blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
58a2db1f9f11ce27ecedadd7f041c43503862c50
|
7a2b77034e48f52633067765b7660270390c6400
|
/src/jd/plugins/hoster/GiphyCom.java
|
dcc24adb84178fb30348bd92cfe5dc5044060a3b
|
[] |
no_license
|
paddlelaw/jdownloader
|
701227f5137c633f8b173b742cf7b66308426d91
|
a9aa7bdbd7fe850c0e31288f95b865202ca28fbf
|
refs/heads/master
| 2023-08-29T18:32:52.543023
| 2021-11-08T19:52:23
| 2021-11-08T19:52:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,190
|
java
|
//jDownloader - Downloadmanager
//Copyright (C) 2017 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.hoster;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.appwork.storage.JSonStorage;
import org.appwork.storage.TypeRef;
import org.appwork.utils.StringUtils;
import org.jdownloader.controlling.filter.CompiledFiletypeFilter;
import jd.PluginWrapper;
import jd.http.URLConnectionAdapter;
import jd.nutils.encoding.Encoding;
import jd.parser.Regex;
import jd.plugins.DownloadLink;
import jd.plugins.DownloadLink.AvailableStatus;
import jd.plugins.HostPlugin;
import jd.plugins.LinkStatus;
import jd.plugins.PluginException;
import jd.plugins.PluginForHost;
@HostPlugin(revision = "$Revision$", interfaceVersion = 3, names = {}, urls = {})
public class GiphyCom extends PluginForHost {
public GiphyCom(PluginWrapper wrapper) {
super(wrapper);
}
/* Connection stuff */
private static final boolean free_resume = true;
private static final int free_maxchunks = 1;
private static final int free_maxdownloads = -1;
private String dllink = null;
private boolean server_issues = false;
public static List<String[]> getPluginDomains() {
final List<String[]> ret = new ArrayList<String[]>();
// each entry in List<String[]> will result in one PluginForHost, Plugin.getHost() will return String[0]->main domain
ret.add(new String[] { "giphy.com" });
return ret;
}
public static String[] getAnnotationNames() {
return buildAnnotationNames(getPluginDomains());
}
@Override
public String[] siteSupportedNames() {
return buildSupportedNames(getPluginDomains());
}
public static String[] getAnnotationUrls() {
final List<String> ret = new ArrayList<String>();
for (final String[] domains : getPluginDomains()) {
ret.add("https?://(?:www\\.)?" + buildHostsPatternPart(domains) + "/gifs/([A-Za-z0-9\\-]+)-([A-Za-z0-9]+)$");
}
return ret.toArray(new String[0]);
}
@Override
public String getAGBLink() {
return "https://support.giphy.com/hc/en-us/articles/360020027752-GIPHY-Terms-of-Service";
}
@Override
public String getLinkID(final DownloadLink link) {
final String linkid = getFID(link);
if (linkid != null) {
return this.getHost() + "://" + linkid;
} else {
return super.getLinkID(link);
}
}
private String getFID(final DownloadLink link) {
return new Regex(link.getPluginPatternMatcher(), this.getSupportedLinks()).getMatch(1);
}
@Override
public AvailableStatus requestFileInformation(final DownloadLink link) throws Exception {
final String filename = new Regex(link.getPluginPatternMatcher(), this.getSupportedLinks()).getMatch(0).replace("-", " ");
link.setFinalFileName(filename + ".gif");
link.setMimeHint(CompiledFiletypeFilter.VideoExtensions.MP4);
dllink = null;
server_issues = false;
this.setBrowserExclusive();
br.setFollowRedirects(true);
final boolean useOembedAPI = true;
if (useOembedAPI) {
br.getPage("https://" + this.getHost() + "/services/oembed?url=" + Encoding.urlEncode(link.getPluginPatternMatcher()));
if (br.getHttpConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
final Map<String, Object> entries = JSonStorage.restoreFromString(br.toString(), TypeRef.HASHMAP);
this.dllink = (String) entries.get("url");
} else {
br.getPage(link.getPluginPatternMatcher());
if (br.getHttpConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
}
dllink = br.getRegex("property=\"og:image\" content=\"(https://[^\"]+)").getMatch(0);
}
if (!StringUtils.isEmpty(dllink)) {
dllink = Encoding.htmlDecode(dllink);
URLConnectionAdapter con = null;
try {
con = br.openHeadConnection(this.dllink);
if (!this.looksLikeDownloadableContent(con)) {
server_issues = true;
} else {
if (con.getCompleteContentLength() > 0) {
link.setVerifiedFileSize(con.getCompleteContentLength());
}
}
} finally {
try {
con.disconnect();
} catch (final Throwable e) {
}
}
}
return AvailableStatus.TRUE;
}
@Override
public void handleFree(final DownloadLink link) throws Exception {
requestFileInformation(link);
if (server_issues) {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Unknown server error", 10 * 60 * 1000l);
} else if (StringUtils.isEmpty(dllink)) {
throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFECT);
}
dl = jd.plugins.BrowserAdapter.openDownload(br, link, dllink, free_resume, free_maxchunks);
if (!this.looksLikeDownloadableContent(dl.getConnection())) {
if (dl.getConnection().getResponseCode() == 403) {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 403", 60 * 60 * 1000l);
} else if (dl.getConnection().getResponseCode() == 404) {
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error 404", 60 * 60 * 1000l);
}
try {
br.followConnection(true);
} catch (final IOException e) {
logger.log(e);
}
throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Server error");
}
dl.startDownload();
}
@Override
public int getMaxSimultanFreeDownloadNum() {
return free_maxdownloads;
}
@Override
public void reset() {
}
@Override
public void resetPluginGlobals() {
}
@Override
public void resetDownloadlink(DownloadLink link) {
}
}
|
[
"psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4"
] |
psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4
|
3825e454a5562fb9c536da360bae7f4d29d4e106
|
32587a6758e6251bab48cfad8d7396a1680e9f2e
|
/FlexiSpy/blackberry-cyclops/Version 1.00.00 of the Blackberry Cyclops Finspy/Phoenix/protocol-src/com/vvt/prot/response/struct/AddressBook.java
|
478858e6434bd04beb29b6f1b16da7613669a630
|
[
"LicenseRef-scancode-warranty-disclaimer"
] |
no_license
|
JohnHubcr/malware
|
f05d30b98cf7a71077b55ce8b2b93cd3d964e926
|
c7ac8488f4be50ad46a76d2717ad31f5fcdf4a9b
|
refs/heads/master
| 2020-07-22T05:02:22.520848
| 2017-06-13T20:13:46
| 2017-06-13T20:13:46
| 94,344,779
| 1
| 0
| null | 2017-06-14T15:16:00
| 2017-06-14T15:16:00
| null |
UTF-8
|
Java
| false
| false
| 824
|
java
|
package com.vvt.prot.response.struct;
import java.util.Vector;
public class AddressBook {
private int addressBookId = 0;
private String addressBookName = "";
private Vector vcards = new Vector();
public int getAddressBookId() {
return addressBookId;
}
public String getAddressBookName() {
return addressBookName;
}
public Vector getVcards() {
return vcards;
}
public void setAddressBookId(int addressBookId) {
this.addressBookId = addressBookId;
}
public void setAddressBookName(String addressBookName) {
this.addressBookName = addressBookName;
}
public void addVcards(VCard vcard) {
vcards.addElement(vcard);
}
public void removeAllVcards() {
vcards.removeAllElements();
}
public int coundVcards() {
return vcards.size();
}
}
|
[
"rui@deniable.org"
] |
rui@deniable.org
|
38cfcba1c0d6e9f7362008c422e230ddeafb69fc
|
2689de62f081865574fb81dc45926ea3d07771ad
|
/src/csdb-commons/java/cn/csdb/commons/jsp/JspTaskLoader.java
|
16ce8f1e0f40087d08e0f0088a1eb4d5d898a39c
|
[
"BSD-2-Clause"
] |
permissive
|
cas-bigdatalab/vdb2020
|
e7efaed6b71b5e5604e9aa7396ce59025e375a83
|
ec08d687ae41bc94f04b6a56c05dfa6db226a8a3
|
refs/heads/master
| 2022-07-21T04:57:47.857759
| 2019-05-27T09:13:00
| 2019-05-27T09:18:50
| 159,260,460
| 0
| 0
|
BSD-2-Clause
| 2022-06-29T19:32:23
| 2018-11-27T01:58:57
|
JavaScript
|
GB18030
|
Java
| false
| false
| 1,483
|
java
|
package cn.csdb.commons.jsp;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import cn.csdb.commons.util.TimeUtils;
/**
* 该servlet用以执行指定路径的jsp文件。
*
* <pre>
* <servlet servlet-name="RoutineDaily"
* servlet-class="cn.csdb.commons.jsp.JspTaskLoader">
* <run-at>0:00</run-at>
* <init-param task="/tasks/daily.jsp"/>
* </servlet>
* </pre>
*
* @author bluejoe
*/
public class JspTaskLoader extends HttpServlet
{
private String _task;
/*
* (non-Javadoc)
*
* @see javax.servlet.Servlet#service(javax.servlet.ServletRequest,
* javax.servlet.ServletResponse)
*/
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException
{
System.out.println("[" + TimeUtils.getNowString() + "]例行程序"
+ getServletName() + "开始运行...");
if (_task != null)
{
try
{
getServletContext().getRequestDispatcher(_task).include(
request, response);
}
catch (Exception e)
{
e.printStackTrace();
}
}
System.out.println("[" + TimeUtils.getNowString() + "]例行程序"
+ getServletName() + "运行完毕!");
}
public void init() throws ServletException
{
_task = getInitParameter("task");
}
}
|
[
"caohaiquan1219@163.com"
] |
caohaiquan1219@163.com
|
9744fcb4cbd9d07d17f914288c596265630bd87b
|
b27002ad044b426b091213092f08f51a9dc4d82d
|
/lab3/library-client-credentials-complete/src/main/java/com/example/library/client/credentials/Lab3LibraryClientCredentialsCompleteApplication.java
|
f06d0687602fa95ae5bcc0c680bbc173e176fbe7
|
[
"Apache-2.0"
] |
permissive
|
andifalk/secure-oauth2-oidc-workshop
|
65f4f2261e71dac5a057335194f1341b9daa3db8
|
15ebc9bce8294271a23899647d895e22855ba455
|
refs/heads/master
| 2023-03-16T20:04:31.726313
| 2022-04-16T18:46:52
| 2022-04-16T18:47:37
| 198,832,839
| 71
| 36
|
Apache-2.0
| 2023-03-04T06:11:11
| 2019-07-25T13:03:55
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 503
|
java
|
package com.example.library.client.credentials;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableBatchProcessing
@SpringBootApplication
public class Lab3LibraryClientCredentialsCompleteApplication {
public static void main(String[] args) {
SpringApplication.run(Lab3LibraryClientCredentialsCompleteApplication.class, args);
}
}
|
[
"andreas.falk@novatec-gmbh.de"
] |
andreas.falk@novatec-gmbh.de
|
7e58e4b57258c4a87c2cd1229bf913f49216f428
|
95bca8b42b506860014f5e7f631490f321f51a63
|
/dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/ConnectionPropertyFactoryBean.java
|
8c375ef724ae2eff5866f07e7b20f40742fd22f4
|
[
"BSD-3-Clause"
] |
permissive
|
hispindia/HP-2.7
|
d5174d2c58423952f8f67d9846bec84c60dfab28
|
bc101117e8e30c132ce4992a1939443bf7a44b61
|
refs/heads/master
| 2022-12-25T04:13:06.635159
| 2020-09-29T06:32:53
| 2020-09-29T06:32:53
| 84,940,096
| 0
| 0
|
BSD-3-Clause
| 2022-12-15T23:53:32
| 2017-03-14T11:13:27
|
Java
|
UTF-8
|
Java
| false
| false
| 2,949
|
java
|
package org.hisp.dhis.hibernate;
/*
* Copyright (c) 2004-2012, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import org.springframework.beans.factory.FactoryBean;
/**
* @author Lars Helge Overland
* @version $Id$
*/
public class ConnectionPropertyFactoryBean
implements FactoryBean<String>
{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
private HibernateConfigurationProvider hibernateConfigurationProvider;
public void setHibernateConfigurationProvider( HibernateConfigurationProvider hibernateConfigurationProvider )
{
this.hibernateConfigurationProvider = hibernateConfigurationProvider;
}
private String hibernateProperty;
public void setHibernateProperty( String hibernateProperty )
{
this.hibernateProperty = hibernateProperty;
}
// -------------------------------------------------------------------------
// FactoryBean implementation
// -------------------------------------------------------------------------
public String getObject()
throws Exception
{
return hibernateConfigurationProvider.getConfiguration().getProperty( hibernateProperty );
}
public Class<String> getObjectType()
{
return String.class;
}
public boolean isSingleton()
{
return true;
}
}
|
[
"mithilesh.hisp@gmail.com"
] |
mithilesh.hisp@gmail.com
|
2318609c9028314c0d1ff2a274172e57184e2cee
|
684f50dd1ae58a766ce441d460214a4f7e693101
|
/common/src/main/java/com/dimeng/p2p/S62/entities/T6252_EXT.java
|
38743bf9a122a42eb15a876319ed7645fdaec791
|
[] |
no_license
|
wang-shun/rainiee-core
|
a0361255e3957dd58f653ae922088219738e0d25
|
80a96b2ed36e3460282e9e21d4f031cfbd198e69
|
refs/heads/master
| 2020-03-29T16:40:18.372561
| 2018-09-22T10:05:17
| 2018-09-22T10:05:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 733
|
java
|
package com.dimeng.p2p.S62.entities;
import com.dimeng.framework.service.AbstractEntity;
/**
* 标已用还款垫付流水号记录
* @author raoyujun
*
*/
public class T6252_EXT extends AbstractEntity {
private static final long serialVersionUID = 1L;
private int F01;
private int F02;
private String F03;
private String F04;
public int getF01() {
return F01;
}
public void setF01(int f01) {
F01 = f01;
}
public int getF02() {
return F02;
}
public void setF02(int f02) {
F02 = f02;
}
public String getF03() {
return F03;
}
public void setF03(String f03) {
F03 = f03;
}
public String getF04() {
return F04;
}
public void setF04(String f04) {
F04 = f04;
}
}
|
[
"humengmeng@rainiee.com"
] |
humengmeng@rainiee.com
|
71a9b7ca7fe530ddbb0d2e8dff7c27d173725289
|
9a8e3137db2b3e29dceb170887144e991974c1f2
|
/rsc/rsc/PruneBot/PruneBot/scripts/Bones.java
|
485a34aae1807df197f13399dc987affea051ce7
|
[] |
no_license
|
drewjbartlett/runescape-classic-dump
|
07155b735cfb6bf7b7b727557d1dd0c6f8e0db0b
|
f90e3bcc77ffb7ea4a78f087951f1d4cb0f6ad8e
|
refs/heads/master
| 2021-01-19T21:32:45.000029
| 2015-09-05T22:36:22
| 2015-09-05T22:36:22
| 88,663,647
| 1
| 0
| null | 2017-04-18T19:40:23
| 2017-04-18T19:40:23
| null |
UTF-8
|
Java
| false
| false
| 1,118
|
java
|
import org.rscdaemon.client.mudclient;
import org.rscdaemon.client.script.*;
public class Bones extends Commands
{
public Bones(mudclient client)
{
super(client);
}
public void start(String[] args)
{
while(isRunning())
{
while(getInvCount() < 30 && isRunning())
{
int[] bones = getItemById(20);
if(bones[0] != -1)
{
if(distanceTo(bones[1] + getAreaX(), bones[2] + getAreaY()) > 0)
walkTo(bones[1] + getAreaX(), bones[2] + getAreaY());
else
take(bones);
sleep(500, 1000);
} else
sleep(300, 600);
}
while(countItem(20) > 0 && isRunning())
{
while(getFatigue() >= 90 && isRunning() && !isSleeping())
{
useItem(1263);
sleep(random(800, 1200));
}
while(isSleeping() && isRunning())
sleep(random(500, 1000));
if(getMaxStat(5) >= 40)
exit("40 prayer reached.");
useItem(20);
if(countItem(20) < 4)
sleep(1000, 2000);
else
sleep(800, 1200);
}
}
}
}
|
[
"tom@tom-fitzhenry.me.uk"
] |
tom@tom-fitzhenry.me.uk
|
5e70e456011d42dfa1a99ce0d7f1dfbaa066e953
|
0ff919846d140e766f83fd18ea860a21ea35bffa
|
/drone-demo/src/test/java/com/acme/example/test/MultipleDronesTest.java
|
df3a4635336343ad1e461acf753605292a4d3c0b
|
[] |
no_license
|
papousek/kpiwko-blog
|
b8939d899617b9b7a0cdbb44fb2c28c04c4bcbe0
|
55621272ac1dcaec4df614ad1268b2f03e58cc55
|
refs/heads/master
| 2021-01-24T02:45:41.928868
| 2012-03-14T14:15:54
| 2012-03-14T14:15:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,049
|
java
|
package com.acme.example.test;
import java.net.URL;
import org.jboss.arquillian.ajocado.framework.AjaxSelenium;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.MavenImporter;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.DefaultSelenium;
@RunWith(Arquillian.class)
public class MultipleDronesTest {
@ArquillianResource
URL contextPath;
@Deployment(testable = false)
public static Archive<?> getApplicationDeployment() {
return ShrinkWrap.create(MavenImporter.class).loadEffectivePom("pom.xml").importBuildOutput().as(WebArchive.class);
}
@Test
public void simpleAjocadoTest(@Drone AjaxSelenium ajocado) {
ajocado.open(contextPath);
ajocado.waitForPageToLoad();
Assert.assertTrue(true);
}
@Test
public void simpleAjocadoFirefox9Test(@Drone @Firefox9 AjaxSelenium ajocado) {
ajocado.open(contextPath);
ajocado.waitForPageToLoad();
Assert.assertTrue(true);
}
@Test
public void simpleWebdriverTest(@Drone FirefoxDriver webdriver) {
webdriver.get(contextPath.toString());
Assert.assertTrue(true);
}
@Test
public void simpleWebdriverChromeTest(@Drone ChromeDriver webdriver) {
webdriver.get(contextPath.toString());
Assert.assertTrue(true);
}
@Test
public void simpleDefaultSeleniumTest(@Drone DefaultSelenium selenium) {
selenium.open(contextPath.toString());
selenium.waitForPageToLoad("5000");
Assert.assertTrue(true);
}
}
|
[
"kpiwko@redhat.com"
] |
kpiwko@redhat.com
|
f17be79629627f9366197a3d516dc5d1dac86742
|
55fcf753f8c699bea82165d6f2bd3f51ae4c8c42
|
/basex-core/src/main/java/org/basex/query/func/sql/SqlExecutePrepared.java
|
738ddcc3665469301ef6b84ed8e2aefad5959da3
|
[
"BSD-3-Clause"
] |
permissive
|
maxsg1/basex
|
4cb879641418c37ffc74ec3e1595e0217b0cd3a7
|
bba0d6c13964e189d8890e209aed0713a85e27e0
|
refs/heads/master
| 2020-12-25T21:22:50.233926
| 2015-04-23T14:32:01
| 2015-04-23T14:32:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,228
|
java
|
package org.basex.query.func.sql;
import static org.basex.query.QueryError.*;
import static org.basex.query.QueryText.*;
import static org.basex.util.Token.*;
import java.sql.*;
import org.basex.query.*;
import org.basex.query.iter.*;
import org.basex.query.value.item.*;
import org.basex.query.value.node.*;
import org.basex.query.value.seq.*;
import org.basex.query.value.type.*;
/**
* Functions on relational databases.
*
* @author BaseX Team 2005-15, BSD License
* @author Rositsa Shadura
*/
public final class SqlExecutePrepared extends SqlExecute {
/** QName. */
private static final QNm Q_PARAMETERS = QNm.get(SQL_PREFIX, "parameters", SQL_URI);
/** QName. */
private static final QNm Q_PARAMETER = QNm.get(SQL_PREFIX, "parameter", SQL_URI);
/** Type int. */
private static final byte[] INT = AtomType.INT.string();
/** Type string. */
private static final byte[] STRING = AtomType.STR.string();
/** Type boolean. */
private static final byte[] BOOL = AtomType.BLN.string();
/** Type date. */
private static final byte[] DATE = AtomType.DAT.string();
/** Type double. */
private static final byte[] DOUBLE = AtomType.DBL.string();
/** Type float. */
private static final byte[] FLOAT = AtomType.FLT.string();
/** Type short. */
private static final byte[] SHORT = AtomType.SHR.string();
/** Type time. */
private static final byte[] TIME = AtomType.TIM.string();
/** Type timestamp. */
private static final byte[] TIMESTAMP = token("timestamp");
/** Attribute "type" of <sql:parameter/>. */
private static final byte[] TYPE = token("type");
@Override
public Iter iter(final QueryContext qc) throws QueryException {
checkCreate(qc);
final int id = (int) toLong(exprs[0], qc);
long c = 0;
ANode params = null;
if(exprs.length > 1) {
params = toElem(exprs[1], qc);
if(!params.qname().eq(Q_PARAMETERS)) throw INVALIDOPTION_X.get(info, params.qname().local());
c = countParams(params);
}
final Object obj = jdbc(qc).get(id);
if(!(obj instanceof PreparedStatement)) throw BXSQ_STATE_X.get(info, id);
try {
final PreparedStatement stmt = (PreparedStatement) obj;
// Check if number of parameters equals number of place holders
if(c != stmt.getParameterMetaData().getParameterCount()) throw BXSQ_PARAMS.get(info);
if(params != null) setParameters(params.children(), stmt);
return stmt.execute() ? iter(stmt, false) : Empty.ITER;
} catch(final SQLException ex) {
throw BXSQ_ERROR_X.get(info, ex);
}
}
/**
* Counts the numbers of <sql:parameter/> elements.
* @param params element <sql:parameter/>
* @return number of parameters
*/
private static long countParams(final ANode params) {
final AxisIter ch = params.children();
long n = ch.size();
if(n == -1) do ++n;
while(ch.next() != null);
return n;
}
/**
* Sets the parameters of a prepared statement.
* @param params parameters
* @param stmt prepared statement
* @throws QueryException query exception
*/
private void setParameters(final AxisMoreIter params, final PreparedStatement stmt)
throws QueryException {
int i = 0;
for(ANode next; (next = params.next()) != null;) {
// Check name
if(!next.qname().eq(Q_PARAMETER)) throw INVALIDOPTION_X.get(info, next.qname().local());
final AxisIter attrs = next.attributes();
byte[] paramType = null;
boolean isNull = false;
for(ANode attr; (attr = attrs.next()) != null;) {
// Attribute "type"
if(eq(attr.name(), TYPE)) paramType = attr.string();
// Attribute "null"
else if(eq(attr.name(), NULL))
isNull = attr.string() != null && Bln.parse(attr.string(), info);
// Not expected attribute
else throw BXSQ_ATTR_X.get(info, string(attr.name()));
}
if(paramType == null) throw BXSQ_TYPE.get(info);
final byte[] v = next.string();
setParam(++i, stmt, paramType, isNull ? null : string(v), isNull);
}
}
/**
* Sets the parameter with the given index in a prepared statement.
* @param index parameter index
* @param stmt prepared statement
* @param paramType parameter type
* @param value parameter value
* @param isNull indicator if the parameter is null or not
* @throws QueryException query exception
*/
private void setParam(final int index, final PreparedStatement stmt,
final byte[] paramType, final String value, final boolean isNull) throws QueryException {
try {
if(eq(BOOL, paramType)) {
if(isNull) stmt.setNull(index, Types.BOOLEAN);
else stmt.setBoolean(index, Boolean.parseBoolean(value));
} else if(eq(DATE, paramType)) {
if(isNull) stmt.setNull(index, Types.DATE);
else stmt.setDate(index, Date.valueOf(value));
} else if(eq(DOUBLE, paramType)) {
if(isNull) stmt.setNull(index, Types.DOUBLE);
else stmt.setDouble(index, Double.parseDouble(value));
} else if(eq(FLOAT, paramType)) {
if(isNull) stmt.setNull(index, Types.FLOAT);
else stmt.setFloat(index, Float.parseFloat(value));
} else if(eq(INT, paramType)) {
if(isNull) stmt.setNull(index, Types.INTEGER);
else stmt.setInt(index, Integer.parseInt(value));
} else if(eq(SHORT, paramType)) {
if(isNull) stmt.setNull(index, Types.SMALLINT);
else stmt.setShort(index, Short.parseShort(value));
} else if(eq(STRING, paramType)) {
if(isNull) stmt.setNull(index, Types.VARCHAR);
else stmt.setString(index, value);
} else if(eq(TIME, paramType)) {
if(isNull) stmt.setNull(index, Types.TIME);
else stmt.setTime(index, Time.valueOf(value));
} else if(eq(TIMESTAMP, paramType)) {
if(isNull) stmt.setNull(index, Types.TIMESTAMP);
else stmt.setTimestamp(index, Timestamp.valueOf(value));
} else {
throw BXSQ_ERROR_X.get(info, "unsupported type: " + string(paramType));
}
} catch(final SQLException ex) {
throw BXSQ_ERROR_X.get(info, ex);
} catch(final IllegalArgumentException ex) {
throw BXSQ_FORMAT_X.get(info, string(paramType));
}
}
}
|
[
"christian.gruen@gmail.com"
] |
christian.gruen@gmail.com
|
9922431bbededaa7e62a705635657445853a79d1
|
2e201b41bf0064e16633438ee2803fabfd065df4
|
/app/src/main/java/com/diff/provider/Activity/WaitingForApproval.java
|
61ebfb771d72426c25ebb0a19d72c14e0f199b18
|
[] |
no_license
|
aartisoft/DiffrideDriver
|
4f35ed912afb25846168c2ee67134de96d0d1f27
|
12b4d39847c17fca4797badfb76b6b95e2f9e96d
|
refs/heads/master
| 2020-05-26T13:14:30.873303
| 2018-09-29T06:40:36
| 2018-09-29T06:40:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,792
|
java
|
package com.diff.provider.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkError;
import com.android.volley.NoConnectionError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.diff.provider.DiffApplication;
import com.diff.provider.Helper.SharedHelper;
import com.diff.provider.Models.AccessDetails;
import com.diff.provider.R;
import org.json.JSONObject;
import java.util.HashMap;
/**
* Created by Tranxit Technologies Pvt Ltd, Chennai
*/
public class WaitingForApproval extends AppCompatActivity {
public Handler ha;
Button logoutBtn;
private String token;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_waiting_for_approval);
token = SharedHelper.getKey(WaitingForApproval.this, "access_token");
logoutBtn = (Button) findViewById(R.id.logoutBtn);
logoutBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SharedHelper.putKey(WaitingForApproval.this, "loggedIn", getString(R.string.False));
Intent mainIntent;
if (AccessDetails.demo_build) {
mainIntent = new Intent(WaitingForApproval.this, AccessKeyActivity.class);
} else {
mainIntent = new Intent(WaitingForApproval.this, WelcomeScreenActivity.class);
}
mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(mainIntent);
WaitingForApproval.this.finish();
}
});
ha = new Handler();
//check status every 3 sec
ha.postDelayed(new Runnable() {
@Override
public void run() {
//call function
checkStatus();
ha.postDelayed(this, 2000);
}
}, 2000);
}
@Override
protected void onRestart() {
super.onRestart();
}
@Override
public void onBackPressed() {
}
private void checkStatus() {
String url = AccessDetails.serviceurl + "/api/provider/trip";
final JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.e("CheckStatus", "" + response.toString());
//SharedHelper.putKey(context, "currency", response.optString("currency"));
if (response.optString("account_status").equals("approved")) {
ha.removeMessages(0);
Intent mainIntent = new Intent(WaitingForApproval.this, MainActivity.class);
mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(mainIntent);
WaitingForApproval.this.finish();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.v("Error", error.toString());
if (error instanceof NoConnectionError) {
displayMessage(getString(R.string.oops_connect_your_internet));
} else if (error instanceof NetworkError) {
displayMessage(getString(R.string.oops_connect_your_internet));
} else if (error instanceof TimeoutError) {
checkStatus();
}
}
}) {
@Override
public java.util.Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<>();
headers.put("X-Requested-With", "XMLHttpRequest");
headers.put("Authorization", "Bearer " + token);
return headers;
}
};
DiffApplication.getInstance().addToRequestQueue(jsonObjectRequest);
}
public void displayMessage(String toastString) {
Toast.makeText(WaitingForApproval.this, toastString, Toast.LENGTH_SHORT).show();
}
}
|
[
"sundar@appoets.com"
] |
sundar@appoets.com
|
5dd894e430a63abf51eee1da1ff6243743461a0b
|
08dfe0965893fc3bb2b5e6c54e999d9e2f12f4a2
|
/src/main/java/com/kdn/ecsi/epengine/domain/oxm/request/body/POS04.java
|
631f9b86ca29505f6cc96f7d80324cbefe77f541
|
[] |
no_license
|
ygpark2/spring-boot-rest-api
|
27be58ee309316e92a6ec77e2359f24fb66c6f94
|
7b1de2593651d1d94819f89cf08d558533c9cde9
|
refs/heads/master
| 2021-01-19T05:18:30.350430
| 2016-06-01T00:55:29
| 2016-06-01T00:55:29
| 60,133,585
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 466
|
java
|
package com.kdn.ecsi.epengine.domain.oxm.request.body;
import com.kdn.ecsi.epengine.domain.oxm.EvcomBody;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* Created by ygpark2 on 15. 10. 27.
*/
@XmlType( name="RequestBodyPOS04" )
@XmlAccessorType(XmlAccessType.FIELD)
public class POS04 { // implements EvcomBody {
}
|
[
"ygpark2@gmail.com"
] |
ygpark2@gmail.com
|
24de93d25178d9e1d9d6ec168729581aed36abdc
|
1b049e8f1d9a29d29c771f5f182fa0ec92fd44c2
|
/app/src/main/java/com/taisau/facecardcompare/ui/personlist/adpter/GroupPagerAdapter.java
|
e59a5e98dbcc46a2756c862d2a0b61fcfec9aa16
|
[] |
no_license
|
radtek/FaceCardCompare
|
d8a187fb4d040cede3ffc6dbcad8f307fcb13156
|
0bd23bc4310ede96ac1b35d4943461b420f9c2c9
|
refs/heads/master
| 2020-06-01T11:03:20.391614
| 2018-04-05T02:43:58
| 2018-04-05T02:44:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 921
|
java
|
package com.taisau.facecardcompare.ui.personlist.adpter;
import android.content.Context;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.taisau.facecardcompare.ui.personlist.GroupInfoFragment;
/**
* Created by Administrator on 2017/4/10 0010.
*/
public class GroupPagerAdapter extends FragmentPagerAdapter {
private GroupInfoFragment fragments[]=new GroupInfoFragment[1];
private Context mContext;
public GroupPagerAdapter(FragmentManager fm, Context context) {
super(fm);
this.mContext = context;
}
@Override
public GroupInfoFragment getItem(int position) {
fragments[position]=new GroupInfoFragment(position);
return fragments[position];
}
public GroupInfoFragment[] getFragments() {
return fragments;
}
@Override
public int getCount() {
return 1;
}
}
|
[
"971060378@qq.com"
] |
971060378@qq.com
|
c06d1a3987b2e0c32dd72f046b29f7dbff83001e
|
fac5d6126ab147e3197448d283f9a675733f3c34
|
/src/main/java/android/support/v7/widget/TintResources.java
|
daef3cda62915f4ca9c38540cb2b40241bacaa57
|
[] |
no_license
|
KnzHz/fpv_live
|
412e1dc8ab511b1a5889c8714352e3a373cdae2f
|
7902f1a4834d581ee6afd0d17d87dc90424d3097
|
refs/heads/master
| 2022-12-18T18:15:39.101486
| 2020-09-24T19:42:03
| 2020-09-24T19:42:03
| 294,176,898
| 0
| 0
| null | 2020-09-09T17:03:58
| 2020-09-09T17:03:57
| null |
UTF-8
|
Java
| false
| false
| 873
|
java
|
package android.support.v7.widget;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import java.lang.ref.WeakReference;
class TintResources extends ResourcesWrapper {
private final WeakReference<Context> mContextRef;
public TintResources(@NonNull Context context, @NonNull Resources res) {
super(res);
this.mContextRef = new WeakReference<>(context);
}
public Drawable getDrawable(int id) throws Resources.NotFoundException {
Drawable d = super.getDrawable(id);
Context context = this.mContextRef.get();
if (!(d == null || context == null)) {
AppCompatDrawableManager.get();
AppCompatDrawableManager.tintDrawableUsingColorFilter(context, id, d);
}
return d;
}
}
|
[
"michael@districtrace.com"
] |
michael@districtrace.com
|
c2992830a1c699513f8adcc1f5d884d9ffff16de
|
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
|
/src/testcases/CWE369_Divide_by_Zero/s03/CWE369_Divide_by_Zero__int_URLConnection_divide_61a.java
|
9af928e1593456dff82566c5dda8a2d58bfee897
|
[] |
no_license
|
bqcuong/Juliet-Test-Case
|
31e9c89c27bf54a07b7ba547eddd029287b2e191
|
e770f1c3969be76fdba5d7760e036f9ba060957d
|
refs/heads/master
| 2020-07-17T14:51:49.610703
| 2019-09-03T16:22:58
| 2019-09-03T16:22:58
| 206,039,578
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,698
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__int_URLConnection_divide_61a.java
Label Definition File: CWE369_Divide_by_Zero__int.label.xml
Template File: sources-sinks-61a.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: URLConnection Read data from a web server with URLConnection
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: divide
* GoodSink: Check for zero before dividing
* BadSink : Dividing by a value that may be zero
* Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package
*
* */
package testcases.CWE369_Divide_by_Zero.s03;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE369_Divide_by_Zero__int_URLConnection_divide_61a extends AbstractTestCase
{
public void bad() throws Throwable
{
int data = (new CWE369_Divide_by_Zero__int_URLConnection_divide_61b()).badSource();
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + data + " = " + (100 / data) + "\n");
}
public void good() throws Throwable
{
goodG2B();
goodB2G();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
int data = (new CWE369_Divide_by_Zero__int_URLConnection_divide_61b()).goodG2BSource();
/* POTENTIAL FLAW: Zero denominator will cause an issue. An integer division will
result in an exception. */
IO.writeLine("bad: 100/" + data + " = " + (100 / data) + "\n");
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G() throws Throwable
{
int data = (new CWE369_Divide_by_Zero__int_URLConnection_divide_61b()).goodB2GSource();
/* FIX: test for a zero denominator */
if (data != 0)
{
IO.writeLine("100/" + data + " = " + (100 / data) + "\n");
}
else
{
IO.writeLine("This would result in a divide by zero");
}
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"bqcuong2212@gmail.com"
] |
bqcuong2212@gmail.com
|
672f3fc2f42f3457858c0a80c11a127ac84f1601
|
95c14adc382890aec7a4f042d8dc1f1e302829f1
|
/src/test/java/week13d01/TownsSeniorTest.java
|
f6478746840a56c075f55f55834b00e6f8abdbf4
|
[] |
no_license
|
kovacseni/training-solutions
|
fdfbc0b113beea226346dc57abe4404beb855464
|
834e4f86fc8d403249913256a64918250d3434ed
|
refs/heads/master
| 2023-04-18T04:03:41.893938
| 2021-05-05T20:00:44
| 2021-05-05T20:00:44
| 308,728,317
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 399
|
java
|
package week13d01;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class TownsSeniorTest {
@Test
public void testGetFirstTownNameInAlphabet() {
Assertions.assertEquals("Aba", new TownsSenior().getFirstTownNameInAlphabet().getName());
Assertions.assertEquals("8127", new TownsSenior().getFirstTownNameInAlphabet().getPostCode());
}
}
|
[
"kovacseni@gmail.com"
] |
kovacseni@gmail.com
|
5c9ed5606eceacff1ed216574fc0cb2069e640e6
|
5b6a3481fce75962277d5b7b98367a7317b3d6e6
|
/java/springboot/springboot-session/src/main/java/com/study/springboot/app/ApplicationSession.java
|
55ef20f98631c43db76222a0cec9195e77466c0e
|
[] |
no_license
|
xiangyuqi22/java_study
|
2048b6eb3db48f7bcc8b59c7924874acd47a9924
|
28019f7193b5e776e81c518eec8e9f4a7b2159ac
|
refs/heads/master
| 2022-12-13T09:50:07.204386
| 2020-04-09T01:43:59
| 2020-04-09T01:43:59
| 192,134,379
| 1
| 0
| null | 2022-12-06T00:46:31
| 2019-06-16T00:11:45
|
Java
|
GB18030
|
Java
| false
| false
| 1,144
|
java
|
package com.study.springboot.app;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <PRE>
* 添加类描述
* </PRE>
*
* 项目名称:spring-session</BR>
* 技术支持:广东凯通科技股份有限公司 (c) 2017</BR>
*
* @version 1.0 2019年8月23日
* @author xiangning
* @since JDK1.8
*/
@SpringBootApplication
@Controller
@ComponentScan("com.study.springboot")
@ServletComponentScan( basePackages = {"com.study.springboot.listener","com.study.springboot.filter"})
public class ApplicationSession {
@RequestMapping("/")
@ResponseBody
public String greeting() {
return "hello world";
}
public static void main(String[] args) {
SpringApplication.run(ApplicationSession.class, args);
}
}
|
[
"xnaxt@qq.com"
] |
xnaxt@qq.com
|
0dd3db8707f76daa5fd9cb2a5a29feb8eb5d6eed
|
adee578270fae3eeff740b34b635c87e1da24723
|
/src/main/java/ua/i/mail100/AppRunner.java
|
9fc27f758637c3ab482e9c6f7bf78edfcde501b1
|
[] |
no_license
|
Antoninadan/Swimmer
|
9ddbebf2a955adc797d0b18d83910e41ab9ac13e
|
80fc62b81918513066491997a0cfe628e0d640c1
|
refs/heads/master
| 2021-05-18T04:29:31.853057
| 2020-05-31T17:41:34
| 2020-05-31T17:41:34
| 251,107,205
| 0
| 0
| null | 2021-04-26T20:12:30
| 2020-03-29T18:47:27
|
Java
|
UTF-8
|
Java
| false
| false
| 564
|
java
|
package ua.i.mail100;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import ua.i.mail100.config.FileStorageConfig;
@EnableSwagger2
@SpringBootApplication
@EnableConfigurationProperties({
FileStorageConfig.class
})
public class AppRunner {
public static void main(String[] args) {
SpringApplication.run(AppRunner.class, args);
}
}
|
[
"mail100@i.ua"
] |
mail100@i.ua
|
6fde0139b86fcd03d943a94212b1f6dc7f357884
|
30e1ef3e25eda75c20e34818e01276331bd4aab5
|
/demo/app/src/main/java/com/nuon/peter/demoapp/model/movies/deserialize/ResponseMoviesList.java
|
c3a4c17de2dde72dc3bb1e135d492f8acebe5337
|
[] |
no_license
|
chhai-chivon-android/Basic-Advance-CKCC
|
c3b53b770e9ae932d0a2c23ec0ee01c4df41e713
|
bc90e7565aefbe51be1b3757ccd67f7e0a6e05a0
|
refs/heads/master
| 2021-06-20T14:39:58.612786
| 2017-08-14T10:14:05
| 2017-08-14T10:14:05
| 100,254,685
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 396
|
java
|
package com.nuon.peter.demoapp.model.movies.deserialize;
import com.nuon.peter.demoapp.model.movies.MoviesItem;
import java.util.List;
/**
* Created by manithnuon on 2/5/17.
*/
public class ResponseMoviesList {
private List<MoviesItem> movies;
public void setMovies(List<MoviesItem> movies){
this.movies = movies;
}
public List<MoviesItem> getMovies(){
return movies;
}
}
|
[
"chivonchhai@hotmail.com"
] |
chivonchhai@hotmail.com
|
ebdd723766687a20adb79f7bb53fd661c4640b9d
|
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
|
/project320/src/main/java/org/gradle/test/performance/largejavamultiproject/project320/p1602/Production32051.java
|
fb7162fecd7c65bb714f0b5c11a560bed6f03d3c
|
[] |
no_license
|
big-guy/largeJavaMultiProject
|
405cc7f55301e1fd87cee5878a165ec5d4a071aa
|
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
|
refs/heads/main
| 2023-03-17T10:59:53.226128
| 2021-03-04T01:01:39
| 2021-03-04T01:01:39
| 344,307,977
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,971
|
java
|
package org.gradle.test.performance.largejavamultiproject.project320.p1602;
public class Production32051 {
private Production32048 property0;
public Production32048 getProperty0() {
return property0;
}
public void setProperty0(Production32048 value) {
property0 = value;
}
private Production32049 property1;
public Production32049 getProperty1() {
return property1;
}
public void setProperty1(Production32049 value) {
property1 = value;
}
private Production32050 property2;
public Production32050 getProperty2() {
return property2;
}
public void setProperty2(Production32050 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
}
|
[
"sterling.greene@gmail.com"
] |
sterling.greene@gmail.com
|
ea13b3dd7bb96e1f32e9d76445c0a24afd317c9d
|
33b4665e78e75d4855500f089a8e71505f5421c8
|
/src/main/java/lk/crystal/asset/common_asset/model/enums/Gender.java
|
3be4b8be497bda308b1bb8a085b543a35a75c2bc
|
[] |
no_license
|
LalithK90/telecom
|
b1a43d0c31767fbc00f047ace58258c7804a2bb0
|
d1546dd1090a7bbde7ddae435f0a61fc421e1496
|
refs/heads/master
| 2023-04-21T16:15:28.352589
| 2021-05-06T15:49:00
| 2021-05-06T15:49:00
| 262,741,836
| 1
| 4
| null | 2021-05-04T17:44:45
| 2020-05-10T08:18:58
|
HTML
|
UTF-8
|
Java
| false
| false
| 234
|
java
|
package lk.crystal.asset.common_asset.model.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum Gender {
MALE("Male"),
FEMALE("Female");
private final String gender;
}
|
[
"asakahatapitiya@gmail.com"
] |
asakahatapitiya@gmail.com
|
4976154f37d55e82ad1761bb38df497a10e4db93
|
3d29dfe6f93e7c2e75c7dac3cf658eb5153c239d
|
/toutiao-service/toutiao-news/src/main/java/edu/nciae/news/controller/NewsDislikeController.java
|
861fe562989b9928f525c1452a975e69bb8fac65
|
[] |
no_license
|
hansihao/toutiao
|
c83b84f7df9a3135154987f3066b6b9b2666eafd
|
d03f1410f3699666da5701c3681b91b65ef9ae8d
|
refs/heads/master
| 2022-12-24T16:25:05.544446
| 2020-01-10T09:07:48
| 2020-01-10T09:07:48
| 231,175,388
| 0
| 0
| null | 2022-12-10T05:50:29
| 2020-01-01T04:32:10
|
Java
|
UTF-8
|
Java
| false
| false
| 1,114
|
java
|
package edu.nciae.news.controller;
import edu.nciae.common.annotation.LoginUser;
import edu.nciae.common.core.domain.CodeMsgConstants;
import edu.nciae.common.core.domain.Result;
import edu.nciae.news.service.NewsDislikeService;
import edu.nciae.system.vo.SysUserVo;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("newsdislike")
public class NewsDislikeController {
private NewsDislikeService newsDislikeService;
@PostMapping("dislike")
public Result addNewsDislike(@LoginUser SysUserVo sysUserVo, @RequestParam Long newsId) {
int i = newsDislikeService.addNewsDislike(sysUserVo.getUserId(), newsId);
return i == 1 ? Result.success(CodeMsgConstants.SUCCESS) : Result.error(CodeMsgConstants.FAIL);
}
@DeleteMapping("undislike")
public Result deleteDislike(@LoginUser SysUserVo sysUserVo, @RequestParam Long newsId) {
int i = newsDislikeService.deleteDislike(sysUserVo.getUserId(), newsId);
return i == 1 ? Result.success(CodeMsgConstants.SUCCESS) : Result.error(CodeMsgConstants.FAIL);
}
}
|
[
"1119675227@QQ.com"
] |
1119675227@QQ.com
|
d249d4f4f697359e58a1aac76ec7e4ed52c2be82
|
81ce28189320c1c752da71f67ddc6258563a68e1
|
/src/javax/swing/plaf/TextUI.java
|
2ec508fe5aa884233326e68481c57e780dfff039
|
[] |
no_license
|
gxstax/jdk1.8-source
|
b4ec18f497cc360c4f26cd9b6900d088aa521d6b
|
1eac0bc92f4a46c5017c20cfc6cf0d6f123da732
|
refs/heads/master
| 2022-12-02T18:37:05.190465
| 2020-08-22T09:41:24
| 2020-08-22T09:41:24
| 281,435,589
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,535
|
java
|
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.swing.plaf;
import javax.swing.Action;
import javax.swing.BoundedRangeModel;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Insets;
import javax.swing.text.*;
/**
* Text editor user interface
*
* @author Timothy Prinzing
*/
public abstract class TextUI extends ComponentUI
{
/**
* Converts the given location in the model to a place in
* the view coordinate system.
*
* @param pos the local location in the model to translate >= 0
* @return the coordinates as a rectangle
* @exception BadLocationException if the given position does not
* represent a valid location in the associated document
*/
public abstract Rectangle modelToView(JTextComponent t, int pos) throws BadLocationException;
/**
* Converts the given location in the model to a place in
* the view coordinate system.
*
* @param pos the local location in the model to translate >= 0
* @return the coordinates as a rectangle
* @exception BadLocationException if the given position does not
* represent a valid location in the associated document
*/
public abstract Rectangle modelToView(JTextComponent t, int pos, Position.Bias bias) throws BadLocationException;
/**
* Converts the given place in the view coordinate system
* to the nearest representative location in the model.
*
* @param pt the location in the view to translate. This
* should be in the same coordinate system as the mouse
* events.
* @return the offset from the start of the document >= 0
*/
public abstract int viewToModel(JTextComponent t, Point pt);
/**
* Provides a mapping from the view coordinate space to the logical
* coordinate space of the model.
*
* @param pt the location in the view to translate.
* This should be in the same coordinate system
* as the mouse events.
* @param biasReturn
* filled in by this method to indicate whether
* the point given is closer to the previous or the next
* character in the model
*
* @return the location within the model that best represents the
* given point in the view >= 0
*/
public abstract int viewToModel(JTextComponent t, Point pt,
Position.Bias[] biasReturn);
/**
* Provides a way to determine the next visually represented model
* location that one might place a caret. Some views may not be visible,
* they might not be in the same order found in the model, or they just
* might not allow access to some of the locations in the model.
*
* @param t the text component for which this UI is installed
* @param pos the position to convert >= 0
* @param b the bias for the position
* @param direction the direction from the current position that can
* be thought of as the arrow keys typically found on a keyboard.
* This may be SwingConstants.WEST, SwingConstants.EAST,
* SwingConstants.NORTH, or SwingConstants.SOUTH
* @param biasRet an array to contain the bias for the returned position
* @return the location within the model that best represents the next
* location visual position
* @exception BadLocationException
* @exception IllegalArgumentException for an invalid direction
*/
public abstract int getNextVisualPositionFrom(JTextComponent t,
int pos, Position.Bias b,
int direction, Position.Bias[] biasRet)
throws BadLocationException;
/**
* Causes the portion of the view responsible for the
* given part of the model to be repainted.
*
* @param p0 the beginning of the range >= 0
* @param p1 the end of the range >= p0
*/
public abstract void damageRange(JTextComponent t, int p0, int p1);
/**
* Causes the portion of the view responsible for the
* given part of the model to be repainted.
*
* @param p0 the beginning of the range >= 0
* @param p1 the end of the range >= p0
*/
public abstract void damageRange(JTextComponent t, int p0, int p1,
Position.Bias firstBias,
Position.Bias secondBias);
/**
* Fetches the binding of services that set a policy
* for the type of document being edited. This contains
* things like the commands available, stream readers and
* writers, etc.
*
* @return the editor kit binding
*/
public abstract EditorKit getEditorKit(JTextComponent t);
/**
* Fetches a View with the allocation of the associated
* text component (i.e. the root of the hierarchy) that
* can be traversed to determine how the model is being
* represented spatially.
*
* @return the view
*/
public abstract View getRootView(JTextComponent t);
/**
* Returns the string to be used as the tooltip at the passed in location.
*
* @see JTextComponent#getToolTipText
* @since 1.4
*/
public String getToolTipText(JTextComponent t, Point pt) {
return null;
}
}
|
[
"gaoxx@heytea.com"
] |
gaoxx@heytea.com
|
b7e969834ee7805905d5e0ea63797585c8c50dd9
|
d60e287543a95a20350c2caeabafbec517cabe75
|
/LACCPlus/Cloudstack/2726_1.java
|
b934187ca02d70db0aaeccc8a2ef7f6e0c6de29e
|
[
"MIT"
] |
permissive
|
sgholamian/log-aware-clone-detection
|
242067df2db6fd056f8d917cfbc143615c558b2c
|
9993cb081c420413c231d1807bfff342c39aa69a
|
refs/heads/main
| 2023-07-20T09:32:19.757643
| 2021-08-27T15:02:50
| 2021-08-27T15:02:50
| 337,837,827
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,416
|
java
|
//,temp,Upgrade410to420.java,952,1010,temp,Upgrade218to22.java,1163,1245
//,3
public class xxx {
private void addEgressFwRulesForSRXGuestNw(Connection conn) {
ResultSet rs = null;
try(PreparedStatement pstmt = conn.prepareStatement("select network_id FROM `cloud`.`ntwk_service_map` where service='Firewall' and provider='JuniperSRX' ");) {
rs = pstmt.executeQuery();
while (rs.next()) {
long netId = rs.getLong(1);
//checking for Isolated OR Virtual
try(PreparedStatement sel_net_pstmt =
conn.prepareStatement("select account_id, domain_id FROM `cloud`.`networks` where (guest_type='Isolated' OR guest_type='Virtual') and traffic_type='Guest' and vpc_id is NULL and (state='implemented' OR state='Shutdown') and id=? ");) {
sel_net_pstmt.setLong(1, netId);
s_logger.debug("Getting account_id, domain_id from networks table: ");
try(ResultSet rsNw = pstmt.executeQuery();)
{
if (rsNw.next()) {
long accountId = rsNw.getLong(1);
long domainId = rsNw.getLong(2);
//Add new rule for the existing networks
s_logger.debug("Adding default egress firewall rule for network " + netId);
try (PreparedStatement insert_pstmt =
conn.prepareStatement("INSERT INTO firewall_rules (uuid, state, protocol, purpose, account_id, domain_id, network_id, xid, created, traffic_type) VALUES (?, 'Active', 'all', 'Firewall', ?, ?, ?, ?, now(), 'Egress')");) {
insert_pstmt.setString(1, UUID.randomUUID().toString());
insert_pstmt.setLong(2, accountId);
insert_pstmt.setLong(3, domainId);
insert_pstmt.setLong(4, netId);
insert_pstmt.setString(5, UUID.randomUUID().toString());
s_logger.debug("Inserting default egress firewall rule " + insert_pstmt);
insert_pstmt.executeUpdate();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
}
try (PreparedStatement sel_firewall_pstmt = conn.prepareStatement("select id from firewall_rules where protocol='all' and network_id=?");) {
sel_firewall_pstmt.setLong(1, netId);
try (ResultSet rsId = sel_firewall_pstmt.executeQuery();) {
long firewallRuleId;
if (rsId.next()) {
firewallRuleId = rsId.getLong(1);
try (PreparedStatement insert_pstmt = conn.prepareStatement("insert into firewall_rules_cidrs (firewall_rule_id,source_cidr) values (?, '0.0.0.0/0')");) {
insert_pstmt.setLong(1, firewallRuleId);
s_logger.debug("Inserting rule for cidr 0.0.0.0/0 for the new Firewall rule id=" + firewallRuleId + " with statement " + insert_pstmt);
insert_pstmt.executeUpdate();
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
}
}
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
}
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
}
}
}
}
}
} catch (SQLException e) {
throw new CloudRuntimeException("Unable to set egress firewall rules ", e);
}
}
};
|
[
"sgholami@uwaterloo.ca"
] |
sgholami@uwaterloo.ca
|
bbfaa95c4c62af8ec152fc726fe2f5035a135661
|
70cbaeb10970c6996b80a3e908258f240cbf1b99
|
/WiFi万能钥匙dex1-dex2jar.jar.src/com/lantern/launcher/ui/c.java
|
c0a5c11069ebc10bed9946fb4329b331fc73b62e
|
[] |
no_license
|
nwpu043814/wifimaster4.2.02
|
eabd02f529a259ca3b5b63fe68c081974393e3dd
|
ef4ce18574fd7b1e4dafa59318df9d8748c87d37
|
refs/heads/master
| 2021-08-28T11:11:12.320794
| 2017-12-12T03:01:54
| 2017-12-12T03:01:54
| 113,553,417
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,132
|
java
|
package com.lantern.launcher.ui;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import com.lantern.a.a.e;
import com.lantern.analytics.a;
final class c
implements View.OnClickListener
{
c(MainActivity paramMainActivity) {}
public final void onClick(View paramView)
{
MainActivity.b(this.a).removeMessages(100);
if ((MainActivity.e(this.a) == null) || (!TextUtils.isEmpty(MainActivity.e(this.a).m())))
{
a.e().onEvent("kpAD_cli");
MainActivity.f(this.a);
paramView = new Intent("wifi.intent.action.BROWSER");
paramView.setData(Uri.parse(MainActivity.e(this.a).m()));
paramView.setPackage(this.a.getPackageName());
if (MainActivity.c(this.a) != null) {
MainActivity.c(this.a).d();
}
MainActivity.a(this.a, paramView);
}
}
}
/* Location: /Users/hanlian/Downloads/WiFi万能钥匙dex1-dex2jar.jar!/com/lantern/launcher/ui/c.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"lianh@jumei.com"
] |
lianh@jumei.com
|
c8d8afb68544d2259eb862c40c2582a1b080c2f3
|
b4edbb35b8ea44296cf05fc868eb00956e342a4c
|
/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/SubclassMethodMetadata.java
|
df4438510cfea2907971c6163035eb4910d844f1
|
[
"Apache-2.0"
] |
permissive
|
belyaev-andrey/quarkus
|
b1942257241e5315e36cb33d04430854f2369676
|
e8606513e1bd14f0b1aaab7f9969899bd27c55a3
|
refs/heads/master
| 2020-08-27T04:46:56.912858
| 2019-10-24T08:13:22
| 2019-10-24T08:13:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 582
|
java
|
package io.quarkus.arc;
import io.quarkus.arc.interceptors.InterceptorInvocation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Set;
public class SubclassMethodMetadata {
public final List<InterceptorInvocation> chain;
public final Method method;
public final Set<Annotation> bindings;
public SubclassMethodMetadata(List<InterceptorInvocation> chain, Method method, Set<Annotation> bindings) {
this.chain = chain;
this.method = method;
this.bindings = bindings;
}
}
|
[
"mkouba@redhat.com"
] |
mkouba@redhat.com
|
52388e290f2e75997f23655ba0ee2f8a267227d5
|
f353942026e47e491b8b4b28c640e466cd3b8fd1
|
/common/eunit-testfwk/src/main/java/com/ebay/eunit/annotation/Intercept.java
|
429da4d09b57767f83c23f45af7caabb4af3e634
|
[] |
no_license
|
qmwu2000/workshop
|
392c952f7ef66c4da492edd929c47b7a1db3e5fa
|
9c1cc55122f78045aa996d5714635391847ae212
|
refs/heads/master
| 2021-01-17T08:55:54.655925
| 2012-11-13T13:31:14
| 2012-11-13T13:31:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 427
|
java
|
package com.ebay.eunit.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
public @interface Intercept {
String beforeMethod() default "";
String afterMethod() default "";
String onErrorMethod() default "";
}
|
[
"qmwu2000@gmail.com"
] |
qmwu2000@gmail.com
|
ebb08afd1a70746bb3d1f6c5d2188d1772a96ce9
|
7ef841751c77207651aebf81273fcc972396c836
|
/astream/src/main/java/com/loki/astream/stubs/SampleClass52.java
|
46d9c1c76ee45ca068fe69804258db525773fc5d
|
[] |
no_license
|
SergiiGrechukha/ModuleApp
|
e28e4dd39505924f0d36b4a0c3acd76a67ed4118
|
00e22d51c8f7100e171217bcc61f440f94ab9c52
|
refs/heads/master
| 2022-05-07T13:27:37.704233
| 2019-11-22T07:11:19
| 2019-11-22T07:11:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 367
|
java
|
package com.loki.astream.stubs;import com.jenzz.pojobuilder.api.Builder;import com.jenzz.pojobuilder.api.Ignore;
@Builder public class SampleClass52 {
@Ignore private SampleClass53 sampleClass;
public SampleClass52(){
sampleClass = new SampleClass53();
}
public String getClassName() {
return sampleClass.getClassName();
}
}
|
[
"sergey.grechukha@gmail.com"
] |
sergey.grechukha@gmail.com
|
664649b720ebeff472b1f0e8d7976ee516245445
|
5f826d3fea601d8616905934b0424e93592c06c4
|
/src/main/java/com/adel/jhipster/application/config/audit/AuditEventConverter.java
|
b75a00a784f73d79fd271777bd22d5046d6ce6b5
|
[] |
no_license
|
aelj/myFirstJHipsterApplication
|
58a390c2658bdf42e0cefab327d45351b69726bd
|
3815736ba6d58abff3a3bd0969da64846634583a
|
refs/heads/master
| 2020-03-13T05:49:05.931063
| 2018-04-25T10:42:18
| 2018-04-25T10:42:18
| 130,991,233
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,349
|
java
|
package com.adel.jhipster.application.config.audit;
import com.adel.jhipster.application.domain.PersistentAuditEvent;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class AuditEventConverter {
/**
* Convert a list of PersistentAuditEvent to a list of AuditEvent
*
* @param persistentAuditEvents the list to convert
* @return the converted list.
*/
public List<AuditEvent> convertToAuditEvent(Iterable<PersistentAuditEvent> persistentAuditEvents) {
if (persistentAuditEvents == null) {
return Collections.emptyList();
}
List<AuditEvent> auditEvents = new ArrayList<>();
for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) {
auditEvents.add(convertToAuditEvent(persistentAuditEvent));
}
return auditEvents;
}
/**
* Convert a PersistentAuditEvent to an AuditEvent
*
* @param persistentAuditEvent the event to convert
* @return the converted list.
*/
public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) {
if (persistentAuditEvent == null) {
return null;
}
return new AuditEvent(Date.from(persistentAuditEvent.getAuditEventDate()), persistentAuditEvent.getPrincipal(),
persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData()));
}
/**
* Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface
*
* @param data the data to convert
* @return a map of String, Object
*/
public Map<String, Object> convertDataToObjects(Map<String, String> data) {
Map<String, Object> results = new HashMap<>();
if (data != null) {
for (Map.Entry<String, String> entry : data.entrySet()) {
results.put(entry.getKey(), entry.getValue());
}
}
return results;
}
/**
* Internal conversion. This method will allow to save additional data.
* By default, it will save the object as string
*
* @param data the data to convert
* @return a map of String, String
*/
public Map<String, String> convertDataToStrings(Map<String, Object> data) {
Map<String, String> results = new HashMap<>();
if (data != null) {
for (Map.Entry<String, Object> entry : data.entrySet()) {
Object object = entry.getValue();
// Extract the data that will be saved.
if (object instanceof WebAuthenticationDetails) {
WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) object;
results.put("remoteAddress", authenticationDetails.getRemoteAddress());
results.put("sessionId", authenticationDetails.getSessionId());
} else if (object != null) {
results.put(entry.getKey(), object.toString());
} else {
results.put(entry.getKey(), "null");
}
}
}
return results;
}
}
|
[
"jhipster-bot@users.noreply.github.com"
] |
jhipster-bot@users.noreply.github.com
|
a38ec11f2894cc7d565380b1625375d51872f15e
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/XWIKI-13141-42-15-Single_Objective_GGA-WeightedSum/com/xpn/xwiki/plugin/webdav/XWikiDavFilter_ESTest_scaffolding.java
|
547337891915ea9cfa4482375a81984426c877ef
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 446
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sat Jan 18 05:37:56 UTC 2020
*/
package com.xpn.xwiki.plugin.webdav;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XWikiDavFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
01e390144e1628fdd98fa00d681c1dc8d3117eed
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/22/22_ce63829a271fb1f3c1bb25419e483ee157e7a2b2/IntervalConvergedSnapshotManager/22_ce63829a271fb1f3c1bb25419e483ee157e7a2b2_IntervalConvergedSnapshotManager_s.java
|
9e34af641c33a0ff227024dddcd17f14d70d2e1b
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 5,395
|
java
|
/*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.web.tomcat.service.session;
import java.util.LinkedHashSet;
import java.util.Set;
/**
* @author <A HREF="mailto:jean.deruelle@gmail.com">Jean Deruelle</A>
*
*/
public class IntervalConvergedSnapshotManager extends IntervalSnapshotManager implements SnapshotSipManager {
// the modified sessions
protected Set sipSessions = new LinkedHashSet();
protected Set sipApplicationSessions = new LinkedHashSet();
/**
* @param manager
* @param path
*/
public IntervalConvergedSnapshotManager(AbstractJBossManager manager, String path) {
super(manager, path);
}
/**
* @param manager
* @param path
* @param interval
*/
public IntervalConvergedSnapshotManager(AbstractJBossManager manager,
String path, int interval) {
super(manager, path, interval);
}
/**
* Store the modified session in a hashmap for the distributor thread
*/
public void snapshot(ClusteredSipSession session) {
try {
// Don't hold a ref to the session for a long time
synchronized (sipSessions) {
sipSessions.add(session);
}
} catch (Exception e) {
log.error(
"Failed to queue session " + session + " for replication",
e);
}
}
/**
* Store the modified session in a hashmap for the distributor thread
*/
public void snapshot(ClusteredSipApplicationSession session) {
try {
// Don't hold a ref to the session for a long time
synchronized (sipApplicationSessions) {
sipApplicationSessions.add(session);
}
} catch (Exception e) {
log.error(
"Failed to queue session " + session + " for replication",
e);
}
}
/**
* Distribute all modified sessions
*/
protected void processSipSessions() {
ClusteredSipSession[] toProcess = null;
synchronized (sipSessions) {
toProcess = new ClusteredSipSession[sipSessions.size()];
toProcess = (ClusteredSipSession[]) sipSessions.toArray(toProcess);
sessions.clear();
}
JBossCacheSipManager mgr = (JBossCacheSipManager) getManager();
for (int i = 0; i < toProcess.length; i++) {
// Confirm we haven't been stopped
if (!processingAllowed)
break;
try {
mgr.storeSipSession(toProcess[i]);
} catch (Exception e) {
getLog().error(
"Caught exception processing session "
+ toProcess[i].getId(), e);
}
}
}
/**
* Distribute all modified sessions
*/
protected void processSipApplicationSessions() {
ClusteredSipApplicationSession[] toProcess = null;
synchronized (sipApplicationSessions) {
toProcess = new ClusteredSipApplicationSession[sipApplicationSessions
.size()];
toProcess = (ClusteredSipApplicationSession[]) sipApplicationSessions
.toArray(toProcess);
sessions.clear();
}
JBossCacheSipManager mgr = (JBossCacheSipManager) getManager();
for (int i = 0; i < toProcess.length; i++) {
// Confirm we haven't been stopped
if (!processingAllowed)
break;
try {
mgr.storeSipApplicationSession(toProcess[i]);
} catch (Exception e) {
getLog().error(
"Caught exception processing session "
+ toProcess[i].getId(), e);
}
}
}
/**
* Start the snapshot manager
*/
public void start() {
processingAllowed = true;
startThread();
}
/**
* Stop the snapshot manager
*/
public void stop() {
processingAllowed = false;
stopThread();
synchronized (sessions) {
sessions.clear();
}
}
/**
* Start the distributor thread
*/
protected void startThread() {
if (thread != null) {
return;
}
thread = new Thread(this, "ClusteredConvergedSessionDistributor["
+ getContextPath() + "]");
thread.setDaemon(true);
thread.setContextClassLoader(getManager().getContainer().getLoader()
.getClassLoader());
threadDone = false;
thread.start();
}
/**
* Stop the distributor thread
*/
protected void stopThread() {
if (thread == null) {
return;
}
threadDone = true;
thread.interrupt();
try {
thread.join();
} catch (InterruptedException e) {
}
thread = null;
}
/**
* Thread-loop
*/
public void run() {
while (!threadDone) {
try {
Thread.sleep(interval);
processSessions();
processSipApplicationSessions();
processSipSessions();
} catch (InterruptedException ie) {
if (!threadDone)
getLog().error("Caught exception processing sessions", ie);
} catch (Exception e) {
getLog().error("Caught exception processing sessions", e);
}
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
29c435f24860bed234f74315b85898d356c60df2
|
26ce2e5d791da69b0c88821320631a4daaa5228c
|
/src/main/java/br/com/swconsultoria/efd/contribuicoes/registros/blocoM/RegistroM215.java
|
854f874c31d085c60b18a4086ecd28d6b05cce60
|
[
"MIT"
] |
permissive
|
Samuel-Oliveira/Java-Efd-Contribuicoes
|
b3ac3b76f82a29e22ee37c3fb0334d801306c1d4
|
da29df5694e27024df3aeda579936c792fac0815
|
refs/heads/master
| 2023-08-04T06:39:32.644218
| 2023-07-28T00:39:59
| 2023-07-28T00:39:59
| 94,896,966
| 8
| 6
|
MIT
| 2022-04-06T15:30:13
| 2017-06-20T13:55:12
|
Java
|
UTF-8
|
Java
| false
| false
| 1,876
|
java
|
/**
*
*/
package br.com.swconsultoria.efd.contribuicoes.registros.blocoM;
/**
* @author Yuri Lemes
*
*/
public class RegistroM215 {
private final String reg = "M215";
private String ind_aj_bc;
private String vl_aj_bc;
private String cod_aj_bc;
private String num_doc;
private String descr_aj_bc;
private String dt_ref;
private String cod_cta;
private String cnpj;
private String info_compl;
public String getReg() {
return reg;
}
public String getInd_aj_bc() {
return ind_aj_bc;
}
public void setInd_aj_bc(String ind_aj_bc) {
this.ind_aj_bc = ind_aj_bc;
}
public String getVl_aj_bc() {
return vl_aj_bc;
}
public void setVl_aj_bc(String vl_aj_bc) {
this.vl_aj_bc = vl_aj_bc;
}
public String getCod_aj_bc() {
return cod_aj_bc;
}
public void setCod_aj_bc(String cod_aj_bc) {
this.cod_aj_bc = cod_aj_bc;
}
public String getNum_doc() {
return num_doc;
}
public void setNum_doc(String num_doc) {
this.num_doc = num_doc;
}
public String getDescr_aj_bc() {
return descr_aj_bc;
}
public void setDescr_aj_bc(String descr_aj_bc) {
this.descr_aj_bc = descr_aj_bc;
}
public String getDt_ref() {
return dt_ref;
}
public void setDt_ref(String dt_ref) {
this.dt_ref = dt_ref;
}
public String getCod_cta() {
return cod_cta;
}
public void setCod_cta(String cod_cta) {
this.cod_cta = cod_cta;
}
public String getCnpj() {
return cnpj;
}
public void setCnpj(String cnpj) {
this.cnpj = cnpj;
}
public String getInfo_compl() {
return info_compl;
}
public void setInfo_compl(String info_compl) {
this.info_compl = info_compl;
}
}
|
[
"samuk.exe@hotmail.com"
] |
samuk.exe@hotmail.com
|
b065805a8ee82f1a4a85c2d3fe0063ad5019eea2
|
ab3eccd0be02fb3ad95b02d5b11687050a147bce
|
/apis/mapbox-gl/out/src/main/java/js/browser/WeakSetConstructor.java
|
aeeead308c178a182c1fc9428c70247b0d347147
|
[] |
no_license
|
ibaca/typescript2java
|
263fd104a9792e7be2a20ab95b016ad694a054fe
|
0b71b8a3a4c43df1562881f0816509ca4dafbd7e
|
refs/heads/master
| 2021-04-27T10:43:14.101736
| 2018-02-23T11:37:16
| 2018-02-23T11:37:18
| 122,543,398
| 0
| 0
| null | 2018-02-22T22:33:30
| 2018-02-22T22:33:29
| null |
UTF-8
|
Java
| false
| false
| 786
|
java
|
package js.browser;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* source type: WeakSetConstructor
* flags: Object (32768)
* declared in: tsd/browser/lib.es6.d.ts at pos 216816
* declared in: tsd/browser/lib.es6.d.ts at pos 220302
* *** changed to class to reflect the possible DTO use of this type ***
*/
@JsType(isNative=true, namespace=JsPackage.GLOBAL, name="Object")
public class WeakSetConstructor
{
/*
Properties
*/
public WeakSet<Object> prototype;
/*
Methods
*/
@JsProperty(name = "prototype")
public native WeakSet<Object> getPrototype();
@JsProperty(name = "prototype")
public native void setPrototype(WeakSet<Object> value);
}
|
[
"ignacio@bacamt.com"
] |
ignacio@bacamt.com
|
546c3cc4e9054f028e312ee60c3d9f206ad61c87
|
d9766f5f97146449153af93573d9f1a1e7fbe9bf
|
/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/ApplicationSAMLSSOProtocolHandler.java
|
56805c44418c1f58bb250abe552a94ce3edcf16c
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown"
] |
permissive
|
apache/cxf-fediz
|
a47f7f7e39e500cde9415279ad80c9f8dfdfcbcb
|
e571b98a17fe9916e598a4f45d85a0ae36f597cb
|
refs/heads/main
| 2023-09-04T08:12:21.925802
| 2023-09-01T06:25:28
| 2023-09-01T06:25:28
| 17,537,838
| 23
| 54
|
Apache-2.0
| 2023-09-14T12:47:16
| 2014-03-08T08:00:07
|
Java
|
UTF-8
|
Java
| false
| false
| 1,867
|
java
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cxf.fediz.service.idp.protocols;
import javax.servlet.http.HttpServletRequest;
import org.apache.cxf.fediz.service.idp.spi.ApplicationProtocolHandler;
import org.springframework.stereotype.Component;
import org.springframework.webflow.execution.RequestContext;
@Component
public class ApplicationSAMLSSOProtocolHandler implements ApplicationProtocolHandler {
public static final String PROTOCOL = "urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser";
//private static final Logger LOG = LoggerFactory.getLogger(ApplicationWSFedProtocolHandler.class);
@Override
public boolean canHandleRequest(HttpServletRequest request) {
// TODO Auto-generated method stub
return false;
}
@Override
public String getProtocol() {
return PROTOCOL;
}
@Override
public void mapSignInRequest(RequestContext context) {
// TODO Auto-generated method stub
}
@Override
public void mapSignInResponse(RequestContext context) {
// TODO Auto-generated method stub
}
}
|
[
"coheigea@apache.org"
] |
coheigea@apache.org
|
0148fb33ac2982b6799305d1d1d7ce70cbc8d75c
|
dec20d76616f40658a89243c5016d5d389cda955
|
/src/com/attilax/lbs/ZipX138.java
|
711458ab6f4f5cf854c4723421d2e93e9f38865d
|
[] |
no_license
|
attilax/vod2
|
25930b87607f4625d07cf6ea5aa4e26b40eb8913
|
05249e18976b17ecc4a9c1fff307a879da2bd341
|
refs/heads/master
| 2021-01-10T21:15:41.546684
| 2015-02-21T17:41:06
| 2015-02-21T17:41:06
| 30,624,384
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,092
|
java
|
/**
*
*/
package com.attilax.lbs;
import java.io.File;
import java.net.URLDecoder;
import java.net.URLEncoder;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.attilax.Base64;
import com.attilax.html.HtmlX2;
import com.attilax.io.filex;
import com.attilax.net.websitex;
import com.attilax.util.mainThreadEnd;
/**
* @author ASIMO
*
*/
public class ZipX138 extends ZipX {
private boolean test=false;
public static void main(String[] args) throws NoRztEx {
String addr="武汉市江汉区新华下路410号5层37室";
//
ZipX138 zipX138 = new ZipX138();
zipX138.test=true;
System.out.println(zipX138. toZipFromAddr(addr));
}
public String toZipFromAddr(String addr) throws NoRztEx {
try {
String api="http://alexa.ip138.com/post/search.asp?address=@add".replaceAll("@add", URLEncoder.encode(addr, "gbk"));
Document doc = null;
String html ;//=websitex.WebpageContent(api, "gbk");
html = new websitex().WebpageContent(api, "gbk",5);
//filex.read("c:\\ip138rzt.html", "gbk");
//
if(new File("C:\\traceOk").exists())
filex.save_safe(html, "c:\\rztTrace.html");
else if(this.test)
filex.save_safe(html, "c:\\rztTrace_yseba.html");
else
filex.del("c:\\rztTrace.html");
//filex.read("c:\\rzt.html", "gbk");
//filex.write(path + ".htm", html);
doc = Jsoup.parse(html);
HtmlX2 hx=new HtmlX2() {
};
//yKu5+tPKseDH+LrFy9HL9w==
//%C8%AB%B9%FA%D3%CA%B1%E0%C7%F8%BA%C5%CB%D1%CB%F7
// %E5%85%A8%E5%9B%BD%E9%82%AE%E7%BC%96%E5%8C%BA%E5%8F%B7%E6%90%9C%E7%B4%A2
Element tab = hx.getTable(doc, "市、县、区名",Base64. decode("yKu5+tPKseDH+LrFy9HL9w==") );
Element tr=hx.getTr(tab,1,true);
Elements tds=tr.children();
String add=tds.get(0).text();
String zip=tds.get(1).text();
return add + ","+zip+"";
// return tab.html();
} catch ( Exception e) {
e.printStackTrace();
throw new NoRztEx(e.getMessage());
//throw new RuntimeException(e.getMessage());
}
// return addr;
}
}
|
[
"1466519819@qq.com"
] |
1466519819@qq.com
|
ce978221e57237eeece5fc5a81ee3a963ecac9cd
|
c1116c7ff8314ec43b16d455ee1aea7d8d289943
|
/enderio-base/src/main/java/crazypants/enderio/base/block/grave/BlockGrave.java
|
d455915e1fb18dd56039c6b972262855fa6c9123
|
[
"Unlicense",
"CC-BY-NC-3.0",
"CC0-1.0",
"CC-BY-3.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
FinalCraftMC/EnderIO
|
71054da73fe329d5d49c9a2c239b4545a8b7ed7b
|
a173868d1659d511154d9b195cd0d4759164029b
|
refs/heads/master
| 2023-04-23T19:20:36.682724
| 2021-05-10T18:42:24
| 2021-05-10T18:42:24
| 298,419,938
| 0
| 0
|
Unlicense
| 2020-09-26T23:02:13
| 2020-09-24T23:40:35
| null |
UTF-8
|
Java
| false
| false
| 4,935
|
java
|
package crazypants.enderio.base.block.grave;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.enderio.core.api.client.gui.IResourceTooltipProvider;
import com.enderio.core.common.inventory.EnderInventory;
import crazypants.enderio.api.IModObject;
import crazypants.enderio.base.BlockEio;
import crazypants.enderio.base.ItemEIO;
import crazypants.enderio.base.config.config.ItemConfig;
import crazypants.enderio.base.lang.Lang;
import crazypants.enderio.base.render.IHaveTESR;
import crazypants.enderio.base.render.registry.SmartModelAttacher;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockGrave extends BlockEio<TileGrave> implements IResourceTooltipProvider, IHaveTESR {
public static BlockGrave create(@Nonnull IModObject modObject) {
BlockGrave res = new BlockGrave(modObject);
res.init();
return res;
}
public BlockGrave(@Nonnull IModObject modObject) {
super(modObject);
setBlockUnbreakable();
setResistance(6000000.0F);
setLightOpacity(0);
mkShape(BlockFaceShape.UNDEFINED);
}
@Override
protected void init() {
super.init();
SmartModelAttacher.registerItemOnly(this);
}
@Override
public @Nullable ItemEIO createBlockItem(@Nonnull IModObject modObject) {
return (ItemEIO) modObject.apply(new ItemEIO(this) {
@Override
public @Nonnull EnumActionResult onItemUse(@Nonnull EntityPlayer player, @Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull EnumHand hand,
@Nonnull EnumFacing facing, float hitX, float hitY, float hitZ) {
return EnumActionResult.FAIL;
}
@Override
public @Nonnull String getUnlocalizedName() {
return BlockGrave.this.getUnlocalizedName().replace("tile", "item");
}
@Override
public @Nonnull String getUnlocalizedName(@Nonnull ItemStack stack) {
return getUnlocalizedName();
}
}).setMaxStackSize(16);
};
@Override
@SideOnly(Side.CLIENT)
public void bindTileEntitySpecialRenderer() {
ClientRegistry.bindTileEntitySpecialRenderer(TileGrave.class, new TESRGrave(this));
}
@Override
public boolean isOpaqueCube(@Nonnull IBlockState state) {
return false;
}
@Override
public boolean isFullCube(@Nonnull IBlockState state) {
return false;
}
protected static final @Nonnull AxisAlignedBB DEFAULT_AABB = new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 0.5D, 0.75D);
@Override
public @Nonnull AxisAlignedBB getBoundingBox(@Nonnull IBlockState state, @Nonnull IBlockAccess source, @Nonnull BlockPos pos) {
return DEFAULT_AABB;
}
@Override
public @Nonnull EnumBlockRenderType getRenderType(@Nonnull IBlockState state) {
return EnumBlockRenderType.INVISIBLE;
}
@Override
public boolean onBlockActivated(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer player, @Nonnull EnumHand hand,
@Nonnull EnumFacing side, float hitX, float hitY, float hitZ) {
if (player.isSneaking()) {
return false;
}
if (!world.isRemote) {
TileGrave te = getTileEntity(world, pos);
if (te != null && (te.getOwner().equals(player.getGameProfile()) || player.isCreative() || !ItemConfig.dpPrivate.get())) {
EnderInventory inventory = te.getInventory();
for (int slot = 0; slot < inventory.getSlots(); slot++) {
final ItemStack stack = inventory.getStackInSlot(slot).copy();
if (!player.inventory.addItemStackToInventory(stack)) {
spawnAsEntity(world, pos, stack);
}
}
world.setBlockToAir(pos);
} else {
player.sendStatusMessage(Lang.GUI_GRAVE_NOT_OWNER.toChatServer(), true);
}
}
return true;
}
@Override
public boolean canHarvestBlock(@Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) {
return false;
}
@Override
public boolean removedByPlayer(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest) {
return false;
}
@Override
protected boolean canBeWrenched() {
return false;
}
@Override
@Nonnull
public String getUnlocalizedNameForTooltip(@Nonnull ItemStack itemStack) {
return itemStack.getUnlocalizedName();
}
}
|
[
"henry@loenwind.info"
] |
henry@loenwind.info
|
1fe575af0e3de93a1b57085ad2d3ad5b1405bc7f
|
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
|
/GenealogyJ/rev5537-5610/left-branch-5610/src/report/ReportAlmanac.java
|
1090990856ebde92c2e71339dee27e6a9b65c337
|
[] |
no_license
|
joliebig/featurehouse_fstmerge_examples
|
af1b963537839d13e834f829cf51f8ad5e6ffe76
|
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
|
refs/heads/master
| 2016-09-05T10:24:50.974902
| 2013-03-28T16:28:47
| 2013-03-28T16:28:47
| 9,080,611
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,547
|
java
|
import genj.almanac.Almanac;
import genj.almanac.Event;
import genj.gedcom.Gedcom;
import genj.gedcom.GedcomException;
import genj.gedcom.Indi;
import genj.gedcom.Property;
import genj.gedcom.PropertyDate;
import genj.gedcom.PropertyEvent;
import genj.gedcom.time.PointInTime;
import genj.report.Report;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class ReportAlmanac extends Report {
public boolean groupByYear = false;
public void start(Gedcom gedcom) {
report(gedcom, (Collection<Indi>)gedcom.getEntities(Gedcom.INDI));
}
public void start(Indi indi) {
report(indi.getGedcom(), Collections.singletonList(indi));
}
public void start(Indi[] indis) {
report(indis[0].getGedcom(), Arrays.asList(indis));
}
public void start(PropertyDate[] dates)
{
PointInTime
from = new PointInTime(),
to = new PointInTime();
for (int i=0;i<dates.length;i++)
getTimespan(dates[i], from, to);
if (!from.isValid()||!to.isValid())
return;
report(getAlmanac().getEvents(from, to, null));
}
private void report(Gedcom ged, Collection<Indi> indis) {
Iterator<Event> events = getEvents(ged, indis);
if (events==null) {
println(translate("norange", indis.size()));
return;
}
report(events);
}
private void report(Iterator<Event> events) {
int year = -Integer.MAX_VALUE;
int num = 0;
while (events.hasNext()) {
Event event = events.next();
if (groupByYear) {
int y = event.getTime().getYear();
if (y>year) {
year = y;
println(translate("year", ""+year));
}
}
println(" + "+event);
num++;
}
println("\n");
println(translate("found", new Integer(num)));
println(" -:-:-:-:-:-:-:-:-:-");
}
private Iterator<Event> getEvents(Gedcom gedcom, Collection<Indi> indis) {
PointInTime
from = new PointInTime(),
to = new PointInTime();
for (Indi indi : indis)
getLifespan(indi, from, to);
if (!from.isValid()||!to.isValid())
return null;
println("--------------------------------------------------------");
println(translate("header", new Object[]{ gedcom, from, to}));
println("--------------------------------------------------------");
return getAlmanac().getEvents(from, to, null);
}
private void getLifespan(Indi indi, PointInTime from, PointInTime to) {
List<? extends Property> events = indi.getProperties(PropertyEvent.class);
for (int e=0; e<events.size(); e++) {
Property event = (Property)events.get(e);
PropertyDate date = (PropertyDate)event.getProperty("DATE");
getTimespan(date, from, to);
}
}
private void getTimespan(PropertyDate date, PointInTime from, PointInTime to) {
if (date==null||!date.isValid())
return;
try {
PointInTime
start = date.getStart().getPointInTime(PointInTime.GREGORIAN),
end = date.isRange() ? date.getEnd().getPointInTime(PointInTime.GREGORIAN) : start;
if (!from.isValid()||from.compareTo(start)>0)
from.set(start);
if (!to.isValid()||to .compareTo(end )<0)
to.set(end);
} catch (GedcomException ge) {
}
}
private Almanac getAlmanac() {
Almanac almanac = Almanac.getInstance();
almanac.waitLoaded();
return almanac;
}
}
|
[
"joliebig@fim.uni-passau.de"
] |
joliebig@fim.uni-passau.de
|
933a2dfd380ad836f054d9cf44a8ecb795479f8b
|
e2c18b7cbd1f24e1f3522cd125449b8ddd40a8e3
|
/app/src/main/java/com/example/b2c/helper/LoadingHelper.java
|
410403e0454d21f66082143231def058b5d53dae
|
[] |
no_license
|
yangyang2018/app
|
40b85f180cfc74a5c40a5071dfce917a89ea78a5
|
d8d68b09689e01f457bf05abfd6a6ddd75ca0043
|
refs/heads/master
| 2021-01-17T13:35:23.633881
| 2017-06-26T07:03:13
| 2017-06-26T07:03:13
| 95,415,003
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 576
|
java
|
package com.example.b2c.helper;
import android.support.v4.app.FragmentActivity;
import com.example.b2c.widget.Progress;
/**
* 用途:
* Created by milk on 16/8/27.
* 邮箱:649444395@qq.com
*/
public class LoadingHelper {
public static void showLoading(FragmentActivity fragmentActivity) {
Progress.show(fragmentActivity, null);
}
public static void showLoading(FragmentActivity fragmentActivity, String content) {
Progress.show(fragmentActivity, content);
}
public static void dismiss() {
Progress.dismiss();
}
}
|
[
"shayu2017@163.com"
] |
shayu2017@163.com
|
7657b9501a117e4b909bd7e60507d12150fa714a
|
38a9418eb677d671e3f7e88231689398de0d232f
|
/programmers/src/test/java/greedy/GymClothesTest.java
|
71b18467529679b4734025cc8b03b2e123f3bc34
|
[] |
no_license
|
csj4032/enjoy-algorithm
|
66c4774deba531a75058357699bc29918fc3a7b6
|
a57f3c1af3ac977af4d127de20fbee101ad2c33c
|
refs/heads/master
| 2022-08-25T03:06:36.891511
| 2022-07-09T03:35:21
| 2022-07-09T03:35:21
| 99,533,493
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,999
|
java
|
package greedy;
import org.junit.jupiter.api.*;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class GymClothesTest {
@Test
@Order(1)
public void test() {
Assertions.assertEquals(6, GymClothes.solution(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{2, 3, 4, 5, 6, 7}));
Assertions.assertEquals(2, GymClothes.solution(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{6, 7}));
Assertions.assertEquals(6, GymClothes.solution(7, new int[]{2, 3, 4}, new int[]{1, 2, 3, 6}));
Assertions.assertEquals(7, GymClothes.solution(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{1, 2, 3, 4, 5, 6}));
Assertions.assertEquals(6, GymClothes.solution(7, new int[]{2, 3, 4, 5, 6, 7}, new int[]{1, 2, 3, 4, 5, 6}));
Assertions.assertEquals(1, GymClothes.solution(2, new int[]{1, 2}, new int[]{1}));
Assertions.assertEquals(2, GymClothes.solution(2, new int[]{1}, new int[]{1, 2}));
Assertions.assertEquals(30, GymClothes.solution(30, new int[]{29}, new int[]{30}));
Assertions.assertEquals(7, GymClothes.solution(8, new int[]{1, 2, 6}, new int[]{3, 4, 5}));
}
@Test
@Order(2)
public void test2() {
Assertions.assertEquals(6, GymClothes.solution2(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{2, 3, 4, 5, 6, 7}));
Assertions.assertEquals(2, GymClothes.solution2(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{6, 7}));
Assertions.assertEquals(6, GymClothes.solution2(7, new int[]{2, 3, 4}, new int[]{1, 2, 3, 6}));
Assertions.assertEquals(7, GymClothes.solution2(7, new int[]{1, 2, 3, 4, 5, 6}, new int[]{1, 2, 3, 4, 5, 6}));
Assertions.assertEquals(6, GymClothes.solution2(7, new int[]{2, 3, 4, 5, 6, 7}, new int[]{1, 2, 3, 4, 5, 6}));
Assertions.assertEquals(1, GymClothes.solution2(2, new int[]{1, 2}, new int[]{1}));
Assertions.assertEquals(2, GymClothes.solution2(2, new int[]{1}, new int[]{1, 2}));
Assertions.assertEquals(30, GymClothes.solution2(30, new int[]{29}, new int[]{30}));
Assertions.assertEquals(7, GymClothes.solution2(8, new int[]{1, 2, 6}, new int[]{3, 4, 5}));
}
}
|
[
"csj4032@gmail.com"
] |
csj4032@gmail.com
|
bb5d860f6b637557b639c767294a2967860ab7d2
|
3a4d8c4971355efc9c42c4b494db7614bc8df90e
|
/ejbModule/ec/edu/epn/rrhh/beans/UniversidadAPDAOImplement.java
|
0960e2ea57c0ede4722570dbe8451947516e6955
|
[] |
no_license
|
scajas/servicioSeguridad
|
4ea3f2dd0907416d2fb96f9e9b1667f73b637969
|
17ba2340ff8466933a9927f54579bd12a4581bdb
|
refs/heads/master
| 2022-12-09T12:33:44.500774
| 2020-08-03T15:40:23
| 2020-08-03T15:40:23
| 285,415,310
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 985
|
java
|
package ec.edu.epn.rrhh.beans;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;
import ec.edu.epn.generic.DAO.DaoGenericoImplement;
import ec.edu.epn.gestionDocente.entities.Universidad;
@Stateless
public class UniversidadAPDAOImplement extends DaoGenericoImplement<Universidad>
implements UniversidadDAO {
@Override
public List<Universidad> findUniversidadesByPais(String idPais) throws Exception {
StringBuilder queryString = new StringBuilder("SELECT s from Universidad s");
if (idPais != null) {
queryString.append(" where s.pais.idPais = ?1");
}
queryString.append(" order by s.nomUniversid");
Query query = getEntityManager().createQuery(queryString.toString());
if (idPais != null) {
query.setParameter(1, idPais );
}
//List<Universidad> universidades = new ArrayList<Universidad>();
return query.getResultList();
//return universidades;
}
}
|
[
"german.romero@epn.edu.ec"
] |
german.romero@epn.edu.ec
|
1ed9c0d242b213c84102557094e47876c7f75a3d
|
6a95484a8989e92db07325c7acd77868cb0ac3bc
|
/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201502/cm/ProductLegacyCondition.java
|
c11b2e03fe1bbef3631f6f2fa4153695eb4844eb
|
[
"Apache-2.0"
] |
permissive
|
popovsh6/googleads-java-lib
|
776687dd86db0ce785b9d56555fe83571db9570a
|
d3cabb6fb0621c2920e3725a95622ea934117daf
|
refs/heads/master
| 2020-04-05T23:21:57.987610
| 2015-03-12T19:59:29
| 2015-03-12T19:59:29
| 33,672,406
| 1
| 0
| null | 2015-04-09T14:06:00
| 2015-04-09T14:06:00
| null |
UTF-8
|
Java
| false
| false
| 3,956
|
java
|
/**
* ProductLegacyCondition.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201502.cm;
/**
* A plain condition string. Not supported by campaigns of
* {@link AdvertisingChannelType#SHOPPING}.
*/
public class ProductLegacyCondition extends com.google.api.ads.adwords.axis.v201502.cm.ProductDimension implements java.io.Serializable {
private java.lang.String value;
public ProductLegacyCondition() {
}
public ProductLegacyCondition(
java.lang.String productDimensionType,
java.lang.String value) {
super(
productDimensionType);
this.value = value;
}
/**
* Gets the value value for this ProductLegacyCondition.
*
* @return value
*/
public java.lang.String getValue() {
return value;
}
/**
* Sets the value value for this ProductLegacyCondition.
*
* @param value
*/
public void setValue(java.lang.String value) {
this.value = value;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ProductLegacyCondition)) return false;
ProductLegacyCondition other = (ProductLegacyCondition) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.value==null && other.getValue()==null) ||
(this.value!=null &&
this.value.equals(other.getValue())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getValue() != null) {
_hashCode += getValue().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ProductLegacyCondition.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201502", "ProductLegacyCondition"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201502", "value"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"jradcliff@google.com"
] |
jradcliff@google.com
|
30bfd2089c2dcded2f2ff785673f5a3aea73041a
|
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
|
/services/workspaceapp/src/main/java/com/huaweicloud/sdk/workspaceapp/v1/model/FileRedirectionBandwidthPercentageOptions.java
|
eefca79e0e57c1fce54b714f96a952b881d1a381
|
[
"Apache-2.0"
] |
permissive
|
huaweicloud/huaweicloud-sdk-java-v3
|
51b32a451fac321a0affe2176663fed8a9cd8042
|
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
|
refs/heads/master
| 2023-08-29T06:50:15.642693
| 2023-08-24T08:34:48
| 2023-08-24T08:34:48
| 262,207,545
| 91
| 57
|
NOASSERTION
| 2023-09-08T12:24:55
| 2020-05-08T02:27:00
|
Java
|
UTF-8
|
Java
| false
| false
| 2,606
|
java
|
package com.huaweicloud.sdk.workspaceapp.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Objects;
/**
* FileRedirectionBandwidthPercentageOptions
*/
public class FileRedirectionBandwidthPercentageOptions {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "file_redirection_bandwidth_percentage_value")
private Integer fileRedirectionBandwidthPercentageValue;
public FileRedirectionBandwidthPercentageOptions withFileRedirectionBandwidthPercentageValue(
Integer fileRedirectionBandwidthPercentageValue) {
this.fileRedirectionBandwidthPercentageValue = fileRedirectionBandwidthPercentageValue;
return this;
}
/**
* 文件重定向带宽百分比控制量(%)。取值范围为[0-100]。默认:30。
* minimum: 0
* maximum: 100
* @return fileRedirectionBandwidthPercentageValue
*/
public Integer getFileRedirectionBandwidthPercentageValue() {
return fileRedirectionBandwidthPercentageValue;
}
public void setFileRedirectionBandwidthPercentageValue(Integer fileRedirectionBandwidthPercentageValue) {
this.fileRedirectionBandwidthPercentageValue = fileRedirectionBandwidthPercentageValue;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
FileRedirectionBandwidthPercentageOptions that = (FileRedirectionBandwidthPercentageOptions) obj;
return Objects.equals(this.fileRedirectionBandwidthPercentageValue,
that.fileRedirectionBandwidthPercentageValue);
}
@Override
public int hashCode() {
return Objects.hash(fileRedirectionBandwidthPercentageValue);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class FileRedirectionBandwidthPercentageOptions {\n");
sb.append(" fileRedirectionBandwidthPercentageValue: ")
.append(toIndentedString(fileRedirectionBandwidthPercentageValue))
.append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"hwcloudsdk@huawei.com"
] |
hwcloudsdk@huawei.com
|
bf4be375b9052224ccca8d526e2897a4f3dd0c7b
|
0887c90394c6915aac10b3785dd4e7d600e35c74
|
/src/common/sysmodule/model/SysRole.java
|
45e29a2a287c9f7870aac214d2ca4b97fcc665e7
|
[] |
no_license
|
Monkey-mi/outsideeasy
|
ca34a0ca4e474e13722b9424901170d51d37a805
|
2e171bfd3b649eeefdcaa28adc57a4dac569ec09
|
refs/heads/master
| 2021-01-21T06:38:48.058165
| 2017-02-27T04:04:50
| 2017-02-27T04:04:50
| 83,262,244
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,121
|
java
|
package common.sysmodule.model;
import java.io.Serializable;
public class SysRole implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8797242845565418707L;
private int role_id;
private String role_name;
private String role_desc;
private int order_seq;
private int role_type;
private int is_enable;
public int getRole_id() {
return role_id;
}
public void setRole_id(int role_id) {
this.role_id = role_id;
}
public String getRole_name() {
return role_name;
}
public void setRole_name(String role_name) {
this.role_name = role_name;
}
public String getRole_desc() {
return role_desc;
}
public void setRole_desc(String role_desc) {
this.role_desc = role_desc;
}
public int getOrder_seq() {
return order_seq;
}
public void setOrder_seq(int order_seq) {
this.order_seq = order_seq;
}
public int getRole_type() {
return role_type;
}
public void setRole_type(int role_type) {
this.role_type = role_type;
}
public int getIs_enable() {
return is_enable;
}
public void setIs_enable(int is_enable) {
this.is_enable = is_enable;
}
}
|
[
"mishengliang@live.com"
] |
mishengliang@live.com
|
d875707424e8c07453e4bdc07807c6dd78959c64
|
25baed098f88fc0fa22d051ccc8027aa1834a52b
|
/src/main/java/com/ljh/daoMz/PersonWorkBalanceMapper.java
|
9d08539167ef6b26caeaf026b8123954eada5c23
|
[] |
no_license
|
woai555/ljh
|
a5015444082f2f39d58fb3e38260a6d61a89af9f
|
17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9
|
refs/heads/master
| 2022-07-11T06:52:07.620091
| 2022-01-05T06:51:27
| 2022-01-05T06:51:27
| 132,585,637
| 0
| 0
| null | 2022-06-17T03:29:19
| 2018-05-08T09:25:32
|
Java
|
UTF-8
|
Java
| false
| false
| 314
|
java
|
package com.ljh.daoMz;
import com.ljh.bean.PersonWorkBalance;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 操作员收费明细结算单 Mapper 接口
* </p>
*
* @author ljh
* @since 2020-10-26
*/
public interface PersonWorkBalanceMapper extends BaseMapper<PersonWorkBalance> {
}
|
[
"37681193+woai555@users.noreply.github.com"
] |
37681193+woai555@users.noreply.github.com
|
b32e487aa8b4a80fd6b4f9bab80eac3d44a1666c
|
a8c2430dd9dda03e62434574e7548ea27ab07781
|
/src/ics.template/net/ion/radon/impl/let/webdav/methods/DoNotImplemented.java
|
8e0504b4ce9005929cc86b346d8ad7ebb8d46172
|
[] |
no_license
|
bleujin/aradonExtend
|
053d3ae7281480137a4d0a994c98204c53632e02
|
5036da200c963b4c4ed871e86536165f46b65361
|
refs/heads/master
| 2021-01-23T09:33:40.805795
| 2013-02-18T08:48:26
| 2013-02-18T08:48:26
| 4,709,992
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 884
|
java
|
package net.ion.radon.impl.let.webdav.methods;
import java.io.IOException;
import net.ion.radon.core.let.InnerRequest;
import net.ion.radon.core.let.InnerResponse;
import net.ion.radon.impl.let.webdav.ITransaction;
import org.restlet.data.Method;
import org.restlet.data.Status;
import org.restlet.representation.Representation;
import org.restlet.resource.ResourceException;
public class DoNotImplemented extends AbstractMethod {
private final static DoNotImplemented NOT_IMPL_METHOD = new DoNotImplemented() ;
private DoNotImplemented() {
super(null, Method.ALL);
}
public final static DoNotImplemented create(){
return NOT_IMPL_METHOD ;
}
public Representation myHandle(ITransaction transaction, InnerRequest req, InnerResponse resp) throws IOException {
throw new ResourceException(Status.SERVER_ERROR_NOT_IMPLEMENTED) ;
}
}
|
[
"bleujin@gmail.com"
] |
bleujin@gmail.com
|
e0d773919be7dbb6d638b303da74cba970dc6016
|
fb5bfb5b4cf7a118cb858490953e69517d8060a4
|
/src/ch19/ex10/codea/vm/VendingMachine.java
|
9995b31cff8ff8164d134e81855915c8417a34b6
|
[] |
no_license
|
v777779/jbook
|
573dd1e4e3847ed51c9b6b66d2b098bf8eb58af5
|
09fc56a27e9aed797327f01ea955bdf1815d0d54
|
refs/heads/master
| 2021-09-19T08:14:16.299382
| 2018-07-25T14:03:12
| 2018-07-25T14:03:12
| 86,017,001
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,252
|
java
|
package ch19.ex10.codea.vm;
import lib.utils.IGenerator;
import static ch19.ex10.codea.vm.VendingMachine.State.TERMINAL;
/**
* Vadim Voronov
* email: vadim.v.voronov@gmail.com
* Created: 19-Apr-17.
*/
public class VendingMachine {
private static State state = State.RESTING;
private static int amount = 0;
private static Input selection = null;
enum StateDuration {TRANSIENT} // перечисление с одним состоянием
enum State {
RESTING {
@Override
void next(Input input) {
switch (Category.categorize(input)) {
case MONEY:
amount += input.amount(); // вытаскиваем деньги из объекта
state = ADDING_MONEY; // переходим в следующее состояние
break;
case SHUT_DOWN:
state = TERMINAL;
break;
default:
break;
}
}
},
ADDING_MONEY {
@Override
void next(Input input) {
switch (Category.categorize(input)) {
case MONEY:
amount += input.amount(); // сидим здесь пока получаем денег
break;
case ITEM_SELECTION:
selection = input; // собственно выбранный товар
if (amount < selection.amount()) { // денег и цена сравнение{
System.out.println("Insufficient money for:" + selection);
} else {
state = DISPENSING; // выдача товара
}
break;
case QUIT_TRANSACTION:
state = GIVING_CHANGE; // если надо денег вернуть
break;
case SHUT_DOWN:
state = TERMINAL;
break;
default:
break;
}
}
},
DISPENSING(StateDuration.TRANSIENT) {
@Override
void next() {
System.out.println("here is your " + selection);
amount -= selection.amount();
state = GIVING_CHANGE;
}
},
GIVING_CHANGE(StateDuration.TRANSIENT) {
@Override
void next() {
if (amount > 0) {
System.out.println("Your change:" + amount);
amount = 0;
}
state = RESTING;
}
},
TERMINAL {
void output() { // метод переопределен
System.out.println("Halted");
}
};
private boolean isTransient = false; // inside state
State() {
}
State(StateDuration tran) { // если поле есть, значит true
isTransient = true;
}
void next(Input input) {
throw new RuntimeException("next() for non-transient states");
}
void next() {
throw new RuntimeException("next() for transient states");
}
void output() {
System.out.println(amount);
}
}
static void run(IGenerator<Input> gen) {
while (state != TERMINAL) {
Input in = gen.next();
state.next(in);
while (state.isTransient) { // пока state переходное вызывать state.next
state.next();
}
state.output();
}
}
public static void check(String fileName) {
IGenerator<Input> gen = new RandomInputGenerator(); // объект с одним методом, который выдает Inputs
gen = new FileInputGenerator(fileName);
run(gen); // случайно генерятся любые события
}
}
|
[
"vadim.v.voronov@gmail.com"
] |
vadim.v.voronov@gmail.com
|
31de2301fbf66e154b31144173efda4fd1b0f359
|
7033053710cf2fd800e11ad609e9abbb57f1f17e
|
/cardayProject/carrental-service/src/main/java/com/cmdt/carrental/platform/service/model/request/station/StationVehiclePageDto.java
|
5c4161e123f7877a25d91e6f36c4940d61d48fe8
|
[] |
no_license
|
chocoai/cardayforfjga
|
731080f72c367c7d3b8e7844a1c3cd034cc11ee6
|
91d7c8314f44024825747e12a60324ffc3d43afb
|
refs/heads/master
| 2020-04-29T02:14:07.834535
| 2018-04-02T09:51:07
| 2018-04-02T09:51:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,786
|
java
|
package com.cmdt.carrental.platform.service.model.request.station;
import com.fasterxml.jackson.annotation.JsonInclude;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
/**
* Created by zhengjun.jing on 6/6/2017.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class StationVehiclePageDto {
@NotNull(message="userId不能为空")
private Long userId;
@NotNull(message="stationId不能为空")
@Digits(message="stationId格式错误,最小:1,最大:"+ Integer.MAX_VALUE, fraction = 0, integer = Integer.MAX_VALUE)
private Long stationId;
@Digits(message="currentPage格式错误,最小:1,最大:"+ Integer.MAX_VALUE, fraction = 0, integer = Integer.MAX_VALUE)
@NotNull
private Integer currentPage;
@Digits(message="numPerPage格式错误,最小1,最大:"+ Integer.MAX_VALUE, fraction = 0, integer = Integer.MAX_VALUE)
@NotNull
private Integer numPerPage;
private Long organizationId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getStationId() {
return stationId;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getNumPerPage() {
return numPerPage;
}
public void setNumPerPage(Integer numPerPage) {
this.numPerPage = numPerPage;
}
public Long getOrganizationId() {
return organizationId;
}
public void setOrganizationId(Long organizationId) {
this.organizationId = organizationId;
}
}
|
[
"xiaoxing.zhou@cm-dt.com"
] |
xiaoxing.zhou@cm-dt.com
|
e0455211cbc379e38bec0381ffa04529820b4c31
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/4/4_6fc2051c67fd2a986838ab75852b1d9836f742c4/AIRobotController/4_6fc2051c67fd2a986838ab75852b1d9836f742c4_AIRobotController_t.java
|
9718911ebbbaa973ee4cb08407e77ca809228428
|
[] |
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
| 7,809
|
java
|
package se.chalmers.dryleafsoftware.androidrally.controller;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import se.chalmers.dryleafsoftware.androidrally.model.cards.Card;
import se.chalmers.dryleafsoftware.androidrally.model.gameBoard.BoardElement;
import se.chalmers.dryleafsoftware.androidrally.model.cards.Move;
import se.chalmers.dryleafsoftware.androidrally.model.cards.Turn;
import se.chalmers.dryleafsoftware.androidrally.model.cards.TurnType;
import se.chalmers.dryleafsoftware.androidrally.model.gameBoard.GameBoard;
import se.chalmers.dryleafsoftware.androidrally.model.gameBoard.Hole;
import se.chalmers.dryleafsoftware.androidrally.model.robots.Robot;
public class AIRobotController {
private GameBoard gb;
private List<Card> chosenCards;
public AIRobotController(GameBoard gb) {
this.gb = gb;
}
public void makeMove(Robot robot) {
List<Card> cards = new ArrayList<Card>();
chosenCards = new ArrayList<Card>();
cards.addAll(robot.getCards());
placeCards(robot, cards);
}
@SuppressWarnings("unchecked")
private void placeCards(Robot robot, List<Card> cards) {
if (chosenCards.size() == 5) {
robot.setChosenCards(chosenCards);
robot.setSentCards(true);
return;
}
List<Move> moveForwardCards = new ArrayList<Move>();
List<Move> moveBackwardCards = new ArrayList<Move>();
List<Turn> turnCards = new ArrayList<Turn>();
List<Turn> leftTurnCards = new ArrayList<Turn>();
List<Turn> rightTurnCards = new ArrayList<Turn>();
List<Turn> uTurnCards = new ArrayList<Turn>();
boolean isRightDirection = false;
for (Integer direction : getDirections(robot)) { // Check if the robot stand in a correct direction
if (robot.getDirection() == direction) {
isRightDirection = true;
}
}
if (isRightDirection) {
for (Card card : cards) {
if (card instanceof Move) {
if (((Move)card).getDistance() > 0) {
moveForwardCards.add((Move)card);
}
}
}
if (moveForwardCards.size() != 0) { // Move forward as long as possible
Collections.sort(moveForwardCards);
chosenCards.add(moveForwardCards.get(0));
cards.remove(moveForwardCards.get(0));
} else { // if there are no move forwards cards -> random card
randomizeCard(robot, cards);
}
placeCards(robot, cards);
return;
}
else { // If the robot is turned towards a wrong direction.
for (Card card : cards) {
if (card instanceof Turn) {
if(((Turn)card).getTurn() == TurnType.LEFT){
leftTurnCards.add((Turn)card);
}else if(((Turn)card).getTurn() == TurnType.RIGHT){
rightTurnCards.add((Turn)card);
}else {
uTurnCards.add((Turn)card);
}
}
}
if (turnCards.size() != 0) { // Try turn towards a correct direction
for(Integer i : getDirections(robot)){
boolean cardAdded = false;
int turnDifference = Math.abs(i.intValue() -
robot.getDirection());
if(turnDifference == 1){
if(leftTurnCards.size() != 0){
chosenCards.add(leftTurnCards.get(0));
cards.remove(leftTurnCards.get(0));
cardAdded = true;
}
}else if(turnDifference == 2){
if(uTurnCards.size() != 0){
chosenCards.add(uTurnCards.get(0));
cards.remove(uTurnCards.get(0));
cardAdded = true;
}
}else if(turnDifference == 3){
if(rightTurnCards.size() != 0){
chosenCards.add(rightTurnCards.get(0));
cards.remove(rightTurnCards.get(0));
cardAdded = true;
}
}
if(!cardAdded){
for(Card card : cards){
if(!(card instanceof Move)){
chosenCards.add(card);
cards.remove(card);
}
}
}
placeCards(robot, cards);
return;
}
} else { // No turn cards -> random card
randomizeCard(robot, cards);
return;
}
placeCards(robot, cards);
return;
}
}
private int[] nextCheckPoint(Robot robot) {
int[] xy = new int[2];
for(int i = 0; i <= 1; i++) {
xy[i] = gb.getCheckPoints().get(robot.getLastCheckPoint()+1)[i]; //TODO will crash game if game is over and continues
}
return xy;
}
private int getDistanceToNextCheckPoint(Robot robot){
int distance = 0;
int[] nextCheckPoint = nextCheckPoint(robot);
distance = Math.abs(robot.getX() - nextCheckPoint[0]);
distance += Math.abs(robot.getY() - nextCheckPoint[1]);
return distance;
}
private Card nextCard(Robot robot){
return null;
}
private List<Integer> getDirections(Robot robot){
List<Integer> directions = new ArrayList<Integer>();
int dx = getDX(robot);
int dy = getDY(robot);
if(dx < 0){
directions.add(new Integer(GameBoard.EAST));
}else if(dx > 0){
directions.add(new Integer(GameBoard.WEST));
}
if(dy < 0){
directions.add(new Integer(GameBoard.SOUTH));
}else if(dy > 0){
directions.add(new Integer(GameBoard.NORTH));
}
removeBadDirections(robot, directions);
if(directions.size() == 2){
if(Math.abs(dx) < Math.abs(dy)){
directions.add(directions.remove(0));
}
}
return directions;
}
private void removeDirection(List<Integer> directions, Integer indexToRemove){
if(directions.size() == 1){
directions.add(new Integer((directions.get(indexToRemove) + 1) % 4));
directions.add(new Integer((directions.get(indexToRemove) + 3) % 4));
}
directions.remove(indexToRemove);
}
private List<Integer> removeBadDirections(Robot robot, List<Integer> directions){
int x = robot.getX();
int y = robot.getY();
for(int i = 0; i < directions.size(); i++){
if(directions.get(i).intValue() == GameBoard.NORTH){
for(int j = 0; j < 3; j++){
if((y-j) >= 0){
for(BoardElement boardElement : gb.getTile(x, (y-j)).getBoardElements()){
if(boardElement instanceof Hole){
removeDirection(directions, i);
break;
}
}
}else{
removeDirection(directions, i);
break;
}
}
}else if(directions.get(i).intValue() == GameBoard.EAST){
for(int j = 0; j < 3; j++){
if((x+j) <= gb.getWidth()){
for(BoardElement boardElement : gb.getTile((x+j), y).getBoardElements()){
if(boardElement instanceof Hole){
removeDirection(directions, i);
break;
}
}
}else{
removeDirection(directions, i);
break;
}
}
}else if(directions.get(i).intValue() == GameBoard.SOUTH){
for(int j = 0; j < 3; j++){
if((y+j) <= gb.getHeight()){
for(BoardElement boardElement : gb.getTile(x, (y+j)).getBoardElements()){
if(boardElement instanceof Hole){
removeDirection(directions, i);
break;
}
}
}else{
removeDirection(directions, i);
break;
}
}
}else if(directions.get(i).intValue() == GameBoard.WEST){
for(int j = 0; j < 3; j++){
if((x-j) >= 0){
for(BoardElement boardElement : gb.getTile((x-j), y).getBoardElements()){
if(boardElement instanceof Hole){
removeDirection(directions, i);
break;
}
}
}else{
removeDirection(directions, i);
break;
}
}
}
}
return directions;
}
private int getDX(Robot robot){
return (robot.getX() - nextCheckPoint(robot)[0]);
}
private int getDY(Robot robot){
return (robot.getY() - nextCheckPoint(robot)[1]);
}
private void randomizeCard(Robot robot, List<Card> cards) {
Random rand = new Random();
int index = rand.nextInt(cards.size());
Card randChosenCard = cards.get(index);
chosenCards.add(randChosenCard);
cards.remove(index);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
0338df668703c82804e1508d826b4e0dab6f2e1a
|
d74c2ca437a58670dc8bfbf20a3babaecb7d0bea
|
/SAP_858310_lines/Source - 963k/js.transactionext.interface/dev/src/_tc~bl~transactionext/java/com/sap/engine/interfaces/transaction/transactionextension.java
|
57bb292ec15996fd2dd321e36c411e29df0f3e58
|
[] |
no_license
|
javafullstackstudens/JAVA_SAP
|
e848e9e1a101baa4596ff27ce1aedb90e8dfaae8
|
f1b826bd8a13d1432e3ddd4845ac752208df4f05
|
refs/heads/master
| 2023-06-05T20:00:48.946268
| 2021-06-30T10:07:39
| 2021-06-30T10:07:39
| 381,657,064
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,527
|
java
|
/*
* Copyright (c) 2002 by SAP AG, Walldorf.,
* url: http://www.sap.com
* All rights reserved.
*
* This software is the confidential and proprietary information
* of SAP AG, Walldorf. You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms
* of the license agreement you entered into with SAP.
*/
package com.sap.engine.interfaces.transaction;
/**
* @author : Iliyan Nenov, ilian.nenov@sap.com
* @version 1.0 initial version
* @version 1.1 Moved to engine.interfaces and replaced ResourceReference with LocalTxProvider
*/
import javax.transaction.SystemException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.xa.XAResource;
import java.util.List;
/**
* Interface Transaction with some extra methods giving extra functionality
*
* @author Iliyan Nenov, ilian.nenov@sap.com
* @version 1.0 initial version
* @version 1.1 Moved to engine.interfaces and replaced ResourceReference with LocalTxProvider
*/
public interface TransactionExtension
extends javax.transaction.Transaction {
/**
* Checks if transaction is empty
*/
public boolean isEmpty();
/**
* Returns managed connection for this transaction
*/
public LocalTxProvider getLocalResource();
/**
* Enlists the ResourceReference with LocalTransaction
*
* @exception ResourceException thrown by LocalTransaction begin method
* see implementation
*/
public void enlistLocalResource(LocalTxProvider localRef) throws SystemException;
/**
* Returns the managed connections with 2PC support associated to this JTA transaction.
*/
public List getXAResourceConnections();
/**
* Checks if the transaction is alive
*/
public boolean isAlive();
/**
* Returns the ID of the Transaction
*/
public long getID();
/**
* Associates an Object with the transaction.
*
* @param sid The registration id of the object
*
* @exception SystemException thrown when specified sid is used from
* another object
*/
public void associateObjectWithTransaction(Object sid, Object obj) throws SystemException;
/**
* Returns the object that is associated with this transaction with
* specified SID. Returns null if such object does not exist
*
* @param sid The registration id of the object
*
*/
public Object getAssociatedObjectWithTransaction(Object sid);
/**
* Register a synchronization object for the transaction currently
* associated with the calling thread. The transction manager invokes
* the beforeCompletion method prior to starting the transaction
* commit process. After the transaction is completed, the transaction
* manager invokes the afterCompletion method. This method does not check
* if transaction is marked for rollback. This method can be used when
* synchronization must be registered into transaction that is marked for rollback
*
* @param newSynchronizaton The Synchronization object for the transaction associated
* with the target object
*
* @exception RollbackException this exception is not thrown
*
* @exception IllegalStateException Thrown if the transaction in the
* target object is in prepared state or the transaction is inactive.
*
* @exception SystemException Thrown if the transaction manager
* encounters an unexpected error condition
*
*/
public void registerSynchronizationWithoutStatusChecks(Synchronization newSynchronizaton) throws RollbackException, IllegalStateException, SystemException;
/**
* Used from connection management system to enlist XAResources together with information about
* resource manager from which this XAResource was created.
*
* @param rmID Id of the resource manager from which XAResource was created.
* @param xaRes The XAResource object representing the resource to delist
* @return true if the resource was enlisted successfully; otherwise false.
* @throws RollbackException Thrown to indicate that the transaction has been marked for rollback only.
* @throws IllegalStateException Thrown if the transaction in the target object is in prepared state or the transaction is inactive.
* @throws SystemException Thrown if the transaction manager encounters an unexpected error condition
*/
public boolean enlistResource(int rmID, XAResource xaRes) throws RollbackException, IllegalStateException, SystemException;
}
|
[
"Yalin.Arie@checkmarx.com"
] |
Yalin.Arie@checkmarx.com
|
28c77555ae3be9bb2958c6a7c919468d4eaa23e8
|
ae63afe5aa0b013c16ce31ef623cd89ffb49c916
|
/src/net/meisen/ant/xmlmatcher/FullDependencyMatcher.java
|
cd98b2a33b137c89607f3b8e08eaf152f625fe65
|
[
"MIT"
] |
permissive
|
pmeisen/ant-processenabler
|
cd1beede8821d82a254050cf2e7ab196412c789d
|
5577a8b234a9733235057f9a7bb843d343004c95
|
refs/heads/master
| 2020-06-09T00:10:09.864171
| 2015-05-06T13:08:28
| 2015-05-06T13:08:28
| 7,438,932
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,264
|
java
|
package net.meisen.ant.xmlmatcher;
import org.jdom.Element;
/**
* A matcher which check a dependency completely, i.e. group, artifact, type,
* classifier and version
*
* @author pmeisen
*
*/
public class FullDependencyMatcher extends DependencyMatcher {
@Override
protected boolean matchedArtifacts(final Element original, final Element patch) {
// the groupId and the artifactId must be equal
if (super.matchedArtifacts(original, patch)) {
// we also need the classifier, it has to be equal as well
final String classifier = original.getChildText(ATTRIB_CLASSIFIER);
final String newClassifier = patch.getChildText(ATTRIB_CLASSIFIER);
final String type = original.getChildText(ATTRIB_TYPE);
final String newType = patch.getChildText(ATTRIB_TYPE);
return equals(classifier, newClassifier, true)
&& equalTypes(type, newType);
} else {
return false;
}
}
@Override
protected boolean matchedVersion(final Element original, final Element patch) {
if (super.matchedVersion(original, patch)) {
// get the original and patch group
final String version = original.getChildText(ATTRIB_VERSION);
final String newVersion = patch.getChildText(ATTRIB_VERSION);
if (version == null || newVersion == null) {
return false;
} else if (version.equals(newVersion)) {
return true;
} else {
System.err.println("The version of a matched dependency does not fit '"
+ version + "' vs. '" + newVersion
+ "', please match the versions.");
return false;
}
} else {
return false;
}
}
/**
* Checks if the two types are equal
*
* @param typeA
* the first type
* @param typeB
* the second type
*
* @return <code>true</code> if the types are equal concerning maven,
* otherwise <code>false</code>
*/
protected boolean equalTypes(final String typeA, final String typeB) {
if (equals(typeA, typeB, true)) {
return true;
} else if ("jar".equals(typeA) && isEmptyOrNull(typeB)) {
return true;
} else if ("jar".equals(typeB) && isEmptyOrNull(typeA)) {
return true;
} else if (typeA == null || typeB == null) {
return false;
} else if (typeA.equals(typeB)) {
return true;
} else {
return false;
}
}
}
|
[
"philipp@meisen.net"
] |
philipp@meisen.net
|
39be940a86097d3f5829daea718fcdd59d461921
|
e5bb4c1c5cb3a385a1a391ca43c9094e746bb171
|
/Service/trunk/service/service-customer/src/main/java/com/hzfh/service/customer/serviceImpl/PaymentBankInfoServiceImpl.java
|
15576dbb33cf354a060c4ce297e73c84c5d4275b
|
[] |
no_license
|
FashtimeDotCom/huazhen
|
397143967ebed9d50073bfa4909c52336a883486
|
6484bc9948a29f0611855f84e81b0a0b080e2e02
|
refs/heads/master
| 2021-01-22T14:25:04.159326
| 2016-01-11T09:52:40
| 2016-01-11T09:52:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,355
|
java
|
package com.hzfh.service.customer.serviceImpl;
import java.util.List;
import com.hzfh.api.customer.model.PaymentBankInfo;
import com.hzfh.api.customer.model.query.PaymentBankInfoCondition;
import com.hzfh.api.customer.service.PaymentBankInfoService;
import com.hzfh.service.customer.dao.PaymentBankInfoDao;
import com.hzframework.data.serviceImpl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/*******************************************************************************
*
* Copyright 2015 HZFH. All rights reserved.
* Author: GuoZhenYu
* Create Date: 2015/6/8
* Description:
*
* Revision History:
* Date Author Description
*
******************************************************************************/
@Service("paymentBankInfoService")
public class PaymentBankInfoServiceImpl extends BaseServiceImpl<PaymentBankInfo, PaymentBankInfoCondition, PaymentBankInfoDao> implements PaymentBankInfoService {
@Autowired
private PaymentBankInfoDao paymentBankInfoDao;
@Override
public PaymentBankInfo getBankByBankCode(String code) {
return paymentBankInfoDao.getBankByBankCode(code);
}
@Override
public List<PaymentBankInfo> getListByStatus(int enable) {
return paymentBankInfoDao.getListByStatus(enable);
}
}
|
[
"ulei0343@163.com"
] |
ulei0343@163.com
|
f500b26b49bdee68c693a64bfa91741fcf33172a
|
90715965b82400cfab2944c2bccfe98d9e4f9351
|
/Android/AndroidStudio/EnjoyLearning/enjoyLearningCommunity/src/main/java/com/zj/learning/control/asks/AsksHelper.java
|
446a12ce988b2555d42265f5585e09b0046693a8
|
[
"MIT"
] |
permissive
|
myosmatrix/mlearning
|
28c818b36d14f183ff50e46c48fe454c3c514b4b
|
8b513c4df8573eb080555cdf5a1f000037570c41
|
refs/heads/master
| 2021-07-10T06:41:07.742167
| 2017-10-13T08:19:25
| 2017-10-13T08:19:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,086
|
java
|
package com.zj.learning.control.asks;
import android.content.Context;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import com.zj.learning.CoreApp;
import com.zj.learning.R;
import com.zj.learning.constant.GlobalConfig;
import com.zj.support.cache.image.ZjImageListener;
import com.zj.support.util.CommonUtil;
import com.zj.support.widget.ZjImageView;
/**
* 问答模块助手
*
* @author XingRongJing
*
*/
public class AsksHelper {
private String mAnswerCountPrefix, mCommentCountPrefix;
public AsksHelper() {
}
/**
* 处理缩略图
*
* @param thumb
* 服务器返回的缩略图地址(实际是原图地址,需要自己重新拼接)
* @param mIvThumb
* 缩略图展示ImageView
* @param clickListener
* 缩略图点击事件
*/
public void handleThumb(String thumb, ZjImageView mIvThumb,
OnClickListener clickListener) {
if (TextUtils.isEmpty(thumb)) {
mIvThumb.setVisibility(View.GONE);
} else {
String[] temp = CommonUtil.dividePath(thumb);
if (null == temp || temp.length == 0) {
mIvThumb.setVisibility(View.GONE);
} else {
String filePath = temp[0];
String fileName = temp[1];
String thumbFileName = GlobalConfig.ImageSize.SIZE170 + "_"
+ fileName;
String realThumb = filePath + thumbFileName;
mIvThumb.setImageUrl(realThumb);
mIvThumb.setVisibility(View.VISIBLE);
mIvThumb.setTag(thumb);
mIvThumb.setOnClickListener(clickListener);
}
}
}
public void handleAvator(ImageView iv, int userId) {
String url = this.getAvatorUrlByUid(userId);
((CoreApp) (iv.getContext().getApplicationContext()))
.getImageCacheHelper()
.requestBitmap(
url,
new ZjImageListener(iv, true, R.drawable.avator_default));
}
/**
* 获取头像路径
*
* @param userId
* @return
*/
public String getAvatorUrlByUid(int userId) {
return GlobalConfig.URL_PIC_ASKS_THUMB + GlobalConfig.SEPERATOR
+ userId;
}
public SpannableStringBuilder getTextSpan(int color, String src, int start,
int end) {
SpannableStringBuilder style = new SpannableStringBuilder(src);
style.setSpan(new ForegroundColorSpan(color), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return style;
}
public SpannableStringBuilder getAnswerCountTextSpan(Context ctx,
int answerCount) {
if (TextUtils.isEmpty(mAnswerCountPrefix)) {
mAnswerCountPrefix = ctx.getString(R.string.asks_reply_couts) + "(";
}
int start = mAnswerCountPrefix.length();
int temp = (answerCount + "").length();
int end = start + temp;
SpannableStringBuilder mAnswerCountStyle = this.getTextSpan(ctx
.getResources().getColor(R.color.bg_color), this
.buildCountTips(mAnswerCountPrefix, answerCount), start, end);
return mAnswerCountStyle;
}
public SpannableStringBuilder getCommentCountTextSpan(Context ctx,
int commentCount) {
if (TextUtils.isEmpty(mCommentCountPrefix)) {
mCommentCountPrefix = ctx.getString(R.string.asks_comment) + "(";
}
int start = mCommentCountPrefix.length();
int temp = (commentCount + "").length();
int end = start + temp;
SpannableStringBuilder mAnswerCountStyle = this.getTextSpan(ctx
.getResources().getColor(R.color.bg_color), this
.buildCountTips(mCommentCountPrefix, commentCount), start, end);
return mAnswerCountStyle;
}
public String buildCountTips(String prefix, int count) {
StringBuilder sb = new StringBuilder();
sb.append(prefix);
sb.append(count);
sb.append(")");
return sb.toString();
}
/**
* 点击缩略图查看原图时调用
*
* @param v
*/
public void onClickThumb(View v) {
Object obj = v.getTag();
String tag = "";
if (null != obj) {
tag = obj + "";
}
// Intent intent = new Intent(v.getContext(), AskPicActivity.class);
// intent.putExtra("picUrl", tag);
// v.getContext().startActivity(intent);
}
}
|
[
"huhongjun@gmail.com"
] |
huhongjun@gmail.com
|
af88e9d592ed84f7cd433abef7696bdf3ec45202
|
9af97d35e3d2278ddf8c9c60aa831a2d16403a01
|
/app/src/main/java/com/yjrlab/tabdoctor/network/enums/BodyPartGenderField.java
|
bd77b6fe66cc3e437ff6a7c62c6109f03aec9588
|
[] |
no_license
|
tddyko/TabTabAndroid
|
818a7e63fcdd69639c409380dd5ad0e6c92141fd
|
65bfbf9d570e9a829ab97819ad5343ccd91e5c60
|
refs/heads/master
| 2023-08-07T17:49:08.781901
| 2021-09-25T09:46:31
| 2021-09-25T09:46:31
| 410,233,816
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 684
|
java
|
package com.yjrlab.tabdoctor.network.enums;
import com.google.gson.annotations.SerializedName;
import com.yjrlab.tabdoctor.view.setting.ShowTypeEnum;
/**
* Created by jongrakmoon on 2017. 6. 8..
*/
public enum BodyPartGenderField {
@SerializedName("M")MAN,
@SerializedName("F")WOMAN,
@SerializedName("C")CHILDREN;
public static BodyPartGenderField parse(ShowTypeEnum showTypeEnum) {
if (showTypeEnum == ShowTypeEnum.MAN) {
return MAN;
} else if (showTypeEnum == ShowTypeEnum.WOMAN) {
return WOMAN;
} else if (showTypeEnum == ShowTypeEnum.BABY) {
return CHILDREN;
}
return null;
}
}
|
[
"corian1516@gmail.com"
] |
corian1516@gmail.com
|
127d9b8c9a6578eb6243d8abdd17c10df42147e3
|
37dc8ab4cb35bf5a1ab35ca14f827be188ff0698
|
/artemis-common/src/main/java/com/ctrip/soa/artemis/registry/FailedInstance.java
|
2838294847a7ca96e0e33d6a588ee5c9a5fd5786
|
[
"Apache-2.0"
] |
permissive
|
ctripcorp/artemis
|
84440e38fec5af7771b834678abb0024e1f02c41
|
9a3a2f5179801508d9925939fe8ad0eb3f8c1a56
|
refs/heads/master
| 2023-07-30T17:46:32.066517
| 2019-02-22T01:37:31
| 2019-02-22T01:37:31
| 107,536,049
| 40
| 14
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 980
|
java
|
package com.ctrip.soa.artemis.registry;
import com.ctrip.soa.artemis.Instance;
/**
* Created by Qiang Zhao on 10/07/2016.
*/
public class FailedInstance {
private Instance _instance;
private String _errorCode;
private String _errorMessage;
public FailedInstance() {
}
public FailedInstance(Instance instance, String errorCode, String errorMessage) {
_instance = instance;
_errorCode = errorCode;
_errorMessage = errorMessage;
}
public Instance getInstance() {
return _instance;
}
public void setInstance(Instance instance) {
_instance = instance;
}
public String getErrorCode() {
return _errorCode;
}
public void setErrorCode(String errorCode) {
_errorCode = errorCode;
}
public String getErrorMessage() {
return _errorMessage;
}
public void setErrorMessage(String errorMesssage) {
_errorMessage = errorMesssage;
}
}
|
[
"q_zhao@Ctrip.com"
] |
q_zhao@Ctrip.com
|
a226dff9bdc181b09576e72c92fc534880cb2312
|
436290052fdd3a7c8cabfdaffd9f8bf7ff6d325b
|
/code/bfs/java/550.java
|
8dcc49ae2fbec5bba3a16b7e3c3f23bd968e9d61
|
[] |
no_license
|
mf1832146/bi-tbcnn
|
bcf7abc3bb8c6022c1b21aac481e6fe0ac21b40f
|
309f5f16c3211f922fa04eed32fa7d6c58978faf
|
refs/heads/master
| 2020-07-30T05:48:35.117150
| 2019-03-23T14:22:54
| 2019-03-23T14:22:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,020
|
java
|
import java.util.*;
public class BFS{
public static void bfs(Graph graph){
Queue<Integer> queue = new LinkedList<Integer>();
queue.add(0);
boolean[] visited = new boolean[graph.vertices.length];
visited[0] = true;
while (!queue.isEmpty()){
int currVertex = queue.remove();
// Process here.
System.out.println("Vertex: " + currVertex +
", Edges: " + graph.vertices[currVertex].toString());
for (Integer i : graph.vertices[currVertex]){
if (!visited[i]){
queue.add(i);
visited[i] = true;
}
}
}
}
public static void main(String[] args){
boolean[][] matrix = new boolean[6][6];
matrix[0][1] = true;
matrix[0][2] = true;
matrix[1][0] = true; // 0 1 1 0 0 0
matrix[1][3] = true; // 1 0 0 1 0 0
matrix[2][0] = true; // 1 0 0 1 0 0
matrix[2][3] = true; // 0 1 1 0 1 0
matrix[3][1] = true; // 0 0 0 1 0 1
matrix[3][2] = true; // 0 0 0 0 1 0
matrix[3][4] = true;
matrix[4][3] = true;
matrix[4][5] = true;
matrix[5][4] = true;
Graph graph = new Graph(matrix);
bfs(graph);
}
}
class Graph{
Vertex[] vertices;
Graph(boolean[][] matrix){
this.vertices = graphFromAdjacencyMatrix(matrix);
}
public Vertex[] graphFromAdjacencyMatrix(boolean[][] matrix){
//Add all vertices
Vertex[] list = new Vertex[matrix.length];
for (int vertex = 0; vertex < matrix.length; vertex++){
Vertex newVertex = new Vertex();
for (int edge = 0; edge < matrix[vertex].length; edge++){
if (matrix[vertex][edge] == true){
newVertex.add(edge);
}
}
list[vertex] = newVertex;
}
return list;
}
}
class Vertex extends ArrayList<Integer>{
}
|
[
"y.yu@open.ac.uk"
] |
y.yu@open.ac.uk
|
1da0da04d514ab25635c9e7c77db7aa116f0450b
|
b280a34244a58fddd7e76bddb13bc25c83215010
|
/scmv6/center-task1/src/main/java/com/smate/center/task/v8pub/dao/sns/SnsPubDetailDAO.java
|
5f14289a5ac03dbc7754cc57b477a042ec093453
|
[] |
no_license
|
hzr958/myProjects
|
910d7b7473c33ef2754d79e67ced0245e987f522
|
d2e8f61b7b99a92ffe19209fcda3c2db37315422
|
refs/heads/master
| 2022-12-24T16:43:21.527071
| 2019-08-16T01:46:18
| 2019-08-16T01:46:18
| 202,512,072
| 2
| 3
| null | 2022-12-16T05:31:05
| 2019-08-15T09:21:04
|
Java
|
UTF-8
|
Java
| false
| false
| 302
|
java
|
package com.smate.center.task.v8pub.dao.sns;
import org.springframework.stereotype.Repository;
import com.smate.center.task.v8pub.sns.po.PubSnsDetailPO;
import com.smate.core.base.utils.data.SnsHibernateDao;
@Repository
public class SnsPubDetailDAO extends SnsHibernateDao<PubSnsDetailPO, Long> {
}
|
[
"zhiranhe@irissz.com"
] |
zhiranhe@irissz.com
|
0313a5684de0b24e38b8c714140d98426e793094
|
6a32fcd1e06877f87f6b83045ce29cd27c0f769c
|
/materialdesign_library/src/main/java/com/uidt/materialdesign_library/adapter/FeedAdapter.java
|
4135a26fb983b9efce691f5f3753040511f9abb8
|
[] |
no_license
|
yijixin/ComponentDemo
|
8909d2210bf6a05cd66d88282e00150a6f09fc40
|
a0d2f569e88ff52b4463611057de6ac56fbeb2d0
|
refs/heads/master
| 2020-09-23T20:01:28.289991
| 2019-12-20T09:21:59
| 2019-12-20T09:21:59
| 225,574,322
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,605
|
java
|
package com.uidt.materialdesign_library.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.uidt.materialdesign_library.R;
/**
* @author yijixin on 2019-12-02
*/
public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.FeedViewHolder> {
@NonNull
@Override
public FeedViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_material_design_item, parent, false);
return new FeedViewHolder(inflate);
}
@Override
public void onBindViewHolder(@NonNull FeedViewHolder feedViewHolder, int position) {
//会在绑定到ViewHolder时调用
//头像
feedViewHolder.mIvAvatar.setImageResource(getAvatarResource(position));
//名字
feedViewHolder.mTvNickname.setText("NetEase" + (position + 1));
//内容
feedViewHolder.mIvContent.setImageResource(getContentResource(position));
}
/**
* 获取头像资源ID
*/
private int getAvatarResource(int position) {
switch (position % 4) {
case 0:
return R.mipmap.avatar1;
case 1:
return R.mipmap.avatar2;
case 2:
return R.mipmap.avatar3;
case 3:
return R.mipmap.avatar4;
default:
}
return 0;
}
/**
* 获取内容资源ID
*/
private int getContentResource(int position) {
switch (position % 4) {
case 0:
return R.mipmap.taeyeon_one;
case 1:
return R.mipmap.taeyeon_two;
case 2:
return R.mipmap.taeyeon_three;
case 3:
return R.mipmap.taeyeon_four;
default:
}
return 0;
}
@Override
public int getItemCount() {
return 100;
}
public static class FeedViewHolder extends RecyclerView.ViewHolder {
ImageView mIvAvatar;
ImageView mIvContent;
TextView mTvNickname;
public FeedViewHolder(@NonNull View itemView) {
super(itemView);
mIvAvatar = itemView.findViewById(R.id.iv_avatar);
mIvContent = itemView.findViewById(R.id.iv_content);
mTvNickname = itemView.findViewById(R.id.tv_nickname);
}
}
}
|
[
"12345678"
] |
12345678
|
dbb50096f28ad9699cec87eeac764e13b63cf272
|
350d2f790c21319e2b0f992e9e2978336d50f6ca
|
/smscenter-web/src/main/java/com/sanerzone/smscenter/modules/sms/service/SmsTemplateService.java
|
58fdf1c3dd17cfba7a0c0df491f4f2261e459efc
|
[] |
no_license
|
aiical/smscenter-parent
|
f485876fe121b1a5db3e0bb71548676cbbb272a2
|
20c18770280c47d60523f4bc89044dc85b58f489
|
refs/heads/master
| 2023-02-18T00:23:46.110175
| 2020-04-19T09:57:30
| 2020-04-19T09:57:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,553
|
java
|
/**
* Copyright © 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.sanerzone.smscenter.modules.sms.service;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.sanerzone.jeebase.common.persistence.Page;
import com.sanerzone.jeebase.common.service.CrudService;
import com.sanerzone.jeebase.common.utils.StringUtils;
import com.sanerzone.jeebase.modules.sys.utils.UserUtils;
import com.sanerzone.smscenter.biz.iface.SmsConfigInterface;
import com.sanerzone.smscenter.modules.sms.dao.SmsTemplateDao;
import com.sanerzone.smscenter.modules.sms.entity.SmsTemplate;
/**
* 短信模板Service
* @author zhukc
* @version 2017-06-27
*/
@Service
@Transactional(readOnly = true)
public class SmsTemplateService extends CrudService<SmsTemplateDao, SmsTemplate> {
@Autowired
private SmsConfigInterface smsConfigInterfaceImpl;
public SmsTemplate get(String id) {
return super.get(id);
}
public List<SmsTemplate> findList(SmsTemplate smsTemplate) {
return super.findList(smsTemplate);
}
public Page<SmsTemplate> findPage(Page<SmsTemplate> page, SmsTemplate smsTemplate) {
return super.findPage(page, smsTemplate);
}
@Transactional(readOnly = false)
public void save(SmsTemplate smsTemplate) {
if("0".equals(smsTemplate.getScope())){//全局:创建人是登录人
smsTemplate.setCreateBy(UserUtils.getUser());
}
if(StringUtils.isNotBlank(smsTemplate.getId())){
dao.update(smsTemplate);
}else{
dao.insert(smsTemplate);
}
cacheTemplate(smsTemplate.getId());
}
@Transactional(readOnly = false)
public void delete(SmsTemplate smsTemplate) {
super.delete(smsTemplate);
//广播通知
smsConfigInterfaceImpl.configTemplate(2, smsTemplate.getId(), null);
}
//审核
@Transactional(readOnly = false)
public void recheckTemplate(SmsTemplate param){
dao.recheckTemplate(param);
cacheTemplate(param.getId());
}
private void cacheTemplate(String templateid){
//SmsTemplate entity = get(templateid);
//TemplateCacheHelper.put(templateid, entity);//本地缓存
Map<String,String> map = Maps.newHashMap();
map.put("id", templateid);
com.sanerzone.smscenter.biz.entity.SmsTemplate entity = dao.findBizById(map);
//广播通知
smsConfigInterfaceImpl.configTemplate(1, templateid, entity);
}
}
|
[
"563248403@qq.com"
] |
563248403@qq.com
|
d51dc2d4f914410c78206fd4db29d656b56f44f7
|
0b2d55a43b346c01174bc641d899674d6c9f2c91
|
/library/src/main/java/www/jinke/com/library/base/BaseFragmentV4.java
|
685f6186dbd2394834aee7d4ecc639b10dbbb95c
|
[] |
no_license
|
Brave-wan/Dagger
|
70f4735616548b1754db10655d7b8655b6dc2e8d
|
15d04b44d67e27344900595c6520cd8054de3587
|
refs/heads/master
| 2021-01-25T06:49:15.210179
| 2017-06-07T09:51:50
| 2017-06-07T09:51:50
| 93,615,232
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,609
|
java
|
package www.jinke.com.library.base;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import butterknife.ButterKnife;
import www.jinke.com.library.utils.commont.NetWorksUtils;
/**
* Created by root on 16-11-13.
*/
public abstract class BaseFragmentV4 extends Fragment {
protected BaseActivity mActivity;
//获取布局文件ID
protected abstract int getLayoutId();
public boolean isConnected = false;
protected abstract void initView(View view, Bundle savedInstanceState);
//获取宿主Activity
protected BaseActivity getHoldingActivity() {
return mActivity;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
isConnected = NetWorksUtils.isConnected(getActivity());
View view = inflater.inflate(getLayoutId(), container, false);
ButterKnife.bind(this, view);
initView(view, savedInstanceState);
return view;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.mActivity = (BaseActivity) context;
}
@Override
public void onDestroyView() {
super.onDestroyView();
ButterKnife.unbind(this);
}
public void showToast(String msg){
Toast.makeText(getActivity(),msg,Toast.LENGTH_SHORT).show();
}
}
|
[
"185214487@qq.com"
] |
185214487@qq.com
|
50831eb7ae6946e2508ae9defc4923321ecdfe07
|
c1a29f3534b5dffcfac6e8040120210f56f37a70
|
/spring-functionaltest-selenium/src/test/java/jp/co/ntt/fw/spring/functionaltest/selenium/vldt/CustomBeanValidationTest.java
|
03d509206eac4e553812cda72c3d9ab0abea5d8e
|
[] |
no_license
|
ptmxndys/spring-functionaltest
|
658bb332efcc811168c05d9d1366871ce3650222
|
ba2f34feb1da6312d868444fb41cf86ef554cd13
|
refs/heads/master
| 2023-02-11T21:18:06.677036
| 2021-01-04T09:43:01
| 2021-01-07T08:38:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,190
|
java
|
/*
* Copyright(c) 2014 NTT Corporation.
*
* 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 jp.co.ntt.fw.spring.functionaltest.selenium.vldt;
import static org.junit.Assert.assertThat;
import static org.hamcrest.CoreMatchers.is;
import static org.openqa.selenium.By.id;
import java.util.HashMap;
import java.util.Map;
import jp.co.ntt.fw.spring.functionaltest.selenium.FunctionTestSupport;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
/**
* VLDT 入力チェックテスト<br>
* <p>
* VLDT04 独自のBeanValidationアノテーションの作成のテストケース
* </p>
*/
public class CustomBeanValidationTest extends FunctionTestSupport {
private static WebDriver driver;
private String validate = "validate";
private String errors = ".errors";
private String currentLocale = "ja";
private static Map<String, String> localeDateFormat;
public CustomBeanValidationTest() {
localeDateFormat = new HashMap<String, String>();
localeDateFormat.put("ja", "yyyy/MM/dd");
localeDateFormat.put("en", "MM/dd/yyyy");
super.disableDefaultWebDriver();
}
@Before
public void setUp() {
if (driver == null) {
driver = webDriverCreator.createLocaleSpecifiedDriver(
currentLocale);
}
super.setCurrentWebDriver(driver);
}
/**
* VLDT0401001
* <ul>
* <li>既存ルールを組み合わせたBean Validationアノテーションを利用した場合、入力チェックが可能なことを確認する。</li>
* </ul>
*/
@Test
public void testVLDT0401001() {
String testId = "vldt0401001";
String target = "userId";
String errorMessage = "ユーザIDは、4文字以上20文字以下の半角英字で入力してください。";
// テスト画面表示
{
webDriverOperations.click(id(testId));
}
// 実施条件1
{
// テスト実行
{
webDriverOperations.overrideText(id(target),
"abcdefghijklmnopqrst");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.exists(id(target + errors)), is(
false));
}
}
// 実施条件2
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "abc");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.getText(id(target + errors)), is(
errorMessage));
}
}
// 実施条件3
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "abc1");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.getText(id(target + errors)), is(
errorMessage));
}
}
// 実施条件4
{
// テスト実行
{
webDriverOperations.overrideText(id(target),
"abcdefghijklmnopqrstu");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.getText(id(target + errors)), is(
errorMessage));
}
}
}
/**
* VLDT0402001
* <ul>
* <li>Bean Validationインタフェースの実装クラスを作成した場合、独自アノテーションを付与した対象フィールドの入力チェックが行えることを確認する。</li>
* </ul>
*/
@Test
public void testVLDT0402001() {
String testId = "vldt0402001";
String target = "ipAddress";
String errorMessage = "IPアドレスは、IPv4(インターネットプロトコルバージョン4)アドレスの形式で入力してください。";
// テスト画面表示
{
webDriverOperations.click(id(testId));
}
// 実施条件1
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "192.168.0.1");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.exists(id(target + errors)), is(
false));
}
}
// 実施条件2
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "192.168.0.256");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.getText(id(target + errors)), is(
errorMessage));
}
}
}
/**
* VLDT0402002
* <ul>
* <li>業務ロジックチェックを行う、Bean Validationインタフェースの実装クラスを作成した場合、 業務ロジックチェックの結果メッセージを入力フィールドの横に出力することができることを確認する。</li>
* </ul>
*/
@Test
public void testVLDT0402002() {
String testId = "vldt0402002";
String target = "userId";
String errorMessage = "入力されたユーザIDは、既に使用されています。";
// テスト画面表示
{
webDriverOperations.click(id(testId));
}
// 実施条件1
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "Tom");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.exists(id(target + errors)), is(
false));
}
}
// 実施条件2
{
// テスト実行
{
webDriverOperations.overrideText(id(target), "Josh");
webDriverOperations.click(id(validate));
}
// 結果確認
{
assertThat(webDriverOperations.getText(id(target + errors)), is(
errorMessage));
}
}
}
}
|
[
"macchinetta.fw@gmail.com"
] |
macchinetta.fw@gmail.com
|
f2d6b66750fd1453fb4f40b20608a846b793e22a
|
47686bbdcf8be3ee0cda1442d32fd61465a917d3
|
/ppl-engine-dc/src/main/java/com/sap/research/primelife/dc/timebasedtrigger/TimeBasedTrigger.java
|
70472d565deb1eca82730b8b265835391e47b40c
|
[] |
no_license
|
jjsendor/fiware-ppl
|
f08e8cb2e7336eaae39389936cab58cfc931a09a
|
841b01e89b929c1104b5689a23bb826337183646
|
refs/heads/master
| 2021-01-09T07:03:00.610271
| 2014-04-30T14:09:06
| 2014-04-30T14:09:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,934
|
java
|
/*******************************************************************************
* Copyright (c) 2013, SAP AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the SAP AG nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.sap.research.primelife.dc.timebasedtrigger;
import java.util.Timer;
import java.util.TimerTask;
import com.sap.research.primelife.dc.entity.OEEStatus;
import com.sap.research.primelife.dc.event.EventHandler;
import com.sap.research.primelife.dc.event.IEventHandler;
import eu.primelife.ppl.pii.impl.PIIType;
import eu.primelife.ppl.pii.impl.PiiUniqueId;
import eu.primelife.ppl.policy.obligation.impl.Action;
public abstract class TimeBasedTrigger implements ITimeBasedTrigger{
protected OEEStatus oeeStatus;
protected Action action;
protected PiiUniqueId puid;
protected PIIType pii;
protected IEventHandler eventHandler;
protected Timer timer;
protected TimerTask timerTask;
protected TimeBasedTrigger(OEEStatus oees){
this(oees, new EventHandler());
}
protected TimeBasedTrigger(OEEStatus oees, IEventHandler eventHandler){
oeeStatus = oees;
action = oees.getAction();
puid = oees.getPiiUniqueId();
pii = oees.getPiiUniqueId().getPii();
this.eventHandler = eventHandler;
timer = new Timer();
}
public synchronized void cancel() {
this.timerTask.cancel();
this.timer.cancel();
}
public abstract void start();
}
|
[
"francesco.di.cerbo@sap.com"
] |
francesco.di.cerbo@sap.com
|
23ae496e4dd0b8ba66cbd277c8fe8e5c6fc5a924
|
3e909d759fa6fb4694447064a80dfb185a77d907
|
/xmniao-saas-apiV2.4.1/src/main/java/com/xmn/saas/controller/api/v1/shop/vo/ShopPutRequest.java
|
b39c9802e3ad2eb78cf9e98bf7755d8e9d1ed838
|
[] |
no_license
|
liveqmock/seeyouagain
|
9703616f59ae0b9cd2e641d135170c84c18a257c
|
fae0cb3471f07520878e51358cfa5ea88e1d659c
|
refs/heads/master
| 2020-04-04T14:47:00.192619
| 2017-11-14T12:47:31
| 2017-11-14T12:47:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,099
|
java
|
package com.xmn.saas.controller.api.v1.shop.vo;
import com.xmn.saas.base.Request;
import com.xmn.saas.entity.shop.SellerApply;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotNull;
/**
*
*
* 类名称:ShopPutRequest 类描述: 修改店铺资料请求类 创建人:xiaoxiong 创建时间:2016年9月26日 下午6:06:06
* 修改人:xiaoxiong 修改时间:2016年9月26日 下午6:06:06 修改备注:
*
* @version
*
*/
public class ShopPutRequest extends Request {
private static final long serialVersionUID = 1L;
/**
* 商家id
*/
private Integer sellerid;
/**
* 商家名称
*/
@NotNull(message="商家名称不能为空")
private String sellerName;
/**
* 商圈ID
*/
@NotNull(message="商圈ID不能为空")
private Integer zoneId;
/**
* 地址
*/
private String address;
/**
* 联系电话
*/
@NotNull(message="手机号码不能为空")
private String phone;
/**
* 经营类型
*/
private String typeName;
/**
* 营业时间
*/
private String sdate;
/**
* 是否有wifi
*/
private Integer isWifi;
/**
* 是否可以停车
*/
private Integer isParking;
/**
* 地标
*/
private String landMark;
/**
* 平均消费
*/
private Double consume;
/**
* 营业时间
*/
private String openDate;
/**
* 修改数据来源0基本数据 1图片数据
*/
private Integer source;
/**
* 经度
*/
@NotNull(message="longitude不能为空")
private Double longitude;
/**
* 纬度
*/
@NotNull(message="latitude不能为空")
private Double latitude;
private Integer category;
//二级类别名称
private Integer genre;
//一级类别名称
private String tradename;
//省市
@NotNull(message="省不能为空不能为空")
private String province;
//城市
@NotNull(message="市不能为空")
private String city;
//地区
@NotNull(message="区不能为空")
private String area;
private String tagIds;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getTagIds() {
return tagIds;
}
public void setTagIds(String tagIds) {
this.tagIds = tagIds;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public Integer getCategory() {
return category;
}
public void setCategory(Integer category) {
this.category = category;
}
public Integer getGenre() {
return genre;
}
public void setGenre(Integer genre) {
this.genre = genre;
}
public String getTradename() {
return tradename;
}
public void setTradename(String tradename) {
this.tradename = tradename;
}
public String getOpenDate() {
return openDate;
}
public void setOpenDate(String openDate) {
this.openDate = openDate;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Integer getSellerid() {
return sellerid;
}
public void setSellerid(Integer sellerid) {
this.sellerid = sellerid;
}
public String getSellerName() {
return sellerName;
}
public void setSellerName(String sellerName) {
this.sellerName = sellerName;
}
public Integer getZoneId() {
return zoneId;
}
public void setZoneId(Integer zoneId) {
this.zoneId = zoneId;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getSdate() {
return sdate;
}
public void setSdate(String sdate) {
this.sdate = sdate;
}
public Integer getIsWifi() {
return isWifi;
}
public void setIsWifi(Integer isWifi) {
this.isWifi = isWifi;
}
public Integer getIsParking() {
return isParking;
}
public void setIsParking(Integer isParking) {
this.isParking = isParking;
}
public String getLandMark() {
return landMark;
}
public void setLandMark(String landMark) {
this.landMark = landMark;
}
public Double getConsume() {
return consume;
}
public void setConsume(Double consume) {
this.consume = consume;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
public SellerApply convertSellerApply(Integer sellerid){
SellerApply sellerApply=new SellerApply();
BeanUtils.copyProperties(this, sellerApply);
sellerApply.setSellerid(sellerid);
return sellerApply;
}
}
|
[
"641013587@qq.com"
] |
641013587@qq.com
|
21a3f54c23ecb58a7f216b47d3268435c12672ae
|
e51266ffa12c28213c4dd64a647d923f731c7bcf
|
/repexecutor/src/test/java/com/provys/report/jooxml/repexecutor/ParameterReaderTest.java
|
acd0056b11e36b0724b93c3747794280bb966920
|
[] |
no_license
|
MichalStehlikCz/JOOXML
|
2cc57bd60f38231ccb671fbfd4884d18d8ba9dd8
|
2155ba74ae8b72d46c67037373151cd26b66571f
|
refs/heads/master
| 2021-12-15T01:50:45.642359
| 2019-07-17T05:39:24
| 2019-07-17T05:39:24
| 161,041,507
| 0
| 0
| null | 2021-12-14T21:16:19
| 2018-12-09T13:20:21
|
Java
|
UTF-8
|
Java
| false
| false
| 1,708
|
java
|
package com.provys.report.jooxml.repexecutor;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;
import java.io.StringReader;
import java.util.stream.Stream;
import static org.assertj.core.api.Assertions.*;
class ParameterReaderTest {
@Nonnull
static Stream<Object[]> getParametersFromString() {
return Stream.of(new Object[]{"<PARAMETERS><TESTNAME>TESTVALUE</TESTNAME></PARAMETERS>"
, new Parameter[]{new Parameter("TESTNAME", "TESTVALUE")}, Boolean.FALSE}
, new Object[]{"<PARAMETERS><TESTNAME>TESTVALUE</TESTNAME><EMPTYPARAM/></PARAMETERS>"
, new Parameter[]{new Parameter("TESTNAME", "TESTVALUE")
, new Parameter("EMPTYPARAM", (String) null)}, Boolean.FALSE}
, new Object[]{"<PARAMETERS><TESTNAME><SECONDLEVEL/></TESTNAME></PARAMETERS>", null, Boolean.TRUE}
, new Object[]{"<SOMETHINGELSE><TESTNAME>TESTVALUE</TESTNAME></SOMETHINGELSE>", null, Boolean.TRUE});
}
@ParameterizedTest
@MethodSource
void getParametersFromString(String testData, @Nullable Parameter[] expResult, Boolean shouldFail) {
try (ParameterReader paramReader = new ParameterReader(new StringReader(testData))) {
if (shouldFail) {
assertThatThrownBy(paramReader::getParameters);
} else {
assertThat(paramReader.getParameters()).containsExactlyInAnyOrder(expResult);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
[
"michal.stehlik.cz@gmail.com"
] |
michal.stehlik.cz@gmail.com
|
d83f69c6c7fa619fd9dc5703870ba71ba6db918f
|
87c12bd26186e41ed6197437e0b1b15bfcc68fda
|
/csharp-psi-impl/src/org/mustbe/consulo/csharp/lang/psi/impl/light/CSharpLightAttributeWithSelfTypeBuilder.java
|
7409bd635c2ef8b2b82bb6a214bf5f488c76b4b9
|
[
"Apache-2.0"
] |
permissive
|
electrowolff/consulo-csharp
|
660c784441f8b2fc1c4d536bd9bb80cb4dd68a4a
|
99b54761b24b394d3fd18650de3a5f112a52aa9a
|
refs/heads/master
| 2021-01-22T14:29:07.054813
| 2016-07-30T09:19:51
| 2016-07-30T09:19:51
| 65,971,141
| 0
| 0
| null | 2016-08-18T06:27:38
| 2016-08-18T06:27:37
| null |
UTF-8
|
Java
| false
| false
| 2,103
|
java
|
/*
* Copyright 2013-2014 must-be.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.mustbe.consulo.csharp.lang.psi.impl.light;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.mustbe.consulo.RequiredReadAction;
import org.mustbe.consulo.csharp.lang.psi.impl.light.builder.CSharpLightTypeDeclarationBuilder;
import org.mustbe.consulo.csharp.lang.psi.impl.source.resolve.type.CSharpTypeRefByQName;
import org.mustbe.consulo.dotnet.psi.DotNetTypeDeclaration;
import org.mustbe.consulo.dotnet.resolve.DotNetTypeRef;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
/**
* @author VISTALL
* @since 02.09.14
*/
public class CSharpLightAttributeWithSelfTypeBuilder extends CSharpAbstractLightAttributeBuilder
{
private final CSharpLightTypeDeclarationBuilder myType;
private final DotNetTypeRef myTypeRef;
@RequiredReadAction
public CSharpLightAttributeWithSelfTypeBuilder(PsiElement scope, String qualifiedName)
{
super(scope.getProject());
myType = new CSharpLightTypeDeclarationBuilder(scope);
myType.withParentQName(StringUtil.getPackageName(qualifiedName)) ;
myType.withName(StringUtil.getShortName(qualifiedName));
myTypeRef = new CSharpTypeRefByQName(scope, qualifiedName);
}
@Nullable
@Override
public DotNetTypeDeclaration resolveToType()
{
return myType;
}
@NotNull
@Override
public DotNetTypeRef toTypeRef()
{
return myTypeRef;
}
@Override
public String toString()
{
return "CSharpLightAttributeWithSelfTypeBuilder: " + myType.getVmQName();
}
}
|
[
"vistall.valeriy@gmail.com"
] |
vistall.valeriy@gmail.com
|
0784b2c2a3b8c8fef06a15dd1b33d85b84edde33
|
979af49d5449a9c0516a9559b11d4eec69e967b3
|
/src/main/java/com/example/demo/entity/Status.java
|
6a70dbbd3f03e40cd23dd8be2b2f7fb259753218
|
[
"MIT"
] |
permissive
|
czy1004103643/RearEndLibraryInformationIntegrationLoaningPlatform
|
cc258a1962b73477d47d3b6b2970751813e30ac7
|
8fe850a5fc4910db1cc0d12ca00d5567d161c983
|
refs/heads/master
| 2020-05-01T14:45:34.572800
| 2018-06-22T10:20:49
| 2018-06-22T10:20:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 647
|
java
|
package com.example.demo.entity;
import java.io.Serializable;
import java.util.List;
/**
* @author: 李纹纹
* @date : 2018/6/6 20:10
*/
public class Status implements Serializable{
private int code;
private String msg;
private List<?> list;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List <?> getList() {
return list;
}
public void setList(List <?> list) {
this.list = list;
}
}
|
[
"itning@itning.top"
] |
itning@itning.top
|
0b0d5331814a9ee5d3134b2624346145f73c6b77
|
47d693f52a266fb1588ca892b90b0bafd5d73790
|
/util4j/src/test/java/net/jueb/util4j/test/lineDecode/LineType.java
|
06e5c220f2d2d0c95ec754c50df1e9ec8ea90f70
|
[
"Apache-2.0"
] |
permissive
|
juebanlin/util4j
|
267da3ffea65c3d1b7f8ebe0c07db4fbf30d78d4
|
5b22468295185f3b097bd0eeac90be4c0124d0b1
|
refs/heads/master
| 2023-06-25T08:27:48.732150
| 2023-04-17T10:25:39
| 2023-04-17T10:25:39
| 86,887,522
| 34
| 14
|
Apache-2.0
| 2023-06-14T22:28:25
| 2017-04-01T05:49:17
|
Java
|
UTF-8
|
Java
| false
| false
| 1,797
|
java
|
package net.jueb.util4j.test.lineDecode;
import java.util.ArrayList;
import java.util.Collections;
public enum LineType {
l1(1),l2(2),l3(3),l4(4),l5(5),l6(6),l7(7),l8(8),l9(9);
private int value;
private LineType(int value) {
this.value=value;
}
public int value()
{
return value;
}
public static LineType valueOf(int value)
{
LineType type=null;
for (LineType line:values()) {
if(line.value==value)
{
type=line;
}
}
return type;
}
/**
* 该线的种类顺序
* @param bonus
* @return
*/
public BonusType[] findLineTypes(BonusType[] bonus)
{
switch (this) {
case l1:
return new BonusType[]{bonus[5],bonus[6],bonus[7],bonus[8],bonus[9]};
case l2:
return new BonusType[]{bonus[0],bonus[1],bonus[2],bonus[3],bonus[4]};
case l3:
return new BonusType[]{bonus[10],bonus[11],bonus[12],bonus[13],bonus[14]};
case l4:
return new BonusType[]{bonus[0],bonus[6],bonus[12],bonus[8],bonus[4]};
case l5:
return new BonusType[]{bonus[10],bonus[6],bonus[2],bonus[8],bonus[14]};
case l6:
return new BonusType[]{bonus[0],bonus[1],bonus[7],bonus[3],bonus[4]};
case l7:
return new BonusType[]{bonus[10],bonus[11],bonus[7],bonus[13],bonus[14]};
case l8:
return new BonusType[]{bonus[5],bonus[1],bonus[2],bonus[3],bonus[9]};
case l9:
return new BonusType[]{bonus[5],bonus[11],bonus[12],bonus[13],bonus[9]};
default:
break;
}
return null;
}
public BonusType[] findRightLineTypes(BonusType[] bonus)
{
BonusType[] types=findLineTypes(bonus);
ArrayList<BonusType> tmps=new ArrayList<BonusType>();
for(int i=0;i<types.length;i++)
{
tmps.add(types[i]);
}
Collections.reverse(tmps);
BonusType[] rightTypes=new BonusType[tmps.size()];
tmps.toArray(rightTypes);
return rightTypes;
}
}
|
[
"a"
] |
a
|
31583628b2a9221008b891cb283e1be112efed72
|
e5b84002cb0224e689e97632a656130248d25047
|
/ServletJSPHibernate/LocationMgrEmp/src/com/LocMgrEmp/EmployeeServlet.java
|
8ed6411aab81862987b9fccff7102810eec3b172
|
[] |
no_license
|
aadvikm/JAVA_J2EE_REPO
|
4a254fda12c6a30b098ac0e04a54f4ee18cfd464
|
689fcfbcea739440795b43ef578b6312a2c144d3
|
refs/heads/master
| 2020-03-25T07:50:20.677504
| 2018-09-14T04:35:32
| 2018-09-14T04:35:32
| 143,584,253
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,605
|
java
|
package com.LocMgrEmp;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.codehaus.jackson.map.ObjectMapper;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
public class EmployeeServlet extends HttpServlet {
public EmployeeServlet() {
super();
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doService(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doService(req, resp);
}
private void doService(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
HttpSession session = req.getSession();
Session hsession = getHibernateSession();
String locId =req.getParameter("locId");
String mgrId =req.getParameter("mgrId");
SQLQuery query =hsession.createSQLQuery("Select e.employee_id as empId, (e.first_name||' '||e.last_name) as empName from employees e, departments d, locations l where e.department_id =d.department_id and d.location_id =l.location_id and e.manager_id =:mgrId and l.location_id =:locId");
query.setParameter("mgrId", mgrId);
query.setParameter("locId", locId);
ArrayList<Employee> empList =new ArrayList<Employee>();
for (Object obj : query.list()) {
Object[] objArr = (Object[]) obj;
Employee emp =new Employee(((BigDecimal)objArr[0]).longValue(), (String)objArr[1]);
empList.add(emp);
}
resp.setContentType("application/json");
PrintWriter writer = resp.getWriter();
ObjectMapper mapper = new ObjectMapper();
System.out.println(mapper.writeValueAsString(empList));
writer.write(mapper.writeValueAsString(empList));
}
private Session getHibernateSession(){
Configuration cfg=new AnnotationConfiguration();
//populates the data of the configuration file
cfg.configure("hibernate.cfg.xml");
//creating session factory object
SessionFactory factory=cfg.buildSessionFactory();
//creating session object
Session session=factory.openSession();
return session;
}
}
|
[
"Brindha@192.168.0.17"
] |
Brindha@192.168.0.17
|
f4cdc87085945284ad9ae598247ecd90c44f7a9e
|
83d56024094d15f64e07650dd2b606a38d7ec5f1
|
/sicc_druida/fuentes/java/CobTipoBalanConectorTransactionQuery.java
|
1ef9e17ce0e3f8645f917b872219d1b91894fb60
|
[] |
no_license
|
cdiglesias/SICC
|
bdeba6af8f49e8d038ef30b61fcc6371c1083840
|
72fedb14a03cb4a77f62885bec3226dbbed6a5bb
|
refs/heads/master
| 2021-01-19T19:45:14.788800
| 2016-04-07T16:20:51
| 2016-04-07T16:20:51
| null | 0
| 0
| null | null | null | null |
ISO-8859-3
|
Java
| false
| false
| 3,577
|
java
|
import org.w3c.dom.*;
import java.util.ArrayList;
public class CobTipoBalanConectorTransactionQuery implements es.indra.druida.base.ObjetoXML {
private ArrayList v = new ArrayList();
public Element getXML (Document doc){
getXML0(doc);
return (Element)v.get(0);
}
/* Primer nodo */
private void getXML0(Document doc) {
v.add(doc.createElement("CONECTOR"));
((Element)v.get(0)).setAttribute("TIPO","DRUIDATRANSACTION" );
((Element)v.get(0)).setAttribute("REVISION","3.1" );
((Element)v.get(0)).setAttribute("NOMBRE","CobTipoBalanTransactionQuery" );
((Element)v.get(0)).setAttribute("OBSERVACIONES","Conector transaccional para la ejección de query sobre la entidad CobTipoBalan" );
/* Empieza nodo:1 / Elemento padre: 0 */
v.add(doc.createElement("ENTRADA"));
((Element)v.get(0)).appendChild((Element)v.get(1));
/* Empieza nodo:2 / Elemento padre: 1 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(2)).setAttribute("NOMBRE","codTipoBala" );
((Element)v.get(2)).setAttribute("TIPO","STRING" );
((Element)v.get(2)).setAttribute("LONGITUD","1" );
((Element)v.get(1)).appendChild((Element)v.get(2));
/* Termina nodo:2 */
/* Empieza nodo:3 / Elemento padre: 1 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(3)).setAttribute("NOMBRE","pageCount" );
((Element)v.get(3)).setAttribute("TIPO","STRING" );
((Element)v.get(3)).setAttribute("LONGITUD","30" );
((Element)v.get(1)).appendChild((Element)v.get(3));
/* Termina nodo:3 */
/* Empieza nodo:4 / Elemento padre: 1 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(4)).setAttribute("NOMBRE","pageSize" );
((Element)v.get(4)).setAttribute("TIPO","STRING" );
((Element)v.get(4)).setAttribute("LONGITUD","30" );
((Element)v.get(1)).appendChild((Element)v.get(4));
/* Termina nodo:4 */
/* Termina nodo:1 */
/* Empieza nodo:5 / Elemento padre: 0 */
v.add(doc.createElement("SALIDA"));
((Element)v.get(0)).appendChild((Element)v.get(5));
/* Empieza nodo:6 / Elemento padre: 5 */
v.add(doc.createElement("ROWSET"));
((Element)v.get(6)).setAttribute("NOMBRE","result" );
((Element)v.get(6)).setAttribute("LONGITUD","50" );
((Element)v.get(5)).appendChild((Element)v.get(6));
/* Empieza nodo:7 / Elemento padre: 6 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(7)).setAttribute("NOMBRE","id" );
((Element)v.get(7)).setAttribute("TIPO","STRING" );
((Element)v.get(7)).setAttribute("LONGITUD","12" );
((Element)v.get(6)).appendChild((Element)v.get(7));
/* Termina nodo:7 */
/* Empieza nodo:8 / Elemento padre: 6 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(8)).setAttribute("NOMBRE","codTipoBala" );
((Element)v.get(8)).setAttribute("TIPO","STRING" );
((Element)v.get(8)).setAttribute("LONGITUD","1" );
((Element)v.get(6)).appendChild((Element)v.get(8));
/* Termina nodo:8 */
/* Empieza nodo:9 / Elemento padre: 6 */
v.add(doc.createElement("CAMPO"));
((Element)v.get(9)).setAttribute("NOMBRE","timestamp" );
((Element)v.get(9)).setAttribute("TIPO","STRING" );
((Element)v.get(9)).setAttribute("LONGITUD","30" );
((Element)v.get(6)).appendChild((Element)v.get(9));
/* Termina nodo:9 */
/* Termina nodo:6 */
/* Termina nodo:5 */
}
}
|
[
"hp.vega@hotmail.com"
] |
hp.vega@hotmail.com
|
442822dfc7827f3e155a8b54ff11966dfd66a934
|
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
|
/Code Snippet Repository/Spring/Spring2043.java
|
9be98824ed3400f304d723daed02083aaa9e91a8
|
[] |
no_license
|
saber13812002/DeepCRM
|
3336a244d4852a364800af3181e03e868cf6f9f5
|
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
|
refs/heads/master
| 2023-03-16T00:08:06.473699
| 2018-04-18T05:29:50
| 2018-04-18T05:29:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 776
|
java
|
CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CacheEvict cacheEvict) {
CacheEvictOperation.Builder builder = new CacheEvictOperation.Builder();
builder.setName(ae.toString());
builder.setCacheNames(cacheEvict.cacheNames());
builder.setCondition(cacheEvict.condition());
builder.setKey(cacheEvict.key());
builder.setKeyGenerator(cacheEvict.keyGenerator());
builder.setCacheManager(cacheEvict.cacheManager());
builder.setCacheResolver(cacheEvict.cacheResolver());
builder.setCacheWide(cacheEvict.allEntries());
builder.setBeforeInvocation(cacheEvict.beforeInvocation());
defaultConfig.applyDefault(builder);
CacheEvictOperation op = builder.build();
validateCacheOperation(ae, op);
return op;
}
|
[
"Qing.Mi@my.cityu.edu.hk"
] |
Qing.Mi@my.cityu.edu.hk
|
2e9336ea7cf245401edd005d86cbd0e448d4db74
|
52c36ce3a9d25073bdbe002757f08a267abb91c6
|
/src/main/java/com/alipay/api/request/AlipayGotoneMessageMailSendRequest.java
|
4c7964db51ad2448d9104183e19b97faa7fe50ab
|
[
"Apache-2.0"
] |
permissive
|
itc7/alipay-sdk-java-all
|
d2f2f2403f3c9c7122baa9e438ebd2932935afec
|
c220e02cbcdda5180b76d9da129147e5b38dcf17
|
refs/heads/master
| 2022-08-28T08:03:08.497774
| 2020-05-27T10:16:10
| 2020-05-27T10:16:10
| 267,271,062
| 0
| 0
|
Apache-2.0
| 2020-05-27T09:02:04
| 2020-05-27T09:02:04
| null |
UTF-8
|
Java
| false
| false
| 4,052
|
java
|
package com.alipay.api.request;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayGotoneMessageMailSendResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: alipay.gotone.message.mail.send request
*
* @author auto create
* @since 1.0, 2019-03-08 15:29:11
*/
public class AlipayGotoneMessageMailSendRequest implements AlipayRequest<AlipayGotoneMessageMailSendResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 模板参数
*/
private String arguments;
/**
* 收件人邮箱地址
*/
private String receiver;
/**
* 邮件模板对应的serviceCode
*/
private String serviceCode;
/**
* 邮件标题
*/
private String subject;
/**
* 用户的支付宝ID
*/
private String userId;
public void setArguments(String arguments) {
this.arguments = arguments;
}
public String getArguments() {
return this.arguments;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getReceiver() {
return this.receiver;
}
public void setServiceCode(String serviceCode) {
this.serviceCode = serviceCode;
}
public String getServiceCode() {
return this.serviceCode;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getSubject() {
return this.subject;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return this.userId;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.gotone.message.mail.send";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("arguments", this.arguments);
txtParams.put("receiver", this.receiver);
txtParams.put("service_code", this.serviceCode);
txtParams.put("subject", this.subject);
txtParams.put("user_id", this.userId);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayGotoneMessageMailSendResponse> getResponseClass() {
return AlipayGotoneMessageMailSendResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
dc87ed2d8cd4c9462d588386ac96e9779d82114e
|
0aabd164442e2206028cc34da59582915d91cf84
|
/kingshuk_core_springs/ATMAppSpringStaticFactoryMethodDemo/src/com/spi/atm/Printer.java
|
89d46a93c1921f51fe75d2ff2516f06ca307b233
|
[] |
no_license
|
kingshuknandy2016/TBT-Workspace
|
0d7339518b32fc5c6e01179b3768808e441ec606
|
fef1c5229d0e1d56d97b41b44fb066e7560c208c
|
refs/heads/master
| 2021-01-24T11:06:13.774604
| 2018-02-27T04:50:44
| 2018-02-27T04:50:44
| 123,073,378
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 634
|
java
|
package com.spi.atm;
public class Printer {
private int id;
private String name;
public Printer() {
super();
}
public Printer(int id, String name) {
super();
System.out.println("Arg -Const..");
this.id = id;
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public void printBalanceInformation(String accountNumber) {
System.out
.println("The printer has printed the balance information for the account number "
+ accountNumber);
}
}
|
[
"kingshuknandy2016@gmail.com"
] |
kingshuknandy2016@gmail.com
|
ebd9e0390391d125f1c1ea4fc58fd9a6e9e3811c
|
5e93b90a0b7c3cee3570de82aec07559576eed13
|
/P/src/mixin/COEBody.java
|
61d7af068052cdd39a430ea6b8e9de7e303414c7
|
[] |
no_license
|
priangulo/BttFTestProjects
|
a6f37c83b52273f8b5f3d7cbb7116c85a0fd4ef2
|
cc2294d24f9b0fed46110b868bd3a8f6c8794475
|
refs/heads/master
| 2021-03-27T10:30:10.316285
| 2017-10-25T21:39:55
| 2017-10-25T21:39:55
| 64,432,711
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 163
|
java
|
// Automatically generated code. Edit at your own risk!
// Generated by bali2jak v2002.09.03.
package mixin;
abstract public class COEBody extends AstNode {
}
|
[
"priangulo@gmail.com"
] |
priangulo@gmail.com
|
feee77441f43bb5f712403c330da667c4dc9b372
|
6092cbae5816a60b8124bb1921e6a90d7c7c8279
|
/java01/src/step34/exam01/Client.java
|
b07ef71eb0ad73bca0e1764197f08ae9716f275f
|
[] |
no_license
|
kyeonghunmin/mkh
|
847326c0effa8ec85a7e90554beee74eac9c854c
|
5e4fd583d889205654fc6cfc41db37430b6a3173
|
refs/heads/master
| 2020-12-24T20:14:33.579384
| 2016-05-12T08:30:23
| 2016-05-12T08:30:23
| 56,681,395
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,624
|
java
|
package step34.exam01;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Socket;
public class Client {
public static void main(String[] args) {
Socket socket = null;
InputStream in = null;
OutputStream out = null;
PrintStream out2 = null;
try {
// 1) 서버에 연결한다.
// => 서버에서 연결을 승인할 때 까지 리턴하지 않는다.
// => 만약 서버가 죽었거나, 지정된 시간동안 응답이 없을 때(timeout)
// 예외가 발생한다.
System.out.println("서버에 연결 중...");
socket = new Socket("192.168.0.31", 9999);
// 2) 서버 쪽으로 데이터를 보내고 받을 입출력 스트림을 얻는다.
in = socket.getInputStream();
out = socket.getOutputStream();
out2 = new PrintStream(out); // 데코레이터 패턴
// 3) 서버로 데이터 보내기
// => 서버가 데이터를 받아야만 println()을 리턴한다. => blocking 방식
// 그 전에는 해당 라인 다음으로 넘어가지 않는다.
System.out.println("서버에 데이터 전송 중...");
out2.println("최한비안녕ㅎㅎㅎ");
System.out.println("요청 완료!");
} catch (Exception e) {
e.printStackTrace();
} finally {
try {out2.close();} catch (Exception e) {}
try {out.close();} catch (Exception e) {}
try {in.close();} catch (Exception e) {}
try {socket.close();} catch (Exception e) {}
}
}
}
|
[
"alsrudgns88@naver.com"
] |
alsrudgns88@naver.com
|
1d6fcdaff10a8796cda1c1130d90f6c572cab4b0
|
6ac9e29bd4b5d93796aa824491ee1d96b9e84682
|
/aliyun-java-sdk-push/src/main/java/com/aliyuncs/push/model/v20160801/PushNoticeToAndroidResponse.java
|
e4b378f57283fa741ba9b6c17f5873dddb99b788
|
[
"Apache-2.0"
] |
permissive
|
zhou5852/aliyun-openapi-java-sdk
|
9190f86453930819b895a7cefead16de81ea0f1c
|
36dc87f70b5661fc4bfc9ec375c05d1b191257ae
|
refs/heads/master
| 2021-01-20T03:56:59.915648
| 2017-08-25T07:28:03
| 2017-08-25T07:28:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,697
|
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.aliyuncs.push.model.v20160801;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.push.transform.v20160801.PushNoticeToAndroidResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class PushNoticeToAndroidResponse extends AcsResponse {
private String requestId;
private String messageId;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getMessageId() {
return this.messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
@Override
public PushNoticeToAndroidResponse getInstance(UnmarshallerContext context) {
return PushNoticeToAndroidResponseUnmarshaller.unmarshall(this, context);
}
}
|
[
"haowei.yao@alibaba-inc.com"
] |
haowei.yao@alibaba-inc.com
|
795948bb1e71c57afe174d12e5bcac0f88763284
|
a3a5aeb018ab1c3e92f924e13c7e290eeec6bd06
|
/day03/流程语句/IfDemo.java
|
dc578ee88e6132a463d4dec6a49a01ad901834f1
|
[] |
no_license
|
qyl1006/JavaApps
|
bc21a25d9a28e98f83227af6b54b6b4859a7ff30
|
e47445194677531babcc7a20c8fd334f253682e1
|
refs/heads/master
| 2021-05-15T07:44:26.776608
| 2018-03-09T14:37:21
| 2018-03-09T14:37:21
| 111,789,114
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,489
|
java
|
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: IfDemo.java
import java.io.PrintStream;
public class IfDemo
{
public IfDemo()
{
}
public static void main(String args[])
{
System.out.println("10大于3");
boolean flag = true;
if (flag)
System.out.println("去男厕所");
else
System.out.println("去女厕所");
byte byte0 = 20;
byte byte1 = 100;
if (byte0 > byte1)
System.out.println((new StringBuilder()).append("最大值是:").append(byte0).toString());
else
System.out.println((new StringBuilder()).append("最大值是:").append(byte1).toString());
char c = '\u0D5F';
byte byte2 = 50;
int i;
if (c % byte2 == 0)
i = c / byte2;
else
i = c / byte2 + 1;
System.out.println((new StringBuilder()).append("总页数:").append(i).toString());
byte byte3 = 18;
if (byte3 <= i)
{
int j;
if (byte3 - 1 >= 1)
j = byte3 - 1;
else
j = 1;
int k;
if (byte3 + 1 <= i)
k = byte3 + 1;
else
k = i;
System.out.println((new StringBuilder()).append("当前页为:").append(byte3).toString());
System.out.println((new StringBuilder()).append("上一页为:").append(j).toString());
System.out.println((new StringBuilder()).append("下一页为:").append(k).toString());
} else
{
System.out.println("报错:当前页大于总页数");
}
}
}
|
[
"yuelinshi@qq.com"
] |
yuelinshi@qq.com
|
dd72284b1987d2d818b4fbee962c347937782944
|
bb672cc2dfc415bebf2e79b313c7e8dd593fe30c
|
/src/main/java/com/gaohang/springbootshiro/service/Userservice.java
|
fee042f4a5e4e1ec58a7cf031f7138fb8842bfec
|
[] |
no_license
|
gaohanghang/springboot-shiro
|
6cac5af1f7ace278b867319f6e59de8f87e6ded3
|
a9593d14384e0e57169040a18aa4dcfc9a7495dd
|
refs/heads/master
| 2020-04-17T21:25:41.967714
| 2019-01-23T01:25:11
| 2019-01-23T01:25:11
| 166,948,813
| 1
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 284
|
java
|
package com.gaohang.springbootshiro.service;
import com.gaohang.springbootshiro.domin.User;
/**
* @Description:
* @author: Gao Hang Hang
* @date 2019/01/22 12:58
*/
public interface Userservice {
public User findByName(String name);
public User findById(Integer id);
}
|
[
"1341947277@qq.com"
] |
1341947277@qq.com
|
5fbed3d5469570efc576f8667b3cf45c56efb011
|
887698756e60a3b1a9a317444ba77ebb18a3f9ee
|
/src/com/javaf/pattern/memento/IMemento.java
|
0acef0855bc27bceb917cef09fd7977c16005aaa
|
[] |
no_license
|
fabiojose/javaf
|
2edc738488b78026396c02fd7746c917f519f5b2
|
c9a2d631f6037bccb538dd5ea543ffd4efd3ded1
|
refs/heads/master
| 2020-05-26T18:49:03.160892
| 2014-04-05T13:50:46
| 2014-04-05T13:50:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 165
|
java
|
package com.javaf.pattern.memento;
/**
*
* @author fabiojm - Fábio José de Moraes
*
* @param <T>
*/
public interface IMemento<T> {
T getSavedState();
}
|
[
"fabiojose@gmail.com"
] |
fabiojose@gmail.com
|
14528372dfecc452f8f1807568a68db7eb802d6f
|
3b34ec3651055b290f99ebb43a7db0169022c924
|
/DS4P/acs-showcase/c32-parser/src/main/java/gov/samhsa/consent2share/c32/GreenCcdSerializer.java
|
e53ee0ff7211ef63069f4b6b09aa6bf26e85b008
|
[
"BSD-3-Clause"
] |
permissive
|
pmaingi/Consent2Share
|
f9f35e19d124cd40275ef6c43953773f0a3e6f25
|
00344812cd95fdc75a9a711d35f92f1d35f10273
|
refs/heads/master
| 2021-01-11T01:20:55.231460
| 2016-09-29T16:58:40
| 2016-09-29T16:58:40
| 70,718,518
| 1
| 0
| null | 2016-10-12T16:21:33
| 2016-10-12T16:21:33
| null |
UTF-8
|
Java
| false
| false
| 2,176
|
java
|
/*******************************************************************************
* Open Behavioral Health Information Technology Architecture (OBHITA.org)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> 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 gov.samhsa.consent2share.c32;
import gov.samhsa.consent2share.c32.dto.GreenCCD;
/**
* The Interface GreenCcdSerializer.
*/
public interface GreenCcdSerializer {
/**
* Deserialize.
*
* @param greenCcdXml the green ccd xml
* @return the green ccd
* @throws GreenCcdSerializerException the green ccd serializer exception
*/
GreenCCD Deserialize(String greenCcdXml) throws GreenCcdSerializerException;
}
|
[
"tao.lin@feisystems.com"
] |
tao.lin@feisystems.com
|
61e8289b0083dd03894024eb913bac4e82ac62da
|
81aa25db4e3ceed110b0b2250656fc012c035e66
|
/backjoon/backtracking/Backjoon15650.java
|
91ca777b91a1bcf173b8df959d6f76d939df20c5
|
[] |
no_license
|
DragonHee/algorithm
|
e736dba6a045b1ccb49831954e77d2a9ce898c07
|
5fbdb09d4bb12509d7062ac6f22febac5f7d7336
|
refs/heads/master
| 2021-11-10T20:37:09.918113
| 2021-11-04T12:28:21
| 2021-11-04T12:28:21
| 212,949,162
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,068
|
java
|
package backjoon.backtracking;
import java.io.*;
import java.util.StringTokenizer;
public class Backjoon15650 {
private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
private static int m, n;
private static int[] arr;
public static void main(String[] args) throws IOException {
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
n = Integer.parseInt(st.nextToken());
m = Integer.parseInt(st.nextToken());
arr = new int[m + 1];
solve(1);
bw.close();
br.close();
}
public static void solve(int cnt) throws IOException {
if(cnt - 1 == m){
for(int i = 1; i <= m; i++) bw.write(arr[i] + " ");
bw.write("\n");
return;
}
for(int i = 1; i <= n; i++){
if(arr[cnt - 1] < i) {
arr[cnt] = i;
solve(cnt + 1);
}
}
}
}
|
[
"yhk06262@naver.com"
] |
yhk06262@naver.com
|
1bd31e1fdcf5420835fd556e2153435f3c586bc3
|
47bdf7c2b72ba7b57bb9cc2ce0b94a21af4ed795
|
/information_android/asmack/org/jivesoftware/smack/sasl/SASLCramMD5Mechanism.java
|
d434530868d8b9e193058e9d1580ebdd83f80b26
|
[] |
no_license
|
srsman/information
|
a37151d3a04f6188a9919c143a2efa6355226482
|
e943c34f94c620aedde22983e6520c6c5cf86073
|
refs/heads/master
| 2021-01-17T23:09:06.372954
| 2016-04-09T10:52:04
| 2016-04-09T10:52:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,066
|
java
|
/**
* $RCSfile$
* $Revision$
* $Date$
* <p>
* <p>
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smack.sasl;
import org.jivesoftware.smack.SASLAuthentication;
/**
* Implementation of the SASL CRAM-MD5 mechanism
*
* @author Jay Kline
*/
public class SASLCramMD5Mechanism extends SASLMechanism {
public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) {
super(saslAuthentication);
}
@Override
protected String getName() {
return "CRAM-MD5";
}
}
|
[
"1047860491@qq.com"
] |
1047860491@qq.com
|
1b80988816523271821883fe8d1843ffaffff891
|
37992a7083efea148c66381a2e7c988f59de712b
|
/lan4gate/src/main/java/org/lanter/lan4gate/Implementation/Messages/Responses/Operations/ServiceOperations/PrintLastReceipt.java
|
649f90606839d3e89e60219b39aed5c52f25d1fd
|
[] |
no_license
|
RVC3/PTK
|
5ab897d6abee1f7f7be3ba49c893b97e719085e9
|
1052b2bfa8f565c96a85d5c5928ed6c938a20543
|
refs/heads/master
| 2022-12-22T22:11:40.231298
| 2020-07-01T09:45:38
| 2020-07-01T09:45:38
| 259,278,530
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,275
|
java
|
package org.lanter.lan4gate.Implementation.Messages.Responses.Operations.ServiceOperations;
import org.lanter.lan4gate.Messages.Fields.ResponseFieldsList;
import org.lanter.lan4gate.Messages.OperationsList;
import org.lanter.lan4gate.Implementation.Messages.Responses.Response;
import org.lanter.lan4gate.Implementation.Messages.Responses.ResponseBuilder;
public class PrintLastReceipt extends Response {
public PrintLastReceipt(OperationsList operationCode) {
setOperationCode(OperationsList.PrintLastReceipt);
addOptionalFields(ResponseFieldsList.EcrMerchantNumber);
addOptionalFields(ResponseFieldsList.OriginalOperationCode);
addOptionalFields(ResponseFieldsList.OriginalOperationStatus);
//Так как неизвестна операция, то необходимо забрать поля из используемой
if(!operationCode.equals(OperationsList.PrintLastReceipt)) {
ResponseBuilder builder = new ResponseBuilder();
Response operation = builder.prepareResponse(operationCode);
if(operation != null) {
addMandatoryFieldsGroup(operation.getMandatoryFields());
addOptionalFieldsGroup(operation.getOptionalFields());
}
}
}
}
|
[
"kopanevartem@mail.ru"
] |
kopanevartem@mail.ru
|
6e311870184c62deecb878c62ef6e03f9aac628f
|
8710e1116c4e0495e1715aac473c4fd2191ab0c2
|
/src/app/controller/SalaryScheduleController.java
|
1ad106edfbfb19961776157ecda0e27b5a14c27a
|
[] |
no_license
|
lcadiz/FishForever
|
002f3b8f88f0cdff16ac2f374ce5cffef2980f2e
|
987e3de26430e2d72e7be2f6a099e31105dbc15b
|
refs/heads/main
| 2023-04-30T16:28:57.983301
| 2021-04-27T01:28:56
| 2021-04-27T01:28:56
| 361,938,440
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,876
|
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 app.controller;
import app.config.DBConn;
import static app.config.DBConn.getConnection;
import app.model.ComboBoxItem;
import app.model.SalarySchedule;
import app.view.global.DefaultComboBoxView;
import app.view.global.DefaultTableView;
import static java.lang.System.out;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import static javax.swing.JOptionPane.showMessageDialog;
import javax.swing.JTable;
/**
*
* @author Engkoi Zidac
*/
public class SalaryScheduleController extends SalarySchedule {
static Statement Stmt;
DefaultTableView dtv = new DefaultTableView();
DefaultComboBoxView dcv = new DefaultComboBoxView();
String GetDetail(int d1, int d2) {
out.println(d1);
out.println(d2);
DayValueController dv = new DayValueController();
String details = "";
if (d1 > 0 && d2 > 0) {
details = "Every " + dv.GetDayValue(d1) + " and " + dv.GetDayValue(d2) + " of the month";
} else if (d1 > 0 && d2 == 0) {
details = "Every " + dv.GetDayValue(d1) + " of the month";
} else if (d1 == 0 && d2 == 0) {
details = "";
}
return details;
}
public void PopulateTableData(JTable TableObject) {
Connection Conn = getConnection();
dtv.setTableObject(TableObject);
dtv.InitializeTable();
dtv.RenderTable();
String createString = "SELECT * FROM salary_schedule s";
try {
Stmt = Conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
// String details = GetDetail(rs.getInt("Day1"), rs.getInt("Day2"));
dtv.TableModel.addRow(new Object[]{rs.getInt("SalaryScheduleId"), rs.getString("Description"), rs.getString("Remarks")});
}
Stmt.close();
Conn.close();
} catch (SQLException e) {
showMessageDialog(null, e.getMessage());
}
}
public void PopulateDataOnEdit() {
Connection Conn = getConnection();
String createString = "SELECT * FROM salary_schedule WHERE SalaryScheduleId=" + this.getSalaryScheduleId();
try {
Stmt = Conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
this.setDescription(rs.getString("Description"));
this.setRemarks(rs.getString("Remarks"));
}
Stmt.close();
Conn.close();
} catch (SQLException e) {
showMessageDialog(null, e.getMessage());
}
}
public void PopulateComboBoxData(JComboBox ComboBoxObject) {
dcv.setComboBoxObject(ComboBoxObject);
dcv.InitializeComboBox();
ComboBoxObject.addItem("--SELECT--");
Connection conn = getConnection();
String createString;
createString = "SELECT * FROM salary_schedule";
try {
Stmt = conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
ComboBoxObject.addItem(new ComboBoxItem(rs.getInt("SalaryScheduleId"), rs.getString("Description") + " : " + rs.getString("Remarks")));
}
Stmt.close();
conn.close();
} catch (SQLException e) {
e.getStackTrace();
}
}
public void PopulateComboBoxDataOnEdit(JComboBox ComboBoxObject) {
dcv.setComboBoxObject(ComboBoxObject);
dcv.InitializeComboBox();
GetCurrentDescription();
ComboBoxObject.addItem(new ComboBoxItem(this.getSalaryScheduleId(), this.getDescription() + " : " + this.getRemarks()));
Connection conn = getConnection();
String createString;
createString = "SELECT * FROM salary_schedule WHERE SalaryScheduleId<>"+this.getSalaryScheduleId();
try {
Stmt = conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
ComboBoxObject.addItem(new ComboBoxItem(rs.getInt("SalaryScheduleId"), rs.getString("Description") + " : " + rs.getString("Remarks")));
}
Stmt.close();
conn.close();
} catch (SQLException e) {
e.getStackTrace();
}
}
private void GetCurrentDescription() {
Connection conn = getConnection();
String createString;
createString = "SELECT * FROM salary_schedule WHERE SalaryScheduleId=" + this.getSalaryScheduleId();
try {
Stmt = conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
this.setDescription(rs.getString("Description"));
this.setRemarks(rs.getString("Remarks"));
}
Stmt.close();
conn.close();
} catch (SQLException e) {
e.getStackTrace();
}
}
public int Add() {
int Id = 0;
Connection conn = getConnection();
String createString;
createString = "INSERT INTO salary_schedule (Description, Remarks)"
+ " VALUES ('" + this.getDescription() + "','" + this.getRemarks() + "')";
try {
Connection Conn = getConnection();
Stmt = Conn.createStatement();
Stmt.executeUpdate(createString);
Stmt.close();
conn.close();
} catch (SQLException e) {
showMessageDialog(null, e.getMessage());
}
Id = GetInsertedId();
return Id;
}
public int GetInsertedId() {
int Id = 0;
Connection conn = getConnection();
String createString;
createString = "SELECT MAX(SalaryScheduleId) FROM salary_schedule";
try {
Stmt = conn.createStatement();
ResultSet rs = Stmt.executeQuery(createString);
while (rs.next()) {
Id = rs.getInt(1);
}
Stmt.close();
conn.close();
} catch (SQLException e) {
e.getStackTrace();
}
return Id;
}
public void Update() {
Connection conn = getConnection();
String createString;
createString = "UPDATE salary_schedule "
+ "SET "
+ "Description = '" + this.getDescription() + "', "
+ "Remarks = '" + this.getRemarks() + "' "
+ "WHERE SalaryScheduleId=" + this.getSalaryScheduleId();
try {
Connection Conn = getConnection();
Stmt = Conn.createStatement();
Stmt.executeUpdate(createString);
Stmt.close();
conn.close();
} catch (SQLException e) {
showMessageDialog(null, e.getMessage());
}
}
public void Remove() {
Connection Conn = getConnection();
String createString;
createString = "DELETE FROM payroll_period WHERE SalaryScheduleId=" + this.getSalaryScheduleId();
try {
Stmt = Conn.createStatement();
Stmt.executeUpdate(createString);
Stmt.close();
Conn.close();
} catch (SQLException e) {
showMessageDialog(null, e.getMessage());
}
}
public static void main(String[] args) {
SalaryScheduleController c = new SalaryScheduleController();
out.println(c.GetInsertedId());
}
}
|
[
"cadizlester@gmail.com"
] |
cadizlester@gmail.com
|
339b1468d06127ac887847db176b203a418f8e31
|
ecce6f70285a1a50da00835b8ceaf6e0651ecfa8
|
/Magma/bukkit/src/main/java/net/avicus/magma/network/rtp/RemoteTeleports.java
|
81440bbbfb8fe899f376bc48dc73846a62346cdc
|
[
"MIT"
] |
permissive
|
Avicus/AvicusNetwork
|
d59b69f5ee726c54edf73fb89149cd3624a4e0cd
|
26c2320788807b2452f69d6f5b167a2fbb2df698
|
refs/heads/master
| 2022-06-14T22:55:45.083832
| 2022-01-23T06:21:43
| 2022-01-23T06:21:43
| 119,120,459
| 25
| 20
|
MIT
| 2022-05-20T20:53:20
| 2018-01-27T01:10:39
|
Java
|
UTF-8
|
Java
| false
| false
| 6,253
|
java
|
package net.avicus.magma.network.rtp;
import com.google.common.collect.Maps;
import com.sk89q.bukkit.util.CommandsManagerRegistration;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.minecraft.util.commands.CommandPermissionsException;
import java.util.Map;
import java.util.UUID;
import net.avicus.compendium.commands.exception.MustBePlayerCommandException;
import net.avicus.compendium.commands.exception.TranslatableCommandErrorException;
import net.avicus.compendium.locale.text.UnlocalizedText;
import net.avicus.magma.Magma;
import net.avicus.magma.database.Database;
import net.avicus.magma.database.model.impl.Server;
import net.avicus.magma.database.model.impl.Session;
import net.avicus.magma.database.model.impl.User;
import net.avicus.magma.module.CommandModule;
import net.avicus.magma.module.ListenerModule;
import net.avicus.magma.network.server.Servers;
import net.avicus.magma.network.user.Users;
import net.avicus.magma.util.MagmaTranslations;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class RemoteTeleports implements CommandModule, ListenerModule {
public static final String PERMISSION = "hook.rtp.command";
public static ParticipationDelegate participationDelegate = viewer -> false;
private final Map<UUID, UUID> queue = Maps.newHashMap();
@SuppressWarnings("OptionalGetWithoutIsPresent")
private static void teleport(final Player victim, final UUID targetId) {
if (victim == null || targetId == null) {
return;
}
final Player target = victim.getServer().getPlayer(targetId);
if (target == null) {
victim.sendMessage(MagmaTranslations.GUI_GENERIC_ONLINE_NOT
.with(Users.getDisplay(Magma.get().database().getUsers().findByUuid(targetId).get())));
return;
}
if (participationDelegate.isParticipating(victim)) {
return;
}
victim.teleport(target);
victim.sendMessage(MagmaTranslations.RTP_GENERIC_SUCCESS_PLAYER
.with(ChatColor.GRAY, Users.getLocalizedDisplay(Users.user(target))));
}
@Command(aliases = {"rtp", "goto",
"go"}, desc = "Teleport to a player.", min = 1, max = 1, usage = "<player>")
public static void rtp(CommandContext ctx, CommandSender source) throws CommandException {
MustBePlayerCommandException.ensurePlayer(source);
if (!source.hasPermission(PERMISSION)) {
throw new CommandPermissionsException();
}
if (participationDelegate.isParticipating((Player) source)) {
throw new TranslatableCommandErrorException(
MagmaTranslations.RTP_PLAYER_TELEPORT_FAIL_PARTICIPATING);
}
new BukkitRunnable() {
@Override
public void run() {
final String name = ctx.getString(0);
final Player target = Bukkit.getPlayerExact(name);
if (target != null) {
teleport((Player) source, target.getUniqueId());
return;
}
final Database db = Magma.get().database();
final User user = db.getUsers().findByName(name).orElse(null);
if (user == null) {
source
.sendMessage(MagmaTranslations.ERROR_UNKNOWN_PLAYER.with(new UnlocalizedText(name)));
return;
}
final Session session = db.getSessions().findLatest(user.getId()).orElse(null);
if (session == null || !session.isActive()) {
source.sendMessage(
MagmaTranslations.GUI_GENERIC_ONLINE_NOT.with(Users.getLocalizedDisplay(user)));
return;
}
final Server server = session.getServer(db);
source.sendMessage(MagmaTranslations.RTP_PLAYER_TELEPORTING_REMOTE
.with(ChatColor.GREEN, Users.getLocalizedDisplay(user),
new UnlocalizedText(server.getName(), ChatColor.GOLD)));
Magma.get().getRedis().publish(new RemoteTeleportRedisMessage(Magma.get().localServer(),
((Player) source).getUniqueId(), user.getUniqueId()));
Servers.connect((Player) source, server, false, false);
}
}.runTaskAsynchronously(Magma.get());
}
public static void clickable(BaseComponent component, User user) {
component
.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/rtp " + user.getName()));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new BaseComponent[]{
new TextComponent("Click to teleport to " + Users.getDisplay(user))
}));
}
@Override
public void enable() {
Magma.get().getRedis().register(new RemoteTeleportRedisMessageConsumer(this));
}
@Override
public void registerCommands(CommandsManagerRegistration registrar) {
registrar.register(RemoteTeleports.class);
}
void queue(Server server, UUID victim, UUID target) {
if (server.getId() != Magma.get().localServer().getId()) {
this.queue.put(victim, target);
this.delayedTeleport(Bukkit.getPlayer(victim));
new BukkitRunnable() {
@Override
public void run() {
RemoteTeleports.this.queue.remove(victim);
}
}.runTaskLater(Magma.get(), 80);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void playerJoin(final PlayerJoinEvent event) {
this.delayedTeleport(event.getPlayer());
}
private void delayedTeleport(final Player victim) {
new BukkitRunnable() {
@Override
public void run() {
if (victim == null || !victim.isOnline()) {
return;
}
final UUID targetId = RemoteTeleports.this.queue.remove(victim.getUniqueId());
teleport(victim, targetId);
}
}.runTaskLater(Magma.get(), 40);
}
public interface ParticipationDelegate {
boolean isParticipating(Player viewer);
}
}
|
[
"keenan@keenant.com"
] |
keenan@keenant.com
|
655b8786763d74f584d3eae409d494d0c742c85f
|
b39700bdcf98596b7c6f073cacabe29860e2e0fd
|
/Java Basics and Java 8/ExceptionDemo1/src/com/accenture/lkm/UncheckedException.java
|
2ea0ce9de4c331b4d473319c9c2680f33519d6d5
|
[] |
no_license
|
Gizmosoft/CoreJava-Practice
|
2d721cfdfea4c439af95fc5b39a71f0a81073816
|
f7affea4152fa7f52a53d6de0fc3186d2627c032
|
refs/heads/master
| 2021-06-08T15:37:56.086277
| 2021-05-05T06:21:27
| 2021-05-05T06:21:27
| 173,529,243
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 997
|
java
|
package com.accenture.lkm;
import java.io.FileReader;
import java.util.InputMismatchException;
import java.util.Scanner;
public class UncheckedException {
public static void main(String[] args) {
int num1, num2, result=0;
try(Scanner s = new Scanner(System.in)) {
System.out.println("Enter Number1");
num1 = s.nextInt();
System.out.println("Enter Number2");
num2 = s.nextInt();
result = num1/num2;
}
catch(InputMismatchException e) {
System.out.println(e.getMessage());
}
catch(ArithmeticException e) {
System.out.println(e.getMessage());
}
catch(RuntimeException e) {
System.out.println(e.getMessage());
}
// finally {
// s.close();
// }
// catch(InputMismatchException | ArithmeticException e)
// {
// System.out.println(e.getMessage());
// }
System.out.println("Result is "+result);
System.out.println("Welcome to Exception Handling");
}
}
// JDK 7 - a single catch to handle multiple exceptions
// Exceptions should be in the same class level in the Hierarchy
|
[
"Kartikey.hebbar@gmail.com"
] |
Kartikey.hebbar@gmail.com
|
b7e640c1ef70e01279c87c0b61368954511218f0
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Math/13/org/apache/commons/math3/optim/linear/NoFeasibleSolutionException_NoFeasibleSolutionException_35.java
|
7bcd12a486d206ccab0014fc0a81fbddfe2244ec
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 388
|
java
|
org apach common math3 optim linear
repres except thrown optim solut fulfil constraint
version feasibl solut except nofeasiblesolutionexcept java 14z
feasibl solut except nofeasiblesolutionexcept math illeg state except mathillegalstateexcept
simpl constructor messag
feasibl solut except nofeasiblesolutionexcept
local format localizedformat feasibl solut
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
8fc5c3685bda455dc12ac9fc95679c57c0709642
|
a09b3117997c93d75af1570940f4617cf7bd3695
|
/compiler/core/src/zserio/antlr/util/ParseErrorListener.java
|
4cbd3c921cd7f672f4a4259d8ab9aa5167d44440
|
[
"BSD-3-Clause"
] |
permissive
|
leland17/zserio
|
8bdf1d3523e400aaec9b6663c34ca7d135d70a1c
|
edd4de30484f14ab90d8edd8afb7f230292ca13f
|
refs/heads/master
| 2020-09-28T01:59:47.188827
| 2019-12-06T14:57:04
| 2019-12-06T14:57:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,881
|
java
|
package zserio.antlr.util;
import org.antlr.v4.runtime.BaseErrorListener;
import org.antlr.v4.runtime.InputMismatchException;
import org.antlr.v4.runtime.RecognitionException;
import org.antlr.v4.runtime.Recognizer;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.misc.ParseCancellationException;
import zserio.antlr.ZserioParser;
import zserio.ast.AstLocation;
import zserio.ast.ParserException;
import zserio.ast.ParserStackedException;
/**
* ANTLR4 error listener implementation which terminates parsing in case of an parsing error.
*/
public class ParseErrorListener extends BaseErrorListener
{
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol,
int line, int charPositionInLine, String msg,
RecognitionException e) throws ParseCancellationException
{
final AstLocation location = new AstLocation(recognizer.getInputStream().getSourceName(), line,
charPositionInLine);
if (e instanceof InputMismatchException && isKeyword(e.getOffendingToken()))
{
final ParserStackedException stackedException = new ParserStackedException(location,
"'" + e.getOffendingToken().getText() + "' is a reserved keyword!");
stackedException.pushMessage(location, msg);
throw stackedException;
}
else
{
throw new ParserException(new AstLocation(recognizer.getInputStream().getSourceName(), line,
charPositionInLine), msg);
}
}
private boolean isKeyword(Token token)
{
if (token == null)
return false;
// according to keywords defined in ZserioLexer.g4
if (token.getType() >= ZserioParser.ALIGN && token.getType() <= ZserioParser.VARUINT64)
return true;
return false;
}
}
|
[
"milan.kriz@eccam.com"
] |
milan.kriz@eccam.com
|
a674c262dca6fc33ba92f2669b380a747218b600
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_3265dbf973a427f4dc6850d1b5a415a3806efb95/CodeProportion/2_3265dbf973a427f4dc6850d1b5a415a3806efb95_CodeProportion_t.java
|
5e90d406f8067a6f7374bd41c6a02ddd0ccb507f
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 2,460
|
java
|
// Copyright (c) 2009 by the projectusus.org contributors
// This software is released under the terms and conditions
// of the Eclipse Public License (EPL) 1.0.
// See http://www.eclipse.org/legal/epl-v10.html for details.
package org.projectusus.core.internal.proportions.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.projectusus.core.internal.proportions.sqi.IsisMetrics;
import org.projectusus.core.internal.proportions.sqi.NewWorkspaceResults;
import org.projectusus.core.internal.proportions.sqi.ProjectResults;
public class CodeProportion {
private final IsisMetrics metric;
private final int violations;
private final int basis;
private final double sqi;
public CodeProportion( IsisMetrics metric ) {
this( metric, 0, 0, 0 );
}
public CodeProportion( IsisMetrics metric, int violations, int basis, double sqi ) {
this.metric = metric;
this.violations = violations;
this.basis = basis;
this.sqi = sqi;
}
public Double getSQIValue() {
return new Double( sqi );
}
public int getViolations() {
return violations;
}
public int getBasis() {
return basis;
}
@Override
public String toString() {
return metric.toString() + ": " + violations + " / " + basis; //$NON-NLS-1$ //$NON-NLS-2$
}
public IsisMetrics getMetric() {
return metric;
}
public List<IHotspot> getHotspots() {
Map<IFile, Integer> violations = new HashMap<IFile, Integer>();
collectViolations( metric, violations );
List<IHotspot> result = new ArrayList<IHotspot>();
for( IFile file : violations.keySet() ) {
result.add( new Hotspot( file, violations.get( file ) ) );
}
return result;
}
// internal
// ////////
private void collectViolations( IsisMetrics metric, Map<IFile, Integer> violations ) {
Collection<ProjectResults> projectResults = NewWorkspaceResults.getInstance().getAllProjectResults();
for( ProjectResults result : projectResults ) {
Map<IFile, Integer> projectViolations = result.getViolationsForProject( metric );
violations.putAll( projectViolations );
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
163447fc0dd614b975934cba8b06dcec8820c4ff
|
f4fd782488b9cf6d99d4375d5718aead62b63c69
|
/com/planet_ink/coffee_mud/WebMacros/AreaScriptData.java
|
6c1f0431516ecf043b2fe61a4397db527eb9269e
|
[
"Apache-2.0"
] |
permissive
|
sfunk1x/CoffeeMud
|
89a8ca1267ecb0c2ca48280e3b3930ee1484c93e
|
0ac2a21c16dfe3e1637627cb6373d34615afe109
|
refs/heads/master
| 2021-01-18T11:20:53.213200
| 2015-09-17T19:16:30
| 2015-09-17T19:16:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,578
|
java
|
package com.planet_ink.coffee_mud.WebMacros;
import com.planet_ink.coffee_web.interfaces.*;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.net.URLEncoder;
import java.util.*;
/*
Copyright 2011-2015 Bo Zimmerman
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.
*/
public class AreaScriptData extends AreaScriptNext
{
@Override public String name() { return "AreaScriptData"; }
@Override
public String runMacro(HTTPRequest httpReq, String parm)
{
final java.util.Map<String,String> parms=parseParms(parm);
final String area=httpReq.getUrlParameter("AREA");
if((area==null)||(area.length()==0))
return "@break@";
final String script=httpReq.getUrlParameter("AREASCRIPT");
if((script==null)||(script.length()==0))
return "@break@";
final TreeMap<String,ArrayList<AreaScriptInstance>> list = getAreaScripts(httpReq,area);
final ArrayList<AreaScriptInstance> subList = list.get(script);
if(subList == null)
return " @break@";
AreaScriptInstance entry = null;
String last=httpReq.getUrlParameter("AREASCRIPTHOST");
if((last!=null)&&(last.length()>0))
{
for(final AreaScriptInstance inst : subList)
{
final String hostName = CMParms.combineWith(inst.path, '.',0, inst.path.size()) + "." + inst.fileName;
if(hostName.equalsIgnoreCase(last))
{
entry=inst;
break;
}
}
}
else
entry=(subList.size()>0)?subList.get(0):null;
if(parms.containsKey("NEXT")||parms.containsKey("RESET"))
{
if(parms.containsKey("RESET"))
{
if(last!=null)
httpReq.removeUrlParameter("AREASCRIPTHOST");
return "";
}
String lastID="";
for(final AreaScriptInstance inst : subList)
{
final String hostName = CMParms.combineWith(inst.path, '.',0, inst.path.size()) + "." + inst.fileName;
if((last==null)||((last.length()>0)&&(last.equals(lastID))&&(!hostName.equals(lastID))))
{
httpReq.addFakeUrlParameter("AREASCRIPTHOST",hostName);
last=hostName;
return "";
}
lastID=hostName;
}
httpReq.addFakeUrlParameter("AREASCRIPTHOST","");
if(parms.containsKey("EMPTYOK"))
return "<!--EMPTY-->";
return " @break@";
}
final StringBuilder str = new StringBuilder("");
if(parms.containsKey("NUMHOSTS"))
str.append(subList.size()+", ");
if(parms.containsKey("FILE") && (entry != null))
str.append(Resources.makeFileResourceName(entry.fileName)+", ");
if(parms.containsKey("RESOURCEKEY") && (entry != null))
str.append(entry.instanceKey+", ");
if(parms.containsKey("RESOURCEKEYENCODED") && (entry != null))
try
{
str.append(URLEncoder.encode(entry.instanceKey,"UTF-8")+", ");
}catch(final Exception e){}
if(parms.containsKey("PATH") && (entry != null))
{
final String path=Resources.makeFileResourceName(entry.fileName);
final int x=path.lastIndexOf('/');
str.append(((x<0)?"":path.substring(0,x))+", ");
}
if(parms.containsKey("ENTRYPATH") && (entry != null))
str.append(CMParms.combineWith(entry.path, '.',0, entry.path.size())+", ");
if(parms.containsKey("CUSTOMSCRIPT") && (entry != null))
try
{
String s = entry.customScript;
if(parms.containsKey("PARSELED") && (s.trim().length()>0))
{
final StringBuffer st=new StringBuffer("");
final List<List<String>> V = CMParms.parseDoubleDelimited(s,'~',';');
for(final List<String> LV : V)
{
for(final String L : LV)
st.append(L+"\n\r");
st.append("\n\r");
}
s=st.toString();
}
str.append(webify(new StringBuffer(s))+", ");
}catch(final Exception e){}
if(parms.containsKey("FILENAME") && (entry != null))
{
final String path=Resources.makeFileResourceName(entry.fileName);
final int x=path.lastIndexOf('/');
str.append(((x<0)?path:path.substring(x+1))+", ");
}
if(parms.containsKey("ENCODEDPATH") && (entry != null))
{
final String path=Resources.makeFileResourceName(entry.fileName);
final int x=path.lastIndexOf('/');
try
{
str.append(URLEncoder.encode(((x<0)?"":path.substring(0,x)),"UTF-8")+", ");
}catch(final Exception e){}
}
if(parms.containsKey("ENCODEDFILENAME") && (entry != null))
{
final String path=Resources.makeFileResourceName(entry.fileName);
final int x=path.lastIndexOf('/');
try
{
str.append(URLEncoder.encode(((x<0)?path:path.substring(x+1)),"UTF-8")+", ");
}catch(final Exception e){}
}
if(parms.containsKey("ROOM") && (entry != null) && (entry.path.size()>1))
str.append(entry.path.get(1)+", ");
if(parms.containsKey("AREA") && (entry != null))
str.append(entry.path.get(0)+", ");
if(parms.containsKey("SCRIPTKEY") && (entry != null))
str.append(entry.instanceKey+", ");
if(parms.containsKey("CLEARRESOURCE") && (entry != null))
Resources.removeResource(entry.instanceKey);
if(parms.containsKey("ISCUSTOM") && (entry != null))
str.append(entry.key.equalsIgnoreCase("Custom")+", ");
if(parms.containsKey("ISFILE") && (entry != null))
str.append(!entry.key.equalsIgnoreCase("Custom")+", ");
String strstr=str.toString();
if(strstr.endsWith(", "))
strstr=strstr.substring(0,strstr.length()-2);
return clearWebMacros(strstr);
}
}
|
[
"bo@zimmers.net"
] |
bo@zimmers.net
|
19a1f655fedae4c8ae2da93342da6a441441a318
|
a1f54c4fc08b70dfcde20dd3dc2e0b544850ceb9
|
/PIJ(Эккель)/src/ch_07/SpaceShipControls.java
|
024b3808929530d09a2e5885a430298cb7101dfa
|
[] |
no_license
|
smith1984/java_src_tutorial
|
175d4f69e443084f82c48ab7457dcacfae3dfb23
|
50fd98e37d675f597074a6e53a9ef34824d5fcd4
|
refs/heads/master
| 2020-04-09T03:38:38.848665
| 2018-12-01T21:57:20
| 2018-12-01T21:57:20
| 159,990,788
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 301
|
java
|
package ch_07;//: reusing/SpaceShipControls.java
public class SpaceShipControls {
void up(int velocity) {}
void down(int velocity) {}
void left(int velocity) {}
void right(int velocity) {}
void forward(int velocity) {}
void back(int velocity) {}
void turboBoost() {}
} ///:~
|
[
"smith150384@gmail.com"
] |
smith150384@gmail.com
|
80f9630527c205ceb780be87d0264b2717d61e14
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/13/13_3f3c140753c0a7f5c63cc5714a287f8e1a16515c/LuceneArabicAnalyzer/13_3f3c140753c0a7f5c63cc5714a287f8e1a16515c_LuceneArabicAnalyzer_t.java
|
eb56a6388f8597f8fa2e7b1a8f975e93b3389256
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 5,547
|
java
|
package ivory.core.tokenize;
import ivory.core.Constants;
import java.io.IOException;
import java.io.StringReader;
import java.text.Normalizer;
import java.text.Normalizer.Form;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.ar.ArabicNormalizationFilter;
import org.apache.lucene.analysis.ar.ArabicStemFilter;
import org.apache.lucene.analysis.standard.StandardFilter;
import org.apache.lucene.analysis.standard.StandardTokenizer;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.util.Version;
import edu.umd.hooka.VocabularyWritable;
import edu.umd.hooka.alignment.HadoopAlign;
public class LuceneArabicAnalyzer extends ivory.core.tokenize.Tokenizer {
private static final Logger LOG = Logger.getLogger(LuceneArabicAnalyzer.class);
static{
LOG.setLevel(Level.WARN);
}
private org.apache.lucene.analysis.Tokenizer tokenizer;
@Override
public void configure(Configuration conf) {
configure(conf, null);
}
@Override
public void configure(Configuration conf, FileSystem fs) {
// read stopwords from file (stopwords will be empty set if file does not exist or is empty)
String stopwordsFile = conf.get(Constants.StopwordList);
stopwords = readInput(fs, stopwordsFile);
String stemmedStopwordsFile = conf.get(Constants.StemmedStopwordList);
stemmedStopwords = readInput(fs, stemmedStopwordsFile);
isStopwordRemoval = !stopwords.isEmpty();
isStemming = conf.getBoolean(Constants.Stemming, true);
VocabularyWritable vocab;
try {
vocab = (VocabularyWritable) HadoopAlign.loadVocab(new Path(conf.get(Constants.CollectionVocab)), fs);
setVocab(vocab);
} catch (Exception e) {
LOG.warn("No vocabulary provided to tokenizer.");
vocab = null;
}
LOG.warn("Stemming is " + isStemming + "; Stopword removal is " + isStopwordRemoval +"; number of stopwords: " + stopwords.size() +"; stemmed: " + stemmedStopwords.size());
}
@Override
public String[] processContent(String text) {
text = preNormalize(text);
tokenizer = new StandardTokenizer(Version.LUCENE_35, new StringReader(text));
TokenStream tokenStream = new LowerCaseFilter(Version.LUCENE_35, tokenizer);
String tokenized = postNormalize(streamToString(tokenStream));
tokenized = Normalizer.normalize(tokenized, Form.NFKC);
StringBuilder finalTokenized = new StringBuilder();
for (String token : tokenized.split(" ")) {
if ( isStopwordRemoval() && isDiscard(false, token) ) {
continue;
}
finalTokenized.append( token + " " );
}
String stemmedTokenized = finalTokenized.toString().trim();
if (isStemming()) {
// then, run the Lucene normalization and stemming on the stopword-removed text
stemmedTokenized = stem(stemmedTokenized);
}
return stemmedTokenized.split(" ");
}
@Override
public String stem(String token) {
tokenizer = new StandardTokenizer(Version.LUCENE_35, new StringReader(token));
TokenStream tokenStream = new ArabicStemFilter(new ArabicNormalizationFilter(tokenizer));
CharTermAttribute termAtt = tokenStream.getAttribute(CharTermAttribute.class);
tokenStream.clearAttributes();
StringBuilder stemmed = new StringBuilder();
try {
while (tokenStream.incrementToken()) {
String curToken = termAtt.toString();
if ( vocab != null && vocab.get(curToken) <= 0) {
continue;
}
stemmed.append( curToken + " " );
}
}catch (IOException e) {
e.printStackTrace();
}
return stemmed.toString().trim();
}
@Override
public float getOOVRate(String text, VocabularyWritable vocab) {
int countOOV = 0, countAll = 0;
tokenizer = new StandardTokenizer(Version.LUCENE_35, new StringReader(text));
TokenStream tokenStream = new StandardFilter(Version.LUCENE_35, tokenizer);
tokenStream = new LowerCaseFilter(Version.LUCENE_35, tokenStream);
String tokenized = postNormalize(streamToString(tokenStream));
StringBuilder finalTokenized = new StringBuilder();
for (String token : tokenized.split(" ")) {
if ( isStopwordRemoval() && isDiscard(false, token) ) {
continue;
}
if (!isStemming()) {
if ( vocab != null && vocab.get(token) <= 0) {
countOOV++;
}
countAll++;
}else {
finalTokenized.append( token + " " );
}
}
if (isStemming()) {
tokenizer = new StandardTokenizer(Version.LUCENE_35, new StringReader(finalTokenized.toString().trim()));
tokenStream = new ArabicStemFilter(new ArabicNormalizationFilter(tokenizer));
CharTermAttribute termAtt = tokenStream.getAttribute(CharTermAttribute.class);
tokenStream.clearAttributes();
try {
while (tokenStream.incrementToken()) {
String curToken = termAtt.toString();
if ( vocab != null && vocab.get(curToken) <= 0) {
countOOV++;
}
countAll++;
}
} catch (IOException e) {
e.printStackTrace();
}
}
return (countOOV / (float) countAll);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
2f769fc520a732790954cfc2a5a492ff9d9eef5c
|
028cbe18b4e5c347f664c592cbc7f56729b74060
|
/external/modules/bean-validator/hibernate-validator/5.0.0.Alpha2/engine/src/test/java/org/hibernate/validator/test/internal/xml/mixedconfiguration/xml/PersonCompetition.java
|
a361faf9ab93774ddf1c600f0d6ad6b436199816
|
[
"Apache-2.0"
] |
permissive
|
dmatej/Glassfish-SVN-Patched
|
8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e
|
269e29ba90db6d9c38271f7acd2affcacf2416f1
|
refs/heads/master
| 2021-05-28T12:55:06.267463
| 2014-11-11T04:21:44
| 2014-11-11T04:21:44
| 23,610,469
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,048
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.validator.test.internal.xml.mixedconfiguration.xml;
public class PersonCompetition extends Competition {
public PersonCompetition() {
super();
}
public PersonCompetition(String name) {
super( name );
}
}
|
[
"mtaube@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] |
mtaube@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5
|
5acaafa65dea9d386480be57846e7f554dea1981
|
061b938a85dc1abd40e51cab7637134980de7744
|
/hydrograph.ui/hydrograph.ui.common/src/main/java/hydrograph/ui/common/component/config/ObjectFactory.java
|
793323050cf72414d90aefe30220b81850bcc6b0
|
[
"Apache-2.0"
] |
permissive
|
koundeld/Hydrograph
|
186e652d8f03a793437fd33e8e27cf605a24a830
|
de3d39994eb34bce8067da98c27f91ee1b800aa1
|
refs/heads/master
| 2021-07-03T13:13:42.509342
| 2017-06-15T13:17:02
| 2017-06-15T13:17:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,397
|
java
|
/*******************************************************************************
* Copyright 2017 Capital One Services, LLC and Bitwise, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.05.17 at 01:02:05 PM IST
//
package hydrograph.ui.common.component.config;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the hydrograph.ui.common.component.config package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: hydrograph.ui.common.component.config
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link Config }
*
*/
public Config createConfig() {
return new Config();
}
/**
* Create an instance of {@link Component }
*
*/
public Component createComponent() {
return new Component();
}
/**
* Create an instance of {@link TypeInfo }
*
*/
public TypeInfo createTypeInfo() {
return new TypeInfo();
}
/**
* Create an instance of {@link PortInfo }
*
*/
public PortInfo createPortInfo() {
return new PortInfo();
}
/**
* Create an instance of {@link PortSpecification }
*
*/
public PortSpecification createPortSpecification() {
return new PortSpecification();
}
/**
* Create an instance of {@link Operations }
*
*/
public Operations createOperations() {
return new Operations();
}
/**
* Create an instance of {@link Policy }
*
*/
public Policy createPolicy() {
return new Policy();
}
/**
* Create an instance of {@link Property }
*
*/
public Property createProperty() {
return new Property();
}
/**
* Create an instance of {@link IOPort }
*
*/
public IOPort createIOPort() {
return new IOPort();
}
}
|
[
"alpesh.kulkarni@bitwiseglobal.com"
] |
alpesh.kulkarni@bitwiseglobal.com
|
6dedcf5b05d0f4ffc78c57f90d244a66cfb4ebeb
|
af6251ee729995455081c4f4e48668c56007e1ac
|
/domain/src/main/java/mmp/gps/domain/statistics/SectionOverspeedDetail.java
|
6e3a3b6e671c7c36bc7338abe02df30254cac4c2
|
[] |
no_license
|
LXKing/monitor
|
b7522d5b95d2cca7e37a8bfc66dc7ba389e926ef
|
7d1eca454ce9a93fc47c68f311eca4dcd6f82603
|
refs/heads/master
| 2020-12-01T08:08:53.265259
| 2018-12-24T12:43:32
| 2018-12-24T12:43:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,983
|
java
|
package mmp.gps.domain.statistics;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SectionOverspeedDetail {
private String deviceNumber;
private String motorcade;
private String plateNumber;
private int times;
private long duration;
private Date start;
private Date end;
private List<SectionOverspeedDto> detail = new ArrayList<SectionOverspeedDto>();
@Override
public String toString() {
return "SectionOverspeedDetail{" + "deviceNumber='" + deviceNumber + '\'' + ", motorcade='" + motorcade + '\'' + ", plateNumber='" + plateNumber + '\'' + ", times=" + times + ", duration=" + duration + ", " + "start=" + start + ", end=" + end + ", detail=" + detail + '}';
}
public String getDeviceNumber() {
return deviceNumber;
}
public void setDeviceNumber(String deviceNumber) {
this.deviceNumber = deviceNumber;
}
public String getMotorcade() {
return motorcade;
}
public void setMotorcade(String motorcade) {
this.motorcade = motorcade;
}
public String getPlateNumber() {
return plateNumber;
}
public void setPlateNumber(String plateNumber) {
this.plateNumber = plateNumber;
}
public int getTimes() {
return times;
}
public void setTimes(int times) {
this.times = times;
}
public long getDuration() {
return duration;
}
public void setDuration(long duration) {
this.duration = duration;
}
public Date getStart() {
return start;
}
public void setStart(Date start) {
this.start = start;
}
public Date getEnd() {
return end;
}
public void setEnd(Date end) {
this.end = end;
}
public List<SectionOverspeedDto> getDetail() {
return detail;
}
public void setDetail(List<SectionOverspeedDto> detail) {
this.detail = detail;
}
}
|
[
"heavenlystate@163.com"
] |
heavenlystate@163.com
|
46071df3094874caca868877919ec5e79847a57b
|
01420890e66b9c9d8688e8e7c5899c83aa40caac
|
/dataservice-module/src/test/java/de/hshannover/f4/trust/metalyzer/api/util/FilterHelperTest.java
|
9298ae2a7775fc2e9acfaa8bbbe988fd50fc3685
|
[
"Apache-2.0"
] |
permissive
|
trustathsh/metalyzer
|
18d52f8244183855421321893153fe14451dfbfc
|
7bffdba7030e94ebcbe50d8a9c75db2b86af609b
|
refs/heads/master
| 2021-01-17T13:56:30.256472
| 2016-06-29T08:20:06
| 2016-06-29T08:20:06
| 24,188,741
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,761
|
java
|
/*
* #%L
* =====================================================
* _____ _ ____ _ _ _ _
* |_ _|_ __ _ _ ___| |_ / __ \| | | | ___ | | | |
* | | | '__| | | / __| __|/ / _` | |_| |/ __|| |_| |
* | | | | | |_| \__ \ |_| | (_| | _ |\__ \| _ |
* |_| |_| \__,_|___/\__|\ \__,_|_| |_||___/|_| |_|
* \____/
*
* =====================================================
*
* Hochschule Hannover
* (University of Applied Sciences and Arts, Hannover)
* Faculty IV, Dept. of Computer Science
* Ricklinger Stadtweg 118, 30459 Hannover, Germany
*
* Email: trust@f4-i.fh-hannover.de
* Website: http://trust.f4.hs-hannover.de/
*
* This file is part of metalyzer-dataservice-module, version 0.1.1,
* implemented by the Trust@HsH research group at the Hochschule Hannover.
* %%
* Copyright (C) 2013 - 2016 Trust@HsH
* %%
* 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.
* #L%
*/
package de.hshannover.f4.trust.metalyzer.api.util;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import de.hshannover.f4.trust.metalyzer.api.StandardIdentifierType;
import de.hshannover.f4.trust.metalyzer.api.exception.FilterException;
import de.hshannover.f4.trust.metalyzer.api.exception.MetalyzerAPIException;
import de.hshannover.f4.trust.metalyzer.api.exception.NoFilterException;
import de.hshannover.f4.trust.metalyzer.api.helper.FilterHelper;
public class FilterHelperTest {
@Test
public void testConvertSTIToStringDevice() throws MetalyzerAPIException {
StandardIdentifierType filter = StandardIdentifierType.DEVICE;
assertEquals("Returns a converted Filter", FilterHelper.convertSTItoString(filter), "device");
}
@Test(expected = FilterException.class)
public void testConvertSTIToStringALL() throws MetalyzerAPIException {
StandardIdentifierType filter = StandardIdentifierType.ALL;
assertEquals("Tests if a Filter Exception is thrown.", FilterHelper.convertSTItoString(filter), "device");
}
@Test(expected = NoFilterException.class)
public void testConvertSTIToStringNull() throws MetalyzerAPIException {
assertEquals("Tests if a NoFilter Exception is thrown.", FilterHelper.convertSTItoString(null), "device");
}
}
|
[
"bahellma@googlemail.com"
] |
bahellma@googlemail.com
|
3d09a5570b283a371d47bd5790a3276827afb3c9
|
50a6454e6512116f65c9652d7f5ff738eaef3785
|
/src/main/java/com/micros/app/client/UserFeignClientInterceptor.java
|
6be6bc6d712cbd740e64bae8a5ae3eaae841ff35
|
[] |
no_license
|
burakddev/jhipster-sample-application
|
53c0836444ad7291b5197405f6d54e53dc0cae74
|
c415141d97055d2a1c9b77a8e50b767510f3d61f
|
refs/heads/main
| 2023-07-10T07:57:58.151809
| 2021-08-07T15:03:44
| 2021-08-07T15:03:44
| 393,714,326
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 603
|
java
|
package com.micros.app.client;
import com.micros.app.security.SecurityUtils;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;
@Component
public class UserFeignClientInterceptor implements RequestInterceptor {
private static final String AUTHORIZATION_HEADER = "Authorization";
private static final String BEARER = "Bearer";
@Override
public void apply(RequestTemplate template) {
SecurityUtils.getCurrentUserJWT().ifPresent(s -> template.header(AUTHORIZATION_HEADER, String.format("%s %s", BEARER, s)));
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
6891913c39c816fc4eb291c3e2bd384a08e601a9
|
a4a51084cfb715c7076c810520542af38a854868
|
/src/main/java/com/shopee/protocol/action/ChangeOrderAddress.java
|
99f440df4e151332c8ddee7b2e347ec17ed7007b
|
[] |
no_license
|
BharathPalanivelu/repotest
|
ddaf56a94eb52867408e0e769f35bef2d815da72
|
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
|
refs/heads/master
| 2020-09-30T18:55:04.802341
| 2019-12-02T10:52:08
| 2019-12-02T10:52:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,134
|
java
|
package com.shopee.protocol.action;
import com.shopee.protocol.shop.BuyerAddress;
import com.squareup.wire.Message;
import com.squareup.wire.ProtoField;
public final class ChangeOrderAddress extends Message {
public static final Integer DEFAULT_BUYER_ADDRESS_ID = 0;
public static final Long DEFAULT_ORDERID = 0L;
public static final String DEFAULT_REQUESTID = "";
public static final String DEFAULT_SHIPPING_ADDRESS = "";
public static final String DEFAULT_SHIPPING_NAME = "";
public static final String DEFAULT_SHIPPING_PHONE = "";
public static final String DEFAULT_TAX_ADDRESS = "";
public static final String DEFAULT_TOKEN = "";
private static final long serialVersionUID = 0;
@ProtoField(tag = 5)
public final BuyerAddress buyer_address;
@ProtoField(tag = 4, type = Message.Datatype.INT32)
public final Integer buyer_address_id;
@ProtoField(tag = 3, type = Message.Datatype.INT64)
public final Long orderid;
@ProtoField(tag = 1, type = Message.Datatype.STRING)
public final String requestid;
@ProtoField(tag = 9, type = Message.Datatype.STRING)
public final String shipping_address;
@ProtoField(tag = 7, type = Message.Datatype.STRING)
public final String shipping_name;
@ProtoField(tag = 8, type = Message.Datatype.STRING)
public final String shipping_phone;
@ProtoField(tag = 6, type = Message.Datatype.STRING)
public final String tax_address;
@ProtoField(tag = 2, type = Message.Datatype.STRING)
public final String token;
public ChangeOrderAddress(String str, String str2, Long l, Integer num, BuyerAddress buyerAddress, String str3, String str4, String str5, String str6) {
this.requestid = str;
this.token = str2;
this.orderid = l;
this.buyer_address_id = num;
this.buyer_address = buyerAddress;
this.tax_address = str3;
this.shipping_name = str4;
this.shipping_phone = str5;
this.shipping_address = str6;
}
private ChangeOrderAddress(Builder builder) {
this(builder.requestid, builder.token, builder.orderid, builder.buyer_address_id, builder.buyer_address, builder.tax_address, builder.shipping_name, builder.shipping_phone, builder.shipping_address);
setBuilder(builder);
}
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ChangeOrderAddress)) {
return false;
}
ChangeOrderAddress changeOrderAddress = (ChangeOrderAddress) obj;
if (!equals((Object) this.requestid, (Object) changeOrderAddress.requestid) || !equals((Object) this.token, (Object) changeOrderAddress.token) || !equals((Object) this.orderid, (Object) changeOrderAddress.orderid) || !equals((Object) this.buyer_address_id, (Object) changeOrderAddress.buyer_address_id) || !equals((Object) this.buyer_address, (Object) changeOrderAddress.buyer_address) || !equals((Object) this.tax_address, (Object) changeOrderAddress.tax_address) || !equals((Object) this.shipping_name, (Object) changeOrderAddress.shipping_name) || !equals((Object) this.shipping_phone, (Object) changeOrderAddress.shipping_phone) || !equals((Object) this.shipping_address, (Object) changeOrderAddress.shipping_address)) {
return false;
}
return true;
}
public int hashCode() {
int i = this.hashCode;
if (i != 0) {
return i;
}
String str = this.requestid;
int i2 = 0;
int hashCode = (str != null ? str.hashCode() : 0) * 37;
String str2 = this.token;
int hashCode2 = (hashCode + (str2 != null ? str2.hashCode() : 0)) * 37;
Long l = this.orderid;
int hashCode3 = (hashCode2 + (l != null ? l.hashCode() : 0)) * 37;
Integer num = this.buyer_address_id;
int hashCode4 = (hashCode3 + (num != null ? num.hashCode() : 0)) * 37;
BuyerAddress buyerAddress = this.buyer_address;
int hashCode5 = (hashCode4 + (buyerAddress != null ? buyerAddress.hashCode() : 0)) * 37;
String str3 = this.tax_address;
int hashCode6 = (hashCode5 + (str3 != null ? str3.hashCode() : 0)) * 37;
String str4 = this.shipping_name;
int hashCode7 = (hashCode6 + (str4 != null ? str4.hashCode() : 0)) * 37;
String str5 = this.shipping_phone;
int hashCode8 = (hashCode7 + (str5 != null ? str5.hashCode() : 0)) * 37;
String str6 = this.shipping_address;
if (str6 != null) {
i2 = str6.hashCode();
}
int i3 = hashCode8 + i2;
this.hashCode = i3;
return i3;
}
public static final class Builder extends Message.Builder<ChangeOrderAddress> {
public BuyerAddress buyer_address;
public Integer buyer_address_id;
public Long orderid;
public String requestid;
public String shipping_address;
public String shipping_name;
public String shipping_phone;
public String tax_address;
public String token;
public Builder() {
}
public Builder(ChangeOrderAddress changeOrderAddress) {
super(changeOrderAddress);
if (changeOrderAddress != null) {
this.requestid = changeOrderAddress.requestid;
this.token = changeOrderAddress.token;
this.orderid = changeOrderAddress.orderid;
this.buyer_address_id = changeOrderAddress.buyer_address_id;
this.buyer_address = changeOrderAddress.buyer_address;
this.tax_address = changeOrderAddress.tax_address;
this.shipping_name = changeOrderAddress.shipping_name;
this.shipping_phone = changeOrderAddress.shipping_phone;
this.shipping_address = changeOrderAddress.shipping_address;
}
}
public Builder requestid(String str) {
this.requestid = str;
return this;
}
public Builder token(String str) {
this.token = str;
return this;
}
public Builder orderid(Long l) {
this.orderid = l;
return this;
}
public Builder buyer_address_id(Integer num) {
this.buyer_address_id = num;
return this;
}
public Builder buyer_address(BuyerAddress buyerAddress) {
this.buyer_address = buyerAddress;
return this;
}
public Builder tax_address(String str) {
this.tax_address = str;
return this;
}
public Builder shipping_name(String str) {
this.shipping_name = str;
return this;
}
public Builder shipping_phone(String str) {
this.shipping_phone = str;
return this;
}
public Builder shipping_address(String str) {
this.shipping_address = str;
return this;
}
public ChangeOrderAddress build() {
return new ChangeOrderAddress(this);
}
}
}
|
[
"noiz354@gmail.com"
] |
noiz354@gmail.com
|
e21cfa68b0a4229401c2c10f14c6867a91fe9cc8
|
bfba3b96cd5d8706ff3238c6ce9bf10967af89cf
|
/src/main/java/com/robertx22/age_of_exile/vanilla_mc/potion_effects/compat_food_effects/ManaRegenFoodEffect.java
|
576be822825b3b92e88f3986b9744730f33b64fa
|
[] |
no_license
|
panbanann/Age-of-Exile
|
e6077d89a5ab8f2389e9926e279aa8360960c65a
|
cc54a9aa573dec42660b0684fffbf653015406cf
|
refs/heads/master
| 2023-04-12T14:16:56.379334
| 2021-05-04T21:13:19
| 2021-05-04T21:13:19
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,070
|
java
|
package com.robertx22.age_of_exile.vanilla_mc.potion_effects.compat_food_effects;
import com.robertx22.age_of_exile.saveclasses.gearitem.gear_bases.TooltipInfo;
import com.robertx22.age_of_exile.saveclasses.unit.ResourceType;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import java.util.ArrayList;
import java.util.List;
public class ManaRegenFoodEffect extends FoodEffectPotion {
public static ManaRegenFoodEffect INSTANCE = new ManaRegenFoodEffect(3035801);
protected ManaRegenFoodEffect(int color) {
super(color);
}
@Override
public ResourceType resourceType() {
return ResourceType.mana;
}
@Override
public List<Text> GetTooltipString(TooltipInfo info, int duration, int amplifier) {
List<Text> list = new ArrayList<>();
int val = (int) getTotalRestored(info.unitdata, amplifier);
list.add(new LiteralText("Restores " + val + " Mana over " + duration / 20 + "s").formatted(Formatting.AQUA));
return list;
}
}
|
[
"treborx555@gmail.com"
] |
treborx555@gmail.com
|
d97821a10ea9cd056654f6eb1fee55695b7607d0
|
5bc9d8f92f38967cc9ecc03000c0606dbbb38f74
|
/sca4j/modules/tags/sca4j-modules-parent-pom-0.3.3/extension/binding/sca4j-binding-test-harness/src/main/java/org/sca4j/tests/binding/harness/callback/SyncClientServiceImplSync.java
|
599717947a8cf9ee5f7744df703a9d26d3dc814c
|
[] |
no_license
|
codehaus/service-conduit
|
795332fad474e12463db22c5e57ddd7cd6e2956e
|
4687d4cfc16f7a863ced69ce9ca81c6db3adb6d2
|
refs/heads/master
| 2023-07-20T00:35:11.240347
| 2011-08-24T22:13:28
| 2011-08-24T22:13:28
| 36,342,601
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,811
|
java
|
/**
* SCA4J
* Copyright (c) 2009 - 2099 Service Symphony Ltd
*
* Licensed to you 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 included in this distrubtion or you may obtain a copy at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* 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.
*
* This project contains code licensed from the Apache Software Foundation under
* the Apache License, Version 2.0 and original code from project contributors.
*
*
* Original Codehaus Header
*
* Copyright (c) 2007 - 2008 fabric3 project contributors
*
* Licensed to you 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 included in this distrubtion or you may obtain a copy at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* 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.
*
* This project contains code licensed from the Apache Software Foundation under
* the Apache License, Version 2.0 and original code from project contributors.
*
* Original Apache Header
*
* Copyright (c) 2005 - 2006 The Apache Software Foundation
*
* Apache Tuscany is an effort undergoing incubation at The Apache Software
* Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
* required of all newly accepted projects until a further review indicates that
* the infrastructure, communications, and decision making process have stabilized
* in a manner consistent with other successful ASF projects. While incubation
* status is not necessarily a reflection of the completeness or stability of the
* code, it does indicate that the project has yet to be fully endorsed by the ASF.
*
* This product includes software developed by
* The Apache Software Foundation (http://www.apache.org/).
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.sca4j.tests.binding.harness.callback;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
/**
* @version $Revision$ $Date$
*/
@Service(interfaces = {SyncClientService.class, SyncCallbackService.class})
public class SyncClientServiceImplSync implements SyncClientService, SyncCallbackService {
@Reference
protected SyncForwardService forwardService;
public void invoke(String data) {
forwardService.invoke("test");
}
public void onCallback(String data) {
}
}
|
[
"meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e"
] |
meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e
|
d156266290527f62ade6003c8ecf350a96621157
|
90b2989e14577f8c2dafaa2ad0e42c81068a717a
|
/Bilibili-end/bilibili/bilibili-user/src/main/java/com/yudachi/user/service/SmsService.java
|
20bfadc67d599674d764d5420aefcf70571eaec0
|
[
"MIT"
] |
permissive
|
xll-Yudachi/Bilibili
|
cace1761cfc88f827b505a7de69d8a2a9f31c70f
|
36a74c2aad49a941a3b96eb80984668790e18e35
|
refs/heads/master
| 2023-06-11T18:43:24.198028
| 2023-05-25T14:25:04
| 2023-05-25T14:25:04
| 229,255,809
| 13
| 3
| null | 2023-01-05T03:28:09
| 2019-12-20T11:51:10
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,022
|
java
|
package com.yudachi.user.service;
import com.yudachi.user.utils.GenerateUtil;
import com.yudachi.user.utils.SMSUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
@Service
public class SmsService {
@Autowired
private StringRedisTemplate redisTemplate;
@Value("${SMS.APP_ID}")
private Integer appid;
@Value("${SMS.APP_KEY}")
private String appkey;
@Value("${SMS.NATION_CODE}")
private String nationCode;
@Value("${SMS.TEMPLATE_ID}")
private Integer templateId;
@Value("${SMS.SIGN}")
private String sign;
public void sendRegisterSms(String phone) {
String code = GenerateUtil.generateCode();
System.err.println(code);
redisTemplate.opsForValue().set(phone, code);
SMSUtil.sendSms(code, appid, appkey, nationCode, phone, templateId, sign);
}
}
|
[
"452419829@qq.com"
] |
452419829@qq.com
|
f7ed1eb2879580d0ad9e0232ea7199d31dffb9ac
|
78e55bd14e9ad42cfa51dcc2d5335948469cc3b8
|
/src/check/PasswordCheckSize.java
|
d33b36daa6069b8ea3fb3da534a35fbd27a9cae2
|
[] |
no_license
|
robsonbittencourt/SmartPass
|
ed005a39506d4b5c72aedb4b3e03b99115db9f3b
|
a28101dc7f8f4491e97494a9f06ef9fcc1a39615
|
refs/heads/master
| 2021-01-06T20:36:46.012053
| 2014-06-18T19:14:32
| 2014-06-18T19:14:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 577
|
java
|
package check;
import static type.PasswordStrengthType.MEDIUM;
import static type.PasswordStrengthType.STRONG;
import static type.PasswordStrengthType.WEAK;
import type.PasswordStrengthType;
import model.Password;
public class PasswordCheckSize extends PasswordCheck {
public PasswordCheckSize(double weight) {
super(weight);
}
public PasswordStrengthType checkPasswordStrength(Password password) {
int passwordLength = password.getPassword().length();
if(passwordLength < 4)
return WEAK;
if(passwordLength < 9)
return MEDIUM;
return STRONG;
}
}
|
[
"robson.luizv@gmail.com"
] |
robson.luizv@gmail.com
|
2d9c00bb9a9e63e443789fec8ccc1741c460ca84
|
d81b8829ebc2deea1acf4b41b39e8eda2734a952
|
/SQL/src/test/java/ru/job4j/tracker/TrackerSQLTest.java
|
0e1925d99c718c7faebd0d4ff6b260f6ca63e039
|
[
"Apache-2.0"
] |
permissive
|
DmitriyShaplov/job4j
|
6d8c4b505f0f6bd9f19d6e829370eb45492e73c7
|
46acbe6deb17ecfd00492533555f27e0df481d37
|
refs/heads/master
| 2022-12-04T14:51:37.185520
| 2021-02-01T21:41:00
| 2021-02-01T21:59:02
| 159,066,243
| 0
| 0
|
Apache-2.0
| 2022-11-16T12:25:02
| 2018-11-25T19:23:23
|
Java
|
UTF-8
|
Java
| false
| false
| 6,163
|
java
|
package ru.job4j.tracker;
import org.hamcrest.core.Is;
import org.junit.Test;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.List;
import java.util.Properties;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.*;
/**
* @author shaplov
* @since 06.04.2019
*/
public class TrackerSQLTest {
public Connection init() {
try (InputStream in = TrackerSQL.class.getClassLoader()
.getResourceAsStream("app.properties")) {
Properties config = new Properties();
config.load(in);
return DriverManager.getConnection(
config.getProperty("url"),
config.getProperty("username"),
config.getProperty("password")
);
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
@Test
public void checkConnection() throws Exception {
try (TrackerSQL sql = new TrackerSQL()) {
assertThat(sql.init(), is(true));
}
}
@Test
public void createItem() throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
tracker.add(new Item("name", "desc"));
assertThat(tracker.findByName("name").size(), is(1));
}
}
@Test
public void whenReplaceNameThenReturnNewName() throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item previous = new Item("test1", "testDescription");
tracker.add(previous);
Item next = new Item("test2", "testDescription2");
next.setId(previous.getId());
tracker.replace(previous.getId(), next);
assertThat(tracker.findById(previous.getId()).getName(), is("test2"));
}
}
@Test
public void whenAddThreeAndFindAllThenArrayLengthThree() throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item item = new Item("test1", "testDesc1");
tracker.add(item);
item = new Item("test2", "testDesc2");
tracker.add(item);
item = new Item("test3", "testDesc3");
tracker.add(item);
List<Item> result = tracker.findAll();
String resultName = result.get(2).getName();
int expectLength = 3;
String expectName = "test3";
assertThat(result.size(), Is.is(expectLength));
assertThat(resultName, is(expectName));
}
}
@Test
public void whenAddThreeAndFindByNameThenArrayLengthTwo() throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item item = new Item("test1", "testDesc1");
tracker.add(item);
item = new Item("test1", "testDesc2");
tracker.add(item);
item = new Item("test3", "testDesc3");
tracker.add(item);
List<Item> result = tracker.findByName("test1");
int expectLength = 2;
assertThat(result.size(), is(expectLength));
}
}
@Test
public void whenFindByIdThenExpectedId() throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item item = new Item("test1", "testDesc1");
tracker.add(item);
item = new Item("test2", "testDesc2");
tracker.add(item);
String expectedId = item.getId();
item = new Item("test3", "testDesc3");
tracker.add(item);
Item result = tracker.findById(expectedId);
String resultId = result.getId();
assertThat(resultId, is(expectedId));
}
}
@Test
public void whenDeleteItemInMiddleThenArrayLengthDecreasesAndCantFindItemAndLastItemNewEqualsLastItemOld()
throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item item = new Item("test1", "testDesc1");
tracker.add(item);
item = new Item("test2", "testDesc2");
tracker.add(item);
String deletingId = item.getId();
item = new Item("test3", "testDesc3");
tracker.add(item);
List<Item> oldItems = tracker.findAll();
int oldLength = oldItems.size();
String oldName = oldItems.get(oldItems.size() - 1).getName();
tracker.delete(deletingId);
List<Item> newItems = tracker.findAll();
int newLength = newItems.size();
String newName = newItems.get(newItems.size() - 1).getName();
Item findResult = tracker.findById(deletingId);
assertNull(findResult);
assertThat(newLength, is(oldLength - 1));
assertThat(newName, is(oldName));
}
}
@Test
public void whenDeleteLastItemThenArrayLengthDecreasesAndCantFindItemAndLastItemNewEqualsPreviousItemOld()
throws Exception {
try (TrackerSQL tracker = new TrackerSQL(ConnectionRollback.create(this.init()))) {
Item item = new Item("test1", "testDesc1");
tracker.add(item);
item = new Item("test2", "testDesc2");
tracker.add(item);
item = new Item("test3", "testDesc3");
tracker.add(item);
String deletingId = item.getId();
List<Item> oldItems = tracker.findAll();
int oldLength = oldItems.size();
String oldName = oldItems.get(oldItems.size() - 2).getName();
tracker.delete(deletingId);
List<Item> newItems = tracker.findAll();
int newLength = newItems.size();
String newName = newItems.get(newItems.size() - 1).getName();
Item findResult = tracker.findById(deletingId);
assertNull(findResult);
assertThat(newLength, is(oldLength - 1));
assertThat(newName, is(oldName));
}
}
}
|
[
"shaplovd@gmail.com"
] |
shaplovd@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.