blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 1
79
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
af01c94fea9375408dde8899312e82a6b649f17b | 7feea917627c60424cc22621fc7436e845c5f996 | /projects/anyframe-flex-query-pi/src/main/java/org/anyframe/plugin/flex/query/dept/service/DeptService.java | 11f0fc8175fa562c0a811c4f9b542cdaa17ddbbb | [] | no_license | anyframejava/anyframe-flex-query | 824dde8dcf1034c96fd0486d46d455ff7bfef6f8 | 88b46ef87fcb40ec505bd3567c10788c3e14363e | refs/heads/master | 2021-01-24T08:00:06.797903 | 2018-04-06T05:31:30 | 2018-04-06T05:31:30 | 93,368,017 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,266 | java | /*
* Copyright 2008-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.anyframe.plugin.flex.query.dept.service;
import java.util.List;
import java.util.Map;
import org.anyframe.pagination.Page;
import org.anyframe.plugin.flex.query.domain.Dept;
import org.anyframe.plugin.flex.query.domain.SearchVO;
public interface DeptService {
Page getPagingList(SearchVO searchVO) throws Exception;
List<Dept> getTree(SearchVO searchVO) throws Exception;
int create(Dept dept) throws Exception;
int update(Dept dept) throws Exception;
int remove(Dept dept) throws Exception;
Map<String, Integer> saveAll(List<Dept> list) throws Exception;
List<Dept> getList(SearchVO searchVO) throws Exception;
} | [
"anyframe@samsung.com"
] | anyframe@samsung.com |
bd43b01af7a670cbc86ee7d5f9e0154cab1c74f6 | 18ae7f67a749a5cfed36163b750f0caf1f514dcf | /src/main/java/com/onshape/api/responses/FeatureStudiosCreateFeatureStudioResponse.java | 0d83c43da7412cb87de982a9a78ceb48ef850654 | [
"MIT"
] | permissive | Change2improve/java-client | d936d35d20d8dbb192d2470f096d06babd034b65 | 5da89caf8c678342376b67eafd6a0fba6289a41a | refs/heads/master | 2020-04-11T05:50:54.304309 | 2018-11-01T14:31:47 | 2018-11-01T14:31:47 | 161,561,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,926 | java | // The MIT License (MIT)
//
// Copyright (c) 2018 - Present Onshape Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
package com.onshape.api.responses;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.onshape.api.Onshape;
import java.lang.Override;
import java.lang.String;
import java.util.Map;
import javax.validation.constraints.NotNull;
/**
* Response object for createFeatureStudio API endpoint.
* © 2018 Onshape Inc.
*/
@JsonIgnoreProperties(
ignoreUnknown = true
)
public final class FeatureStudiosCreateFeatureStudioResponse {
/**
* Element name
*/
@JsonProperty("name")
@NotNull
String name;
/**
* Element ID
*/
@JsonProperty("id")
@NotNull
String id;
/**
* Element type (for example, "PARTSTUDIO")
*/
@JsonProperty("elementType")
@NotNull
String elementType;
/**
* Onshape internal use
*/
@JsonProperty("type")
@NotNull
String type;
/**
* Length units, for Part Studio elements only
*/
@JsonProperty("lengthUnits")
@NotNull
String lengthUnits;
/**
* Angle units, for Part Studio elements only
*/
@JsonProperty("angleUnits")
@NotNull
String angleUnits;
/**
* Thumbnail information
*/
@JsonProperty("thumbnailInfo")
@NotNull
Map thumbnailInfo;
/**
* Onshape internal use
*/
@JsonProperty("thumbnails")
@NotNull
Map thumbnails;
/**
* Get Element name
*
* @return Element name
*
*/
public final String getName() {
return this.name;
}
/**
* Get Element ID
*
* @return Element ID
*
*/
public final String getId() {
return this.id;
}
/**
* Get Element type (for example, "PARTSTUDIO")
*
* @return Element type (for example, "PARTSTUDIO")
*
*/
public final String getElementType() {
return this.elementType;
}
/**
* Get Onshape internal use
*
* @return Onshape internal use
*
*/
public final String getType() {
return this.type;
}
/**
* Get Length units, for Part Studio elements only
*
* @return Length units, for Part Studio elements only
*
*/
public final String getLengthUnits() {
return this.lengthUnits;
}
/**
* Get Angle units, for Part Studio elements only
*
* @return Angle units, for Part Studio elements only
*
*/
public final String getAngleUnits() {
return this.angleUnits;
}
/**
* Get Thumbnail information
*
* @return Thumbnail information
*
*/
public final Map getThumbnailInfo() {
return this.thumbnailInfo;
}
/**
* Get Onshape internal use
*
* @return Onshape internal use
*
*/
public final Map getThumbnails() {
return this.thumbnails;
}
@Override
public String toString() {
return Onshape.toString(this);
}
}
| [
"peter.harman@deltatheta.com"
] | peter.harman@deltatheta.com |
97bed9d80d145de80a23404d9269c51b9bdfbb19 | 8d6d39728ee0749ffce108d76072c6d9e22f040f | /src/main/java/de/userservice/VO/Department.java | 00620402c54f1d590786aee5adbc77a62d9dc47b | [] | no_license | AIRAT1/user-service | 40f51c67ab4cba59aeeb119ea2c4c5445be4d14d | d07af2a8b074c5f96a9b1ba50ebdc203b068a7e7 | refs/heads/master | 2023-03-09T23:07:28.115804 | 2021-02-22T05:38:37 | 2021-02-22T05:38:37 | 339,818,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package de.userservice.VO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {
private Long departmentId;
private String departmentName;
private String departmentAddress;
private String departmentCode;
}
| [
"ayrat1@mail.ru"
] | ayrat1@mail.ru |
1d7aeb3eaea8105a0957ad1f2b4e493fba495651 | a16611c75fa0c8699bdf97ab1a9d24c442d48a57 | /ucloude-uts/ucloude-uts-monitor/src/main/java/cn/uway/ucloude/uts/monitor/access/face/JobTrackerMAccess.java | ae43b43a48452df8c5b54b7bc3fae017abebf141 | [] | no_license | un-knower/yuncaiji_v4 | cfaf3f18accb794901f70f7252af30280414e7ed | a4ff027e485272b73e2c6fb3f1dd098f5499086b | refs/heads/master | 2020-03-17T23:14:40.121595 | 2017-05-21T05:55:51 | 2017-05-21T05:55:51 | 134,036,686 | 0 | 1 | null | 2018-05-19T06:35:12 | 2018-05-19T06:35:12 | null | UTF-8 | Java | false | false | 270 | java | package cn.uway.ucloude.uts.monitor.access.face;
import java.util.List;
import cn.uway.ucloude.uts.monitor.access.domain.JobTrackerMDataPo;
/**
* @author uway
*/
public interface JobTrackerMAccess {
void insert(List<JobTrackerMDataPo> jobTrackerMDataPos);
}
| [
"1852300415@qq.com"
] | 1852300415@qq.com |
1bf3c35087e4913cf72a196a8e8e8e1dbd793271 | 3b91ed788572b6d5ac4db1bee814a74560603578 | /com/tencent/mm/plugin/game/ui/GameIndexWxagView$1.java | f7400a5f540ff99b7c54fc740d9272719a6eb3d5 | [] | no_license | linsir6/WeChat_java | a1deee3035b555fb35a423f367eb5e3e58a17cb0 | 32e52b88c012051100315af6751111bfb6697a29 | refs/heads/master | 2020-05-31T05:40:17.161282 | 2018-08-28T02:07:02 | 2018-08-28T02:07:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,118 | java | package com.tencent.mm.plugin.game.ui;
import android.view.View;
import android.view.View.OnClickListener;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.appbrand.n.d;
import com.tencent.mm.plugin.appbrand.report.AppBrandStatObject;
import com.tencent.mm.plugin.game.d.dl;
import com.tencent.mm.plugin.game.model.an;
class GameIndexWxagView$1 implements OnClickListener {
final /* synthetic */ int jUG;
final /* synthetic */ GameIndexWxagView jYW;
GameIndexWxagView$1(GameIndexWxagView gameIndexWxagView, int i) {
this.jYW = gameIndexWxagView;
this.jUG = i;
}
public final void onClick(View view) {
if (view.getTag() != null && (view.getTag() instanceof dl)) {
dl dlVar = (dl) view.getTag();
AppBrandStatObject appBrandStatObject = new AppBrandStatObject();
appBrandStatObject.scene = 1079;
((d) g.l(d.class)).a(this.jYW.getContext(), dlVar.hbL, dlVar.jQb, dlVar.jTy, 0, dlVar.jTx, appBrandStatObject);
an.a(this.jYW.getContext(), 10, 1025, 999, 30, dlVar.jQb, this.jUG, null);
}
}
}
| [
"707194831@qq.com"
] | 707194831@qq.com |
d97c268f43efdb211c662419c38e3a10a6251e1b | 5c00167c61faaf2e83849a91cc0e574c66336e80 | /canova-api/src/main/java/org/canova/api/util/ClassPathResource.java | 42757c269c94f421773b24f55553f75ff6a4f229 | [
"Apache-2.0"
] | permissive | ljzzju/Canova | 041a13c3d50d6f5eaf86e75e1afdf070f21efc82 | 2f7df2d936217925449f6286e6c3ef4f0158d7b3 | refs/heads/master | 2020-07-13T14:41:48.309356 | 2016-01-12T02:58:05 | 2016-01-12T02:58:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,784 | java | package org.canova.api.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* Simple utility class used to get access to files at the classpath, or packed into jar.
* Based on Spring ClassPathResource implementation + jar internals access implemented.
*
*
* @author raver119@gmail.com
*/
public class ClassPathResource {
private String resourceName;
private static Logger log = LoggerFactory.getLogger(ClassPathResource.class);
/**
* Builds new ClassPathResource object
*
* @param resourceName String name of resource, to be retrieved
*/
public ClassPathResource(String resourceName) {
if (resourceName == null) throw new IllegalStateException("Resource name can't be null");
this.resourceName = resourceName;
}
/**
* Returns URL of the requested resource
*
* @return URL of the resource, if it's available in current Jar
*/
private URL getUrl() {
ClassLoader loader = null;
try {
loader = Thread.currentThread().getContextClassLoader();
} catch (Exception e) {
// do nothing
}
if (loader == null) {
loader = ClassPathResource.class.getClassLoader();
}
URL url = loader.getResource(this.resourceName);
if (url == null) {
// try to check for mis-used starting slash
// TODO: see TODO below
if (this.resourceName.startsWith("/")) {
url = loader.getResource(this.resourceName.replaceFirst("[\\\\/]",""));
if (url != null) return url;
} else {
// try to add slash, to make clear it's not an issue
// TODO: change this mechanic to actual path purifier
url = loader.getResource("/" + this.resourceName);
if (url != null) return url;
}
throw new IllegalStateException("Resource '" + this.resourceName + "' cannot be found.");
}
return url;
}
/**
* Returns requested ClassPathResource as File object
*
* Please note: if this method called from compiled jar, temporary file will be created to provide File access
*
* @return File requested at constructor call
* @throws FileNotFoundException
*/
public File getFile() throws FileNotFoundException {
URL url = this.getUrl();
if (isJarURL(url)) {
/*
This is actually request for file, that's packed into jar. Probably the current one, but that doesn't matters.
*/
try {
url = extractActualUrl(url);
File file = File.createTempFile("canova_temp","file");
file.deleteOnExit();
ZipFile zipFile = new ZipFile(url.getFile());
ZipEntry entry = zipFile.getEntry(this.resourceName);
if (entry == null) {
if (this.resourceName.startsWith("/")) {
entry = zipFile.getEntry(this.resourceName.replaceFirst("/",""));
if (entry == null) {
throw new FileNotFoundException("Resource " + this.resourceName + " not found");
}
} else throw new FileNotFoundException("Resource " + this.resourceName + " not found");
}
InputStream stream = zipFile.getInputStream(entry);
FileOutputStream outputStream = new FileOutputStream(file);
byte[] array = new byte[1024];
int rd = 0;
do {
rd = stream.read(array);
outputStream.write(array,0,rd);
} while (rd == 1024);
outputStream.flush();
outputStream.close();
stream.close();
zipFile.close();
return file;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
/*
It's something in the actual underlying filesystem, so we can just go for it
*/
try {
URI uri = new URI(url.toString().replaceAll(" ", "%20"));
return new File(uri.getSchemeSpecificPart());
} catch (URISyntaxException e) {
return new File(url.getFile());
}
}
}
/**
* Checks, if proposed URL is packed into archive.
*
* @param url URL to be checked
* @return True, if URL is archive entry, False otherwise
*/
private boolean isJarURL(URL url) {
String protocol = url.getProtocol();
return "jar".equals(protocol) || "zip".equals(protocol) || "wsjar".equals(protocol) || "code-source".equals(protocol) && url.getPath().contains("!/");
}
/**
* Extracts parent Jar URL from original ClassPath entry URL.
*
* @param jarUrl Original URL of the resource
* @return URL of the Jar file, containing requested resource
* @throws MalformedURLException
*/
private URL extractActualUrl(URL jarUrl) throws MalformedURLException {
String urlFile = jarUrl.getFile();
int separatorIndex = urlFile.indexOf("!/");
if(separatorIndex != -1) {
String jarFile = urlFile.substring(0, separatorIndex);
try {
return new URL(jarFile);
} catch (MalformedURLException var5) {
if(!jarFile.startsWith("/")) {
jarFile = "/" + jarFile;
}
return new URL("file:" + jarFile);
}
} else {
return jarUrl;
}
}
/**
* Returns requested ClassPathResource as InputStream object
*
* @return File requested at constructor call
* @throws FileNotFoundException
*/
public InputStream getInputStream() throws FileNotFoundException {
URL url = this.getUrl();
if (isJarURL(url)) {
try {
url = extractActualUrl(url);
ZipFile zipFile = new ZipFile(url.getFile());
ZipEntry entry = zipFile.getEntry(this.resourceName);
InputStream stream = zipFile.getInputStream(entry);
return stream;
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
File srcFile = this.getFile();
return new FileInputStream(srcFile);
}
}
}
| [
"raver119@gmail.com"
] | raver119@gmail.com |
fb0dc4d01b4a9a450438ac8183026c4e29e8b350 | d31e0b420a6681524f00c607475fbf5c6063158c | /src/main/java/gov/hhs/acf/cb/nytd/actions/compliance/RecordLevelDQAExport.java | a850000a5bae48eb5d0127be9c580eca21527660 | [] | no_license | MichaelKilleenSandbox/nytd-incremental | 5dd5b851e91b2be8822f4455aeae4abf6bb8c64f | 517f57420af7452d123d92f2d78d7b31d8f6f944 | refs/heads/master | 2023-07-18T23:47:15.871204 | 2021-08-27T20:32:07 | 2021-08-27T20:32:07 | 400,630,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,901 | java | package gov.hhs.acf.cb.nytd.actions.compliance;
import com.opensymphony.xwork2.ActionSupport;
import gov.hhs.acf.cb.nytd.actions.ExportableTable;
import gov.hhs.acf.cb.nytd.models.RecordLevelAdvisory;
import gov.hhs.acf.cb.nytd.service.DataExtractionService;
import java.util.HashMap;
import java.util.Map;
/**
* User: 23839
* Date: Jan 20, 2011
*/
public class RecordLevelDQAExport extends ExportableTable<RecordLevelAdvisory>
{
public RecordLevelDQAExport(ActionSupport action, DataExtractionService dataExtractionService)
{
super(action, dataExtractionService);
}
protected void addColumns()
{
addColumn("Record Number", new ValueProvider<RecordLevelAdvisory>()
{
public String getValue(final RecordLevelAdvisory recordLevelAdvisory)
{
return recordLevelAdvisory.getDatum().getTransmissionRecord().getRecordNumber();
}
});
addColumn("Element Number/Name", new ValueProvider<RecordLevelAdvisory>()
{
public String getValue(final RecordLevelAdvisory recordLevelAdvisory)
{
return recordLevelAdvisory.getDatum().getElement().getName() +" - "+recordLevelAdvisory.getDatum().getElement().getDescription() ;
}
});
/* addColumn("Element Name", new ExportableTable.ValueProvider<RecordLevelAdvisory>()
{
public String getValue(final RecordLevelAdvisory recordLevelAdvisory)
{
return recordLevelAdvisory.getDatum().getElement().getDescription();
}
});
*/
addColumn("Error Description", new ValueProvider<RecordLevelAdvisory>()
{
public String getValue(final RecordLevelAdvisory recordLevelAdvisory)
{
Map<String, Object> namedParams = new HashMap<String, Object>();
namedParams.put("elementNumber", recordLevelAdvisory.getDatum().getElement().getName());
return recordLevelAdvisory.formatText(recordLevelAdvisory.getProblemDescription().getName(),namedParams);
}
});
}
}
| [
"michaeljkilleen@outlook.com"
] | michaeljkilleen@outlook.com |
60f585567c404dc33e269e7d67bbc9037083264c | c2fa04760594de051e51eb1b7102b827424951ae | /YiXin/.apt_generated/com/yxst/epic/yixin/rest/com/yxst/epic/yixin/rest/ServiceResult_Object.java | 7d1312dab870c7510af6ebc7eb5527311b36c062 | [
"Apache-2.0"
] | permissive | glustful/mika | c3d9c7b61f02ac94a7e750ebf84391464054e2a3 | 300c9e921fbefd00734882466819e5987cfc058b | refs/heads/master | 2021-01-10T10:50:44.125499 | 2016-04-06T01:45:26 | 2016-04-06T01:45:26 | 55,567,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 270 | java | //
// DO NOT EDIT THIS FILE, IT HAS BEEN GENERATED USING AndroidAnnotations 3.0.1.
//
package com.yxst.epic.yixin.rest.com.yxst.epic.yixin.rest;
import com.yxst.epic.yixin.rest.ServiceResult;
public class ServiceResult_Object
extends ServiceResult<Object>
{
}
| [
"852411097@qq.com"
] | 852411097@qq.com |
afa0868d63d8243eddee5a9d248156de075c9fd9 | 33a5fcf025d92929669d53cf2dc3f1635eeb59c6 | /昌平/app/src/main/java/com/mapuni/mobileenvironment/activity/AirActivity.java | aae04962c0a89348c2402f4363722ac24ba64493 | [] | no_license | dayunxiang/MyHistoryProjects | 2cacbe26d522eeb3f858d69aa6b3c77f3c533f37 | 6e041f53a184e7c4380ce25f5c0274aa10f06c8e | refs/heads/master | 2020-11-29T09:23:27.085614 | 2018-03-12T07:07:18 | 2018-03-12T07:07:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,060 | java | package com.mapuni.mobileenvironment.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;
import android.widget.TextView;
import com.mapuni.mobileenvironment.R;
import com.mapuni.mobileenvironment.adapter.AirListAdapter;
import com.mapuni.mobileenvironment.utils.TestData;
import java.util.List;
public class AirActivity extends AppCompatActivity {
private ListView listView;
private TextView noData;
private List<String> list;
private AirListAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_air);
initDate();
initView();
}
private void initDate() {
list= TestData.getAirSource();
}
private void initView() {
listView= (ListView) findViewById(R.id.list);
noData= (TextView) findViewById(R.id.nodata);
adapter=new AirListAdapter(this,list);
listView.setAdapter(adapter);
}
}
| [
"you@example.com"
] | you@example.com |
6af2f3a336a976c39c9e9d3c2f1157678d16135d | e7488e2521feacc341ff992303cb2170a068a183 | /vskeddemos/projects/jdicdemo/project/jdicdemo/src/com/vsked/test/Browser_jForwardButton_actionAdapter.java | 3a859ffafacc4814be5c9702664f9002a64665f1 | [
"MIT"
] | permissive | brucevsked/vskeddemolist | 6b061d5657d503865726fb98314c5ff0b1dbb1cf | f863783b5b2b4e21e878ee3b295a3b5e03f39d94 | refs/heads/master | 2023-07-21T21:20:48.900142 | 2023-07-13T08:11:19 | 2023-07-13T08:11:19 | 38,467,274 | 29 | 12 | MIT | 2022-10-26T01:32:56 | 2015-07-03T02:21:29 | Java | UTF-8 | Java | false | false | 398 | java | package com.vsked.test;
import java.awt.event.ActionEvent;
public class Browser_jForwardButton_actionAdapter implements java.awt.event.ActionListener {
Browser adaptee;
Browser_jForwardButton_actionAdapter(Browser adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jForwardButton_actionPerformed(e);
}
}
| [
"vsked@163.com"
] | vsked@163.com |
fe126651ab6d8db8a3ff1816edca5bb74fbf6cf8 | a88404e860f9e81f175d80c51b8e735fa499c93c | /hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalDstu3Test.java | 9b39bb2e3a9be924e25b763f72c8055f9b5537ce | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | sabri0/hapi-fhir | 4a53409d31b7f40afe088aa0ee8b946860b8372d | c7798fee4880ee8ffc9ed2e42c29c3b8f6753a1c | refs/heads/master | 2020-06-07T20:02:33.258075 | 2019-06-18T09:40:00 | 2019-06-18T09:40:00 | 193,081,738 | 2 | 0 | Apache-2.0 | 2019-06-21T10:46:17 | 2019-06-21T10:46:17 | null | UTF-8 | Java | false | false | 4,169 | java | package ca.uhn.fhir.rest.server;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.concurrent.TimeUnit;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Patient;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.junit.*;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.annotation.*;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor;
import ca.uhn.fhir.test.utilities.JettyUtil;
import ca.uhn.fhir.util.TestUtil;
public class DeleteConditionalDstu3Test {
private static CloseableHttpClient ourClient;
private static FhirContext ourCtx = FhirContext.forDstu3();
private static IGenericClient ourHapiClient;
private static String ourLastConditionalUrl;
private static IdType ourLastIdParam;
private static boolean ourLastRequestWasDelete;
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(DeleteConditionalDstu3Test.class);
private static int ourPort;
private static Server ourServer;
@Before
public void before() {
ourLastConditionalUrl = null;
ourLastIdParam = null;
ourLastRequestWasDelete = false;
}
@Test
public void testSearchStillWorks() throws Exception {
Patient patient = new Patient();
patient.addIdentifier().setValue("002");
// HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_pretty=true");
//
// HttpResponse status = ourClient.execute(httpGet);
//
// String responseContent = IOUtils.toString(status.getEntity().getContent());
// IOUtils.closeQuietly(status.getEntity().getContent());
//
// ourLog.info("Response was:\n{}", responseContent);
//@formatter:off
ourHapiClient
.delete()
.resourceConditionalByType(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndIdentifier("SOMESYS","SOMEID"))
.execute();
//@formatter:on
assertTrue(ourLastRequestWasDelete);
assertEquals(null, ourLastIdParam);
assertEquals("Patient?identifier=SOMESYS%7CSOMEID", ourLastConditionalUrl);
}
@AfterClass
public static void afterClassClearContext() throws Exception {
JettyUtil.closeServer(ourServer);
TestUtil.clearAllStaticFieldsForUnitTest();
}
@BeforeClass
public static void beforeClass() throws Exception {
ourServer = new Server(0);
PatientProvider patientProvider = new PatientProvider();
ServletHandler proxyHandler = new ServletHandler();
RestfulServer servlet = new RestfulServer(ourCtx);
servlet.setResourceProviders(patientProvider);
ServletHolder servletHolder = new ServletHolder(servlet);
proxyHandler.addServletWithMapping(servletHolder, "/*");
ourServer.setHandler(proxyHandler);
JettyUtil.startServer(ourServer);
ourPort = JettyUtil.getPortForStartedServer(ourServer);
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setConnectionManager(connectionManager);
ourClient = builder.build();
ourCtx.getRestfulClientFactory().setSocketTimeout(500 * 1000);
ourHapiClient = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/");
ourHapiClient.registerInterceptor(new LoggingInterceptor());
}
public static class PatientProvider implements IResourceProvider {
@Delete()
public MethodOutcome deletePatient(@IdParam IdType theIdParam, @ConditionalUrlParam String theConditional) {
ourLastRequestWasDelete = true;
ourLastConditionalUrl = theConditional;
ourLastIdParam = theIdParam;
return new MethodOutcome(new IdType("Patient/001/_history/002"));
}
@Override
public Class<? extends IBaseResource> getResourceType() {
return Patient.class;
}
}
}
| [
"jamesagnew@gmail.com"
] | jamesagnew@gmail.com |
82e21dd5d89583c9b6f4a1f51f3e6e3f4e490a17 | 7d8c64f1f09e13043f14a5a235c4e61272a77506 | /sources/p006ti/modules/titanium/network/TiNetworkListener.java | 5dc985a642f37d5c010c127b6e39ce2aaf65bff0 | [] | no_license | AlexKohanim/QuickReturn | 168530c2ef4035faff817a901f1384ed8a554f73 | 1ce10de7020951d49f80b66615fe3537887cea80 | refs/heads/master | 2022-06-25T19:00:59.818761 | 2020-05-08T20:11:14 | 2020-05-08T20:11:14 | 262,418,565 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,209 | java | package p006ti.modules.titanium.network;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import org.appcelerator.kroll.common.Log;
/* renamed from: ti.modules.titanium.network.TiNetworkListener */
public class TiNetworkListener {
public static final String EXTRA_CONNECTED = "connected";
public static final String EXTRA_FAILOVER = "failover";
public static final String EXTRA_NETWORK_TYPE = "networkType";
public static final String EXTRA_NETWORK_TYPE_NAME = "networkTypeName";
public static final String EXTRA_REASON = "reason";
private static final String TAG = "TiNetListener";
private IntentFilter connectivityIntentFilter;
private Context context;
private boolean listening;
/* access modifiers changed from: private */
public Handler messageHandler;
private ConnectivityBroadcastReceiver receiver = new ConnectivityBroadcastReceiver();
/* renamed from: ti.modules.titanium.network.TiNetworkListener$ConnectivityBroadcastReceiver */
private class ConnectivityBroadcastReceiver extends BroadcastReceiver {
private ConnectivityBroadcastReceiver() {
}
public void onReceive(Context context, Intent intent) {
boolean z;
if (intent.getAction().equals("android.net.conn.CONNECTIVITY_CHANGE")) {
if (TiNetworkListener.this.messageHandler == null) {
Log.m44w(TiNetworkListener.TAG, "Network receiver is active but no handler has been set.");
return;
}
boolean noConnectivity = intent.getBooleanExtra("noConnectivity", false);
NetworkInfo networkInfo = (NetworkInfo) intent.getParcelableExtra("networkInfo");
NetworkInfo otherNetworkInfo = (NetworkInfo) intent.getParcelableExtra("otherNetwork");
String reason = intent.getStringExtra("reason");
boolean failover = intent.getBooleanExtra("isFailover", false);
Log.m29d(TiNetworkListener.TAG, "onReceive(): mNetworkInfo=" + networkInfo + " mOtherNetworkInfo = " + (otherNetworkInfo == null ? "[none]" : otherNetworkInfo + " noConn=" + noConnectivity), Log.DEBUG_MODE);
Message message = Message.obtain(TiNetworkListener.this.messageHandler);
Bundle b = message.getData();
String str = TiNetworkListener.EXTRA_CONNECTED;
if (!noConnectivity) {
z = true;
} else {
z = false;
}
b.putBoolean(str, z);
b.putInt(TiNetworkListener.EXTRA_NETWORK_TYPE, networkInfo.getType());
if (noConnectivity) {
b.putString(TiNetworkListener.EXTRA_NETWORK_TYPE_NAME, "NONE");
} else {
b.putString(TiNetworkListener.EXTRA_NETWORK_TYPE_NAME, networkInfo.getTypeName());
}
b.putBoolean(TiNetworkListener.EXTRA_FAILOVER, failover);
b.putString("reason", reason);
message.sendToTarget();
}
}
}
public TiNetworkListener(Handler messageHandler2) {
this.messageHandler = messageHandler2;
this.connectivityIntentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
}
public void attach(Context context2) {
if (this.listening) {
Log.m44w(TAG, "Connectivity listener is already attached");
} else if (this.context == null) {
this.context = context2;
context2.registerReceiver(this.receiver, this.connectivityIntentFilter);
this.listening = true;
} else {
throw new IllegalStateException("Context was not cleaned up from last release.");
}
}
public void detach() {
if (this.listening) {
this.context.unregisterReceiver(this.receiver);
this.context = null;
this.listening = false;
}
}
}
| [
"akohanim@sfsu.edu"
] | akohanim@sfsu.edu |
14c0e560e7fd74c416abfe54a6ddfa2da0bf826a | 76852b1b29410436817bafa34c6dedaedd0786cd | /sources-2020-11-04-tempmail/sources/com/google/android/gms/internal/ads/zzwx.java | 16d0128299341d8e6c53da00a5c0577b06aa913a | [] | no_license | zteeed/tempmail-apks | 040e64e07beadd8f5e48cd7bea8b47233e99611c | 19f8da1993c2f783b8847234afb52d94b9d1aa4c | refs/heads/master | 2023-01-09T06:43:40.830942 | 2020-11-04T18:55:05 | 2020-11-04T18:55:05 | 310,075,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | package com.google.android.gms.internal.ads;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import com.google.android.gms.dynamic.IObjectWrapper;
/* compiled from: com.google.android.gms:play-services-ads-lite@@19.2.0 */
public interface zzwx extends IInterface {
IBinder M5(IObjectWrapper iObjectWrapper, zzvh zzvh, String str, zzamr zzamr, int i, int i2) throws RemoteException;
}
| [
"zteeed@minet.net"
] | zteeed@minet.net |
a2db72691d5b9eb33e778a6488611e58b4138dd7 | b34788b8684ff9747174187ac7542ef0155fca0d | /src/main/java/net/mcreator/blahmod/block/PolishedCharredScoriaSideSlabBlock.java | cc1217eec5ca5fd72fcaef03f395c553823dbd19 | [] | no_license | blahblahbal/Blah-s-MCreator-Mod | 05202024e57585355118285ba5ad4881ab5c5cfa | a69c91ccf028327b0a29066e1f3c71d9d2b332a3 | refs/heads/master | 2023-04-03T11:32:01.583363 | 2021-04-12T02:31:45 | 2021-04-12T02:31:45 | 355,346,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,866 | java |
package net.mcreator.blahmod.block;
import net.minecraftforge.registries.ObjectHolder;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.world.IWorld;
import net.minecraft.world.IBlockReader;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.Rotation;
import net.minecraft.util.Mirror;
import net.minecraft.util.Direction;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.StateContainer;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.BooleanProperty;
import net.minecraft.loot.LootContext;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.BlockItem;
import net.minecraft.fluid.Fluids;
import net.minecraft.fluid.FluidState;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.block.material.Material;
import net.minecraft.block.SoundType;
import net.minecraft.block.IWaterLoggable;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Block;
import net.mcreator.blahmod.itemgroup.CreativeTabBlahBlocksItemGroup;
import net.mcreator.blahmod.BlahmodModElements;
import java.util.List;
import java.util.Collections;
@BlahmodModElements.ModElement.Tag
public class PolishedCharredScoriaSideSlabBlock extends BlahmodModElements.ModElement {
@ObjectHolder("blahmod:polished_charred_scoria_side_slab")
public static final Block block = null;
public PolishedCharredScoriaSideSlabBlock(BlahmodModElements instance) {
super(instance, 1620);
}
@Override
public void initElements() {
elements.blocks.add(() -> new CustomBlock());
elements.items.add(
() -> new BlockItem(block, new Item.Properties().group(CreativeTabBlahBlocksItemGroup.tab)).setRegistryName(block.getRegistryName()));
}
@Override
@OnlyIn(Dist.CLIENT)
public void clientLoad(FMLClientSetupEvent event) {
RenderTypeLookup.setRenderLayer(block, RenderType.getCutout());
}
public static class CustomBlock extends Block implements IWaterLoggable {
public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public CustomBlock() {
super(Block.Properties.create(Material.ROCK).sound(SoundType.BASALT).hardnessAndResistance(1.5f, 6f).setLightLevel(s -> 0).harvestLevel(0)
.harvestTool(ToolType.PICKAXE).setRequiresTool().notSolid().setOpaque((bs, br, bp) -> false));
this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH).with(WATERLOGGED, false));
setRegistryName("polished_charred_scoria_side_slab");
}
@Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
return true;
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) {
Vector3d offset = state.getOffset(world, pos);
switch ((Direction) state.get(FACING)) {
case SOUTH :
default :
return VoxelShapes.or(makeCuboidShape(16, 0, 8, 0, 16, 0)).withOffset(offset.x, offset.y, offset.z);
case NORTH :
return VoxelShapes.or(makeCuboidShape(0, 0, 8, 16, 16, 16)).withOffset(offset.x, offset.y, offset.z);
case EAST :
return VoxelShapes.or(makeCuboidShape(8, 0, 0, 0, 16, 16)).withOffset(offset.x, offset.y, offset.z);
case WEST :
return VoxelShapes.or(makeCuboidShape(8, 0, 16, 16, 16, 0)).withOffset(offset.x, offset.y, offset.z);
}
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
builder.add(FACING, WATERLOGGED);
}
public BlockState rotate(BlockState state, Rotation rot) {
return state.with(FACING, rot.rotate(state.get(FACING)));
}
public BlockState mirror(BlockState state, Mirror mirrorIn) {
return state.rotate(mirrorIn.toRotation(state.get(FACING)));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER;;
if (context.getFace() == Direction.UP || context.getFace() == Direction.DOWN)
return this.getDefaultState().with(FACING, Direction.NORTH).with(WATERLOGGED, flag);
return this.getDefaultState().with(FACING, context.getFace()).with(WATERLOGGED, flag);
}
@Override
public FluidState getFluidState(BlockState state) {
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
}
@Override
public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos,
BlockPos facingPos) {
if (state.get(WATERLOGGED)) {
world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world));
}
return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos);
}
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
List<ItemStack> dropsOriginal = super.getDrops(state, builder);
if (!dropsOriginal.isEmpty())
return dropsOriginal;
return Collections.singletonList(new ItemStack(this, 1));
}
}
}
| [
"jabawakijadehawk@gmail.com"
] | jabawakijadehawk@gmail.com |
a257791eb1caec6424eb7a7fee4259346774af5b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_496c4ee9d62e080fc5095887a14746bac471ccd1/SegmentController/33_496c4ee9d62e080fc5095887a14746bac471ccd1_SegmentController_s.java | bd99c06491b92c7097436e33e0891d6aec6a7349 | [] | 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 | 1,457 | java | package websiteschema.mpsegment.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import websiteschema.mpsegment.core.SegmentEngine;
import websiteschema.mpsegment.core.SegmentResult;
import websiteschema.mpsegment.core.SegmentWorker;
import websiteschema.mpsegment.core.WordAtom;
import java.util.List;
@Controller
@RequestMapping(value = "/segment")
public class SegmentController {
@RequestMapping(value = "", method = RequestMethod.GET)
@ResponseBody
public List<WordAtom> get(String sentence) {
System.out.println(sentence);
SegmentWorker worker = SegmentEngine.getInstance().getSegmentWorker();
SegmentResult result = worker.segment(sentence);
System.out.println(result);
return result.getWordAtoms();
}
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
public List<WordAtom> post(@RequestBody String sentence) {
System.out.println(sentence);
SegmentWorker worker = SegmentEngine.getInstance().getSegmentWorker();
SegmentResult result = worker.segment(sentence);
System.out.println(result);
return result.getWordAtoms();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
38ba18be416bc157d25593a96942352d67771efe | 19f7e40c448029530d191a262e5215571382bf9f | /decompiled/instagram/sources/p000X/C14850lq.java | 43db0ad9cc04dd2ff83c2273948635a654a5c3f3 | [] | no_license | stanvanrooy/decompiled-instagram | c1fb553c52e98fd82784a3a8a17abab43b0f52eb | 3091a40af7accf6c0a80b9dda608471d503c4d78 | refs/heads/master | 2022-12-07T22:31:43.155086 | 2020-08-26T03:42:04 | 2020-08-26T03:42:04 | 283,347,288 | 18 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,155 | java | package p000X;
import java.util.Arrays;
/* renamed from: X.0lq reason: invalid class name and case insensitive filesystem */
public final class C14850lq {
public final int A00;
public final String A01;
public final String A02;
public final boolean equals(Object obj) {
if (this != obj) {
if (obj == null || getClass() != obj.getClass()) {
return false;
}
C14850lq r5 = (C14850lq) obj;
if (this.A00 != r5.A00) {
return false;
}
String str = this.A02;
String str2 = r5.A02;
if (str != str2 && (str == null || !str.equals(str2))) {
return false;
}
String str3 = this.A01;
String str4 = r5.A01;
return str3 == str4 || (str3 != null && str3.equals(str4));
}
}
public final int hashCode() {
return Arrays.hashCode(new Object[]{Integer.valueOf(this.A00), this.A02, this.A01});
}
public C14850lq(int i, String str, String str2) {
this.A00 = i;
this.A02 = str;
this.A01 = str2;
}
}
| [
"stan@rooy.works"
] | stan@rooy.works |
da13ef4712a67f3b5d67cc180fe28469d91781b1 | 8c40e048c31881b814b7b5ffb63fc7807b099413 | /src/main/java/com/dongluhitec/card/connect/util/BCDAddressAdaptor.java | 16a1457e216da619da1157a54e735af069cd3c4a | [] | no_license | wangxinit/carparkServer | 40539faebac33dd72449e1b053b50f34cdce5d67 | 62f4fa351385d494f578eae897458cecae0e37f3 | refs/heads/master | 2021-08-27T15:40:45.567905 | 2014-05-26T03:22:16 | 2014-05-26T03:22:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | package com.dongluhitec.card.connect.util;
public class BCDAddressAdaptor {
final private SerialDeviceAddress address;
public BCDAddressAdaptor(SerialDeviceAddress address) {
this.address = address;
}
public BCDAddressAdaptor(byte[] bytes, int start) {
int high_1 = Utils.BCDConvertFromByteToInt(bytes[start + 1]);
int low_1 = Utils.BCDConvertFromByteToInt(bytes[start + 3]);
this.address = new SerialDeviceAddress();
this.address.setAddress(high_1, low_1);
}
public byte[] getBytes() {
byte[] b = new byte[4];
int firstAddrPart = this.address.getFirstAddrPart();
int secondAddrPart = this.address.getSecondAddrPart();
b[1] = Utils.BCDConvertFromIntToByte(firstAddrPart);
b[3] = Utils.BCDConvertFromIntToByte(secondAddrPart);
return b;
}
public SerialDeviceAddress getAddress() {
return this.address;
}
}
| [
"154341736@qq.com"
] | 154341736@qq.com |
27360f4428fe6565d931e9e69e0ca66bfca57c0e | ab2f8717905f7a8f3b70199f9bed81acfa4cb0ba | /JavaFXproject/src/basic/control/Phone.java | 635ede2aae9bed321b06a181645a1f6238170cf1 | [] | no_license | tjdwns631/JavaFXProject | 5dbf55313b3d4f41a6aa8e34071c8563f5009b21 | 6662abb044c9151bf73104e4cd561c848b40e65b | refs/heads/master | 2022-12-22T13:51:19.865851 | 2020-09-14T06:49:48 | 2020-09-14T06:49:48 | 291,579,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package basic.control;
import javafx.beans.property.SimpleStringProperty;
public class Phone {
SimpleStringProperty smartPhone;
SimpleStringProperty image;
public Phone(String smartPhone, String image) {
this.smartPhone = new SimpleStringProperty(smartPhone);
this.image = new SimpleStringProperty(image);
}
public void setSmartPhone(String smartPhone) {
this.smartPhone.set(smartPhone);
}
public void setImage(String image) {
this.image.set(image);
}
public String getSmartPhone() {
return this.smartPhone.get();
}
public String getImage() {
return this.image.get();
}
}
| [
"you@example.com"
] | you@example.com |
28eb12a24b9cbe094d283c637b2645df6b32fb46 | ffc3c5e51d0ac126c2a36e6ac45f7a6a0eda9164 | /src/main/java/wenyu/learning/Matrix/PrintSpiralMatrix.java | e4dab186411ce298662bcf74562091b1e8693645 | [] | no_license | WenyuChang/data-structure-algorithm-leaning | 203646bd537542e4cd33ca2b549e497e90d97297 | 9f9df7eb6d438493a1a91c87c766969a1f2147d9 | refs/heads/master | 2021-01-22T20:08:05.117890 | 2017-03-17T07:20:14 | 2017-03-17T07:20:14 | 85,282,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,365 | java | package wenyu.learning.Matrix;
/**
* Created by Wenyu on 11/30/16.
*
* Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
* For example:
* Given n = 3,
* You should return the following matrix:
[
[ 1, 2, 3 ],
[ 8, 9, 4 ],
[ 7, 6, 5 ]
]
*/
public class PrintSpiralMatrix {
private int printSingleSpiral(int[][] matrix, int level, int start) {
int row = level;
int col = level;
while(col<matrix[0].length-level) {
matrix[row][col++] = start++;
}
row++;
col = matrix[0].length-level-1;
while(row<matrix.length-level) {
matrix[row++][col] = start++;
}
col--;
row = matrix.length-level-1;
while(col>=level && row>level) {
matrix[row][col--] = start++;
}
col = level;
row--;
while(row>level && col<matrix[0].length-level-1) {
matrix[row--][col] = start++;
}
return start;
}
public int[][] generateMatrix(int n) {
int[][] matrix = new int[n][n];
int level = 0;
int start = 1;
while(level*2<matrix.length && level*2<matrix[0].length) {
start = printSingleSpiral(matrix, level, start);
level++;
}
return matrix;
}
}
| [
"changwy_1987@hotmail.com"
] | changwy_1987@hotmail.com |
b7ce9f6b46eadcbd359cd77a2555c2c759ef4fb0 | 76f3f97eea31c6993b2d9ab2739e8858d8a3fe6e | /libmc/src/main/java/com/kiun/modelcommonsupport/controllers/LocationActivity.java | eaf47278da345c2756a06388d0771c9917d7b92b | [] | no_license | shanghaif/o2o-android-app | 4309dc88047ca16c7ae0bc2477e420070bcb486a | a883287a00d91c62eee4d7d5847b544828402973 | refs/heads/master | 2022-03-04T08:35:58.649521 | 2019-11-04T07:40:35 | 2019-11-04T07:42:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,524 | java | package com.kiun.modelcommonsupport.controllers;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.view.View;
import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.location.AMapLocationListener;
import com.amos.modulebase.utils.MathUtils;
import com.kiun.modelcommonsupport.MainApplication;
import com.kiun.modelcommonsupport.R;
import com.kiun.modelcommonsupport.adapter.ItemListener;
import com.kiun.modelcommonsupport.utils.MCDialogManager;
/**
* Created by kiun_2007 on 2018/9/11.
*/
public abstract class LocationActivity extends BaseRequestAcitity {
public AMapLocationClient mLocationClient = null;
public AMapLocationClientOption mLocationOption = null;
MCDialogManager permissionDialog = null;
MCDialogManager localPermissDialog = null;
public abstract void onLocationChanged(String cityName, String cityCode, double latitude, double longitude);
public abstract Long getInterval();
// 高德定位
public void getPositioning() {
String localCity = MainApplication.getInstance().getValue("localCity");
String localCityCode = MainApplication.getInstance().getValue("localCityCode");
String poiname = MainApplication.getInstance().getValue("poiname");
String lastLatitude = MainApplication.getInstance().getValue("lastLatitude");
String lastLongitude = MainApplication.getInstance().getValue("lastLongitude");
if (!TextUtils.isEmpty(localCity) && !TextUtils.isEmpty(localCityCode)) {
//onLocationChanged(localCity.replace("市", "") + "•" + poiname, localCityCode, MathUtils.str2Double(lastLatitude), MathUtils.str2Double(lastLongitude));
onLocationChanged(localCity.replace("市", "") , localCityCode, MathUtils.str2Double(lastLatitude), MathUtils.str2Double(lastLongitude));
}
// if()
//初始化定位
mLocationClient = new AMapLocationClient(this);
//设置定位回调监听
mLocationClient.setLocationListener(new AMapLocationListener() {
@Override
public void onLocationChanged(AMapLocation aMapLocation) {
String cityCode = "";
MainApplication.getInstance().save("location", String.format("%f,%f", aMapLocation.getLatitude(), aMapLocation.getLongitude()));
if (!aMapLocation.getAdCode().isEmpty()) {
cityCode = aMapLocation.getAdCode().substring(0, 4) + "00";
}
if (!TextUtils.isEmpty(aMapLocation.getCity()) && !TextUtils.isEmpty(aMapLocation.getPoiName())) {
//LocationActivity.this.onLocationChanged(aMapLocation.getCity().replace("市", "") + "•" + aMapLocation.getPoiName(), cityCode, aMapLocation.getLatitude(), aMapLocation.getLongitude());
LocationActivity.this.onLocationChanged(aMapLocation.getCity().replace("市", "") , cityCode, aMapLocation.getLatitude(), aMapLocation.getLongitude());
}
if (!aMapLocation.getCity().isEmpty() && !cityCode.isEmpty()) {
MainApplication.getInstance().save("poiname", aMapLocation.getPoiName());
MainApplication.getInstance().save("localCity", aMapLocation.getCity());
MainApplication.getInstance().save("localCityCode", cityCode);
MainApplication.getInstance().save("lastLatitude", String.format("%f", aMapLocation.getLatitude()));
MainApplication.getInstance().save("lastLongitude", String.format("%f", aMapLocation.getLongitude()));
}
if (getInterval() < 0) {
mLocationClient.stopLocation();
}
}
});
//初始化AMapLocationClientOption对象
mLocationOption = new AMapLocationClientOption();
//获取一次定位结果:
//该方法默认为false。
mLocationOption.setInterval(10000);
//设置是否返回地址信息(默认返回地址信息)
mLocationOption.setNeedAddress(true);
//设置是否允许模拟位置,默认为true,允许模拟位置
mLocationOption.setMockEnable(true);
//给定位客户端对象设置定位参数
mLocationClient.setLocationOption(mLocationOption);
//设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。
mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
//启动定位
mLocationClient.startLocation();
}
public boolean isLocationEnabled() {
int locationMode = 0;
String locationProviders;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try {
locationMode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
return false;
}
return locationMode != Settings.Secure.LOCATION_MODE_OFF;
} else {
locationProviders = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
return !TextUtils.isEmpty(locationProviders);
}
}
public void startLocation() {
if (!isLocationEnabled()) {
localPermissDialog = MCDialogManager.showMessage(this, "需要打开定位", "手机没有开启定位无法正常工作",
"立即去打开", "暂时不打开", R.drawable.svg_icon_prompt_big);
localPermissDialog.setListener(new ItemListener() {
@Override
public void onItemClick(View listView, Object itemData, int tag) {
if (tag == MCDialogManager.TAG_RIGHT_BTN) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivityForResult(intent, 887);
}
}
});
return;
}
//检测系统是否打开开启了地理定位权限
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
permissionDialog = MCDialogManager.showMessage(this, "需要定位权限", "应用没有定位权限,设置定位权限才能正常工作",
"立即去设置", "暂时不设置", R.drawable.svg_icon_prompt_big);
permissionDialog.setListener(new ItemListener() {
@Override
public void onItemClick(View listView, Object itemData, int tag) {
if (tag == MCDialogManager.TAG_RIGHT_BTN) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", MainApplication.getInstance().getPackageName(), null);
intent.setData(uri);
startActivity(intent);
}
}
});
return;
}
getPositioning();
}
}
| [
"kiun_2007@aliyun.com"
] | kiun_2007@aliyun.com |
7507da289cd006f7e812cc2cdc67c9264598de4e | ed3cb95dcc590e98d09117ea0b4768df18e8f99e | /project_1_1/src/g/a/g/Calc_1_1_6061.java | 208d52583d2a2d51035ccc9f8e874af4e59ed0d6 | [] | no_license | chalstrick/bigRepo1 | ac7fd5785d475b3c38f1328e370ba9a85a751cff | dad1852eef66fcec200df10083959c674fdcc55d | refs/heads/master | 2016-08-11T17:59:16.079541 | 2015-12-18T14:26:49 | 2015-12-18T14:26:49 | 48,244,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 131 | java | package g.a.g;
public class Calc_1_1_6061 {
/** @return the sum of a and b */
public int add(int a, int b) {
return a+b;
}
}
| [
"christian.halstrick@sap.com"
] | christian.halstrick@sap.com |
002c8cbd6df19afc777b7fec17c3c50fd6e6e865 | a5128099178a19d5e2f5f103001f4e4b7154a819 | /src/test/java/net/cassite/vproxy/test/cases/TestIpParser.java | e758e2105c49c5fedbaf23f27fb2a23e4a5dde85 | [
"MIT"
] | permissive | AlexZFX/vproxy | bf4a5288a27ce508b4fe2e0e3909921bf406ada9 | 9ed242444eac83ca80dc17bb587ac65de7f47ba2 | refs/heads/master | 2020-04-18T01:37:59.700846 | 2019-02-26T15:34:39 | 2019-02-26T15:34:39 | 167,126,386 | 0 | 0 | MIT | 2019-01-23T06:00:57 | 2019-01-23T06:00:52 | Java | UTF-8 | Java | false | false | 5,349 | java | package net.cassite.vproxy.test.cases;
import net.cassite.vproxy.util.Utils;
import org.junit.Test;
import java.net.Inet6Address;
import java.net.InetAddress;
import static org.junit.Assert.*;
public class TestIpParser {
@Test
public void parseIpv4() {
int a = 192;
int b = 168;
int c = 12;
int d = 34;
String s = a + "." + b + "." + c + "." + d;
byte[] bytes = Utils.parseIpv4String(s);
assert bytes != null;
assertEquals((byte) a, bytes[0]);
assertEquals((byte) b, bytes[1]);
assertEquals((byte) c, bytes[2]);
assertEquals((byte) d, bytes[3]);
a = 192;
b = 168;
c = 0;
d = 0;
s = a + "." + b + "." + c + "." + d;
bytes = Utils.parseIpv4String(s);
assert bytes != null;
assertEquals((byte) a, bytes[0]);
assertEquals((byte) b, bytes[1]);
assertEquals((byte) c, bytes[2]);
assertEquals((byte) d, bytes[3]);
}
@Test
public void parseIpv4Fail() {
assertNull(Utils.parseIpv4String("1"));
assertNull(Utils.parseIpv4String("a.b.c.d"));
assertNull(Utils.parseIpv4String("1.2.3."));
assertNull(Utils.parseIpv4String("..."));
assertNull(Utils.parseIpv4String("1.2.."));
assertNull(Utils.parseIpv4String("..3.4"));
assertNull(Utils.parseIpv4String("1...4"));
assertNull(Utils.parseIpv4String("256.1.1.1"));
assertNull(Utils.parseIpv4String("1.256.1.1"));
}
private void check(String s) throws Exception {
InetAddress addr = InetAddress.getByName(s);
byte[] b1 = addr.getAddress();
byte[] b2 = Utils.parseIpv6String(s);
assert b2 != null;
if (addr instanceof Inet6Address) {
assertArrayEquals(b1, b2);
} else {
for (int i = 0; i < 10; ++i) {
assertEquals(0, b2[i]);
}
for (int i = 11; i < 12; ++i) {
assertEquals((byte) 0xFF, b2[i]);
}
for (int i = 0; i < 4; ++i) {
assertEquals(b1[i], b2[i + 12]);
}
}
if (s.startsWith("[")) {
return;
}
check("[" + s + "]");
}
@Test
public void parseIpv6() throws Exception {
// https://tools.ietf.org/html/rfc4291#section-2.2
check("ABCD:EF01:2345:6789:ABCD:EF01:2345:6789");
check("2001:DB8:0:0:8:800:200C:417A");
check("FF01:0:0:0:0:0:0:101");
check("0:0:0:0:0:0:0:1");
check("0:0:0:0:0:0:0:0");
check("2001:DB8::8:800:200C:417A");
check("FF01::101");
check("::1");
check("::");
check("0:0:0:0:0:0:13.1.68.3");
check("0:0:0:0:0:FFFF:129.144.52.38");
check("::13.1.68.3");
check("::FFFF:129.144.52.38");
// my test cases
check("1::");
check("1a2b::3c4d");
check("22::");
check("333::");
check("4444::");
// https://stackoverflow.com/questions/10995273/test-case-for-validation-ipv4-embedded-ipv6-addresses
check("2001:db8:c000:221::");
check("2001:db8:1c0:2:21::");
check("2001:db8:122:c000:2:2100::");
check("2001:db8:122:3c0:0:221::");
check("2001:db8:122:344:c0:2:2100::");
check("2001:db8:122:344::192.0.2.33");
}
// from guava
// https://github.com/google/guava/blob/master/guava-tests/test/com/google/common/net/InetAddressesTest.java#L42
// Copyright (C) 2008 The Guava Authors
// apache2 license
String[] bogusInputs = {
"",
"016.016.016.016",
"016.016.016",
"016.016",
"016",
"000.000.000.000",
"000",
"0x0a.0x0a.0x0a.0x0a",
"0x0a.0x0a.0x0a",
"0x0a.0x0a",
"0x0a",
"42.42.42.42.42",
"42.42.42",
"42.42",
"42",
"42..42.42",
"42..42.42.42",
"42.42.42.42.",
"42.42.42.42...",
".42.42.42.42",
"...42.42.42.42",
"42.42.42.-0",
"42.42.42.+0",
".",
"...",
"bogus",
"bogus.com",
"192.168.0.1.com",
"12345.67899.-54321.-98765",
"257.0.0.0",
"42.42.42.-42",
"3ffe::1.net",
"3ffe::1::1",
"1::2::3::4:5",
"::7:6:5:4:3:2:", // should end with ":0"
":6:5:4:3:2:1::", // should begin with "0:"
"2001::db:::1",
"FEDC:9878",
"+1.+2.+3.4",
"1.2.3.4e0",
"::7:6:5:4:3:2:1:0", // too many parts
"7:6:5:4:3:2:1:0::", // too many parts
"9:8:7:6:5:4:3::2:1", // too many parts
"0:1:2:3::4:5:6:7", // :: must remove at least one 0.
"3ffe:0:0:0:0:0:0:0:1", // too many parts (9 instead of 8)
"3ffe::10000", // hextet exceeds 16 bits
"3ffe::goog",
"3ffe::-0",
"3ffe::+0",
"3ffe::-1",
":",
":::",
"::1.2.3",
"::1.2.3.4.5",
"::1.2.3.4:",
"1.2.3.4::",
"2001:db8::1:",
":2001:db8::1",
":1:2:3:4:5:6:7",
"1:2:3:4:5:6:7:",
":1:2:3:4:5:6:"
};
@Test
public void parseIpFail() {
for (String ip : bogusInputs) {
assertNull(Utils.parseIpString(ip));
}
}
}
| [
"wkgcass@hotmail.com"
] | wkgcass@hotmail.com |
de8ef7ac836c307db2141bd6d198420c3d84fb04 | 0deb56bdcf91ca229bf61da0cf3cf3406223fb2c | /SmartLife-webrtc/sdk/WhiteBoardLibWrapper/SVGLib/src/main/java/com/coocaa/svg/parser/SvgXmlPathParser.java | 3e74930cdcd5d45f237a56780d63b96199fca879 | [] | no_license | soulcure/airplay | 2ceb0a6707b2d4a69f85dd091b797dcb6f2c9d46 | 37dd3a890148a708d8aa6f95ac84355606af6a18 | refs/heads/master | 2023-04-11T03:49:15.246072 | 2021-04-16T09:15:03 | 2021-04-16T09:15:03 | 357,804,553 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,597 | java | /*
* Copyright (C) 2015 Jorge Castillo Pérez
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.coocaa.svg.parser;
import android.graphics.Path;
import android.os.SystemClock;
import android.util.Log;
import com.coocaa.svg.data.SvgPathNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
/**
* Entity to parse Svg paths to {@link Path} items understandable by the Android SDK. Obtained
* from romainnurik Muzei implementation to avoid rewriting .
*
* @author romainnurik
*/
public class SvgXmlPathParser {
private DocumentBuilder docBuilder;
private Document mDoc;
String TAG = "SVG-PathParser";
public SvgXmlPathParser() {
try {
docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
} catch (ParserConfigurationException e)
{
e.printStackTrace();
}
}
public SvgPathNode parse(String data) {
Log.d(TAG, "start parse : " + data);
long start = SystemClock.uptimeMillis();
InputStream is = null;
try {
is = new ByteArrayInputStream(data.getBytes("utf-8"));
mDoc = docBuilder.parse(is);
} catch (Exception e) {
e.printStackTrace();
} finally {
if(is != null) {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
if(mDoc == null) {
return null;
}
Element element = mDoc.getDocumentElement();
SvgPathNode node = new SvgPathNode();
NamedNodeMap map = element.getAttributes();
node.tagName = element.getTagName();
if(map != null) {
node.parse(map);
}
return node;
}
} | [
"chenqiongyao@coocaa.com"
] | chenqiongyao@coocaa.com |
e534d49c7f98342187015debf410d1f6e79ac64d | 815d640f58bd19a8e1cf93b1beecb707fbd326b1 | /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/monitor/AbstractMonitor.java | 6e032dc366c1ff5db836dba7e53874eba36ca0a7 | [] | no_license | smipo/spring-data-mongodb-2.1.18.RELEASE | 5ebc35841039e4135ade81b7f05490c76f716354 | 36b32e7f67e7d31caea6d3169da902934821cbb5 | refs/heads/main | 2023-05-03T08:06:58.949879 | 2021-05-08T11:01:30 | 2021-05-08T11:01:30 | 365,442,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,451 | java | /*
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.springframework.data.mongodb.monitor;
import org.bson.Document;
import com.mongodb.MongoClient;
import com.mongodb.client.MongoDatabase;
/**
* Base class to encapsulate common configuration settings when connecting to a database
*
* @author Mark Pollack
* @author Oliver Gierke
* @author Christoph Strobl
*/
public abstract class AbstractMonitor {
private final MongoClient mongoClient;
protected AbstractMonitor(MongoClient mongoClient) {
this.mongoClient = mongoClient;
}
public Document getServerStatus() {
return getDb("admin").runCommand(new Document("serverStatus", 1).append("rangeDeleter", 1).append("repl", 1));
}
public MongoDatabase getDb(String databaseName) {
return mongoClient.getDatabase(databaseName);
}
protected MongoClient getMongoClient() {
return mongoClient;
}
}
| [
"liushuaishuai@rr.tv"
] | liushuaishuai@rr.tv |
cfcf1b208a18358dffa41daf228fc2ed506a8890 | 546d29e1adc03f7f6d98d12ba93eef2a3401d15f | /src/main/java/examples/SynchronizedFactorizer.java | d50ebfd923488291450841f3923e663a82aeddf4 | [] | no_license | gailo22/concurrency | 9d8841596157c9fc1148a1489a7c75271b27e951 | 7bc99f6ff75c6b9f34c416a24ffe41c6d86dfc7a | refs/heads/master | 2021-01-15T17:08:03.074512 | 2014-06-16T03:44:10 | 2014-06-16T03:44:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,206 | java | package examples;
import java.math.BigInteger;
import javax.servlet.*;
import annotations.*;
/**
* SynchronizedFactorizer
* <p/>
* Servlet that caches last result, but with unnacceptably poor concurrency
*
* @author Brian Goetz and Tim Peierls
*/
@ThreadSafe
public class SynchronizedFactorizer extends GenericServlet implements Servlet {
@GuardedBy("this")
private BigInteger lastNumber;
@GuardedBy("this")
private BigInteger[] lastFactors;
public synchronized void service(ServletRequest req,
ServletResponse resp) {
BigInteger i = extractFromRequest(req);
if (i.equals(lastNumber))
encodeIntoResponse(resp, lastFactors);
else {
BigInteger[] factors = factor(i);
lastNumber = i;
lastFactors = factors;
encodeIntoResponse(resp, factors);
}
}
void encodeIntoResponse(ServletResponse resp, BigInteger[] factors) {
}
BigInteger extractFromRequest(ServletRequest req) {
return new BigInteger("7");
}
BigInteger[] factor(BigInteger i) {
// Doesn't really factor
return new BigInteger[]{i};
}
}
| [
"yidao620@gmail.com"
] | yidao620@gmail.com |
a9b200bfc27be571155a316fd9fc0bbaccf07c97 | c78e8338af6575af291754da1f51e0bccd00521d | /dev-timeline-chat/src/main/java/com/sky7th/devtimeline/chat/domain/chattingMessage/dto/ChattingUserResponseDto.java | ea2c7210dce7336ed4dee7e09e9c897f5219260c | [] | no_license | sky7th/dev-timeline | 0099153c440ae15dbebb1fa089c91b06e960d239 | f46fc6cd37a9ef85fa61d42cdad3499466793e56 | refs/heads/master | 2023-04-08T23:55:49.860902 | 2021-04-19T16:33:28 | 2021-04-19T16:33:28 | 250,259,244 | 7 | 1 | null | 2020-11-25T06:47:49 | 2020-03-26T12:59:05 | Java | UTF-8 | Java | false | false | 625 | java | package com.sky7th.devtimeline.chat.domain.chattingMessage.dto;
import com.sky7th.devtimeline.user.domain.User;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@ToString
public class ChattingUserResponseDto implements Serializable {
private Long userId;
private String name;
private String imageUrl;
public static ChattingUserResponseDto of(User entity) {
return new ChattingUserResponseDto(entity.getId(), entity.getName(), entity.getImageUrl());
}
}
| [
"xoghk0321@gmail.com"
] | xoghk0321@gmail.com |
3e0aa7febb852d32bbd12736e1e4c492401afaa4 | c39b0a0e8a4010f1b1d8617bfb0f933bbc6460bf | /introduction/Simple Java Database Swing Application/Part 12 - Packaging and Distribution/src/main/java/com/javacreed/examples/app/DbHelper.java | db299763dfaafd3abe69508df731ff167f7a1766 | [] | no_license | rkmishracs/java-creed-examples | 4ac00308174acaaf46e0448dce7750166174b548 | b5070604842dd8933ca4284a47a7144c8b1f22d7 | refs/heads/master | 2016-09-06T08:10:14.959217 | 2015-03-14T12:24:13 | 2015-03-14T12:24:13 | 42,683,378 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,913 | java | /**
* Copyright 2012-2014 Java Creed.
*
* Licensed under the Apache License, Version 2.0 (the "<em>License</em>");
* 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.javacreed.examples.app;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Properties;
import javax.sql.DataSource;
import org.apache.commons.dbcp.BasicDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.googlecode.flyway.core.Flyway;
public class DbHelper {
private static final Logger LOGGER = LoggerFactory.getLogger(DbHelper.class);
private static final DbHelper INSTANCE = new DbHelper();
public static Connection getConnection() throws SQLException {
return DbHelper.getInstance().getDataSource().getConnection();
}
public static DbHelper getInstance() {
return DbHelper.INSTANCE;
}
private BasicDataSource ds;
private DbHelper() {
}
public void close() {
if (ds != null) {
DbHelper.LOGGER.debug("Closing the data source");
try {
ds.close();
} catch (final SQLException e) {
DbHelper.LOGGER.error("Failed to close the data source", e);
}
}
}
public DataSource getDataSource() {
return ds;
}
public void init() {
DbHelper.LOGGER.debug("Loading properties");
final Properties properties = new Properties();
properties.put("db.path", "target/db");
properties.put("db.username", "sa");
properties.put("db.password", "");
try {
properties.load(getClass().getResourceAsStream("/app.properties"));
} catch (final IOException e) {
DbHelper.LOGGER.error("Failed to load the properties");
}
DbHelper.LOGGER.debug("Creating the data source");
ds = new BasicDataSource();
ds.setDriverClassName("org.h2.Driver");
ds.setUrl("jdbc:h2:" + properties.getProperty("db.path"));
ds.setUsername(properties.getProperty("db.username"));
ds.setPassword(properties.getProperty("db.password"));
DbHelper.LOGGER.debug("Executing Flyway (database migration)");
final Flyway flyway = new Flyway();
flyway.setDataSource(ds);
flyway.migrate();
}
public void registerShutdownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
@Override
public void run() {
close();
}
}));
}
}
| [
"albertattard@gmail.com"
] | albertattard@gmail.com |
c8603c9e47f101cd597ace5da4f29acc717a8ea6 | 5455cb795588916e525be7f91d5203e59b4380ea | /tools/core/src/main/java/org/jboss/mapper/camel/config/SamplingDefinition.java | a014ac07e5b0c202497ef2ca58fd6bf82d4becd2 | [
"Apache-2.0"
] | permissive | jewzaam/data-mapper | cb4d893e3125dc90474bef2ac56d8dd93ba9dd54 | fb055312e5f484a4e3c8f3b190c91dfc046cd5c0 | refs/heads/master | 2021-01-17T01:50:24.998582 | 2014-12-18T22:00:38 | 2014-12-18T22:00:38 | 28,236,129 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,149 | java | //
// 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: 2014.11.26 at 02:37:57 PM EST
//
package org.jboss.mapper.camel.config;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for samplingDefinition complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="samplingDefinition">
* <complexContent>
* <extension base="{http://camel.apache.org/schema/spring}output">
* <sequence>
* </sequence>
* <attribute name="samplePeriod" type="{http://www.w3.org/2001/XMLSchema}long" />
* <attribute name="messageFrequency" type="{http://www.w3.org/2001/XMLSchema}long" />
* <attribute name="units" type="{http://www.w3.org/2001/XMLSchema}string" />
* <anyAttribute processContents='skip' namespace='##other'/>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "samplingDefinition")
public class SamplingDefinition
extends Output
{
@XmlAttribute(name = "samplePeriod")
protected Long samplePeriod;
@XmlAttribute(name = "messageFrequency")
protected Long messageFrequency;
@XmlAttribute(name = "units")
protected String units;
/**
* Gets the value of the samplePeriod property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getSamplePeriod() {
return samplePeriod;
}
/**
* Sets the value of the samplePeriod property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setSamplePeriod(Long value) {
this.samplePeriod = value;
}
/**
* Gets the value of the messageFrequency property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getMessageFrequency() {
return messageFrequency;
}
/**
* Sets the value of the messageFrequency property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setMessageFrequency(Long value) {
this.messageFrequency = value;
}
/**
* Gets the value of the units property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUnits() {
return units;
}
/**
* Sets the value of the units property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUnits(String value) {
this.units = value;
}
}
| [
"kbabo@redhat.com"
] | kbabo@redhat.com |
1114a2e13c35e152f306ff42bfc205ac39c21d7c | 846a7668ac964632bdb6db639ab381be11c13b77 | /android/packages/apps/Settings/src/com/android/settings/DisplaySettings.java | 8cfd0eee9134e65241105396518d7050a2551db2 | [
"Apache-2.0"
] | permissive | BPI-SINOVOIP/BPI-A64-Android8 | f2900965e96fd6f2a28ced68af668a858b15ebe1 | 744c72c133b9bf5d2e9efe0ab33e01e6e51d5743 | refs/heads/master | 2023-05-21T08:02:23.364495 | 2020-07-15T11:27:51 | 2020-07-15T11:27:51 | 143,945,191 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,798 | java | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings;
import android.content.Context;
import android.provider.SearchIndexableResource;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.display.AmbientDisplayPreferenceController;
import com.android.settings.display.AutoBrightnessPreferenceController;
import com.android.settings.display.AutoRotatePreferenceController;
import com.android.settings.display.AwColorTemperaturePreferenceController;
import com.android.settings.display.AwEnhanceModePreferenceController;
import com.android.settings.display.AwHdmiPreferenceController;
import com.android.settings.display.AwSmartBacklightPreferenceController;
import com.android.settings.display.BrightnessLevelPreferenceController;
import com.android.settings.display.CameraGesturePreferenceController;
import com.android.settings.display.ColorModePreferenceController;
import com.android.settings.display.FontSizePreferenceController;
import com.android.settings.display.LiftToWakePreferenceController;
import com.android.settings.display.NightDisplayPreferenceController;
import com.android.settings.display.NightModePreferenceController;
import com.android.settings.display.ScreenSaverPreferenceController;
import com.android.settings.display.TapToWakePreferenceController;
import com.android.settings.display.ThemePreferenceController;
import com.android.settings.display.TimeoutPreferenceController;
import com.android.settings.display.VrDisplayPreferenceController;
import com.android.settings.display.WallpaperPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import java.util.ArrayList;
import java.util.List;
public class DisplaySettings extends DashboardFragment {
private static final String TAG = "DisplaySettings";
public static final String KEY_AUTO_BRIGHTNESS = "auto_brightness";
public static final String KEY_DISPLAY_SIZE = "screen_zoom";
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
private static final String KEY_AMBIENT_DISPLAY = "ambient_display";
@Override
public int getMetricsCategory() {
return MetricsEvent.DISPLAY;
}
@Override
protected String getLogTag() {
return TAG;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
mProgressiveDisclosureMixin.setTileLimit(4);
}
@Override
protected int getPreferenceScreenResId() {
return R.xml.display_settings;
}
@Override
protected List<AbstractPreferenceController> getPreferenceControllers(Context context) {
return buildPreferenceControllers(context, getLifecycle());
}
@Override
protected int getHelpResource() {
return R.string.help_uri_display;
}
private static List<AbstractPreferenceController> buildPreferenceControllers(
Context context, Lifecycle lifecycle) {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new AutoBrightnessPreferenceController(context, KEY_AUTO_BRIGHTNESS));
controllers.add(new AutoRotatePreferenceController(context, lifecycle));
controllers.add(new CameraGesturePreferenceController(context));
controllers.add(new FontSizePreferenceController(context));
controllers.add(new LiftToWakePreferenceController(context));
controllers.add(new NightDisplayPreferenceController(context));
controllers.add(new NightModePreferenceController(context));
controllers.add(new ScreenSaverPreferenceController(context));
controllers.add(new AmbientDisplayPreferenceController(
context,
new AmbientDisplayConfiguration(context),
KEY_AMBIENT_DISPLAY));
controllers.add(new TapToWakePreferenceController(context));
controllers.add(new TimeoutPreferenceController(context, KEY_SCREEN_TIMEOUT));
controllers.add(new VrDisplayPreferenceController(context));
controllers.add(new WallpaperPreferenceController(context));
controllers.add(new ThemePreferenceController(context));
controllers.add(new BrightnessLevelPreferenceController(context, lifecycle));
controllers.add(new ColorModePreferenceController(context));
controllers.add(new AwHdmiPreferenceController(context));
controllers.add(new AwEnhanceModePreferenceController(context));
controllers.add(new AwSmartBacklightPreferenceController(context));
controllers.add(new AwColorTemperaturePreferenceController(context));
return controllers;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
final ArrayList<SearchIndexableResource> result = new ArrayList<>();
final SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.display_settings;
result.add(sir);
return result;
}
@Override
public List<String> getNonIndexableKeys(Context context) {
List<String> keys = super.getNonIndexableKeys(context);
keys.add(KEY_DISPLAY_SIZE);
keys.add(WallpaperPreferenceController.KEY_WALLPAPER);
keys.add(KEY_AMBIENT_DISPLAY);
return keys;
}
@Override
public List<AbstractPreferenceController> getPreferenceControllers(Context context) {
return buildPreferenceControllers(context, null);
}
};
}
| [
"mingxin.android@gmail.com"
] | mingxin.android@gmail.com |
3025128aaeec31dd65c30cbacd09c289e3844f0a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_443e458362561d9689581c7e15794ce877dbe2fa/Program/11_443e458362561d9689581c7e15794ce877dbe2fa_Program_s.java | 21139a38d17373ac5933656864be9f7a5d9d0360 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,164 | java | /**
* jcbnfp — A parser for JCBNF (Jacky's Compilable BNF)
*
* Copyright (C) 2012 Mattias Andrée <maandree@kth.se>
*
* 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 se.kth.maandree.jcbnfp;
import java.util.*;
import java.io.*;
/**
* This is the main entry point of the program
*
* @author Mattias Andrée, <a href="mailto:maandree@kth.se">maandree@kth.se</a>
* @version 1.0
*/
public class Program
{
/**
* Forbidden constructor
*/
private Program()
{
assert false : "You may not create instances of this class.";
}
/**
* This is the main entry point of the program
*
* @param args Command line arguments
*/
public static void main(final String... args)
{
final PrintStream stderr = System.err;
final PrintStream stdout = System.out;
final PrintStream devNull = new PrintStream(new OutputStream() { public void write(int b) { /* do nothing */ } });
final String jcbnfFile = args[0];
final String parseFile = args[1];
final String main = args[2];
InputStream gis = null, fis = null;
try
{
System.setOut(devNull);
System.setErr(devNull);
System.out.println("--- Parsing Syntax ---\n\n");
gis = new BufferedInputStream(new FileInputStream(new File(jcbnfFile)));
final HashMap<String, Definition> defs = GrammarParser.parseGrammar(gis);
for (final Definition def : defs.values())
{
printGrammar(def);
System.out.println("\n");
}
System.out.println("--- Parsing code ---\n\n");
final Parser parser = new Parser(defs, main);
fis = new BufferedInputStream(new FileInputStream(new File(parseFile)));
final ParseTree tree = parser.parse(fis);
System.out.println("\n");
System.setOut(stdout);
System.setErr(stderr);
if (tree == null)
System.out.println("===### Grammar did not match ###===\n\n");
else
{
System.out.println("--- Parsed code ---\n\n");
printTree(tree, parser.data);
System.out.println("\n");
}
}
catch (final SyntaxFileError err)
{
System.err.println("ERROR: " + err.getMessage());
if (err.getCause() != null)
err.getCause().printStackTrace(System.err);
}
catch (final UndefiniedDefinitionException err)
{
System.err.println("ERROR: " + err.getMessage());
}
catch (final RuntimeException err)
{
System.err.print("ERROR: ");
err.printStackTrace(System.err);
}
catch (final Throwable err)
{
System.err.println("---SYSTEM ERROR---");
err.printStackTrace(System.err);
}
finally
{
if (gis != null)
try
{ gis.close();
}
catch (final Throwable err)
{ //Ignore
}
if (fis != null)
try
{ fis.close();
}
catch (final Throwable err)
{ //Ignore
}
}
}
/**
* Prints out a parsed tree
*
* @param tree The tree
* @param data The parsed data
*
* @throws Exception Yay!
*/
public static void printTree(final ParseTree tree, final int[] data) throws Exception
{
final ArrayDeque<ParseTree> nodes = new ArrayDeque<ParseTree>();
final ArrayDeque<String> indents = new ArrayDeque<String>();
nodes.add(tree);
indents.add("");
ParseTree node;
while ((node = nodes.pollLast()) != null)
{
String indent = indents.pollLast();
System.err.print(indent);
System.err.print(node.definition.definition);
System.err.print(" :: (");
System.err.print(node.intervalStart);
System.err.print(", ");
System.err.print(node.intervalEnd - node.intervalStart);
System.err.print(", ");
System.err.print(node.intervalEnd);
System.err.print(") \"\033[32m");
System.err.write(Escaper.escape(data, node.intervalStart, node.intervalEnd - node.intervalStart));
System.err.println("\033[39m\"\033[35m");
System.err.println(indent + "(:: " + node.definition.name + " ::)");
//node.definition.definition.printGrammar(indent + "::= ");
System.err.print("\033[21;33m");
for (final int[] warning : node.definition.warnings) System.err.println(indent + "w-- " + Util.intArrayToString(warning));
for (final int[] warning : node.definition.uniques) System.err.println(indent + "w== " + Util.intArrayToString(warning));
System.err.print("\033[31m");
for (final int[] error : node.definition.oopses) System.err.println(indent + "<-- " + Util.intArrayToString(error));
System.err.print("\033[1m");
for (final int[] error : node.definition.panics) System.err.println(indent + "<== " + Util.intArrayToString(error));
System.err.print("\033[21;39m");
indent += " ";
for (int i = node.children.size() - 1; i >= 0; i--)
{
nodes.offerLast(node.children.get(i));
indents.offerLast(indent);
}
}
}
/**
* Prints out a definition
*
* @param definition The definition
*/
@SuppressWarnings({"rawtypes", "unchecked"})
public static void printGrammar(final Definition definition)
{
System.err.print(definition.toString());
System.out.println("(:: " + definition.name + " ::)");
if (definition.definition != null)
definition.definition.printGrammar("::= ");
if (definition.compiles != null)
definition.compiles.printGrammar("==> ");
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
7bced8825aa6dfc77c7d4dc11f4dc3f9eee24f80 | 4560dcc6564baea1b5e3f4b2e0cfa401a19b644f | /boardTest/src/main/java/com/springbook/biz/board/impl/BoardDAO.java | 851e9d25984ee859216f40352c610d8213cb19a5 | [] | no_license | taeheon1/SpringExam | 4c11f5170aafb3aaca01c7065f4e5559c1b4cf05 | 8081a93d188d8c1366090b4571ac4d545cf36ccc | refs/heads/master | 2022-10-19T03:36:46.790482 | 2020-06-12T09:30:09 | 2020-06-12T09:30:09 | 268,393,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,788 | java | package com.springbook.biz.board.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.springbook.biz.board.BoardVO;
import com.springbook.biz.common.JDBCUtil;
@Repository("boardDAO")
public class BoardDAO {
// JDBC 관련 변수
private Connection conn = null;
private PreparedStatement stmt = null;
private ResultSet rs = null;
// SQL 명령어들
private final String BOARD_INSERT = "insert into board(seq, title, writer,content) values ((select nvl(max(seq), 0)+1 from board) ,?,?,?)";
private final String BOARD_UPDATE = "update board set title=?,content=? where seq=?";
private final String BOARD_DELETE = "delete board where seq=?";
private final String BOARD_GET = "select * from board where seq=?";
private final String BOARD_LIST = "select * from board order by seq desc";
// CRUD 기능의 메소드 구현
// 글 등록
public void insertBoard(BoardVO vo) {
System.out.println("===> JDBC로 insertBoard() 기능 처리");
try {
conn = JDBCUtil.getConnection();
stmt = conn.prepareStatement(BOARD_INSERT);
stmt.setString(1, vo.getTitle());
stmt.setString(2, vo.getWriter());
stmt.setString(3, vo.getContent());
stmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtil.close(stmt, conn);
}
}
// 글 수정
public void updateBoard(BoardVO vo) {
System.out.println("===> JDBC로 updateBoard() 기능 처리");
try {
conn = JDBCUtil.getConnection();
stmt = conn.prepareStatement(BOARD_UPDATE);
stmt.setString(1, vo.getTitle());
stmt.setString(2, vo.getContent());
stmt.setInt(3, vo.getSeq());
stmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtil.close(stmt, conn);
}
}
// 글 삭제
public void deleteBoard(BoardVO vo) {
System.out.println("===> JDBC로 deleteBoard() 기능 처리");
try {
conn = JDBCUtil.getConnection();
stmt = conn.prepareStatement(BOARD_DELETE);
stmt.setInt(1, vo.getSeq());
stmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtil.close(stmt, conn);
}
}
// 글 상세 조회
public BoardVO getBoard(BoardVO vo) {
System.out.println("===> JDBC로 getBoard() 기능 처리");
BoardVO board = null;
try {
conn = JDBCUtil.getConnection();
stmt = conn.prepareStatement(BOARD_GET);
stmt.setInt(1, vo.getSeq());
rs = stmt.executeQuery();
if(rs.next()) {
board = new BoardVO();
board.setSeq(rs.getInt("SEQ"));
board.setTitle(rs.getString("TITLE"));
board.setWriter(rs.getString("WRITER"));
board.setContent(rs.getString("CONTENT"));
board.setRegDate(rs.getDate("REGDATE"));
board.setCnt(rs.getInt("CNT"));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtil.close(rs, stmt, conn);
}
return board;
}
// 글 목록 조회
public List<BoardVO> getBoardList(BoardVO vo) {
System.out.println("===> JDBC로 getBoardList() 기능 처리");
List<BoardVO> boardList = new ArrayList<BoardVO>();
try {
conn = JDBCUtil.getConnection();
stmt = conn.prepareStatement(BOARD_LIST);
rs = stmt.executeQuery();
while(rs.next()) {
BoardVO board = new BoardVO();
board.setSeq(rs.getInt("SEQ"));
board.setTitle(rs.getString("TITLE"));
board.setWriter(rs.getString("WRITER"));
board.setContent(rs.getString("CONTENT"));
board.setRegDate(rs.getDate("REGDATA"));
board.setCnt(rs.getInt("CNT"));
boardList.add(board);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
JDBCUtil.close(rs, stmt, conn);
}
return boardList;
}
} | [
"pengdoong95@gmail.com"
] | pengdoong95@gmail.com |
35b8d82d314ca80a6e493224447b34c10aeebc70 | 0493ffe947dad031c7b19145523eb39209e8059a | /OpenJdk8uTest/src/test/sun/security/mscapi/AccessKeyStore.java | ae72d4fa99ee1ef6cf2b5c1c31405e101cf8fef7 | [] | no_license | thelinh95/Open_Jdk8u_Test | 7612f1b63b5001d1df85c1df0d70627b123de80f | 4df362a71e680dbd7dfbb28c8922e8f20373757a | refs/heads/master | 2021-01-16T19:27:30.506632 | 2017-08-13T23:26:05 | 2017-08-13T23:26:05 | 100,169,775 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,705 | java | package test.sun.security.mscapi;
/*
* Copyright (c) 2005, 2015, 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.
*
* 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.
*/
/**
* @see AccessKeyStore.sh
*/
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.security.interfaces.RSAKey;
import java.util.Enumeration;
import sun.security.mscapi.Key;
import sun.security.mscapi.KeyStore;
import test.java.security.*;
import test.java.security.cert.*;
public class AccessKeyStore {
public static void main(String[] args) throws Exception {
// Check that a security manager has been installed
if (System.getSecurityManager() == null) {
throw new Exception("A security manager has not been installed");
}
Provider p = Security.getProvider("SunMSCAPI");
System.out.println("SunMSCAPI provider classname is " +
p.getClass().getName());
KeyStore keyStore = KeyStore.getInstance("Windows-MY", p);
/*
* If a SecurityManager exists then this will trigger a
* SecurityException if the following permission has not
* been granted:
*
* SecurityPermission("authProvider.SunMSCAPI")
*/
try {
keyStore.load(null, null);
if (args.length > 0 && "-deny".equals(args[0])) {
throw new Exception(
"Expected KeyStore.load to throw a SecurityException");
}
} catch (SecurityException se) {
if (args.length > 0 && "-deny".equals(args[0])) {
System.out.println("Caught the expected exception: " + se);
return;
} else {
throw se;
}
}
int i = 0;
for (Enumeration<String> e = keyStore.aliases(); e.hasMoreElements(); ) {
String alias = e.nextElement();
displayEntry(keyStore, alias, i++);
}
}
private static void displayEntry(KeyStore keyStore, String alias,
int index) throws KeyStoreException, NoSuchAlgorithmException {
if (keyStore.isKeyEntry(alias)) {
System.out.println("[" + index + "]\n " + alias +
" [key-entry]\n");
try {
Key key = keyStore.getKey(alias, null);
if (key instanceof RSAKey) {
System.out.println(" Key type: " + key.getAlgorithm() +
" (" + ((RSAKey)key).getModulus().bitLength() +
" bit)\n");
} else {
System.out.println(" Key type: " + key.getAlgorithm() +
"\n");
}
} catch (UnrecoverableKeyException e) {
System.out.println(" Key type: Unknown\n");
}
Certificate[] chain = keyStore.getCertificateChain(alias);
if (chain != null) {
System.out.println(" Certificate chain: ");
for (int i = 0; i < chain.length; i ++) {
System.out.println(" ["+ (i + 1) + "]");
displayCert(chain[i], " ");
}
}
} else {
System.out.println("[" + index + "]\n " + alias +
" [trusted-cert-entry]\n");
Certificate[] chain = keyStore.getCertificateChain(alias);
if (chain != null) {
System.out.println(" Certificate chain: ");
for (int i = 0; i < chain.length; i ++) {
System.out.println(" ["+ (i + 1) + "]");
displayCert(chain[i], " ");
}
}
}
System.out.println("-------------------------------------------------");
}
private static void displayCert(Certificate cert, String tab) {
if (cert instanceof X509Certificate) {
X509Certificate x = (X509Certificate) cert;
System.out.println(
tab + "Owner: " + x.getSubjectDN().toString() + "\n" +
tab + "Issuer: " + x.getIssuerDN().toString() + "\n" +
tab + "Serial number: " + x.getSerialNumber().toString(16) +
"\n"+
tab + "Valid from: " + x.getNotBefore().toString() + "\n" +
tab + " until: " + x.getNotAfter().toString());
} else {
System.out.println(tab + "[unknown certificate format]");
}
System.out.println();
}
}
| [
"truongthelinh95@gmail.com"
] | truongthelinh95@gmail.com |
5c7b65e70f2540683f9673dc38c8c9350a12b2b1 | 29106442e1cf9f4b8b8f4f509408063eeb7a3657 | /app/src/main/java/com/smartlab/drivetrain/license/Result.java | 411171bae35daef1af133a98c0d09c349643cd82 | [
"Apache-2.0"
] | permissive | tempest1/ChinaDriveTrainingMobileAndroid | 883740238892885b3b62bbcb43f6347738f847aa | bc7796cbc472470a1c1e4a4c3332822b1b1bdf8e | refs/heads/master | 2020-05-30T14:17:54.575603 | 2016-09-22T06:39:54 | 2016-09-22T06:39:54 | 68,892,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 542 | java | package com.smartlab.drivetrain.license;
import android.os.Bundle;
import com.smartlab.drivetrain.base.BaseActivity;
/**
* Created by smartlab on 15/10/24.
*/
public class Result extends BaseActivity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//获取用户的分数使用,然后将其分数绘制到View上面
// setContentView();
}
@Override
protected void initData() {
}
@Override
protected void initView() {
}
}
| [
"505675592@qq.com"
] | 505675592@qq.com |
49165bdfc5af43d965500a39bfa51ffdc946b0c1 | a10cb46de27156b1f7803ede2111188be94bbee8 | /android/app/src/debug/java/com/nectars_28450/ReactNativeFlipper.java | 8b9204fc13012d37bd60446890543ad3c280e617 | [] | no_license | crowdbotics-apps/nectars-28450 | 76efecce2ba21173dda1b8748256b1dd5e2be13a | fb330ba7aa7288387aaccfe0a91bb1ce909868ae | refs/heads/master | 2023-06-06T16:53:03.740768 | 2021-07-05T05:21:49 | 2021-07-05T05:21:49 | 383,022,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,268 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.nectars_28450;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"team@crowdbotics.com"
] | team@crowdbotics.com |
43fe635557d61727c0aed5220f2d562a8bf1c20d | 5148293c98b0a27aa223ea157441ac7fa9b5e7a3 | /Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd82.java | 0cbd96b94c510c9a230d1419e2ac9a8d2523b760 | [] | no_license | ryosuke-ku/TestCodeSeacherPlus | cfd03a2858b67a05ecf17194213b7c02c5f2caff | d002a52251f5461598c7af73925b85a05cea85c6 | refs/heads/master | 2020-05-24T01:25:27.000821 | 2019-08-17T06:23:42 | 2019-08-17T06:23:42 | 187,005,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | // clone pairs:1475:91%
// 1259:beam/runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkJobServerDriver.java
public class Nicad_t1_beam_2nd82
{
public static FlinkJobServerDriver fromParams(String[] args) {
FlinkServerConfiguration configuration = new FlinkServerConfiguration();
CmdLineParser parser = new CmdLineParser(configuration);
try {
parser.parseArgument(args);
} catch (CmdLineException e) {
LOG.error("Unable to parse command line arguments.", e);
printUsage(parser);
throw new IllegalArgumentException("Unable to parse command line arguments.", e);
}
return fromConfig(configuration);
}
} | [
"naist1020@gmail.com"
] | naist1020@gmail.com |
e99eb9284fd2f2d35a844ed64d529dd72e6fe33f | 46a9a252ea9d80f8ba3cc61d3d495a728c43031b | /src/ch03/DateTest.java | 059ea2229dcb327a69c88e9884c084e350947f4b | [] | no_license | humility0310/ch03 | db491f24b51c53e9342adb83e04d61ae3dfe61a9 | 4de34dc26a8bd423feeb8539d7b06e183246a029 | refs/heads/master | 2021-01-12T13:23:17.173485 | 2016-09-26T02:56:00 | 2016-09-26T02:56:00 | 68,971,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java | package ch03;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateTest {
public static void main(String[] args) {
Date now = new Date();
// System.out.println(now);
// 년, 월(0-11), 일
Date d1 = new Date(2000, 9, 23);// depercated-> 없어질 예정(비추천하는거)
printDate(d1);
// 년, 월(0-11), 일, 시간, 분
Date d2 = new Date(2000, 8, 1, 12, 30);// depercated-> 없어질 예정(비추천하는거)
// System.out.println(d2);
printDate(d2);
// 년, 월(0-11), 일, 시간, 분
Date d3 = new Date(2000, 8, 1, 12, 30, 30);// depercated-> 없어질
// 예정(비추천하는거)
// System.out.println(d3);
printDate(d3);
// 1970년 1월1일 00:00:00 기준으로 밀리세컨드값으로 세팅
// 년, 월(0-11), 일, 시간, 분
long milliseconds = 1000L * 60 * 60 * 24 * 365 * 40;
Date d4 = new Date(milliseconds);
// System.out.println(d4);
printDate(d4);
printDate2(d4);
}
private static void printDate(Date d) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy년 MM월 dd일 hh:mm:ss");
System.out.println(sdf.format(d));
}
private static void printDate2(Date d) {
//년도 + 1900
int year = d.getYear();
//월 + 1
int month = d.getMonth();
//일
int date = d.getDate();
//시
int hour = d.getHours();
//분
int min= d.getMinutes();
//초
int sec = d.getSeconds();
System.out.println((year+1900) + "년" +
(month+1)+"월"+
(date)+"일"+
(hour)+"시"+
(min)+"분"+
(sec)+"초");
}
}
| [
"bit-user@bit"
] | bit-user@bit |
2a90304e9afb2ae894b5aeb2c77299a7675cde47 | f77c2988a65916f685888beb07fd8bdfdc26ec83 | /springbootMangodb/springbootMangodb/src/main/java/com/formation/springbootMangodb/dao/CustomerRepository.java | a90c65b363315a7cbaae1085ea89179ca0a5dc31 | [] | no_license | khaledboussaba/my_workspaces_al34 | 8306d7544b7e8d207077bc6f87cea1284e663007 | bb15ae2463a08772b00144dc4c53fb8959a10f8c | refs/heads/master | 2022-12-14T03:35:13.992147 | 2020-02-21T15:49:07 | 2020-02-21T15:49:07 | 224,636,612 | 0 | 0 | null | 2022-12-13T17:49:51 | 2019-11-28T11:17:49 | Java | UTF-8 | Java | false | false | 380 | java | package com.formation.springbootMangodb.dao;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.formation.springbootMangodb.entity.Person;
public interface CustomerRepository extends MongoRepository<Person, String> {
public Person findByFirstName(String firstName);
public List<Person> findByLastName(String lastName);
}
| [
"khaledboussaba@gmail.com"
] | khaledboussaba@gmail.com |
de609998b80595c5d91b0cc73a1a178102ef3c2d | 4c9a93e06b0af708f6e0d2d4d44ed7c1a7580eb2 | /xstream/src/java/com/thoughtworks/xstream/converters/extended/ActivationDataFlavorConverter.java | a7e6904facff1efc9220438bf123169c8e38d213 | [
"BSD-3-Clause"
] | permissive | zeshuai007/xstream | dc550a39a3ba980ce276310854e9fbb197ac78dc | 87ccfbf98a8db545f4d30f2fc71a8a0c37609dc2 | refs/heads/master | 2021-02-14T09:33:15.275733 | 2020-03-04T10:59:27 | 2020-03-21T09:04:48 | 244,793,330 | 0 | 0 | NOASSERTION | 2020-03-04T10:59:55 | 2020-03-04T02:55:08 | Java | UTF-8 | Java | false | false | 3,618 | java | /*
* Copyright (C) 2015 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on 21.06.2015 by Joerg Schaible
*/
package com.thoughtworks.xstream.converters.extended;
import javax.activation.ActivationDataFlavor;
import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
/**
* Converts an {@link ActivationDataFlavor}.
*
* @author Jörg Schaible
* @since 1.4.9
*/
public class ActivationDataFlavorConverter implements Converter {
@Override
public boolean canConvert(final Class<?> type) {
return type == ActivationDataFlavor.class;
}
@Override
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) {
final ActivationDataFlavor dataFlavor = ActivationDataFlavor.class.cast(source);
final String mimeType = dataFlavor.getMimeType();
if (mimeType != null) {
writer.startNode("mimeType");
writer.setValue(mimeType);
writer.endNode();
}
final String name = dataFlavor.getHumanPresentableName();
if (name != null) {
writer.startNode("humanRepresentableName");
writer.setValue(name);
writer.endNode();
}
final Class<?> representationClass = dataFlavor.getRepresentationClass();
if (representationClass != null) {
writer.startNode("representationClass");
context.convertAnother(representationClass);
writer.endNode();
}
}
@Override
public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) {
String mimeType = null;
String name = null;
Class<?> type = null;
while (reader.hasMoreChildren()) {
reader.moveDown();
final String elementName = reader.getNodeName();
if (elementName.equals("mimeType")) {
mimeType = reader.getValue();
} else if (elementName.equals("humanRepresentableName")) {
name = reader.getValue();
} else if (elementName.equals("representationClass")) {
type = (Class<?>)context.convertAnother(null, Class.class);
} else {
final ConversionException exception = new ConversionException("Unknown child element");
exception.add("element", reader.getNodeName());
throw exception;
}
reader.moveUp();
}
ActivationDataFlavor dataFlavor = null;
try {
if (type == null) {
dataFlavor = new ActivationDataFlavor(mimeType, name);
} else if (mimeType == null) {
dataFlavor = new ActivationDataFlavor(type, name);
} else {
dataFlavor = new ActivationDataFlavor(type, mimeType, name);
}
} catch (final IllegalArgumentException ex) {
throw new ConversionException(ex);
} catch (final NullPointerException ex) {
throw new ConversionException(ex);
}
return dataFlavor;
}
}
| [
"joerg.schaible@gmx.de"
] | joerg.schaible@gmx.de |
25a77b7980aaf0163a3eeec79912e1bf08e0be51 | 0e2eed7cca32367c797938e3c8e24e5d83ba2ca8 | /app/src/main/java/com/xkj/binaryoption/bean/HistoryDataList.java | 356a24fd2cbed428dee7a5a92b35e962f3c7b99d | [] | no_license | AreYReady/BinaryOption | fd23c098ccdf58adeb678a350335ba0d0f4fe548 | 60bd6c3b3dbe275f2a39c7fe2b3270a000991595 | refs/heads/master | 2021-01-19T23:52:28.954837 | 2017-05-13T03:05:26 | 2017-05-13T03:05:26 | 89,043,127 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,279 | java | package com.xkj.binaryoption.bean;
import java.io.Serializable;
import java.util.List;
/**
* @author xjunda
* @date 2016-07-18
* 历史数据列表
*/
public class HistoryDataList implements Serializable, IHistoryDataList {
/**
* msg_type : 1101
* result_code : 0
* count : 2
* digits : 5
*/
private int msg_type;
private int result_code;
private int count;
private int digits;
private List<HistoryData> items;
private String symbol;
private int period;
private long cacheTime;
/**
* 历史最近一次价格
*/
private String nowPrice = "0.00000";
private int flag;
private double[] price;
public int getMsg_type() {
return msg_type;
}
public void setMsg_type(int msg_type) {
this.msg_type = msg_type;
}
public int getResult_code() {
return result_code;
}
public void setResult_code(int result_code) {
this.result_code = result_code;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getDigits() {
return digits;
}
public void setDigits(int digits) {
this.digits = digits;
}
public List<HistoryData> getItems() {
return items;
}
public void setItems(List<HistoryData> items) {
this.items = items;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
public int getPeriod() {
return period;
}
public void setPeriod(int period) {
this.period = period;
}
public long getCacheTime() {
return cacheTime;
}
public void setCacheTime(long cacheTime) {
this.cacheTime = cacheTime;
}
public String getNowPrice() {
return nowPrice;
}
public void setNowPrice(String nowPrice) {
this.nowPrice = nowPrice;
}
public int getFlag() {
return flag;
}
public void setFlag(int flag) {
this.flag = flag;
}
public double[] getPrice() {
return price;
}
public void setPrice(double[] price) {
this.price = price;
}
}
| [
"jimdaxu@qq.com"
] | jimdaxu@qq.com |
150549767eb866b342cf84673b43ec8768318c3f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/21/21_73c5c105e2ff0853742c14fce731689ee8ccf11e/ImportFileStatusWidget/21_73c5c105e2ff0853742c14fce731689ee8ccf11e_ImportFileStatusWidget_s.java | 9b01a2eb756457c2e4d59c4cfdd09629b58b4801 | [] | 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,040 | java | package eu.europeana.dashboard.client.collections;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Widget;
import eu.europeana.dashboard.client.CollectionHolder;
import eu.europeana.dashboard.client.DashboardWidget;
import eu.europeana.dashboard.client.Reply;
import eu.europeana.dashboard.client.dto.EuropeanaCollectionX;
import eu.europeana.dashboard.client.dto.ImportFileX;
/**
* Hold an import file and present the appropriate widget for doing things with it.
*
* @author Gerald de Jong, Beautiful Code BV, <geralddejong@gmail.com>
*/
public class ImportFileStatusWidget extends DashboardWidget {
private static final int STATUS_CHECK_DELAY = 1000;
private CollectionHolder holder;
private StatusCheckTimer statusCheckTimer;
private HorizontalPanel panel = new HorizontalPanel();
public ImportFileStatusWidget(World world, CollectionHolder holder) {
super(world);
this.holder = holder;
this.panel.setSpacing(6);
refreshPanel();
holder.addListener(new CollectionHolder.CollectionUpdateListener() {
public void collectionUpdated(EuropeanaCollectionX collection) {
refreshPanel();
}
});
}
public Widget createWidget() {
return panel;
}
public void refreshPanel() {
panel.clear();
if (holder.getImportFile() == null) {
panel.add(new HTML(world.messages().noImportFilePresent()));
}
else {
final ImportFileX importFile = holder.getImportFile();
panel.add(new HTML(world.messages().theFileIs(importFile.getFileName())));
switch (importFile.getState()) {
case NONEXISTENT:
panel.add(new HTML(world.messages().noImportFilePresent()));
checkTransitionFromState(ImportFileX.State.NONEXISTENT);
break;
case UPLOADING:
panel.add(new HTML(world.messages().uploading()));
checkTransitionFromState(ImportFileX.State.UPLOADING);
break;
case UPLOADED:
panel.add(new HTML(world.messages().uploaded()));
Button commenceImport = new Button(world.messages().commenceImport());
commenceImport.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent sender) {
world.service().commenceImport(importFile, holder.getCollection().getId(), true, new Reply<ImportFileX>() {
public void onSuccess(ImportFileX result) {
holder.setImportFile(result);
}
});
}
});
panel.add(commenceImport);
panel.add(new HTML(world.messages().or()));
break;
case IMPORTING:
panel.add(new HTML(world.messages().importing()));
Button cancelImport = new Button(world.messages().abortImport());
cancelImport.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent sender) {
world.service().abortImport(importFile, true, new Reply<ImportFileX>() {
public void onSuccess(ImportFileX result) {
holder.setImportFile(result);
}
});
}
});
panel.add(cancelImport);
checkTransitionFromState(ImportFileX.State.IMPORTING);
break;
case IMPORTED:
panel.add(new HTML(world.messages().imported()));
break;
case ERROR:
panel.add(new HTML(world.messages().haltedWithAnError()));
break;
default:
throw new RuntimeException("Unknown state");
}
}
}
public void waitForFile() {
checkTransitionFromState(ImportFileX.State.NONEXISTENT);
}
private void checkTransitionFromState(ImportFileX.State currentState) {
if (statusCheckTimer != null) {
if (!statusCheckTimer.checks(currentState)) {
statusCheckTimer.cancel();
statusCheckTimer = new StatusCheckTimer(currentState);
statusCheckTimer.schedule(STATUS_CHECK_DELAY);
}
}
else {
statusCheckTimer = new StatusCheckTimer(currentState);
statusCheckTimer.schedule(STATUS_CHECK_DELAY);
}
}
private class StatusCheckTimer extends Timer {
private ImportFileX.State currentState;
private StatusCheckTimer(ImportFileX.State currentState) {
this.currentState = currentState;
}
public boolean checks(ImportFileX.State currentState) {
return this.currentState == currentState;
}
public void run() {
GWT.log("checking for " + holder.getCollection().getFileName(), null);
world.service().checkImportFileStatus(holder.getCollection().getFileName(), true, new Reply<ImportFileX>() {
public void onSuccess(ImportFileX result) {
if (result != null) {
holder.setImportFile(result);
if (result.getState() == currentState) {
GWT.log("waiting for " + holder.getCollection().getName() + " from " + currentState, null);
StatusCheckTimer.this.schedule(STATUS_CHECK_DELAY);
}
else {
statusCheckTimer = null;
}
}
else if (currentState == ImportFileX.State.NONEXISTENT) {
GWT.log("waiting for " + holder.getCollection().getName() + " from " + currentState, null);
StatusCheckTimer.this.schedule(STATUS_CHECK_DELAY);
}
else {
GWT.log("no import file named " + holder.getCollection().getFileName(), null);
holder.clearImportFile();
statusCheckTimer = null;
}
}
});
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
4c4858b32e1878c74e55a0fd8b3d9c7859a6609a | aa23a19ab8e6a19c4ab9e039e62d7271ed357f1f | /CarWorkshop/CarWorkshop_v4/src/uo/ri/ui/admin/action/UpdateMechanicAction.java | a1fae87b6191ba8a1fb975b4ac772ad9797b2eed | [] | no_license | mistermboy/RI | 409179fed877754e18f417252929d7a452169442 | 3d7c3c5a801460bbda0b5fe4e3f6a2a095810b0f | refs/heads/master | 2021-03-27T13:46:32.425013 | 2018-01-25T22:52:13 | 2018-01-25T22:52:13 | 103,941,796 | 1 | 0 | null | 2020-06-16T07:58:07 | 2017-09-18T13:21:58 | Java | UTF-8 | Java | false | false | 605 | java | package uo.ri.ui.admin.action;
import uo.ri.common.BusinessException;
import uo.ri.conf.ServicesFactory;
import alb.util.console.Console;
import alb.util.menu.Action;
public class UpdateMechanicAction implements Action {
@Override
public void execute() throws BusinessException {
// Pedir datos
Long id = Console.readLong("Id del mecánico");
String nombre = Console.readString("Nombre");
String apellidos = Console.readString("Apellidos");
ServicesFactory.getAdminService().updateMechanic(id, nombre, apellidos);
// Mostrar resultado
Console.println("Mecánico actualizado");
}
}
| [
"pabloyo97@hotmail.com"
] | pabloyo97@hotmail.com |
ee404de394339386dec009ebba375fae3a916d27 | 8727b1cbb8ca63d30340e8482277307267635d81 | /PolarServer/src/com/game/summonpet/bean/SummonPetDetailInfo.java | 3f7efbf2ee6db3eaa6fd4a5e7ee18ba542aafc6f | [] | no_license | taohyson/Polar | 50026903ded017586eac21a7905b0f1c6b160032 | b0617f973fd3866bed62da14f63309eee56f6007 | refs/heads/master | 2021-05-08T12:22:18.884688 | 2015-12-11T01:44:18 | 2015-12-11T01:44:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,021 | java | package com.game.summonpet.bean;
import java.util.List;
import java.util.ArrayList;
import com.game.message.Bean;
import org.apache.mina.core.buffer.IoBuffer;
/**
* @author Commuication Auto Maker
*
* @version 1.0.0
*
* 召唤怪祥细信息类
*/
public class SummonPetDetailInfo extends Bean {
//召唤怪Id
private long petId;
//召唤怪模板Id
private int petModelId;
//召唤怪等级
private int level;
//召唤怪HP
private int hp;
//召唤怪最大HP
private int maxHp;
//召唤怪MP
private int mp;
//召唤怪最大MP
private int maxMp;
//召唤怪SP
private int sp;
//召唤怪最大SP
private int maxSp;
//召唤怪速度
private int speed;
// //出战状态,1出战 0不出战
// private byte showState;
//
// //死亡时间 如果出战状态且未死亡则返回0 否则返回秒级时间
// private int dieTime;
//
// //合体次数
// private int htCount;
//
// //今日合体次数
// private int dayCount;
//
// //合体冷确时间
// private int htCoolDownTime;
//技能列表
private List<com.game.skill.bean.SkillInfo> skillInfos = new ArrayList<com.game.skill.bean.SkillInfo>();
//合体加成
// private List<com.game.player.bean.PlayerAttributeItem> htAddition = new ArrayList<com.game.player.bean.PlayerAttributeItem>();
/**
* 写入字节缓存
*/
public boolean write(IoBuffer buf){
//召唤怪Id
writeLong(buf, this.petId);
//召唤怪模板Id
writeInt(buf, this.petModelId);
//召唤怪等级
writeInt(buf, this.level);
//召唤怪HP
writeInt(buf, this.hp);
//召唤怪最大HP
writeInt(buf, this.maxHp);
//召唤怪MP
writeInt(buf, this.mp);
//召唤怪最大MP
writeInt(buf, this.maxMp);
//召唤怪SP
writeInt(buf, this.sp);
//召唤怪最大SP
writeInt(buf, this.maxSp);
//召唤怪速度
writeInt(buf, this.speed);
//技能列表
writeShort(buf, skillInfos.size());
for (int i = 0; i < skillInfos.size(); i++) {
writeBean(buf, skillInfos.get(i));
}
return true;
}
/**
* 读取字节缓存
*/
public boolean read(IoBuffer buf){
//召唤怪Id
this.petId = readLong(buf);
//召唤怪模板Id
this.petModelId = readInt(buf);
//召唤怪等级
this.level = readInt(buf);
//召唤怪HP
this.hp = readInt(buf);
//召唤怪最大HP
this.maxHp = readInt(buf);
//召唤怪MP
this.mp = readInt(buf);
//召唤怪最大MP
this.maxMp = readInt(buf);
//召唤怪SP
this.sp = readInt(buf);
//召唤怪最大SP
this.maxSp = readInt(buf);
//召唤怪速度
this.speed = readInt(buf);
//技能列表
int skillInfos_length = readShort(buf);
for (int i = 0; i < skillInfos_length; i++) {
skillInfos.add((com.game.skill.bean.SkillInfo)readBean(buf, com.game.skill.bean.SkillInfo.class));
}
return true;
}
/**
* get 召唤怪Id
* @return
*/
public long getPetId(){
return petId;
}
/**
* set 召唤怪Id
*/
public void setPetId(long petId){
this.petId = petId;
}
/**
* get 召唤怪模板Id
* @return
*/
public int getPetModelId(){
return petModelId;
}
/**
* set 召唤怪模板Id
*/
public void setPetModelId(int petModelId){
this.petModelId = petModelId;
}
/**
* get 召唤怪等级
* @return
*/
public int getLevel(){
return level;
}
/**
* set 召唤怪等级
*/
public void setLevel(int level){
this.level = level;
}
/**
* get 召唤怪HP
* @return
*/
public int getHp(){
return hp;
}
/**
* set 召唤怪HP
*/
public void setHp(int hp){
this.hp = hp;
}
/**
* get 召唤怪最大HP
* @return
*/
public int getMaxHp(){
return maxHp;
}
/**
* set 召唤怪最大HP
*/
public void setMaxHp(int maxHp){
this.maxHp = maxHp;
}
/**
* get 召唤怪MP
* @return
*/
public int getMp(){
return mp;
}
/**
* set 召唤怪MP
*/
public void setMp(int mp){
this.mp = mp;
}
/**
* get 召唤怪最大MP
* @return
*/
public int getMaxMp(){
return maxMp;
}
/**
* set 召唤怪最大MP
*/
public void setMaxMp(int maxMp){
this.maxMp = maxMp;
}
/**
* get 召唤怪SP
* @return
*/
public int getSp(){
return sp;
}
/**
* set 召唤怪SP
*/
public void setSp(int sp){
this.sp = sp;
}
/**
* get 召唤怪最大SP
* @return
*/
public int getMaxSp(){
return maxSp;
}
/**
* set 召唤怪最大SP
*/
public void setMaxSp(int maxSp){
this.maxSp = maxSp;
}
/**
* get 召唤怪速度
* @return
*/
public int getSpeed(){
return speed;
}
/**
* set 召唤怪速度
*/
public void setSpeed(int speed){
this.speed = speed;
}
/**
* get 技能列表
* @return
*/
public List<com.game.skill.bean.SkillInfo> getSkillInfos(){
return skillInfos;
}
/**
* set 技能列表
*/
public void setSkillInfos(List<com.game.skill.bean.SkillInfo> skillInfos){
this.skillInfos = skillInfos;
}
@Override
public String toString(){
StringBuffer buf = new StringBuffer("[");
//召唤怪Id
buf.append("petId:" + petId +",");
//召唤怪模板Id
buf.append("petModelId:" + petModelId +",");
//召唤怪等级
buf.append("level:" + level +",");
//召唤怪HP
buf.append("hp:" + hp +",");
//召唤怪最大HP
buf.append("maxHp:" + maxHp +",");
//召唤怪MP
buf.append("mp:" + mp +",");
//召唤怪最大MP
buf.append("maxMp:" + maxMp +",");
//召唤怪SP
buf.append("sp:" + sp +",");
//召唤怪最大SP
buf.append("maxSp:" + maxSp +",");
//召唤怪速度
buf.append("speed:" + speed +",");
//技能列表
buf.append("skillInfos:{");
for (int i = 0; i < skillInfos.size(); i++) {
buf.append(skillInfos.get(i).toString() +",");
}
if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1);
buf.append("},");
if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1);
buf.append("},");
if(buf.charAt(buf.length()-1)==',') buf.deleteCharAt(buf.length()-1);
buf.append("]");
return buf.toString();
}
} | [
"zhuyuanbiao@ZHUYUANBIAO.rd.com"
] | zhuyuanbiao@ZHUYUANBIAO.rd.com |
ed00b765e0fffa5c5fc508fdc0e5947b203b01dc | 9dae38286b0d430a2c33eab688926a43c8661c3a | /src/main/java/net/minecraft/block/BlockBasePressurePlate.java | 625c2d88678988de330d446efea14e1a8e7247ad | [] | no_license | SkidJava/Orbit-1.12.2 | a4cd3cb11f5a245168c20ae211bbd156668485e5 | 41d445d1f5ba99b826ee3b57552539e0caaf9a37 | refs/heads/master | 2022-04-25T21:12:53.403324 | 2020-04-28T17:37:16 | 2020-04-28T17:37:16 | 258,465,036 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,396 | java | package net.minecraft.block;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public abstract class BlockBasePressurePlate extends Block
{
/** The bounding box for the pressure plate pressed state */
protected static final AxisAlignedBB PRESSED_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.03125D, 0.9375D);
protected static final AxisAlignedBB UNPRESSED_AABB = new AxisAlignedBB(0.0625D, 0.0D, 0.0625D, 0.9375D, 0.0625D, 0.9375D);
/**
* This bounding box is used to check for entities in a certain area and then determine the pressed state.
*/
protected static final AxisAlignedBB PRESSURE_AABB = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 0.25D, 0.875D);
protected BlockBasePressurePlate(Material materialIn)
{
this(materialIn, materialIn.getMaterialMapColor());
}
protected BlockBasePressurePlate(Material materialIn, MapColor mapColorIn)
{
super(materialIn, mapColorIn);
this.setCreativeTab(CreativeTabs.REDSTONE);
this.setTickRandomly(true);
}
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
boolean flag = this.getRedstoneStrength(state) > 0;
return flag ? PRESSED_AABB : UNPRESSED_AABB;
}
/**
* How many theWorld ticks before ticking
*/
public int tickRate(World worldIn)
{
return 20;
}
@Nullable
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
{
return NULL_AABB;
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
public boolean isFullCube(IBlockState state)
{
return false;
}
public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
{
return true;
}
/**
* Return true if an entity can be spawned inside the block (used to get the thePlayer's bed spawn location)
*/
public boolean canSpawnInBlock()
{
return true;
}
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
return this.canBePlacedOn(worldIn, pos.down());
}
/**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos p_189540_5_)
{
if (!this.canBePlacedOn(worldIn, pos.down()))
{
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
}
}
private boolean canBePlacedOn(World worldIn, BlockPos pos)
{
return worldIn.getBlockState(pos).isFullyOpaque() || worldIn.getBlockState(pos).getBlock() instanceof BlockFence;
}
/**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/
public void randomTick(World worldIn, BlockPos pos, IBlockState state, Random random)
{
}
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
if (!worldIn.isRemote)
{
int i = this.getRedstoneStrength(state);
if (i > 0)
{
this.updateState(worldIn, pos, state, i);
}
}
}
/**
* Called When an Entity Collided with the Block
*/
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn)
{
if (!worldIn.isRemote)
{
int i = this.getRedstoneStrength(state);
if (i == 0)
{
this.updateState(worldIn, pos, state, i);
}
}
}
/**
* Updates the pressure plate when stepped on
*/
protected void updateState(World worldIn, BlockPos pos, IBlockState state, int oldRedstoneStrength)
{
int i = this.computeRedstoneStrength(worldIn, pos);
boolean flag = oldRedstoneStrength > 0;
boolean flag1 = i > 0;
if (oldRedstoneStrength != i)
{
state = this.setRedstoneStrength(state, i);
worldIn.setBlockState(pos, state, 2);
this.updateNeighbors(worldIn, pos);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
}
if (!flag1 && flag)
{
this.playClickOffSound(worldIn, pos);
}
else if (flag1 && !flag)
{
this.playClickOnSound(worldIn, pos);
}
if (flag1)
{
worldIn.scheduleUpdate(new BlockPos(pos), this, this.tickRate(worldIn));
}
}
protected abstract void playClickOnSound(World worldIn, BlockPos color);
protected abstract void playClickOffSound(World worldIn, BlockPos pos);
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
if (this.getRedstoneStrength(state) > 0)
{
this.updateNeighbors(worldIn, pos);
}
super.breakBlock(worldIn, pos, state);
}
/**
* Notify block and block below of changes
*/
protected void updateNeighbors(World worldIn, BlockPos pos)
{
worldIn.notifyNeighborsOfStateChange(pos, this, false);
worldIn.notifyNeighborsOfStateChange(pos.down(), this, false);
}
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return this.getRedstoneStrength(blockState);
}
public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return side == EnumFacing.UP ? this.getRedstoneStrength(blockState) : 0;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower(IBlockState state)
{
return true;
}
public EnumPushReaction getMobilityFlag(IBlockState state)
{
return EnumPushReaction.DESTROY;
}
protected abstract int computeRedstoneStrength(World worldIn, BlockPos pos);
protected abstract int getRedstoneStrength(IBlockState state);
protected abstract IBlockState setRedstoneStrength(IBlockState state, int strength);
public BlockFaceShape func_193383_a(IBlockAccess p_193383_1_, IBlockState p_193383_2_, BlockPos p_193383_3_, EnumFacing p_193383_4_)
{
return BlockFaceShape.UNDEFINED;
}
}
| [
"skidjava@gmail.com"
] | skidjava@gmail.com |
4dc5a5998aab43e9eb0d40b3a5915a9f60315a39 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-18-26-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/xhtml/wikimodel/XWikiCommentHandler_ESTest.java | 561ac14ed194312da7f010356cb01e7b3fdd623d | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 08 05:26:22 UTC 2020
*/
package org.xwiki.rendering.internal.parser.xhtml.wikimodel;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class XWikiCommentHandler_ESTest extends XWikiCommentHandler_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
81e29aa47490ee4569ed2514c303e89f23bde45b | 93837a1c3a25a80c355878442269d97e6afff096 | /src/test/java/com/tc/shop/ShopadminApplicationTests.java | 87b8abd0aea5b207ca82fe52ecb9db74f20b3e80 | [] | no_license | Gemmmm/ShopAdmin | fefef4ff2cddd2b86e34a66317bf1aedc504786d | 305bbdc3a7e841c883d50cf628e9d4fecd77546d | refs/heads/main | 2023-02-10T18:01:53.758072 | 2021-01-07T02:06:07 | 2021-01-07T02:06:07 | 327,476,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package com.tc.shop;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ShopadminApplicationTests {
@Test
void contextLoads() {
}
}
| [
"1121382295@qq.com"
] | 1121382295@qq.com |
814f754a00a581d249ef182141644a7342e67d87 | 027c0c52ab66f181be386217c91a28188dd3a4d2 | /dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/source/SourceStoreTest.java | 3e75b49889a0c0ca244855d9ff2d0c9ba8624448 | [
"BSD-3-Clause"
] | permissive | rubendw/dhis2 | 96f3af9fb4fa0f9d421b39098ad7aa4096c82af3 | b9f5272ea001020717e4fc630ddb9f145b95d6ef | refs/heads/master | 2022-02-15T08:35:43.775194 | 2009-03-04T15:10:07 | 2009-03-04T15:10:07 | 142,915 | 1 | 0 | null | 2022-01-21T23:21:45 | 2009-03-04T15:13:23 | Java | UTF-8 | Java | false | false | 4,578 | java | package org.hisp.dhis.source;
/*
* Copyright (c) 2004-2007, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import org.hisp.dhis.DhisSpringTest;
/**
* @author Torgeir Lorange Ostby
* @version $Id: SourceStoreTest.java 3200 2007-03-29 11:51:17Z torgeilo $
*/
public class SourceStoreTest
extends DhisSpringTest
{
private SourceStore sourceStore;
// -------------------------------------------------------------------------
// Set up/tear down
// -------------------------------------------------------------------------
public void setUpTest()
throws Exception
{
sourceStore = (SourceStore) getBean( SourceStore.ID );
}
// -------------------------------------------------------------------------
// Tests
// -------------------------------------------------------------------------
public void testSource()
throws Exception
{
String sourceAName = "DummySourceA";
String sourceBName = "DummySourceB";
Source sourceA = new DummySource( sourceAName );
Source sourceB = new DummySource( sourceBName );
assertEquals( 0, sourceStore.getAllSources().size() );
assertEquals( 0, sourceStore.getAllSources( DummySource.class ).size() );
int sourceAId = sourceStore.addSource( sourceA );
DummySource sourceAA = sourceStore.getSource( sourceAId );
assertEquals( sourceAId, sourceAA.getId() );
assertEquals( sourceAName, sourceAA.getName() );
assertEquals( 1, sourceStore.getAllSources().size() );
assertEquals( 1, sourceStore.getAllSources( DummySource.class ).size() );
int sourceBId = sourceStore.addSource( sourceB );
DummySource sourceBB = sourceStore.getSource( sourceBId );
assertEquals( sourceBId, sourceBB.getId() );
assertEquals( sourceBName, sourceBB.getName() );
assertEquals( 2, sourceStore.getAllSources().size() );
assertEquals( 2, sourceStore.getAllSources( DummySource.class ).size() );
try
{
sourceStore.addSource( new DummySource( sourceAName ) );
fail();
}
catch ( Exception e )
{
// Expected
}
sourceAName = "DummySourceAA";
sourceAA.setName( sourceAName );
sourceStore.updateSource( sourceAA );
sourceAA = sourceStore.getSource( sourceAId );
assertEquals( sourceAId, sourceAA.getId() );
assertEquals( sourceAName, sourceAA.getName() );
assertEquals( 2, sourceStore.getAllSources().size() );
sourceStore.deleteSource( sourceAA );
assertNull( sourceStore.getSource( sourceAId ) );
assertEquals( 1, sourceStore.getAllSources().size() );
sourceBB = sourceStore.getSource( sourceBId);
sourceStore.deleteSource( sourceBB );
assertNull( sourceStore.getSource( sourceBId ) );
assertEquals( 0, sourceStore.getAllSources().size() );
}
}
| [
"oddmunds@leia.ifi.uio.no"
] | oddmunds@leia.ifi.uio.no |
72fde31f012995a081d62683f1673982b50bfe0a | 678a3d58c110afd1e9ce195d2f20b2531d45a2e0 | /sources/com/airbnb/android/lib/views/RatingCell.java | 980f9b65ed2ad7becf2d1920a4961f184a825885 | [] | no_license | jasonnth/AirCode | d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5 | d37db1baa493fca56f390c4205faf5c9bbe36604 | refs/heads/master | 2020-07-03T08:35:24.902940 | 2019-08-12T03:34:56 | 2019-08-12T03:34:56 | 201,842,970 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,165 | java | package com.airbnb.android.lib.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.RatingBar;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.airbnb.android.lib.C0880R;
import com.airbnb.android.utils.ViewUtils;
import com.airbnb.p027n2.utils.ViewLibUtils;
import java.text.DecimalFormat;
public class RatingCell extends FrameLayout {
@BindView
View divider;
@BindView
RatingBar ratingBar;
@BindView
View ratingBarContainer;
private final DecimalFormat ratingFormatter = new DecimalFormat("0.0");
@BindView
TextView ratingText;
@BindView
TextView titleTextView;
private enum RatingStyle {
FiveStarBar,
TextWithSingleStar
}
public RatingCell(Context context) {
super(context);
init(null);
}
public RatingCell(Context context, AttributeSet attrs) {
super(context, attrs);
init(attrs);
}
public RatingCell(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(attrs);
}
private void init(AttributeSet attrs) {
LayoutInflater.from(getContext()).inflate(C0880R.layout.view_rating_cell, this);
ButterKnife.bind((View) this);
if (attrs != null) {
TypedArray a = getContext().obtainStyledAttributes(attrs, C0880R.styleable.RatingCell, 0, 0);
if (a != null) {
String titleText = a.getString(C0880R.styleable.RatingCell_title);
boolean showDivder = a.getBoolean(C0880R.styleable.RatingCell_lib_showDivider, true);
RatingStyle ratingStyle = RatingStyle.values()[a.getInt(C0880R.styleable.RatingCell_ratingStyle, RatingStyle.FiveStarBar.ordinal())];
ViewLibUtils.setVisibleIf(this.ratingText, RatingStyle.TextWithSingleStar.equals(ratingStyle));
ViewLibUtils.setVisibleIf(this.ratingBar, RatingStyle.FiveStarBar.equals(ratingStyle));
setTitle(titleText);
setDividerEnabled(showDivder);
a.recycle();
}
}
}
public void setRating(float rating) {
if (this.ratingBar.getVisibility() == 0) {
this.ratingBar.setRating(rating);
} else {
this.ratingText.setText(this.ratingFormatter.format((double) rating));
}
}
public void setDividerEnabled(boolean showDivder) {
ViewUtils.setVisibleIf(this.divider, showDivder);
}
public void setTitle(String titleText) {
this.titleTextView.setText(titleText);
}
public void setTitle(int titleRes) {
this.titleTextView.setText(titleRes);
}
public void setHorizontalPadding(int horizontalPadding) {
int padding = getResources().getDimensionPixelOffset(horizontalPadding);
this.ratingBarContainer.setPadding(0, 0, padding, 0);
this.titleTextView.setPadding(padding, 0, 0, 0);
}
}
| [
"thanhhuu2apc@gmail.com"
] | thanhhuu2apc@gmail.com |
7c1f7b21b402c1ec9c80271ba925355c157edf29 | e59db84b4e82306b39f9259f3d3ea3c46cd8889c | /src/main/java/in/ankushs/linode4j/model/profile/AuthorizedAppsPageImpl.java | 40509f8a34e9747f4222d14f1b77efdf212a47f1 | [
"MIT"
] | permissive | jordancole18/linode4j | 90b7629a6a35c69f543e2409aec93e0d09c2f4c6 | 163e8d34df9ac78215213c7624c8f97245f18d61 | refs/heads/master | 2021-09-05T02:42:37.300176 | 2018-01-23T18:24:15 | 2018-01-23T18:24:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 710 | java | package in.ankushs.linode4j.model.profile;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import in.ankushs.linode4j.model.interfaces.Page;
import lombok.Data;
import java.util.Set;
/**
* Created by ankushsharma on 22/12/17.
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public final class AuthorizedAppsPageImpl implements Page<AuthorizedApp> {
@JsonProperty("pages")
private final Integer totalPages;
@JsonProperty("page")
private final Integer currentPageCount;
@JsonProperty("results")
private final Integer totalResults;
@JsonProperty("data")
private final Set<AuthorizedApp> content;
}
| [
"ankush.s@adsizzlergroup.com"
] | ankush.s@adsizzlergroup.com |
0d6542ef1441cb39e43ed5eaa0bb3b7985fe1472 | f932bc7baf8cfcdbd3764d70927d90f18fc1e32c | /common/src/main/java/org/glowroot/common/model/MutableQuery.java | 21b2b653cc97f274c7770cece316072acb153d74 | [
"Apache-2.0"
] | permissive | chakra-coder/glowroot | e459ee825e0d55dbaede9e526b558236d3357504 | 1aad8e83013c48c77814eac7b42d711cae2e8751 | refs/heads/master | 2021-06-04T04:22:43.452703 | 2016-09-08T07:10:20 | 2016-09-08T07:10:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,429 | java | /*
* Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.glowroot.common.model;
import javax.annotation.Nullable;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Doubles;
public class MutableQuery {
static final Ordering<MutableQuery> byTotalDurationDesc = new Ordering<MutableQuery>() {
@Override
public int compare(MutableQuery left, MutableQuery right) {
return Doubles.compare(right.getTotalDurationNanos(), left.getTotalDurationNanos());
}
};
private final String truncatedQueryText;
private final @Nullable String fullQueryTextSha1;
private double totalDurationNanos;
private long executionCount;
private boolean hasTotalRows;
private long totalRows;
MutableQuery(String truncatedQueryText, @Nullable String fullQueryTextSha1) {
this.truncatedQueryText = truncatedQueryText;
this.fullQueryTextSha1 = fullQueryTextSha1;
}
public String getTruncatedQueryText() {
return truncatedQueryText;
}
public @Nullable String getFullQueryTextSha1() {
return fullQueryTextSha1;
}
public double getTotalDurationNanos() {
return totalDurationNanos;
}
public long getExecutionCount() {
return executionCount;
}
public boolean hasTotalRows() {
return hasTotalRows;
}
public long getTotalRows() {
return totalRows;
}
void addToTotalDurationNanos(double totalDurationNanos) {
this.totalDurationNanos += totalDurationNanos;
}
void addToExecutionCount(long executionCount) {
this.executionCount += executionCount;
}
void addToTotalRows(boolean hasTotalRows, long totalRows) {
if (hasTotalRows) {
this.hasTotalRows = true;
this.totalRows += totalRows;
}
}
}
| [
"trask.stalnaker@gmail.com"
] | trask.stalnaker@gmail.com |
8861beb3e5271ba00995abf8a2926c6c0462ae47 | af58eabf5360cb82082e1b0590696b627118d5a3 | /app-main/src/main/java/com/zhongmei/bty/dinner/Listener/DishOptListener.java | b2c59fec953539c6ae64fe53d4a649d9278b88bd | [] | no_license | sengeiou/marketing-app | f4b670f3996ba190decd2f1b8e4a276eb53b8b2a | 278f3da95584e2ab7d97dff1a067db848e70a9f3 | refs/heads/master | 2020-06-07T01:51:25.743676 | 2019-06-20T08:58:28 | 2019-06-20T08:58:28 | 192,895,799 | 0 | 1 | null | 2019-06-20T09:59:09 | 2019-06-20T09:59:08 | null | UTF-8 | Java | false | false | 442 | java | package com.zhongmei.bty.dinner.Listener;
import com.zhongmei.bty.basemodule.orderdish.bean.DishDataItem;
import com.zhongmei.yunfu.db.enums.PrintOperationOpType;
import java.util.List;
/**
* @Date: 2018/2/8
* @Description:
* @Version: 1.0
*/
public interface DishOptListener {
void onSuccess(PrintOperationOpType type, List<DishDataItem> dataItems);
void onFail(PrintOperationOpType type, List<DishDataItem> dataItems);
}
| [
"yangyuanping_cd@shishike.com"
] | yangyuanping_cd@shishike.com |
70a05e1d92123208fd73598efccfafdec0aadf69 | 4db17f8d057b9fc19d6a3c1a357333ca173a9ae3 | /src/main/java/org/markdownwriterfx/util/ActionUtils.java | 8dd6856de0e28c22eec3eba048b4ad633959bbef | [
"BSD-2-Clause"
] | permissive | andreas-oberheim/universal-markup-editor | 46982c1dda07114e1a5b529a00cdafad1f7a2aeb | bd6bbaea26cc9d39e6310bc2270419cbb5c89b07 | refs/heads/master | 2021-01-17T15:58:03.152382 | 2016-08-20T21:39:26 | 2016-08-20T21:39:26 | 66,168,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,751 | java | /*
* Copyright (c) 2015 Karl Tauber <karl at jformdesigner dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* o 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.
*
* 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 org.markdownwriterfx.util;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Separator;
import javafx.scene.control.SeparatorMenuItem;
import javafx.scene.control.ToolBar;
import javafx.scene.control.Tooltip;
import de.jensd.fx.glyphs.fontawesome.utils.FontAwesomeIconFactory;
/**
* Action utilities
*
* @author Karl Tauber
*/
public class ActionUtils
{
public static Menu createMenu(String text, Action... actions) {
return new Menu(text, null, createMenuItems(actions));
}
public static MenuItem[] createMenuItems(Action... actions) {
MenuItem[] menuItems = new MenuItem[actions.length];
for (int i = 0; i < actions.length; i++) {
menuItems[i] = (actions[i] != null)
? createMenuItem(actions[i])
: new SeparatorMenuItem();
}
return menuItems;
}
public static MenuItem createMenuItem(Action action) {
MenuItem menuItem = new MenuItem(action.text);
if (action.accelerator != null)
menuItem.setAccelerator(action.accelerator);
if (action.icon != null)
menuItem.setGraphic(FontAwesomeIconFactory.get().createIcon(action.icon));
menuItem.setOnAction(action.action);
if (action.disable != null)
menuItem.disableProperty().bind(action.disable);
return menuItem;
}
public static ToolBar createToolBar(Action... actions) {
return new ToolBar(createToolBarButtons(actions));
}
public static Node[] createToolBarButtons(Action... actions) {
Node[] buttons = new Node[actions.length];
for (int i = 0; i < actions.length; i++) {
buttons[i] = (actions[i] != null)
? createToolBarButton(actions[i])
: new Separator();
}
return buttons;
}
public static Button createToolBarButton(Action action) {
Button button = new Button();
button.setGraphic(FontAwesomeIconFactory.get().createIcon(action.icon, "1.2em"));
String tooltip = action.text;
if (tooltip.endsWith("..."))
tooltip = tooltip.substring(0, tooltip.length() - 3);
if (action.accelerator != null)
tooltip += " (" + action.accelerator.getDisplayText() + ')';
button.setTooltip(new Tooltip(tooltip));
button.setFocusTraversable(false);
button.setOnAction(action.action);
if (action.disable != null)
button.disableProperty().bind(action.disable);
return button;
}
}
| [
"karl@jformdesigner.com"
] | karl@jformdesigner.com |
c505681795fe63168c73ca0ece06169d6e26b296 | 10bbb49b8b82e67f8aae8568321d5677500738d9 | /goja-wxchat/src/main/java/com/jfinal/weixin/sdk/msg/out/OutVideoMsg.java | 32a4c6d6c27af8260b71fa44b62125738142fbb6 | [
"MIT"
] | permissive | shootboss/goja | 178acc8f6e7b76863bda556d8fb742649b141ec6 | 1d6aef9c6cd13728f7601ee126d38276a3f1efb5 | refs/heads/master | 2021-01-22T20:08:23.456712 | 2014-11-15T15:21:34 | 2014-11-15T15:21:34 | 26,850,053 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,834 | java | /**
* Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.jfinal.weixin.sdk.msg.out;
import com.jfinal.weixin.sdk.msg.in.InMsg;
/**
回复视频消息
<xml>
<ToUserName><![CDATA[toUser]]></ToUserName>
<FromUserName><![CDATA[fromUser]]></FromUserName>
<CreateTime>12345678</CreateTime>
<MsgType><![CDATA[video]]></MsgType>
<Video>
<MediaId><![CDATA[media_id]]></MediaId>
<Title><![CDATA[title]]></Title>
<Description><![CDATA[description]]></Description>
</Video>
</xml>
*/
public class OutVideoMsg extends OutMsg {
public static final String TEMPLATE =
"<xml>\n" +
"<ToUserName><![CDATA[${__msg.toUserName}]]></ToUserName>\n" +
"<FromUserName><![CDATA[${__msg.fromUserName}]]></FromUserName>\n" +
"<CreateTime>${__msg.createTime}</CreateTime>\n" +
"<MsgType><![CDATA[${__msg.msgType}]]></MsgType>\n" +
"<Video>\n" +
"<MediaId><![CDATA[${__msg.mediaId}]]></MediaId>\n" +
"<Title><![CDATA[${(__msg.title)!}]]></Title>\n" +
"<Description><![CDATA[${(__msg.description)!}]]></Description>\n" +
"</Video>\n" +
"</xml>";
private String mediaId;
private String title; // 不是必须
private String description; // 不是必须
public OutVideoMsg() {
this.msgType = "video";
}
public OutVideoMsg(InMsg inMsg) {
super(inMsg);
this.msgType = "video";
}
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
| [
"poplar1123@gmail.com"
] | poplar1123@gmail.com |
e272ecfd6d3a06ef893c00602ed41c4d6d39fb2d | 2d5c6766fb7ebbb6fd9b3f81e015b8c56eda2733 | /nephele/nephele-server/src/main/java/eu/stratosphere/nephele/protocols/JobManagerProtocol.java | 1190b46d32667f68889d196751c994719fd35f44 | [] | no_license | bel90/nephele | e134197edeb86d5b2bfde138445f2f624f934bae | 674876a9714a6b48fd7467cadbc48f9eacfd5c84 | refs/heads/master | 2021-08-24T00:43:16.161984 | 2017-12-07T09:22:36 | 2017-12-07T09:22:36 | 112,023,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,107 | java | /***********************************************************************************************************************
*
* Copyright (C) 2010-2013 by the Stratosphere project (http://stratosphere.eu)
*
* 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 eu.stratosphere.nephele.protocols;
import java.io.IOException;
import eu.stratosphere.nephele.instance.HardwareDescription;
import eu.stratosphere.nephele.instance.InstanceConnectionInfo;
import eu.stratosphere.nephele.rpc.RPCProtocol;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointDecisionReason;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointSize;
import eu.stratosphere.nephele.taskmanager.TaskCheckpointState;
import eu.stratosphere.nephele.taskmanager.TaskExecutionState;
import eu.stratosphere.nephele.taskmanager.TaskRecordSkipped;
/**
* The job manager protocol is implemented by the job manager and offers functionality
* to task managers which allows them to register themselves, send heart beat messages
* or to report the results of a task execution.
*
* @author warneke
*/
public interface JobManagerProtocol extends RPCProtocol {
/**
* Sends a heart beat to the job manager.
*
* @param instanceConnectionInfo
* the information the job manager requires to connect to the instance's task manager
* @param hardwareDescription
* a hardware description with details on the instance's compute resources.
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void sendHeartbeat(InstanceConnectionInfo instanceConnectionInfo, HardwareDescription hardwareDescription)
throws IOException, InterruptedException;
/**
* Reports an update of a task's execution state to the job manager.
*
* @param taskExecutionState
* the new task execution state
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void updateTaskExecutionState(TaskExecutionState taskExecutionState) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint state to the job manager.
*
* @param taskCheckpointState
* the new checkpoint state of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
*/
void updateCheckpointState(TaskCheckpointState taskCheckpointState) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint decision reason to the job manager.
*
* @param taskCheckpointDecisionReason
* the new checkpoint decision reason of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void updateCheckpointDecisionReason(TaskCheckpointDecisionReason taskCheckpointDecisionReason) throws IOException, InterruptedException;
/**
* Reports an update of a task's checkpoint size to the job manager.
*
* @param taskCheckpointSize
* the new checkpoint size of the task
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void newCheckpointSize(TaskCheckpointSize taskCheckpointSize) throws IOException, InterruptedException;
/**
* Reports an update that a Record was skipped to the job manager.
*
* @param taskRecordSkipped
* the information that a record was skipped
* @throws IOException
* thrown if an error occurs during this remote procedure call
* @throws InterruptedException
* thrown if the caller is interrupted while waiting for the response of the remote procedure call
* @author bel
*/
void recordSkipped(TaskRecordSkipped taskRecordSkipped) throws IOException, InterruptedException;
}
| [
"belinda.diesslin@campus.tu-berlin.de"
] | belinda.diesslin@campus.tu-berlin.de |
3c983771f483d93ca0c8d2d20e5271eaf6a69c60 | 98622e5aab7bfd54988f0768c1d5e3b366f7e4bb | /src/org/tentackle/appworx/AppDbCursorProgressDialog.java | 32d602c887155943321cc6aa03cc80b2e8a89a4a | [] | no_license | yovannyr/tentackle | af6a7717ea50398714fc160bb329ab77418269af | ebbaa3986e32783fc78a46ed4fbfbda372993f95 | refs/heads/master | 2021-01-10T01:09:48.403574 | 2016-03-24T17:16:21 | 2016-03-24T17:16:21 | 54,660,042 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,437 | java | /**
* Tentackle - a framework for java desktop applications
* Copyright (C) 2001-2008 Harald Krake, harald@krake.de, +49 7722 9508-0
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// $Id: AppDbCursorProgressDialog.java 336 2008-05-09 14:40:20Z harald $
package org.tentackle.appworx;
import org.tentackle.plaf.PlafGlobal;
/**
* Progress dialog for {@link AppDbCursor}.
* <p>
* The modal dialog is shown if more than {@link QbfParameter#warnRowCount}
* rows are retrieved and the user answers the question to retrieve more
* with "yes". The progress dialog shows and updates the numbers of rows retrieved
* and provides an abort button.
*
* @author harald
*/
public class AppDbCursorProgressDialog extends org.tentackle.ui.FormDialog {
private AppDbCursor cursor;
/**
* Creates a progress dialog.
*
* @param cursor the database cursor
*/
public AppDbCursorProgressDialog(AppDbCursor cursor) {
this.cursor = cursor;
initComponents();
}
/**
* Shows the modal dialog.
*/
public void showDialog() {
pack();
setVisible(true);
}
/**
* Updates and displays the row count.
*
* @param rowCount
*/
public void updateRowCount(int rowCount) {
rowCountField.setIntValue(rowCount);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
infoPanel = new org.tentackle.ui.FormPanel();
jLabel1 = new javax.swing.JLabel();
rowCountField = new org.tentackle.ui.IntegerFormField();
buttonPanel = new org.tentackle.ui.FormPanel();
abortButton = new org.tentackle.ui.FormButton();
setAutoPosition(true);
setTitle(Locales.bundle.getString("Loading_objects...")); // NOI18N
setModal(true);
infoPanel.setLayout(new java.awt.GridBagLayout());
jLabel1.setText(Locales.bundle.getString("objects_read_so_far:")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
infoPanel.add(jLabel1, gridBagConstraints);
rowCountField.setColumns(10);
rowCountField.setChangeable(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.insets = new java.awt.Insets(5, 0, 5, 5);
infoPanel.add(rowCountField, gridBagConstraints);
getContentPane().add(infoPanel, java.awt.BorderLayout.CENTER);
abortButton.setIcon(PlafGlobal.getIcon("working"));
abortButton.setText(Locales.bundle.getString("abort")); // NOI18N
abortButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
abortButtonActionPerformed(evt);
}
});
buttonPanel.add(abortButton);
getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
pack();
}// </editor-fold>//GEN-END:initComponents
private void abortButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_abortButtonActionPerformed
cursor.setAbortRequested(true);
}//GEN-LAST:event_abortButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private org.tentackle.ui.FormButton abortButton;
private org.tentackle.ui.FormPanel buttonPanel;
private org.tentackle.ui.FormPanel infoPanel;
private javax.swing.JLabel jLabel1;
private org.tentackle.ui.IntegerFormField rowCountField;
// End of variables declaration//GEN-END:variables
}
| [
"yovannyr@outlook.com"
] | yovannyr@outlook.com |
d6ee9271aca96faa450e13ec45edfe74c65db8f2 | 280da3630f692c94472f2c42abd1051fb73d1344 | /src/net/minecraft/item/ItemWritableBook.java | 9a13b9c10c9e58a4f5e870332762d3f3f96fbfa1 | [] | no_license | MicrowaveClient/Clarinet | 7c35206c671eb28bc139ee52e503f405a14ccb5b | bd387bc30329e0febb6c1c1b06a836d9013093b5 | refs/heads/master | 2020-04-02T18:47:52.047731 | 2016-07-14T03:21:46 | 2016-07-14T03:21:46 | 63,297,767 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,522 | java | package net.minecraft.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.stats.StatList;
import net.minecraft.world.World;
public class ItemWritableBook extends Item {
public ItemWritableBook() {
this.setMaxStackSize(1);
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn) {
playerIn.displayGUIBook(itemStackIn);
playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
return itemStackIn;
}
/**
* this method returns true if the book's NBT Tag List "pages" is valid
*/
public static boolean isNBTValid(NBTTagCompound nbt) {
if (nbt == null) {
return false;
} else if (!nbt.hasKey("pages", 9)) {
return false;
} else {
NBTTagList var1 = nbt.getTagList("pages", 8);
for (int var2 = 0; var2 < var1.tagCount(); ++var2) {
String var3 = var1.getStringTagAt(var2);
if (var3 == null) {
return false;
}
if (var3.length() > 32767) {
return false;
}
}
return true;
}
}
}
| [
"justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704"
] | justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704 |
e37e42d5a2b59bfb63390e90d0ae97361419827e | 1110b124a8d697e1411f5974666e5d3ac5afcc0a | /src/java/cd4017be/indlog/item/ItemFluidFilter.java | 0c977a7435068a0b4afbf821ad0b0a032226118f | [
"MIT"
] | permissive | coldino/InductiveLogistics | f77c69d6b33fd39a2e310565dac82582cb374235 | d237896283fb11b71e5a0b0b062149bb5edca812 | refs/heads/master | 2020-07-29T23:15:57.914435 | 2017-12-21T16:59:22 | 2017-12-21T16:59:22 | 209,997,815 | 0 | 0 | MIT | 2019-09-21T14:19:08 | 2019-09-21T14:19:08 | null | UTF-8 | Java | false | false | 5,681 | java | package cd4017be.indlog.item;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.io.IOException;
import java.util.List;
import cd4017be.indlog.render.gui.GuiFluidFilter;
import cd4017be.indlog.util.PipeFilterFluid;
import cd4017be.lib.BlockGuiHandler;
import cd4017be.lib.BlockGuiHandler.ClientItemPacketReceiver;
import cd4017be.lib.util.TooltipUtil;
import cd4017be.lib.Gui.DataContainer;
import cd4017be.lib.Gui.IGuiItem;
import cd4017be.lib.Gui.ITankContainer;
import cd4017be.lib.Gui.ItemGuiData;
import cd4017be.lib.Gui.TileContainer;
import cd4017be.lib.Gui.TileContainer.TankSlot;
import cd4017be.lib.item.BaseItem;
import cd4017be.lib.util.ItemFluidUtil;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
*
* @author CD4017BE
*/
public class ItemFluidFilter extends BaseItem implements IGuiItem, ClientItemPacketReceiver {
public ItemFluidFilter(String id) {
super(id);
}
@Override
public void addInformation(ItemStack item, EntityPlayer player, List<String> list, boolean b) {
if (item.hasTagCompound()) {
String[] states = TooltipUtil.translate("gui.cd4017be.filter.state").split(",");
PipeFilterFluid filter = PipeFilterFluid.load(item.getTagCompound());
String s;
if (states.length >= 8) {
s = states[(filter.mode & 1) == 0 ? 0 : 1];
if ((filter.mode & 2) != 0) s += states[5];
if ((filter.mode & 4) != 0) s += states[(filter.mode & 8) != 0 ? 7 : 6];
} else s = "<invalid lang entry!>";
list.add(s);
for (Fluid stack : filter.list) list.add("> " + stack.getLocalizedName(new FluidStack(stack, 0)));
if (filter.maxAmount != 0) list.add(TooltipUtil.format("gui.cd4017be.filter.stock", TooltipUtil.formatNumber((double)filter.maxAmount / 1000D, 3)));
if (filter.priority != 0) list.add(TooltipUtil.format("gui.cd4017be.priority", filter.priority));
}
super.addInformation(item, player, list, b);
}
public Fluid[] getFluids(NBTTagCompound nbt) {
if (nbt == null || !nbt.hasKey(ItemFluidUtil.Tag_FluidList, 9)) return null;
NBTTagList list = nbt.getTagList(ItemFluidUtil.Tag_FluidList, 8);
Fluid[] fluids = new Fluid[list.tagCount()];
for (int i = 0; i < fluids.length; i++)
fluids[i] = FluidRegistry.getFluid(list.getStringTagAt(i));
return fluids;
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
ItemStack item = player.getHeldItem(hand);
BlockGuiHandler.openItemGui(player, hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item);
}
@Override
public Container getContainer(ItemStack item, EntityPlayer player, World world, BlockPos pos, int slot) {
return new TileContainer(new GuiData(), player);
}
@SideOnly(Side.CLIENT)
@Override
public GuiContainer getGui(ItemStack item, EntityPlayer player, World world, BlockPos pos, int slot) {
return new GuiFluidFilter(new TileContainer(new GuiData(), player));
}
@Override
public void onPacketFromClient(PacketBuffer dis, EntityPlayer player, ItemStack item, int slot) throws IOException {
NBTTagCompound nbt;
if (item.hasTagCompound()) nbt = item.getTagCompound();
else item.setTagCompound(nbt = new NBTTagCompound());
byte cmd = dis.readByte();
switch(cmd) {
case 5: nbt.setByte("mode", dis.readByte()); return;
case 6: nbt.setInteger("maxAm", dis.readInt()); return;
case 7: nbt.setByte("prior", dis.readByte()); return;
default: if (cmd < 0 || cmd >= 5) return;
String name = dis.readString(32);
NBTTagList list;
if (nbt.hasKey(ItemFluidUtil.Tag_FluidList, 9)) list = nbt.getTagList(ItemFluidUtil.Tag_FluidList, 8);
else nbt.setTag(ItemFluidUtil.Tag_FluidList, list = new NBTTagList());
if (!name.isEmpty()) {
if (cmd < list.tagCount()) list.set(cmd, new NBTTagString(name));
else list.appendTag(new NBTTagString(name));
} else if (cmd < list.tagCount()) list.removeTag(cmd);
}
}
class GuiData extends ItemGuiData implements ITankContainer {
private InventoryPlayer player;
public GuiData() {super(ItemFluidFilter.this);}
@Override
public void initContainer(DataContainer container) {
TileContainer cont = (TileContainer)container;
for (int i = 0; i < getTanks(); i++)
cont.addTankSlot(new TankSlot(this, i, 26 + 18 * i, 16, (byte)0x11));
cont.addPlayerInventory(8, 50, false, true);
player = cont.player.inventory;
}
@Override
public int getTanks() {return 5;}
@Override
public FluidStack getTank(int i) {
ItemStack item = player.mainInventory.get(player.currentItem);
Fluid[] fluids = item != null ? getFluids(item.getTagCompound()) : null;
return fluids != null && i < fluids.length ? new FluidStack(fluids[i], 0) : null;
}
@Override
public int getCapacity(int i) {return 0;}
@Override
public void setTank(int i, FluidStack fluid) {}
}
}
| [
"cd4017be@gmail.com"
] | cd4017be@gmail.com |
773b4bcba47a69e6fbb7e6daffb9d37e21d9ad44 | 96aa018a27ac4c3076caf9b18532be958062cf1a | /OnlineTest/src/baidu/Permutations.java | 8f50030865ab53bbc4d76aaa7fcff2c37be9502e | [] | no_license | gongmi/workSpace | 46a9b6440fe8e0ebcf1cc0b7caea2573668a8579 | 0a3b729d937bce06fd081f69e92413917eedb942 | refs/heads/master | 2020-12-24T20:09:47.676222 | 2017-09-09T06:29:12 | 2017-09-09T06:29:12 | 86,234,013 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 470 | java | package baidu;
import java.util.*;
public class Permutations {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k = in.nextInt();
int[][] dp = new int[n + 1][k + 1];
for (int i = 0; i <= n; i++)
dp[i][0] = 1;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= k; j++)
dp[i][j] = dp[i - 1][j] * (j + 1) + dp[i - 1][j - 1] * (i - j);
System.out.println(dp[n][k]);
}
}
| [
"450989123@qq.com"
] | 450989123@qq.com |
aafb282718732d148a73cb21a583316844203d2f | ed20c341c40aae5aa6aa5995489681b56b1b7246 | /colplus-dao/src/test/java/org/col/db/mapper/TaxonMapperTreeTest.java | e45b267a9ad7669481e8977e456951373542365d | [
"Apache-2.0"
] | permissive | ManonGros/colplus-backend | bf9a9f6e1c4683d7bf6a97e445f0aa19d907745a | 62723b45de211c3db98055294a87b90284e850bd | refs/heads/master | 2020-09-01T16:20:41.020309 | 2019-11-01T10:41:42 | 2019-11-01T10:41:42 | 218,999,298 | 0 | 0 | Apache-2.0 | 2019-11-01T14:18:31 | 2019-11-01T14:18:31 | null | UTF-8 | Java | false | false | 1,722 | java | package org.col.db.mapper;
import java.util.List;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import org.col.api.model.DSID;
import org.col.api.model.DSIDValue;
import org.col.api.model.Taxon;
import org.col.api.model.TaxonCountMap;
import org.junit.Test;
import static org.col.api.TestEntityGenerator.DATASET11;
import static org.col.api.TestEntityGenerator.NAME4;
import static org.junit.Assert.*;
public class TaxonMapperTreeTest extends MapperTestBase<TaxonMapper> {
NameUsageMapperTreeTest.CountHandler<Taxon> countHandler;
public TaxonMapperTreeTest() {
super(TaxonMapper.class, TestDataRule.tree());
}
@Test
public void classificationCounts() throws Exception {
DSIDValue<String> key = DSID.key(DATASET11.getKey(), "t20");
List<TaxonCountMap> x = mapper().classificationCounts(key);
assertEquals(6, x.size());
for (TaxonCountMap c : x) {
assertNotNull(c.getId());
assertNotNull(c.getCount());
assertTrue(c.getCount().isEmpty());
}
mapper().updateDatasetSectorCount(key.id("t2"), null);
mapper().updateDatasetSectorCount(key.id("t2"), new Int2IntOpenHashMap());
Int2IntOpenHashMap cnt = new Int2IntOpenHashMap();
cnt.put(45, 6);
cnt.put(4, 666);
cnt.put(13, 169);
mapper().updateDatasetSectorCount(key.id("t3"), cnt);
x = mapper().classificationCounts(key.id("t20"));
assertEquals(6, x.size());
for (TaxonCountMap c : x) {
assertNotNull(c.getId());
assertNotNull(c.getCount());
}
}
@Test
public void classificationSimple() throws Exception {
List<?> cl = mapper().classificationSimple(DSID.key(NAME4.getDatasetKey(), "t15"));
assertEquals(7, cl.size());
}
}
| [
"m.doering@mac.com"
] | m.doering@mac.com |
1b399f8ddff8e3f484142f5f940996929aded282 | d23dfd7e9b84df5ac252537df1d2d6c8fded1e3b | /PMClient/lib_pm/src/main/java/com/wisn/pmlib/utils/FileUtilsOld.java | 112c7046af8a8234e0ff90606c6e1d963b394ceb | [] | no_license | wisn-mirror/AMClient | 3838b866978bc4f5cfb883ee166544b8e7e09ea7 | 0614bf0d2af1aab1308a31f6041ff7ff61b28c71 | refs/heads/master | 2021-01-12T12:42:11.003621 | 2017-12-29T13:43:38 | 2017-12-29T13:43:38 | 69,642,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,098 | java | package com.wisn.pmlib.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* <b>Create Date:</b> 2016/9/21<br>
* <b>Author:</b> Wisn(吴贻顺)<br>
* <b>Description:</b>
* <p>
* <br>
*/
public class FileUtilsOld {
public static int copy(String fromFile, String toFile) {
//要复制的文件目录
File[] currentFiles;
File root = new File(fromFile);
//如同判断SD卡是否存在或者文件是否存在
//如果不存在则 return出去
if (!root.exists()) {
return -1;
}
//如果存在则获取当前目录下的全部文件 填充数组
currentFiles = root.listFiles();
//目标目录
File targetDir = new File(toFile);
//创建目录
if (!targetDir.exists()) {
targetDir.mkdirs();
}
//遍历要复制该目录下的全部文件
for (int i = 0; i < currentFiles.length; i++) {
if (currentFiles[i].isDirectory())//如果当前项为子目录 进行递归
{
copy(currentFiles[i].getPath() + "/", toFile + currentFiles[i].getName() + "/");
} else//如果当前项为文件则进行文件拷贝
{
CopySdcardFile(currentFiles[i].getPath(), toFile + currentFiles[i].getName());
}
}
return 0;
}
/**
* 文件拷贝
* @param fromFile
* @param toFile
* @return
*/
public static int CopySdcardFile(String fromFile, String toFile) {
try {
InputStream fosfrom = new FileInputStream(fromFile);
OutputStream fosto = new FileOutputStream(toFile);
byte bt[] = new byte[1024];
int c;
while ((c = fosfrom.read(bt)) > 0) {
fosto.write(bt, 0, c);
}
fosfrom.close();
fosto.close();
return 0;
} catch (Exception ex) {
return -1;
}
}
}
| [
"wuyishun_kmk@outlook.com"
] | wuyishun_kmk@outlook.com |
57da37bb0262a083fec6b390a9a24dbeadf5352b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_4cd8a69f6192f2d8f84b9f96771db798e04f1b40/StudyController/3_4cd8a69f6192f2d8f84b9f96771db798e04f1b40_StudyController_s.java | 4198e115e2428cfd8a5210be1062ffb738631b22 | [] | 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,907 | java | package usask.hci.fastdraw;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
public class StudyController {
private final String[][][] mTrials;
private final StudyLogger mLog;
private int mTrialNum;
private int mTrialIndex;
private int mBlockNum;
private int mSetIndex;
private Set<String> mToSelect;
private Integer[] mTrialOrder;
private long mTrialStart;
private int mNumErrors;
private StringBuilder mErrors;
private int[] mBlocksPerSet;
private int mTimesPainted;
private boolean mFinished;
private long mUITime;
private boolean mWaiting;
private int mNumWaitDots;
public boolean shouldPause;
public StudyController(StudyLogger logger) {
mLog = logger;
mTrials = new String[][][] {
{{"Paintbrush"}, {"Line"}, {"Circle"}, {"Rectangle"},
{"Black"}, {"Red"}, {"Green"}, {"Blue"},
{"White"}, {"Yellow"}, {"Cyan"}, {"Magenta"},
{"Fine"}, {"Thin"}, {"Normal"}, {"Wide"}},
{{"Normal", "Circle"},
{"Blue", "Rectangle"},
{"Fine", "White"},
{"Wide", "Line"},
{"Cyan", "Paintbrush"},
{"Fine", "Green"},
{"Yellow", "Paintbrush"},
{"Magenta", "Circle"},
{"Normal", "Red"},
{"Thin", "Black"}},
{{"Normal", "Red", "Line"},
{"Thin", "Yellow", "Rectangle"},
{"Fine", "White", "Circle"},
{"Wide", "Magenta", "Line"},
{"Normal", "Cyan", "Paintbrush"},
{"Fine", "Green", "Rectangle"},
{"Wide", "White", "Paintbrush"},
{"Normal", "Blue", "Circle"},
{"Wide", "Yellow", "Line"},
{"Thin", "Black", "Paintbrush"}}
};
mBlocksPerSet = new int[] { 5, 5, 5 };
mSetIndex = 0;
mBlockNum = 0;
mFinished = false;
shouldPause = false;
mWaiting = false;
mNumWaitDots = 0;
nextBlock();
}
public void waitStep() {
if (!mWaiting) {
mWaiting = true;
} else if (mNumWaitDots == 3) {
mWaiting = false;
mNumWaitDots = 0;
mTrialStart = System.nanoTime();
} else {
mNumWaitDots++;
}
}
public boolean isFinished() {
return mFinished;
}
public long getTrialStart() {
return mTrialStart;
}
public int getNumSets() {
return mTrials.length;
}
public int getNumBlocks(int set) {
return mBlocksPerSet[set - 1];
}
public void setSetNum(int set) {
mSetIndex = set - 2;
nextSet();
}
public void setBlockNum(int block) {
mBlockNum = block - 1;
nextBlock();
}
public void incrementTimesPainted() {
mTimesPainted++;
}
// Return whether the selection was one of the current targets.
public boolean handleSelected(String selection, boolean gesture) {
if (mFinished)
return false;
if (mToSelect.contains(selection)) {
mToSelect.remove(selection);
if (mToSelect.isEmpty()) {
long now = System.nanoTime();
int numTargets = mTrials[mSetIndex][mTrialIndex].length;
StringBuilder targetString = new StringBuilder();
for (int i = 0; i < numTargets; i++) {
if (i != 0)
targetString.append(",");
targetString.append(mTrials[mSetIndex][mTrialIndex][i]);
}
if (gesture) {
mLog.gestureTrial(now, mSetIndex + 1, mBlockNum, mTrialNum, mTrials[mSetIndex][mTrialIndex].length,
targetString.toString(), mNumErrors, mErrors.toString(),
mTimesPainted, mUITime, now - mTrialStart);
} else {
mLog.chordTrial(now, mSetIndex + 1, mBlockNum, mTrialNum, mTrials[mSetIndex][mTrialIndex].length,
targetString.toString(), mNumErrors, mErrors.toString(),
mTimesPainted, mUITime, now - mTrialStart);
}
nextTrial();
}
return true;
} else {
if (mNumErrors != 0)
mErrors.append(",");
mErrors.append(selection);
mNumErrors++;
return false;
}
}
public void addUITime(long duration) {
mUITime += duration;
}
public String getPrompt() {
return getPrompt(false);
}
public String getPrompt(boolean hideTarget) {
if (mFinished)
return "You are finished!";
String progress = "#" + mBlockNum + " (" + mTrialNum + "/" + mTrials[mSetIndex].length + ")";
if (mWaiting) {
StringBuilder dots = new StringBuilder("");
for (int i = 0; i < mNumWaitDots; i++)
dots.append(".");
return progress + " Please select: " + dots;
}
StringBuilder title = new StringBuilder(progress + " Please select: ");
if (hideTarget)
return title.toString();
for (String toSelect : mToSelect) {
title.append(toSelect);
title.append(", ");
}
return title.substring(0, title.length() - 2);
}
private void nextSet() {
if (mSetIndex == mTrials.length - 1) {
mFinished = true;
return;
}
mSetIndex++;
mBlockNum = 0;
nextBlock();
}
private void nextBlock() {
if (mBlockNum >= mBlocksPerSet[mSetIndex]) {
nextSet();
return;
}
mTrialOrder = new Integer[mTrials[mSetIndex].length];
for (int i = 0; i < mTrialOrder.length; i++)
mTrialOrder[i] = i;
Collections.shuffle(Arrays.asList(mTrialOrder));
mBlockNum++;
mTrialNum = 0;
nextTrial();
shouldPause = true;
}
private void nextTrial() {
if (mTrialNum >= mTrials[mSetIndex].length) {
nextBlock();
return;
}
mTrialStart = System.nanoTime();
mUITime = 0;
mNumErrors = 0;
mTimesPainted = 0;
mErrors = new StringBuilder();
mTrialIndex = mTrialOrder[mTrialNum];
mTrialNum++;
mToSelect = new LinkedHashSet<String>(Arrays.asList(mTrials[mSetIndex][mTrialIndex]));
}
public boolean isOnLastTarget() {
return mToSelect.size() == 1;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
2cb38a47fe75f78efaa57f1d832c0956039511f4 | be59c0ca127a4f7041758b2709e1327bc71b6e12 | /qipai/game-mj-dehmj/src/main/java/com/sy599/game/qipai/dehmj/constant/DehMjAction.java | fb4aed5eb054dca0f7e56161ae286f3d020de819 | [] | no_license | Yiwei-TEST/xxqp-server | 2389dd6b12614b0a9557d59b473f88a3a59620cf | c2c683ce8060c0cbaee86c3ee550e0195e1bb7e4 | refs/heads/main | 2023-08-14T08:49:37.586893 | 2021-09-15T03:21:13 | 2021-09-15T03:21:13 | 401,583,086 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,992 | java | package com.sy599.game.qipai.dehmj.constant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class DehMjAction {
public static final int ACTION_SIZE = 18;
/*** 胡*/
public static final int HU = 0;
/*** 碰*/
public static final int PENG =1;
/*** 明杠*/
public static final int MINGGANG = 2;
/*** 暗杠*/
public static final int ANGANG = 3;
/*** 吃*/
public static final int CHI = 4;
/*** 补张*/
public static final int BUZHANG = 5;
/*** 缺一色*/
public static final int QUEYISE = 6;
/*** 暗杠补张*/
public static final int BUZHANG_AN = 16;
/**报听*/
public static final int BaoTING =10;
/*** 自摸*/
public static final int ZIMO = 0;
/*** 大胡自摸*/
public static final int ACTION_COUNT_DAHU_ZIMO = 0 ;
/*** 小胡自摸*/
public static final int ACTION_COUNT_XIAOHU_ZIMO = 1;
/*** 大胡点炮*/
public static final int ACTION_COUNT_DAHU_DIANPAO = 2;
/*** 小胡点炮*/
public static final int ACTION_COUNT_XIAOHU_DIANPAO = 3;
/*** 大胡接炮*/
public static final int ACTION_COUNT_DAHU_JIEPAO = 4;
/*** 小胡接炮*/
public static final int ACTION_COUNT_XIAOHU_JIEPAO = 5;
/** 小胡展示的优先级*/
public static final List<Integer> xiaoHuPriority = Arrays.asList(QUEYISE);
private int [] arr;
public DehMjAction(){
this.arr = new int[ACTION_SIZE];
}
public int[] getArr(){
return arr;
}
public void addHu() {
setVal(HU);
}
public void addPeng() {
setVal(PENG);
}
public void addMingGang() {
setVal(MINGGANG);
}
public void addAnGang() {
setVal(ANGANG);
}
public void addChi() {
setVal(CHI);
}
public void addBuZhang() {
setVal(BUZHANG);
}
public void addQueYiSe() {
setVal(QUEYISE);
}
public void addBuZhangAn(){
setVal(BUZHANG_AN);
}
public void addZiMo(){
setVal(ZIMO);
}
public void addBaoting() {
setVal(BaoTING);
}
public void setVal(int action){
arr[action] = 1 ;
}
/**
* 从可操作列表中提出第一个小胡
* @param actList
* @return
*/
public static int getFirstXiaoHu(List<Integer> actList){
for(int index : xiaoHuPriority){
if(actList.get(index) == 1){
return index;
}
}
return -1;
}
/**
* 是否有胡操作
*
* @param actionList
* @return
*/
public static boolean hasHu(List<Integer> actionList) {
return hasAction(actionList, DehMjAction.HU) || hasAction(actionList,ZIMO);
}
/**
* 是否有操作
*
* @param actionList
* @param action 操作
* @return
*/
private static boolean hasAction(List<Integer> actionList, int action) {
if (actionList != null && actionList.size() > action) {
return actionList.get(action) == 1;
}
return false;
}
/**
* 只保留胡操作
*
* @param actionList
* @return
*/
public static List<Integer> keepHu(List<Integer> actionList) {
if (actionList == null || actionList.size() < HU + 1) {
return Collections.EMPTY_LIST;
}
List<Integer> res = new ArrayList<>();
for (int i = 0; i < actionList.size(); i++) {
if (i == HU) {
res.add(actionList.get(i));
} else {
res.add(0);
}
}
return res;
}
/* *//**
* 是否是起手小胡
* @param xiaoHu
* @return
*//*
public static boolean isQiShouXiaoHu(int xiaoHu){
if(xiaoHu == ZHONGTUSIXI || xiaoHu == ZHONGTULIULIUSHUN){
return false;
}
return true;
}*/
}
| [
"ee68i5@yeah.net"
] | ee68i5@yeah.net |
16d377059bd953082a814d6ca279496d9d30efa7 | 9ec018af2fe0c3260ff9e75dea58dad1e93cd2d2 | /sandbox/release-tools/src/main/java/org/apache/openejb/tools/release/cmd/Binaries.java | 993228719c23f140c470a3110e6a45c3c4cf55ae | [
"Apache-2.0"
] | permissive | apache/openejb | 932c5a64c47ab4c7ff474855178db67f3d6fc37a | f10c077ade927d73bdbd9ed4cc28b79f58a1cd66 | refs/heads/trunk | 2023-08-15T17:45:22.852380 | 2013-01-13T22:33:08 | 2013-01-13T22:33:08 | 688,367 | 12 | 15 | null | null | null | null | UTF-8 | Java | false | false | 3,261 | 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.openejb.tools.release.cmd;
import org.apache.openejb.tools.release.Command;
import org.apache.openejb.tools.release.Release;
import org.apache.openejb.tools.release.util.Files;
import org.apache.openejb.tools.release.util.IO;
import org.apache.creadur.tentacles.NexusClient;
import org.apache.xbean.finder.UriSet;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.net.URI;
import java.text.SimpleDateFormat;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
/**
* Little utility that downloads the binaries into
*/
@Command(dependsOn = Close.class)
public class Binaries {
public static void main(String[] args) throws Exception {
final NexusClient client = new NexusClient();
final File dir = Files.file(Release.builddir, "staging-" + Release.build, Release.openejbVersionName);
final URI repo = URI.create(Release.staging);
System.out.println("Downloads: " + dir.getAbsolutePath());
if (!dir.exists() && !dir.mkdirs()) throw new IllegalStateException("Cannot make directory: " + dir.getAbsolutePath());
final UriSet all = new UriSet(client.crawl(repo));
UriSet binaries = all.include(".*\\.(zip|gz|war).*");
binaries = binaries.exclude(".*\\.asc\\.(sha1|md5)");
for (URI uri : binaries.include(".*\\/(tomee|openejb-|apache-tomee|examples)-.*|.*source-release.*")) {
final File file = new File(dir, uri.getPath().replaceAll(".*/", ""));
System.out.println("Downloading " + file.getName());
client.download(uri, file);
if (file.getName().endsWith(".zip")) {
final PrintStream out = new PrintStream(IO.write(new File(file.getAbsolutePath() + ".txt")));
list(file, out);
out.close();
}
}
}
private static void list(File file, PrintStream out) throws IOException {
final SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
final ZipFile zip = new ZipFile(file);
final Enumeration<? extends ZipEntry> enumeration = zip.entries();
while (enumeration.hasMoreElements()) {
ZipEntry entry = enumeration.nextElement();
out.printf("%1$7s %2$2s %3$2s", entry.getSize(), format.format(entry.getTime()), entry.getName() );
out.println();
}
}
}
| [
"dblevins@apache.org"
] | dblevins@apache.org |
663eb903e7868d23258393e08deb6760a2f806fd | 9ccb9d678487a7b5fa140f69c8dc08b010ee5185 | /src/main/java/com/fanyank/pojo/User.java | 75d7130927d82dbd962bfdc6baf8680026102a31 | [] | no_license | Fish-Fan/MyBatisDemo | 6131f8b074d85b33f7513286b81234b7dffda235 | ed8ab63a274dbb1a2132f957df2e6b6e44bdb37f | refs/heads/master | 2021-01-19T21:40:53.478090 | 2017-04-19T09:07:29 | 2017-04-19T09:07:29 | 88,687,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 865 | java | package com.fanyank.pojo;
import java.io.InputStream;
/**
* Created by yanfeng-mac on 2017/4/18.
*/
public class User {
private Integer id;
private String username;
private String password;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "user{" +
"id=" + id +
", username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}
| [
"fanyank@126.com"
] | fanyank@126.com |
27e1df88f614f224edce72344e49a6c3a61cccc9 | a5902db24e25cab51b48a611f558d09ee5b09a0d | /src/test/java/cn/acyou/ibloges/practice/Elasticsearch4Student.java | f1750f7dfd6635f9d8eb6e6cb571d47ac5fc2cc9 | [] | no_license | f981545521/iblog-es | 49e304faa4c562c57d9ad06664cc34a46fff617b | 39fb80434ed60923840aac30648d0f9a1a85295a | refs/heads/master | 2020-03-28T19:27:23.356372 | 2018-12-13T06:25:02 | 2018-12-13T06:25:02 | 148,978,032 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,803 | java | package cn.acyou.ibloges.practice;
import com.alibaba.fastjson.JSONObject;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.transport.client.PreBuiltTransportClient;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* @author youfang
* @version [1.0.0, 2018-09-18 下午 06:02]
**/
public class Elasticsearch4Student {
private Logger logger = LoggerFactory.getLogger(Elasticsearch4Student.class);
public final static String HOST = "127.0.0.1";
public final static int PORT = 9300;//http请求的端口是9200,客户端是9300
private TransportClient client = null;
@SuppressWarnings("resource")
@Before
public void beforeProduce() throws UnknownHostException {
//创建客户端
Settings settings = Settings.builder().put("cluster.name", "iblog-es").build();
client = new PreBuiltTransportClient(settings).addTransportAddresses(
new InetSocketTransportAddress(InetAddress.getByName(HOST),PORT));
logger.debug("Elasticsearch connect info:" + client.toString());
}
@After
public void afterProduce(){
client.close();
}
@Test
public void prepareTest(){
System.out.println("SUCCESS");
}
/**
* 3、Elasticsearch索引库的创建
* 创建索引库
* 需求:创建一个索引库为:student,类型为:tweet,id为1
* 索引库的名称必须为小写
*/
@Test
public void addIndex1() throws IOException {
IndexResponse response = client.prepareIndex("student", "logs", "1").setSource(XContentFactory.jsonBuilder()
.startObject()//生成文档
.field("id", "1")
.field("name", "刘邦")
.field("age", "11")
.field("birth", new Date())
.field("update_time", new Date())
.endObject()).get();
logger.info("索引名称:" + response.getIndex() + "类型:" + response.getType()
+ "文档ID:" + response.getId() + "当前实例状态:" + response.status());
}
/**
* 删除索引
*/
@Test
public void deleteIndex() {
DeleteIndexResponse response = client.admin().indices()
.prepareDelete("student")
.get();
System.out.println("SUCCESS");
}
/**
* 4、向索引库中添加json字符串
*/
@Test
public void addIndex2() {
String jsonStr = "{" +
"\"userName\":\"张三\"," +
"\"sendDate\":\"2017-11-30\"," +
"\"msg\":\"你好李四\"" +
"}";
IndexResponse response = client.prepareIndex("weixin", "tweet").setSource(jsonStr, XContentType.JSON).get();
logger.info("json索引名称:" + response.getIndex() + "json类型:" + response.getType()
+ "json文档ID:" + response.getId() + "当前实例json状态:" + response.status());
}
/**
* 5、向索引库添加一个Map集合
*/
@Test
public void addIndex3() {
Map<String, Object> map = new HashMap<String,Object>();
map.put("userName", "张三");
map.put("sendDate", new Date());
map.put("msg", "你好李四");
IndexResponse response = client.prepareIndex("momo", "tweet").setSource(map).get();
logger.info("map索引名称:" + response.getIndex() + " map类型:" + response.getType()
+ " map文档ID:" + response.getId() + "当前实例map状态:" + response.status());
}
/**
* 6、向索引库添加JsonObject
* 传递json对象
*/
@Test
public void addIndex4() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userName", "张三");
jsonObject.put("sendDate", "2017-11-23");
jsonObject.put("msg","你好李四");
IndexResponse response = client.prepareIndex("qq", "tweet").setSource(jsonObject, XContentType.JSON).get();
logger.info("jsonObject索引名称:" + response.getIndex() + " jsonObject类型:" + response.getType()
+ " jsonObject文档ID:" + response.getId() + "当前实例jsonObject状态:" + response.status());
}
/**
* 7、从索引库获取数据
*/
@Test
public void getData1() {
GetResponse getResponse = client.prepareGet("student", "tweet", "1").get();
logger.info("索引库的数据:" + getResponse.getSourceAsString());
}
/**
* 8、更新索引库数据
*/
@Test
public void updateData() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("userName", "王五");
jsonObject.put("sendDate", "2008-08-08");
jsonObject.put("msg","你好,张三,好久不见");
UpdateResponse updateResponse = client.prepareUpdate("msg", "tweet", "1")
.setDoc(jsonObject.toString(),XContentType.JSON).get();
logger.info("updateResponse索引名称:" + updateResponse.getIndex() + " updateResponse类型:" + updateResponse.getType()
+ " updateResponse文档ID:" + updateResponse.getId() + "当前实例updateResponse状态:" + updateResponse.status());
}
/**
* 9、删除索引库的数据
* 根据索引名称,类别,文档ID 删除索引库的数据
*/
@Test
public void deleteData() {
DeleteResponse deleteResponse = client.prepareDelete("student", "tweet", "1").get();
logger.info("deleteResponse索引名称:" + deleteResponse.getIndex() + " deleteResponse类型:" + deleteResponse.getType()
+ " deleteResponse文档ID:" + deleteResponse.getId() + "当前实例deleteResponse状态:" + deleteResponse.status());
}
// 创建索引
@Test
public void createIndex() {
String indexName = "student";
client.admin().indices().create(new CreateIndexRequest(indexName))
.actionGet();
}
}
| [
"981545521@qq.com"
] | 981545521@qq.com |
2485f4602475c599bf12be8c672dc8b1792edf71 | 9f127cd00455d665f6cea0897cbf4c8f5db6e8c3 | /DaWae/chapter3/section1/Exercise39_ActualTimings.java | 75b33e2b41151ffd0ad576530311f034f7c4c6e9 | [
"MIT"
] | permissive | NoticeMeDan/algo-exercises | 9d1a218270dd47872bcc48d2ed1847a62b0a30eb | c97c4a61b19c1e75dae5f6c815bf12bbd22e1e7d | refs/heads/master | 2021-09-13T11:47:51.979263 | 2018-04-29T10:36:25 | 2018-04-29T10:36:25 | 119,688,592 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,914 | java | package chapter3.section1;
import edu.princeton.cs.algs4.Stopwatch;
import util.Constants;
import util.FileUtil;
import util.VisualAccumulator;
/**
* Created by Rene Argento on 12/06/17.
*/
public class Exercise39_ActualTimings {
private static final String TALE_FILE_PATH = Constants.FILES_PATH + "tale_of_two_cities.txt";
public static void main(String[] args) {
String[] wordsInTale = FileUtil.getAllStringsFromFile(TALE_FILE_PATH);
int minLength = 8; //Same as the book analysis
Exercise39_ActualTimings actualTimings = new Exercise39_ActualTimings();
String title;
//Sequential search symbol table
// SequentialSearchSymbolTable<String, Integer> sequentialSearchSymbolTable = new SequentialSearchSymbolTable<>();
// title = "SequentialSearchST running time calling get() or put() in FrequencyCounter";
// actualTimings.frequencyCounter(sequentialSearchSymbolTable, wordsInTale, minLength, title);
//Binary search symbol table
BinarySearchSymbolTable<String, Integer> binarySearchSymbolTable = new BinarySearchSymbolTable<>();
title = "BinarySearchST running time calling get() or put() in FrequencyCounter";
actualTimings.frequencyCounter(binarySearchSymbolTable, wordsInTale, minLength, title);
}
private String frequencyCounter(SymbolTable<String, Integer> symbolTable, String[] words, int minLength, String title) {
String xAxisLabel = "calls to get() or put()";
String yAxisLabel = "running time";
double maxNumberOfOperations = 45000;
double maxRunningTime = 3000;
int originValue = 0;
VisualAccumulator visualAccumulator = new VisualAccumulator(originValue, maxNumberOfOperations, maxRunningTime, title,
xAxisLabel, yAxisLabel);
double totalRunningTime = 0;
Stopwatch timer;
for(String word : words) {
if(word.length() < minLength) {
continue;
}
if(!symbolTable.contains(word)) {
timer = new Stopwatch();
symbolTable.put(word, 1);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
} else {
timer = new Stopwatch();
int wordFrequency = symbolTable.get(word);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
timer = new Stopwatch();
symbolTable.put(word, wordFrequency + 1);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
}
}
String max = "";
timer = new Stopwatch();
symbolTable.put(max, 0);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
for(String word : symbolTable.keys()) {
timer = new Stopwatch();
int wordFrequency = symbolTable.get(word);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
timer = new Stopwatch();
int maxWordFrequency = symbolTable.get(max);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
if(wordFrequency > maxWordFrequency) {
max = word;
}
}
timer = new Stopwatch();
int maxFrequency = symbolTable.get(max);
totalRunningTime += timer.elapsedTime() * 1000;
visualAccumulator.addDataValue(totalRunningTime, false);
visualAccumulator.writeLastComputedValue();
return max + " " + maxFrequency;
}
}
| [
"im.arnild@gmail.com"
] | im.arnild@gmail.com |
f10e01575dbaf864d390e25c72fabd28bbe15d5d | 2d30b224c42a1410f90d35628e58c5b3a06b8ac0 | /Chapter_7_GCS/mdse.book.swml.diagram/src/swml/diagram/edit/policies/NCLinkItemSemanticEditPolicy.java | 37fb860cfd92e98e88a6c00b166554dbfed54329 | [] | no_license | soediro/MDSEBook | a4a4391c8bd5b455544be2559f38c159289c2787 | 14ed8230008051b7c22cf9f51df6b8caa7a6879e | refs/heads/master | 2020-03-18T00:32:31.724606 | 2015-12-08T10:11:22 | 2015-12-08T10:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 670 | java | /*
*
*/
package swml.diagram.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import swml.diagram.providers.SwmlElementTypes;
/**
* @generated
*/
public class NCLinkItemSemanticEditPolicy extends
SwmlBaseItemSemanticEditPolicy {
/**
* @generated
*/
public NCLinkItemSemanticEditPolicy() {
super(SwmlElementTypes.NCLink_4001);
}
/**
* @generated
*/
protected Command getDestroyElementCommand(DestroyElementRequest req) {
return getGEFWrapper(new DestroyElementCommand(req));
}
}
| [
"wimmer@big.tuwien.ac.at"
] | wimmer@big.tuwien.ac.at |
c797a4952d79c1f29d9134668516148bad061d37 | c8cf34588ac061b5a9313c0b976be9d6412c8a0e | /runescape-api/src/main/java/net/runelite/rs/api/RSNPC.java | fc4bfcc7144558a2edc4e0bbbeff58eadf2b4770 | [
"BSD-2-Clause"
] | permissive | boundl/runelite | eb296c66dcfbbb4f9b42eaf25a97bf7721a6959b | 2d525e7c93e9658790be586b61867296661df4d1 | refs/heads/master | 2020-04-18T09:21:39.006738 | 2019-03-30T14:06:52 | 2019-03-30T14:06:52 | 167,431,476 | 13 | 6 | BSD-2-Clause | 2019-02-10T19:56:06 | 2019-01-24T20:19:41 | Java | UTF-8 | Java | false | false | 1,684 | java | /*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.rs.api;
import net.runelite.api.NPC;
import net.runelite.mapping.Import;
public interface RSNPC extends RSActor, NPC
{
@Import("composition")
@Override
RSNPCComposition getComposition();
@Override
int getIndex();
void setIndex(int id);
void setDead(boolean dead);
}
| [
"Adam@anope.org"
] | Adam@anope.org |
58260643bb006c1e16241085597065eb9425bb15 | 3526196f89d1b05591f3f3f95e34d33360e14a0d | /framework-client/src/main/java/com/github/framework/client/metries/Meter.java | 803aa84a3e4746cb4948cc695a7ab15345e0f918 | [] | no_license | lhrimperial/framework-rpc | 93cc4e0ed8aa134c25298e389e52eb6e36a04596 | e8a557d6fbeb427036631daa5391b39481a11756 | refs/heads/master | 2021-01-24T08:48:16.468394 | 2018-03-19T10:02:28 | 2018-03-19T10:02:28 | 122,995,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,370 | java | package com.github.framework.client.metries;
import java.util.concurrent.atomic.AtomicLong;
/**
* RPC调用统计
*/
public class Meter {
private String serviceName; //服务名
private AtomicLong callCount = new AtomicLong(0l); //调用次数
private AtomicLong failedCount = new AtomicLong(0l); //失败次数
private AtomicLong totalCallTime = new AtomicLong(0l); //总的调用时间
private AtomicLong totalRequestSize = new AtomicLong(0l);//入参大小
public Meter(String serviceName) {
this.serviceName = serviceName;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
public AtomicLong getCallCount() {
return callCount;
}
public void setCallCount(AtomicLong callCount) {
this.callCount = callCount;
}
public AtomicLong getFailedCount() {
return failedCount;
}
public void setFailedCount(AtomicLong failedCount) {
this.failedCount = failedCount;
}
public AtomicLong getTotalCallTime() {
return totalCallTime;
}
public void setTotalCallTime(AtomicLong totalCallTime) {
this.totalCallTime = totalCallTime;
}
public AtomicLong getTotalRequestSize() {
return totalRequestSize;
}
public void setTotalRequestSize(AtomicLong totalRequestSize) {
this.totalRequestSize = totalRequestSize;
}
}
| [
"longhairen@lvmama.com"
] | longhairen@lvmama.com |
a28ad65bb9778824af026b32bd92ac43ca92201e | e0f0cbfec89ba178816a36864a0ef085a825236e | /blade-core/src/main/java/com/blade/CoreFilter.java | 68b0d0df1d82fd4cc40fa88bea30fd869bd2fd69 | [
"Apache-2.0"
] | permissive | dakabang/blade | e6fa8ef9d021bc6a15c23f6c2bb987024a4b5ad7 | 29f0da2d59415a9ee0354220ebde1b6e262de697 | refs/heads/master | 2020-04-01T17:59:07.086611 | 2015-11-30T11:40:37 | 2015-11-30T11:40:37 | 47,091,333 | 0 | 0 | null | 2015-11-30T02:43:44 | 2015-11-30T02:43:43 | null | UTF-8 | Java | false | false | 4,544 | java | /**
* Copyright (c) 2015, biezhi 王爵 (biezhi.me@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.blade;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.blade.context.BladeWebContext;
import com.blade.route.RouteBuilder;
import blade.kit.StringKit;
import blade.kit.TaskKit;
import blade.kit.log.Logger;
/**
* blade核心过滤器,mvc总线
* 匹配所有请求过滤
*
* @author <a href="mailto:biezhi.me@gmail.com" target="_blank">biezhi</a>
* @since 1.0
*/
public class CoreFilter implements Filter {
private static final Logger LOGGER = Logger.getLogger(CoreFilter.class);
/**
* blade全局初始化类
*/
private static final String BOOSTRAP_CLASS = "bootstrapClass";
/**
* Blade单例对象
*/
private Blade blade;
/**
* 执行所有请求的处理器
*/
private ActionHandler actionHandler;
@Override
public void init(FilterConfig filterConfig) throws ServletException {
// 防止重复初始化
try {
blade = Blade.me();
if(!blade.isInit){
blade.webRoot(filterConfig.getServletContext().getRealPath("/"));
Bootstrap bootstrap = blade.bootstrap();
String bootStrapClassName = filterConfig.getInitParameter(BOOSTRAP_CLASS);
if(StringKit.isNotBlank(bootStrapClassName)){
bootstrap = getBootstrap(filterConfig.getInitParameter(BOOSTRAP_CLASS));
bootstrap.init();
blade.app(bootstrap);
}
// 构建路由
new RouteBuilder(blade).building();
// 初始化IOC
IocApplication.init(blade);
bootstrap.contextInitialized(blade);
blade.setInit(true);
actionHandler = new ActionHandler(filterConfig.getServletContext(), blade);
LOGGER.info("blade init complete!");
}
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
}
}
/**
* 获取全局初始化对象,初始化应用
*
* @param botstrapClassName 全局初始化类名
* @return 一个全局初始化对象
* @throws ServletException
*/
private Bootstrap getBootstrap(String botstrapClassName) throws ServletException {
Bootstrap bootstrapClass = null;
try {
if(null != botstrapClassName){
Class<?> applicationClass = Class.forName(botstrapClassName);
if(null != applicationClass){
bootstrapClass = (Bootstrap) applicationClass.newInstance();
}
} else {
throw new ServletException("bootstrapClass is null !");
}
} catch (Exception e) {
throw new ServletException(e);
}
return bootstrapClass;
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException{
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpRequest.setCharacterEncoding(blade.encoding());
httpResponse.setCharacterEncoding(blade.encoding());
/**
* 是否被RequestHandler执行
*/
boolean isHandler = actionHandler.handle(httpRequest, httpResponse);
if(!isHandler){
chain.doFilter(httpRequest, httpResponse);
}
}
@Override
public void destroy() {
LOGGER.info("blade destroy!");
BladeWebContext.remove();
IocApplication.destroy();
TaskKit.depose();
}
} | [
"biezhi.me@gmail.com"
] | biezhi.me@gmail.com |
97063fbb7025a9229735e0820373791b80fb41b8 | f609cb34b3538f6dac07d2d8144ce45b14ca8ac2 | /src/coding/temp/_0399_Evaluate_Division.java | d42389ff199d5874fdf9756b3606a6a2afc91f08 | [] | no_license | sahilmutreja/Algorithms | ca8f6f59039b01ea2c0ea7f7f6e51de7e9982141 | a24f6e73c1ad4c863c67e957fcba781c4953ac80 | refs/heads/master | 2023-02-10T08:00:13.729659 | 2021-01-04T08:02:12 | 2021-01-04T08:02:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,335 | java | /**
* @author Yunxiang He
* @date 06/27/2018
*/
package coding.temp;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/*
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number).
Given some queries, return the answers. If the answer does not exist, return -1.0.
Example:
Given a / b = 2.0, b / c = 3.0.
queries are: a / c = ?, b / a = ?, a / equations = ?, a / a = ?, x / x = ? .
return [6.0, 0.5, -1.0, 1.0, -1.0 ].
The input is: vector<pair<string, string>> equations, vector<double>& values, vector<pair<string, string>> queries , where equations.size() == values.size(), and the values are positive.
This represents the equations. Return vector<double>.
According to the example above:
equations = [ ["a", "b"], ["b", "c"] ],
values = [2.0, 3.0],
queries = [ ["a", "c"], ["b", "a"], ["a", "equations"], ["a", "a"], ["x", "x"] ].
The input is always valid. You may assume that evaluating the queries will result in no division by zero and there is no contradiction.
*/
public class _0399_Evaluate_Division {
public static void main(String[] args) {
_0399_Evaluate_Division _0399_Evaluate_Division = new _0399_Evaluate_Division();
_0399_Evaluate_Division.calcEquation_DFS(new String[][] { { "a", "b" }, { "b", "c" }, }, new double[] { 2.0, 3.0, }, new String[][] { { "a", "c" }, });
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Map<String, String> root = new HashMap<>();
Map<String, Double> ratio2root = new HashMap<>();
public double[] calcEquation(String[][] equations, double[] values, String[][] queries) {
String r1;
String r2;
for (int i = 0; i < equations.length; ++i) {
r1 = find(equations[i][0]);
r2 = find(equations[i][1]);
if (!r1.equals(r2)) {
root.put(r1, r2);
ratio2root.put(r1, values[i] * ratio2root.get(equations[i][1]) / ratio2root.get(equations[i][0]));
}
}
double[] res = new double[queries.length];
for (int i = 0; i < queries.length; ++i) {
if (ratio2root.containsKey(queries[i][0]) && ratio2root.containsKey(queries[i][1])) {
if (queries[i][0].equals(queries[i][1])) {
res[i] = 1.0;
} else if (find(queries[i][0]).equals(find(queries[i][1]))) {
res[i] = ratio2root.get(queries[i][0]) / ratio2root.get(queries[i][1]);
} else {
res[i] = -1.0;
}
} else {
res[i] = -1.0;
}
}
return res;
}
private String find(String index) {
if (!root.containsKey(index)) {
root.put(index, index);
ratio2root.put(index, 1.0);
}
if (root.get(index).equals(index)) {
return index;
}
String temp = find(root.get(index));
ratio2root.put(index, ratio2root.get(index) * ratio2root.get(root.get(index)));
root.put(index, temp);
return temp;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Map<String, Map<String, Double>> graph = new HashMap<>();
public double[] calcEquation_DFS(String[][] equations, double[] values, String[][] queries) {
buildGraph(equations, values);
double[] res = new double[queries.length];
for (int i = 0; i < queries.length; ++i) {
if (!graph.containsKey(queries[i][0]) || !graph.containsKey(queries[i][1])) {
res[i] = -1.0;
} else if (queries[i][0] == queries[i][1]) {
res[i] = 1.0;
} else {
res[i] = DFS(queries[i][0], queries[i][1], new HashSet<>(), 1.0);
}
}
return res;
}
private double DFS(String from, String to, Set<String> visited, double curr) {
if (from.equals(to)) {
return curr;
} else if (!visited.contains(from)) {
visited.add(from);
for (Map.Entry<String, Double> next : graph.get(from).entrySet()) {
double temp = DFS(next.getKey(), to, visited, curr * next.getValue());
if (temp != -1.0) {
return temp;
}
}
}
return -1.0;
}
private Map<String, Map<String, Double>> buildGraph(String[][] equations, double[] values) {
Map<String, Map<String, Double>> graph = new HashMap<>();
for (int i = 0; i < equations.length; i++) {
graph.putIfAbsent(equations[i][0], new HashMap<>());
graph.get(equations[i][0]).put(equations[i][1], values[i]);
graph.putIfAbsent(equations[i][1], new HashMap<>());
graph.get(equations[i][1]).put(equations[i][0], 1.0 / values[i]);
}
return graph;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private boolean isFound;
private double temp;
public double[] calcEquation_DFS2(String[][] equations, double[] values, String[][] queries) {
graph = buildGraph(equations, values);
double[] res = new double[queries.length];
for (int i = 0; i < queries.length; i++) {
if (!graph.containsKey(queries[i][0]) || !graph.containsKey(queries[i][1])) {
res[i] = -1.0;
} else if (queries[i][0] == queries[i][1]) {
res[i] = 1.0;
} else {
temp = 1.0;
isFound = false;
DFS2(queries[i][0], queries[i][1], new HashSet<>(), 1.0);
if (isFound) {
res[i] = temp;
} else {
res[i] = -1.0;
}
}
}
return res;
}
private void DFS2(String root, String target, Set<String> visited, double curr) {
if (!isFound) {
if (root.equals(target)) {
isFound = true;
temp = curr;
}
if (!visited.contains(root)) {
visited.add(root);
for (Map.Entry<String, Double> node : graph.get(root).entrySet()) {
DFS2(node.getKey(), target, visited, curr * node.getValue());
}
}
}
}
}
| [
"155028525@qq.com"
] | 155028525@qq.com |
4d0870c13a91319cd7ad46094f593c7826abaa49 | a3d6556180e74af7b555f8d47d3fea55b94bcbda | /chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/PrivacySandboxSnackbarController.java | baa33935bf8c4d13b750c71707d0425010013c68 | [
"BSD-3-Clause"
] | permissive | chromium/chromium | aaa9eda10115b50b0616d2f1aed5ef35d1d779d6 | a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c | refs/heads/main | 2023-08-24T00:35:12.585945 | 2023-08-23T22:01:11 | 2023-08-23T22:01:11 | 120,360,765 | 17,408 | 7,102 | BSD-3-Clause | 2023-09-10T23:44:27 | 2018-02-05T20:55:32 | null | UTF-8 | Java | false | false | 2,393 | java | // Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.privacy_sandbox;
import android.content.Context;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
/**
* Shows the snackbar for Privacy Sandbox settings, allowing the user to quickly navigate there.
*/
public class PrivacySandboxSnackbarController implements SnackbarManager.SnackbarController {
private Context mContext;
private SettingsLauncher mSettingsLauncher;
private SnackbarManager mSnackbarManager;
/**
* Creates an instance of the controller given a SnackbarManager and a SettingsLauncher.
*/
public PrivacySandboxSnackbarController(
Context context, SnackbarManager manager, SettingsLauncher launcher) {
ThreadUtils.assertOnUiThread();
assert manager != null;
mContext = context;
mSnackbarManager = manager;
mSettingsLauncher = launcher;
}
/**
* Displays a snackbar, showing the user an option to go to Privacy Sandbox settings.
*/
public void showSnackbar() {
RecordUserAction.record("Settings.PrivacySandbox.Block3PCookies");
mSnackbarManager.dismissSnackbars(this);
mSnackbarManager.showSnackbar(
Snackbar.make(mContext.getString(R.string.privacy_sandbox_snackbar_message), this,
Snackbar.TYPE_PERSISTENT, Snackbar.UMA_PRIVACY_SANDBOX_PAGE_OPEN)
.setAction(mContext.getString(R.string.more), null)
.setSingleLine(false));
}
/**
* Dismisses the snackbar, if it is active.
*/
public void dismissSnackbar() {
mSnackbarManager.dismissSnackbars(this);
}
// Implement SnackbarController.
@Override
public void onAction(Object actionData) {
PrivacySandboxSettingsBaseFragment.launchPrivacySandboxSettings(
mContext, mSettingsLauncher, PrivacySandboxReferrer.COOKIES_SNACKBAR);
}
@Override
public void onDismissNoAction(Object actionData) {}
}
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
16e77bc084dc8ab2a6143ded1376f91fe2055de7 | 6e540d54b36e983d30e11f84d8dc9d2ae5152656 | /Day16/src/lv/madara/TestThrow.java | e06513dd166d719ca95804cb1ce5f93d70063900 | [] | no_license | Madara89/Java_80h | 9be48f32ea1d07bd10de72c7ae02f561bf563164 | 8df01ee09d6bfa9080b9b6e05cfc5e580e2160e3 | refs/heads/master | 2022-08-25T14:52:09.748527 | 2020-05-25T18:35:22 | 2020-05-25T18:35:22 | 266,851,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package lv.madara;
public class TestThrow {
public static void main(String[] args) {
checkAge(19);
}
public static void checkAge(int age){ //ar public static var main metodē uzreiz izsaukt checkAge
if(age < 21){
throw new ArithmeticException("Your age is below 21."); //ar throw new iemet erroru
}else{
System.out.println("Your age is "+age);
}
}
}
| [
"you@example.com"
] | you@example.com |
8036d92b788a887b3477ee2dcc7115368f448219 | 7c20e36b535f41f86b2e21367d687ea33d0cb329 | /Capricornus/src/com/gopawpaw/erp/hibernate/m/AbstractMpdDetId.java | 348883b1af536e6a765ba7c454c16dcd032be817 | [] | no_license | fazoolmail89/gopawpaw | 50c95b924039fa4da8f309e2a6b2ebe063d48159 | b23ccffce768a3d58d7d71833f30b85186a50cc5 | refs/heads/master | 2016-09-08T02:00:37.052781 | 2014-05-14T11:46:18 | 2014-05-14T11:46:18 | 35,091,153 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,283 | java | package com.gopawpaw.erp.hibernate.m;
/**
* AbstractMpdDetId entity provides the base persistence definition of the
* MpdDetId entity. @author MyEclipse Persistence Tools
*/
public abstract class AbstractMpdDetId implements java.io.Serializable {
// Fields
private String mpdDomain;
private String mpdNbr;
private String mpdType;
// Constructors
/** default constructor */
public AbstractMpdDetId() {
}
/** minimal constructor */
public AbstractMpdDetId(String mpdDomain) {
this.mpdDomain = mpdDomain;
}
/** full constructor */
public AbstractMpdDetId(String mpdDomain, String mpdNbr, String mpdType) {
this.mpdDomain = mpdDomain;
this.mpdNbr = mpdNbr;
this.mpdType = mpdType;
}
// Property accessors
public String getMpdDomain() {
return this.mpdDomain;
}
public void setMpdDomain(String mpdDomain) {
this.mpdDomain = mpdDomain;
}
public String getMpdNbr() {
return this.mpdNbr;
}
public void setMpdNbr(String mpdNbr) {
this.mpdNbr = mpdNbr;
}
public String getMpdType() {
return this.mpdType;
}
public void setMpdType(String mpdType) {
this.mpdType = mpdType;
}
public boolean equals(Object other) {
if ((this == other))
return true;
if ((other == null))
return false;
if (!(other instanceof AbstractMpdDetId))
return false;
AbstractMpdDetId castOther = (AbstractMpdDetId) other;
return ((this.getMpdDomain() == castOther.getMpdDomain()) || (this
.getMpdDomain() != null
&& castOther.getMpdDomain() != null && this.getMpdDomain()
.equals(castOther.getMpdDomain())))
&& ((this.getMpdNbr() == castOther.getMpdNbr()) || (this
.getMpdNbr() != null
&& castOther.getMpdNbr() != null && this.getMpdNbr()
.equals(castOther.getMpdNbr())))
&& ((this.getMpdType() == castOther.getMpdType()) || (this
.getMpdType() != null
&& castOther.getMpdType() != null && this.getMpdType()
.equals(castOther.getMpdType())));
}
public int hashCode() {
int result = 17;
result = 37 * result
+ (getMpdDomain() == null ? 0 : this.getMpdDomain().hashCode());
result = 37 * result
+ (getMpdNbr() == null ? 0 : this.getMpdNbr().hashCode());
result = 37 * result
+ (getMpdType() == null ? 0 : this.getMpdType().hashCode());
return result;
}
} | [
"ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5"
] | ahuaness@b3021582-c689-11de-ba9a-9db95b2bc6c5 |
76d944f3c389d8126b02405e8d2f0d57bf85c8c8 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_50814.java | c1eac4ed0e46a11a2870ed4e9f311a198adee037 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | public void setMaxRuleViolations(int max){
if (max >= 0) {
this.maxRuleViolations=max;
this.failOnRuleViolation=true;
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
b873c1c93ac4d81048a64c1fd3b602b28e83121d | d133fffddfba6783f4cf9403a04269e7955a74b0 | /src/osmedile/intellij/stringmanip/styles/AbstractCaseConvertingAction.java | 46431df624aa217d2694e38f1dcbb0894c472df8 | [
"Apache-2.0"
] | permissive | hatip5656/StringManipulation | 2d94b13f36b3b59d2c26d90c50a01ed0fa4b42d4 | 6ea59b84fde34d806874516a1dc37a3bd889e6aa | refs/heads/master | 2023-08-22T04:45:14.361417 | 2021-10-27T09:43:32 | 2021-10-27T09:43:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,609 | java | package osmedile.intellij.stringmanip.styles;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.SelectionModel;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.PlainTextFileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.tree.LeafPsiElement;
import com.intellij.psi.impl.source.tree.java.PsiJavaTokenImpl;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiUtilBase;
import osmedile.intellij.stringmanip.AbstractStringManipAction;
import osmedile.intellij.stringmanip.utils.StringUtil;
import java.util.Map;
/**
* todo write some tests
*/
public abstract class AbstractCaseConvertingAction extends AbstractStringManipAction<Object> {
public static final String FROM = "from";
private final Logger LOG = Logger.getInstance("#" + getClass().getCanonicalName());
public AbstractCaseConvertingAction() {
}
public AbstractCaseConvertingAction(boolean setupHandler) {
super(setupHandler);
}
@Override
protected boolean selectSomethingUnderCaret(Editor editor, DataContext dataContext, SelectionModel selectionModel) {
try {
Project project = editor.getProject();
if (project == null) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (psiFile == null) {// select whole line in plaintext
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
FileType fileType = psiFile.getFileType();
boolean handled = false;
if (isJava(fileType)) {
handled = javaHandling(editor, dataContext, selectionModel, psiFile);
}
if (!handled && isProperties(fileType)) {
handled = propertiesHandling(editor, dataContext, selectionModel, psiFile);
}
if (!handled && fileType.equals(PlainTextFileType.INSTANCE)) {
handled = super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
if (!handled) {
handled = genericHandling(editor, dataContext, selectionModel, psiFile);
}
return handled;
} catch (Throwable e) {
LOG.error("please report this, so I can fix it :(", e);
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
}
private boolean isProperties(FileType fileType) {
try {
return "Properties".equals(fileType.getName());
} catch (Throwable exception) {
return false;
}
}
private boolean isJava(FileType fileType) {
try {
//noinspection ConstantConditions
return "JAVA".equals(fileType.getName()) && Class.forName("com.intellij.psi.impl.source.tree.java.PsiJavaTokenImpl") != null;
} catch (Throwable e) {
return false;
}
}
private boolean propertiesHandling(Editor editor, DataContext dataContext, SelectionModel selectionModel,
PsiFile psiFile) {
PsiElement elementAtCaret = PsiUtilBase.getElementAtCaret(editor);
if (elementAtCaret instanceof PsiWhiteSpace) {
return false;
} else if (elementAtCaret instanceof LeafPsiElement) {
IElementType elementType = ((LeafPsiElement) elementAtCaret).getElementType();
if (elementType.toString().equals("Properties:VALUE_CHARACTERS")
|| elementType.toString().equals("Properties:KEY_CHARACTERS")) {
TextRange textRange = elementAtCaret.getTextRange();
if (textRange.getLength() == 0) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
selectionModel.setSelection(textRange.getStartOffset(), textRange.getEndOffset());
return true;
}
}
return false;
}
private boolean javaHandling(Editor editor, DataContext dataContext, SelectionModel selectionModel, PsiFile psiFile) {
boolean steppedLeft = false;
int caretOffset = editor.getCaretModel().getOffset();
PsiElement elementAtCaret = PsiUtilBase.getElementAtCaret(editor);
if (elementAtCaret instanceof PsiWhiteSpace) {
elementAtCaret = PsiUtilBase.getElementAtOffset(psiFile, caretOffset - 1);
steppedLeft = true;
} else if (elementAtCaret instanceof PsiJavaTokenImpl) {
PsiJavaToken javaToken = (PsiJavaToken) elementAtCaret;
if (javaToken.getTokenType() != JavaTokenType.STRING_LITERAL) {
elementAtCaret = PsiUtilBase.getElementAtOffset(psiFile, caretOffset - 1);
steppedLeft = true;
}
}
if (steppedLeft && !(elementAtCaret instanceof PsiJavaToken)) {
return false;
}
if (steppedLeft && elementAtCaret instanceof PsiJavaTokenImpl) {
PsiJavaToken javaToken = (PsiJavaToken) elementAtCaret;
if (javaToken.getTokenType() != JavaTokenType.STRING_LITERAL) {
return false;
}
}
if (elementAtCaret instanceof PsiJavaToken) {
int offset = 0;
PsiJavaToken javaToken = (PsiJavaToken) elementAtCaret;
if (javaToken.getTokenType() == JavaTokenType.STRING_LITERAL) {
offset = 1;
}
TextRange textRange = elementAtCaret.getTextRange();
if (textRange.getLength() == 0) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
selectionModel.setSelection(textRange.getStartOffset() + offset, textRange.getEndOffset() - offset);
if (caretOffset < selectionModel.getSelectionStart()) {
editor.getCaretModel().moveToOffset(selectionModel.getSelectionStart());
}
if (caretOffset > selectionModel.getSelectionEnd()) {
editor.getCaretModel().moveToOffset(selectionModel.getSelectionEnd());
}
return true;
} else {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
}
private boolean genericHandling(Editor editor, DataContext dataContext, SelectionModel selectionModel,
PsiFile psiFile) {
int caretOffset = editor.getCaretModel().getOffset();
PsiElement elementAtCaret = PsiUtilBase.getElementAtCaret(editor);
if (elementAtCaret instanceof PsiPlainText) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
} else if (elementAtCaret instanceof PsiWhiteSpace) {
elementAtCaret = PsiUtilBase.getElementAtOffset(psiFile, caretOffset - 1);
}
if (elementAtCaret == null || elementAtCaret instanceof PsiWhiteSpace) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
} else {
TextRange textRange = elementAtCaret.getTextRange();
if (textRange.getLength() == 0) {
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
selectionModel.setSelection(textRange.getStartOffset(), textRange.getEndOffset());
String selectedText = selectionModel.getSelectedText();
if (selectedText != null && selectedText.contains("\n")) {
selectionModel.removeSelection();
return super.selectSomethingUnderCaret(editor, dataContext, selectionModel);
}
if (StringUtil.isQuoted(selectedText)) {
selectionModel.setSelection(selectionModel.getSelectionStart() + 1,
selectionModel.getSelectionEnd() - 1);
}
if (caretOffset < selectionModel.getSelectionStart()) {
editor.getCaretModel().moveToOffset(selectionModel.getSelectionStart());
}
if (caretOffset > selectionModel.getSelectionEnd()) {
editor.getCaretModel().moveToOffset(selectionModel.getSelectionEnd());
}
return true;
}
}
protected Style getStyle(Map<String, Object> actionContext, String s) {
Style from = (Style) actionContext.get(FROM);
if (from == null) {
from = Style.from(s);
actionContext.put(FROM, from);
}
return from;
}
}
| [
"vojta.krasa@gmail.com"
] | vojta.krasa@gmail.com |
6697302955540eb28d413c8e98985b5b5f2c95b2 | 2074f1faad684f66ebe46341a4553859578b640e | /myphotos-model/src/main/java/org/myphotos/validation/EnglishLanguage.java | adf1ac0733767a2c2c4f233354ac886a4fec4a89 | [] | no_license | VitaliyDragun1990/mp | 3a7b0fbd8e21fa0f03be7972d4c3bcca7f54da81 | 08f3c40e5a4857d0e9c56e91269a8ba85276bdd1 | refs/heads/master | 2022-02-18T12:03:12.724620 | 2019-08-21T14:36:26 | 2019-08-21T14:36:26 | 198,579,904 | 0 | 0 | null | 2022-02-09T22:10:10 | 2019-07-24T07:15:35 | Java | UTF-8 | Java | false | false | 1,431 | java | package org.myphotos.validation;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
import org.myphotos.validation.validator.EnglishLanguageConstraintValidator;
/**
* Validation annotation to check whether some text value written in Enlish
* language with some specified constrains.
*
* @author Vitaliy Dragun
*
*/
@Documented
@Retention(RUNTIME)
@Target({ FIELD, METHOD, PARAMETER, CONSTRUCTOR, ANNOTATION_TYPE })
@Constraint(validatedBy = EnglishLanguageConstraintValidator.class)
public @interface EnglishLanguage {
String message() default "{javax.validation.constraints.EnglishLanguage.message}";
// 0123456789
boolean withNumbers() default true;
// .,?!-:()'"[]{}; \t\n
boolean withPunctuations() default true;
// ~#$%^&*-+=_\\|/@`!'\";:><,.?{}
boolean withSpecSymbols() default true;
Class<? extends Payload>[] payload() default {};
Class<?>[] groups() default {};
}
| [
"vdrag00n90@gmail.com"
] | vdrag00n90@gmail.com |
54774a704f67b75e6d9f399c13ac958c82bad3fe | 00bcd19c4d237afdf9bb20e57f4a494517603d5f | /src/main/java/io/spring/calendar/jira/JiraVersion.java | 369ce3b87b0fd85f2fe2f7757355c270abe31c4d | [] | no_license | bclozel/spring-calendar | 2cd3c3558b6a0188ea5699919638310a4e9f22e9 | cee27f82e3882cee43d18ac4b07138f68287fe35 | refs/heads/master | 2021-01-11T05:24:29.957621 | 2017-10-20T08:07:59 | 2017-10-20T08:07:59 | 71,802,628 | 0 | 1 | null | 2016-10-24T15:23:46 | 2016-10-24T15:23:45 | null | UTF-8 | Java | false | false | 1,489 | java | /*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.spring.calendar.jira;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A minimal representation of a Jira version.
*
* @author Andy Wilkinson
*/
class JiraVersion {
private final String id;
private final String name;
private final String releaseDate;
private final boolean released;
@JsonCreator
JiraVersion(@JsonProperty("id") String id, @JsonProperty("name") String name,
@JsonProperty("releaseDate") String releaseDate,
@JsonProperty("released") boolean released) {
this.id = id;
this.name = name;
this.releaseDate = releaseDate;
this.released = released;
}
String getId() {
return this.id;
}
String getName() {
return this.name;
}
String getReleaseDate() {
return this.releaseDate;
}
public boolean isReleased() {
return this.released;
}
}
| [
"awilkinson@pivotal.io"
] | awilkinson@pivotal.io |
cc52dde195fb22e3d0420ce78c01909ed5a5d7b0 | ac82c09fd704b2288cef8342bde6d66f200eeb0d | /projects/OG-Engine/src/test/java/com/opengamma/engine/fudgemsg/CompiledViewCalculationConfigurationFudgeBuilderTest.java | 3a8ed02fca310d02a1db6eb5669b6b1670f7ef09 | [
"Apache-2.0"
] | permissive | cobaltblueocean/OG-Platform | 88f1a6a94f76d7f589fb8fbacb3f26502835d7bb | 9b78891139503d8c6aecdeadc4d583b23a0cc0f2 | refs/heads/master | 2021-08-26T00:44:27.315546 | 2018-02-23T20:12:08 | 2018-02-23T20:12:08 | 241,467,299 | 0 | 2 | Apache-2.0 | 2021-08-02T17:20:41 | 2020-02-18T21:05:35 | Java | UTF-8 | Java | false | false | 4,613 | java | /**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.engine.fudgemsg;
import static org.testng.Assert.assertEquals;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.opengamma.engine.ComputationTargetSpecification;
import com.opengamma.engine.target.ComputationTargetRequirement;
import com.opengamma.engine.value.ValueProperties;
import com.opengamma.engine.value.ValuePropertyNames;
import com.opengamma.engine.value.ValueRequirement;
import com.opengamma.engine.value.ValueSpecification;
import com.opengamma.engine.view.compilation.CompiledViewCalculationConfiguration;
import com.opengamma.engine.view.compilation.CompiledViewCalculationConfigurationImpl;
import com.opengamma.id.ExternalId;
import com.opengamma.id.UniqueId;
import com.opengamma.util.test.AbstractFudgeBuilderTestCase;
import com.opengamma.util.test.TestGroup;
/**
* Tests the {@link CompiledViewCalculationConfigurationFudgeBuilder} class.
*/
@Test(groups = TestGroup.UNIT)
public class CompiledViewCalculationConfigurationFudgeBuilderTest extends AbstractFudgeBuilderTestCase {
public void testEmpty() {
final CompiledViewCalculationConfiguration in = new CompiledViewCalculationConfigurationImpl("1", Collections.<ComputationTargetSpecification>emptySet(),
Collections.<ValueSpecification, Set<ValueRequirement>>emptyMap(), Collections.<ValueSpecification, Collection<ValueSpecification>>emptyMap());
final CompiledViewCalculationConfiguration out = cycleObject(CompiledViewCalculationConfiguration.class, in);
assertEquals(out.getName(), in.getName());
assertEquals(out.getComputationTargets(), in.getComputationTargets());
assertEquals(out.getMarketDataRequirements(), in.getMarketDataRequirements());
assertEquals(out.getTerminalOutputSpecifications(), in.getTerminalOutputSpecifications());
}
public void testBasic() {
final ComputationTargetRequirement targetReq = ComputationTargetRequirement.of(ExternalId.of("Foo", "Bar"));
final ComputationTargetSpecification targetSpec = ComputationTargetSpecification.of(UniqueId.of("Sec", "123"));
final ValueSpecification valueSpecification = new ValueSpecification("Value", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Foo").get());
final ValueRequirement valueRequirement = new ValueRequirement("Value", targetReq);
final ValueSpecification dataSpecification1 = new ValueSpecification("Data1", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final ValueSpecification dataSpecification2a = new ValueSpecification("Data2a", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final ValueSpecification dataSpecification2b = new ValueSpecification("Data2b", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final ValueSpecification dataSpecification3a = new ValueSpecification("Data3a", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final ValueSpecification dataSpecification3b = new ValueSpecification("Data3b", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final ValueSpecification dataSpecification3c = new ValueSpecification("Data3c", targetSpec, ValueProperties.with(ValuePropertyNames.FUNCTION, "Bar").get());
final CompiledViewCalculationConfiguration in = new CompiledViewCalculationConfigurationImpl("2", ImmutableSet.of(ComputationTargetSpecification.NULL, targetSpec),
ImmutableMap.<ValueSpecification, Set<ValueRequirement>>of(valueSpecification, ImmutableSet.of(valueRequirement)), ImmutableMap.<ValueSpecification, Collection<ValueSpecification>>of(
dataSpecification1, Collections.singleton(dataSpecification1),
dataSpecification2a, Collections.singleton(dataSpecification2b),
dataSpecification3a, ImmutableSet.of(dataSpecification3a, dataSpecification3b, dataSpecification3c)));
final CompiledViewCalculationConfiguration out = cycleObject(CompiledViewCalculationConfiguration.class, in);
assertEquals(out.getName(), in.getName());
assertEquals(out.getComputationTargets(), in.getComputationTargets());
assertEquals(out.getTerminalOutputSpecifications(), in.getTerminalOutputSpecifications());
assertEquals(out.getMarketDataRequirements(), in.getMarketDataRequirements());
}
}
| [
"cobaltblue.ocean@gmail.com"
] | cobaltblue.ocean@gmail.com |
847a838de4687b6a6d5b49dbc8a5501aed10e417 | d8772960b3b2b07dddc8a77595397cb2618ec7b0 | /rhServer/src/main/java/com/rhlinkcon/repository/periciaMedica/PericiaMedicaRepository.java | 58513bedb0983e49bb7ab76f9afa6291f52ace1d | [] | no_license | vctrmarques/interno-rh-sistema | c0f49a17923b5cdfaeb148c6f6da48236055cf29 | 7a7a5d9c36c50ec967cb40a347ec0ad3744d896e | refs/heads/main | 2023-03-17T02:07:10.089496 | 2021-03-12T19:06:05 | 2021-03-12T19:06:05 | 347,168,924 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 841 | java | package com.rhlinkcon.repository.periciaMedica;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import com.rhlinkcon.model.ConsultaPericiaMedica;
import com.rhlinkcon.model.PacientePericiaMedica;
@Repository
public interface PericiaMedicaRepository extends JpaRepository<ConsultaPericiaMedica, Long> {
@Query("SELECT cpm FROM ConsultaPericiaMedica cpm"
+ " WHERE cpm.pacientePericiaMedica.id = :id "
+ " AND cpm.compareceu = false "
+ " AND DATENAME(YEAR, CURRENT_TIMESTAMP) >= DATENAME(YEAR, cpm.agendaMedicaData.data)")
List<ConsultaPericiaMedica> getConsultaPericiaMedicaByPacientePericiaMedicaId(@Param("id") Long id);
}
| [
"vctmarques@gmail.com"
] | vctmarques@gmail.com |
2a57c2f7cc89653093a9a1ce608d13f972af2293 | 09649412e12bdc15cf61607e881203735cfafa50 | /src/test/java/com/microsoft/bingads/v10/api/test/entities/account/write/BulkAccountWriteToRowValuesCustomerIdTest.java | 8b5f2526cc76ac58f69fcc6dd306b12c3b92490d | [
"MIT"
] | permissive | yosefarr/BingAds-Java-SDK | cec603b74a921e71c6173ce112caccdf7c1fdbc8 | d1c333d0ba5b7e434c85a92c7a80dad0add0d634 | refs/heads/master | 2021-01-18T15:02:53.945816 | 2016-03-06T13:18:32 | 2016-03-06T13:18:32 | 51,738,651 | 0 | 1 | null | 2016-02-15T07:38:14 | 2016-02-15T07:38:13 | null | UTF-8 | Java | false | false | 1,481 | java | package com.microsoft.bingads.v10.api.test.entities.account.write;
import com.microsoft.bingads.v10.api.test.entities.account.BulkAccountTest;
import com.microsoft.bingads.v10.bulk.entities.BulkAccount;
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
@RunWith(Parameterized.class)
public class BulkAccountWriteToRowValuesCustomerIdTest extends BulkAccountTest {
@Parameter(value = 1)
public Long propertyValue;
@Parameters
public static Collection<Object[]> data() {
// In this example, the parameter generator returns a List of
// arrays. Each array has two elements: { datum, expected }.
// These data are hard-coded into the class, but they could be
// generated or loaded in any way you like.
return Arrays.asList(new Object[][]{
{"123", 123L},
{"9223372036854775807", 9223372036854775807L}
});
}
@Test
public void testWrite() {
this.<Long>testWriteProperty("Parent Id", this.datum, this.propertyValue, new BiConsumer<BulkAccount, Long>() {
@Override
public void accept(BulkAccount c, Long v) {
c.setCustomerId(v);
}
});
}
}
| [
"jiaj@microsoft.com"
] | jiaj@microsoft.com |
12ad614a9c1e913d0fa7a48f3065929209a130de | a7e8e204cb44c7a199fa3097f13fd281340cd512 | /src/main/java/com/inetpsa/pct00/pct00demo/security/jwt/TokenProvider.java | 127dd5dd8e23eb2c3b636da8b627e98227881c01 | [] | no_license | hartmanjan/jhipsterSampleApplication | 8e69d9718c7ef34f9ce6572512380253be669e6d | fdacc26a6a8fd495e043b007ece3174966291746 | refs/heads/master | 2020-03-17T15:32:32.764375 | 2018-05-16T19:37:39 | 2018-05-16T19:37:39 | 133,714,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,052 | java | package com.inetpsa.pct00.pct00demo.security.jwt;
import io.github.jhipster.config.JHipsterProperties;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Component;
import io.jsonwebtoken.*;
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
private String secretKey;
private long tokenValidityInMilliseconds;
private long tokenValidityInMillisecondsForRememberMe;
private final JHipsterProperties jHipsterProperties;
public TokenProvider(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@PostConstruct
public void init() {
this.secretKey =
jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret();
this.tokenValidityInMilliseconds =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds();
this.tokenValidityInMillisecondsForRememberMe =
1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe();
}
public String createToken(Authentication authentication, boolean rememberMe) {
String authorities = authentication.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.joining(","));
long now = (new Date()).getTime();
Date validity;
if (rememberMe) {
validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe);
} else {
validity = new Date(now + this.tokenValidityInMilliseconds);
}
return Jwts.builder()
.setSubject(authentication.getName())
.claim(AUTHORITIES_KEY, authorities)
.signWith(SignatureAlgorithm.HS512, secretKey)
.setExpiration(validity)
.compact();
}
public Authentication getAuthentication(String token) {
Claims claims = Jwts.parser()
.setSigningKey(secretKey)
.parseClaimsJws(token)
.getBody();
Collection<? extends GrantedAuthority> authorities =
Arrays.stream(claims.get(AUTHORITIES_KEY).toString().split(","))
.map(SimpleGrantedAuthority::new)
.collect(Collectors.toList());
User principal = new User(claims.getSubject(), "", authorities);
return new UsernamePasswordAuthenticationToken(principal, token, authorities);
}
public boolean validateToken(String authToken) {
try {
Jwts.parser().setSigningKey(secretKey).parseClaimsJws(authToken);
return true;
} catch (SignatureException e) {
log.info("Invalid JWT signature.");
log.trace("Invalid JWT signature trace: {}", e);
} catch (MalformedJwtException e) {
log.info("Invalid JWT token.");
log.trace("Invalid JWT token trace: {}", e);
} catch (ExpiredJwtException e) {
log.info("Expired JWT token.");
log.trace("Expired JWT token trace: {}", e);
} catch (UnsupportedJwtException e) {
log.info("Unsupported JWT token.");
log.trace("Unsupported JWT token trace: {}", e);
} catch (IllegalArgumentException e) {
log.info("JWT token compact of handler are invalid.");
log.trace("JWT token compact of handler are invalid trace: {}", e);
}
return false;
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
15ebafa2a02dd1641ab662c603d2ecb88234755e | bdf28391864f024cb841ea4a9e0182c45836500e | /api/src/main/java/com/yanzhenjie/andserver/error/ServerInternalException.java | 058004b30d01b9f21646856cf8a679a9ba83a56d | [
"Apache-2.0"
] | permissive | yanzhenjie/AndServer | 3d48624d8fecc7f27e24c31c6a6ef85ba6add974 | 23a7c15512f5a70a9ce517710a5d04c06a4d57c9 | refs/heads/master | 2023-09-02T01:10:18.569605 | 2023-06-07T07:58:41 | 2023-06-07T07:58:41 | 61,079,960 | 3,675 | 795 | Apache-2.0 | 2023-06-07T07:58:42 | 2016-06-14T00:52:52 | Java | UTF-8 | Java | false | false | 1,367 | java | /*
* Copyright © 2018 Zhenjie Yan.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.yanzhenjie.andserver.error;
import com.yanzhenjie.andserver.http.StatusCode;
/**
* Created by Zhenjie Yan on 2018/9/4.
*/
public class ServerInternalException extends HttpException {
private static final String MESSAGE = "Server internal error";
public ServerInternalException(String subMessage) {
super(StatusCode.SC_INTERNAL_SERVER_ERROR, String.format("%s, %s.", MESSAGE, subMessage));
}
public ServerInternalException(String subMessage, Throwable cause) {
super(StatusCode.SC_INTERNAL_SERVER_ERROR, String.format("%s, %s.", MESSAGE, subMessage), cause);
}
public ServerInternalException(Throwable cause) {
super(StatusCode.SC_INTERNAL_SERVER_ERROR, String.format("%s.", MESSAGE), cause);
}
} | [
"im.yanzhenjie@gmail.com"
] | im.yanzhenjie@gmail.com |
0744ad584dc13870d235ff64f99e94608ff821ab | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_completed/4697213.java | 71ee8cd3d4e5a50fc85258a461665146f098ba0c | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,354 | java |
import java.io.UncheckedIOException;
import java.io.UncheckedIOException;
class c4697213 {
protected void downloadJar(URL downloadURL, File jarFile, IProgressListener pl) {
BufferedOutputStream out = null;
InputStream in = null;
URLConnection urlConnection = null;
try {
urlConnection =(URLConnection)(Object) downloadURL.openConnection();
out = new BufferedOutputStream(new FileOutputStream(jarFile));
in =(InputStream)(Object) urlConnection.getInputStream();
int len =(int)(Object) in.available();
MyHelperClass Log = new MyHelperClass();
Log.log("downloading jar with size: " + urlConnection.getContentLength());
if (len < 1) len = 1024;
byte[] buffer = new byte[len];
while ((len =(int)(Object) in.read(buffer)) > 0) {
out.write(buffer, 0, len);
}
out.close();
in.close();
} catch (Exception e) {
} finally {
if (out != null) {
try {
out.close();
} catch (UncheckedIOException ignore) {
}
}
if (in != null) {
try {
in.close();
} catch (UncheckedIOException ignore) {
}
}
}
}
}
// Code below this line has been added to remove errors
class MyHelperClass {
public MyHelperClass log(String o0){ return null; }}
class URL {
public MyHelperClass openConnection(){ return null; }}
class File {
}
class IProgressListener {
}
class BufferedOutputStream {
BufferedOutputStream(FileOutputStream o0){}
BufferedOutputStream(){}
public MyHelperClass write(byte[] o0, int o1, int o2){ return null; }
public MyHelperClass close(){ return null; }}
class InputStream {
public MyHelperClass read(byte[] o0){ return null; }
public MyHelperClass close(){ return null; }
public MyHelperClass available(){ return null; }}
class URLConnection {
public MyHelperClass getContentLength(){ return null; }
public MyHelperClass getInputStream(){ return null; }}
class FileOutputStream {
FileOutputStream(File o0){}
FileOutputStream(){}}
class IOException extends Exception{
public IOException(String errorMessage) { super(errorMessage); }
}
| [
"piyush16066@iiitd.ac.in"
] | piyush16066@iiitd.ac.in |
e979b5938ed84ea3a326dbe99ca60643024a026f | 23b155d6cb82066d8267d6dfe920d998b9e36e5b | /geoservice-common/src/main/java/org/schoellerfamily/geoservice/exception/package-info.java | a1ab705a696f9cfc542e9e5203c46c6c8b6b0585 | [
"Apache-2.0"
] | permissive | dickschoeller/gedbrowser | d64291e21594026e1ccab9e7557487a0e1fa3731 | eb15573af066550c7c73b37aeb2b6a1a201ae8ca | refs/heads/development | 2023-07-26T14:05:58.405659 | 2021-01-24T02:05:02 | 2021-01-24T02:05:02 | 51,677,959 | 1 | 2 | Apache-2.0 | 2023-07-13T17:05:12 | 2016-02-14T03:30:44 | Java | UTF-8 | Java | false | false | 130 | java | /**
* Copyright 2016 Richard Schoeller
* Common exceptions for geocoding.
*/
package org.schoellerfamily.geoservice.exception;
| [
"schoeller@comcast.net"
] | schoeller@comcast.net |
50b52cc07510acc48feef010fe0f168231beca98 | af79916025156e3d0cf4986b126fbe7f059753e2 | /web/dx/renshi/src/main/java/com/renshi/entity/job/JobOrder.java | ec7468f110c5b4c65b1d78cd789aa8c93fe0607f | [] | no_license | Letmebeawinner/yywt | 5380680fadb7fc0d4c86fb92234f7c69cb216010 | 254fa0f54c09300d4bdcdf8617d97d75003536bd | refs/heads/master | 2022-12-26T06:17:11.755486 | 2020-02-14T10:04:29 | 2020-02-14T10:04:29 | 240,468,510 | 0 | 0 | null | 2022-12-16T11:36:21 | 2020-02-14T09:08:31 | Roff | UTF-8 | Java | false | false | 338 | java | package com.renshi.entity.job;
import com.a_268.base.core.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 干部类
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class JobOrder extends BaseEntity{
private static final long serialVersionUID = -6034634689029517111L;
private String name;//序列名称
}
| [
"448397385@qq.com"
] | 448397385@qq.com |
b60fd20fb942a457575aa0828f73274f8e145fa6 | f188fc63c597bb8ad6fda79a948943ef6e622ce6 | /app/src/main/java/com/tylz/wechat/model/request/RegisterRequest.java | 59b67847d5d0f71374ffee9cc644ad5e0976bf60 | [] | no_license | tylzcxw/CXWWeChat | 066480869aa07df88b68f64249d46fe3b01cb7c1 | 6d3639d121c880fc68192296b07ed324ebcbd3e2 | refs/heads/master | 2021-08-28T19:28:41.249718 | 2017-12-13T02:45:32 | 2017-12-13T02:45:37 | 114,064,729 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,024 | java | package com.tylz.wechat.model.request;
/**
* Created by AMing on 15/12/23.
* Company RongCloud
*/
public class RegisterRequest {
private String nickname;
private String password;
private String verification_token;
public RegisterRequest(String nickname, String password, String verification_token) {
this.nickname = nickname;
this.password = password;
this.verification_token = verification_token;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getVerification_token() {
return verification_token;
}
public void setVerification_token(String verification_token) {
this.verification_token = verification_token;
}
}
| [
"tylzcxw@163.com"
] | tylzcxw@163.com |
3e3f6161ee90955c3979cf895235f376a4ed83eb | 30998a3486f3fad0b336cd7aa8e5ab20fa91181e | /src/main/java/com/liuqi/business/model/MiningConfigModelDto.java | cb67e1d44ebfcf022360e95cc1bace1a2ac34153 | [] | no_license | radar9494/Radar-Star-admin | cbf8c9a0b5b782d2bcc281dfd5ee78ce5b31f086 | 9e4622d3932c2cd2219152814fc91858030cc196 | refs/heads/main | 2023-02-24T00:07:03.150304 | 2021-01-26T02:51:38 | 2021-01-26T02:51:38 | 332,949,996 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package com.liuqi.business.model;
import lombok.Data;
@Data
public class MiningConfigModelDto extends MiningConfigModel{
private String currencyName;
private String typeStr;
public String getTypeStr() {
if(super.getType()!=null){
if(super.getType()==0){
typeStr="矿池";
}else{
typeStr="时间戳";
}
}
return typeStr;
}
private String image;
}
| [
"radar131419@gmail.com"
] | radar131419@gmail.com |
a05f821965af6920ccab3c9cc11e6ac04e39fcd5 | cee6d0534a4b4fda056cacd1738fc7c22223ef06 | /src/main/java/by/distributionnetwork/service/dto/UserDTO.java | 17ddf0cad52a5c172b6ed60241bee33fe1c288f1 | [] | no_license | Topolev/DistributionNetwork_2017_05_31 | 54c0fac9ba8dbdd916dfec27b8348c60d7751840 | a083f2bf9a64e7bbfe10ad2ea254c04c35f1d7a2 | refs/heads/master | 2021-01-23T01:40:32.544847 | 2017-05-31T15:52:36 | 2017-05-31T15:52:42 | 92,882,438 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,192 | java | package by.distributionnetwork.service.dto;
import by.distributionnetwork.config.Constants;
import by.distributionnetwork.domain.Authority;
import by.distributionnetwork.domain.User;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.*;
import java.time.Instant;
import java.util.Set;
import java.util.stream.Collectors;
/**
* A DTO representing a user, with his authorities.
*/
public class UserDTO {
private Long id;
@NotBlank
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
private String login;
@Size(max = 50)
private String firstName;
@Size(max = 50)
private String lastName;
@Email
@Size(min = 5, max = 100)
private String email;
@Size(max = 256)
private String imageUrl;
private boolean activated = false;
@Size(min = 2, max = 5)
private String langKey;
private String createdBy;
private Instant createdDate;
private String lastModifiedBy;
private Instant lastModifiedDate;
private Set<String> authorities;
public UserDTO() {
// Empty constructor needed for Jackson.
}
public UserDTO(User user) {
this(user.getId(), user.getLogin(), user.getFirstName(), user.getLastName(),
user.getEmail(), user.getActivated(), user.getImageUrl(), user.getLangKey(),
user.getCreatedBy(), user.getCreatedDate(), user.getLastModifiedBy(), user.getLastModifiedDate(),
user.getAuthorities().stream().map(Authority::getName)
.collect(Collectors.toSet()));
}
public UserDTO(Long id, String login, String firstName, String lastName,
String email, boolean activated, String imageUrl, String langKey,
String createdBy, Instant createdDate, String lastModifiedBy, Instant lastModifiedDate,
Set<String> authorities) {
this.id = id;
this.login = login;
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.activated = activated;
this.imageUrl = imageUrl;
this.langKey = langKey;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.lastModifiedBy = lastModifiedBy;
this.lastModifiedDate = lastModifiedDate;
this.authorities = authorities;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getEmail() {
return email;
}
public String getImageUrl() {
return imageUrl;
}
public boolean isActivated() {
return activated;
}
public String getLangKey() {
return langKey;
}
public String getCreatedBy() {
return createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public Set<String> getAuthorities() {
return authorities;
}
@Override
public String toString() {
return "UserDTO{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated=" + activated +
", langKey='" + langKey + '\'' +
", createdBy=" + createdBy +
", createdDate=" + createdDate +
", lastModifiedBy='" + lastModifiedBy + '\'' +
", lastModifiedDate=" + lastModifiedDate +
", authorities=" + authorities +
"}";
}
}
| [
"i.topolev.vladimir@gmail.com"
] | i.topolev.vladimir@gmail.com |
ae10f3549a50a42249e5b748fb2d7d61a42a7c54 | b295cffc1de37330b0b8d28a4d81faac01de7f22 | /CODE/android/device/customer/HeranSMARTTV/apps/TV_APK/HTvPlayer/src/com/eostek/tv/player/business/TvDBManager.java | 4e5b5d196ecbe76ce4d277bfcbd77e4ffde5eefe | [] | no_license | windxixi/test | fc2487d73a959050d8ad37d718b09a243660ec64 | 278a167c26fb608f700b81656f32e734f536c9f9 | refs/heads/master | 2023-03-16T19:59:41.941474 | 2016-07-25T04:18:41 | 2016-07-25T04:18:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,574 | java |
package com.eostek.tv.player.business;
import java.util.ArrayList;
import java.util.List;
import com.eostek.tv.player.model.AdInfo;
import com.mstar.android.tv.TvCommonManager;
import com.mstar.android.tvapi.common.vo.ProgramInfo;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
public class TvDBManager {
private final String TAG = TvDBManager.class.getSimpleName();
private static TvDBManager mDbManager;
private Context mContext;
private SQLiteDatabase mDB = null;
private TvDBManager(Context context) {
mContext = context;
mDB = new TvDBHelper(context).getWritableDatabase();
}
public static TvDBManager getInstance(Context context) {
if (mDbManager == null) {
mDbManager = new TvDBManager(context);
}
return mDbManager;
}
/**
* insert one entry to table adinfo
*
* @param AdInfo
* @return
*/
public synchronized void insertAdInfo(AdInfo info) {
ContentValues cv = new ContentValues();
cv.put(TvDBHelper.AD_COLUMN_TITLE, info.getTitle());
cv.put(TvDBHelper.AD_COLUMN_UPDATEDATE, info.getUpdate_date());
cv.put(TvDBHelper.AD_COLUMN_UPDATETIME, info.getUpdate_time());
cv.put(TvDBHelper.AD_COLUMN_PICTURE_URL, info.getPic_url());
cv.put(TvDBHelper.AD_COLUMN_DESCRITPTION, info.getDescription());
cv.put(TvDBHelper.AD_COLUMN_DISMISS_TIME, info.getDismiss_time());
cv.put(TvDBHelper.AD_COLUMN_PROGRAMME_ID, info.getProgramme_id());
cv.put(TvDBHelper.AD_COLUMN_SOURCE, info.getSource());
cv.put(TvDBHelper.AD_COLUMN_WEBVIEW_URL, info.getWebview_url());
cv.put(TvDBHelper.AD_COLUMN_POSITION_X, info.getPos_x());
cv.put(TvDBHelper.AD_COLUMN_POSITION_Y, info.getPos_y());
cv.put(TvDBHelper.AD_COLUMN_SIZE, info.getSiz());
mDB.insert(TvDBHelper.AD_TABLE_NAME, null, cv);
}
/**
* query a list of AdInfo at certain condition
*
* @param selections
* @param whereArgs
* @return
*/
public synchronized List<AdInfo> getAdInfos(String selections, String[] whereArgs) {
List<AdInfo> list = new ArrayList<AdInfo>();
Cursor cursor = mDB.query(TvDBHelper.AD_TABLE_NAME, null, selections, whereArgs, null, null, null);
if (cursor != null) {
Log.i(TAG,"cursor count : " + cursor.getCount());
while (cursor.moveToNext()) {
AdInfo info = new AdInfo();
info.setTitle(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_TITLE)));
info.setUpdate_date(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_UPDATEDATE)));
info.setUpdate_time(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_UPDATETIME)));
info.setPic_url(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_PICTURE_URL)));
info.setDescription(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_DESCRITPTION)));
info.setDismiss_time(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_DISMISS_TIME)));
info.setProgramme_id(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_PROGRAMME_ID)));
info.setSource(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_SOURCE)));
info.setWebview_url(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_WEBVIEW_URL)));
info.setPos_x(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_POSITION_X)));
info.setPos_y(cursor.getInt(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_POSITION_Y)));
info.setSiz(cursor.getString(cursor.getColumnIndex(TvDBHelper.AD_COLUMN_SIZE)));
list.add(info);
}
cursor.close();
cursor = null;
}
return list;
}
/**
* get a list of current adinfos at specified source
*
* @param source : current source
* @param info : current programme info, only used when source is DTV/ATV, set null in other case
* @return
*/
public List<AdInfo> getCurrentAdInfo(int source, ProgramInfo info){
String[] whereArgs = new String[2];
String selections = TvDBHelper.AD_COLUMN_SOURCE + "=? AND " + TvDBHelper.AD_COLUMN_PROGRAMME_ID + "=?";
switch (source) {
case TvCommonManager.INPUT_SOURCE_ATV:
if (info == null)
return null;
whereArgs[0] = "ATV";
whereArgs[1] = String.valueOf(info.number);
Log.i(TAG, "atv info number : " + info.number);
break;
case TvCommonManager.INPUT_SOURCE_DTV:
if (info == null)
return null;
whereArgs[0] = "DTV";
whereArgs[1] = String.valueOf(info.serviceId);
Log.i(TAG, "dtv info serviceId : " + info.serviceId);
break;
case TvCommonManager.INPUT_SOURCE_HDMI:
whereArgs[0] = "HDMI1";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_HDMI2:
whereArgs[0] = "HDMI2";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_HDMI3:
whereArgs[0] = "HDMI3";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_CVBS:
whereArgs[0] = "AV";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_YPBPR:
whereArgs[0] = "YPBPR";
whereArgs[1] = "0";
break;
case TvCommonManager.INPUT_SOURCE_VGA:
whereArgs[0] = "VGA";
whereArgs[1] = "0";
break;
default:
break;
}
return getAdInfos(selections, whereArgs);
}
/**
* empty data
*
* @param tablename
* @return
*/
public synchronized long emptyData(String tablename) {
return mDB.delete(tablename, null, null);
}
/**
* arbitrary sql
*
* @param sql statement
* @return
*/
public synchronized void execSQL(String sql) {
mDB.execSQL(sql);
}
}
| [
"gracie.zhou@ieostek.com"
] | gracie.zhou@ieostek.com |
396884c248ac4533a92b7de95e1d815a0764df4d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_72e68e61b02e49c520d242215ab3aa42c54da42a/SimulationDrawerTest/2_72e68e61b02e49c520d242215ab3aa42c54da42a_SimulationDrawerTest_s.java | ba146572d9cf4b2691675acf776542e3a3ac2213 | [] | 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 | 1,314 | java | package codeplanes;
import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
public class SimulationDrawerTest extends JFrame {
static class TestStrategy implements Strategy {
@Override
public void turn(final Plane plane, final World world, final Move move) {
//move.setAngle(100500);
move.setAngle(Math.random() - Math.random());
move.setFire(true);
}
}
private final BattleDrawer battleDrawer = new BattleDrawer();
SimulationDrawerTest() {
add(battleDrawer);
}
public void setBattle(final Battle battle) {
battle.addHandler(battleDrawer);
}
public static void main(final String[] args) {
final SimulationDrawerTest battleDrawerTest = new SimulationDrawerTest();
final List<Strategy> strategies = new ArrayList<>();
strategies.add( new TestStrategy() );
strategies.add( new TestStrategy() );
final Simulation battle = new Simulation(strategies, 800, 600, 4000);
battleDrawerTest.setBattle(battle);
battleDrawerTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
battleDrawerTest.setVisible(true);
battleDrawerTest.setSize(500,500);
battle.run();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
37dadeea9794db5b35c786887b7c095646a01c3d | 2b7c587542ffb625c92ee0770ae1f164f327096a | /z00-Test/ch01-05 Imports/Cat.java | cbcb4f242cd9960bcda68bc517161213018506c7 | [] | no_license | Sabyh11/Java-SE8-OCP-Exam-1Z0-809 | bf881ea0e218838820022bfe3f6ee078dc0fd6c8 | 52a7c81c840b76f4c149056c71b119b1e5c1e32b | refs/heads/master | 2022-01-20T11:10:47.983033 | 2018-07-07T17:41:00 | 2018-07-07T17:41:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | import static java.time.LocalDateTime.now;
class Cat {
public static void main(String[] args) {
System.out.println(now());
}
} | [
"mercurylink@gmail.com"
] | mercurylink@gmail.com |
d8fb0ce550189cdb55805a7d56aa744ba059833f | 56b71d38bbd6a68a15b9d0282647e360b8671114 | /src/com/esb/jinying/sap/functions/rfc/sap/document/sap_com/ZFM_INT_BW006.java | 78bebd9d029d155fe0fab8a7bcbb4137f61949d4 | [] | no_license | BaTianCheng/Gauss-private | 41c7c8fb58b384b57531f5825526272653d7fea5 | df98894dd0b9cc548ed4a354d73234920d26ab84 | refs/heads/master | 2021-06-29T13:24:04.620226 | 2017-09-17T14:52:38 | 2017-09-17T14:52:38 | 93,713,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,805 | java | /**
* ZFM_INT_BW006.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.esb.jinying.sap.functions.rfc.sap.document.sap_com;
public class ZFM_INT_BW006 implements java.io.Serializable {
private java.lang.String COMP_CODE;
private com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE;
private com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB;
public ZFM_INT_BW006() {
}
public ZFM_INT_BW006(
java.lang.String COMP_CODE,
com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE,
com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB) {
this.COMP_CODE = COMP_CODE;
this.PSTNG_DATE = PSTNG_DATE;
this.TAB = TAB;
}
/**
* Gets the COMP_CODE value for this ZFM_INT_BW006.
*
* @return COMP_CODE
*/
public java.lang.String getCOMP_CODE() {
return COMP_CODE;
}
/**
* Sets the COMP_CODE value for this ZFM_INT_BW006.
*
* @param COMP_CODE
*/
public void setCOMP_CODE(java.lang.String COMP_CODE) {
this.COMP_CODE = COMP_CODE;
}
/**
* Gets the PSTNG_DATE value for this ZFM_INT_BW006.
*
* @return PSTNG_DATE
*/
public com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date getPSTNG_DATE() {
return PSTNG_DATE;
}
/**
* Sets the PSTNG_DATE value for this ZFM_INT_BW006.
*
* @param PSTNG_DATE
*/
public void setPSTNG_DATE(com.esb.jinying.sap.functions.rfc.sap.document.sap_com.Date PSTNG_DATE) {
this.PSTNG_DATE = PSTNG_DATE;
}
/**
* Gets the TAB value for this ZFM_INT_BW006.
*
* @return TAB
*/
public com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] getTAB() {
return TAB;
}
/**
* Sets the TAB value for this ZFM_INT_BW006.
*
* @param TAB
*/
public void setTAB(com.esb.jinying.sap.functions.rfc.sap.document.sap_com._BIC_AZZCSSJ00[] TAB) {
this.TAB = TAB;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ZFM_INT_BW006)) return false;
ZFM_INT_BW006 other = (ZFM_INT_BW006) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.COMP_CODE==null && other.getCOMP_CODE()==null) ||
(this.COMP_CODE!=null &&
this.COMP_CODE.equals(other.getCOMP_CODE()))) &&
((this.PSTNG_DATE==null && other.getPSTNG_DATE()==null) ||
(this.PSTNG_DATE!=null &&
this.PSTNG_DATE.equals(other.getPSTNG_DATE()))) &&
((this.TAB==null && other.getTAB()==null) ||
(this.TAB!=null &&
java.util.Arrays.equals(this.TAB, other.getTAB())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getCOMP_CODE() != null) {
_hashCode += getCOMP_CODE().hashCode();
}
if (getPSTNG_DATE() != null) {
_hashCode += getPSTNG_DATE().hashCode();
}
if (getTAB() != null) {
for (int i=0;
i<java.lang.reflect.Array.getLength(getTAB());
i++) {
java.lang.Object obj = java.lang.reflect.Array.get(getTAB(), i);
if (obj != null &&
!obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ZFM_INT_BW006.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", ">ZFM_INT_BW006"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("COMP_CODE");
elemField.setXmlName(new javax.xml.namespace.QName("", "COMP_CODE"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("PSTNG_DATE");
elemField.setXmlName(new javax.xml.namespace.QName("", "PSTNG_DATE"));
elemField.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", "date"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("TAB");
elemField.setXmlName(new javax.xml.namespace.QName("", "TAB"));
elemField.setXmlType(new javax.xml.namespace.QName("urn:sap-com:document:sap:rfc:functions", "_-BIC_-AZZCSSJ00"));
elemField.setNillable(false);
elemField.setItemQName(new javax.xml.namespace.QName("", "item"));
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);
}
}
| [
"cheng_wei_njut@163.com"
] | cheng_wei_njut@163.com |
2b6a7f9c23bfac2b11f9fe84ba8b7d26c4d7916f | e23130c3b4be8a537723c8b9dd10fa9cc53b6268 | /app/src/main/java/com/smartbus/heze/fileapprove/module/DepartBudgetWillCheckTypeContract.java | a1dddb42f94dab2c17b581b961c9fe79df526438 | [] | no_license | huysyyrps/joffice_heze | cf2ad006b99a5ba6c9ec471d6f3d1ef7df88c9d5 | 170f4a85b554eca5cbbdabacd570b803f73faf42 | refs/heads/master | 2021-02-20T18:26:00.267972 | 2020-06-18T03:45:03 | 2020-06-18T03:45:03 | 245,343,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 678 | java | package com.smartbus.heze.fileapprove.module;
import com.smartbus.heze.http.base.BaseDSixView;
import com.smartbus.heze.http.base.BasePresenter;
import com.smartbus.heze.oaflow.bean.CheckType;
/**
* Created by Administrator on 2019/4/11.
*/
public interface DepartBudgetWillCheckTypeContract {
interface View extends BaseDSixView<presenter> {
//事故借款修改状态
void setDepartBudgetWillCheckType(CheckType s);
void setDepartBudgetWillCheckTypeMessage(String s);
}
interface presenter extends BasePresenter {
void getDepartBudgetWillCheckType(String runId, String vocationId, String destName, String mycomments);
}
}
| [
"914036951@qq.com"
] | 914036951@qq.com |
26dffb817164063691eb17100f1842627f1b9e42 | b7bc39c604f7b83a7d7f0d750240fe86d8df7a5c | /java-basic/src/main/java/ch29/i2/X1Car.java | 3a6edc92e59298577ca4c86ab44fe76edc29debb | [] | no_license | ppappikko/bitcamp-java-2018-12 | e79e023a00c579519ae67ba9f997b615fb539e5c | bd2a0b87c20a716d2b1e8cafc2a9cd54f683a37f | refs/heads/master | 2021-08-06T17:31:37.187323 | 2019-07-19T04:55:07 | 2019-07-19T04:55:07 | 163,650,729 | 0 | 0 | null | 2020-04-30T16:14:59 | 2018-12-31T08:01:24 | Java | UTF-8 | Java | false | false | 1,394 | java | package ch29.i2;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ch29.i.BlackBox;
@Component
public class X1Car {
private String maker;
private String model;
private int cc;
private int valve;
private boolean auto;
private Date createdDate;
@Autowired private BlackBox blackBox;
public X1Car() {
System.out.println("Car()");
}
@Override
public String toString() {
return "Car [maker=" + maker + ", model=" + model + ", cc=" + cc + ", valve=" + valve
+ ", auto=" + auto + ", createdDate=" + createdDate + ", blackBox=" + blackBox + "]";
}
public String getMaker() {
return maker;
}
public void setMaker(String maker) {
this.maker = maker;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public int getCc() {
return cc;
}
public void setCc(int cc) {
this.cc = cc;
}
public int getValve() {
return valve;
}
public void setValve(int valve) {
this.valve = valve;
}
public boolean isAuto() {
return auto;
}
public void setAuto(boolean auto) {
this.auto = auto;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
}
| [
"sanghyun.dev@gmail.com"
] | sanghyun.dev@gmail.com |
41aff997ebb9d9d30136df84d62b4e2cc6c14e3d | 3b2d7941687c8a7ead6ef5b400d93d514d56330a | /src/main/java/eu/mrndesign/matned/rpggame/core/game/IHero.java | 48c31e27d7e05e61f8568fbe2878ca6efe6bc2b4 | [] | no_license | matned666/rpg-game | 3dc310138ba8dea0e41f41853ef48c007e67a168 | e67b74879ccbab1c177c7d3b6d8fd4fff365f05c | refs/heads/master | 2023-06-19T11:02:45.417191 | 2021-07-15T04:01:08 | 2021-07-15T04:01:08 | 385,055,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,882 | java | package eu.mrndesign.matned.rpggame.core.game;
import eu.mrndesign.matned.rpggame.core.IObserver;
import eu.mrndesign.matned.rpggame.core.data.items.ICreature;
import eu.mrndesign.matned.rpggame.core.data.items.IInventory;
import java.util.List;
public interface IHero {
List<IInventory> getInventoryInBackpack();
ICreature get();
int getX();
int getY();
int getPrevX();
int getPrevY();
void setX(int val);
void setY(int val);
void setPrevX(int val);
void setPrevY(int val);
void attackAction(ICreature creature);
void moveEast();
void moveWest();
void moveNorth();
void moveSouth();
void talk(ICreature creature);
void runAway();
void pickUpItems(List<IInventory> items);
void barter();
void putHelmet(IInventory inventory);
void removeHelmet();
IInventory getHelmet();
void putArmor(IInventory inventory);
void removeArmor();
IInventory getArmor();
void putShoes(IInventory inventory);
void removeShoes();
IInventory getShoes();
void putGloves(IInventory inventory);
void removeGloves();
IInventory getGloves();
void putBelt(IInventory inventory);
void removeBelt();
IInventory getBelt();
void putPrimaryMeleeWeapon(IInventory inventory);
void removePrimaryMeleeWeapon();
IInventory getPrimaryMeleeWeapon();
void putSecondaryMeleeWeapon(IInventory inventory);
void removeSecondaryMeleeWeapon();
IInventory getSecondaryMeleeWeapon();
void putRangedWeapon(IInventory inventory);
void removeRangedWeapon();
IInventory getRangedWeapon();
void putAmulet(IInventory inventory);
void removeAmulet();
IInventory getAmulet();
void putItemOnSlot1(IInventory item);
void putItemOnSlot2(IInventory item);
void useItem(IInventory item);
void dropItem(IInventory item);
}
| [
"mat.niedbal@yahoo.com"
] | mat.niedbal@yahoo.com |
830c8a082b184c853640dd50bc3bd399ac8aa2ae | 4f9e893cedd8f25557239f939edee6bcb1246715 | /jinghua/dmm_xg/src/main/java/cn/gilight/dmm/xg/dao/ChangeBadDao.java | 4d6f8beeae809d6bde2163bb954d237e8a942163 | [] | no_license | yangtie34/projects | cc9ba22c1fd235dadfe18509bc6951e21e9d3be4 | 5a3a86116e385db1086f8f6e9eb07198432fec27 | refs/heads/master | 2020-06-29T11:04:26.615952 | 2017-07-25T03:28:15 | 2017-07-25T03:28:15 | 74,436,105 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 140 | java | package cn.gilight.dmm.xg.dao;
/**
*
*
* @author xuebl
* @date 2016年5月10日 下午5:57:24
*/
public interface ChangeBadDao {
} | [
"yangtie34@163.com"
] | yangtie34@163.com |
6306f96766d6e9cd854367388ffada85524f4e2d | 0e81247e404755acc33205836a15aaa83a589ce5 | /kc_project3.1_GitHub/src/main/java/org/kuali/kra/budget/printing/print/BudgetCumulativePrint.java | c02ad41db529b8319eeea2370c665f596c8c0ad1 | [] | no_license | ajeeshg/KC3Remote | e2d88bb8efe6384083a6b3978a405b51e998f361 | 941646814a7a11237ce4ed1f844941182e357ec9 | refs/heads/master | 2016-09-10T20:07:05.685013 | 2012-07-17T15:52:59 | 2012-07-17T15:52:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,855 | java | /*
* Copyright 2005-2010 The Kuali Foundation
*
* Licensed under the Educational Community 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.opensource.org/licenses/ecl1.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.
*/
package org.kuali.kra.budget.printing.print;
import java.util.ArrayList;
import java.util.List;
import javax.xml.transform.Source;
import org.kuali.kra.bo.KraPersistableBusinessObjectBase;
import org.kuali.kra.budget.printing.BudgetPrintType;
import org.kuali.kra.document.ResearchDocumentBase;
import org.kuali.kra.printing.print.AbstractPrint;
import org.kuali.kra.printing.util.PrintingUtils;
/**
* This class provides the implementation for printing Budget Cumulative Report.
* It generates XML that conforms with Summary Report XSD, fetches XSL
* style-sheets applicable to this XML, returns XML and XSL for any consumer
* that would use this XML and XSls for any purpose like report generation, PDF
* streaming etc.
*
*/
public class BudgetCumulativePrint extends AbstractPrint {
/**
* This method fetches the XSL style-sheets required for transforming the
* generated XML into PDF.
*
* @return {@link ArrayList}} of {@link Source} XSLs
*/
public List<Source> getXSLTemplates() {
ArrayList<Source> sourceList = PrintingUtils
.getXSLTforReport(BudgetPrintType.BUDGET_CUMULATIVE_REPORT
.getBudgetPrintType());
return sourceList;
}
}
| [
"naira@campusad.msu.edu"
] | naira@campusad.msu.edu |
81c0038a89f9e6f1bca3769f2d12f604adc9ab3e | 038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad | /schemaOrgDomaConv/src/org/kyojo/schemaOrg/m3n3/doma/healthLifesci/clazz/MuscleConverter.java | b695c7eb0826307bb00212ffbada470224066da9 | [
"Apache-2.0"
] | permissive | nagaikenshin/schemaOrg | 3dec1626781913930da5585884e3484e0b525aea | 4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8 | refs/heads/master | 2021-06-25T04:52:49.995840 | 2019-05-12T06:22:37 | 2019-05-12T06:22:37 | 134,319,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | package org.kyojo.schemaorg.m3n3.doma.healthLifesci.clazz;
import org.seasar.doma.ExternalDomain;
import org.seasar.doma.jdbc.domain.DomainConverter;
import org.kyojo.schemaorg.m3n3.healthLifesci.impl.MUSCLE;
import org.kyojo.schemaorg.m3n3.healthLifesci.Clazz.Muscle;
@ExternalDomain
public class MuscleConverter implements DomainConverter<Muscle, String> {
@Override
public String fromDomainToValue(Muscle domain) {
return domain.getNativeValue();
}
@Override
public Muscle fromValueToDomain(String value) {
return new MUSCLE(value);
}
}
| [
"nagai@nagaikenshin.com"
] | nagai@nagaikenshin.com |
4a263965fa9625996281d66f004e5b88cf15bf19 | ab8d10f02716519aadd66ecef4d0c799e15aa517 | /src/main/java/jxl/read/biff/DefaultColumnWidthRecord.java | 43081fba4b7eadd0188f9568850614128a347fc4 | [] | no_license | caiqiqi/EngineerMode | cc767ddcde7ccaf0ef15ec7ef8837a70a671b183 | 09a87a94ceb0d38b97d3fbe0e03086e9ee53a0f3 | refs/heads/master | 2021-08-12T07:45:06.927619 | 2017-11-14T14:54:58 | 2017-11-14T14:54:58 | 110,684,973 | 0 | 0 | null | 2017-11-14T12:02:58 | 2017-11-14T12:02:58 | null | UTF-8 | Java | false | false | 392 | java | package jxl.read.biff;
import jxl.biff.IntegerHelper;
import jxl.biff.RecordData;
class DefaultColumnWidthRecord extends RecordData {
private int width;
public DefaultColumnWidthRecord(Record t) {
super(t);
byte[] data = t.getData();
this.width = IntegerHelper.getInt(data[0], data[1]);
}
public int getWidth() {
return this.width;
}
}
| [
"elliot.alderson@ecorp.com"
] | elliot.alderson@ecorp.com |
362a4be6f18c8c370a88b811e20a05f0f1169c73 | 48116c8d80cb92da584a571595f223d34f2173cf | /src/main/java/first/sample/com/web/rest/errors/FieldErrorVM.java | 941c63dcb92102d24eb6a94185b2625b26f12bcd | [] | no_license | abdou-93/jhipsterSampleApplication | 3ad5578bafcf6ccee32271c14349901fe693936c | dbdadf720207b4b15a62e59a9aa34275ce045b4c | refs/heads/master | 2021-07-18T05:11:34.017882 | 2017-10-23T11:38:28 | 2017-10-23T11:38:28 | 107,973,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 648 | java | package first.sample.com.web.rest.errors;
import java.io.Serializable;
public class FieldErrorVM implements Serializable {
private static final long serialVersionUID = 1L;
private final String objectName;
private final String field;
private final String message;
public FieldErrorVM(String dto, String field, String message) {
this.objectName = dto;
this.field = field;
this.message = message;
}
public String getObjectName() {
return objectName;
}
public String getField() {
return field;
}
public String getMessage() {
return message;
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.