blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0dea684f9dca828f5afb1d7e396f72de5b9a9f07 | e6786abd50e3be8f4c5c9c958f828dbd6b3217a8 | /aek-assets-web-api/src/main/java/com/aek/ebey/assets/web/report/AssetsImportUtil.java | 9904954e95d2725601566ba605f1d245146688a2 | [
"Apache-2.0"
] | permissive | honghuixixi/aek-assets-service | fedef8b2ba7b656dedb35afeccf2b0180011335d | 1281e320f934159989f28a33d362f8f633f139a3 | refs/heads/master | 2020-03-21T06:48:55.864602 | 2018-06-22T02:13:39 | 2018-06-22T02:13:39 | 138,243,645 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,952 | java | package com.aek.ebey.assets.web.report;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import com.aek.common.core.util.DateUtil;
import com.aek.ebey.assets.core.util.CommonUtils;
import com.aek.ebey.assets.core.util.SpringContextUtil;
import com.aek.ebey.assets.model.CodeInfo;
import com.aek.ebey.assets.service.CodeInfoService;
public class AssetsImportUtil {
public static String setFieldValue(Field field, Object obj, Object val) throws Exception{
field.setAccessible(true);
ExcelColumn annotation = field.getDeclaredAnnotation(ExcelColumn.class);
if(annotation!=null){
String[] enums = annotation.enums();
if(enums!=null&&enums.length>0){
if(val!=null&&StringUtils.isNotBlank(val.toString())){
Integer value=null;
for (int i = 0; i < enums.length; i+=2) {
if(enums[i].equals(val)){
value = Integer.valueOf(enums[++i]);
break;
}
}
if(value==null){
return annotation.title()+":只能选择给定的数据.";
}
val = value;
}
}
String baseDataType = annotation.baseDataType();
if(StringUtils.isNotBlank(baseDataType)){
if(val!=null&&StringUtils.isNotBlank(val.toString())){
field.set(obj, val);
CodeInfoService bean = SpringContextUtil.getBean(CodeInfoService.class);
List<CodeInfo> codeList = bean.getCodeList(baseDataType);
Map<String, String> map = new HashMap<String, String>();
codeList.stream().forEach(e->{
map.put(e.getCodeText(), e.getCodeValue());
});
if(map.get(val)==null){
return annotation.title()+":只能选择给定的数据.";
}
Integer value = Integer.valueOf(map.get(val));
if(StringUtils.isNotBlank(annotation.relField())){
Field relField = obj.getClass().getDeclaredField(annotation.relField());
relField.setAccessible(true);
relField.set(obj, value);
}
}
}
if(annotation.required()){
if(val==null){
return annotation.title()+":不能为空.";
}else if(val instanceof String){
if(StringUtils.isBlank(val.toString())){
return annotation.title()+":不能为空.";
}
}
}
if(StringUtils.isNotBlank(annotation.regex()) && field.getType()==String.class){
if(val!=null&&StringUtils.isNotBlank(val.toString())){
Pattern pattern = Pattern.compile(annotation.regex());
Matcher matcher = pattern.matcher(val.toString());
boolean matches = matcher.matches();
field.set(obj, val);
if(!matches){
return annotation.title()+":"+annotation.msg();
}
}
}
Type type = field.getGenericType();
if(type==Date.class){
if(val==null){
return null;
}else if(val instanceof String){
if(StringUtils.isBlank(val.toString())){
return null;
}
}
}
if(annotation.relFieldType()==Date.class&&StringUtils.isNotBlank(annotation.relField())){
try {
if(val instanceof Date){
val=DateUtil.TH_DATE_FORMAT.get().format(val);
}
if(val!=null&&StringUtils.isNotBlank(val.toString())){
field.set(obj, val);
Field relField = obj.getClass().getDeclaredField(annotation.relField());
relField.setAccessible(true);
Date date=null;
date = DateUtil.TH_DATE_FORMAT.get().parse(val.toString());
relField.set(obj, date);
}
} catch (ParseException e) {
return annotation.title()+":日期格式错误.";
}
}
if(annotation.relFieldType()==Long.class&&StringUtils.isNotBlank(annotation.relField())){
try {
if(val instanceof Long && val!=null){
field.set(obj, val.toString());
if(((Long)val)<0){
return annotation.title()+":不能小于零.";
}
Field relField = obj.getClass().getDeclaredField(annotation.relField());
relField.setAccessible(true);
relField.set(obj, Long.valueOf(CommonUtils.fromY2X(val.toString())));
}else if(val instanceof String && StringUtils.isNotBlank(val.toString())){
field.set(obj, val);
if(Double.valueOf(val.toString())<0){
return annotation.title()+":不能小于零.";
}
Field relField = obj.getClass().getDeclaredField(annotation.relField());
relField.setAccessible(true);
relField.set(obj, Long.valueOf(CommonUtils.fromY2X(val.toString())));
}
} catch (Exception e) {
return annotation.title()+":格式错误.";
}
}
if(annotation.maxLength()!=0 && val!=null && field.getType()==String.class){
field.set(obj, val);
String s = val.toString().trim();
if(StringUtils.isNotBlank(s)&&s.length()>annotation.maxLength()){
return annotation.title()+":不能多于"+annotation.maxLength()+"个字符.";
}
}
field.set(obj, val);
}
return null;
}
}
| [
"honghui@aek56.com"
] | honghui@aek56.com |
a0009cd939df16a34841715dec4ab7d6432a6349 | 677197bbd8a9826558255b8ec6235c1e16dd280a | /src/org/apache/commons/httpclient/auth/AuthState.java | ce86db8355f3d45befdec968e66622157e13f954 | [] | no_license | xiaolongyuan/QingTingCheat | 19fcdd821650126b9a4450fcaebc747259f41335 | 989c964665a95f512964f3fafb3459bec7e4125a | refs/heads/master | 2020-12-26T02:31:51.506606 | 2015-11-11T08:12:39 | 2015-11-11T08:12:39 | 45,967,303 | 0 | 1 | null | 2015-11-11T07:47:59 | 2015-11-11T07:47:59 | null | UTF-8 | Java | false | false | 2,637 | java | package org.apache.commons.httpclient.auth;
public class AuthState
{
public static final String PREEMPTIVE_AUTH_SCHEME = "basic";
private boolean authAttempted = false;
private boolean authRequested = false;
private AuthScheme authScheme = null;
private boolean preemptive = false;
public AuthScheme getAuthScheme()
{
return this.authScheme;
}
public String getRealm()
{
if (this.authScheme != null)
return this.authScheme.getRealm();
return null;
}
public void invalidate()
{
this.authScheme = null;
this.authRequested = false;
this.authAttempted = false;
this.preemptive = false;
}
public boolean isAuthAttempted()
{
return this.authAttempted;
}
public boolean isAuthRequested()
{
return this.authRequested;
}
public boolean isPreemptive()
{
return this.preemptive;
}
public void setAuthAttempted(boolean paramBoolean)
{
this.authAttempted = paramBoolean;
}
public void setAuthRequested(boolean paramBoolean)
{
this.authRequested = paramBoolean;
}
public void setAuthScheme(AuthScheme paramAuthScheme)
{
if (paramAuthScheme == null)
{
invalidate();
return;
}
if ((this.preemptive) && (!this.authScheme.getClass().isInstance(paramAuthScheme)))
{
this.preemptive = false;
this.authAttempted = false;
}
this.authScheme = paramAuthScheme;
}
public void setPreemptive()
{
if (!this.preemptive)
{
if (this.authScheme != null)
throw new IllegalStateException("Authentication state already initialized");
this.authScheme = AuthPolicy.getAuthScheme("basic");
this.preemptive = true;
}
}
public String toString()
{
StringBuffer localStringBuffer = new StringBuffer();
localStringBuffer.append("Auth state: auth requested [");
localStringBuffer.append(this.authRequested);
localStringBuffer.append("]; auth attempted [");
localStringBuffer.append(this.authAttempted);
if (this.authScheme != null)
{
localStringBuffer.append("]; auth scheme [");
localStringBuffer.append(this.authScheme.getSchemeName());
localStringBuffer.append("]; realm [");
localStringBuffer.append(this.authScheme.getRealm());
}
localStringBuffer.append("] preemptive [");
localStringBuffer.append(this.preemptive);
localStringBuffer.append("]");
return localStringBuffer.toString();
}
}
/* Location: /Users/zhangxun-xy/Downloads/qingting2/classes_dex2jar.jar
* Qualified Name: org.apache.commons.httpclient.auth.AuthState
* JD-Core Version: 0.6.2
*/ | [
"cnzx219@qq.com"
] | cnzx219@qq.com |
232dc482e27364976789493bdf01d5b3e5cc557e | 07bd89d994da04a94c84db8997a67ae118af7830 | /LightingSalesSystem/SalesSystemClient/src/ui/commodityUi/FuzzySearchUiController.java | 54361c6d4305bf115d7b91c6cdf95cb5d885d495 | [] | no_license | pilibb0712/myHomework | 61e48163972b0ca0c42c736636c46b07492c40da | 5d013e35ee930f730418cad0a9af4cc3bf9ba0a2 | refs/heads/master | 2023-08-24T09:41:17.561232 | 2019-11-30T05:18:26 | 2019-11-30T05:18:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,483 | java | package ui.commodityUi;
import java.util.ArrayList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import ui.uiAssistants.Fonts;
import vo.GoodsVO;
public class FuzzySearchUiController {
@FXML private VBox relatedGoodsPane;
private Stage currentStage;
public void setStage(Stage stage){
currentStage=stage;
}
public void initFuzzySearchUi(ArrayList<GoodsVO> relatedGoods){
for(int i=0;i<=relatedGoods.size()-1;i++){
GoodsVO Goods=relatedGoods.get(i);
String goodsID=Goods.getNumber();
String goodsName=Goods.getName();
String goodsType=Goods.getType();
String goodsInforLabel=goodsID+" "+goodsName+" "+goodsType;
Button theGoodsBu=new Button();
theGoodsBu.setText(goodsInforLabel);
theGoodsBu.setFont(Fonts.BUTTON_FONT);
theGoodsBu.getStyleClass().add("usercase-buttons");
theGoodsBu.setOnAction((ActionEvent e)->{
initGoodsInforUi(goodsID);
});
relatedGoodsPane.getChildren().add(theGoodsBu);
}
}
private void initGoodsInforUi(String ID){
GoodsInforUiStarter starter=new GoodsInforUiStarter();
starter.initGoodsInforUi(currentStage, ID);
}
@FXML protected void returnFromFuzzySearch(){
backToGoodsInforManaUi();
}
private void backToGoodsInforManaUi(){
GoodsInforManagementUiStarter starter=new GoodsInforManagementUiStarter();
starter.initGoodsInforManagementUi(currentStage);
}
}
| [
"1292155474@qq.com"
] | 1292155474@qq.com |
2875fb60d1be569c98ae1f3b49ce3fb67f6788b7 | 1cc9a863686c2fe4c5c1d4417b334000879710ff | /src/main/java/thoth/insns/LoadConstantInsn.java | 186994b555d6a58f93b66512bb67ec4a11160803 | [
"MIT"
] | permissive | jglrxavpok/Thoth | 953e3d94eb29732f6f751a4ff260e88ed88b0832 | f2cd9d194b71c57556624cb4c1fb062814d97a47 | refs/heads/master | 2021-01-10T09:09:25.622213 | 2015-08-19T19:48:39 | 2015-08-19T19:48:39 | 36,116,481 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | package thoth.insns;
import thoth.interpreter.InterpreterState;
import thoth.interpreter.ThothInterpreter;
import thoth.lang.ThothValue;
public class LoadConstantInsn extends ThothInstruction {
private final String val;
public LoadConstantInsn(String s) {
super(Type.VARIABLE);
this.val = s;
}
@Override
public String execute(ThothValue[] params, InterpreterState state, ThothInterpreter interpreter) {
state.push(new ThothValue(ThothValue.Types.TEXT, val));
return "";
}
@Override
public String toString() {
return "LDC "+val;
}
public String getConstant() {
return val;
}
}
| [
"jglrxavpok@gmail.com"
] | jglrxavpok@gmail.com |
334c203a5f160fac04c9d4753c0379f310a76e74 | d5d3ff3359c234c010ae84ff40755394b209724e | /Clients/RCP/Adv/plugins/gov.pnnl.cat.imageflow/src/gov/pnnl/cat/imageflow/model/ImageContainer.java | ea2b2137d867531a200284b645a59322ace62a18 | [] | no_license | purohitsumit/velo | 59f58f60f926d22af270e14c6362b26d9a3b3d59 | bd5ee6b395b2f48e1d8db613d92f567c55f9e736 | refs/heads/master | 2020-05-03T05:36:07.610106 | 2018-10-31T22:14:43 | 2018-10-31T22:14:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,612 | java | package gov.pnnl.cat.imageflow.model;
import gov.pnnl.cat.core.resources.IFolder;
public class ImageContainer {
private IFolder imageFolder;
private boolean imagesOnly;
public boolean isImagesOnly() {
return imagesOnly;
}
public void setImagesOnly(boolean imagesOnly) {
this.imagesOnly = imagesOnly;
}
public boolean isIncludeAllSubfolders() {
return includeAllSubfolders;
}
public void setIncludeAllSubfolders(boolean includeAllSubfolders) {
this.includeAllSubfolders = includeAllSubfolders;
}
private boolean includeAllSubfolders;
public ImageContainer(IFolder imageFolder) {
this(imageFolder, false, false);
}
public ImageContainer(IFolder imageFolder, boolean imagesOnly, boolean includeAllSubfolders) {
super();
this.imageFolder = imageFolder;
this.imagesOnly = imagesOnly;
this.includeAllSubfolders = includeAllSubfolders;
}
public void setImageFolder(IFolder imageFolder) {
this.imageFolder = imageFolder;
}
public IFolder getImageFolder() {
return imageFolder;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if(obj != null && obj.getClass().equals(ImageContainer.class)){
ImageContainer compare = (ImageContainer)obj;
return compare.imagesOnly == this.imagesOnly && compare.includeAllSubfolders == this.includeAllSubfolders &&
compare.imageFolder.getPath().equals(this.imageFolder.getPath());
}
return false;
}
}
| [
"timothy.stavenger@pnnl.gov"
] | timothy.stavenger@pnnl.gov |
b5e3f196996aba78d04965e4c5a68febae590908 | 754a0fdc13c70711b33a414e48f41333a7e8052d | /app/src/main/java/com/pbph/yuguo/adapter/ChoiceAddressListSearchAdapter.java | 9f3d6c556526191a9753473564f77cf4f4c98e48 | [] | no_license | lianjf646/PbphYuGuo | b70b3315d9815af078101573066cbc215d46945c | 78e643cd1b0f142f96ce595fb0c5788b3e4bb09a | refs/heads/master | 2023-04-23T00:48:00.842462 | 2021-04-30T06:25:12 | 2021-04-30T06:25:12 | 363,044,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,237 | java | package com.pbph.yuguo.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.baidu.mapapi.search.core.PoiInfo;
import com.pbph.yuguo.R;
import java.util.List;
/**
* Created by 连嘉凡 on 2018/8/8.
*/
public class ChoiceAddressListSearchAdapter extends BaseAdapter {
private Context context;
private List<PoiInfo> poiInfos;
public ChoiceAddressListSearchAdapter(Context context) {
this.context = context;
}
public void setPoiInfos(List<PoiInfo> poiInfos) {
this.poiInfos = poiInfos;
notifyDataSetChanged();
}
@Override
public int getCount() {
return poiInfos != null ? poiInfos.size() : 0;
}
@Override
public PoiInfo getItem(int position) {
return poiInfos.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ChoiceAddressListSearchViewHolder choiceAddressListSearchViewHolder;
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout
.adapter_choice_address_search_item, null);
choiceAddressListSearchViewHolder = new ChoiceAddressListSearchViewHolder(convertView);
convertView.setTag(choiceAddressListSearchViewHolder);
} else {
choiceAddressListSearchViewHolder = (ChoiceAddressListSearchViewHolder) convertView
.getTag();
}
PoiInfo poiInfo = poiInfos.get(position);
choiceAddressListSearchViewHolder.mTvAddress.setText(poiInfo.name);
choiceAddressListSearchViewHolder.mTvAddressInfo.setText(poiInfo.address);
return convertView;
}
class ChoiceAddressListSearchViewHolder {
private TextView mTvAddress, mTvAddressInfo;
public ChoiceAddressListSearchViewHolder(View view) {
mTvAddress = view.findViewById(R.id.tv_address);
mTvAddressInfo = view.findViewById(R.id.tv_address_info);
}
}
}
| [
"1548300188@qq.com"
] | 1548300188@qq.com |
dd7950526b8338ee665de3dbfd8a09a68b02549e | 7a0acc1c2e808c7d363043546d9581d21a129693 | /remote/server/src/java/org/openqa/jetty/http/handler/MsieSslHandler.java | 92624d9d2ba056f61addeb70d7a6feac127bf349 | [
"Apache-2.0"
] | permissive | epall/selenium | 39b9759f8719a168b021b28e500c64afc5f83582 | 273260522efb84116979da2a499f64510250249b | refs/heads/master | 2022-06-25T22:15:25.493076 | 2010-03-11T00:43:02 | 2010-03-11T00:43:02 | 552,908 | 3 | 0 | Apache-2.0 | 2022-06-10T22:44:36 | 2010-03-08T19:10:45 | C | UTF-8 | Java | false | false | 2,769 | java | // ========================================================================
// $Id: MsieSslHandler.java,v 1.3 2005/08/13 00:01:26 gregwilkins Exp $
// Copyright 2003-2004 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
package org.openqa.jetty.http.handler;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.openqa.jetty.log.LogFactory;
import org.openqa.jetty.http.HttpException;
import org.openqa.jetty.http.HttpFields;
import org.openqa.jetty.http.HttpRequest;
import org.openqa.jetty.http.HttpResponse;
/**
* Handler to force MSIE SSL connections to not be persistent to
* work around MSIE5 bug.
*
* @author gregw
* @author chris haynes
*
*/
public class MsieSslHandler extends AbstractHttpHandler
{
private static Log log = LogFactory.getLog(MsieSslHandler.class);
private String userAgentSubString="MSIE 5";
/*
* @see org.openqa.jetty.http.HttpHandler#handle(java.lang.String, java.lang.String, org.openqa.jetty.http.HttpRequest, org.openqa.jetty.http.HttpResponse)
*/
public void handle(
String pathInContext,
String pathParams,
HttpRequest request,
HttpResponse response)
throws HttpException, IOException
{
String userAgent = request.getField(HttpFields.__UserAgent);
if(userAgent != null &&
userAgent.indexOf( userAgentSubString)>=0 &&
HttpRequest.__SSL_SCHEME.equalsIgnoreCase(request.getScheme()))
{
if (log.isDebugEnabled())
log.debug("Force close");
response.setField(HttpFields.__Connection, HttpFields.__Close);
request.getHttpConnection().forceClose();
}
}
/**
* @return The substring to match against the User-Agent field
*/
public String getUserAgentSubString()
{
return userAgentSubString;
}
/**
* @param string The substring to match against the User-Agent field
*/
public void setUserAgentSubString(String string)
{
userAgentSubString= string;
}
}
| [
"simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9"
] | simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9 |
38017ef06276b55b4931ed68c36c424c73f189e1 | f82f8ddbba4f6e8f8d2a7d1339966398913968bb | /Lecher/Android/Work/part3.component/ad32-01.OpenActivity/st1StartActivity/src/main/java/com/example/startactivity/MainActivity.java | 58f54f4d619e1e64c3f56514c9cfc8f9d61d2f76 | [] | no_license | gunee7/workspace | 66dd0e0151f1f1e3d316c38976fadded6da70398 | c962907b6e0859062fc05078e9c9f43e6b62dcff | refs/heads/master | 2021-05-07T15:14:04.814560 | 2018-02-20T09:07:17 | 2018-02-20T09:07:17 | 114,836,940 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,187 | java | package com.example.startactivity;
import android.content.ComponentName;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.content.Intent; // 직접 타이핑
public class MainActivity extends AppCompatActivity {
// 위젯 선언
private Button btn1;
private Button btn2;
private Button btn3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 위젯 찾기
btn1 = findViewById(R.id.btn1);
btn2 = findViewById(R.id.btn2);
btn3 = findViewById(R.id.btn3);
ButtonListener blistener = new ButtonListener();
btn1.setOnClickListener( blistener );
btn2.setOnClickListener( blistener );
btn3.setOnClickListener( blistener );
}
private class ButtonListener implements View.OnClickListener {
@Override
public void onClick(View v) {
Intent intent = null;
switch (v.getId() ) {
case R.id.btn1:
intent = new Intent( getApplicationContext(), SecondActivity.class );
intent.putExtra("val", "1");
startActivity( intent ); // 새창 띄우기
break;
case R.id.btn2:
intent = new Intent( MainActivity.this, SecondActivity.class );
intent.putExtra("val", "2");
startActivity( intent ); // 새창 띄우기
break;
case R.id.btn3:
// 실행할 패키지의 정보.
ComponentName comname = new ComponentName("com.example.startactivity"
,"com.example.startactivity.SecondActivity");
intent = new Intent();
intent.setComponent( comname );
intent.putExtra("val", "3");
startActivity( intent ); // 새창 띄우기
break;
}
}
}
}
| [
"gunee7@naver.com"
] | gunee7@naver.com |
f1a7ecaa510e5b96b2bca2731c176eb5b478d55b | 7ffe92c32c0ad5fb48c9f45e1c0d8232d19ee24d | /src/main/lib_src/ru/aisa/rgd/ws/dao/UpDao.java | 1e8e202516f47af50951a6ee34b656f4e7ccc527 | [] | no_license | spnikit/portal.work | 8e9274d6da670773d7c5500c8fad5947cfb5452d | 1507caa8ee37dcb1751bdefc56c2ee230ca2726d | refs/heads/master | 2021-01-25T09:43:34.790165 | 2017-06-09T16:07:06 | 2017-06-09T16:07:06 | 93,873,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 248 | java | package ru.aisa.rgd.ws.dao;
import ru.aisa.rgd.ws.domain.Up;
import ru.aisa.rgd.ws.exeption.ServiceException;
public interface UpDao {
Up getById(int id) throws ServiceException;
Up getByCode(int code) throws ServiceException;
}
| [
"spnikit@gmail.com"
] | spnikit@gmail.com |
d201a0431ccfd21f17bea536e044ed3d1084b05b | 86bdc52550e4c14f415f739f5703c4ffbb706677 | /hello-world-student/src/helloworld/Server.java | 0423eff6300adaa5df0de32bc837c9b2e775fbf3 | [] | no_license | niteshjain132/my-cxf-examples | cca73dbfd69d5d963ecd8f3eecd892fbc7962c07 | e1b09ea5448b1489a38244543bc96cdea784c6d7 | refs/heads/master | 2021-01-15T22:34:26.007047 | 2012-05-06T20:05:53 | 2012-05-06T20:05:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 824 | java | package helloworld;
import javax.xml.ws.Endpoint;
public class Server {
private static final String address = "http://localhost:9090/helloworld";
public static void main(String[] args)
{
// TODO: Create the HelloWorldImpl object.
// Create implementation object
//
HelloWorldImpl helloWorld = new HelloWorldImpl();
// TODO: Publish endpoint.
// Publish endpoint, using the Endpoint.publish() method with the address
// and the implementation object as parameters.
//
Endpoint.publish(address, helloWorld);
// The endpoints are now listening for requests; The main thread will
// complete, but the Bus threads will continue to process requests.
//
System.out.println("Listening for requests...");
}
}
| [
"christian.posta@gmail.com"
] | christian.posta@gmail.com |
f900d27d1e68eaafa6d1e2206b71f57026a88eaa | 2ffe0018d8d6b421e941c0e3ff9ecfaabc63165c | /fr.opensagres.nosql.ide.ui/src/fr/opensagres/nosql/ide/ui/internal/ApplicationWorkbenchWindowAdvisor.java | 6213de1fde7da9bcaa513d8c3f7217c4c97b2348 | [] | no_license | opensagres/mongodb-ide | 8b5a8f41828017d425bd88b18c5638a211aab31f | a39d31b076cf27900c263894e55a2f6b6be67fbe | refs/heads/master | 2023-06-10T14:00:41.340032 | 2014-05-13T11:26:56 | 2014-05-13T11:26:56 | 4,914,729 | 2 | 2 | null | 2014-05-13T11:26:57 | 2012-07-05T20:31:06 | Java | UTF-8 | Java | false | false | 912 | java | package fr.opensagres.nosql.ide.ui.internal;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
super(configurer);
}
public ActionBarAdvisor createActionBarAdvisor(
IActionBarConfigurer configurer) {
return new ApplicationActionBarAdvisor(configurer);
}
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(900, 700));
//configurer.setShowCoolBar(true);
//configurer.setShowStatusLine(true);
configurer.setTitle("NoSQL IDE");
}
}
| [
"angelo.zerr@gmail.com"
] | angelo.zerr@gmail.com |
ddf2de70ea1ef61b7c576511950690b70f661565 | 637817184196b8d73130958fc1fc0b27833d8d92 | /aprint-core/src/main/java/org/barrelorgandiscovery/model/type/ScaleType.java | 7dda31469e001e76263b60f5bd5116263b6a8d86 | [] | no_license | barrelorgandiscovery/aprintproject | daad59e1e52e6e8e4187f943de95b79622827c81 | ebc932c50d3116a4bbe9802910eac097151b1625 | refs/heads/master | 2023-06-28T03:11:25.779074 | 2023-05-08T12:15:27 | 2023-05-08T12:15:27 | 258,808,541 | 2 | 0 | null | 2023-05-08T09:50:33 | 2020-04-25T15:24:59 | Java | UTF-8 | Java | false | false | 1,973 | java | package org.barrelorgandiscovery.model.type;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.Serializable;
import java.util.Base64;
import java.util.Base64.Decoder;
import java.util.Base64.Encoder;
import org.barrelorgandiscovery.messages.Messages;
import org.barrelorgandiscovery.model.ModelType;
import org.barrelorgandiscovery.scale.Scale;
import org.barrelorgandiscovery.scale.io.ScaleIO;
import org.barrelorgandiscovery.tools.Base64Tools;
/**
* Scale of a specific organ Permit to parametrize a scale for a given organ or
* couple of organ
*
* @author pfreydiere
*
*/
public class ScaleType implements ModelType, Serializable {
private Scale scale;
private JavaType inner = new JavaType(Scale.class);
public ScaleType(String serializedForm) throws Exception {
// read the Scale
scale = ScaleIO.readGamme(new ByteArrayInputStream(Base64Tools.decode(serializedForm)));
}
public String serializedForm() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ScaleIO.writeGamme(scale, baos);
return new String(Base64Tools.encode(baos.toByteArray()));
}
public ScaleType(Scale scale) {
this.scale = scale;
}
public boolean doesValueBelongToThisType(Object value) {
boolean b = inner.doesValueBelongToThisType(value);
if (!b)
return false;
if (value == null) {
if (scale == null)
return true;
return false;
}
// check the scale definition
Scale scaleValue = (Scale) value;
return scaleValue.equals(scale);
}
public boolean isAssignableFrom(ModelType type) {
assert type != null;
if (type.getClass() != getClass())
return false;
return ((ScaleType) type).scale.equals(scale);
}
public String getDescription() {
return "Scale of type " + scale.getName();
}
public String getName() {
return scale.getName();
}
@Override
public String getLabel() {
String key = getName();
return Messages.getString(key);
}
}
| [
"frett27@gmail.com"
] | frett27@gmail.com |
53bfc30db9cd2de55cd2ab23da52179cf1c90dd9 | 758a33f1ecc65efdd114436ea187d02f0c15734d | /Practica11/src/visitor/Visitor.java | e20940b828530a53c911df39f3e590627f6fa457 | [] | no_license | cafeteru/DLP | afb7db2682ba999e26adbc924137eb7bc925369c | 2232dafbe12747a1bfa26509e0ac33a371464690 | refs/heads/master | 2021-12-15T02:01:33.024507 | 2017-07-14T16:54:36 | 2017-07-14T16:54:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,112 | java | package visitor;
import ast.Programa;
import ast.definiciones.*;
import ast.expresiones.*;
import ast.sentencias.*;
import ast.tipos.CampoRegistro;
import ast.tipos.TipoArray;
import ast.tipos.TipoCaracter;
import ast.tipos.TipoEntero;
import ast.tipos.TipoError;
import ast.tipos.TipoFuncion;
import ast.tipos.TipoReal;
import ast.tipos.TipoRegistro;
import ast.tipos.TipoVoid;
public interface Visitor {
public Object visit(Programa programa, Object o);
public Object visit(DefVariable defVariable, Object o);
public Object visit(DefFuncion defFuncion, Object o);
public Object visit(AccesoArray accesoArray, Object o);
public Object visit(AccesoCampo accesoCampo, Object o);
public Object visit(Aritmetica aritmetica, Object o);
public Object visit(Cast cast, Object o);
public Object visit(Comparacion comparacion, Object o);
public Object visit(LiteralCaracter literalCaracter, Object o);
public Object visit(LiteralEntero literalEntero, Object o);
public Object visit(LiteralReal literalReal, Object o);
public Object visit(Logica logica, Object o);
public Object visit(MenosUnario menosUnario, Object o);
public Object visit(Negacion negacion, Object o);
public Object visit(Variable variable, Object o);
public Object visit(Asignacion asignacion, Object o);
public Object visit(Escritura escritura, Object o);
public Object visit(Invocacion invocacion, Object o);
public Object visit(Lectura lectura, Object o);
public Object visit(Return return1, Object o);
public Object visit(SentenciaIf if1, Object o);
public Object visit(SentenciaWhile sentenciaWhile, Object o);
public Object visit(CampoRegistro campoRegistro, Object o);
public Object visit(TipoArray tipoArray, Object o);
public Object visit(TipoCaracter caracter, Object o);
public Object visit(TipoEntero tipoEntero, Object o);
public Object visit(TipoError error, Object o);
public Object visit(TipoFuncion funcion, Object o);
public Object visit(TipoReal real, Object o);
public Object visit(TipoRegistro registro, Object o);
public Object visit(TipoVoid tipoVoid, Object o);
}
| [
"ivangonzalezmahagamage@gmail.com"
] | ivangonzalezmahagamage@gmail.com |
f483013c9bfed9cff26d8b1d4acf1f5c046ec6a5 | de866e2f7f9bd3facc35af3d59cf977b459dd3c0 | /impl-pcollections/src/main/java/nl/gohla/graph/persistent/internal/pcollections/hash/PCHashIntMap.java | 0347f6dc2cd51217bd4ef0ce9e066254fb11cc2e | [
"MIT"
] | permissive | Gohla/persistent-graph | 42003cb70059da859ff12cea159cbea5cf97d036 | e56e25553530c2d0db29c3475d381b346ef2c7aa | refs/heads/master | 2021-01-10T16:42:48.444291 | 2016-02-05T12:34:36 | 2016-02-05T12:34:36 | 51,088,912 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,776 | java | package nl.gohla.graph.persistent.internal.pcollections.hash;
import java.util.Map.Entry;
import java.util.Set;
import org.pcollections.HashPMap;
import org.pcollections.HashTreePMap;
import nl.gohla.graph.persistent.IIntMap;
public class PCHashIntMap<T> implements IIntMap<T> {
public final HashPMap<Integer, T> map;
public PCHashIntMap() {
this(HashTreePMap.<Integer, T>empty());
}
public PCHashIntMap(HashPMap<Integer, T> map) {
this.map = map;
}
@Override public boolean isEmpty() {
return map.isEmpty();
}
@Override public boolean contains(int key) {
return map.containsKey(key);
}
@Override public T get(int key) {
return map.get(key);
}
@Override public Set<Integer> keys() {
return map.keySet();
}
@Override public Iterable<T> values() {
return map.values();
}
@Override public Iterable<Entry<Integer, T>> entries() {
return map.entrySet();
}
@Override public IIntMap<T> put(int key, T value) {
return new PCHashIntMap<T>(map.plus(key, value));
}
@Override public IIntMap<T> remove(int key) {
return new PCHashIntMap<T>(map.minus(key));
}
@Override public int hashCode() {
return map.hashCode();
}
@Override public boolean equals(Object obj) {
if(this == obj)
return true;
if(obj == null)
return false;
if(getClass() != obj.getClass())
return false;
@SuppressWarnings("unchecked") PCHashIntMap<T> other = (PCHashIntMap<T>) obj;
if(!map.equals(other.map))
return false;
return true;
}
@Override public String toString() {
return map.toString();
}
}
| [
"gabrielkonat@gmail.com"
] | gabrielkonat@gmail.com |
05ebd4bd6a285b8d8722d444ee4aaf884c1955ca | a7df92046eebf606c62842b28d86f755370649a9 | /src/main/java/com/qfedu/utils/MyBatisUtil.java | 3fb6369f94aa0b5879a8297444e38252be13eb0b | [] | no_license | hellomyheart/bank-system | 81a68c3b765ee8aa56bf85c8b0c935b8cf55654e | 36202587d07d591c5cec45a12183a65f08c385e5 | refs/heads/master | 2022-12-20T03:28:48.147463 | 2020-10-06T13:19:17 | 2020-10-06T13:19:17 | 297,951,811 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.qfedu.utils;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import java.io.Reader;
/**
* @description
* @className: MyBatisUtil
* @package: com.qfedu.utils
* @author: Stephen Shen
* @date: 2020/9/3 上午11:40
*/
public class MyBatisUtil {
private static SqlSessionFactory factory = null;
static {
try {
//1.读取配置文件
Reader reader = Resources.getResourceAsReader("mybatis.xml");
//2.创建sqlsessionFactory的对象
factory = new SqlSessionFactoryBuilder().build(reader);
} catch (Exception e) {
e.printStackTrace();
}
}
public static SqlSession getSession(){
return factory.openSession();
}
}
| [
"723809534@qq.com"
] | 723809534@qq.com |
8bff165af69c364cbfd3e5986d92f69455002d40 | 737b0fc040333ec26f50409fc16372f5c64c7df6 | /bus-health/src/main/java/org/aoju/bus/health/mac/hardware/MacSoundCard.java | 0204d89dad2e9109055c408fa0b923f272211cca | [
"MIT"
] | permissive | sfg11/bus | 1714cdc6c77f0042e3b80f32e1d9b7483c154e3e | d560ba4d3abd2e0a6c5dfda9faf7075da8e8d73e | refs/heads/master | 2022-12-13T02:26:18.533039 | 2020-08-26T02:23:34 | 2020-08-26T02:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,348 | java | /*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2020 aoju.org OSHI and other contributors. *
* *
* 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 org.aoju.bus.health.mac.hardware;
import org.aoju.bus.core.annotation.Immutable;
import org.aoju.bus.core.toolkit.FileKit;
import org.aoju.bus.health.Builder;
import org.aoju.bus.health.builtin.hardware.AbstractHardwareAbstractionLayer;
import org.aoju.bus.health.builtin.hardware.AbstractSoundCard;
import org.aoju.bus.health.builtin.hardware.SoundCard;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Sound card data obtained via AppleHDA kext
*
* @author Kimi Liu
* @version 6.0.8
* @since JDK 1.8+
*/
@Immutable
final class MacSoundCard extends AbstractSoundCard {
private static final String APPLE = "Apple Inc.";
/**
* Constructor for MacSoundCard.
*
* @param kernelVersion The version
* @param name The name
* @param codec The codec
*/
MacSoundCard(String kernelVersion, String name, String codec) {
super(kernelVersion, name, codec);
}
/**
* public method used by
* {@link AbstractHardwareAbstractionLayer} to access the
* sound cards.
*
* @return List of {@link MacSoundCard} objects.
*/
public static List<SoundCard> getSoundCards() {
List<MacSoundCard> soundCards = new ArrayList<>();
// /System/Library/Extensions/AppleHDA.kext/Contents/Info.plist
// ..... snip ....
// <dict>
// <key>com.apple.driver.AppleHDAController</key>
// <string>1.7.2a1</string>
String manufacturer = APPLE;
String kernelVersion = "AppleHDAController";
String codec = "AppleHDACodec";
boolean version = false;
String versionMarker = "<key>com.apple.driver.AppleHDAController</key>";
for (final String checkLine : FileKit.readLines("/System/Library/Extensions/AppleHDA.kext/Contents/Info.plist")) {
if (checkLine.contains(versionMarker)) {
version = true;
continue;
}
if (version) {
kernelVersion = "AppleHDAController "
+ Builder.getTextBetweenStrings(checkLine, "<string>", "</string>");
version = false;
}
}
soundCards.add(new MacSoundCard(kernelVersion, manufacturer, codec));
return Collections.unmodifiableList(soundCards);
}
}
| [
"839536@qq.com"
] | 839536@qq.com |
63c085bc7f892e16665cdc765d3ddebb629ba5ee | b683f72483c72ffb1d70250bab602beaacb458b6 | /src/main/java/ua/lviv/lgs/repository/UserRepository.java | a5f95863a142e186b5d4e887ede48e43c81ee16a | [] | no_license | Splash001/Java_Advanced_Final | a6e72771e6790cd8cc5ba4dbf4f889fb5c4a7450 | e2af31770680e484c88802efa41f74dd2939cbe5 | refs/heads/master | 2022-02-12T23:38:18.088971 | 2020-01-31T09:02:30 | 2020-01-31T09:02:30 | 233,577,181 | 0 | 1 | null | 2022-01-21T23:37:06 | 2020-01-13T11:11:13 | CSS | UTF-8 | Java | false | false | 286 | java | package ua.lviv.lgs.repository;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import ua.lviv.lgs.domain.User;
public interface UserRepository extends JpaRepository<User, Integer> {
Optional<User> findByEmail(String email);
}
| [
"Tester99037@gmail.com"
] | Tester99037@gmail.com |
bcf5b820a71d3a2233251cf6f47a3a13c5d96323 | 5b023f9d9cd5b28a94218fac1bcf8650143a7d40 | /src/main/java/com/codeborne/selenide/commands/GetSelectedOptions.java | 2651e74ff55f81af61341a4afaf2e200716fa85c | [
"MIT",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-free-unknown"
] | permissive | yorlov/selenide | 7f7d9dce5cdcefd512540bf29e94aebb2b2639e6 | ae30316e61ea39e2d37030cc0014aac5ac7d2cf9 | refs/heads/master | 2023-01-24T04:03:30.152586 | 2020-12-07T14:42:28 | 2020-12-07T15:32:51 | 319,349,614 | 0 | 0 | MIT | 2020-12-07T14:43:56 | 2020-12-07T14:43:55 | null | UTF-8 | Java | false | false | 2,039 | java | package com.codeborne.selenide.commands;
import com.codeborne.selenide.Command;
import com.codeborne.selenide.Driver;
import com.codeborne.selenide.ElementsCollection;
import com.codeborne.selenide.SelenideElement;
import com.codeborne.selenide.impl.WebElementSource;
import com.codeborne.selenide.impl.WebElementsCollection;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
@ParametersAreNonnullByDefault
public class GetSelectedOptions implements Command<ElementsCollection> {
@Override
public ElementsCollection execute(SelenideElement proxy, final WebElementSource selectElement, @Nullable Object[] args) {
return new ElementsCollection(new SelectedOptionsCollection(selectElement));
}
private static class SelectedOptionsCollection implements WebElementsCollection {
private final WebElementSource selectElement;
private SelectedOptionsCollection(WebElementSource selectElement) {
this.selectElement = selectElement;
}
@Override
@CheckReturnValue
@Nonnull
public List<WebElement> getElements() {
return select(selectElement).getAllSelectedOptions();
}
@Override
@CheckReturnValue
@Nonnull
public WebElement getElement(int index) {
return index == 0 ?
select(selectElement).getFirstSelectedOption() :
select(selectElement).getAllSelectedOptions().get(index);
}
@CheckReturnValue
@Nonnull
private Select select(WebElementSource selectElement) {
return new Select(selectElement.getWebElement());
}
@Override
@CheckReturnValue
@Nonnull
public String description() {
return selectElement.getSearchCriteria() + " selected options";
}
@Override
@CheckReturnValue
@Nonnull
public Driver driver() {
return selectElement.driver();
}
}
}
| [
"andrei.solntsev@gmail.com"
] | andrei.solntsev@gmail.com |
6254fd0a5a3ea443c3576935eeae55e342dd060c | 5ca3901b424539c2cf0d3dda52d8d7ba2ed91773 | /src_procyon/com/google/common/base/Functions$IdentityFunction.java | 68837b82e67d5b355f5a54b1e7a275e297f94231 | [] | no_license | fjh658/bindiff | c98c9c24b0d904be852182ecbf4f81926ce67fb4 | 2a31859b4638404cdc915d7ed6be19937d762743 | refs/heads/master | 2021-01-20T06:43:12.134977 | 2016-06-29T17:09:03 | 2016-06-29T17:09:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 431 | java | package com.google.common.base;
import javax.annotation.*;
enum Functions$IdentityFunction implements Function
{
INSTANCE("INSTANCE", 0);
private Functions$IdentityFunction(final String s, final int n) {
}
@Nullable
@Override
public Object apply(@Nullable final Object o) {
return o;
}
@Override
public String toString() {
return "Functions.identity()";
}
}
| [
"manouchehri@riseup.net"
] | manouchehri@riseup.net |
d5407127a5f0feb8565fb35198c40c3377351b67 | 1176e829e16058f6df671b3f9dd2aec5d4cce14b | /src/api/java/minestrapteam/extracore/network/PacketSplashEffect.java | 4a68d762069947e47a0e66410a289c91d9d4071f | [] | no_license | MinestrapTeam/Extrapolated-Dimensions | f310aa1e40c550c4668e6cefa4405f70307f8e8c | 68e1e41c1a8d42d7fd6d8e0228b4d29e0360d2bb | refs/heads/master | 2021-01-18T22:36:00.031466 | 2016-05-08T21:07:29 | 2016-05-08T21:07:29 | 13,861,600 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,253 | java | package minestrapteam.extracore.network;
import minestrapteam.extracore.ExtraCore;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.PacketBuffer;
public class PacketSplashEffect extends ECPacket
{
public double x;
public double y;
public double z;
public int color;
public boolean instant;
public PacketSplashEffect(double x, double y, double z, int color, boolean instant)
{
this.x = x;
this.y = y;
this.z = z;
this.color = color;
this.instant = instant;
}
@Override
public void write(PacketBuffer buf)
{
buf.writeDouble(this.x);
buf.writeDouble(this.y);
buf.writeDouble(this.z);
buf.writeInt(this.color);
buf.writeBoolean(this.instant);
}
@Override
public void read(PacketBuffer buf)
{
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.color = buf.readInt();
this.instant = buf.readBoolean();
}
@Override
public void handleClient(EntityPlayer player)
{
ExtraCore.proxy.playSplashEffect(ExtraCore.proxy.getClientWorld(), this.x, this.y, this.z, this.color, this.instant);
}
@Override
public void handleServer(EntityPlayerMP player)
{
this.handleClient(player);
}
}
| [
"clashsoft@hotmail.com"
] | clashsoft@hotmail.com |
add3241c172f82b0426ccf9ed5ef8de939f3edcb | a2440dbe95b034784aa940ddc0ee0faae7869e76 | /modules/lwjgl/opengl/src/generated/java/org/lwjgl/opengl/NVTransformFeedback2.java | 78fcc4ba11cf0fda8cb70dff887e3f118e4c5f3c | [
"LicenseRef-scancode-khronos",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LWJGL/lwjgl3 | 8972338303520c5880d4a705ddeef60472a3d8e5 | 67b64ad33bdeece7c09b0f533effffb278c3ecf7 | refs/heads/master | 2023-08-26T16:21:38.090410 | 2023-08-26T16:05:52 | 2023-08-26T16:05:52 | 7,296,244 | 4,835 | 1,004 | BSD-3-Clause | 2023-09-10T12:03:24 | 2012-12-23T15:40:04 | Java | UTF-8 | Java | false | false | 5,784 | java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.opengl;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* Native bindings to the <a href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_transform_feedback2.txt">NV_transform_feedback2</a> extension.
*
* <p>The NV_transform_feedback and EXT_transform_feedback extensions allow applications to capture primitives to one or more buffer objects when transformed
* by the GL. This extension provides a few additional capabilities to these extensions, making transform feedback mode more useful.</p>
*
* <p>First, it provides transform feedback objects encapsulating transform feedback-related state, allowing applications to replace the entire transform
* feedback configuration in a single bind call. Second, it provides the ability to pause and resume transform feedback operations. When transform
* feedback is paused, applications may render without transform feedback or may use transform feedback with different state and a different transform
* feedback object. When transform feedback is resumed, additional primitives are captured and appended to previously captured primitives for the object.</p>
*
* <p>Additionally, this extension provides the ability to draw primitives captured in transform feedback mode without querying the captured primitive count.
* The command DrawTransformFeedbackNV() is equivalent to {@code glDrawArrays(<mode>, 0, <count>)}, where {@code count} is the number of vertices captured
* to buffer objects during the last transform feedback capture operation on the transform feedback object used. This draw operation only provides a
* vertex count -- it does not automatically set up vertex array state or vertex buffer object bindings, which must be done separately by the application.</p>
*
* <p>Requires {@link GL15 OpenGL 1.5} and {@link NVTransformFeedback NV_transform_feedback} or {@link EXTTransformFeedback EXT_transform_feedback}.</p>
*/
public class NVTransformFeedback2 {
static { GL.initialize(); }
/** Accepted by the {@code target} parameter of BindTransformFeedbackNV. */
public static final int GL_TRANSFORM_FEEDBACK_NV = 0x8E22;
/** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */
public static final int
GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23,
GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24,
GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25;
protected NVTransformFeedback2() {
throw new UnsupportedOperationException();
}
// --- [ glBindTransformFeedbackNV ] ---
public static native void glBindTransformFeedbackNV(@NativeType("GLenum") int target, @NativeType("GLuint") int id);
// --- [ glDeleteTransformFeedbacksNV ] ---
public static native void nglDeleteTransformFeedbacksNV(int n, long ids);
public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") IntBuffer ids) {
nglDeleteTransformFeedbacksNV(ids.remaining(), memAddress(ids));
}
public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") int id) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
IntBuffer ids = stack.ints(id);
nglDeleteTransformFeedbacksNV(1, memAddress(ids));
} finally {
stack.setPointer(stackPointer);
}
}
// --- [ glGenTransformFeedbacksNV ] ---
public static native void nglGenTransformFeedbacksNV(int n, long ids);
public static void glGenTransformFeedbacksNV(@NativeType("GLuint *") IntBuffer ids) {
if (CHECKS) {
check(ids, 1);
}
nglGenTransformFeedbacksNV(ids.remaining(), memAddress(ids));
}
@NativeType("void")
public static int glGenTransformFeedbacksNV() {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
IntBuffer ids = stack.callocInt(1);
nglGenTransformFeedbacksNV(1, memAddress(ids));
return ids.get(0);
} finally {
stack.setPointer(stackPointer);
}
}
// --- [ glIsTransformFeedbackNV ] ---
@NativeType("GLboolean")
public static native boolean glIsTransformFeedbackNV(@NativeType("GLuint") int id);
// --- [ glPauseTransformFeedbackNV ] ---
public static native void glPauseTransformFeedbackNV();
// --- [ glResumeTransformFeedbackNV ] ---
public static native void glResumeTransformFeedbackNV();
// --- [ glDrawTransformFeedbackNV ] ---
public static native void glDrawTransformFeedbackNV(@NativeType("GLenum") int mode, @NativeType("GLuint") int id);
/** Array version of: {@link #glDeleteTransformFeedbacksNV DeleteTransformFeedbacksNV} */
public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") int[] ids) {
long __functionAddress = GL.getICD().glDeleteTransformFeedbacksNV;
if (CHECKS) {
check(__functionAddress);
}
callPV(ids.length, ids, __functionAddress);
}
/** Array version of: {@link #glGenTransformFeedbacksNV GenTransformFeedbacksNV} */
public static void glGenTransformFeedbacksNV(@NativeType("GLuint *") int[] ids) {
long __functionAddress = GL.getICD().glGenTransformFeedbacksNV;
if (CHECKS) {
check(__functionAddress);
check(ids, 1);
}
callPV(ids.length, ids, __functionAddress);
}
} | [
"iotsakp@gmail.com"
] | iotsakp@gmail.com |
c156d69e7870b1df39cf75dd465d395c9b247df4 | 60371d05f1c3e32fa5ebb7115bd1df145d03531a | /RxTools-library/src/main/java/com/vondear/rxtools/utils/RxUtils.java | 9f449515ac52f5eea9e7458978e3f175e9754649 | [] | no_license | androiddeveloper007/zhishang | bf50a716b368db6fb6eb1b5ab98eba5d897f7126 | ce6ae7e97d8976462998784b83b99e144524b91f | refs/heads/master | 2020-04-01T14:26:33.000264 | 2018-05-31T09:13:18 | 2018-05-31T09:13:18 | 153,294,393 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,515 | java | package com.vondear.rxtools.utils;
import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
import android.text.InputFilter;
import android.text.InputType;
import android.text.Spanned;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by vondear on 2016/1/24.
* RxTools的常用工具类
*/
public class RxUtils {
private static Context context;
/**
* 初始化工具类
*
* @param context 上下文
*/
public static void init(Context context) {
RxUtils.context = context.getApplicationContext();
RxCrashUtils.getInstance(context).init();
}
/**
* 在某种获取不到 Context 的情况下,即可以使用才方法获取 Context
* <p>
* 获取ApplicationContext
*
* @return ApplicationContext
*/
public static Context getContext() {
if (context != null) return context;
throw new NullPointerException("请先调用init()方法");
}
public static void delayToDo(final DelayListener delayListener, long delayTime) {
new Handler().postDelayed(new Runnable() {
public void run() {
//execute the task
delayListener.doSomething();
}
}, delayTime);
}
/**
* 倒计时
*
* @param textView 控件
* @param waitTime 倒计时总时长
* @param interval 倒计时的间隔时间
* @param hint 倒计时完毕时显示的文字
*/
public static void countDown(final TextView textView, long waitTime, long interval, final String hint) {
textView.setEnabled(false);
android.os.CountDownTimer timer = new android.os.CountDownTimer(waitTime, interval) {
@Override
public void onTick(long millisUntilFinished) {
textView.setText("剩下 " + (millisUntilFinished / 1000) + " S");
}
@Override
public void onFinish() {
textView.setEnabled(true);
textView.setText(hint);
}
};
timer.start();
}
//==============================================================================================延时任务封装 end
/**
* 手动计算出listView的高度,但是不再具有滚动效果
*
* @param listView
*/
public static void fixListViewHeight(ListView listView) {
// 如果没有设置数据适配器,则ListView没有子项,返回。
ListAdapter listAdapter = listView.getAdapter();
int totalHeight = 0;
if (listAdapter == null) {
return;
}
for (int index = 0, len = listAdapter.getCount(); index < len; index++) {
View listViewItem = listAdapter.getView(index, null, listView);
// 计算子项View 的宽高
listViewItem.measure(0, 0);
// 计算所有子项的高度
totalHeight += listViewItem.getMeasuredHeight();
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
// listView.getDividerHeight()获取子项间分隔符的高度
// params.height设置ListView完全显示需要的高度
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
}
/**
* 生成MD5加密32位字符串
*
* @param MStr :需要加密的字符串
* @return
*/
public static String Md5(String MStr) {
try {
final MessageDigest mDigest = MessageDigest.getInstance("MD5");
mDigest.update(MStr.getBytes());
return bytesToHexString(mDigest.digest());
} catch (NoSuchAlgorithmException e) {
return String.valueOf(MStr.hashCode());
}
}
//---------------------------------------------MD5加密-------------------------------------------
// MD5内部算法---------------不能修改!
private static String bytesToHexString(byte[] bytes) {
// http://stackoverflow.com/questions/332079
StringBuilder sb = new StringBuilder();
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(0xFF & bytes[i]);
if (hex.length() == 1) {
sb.append('0');
}
sb.append(hex);
}
return sb.toString();
}
/**
* 根据资源名称获取资源 id
* <p>
* 不提倡使用这个方法获取资源,比其直接获取ID效率慢
* <p>
* 例如
* getResources().getIdentifier("ic_launcher", "drawable", getPackageName());
*
* @param context
* @param name
* @param defType
* @return
*/
public static final int getResIdByName(Context context, String name, String defType) {
return context.getResources().getIdentifier("ic_launcher", "drawable", context.getPackageName());
}
//============================================MD5加密============================================
//----------------------------------------------------------------------------------------------延时任务封装 start
public interface DelayListener {
void doSomething();
}
private static long lastClickTime;
public static boolean isFastClick(int millisecond) {
long curClickTime = System.currentTimeMillis();
long interval = (curClickTime - lastClickTime);
if (0 < interval && interval < millisecond) {
// 超过点击间隔后再将lastClickTime重置为当前点击时间
return true;
}
lastClickTime = curClickTime;
return false;
}
/**
* Edittext 首位小数点自动加零,最多两位小数
*
* @param editText
*/
public static void setEdTwoDecimal(EditText editText) {
setEdDecimal(editText, 3);
}
public static void setEdDecimal(EditText editText, int count) {
if (count < 1) {
count = 1;
}
editText.setInputType(InputType.TYPE_NUMBER_FLAG_DECIMAL | InputType.TYPE_CLASS_NUMBER);
//设置字符过滤
final int finalCount = count;
editText.setFilters(new InputFilter[]{new InputFilter() {
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
if (source.equals(".") && dest.toString().length() == 0) {
return "0.";
}
if (dest.toString().contains(".")) {
int index = dest.toString().indexOf(".");
int mlength = dest.toString().substring(index).length();
if (mlength == finalCount) {
return "";
}
}
return null;
}
}});
}
public static void initEditNumberPrefix(final EditText edSerialNumber, final int number) {
edSerialNumber.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
String s = edSerialNumber.getText().toString();
String temp = "";
for (int i = s.length(); i < number; i++) {
s = "0" + s;
}
for (int i = 0; i < number; i++) {
temp += "0";
}
if (s.equals(temp)) {
s = temp.substring(1) + "1";
}
edSerialNumber.setText(s);
}
}
});
}
public static Handler getBackgroundHandler() {
HandlerThread thread = new HandlerThread("background");
thread.start();
Handler mBackgroundHandler = new Handler(thread.getLooper());
return mBackgroundHandler;
}
}
| [
"zhu852514500@163.com"
] | zhu852514500@163.com |
8c08147acc6aa15b74482669639b066d7e08f9db | 044fa73ee3106fe81f6414fa33dd2f8d44c8457e | /rta-api/rta-core/src/main/java/org/rta/core/dao/payment/tax/VehicleCurrentTaxDAO.java | e324a0c3fe06a3a9beac6a327ce48d249c82ef0b | [] | no_license | VinayAddank/webservices | 6ec87de5b90d28c6511294de644b7579219473ca | 882ba250a7bbe9c7112aa6e2dc1a34640731bfb8 | refs/heads/master | 2021-01-25T11:34:25.534538 | 2018-03-01T09:18:26 | 2018-03-01T09:18:26 | 123,411,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486 | java | package org.rta.core.dao.payment.tax;
import java.util.List;
import org.rta.core.dao.base.GenericDAO;
import org.rta.core.entity.payment.tax.VehicleCurrentTaxEntity;
import org.rta.core.entity.vehicle.VehicleRCEntity;
public interface VehicleCurrentTaxDAO extends GenericDAO<VehicleCurrentTaxEntity> {
public VehicleCurrentTaxEntity getEntityByVehicleRcId(long vehicleRcId);
public List<VehicleCurrentTaxEntity> getByVehicleRcEntities(List<VehicleRCEntity> vehicleRCEntities);
}
| [
"vinay.addanki540@gmail.com"
] | vinay.addanki540@gmail.com |
a2cc178d7c33a3889968ed08d83c7cfd5bc0f2cf | 25401ecdc0394dfeed79f6ab59b8339d8c1cc74a | /cardreader.provider.usb.tactivo/src/test/java/de/gematik/ti/cardreader/provider/usb/tactivo/control/TactivoCardReaderProviderTest.java | 74d781efdd80be16069ddde43639cb031d1e3a97 | [
"Apache-2.0"
] | permissive | gematik/ref-CardReaderProvider-USB-Tactivo-Android | f1f6d544358c5d93963ef889cb6281a059678b60 | e49e01f305cc3f24fe3544fbe9cdb3077cddcb6f | refs/heads/master | 2022-02-07T13:08:30.124094 | 2022-01-07T07:24:20 | 2022-01-07T07:24:20 | 214,091,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,820 | java | /*
* Copyright (c) 2020 gematik GmbH
*
* 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 de.gematik.ti.cardreader.provider.usb.tactivo.control;
import org.hamcrest.core.Is;
import org.hamcrest.core.IsNull;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
public class TactivoCardReaderProviderTest {
private static TactivoCardReaderProvider tactivoCardReaderProvider;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
tactivoCardReaderProvider = new TactivoCardReaderProvider();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Test
public void testGetCardReaderController() {
Assert.assertThat(tactivoCardReaderProvider.getCardReaderController(), IsNull.notNullValue());
}
@Test
public void testGetDescriptor() {
Assert.assertThat(tactivoCardReaderProvider.getDescriptor().getName(), Is.is("Gematik Tactivo-Provider"));
Assert.assertThat(tactivoCardReaderProvider.getDescriptor().getDescription(), Is.is("This Provider makes Tactivo Cardreader available."));
Assert.assertThat(tactivoCardReaderProvider.getDescriptor().getLicense(), Is.is("Gematik internernal use only, details tbd"));
}
}
| [
"referenzimplementierung@gematik.de"
] | referenzimplementierung@gematik.de |
eda9d2836c6036a3c472ffd326dcc898a89da524 | 2a6212e757c7b4a6a172edbb3bc372e9f6fa4c11 | /src/main/java/cn/nukkit/entity/projectile/EntityProjectile.java | b100e5d7fc6c758ee572e354bcda86b9b0f66407 | [] | no_license | RootMC/CustomNukkit | ea665dfcc66417d2ea440c4fff1d8b2a09d43c60 | a85eb4ef27ad7b9f55cd8ada7e249d91ba1e007a | refs/heads/master | 2022-11-15T08:29:09.769624 | 2020-05-11T19:36:35 | 2020-05-11T19:36:35 | 259,236,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,179 | java | package cn.nukkit.entity.projectile;
import cn.nukkit.entity.Entity;
import cn.nukkit.entity.EntityLiving;
import cn.nukkit.entity.data.LongEntityData;
import cn.nukkit.entity.item.EntityEndCrystal;
import cn.nukkit.event.entity.*;
import cn.nukkit.event.entity.EntityDamageEvent.DamageCause;
import cn.nukkit.level.MovingObjectPosition;
import cn.nukkit.level.format.FullChunk;
import cn.nukkit.math.AxisAlignedBB;
import cn.nukkit.math.NukkitMath;
import cn.nukkit.math.Vector3;
import cn.nukkit.nbt.tag.CompoundTag;
import java.util.concurrent.ThreadLocalRandom;
/**
* @author MagicDroidX
* Nukkit Project
*/
public abstract class EntityProjectile extends Entity {
public static final int DATA_SHOOTER_ID = 17;
public Entity shootingEntity;
public boolean firstTickOnGround = true;
protected double getDamage() {
return namedTag.contains("damage") ? namedTag.getDouble("damage") : getBaseDamage();
}
protected double getBaseDamage() {
return 0;
}
public boolean hadCollision = false;
public EntityProjectile(FullChunk chunk, CompoundTag nbt) {
this(chunk, nbt, null);
}
public EntityProjectile(FullChunk chunk, CompoundTag nbt, Entity shootingEntity) {
super(chunk, nbt);
this.shootingEntity = shootingEntity;
if (shootingEntity != null) {
this.setDataProperty(new LongEntityData(DATA_SHOOTER_ID, shootingEntity.getId()));
}
}
public int getResultDamage() {
return NukkitMath.ceilDouble(Math.sqrt(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ) * getDamage());
}
public boolean attack(EntityDamageEvent source) {
return source.getCause() == DamageCause.VOID && super.attack(source);
}
public void onCollideWithEntity(Entity entity) {
this.server.getPluginManager().callEvent(new ProjectileHitEvent(this, MovingObjectPosition.fromEntity(entity)));
float damage = this.getResultDamage();
EntityDamageEvent ev;
if (this.shootingEntity == null) {
ev = new EntityDamageByEntityEvent(this, entity, DamageCause.PROJECTILE, damage);
} else {
ev = new EntityDamageByChildEntityEvent(this.shootingEntity, this, entity, DamageCause.PROJECTILE, damage);
}
if (entity.attack(ev)) {
this.hadCollision = true;
if (this.fireTicks > 0) {
EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this, entity, 5);
this.server.getPluginManager().callEvent(ev);
if (!event.isCancelled()) {
entity.setOnFire(event.getDuration());
}
}
}
this.close();
}
@Override
protected void initEntity() {
super.initEntity();
this.setMaxHealth(1);
this.setHealth(1);
if (this.namedTag.contains("Age")) {
this.age = this.namedTag.getShort("Age");
}
}
@Override
public boolean canCollideWith(Entity entity) {
return (entity instanceof EntityLiving || entity instanceof EntityEndCrystal) && !this.onGround;
}
@Override
public void saveNBT() {
super.saveNBT();
this.namedTag.putShort("Age", this.age);
}
@Override
public boolean onUpdate(int currentTick) {
if (this.closed) {
return false;
}
int tickDiff = currentTick - this.lastUpdate;
if (tickDiff <= 0 && !this.justCreated) {
return true;
}
this.lastUpdate = currentTick;
boolean hasUpdate = this.entityBaseTick(tickDiff);
if (this.isAlive()) {
MovingObjectPosition movingObjectPosition = null;
if (!this.isCollided) {
if (this.isInsideOfWater()) {
this.motionY -= this.getGravity() - (this.getGravity() / 2);
} else {
this.motionY -= this.getGravity();
}
this.motionX *= 1 - this.getDrag();
this.motionZ *= 1 - this.getDrag();
}
Vector3 moveVector = new Vector3(this.x + this.motionX, this.y + this.motionY, this.z + this.motionZ);
Entity[] list = this.getLevel().getCollidingEntities(this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1, 1, 1), this);
double nearDistance = Integer.MAX_VALUE;
Entity nearEntity = null;
for (Entity entity : list) {
if (/*!entity.canCollideWith(this) || */(entity == this.shootingEntity && this.age < 5)) {
continue;
}
AxisAlignedBB axisalignedbb = entity.boundingBox.grow(0.3, 0.3, 0.3);
MovingObjectPosition ob = axisalignedbb.calculateIntercept(this, moveVector);
if (ob == null) {
continue;
}
double distance = this.distanceSquared(ob.hitVector);
if (distance < nearDistance) {
nearDistance = distance;
nearEntity = entity;
}
}
if (nearEntity != null) {
movingObjectPosition = MovingObjectPosition.fromEntity(nearEntity);
}
if (movingObjectPosition != null) {
if (movingObjectPosition.entityHit != null) {
onCollideWithEntity(movingObjectPosition.entityHit);
return true;
}
}
this.move(this.motionX, this.motionY, this.motionZ);
if (this.isCollided && !this.hadCollision) { //collide with block
this.hadCollision = true;
this.motionX = 0;
this.motionY = 0;
this.motionZ = 0;
this.server.getPluginManager().callEvent(new ProjectileHitEvent(this, MovingObjectPosition.fromBlock(this.getFloorX(), this.getFloorY(), this.getFloorZ(), -1, this)));
return false;
} else if (!this.isCollided && this.hadCollision) {
this.hadCollision = false;
}
if (!this.hadCollision || Math.abs(this.motionX) > 0.00001 || Math.abs(this.motionY) > 0.00001 || Math.abs(this.motionZ) > 0.00001) {
updateRotation();
hasUpdate = true;
}
this.updateMovement();
}
return hasUpdate;
}
public void updateRotation() {
double f = Math.sqrt((this.motionX * this.motionX) + (this.motionZ * this.motionZ));
this.yaw = Math.atan2(this.motionX, this.motionZ) * 180 / Math.PI;
this.pitch = Math.atan2(this.motionY, f) * 180 / Math.PI;
}
public void inaccurate(float modifier) {
ThreadLocalRandom rand = ThreadLocalRandom.current();
this.motionX += rand.nextGaussian() * 0.007499999832361937 * modifier;
this.motionY += rand.nextGaussian() * 0.007499999832361937 * modifier;
this.motionZ += rand.nextGaussian() * 0.007499999832361937 * modifier;
}
}
| [
"tantoan1909@gmail.com"
] | tantoan1909@gmail.com |
3707a28372d04de0cd5de5c082c15373cd019bca | 15b260ccada93e20bb696ae19b14ec62e78ed023 | /v2/src/main/java/com/alipay/api/domain/AlipayFundTransMergePrecreateModel.java | 0e0f1188d515d09fcad59792ef79aa14fe3cbdd3 | [
"Apache-2.0"
] | permissive | alipay/alipay-sdk-java-all | df461d00ead2be06d834c37ab1befa110736b5ab | 8cd1750da98ce62dbc931ed437f6101684fbb66a | refs/heads/master | 2023-08-27T03:59:06.566567 | 2023-08-22T14:54:57 | 2023-08-22T14:54:57 | 132,569,986 | 470 | 207 | Apache-2.0 | 2022-12-25T07:37:40 | 2018-05-08T07:19:22 | Java | UTF-8 | Java | false | false | 2,552 | java | package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 合并转账预下单接口
*
* @author auto create
* @since 1.0, 2022-12-09 16:13:35
*/
public class AlipayFundTransMergePrecreateModel extends AlipayObject {
private static final long serialVersionUID = 7478957598873136726L;
/**
* 业务场景。
DINGTALK_MERCHANT_PAY:钉钉企业付款
*/
@ApiField("biz_scene")
private String bizScene;
/**
* 转账请求的扩展参数,具体请与支付宝工程师联系。
merchant_op_id:商户所属的操作员id
*/
@ApiField("business_params")
private String businessParams;
/**
* 用于收银台展示标题,必填
*/
@ApiField("order_title")
private String orderTitle;
/**
* 付款方信息。如果指定了,在某些场景下以指定的付款方为准,在某些场景下会做一致性校验。
*/
@ApiField("payer_info")
private Participant payerInfo;
/**
* 合并付款的业务产品码
*/
@ApiField("product_code")
private String productCode;
/**
* 绝对超时时间,格式为yyyy-MM-dd HH:mm。
*/
@ApiField("time_expire")
private String timeExpire;
/**
* 转账订单列表,最多支持10条。
*/
@ApiListField("trans_order_list")
@ApiField("trans_order_detail")
private List<TransOrderDetail> transOrderList;
public String getBizScene() {
return this.bizScene;
}
public void setBizScene(String bizScene) {
this.bizScene = bizScene;
}
public String getBusinessParams() {
return this.businessParams;
}
public void setBusinessParams(String businessParams) {
this.businessParams = businessParams;
}
public String getOrderTitle() {
return this.orderTitle;
}
public void setOrderTitle(String orderTitle) {
this.orderTitle = orderTitle;
}
public Participant getPayerInfo() {
return this.payerInfo;
}
public void setPayerInfo(Participant payerInfo) {
this.payerInfo = payerInfo;
}
public String getProductCode() {
return this.productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getTimeExpire() {
return this.timeExpire;
}
public void setTimeExpire(String timeExpire) {
this.timeExpire = timeExpire;
}
public List<TransOrderDetail> getTransOrderList() {
return this.transOrderList;
}
public void setTransOrderList(List<TransOrderDetail> transOrderList) {
this.transOrderList = transOrderList;
}
}
| [
"auto-publish"
] | auto-publish |
31d0e545bfb1eac78042e84cb2708eb95ca50505 | 96ca926a0e95e71d583de3034aded16bb2712a9d | /example/tcphelloexam/src/main/java/hprose/tcphelloexam/TCPHelloClient.java | 974417dc90a4d73e15e60e2eb35fd06547384d4d | [
"MIT"
] | permissive | xiaoqiangcn1/hprose-java | 48e8c5dad237727e8585287e4b6c49f9a109ee82 | 47edfce3aeecab7936dbb6a7dfae89bb7e3d9010 | refs/heads/master | 2022-07-07T16:36:53.515136 | 2022-07-03T05:58:08 | 2022-07-03T05:58:08 | 101,377,673 | 0 | 0 | null | 2017-08-25T07:23:45 | 2017-08-25T07:23:45 | null | UTF-8 | Java | false | false | 4,223 | java | package hprose.tcphelloexam;
import hprose.client.HproseTcpClient;
import java.util.logging.Level;
import java.util.logging.Logger;
public class TCPHelloClient {
public static void main(String[] args) throws Throwable {
System.out.println("START");
HproseTcpClient.setReactorThreads(2);
long start = System.currentTimeMillis();
int threadNumber = 40;
final int roundNumber = 25000;
Thread[] threads = new Thread[threadNumber];
final HproseTcpClient client = new HproseTcpClient(new String[] {"tcp://localhost:4321", "tcp://localhost:4321"} );
client.setFullDuplex(true);
client.setNoDelay(true);
client.setTimeout(10000);
client.setMaxPoolSize(4);
// client.subscribe("news", new Action<String>() {
// @Override
// public void call(String value) throws Throwable {
// //System.out.println(value);
// }
// }, String.class);
// client.addFilter(new HproseFilter() {
// public String getString(ByteBuffer buffer) {
// Charset charset;
// CharsetDecoder decoder;
// CharBuffer charBuffer;
// try
// {
// charset = Charset.forName("UTF-8");
// decoder = charset.newDecoder();
// charBuffer = decoder.decode(buffer.asReadOnlyBuffer());
// return charBuffer.toString();
// }
// catch (Exception ex)
// {
// ex.printStackTrace();
// return "";
// }
// }
// @Override
// public ByteBuffer inputFilter(ByteBuffer istream, HproseContext context) {
// System.out.println(getString(istream));
// return istream;
// }
// @Override
// public ByteBuffer outputFilter(ByteBuffer ostream, HproseContext context) {
// System.out.println(getString(ostream));
// return ostream;
// }
// });
// System.out.println(client.invoke("hello", new Object[] {"World"}));
// client.invoke("hello", new Object[] {"Async World"}, Promise.class).then(new Action<String>() {
// @Override
// public void call(String value) throws Throwable {
// System.out.println(value);
// }
// }, new Action<Throwable>() {
// @Override
// public void call(Throwable value) throws Throwable {
// Logger.getLogger(TCPHelloClient.class.getName()).log(Level.SEVERE, null, value);
// }
// });
for (int i = 0; i < threadNumber; i++) {
threads[i] = new Thread() {
@Override
public void run() {
try {
for (int i = 0; i < roundNumber; i++) {
client.invoke("hello", new Object[] {"World" + i});
}
} catch (Throwable ex) {
Logger.getLogger(TCPHelloClient.class.getName()).log(Level.SEVERE, null, ex);
}
}
};
threads[i].start();
}
for (int i = 0; i < threadNumber; i++) {
if (threads[i].isAlive()) {
threads[i].join();
}
}
long end = System.currentTimeMillis();
System.out.println("总耗时: " + (end - start));
System.out.println(((threadNumber * roundNumber) * 1000/(end - start)) + " QPS");
// start = System.currentTimeMillis();
// for (int i = 0; i < 10; i++) {
// client.invoke("hello", new Object[] {"World"}, new HproseCallback1<String>() {
// @Override
// public void handler(String result) {
// System.out.println(result);
// }
// });
// }
// client.unsubscribe("news");
client.close();
// end = System.currentTimeMillis();
// System.out.println(end - start);
System.out.println("END");
}
}
| [
"mabingyao@gmail.com"
] | mabingyao@gmail.com |
2feaaa85d661ba487f1fcd81d95f3f8a434588f9 | 4c3030478340c4474340a0dec9f5340199284b5f | /java-tutorial-juc/src/main/java/com/geekerstar/collections/copyonwrite/CopyOnWriteArrayListDemo1.java | 7de2091510744f4fcab5b904915e107b96067528 | [] | no_license | jinguicheng-personal/java-tutorial | f48b5d8fa21c1f4a293929cc7019d43ca0b60118 | 5971344918aaf86f2697fc1b7ffb726d55292295 | refs/heads/master | 2023-07-03T23:48:07.339343 | 2021-08-14T09:47:26 | 2021-08-14T09:47:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,017 | java | package com.geekerstar.collections.copyonwrite;
import java.util.ArrayList;
import java.util.Iterator;
/**
* @author geekerstar
* @date 2020/2/9 14:23
* @description CopyOnWriteArrayList可以在迭代的过程中修改数组内容,但是ArrayList不行,对比
*/
public class CopyOnWriteArrayListDemo1 {
public static void main(String[] args) {
ArrayList<String> list = new ArrayList<>();
// CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();
list.add("1");
list.add("2");
list.add("3");
list.add("4");
list.add("5");
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()) {
System.out.println("list is" + list);
String next = iterator.next();
System.out.println(next);
if (next.equals("2")) {
list.remove("5");
}
if (next.equals("3")) {
list.add("3 found");
}
}
}
}
| [
"247507792@qq.com"
] | 247507792@qq.com |
e252b9c17da728c5f8de9a8cc37b437ee79bf8f4 | 33554450797589016d8cec543ba3ed1079b50313 | /app/src/main/java/com/sx/trans/transport/home/bean/YearPlanDetailBean.java | 7ae005e48e31b865eb8f2f3a500f522f90696da0 | [] | no_license | liuzhao1006/MyLiuZhao | 895b6f92f027e42f449597fc694b1f5e5dff1c30 | c0496c8f11b46ad563070856d55a0b9f71448110 | refs/heads/master | 2021-04-09T16:18:05.074841 | 2018-03-18T15:08:00 | 2018-03-18T15:08:00 | 125,736,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,936 | java | package com.sx.trans.transport.home.bean;
import com.sx.trans.base.BaseBean;
/**
* Created by xxxxxx on 2017/11/27.
*/
public class YearPlanDetailBean extends BaseBean {
/**
* Id : 3066
* StudyPlanName : 201710计划
* StudyMonth : 201710
* IndustryId : 2044
* StudyBatch : 1
* CompanyId : 5146
* BasicsHours : 120
* AddUserId : 9281
* AddTime : 2017/10/21 16:39:43
* ApprovalState : 5
* IsDelete : 0
* StudyYear : 2017
*/
private String Id;
private String StudyPlanName;
private String StudyMonth;
private String IndustryId;
private String StudyBatch;
private String CompanyId;
private String BasicsHours;
private String AddUserId;
private String AddTime;
private String ApprovalState;
private String IsDelete;
private String StudyYear;
public String getId() {
return Id;
}
public void setId(String Id) {
this.Id = Id;
}
public String getStudyPlanName() {
return StudyPlanName;
}
public void setStudyPlanName(String StudyPlanName) {
this.StudyPlanName = StudyPlanName;
}
public String getStudyMonth() {
return StudyMonth;
}
public void setStudyMonth(String StudyMonth) {
this.StudyMonth = StudyMonth;
}
public String getIndustryId() {
return IndustryId;
}
public void setIndustryId(String IndustryId) {
this.IndustryId = IndustryId;
}
public String getStudyBatch() {
return StudyBatch;
}
public void setStudyBatch(String StudyBatch) {
this.StudyBatch = StudyBatch;
}
public String getCompanyId() {
return CompanyId;
}
public void setCompanyId(String CompanyId) {
this.CompanyId = CompanyId;
}
public String getBasicsHours() {
return BasicsHours;
}
public void setBasicsHours(String BasicsHours) {
this.BasicsHours = BasicsHours;
}
public String getAddUserId() {
return AddUserId;
}
public void setAddUserId(String AddUserId) {
this.AddUserId = AddUserId;
}
public String getAddTime() {
return AddTime;
}
public void setAddTime(String AddTime) {
this.AddTime = AddTime;
}
public String getApprovalState() {
return ApprovalState;
}
public void setApprovalState(String ApprovalState) {
this.ApprovalState = ApprovalState;
}
public String getIsDelete() {
return IsDelete;
}
public void setIsDelete(String IsDelete) {
this.IsDelete = IsDelete;
}
public String getStudyYear() {
return StudyYear;
}
public void setStudyYear(String StudyYear) {
this.StudyYear = StudyYear;
}
}
| [
"5215503ren@163.com"
] | 5215503ren@163.com |
d9eb7a21845f30f7d7f48817ad0976a3424e3a4b | fbaae056f25cca6d3c4d1065e064f768bbf02377 | /src/main/java/jkmau5/alternativeenergy/server/PacketHandler.java | 143d96048d02b4aa54b0c67105cbf2cfacdbee1c | [] | no_license | Vexatos/AlternativeEnergy | 14426a40b15474890b6befd556e74696563b0ed6 | b961374feed9f52db9102bf6c2ac70fd16a708dd | refs/heads/master | 2020-05-20T16:19:28.377421 | 2013-12-08T10:06:42 | 2013-12-08T10:06:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 645 | java | package jkmau5.alternativeenergy.server;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
import jkmau5.alternativeenergy.network.AbstractPacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
/**
* No description given
*
* @author jk-5
*/
public class PacketHandler implements IPacketHandler {
@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
AbstractPacket.readPacket(packet, (EntityPlayer) player);
}
}
| [
"jeffreykog@me.com"
] | jeffreykog@me.com |
9d205bf3879133932e5641577fe4c02083a7147a | a12fbb9fae79a850b7929d463050fbea7110f07d | /datacentre-parent/oauth2-server/src/main/java/com/yhl/oauth2server/service/OAthUserDetailesService.java | cab866145f47064ec599bbbaf76df2829eceb89f | [] | no_license | SuperRookieMam/myProject | d1f2a5c71e366f270a4d3f765f025589fa9daff7 | bfde96f77306865d9aba8d59308721e14e7a35e3 | refs/heads/master | 2020-04-22T20:46:50.742869 | 2019-03-15T03:20:04 | 2019-03-15T03:20:04 | 170,651,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.yhl.oauth2server.service;
import com.yhl.base.baseService.BaseService;
import com.yhl.oauth2server.entity.OAthUserDetailes;
import org.springframework.security.core.userdetails.UserDetailsService;
public interface OAthUserDetailesService extends UserDetailsService, BaseService<OAthUserDetailes,String> {
}
| [
"422375723@qq.com"
] | 422375723@qq.com |
67ae6537c382fdea7b863a6cf6b58b498ac4e458 | 5095b037518edb145fbecbe391fd14757f16c9b9 | /gameserver/src/main/java/l2s/gameserver/model/entity/events/objects/KrateisCubePlayerObject.java | 343fd93f2054d34a5df215d8f2b28d0db29cb1c5 | [] | no_license | merlin-tribukait/lindvior | ce7da0da95c3367b05e0230379411f3544f4d9f3 | 21a3138a43cc03c7d6b8922054b4663db8e63a49 | refs/heads/master | 2021-05-28T20:58:13.697507 | 2014-10-09T15:58:04 | 2014-10-09T15:58:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,730 | java | package l2s.gameserver.model.entity.events.objects;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.Future;
import l2s.commons.threading.RunnableImpl;
import l2s.commons.util.Rnd;
import l2s.gameserver.ThreadPoolManager;
import l2s.gameserver.model.Player;
import l2s.gameserver.model.entity.events.impl.KrateisCubeEvent;
import l2s.gameserver.network.l2.components.SystemMsg;
import l2s.gameserver.network.l2.s2c.SystemMessage2;
import l2s.gameserver.utils.Location;
/**
* @author VISTALL
* @date 13:09/04.07.2011
*/
public class KrateisCubePlayerObject implements Serializable, Comparable<KrateisCubePlayerObject>
{
private static final long serialVersionUID = 1L;
private class RessurectTask extends RunnableImpl
{
private int _seconds = 10;
public RessurectTask()
{
//
}
@Override
public void runImpl() throws Exception
{
_seconds -= 1;
if(_seconds == 0)
{
KrateisCubeEvent cubeEvent = _player.getEvent(KrateisCubeEvent.class);
List<Location> waitLocs = cubeEvent.getObjects(KrateisCubeEvent.WAIT_LOCS);
_ressurectTask = null;
_player.teleToLocation(Rnd.get(waitLocs));
_player.doRevive();
}
else
{
_player.sendPacket(new SystemMessage2(SystemMsg.RESURRECTION_WILL_TAKE_PLACE_IN_THE_WAITING_ROOM_AFTER_S1_SECONDS).addInteger(_seconds));
_ressurectTask = ThreadPoolManager.getInstance().schedule(this, 1000L);
}
}
}
private final Player _player;
private final long _registrationTime;
private boolean _showRank;
private int _points;
private Future<?> _ressurectTask;
public KrateisCubePlayerObject(Player player)
{
_player = player;
_registrationTime = System.currentTimeMillis();
}
public String getName()
{
return _player.getName();
}
public boolean isShowRank()
{
return _showRank;
}
public int getPoints()
{
return _points;
}
public void setPoints(int points)
{
_points = points;
}
public void setShowRank(boolean showRank)
{
_showRank = showRank;
}
public long getRegistrationTime()
{
return _registrationTime;
}
public int getObjectId()
{
return _player.getObjectId();
}
public Player getPlayer()
{
return _player;
}
public void startRessurectTask()
{
if(_ressurectTask != null)
return;
_ressurectTask = ThreadPoolManager.getInstance().schedule(new RessurectTask(), 1000L);
}
public void stopRessurectTask()
{
if(_ressurectTask != null)
{
_ressurectTask.cancel(false);
_ressurectTask = null;
}
}
@Override
public int compareTo(KrateisCubePlayerObject o)
{
if(getPoints() == o.getPoints())
return (int) ((getRegistrationTime() - o.getRegistrationTime()) / 1000L);
return getPoints() - o.getPoints();
}
}
| [
"namlehong@gmail.com"
] | namlehong@gmail.com |
713f9140c738cb9a2146c8fb63d62522b144887b | 08888a29fc00788e49390cbf6590a9c5b9a88f95 | /cgtjr/academics/chmstry/general/atoms/ChromiumAtom.java | 252ea64658d5ef918cdebfc71137fcc5e86bdb1d | [] | no_license | hellohung1229/cgtjr_csa | eebfd3f8f04deb89ca4346b13b79c87640527f58 | 5591dc8c2ec22fd4d94d1895b83c1313f1537df9 | refs/heads/master | 2021-04-15T05:00:42.743118 | 2017-10-23T20:43:33 | 2017-10-23T20:43:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package cgtjr.academics.chmstry.general.atoms;
public class ChromiumAtom extends PDBAtom
{
public ChromiumAtom()
{
initialize();
}
public void initialize()
{
setColor(0xce7711);
setAtomicNumber(24);
setAtomicSymbol("Cr");
setAtomicName("Chromium");
}
} | [
"clayton.g.thomas@gmail.com"
] | clayton.g.thomas@gmail.com |
0412429d1ffe06e4e2592d70fbebc56631233ac7 | 74b42eca2103ce3ab39bb66110171b136450a68f | /src/tools/debugger/session/PromiseResolutionBreakpoint.java | 85a19691f659ca8e90f54066562efa45747d438d | [
"MIT"
] | permissive | salenaer/SOMns | 135ddb9c1fce6bbc65010a6486cf1623ad2c426f | ed393bc961c3064a516bcb495e9b39845b3d58f0 | refs/heads/master | 2021-01-19T10:06:16.280442 | 2017-03-15T16:41:20 | 2017-03-15T16:41:20 | 82,160,482 | 0 | 0 | null | 2017-03-13T16:14:30 | 2017-02-16T08:58:57 | Java | UTF-8 | Java | false | false | 505 | java | package tools.debugger.session;
import tools.SourceCoordinate.FullSourceCoordinate;
import tools.debugger.FrontendConnector;
public class PromiseResolutionBreakpoint extends SectionBreakpoint {
public PromiseResolutionBreakpoint(final boolean enabled, final FullSourceCoordinate coord) {
super(enabled, coord);
}
public PromiseResolutionBreakpoint() {
super();
}
@Override
public void registerOrUpdate(final FrontendConnector frontend) {
frontend.registerOrUpdate(this);
}
}
| [
"git@stefan-marr.de"
] | git@stefan-marr.de |
9e1e751f6b268b19e150f7f3a8c072dd8595fda5 | 7072af6a03d025baf94bdf9303c48d77d469633d | /com/shangshufang/homework/step1/knowledge9001_30/Demo1.java | e49c3d0d9bb90ea5c4b670baa928e11200d189a2 | [] | no_license | ShangShuFang/JavaExercisesDemo | 8ed9b2291e4e73a32b47ad4572f9a39da60aaa41 | f91253d2886d4913adb84302dbd749b1a2952f23 | refs/heads/master | 2023-02-06T19:42:54.466802 | 2020-12-18T09:34:08 | 2020-12-18T09:34:08 | 317,754,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 385 | java | package com.shangshufang.homework.step1.knowledge9001_30;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class Demo1 {
public static void main(String[] args) {
LocalDateTime dt = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
System.out.println(dtf.format(dt));
}
}
| [
"johnny.q.zhang@outlook.com"
] | johnny.q.zhang@outlook.com |
983ef5823bc158095c94c1f90a8f14e6c7106afd | eb71e782cebec26969623bb5c3638d6f62516290 | /src/droptable/Aquanite.java | a60433fa688c07d361139e25921bd77098e096f5 | [] | no_license | DukeCharles/revision-718-server | 0fe7230a4c7da8de6f7de289ef1b4baec81fbd8b | cc69a0ab6e139d5cc7e2db9a73ec1eeaf76fd6e3 | refs/heads/main | 2023-06-25T05:50:04.376413 | 2021-07-25T19:38:35 | 2021-07-25T19:38:35 | 387,924,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,969 | java | package droptable;
import com.rs.game.npc.MobRewardNodeBuilder;
import com.rs.game.player.Player;
public final class Aquanite extends MobRewardNodeBuilder {
public Aquanite() {
super(new Object[] { "Aquanite", 9172 });
}
@Override
public void populate(Player player) {
switch (rarityNode(player)) {
case -1:
case COMMON:
dissectNodeBatch(1, node(WATER_RUNE, 30, 49),
node(WATER_RUNE, 100),
node(ADAMANT_BOLTS, 10),
node(RUNITE_BOLTS, 5),
node(RUNE_DART, 1),
node(RAW_LOBSTER, 1, 3),
node(RAW_SWORDFISH, 1, 2),
node(RAW_SHARK, 1),
node(COINS, 500),
node(SEAWEED_NOTED, 3, 6),
node(SNAPE_GRASS_NOTED, 3));
break;
case UNCOMMON:
dissectNodeBatch(1, node(AIR_RUNE, 40),
node(NATURE_RUNE, 4),
node(DEATH_RUNE, 3),
node(BLOOD_RUNE, 3),
node(SOUL_RUNE, 3, 6),
node(WATER_BATTLESTAFF, 1),
node(MORCHELLA_MUSHROOM_SPORE, 4),
node(POISON_IVY_SEED, 1),
node(CACTUS_SEED, 1),
node(BELLADONNA_SEED, 1),
node(AVANTOE_SEED, 1),
node(TOADFLAX_SEED, 1),
node(CADANTINE_SEED, 1),
node(IRIT_SEED, 1),
node(KWUARM_SEED, 1),
node(FELLSTALK_SEED, 1),
node(GRIMY_GUAM, 1),
node(GRIMY_MARRENTILL, 1),
node(GRIMY_HARRALANDER, 1),
node(GRIMY_RANARR, 1),
node(GRIMY_IRIT, 1),
node(GRIMY_AVANTOE, 1),
node(GRIMY_KWUARM, 1),
node(GRIMY_CADANTINE, 1),
node(GRIMY_LANTADYME, 1),
node(GRIMY_DWARF_WEED, 1));
break;
case RARE:
case VERY_RARE:
dissectNodeBatch(1, node(AIR_BATTLESTAFF, 1),
node(AMULET_OF_RANGING, 1),
node(RANARR_SEED, 1),
node(SNAPDRAGON_SEED, 1),
node(LANTADYME_SEED, 1),
node(DWARF_WEED_SEED, 1),
node(TORSTOL_SEED, 1),
node(LONG_BONE, 1),
node(CURVED_BONE, 1));
break;
}
addObj(BIG_BONES, 1);
shakeTreasureTrail(player, HARD_CLUE);
shakeSummoningCharm(1, 10, 5, 5, 6.5);
}
}
| [
"charles.simon.morin@gmail.com"
] | charles.simon.morin@gmail.com |
1c9785faecaec948b1242c1389d8fad594187cda | 5997633f833b5c0172b7f774eeb2350f64cedbd7 | /cli/src/main/java/com/box/l10n/mojito/cli/command/ThirdPartySyncCommand.java | 23d3b30b95f6c6bf4be8a4de03c2c89f1dfe2b29 | [
"Apache-2.0"
] | permissive | boxmoji/mojito | 42b5cceffba891ec3750d1bcf8a8160af21608ce | 03b3c9f8602697b37278dcee131cf9cb9b53bb5c | refs/heads/master | 2023-08-09T21:43:44.325425 | 2020-09-01T19:18:35 | 2020-09-01T20:07:54 | 70,105,535 | 0 | 0 | Apache-2.0 | 2020-09-15T03:26:28 | 2016-10-05T22:48:30 | Java | UTF-8 | Java | false | false | 4,276 | java | package com.box.l10n.mojito.cli.command;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.box.l10n.mojito.cli.command.param.Param;
import com.box.l10n.mojito.cli.console.ConsoleWriter;
import com.box.l10n.mojito.rest.ThirdPartySyncAction;
import com.box.l10n.mojito.rest.client.ThirdPartyClient;
import com.box.l10n.mojito.rest.entity.PollableTask;
import com.box.l10n.mojito.rest.entity.Repository;
import org.fusesource.jansi.Ansi;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import static org.fusesource.jansi.Ansi.Color.CYAN;
/**
* @author jaurambault
*/
@Component
@Scope("prototype")
@Parameters(commandNames = {"thirdparty-sync", "tps"}, commandDescription = "Third-party command to sychronize text units and screenshots with third party TMS")
public class ThirdPartySyncCommand extends Command {
/**
* logger
*/
static Logger logger = LoggerFactory.getLogger(ThirdPartySyncCommand.class);
@Autowired
ConsoleWriter consoleWriter;
@Parameter(names = {Param.REPOSITORY_LONG, Param.REPOSITORY_SHORT}, arity = 1, required = true, description = Param.REPOSITORY_DESCRIPTION)
String repositoryParam;
@Parameter(names = {"--project", "-p"}, arity = 1, required = true, description = "Third party project to synchronize with")
String thirdPartyProjectId;
@Parameter(names = {"--actions", "-a"}, variableArity = true, required = false, description = "Actions to synchronize", converter = ThirdPartySyncActionsConverter.class)
List<ThirdPartySyncAction> actions = Arrays.asList(ThirdPartySyncAction.MAP_TEXTUNIT, ThirdPartySyncAction.PUSH_SCREENSHOT);
@Parameter(names = {"--plural-separator", "-ps"}, arity = 1, required = false, description = "Plural separator for name")
String pluralSeparator;
@Parameter(names = {Param.REPOSITORY_LOCALES_MAPPING_LONG, Param.REPOSITORY_LOCALES_MAPPING_SHORT}, arity = 1, required = false, description = Param.REPOSITORY_LOCALES_MAPPING_DESCRIPTION)
String localeMapping;
@Parameter(names = {"--skip-text-units-with-pattern", "-st"}, arity = 1, required = false, description = "Do not process text units matching with the SQL LIKE expression")
String skipTextUnitsWithPattern;
@Parameter(names = {"--skip-assets-path-pattern", "-sa"}, arity = 1, required = false, description = "Do not process text units whose assets path match the SQL LIKE expression")
String skipAssetsWithPathPattern;
@Parameter(names = {"--options", "-o"}, variableArity = true, required = false, description = "Options to synchronize")
List<String> options;
@Autowired
ThirdPartyClient thirdPartyClient;
@Autowired
CommandHelper commandHelper;
@Override
public void execute() throws CommandException {
consoleWriter.newLine().a("Third party TMS synchronization for repository: ").fg(CYAN).a(repositoryParam).reset()
.a(" project id: ").fg(CYAN).a(thirdPartyProjectId).reset()
.a(" actions: ").fg(CYAN).a(Objects.toString(actions)).reset()
.a(" plural-separator: ").fg(CYAN).a(Objects.toString(pluralSeparator)).reset()
.a(" locale-mapping: ").fg(CYAN).a(Objects.toString(localeMapping)).reset()
.a(" skip-text-units-with-pattern: ").fg(CYAN).a(Objects.toString(skipTextUnitsWithPattern)).reset()
.a(" skip-assets-path-pattern: ").fg(CYAN).a(Objects.toString(skipAssetsWithPathPattern)).reset()
.a(" options: ").fg(CYAN).a(Objects.toString(options)).println(2);
Repository repository = commandHelper.findRepositoryByName(repositoryParam);
PollableTask pollableTask = thirdPartyClient.sync(repository.getId(), thirdPartyProjectId, pluralSeparator, localeMapping,
actions, skipTextUnitsWithPattern, skipAssetsWithPathPattern, options);
commandHelper.waitForPollableTask(pollableTask.getId());
consoleWriter.fg(Ansi.Color.GREEN).newLine().a("Finished").println(2);
}
}
| [
"aurambaj@users.noreply.github.com"
] | aurambaj@users.noreply.github.com |
f65517cc6a791bc57071884b4aa7372f5f296c6e | 029fc19fd0cd022715f0d4f74392d697c59dd2ec | /fleece-mapper/src/main/java/org/apache/fleece/mapper/converter/IntegerConverter.java | 8677b3e7e60191f23bae0e25ba7667d727f9fcd8 | [] | no_license | salyh/incubator-fleece | 00bea6d3e3dc9926e816e097bfde002c4aeeb13c | 72e0a8162478acfefc2fadf12f5dc0b1528a382a | refs/heads/master | 2016-09-06T07:52:56.517886 | 2014-09-04T18:19:33 | 2014-09-04T18:19:33 | 21,290,179 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,181 | 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.fleece.mapper.converter;
import org.apache.fleece.mapper.Converter;
public class IntegerConverter implements Converter<Integer> {
@Override
public String toString(final Integer instance) {
return Integer.toString(instance);
}
@Override
public Integer fromString(final String text) {
return Integer.valueOf(text);
}
}
| [
"rmannibucau@gmail.com"
] | rmannibucau@gmail.com |
bd0d7519c4e4e909097a0fc9b1dca007718dc257 | 036f37aa941bcecf86941704a74682a95cdb3002 | /DP_MatrixMultiplicationChain/src/MatrixMultiplicationChain.java | ea1f71fb326952a19365b6ffbebdd1ca4331fb87 | [] | no_license | mbhushan/injava | 98999b0e9e0619a7b23694aa4c8b539b8434df1e | 36afa016fc8e62ee532c385b08e35fb625dc5473 | refs/heads/master | 2020-05-31T02:45:36.452691 | 2016-08-24T00:36:35 | 2016-08-24T00:36:35 | 29,081,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java |
public class MatrixMultiplicationChain {
public static void main(String [] args) {
int [] M = {1, 2, 3, 4};
MatrixMultiplicationChain MMC = new MatrixMultiplicationChain();
System.out.println("optimal cost to multiply matrices: " + MMC.matrixMulChainCost(M));
}
//Time Complexity: O(n^3)
//Auxiliary Space: O(n^2)
public int matrixMulChainCost(int [] M) {
int len = M.length;
/* m[i,j] = Minimum number of scalar multiplications needed
to compute the matrix A[i]A[i+1]...A[j] = A[i..j] where
dimension of A[i] is p[i-1] x p[i] */
int [][] T = new int[len][len];
int value = 0;
for (int n=2; n<len; n++) {
for (int i=0; i<len-n; i++) {
int j = i + n;
T[i][j] = Integer.MAX_VALUE;
for (int k=i+1; k<j; k++) {
value = T[i][k] + T[k][j] + (M[i] * M[k] * M[j]);
if (value < T[i][j]) {
T[i][j] = value;
}
}
}
}
return T[0][len-1];
}
}
| [
"manibhushan.cs@gmail.com"
] | manibhushan.cs@gmail.com |
a8c715123cc0787b3dfac86e3bf7f7c26a7fa8ae | 5a13f24c35c34082492ef851fb91d404827b7ddb | /src/main/java3/com/alipay/api/domain/AlipayDaoweiOrderConfirmModel.java | a08fe4a5e52c25cd17a042924a980d9ac533e4d2 | [] | no_license | featherfly/alipay-sdk | 69b2f2fc89a09996004b36373bd5512664521bfd | ba2355a05de358dc15855ffaab8e19acfa24a93b | refs/heads/master | 2021-01-22T11:03:20.304528 | 2017-09-04T09:39:42 | 2017-09-04T09:39:42 | 102,344,436 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,507 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 订单确认接口
*
* @author auto create
* @since 1.0, 2017-03-20 14:01:05
*/
public class AlipayDaoweiOrderConfirmModel extends AlipayObject {
private static final long serialVersionUID = 6764532235125649498L;
/**
* 备注信息,商家确认订单时添加的备注信息,长度不超过2000个字符
*/
@ApiField("memo")
private String memo;
/**
* 到位业务订单号。用户在到位下单时,由到位系统生成的32位全局唯一数字 id。
通过应用中的应用网关post发送给商户(应用网关配置参考链接:https%3A%2F%2Fdoc.open.alipay.com%2Fdocs%2Fdoc.htm%3Fspm%3Da219a.7629140.0.0.TcIuKL%26treeId%3D193%26articleId%3D105310%26docType%3D1)。
*/
@ApiField("order_no")
private String orderNo;
/**
* 商户订单号码。确认接单时需要设置外部订单号,由商户自行生成,并确保其唯一性
*/
@ApiField("out_order_no")
private String outOrderNo;
public String getMemo() {
return this.memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getOrderNo() {
return this.orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getOutOrderNo() {
return this.outOrderNo;
}
public void setOutOrderNo(String outOrderNo) {
this.outOrderNo = outOrderNo;
}
}
| [
"zhongj@cdmhzx.com"
] | zhongj@cdmhzx.com |
a9a45203acdb8c92d6a47eda411d95d1c1101e4f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_e46cce59c381ddd5a46f3113ee87c4a7b96893ae/RemoteLauncherTests/4_e46cce59c381ddd5a46f3113ee87c4a7b96893ae_RemoteLauncherTests_s.java | 07431c94042037b30c829f63b21a7ed280a2ff05 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,566 | java | /*
* Copyright 2006-2007 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.springframework.batch.sample.launch;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.launch.JobOperator;
import org.springframework.batch.core.launch.NoSuchJobException;
import org.springframework.batch.core.launch.support.JobRegistryBackgroundJobRunner;
import org.springframework.jmx.MBeanServerNotFoundException;
import org.springframework.jmx.access.InvalidInvocationException;
import org.springframework.jmx.access.MBeanProxyFactoryBean;
import org.springframework.jmx.support.MBeanServerConnectionFactoryBean;
/**
* @author Dave Syer
*
*/
public class RemoteLauncherTests {
private static Log logger = LogFactory.getLog(RemoteLauncherTests.class);
private static List<Exception> errors = new ArrayList<Exception>();
private static JobOperator launcher;
private static JobLoader loader;
@Test
public void testConnect() throws Exception {
String message = errors.isEmpty() ? "" : errors.get(0).getMessage();
assertEquals(message, 0, errors.size());
assertTrue(isConnected());
}
@Test
public void testLaunchBadJob() throws Exception {
assertEquals(0, errors.size());
assertTrue(isConnected());
try {
launcher.start("foo", "");
fail("Expected NoSuchJobException");
} catch (NoSuchJobException e) {
//expected;
}
}
@Test
public void testAvailableJobs() throws Exception {
assertEquals(0, errors.size());
assertTrue(isConnected());
assertTrue(launcher.getJobNames().contains("loopJob"));
}
/*
* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
@Before
public void setUp() throws Exception {
if (launcher != null) {
return;
}
System.setProperty("com.sun.management.jmxremote", "");
Thread thread = new Thread(new Runnable() {
public void run() {
try {
JobRegistryBackgroundJobRunner.main("adhoc-job-launcher-context.xml", "jobs/adhocLoopJob.xml");
}
catch (Exception e) {
errors.add(e);
}
}
});
thread.start();
int count = 0;
while (!isConnected() && count++ < 10) {
Thread.sleep(1000);
}
}
private static boolean isConnected() throws Exception {
boolean connected = false;
if (!JobRegistryBackgroundJobRunner.getErrors().isEmpty()) {
throw JobRegistryBackgroundJobRunner.getErrors().get(0);
}
if (launcher == null) {
MBeanServerConnectionFactoryBean connectionFactory = new MBeanServerConnectionFactoryBean();
try {
launcher = (JobOperator) getMBean(connectionFactory, "spring:service=batch,bean=jobOperator", JobOperator.class);
loader = (JobLoader) getMBean(connectionFactory, "spring:service=batch,bean=jobLoader", JobLoader.class);
}
catch (MBeanServerNotFoundException e) {
// ignore
return false;
}
}
try {
launcher.getJobNames();
connected = loader.getConfigurations().size()>0;
logger.info("Configurations loaded: " + loader.getConfigurations());
}
catch (InvalidInvocationException e) {
// ignore
}
return connected;
}
private static Object getMBean(MBeanServerConnectionFactoryBean connectionFactory, String objectName, Class<?> interfaceType)
throws MalformedObjectNameException {
MBeanProxyFactoryBean factory = new MBeanProxyFactoryBean();
factory.setObjectName(objectName);
factory.setProxyInterface(interfaceType);
factory.setServer((MBeanServerConnection) connectionFactory.getObject());
factory.afterPropertiesSet();
return factory.getObject();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
2453cb8418435173c506af7934d44b23e9c9e2be | d4833506e19df8f6d8b878b46f74c8447cc01e50 | /src/test/java/agh/jo/cnf/patricia/PatriciaTreeFromCNFAbstractTest.java | 8104798ee91ed0cb69ed58d0877eeedafd0d87c5 | [
"Apache-2.0"
] | permissive | axal25/TrieTreeImplementations | c2637cf7b7216dcf0e61f37606bc36a0301d5dbb | d23d0c43b3e4fdeaa71e2537a458f1d07b86c19f | refs/heads/master | 2022-06-14T23:47:02.722331 | 2020-03-21T21:20:48 | 2020-03-21T21:20:48 | 234,785,306 | 0 | 0 | Apache-2.0 | 2022-05-20T21:23:19 | 2020-01-18T19:23:56 | Java | UTF-8 | Java | false | false | 4,032 | java | package agh.jo.cnf.patricia;
import agh.jo.cnf.converter.CNFConverter;
import agh.jo.knuth.patricia.Encoding;
import agh.jo.knuth.patricia.PatriciaTree;
import agh.jo.knuth.patricia.file.ops.WordStrategy;
import agh.jo.knuth.patricia.file.ops.exceptions.NextWordStartIndexNotFoundException;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public abstract class PatriciaTreeFromCNFAbstractTest {
public PatriciaTree getNewInitiatedPatriciaTree(
String filePath,
String fileName,
char charEOF,
char charEOK,
WordStrategy wordStrategy,
Encoding encoding
) throws Exception {
PatriciaTree patriciaTree = new PatriciaTree(filePath, fileName, charEOF, charEOK, wordStrategy, encoding);
return patriciaTree;
}
public static void isFindingAllKeys(PatriciaTree patriciaTree, CNFConverter cnfConverter) throws Exception {
int position = 0;
int nextPosition = position;
int cnfCounter = 0;
String cnf = null;
while((cnf = cnfConverter.getCnfReader().readCNF()) != null && !cnf.isEmpty()) {
cnfCounter++;
position = nextPosition;
System.out.println(cnfCounter + ". \"" + cnf + "\"");
Long[] longArray = cnfConverter.parseCNF(cnf);
Arrays.sort(longArray);
String sortedCnf = cnfConverter.literalArrayToString(longArray);
sortedCnf = new StringBuilder().append(sortedCnf).append(cnfConverter.getCnfWriter().getEOCNF()).toString();
String key = patriciaTree.getFileOps().getFileOpsStrategy().getWordStringFromFileStartingAtPosition(position);
try {
nextPosition = patriciaTree.getFileOps().getFileOpsStrategy().findNextWordStartIndex(position);
System.out.println(cnfCounter + ". \"" + sortedCnf + "\"");
assertEquals(sortedCnf, key);
} catch (NextWordStartIndexNotFoundException e) {
sortedCnf = new StringBuilder().append(sortedCnf).append(cnfConverter.getCnfWriter().getOutputEOF()).toString();
System.out.println(cnfCounter + ". \"" + sortedCnf + "\"");
assertEquals(sortedCnf, key);
}
}
}
public PatriciaTree getPatriciaTreeWithAllKeys(PatriciaTree patriciaTree) throws Exception {
patriciaTree.insertAllKeysIntoTree();
return patriciaTree;
}
public static void isContainingAllPrefixes(PatriciaTree patriciaTreeWithAllKeys, CNFConverter cnfConverter) throws Exception {
String cnf = null;
int cnfCounter = 0;
while((cnf = cnfConverter.getCnfReader().readCNF()) != null && !cnf.isEmpty()) {
cnfCounter++;
System.out.println(cnfCounter + ". \"" + cnf + "\"");
Long[] longArray = cnfConverter.parseCNF(cnf);
Arrays.sort(longArray);
String sortedCnf = cnfConverter.literalArrayToString(longArray);
System.out.println(cnfCounter + ". \"" + sortedCnf + "\"");
assertTrue(patriciaTreeWithAllKeys.isContainingPrefix(cnf));
assertEquals(1, patriciaTreeWithAllKeys.findNodesMatchingPrefix(cnf).length);
}
}
public static void isContainingAllKeys(PatriciaTree patriciaTreeWithAllKeys, CNFConverter cnfConverter) throws Exception {
String cnf = null;
int cnfCounter = 0;
while((cnf = cnfConverter.getCnfReader().readCNF()) != null && !cnf.isEmpty()) {
cnfCounter++;
System.out.println(cnfCounter + ". \"" + cnf + "\"");
Long[] longArray = cnfConverter.parseCNF(cnf);
Arrays.sort(longArray);
String sortedCnf = cnfConverter.literalArrayToString(longArray);
System.out.println(cnfCounter + ". \"" + sortedCnf + "\"");
assertTrue(patriciaTreeWithAllKeys.isContainingKey(cnf));
}
}
}
| [
"emevig@gmail.com"
] | emevig@gmail.com |
ac58c0b228b237aa3114b006963d590fb6c385c0 | cc16a38859a219a0688ef179babd31160ff0fcd4 | /src/count_univalue_subtrees/Solution.java | 695f92bc1c4135ade9528eca196fef583490d258 | [] | no_license | harperjiang/LeetCode | f1ab4ee796b3de1b2f0ec03ceb443908c20e68b1 | 83edba731e0070ab175e5cb42ea4ac3c0b1a90c8 | refs/heads/master | 2023-06-12T20:19:24.988389 | 2023-06-01T13:47:22 | 2023-06-01T13:47:22 | 94,937,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | package count_univalue_subtrees;
public class Solution {
int[] scan(TreeNode root) {
if (root == null) {
return null;
}
if (root.left == null && root.right == null) {
return new int[]{root.val, 1};
}
int[] left = scan(root.left);
int[] right = scan(root.right);
int newvalue = (left == null || left[0] == root.val) && (right == null || right[0] == root.val) ? root.val : -1001;
int newcount = (left == null ? 0 : left[1]) + (right == null ? 0 : right[1]);
if (newvalue != -1001) {
newcount++;
}
return new int[]{newvalue, newcount};
}
public int countUnivalSubtrees(TreeNode root) {
if (root == null) {
return 0;
}
return scan(root)[1];
}
}
| [
"harperjiang@msn.com"
] | harperjiang@msn.com |
4d87fa2f05bb6d00504bfccdbb9e430e25a17df8 | cceb4e618ce4ccf7a20ae1e6a2a0b53cf5924a19 | /src/main/java/cn/bestsec/dcms/platform/impl/unit/UnitQueryMinorList.java | 0707e314a01dbfc4ad88085528f19c29d323dd4a | [] | no_license | zhanght86/dcms | 9843663cb278ebafb6f26bc662b385b713f2058d | 8e51ec3434ffb1784d9ea5d748e8972dc8fc629b | refs/heads/master | 2021-06-24T16:14:09.891624 | 2017-09-08T08:18:39 | 2017-09-08T08:18:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,474 | java | package cn.bestsec.dcms.platform.impl.unit;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import cn.bestsec.dcms.platform.api.Unit_QueryMinorListApi;
import cn.bestsec.dcms.platform.api.exception.ApiException;
import cn.bestsec.dcms.platform.api.model.UnitItem;
import cn.bestsec.dcms.platform.api.model.Unit_QueryMinorListRequest;
import cn.bestsec.dcms.platform.api.model.Unit_QueryMinorListResponse;
import cn.bestsec.dcms.platform.consts.CommonConsts;
import cn.bestsec.dcms.platform.dao.FileLevelDecideUnitDao;
import cn.bestsec.dcms.platform.entity.FileLevelDecideUnit;
/**
* 查询辅助定密单位列表 无权限限制
*
* @author 刘强 email:liuqiang@bestsec.cn
* @time 2016年12月29日 上午10:52:34
*/
@Component
public class UnitQueryMinorList implements Unit_QueryMinorListApi {
@Autowired
private FileLevelDecideUnitDao fileLevelDecideUnitDao;
@Override
@Transactional
public Unit_QueryMinorListResponse execute(Unit_QueryMinorListRequest unit_QueryMinorListRequest)
throws ApiException {
Unit_QueryMinorListResponse resp = new Unit_QueryMinorListResponse();
// 查询辅助定密单位
Specification<FileLevelDecideUnit> spec = new Specification<FileLevelDecideUnit>() {
@Override
public Predicate toPredicate(Root<FileLevelDecideUnit> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
Predicate predicate = cb.equal(root.get("major"), CommonConsts.Bool.no.getInt());
return predicate;
}
};
List<FileLevelDecideUnit> unitData = fileLevelDecideUnitDao.findAll(spec, new Sort(Sort.Direction.ASC, "unitNo"));
List<UnitItem> unitList = new ArrayList<UnitItem>();
for (FileLevelDecideUnit fileLevelDecideUnit : unitData) {
unitList.add(new UnitItem(fileLevelDecideUnit.getUnitNo(), fileLevelDecideUnit.getName(), fileLevelDecideUnit.getDescription()));
}
resp.setUnitList(unitList);
return resp;
}
}
| [
"liu@gmail.com"
] | liu@gmail.com |
49a2812c43c976a3f1b4ebdd8ab89588c770a249 | 1a83f3f213dca04890764ac096ba3613f50e5665 | /src/main/java/io/server/game/event/impl/ItemOnItemEvent.java | 7e183fa0901e1f55afd973491bc136af186f5940 | [] | no_license | noveltyps/NewRunityRebelion | 52dfc757d6f784cce4d536c509bcdd6247ae57ef | 6b0e5c0e7330a8a9ee91c691fb150cb1db567457 | refs/heads/master | 2020-05-20T08:44:36.648909 | 2019-05-09T17:23:50 | 2019-05-09T17:23:50 | 185,468,893 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package io.server.game.event.impl;
import io.server.game.event.Event;
import io.server.game.world.items.Item;
public class ItemOnItemEvent implements Event {
private final Item used;
private final int usedSlot;
private final Item with;
private final int withSlot;
public ItemOnItemEvent(Item used, int usedSlot, Item with, int withSlot) {
this.used = used;
this.usedSlot = usedSlot;
this.with = with;
this.withSlot = withSlot;
}
public Item getUsed() {
return used;
}
public int getUsedSlot() {
return usedSlot;
}
public Item getWith() {
return with;
}
public int getWithSlot() {
return withSlot;
}
}
| [
"43006455+donvlee97@users.noreply.github.com"
] | 43006455+donvlee97@users.noreply.github.com |
a28da4fec9ca2ed2ad630605cf501f76e65dee7d | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/neo4j--neo4j/ea863751776c4b0e24becd848d0bcf9db49d9837/after/ArrayEncoder.java | 798c1b2b43e26d76dda2daf1238bd00d01828068 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,825 | java | /**
* Copyright (c) 2002-2015 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 org.neo4j.kernel.api.index;
import sun.misc.BASE64Encoder;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import org.neo4j.kernel.impl.util.Charsets;
public class ArrayEncoder
{
private static final BASE64Encoder base64Encoder = new BASE64Encoder()
{
@Override
protected void encodeBufferPrefix( OutputStream out ) throws IOException
{
// don't initialize the non-thread-safe state
}
@Override
protected void encodeBufferSuffix( OutputStream outputStream ) throws IOException
{
// nothing to do here
}
@Override
protected void encodeLinePrefix( OutputStream outputStream, int i ) throws IOException
{
// nothing to do here
}
@Override
protected void encodeLineSuffix( OutputStream out ) throws IOException
{
// don't use the non-thread-safe state, but do nothing
}
};
public static String encode( Object array )
{
if ( !array.getClass().isArray() )
{
throw new IllegalArgumentException( "Only works with arrays" );
}
StringBuilder builder = new StringBuilder();
int length = Array.getLength( array );
String type = "";
for ( int i = 0; i < length; i++ )
{
Object o = Array.get( array, i );
if ( o instanceof Number )
{
type = "D";
builder.append( ((Number) o).doubleValue() );
}
else if ( o instanceof Boolean )
{
type = "Z";
builder.append( o );
}
else
{
type = "L";
String str = o.toString();
builder.append( base64Encoder.encode( str.getBytes( Charsets.UTF_8 ) ) );
}
builder.append( "|" );
}
return type + builder.toString();
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
7ce90320b268692ffc8a2039a7d5328e588d7590 | c9422d4c4c799cda11d8190fe5aa14caebe9a48f | /src/com/coreeight/basics/blocks/StaticBlocks.java | 7fb4895f780bc92a47060310d4a08b5355082815 | [
"MIT"
] | permissive | pradeepreddy126/Java-Eight | ab18f68fb0a8691831313e6117fc4e4763a4baeb | 820a84ec12973fcde8ce41237ba2e5056a5535f3 | refs/heads/master | 2022-06-29T23:10:05.251520 | 2020-05-13T02:49:58 | 2020-05-13T02:49:58 | 258,724,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 435 | java | package com.coreeight.basics.blocks;
import javax.swing.text.html.StyleSheet;
public class StaticBlocks {
static {
System.out.println("Block 1");
}
static {
System.out.println("Block 3");
}
static {
System.out.println("Block 2");
}
public static void main(String str[]){
System.out.println("main()");
}
static {
System.out.println("Block 4");
}
}
| [
"test@gmail.com"
] | test@gmail.com |
73be5fe15fcdda2dab32da0dfea9c47ef42e9642 | 43ee32d891b5357501d74be4680c5574d0788466 | /hutool-cron/src/main/java/cn/hutool/cron/timingwheel/SystemTimer.java | 9d640fa02db507bbdf717e620b1c76feaf18eb5b | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-mulanpsl-2.0-en",
"MulanPSL-2.0"
] | permissive | zw1127/hutool | 0a0384cbabdd01e45ddc192cbc6c54215f8d7fc4 | 89832cdcce8dc3b6bed0fc1d5bdd33e36d1e599f | refs/heads/v4-master | 2023-05-05T00:50:50.562107 | 2023-04-16T15:40:08 | 2023-04-16T15:40:08 | 176,929,021 | 0 | 0 | Apache-2.0 | 2019-06-27T01:17:26 | 2019-03-21T11:13:16 | Java | UTF-8 | Java | false | false | 2,427 | java | package cn.hutool.cron.timingwheel;
import cn.hutool.core.thread.ThreadUtil;
import java.util.concurrent.DelayQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
/**
* 系统计时器
*
* @author eliasyaoyc, looly
*/
public class SystemTimer {
/**
* 底层时间轮
*/
private final TimingWheel timeWheel;
/**
* 一个Timer只有一个delayQueue
*/
private final DelayQueue<TimerTaskList> delayQueue = new DelayQueue<>();
/**
* 执行队列取元素超时时长,单位毫秒,默认100
*/
private long delayQueueTimeout = 100;
/**
* 轮询delayQueue获取过期任务线程
*/
private ExecutorService bossThreadPool;
/**
* 构造
*/
public SystemTimer() {
timeWheel = new TimingWheel(1, 20, delayQueue::offer);
}
/**
* 设置执行队列取元素超时时长,单位毫秒
* @param delayQueueTimeout 执行队列取元素超时时长,单位毫秒
* @return this
*/
public SystemTimer setDelayQueueTimeout(long delayQueueTimeout){
this.delayQueueTimeout = delayQueueTimeout;
return this;
}
/**
* 启动,异步
*
* @return this
*/
public SystemTimer start() {
bossThreadPool = ThreadUtil.newSingleExecutor();
bossThreadPool.submit(() -> {
while (true) {
if(false == advanceClock()){
break;
}
}
});
return this;
}
/**
* 强制结束
*/
public void stop(){
this.bossThreadPool.shutdown();
}
/**
* 添加任务
*
* @param timerTask 任务
*/
public void addTask(TimerTask timerTask) {
//添加失败任务直接执行
if (false == timeWheel.addTask(timerTask)) {
ThreadUtil.execAsync(timerTask.getTask());
}
}
/**
* 指针前进并获取过期任务
*
* @return 是否结束
*/
private boolean advanceClock() {
try {
TimerTaskList timerTaskList = poll();
if (null != timerTaskList) {
//推进时间
timeWheel.advanceClock(timerTaskList.getExpire());
//执行过期任务(包含降级操作)
timerTaskList.flush(this::addTask);
}
} catch (InterruptedException ignore) {
return false;
}
return true;
}
/**
* 执行队列取任务列表
* @return 任务列表
* @throws InterruptedException 中断异常
*/
private TimerTaskList poll() throws InterruptedException {
return this.delayQueueTimeout > 0 ?
delayQueue.poll(delayQueueTimeout, TimeUnit.MILLISECONDS) :
delayQueue.poll();
}
}
| [
"loolly@gmail.com"
] | loolly@gmail.com |
a965a16f0185ea3fb4e8b4a6d048341ad11b0a05 | f3aec68bc48dc52e76f276fd3b47c3260c01b2a4 | /core/referencebook/src/main/java/ru/korus/tmis/pix/SetUpdateMode.java | 070d04468dba11af54cec64363f7086113755d46 | [] | no_license | MarsStirner/core | c9a383799a92e485e2395d81a0bc95d51ada5fa5 | 6fbf37af989aa48fabb9c4c2566195aafd2b16ab | refs/heads/master | 2020-12-03T00:39:51.407573 | 2016-04-29T12:28:32 | 2016-04-29T12:28:32 | 96,041,573 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 826 | java |
package ru.korus.tmis.pix;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SetUpdateMode.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="SetUpdateMode">
* <restriction base="{urn:hl7-org:v3}cs">
* <enumeration value="ESA"/>
* <enumeration value="ESAC"/>
* <enumeration value="ESC"/>
* <enumeration value="ESD"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "SetUpdateMode")
@XmlEnum
public enum SetUpdateMode {
ESA,
ESAC,
ESC,
ESD;
public String value() {
return name();
}
public static SetUpdateMode fromValue(String v) {
return valueOf(v);
}
}
| [
"szgrebelny@korusconsulting.ru"
] | szgrebelny@korusconsulting.ru |
49b35a4d70407211bfa7cf37a0a3da4c2e178538 | 14431603e83103ea34fd371de5d36518424d99a5 | /src/test/java/org/datasurvey/web/rest/TestUtil.java | 2373dc3986a4d1b46cd796247ddc9a6c21657f6a | [
"MIT"
] | permissive | Quantum-P3/datasurvey | c9bee843f6a1867277b3619e1de6e7b9fad54252 | fc03659f7ed0b2592939fe05a4d9cda4531af5bf | refs/heads/dev | 2023-07-11T10:36:17.512315 | 2021-08-18T05:21:59 | 2021-08-18T05:21:59 | 382,707,818 | 0 | 0 | MIT | 2021-08-18T05:34:03 | 2021-07-03T20:55:10 | Java | UTF-8 | Java | false | false | 7,877 | java | package org.datasurvey.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.hamcrest.TypeSafeMatcher;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
/**
* Utility class for testing REST controllers.
*/
public final class TestUtil {
private static final ObjectMapper mapper = createObjectMapper();
private static ObjectMapper createObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
mapper.registerModule(new JavaTimeModule());
return mapper;
}
/**
* Convert an object to JSON byte array.
*
* @param object the object to convert.
* @return the JSON byte array.
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object) throws IOException {
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array.
* @param data the data to put in the byte array.
* @return the JSON byte array.
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
/**
* A matcher that tests that the examined string represents the same instant as the reference datetime.
*/
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
}
@Override
protected boolean matchesSafely(String item, Description mismatchDescription) {
try {
if (!date.isEqual(ZonedDateTime.parse(item))) {
mismatchDescription.appendText("was ").appendValue(item);
return false;
}
return true;
} catch (DateTimeParseException e) {
mismatchDescription.appendText("was ").appendValue(item).appendText(", which could not be parsed as a ZonedDateTime");
return false;
}
}
@Override
public void describeTo(Description description) {
description.appendText("a String representing the same Instant as ").appendValue(date);
}
}
/**
* Creates a matcher that matches when the examined string represents the same instant as the reference datetime.
*
* @param date the reference datetime against which the examined string is checked.
*/
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
}
/**
* A matcher that tests that the examined number represents the same value - it can be Long, Double, etc - as the reference BigDecimal.
*/
public static class NumberMatcher extends TypeSafeMatcher<Number> {
final BigDecimal value;
public NumberMatcher(BigDecimal value) {
this.value = value;
}
@Override
public void describeTo(Description description) {
description.appendText("a numeric value is ").appendValue(value);
}
@Override
protected boolean matchesSafely(Number item) {
BigDecimal bigDecimal = asDecimal(item);
return bigDecimal != null && value.compareTo(bigDecimal) == 0;
}
private static BigDecimal asDecimal(Number item) {
if (item == null) {
return null;
}
if (item instanceof BigDecimal) {
return (BigDecimal) item;
} else if (item instanceof Long) {
return BigDecimal.valueOf((Long) item);
} else if (item instanceof Integer) {
return BigDecimal.valueOf((Integer) item);
} else if (item instanceof Double) {
return BigDecimal.valueOf((Double) item);
} else if (item instanceof Float) {
return BigDecimal.valueOf((Float) item);
} else {
return BigDecimal.valueOf(item.doubleValue());
}
}
}
/**
* Creates a matcher that matches when the examined number represents the same value as the reference BigDecimal.
*
* @param number the reference BigDecimal against which the examined number is checked.
*/
public static NumberMatcher sameNumber(BigDecimal number) {
return new NumberMatcher(number);
}
/**
* Verifies the equals/hashcode contract on the domain object.
*/
public static <T> void equalsVerifier(Class<T> clazz) throws Exception {
T domainObject1 = clazz.getConstructor().newInstance();
assertThat(domainObject1.toString()).isNotNull();
assertThat(domainObject1).isEqualTo(domainObject1);
assertThat(domainObject1).hasSameHashCodeAs(domainObject1);
// Test with an instance of another class
Object testOtherObject = new Object();
assertThat(domainObject1).isNotEqualTo(testOtherObject);
assertThat(domainObject1).isNotEqualTo(null);
// Test with an instance of the same class
T domainObject2 = clazz.getConstructor().newInstance();
assertThat(domainObject1).isNotEqualTo(domainObject2);
// HashCodes are equals because the objects are not persisted yet
assertThat(domainObject1).hasSameHashCodeAs(domainObject2);
}
/**
* Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
* @return the {@link FormattingConversionService}.
*/
public static FormattingConversionService createFormattingConversionService() {
DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService();
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(dfcs);
return dfcs;
}
/**
* Makes a an executes a query to the EntityManager finding all stored objects.
* @param <T> The type of objects to be searched
* @param em The instance of the EntityManager
* @param clss The class type to be searched
* @return A list of all found objects
*/
public static <T> List<T> findAll(EntityManager em, Class<T> clss) {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<T> cq = cb.createQuery(clss);
Root<T> rootEntry = cq.from(clss);
CriteriaQuery<T> all = cq.select(rootEntry);
TypedQuery<T> allQuery = em.createQuery(all);
return allQuery.getResultList();
}
private TestUtil() {}
}
| [
"pbonilla29@hotmail.com"
] | pbonilla29@hotmail.com |
845dfcaccb46939504bcef2fa6f177047d9350c7 | 7a3ae605834e5331b9b5ec5ee6f2bdce20feb26a | /kiji-schema/src/main/java/org/kiji/schema/impl/HBaseVersionPager.java | be04ce265bc362b0bda02212a96a1d01b6035c5d | [
"Apache-2.0"
] | permissive | alexandre-normand/kiji-schema | 9429a354bfdf6f3d3d63666589b0d2945dc33adb | ba3a995e8992db6f300214fc05aaf287b0a6b328 | refs/heads/master | 2021-01-17T16:22:10.901396 | 2013-04-16T23:44:43 | 2013-04-16T23:44:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,417 | java | /**
* (c) Copyright 2013 WibiData, Inc.
*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* 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.kiji.schema.impl;
import java.io.IOException;
import java.util.NoSuchElementException;
import com.google.common.base.Preconditions;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.kiji.annotations.ApiAudience;
import org.kiji.schema.EntityId;
import org.kiji.schema.KijiColumnName;
import org.kiji.schema.KijiColumnPagingNotEnabledException;
import org.kiji.schema.KijiDataRequest;
import org.kiji.schema.KijiDataRequestBuilder;
import org.kiji.schema.KijiDataRequestBuilder.ColumnsDef;
import org.kiji.schema.KijiIOException;
import org.kiji.schema.KijiPager;
import org.kiji.schema.KijiRowData;
/**
* Pages through the versions of a fully-qualified column.
*
* <p>
* Each page of versions is fetched by a Get RPC to the region server.
* The page size is translated into the Get's max-versions.
* The page offset is translated into the Get's max-timestamp.
* </p>
*/
@ApiAudience.Private
public final class HBaseVersionPager implements KijiPager {
private static final Logger LOG = LoggerFactory.getLogger(HBaseVersionPager.class);
/** Entity ID of the row being paged through. */
private final EntityId mEntityId;
/** Data request template for the column being paged through. */
private final KijiDataRequest mColumnDataRequest;
/** HBase KijiTable to read from. */
private final HBaseKijiTable mTable;
/** Name of the column being paged through. */
private final KijiColumnName mColumnName;
/** Default page size for this column. */
private final int mDefaultPageSize;
/** Total number of versions to return for the entire column. */
private final int mTotalVersions;
/** Number of versions returned so far. */
private int mVersionsCount = 0;
/** Page offset (in number of cells). */
private long mPageMaxTimestamp;
/** True only if there is another page of data to read through {@link #next()}. */
private boolean mHasNext;
/**
* Initializes an HBaseVersionPager.
*
* <p>
* A fully-qualified column may contain a lot of cells (ie. a lot of versions).
* Fetching all these versions in a single Get is not always realistic.
* This version pager allows one to fetch subsets of the versions at a time.
* </p>
*
* <p>
* To get a pager for a column with paging enabled,
* use {@link KijiRowData#getPager(String, String)}.
* </p>
*
* @param entityId The entityId of the row.
* @param dataRequest The requested data.
* @param table The Kiji table that this row belongs to.
* @param colName Name of the paged column.
* @throws KijiColumnPagingNotEnabledException If paging is not enabled for the specified column.
*/
protected HBaseVersionPager(
EntityId entityId,
KijiDataRequest dataRequest,
HBaseKijiTable table,
KijiColumnName colName)
throws KijiColumnPagingNotEnabledException {
Preconditions.checkArgument(colName.isFullyQualified());
final KijiDataRequest.Column columnRequest =
dataRequest.getColumn(colName.getFamily(), colName.getQualifier());
if (!columnRequest.isPagingEnabled()) {
throw new KijiColumnPagingNotEnabledException(
String.format("Paging is not enabled for column '%s'.", colName));
}
// Construct a data request for only this column.
final KijiDataRequestBuilder builder = KijiDataRequest.builder()
.withTimeRange(dataRequest.getMinTimestamp(), dataRequest.getMaxTimestamp());
builder.newColumnsDef(columnRequest);
mColumnName = colName;
mColumnDataRequest = builder.build();
mDefaultPageSize = columnRequest.getPageSize();
mEntityId = entityId;
mTable = table;
mHasNext = true; // there might be no page to read, but we don't know until we issue an RPC
mPageMaxTimestamp = dataRequest.getMaxTimestamp();
mTotalVersions = columnRequest.getMaxVersions();
mVersionsCount = 0;
// Only retain the table if everything else ran fine:
mTable.retain();
}
/** {@inheritDoc} */
@Override
public boolean hasNext() {
return mHasNext;
}
/** {@inheritDoc} */
@Override
public KijiRowData next() {
return next(mDefaultPageSize);
}
/** {@inheritDoc} */
@Override
public KijiRowData next(int pageSize) {
Preconditions.checkArgument(pageSize > 0, "Page size must be >= 1, got %s", pageSize);
if (!mHasNext) {
throw new NoSuchElementException();
}
final KijiDataRequest.Column columnReq =
mColumnDataRequest.getColumn(mColumnName.getFamily(), mColumnName.getQualifier());
final int maxVersions = Math.min(mTotalVersions - mVersionsCount, pageSize);
// Clone the column data request template, but adjust the max-timestamp and the max-versions:
final KijiDataRequest nextPageDataRequest = KijiDataRequest.builder()
.withTimeRange(mColumnDataRequest.getMinTimestamp(), mPageMaxTimestamp)
.addColumns(ColumnsDef.create()
.withFilter(columnReq.getFilter())
.withMaxVersions(maxVersions)
.add(mColumnName))
.build();
final HBaseDataRequestAdapter adapter = new HBaseDataRequestAdapter(nextPageDataRequest);
try {
final Get hbaseGet = adapter.toGet(mEntityId, mTable.getLayout());
LOG.debug("Sending HBase Get: {}", hbaseGet);
final Result result = mTable.getHTable().get(hbaseGet);
LOG.debug("{} cells were requested, {} cells were received.", result.size(), pageSize);
if (result.size() < maxVersions) {
// We got fewer versions than the number we expected, that means there are no more
// versions to page through:
mHasNext = false;
} else {
// track how far we have gone:
final KeyValue last = result.raw()[result.raw().length - 1];
mPageMaxTimestamp = last.getTimestamp(); // max-timestamp is exclusive
mVersionsCount += result.raw().length;
if ((mPageMaxTimestamp <= mColumnDataRequest.getMinTimestamp())
|| (mVersionsCount >= mTotalVersions)) {
mHasNext = false;
}
}
return new HBaseKijiRowData(mEntityId, nextPageDataRequest, mTable, result);
} catch (IOException ioe) {
throw new KijiIOException(ioe);
}
}
/** {@inheritDoc} */
@Override
public void remove() {
throw new UnsupportedOperationException("KijiPager.remove() is not supported.");
}
/** {@inheritDoc} */
@Override
public void close() throws IOException {
// TODO: Ensure that close() has been invoked properly (through finalize()).
mTable.release();
}
}
| [
"taton@wibidata.com"
] | taton@wibidata.com |
ae95c993142f65e4ea04ad13b250e3106e1573ea | 78f284cd59ae5795f0717173f50e0ebe96228e96 | /factura-negocio/src/cl/stotomas/factura/negocio/formulario_29/copy2/TestingError.java | e9eb15dd7b686ba80706c7af0346c46261e0da81 | [] | no_license | Pattricio/Factura | ebb394e525dfebc97ee2225ffc5fca10962ff477 | eae66593ac653f85d05071b6ccb97fb1e058502d | refs/heads/master | 2020-03-16T03:08:45.822070 | 2018-05-07T15:29:25 | 2018-05-07T15:29:25 | 132,481,305 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,197 | java | package cl.stotomas.factura.negocio.formulario_29.copy2;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
//import cl.stomas.factura.negocio.testing.TestingFinal.Echo;
public class TestingError {
public static String decryptMessage(final byte[] message, byte[] secretKey)
{
try {
// CÓDIGO VULNERABLE
final SecretKeySpec KeySpec = new SecretKeySpec(secretKey, "DES");
final Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, KeySpec);
// RECOMENDACIÓN VERACODE
// final Cipher cipher = Cipher.getInstance("DES...");
// cipher.init(Cipher.DECRYPT_MODE, KeySpec);
return new String(cipher.doFinal(message));
}
catch(Exception e)
{
e.printStackTrace();
}
return null;
}
class Echo {
// Control de Proceso
// Posible reemplazo de librería por una maliciosa
// Donde además se nos muestra el nombre explícito de esta.
public native void runEcho();
{
System.loadLibrary("echo"); // Se carga librería
}
public void main(String[] args)
{
new Echo().runEcho();
}
}
} | [
"Adriana Molano@DESKTOP-GQ96FK8"
] | Adriana Molano@DESKTOP-GQ96FK8 |
e12bba0757de80ec619b1931b5a5b8e45d85bb3a | f59ea6fc21caaa5b9f7ef21cb08ed7337ad1ff5b | /app/src/main/java/com/shengui/app/android/shengui/utils/im/UISquaredImageView.java | 5ec2407d26fd58e8403a1d7248e0d39dd3dfd406 | [] | no_license | chengyue5923/shenguinewproject | bd66ad7d463438a2c848a1f5799c4db49574dcd1 | 9020a4d55befb95d18aa42bf65886c04a2e1630b | refs/heads/master | 2021-01-20T13:06:43.854795 | 2017-05-06T09:08:06 | 2017-05-06T09:08:06 | 90,450,821 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,055 | java | package com.shengui.app.android.shengui.utils.im;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.kdmobi.gui.R;
/**
* 图片组件
* Created by HW on 2015/10/5.
*/
public class UISquaredImageView extends SquaredImageView {
private int WIDTH;
private int HEIGHT;
private int PAINT_ALPHA = 48;
private int mPressedColor;
private Paint mPaint;
private int mShapeType;
private int mRadius;
public UISquaredImageView(Context context) {
super(context);
}
public UISquaredImageView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public UISquaredImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private void init(final Context context, final AttributeSet attrs) {
if (isInEditMode())
return;
final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.UIButton);
mPressedColor = typedArray.getColor(R.styleable.UIButton_color_pressed, getResources().getColor(R.color.color_pressed));
PAINT_ALPHA = typedArray.getInteger(R.styleable.UIButton_alpha_pressed, PAINT_ALPHA);
mShapeType = typedArray.getInt(R.styleable.UIButton_shape_type, 1);
mRadius = typedArray.getDimensionPixelSize(R.styleable.UIButton_ui_radius, getResources().getDimensionPixelSize(R.dimen.twoDp));
typedArray.recycle();
mPaint = new Paint();
mPaint.setStyle(Paint.Style.FILL);
mPaint.setColor(mPressedColor);
this.setWillNotDraw(false);
mPaint.setAlpha(0);
mPaint.setAntiAlias(true);
this.setDrawingCacheEnabled(true);
// this.setClickable(true);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
WIDTH = w;
HEIGHT = h;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (mPaint == null) return;
if (mShapeType == 0) {
canvas.drawCircle(WIDTH/2, HEIGHT/2, WIDTH/2.1038f, mPaint);
} else {
RectF rectF = new RectF();
rectF.set(0, 0, WIDTH, HEIGHT);
canvas.drawRoundRect(rectF, mRadius, mRadius, mPaint);
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mPaint.setAlpha(PAINT_ALPHA);
invalidate();
break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
mPaint.setAlpha(0);
invalidate();
break;
}
return super.onTouchEvent(event);
}
}
| [
"chengyue5923@163.com"
] | chengyue5923@163.com |
764a018105339939e141f234cd17701b3276cc25 | 3ca53c13d2953805c00406476ceda9684887a8ad | /src/com/iwxxm/taf/MDAggregateInformationPropertyType.java | 10b56b66922ec556ac81f8db600592062137631c | [] | no_license | yw2017051032/tac2iwxxm | ae93c12b08b7316cd59de032d4ae2e8082bc6c0b | 5a08cb9ecd0833fd4435bf6db81a2b8126380ec1 | refs/heads/master | 2020-03-17T03:03:06.671868 | 2018-06-05T16:55:59 | 2018-06-05T17:06:03 | 133,217,637 | 3 | 0 | null | null | null | null | GB18030 | Java | false | false | 8,054 | java | //
// 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的
// 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 在重新编译源模式时, 对此文件的所有修改都将丢失。
// 生成时间: 2018.04.04 时间 07:08:22 PM CST
//
package com.iwxxm.taf;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>MD_AggregateInformation_PropertyType complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType name="MD_AggregateInformation_PropertyType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence minOccurs="0">
* <element ref="{http://www.isotc211.org/2005/gmd}MD_AggregateInformation"/>
* </sequence>
* <attGroup ref="{http://www.isotc211.org/2005/gco}ObjectReference"/>
* <attribute ref="{http://www.isotc211.org/2005/gco}nilReason"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MD_AggregateInformation_PropertyType", namespace = "http://www.isotc211.org/2005/gmd", propOrder = {
"mdAggregateInformation"
})
public class MDAggregateInformationPropertyType {
@XmlElement(name = "MD_AggregateInformation")
protected MDAggregateInformationType mdAggregateInformation;
@XmlAttribute(name = "nilReason", namespace = "http://www.isotc211.org/2005/gco")
protected List<String> nilReason;
@XmlAttribute(name = "uuidref")
protected String uuidref;
@XmlAttribute(name = "type", namespace = "http://www.w3.org/1999/xlink")
protected TypeType type;
@XmlAttribute(name = "href", namespace = "http://www.w3.org/1999/xlink")
protected String href;
@XmlAttribute(name = "role", namespace = "http://www.w3.org/1999/xlink")
protected String role;
@XmlAttribute(name = "arcrole", namespace = "http://www.w3.org/1999/xlink")
protected String arcrole;
@XmlAttribute(name = "title", namespace = "http://www.w3.org/1999/xlink")
protected String valueFileSizeTriggerType2;
@XmlAttribute(name = "show", namespace = "http://www.w3.org/1999/xlink")
protected ShowType show;
@XmlAttribute(name = "actuate", namespace = "http://www.w3.org/1999/xlink")
protected ActuateType actuate;
/**
* 获取mdAggregateInformation属性的值。
*
* @return
* possible object is
* {@link MDAggregateInformationType }
*
*/
public MDAggregateInformationType getMDAggregateInformation() {
return mdAggregateInformation;
}
/**
* 设置mdAggregateInformation属性的值。
*
* @param value
* allowed object is
* {@link MDAggregateInformationType }
*
*/
public void setMDAggregateInformation(MDAggregateInformationType value) {
this.mdAggregateInformation = value;
}
/**
* Gets the value of the nilReason property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nilReason property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNilReason().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNilReason() {
if (nilReason == null) {
nilReason = new ArrayList<String>();
}
return this.nilReason;
}
/**
* 获取uuidref属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getUuidref() {
return uuidref;
}
/**
* 设置uuidref属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUuidref(String value) {
this.uuidref = value;
}
/**
* 获取type属性的值。
*
* @return
* possible object is
* {@link TypeType }
*
*/
public TypeType getType() {
if (type == null) {
return TypeType.SIMPLE;
} else {
return type;
}
}
/**
* 设置type属性的值。
*
* @param value
* allowed object is
* {@link TypeType }
*
*/
public void setType(TypeType value) {
this.type = value;
}
/**
* 获取href属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getHref() {
return href;
}
/**
* 设置href属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setHref(String value) {
this.href = value;
}
/**
* 获取role属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getRole() {
return role;
}
/**
* 设置role属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRole(String value) {
this.role = value;
}
/**
* 获取arcrole属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getArcrole() {
return arcrole;
}
/**
* 设置arcrole属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArcrole(String value) {
this.arcrole = value;
}
/**
* 获取valueFileSizeTriggerType2属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getValueFileSizeTriggerType2() {
return valueFileSizeTriggerType2;
}
/**
* 设置valueFileSizeTriggerType2属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValueFileSizeTriggerType2(String value) {
this.valueFileSizeTriggerType2 = value;
}
/**
* 获取show属性的值。
*
* @return
* possible object is
* {@link ShowType }
*
*/
public ShowType getShow() {
return show;
}
/**
* 设置show属性的值。
*
* @param value
* allowed object is
* {@link ShowType }
*
*/
public void setShow(ShowType value) {
this.show = value;
}
/**
* 获取actuate属性的值。
*
* @return
* possible object is
* {@link ActuateType }
*
*/
public ActuateType getActuate() {
return actuate;
}
/**
* 设置actuate属性的值。
*
* @param value
* allowed object is
* {@link ActuateType }
*
*/
public void setActuate(ActuateType value) {
this.actuate = value;
}
}
| [
"852406820@qq.com"
] | 852406820@qq.com |
b3f9a1ee379a322b0365bb63b78e95c8e26e31fd | dd76d0b680549acb07278b2ecd387cb05ec84d64 | /divestory-Fernflower/com/google/common/base/FunctionalEquivalence.java | b85cee2fe72d788c5619b334363912a3c2149be0 | [] | no_license | ryangardner/excursion-decompiling | 43c99a799ce75a417e636da85bddd5d1d9a9109c | 4b6d11d6f118cdab31328c877c268f3d56b95c58 | refs/heads/master | 2023-07-02T13:32:30.872241 | 2021-08-09T19:33:37 | 2021-08-09T19:33:37 | 299,657,052 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,710 | java | package com.google.common.base;
import java.io.Serializable;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
final class FunctionalEquivalence<F, T> extends Equivalence<F> implements Serializable {
private static final long serialVersionUID = 0L;
private final Function<F, ? extends T> function;
private final Equivalence<T> resultEquivalence;
FunctionalEquivalence(Function<F, ? extends T> var1, Equivalence<T> var2) {
this.function = (Function)Preconditions.checkNotNull(var1);
this.resultEquivalence = (Equivalence)Preconditions.checkNotNull(var2);
}
protected boolean doEquivalent(F var1, F var2) {
return this.resultEquivalence.equivalent(this.function.apply(var1), this.function.apply(var2));
}
protected int doHash(F var1) {
return this.resultEquivalence.hash(this.function.apply(var1));
}
public boolean equals(@NullableDecl Object var1) {
boolean var2 = true;
if (var1 == this) {
return true;
} else if (!(var1 instanceof FunctionalEquivalence)) {
return false;
} else {
FunctionalEquivalence var3 = (FunctionalEquivalence)var1;
if (!this.function.equals(var3.function) || !this.resultEquivalence.equals(var3.resultEquivalence)) {
var2 = false;
}
return var2;
}
}
public int hashCode() {
return Objects.hashCode(this.function, this.resultEquivalence);
}
public String toString() {
StringBuilder var1 = new StringBuilder();
var1.append(this.resultEquivalence);
var1.append(".onResultOf(");
var1.append(this.function);
var1.append(")");
return var1.toString();
}
}
| [
"ryan.gardner@coxautoinc.com"
] | ryan.gardner@coxautoinc.com |
25657e52043780d94f9e299a2f91cf96fac8292a | 71201748e0b19ffa382d7f17c52194b587665fa4 | /products/sarldoc/src/main/java/io/sarl/sarldoc/modules/internal/SarldocApplicationModule.java | 4daffd183acb804fe6991f45fc788980b3da4c52 | [
"Apache-2.0"
] | permissive | Draf09/sarl | 0e79aaf72e1b0999e426a556302ab89a8fa296ad | eb0cb1a621b4052cb2a5a4ef8e1756de4676f1ec | refs/heads/master | 2022-11-24T15:41:57.807507 | 2020-07-29T21:24:38 | 2020-07-30T14:50:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,647 | java | /*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2020 the original authors 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.sarl.sarldoc.modules.internal;
import static io.bootique.BQCoreModule.extend;
import java.text.MessageFormat;
import javax.inject.Provider;
import javax.inject.Singleton;
import com.google.inject.AbstractModule;
import org.arakhne.afc.bootique.applicationdata2.annotations.DefaultApplicationName;
import org.arakhne.afc.bootique.synopsishelp.annotations.ApplicationArgumentSynopsis;
import org.arakhne.afc.bootique.synopsishelp.annotations.ApplicationDetailedDescription;
import io.sarl.lang.SARLConfig;
import io.sarl.maven.bootiqueapp.utils.SystemProperties;
import io.sarl.sarldoc.Constants;
import io.sarl.sarldoc.commands.SarldocCommand;
import io.sarl.sarldoc.configs.SarldocConfig;
/** Module for configuring the sarldoc application information.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.10
*/
public class SarldocApplicationModule extends AbstractModule {
@Override
protected void configure() {
// Name of the application.
bind(String.class).annotatedWith(DefaultApplicationName.class).toInstance(
SystemProperties.getValue(SarldocConfig.PREFIX + ".programName", Constants.PROGRAM_NAME)); //$NON-NLS-1$
// Short description of the application.
extend(binder()).setApplicationDescription(Messages.SarldocApplicationModule_0);
// Long description of the application.
bind(String.class).annotatedWith(ApplicationDetailedDescription.class).toProvider(LongDescriptionProvider.class).in(Singleton.class);
// Synopsis of the application's arguments.
bind(String.class).annotatedWith(ApplicationArgumentSynopsis.class).toInstance(Messages.SarldocApplicationModule_1);
// Default command
extend(binder()).setDefaultCommand(SarldocCommand.class);
}
/** Provider of the long description of the application.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @since 0.10
*/
private static class LongDescriptionProvider implements Provider<String> {
@Override
public String get() {
final String sarlOutputDirectory = SARLConfig.FOLDER_SOURCE_GENERATED;
final String sarlOutputDirectoryOption = "--" + io.sarl.lang.sarlc.Constants.SARL_OUTPUT_DIRECTORY_OPTION; //$NON-NLS-1$
final String javaOutputDirectory = SARLConfig.FOLDER_BIN;
final String javaOutputDirectoryOption = "--" + io.sarl.lang.sarlc.Constants.JAVA_OUTPUT_DIRECTORY_OPTION; //$NON-NLS-1$
final String docOutputDirectory = SarldocConfig.DOC_OUTPUT_DIRECTORY_VALUE;
final String docOutputDirectoryOption = "--" + Constants.DOCUMENTATION_OUTPUT_DIRECTORY_OPTION; //$NON-NLS-1$
return MessageFormat.format(Messages.SarldocApplicationModule_2,
sarlOutputDirectory, sarlOutputDirectoryOption,
javaOutputDirectory, javaOutputDirectoryOption,
docOutputDirectory, docOutputDirectoryOption);
}
}
}
| [
"galland@arakhne.org"
] | galland@arakhne.org |
cfd84cac88e43f492e14182089642b4552da3aec | 0cc2845f9d22be098cb7b1f28d1bf432bac2be3e | /SAA/FONTE/saaservico/src/main/java/br/com/saa/servico/RotinaServico.java | 3b166cd257154b6ed41481f7e526acf663f8fbb4 | [] | no_license | elimarcosarouca/imec | ed9075b2868c18f2826a2aaab2d2d5a5960eea6c | f9d15df690c10bf034cb4b82dbf67121b63d573a | refs/heads/master | 2021-01-10T12:34:00.437093 | 2015-08-13T03:19:00 | 2015-08-13T03:19:00 | 43,327,018 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package br.com.saa.servico;
import java.util.List;
import br.com.saa.modelo.entidade.Rotina;
public interface RotinaServico extends IService<Rotina, Long> {
public List<Rotina> listaRotinasPorPerfil(Long id);
public List<Rotina> findByNomeLike(String nome);
} | [
"claudemirramosferreira@gmail.com"
] | claudemirramosferreira@gmail.com |
3bc94291afb73ddb494b8733f22d81bdc6a4e1a7 | 98d61e74003e599e70e5fe37829db567f2119c74 | /jsystem-core-system-objects/FileTransfer-tests/src/main/java/com/aqua/filetransfer/ftp/FTPClientTest.java | 511cb44160cd9cc332db7b609a7403e3738754ac | [
"Apache-2.0"
] | permissive | Top-Q/jsystem | e3721e981fcdfa305c7d2679f98105124b705ff6 | 282064793b64dad8de685dd6d5332d5bd753f07b | refs/heads/master | 2023-07-08T03:02:09.358983 | 2022-05-25T06:04:50 | 2022-05-25T06:04:50 | 6,123,437 | 35 | 53 | Apache-2.0 | 2023-06-28T12:06:26 | 2012-10-08T11:33:14 | Java | UTF-8 | Java | false | false | 3,046 | java | /*
* Copyright 2005-2010 Ignis Software Tools Ltd. All rights reserved.
*/
package com.aqua.filetransfer.ftp;
import java.io.File;
import jsystem.framework.JSystemProperties;
import jsystem.utils.FileUtils;
import junit.framework.SystemTestCase;
public class FTPClientTest extends SystemTestCase {
private static FTPServer server;
private FTPClient client;
private File tempFile;
public void setUp() throws Exception {
if (server == null){
JSystemProperties.getInstance().setPreference("com.aqua.filetransfer.ftp.ftpserver","127.0.0.1");
server = new FTPServer();
server.init();
server.startServer();
}
client = (FTPClient)system.getSystemObject("ftpClient");
client.connect();
}
public void tearDown() throws Exception{
if (tempFile != null){
tempFile.delete();
}
if (client != null){
client.disconnect();
}
}
public void testSleep() throws Exception {
sleep(60000);
}
public void testPutFile() throws Exception {
File serverPath = server.getServerRootDirectory();
File fileInServer = new File(serverPath,"testPutFile.txt");
assertTrue(!fileInServer.exists() || fileInServer.delete());
tempFile = File.createTempFile("ftpClient",".txt");
client.putFile(tempFile.getPath(),"testPutFile.txt");
assertTrue(fileInServer.exists());
}
public void testGetFile() throws Exception {
tempFile = new File("testGetFile.txt");
assertTrue(!tempFile.exists() || tempFile.delete());
File serverPath = server.getServerRootDirectory();
File fileInServer = new File(serverPath,"testGetFileRemote.txt");
FileUtils.write(fileInServer.getPath(), "shalom");
client.getFile("testGetFileRemote.txt",tempFile.getPath());
assertTrue(tempFile.exists());
}
public void testMoveFile() throws Exception {
File serverPath = server.getServerRootDirectory();
tempFile = new File(serverPath,"testMoveFileAfterMove.txt");
assertTrue(!tempFile.exists() || tempFile.delete());
File fileInServer = new File(serverPath,"testMoveFile.txt");
FileUtils.write(fileInServer.getPath(), "shalom");
client.moveFile("testMoveFile.txt", "testMoveFileAfterMove.txt");
assertTrue(tempFile.exists());
assertTrue(!fileInServer.exists());
}
public void testDeleteFile() throws Exception{
File serverPath = server.getServerRootDirectory();
File fileInServer = new File(serverPath,"testDeleteFile.txt");
FileUtils.write(fileInServer.getPath(), "shalom");
client.deleteFile("testDeleteFile.txt");
assertTrue(!fileInServer.exists());
}
public void testMakeDirectory() throws Exception{
File serverPath = server.getServerRootDirectory();
File fileInServer = new File(serverPath,"testMakeDirectory/testMakeDirectory.txt");
FileUtils.deltree(new File(serverPath,"testMakeDirectory"));
assertTrue(!fileInServer.exists() || fileInServer.delete());
tempFile = File.createTempFile("testMakeDirectory",".txt");
client.makeDirectory("testMakeDirectory");
client.putFile(tempFile.getPath(),"testMakeDirectory/testMakeDirectory.txt");
assertTrue(fileInServer.exists());
}
}
| [
"itai.agmon@gmail.com"
] | itai.agmon@gmail.com |
5ea949b2986616052c4c614a9c28dc31973fc8fd | d18af2a6333b1a868e8388f68733b3fccb0b4450 | /java/src/com/google/android/gms/internal/zzht$zza.java | 7237954823a342eec3b7130f7827e2cbd76ba00d | [] | no_license | showmaxAlt/showmaxAndroid | 60576436172495709121f08bd9f157d36a077aad | d732f46d89acdeafea545a863c10566834ba1dec | refs/heads/master | 2021-03-12T20:01:11.543987 | 2015-08-19T20:31:46 | 2015-08-19T20:31:46 | 41,050,587 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.internal;
import java.io.InputStream;
// Referenced classes of package com.google.android.gms.internal:
// zzht
public static interface
{
public abstract Object zzb(InputStream inputstream);
public abstract Object zzdQ();
}
| [
"invisible@example.com"
] | invisible@example.com |
b1f39cbe7f8c9fd67e230a7c7c31878e012e1abe | 846b7ce05c7985564faec716fb9ebf6fc330af32 | /vertx-web-client/src/test/java/io/vertx/ext/web/client/jackson/WineAndCheese.java | 8fe82d9b15a28e1816e8ab4b32d9735774ae1faa | [
"Apache-2.0"
] | permissive | AlexeySoshin/vertx-web | c0497e8fe4cc7b86621c14fb692676035ed91282 | d422c71b0d4b4f5657fb6d7992004e2774b05dc5 | refs/heads/master | 2023-02-25T01:51:25.979838 | 2018-11-22T16:28:09 | 2018-11-22T16:28:09 | 125,709,934 | 2 | 0 | Apache-2.0 | 2023-02-10T09:38:48 | 2018-03-18T09:31:45 | Java | UTF-8 | Java | false | false | 767 | java | package io.vertx.ext.web.client.jackson;
import java.util.Objects;
/**
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a>
*/
public class WineAndCheese {
private String wine;
private String cheese;
public String getWine() {
return wine;
}
public WineAndCheese setWine(String wine) {
this.wine = wine;
return this;
}
public String getCheese() {
return cheese;
}
public WineAndCheese setCheese(String cheese) {
this.cheese = cheese;
return this;
}
@Override
public boolean equals(Object obj) {
if (obj instanceof WineAndCheese) {
WineAndCheese that = (WineAndCheese) obj;
return Objects.equals(wine, that.wine) && Objects.equals(cheese, that.cheese);
}
return false;
}
}
| [
"julien@julienviet.com"
] | julien@julienviet.com |
9bc854fb77fae12b6da7933079860b45539fe1b4 | 674b10a0a3e2628e177f676d297799e585fe0eb6 | /src/main/java/androidx/lifecycle/FullLifecycleObserver.java | 9bd81963497856daeefd8b05d78de8e8ef6faec9 | [] | no_license | Rune-Status/open-osrs-osrs-android | 091792f375f1ea118da4ad341c07cb73f76b3e03 | 551b86ab331af94f66fe0dcb3adc8242bf3f472f | refs/heads/master | 2020-08-08T03:32:10.802605 | 2019-10-08T15:50:18 | 2019-10-08T15:50:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package androidx.lifecycle;
interface FullLifecycleObserver extends LifecycleObserver {
void onCreate(LifecycleOwner arg1);
void onDestroy(LifecycleOwner arg1);
void onPause(LifecycleOwner arg1);
void onResume(LifecycleOwner arg1);
void onStart(LifecycleOwner arg1);
void onStop(LifecycleOwner arg1);
}
| [
"kslrtips@gmail.com"
] | kslrtips@gmail.com |
aa4b50ef9a9492b355f9812ef04592a537ee5100 | 5f8109fa4637634b458c196967e0a8d9a0bb2c3c | /workspace_07_08/java_02/src/day19/Node.java | 302e31753edbaaf883776fad6c4573f149efa4d6 | [] | no_license | mini222333/mini | 72e7a9f2126dfdd0b5dde551cfaa4d375c0256d2 | 787b02e0d4db27a208a3e2cac652711898ed2cbe | refs/heads/master | 2020-07-29T09:31:16.776045 | 2019-09-20T08:54:40 | 2019-09-20T08:54:40 | 209,746,612 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 441 | java | package day19;
public class Node<E>{
E data;
Node<E> next;
//그 다음 데이터 얘기해줌 null이면 그 다음 데이터 없음
//이런식으로 데이터 관리된다까지 알아두기
public Node(E data, Node<E> next) {//링크드리스트는 노드기반
this.data = data;
this.next = next;
}
@Override
public String toString() {
return "Node [data=" + data + ", next=" + next + "]";
}
}
| [
"user@DESKTOP-V882PTR"
] | user@DESKTOP-V882PTR |
c8a691ed57f64410824b2aeee29143635b0a63c0 | 14d4fa5f2eb32853f72f791de4bf92f76022b9da | /SimpleSDK/src/org/bouncycastle/bcpg/MPInteger.java | 940d782d656e158b65880b25bf4a2262788ded65 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-proprietary-license",
"JSON",
"LicenseRef-scancode-warranty-disclaimer",
"EPL-1.0"
] | permissive | SKT-ThingPlug2/device-sdk-javame | 253ece8b8f41286256c27bae07a242dc551ff8c6 | 2a965a8d882b3a4e36753c7b81f152a9b56614d3 | refs/heads/master | 2021-05-02T12:52:01.394954 | 2018-03-09T08:22:25 | 2018-03-09T08:22:25 | 120,748,806 | 1 | 5 | Apache-2.0 | 2018-03-23T06:16:34 | 2018-02-08T10:48:43 | Java | UTF-8 | Java | false | false | 1,288 | java | package org.bouncycastle.bcpg;
import java.io.IOException;
import javax.math.BigInteger;
/**
* a multiple precision integer
*/
public class MPInteger
extends BCPGObject
{
BigInteger value = null;
public MPInteger(
BCPGInputStream in)
throws IOException
{
int length = (in.read() << 8) | in.read();
byte[] bytes = new byte[(length + 7) / 8];
in.readFully(bytes);
value = new BigInteger(1, bytes);
}
public MPInteger(
BigInteger value)
{
if (value == null || value.signum() < 0)
{
throw new IllegalArgumentException("value must not be null, or negative");
}
this.value = value;
}
public BigInteger getValue()
{
return value;
}
public void encode(
BCPGOutputStream out)
throws IOException
{
int length = value.bitLength();
out.write(length >> 8);
out.write(length);
byte[] bytes = value.toByteArray();
if (bytes[0] == 0)
{
out.write(bytes, 1, bytes.length - 1);
}
else
{
out.write(bytes, 0, bytes.length);
}
}
}
| [
"lesmin@sk.com"
] | lesmin@sk.com |
c7145a4242ee6c2857ae44aa42eaf077e4a48b1b | bb302c89db6cd4a4d9ab7571796368c35445c2cd | /libs41/src/main/java/com/seasunny/authentication/enums/SmsStatusEnum.java | 8034a6118003698dfe2d2674aab9df23da0dba84 | [] | no_license | seasunny1229/SpringCloud | ee008c0114bdeb8f297db54261b324855275991c | 5c87263df9c59d895784318aa6126bb0221edf71 | refs/heads/master | 2023-03-21T03:32:14.584007 | 2021-03-14T14:48:40 | 2021-03-14T14:48:40 | 302,620,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.seasunny.authentication.enums;
public enum SmsStatusEnum {
USED("U", "已使用"),
NOT_USED("N", "未使用");
private String code;
private String desc;
SmsStatusEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getDesc() {
return desc;
}
}
| [
"sea_sunny1229@163.com"
] | sea_sunny1229@163.com |
62f841d64d6a0850622f4b2a8a1ee40df509e8df | a125e0a6ff70c7fc6b90311bb5f5d19f99bb80c2 | /src/simple/bean/Employee.java | 6dfe4016fb05ca17a9aa86a88f2974fbe75424ef | [] | no_license | borjur/EmployeeForm | 70152c0a820cfec7b3d3bc33644f5b12b6641a92 | 136f6946191b9e2fd12ec30c883a257cb604333d | refs/heads/master | 2021-01-01T15:36:17.988207 | 2014-06-18T05:16:19 | 2014-06-18T05:16:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | package simple.bean;
public class Employee {
private String employeeNo = "";
private String firstName = "";
private String middleName = "";
private String lastName = "";
public String getEmployeeNo() {
return employeeNo;
}
public void setEmployeeNo(String employeeNo) {
this.employeeNo = employeeNo;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getMiddleName() {
return middleName;
}
public void setMiddleName(String middleName) {
this.middleName = middleName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
| [
"borisjurosevic001@gmail.com"
] | borisjurosevic001@gmail.com |
140e25f1071c99808938133b70abd9f4b5a55d2d | c7dc8c3b6c5f0c836f5ccce772be2f4252e0eae5 | /src/main/java/com/peycash/persistence/dao/impl/MessageTypeDAOImpl.java | 10a21443ceb6e2e1b531fb6b515264251b884f9e | [] | no_license | amaro-coria/Peycash | f6b09cd5e59b7291f8994ae4786caaf61f0497f5 | 90210f4dfa0a1d227a3ca60e38126f257355555e | refs/heads/master | 2021-01-17T13:57:21.372340 | 2016-07-06T07:08:33 | 2016-07-06T07:08:33 | 17,179,205 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | /*
* Peycash 2014 - All rights reserved
*/
package com.peycash.persistence.dao.impl;
import org.springframework.stereotype.Repository;
import com.peycash.persistence.dao.MessageTypeDAO;
import com.peycash.persistence.domain.Messagetype;
/**
* Implementation of the interface to access the persistence entity Messagetype
*
* @author Jorge Amaro
* @author Aline Ordoñez
* @version 1.1
* @since 1.0
*
*/
@Repository
public class MessageTypeDAOImpl extends BaseDAOImpl<Messagetype, Long>
implements MessageTypeDAO {
}
| [
"amaro.coria@gmail.com"
] | amaro.coria@gmail.com |
98b1e6ec3e4a593a89495a03a986923793bcebd3 | 4991436c2b266b2892363b4e8d421247a8d29c6e | /checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/finallocalvariable/InputFinalLocalVariableNameShadowing.java | 02a25f20b92e2d939174c57955d5c5412749f22e | [
"Apache-2.0"
] | permissive | spoole167/java-static-analysis-samples | d9f970104bb69abb968e0ecf09c11aa25c364ebd | 880f9b394e531d8c03af425b1b4e5a95302a3359 | refs/heads/main | 2023-08-14T22:26:12.012352 | 2021-09-15T05:50:20 | 2021-09-15T05:50:20 | 406,629,824 | 0 | 0 | Apache-2.0 | 2021-09-15T05:49:41 | 2021-09-15T05:49:41 | null | UTF-8 | Java | false | false | 854 | java | /*
FinalLocalVariable
validateEnhancedForLoopVariable = (default)false
tokens = PARAMETER_DEF,VARIABLE_DEF
*/
package com.puppycrawl.tools.checkstyle.checks.coding.finallocalvariable;
class InputFinalLocalVariableNameShadowing {
public void foo(String text) { // violation
System.identityHashCode(text);
class Bar {
void bar (String text) {
text = "xxx";
}
}
}
}
class Foo2 {
public void foo() {
int x; // violation
class Bar {
void bar () {
int x = 1;
x++;
x++;
}
}
}
}
enum InputFinalLocalVariableNameShadowingEnum{
test;
final String foo1 = "error";
InputFinalLocalVariableNameShadowingEnum()
{
String foo = foo1;
foo += foo1;
}
}
| [
"spoole167@googlemail.com"
] | spoole167@googlemail.com |
9e4e8fd7046e036947c52143d913bc7b2495d29f | bb1b2793c965f2982d27206d13820f09d288ab99 | /JpaExample/src/com/isbank/rest/constraint/MyAnnoValid.java | 745d143726a2dc5c8c3a80e630ab84ac085bdccf | [] | no_license | osmanyaycioglu/ishiber | 9724b98fbc38a5b9d40a2bb52afc975f7c569d5d | 6fdf9e137076e23df4dd8ead8e6f8b14de3988f5 | refs/heads/master | 2021-02-12T23:43:58.499731 | 2020-03-06T13:18:39 | 2020-03-06T13:18:39 | 244,643,193 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 675 | java | package com.isbank.rest.constraint;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
@Retention(RUNTIME)
@Target({ FIELD, METHOD })
@Constraint(validatedBy = MyValidator.class)
public @interface MyAnnoValid {
int length() default 20;
String message() default "{javax.validation.constraints.MyAnno.message}";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
}
| [
"osman.yaycioglu@gmail.com"
] | osman.yaycioglu@gmail.com |
6441d5fb36831b5c16445c652b5bfe3d27c825d1 | 99ed166aee0c49e3be5b257587ae953d02cd4e0b | /ews/src/main/java/com/github/huifer/ews/domain/em/OperatorEnums.java | 5aa64e1596328223084652d8d584f28e0e09e8ac | [
"Apache-2.0"
] | permissive | huifer/ews | 2d2a6c18b6b361f338d1f47734e937a756644177 | 53dee9bf75d6e521a81e6c6b7da18da7d79cb7b7 | refs/heads/main | 2023-06-24T23:33:21.673283 | 2021-08-02T01:31:15 | 2021-08-02T01:31:15 | 387,712,036 | 1 | 0 | null | 2021-07-22T08:14:18 | 2021-07-20T07:38:39 | Java | UTF-8 | Java | false | false | 719 | java | package com.github.huifer.ews.domain.em;
public enum OperatorEnums {
EQ("==", "等于", 0),
NEQ("!=", "不等于", 1),
GTE(">=", "大于等于", 2),
GT(">", "大于", 3),
LT("<", "小于", 4),
LTE("<=", "小于等于", 5);
private final String code;
private final String name;
private final int id;
OperatorEnums(String code, String name, int id) {
this.code = code;
this.name = name;
this.id = id;
}
public static OperatorEnums oc(int i) {
for (OperatorEnums value : OperatorEnums.values()) {
if (value.id == i) {
return value;
}
}
return null;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
}
| [
"huifer97@163.com"
] | huifer97@163.com |
46001ef59e90acbd8ffa34c0c0ae02d26b3e7cd7 | 9b294c3bf262770e9bac252b018f4b6e9412e3ee | /camerazadas/source/apk/com.sonyericsson.android.camera/src-cfr-nocode/android/support/v4/util/AtomicFile.java | 1a5d1b9aa5e406b74662537821e1d7dd807137e7 | [] | no_license | h265/camera | 2c00f767002fd7dbb64ef4dc15ff667e493cd937 | 77b986a60f99c3909638a746c0ef62cca38e4235 | refs/heads/master | 2020-12-30T22:09:17.331958 | 2015-08-25T01:22:25 | 2015-08-25T01:22:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | /*
* Decompiled with CFR 0_100.
*/
package android.support.v4.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/*
* Exception performing whole class analysis.
*/
public class AtomicFile {
private final File mBackupName;
private final File mBaseName;
public AtomicFile(File var1);
static boolean sync(FileOutputStream var0);
public void delete();
public void failWrite(FileOutputStream var1);
public void finishWrite(FileOutputStream var1);
public File getBaseFile();
public FileInputStream openRead() throws FileNotFoundException;
public byte[] readFully() throws IOException;
public FileOutputStream startWrite() throws IOException;
}
| [
"jmrm@ua.pt"
] | jmrm@ua.pt |
44f1f7a930f4f35bff9ab1d1a9aed46089ac2fea | f1ad958a3398c2ffece6e7b7ddad73a77e4d8483 | /multi-thread-programming/src/main/java/ch03/stack_2/MyStack.java | 5265e32921f2e7bac06d5ef5a14432c4061f75ef | [] | no_license | skjme/csf-pro | 46b824f99ad8ebf7a5d241b1bda5b13801c4a679 | 6271ea2e8bdd72f43c1575bdbfa1d8c52b6e3b56 | refs/heads/master | 2023-01-23T18:26:19.666611 | 2022-04-12T06:47:31 | 2022-04-12T06:47:31 | 146,056,071 | 2 | 0 | null | 2023-01-04T19:46:07 | 2018-08-25T01:54:51 | JavaScript | UTF-8 | Java | false | false | 1,276 | java | package ch03.stack_2;
import java.util.ArrayList;
import java.util.List;
public class MyStack {
private List list = new ArrayList();
synchronized public void push(){
try{
while (list.size() == 1){ // 注意这里不是if而是while, 避免多个呈wait状态的状态被唤醒
this.wait();
}
list.add("anyString=" + Math.random());
this.notifyAll(); // 防止假死
System.out.println("push=" + list.size());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
synchronized public String pop(){
String returnValue = "";
try{
while (list.size() == 0){ // 注意这里不是if而是while, 避免多个呈wait状态的状态被唤醒
System.out.println("pop操作中的:" + Thread.currentThread().getName()
+ " 线程呈wait状态");
this.wait();
}
returnValue = "" + list.get(0);
list.remove(0);
this.notifyAll(); // 防止假死
System.out.println("pop=" + list.size());
} catch (InterruptedException e) {
e.printStackTrace();
}
return returnValue;
}
}
| [
"chase.shu@asia.training"
] | chase.shu@asia.training |
f287b599926d92c30fb1bc1dc221d680d8bbf1ad | 0e06e096a9f95ab094b8078ea2cd310759af008b | /sources/com/google/android/gms/nearby/messages/internal/zzaz.java | 2843c60ab17125b08be77b5e409719cdce1c2b52 | [] | no_license | Manifold0/adcom_decompile | 4bc2907a057c73703cf141dc0749ed4c014ebe55 | fce3d59b59480abe91f90ba05b0df4eaadd849f7 | refs/heads/master | 2020-05-21T02:01:59.787840 | 2019-05-10T00:36:27 | 2019-05-10T00:36:27 | 185,856,424 | 1 | 2 | null | 2019-05-10T00:36:28 | 2019-05-09T19:04:28 | Java | UTF-8 | Java | false | false | 885 | java | package com.google.android.gms.nearby.messages.internal;
import android.os.RemoteException;
import com.google.android.gms.common.api.Api.AnyClient;
import com.google.android.gms.common.api.internal.ListenerHolder;
import com.google.android.gms.common.api.internal.RegisterListenerMethod;
import com.google.android.gms.tasks.TaskCompletionSource;
final class zzaz extends RegisterListenerMethod<zzah, T> {
private final /* synthetic */ zzak zzia;
private final /* synthetic */ zzbd zzid;
zzaz(zzak zzak, ListenerHolder listenerHolder, zzbd zzbd) {
this.zzia = zzak;
this.zzid = zzbd;
super(listenerHolder);
}
protected final /* synthetic */ void registerListener(AnyClient anyClient, TaskCompletionSource taskCompletionSource) throws RemoteException {
this.zzid.zza((zzah) anyClient, this.zzia.zza(taskCompletionSource));
}
}
| [
"querky1231@gmail.com"
] | querky1231@gmail.com |
f0bc9df4ae694ae8188dd5d83a3d0533bab1ff22 | 712804efc761f095340a1128c4a7577a9fd4fcdd | /src/main/java/com/twineworks/tweakflow/lang/types/BooleanType.java | 5936deb2d72c603b52359ab79ce5346ea7706437 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | gitter-badger/tweakflow | 097a47567373abaa9a93f61750381ee41e0db9a0 | cfabfc96f1f6bcda18ec050108cfe64c2517868f | refs/heads/master | 2020-05-14T09:52:43.062608 | 2019-04-16T19:11:37 | 2019-04-16T19:11:37 | 181,751,285 | 1 | 1 | null | 2019-04-16T19:12:44 | 2019-04-16T19:12:44 | null | UTF-8 | Java | false | false | 4,249 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2019 Twineworks GmbH
*
* 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.twineworks.tweakflow.lang.types;
import com.twineworks.tweakflow.lang.values.Value;
import com.twineworks.tweakflow.lang.values.Values;
final public class BooleanType implements Type {
@Override
public String name() {
return "boolean";
}
@Override
public boolean isAny() {
return false;
}
@Override
public boolean isVoid() {
return false;
}
@Override
public boolean isString() {
return false;
}
@Override
public boolean isNumeric() {
return false;
}
@Override
public boolean isLong() {
return false;
}
@Override
public boolean isDouble() {
return false;
}
@Override
public boolean isDateTime() {
return false;
}
@Override
public boolean isBigInteger() {
return false;
}
@Override
public boolean isBigDecimal() {
return false;
}
@Override
public boolean isBoolean() {
return true;
}
@Override
public boolean isBinary() {
return false;
}
@Override
public boolean isDict() {
return false;
}
@Override
public boolean isList() {
return false;
}
@Override
public boolean isSet() {
return false;
}
@Override
public boolean isContainer() {
return false;
}
@Override
public boolean isFunction() {
return false;
}
@Override
public boolean canAttemptCastTo(Type type) {
return type.canAttemptCastFrom(this);
}
@Override
public boolean canAttemptCastFrom(Type type) {
return true; // everything casts to boolean somehow
}
@Override
public Value castFrom(Value x) {
if (x == Values.NIL) return Values.NIL;
Type srcType = x.type();
if (srcType == Types.BOOLEAN){
return x;
}
else if (srcType == Types.LIST){
return x.list().size() == 0 ? Values.FALSE : Values.TRUE;
}
else if (srcType == Types.DICT){
return x.dict().size() == 0 ? Values.FALSE : Values.TRUE;
}
else if (srcType == Types.DOUBLE){
Double d = x.doubleNum();
if (Double.isNaN(d)) return Values.FALSE;
if (d.equals(0.0d)) return Values.FALSE;
if (d.equals(-0.0d)) return Values.FALSE;
return Values.TRUE;
}
else if (srcType == Types.LONG){
Long n = x.longNum();
return (n == 0L) ? Values.FALSE : Values.TRUE;
}
else if (srcType == Types.FUNCTION){
return Values.TRUE;
}
else if (srcType == Types.DATETIME){
return Values.TRUE;
}
else if (srcType == Types.STRING){
return (x.string().length() == 0) ? Values.FALSE : Values.TRUE;
}
throw new AssertionError("Unknown type "+srcType);
}
@Override
public int valueHash(Value x) {
return x == Values.FALSE ? 0 : 1;
}
@Override
public boolean valueEquals(Value x, Value o) {
// boolean values are singletons
return x == o;
}
@Override
public boolean valueAndTypeEquals(Value x, Value o) {
// boolean values are singletons
return x == o;
}
@Override
public String toString() {
return name();
}
@Override
public int hashCode() {
return name().hashCode();
}
}
| [
"slawomir.chodnicki@gmail.com"
] | slawomir.chodnicki@gmail.com |
33519b8650e1beafb44d4d6efb935431f40526f6 | a3a54e8c694730ea5ae071cc198db50582ca7ab6 | /学习笔记/Android notes/1.基础/【黑马52】day35_Android应用开发-新特性和知识点回顾/code/ObjectAnimator/gen/com/example/objectanimator/BuildConfig.java | c5dc9f45c84dad911ad41ca7dda578834d3a9a84 | [] | no_license | zhhqiang9198/Giovani-resource | 3f807c97f231a00b694a1bd8adaa7816aab90af4 | aa30dcac2af0b34c6f14f55635199a9319ef3685 | refs/heads/master | 2021-10-18T17:15:22.759832 | 2019-01-16T10:01:20 | 2019-01-16T10:01:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 168 | java | /** Automatically generated file. DO NOT MODIFY */
package com.example.objectanimator;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"15219331778@163.com"
] | 15219331778@163.com |
2e1621d6f6917a842a7c08e5fd1474790bd10a3d | 58df55b0daff8c1892c00369f02bf4bf41804576 | /src/com/android/mail/ui/ShortcutNameActivity.java | 4802c75899f476b5da8d2a38189c553360b02dff | [] | no_license | gafesinremedio/com.google.android.gm | 0b0689f869a2a1161535b19c77b4b520af295174 | 278118754ea2a262fd3b5960ef9780c658b1ce7b | refs/heads/master | 2020-05-04T15:52:52.660697 | 2016-07-21T03:39:17 | 2016-07-21T03:39:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,363 | java | package com.android.mail.ui;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.Selection;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import buc;
import bue;
import bug;
public class ShortcutNameActivity
extends Activity
implements View.OnClickListener, TextView.OnEditorActionListener
{
private EditText a;
private String b;
private Intent c;
private final void a()
{
Object localObject = a.getText();
Intent localIntent = new Intent();
localIntent.putExtra("extra_folder_click_intent", c);
localIntent.putExtra("android.intent.extra.shortcut.NAME", b);
localObject = ((CharSequence)localObject).toString();
if (TextUtils.getTrimmedLength((CharSequence)localObject) > 0) {
c.putExtra("android.intent.extra.shortcut.NAME", (String)localObject);
}
setResult(-1, c);
finish();
}
public void onClick(View paramView)
{
int i = paramView.getId();
if (buc.be == i) {
a();
}
while (buc.P != i) {
return;
}
setResult(0);
finish();
}
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(bue.ah);
c = ((Intent)getIntent().getParcelableExtra("extra_folder_click_intent"));
b = getIntent().getStringExtra("extra_shortcut_name");
a = ((EditText)findViewById(buc.bC));
a.setText(b);
a.setOnEditorActionListener(this);
a.requestFocus();
paramBundle = a.getText();
Selection.setSelection(paramBundle, paramBundle.length());
findViewById(buc.be).setOnClickListener(this);
findViewById(buc.P).setOnClickListener(this);
paramBundle = getActionBar();
if (paramBundle != null) {
paramBundle.setIcon(bug.a);
}
}
public boolean onEditorAction(TextView paramTextView, int paramInt, KeyEvent paramKeyEvent)
{
if (paramInt == 6)
{
a();
return true;
}
return false;
}
}
/* Location:
* Qualified Name: com.android.mail.ui.ShortcutNameActivity
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
dcfb2230cf80e9e0a95e4cf6cd902216a4ab4889 | 3781a8ad2c5b10cca2906441a3f2ee02079d1151 | /src/mouseapp/KindOfDatabase.java | b1fba50bc7d6d7a3304260b2822bfbb2e1f468e5 | [] | no_license | tsoglani/AndroidRemoteJavaServer | 6e34913accbbc00f2ea950db8382aa38ce232d00 | bce4fcf1614fa79d9254c3319f8de113ec3181c4 | refs/heads/master | 2021-01-10T20:36:08.315257 | 2018-06-06T20:43:53 | 2018-06-06T20:43:53 | 39,274,911 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 964 | java | package mouseapp;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class KindOfDatabase {
private PrintWriter pw;
private BufferedReader br;
private static File file = new File("username_db.txt");
public KindOfDatabase() {
}
public synchronized void reset() {
pw.write("");
pw.flush();
}
public synchronized void addNewUserName(String username) throws FileNotFoundException {
pw = new PrintWriter(file);
pw.write(username);
pw.flush();
pw.close();
}
public synchronized String getUserName() throws FileNotFoundException {
br = new BufferedReader(new FileReader(file));
String nm = "";
try {
nm = br.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return nm;
}
}
| [
"mrtsoglanakos@hotmail.com"
] | mrtsoglanakos@hotmail.com |
b1c105f86bbcc5f5a0252578440e51e995b0e469 | 95a4cd938079325337a490792bb560bedf821c7e | /service/service-edu/src/main/java/com/wzd/eduservice/service/impl/EduChapterServiceImpl.java | 55c6e429b640ad7b88fafa0c61a4ba603bbaed60 | [] | no_license | lofxve/e_learning | 57b9b8a58306d293f6d0d6556ee7ac4b827801bf | 272095b9720d64aec5bcf88ebe884db92a0258bc | refs/heads/master | 2023-03-28T09:35:57.717042 | 2021-03-12T09:09:02 | 2021-03-12T09:09:02 | 334,385,463 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,540 | java | package com.wzd.eduservice.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzd.baseservice.exceptionHandler.BaseException;
import com.wzd.eduservice.entity.EduChapter;
import com.wzd.eduservice.entity.EduVideo;
import com.wzd.eduservice.entity.capter.ChapterVo;
import com.wzd.eduservice.entity.capter.VideoVo;
import com.wzd.eduservice.mapper.EduChapterMapper;
import com.wzd.eduservice.mapper.EduVideoMapper;
import com.wzd.eduservice.service.EduChapterService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 课程 服务实现类
* </p>
*
* @author wzd
* @since 2021-02-24
*/
@Service
public class EduChapterServiceImpl extends ServiceImpl<EduChapterMapper, EduChapter> implements EduChapterService {
@Autowired
private EduVideoMapper videoMapper;
@Override
public List<ChapterVo> getChapterVideo(String courseId) {
// 查询所有章节
QueryWrapper<EduChapter> chapterVoQueryWrapper = new QueryWrapper<>();
chapterVoQueryWrapper.eq("course_id", courseId);
chapterVoQueryWrapper.orderByAsc("sort", "id");
List<EduChapter> chapters = baseMapper.selectList(chapterVoQueryWrapper);
// 查询所有小结
QueryWrapper<EduVideo> videoQueryWrapper = new QueryWrapper<>();
videoQueryWrapper.eq("course_id", courseId);
videoQueryWrapper.orderByAsc("sort", "id");
List<EduVideo> videos = videoMapper.selectList(videoQueryWrapper);
// 创建组装值
ArrayList<ChapterVo> chapterVos = new ArrayList<>();
// 遍历章节
for (EduChapter chapter : chapters) {
ChapterVo chapterVo = new ChapterVo();
BeanUtils.copyProperties(chapter, chapterVo);
// 遍历小结
ArrayList<VideoVo> videoVos = new ArrayList<>();
for (EduVideo video : videos) {
if (video.getCourseId().equals(chapter.getCourseId()) && video.getChapterId().equals(chapter.getId())) {
VideoVo videoVo = new VideoVo();
BeanUtils.copyProperties(video, videoVo);
videoVos.add(videoVo);
}
}
chapterVo.setChildren(videoVos);
chapterVos.add(chapterVo);
}
return chapterVos;
}
/**
* @return void
* @Author lofxve
* @Description // 如果章节下有小结,则不能进行删除
* @Date 18:20 2021/2/25
* @Param [chapterId]
**/
@Override
public boolean deleteChapter(String chapterId) {
// 查询这个章节下的小结
QueryWrapper<EduVideo> videoQueryWrapper = new QueryWrapper<>();
videoQueryWrapper.eq("chapter_id", chapterId);
Integer count = videoMapper.selectCount(videoQueryWrapper);
if (count > 0) {
throw new BaseException(20001, "该章节下含有小结不能进行删除");
} else {
// 删除章节
int i = baseMapper.deleteById(chapterId);
return i > 0;
}
}
@Override
public void removeByCourseId(String courseId) {
QueryWrapper<EduChapter> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("course_id", courseId);
baseMapper.delete(queryWrapper);
}
}
| [
"875567313@qq.com"
] | 875567313@qq.com |
b97e3071ecc63acf1778aba03f6085b63df13454 | e1b973c582a68cb308e46b445381b457607e0791 | /java/CodeForces/older/AniaSmartfon.java | 3b662c997c3a06f9ba01dd064360b221ffa3148a | [] | no_license | mishagam/progs | d21cb0b1a9523b6083ff77aca69e6a8beb6a3cff | 3300640d779fa14aae15a672b803381c23285582 | refs/heads/master | 2021-08-30T15:51:05.890530 | 2017-12-18T13:54:43 | 2017-12-18T13:54:43 | 114,647,485 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,501 | java | // CodeForces Round #518 C competition
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class AniaSmartfon {
int n,m,k;
int []a;
int []ra; // reverse a - place of each app
int []b;
long npress;
private void readData(BufferedReader bin) throws IOException {
String s = bin.readLine();
String []ss = s.split(" ");
n = Integer.parseInt(ss[0]);
m = Integer.parseInt(ss[1]);
k = Integer.parseInt(ss[2]);
a = new int[n];
ra = new int[n+1];
b = new int[m];
// read a
s = bin.readLine();
ss = s.split(" ");
for (int i=0; i<n; i++) {
a[i] = Integer.parseInt(ss[i]);
ra[a[i]] = i;
}
// read b
s = bin.readLine();
ss = s.split(" ");
for (int i=0; i<m; i++) {
b[i] = Integer.parseInt(ss[i]);
}
}
void printRes() {
System.out.println(npress);
}
void shift(int i) {
if (i==0) {
return;
}
int aa = a[i];
int bb = a[i-1];
a[i-1] = aa;
a[i] = bb;
ra[aa] = i-1;
ra[bb] = i;
}
private void calculate() {
npress = 0;
for (int j=0; j<m; j++) {
int ia = ra[b[j]];
npress += (ia / k) + 1;
shift(ia);
}
}
public static void main(String[] args) throws IOException {
// BufferedReader bin = new BufferedReader(new FileReader("cactus.in"));
BufferedReader bin = new BufferedReader(
new InputStreamReader(System.in));
AniaSmartfon l = new AniaSmartfon();
l.readData(bin);
l.calculate();
l.printRes();
}
}
| [
"mishagam@gmail.com"
] | mishagam@gmail.com |
b8de378cf049336005e250ffa2ffd4cb6e5be727 | 79267269a57d62bf6b63b4c73cd6ba1c4a8815a0 | /src/main/java/cn/edu/ncut/eavp/dao/MessagesendrecieveDaoImpl.java | 4e6c8e2b7cf6bbef69b91bc6ba8ace63b2314a1e | [] | no_license | hklhai/eavp | fe65c85232fe74fa8cd407f6e3dccfc43e8cf5e2 | 4e35f242b8f2ee754bfba0d57e3b190bffc143cb | refs/heads/master | 2020-09-16T21:52:26.181152 | 2017-06-16T00:00:35 | 2017-06-16T00:00:35 | 94,487,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,620 | java | package cn.edu.ncut.eavp.dao;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;
import cn.edu.ncut.eavp.common.basedao.DaoSupport;
import cn.edu.ncut.eavp.common.basedao.QueryResult;
import cn.edu.ncut.eavp.model.view.MessagesendrecieveObj;
import cn.edu.ncut.eavp.webservice.base.DatagridResult;
@Repository("messagesendrecieveDao")
public class MessagesendrecieveDaoImpl extends
DaoSupport<MessagesendrecieveObj> implements MessagesendrecieveDao {
protected final static Logger logger = Logger
.getLogger(MessagesendrecieveDaoImpl.class);
@Override
public DatagridResult getRecieveMessageGridData(int firstResult,
int maxResult, String where, Map<String, Object> params,
String orderby) {
DatagridResult dr = null;
try {
Map<String, Object> fieldMap = new LinkedHashMap<String, Object>();
fieldMap.put("ORGMESSAGEID", null);
fieldMap.put("MESSAGENAME", null);
// fieldMap.put("MESSAGECONTENT", null);
fieldMap.put("FROMNAME", null);
fieldMap.put("SENDTIME", null);
fieldMap.put("CREATETIME", null);
Map<Object, String> readFlag = new HashMap<Object, String>();
readFlag.put(false, "未阅读");
readFlag.put(true, "阅读");
fieldMap.put("READFLAG", readFlag);
QueryResult<Map<String, Object>> qr = this.getScrollData(
firstResult, maxResult, where, params, orderby, fieldMap
.keySet().toArray(new String[0]));
dr = qr.getDatagridResult(fieldMap);
} catch (Exception e) {
logger.debug(e.getMessage());
}
return dr;
}
}
| [
"hkhai@outlook.com"
] | hkhai@outlook.com |
486f6252c2c19648b6eec9590d7711861b709350 | 343c79e2c638fe5b4ef14de39d885bc5e1e6aca5 | /MyApplication/app/src/main/java/cmcm/com/myapplication/com/dataflurry/statistics/InstallReferrerReceiver.java | 0529e8e6f9c0b27aae72d17ab0d761d0fe268c4a | [] | no_license | Leonilobayang/AndroidDemos | 05a76647b8e27582fa56e2e15d4195c2ff9b9c32 | 6ac06c3752dfa9cebe81f7c796525a17df620663 | refs/heads/master | 2022-04-17T06:56:52.912639 | 2016-07-01T07:48:50 | 2016-07-01T07:48:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,388 | java | package cmcm.com.myapplication.com.dataflurry.statistics;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import java.net.URLDecoder;
import java.net.URLEncoder;
import ke;
import kl;
import kx;
public class InstallReferrerReceiver extends BroadcastReceiver
{
public void onReceive(Context paramContext, Intent paramIntent)
{
while (true)
{
int i;
try
{
if (!paramIntent.hasExtra("referrer"))
break;
kx.c("DF_Receiver", "onReceive encode Referrers: " + paramIntent.getStringExtra("referrer"));
String str = URLDecoder.decode(paramIntent.getStringExtra("referrer"), "UTF-8");
paramIntent = "";
localObject1 = "";
String[] arrayOfString = str.split("&");
int j = arrayOfString.length;
i = 0;
Object localObject3 = "";
if (i < j)
{
localObject2 = arrayOfString[i].split("=");
if (localObject2.length == 2)
{
Object localObject4 = localObject2[0];
localObject2 = localObject2[1];
if ((!TextUtils.isEmpty((CharSequence)localObject4)) && (!TextUtils.isEmpty((CharSequence)localObject2)))
{
if (((String)localObject4).toString().trim().equals("pid".toString().trim()))
{
paramIntent = (Intent)localObject1;
localObject1 = localObject2;
break label343;
}
if (((String)localObject4).toString().trim().equals("c".toString().trim()))
{
localObject1 = paramIntent;
paramIntent = (Intent)localObject2;
break label343;
}
if (((String)localObject4).toString().trim().equals("clickid".toString().trim()))
{
localObject4 = paramIntent;
localObject3 = localObject2;
paramIntent = (Intent)localObject1;
localObject1 = localObject4;
break label343;
}
}
}
}
else
{
localObject2 = paramIntent;
if (TextUtils.isEmpty(paramIntent))
localObject2 = "unkown";
paramIntent = (String)localObject2 + "," + (String)localObject1 + "," + (String)localObject3;
try
{
kl.a().a(paramContext, "referrer", URLEncoder.encode(str));
kl.a().a(paramContext, "pid_c", URLEncoder.encode(paramIntent));
paramContext.getContentResolver().call(ke.a, String.valueOf(500), null, null);
return;
}
catch (Throwable paramIntent)
{
paramIntent.printStackTrace();
continue;
}
}
}
catch (Exception paramContext)
{
return;
}
Object localObject2 = localObject1;
Object localObject1 = paramIntent;
paramIntent = (Intent)localObject2;
label343: i += 1;
localObject2 = localObject1;
localObject1 = paramIntent;
paramIntent = (Intent)localObject2;
}
}
}
/* Location: classes-dex2jar.jar
* Qualified Name: com.dataflurry.statistics.InstallReferrerReceiver
* JD-Core Version: 0.6.2
*/ | [
"1004410930@qq.com"
] | 1004410930@qq.com |
6fd43ba477f554bf09524ed803e50dcf9506a74b | c95b26c2f7dd77f5e30e2d1cd1a45bc1d936c615 | /azureus-core/src/main/java/com/aelitis/azureus/plugins/extseed/impl/webseed/ExternalSeedReaderFactoryWebSeed.java | 4463aab86de4560deffb16ec487921da2bb211de | [] | no_license | ostigter/testproject3 | b918764f5c7d4c10d3846411bd9270ca5ba2f4f2 | 2d2336ef19631148c83636c3e373f874b000a2bf | refs/heads/master | 2023-07-27T08:35:59.212278 | 2023-02-22T09:10:45 | 2023-02-22T09:10:45 | 41,742,046 | 2 | 1 | null | 2023-07-07T22:07:12 | 2015-09-01T14:02:08 | Java | UTF-8 | Java | false | false | 4,835 | java | /*
* Created on 15-Dec-2005
* Created by Paul Gardner
* Copyright (C) Azureus Software, Inc, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package com.aelitis.azureus.plugins.extseed.impl.webseed;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.download.Download;
import org.gudy.azureus2.plugins.torrent.Torrent;
import com.aelitis.azureus.plugins.extseed.ExternalSeedPlugin;
import com.aelitis.azureus.plugins.extseed.ExternalSeedReader;
import com.aelitis.azureus.plugins.extseed.ExternalSeedReaderFactory;
public class ExternalSeedReaderFactoryWebSeed implements ExternalSeedReaderFactory {
public ExternalSeedReaderFactoryWebSeed() {
}
public ExternalSeedReader[] getSeedReaders(ExternalSeedPlugin plugin, Download download) {
return (getSeedReaders(plugin, download.getName(), download.getTorrent()));
}
public ExternalSeedReader[] getSeedReaders(ExternalSeedPlugin plugin, Torrent torrent) {
return (getSeedReaders(plugin, torrent.getName(), torrent));
}
private ExternalSeedReader[] getSeedReaders(ExternalSeedPlugin plugin, String name, Torrent torrent) {
try {
Map config = new HashMap();
Object obj = torrent.getAdditionalProperty("httpseeds");
if (obj != null) {
config.put("httpseeds", obj);
}
return (getSeedReaders(plugin, name, torrent, config));
} catch (Throwable e) {
e.printStackTrace();
}
return (new ExternalSeedReader[0]);
}
public ExternalSeedReader[] getSeedReaders(ExternalSeedPlugin plugin, Download download, Map config) {
return (getSeedReaders(plugin, download.getName(), download.getTorrent(), config));
}
private ExternalSeedReader[] getSeedReaders(ExternalSeedPlugin plugin, String name, Torrent torrent, Map config) {
try {
Object obj = config.get("httpseeds");
// might as well handle case where there's a single entry rather than a list
if (obj instanceof byte[]) {
List l = new ArrayList();
l.add(obj);
obj = l;
}
if (obj instanceof List) {
List urls = (List) obj;
List readers = new ArrayList();
Object _params = config.get("httpseeds-params");
Map params = _params instanceof Map ? (Map) _params : new HashMap();
for (int i = 0; i < urls.size(); i++) {
if (readers.size() > 10) {
Debug.out("Too many WS seeds, truncating");
break;
}
try {
String url_str = new String((byte[]) urls.get(i));
// avoid java encoding ' ' as '+' as this is not conformant with Apache (for example)
url_str = url_str.replaceAll(" ", "%20");
URL url = new URL(url_str);
String protocol = url.getProtocol().toLowerCase();
if (protocol.equals("http")) {
readers.add(new ExternalSeedReaderWebSeed(plugin, torrent, url, params));
} else {
plugin.log(name + ": WS unsupported protocol: " + url);
}
} catch (Throwable e) {
Object o = urls.get(i);
String str = (o instanceof byte[]) ? new String((byte[]) o) : String.valueOf(o);
Debug.out("WS seed invalid: " + str, e);
}
}
ExternalSeedReader[] res = new ExternalSeedReader[readers.size()];
readers.toArray(res);
return (res);
}
} catch (Throwable e) {
e.printStackTrace();
}
return (new ExternalSeedReader[0]);
}
}
| [
"oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b"
] | oscar.stigter@e0aef87a-ea4e-0410-81cd-4b1fdc67522b |
835bf39beac92b03805f74ea4e8e8209edf94460 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_e9c8a0529a16771354391311adfbca1548c83711/PreferredScaleCommand/17_e9c8a0529a16771354391311adfbca1548c83711_PreferredScaleCommand_t.java | 9d639b4aa9193a608b19654f601b0e183e3032a5 | [] | 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 | 3,764 | java | /*
* Project: droidAtScreen
* File: PreferredScaleCommand.java
* Modified: 2012-03-25
*
* Copyright (C) 2011, Ribomation AB (Jens Riboe).
* http://blog.ribomation.com/
*
* You are free to use this software and the source code as you like.
* We do appreciate if you attribute were it came from.
*/
package com.ribomation.droidAtScreen.cmd;
import java.awt.Dimension;
import java.util.Hashtable;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JSlider;
import javax.swing.WindowConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.ribomation.droidAtScreen.Application;
/**
* DESCRIPTION
* <p/>
* User: Jens
* Created: 2012-03-25, 10:30
*/
public class PreferredScaleCommand extends Command {
private static final int vMarg = 2, hMarg = 4, lblHt = 26, minScale = 0, maxScale = 300, tick = 25;
protected PreferredScaleCommand() {
updateButton(getApplication().getSettings().getPreferredScale());
setIcon("scale");
setMnemonic('S');
setTooltip("Set the preferred scale of new devices");
}
private void updateButton(int value) {
setLabel(String.format("Preferred Scale (%d%%)", value));
}
@Override
protected void doExecute(final Application app) {
final JDialog dlg = createScaleDialog(app, app.getSettings().getPreferredScale(),
new OnScaleUpdatedListener() {
@Override
public void onScaleUpdated(int value) {
app.getSettings().setPreferredScale(value);
getLog().info(String.format("Preferred scale: value=%d", value));
updateButton(value);
}
});
dlg.setLocationRelativeTo(app.getAppFrame());
dlg.setVisible(true);
}
public interface OnScaleUpdatedListener {
void onScaleUpdated(int value);
}
public static JDialog createScaleDialog(Application app, int currentValue, final OnScaleUpdatedListener action) {
final JSlider scaleSlider = new JSlider(JSlider.VERTICAL, minScale, maxScale, currentValue);
Hashtable labels = scaleSlider.createStandardLabels(tick);
for (Object key : labels.keySet()) {
JLabel lbl = ((JLabel) labels.get(key));
lbl.setText(lbl.getText() + "%");
}
scaleSlider.setPaintTicks(true);
scaleSlider.setSnapToTicks(true);
scaleSlider.setMajorTickSpacing(tick);
scaleSlider.setPaintLabels(true);
scaleSlider.setLabelTable(labels);
scaleSlider.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createEmptyBorder(vMarg, hMarg, vMarg, 2 * hMarg),
BorderFactory.createTitledBorder("Scale")));
final JDialog dlg = new JDialog(app.getAppFrame(), true);
dlg.add(scaleSlider);
dlg.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dlg.setMinimumSize(new Dimension(100, 200));
dlg.setSize(scaleSlider.getSize().width, labels.size() * lblHt + 2 * vMarg);
scaleSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (scaleSlider.getValueIsAdjusting()) return;
int value = scaleSlider.getModel().getValue();
action.onScaleUpdated(value);
dlg.dispose();
}
});
return dlg;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
bedaf2bb23f96d1debd2823c279425f8b4abce47 | 062e6e7a36cf65f82e33f762e6eac7058f9baa1d | /sky-business-task/xxl-job-core/src/main/java/com/xxl/job/core/biz/impl/ExecutorBizImpl.java | 1130f2263b82c1dcaed9218eb98909e6b3f638b7 | [] | no_license | sengeiou/sky | 066d5b02ad7c2659ba85237071bd69754f0bdc15 | ba12c4d5a1a83241e61d033d26d239575f75e69b | refs/heads/master | 2022-10-04T18:49:40.659033 | 2020-06-07T23:45:46 | 2020-06-07T23:45:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,454 | java | package com.xxl.job.core.biz.impl;
import com.xxl.job.core.biz.ExecutorBiz;
import com.xxl.job.core.biz.model.LogResult;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.biz.model.TriggerParam;
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.executor.XxlJobExecutor;
import com.xxl.job.core.glue.GlueFactory;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.impl.GlueJobHandler;
import com.xxl.job.core.handler.impl.ScriptJobHandler;
import com.xxl.job.core.log.XxlJobFileAppender;
import com.xxl.job.core.thread.JobThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
/**
* Created by xuxueli on 17/3/1.
*/
public class ExecutorBizImpl implements ExecutorBiz {
private static Logger logger = LoggerFactory.getLogger(ExecutorBizImpl.class);
@Override
public ReturnT<String> beat() {
return ReturnT.SUCCESS;
}
@Override
public ReturnT<String> idleBeat(int jobId) {
// isRunningOrHasQueue
boolean isRunningOrHasQueue = false;
JobThread jobThread = XxlJobExecutor.loadJobThread(jobId);
if (jobThread != null && jobThread.isRunningOrHasQueue()) {
isRunningOrHasQueue = true;
}
if (isRunningOrHasQueue) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "job thread is running or has trigger queue.");
}
return ReturnT.SUCCESS;
}
@Override
public ReturnT<String> kill(int jobId) {
// kill handlerThread, and create new one
JobThread jobThread = XxlJobExecutor.loadJobThread(jobId);
if (jobThread != null) {
XxlJobExecutor.removeJobThread(jobId, "人工手动终止");
return ReturnT.SUCCESS;
}
return new ReturnT<String>(ReturnT.SUCCESS_CODE, "job thread aleady killed.");
}
@Override
public ReturnT<LogResult> log(long logDateTim, int logId, int fromLineNum) {
// log filename: yyyy-MM-dd/9999.log
String logFileName = XxlJobFileAppender.makeLogFileName(new Date(logDateTim), logId);
LogResult logResult = XxlJobFileAppender.readLog(logFileName, fromLineNum);
return new ReturnT<LogResult>(logResult);
}
@Override
public ReturnT<String> run(TriggerParam triggerParam) {
// load old:jobHandler + jobThread
JobThread jobThread = XxlJobExecutor.loadJobThread(triggerParam.getJobId());
IJobHandler jobHandler = jobThread!=null?jobThread.getHandler():null;
String removeOldReason = null;
// valid:jobHandler + jobThread
if (GlueTypeEnum.BEAN==GlueTypeEnum.match(triggerParam.getGlueType())) {
// new jobhandler
IJobHandler newJobHandler = XxlJobExecutor.loadJobHandler(triggerParam.getExecutorHandler());
// valid old jobThread
if (jobThread!=null && jobHandler != newJobHandler) {
// change handler, need kill old thread
removeOldReason = "更换JobHandler或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
jobHandler = newJobHandler;
if (jobHandler == null) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "job handler [" + triggerParam.getExecutorHandler() + "] not found.");
}
}
} else if (GlueTypeEnum.GLUE_GROOVY==GlueTypeEnum.match(triggerParam.getGlueType())) {
// valid old jobThread
if (jobThread != null &&
!(jobThread.getHandler() instanceof GlueJobHandler
&& ((GlueJobHandler) jobThread.getHandler()).getGlueUpdatetime()==triggerParam.getGlueUpdatetime() )) {
// change handler or gluesource updated, need kill old thread
removeOldReason = "更新任务逻辑或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
try {
IJobHandler originJobHandler = GlueFactory.getInstance().loadNewInstance(triggerParam.getGlueSource());
jobHandler = new GlueJobHandler(originJobHandler, triggerParam.getGlueUpdatetime());
} catch (Exception e) {
logger.error(e.getMessage(), e);
return new ReturnT<String>(ReturnT.FAIL_CODE, e.getMessage());
}
}
} else if (GlueTypeEnum.GLUE_SHELL==GlueTypeEnum.match(triggerParam.getGlueType())
|| GlueTypeEnum.GLUE_PYTHON==GlueTypeEnum.match(triggerParam.getGlueType())
|| GlueTypeEnum.GLUE_NODEJS==GlueTypeEnum.match(triggerParam.getGlueType())) {
// valid old jobThread
if (jobThread != null &&
!(jobThread.getHandler() instanceof ScriptJobHandler
&& ((ScriptJobHandler) jobThread.getHandler()).getGlueUpdatetime()==triggerParam.getGlueUpdatetime() )) {
// change script or gluesource updated, need kill old thread
removeOldReason = "更新任务逻辑或更换任务模式,终止旧任务线程";
jobThread = null;
jobHandler = null;
}
// valid handler
if (jobHandler == null) {
jobHandler = new ScriptJobHandler(triggerParam.getJobId(), triggerParam.getGlueUpdatetime(), triggerParam.getGlueSource(), GlueTypeEnum.match(triggerParam.getGlueType()));
}
} else {
return new ReturnT<String>(ReturnT.FAIL_CODE, "glueType[" + triggerParam.getGlueType() + "] is not valid.");
}
// executor block strategy
if (jobThread != null) {
ExecutorBlockStrategyEnum blockStrategy = ExecutorBlockStrategyEnum.match(triggerParam.getExecutorBlockStrategy(), null);
if (ExecutorBlockStrategyEnum.DISCARD_LATER == blockStrategy) {
// discard when running
if (jobThread.isRunningOrHasQueue()) {
return new ReturnT<String>(ReturnT.FAIL_CODE, "阻塞处理策略-生效:"+ExecutorBlockStrategyEnum.DISCARD_LATER.getTitle());
}
} else if (ExecutorBlockStrategyEnum.COVER_EARLY == blockStrategy) {
// kill running jobThread
if (jobThread.isRunningOrHasQueue()) {
removeOldReason = "阻塞处理策略-生效:" + ExecutorBlockStrategyEnum.COVER_EARLY.getTitle();
jobThread = null;
}
} else {
// just queue trigger
}
}
// replace thread (new or exists invalid)
if (jobThread == null) {
jobThread = XxlJobExecutor.registJobThread(triggerParam.getJobId(), jobHandler, removeOldReason);
}
// push data to queue
ReturnT<String> pushResult = jobThread.pushTriggerQueue(triggerParam);
return pushResult;
}
}
| [
"wangyongtao@ijiuyue.com"
] | wangyongtao@ijiuyue.com |
b0c5c984a9c8039c4392d53a4143fd0e3e34f681 | dbc00a8bcf2b54eb4edb03d113a3e70b44aabfbd | /SpringDay02/src/cn/qlq/test/SpringAnnotationAopTest.java | 5c0560522d2376f86c2bc365a02185ce599b1676 | [] | no_license | qiao-zhi/AllProject | daad9829a6064e1448275677b2cf20f31604b682 | 9e7da0ed7b351cddfb62080873952ea34ed90ea1 | refs/heads/master | 2020-03-12T04:02:15.640076 | 2018-04-21T03:33:02 | 2018-04-21T03:33:02 | 130,436,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package cn.qlq.test;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import cn.qlq.service.UserService;
//帮我们创建容器
@RunWith(SpringJUnit4ClassRunner.class)
//指定创建容器时使用的配置文件
@ContextConfiguration("classpath:cn/qlq/annotationAOP/applicationContext.xml")
public class SpringAnnotationAopTest {
@Resource(name="userService")
private UserService us;
@Test
public void fun1() throws Exception{
us.save("111");
}
}
| [
"qiao_liqiang@163.com"
] | qiao_liqiang@163.com |
cb0c9f20d55707152a9ca91a78a8c037e1d8dca8 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/webview/ui/tools/jsapi/j$2$1.java | 4dc2d298d01aa5173ebebc7e199991983911a5d6 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package com.tencent.mm.plugin.webview.ui.tools.jsapi;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.modelgeo.Addr;
import com.tencent.mm.modelgeo.c.a;
final class j$2$1
implements c.a
{
j$2$1(j.2 param2)
{
}
public final void b(Addr paramAddr)
{
AppMethodBeat.i(9822);
if ((this.uIV.uIU.uIM != null) && (this.uIV.uIU.uIQ != null))
{
this.uIV.uIU.uIM.uIW = paramAddr.agv();
this.uIV.uIU.dcP();
}
AppMethodBeat.o(9822);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.webview.ui.tools.jsapi.j.2.1
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
2a8adcd66114086865ce61b89814b383e9bc20b0 | 24a32bc2aafcca19cf5e5a72ee13781387be7f0b | /src/framework/tags/gwt-test-utils-parent-0.25.1/gwt-test-utils-gxt/src/test/java/com/octo/gxt/test/DataListTest.java | 73b798c488b5121911351640b05eea5c5c61ca70 | [] | no_license | google-code-export/gwt-test-utils | 27d6ee080f039a8b4111e04f32ba03e5396dced5 | 0391347ea51b3db30c4433566a8985c4e3be240e | refs/heads/master | 2016-09-09T17:24:59.969944 | 2012-11-20T07:13:03 | 2012-11-20T07:13:03 | 32,134,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | java | package com.octo.gxt.test;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import com.extjs.gxt.ui.client.widget.DataList;
import com.extjs.gxt.ui.client.widget.DataListItem;
// TODO: complete tests..
@SuppressWarnings("deprecation")
public class DataListTest extends GwtGxtTest {
private DataList dataList;
@Test
public void checkSelectedItem() {
// Arrange
DataListItem item0 = new DataListItem("item 0");
dataList.add(item0);
DataListItem item1 = new DataListItem("item 1");
dataList.add(item1);
// Act
dataList.setSelectedItem(item1);
// Assert
Assert.assertEquals(item1, dataList.getSelectedItem());
}
@Before
public void setupDataList() {
dataList = new DataList();
}
}
| [
"gael.lazzari@d9eb14d4-a931-11de-b950-3d5b5f4ea0aa"
] | gael.lazzari@d9eb14d4-a931-11de-b950-3d5b5f4ea0aa |
b32da5b6c7623ff92dbe1b664564fdc2b4fe40fa | 8767bf1de1c46bfbc8c2cc01aba9d3d4de130eee | /test/level07/lesson12/home04/Solution.java | fa9bf7d62fea1921ce57f1df7205f8d4bd6ab6d4 | [] | no_license | nenya-alex/javarush | 8070e682c31f6b74164d26872a5927ac0e6e8703 | eac49e3c0edcdaa1790ab2fbbc3425ad7ef7ddac | refs/heads/master | 2016-09-02T01:41:22.197290 | 2015-09-05T14:55:51 | 2015-09-05T14:55:51 | 41,964,779 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | package com.javarush.test.level07.lesson12.home04;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/* Вводить с клавиатуры строки, пока пользователь не введёт строку 'end'
Создать список строк.
Ввести строки с клавиатуры и добавить их в список.
Вводить с клавиатуры строки, пока пользователь не введёт строку "end". "end" не учитывать.
Вывести строки на экран, каждую с новой строки.
*/
public class Solution
{
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> list = new ArrayList<String>();
//int i = 0;
for (;true;)
{
String s = reader.readLine();
if (!s.equals("end"))
{list.add(s);
}
else
{
break;
}
}
for (int i = 0; i < list.size(); i++)
{
System.out.println(list.get(i));
}
//Напишите тут ваш код
}
}
| [
"alexni@ukr.net"
] | alexni@ukr.net |
1b8f3eb6e1f9b1fb8e36be9667253863215619f7 | 15a04ddc490a2273f9516fb2f730b208c672a7bd | /officefloor/activity/officeactivity/src/test/java/net/officefloor/activity/model/RefactorSectionTest.java | e5b67e083df4599fac50026f0490755cbd8d949d | [
"Apache-2.0"
] | permissive | officefloor/OfficeFloor | d50c4441e96773e3f33b6a154dcaf049088480a2 | 4bad837e3d71dbc49b161f9814d6b188937ca69d | refs/heads/master | 2023-09-01T12:06:04.230609 | 2023-08-27T16:36:04 | 2023-08-27T16:36:04 | 76,112,580 | 60 | 7 | Apache-2.0 | 2023-09-14T20:12:48 | 2016-12-10T12:56:50 | Java | UTF-8 | Java | false | false | 6,568 | java | /*-
* #%L
* Activity
* %%
* Copyright (C) 2005 - 2020 Daniel Sagenschneider
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package net.officefloor.activity.model;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
import net.officefloor.compile.OfficeFloorCompiler;
import net.officefloor.compile.properties.PropertyList;
import net.officefloor.compile.section.SectionType;
import net.officefloor.model.change.Change;
/**
* Tests refactoring the {@link ActivitySectionModel}.
*
* @author Daniel Sagenschneider
*/
public class RefactorSectionTest extends AbstractActivityChangesTestCase {
/**
* {@link ActivitySectionModel}.
*/
private ActivitySectionModel section;
/**
* {@link ActivitySectionInputModel} name mapping.
*/
private Map<String, String> sectionInputNameMapping = new HashMap<String, String>();;
/**
* {@link ActivitySectionOutputModel} name mapping.
*/
private Map<String, String> sectionOutputNameMapping = new HashMap<String, String>();;
/**
* Initiate.
*/
public RefactorSectionTest() {
super(true);
}
@Override
protected void setUp() throws Exception {
super.setUp();
this.section = this.model.getActivitySections().get(0);
}
/**
* Ensure handle no change.
*/
public void testNoChange() {
// Create the section type
SectionType sectionType = this.constructSectionType((context) -> {
context.addSectionInput("INPUT", null);
context.addSectionOutput("OUTPUT_A", Integer.class, false);
context.addSectionOutput("OUTPUT_B", null, false);
context.addSectionOutput("OUTPUT_C", null, false);
context.addSectionOutput("NOT_INCLUDE_ESCALTION", IOException.class, true);
context.addSectionObject("IGNORE_OBJECT", DataSource.class, null);
});
// Create the properties
PropertyList properties = OfficeFloorCompiler.newPropertyList();
properties.addProperty("name.one").setValue("value.one");
properties.addProperty("name.two").setValue("value.two");
// Keep section input names
this.sectionInputNameMapping.put("INPUT", "INPUT");
// Keep section output names
this.sectionOutputNameMapping.put("OUTPUT_A", "OUTPUT_A");
this.sectionOutputNameMapping.put("OUTPUT_B", "OUTPUT_B");
this.sectionOutputNameMapping.put("OUTPUT_C", "OUTPUT_C");
// Refactor the section with same details
Change<ActivitySectionModel> change = this.operations.refactorSection(this.section, "SECTION",
"net.example.ExampleSectionSource", "SECTION_LOCATION", properties, sectionType,
this.sectionInputNameMapping, this.sectionOutputNameMapping);
// Validate change
this.assertChange(change, null, "Refactor Section", true);
}
/**
* Ensure handle change to all details.
*/
public void testChange() {
// Create the section type
SectionType sectionType = this.constructSectionType((context) -> {
context.addSectionInput("INPUT_CHANGE", Double.class);
context.addSectionOutput("OUTPUT_A", Integer.class, false);
context.addSectionOutput("OUTPUT_B", String.class, false);
context.addSectionOutput("OUTPUT_C", null, false);
context.addSectionOutput("NOT_INCLUDE_ESCALTION", IOException.class, true);
context.addSectionObject("IGNORE_OBJECT", DataSource.class, null);
});
// Create the properties
PropertyList properties = OfficeFloorCompiler.newPropertyList();
properties.addProperty("name.1").setValue("value.one");
properties.addProperty("name.two").setValue("value.2");
// Keep section input names
this.sectionInputNameMapping.put("INPUT_CHANGE", "INPUT");
// Change section output names around
this.sectionOutputNameMapping.put("OUTPUT_B", "OUTPUT_A");
this.sectionOutputNameMapping.put("OUTPUT_C", "OUTPUT_B");
this.sectionOutputNameMapping.put("OUTPUT_A", "OUTPUT_C");
// Refactor the section with same details
Change<ActivitySectionModel> change = this.operations.refactorSection(this.section, "CHANGE",
"net.example.ChangeSectionSource", "CHANGE_LOCATION", properties, sectionType,
this.sectionInputNameMapping, this.sectionOutputNameMapping);
// Validate change
this.assertChange(change, null, "Refactor Section", true);
}
/**
* Ensure handle remove {@link PropertyModel}, {@link ActivitySectionInputModel}
* and {@link ActivitySectionOutputModel} instances.
*/
public void testRemoveDetails() {
// Create the section type
SectionType sectionType = this.constructSectionType(null);
// Refactor the section removing details
Change<ActivitySectionModel> change = this.operations.refactorSection(this.section, "REMOVE",
"net.example.RemoveSectionSource", "REMOVE_LOCATION", null, sectionType, null, null);
// Validate change
this.assertChange(change, null, "Refactor Section", true);
}
/**
* Ensure handle adding {@link PropertyModel}, {@link ActivitySectionInputModel}
* and {@link ActivitySectionOutputModel} instances.
*/
public void testAddDetails() {
// Create the section type
SectionType sectionType = this.constructSectionType((context) -> {
context.addSectionInput("INPUT_1", Double.class);
context.addSectionInput("INPUT_2", null);
context.addSectionOutput("OUTPUT_A", Integer.class, false);
context.addSectionOutput("OUTPUT_B", String.class, false);
context.addSectionOutput("OUTPUT_C", null, false);
context.addSectionOutput("NOT_INCLUDE_ESCALTION", IOException.class, true);
context.addSectionObject("IGNORE_OBJECT", DataSource.class, null);
});
// Create the properties
PropertyList properties = OfficeFloorCompiler.newPropertyList();
properties.addProperty("name.one").setValue("value.one");
properties.addProperty("name.two").setValue("value.two");
// Refactor the section with same details
Change<ActivitySectionModel> change = this.operations.refactorSection(this.section, "ADD",
"net.example.AddSectionSource", "ADD_LOCATION", properties, sectionType, this.sectionInputNameMapping,
this.sectionOutputNameMapping);
// Validate change
this.assertChange(change, null, "Refactor Section", true);
}
}
| [
"daniel@officefloor.net"
] | daniel@officefloor.net |
4956674aae31dfff10fee385630d511e147b643d | cca87c4ade972a682c9bf0663ffdf21232c9b857 | /com/tencent/mm/plugin/exdevice/service/v.java | deaf59add3a72e655ee3ca3129c3aed981f3cfd2 | [] | no_license | ZoranLi/wechat_reversing | b246d43f7c2d7beb00a339e2f825fcb127e0d1a1 | 36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a | refs/heads/master | 2021-07-05T01:17:20.533427 | 2017-09-25T09:07:33 | 2017-09-25T09:07:33 | 104,726,592 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.tencent.mm.plugin.exdevice.service;
import com.tencent.mm.sdk.platformtools.af;
import java.util.HashMap;
public final class v {
private static v lgQ = null;
public af laX = new af();
final HashMap<Long, Integer> lgR = new HashMap();
private v() {
}
public static v apW() {
if (lgQ == null) {
lgQ = new v();
}
return lgQ;
}
}
| [
"lizhangliao@xiaohongchun.com"
] | lizhangliao@xiaohongchun.com |
2efba53ade6ce2394bbccf9d66ca92baa89379e9 | 0f113a0ce22286fc312a462c12544f38b0c52a24 | /h2/src/main/org/h2/result/ResultWithGeneratedKeys.java | c6179a6a3296362c81f47e3e70422849b307c0f7 | [
"Apache-2.0"
] | permissive | andersonbisconsin/tradutor | e488c408a2f87a57b1033b0a4721775cfb2accd8 | b33aebfedb1c175c59f303649612c6be0655cd8a | refs/heads/master | 2021-07-11T00:17:59.723945 | 2020-03-13T16:51:13 | 2020-03-13T16:51:13 | 247,068,521 | 0 | 0 | Apache-2.0 | 2021-06-07T18:42:25 | 2020-03-13T12:40:44 | Java | UTF-8 | Java | false | false | 1,775 | java | /*
* Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
* and the EPL 1.0 (https://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.result;
/**
* Result of update command with optional generated keys.
*/
public class ResultWithGeneratedKeys {
/**
* Result of update command with generated keys;
*/
public static final class WithKeys extends ResultWithGeneratedKeys {
private final ResultInterface generatedKeys;
/**
* Creates a result with update count and generated keys.
*
* @param updateCount
* update count
* @param generatedKeys
* generated keys
*/
public WithKeys(int updateCount, ResultInterface generatedKeys) {
super(updateCount);
this.generatedKeys = generatedKeys;
}
@Override
public ResultInterface getGeneratedKeys() {
return generatedKeys;
}
}
/**
* Returns a result with only update count.
*
* @param updateCount
* update count
* @return the result.
*/
public static ResultWithGeneratedKeys of(int updateCount) {
return new ResultWithGeneratedKeys(updateCount);
}
private final int updateCount;
ResultWithGeneratedKeys(int updateCount) {
this.updateCount = updateCount;
}
/**
* Returns generated keys, or {@code null}.
*
* @return generated keys, or {@code null}
*/
public ResultInterface getGeneratedKeys() {
return null;
}
/**
* Returns update count.
*
* @return update count
*/
public int getUpdateCount() {
return updateCount;
}
}
| [
"ander@LAPTOP-FND853L8"
] | ander@LAPTOP-FND853L8 |
a72d35cc5ae4888bda266eb1a9e291ce73fa8b8a | 85659db6cd40fcbd0d4eca9654a018d3ac4d0925 | /packages/apps/SmartActions/SmartActions/src/com/motorola/contextual/smartrules/psf/mediator/protocol/CancelResponse.java | df33b3c193226ee508eb62e32a184e8fd3315001 | [] | no_license | qwe00921/switchui | 28e6e9e7da559c27a3a6663495a5f75593f48fb8 | 6d859b67402fb0cd9f7e7a9808428df108357e4d | refs/heads/master | 2021-01-17T06:34:05.414076 | 2014-01-15T15:40:35 | 2014-01-15T15:40:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,876 | java | /*
* @(#)CancelResponse.java
*
* (c) COPYRIGHT 2011-2012 MOTOROLA INC.
* MOTOROLA CONFIDENTIAL PROPRIETARY
* MOTOROLA Advanced Technology and Software Operations
*
* REVISION HISTORY:
* Author Date CR Number Brief Description
* ------------- ---------- ----------------- ------------------------------
* qwfn37 2012/05/22 NA Initial version
*
*/
package com.motorola.contextual.smartrules.psf.mediator.protocol;
import java.util.ArrayList;
import java.util.List;
import com.motorola.contextual.smartrules.Constants;
import com.motorola.contextual.smartrules.db.DbSyntax;
import com.motorola.contextual.smartrules.psf.mediator.MediatorConstants;
import com.motorola.contextual.smartrules.psf.mediator.MediatorHelper;
import com.motorola.contextual.smartrules.psf.table.MediatorTable;
import com.motorola.contextual.smartrules.psf.table.MediatorTuple;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.util.Log;
/**
* This class handles "cancel response" from condition publishers.
*
* <CODE><PRE>
*
* CLASS:
* Implements IMediatorProtocol
*
* RESPONSIBILITIES:
* Send the "cancel response" intent to desired consumer
*
* COLABORATORS:
* Consumer - Uses the preconditions available across the system
* ConditionPublisher - Implements the preconditions available across the system
*
* USAGE:
* See each method.
*
* </PRE></CODE>
*/
public class CancelResponse implements IMediatorProtocol, MediatorConstants, DbSyntax {
private static final String TAG = MEDIATOR_PREFIX + CancelResponse.class.getSimpleName();
private String mConfig;
private String mPublisher;
private String mResponseId;
private String mStatus;
public CancelResponse(Intent intent) {
mConfig = intent.getStringExtra(EXTRA_CONFIG);
mPublisher = intent.getStringExtra(EXTRA_PUBLISHER_KEY);
mResponseId = intent.getStringExtra(EXTRA_RESPONSE_ID);
mStatus = intent.getStringExtra(EXTRA_STATUS);
}
public boolean processRequest(Context context, Intent intent) {
return (mConfig != null && mPublisher != null && mResponseId != null &&
mStatus != null && MediatorHelper.isMediatorInitialized(context)) ? true : false;
}
public List<Intent> execute(Context context, Intent intent) {
List<Intent> intentsToBroadcast = new ArrayList<Intent>();
ContentResolver contentResolver = context.getContentResolver();
Cursor cursor = null;
String where = MediatorTable.Columns.CONFIG + EQUALS + Q + mConfig + Q + AND +
MediatorTable.Columns.PUBLISHER + EQUALS + Q + mPublisher + Q;
try {
cursor = contentResolver.query(MediatorTable.CONTENT_URI, null, where, null, null);
if (cursor != null && cursor.getCount() > 0) {
intentsToBroadcast = handleCancelResponse(contentResolver, cursor);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (cursor != null) {
cursor.close();
}
}
return intentsToBroadcast;
}
/**
* Method to handle cancel response
* @param contentResolver
* @param cursor
* @return
*/
private List<Intent> handleCancelResponse(ContentResolver contentResolver, Cursor cursor) {
List<Intent> intentsToBroadcast = new ArrayList<Intent>();
cursor.moveToFirst();
do {
MediatorTuple mediatorTuple = new MediatorTuple(cursor);
String consumer = mediatorTuple.getConsumer();
if (consumer != null && mediatorTuple.getCancelRequestIdsAsList().contains(mResponseId)) {
if (mStatus.equals(FAILURE)) {
//Cancel failed. Remove cancel ID
mediatorTuple.removeCancelRequestId(mResponseId);
MediatorHelper.updateTuple(contentResolver, mediatorTuple);
} else {
MediatorHelper.deleteFromMediatorDatabase(contentResolver, consumer, mPublisher, mConfig);
}
if (!mResponseId.contains(MEDIATOR_SEPARATOR)) {
intentsToBroadcast.add(MediatorHelper.createCommandResponseIntent(consumer, mConfig,
mResponseId, CANCEL_RESPONSE_EVENT, mPublisher, mStatus, null, null));
} else {
//Mediator itself requested cancel. No need to send cancel response.
if (Constants.LOG_DEBUG) Log.d(TAG, "Mediator requested cancel request completed");
}
break;
}
} while (cursor.moveToNext());
return intentsToBroadcast;
}
}
| [
"cheng.carmark@gmail.com"
] | cheng.carmark@gmail.com |
9ecaa1968bb90af2242cc54691a1f3c733c95008 | ee1fc12feef20f8ebe734911acdd02b1742e417c | /android_sourcecode/app/src/main/java/com/ak/pt/mvp/view/people/ILeaveView.java | d996ed6ff49c94ecd8355851b89eb8ae03604e20 | [
"MIT"
] | permissive | xiaozhangxin/test | aee7aae01478a06741978e7747614956508067ed | aeda4d6958f8bf7af54f87bc70ad33d81545c5b3 | refs/heads/master | 2021-07-15T21:52:28.171542 | 2020-03-09T14:30:45 | 2020-03-09T14:30:45 | 126,810,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | package com.ak.pt.mvp.view.people;
import com.ak.pt.bean.MeParentBean;
import com.ak.pt.bean.QuitJobBean;
import com.ak.pt.bean.staffGroupBeans;
import com.ak.pt.mvp.base.BaseView;
import java.util.List;
public interface ILeaveView extends BaseView{
void insertQuitJob(String data);
void deleteQuitJob(String data);
void updateQuitJob(String data);
void auditQuitJob(String data);
void getQuitJobList(List<QuitJobBean> data);
void getQuitJobDetail(QuitJobBean data);
void getAuditStaffList(List<MeParentBean> data);
}
| [
"xiaozhangxin@shifuhelp.com"
] | xiaozhangxin@shifuhelp.com |
95515183fc91bc9ee5db0765ffbb93c99ed45404 | 62e334192393326476756dfa89dce9f0f08570d4 | /tk_code/splider/splider-server/src/main/java/com/huatu/splider/dao/jpa/api/FbCourseSetDao.java | a4fa55a369d110de64ec8abf450efeab2d87a741 | [] | no_license | JellyB/code_back | 4796d5816ba6ff6f3925fded9d75254536a5ddcf | f5cecf3a9efd6851724a1315813337a0741bd89d | refs/heads/master | 2022-07-16T14:19:39.770569 | 2019-11-22T09:22:12 | 2019-11-22T09:22:12 | 223,366,837 | 1 | 2 | null | 2022-06-30T20:21:38 | 2019-11-22T09:15:50 | Java | UTF-8 | Java | false | false | 481 | java | package com.huatu.splider.dao.jpa.api;
import com.huatu.splider.dao.jpa.entity.FbCourseSet;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
/**
* @author hanchao
* @date 2018/2/27 16:08
*/
public interface FbCourseSetDao extends JpaRepository<FbCourseSet,Integer> {
@Modifying
@Query("update FbCourseSet set state=0")
void deleteAll();
}
| [
"jelly_b@126.com"
] | jelly_b@126.com |
2518048397f803926cb44885478c53b24a067ff8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/8/8_a44dbdf1659875e61c8839b2d7bcfcb8cfe8b74d/JstlFunction/8_a44dbdf1659875e61c8839b2d7bcfcb8cfe8b74d_JstlFunction_s.java | ef7d46ce545dd8b7c4c05ca09b3fafbd0e083cc8 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,849 | java | /**
* 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.sun.facelets.tag.jstl.fn;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Map;
/**
* Implementations of JSTL Functions
*
* @author Jacob Hookom
* @version $Id: JstlFunction.java,v 1.5 2008-07-13 19:01:51 rlubke Exp $
*/
public final class JstlFunction {
private JstlFunction() {
}
public static boolean contains(String name, String searchString) {
if (name == null || searchString == null) {
return false;
}
return -1 != name.indexOf(searchString);
}
public static boolean containsIgnoreCase(String name, String searchString) {
if (name == null || searchString == null) {
return false;
}
return -1 != name.toUpperCase().indexOf(searchString.toUpperCase());
}
public static boolean endsWith(String name, String searchString) {
if (name == null || searchString == null) {
return false;
}
return name.endsWith(searchString);
}
public static String escapeXml(String value) {
if (value == null) {
return null;
}
return value.replaceAll("<", "<");
}
public static int indexOf(String name, String searchString) {
if (name == null || searchString == null) {
return -1;
}
return name.indexOf(searchString);
}
public static String join(String[] a, String delim) {
if (a == null || delim == null) {
return null;
}
if (a.length == 0) {
return "";
}
StringBuffer sb = new StringBuffer(a.length
* (a[0].length() + delim.length()));
for (int i = 0; i < a.length; i++) {
sb.append(a[i]).append(delim);
}
return sb.toString();
}
public static int length(Object obj) {
if (obj == null) {
return 0;
}
if (obj instanceof Collection) {
return ((Collection) obj).size();
}
if (obj.getClass().isArray()) {
return Array.getLength(obj);
}
if (obj instanceof String) {
return ((String) obj).length();
}
if (obj instanceof Map) {
return ((Map) obj).size();
}
throw new IllegalArgumentException("Object type not supported: "
+ obj.getClass().getName());
}
public static String replace(String value, String a, String b) {
if (value == null || a == null || b == null) {
return null;
}
return value.replaceAll(a, b);
}
public static String[] split(String value, String d) {
if (value == null || d == null) {
return null;
}
return value.split(d);
}
public static boolean startsWith(String value, String p) {
if (value == null || p == null) {
return false;
}
return value.startsWith(p);
}
public static String substring(String v, int s, int e) {
if (v == null) {
return null;
}
return v.substring(s, e);
}
public static String substringAfter(String v, String p) {
if (v == null) {
return null;
}
int i = v.indexOf(p);
if (i >= 0) {
return v.substring(i+p.length());
}
return null;
}
public static String substringBefore(String v, String s) {
if (v == null) {
return null;
}
int i = v.indexOf(s);
if (i > 0) {
return v.substring(0, i);
}
return null;
}
public static String toLowerCase(String v) {
if (v == null) {
return null;
}
return v.toLowerCase();
}
public static String toUpperCase(String v) {
if (v == null) {
return null;
}
return v.toUpperCase();
}
public static String trim(String v) {
if (v == null) {
return null;
}
return v.trim();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3cd8cd39d8579b403d17a3b216fdb0ad5b527ce3 | f1b65f6ace564ef496ae97c237763a1e282b2189 | /tis-console/src/main/java/com/qlangtech/tis/trigger/module/action/TriggermonitorAjax.java | 884eea09e8b171a2783d4406fc8a046940fa0c80 | [
"MIT"
] | permissive | fightingyuman/tis-solr | 27b65d3e4a89612ea9087a0f260a8c0a89b7f640 | 8655db7c32bb88928b931e2754291deb0e4ab4db | refs/heads/master | 2022-04-04T08:26:23.438875 | 2020-01-02T13:04:51 | 2020-01-02T13:04:51 | 258,164,459 | 1 | 0 | MIT | 2020-04-23T10:09:51 | 2020-04-23T10:09:51 | null | UTF-8 | Java | false | false | 2,901 | java | /*
* The MIT License
*
* Copyright (c) 2018-2022, qinglangtech Ltd
*
* 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.qlangtech.tis.trigger.module.action;
import java.util.List;
import com.alibaba.citrus.turbine.Context;
import com.qlangtech.tis.manage.common.ManageUtils;
import com.qlangtech.tis.trigger.module.screen.Triggermonitor;
import com.qlangtech.tis.trigger.rmi.JobDesc;
/* *
* @author 百岁(baisui@qlangtech.com)
* @date 2019年1月17日
*/
public class TriggermonitorAjax extends Triggermonitor {
private static final long serialVersionUID = 1L;
public void doTaskSchedule(Context context) throws Exception {
this.execute(context);
}
/**
* @param context
* @throws Exception
*/
public void doGetRecentErrorJobs(Context context) throws Exception {
context.put("biz_result", this.getTaskDAO().getRecentExecuteJobs(this.getAppDomain().getRunEnvironment().getKeyName()));
}
@Override
protected void processJoblist(Context context, List<JobDesc> joblist) throws Exception {
StringBuffer execResult = new StringBuffer();
execResult.append("{");
execResult.append("\"result\":[");
execResult.append("{\"jobid\":0,").append("\"triggerdate\":\"\"}\n");
int i = 0;
for (JobDesc job : joblist) {
i++;
if (job.getPreviousFireTime() == null) {
continue;
}
execResult.append(",");
execResult.append("{\"jobid\":").append(job.getJobid()).append(",").append("\"triggerdate\":\"").append(ManageUtils.formatDateYYYYMMdd(job.getPreviousFireTime())).append("\"}\n");
// if (i < joblist.size()) {
//
// }
}
execResult.append("]}");
writeJson(execResult);
}
@Override
protected void forward() {
}
}
| [
"baisui@2dfire.com"
] | baisui@2dfire.com |
8011462e024ba82bf3e4aab27c58b7652fb1c0d6 | 0684cd7a7cfc0ec4e1015db7838348d7ad733d7e | /extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java | a375accc8a29a47afc8102ba959f2c9b4a06be92 | [
"Apache-2.0"
] | permissive | SeppPenner/thingsboard | 80ff347e5018861b0799a5200f966a853deed993 | d44522e1cf5a7b2aa7b55bad7f2d0d1eb458c71b | refs/heads/master | 2021-06-04T05:26:55.514712 | 2020-03-15T22:39:36 | 2020-03-15T22:39:36 | 96,238,522 | 1 | 0 | NOASSERTION | 2020-03-15T22:39:37 | 2017-07-04T16:58:02 | Java | UTF-8 | Java | false | false | 1,142 | java | /**
* Copyright © 2016-2017 The Thingsboard 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.thingsboard.server.extensions.api.device;
import lombok.Data;
import lombok.Getter;
import lombok.ToString;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.kv.AttributeKey;
import java.util.Set;
/**
* @author Andrew Shvayka
*/
@Data
public class DeviceCredentialsUpdateNotificationMsg implements ToDeviceActorNotificationMsg {
private final TenantId tenantId;
private final DeviceId deviceId;
}
| [
"ashvayka@thingsboard.io"
] | ashvayka@thingsboard.io |
dd3e8445b50650db60aeb7afe09d2074efd187d8 | 3d4349c88a96505992277c56311e73243130c290 | /Preparation/processed-dataset/data-class_4_278/30.java | 86f14bfdc6fcd6a5f4cae739c8e44a7ca7d4b803 | [] | no_license | D-a-r-e-k/Code-Smells-Detection | 5270233badf3fb8c2d6034ac4d780e9ce7a8276e | 079a02e5037d909114613aedceba1d5dea81c65d | refs/heads/master | 2020-05-20T00:03:08.191102 | 2019-05-15T11:51:51 | 2019-05-15T11:51:51 | 185,272,690 | 7 | 4 | null | null | null | null | UTF-8 | Java | false | false | 2,637 | java | /** Find the light being scattered by a point in scattering material.
The surface properties for the given point should be in surfSpec[treeDepth-1], and
the resulting color is returned in color[treeDepth-1].
@param rt contains information for the thread currently being executed
@param treeDepth the current ray tree depth
@param node the octree node containing the point
@param eccentricity the eccentricity of the material
@param totalDist the distance traveled from the viewpoint
@param currentMaterial the MaterialMapping through which the ray is being propagated
@param prevMaterial the MaterialMapping the ray was passing through before entering material
@param currentMatTrans the transform to local coordinates for the current material
@param prevMatTrans the transform to local coordinates for the previous material
*/
protected void getScatteredLight(RaytracerContext rt, int treeDepth, OctreeNode node, double eccentricity, double totalDist, MaterialMapping currentMaterial, MaterialMapping prevMaterial, Mat4 currentMatTrans, Mat4 prevMatTrans) {
int i;
RGBColor filter = rt.rayIntensity[treeDepth], lightColor = rt.color[treeDepth];
Ray r = rt.ray[treeDepth];
Vec3 dir, pos = r.origin, viewDir = rt.ray[treeDepth - 1].direction;
double distToLight, fatt, dot;
double ec2 = eccentricity * eccentricity;
Light lt;
rt.tempColor2.setRGB(0.0f, 0.0f, 0.0f);
dir = r.getDirection();
for (i = light.length - 1; i >= 0; i--) {
lt = light[i].getLight();
distToLight = light[i].findRayToLight(pos, r, -1);
r.newID();
// Now scan through the list of objects, and see if the light is blocked.
lt.getLight(lightColor, light[i].getCoords().toLocal().times(pos));
lightColor.multiply(filter);
if (eccentricity != 0.0 && lt.getType() != Light.TYPE_AMBIENT) {
dot = dir.dot(viewDir);
fatt = (1.0 - ec2) / Math.pow(1.0 + ec2 - 2.0 * eccentricity * dot, 1.5);
lightColor.scale(fatt);
}
if (lightColor.getRed() < minRayIntensity && lightColor.getGreen() < minRayIntensity && lightColor.getBlue() < minRayIntensity)
continue;
if (lt.getType() == Light.TYPE_AMBIENT || lt.getType() == Light.TYPE_SHADOWLESS || traceLightRay(r, lt, treeDepth, node, lightNode[i], distToLight, totalDist, currentMaterial, prevMaterial, currentMatTrans, prevMatTrans))
rt.tempColor2.add(lightColor);
}
rt.color[treeDepth].copy(rt.tempColor2);
}
| [
"dariusb@unifysquare.com"
] | dariusb@unifysquare.com |
620416d7cdba16729c3c64a490fa856b81935a16 | 689cdf772da9f871beee7099ab21cd244005bfb2 | /classes/com/f/a/a/ei.java | 386a8622715e3cb0de3ef7d620b2d3bec921aaec | [] | no_license | waterwitness/dazhihui | 9353fd5e22821cb5026921ce22d02ca53af381dc | ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3 | refs/heads/master | 2020-05-29T08:54:50.751842 | 2016-10-08T08:09:46 | 2016-10-08T08:09:46 | 70,314,359 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,209 | java | package com.f.a.a;
import com.unionpay.upomp.lthj.plugin.model.Data;
import com.unionpay.upomp.lthj.plugin.model.SMSDynamicValCodeIssue;
public class ei
extends es
{
private String a;
private String b;
private String c;
public ei(int paramInt)
{
super(paramInt);
}
public Data a()
{
SMSDynamicValCodeIssue localSMSDynamicValCodeIssue = new SMSDynamicValCodeIssue();
b(localSMSDynamicValCodeIssue);
localSMSDynamicValCodeIssue.mobileNumber = this.a;
localSMSDynamicValCodeIssue.secureInfo = this.b;
return localSMSDynamicValCodeIssue;
}
public void a(Data paramData)
{
paramData = (SMSDynamicValCodeIssue)paramData;
c(paramData);
this.a = paramData.mobileNumber;
this.c = paramData.mobileMac;
this.b = paramData.secureInfo;
}
public void a(String paramString)
{
this.a = paramString;
}
public String b()
{
return this.b;
}
public void b(String paramString)
{
this.b = paramString;
}
public String c()
{
return this.c;
}
}
/* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\f\a\a\ei.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
596a004e02c8e6fffd240f3ce8fcc89b3ed031df | f3698795f174340106c66885bb57ac72134c58c8 | /metacube/idatrix-metacube-web/src/main/java/com/ys/idatrix/metacube/metamanage/service/impl/MysqlSnapshotServiceImpl.java | 55844de99b87141e8b88a4d125660298aef2f0ca | [] | no_license | ahandful/CloudETL | 6e5c195953a944cdc62702b100bd7bcd629b4aee | bb4be62e8117082cd656741ecae33e4262ad3fb5 | refs/heads/master | 2020-09-13T01:33:43.749781 | 2019-04-18T02:12:08 | 2019-04-18T02:13:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,713 | java | package com.ys.idatrix.metacube.metamanage.service.impl;
import com.ys.idatrix.metacube.metamanage.domain.*;
import com.ys.idatrix.metacube.metamanage.mapper.*;
import com.ys.idatrix.metacube.metamanage.service.MysqlSnapshotService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName MysqlSnapshotServiceImpl
* @Description mysql 快照信息实现类
* @Author ouyang
* @Date
*/
@Transactional
@Service
public class MysqlSnapshotServiceImpl implements MysqlSnapshotService {
@Autowired
private SnapshotMetadataMapper snapshotMetadataMapper;
@Autowired
private SnapshotTableColumnMapper snapshotTableColumnMapper;
@Autowired
private SnapshotTableIdxMysqlMapper snapshotTableIdxMysqlMapper;
@Autowired
private SnapshotTableFkMysqlMapper snapshotTableFkMysqlMapper;
@Autowired
private SnapshotViewDetailMapper snapshotViewDetailMapper;
@Override
public void generateCreateTableSnapshot(Metadata table, List<TableColumn> columnList, List<TableIdxMysql> tableIndexList, List<TableFkMysql> tableFkMysqlList, String details) {
// 基本快照信息
SnapshotMetadata snapshotMetadata = new SnapshotMetadata();
BeanUtils.copyProperties(table, snapshotMetadata);
snapshotMetadata.setMetaId(table.getId()); // table id
snapshotMetadata.setVersion(table.getVersion()); // 当前快照版本
snapshotMetadata.setDetails(details); // 变更详情
snapshotMetadata.setId(null);
snapshotMetadataMapper.insertSelective(snapshotMetadata);
// 列快照信息
List<SnapshotTableColumn> snapshotColList = new ArrayList<>(); // 要新增的列快照信息
for (TableColumn tableColumn : columnList) {
SnapshotTableColumn snapshotTableColumn = new SnapshotTableColumn();
BeanUtils.copyProperties(tableColumn, snapshotTableColumn);
snapshotTableColumn.setVersion(snapshotMetadata.getVersion()); // 版本号
snapshotTableColumn.setColumnId(tableColumn.getId()); // 列id
snapshotColList.add(snapshotTableColumn);
}
snapshotTableColumnMapper.batchInsert(snapshotColList);
// 索引快照信息
if (CollectionUtils.isNotEmpty(tableIndexList)) {
List<SnapshotTableIdxMysql> snapshotIdxList = new ArrayList<>();
for (TableIdxMysql index : tableIndexList) {
SnapshotTableIdxMysql snapshotIdx = new SnapshotTableIdxMysql();
BeanUtils.copyProperties(index, snapshotIdx);
snapshotIdx.setVersion(snapshotMetadata.getVersion()); // 版本号
snapshotIdx.setIndexId(index.getId());// 索引id
snapshotIdxList.add(snapshotIdx);
}
snapshotTableIdxMysqlMapper.batchInsert(snapshotIdxList);
}
// 外键快照信息
if (CollectionUtils.isNotEmpty(tableFkMysqlList)) {
List<SnapshotTableFkMysql> snapshotFKList = new ArrayList<>();
for (TableFkMysql tableFk : tableFkMysqlList) {
SnapshotTableFkMysql snapshotFk = new SnapshotTableFkMysql();
BeanUtils.copyProperties(tableFk, snapshotFk);
snapshotFk.setVersion(snapshotMetadata.getVersion()); // 版本号
snapshotFk.setFkId(tableFk.getId());// 外键id
snapshotFKList.add(snapshotFk);
}
snapshotTableFkMysqlMapper.batchInsert(snapshotFKList);
}
}
@Override
public Metadata getSnapshotTableInfoByTableId(Long tableId, Integer version) {
SnapshotMetadata snapshotTable = snapshotMetadataMapper.selectByTableIdAndVersion(tableId, version);
Metadata metadata = new Metadata();
BeanUtils.copyProperties(snapshotTable, metadata);
metadata.setId(snapshotTable.getMetaId());
return metadata;
}
@Override
public List<TableColumn> getSnapshotColumnListByTableId(Long tableId, Integer version) {
List<TableColumn> columnList = new ArrayList();
List<SnapshotTableColumn> snapshotTableColumnList = snapshotTableColumnMapper.selectListByTableIdAndVersion(tableId, version);
for (SnapshotTableColumn snapshotColumn : snapshotTableColumnList) {
TableColumn column = new TableColumn();
BeanUtils.copyProperties(snapshotColumn, column);
column.setId(snapshotColumn.getColumnId());
columnList.add(column);
}
return columnList;
}
@Override
public List<TableIdxMysql> getSnapshotIndexListByTableId(Long tableId, Integer version) {
List<TableIdxMysql> list = new ArrayList<>();
List<SnapshotTableIdxMysql> snapshotIndexList = snapshotTableIdxMysqlMapper.selectListByTableIdAndVersion(tableId, version);
for (SnapshotTableIdxMysql snapshotIndex : snapshotIndexList) {
TableIdxMysql index = new TableIdxMysql();
BeanUtils.copyProperties(snapshotIndex, index);
index.setId(snapshotIndex.getIndexId());
list.add(index);
}
return list;
}
@Override
public List<TableFkMysql> getSnapshotForeignKeyListByTableId(Long tableId, Integer version) {
List<TableFkMysql> list = new ArrayList<>();
List<SnapshotTableFkMysql> snapshotForeignKeyList = snapshotTableFkMysqlMapper.selectListByTableIdAndVersion(tableId, version);
for (SnapshotTableFkMysql snapshotForeignKey : snapshotForeignKeyList) {
TableFkMysql foreignKey = new TableFkMysql();
BeanUtils.copyProperties(snapshotForeignKey,foreignKey);
foreignKey.setId(snapshotForeignKey.getFkId());
list.add(foreignKey);
}
return list;
}
@Override
public SnapshotTableColumn getSnapshotColumn(Long columnId, Integer version) {
SnapshotTableColumn snapshotColumn = snapshotTableColumnMapper.findByColumnIdAndVersion(columnId, version);
return snapshotColumn;
}
@Override
public void createViewSnapshot(Metadata view, ViewDetail viewDetail, String details) {
// 视图基本快照信息
SnapshotMetadata snapshotMetadata = new SnapshotMetadata();
BeanUtils.copyProperties(view, snapshotMetadata);
snapshotMetadata.setMetaId(view.getId()); // view id
snapshotMetadata.setVersion(view.getVersion()); // 当前快照版本
snapshotMetadata.setDetails(details); // 变更详情
snapshotMetadata.setId(null);
snapshotMetadataMapper.insertSelective(snapshotMetadata);
// 视图详情快照信息
SnapshotViewDetail snapshotViewDetail = new SnapshotViewDetail();
BeanUtils.copyProperties(viewDetail, snapshotViewDetail);
snapshotViewDetail.setId(null);
snapshotViewDetail.setViewDetailId(viewDetail.getId());
snapshotViewDetail.setVersion(view.getVersion()); // 版本号
snapshotViewDetailMapper.insertSelective(snapshotViewDetail);
}
@Override
public ViewDetail getSnapshotViewDetail(Long viewId, Integer version) {
SnapshotViewDetail snapshotViewDetail = snapshotViewDetailMapper.findByViewIdAndVersion(viewId, version);
ViewDetail viewDetail = new ViewDetail();
BeanUtils.copyProperties(snapshotViewDetail, viewDetail);
viewDetail.setId(snapshotViewDetail.getViewId());
return viewDetail;
}
}
| [
"xionghan@gdbigdata.com"
] | xionghan@gdbigdata.com |
fc534123b70d4bda2c38a7efc86c52d00113db46 | d950704f993a38c5f7c632d0322eb6df5877ff49 | /framework/src/main/java/com/wch/bean/BeanUtilsX.java | 48d51d75877ca62937ccfb6caca5019bd8951fd9 | [] | no_license | gdnwxf/framework | 025fef9c1e60d6673c16aed88fc969da810c44ba | dee9604c004a28c7fc40a1d16b96dec8a4852cd1 | refs/heads/master | 2020-04-15T12:44:02.039374 | 2017-05-12T02:52:12 | 2017-05-12T02:52:12 | 61,381,968 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | /**
*
*/
package com.wch.bean;
import java.util.List;
import java.util.Map;
/**
* @author wch
*
*/
public class BeanUtilsX {
public <T> T toBean(Map<String, Object> map, Class<T> tClass) {
return null;
}
public <T> T covert(Object object ,Class<T> t) {
Class<? extends Object> class1 = object.getClass();
return null;
}
public <P,T> List<T> convertList( List<P> list , Class<T> t ) {
return null;
}
}
| [
"qinghao@2dfire.com"
] | qinghao@2dfire.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.