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
1d36c4f8241185235758d1f9cccc6ae492a97030
42c50e58c738d67fd65105172c3291fbedfc1ecb
/src/com/szit/arbitrate/mediation/entity/MediationResource.java
aed8a881c5534ff305a96a27e9767f4f9b32e19c
[]
no_license
xmxnkj/interact
44860df5ad4550f972c26a5bab32460d9228d5c2
f97b4631fc6bffcfc4606cac36286e6e59165f4e
refs/heads/master
2020-08-08T20:31:53.681178
2019-01-10T07:33:31
2019-01-10T07:33:31
213,910,518
0
0
null
null
null
null
UTF-8
Java
false
false
2,726
java
package com.szit.arbitrate.mediation.entity; import java.util.Date; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.hsit.common.kfbase.entity.DomainEntity; import com.hsit.common.utils.CustomDateSerializerYmdhms; import com.szit.arbitrate.mediation.entity.enumvo.CaseResTypeEnum; /** * * @ProjectName: * @ClassName: MediationResource * @Description:证明材料 资源实体类 * @author Administrator * @date 2017年3月22日 下午4:22:47 * @UpdateUser: * @UpdateDate: * @UpdateRemark: * @Copyright: 2017 厦门西牛科技有限公司 * @versions:1.0 */ @JsonIgnoreProperties({"name","description","displayOrder","createTime"}) public class MediationResource extends DomainEntity{ private static final long serialVersionUID = -5825654864758601630L; private String caseId;//id private String clientId;//上传用户id private String clientName; private String clientImage; private CaseResTypeEnum resType;//资源类型 private Integer resseq; //资源排序序号 private String resuploadfileid;//资源上传的文件ID private String resuploadfilepath;//资源上传的文件路径 private Date rescreatedatatime;//创建时间 public String getCaseId() { return caseId; } public void setCaseId(String caseId) { this.caseId = caseId; } public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public CaseResTypeEnum getResType() { return resType; } public void setResType(CaseResTypeEnum resType) { this.resType = resType; } public Integer getResseq() { return resseq; } public void setResseq(Integer resseq) { this.resseq = resseq; } public String getResuploadfileid() { return resuploadfileid; } public void setResuploadfileid(String resuploadfileid) { this.resuploadfileid = resuploadfileid; } public String getResuploadfilepath() { return resuploadfilepath; } public void setResuploadfilepath(String resuploadfilepath) { this.resuploadfilepath = resuploadfilepath; } @JsonSerialize(using = CustomDateSerializerYmdhms.class) public Date getRescreatedatatime() { return rescreatedatatime; } public void setRescreatedatatime(Date rescreatedatatime) { this.rescreatedatatime = rescreatedatatime; } public String getClientName() { return clientName; } public void setClientName(String clientName) { this.clientName = clientName; } public String getClientImage() { return clientImage; } public void setClientImage(String clientImage) { this.clientImage = clientImage; } }
[ "chenwu0@aliyun.com" ]
chenwu0@aliyun.com
1d2c96910f4a00c631ffb68dc5d0ab6ae62fd0de
6437240eddd7c33372fccab081395d4c6d45aa92
/precomedModuloOld/template/src/main/java/br/com/lojadigicom/precomed/modelo/montador/MarcaMontador.java
418cd8060ca86f607b724ad33656b11197d312ad
[]
no_license
paulofor/projeto-android-aplicacao
49a530533496ec4a11dcb0a86ed9e9b75f2f9a4a
2aa9c244a830f12cf120f45727d7474203619c59
refs/heads/master
2021-01-05T06:04:29.225920
2020-02-16T14:45:25
2020-02-16T14:45:25
240,908,240
0
0
null
null
null
null
UTF-8
Java
false
false
4,724
java
package br.com.lojadigicom.precomed.modelo.montador; import java.lang.reflect.InvocationTargetException; import java.sql.Timestamp; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import br.com.lojadigicom.precomed.modelo.Marca; import br.com.lojadigicom.precomed.modelo.MarcaVo; //import br.com.lojadigicom.precomed.modelo.vo.FabricaVo; import android.database.Cursor; //import br.com.digicom.dao.MontadorDaoBase; //import br.com.digicom.dao.MontadorDaoI; //import br.com.digicom.modelo.DCIObjetoDominio; //import br.com.digicom.modelo.ObjetoSinc; import br.com.lojadigicom.precomed.framework.modelo.ObjetoSinc; import br.com.lojadigicom.precomed.framework.modelo.DCIObjetoDominio; import br.com.lojadigicom.precomed.framework.dao.MontadorDaoI; import br.com.lojadigicom.precomed.framework.modelo.ObjetoSinc; import br.com.lojadigicom.precomed.framework.dao.DaoException; import br.com.lojadigicom.precomed.framework.dao.DaoItemRetorno; public class MarcaMontador implements MontadorDaoI { private Marca principal = new MarcaVo(); private boolean sinc = false; public MarcaMontador(boolean sinc) { this.sinc = sinc; } public MarcaMontador() { this.sinc = false; } public void desligaSinc() { this.sinc = false; } public DCIObjetoDominio getItemSinc(Cursor c) { DCIObjetoDominio obj = getItem(c); ((ObjetoSinc)obj).setOperacaoSinc(getString(c,quantidadeCampos())); return obj; } public boolean getItemListaInterna(Cursor c, DCIObjetoDominio objeto) { objeto = ((MontadorDaoI)this).getItem(c); return true; } public boolean getItemRegistroInterno(Cursor c, DCIObjetoDominio objeto) { objeto = ((MontadorDaoI)this).getItem(c); return true; } public DCIObjetoDominio getItem(Cursor c) { DCIObjetoDominio objeto = null; //objeto = FabricaVo.criaMarca(); objeto = new MarcaVo(); return getItem(c, objeto, 0); } public DCIObjetoDominio getItem(Cursor c, int pos) { DCIObjetoDominio objeto = null; //objeto = FabricaVo.criaMarca(); objeto = new MarcaVo(); return getItem(c, objeto, pos); } public DCIObjetoDominio getItem(Cursor c, DCIObjetoDominio entrada, int pos) { Marca item = null; item = (Marca) entrada; item.setIdMarca(getInt(c,pos++)); item.setNomeMarca(getString(c,pos++)); //if (sinc) { // ((ObjetoSinc)item).setOperacaoSinc(getString(c,pos++)); //} return item; } public int quantidadeCampos() { return (sinc?2+0+1:2+0); } protected String getString(Cursor c,int posicao) { return c.getString(posicao); } protected int getInt(Cursor c,int posicao) { return c.getInt(posicao); } protected boolean getLogic(Cursor c,int posicao) { int i= c.getInt(posicao); return (i==1); } protected float getFloat(Cursor c,int posicao) { float c1 = c.getFloat(posicao); return c1; } protected Timestamp getTimestamp(Cursor c,int posicao) { long num = c.getLong(posicao); Timestamp ret = new Timestamp(num); return ret; } protected Timestamp getTimestampData(Cursor c,int posicao) { Timestamp saida = null; String idStr = String.valueOf(c.getLong(posicao)); if (idStr==null) return null;; DateFormat formatter = new SimpleDateFormat("yyyyMMdd"); try { java.util.Date date = (java.util.Date)formatter.parse(idStr); saida = new Timestamp(date.getTime()); } catch (ParseException e) { saida = null; } return saida; } protected Timestamp getTimestampDataHora(Cursor c,int posicao) { Timestamp saida = null; String idStr = String.valueOf(c.getLong(posicao)); if (idStr==null) return null;; DateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); try { java.util.Date date = (java.util.Date)formatter.parse(idStr); saida = new Timestamp(date.getTime()); } catch (ParseException e) { saida = null; } return saida; } public DaoItemRetorno extraiRegistroListaInterna(Cursor paramResultadoLista, DCIObjetoDominio objeto) throws DaoException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { objeto = ((MontadorDaoI)this).getItem(paramResultadoLista); DaoItemRetorno item = new DaoItemRetorno(); item.setInsere(true); item.setObjeto(objeto); return item; } public DaoItemRetorno extraiRegistroListaInternaSinc(Cursor paramResultadoLista, DCIObjetoDominio objeto) throws DaoException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException { objeto = ((MontadorDaoI)this).getItem(paramResultadoLista); DaoItemRetorno item = new DaoItemRetorno(); item.setInsere(true); item.setObjeto(objeto); return item; } }
[ "paulofore@gmail.com" ]
paulofore@gmail.com
536c4fbcd2964a7cc435b2d6d41110c09f2fceb2
4ff777cf407626948d40479d3227549948ede894
/src/main/java/song/annotationTest/aptTest/ExtractInterface.java
def4ca88b632e24cd726cf83533f157e52858ab5
[]
no_license
Sonlan/test
641e47997fbc6f6196c0fb58a2fb14db1c8dbc0c
86cd96297b5e839e5a40bd93d071955cfd0e5221
refs/heads/master
2020-12-25T14:14:32.366965
2016-11-13T14:05:22
2016-11-13T14:05:22
67,875,962
0
1
null
null
null
null
UTF-8
Java
false
false
369
java
package song.annotationTest.aptTest; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Created by Song on 2016/10/27. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface ExtractInterface { public String value(); }
[ "1147649695@qq.com" ]
1147649695@qq.com
42156b62d4f398aaed2fed95be5fb52d7c53c529
91ef83fb5b10ba5ddb1f9aee9d511a11496089a7
/core/src/main/java/javabot/dao/impl/ConfigDaoImpl.java
61b69ec79e8aa455492c073656cfe4c854fc6093
[ "BSD-3-Clause" ]
permissive
rickyclarkson/javabot
c56473b6ebf84456993d9576c11ecd38a449f1de
17988d5ad0463cf0670fb4cf38af992253d893a3
refs/heads/master
2021-01-16T20:02:10.367135
2010-02-03T04:07:20
2010-02-03T04:07:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,441
java
package javabot.dao.impl; import javabot.Javabot; import javabot.dao.AbstractDaoImpl; import javabot.dao.AdminDao; import javabot.dao.ChannelDao; import javabot.dao.ConfigDao; import javabot.model.Admin; import javabot.model.Channel; import javabot.model.Config; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; /** * Created Jun 21, 2007 * * @author <a href="mailto:javabot@cheeseronline.org">cheeser</a> */ public class ConfigDaoImpl extends AbstractDaoImpl<Config> implements ConfigDao { private static final Logger log = LoggerFactory.getLogger(ConfigDaoImpl.class); @Autowired private ChannelDao channelDao; @Autowired private AdminDao adminDao; @Autowired private Config defaults; @Autowired private Admin defaultAdmin; protected ConfigDaoImpl() { super(Config.class); } public Config get() { return (Config) getEntityManager().createNamedQuery(ConfigDao.GET_CONFIG).getSingleResult(); } public Config create() { final Config config; config = defaults; final Channel channel = new Channel(); channel.setName("##" + config.getNick()); channelDao.save(channel); config.setOperations(Javabot.OPERATIONS); adminDao.create(defaultAdmin.getUserName(), defaultAdmin.getHostName()); save(config); return config; } }
[ "jlee@antwerkz.com" ]
jlee@antwerkz.com
4581422512eeff0110c52ab385f9f5f92bfad9ac
44fe40372cdfc3d47d70a7cc47b301cc17bf270a
/app/src/main/java/io/bloc/android/blocly/ui/fragment/RssItemDetailFragment.java
346cae8e6a4e6affbe6d25cc4a99c3f94472c616
[]
no_license
ver2point0/Blocly
13d01ffdb763a7a944f7864f5a8f91df80c69b90
b2660db303cb8f5871af5545dcaccf52fa2f1b10
refs/heads/master
2021-01-10T02:11:41.747598
2015-12-26T16:15:38
2015-12-26T16:15:38
36,327,165
0
0
null
null
null
null
UTF-8
Java
false
false
4,889
java
package io.bloc.android.blocly.ui.fragment; import android.app.Fragment; import android.graphics.Bitmap; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateDecelerateInterpolator; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; import io.bloc.android.blocly.BloclyApplication; import io.bloc.android.blocly.R; import io.bloc.android.blocly.api.DataSource; import io.bloc.android.blocly.api.model.RssItem; public class RssItemDetailFragment extends Fragment implements ImageLoadingListener { private static final String BUNDLE_EXTRA_RSS_ITEM = RssItemDetailFragment.class.getCanonicalName().concat(".EXTRA_RSS_ITEM"); public static RssItemDetailFragment detailFragmentForRssItem(RssItem rssItem) { Bundle arguments = new Bundle(); arguments.putLong(BUNDLE_EXTRA_RSS_ITEM, rssItem.getRowId()); RssItemDetailFragment rssItemDetailFragment = new RssItemDetailFragment(); rssItemDetailFragment.setArguments(arguments); return rssItemDetailFragment; } ImageView mHeaderImage; TextView mTitle; TextView mContent; ProgressBar mProgressBar; @Override public void onCreate(Bundle savedInstaneState) { super.onCreate(savedInstaneState); Bundle arguments = getArguments(); if (arguments != null) { long rssItemId = arguments.getLong(BUNDLE_EXTRA_RSS_ITEM); BloclyApplication.getSharedDataSource().fetchRssItemWithId(rssItemId, new DataSource.Callback<RssItem>() { @Override public void onSuccess(RssItem rssItem) { if (getActivity() == null) { return; } mTitle.setText(rssItem.getTitle()); mContent.setText(rssItem.getDescription()); ImageLoader.getInstance().loadImage(rssItem.getImageUrl(), RssItemDetailFragment.this); } @Override public void onError(String errorMessage) {} }); } } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View inflate = inflater.inflate(R.layout.fragment_rss_item_detail, container, false); mHeaderImage = (ImageView) inflate.findViewById(R.id.iv_fragment_rss_item_detail_header); mProgressBar = (ProgressBar) inflate.findViewById(R.id.pb_fragment_rss_item_detail_header); mTitle = (TextView) inflate.findViewById(R.id.tv_fragment_rss_item_detail_title); mContent = (TextView) inflate.findViewById(R.id.tv_fragment_rss_item_detail_content); return inflate; } /* * ImageLoadingListener */ @Override public void onLoadingStarted(String imageUri, View view) { mProgressBar.animate() .alpha(1f) .setInterpolator(new AccelerateDecelerateInterpolator()) .setDuration(getActivity().getResources().getInteger(android.R.integer.config_shortAnimTime)) .start(); mHeaderImage.animate() .alpha(0f) .setInterpolator(new AccelerateDecelerateInterpolator()) .setDuration(getActivity().getResources().getInteger(android.R.integer.config_shortAnimTime)) .start(); } @Override public void onLoadingFailed(String imageUri, View view, FailReason failReason) { mProgressBar.animate() .alpha(0f) .setInterpolator(new AccelerateDecelerateInterpolator()) .setDuration(getActivity().getResources().getInteger(android.R.integer.config_shortAnimTime)) .start(); } @Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { mProgressBar.animate() .alpha(0f) .setInterpolator(new AccelerateDecelerateInterpolator()) .setDuration(getActivity().getResources().getInteger(android.R.integer.config_shortAnimTime)) .start(); mHeaderImage.setImageBitmap(loadedImage); mHeaderImage.animate() .alpha(1f) .setInterpolator(new AccelerateDecelerateInterpolator()) .setDuration(getActivity().getResources().getInteger(android.R.integer.config_shortAnimTime)) .start(); } @Override public void onLoadingCancelled(String imageUri, View view) {} }
[ "jmci10@hotmail.com" ]
jmci10@hotmail.com
d5a2e17a95facf519fb0eba1c9fe8de0e4df2d01
c30d4f174a28aac495463f44b496811ee0c21265
/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/Java8RegressionTest.java
26d9f6d81960b429ed4e996f596734b0b7eab80c
[ "Apache-2.0" ]
permissive
sarvex/intellij-community
cbbf08642231783c5b46ef2d55a29441341a03b3
8b8c21f445550bd72662e159ae715e9d944ba140
refs/heads/master
2023-05-14T14:32:51.014859
2023-05-01T06:59:21
2023-05-01T06:59:21
32,571,446
0
0
Apache-2.0
2023-05-01T06:59:22
2015-03-20T08:16:17
Java
UTF-8
Java
false
false
2,422
java
/* * Copyright 2000-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.codeInsight.daemon.lambda; import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase; import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection; import com.intellij.openapi.projectRoots.JavaSdkVersion; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.testFramework.IdeaTestUtil; import org.jetbrains.annotations.NonNls; public class Java8RegressionTest extends LightDaemonAnalyzerTestCase { @NonNls static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lambda/regression"; @Override protected void setUp() throws Exception { super.setUp(); enableInspectionTool(new UnusedDeclarationInspection()); } public void testIDEA136856() throws Exception { doTest(); } public void testIDEA136887() throws Exception { doTest(); } public void testIDEA136840() throws Exception { doTest(); } public void testIDEA137277() throws Exception { doTest(); } public void testIDEA137694() throws Exception { doTest(); } public void testIDEA137668() throws Exception { doTest(); } public void testIDEA137795() throws Exception { doTest(); } public void testIDEA137893() throws Exception { doTest(); } public void testIDEA138696() throws Exception { doTest(); } public void testIDEA131282() throws Exception { doTest(false); } public void testIDEA134945() throws Exception { doTest(false); } private void doTest() { doTest(false); } private void doTest(boolean warnings) { IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); doTest(BASE_PATH + "/" + getTestName(false) + ".java", warnings, false); } @Override protected Sdk getProjectJDK() { return IdeaTestUtil.getMockJdk18(); } }
[ "anna.kozlova@jetbrains.com" ]
anna.kozlova@jetbrains.com
f49c2de3d969cc4e20bc4832d5b14633931c6ef0
ea87e7258602e16675cec3e29dd8bb102d7f90f8
/fest-swing/src/main/java/org/fest/swing/util/Colors.java
7646d0c09c2980b23ae2565fe33b3a3f743a3888
[ "Apache-2.0" ]
permissive
codehaus/fest
501714cb0e6f44aa1b567df57e4f9f6586311862
a91c0c0585c2928e255913f1825d65fa03399bc6
refs/heads/master
2023-07-20T01:30:54.762720
2010-09-02T00:56:33
2010-09-02T00:56:33
36,525,844
1
0
null
null
null
null
UTF-8
Java
false
false
1,945
java
/* * Created on Apr 15, 2008 * * 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. * * Copyright @2008-2010 the original author or authors. */ package org.fest.swing.util; import static org.fest.util.Strings.*; import java.awt.Color; import org.fest.util.Strings; /** * Understands utility methods related to colors. * * @author Alex Ruiz */ public final class Colors { /** * Returns a <code>{@link Color}</code> from the given {@code String} containing the hexadecimal coding of a * color. * @param hexString contains the hexadecimal coding of a color. * @return a <code>Color</code> from the given {@code String} containing the hexadecimal coding of a color. * @throws NullPointerException if the hexadecimal code is {@code null}. * @throws IllegalArgumentException if the hexadecimal code is empty. * @throws NumberFormatException if the hexadecimal code is empty. */ public static Color colorFromHexString(String hexString) { if (hexString == null) throw new NullPointerException("The hexadecimal code should not be null"); if (Strings.isEmpty(hexString)) throw new IllegalArgumentException("The hexadecimal code should not be empty"); try { return new Color(Integer.parseInt(hexString, 16)); } catch (NumberFormatException e) { throw new NumberFormatException(concat("The hexadecimal code ", quote(hexString), " is not a valid color code")); } } private Colors() {} }
[ "alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc" ]
alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc
83fe41b4590f67944c44c99f66b8c24386f70fcb
efea07f32c57c84d9c137fd9fd287f77d039d919
/javasource/apmagent/actions/BatchDeleteEntity.java
3641b4511186b2876c7186f378071e05c89db9bb
[ "MIT" ]
permissive
McDoyen/yavasource
a4e53bb519ded49f85c8475fca7c94abf1cfdaee
fe15e7d9c3d230465583764d01daedd6157060a8
refs/heads/master
2021-05-07T01:22:45.391241
2017-11-10T11:48:54
2017-11-10T11:48:54
110,241,187
0
0
null
null
null
null
UTF-8
Java
false
false
2,030
java
// This file was generated by Mendix Modeler. // // WARNING: Only the following code will be retained when actions are regenerated: // - the import list // - the code between BEGIN USER CODE and END USER CODE // - the code between BEGIN EXTRA CODE and END EXTRA CODE // Other code you write will be lost the next time you deploy the project. // Special characters, e.g., é, ö, à, etc. are supported in comments. package apmagent.actions; import com.mendix.systemwideinterfaces.core.IContext; import com.mendix.webui.CustomJavaAction; import com.mendix.webui.FeedbackHelper; /** * xPathQuery starting with //EntityName and optionally with a qualifier between [ and ] * sortOrder attribute[:ASC|DESC][;attribute[:ASC|DESC] * numberToPreserve when wanting a log table to contain max 100.000 records pass 100.000 to this variable and sort so the last 100.000 records are preserved. * */ public class BatchDeleteEntity extends CustomJavaAction<java.lang.Boolean> { private java.lang.String xPathQuery; private java.lang.String sortOrder; private java.lang.Long numberToPreserve; public BatchDeleteEntity(IContext context, java.lang.String xPathQuery, java.lang.String sortOrder, java.lang.Long numberToPreserve) { super(context); this.xPathQuery = xPathQuery; this.sortOrder = sortOrder; this.numberToPreserve = numberToPreserve; } @Override public java.lang.Boolean executeAction() throws Exception { // BEGIN USER CODE nl.mansystems.shared.SharedFunctions.batchDelete(this.getContext(), xPathQuery, sortOrder, numberToPreserve); String entity = xPathQuery.substring(2, (xPathQuery.indexOf('[')>0?xPathQuery.indexOf('['):xPathQuery.length() ) ); FeedbackHelper.addRefreshClass(getContext(), entity); return true; // END USER CODE } /** * Returns a string representation of this action */ @Override public java.lang.String toString() { return "BatchDeleteEntity"; } // BEGIN EXTRA CODE // END EXTRA CODE }
[ "mrpoloh@yahoo.co.uk" ]
mrpoloh@yahoo.co.uk
366b96ea0ff203d7ab069bb0f31ce5c73cec4f03
07d87bfdc175514ed128bb730c54e8414ba112d8
/src/edgruberman/bukkit/silkpoke/Main.java
dada59b7043376081d1b3bc3bd0278b755c53ef6
[]
no_license
EdGruberman/SilkPoke
9242da6ce16c422265068616b7a09f9b18478af2
3b11e178b5c78b3a912872116186ab37bb45873f
refs/heads/master
2021-01-21T13:07:36.760275
2013-09-23T00:08:50
2013-09-23T00:08:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,004
java
package edgruberman.bukkit.silkpoke; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.enchantments.Enchantment; import org.bukkit.event.EventHandler; import org.bukkit.event.HandlerList; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.Plugin; import edgruberman.bukkit.silkpoke.commands.Reload; import edgruberman.bukkit.silkpoke.messaging.Courier.ConfigurationCourier; import edgruberman.bukkit.silkpoke.util.CustomPlugin; public final class Main extends CustomPlugin implements Listener { public static ConfigurationCourier courier; private final List<Permission> permissions = new ArrayList<Permission>(); @Override public void onLoad() { this.putConfigMinimum("2.3.0"); } @Override public void onEnable() { this.setPathSeparator('|').reloadConfig(); Main.courier = ConfigurationCourier.Factory.create(this).build(); this.loadPermissions(this.getConfig().getConfigurationSection("permissions")); if (this.getConfig().getBoolean("vaporizer")) Bukkit.getPluginManager().registerEvents(new Vaporizer(), this); Bukkit.getPluginManager().registerEvents(this, this); this.getCommand("silkpoke:reload").setExecutor(new Reload(this)); } @Override public void onDisable() { HandlerList.unregisterAll((Plugin) this); for (final Permission permission : this.permissions) Bukkit.getPluginManager().removePermission(permission); Main.courier = null; } private void loadPermissions(final ConfigurationSection permissions) { if (permissions == null) return; for (final String name : permissions.getKeys(false)) { final ConfigurationSection permission = permissions.getConfigurationSection(name); final String description = permission.getString("description"); final PermissionDefault permDefault = PermissionDefault.getByName(permission.getString("default", Permission.DEFAULT_PERMISSION.name())); final Map<String, Boolean> children = new HashMap<String, Boolean>(); for (final String child : permission.getConfigurationSection("children").getKeys(false)) children.put(child, permission.getConfigurationSection("children").getBoolean(child)); final Permission created = new Permission(name, description, permDefault, children); this.permissions.add(created); Bukkit.getPluginManager().addPermission(created); } } @EventHandler(ignoreCancelled = true) public void onBlockBreak(final BlockBreakEvent event) { if (!event.getPlayer().getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) return; final String permission = "silkpoke.material." + event.getBlock().getType().name(); if (!event.getPlayer().hasPermission(permission)) return; event.setCancelled(true); final ItemStack drop = new ItemStack(event.getBlock().getType(), 1); drop.setData(event.getBlock().getState().getData()); event.getBlock().setType(Material.AIR); event.getBlock().getWorld().dropItemNaturally(event.getBlock().getLocation(), drop); this.getLogger().log(Level.FINEST, "Dropped {0}:{1} for {2} using {3} with {4}" , new Object[] { drop.getType().name(), (int) drop.getDurability() , event.getPlayer().getName(), event.getPlayer().getItemInHand().getType().name() , Enchantment.SILK_TOUCH.getName() }); } }
[ "ed@rjump.com" ]
ed@rjump.com
5ddbddd0fd9070d1ff78eee43fd32c92539390ac
d31fc6d37d0610e1d0081affcb184dc0f22dfdd9
/src/mddtools/preferences/MDDToolsPrefsAlertDialog.java
cfbb6ce2fa21cfe08dee3da8d8de40f597729055
[]
no_license
csipiemonte/mddtools
2de79281c8899beb04939803e2ec0f37a0e2ebde
fe93b657cd25d63dcf0c42e6896acc5d7ae0d6ae
refs/heads/master
2020-08-29T12:08:19.170015
2017-07-10T14:08:08
2017-07-10T14:08:08
218,027,174
0
0
null
null
null
null
ISO-8859-1
Java
false
false
6,002
java
package mddtools.preferences; import mddtools.Activator; import mddtools.util.BrowserUtils; import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.NotEnabledException; import org.eclipse.core.commands.NotHandledException; import org.eclipse.core.commands.Parameterization; import org.eclipse.core.commands.ParameterizedCommand; import org.eclipse.core.commands.common.NotDefinedException; import org.eclipse.emf.mwe.internal.core.debug.processing.handlers.CommandRuntimeHandler; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.window.IShellProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.commands.ICommandService; import org.eclipse.ui.handlers.IHandlerService; public class MDDToolsPrefsAlertDialog extends Dialog { // private Button checkBox; private boolean reportEnabled; public MDDToolsPrefsAlertDialog(boolean reportEnabled, Shell parentShell) { super(parentShell); this.reportEnabled = reportEnabled; } public MDDToolsPrefsAlertDialog(boolean reportEnabled, IShellProvider parentShell) { super(parentShell); this.reportEnabled = reportEnabled; } protected void buttonPressed(int buttonId) { // if (buttonId == IDialogConstants.OK_ID) { // this.reportEnabled = checkBox.getSelection(); // } else if (buttonId == IDialogConstants.CANCEL_ID) { // this.reportEnabled = false; // } super.buttonPressed(buttonId); } protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(getDialogTitle()); } private String getDialogTitle() { return "MDDTools usage tracking"; } public final static String DLG_TITLE = "Configurazione iniziale MDDTools mancante"; public final static String DLG_MESSAGE = "Attenzione: prima di poter utilizzare gli MDD-Tools è necessario configurare le preferenze dello strumento\n"+ "(selezionare la voce di menu: window -> preferences -> MDDTools preferences).\n"+ "Le impostazioni permettono di abilitare/disabilitare l'invio di informazioni statistiche sull'utilizzo dei vari tool."; public final static String EXPLANATION_PAGE = "http://mdd.csipiemonte.it/usageTracking.html"; // public final static String CHECKBOX_TEXT = "Report usage of MDDTools to development team."; protected void createButtonsForButtonBar(Composite parent) { Button b_ok = createButton(parent, IDialogConstants.OK_ID, "Apri il dialog delle preferenze", true); b_ok.addSelectionListener(new SelectionAdapter(){ public void widgetSelected(SelectionEvent e) { // apre la pagina di properties IWorkbench workbench = PlatformUI.getWorkbench(); IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class); ICommandService commandService = (ICommandService) workbench.getService(ICommandService.class); try { Command prefCmd = commandService.getCommand("org.eclipse.ui.window.preferences"); Parameterization params[] = new Parameterization[1]; params[0] = new Parameterization(prefCmd.getParameters()[0], "mddtools.preferences.MDDToolsPreferencePage"); ParameterizedCommand mddToolPrefCmd = new ParameterizedCommand(prefCmd, params); //handlerService.executeCommand("org.eclipse.ui.window.preferences", null); handlerService.executeCommand(mddToolPrefCmd, null); } catch (ExecutionException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NotDefinedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NotEnabledException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NotHandledException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); b_ok.setFocus(); //createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); //checkBox.setFocus(); //checkBox.setSelection(reportEnabled); } protected Control createDialogArea(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); composite.setLayout(new GridLayout()); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); // message Link link = new Link(composite, SWT.WRAP); link.setFont(parent.getFont()); link.setText(DLG_MESSAGE); link.setToolTipText(EXPLANATION_PAGE); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { BrowserUtils.checkedCreateExternalBrowser( EXPLANATION_PAGE, Activator.PLUGIN_ID, Activator.getDefault().getLog()); } }); /* per il momento il link è disabilitato perchè non è ancora disponibile la pagina Button b = new Button(composite, SWT.NULL); b.setText("MDDTools usage tracking: dettagli"); b.setToolTipText("Premere per visualizzare una pagina esplicativa \ndel meccanismo di usage tracking degli MDDTools"); b.addSelectionListener(new SelectionAdapter(){ public void widgetSelected(SelectionEvent e) { BrowserUtils.checkedCreateExternalBrowser( EXPLANATION_PAGE, Activator.PLUGIN_ID, Activator.getDefault().getLog()); } }); */ // checkbox // checkBox = new Button(composite, SWT.CHECK); // checkBox.setText(CHECKBOX_TEXT); return composite; } public boolean isReportEnabled() { return reportEnabled; } }
[ "mauro.antonaci@csi.it" ]
mauro.antonaci@csi.it
2e82d6254dfe1a539edc08a8103b35620d6ab613
8f30ec284c29e02d8cacf2ef0b2b901d84fddb7a
/net.dougqh.jak.core.assembler/src/net/dougqh/jak/assembler/ThisType.java
31762602291631c5bcb2ceacd1f42917ad0cf454
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
dougqh/JAK
8b7096766b36909262d03a3754ae71b1c8c67e03
e10da7384cce6466530c12378ee782a1d8209b51
refs/heads/master
2021-01-01T16:19:39.434996
2013-04-04T04:01:42
2013-04-04T04:01:42
732,624
11
2
null
2013-04-04T04:01:27
2010-06-21T20:00:44
Java
UTF-8
Java
false
false
187
java
package net.dougqh.jak.assembler; import java.lang.reflect.Type; final class ThisType implements Type { protected static ThisType INSTANCE = new ThisType(); private ThisType() {} }
[ "dougqh@gmail.com" ]
dougqh@gmail.com
1fc0575175b78f4113a78d777d3202b54ea9f3c9
ccfeb0a261adb7954cd9b82679255a85302e0601
/to0client/src/main/java/org/sdo/cri/to0client/package-info.java
55f9b3c5e4b6d53c5ae106571a2a117dfffca921
[ "Apache-2.0" ]
permissive
bprashan/cri
edfd924ae7a9fa2334de744d671acf9badabff78
f01cd3285e45faaa2ebb1ed5ac07cdbb8c9f5a1b
refs/heads/master
2021-05-16T22:46:44.122703
2020-04-26T17:15:22
2020-04-26T17:15:22
250,501,119
0
3
Apache-2.0
2020-05-15T11:20:58
2020-03-27T10:10:29
Java
UTF-8
Java
false
false
158
java
// Copyright 2020 Intel Corporation // SPDX-License-Identifier: Apache 2.0 /** * A Java client for the SDO TO0 protocol. */ package org.sdo.cri.to0client;
[ "tushar.ranjan.behera@intel.com" ]
tushar.ranjan.behera@intel.com
18c43351d24f52548573f0f5e199f0dffe609af6
3ea90852ce844b9fdb21e5d391aed7929013bce5
/rapla-source-1.8.4/src/org/rapla/rest/server/AbstractRestPage.java
0a719328fed69a2d9ce10bb3471e5e47f30ce18e
[]
no_license
Ayce45/OverwatchBTS
5e2b932d9b3d7744b0f6bc2bba1cb2b0f5bfc06c
eb1ece3695b0b34ecad0422e9e878563f486e01f
refs/heads/master
2020-04-12T19:26:13.116600
2019-09-14T12:50:41
2019-09-14T12:50:41
162,708,924
1
0
null
null
null
null
UTF-8
Java
false
false
7,546
java
package org.rapla.rest.server; import java.io.IOException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.rapla.entities.User; import org.rapla.entities.dynamictype.Attribute; import org.rapla.entities.dynamictype.ClassificationFilter; import org.rapla.entities.dynamictype.DynamicType; import org.rapla.entities.dynamictype.DynamicTypeAnnotations; import org.rapla.facade.ClientFacade; import org.rapla.facade.RaplaComponent; import org.rapla.framework.RaplaContext; import org.rapla.framework.RaplaException; import org.rapla.rest.gwtjsonrpc.server.JsonServlet; import org.rapla.server.ServerServiceContainer; import org.rapla.servletpages.RaplaPageGenerator; import org.rapla.storage.RaplaSecurityException; import org.rapla.storage.StorageOperator; public class AbstractRestPage extends RaplaComponent implements RaplaPageGenerator { protected StorageOperator operator; protected JsonServlet servlet; protected final ServerServiceContainer serverContainer; String getMethod = null; String updatetMethod = null; String listMethod = null; String createMethod = null; public AbstractRestPage(RaplaContext context) throws RaplaException { super(context); operator = context.lookup( ClientFacade.class).getOperator(); serverContainer = context.lookup(ServerServiceContainer.class); Class class1 = getServiceObject().getClass(); Collection<String> publicMethodNames = getPublicMethods(class1); servlet = new JsonServlet(getLogger(), class1); if ( publicMethodNames.contains("get")) { getMethod = "get"; } if ( publicMethodNames.contains("update")) { updatetMethod = "update"; } if ( publicMethodNames.contains("create")) { createMethod = "create"; } if ( publicMethodNames.contains("list")) { listMethod = "list"; } } @Override public void generatePage(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { User user; Object serviceObj = getServiceObject(); try { user = serverContainer.getUser(request); if ( user == null) { throw new RaplaSecurityException("User not authentified. Pass access token"); } request.setAttribute("user", user); String pathInfo = request.getPathInfo(); int appendix = pathInfo.indexOf("/",1); String method = request.getMethod(); if ( appendix > 0) { if ( method.equals("GET") && getMethod != null ) { String id = pathInfo.substring(appendix+1); request.setAttribute("id", id); request.setAttribute("method", getMethod); } else if ( method.equals("PATCH") && getMethod != null && updatetMethod != null) { String id = pathInfo.substring(appendix+1); request.setAttribute("id", id); request.setAttribute("method", getMethod); request.setAttribute("patchMethod", updatetMethod); } else if ( method.equals("PUT") && updatetMethod != null) { String id = pathInfo.substring(appendix+1); request.setAttribute("id", id); request.setAttribute("method", updatetMethod); } else { throw new RaplaException(method + " Method not supported in this context"); } } else { if ( method.equals("GET") && listMethod != null) { request.setAttribute("method", listMethod); } else if ( method.equals("POST") && createMethod != null) { request.setAttribute("method", createMethod); } else { throw new RaplaException(method + " Method not supported in this context"); } } } catch (RaplaException ex) { servlet.serviceError(request, response, servletContext, ex); return; } servlet.service(request, response, servletContext, serviceObj); // super.generatePage(servletContext, request, response); } protected Collection<String> getPublicMethods(Class class1) { HashSet<String> result = new HashSet<String>(); for (Method m:class1.getMethods()) { if ( Modifier.isPublic(m.getModifiers() )) { result.add( m.getName()); } } return result; } public ClassificationFilter[] getClassificationFilter(Map<String, String> simpleFilter, Collection<String> selectedClassificationTypes, Collection<String> typeNames) throws RaplaException { ClassificationFilter[] filters = null; if ( simpleFilter != null || typeNames == null) { DynamicType[] types = getQuery().getDynamicTypes(null); List<ClassificationFilter> filterList = new ArrayList<ClassificationFilter>(); for ( DynamicType type:types) { String classificationType = type.getAnnotation(DynamicTypeAnnotations.KEY_CLASSIFICATION_TYPE); if ( classificationType == null || !selectedClassificationTypes.contains(classificationType)) { continue; } ClassificationFilter classificationFilter = type.newClassificationFilter(); if ( typeNames != null) { if ( !typeNames.contains( type.getKey())) { continue; } } if ( simpleFilter != null) { for (String key:simpleFilter.keySet()) { Attribute att = type.getAttribute(key); if ( att != null) { String value = simpleFilter.get(key); // convert from string to attribute type Object object = att.convertValue(value); if ( object != null) { classificationFilter.addEqualsRule(att.getKey(), object); } filterList.add(classificationFilter); } } } else { filterList.add(classificationFilter); } } filters = filterList.toArray( new ClassificationFilter[] {}); } return filters; } private Object getServiceObject() { return this; } }
[ "32338891+Ayce45@users.noreply.github.com" ]
32338891+Ayce45@users.noreply.github.com
141e10f123141f81c24274b4edc968f3d0adb364
d7fe2596a70f915e35fb6f8dc4fbc080eb1390c5
/src/main/java/org/elasticsearch/client/transport/support/InternalTransportClusterAdminClient.java
7b59e5f11d51391f65d1a32edb45298eb4c58eab
[ "Apache-2.0" ]
permissive
Oneiroi/elasticsearch
009f93d477ef75e196674edcb5bdc755b254c7b0
d66f401ce6b0ac6baa0d461f12ca3d002407b49d
refs/heads/master
2022-09-13T12:51:35.270084
2012-06-18T20:45:17
2012-06-19T02:13:47
4,712,532
0
0
Apache-2.0
2022-09-09T18:17:56
2012-06-19T10:58:24
Java
UTF-8
Java
false
false
4,201
java
/* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch 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.elasticsearch.client.transport.support; import com.google.common.collect.ImmutableMap; import org.elasticsearch.ElasticSearchException; import org.elasticsearch.action.*; import org.elasticsearch.action.admin.cluster.ClusterAction; import org.elasticsearch.client.internal.InternalClusterAdminClient; import org.elasticsearch.client.support.AbstractClusterAdminClient; import org.elasticsearch.client.transport.TransportClientNodesService; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import java.util.Map; /** * */ public class InternalTransportClusterAdminClient extends AbstractClusterAdminClient implements InternalClusterAdminClient { private final TransportClientNodesService nodesService; private final ThreadPool threadPool; private final ImmutableMap<ClusterAction, TransportActionNodeProxy> actions; @Inject public InternalTransportClusterAdminClient(Settings settings, TransportClientNodesService nodesService, ThreadPool threadPool, TransportService transportService, Map<String, GenericAction> actions) { this.nodesService = nodesService; this.threadPool = threadPool; MapBuilder<ClusterAction, TransportActionNodeProxy> actionsBuilder = new MapBuilder<ClusterAction, TransportActionNodeProxy>(); for (GenericAction action : actions.values()) { if (action instanceof ClusterAction) { actionsBuilder.put((ClusterAction) action, new TransportActionNodeProxy(settings, action, transportService)); } } this.actions = actionsBuilder.immutableMap(); } @Override public ThreadPool threadPool() { return this.threadPool; } @Override public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response>> ActionFuture<Response> execute(final ClusterAction<Request, Response, RequestBuilder> action, final Request request) { final TransportActionNodeProxy<Request, Response> proxy = actions.get(action); return nodesService.execute(new TransportClientNodesService.NodeCallback<ActionFuture<Response>>() { @Override public ActionFuture<Response> doWithNode(DiscoveryNode node) throws ElasticSearchException { return proxy.execute(node, request); } }); } @Override public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response>> void execute(final ClusterAction<Request, Response, RequestBuilder> action, final Request request, final ActionListener<Response> listener) { final TransportActionNodeProxy<Request, Response> proxy = actions.get(action); nodesService.execute(new TransportClientNodesService.NodeListenerCallback<Response>() { @Override public void doWithNode(DiscoveryNode node, ActionListener<Response> listener) throws ElasticSearchException { proxy.execute(node, request, listener); } }, listener); } }
[ "kimchy@gmail.com" ]
kimchy@gmail.com
8facbc1512ef188b402fefc3f76132eb73bc2a40
e1a4acf1d41b152a0f811e82c27ad261315399cc
/lang_interface/java/com/intel/daal/algorithms/neural_networks/layers/average_pooling1d/AveragePooling1dBackwardInput.java
f5749b8288d80534d3b76362b10e0faed82d4e44
[ "Apache-2.0", "Intel" ]
permissive
ValeryiE/daal
e7572f16e692785db1e17bed23b6ab709db4e705
d326bdc5291612bc9e090d95da65aa579588b81e
refs/heads/master
2020-08-29T11:37:16.157315
2019-10-25T13:11:01
2019-10-25T13:11:01
218,020,419
0
0
Apache-2.0
2019-10-28T10:22:19
2019-10-28T10:22:19
null
UTF-8
Java
false
false
3,035
java
/* file: AveragePooling1dBackwardInput.java */ /******************************************************************************* * Copyright 2014-2019 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ /** * @defgroup average_pooling1d_backward Backward One-dimensional Average Pooling Layer * @brief Contains classes for backward average 1D pooling layer * @ingroup average_pooling1d * @{ */ package com.intel.daal.algorithms.neural_networks.layers.average_pooling1d; import com.intel.daal.utils.*; import com.intel.daal.services.DaalContext; import com.intel.daal.data_management.data.Factory; import com.intel.daal.data_management.data.NumericTable; /** * <a name="DAAL-CLASS-ALGORITHMS__NEURAL_NETWORKS__LAYERS__AVERAGE_POOLING1D__AVERAGEPOOLING1DBACKWARDINPUT"></a> * @brief Input object for the backward one-dimensional average pooling layer */ public final class AveragePooling1dBackwardInput extends com.intel.daal.algorithms.neural_networks.layers.pooling1d.Pooling1dBackwardInput { /** @private */ static { LibUtils.loadLibrary(); } public AveragePooling1dBackwardInput(DaalContext context, long cObject) { super(context, cObject); } /** * Sets the input object of the backward one-dimensional average pooling layer * @param id Identifier of the input object * @param val Value of the input object */ public void set(AveragePooling1dLayerDataId id, NumericTable val) { if (id == AveragePooling1dLayerDataId.auxInputDimensions) { cSetInput(cObject, id.getValue(), val.getCObject()); } else { throw new IllegalArgumentException("Incorrect AveragePooling1dBackwardInputId"); } } /** * Returns the input object of the backward one-dimensional average pooling layer * @param id Identifier of the input object * @return Input object that corresponds to the given identifier */ public NumericTable get(AveragePooling1dLayerDataId id) { if (id == AveragePooling1dLayerDataId.auxInputDimensions) { return (NumericTable)Factory.instance().createObject(getContext(), cGetInput(cObject, id.getValue())); } else { throw new IllegalArgumentException("id unsupported"); } } private native void cSetInput(long cObject, int id, long ntAddr); private native long cGetInput(long cObject, int id); } /** @} */
[ "nikolay.a.petrov@intel.com" ]
nikolay.a.petrov@intel.com
5b578b6ce6ce87f601b42ddb59ad1384446c374f
7e57a9c43657fc0391cc0a65b1d7890ae1d166e3
/src/main/java/com/abilists/service/LoginService.java
8aa1f0746a687fcab794d1c88fac4b38f01c26fc
[ "Apache-2.0" ]
permissive
minziappa/abilists
6f8ea71efcee433e35b518035e5c668cd36626d1
1d48aabafb9533d30b425a4f2ce87a84e01e89ef
refs/heads/master
2020-05-21T16:29:52.154690
2017-02-25T02:55:35
2017-02-25T02:55:35
79,440,574
1
0
null
null
null
null
UTF-8
Java
false
false
913
java
package com.abilists.service; import com.abilists.bean.model.UserTemp; import com.abilists.bean.para.LoginPara; import com.abilists.bean.para.login.CompleteConfirmPara; import com.abilists.bean.para.login.CompleteResetPwdPara; import com.abilists.bean.para.login.SignUpPara; public interface LoginService { public boolean insertUserTemp(SignUpPara signUpPara) throws Exception; public void sendEmail(SignUpPara signUpPara) throws Exception; public void sendEmailForResetPwd(SignUpPara signUpPara) throws Exception; public boolean validateEmail(String userEmail) throws Exception; public boolean validatePwd(LoginPara loginPara) throws Exception; public UserTemp sltUserTemp(String token) throws Exception; public boolean completeRegister(CompleteConfirmPara registerPwdPara) throws Exception; public boolean updatePwd(CompleteResetPwdPara completeResetPwdPara) throws Exception; }
[ "minziappa@gmail.com" ]
minziappa@gmail.com
0cbae56fef4372cb6a9961f7403d5791178d53ad
52aa753885647b44c60abf691bfb0116be6fca4e
/src/edu/cmu/cs/stage3/alice/scenegraph/util/SegmentBBox.java
faeb684d5a7f6951c6bf09be06dceb089012e515
[ "MIT" ]
permissive
ai-ku/langvis
10083029599dac0a0098cdc4cbf77f3e1bdf6d43
4ccd37107a3dea4b7b12696270a25df9c17d579d
refs/heads/master
2020-12-24T15:14:43.644569
2014-03-26T13:43:25
2014-03-26T14:09:03
15,770,922
1
0
null
null
null
null
UTF-8
Java
false
false
4,300
java
/* * Copyright (c) 1999-2003, Carnegie Mellon University. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Products derived from the software may not be called "Alice", * nor may "Alice" appear in their name, without prior written * permission of Carnegie Mellon University. * * 4. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes software developed by Carnegie Mellon University" */ package edu.cmu.cs.stage3.alice.scenegraph.util; /** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: Stage3</p> * @author Ben Buchwald * @version 1.0 */ import javax.vecmath.Point2d; public class SegmentBBox { Point2d[] pointBounds = new Point2d[2]; double[] yBounds = new double[2]; Point2d[] pointBoundsB = new Point2d[2]; double[] yBoundsB = new double[2]; public SegmentBBox(Point2d a, Point2d b) { if (Triangulator.pointCompare(a,b)<0) { pointBounds[0]=a; pointBounds[1]=b; } else { pointBounds[0]=b; pointBounds[1]=a; } if (a.y<b.y) { yBounds[0]=a.y; yBounds[1]=b.y; } else { yBounds[0]=b.y; yBounds[1]=a.y; } } public boolean boxOverlaps(Point2d a,Point2d b) { if (Triangulator.pointCompare(a,b)<0) { pointBoundsB[0]=a; pointBoundsB[1]=b; } else { pointBoundsB[0]=b; pointBoundsB[1]=a; } if (a.y<b.y) { yBoundsB[0]=a.y; yBoundsB[1]=b.y; } else { yBoundsB[0]=b.y; yBoundsB[1]=a.y; } if (Triangulator.pointCompare(pointBounds[1],pointBoundsB[0])<0) return false; if (Triangulator.pointCompare(pointBounds[0],pointBoundsB[1])>0) return false; if (yBounds[1]<yBoundsB[0]) return false; if (yBounds[0]>yBoundsB[1]) return false; return true; } public boolean segmentOverlaps(Point2d a,Point2d b) { if (!boxOverlaps(a,b)) return false; if (Triangulator.pointCompare(pointBounds[0],pointBounds[1])==0 || Triangulator.pointCompare(pointBoundsB[0],pointBoundsB[1])==0) return false; if (Triangulator.pointCompare(pointBounds[0],pointBoundsB[0])==0 && Triangulator.pointCompare(pointBounds[1],pointBoundsB[1])==0) return true; int orient1 = Triangle.orientation(pointBounds[0],pointBounds[1],pointBoundsB[0]); int orient2 = Triangle.orientation(pointBounds[0],pointBounds[1],pointBoundsB[1]); if (orient1 == orient2 && orient1!=0) return false; if (orient1==0) { if (Triangulator.pointCompare(pointBounds[0],pointBoundsB[0])<0 && Triangulator.pointCompare(pointBoundsB[0],pointBounds[1])<0) return true; if (orient2==0 && Triangulator.pointCompare(pointBounds[0],pointBoundsB[1])<0 && Triangulator.pointCompare(pointBoundsB[1],pointBounds[1])<0) return true; return false; } else if (orient2==0) { if (Triangulator.pointCompare(pointBounds[0],pointBoundsB[1])<0 && Triangulator.pointCompare(pointBoundsB[1],pointBounds[1])<0) return true; return false; } if ( Triangle.orientation(pointBoundsB[0],pointBoundsB[1],pointBounds[0])==Triangle.orientation(pointBoundsB[0],pointBoundsB[1],pointBounds[1]) ) return false; return true; } }
[ "emreunal99@gmail.com" ]
emreunal99@gmail.com
b979615469a21fe094e82de4d231b338270ea0fd
114433842ca5ea98ecc45384a2c676ef26cf1213
/src/test/java/com/diego/garagem/config/StaticResourcesWebConfigurerTest.java
25ad6b96d6053fb62d13f0de32525ecbddfd684b
[]
no_license
diekof/garagem-app
0cb87e1b3c09de3fa8c3b331165ef2df41aaca3e
dbefceb035d3545a423608e2e6e533396b51b115
refs/heads/main
2023-06-03T23:34:34.639562
2021-06-21T16:37:56
2021-06-21T16:37:56
378,997,725
0
0
null
null
null
null
UTF-8
Java
false
false
3,616
java
package com.diego.garagem.config; import static com.diego.garagem.config.StaticResourcesWebConfiguration.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.http.CacheControl; import org.springframework.mock.web.MockServletContext; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import tech.jhipster.config.JHipsterDefaults; import tech.jhipster.config.JHipsterProperties; class StaticResourcesWebConfigurerTest { public static final int MAX_AGE_TEST = 5; public StaticResourcesWebConfiguration staticResourcesWebConfiguration; private ResourceHandlerRegistry resourceHandlerRegistry; private MockServletContext servletContext; private WebApplicationContext applicationContext; private JHipsterProperties props; @BeforeEach void setUp() { servletContext = spy(new MockServletContext()); applicationContext = mock(WebApplicationContext.class); resourceHandlerRegistry = spy(new ResourceHandlerRegistry(applicationContext, servletContext)); props = new JHipsterProperties(); staticResourcesWebConfiguration = spy(new StaticResourcesWebConfiguration(props)); } @Test void shouldAppendResourceHandlerAndInitiliazeIt() { staticResourcesWebConfiguration.addResourceHandlers(resourceHandlerRegistry); verify(resourceHandlerRegistry, times(1)).addResourceHandler(RESOURCE_PATHS); verify(staticResourcesWebConfiguration, times(1)).initializeResourceHandler(any(ResourceHandlerRegistration.class)); for (String testingPath : RESOURCE_PATHS) { assertThat(resourceHandlerRegistry.hasMappingForPattern(testingPath)).isTrue(); } } @Test void shouldInitializeResourceHandlerWithCacheControlAndLocations() { CacheControl ccExpected = CacheControl.maxAge(5, TimeUnit.DAYS).cachePublic(); when(staticResourcesWebConfiguration.getCacheControl()).thenReturn(ccExpected); ResourceHandlerRegistration resourceHandlerRegistration = spy(new ResourceHandlerRegistration(RESOURCE_PATHS)); staticResourcesWebConfiguration.initializeResourceHandler(resourceHandlerRegistration); verify(staticResourcesWebConfiguration, times(1)).getCacheControl(); verify(resourceHandlerRegistration, times(1)).setCacheControl(ccExpected); verify(resourceHandlerRegistration, times(1)).addResourceLocations(RESOURCE_LOCATIONS); } @Test void shoudCreateCacheControlBasedOnJhipsterDefaultProperties() { CacheControl cacheExpected = CacheControl.maxAge(JHipsterDefaults.Http.Cache.timeToLiveInDays, TimeUnit.DAYS).cachePublic(); assertThat(staticResourcesWebConfiguration.getCacheControl()) .extracting(CacheControl::getHeaderValue) .isEqualTo(cacheExpected.getHeaderValue()); } @Test void shoudCreateCacheControlWithSpecificConfigurationInProperties() { props.getHttp().getCache().setTimeToLiveInDays(MAX_AGE_TEST); CacheControl cacheExpected = CacheControl.maxAge(MAX_AGE_TEST, TimeUnit.DAYS).cachePublic(); assertThat(staticResourcesWebConfiguration.getCacheControl()) .extracting(CacheControl::getHeaderValue) .isEqualTo(cacheExpected.getHeaderValue()); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
92a5302285f6a0c83b25f201da8020befc1c200e
dac583dd79af02d6c44fd393331162298ed02426
/src/main/java/com/selectica/PhilipRCFTEST/eclm/definitions/CNDABO/actions/SetStatusDraftAction.java
563343b169efcc7bfc4f0f96a200c9b4d0c5ab2d
[]
no_license
pkoptilin/ECLM_RCF_Phase0
b985b3e4aa0af96057b7af6bf65c6b85cff72c76
5a467f7dce7f956f45c8b70200e2840ee7cd3878
refs/heads/master
2020-12-11T05:37:52.708323
2015-07-30T10:26:12
2015-07-30T10:26:12
39,936,762
1
0
null
2015-07-30T07:16:21
2015-07-30T07:16:20
null
UTF-8
Java
false
false
757
java
package com.selectica.PhilipRCFTEST.eclm.definitions.CNDABO.actions; import com.selectica.PhilipRCFTEST.eclm.definitions.ContractStatus; import com.selectica.PhilipRCFTEST.stubs.CNDADetails; import com.selectica.rcfscripts.AbstractBOWriteScript; /** * Created by vshilkin on 09/01/2015. */ public class SetStatusDraftAction extends AbstractBOWriteScript<Boolean> { /* thisComponent.setValue("CNDABO/ReqCNDADetails/contractStatus","Draft"); thisComponent.save(); */ @Override public Boolean process() throws Exception { CNDADetails info = getHelper().getInfoComponentStub(); info.setContractStatus(ContractStatus.DRAFT.getStatus()); return getHelper().saveComponent(info); } }
[ "rcf@selectica.com" ]
rcf@selectica.com
3c790b187498654ec0984209aa063031d364a188
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/X/C29921aQ.java
15217aa2fb8bac390b531430a99f3dec63dcc960
[]
no_license
technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666116
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
UTF-8
Java
false
false
650
java
package X; import android.content.Intent; /* renamed from: X.1aQ reason: invalid class name and case insensitive filesystem */ public final class C29921aQ implements AbstractC14510mP { public final int A00; public final Intent A01; public final /* synthetic */ AnonymousClass0PF A02; public C29921aQ(AnonymousClass0PF r1, Intent intent, int i) { this.A02 = r1; this.A01 = intent; this.A00 = i; } @Override // X.AbstractC14510mP public void A2s() { this.A02.stopSelf(this.A00); } @Override // X.AbstractC14510mP public Intent getIntent() { return this.A01; } }
[ "madeinborneo@gmail.com" ]
madeinborneo@gmail.com
984aa1080caeb682d72f1693e17d0a1ea0547286
7ecbb3719565a487154f2d048ef2f8ef11ff7f0d
/core/src/main/java/com/metaui/core/web/action/BaseAction.java
275d015af43792ca6271b798fadf2a74d2a8d5d4
[ "Apache-2.0" ]
permissive
weijiancai/metaui
5bbe91f2e4c176b6ae48bc598d8531d076ef086d
b3daecf2b6ef5599c1e8fa92632d40bfee0936e0
refs/heads/master
2022-09-15T08:47:13.977905
2020-09-26T03:29:08
2020-09-26T03:29:08
30,705,651
0
2
Apache-2.0
2022-09-01T22:41:37
2015-02-12T14:18:25
JavaScript
UTF-8
Java
false
false
1,487
java
package com.metaui.core.web.action; import com.alibaba.fastjson.JSON; import com.metaui.core.util.UFile; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; /** * Base Action * * @author wei_jc * @since 1.0.0 */ public abstract class BaseAction extends HttpServlet { public enum BrowserType { MSIE, FIREFOX, CHROME } protected BrowserType browserType; protected void writeJsonObject(HttpServletResponse res, Object obj) throws IOException { res.setContentType("application/json;charset=UTF-8"); res.getWriter().write(JSON.toJSONString(obj)); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String userAgent = req.getHeader("User-Agent"); if (userAgent.contains("MSIE")) { browserType = BrowserType.MSIE; } else if (userAgent.contains("Firefox")) { browserType = BrowserType.FIREFOX; } else if (userAgent.contains("Chrome")) { browserType = BrowserType.CHROME; } doPost(req, res); } protected Map<String, Object> getData(HttpServletRequest req) throws IOException { String jsonStr = UFile.readString(req.getInputStream(), "UTF-8"); return JSON.parseObject(jsonStr); } }
[ "weijiancai@126.com" ]
weijiancai@126.com
065b0fb5c138dc702150bbb3c941b842fef0a3a9
9ed918fac39f617d38194b96a3476c3a64b3bd4f
/JavaLab/Java/TestJava/src/ILaptop.java
8acb6758881bff0a05f852c81cf2a6359de9f3e8
[]
no_license
quanghuynguyen2412/FPTU
e1a85cb4632ec8cea8e86568a0cf1b1bf45211c1
d9f6f8a613b42148f5a4ea37d6dc224434e78cbd
refs/heads/master
2022-04-17T10:51:36.203986
2020-04-17T10:22:51
2020-04-17T10:22:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
148
java
import java.util.ArrayList; public interface ILaptop { public String f1(ArrayList<Laptop> a); public int f2(ArrayList<Laptop> a); }
[ "=" ]
=
ee4ae372304e1733a882612b6dceea23b19ebfc7
97c0cfe5592bd57a6b3c853d56cef44e90b790b0
/service/service_ucenter/src/main/java/com/atguigu/educenter/controller/UcenterMemberController.java
9fec040510b75766febe0f12404bf2f3efd741b5
[]
no_license
HWenTing/online-study-platform
053fd03814fcb8830ffc85e642d08f57700668f5
09906105c35b0535ea086b116803cb73cbc23299
refs/heads/master
2023-02-06T18:08:19.932911
2020-12-27T13:22:44
2020-12-27T13:22:44
324,766,195
1
0
null
null
null
null
UTF-8
Java
false
false
1,745
java
package com.atguigu.educenter.controller; import com.atguigu.commonutils.JwtUtils; import com.atguigu.commonutils.R; import com.atguigu.educenter.entity.UcenterMember; import com.atguigu.educenter.entity.vo.RegisterUserVo; import com.atguigu.educenter.service.UcenterMemberService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; /** * <p> * 会员表 前端控制器 * </p> * * @author atguigu * @since 2020-10-20 */ @RestController @RequestMapping("/educenter/member") //@CrossOrigin public class UcenterMemberController { @Autowired private UcenterMemberService ucenterMemberService; // 登陆 @PostMapping("login") public R loginUser(@RequestBody UcenterMember ucenterMember){ // 生成token值 通过jwt得到 String token = ucenterMemberService.login(ucenterMember); return R.ok().data("token",token); } // 注册 @PostMapping("register") public R registerUser(@RequestBody RegisterUserVo registerUserVo){ ucenterMemberService.register(registerUserVo); return R.ok(); } // "根据token获取登录信息" @GetMapping("getLoginInfo") public R getLoginInfo(HttpServletRequest request){ String id = JwtUtils.getMemberIdByJwtToken(request); UcenterMember member = ucenterMemberService.getById(id); return R.ok().data("member",member); } // 查询某一天的注册人数 @GetMapping(value = "countRegister/{day}") public R countRegister(@PathVariable String day){ Integer cnt = ucenterMemberService.countRegisterDay(day); return R.ok().data("countRegister", cnt); } }
[ "982740445@qq.com" ]
982740445@qq.com
70fb06a7b4c5bc8296a33c4a272081c79e6c4117
61602d4b976db2084059453edeafe63865f96ec5
/com/huawei/hms/support/api/push/a/a/a.java
d45cf77a2eec2d4d105d36a7fbb318c071c16159
[]
no_license
ZoranLi/thunder
9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0
0778679ef03ba1103b1d9d9a626c8449b19be14b
refs/heads/master
2020-03-20T23:29:27.131636
2018-06-19T06:43:26
2018-06-19T06:43:26
137,848,886
12
1
null
null
null
null
UTF-8
Java
false
false
2,640
java
package com.huawei.hms.support.api.push.a.a; import android.content.Context; import android.text.TextUtils; import com.huawei.hms.support.api.push.a.a.a.c; import com.huawei.hms.support.api.push.a.a.b.d; /* compiled from: PushDataEncrypterManager */ public abstract class a { public static String a(Context context, String str, String str2) { String str3 = ""; if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) { return str3; } StringBuilder stringBuilder; try { stringBuilder = new StringBuilder(); stringBuilder.append(str2); stringBuilder.append("_v2"); context = d.b(context, new c(context, str).b(stringBuilder.toString())); } catch (Context context2) { if (com.huawei.hms.support.log.a.d() != null) { stringBuilder = new StringBuilder("getSecureData"); stringBuilder.append(context2.getMessage()); com.huawei.hms.support.log.a.d("PushDataEncrypterManager", stringBuilder.toString()); } context2 = str3; } if (!(TextUtils.isEmpty(context2) == null || com.huawei.hms.support.log.a.a() == null)) { StringBuilder stringBuilder2 = new StringBuilder("not exist for:"); stringBuilder2.append(str2); com.huawei.hms.support.log.a.a("PushDataEncrypterManager", stringBuilder2.toString()); } return context2; } public static void b(Context context, String str, String str2) { if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) { try { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(str2); stringBuilder.append("_v2"); new c(context, str).d(stringBuilder.toString()); } catch (Context context2) { if (com.huawei.hms.support.log.a.d() != null) { str2 = new StringBuilder("removeSecureData"); str2.append(context2.getMessage()); com.huawei.hms.support.log.a.d("PushDataEncrypterManager", str2.toString()); } } } } public static boolean a(Context context, String str, String str2, String str3) { if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) { return false; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(str2); stringBuilder.append("_v2"); return new c(context, str).a(stringBuilder.toString(), d.a(context, str3)); } }
[ "lizhangliao@xiaohongchun.com" ]
lizhangliao@xiaohongchun.com
5324b6767a28a7d58ee6c64479e392f3cc12baf4
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/LeetcodeTemplate/_0735AsteroidCollision.java
5754ca9300359cf65f768259887d96bae00e3cae
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
532
java
package LeetcodeTemplate; import java.util.Arrays; public class _0735AsteroidCollision { public static void main(String[] args) { System.out.println(Arrays.toString(asteroidCollision(new int[] { 5, 10, -5 }))); System.out.println(Arrays.toString(asteroidCollision(new int[] { 10, 2, -5 }))); System.out.println(Arrays.toString(asteroidCollision(new int[] { 8, -8 }))); System.out.println(Arrays.toString(asteroidCollision(new int[] { -2, -1, 1, 2 }))); } public static int[] asteroidCollision(int[] asteroids) { } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
5cfc94082af21017eb0a88477ec2f1fb4a996e9e
a590cf3293c9d5f83a880a706e1686f8aede1377
/Codesignal and Geekforgeeks Combined/ValidateAnIpAddress.java
2ccf819df9a87d482a05230253a0ed94b1c18aab
[]
no_license
pushker-git/LeetCodeTopInterviewQuestions
168b9f8fc1054807eeba9ee444745dd2b1a74a29
43c605e6353575fdef5fcdb20b83c047e284534d
refs/heads/master
2023-06-16T21:26:11.614311
2021-07-10T14:12:34
2021-07-10T14:12:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,533
java
Write a program to Validate an IPv4 Address. According to Wikipedia, IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., 172.16.254.1 . The generalized form of an IPv4 address is (0-255).(0-255).(0-255).(0-255). Here we are considering numbers only from 0 to 255 and any additional leading zeroes will be considered invalid. Your task is to complete the function isValid which returns 1 if the ip address is valid else returns 0. The function takes a string s as its only argument . Example 1: Input: ip = 222.111.111.111 Output: 1 Example 2: Input: ip = 5555..555 Output: 0 Explanation: 5555..555 is not a valid ip address, as the middle two portions are missing. Your Task: Complete the function isValid() which takes the string s as an input parameter and returns 1 if this is a valid ip address otherwise returns 0. Expected Time Complexity: O(N), N = length of string. Expected Auxiliary Space: O(1) Constraints: 1<=length of string <=50 Note:The Input/Ouput format and Example given are used for system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from stdin/console. The task is to complete the function specified, and not to write the full code. class Solution { public boolean isValidIP(String s) { int start=0; int sum=0; int count=0; int zero=0; int dot=0; while(start<s.length()){ if(s.charAt(start)=='.') return false; int k=start; if(s.charAt(start)>='a' && s.charAt(start)<='z') return false; while(start<s.length() && s.charAt(start)!='.'){ sum=sum*10+s.charAt(start)-'0'; if(s.charAt(start)=='0') zero++; start++; count++; } if(zero>1 && sum==0 || s.charAt(k)=='0' && sum!=0) return false; if(start<s.length() && s.charAt(start)=='.') dot++; if(sum>255 || sum<0 || count>3 ) return false; count=0; sum=0; zero=0; start++; } if(dot!=3) return false; return true; } }
[ "rohithv63@gmail.com" ]
rohithv63@gmail.com
58cee5f752db0cce0295d6837cefae6f0a9dbe47
ff24162d05e2605a0a655bb9e3dbb5ab9c72b152
/myddd-extentions/myddd-security/myddd-security-login/src/test/java/org/myddd/security/account/TestApplication.java
857e9d232bfe4b2f8b8157e6a9d765de4c646bba
[ "MIT" ]
permissive
jiajianfa/myddd-java
b1d8eda6ef6ecf8d908557c6335ad2415812a808
42b9a48498e2675b2bf4ab5863307d5b0568d76a
refs/heads/master
2023-04-04T00:36:19.528386
2021-04-07T09:38:56
2021-04-07T09:38:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package org.myddd.security.account; import org.myddd.domain.InstanceFactory; import org.myddd.ioc.spring.SpringInstanceProvider; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = {"org.myddd"}) @EntityScan(basePackages = {"org.myddd"}) public class TestApplication { public static void main(String[] args) { ApplicationContext ctx = SpringApplication.run(TestApplication.class, args); InstanceFactory.setInstanceProvider(SpringInstanceProvider.createInstance(ctx)); } }
[ "lingen.liu@gmail.com" ]
lingen.liu@gmail.com
68d4fcba9efd849f6e7faff0e8cbd7ff7ea1f888
35189f28c6961d55e98576e6b0b9e1cf7d4a15f3
/src/Collection/CollectionAndGenericsDemo.java
8191bbd9f28992b5e3d17e25688eb75f3d0df0e9
[]
no_license
ChristoT98/LearningJava
62a07365eb5d2904522e266a83427a8c20990664
66614148228ffc73c519324e035484be746ab7c6
refs/heads/master
2022-12-13T01:56:55.351612
2020-09-11T11:01:49
2020-09-11T11:01:49
294,671,477
0
0
null
2020-09-11T11:00:05
2020-09-11T11:00:04
null
UTF-8
Java
false
false
2,001
java
package Collection; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class CollectionAndGenericsDemo { public static void main(String[] args) { /* List<Integer> list = new ArrayList<>(); Random random = new Random(); for (int i = 0; i <= 100; i++) { list.add(random.nextInt(1000)); } Collections.sort(list, (i1, i2) -> { return i1 % 10 > i2 % 10 ? 1 : i1 % 10 < i2 % 10 ? -1 : 0; }); for (Integer integer : list) { System.out.println(integer); }*/ List<Student> students = new ArrayList<>(); students.add(new Student(1, 55)); students.add(new Student(2, 75)); students.add(new Student(3, 65)); students.add(new Student(4, 85)); students.add(new Student(5, 95)); /* Step -01 Collections.sort(students, (s1,s2)->{ return s1.marks>s2.marks?-1:s1.marks<s2.marks?1:0; });*/ Collections.sort(students); for (Student student : students) { System.out.println(student); } } } /* Step -01 class Student { int rolNo; int marks; public Student(int rolNo, int marks) { this.rolNo = rolNo; this.marks = marks; } @Override public String toString() { return "Student{" + "rolNo=" + rolNo + ", marks=" + marks + '}'; } }*/ class Student implements Comparable<Student> { private int rolNo; private int marks; Student(int rolNo, int marks) { this.rolNo = rolNo; this.marks = marks; } public int compareTo(Student student) { return this.marks > student.marks ? -1 : this.marks < student.marks ? 1 : 0; } @Override public String toString() { return "Student{" + "rolNo=" + rolNo + ", marks=" + marks + '}'; } }
[ "asakahatapitiya@gmail.com" ]
asakahatapitiya@gmail.com
c08aa2c2399100f562cceccffbea6666ac685e94
5f6edf313639dbe464a1c9cbb62762b427786235
/crm/src/com/naswork/service/ExchangeRateService.java
3aaf1a6d797207d5020874d544fb0d8e05265a57
[]
no_license
magicgis/outfile
e69b785cd14ce7cb08d93d0f83b3f4c0b435b17b
497635e2cd947811bf616304e9563e59f0ab4f56
refs/heads/master
2020-05-07T19:24:08.371572
2019-01-23T04:57:18
2019-01-23T04:57:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
529
java
package com.naswork.service; import com.naswork.model.ExchangeRate; import com.naswork.module.system.controller.exchangerate.ExchangeRateVo; import com.naswork.vo.PageModel; public interface ExchangeRateService { int insertSelective(ExchangeRate record); ExchangeRate selectByPrimaryKey(Integer currencyId); int updateByPrimaryKeySelective(ExchangeRate record); /** * 列表 */ public void listPage(PageModel<ExchangeRateVo> page); public ExchangeRateVo findById(Integer id); }
[ "942364283@qq.com" ]
942364283@qq.com
b79f610d79a3678d586bf5b713b698decc651da3
609f726c4360957d1332b38896cf3fab8c1ba5de
/oxService/src/main/java/org/gluu/model/security/protect/AuthenticationAttempt.java
9746889e3289986dfe4befa11d165b3484f69ff5
[ "MIT" ]
permissive
GluuFederation/oxCore
f2a3749710a61c0471c9347e04d85121deb9537e
918ea9cbf7ad7d4a4a9d88108ef0c2f36cbcf733
refs/heads/master
2023-08-08T00:36:31.395698
2023-07-17T19:58:42
2023-07-17T19:58:42
18,150,075
15
16
MIT
2023-07-18T18:22:14
2014-03-26T19:00:16
Java
UTF-8
Java
false
false
1,081
java
package org.gluu.model.security.protect; import java.io.Serializable; import javax.enterprise.context.RequestScoped; import javax.inject.Named; @RequestScoped public class AuthenticationAttempt implements Serializable { private static final long serialVersionUID = -1841823297081861148L; private long time; private long expiration; private boolean success; public AuthenticationAttempt() { } public AuthenticationAttempt(long time, long expiration, boolean success) { this.time = time; this.expiration = expiration; this.success = success; } public final long getTime() { return time; } public final void setTime(long time) { this.time = time; } public final long getExpiration() { return expiration; } public final void setExpiration(long expiration) { this.expiration = expiration; } public final boolean isSuccess() { return success; } public final void setSuccess(boolean success) { this.success = success; } }
[ "Yuriy.Movchan@gmail.com" ]
Yuriy.Movchan@gmail.com
8919144fc5b8fb7d8650b1a6313b548b26dbc232
c5679ee59de14eedc61c5dcd565eda44a996feb1
/presto-main/src/main/java/io/prestosql/execution/ClusterSizeMonitor.java
b9a35d1d47554a1d572affaf9990bce0db84daa0
[ "Apache-2.0" ]
permissive
chengpeng2015/hetu-core
58e02e087e82ed008de011f9e4e5ff96c396d180
5ddf288154909ddb505ca4a4ce5ba19d64fd94d3
refs/heads/master
2023-01-28T14:56:45.973460
2020-12-05T07:01:20
2020-12-05T07:01:20
319,274,123
1
0
Apache-2.0
2020-12-07T09:52:21
2020-12-07T09:52:21
null
UTF-8
Java
false
false
6,250
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 io.prestosql.execution; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import io.airlift.units.Duration; import io.prestosql.execution.scheduler.DynamicSplitPlacementPolicy; import io.prestosql.execution.scheduler.NodeSchedulerConfig; import io.prestosql.metadata.AllNodes; import io.prestosql.metadata.InternalNodeManager; import io.prestosql.spi.PrestoException; import io.prestosql.spi.service.PropertyService; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.concurrent.GuardedBy; import javax.inject.Inject; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.function.Consumer; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.util.concurrent.Futures.immediateFuture; import static io.airlift.concurrent.Threads.threadsNamed; import static io.prestosql.spi.StandardErrorCode.GENERIC_INSUFFICIENT_RESOURCES; import static java.lang.String.format; import static java.util.Objects.requireNonNull; import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class ClusterSizeMonitor { private final InternalNodeManager nodeManager; private final boolean includeCoordinator; private final int executionMinCount; private final Duration executionMaxWait; private final ScheduledExecutorService executor; private final Consumer<AllNodes> listener = this::updateAllNodes; @GuardedBy("this") private int currentCount; @GuardedBy("this") private final List<SettableFuture<?>> futures = new ArrayList<>(); @Inject public ClusterSizeMonitor(InternalNodeManager nodeManager, NodeSchedulerConfig nodeSchedulerConfig, QueryManagerConfig queryManagerConfig) { this( nodeManager, requireNonNull(nodeSchedulerConfig, "nodeSchedulerConfig is null").isIncludeCoordinator(), requireNonNull(queryManagerConfig, "queryManagerConfig is null").getRequiredWorkers(), queryManagerConfig.getRequiredWorkersMaxWait()); } //TODO remove queryRetryWait after Discovery Service AA is implemented public ClusterSizeMonitor( InternalNodeManager nodeManager, boolean includeCoordinator, int executionMinCount, Duration executionMaxWait) { this.nodeManager = requireNonNull(nodeManager, "nodeManager is null"); this.includeCoordinator = includeCoordinator; checkArgument(executionMinCount >= 0, "executionMinCount is negative"); this.executionMinCount = executionMinCount; this.executionMaxWait = requireNonNull(executionMaxWait, "executionMaxWait is null"); this.executor = newSingleThreadScheduledExecutor(threadsNamed("node-monitor-%s")); //TODO remove following after Discovery Service AA mode Implemented PropertyService.setProperty(DynamicSplitPlacementPolicy.QUERY_MANAGER_REQUIRED_WORKERS_MAX_WAIT, executionMaxWait); } @PostConstruct public void start() { nodeManager.addNodeChangeListener(listener); updateAllNodes(nodeManager.getAllNodes()); } @PreDestroy public void stop() { nodeManager.removeNodeChangeListener(listener); } /** * Returns a listener that completes when the minimum number of workers for the cluster has been met. * Note: caller should not add a listener using the direct executor, as this can delay the * notifications for other listeners. */ public synchronized ListenableFuture<?> waitForMinimumWorkers() { if (currentCount >= executionMinCount) { return immediateFuture(null); } SettableFuture<?> future = SettableFuture.create(); futures.add(future); // if future does not finish in wait period, complete with an exception ScheduledFuture<?> timeoutTask = executor.schedule( () -> { synchronized (this) { future.setException(new PrestoException( GENERIC_INSUFFICIENT_RESOURCES, format("Insufficient active worker nodes. Waited %s for at least %s workers, but only %s workers are active", executionMaxWait, executionMinCount, currentCount))); } }, executionMaxWait.toMillis(), MILLISECONDS); // remove future if finished (e.g., canceled, timed out) future.addListener(() -> { timeoutTask.cancel(true); removeFuture(future); }, executor); return future; } private synchronized void removeFuture(SettableFuture<?> future) { futures.remove(future); } private synchronized void updateAllNodes(AllNodes allNodes) { if (includeCoordinator) { currentCount = allNodes.getActiveNodes().size(); } else { currentCount = Sets.difference(allNodes.getActiveNodes(), allNodes.getActiveCoordinators()).size(); } if (currentCount >= executionMinCount) { ImmutableList<SettableFuture<?>> listeners = ImmutableList.copyOf(futures); futures.clear(); executor.submit(() -> listeners.forEach(listener -> listener.set(null))); } } }
[ "7676181+fbird2020@user.noreply.gitee.com" ]
7676181+fbird2020@user.noreply.gitee.com
f25f727fc1877d65fb30d70ac4fb34b05aae1a03
f766baf255197dd4c1561ae6858a67ad23dcda68
/app/src/main/java/com/tencent/mm/protocal/c/ci.java
502e5b620559495bff97a573121befe57eff1555
[]
no_license
jianghan200/wxsrc6.6.7
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
eb6c56587cfca596f8c7095b0854cbbc78254178
refs/heads/master
2020-03-19T23:40:49.532494
2018-06-12T06:00:50
2018-06-12T06:00:50
137,015,278
4
2
null
null
null
null
UTF-8
Java
false
false
2,748
java
package com.tencent.mm.protocal.c; import java.util.LinkedList; public final class ci extends com.tencent.mm.bk.a { public String rcJ; public LinkedList<brc> rcK = new LinkedList(); public String title; protected final int a(int paramInt, Object... paramVarArgs) { if (paramInt == 0) { paramVarArgs = (f.a.a.c.a)paramVarArgs[0]; if (this.rcJ != null) { paramVarArgs.g(1, this.rcJ); } paramVarArgs.d(2, 8, this.rcK); if (this.title != null) { paramVarArgs.g(3, this.title); } return 0; } if (paramInt == 1) { if (this.rcJ == null) { break label367; } } label367: for (paramInt = f.a.a.b.b.a.h(1, this.rcJ) + 0;; paramInt = 0) { int i = paramInt + f.a.a.a.c(2, 8, this.rcK); paramInt = i; if (this.title != null) { paramInt = i + f.a.a.b.b.a.h(3, this.title); } return paramInt; if (paramInt == 2) { paramVarArgs = (byte[])paramVarArgs[0]; this.rcK.clear(); paramVarArgs = new f.a.a.a.a(paramVarArgs, unknownTagHandler); for (paramInt = com.tencent.mm.bk.a.a(paramVarArgs); paramInt > 0; paramInt = com.tencent.mm.bk.a.a(paramVarArgs)) { if (!super.a(paramVarArgs, this, paramInt)) { paramVarArgs.cJS(); } } break; } if (paramInt == 3) { Object localObject1 = (f.a.a.a.a)paramVarArgs[0]; ci localci = (ci)paramVarArgs[1]; paramInt = ((Integer)paramVarArgs[2]).intValue(); switch (paramInt) { default: return -1; case 1: localci.rcJ = ((f.a.a.a.a)localObject1).vHC.readString(); return 0; case 2: paramVarArgs = ((f.a.a.a.a)localObject1).IC(paramInt); i = paramVarArgs.size(); paramInt = 0; while (paramInt < i) { Object localObject2 = (byte[])paramVarArgs.get(paramInt); localObject1 = new brc(); localObject2 = new f.a.a.a.a((byte[])localObject2, unknownTagHandler); for (boolean bool = true; bool; bool = ((brc)localObject1).a((f.a.a.a.a)localObject2, (com.tencent.mm.bk.a)localObject1, com.tencent.mm.bk.a.a((f.a.a.a.a)localObject2))) {} localci.rcK.add(localObject1); paramInt += 1; } } localci.title = ((f.a.a.a.a)localObject1).vHC.readString(); return 0; } return -1; } } } /* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes2-dex2jar.jar!/com/tencent/mm/protocal/c/ci.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "526687570@qq.com" ]
526687570@qq.com
7e3e473d43c7079a53991657efd03680a29e1dc1
d59b6f34d2188f4dcb2c0218fd94ee7ad3ffd9dc
/cocoatouch/src/main/java/com/bugvm/bindings/AVFoundation/AVAssetResourceLoadingRequestOptions.java
68edfffd087ff5cc82ed9d4eb5a3fd64e810591f
[ "Apache-2.0" ]
permissive
anidotnet/bugvm
0e9b6d5ab6837e5357b1e83f0069554175b3bd30
77350f8462f2467d8445827fd5f6515472f56ba1
refs/heads/master
2020-05-25T15:41:07.994236
2016-09-29T11:16:54
2016-09-29T11:16:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,367
java
/* * Copyright (C) 2013-2015 RoboVM AB * * 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.bugvm.bindings.AVFoundation; /*<imports>*/ import java.io.*; import java.nio.*; import java.util.*; import com.bugvm.objc.*; import com.bugvm.objc.annotation.*; import com.bugvm.objc.block.*; import com.bugvm.rt.*; import com.bugvm.rt.annotation.*; import com.bugvm.rt.bro.*; import com.bugvm.rt.bro.annotation.*; import com.bugvm.rt.bro.ptr.*; import com.bugvm.apple.foundation.*; import com.bugvm.apple.corefoundation.*; import com.bugvm.apple.dispatch.*; import com.bugvm.apple.coreanimation.*; import com.bugvm.apple.coreimage.*; import com.bugvm.apple.coregraphics.*; import com.bugvm.apple.coreaudio.*; import com.bugvm.apple.coremedia.*; import com.bugvm.apple.corevideo.*; import com.bugvm.apple.mediatoolbox.*; import com.bugvm.apple.audiotoolbox.*; import com.bugvm.apple.audiounit.*; /*</imports>*/ /*<javadoc>*/ /*</javadoc>*/ /*<annotations>*/@Library("AVFoundation")/*</annotations>*/ @Marshaler(/*<name>*/AVAssetResourceLoadingRequestOptions/*</name>*/.Marshaler.class) /*<visibility>*/public/*</visibility>*/ class /*<name>*/AVAssetResourceLoadingRequestOptions/*</name>*/ extends /*<extends>*/NSDictionaryWrapper/*</extends>*/ /*<implements>*//*</implements>*/ { /*<marshalers>*/ public static class Marshaler { @MarshalsPointer public static AVAssetResourceLoadingRequestOptions toObject(Class<AVAssetResourceLoadingRequestOptions> cls, long handle, long flags) { NSDictionary o = (NSDictionary) NSObject.Marshaler.toObject(NSDictionary.class, handle, flags); if (o == null) { return null; } return new AVAssetResourceLoadingRequestOptions(o); } @MarshalsPointer public static long toNative(AVAssetResourceLoadingRequestOptions o, long flags) { if (o == null) { return 0L; } return NSObject.Marshaler.toNative(o.data, flags); } } public static class AsListMarshaler { @MarshalsPointer public static List<AVAssetResourceLoadingRequestOptions> toObject(Class<? extends NSObject> cls, long handle, long flags) { NSArray<NSDictionary> o = (NSArray<NSDictionary>) NSObject.Marshaler.toObject(NSArray.class, handle, flags); if (o == null) { return null; } List<AVAssetResourceLoadingRequestOptions> list = new ArrayList<>(); for (int i = 0; i < o.size(); i++) { list.add(new AVAssetResourceLoadingRequestOptions(o.get(i))); } return list; } @MarshalsPointer public static long toNative(List<AVAssetResourceLoadingRequestOptions> l, long flags) { if (l == null) { return 0L; } NSArray<NSDictionary> array = new NSMutableArray<>(); for (AVAssetResourceLoadingRequestOptions i : l) { array.add(i.getDictionary()); } return NSObject.Marshaler.toNative(array, flags); } } /*</marshalers>*/ /*<constructors>*/ AVAssetResourceLoadingRequestOptions(NSDictionary data) { super(data); } public AVAssetResourceLoadingRequestOptions() {} /*</constructors>*/ /*<methods>*/ public boolean has(NSString key) { return data.containsKey(key); } public NSObject get(NSString key) { if (has(key)) { return data.get(key); } return null; } public AVAssetResourceLoadingRequestOptions set(NSString key, NSObject value) { data.put(key, value); return this; } /** * @since Available in iOS 9.0 and later. */ public boolean requiresPersistentKey() { if (has(Keys.StreamingContentKeyRequestRequiresPersistentKey())) { NSNumber val = (NSNumber) get(Keys.StreamingContentKeyRequestRequiresPersistentKey()); return val.booleanValue(); } return false; } /** * @since Available in iOS 9.0 and later. */ public AVAssetResourceLoadingRequestOptions setRequiresPersistentKey(boolean requiresPersistentKey) { set(Keys.StreamingContentKeyRequestRequiresPersistentKey(), NSNumber.valueOf(requiresPersistentKey)); return this; } /*</methods>*/ /*<keys>*/ @Library("AVFoundation") public static class Keys { static { Bro.bind(Keys.class); } /** * @since Available in iOS 9.0 and later. */ @GlobalValue(symbol="AVAssetResourceLoadingRequestStreamingContentKeyRequestRequiresPersistentKey", optional=true) public static native NSString StreamingContentKeyRequestRequiresPersistentKey(); } /*</keys>*/ }
[ "github@ibinti.com" ]
github@ibinti.com
e7036e349f3c0d59e344374cefa27d66f4d0690a
3c10b507e6a3e17cbf9b17a9f102ea3038b46e1c
/src/org/jitsi/util/InstanceLogger.java
d2a32797c2c5a2f36e4ec46172d5324cbe4af01f
[ "Apache-2.0" ]
permissive
pstros/libjitsi
a1150f0e9aaba8ccaa911161de178e13d0d316ef
9935aeb7096511cd7a94f972ef25f29a1de821af
refs/heads/master
2020-12-25T17:46:08.191194
2019-02-07T10:50:17
2019-02-07T12:31:51
48,122,100
0
1
Apache-2.0
2019-04-17T18:45:26
2015-12-16T16:31:51
Java
UTF-8
Java
false
false
3,322
java
/* * Copyright @ 2015 Atlassian 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.jitsi.util; import java.util.logging.*; /** * Implements a {@link Logger}, which delegates logging to another * {@link Logger}, and allows it's level to be lowered independent of the * delegate (by another {@link Logger} instance or by a level configuration). * * @author Boris Grozev */ public class InstanceLogger extends Logger { /** * The {@link Logger} used for logging. */ private Logger loggingDelegate; /** * The {@link Logger} used for configuring the level. Messages are logged * iff: * 1. {@link #levelDelegate} is not set or allows it. * 2. {@link #loggingDelegate} allows it. * 3. {@link #level}, is not set or allows it. */ private Logger levelDelegate; /** * The level configured for this instance. */ private Level level = null; /** * Initializes an {@link InstanceLogger} instance with the given delegate * for logging and for getting the level. */ protected InstanceLogger(Logger loggingDelegate, Logger levelDelegate) { this.loggingDelegate = loggingDelegate; this.levelDelegate = levelDelegate; } /** * {@inheritDoc} */ @Override public void setLevel(Level level) { this.level = level; } /** * {@inheritDoc} */ @Override public Level getLevel() { return higher( higher(level != null ? level : Level.ALL, loggingDelegate.getLevel()), levelDelegate != null ? levelDelegate.getLevel() : Level.ALL); } /** * {@inheritDoc} */ @Override boolean isLoggable(Level level) { Level loggerLevel = getLevel(); if (level == null || loggerLevel == Level.OFF) { return false; } return level.intValue() >= loggerLevel.intValue(); } /** * {@inheritDoc} */ @Override public void log(Level level, Object msg) { if (isLoggable(level)) { loggingDelegate.log(level, msg != null ? msg.toString() : "null"); } } /** * {@inheritDoc} */ @Override public void log(Level level, Object msg, Throwable thrown) { if (isLoggable(level)) { loggingDelegate .log(level, msg != null ? msg.toString() : "null", thrown); } } /** * @return the higher of two logging levels. * e.g.: higher(Level.FINE, Level.WARNING) -> Level.WARNING */ private Level higher(Level a, Level b) { if (a.intValue() >= b.intValue()) return a; return b; } }
[ "boris@jitsi.org" ]
boris@jitsi.org
bd55099cfc61a2a2c0519ca1a4ea3f1a839eb023
4317e72e0ec1f80fd4063ccd60af9b754f088a42
/ph-commons/src/main/java/com/helger/commons/collection/attr/AttributeContainerConcurrent.java
a84b48917662d75260dc79618dd281e9c3ae4435
[ "Apache-2.0" ]
permissive
AJcodes42/ph-commons
fabe49f68b900b74984a3f85ecd408005af5654c
6fb35fb3937c155a38c3856196248c0546134c87
refs/heads/master
2021-01-15T14:49:56.555882
2017-08-08T12:18:09
2017-08-08T12:18:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,042
java
/** * Copyright (C) 2014-2017 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.helger.commons.collection.attr; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.annotation.concurrent.ThreadSafe; import com.helger.commons.callback.CallbackList; import com.helger.commons.collection.impl.CommonsConcurrentHashMap; import com.helger.commons.hashcode.HashCodeGenerator; /** * Base class for all kind of any-any mapping container. This implementation is * thread-safe! * * @author Philip Helger * @param <KEYTYPE> * Key type * @param <VALUETYPE> * Value type */ @ThreadSafe public class AttributeContainerConcurrent <KEYTYPE, VALUETYPE> extends CommonsConcurrentHashMap <KEYTYPE, VALUETYPE> implements IMutableAttributeContainer <KEYTYPE, VALUETYPE> { private final CallbackList <IBeforeSetValueCallback <KEYTYPE, VALUETYPE>> m_aBeforeCallbacks = new CallbackList <> (); private final CallbackList <IAfterSetValueCallback <KEYTYPE, VALUETYPE>> m_aAfterCallbacks = new CallbackList <> (); public AttributeContainerConcurrent () {} public AttributeContainerConcurrent (@Nullable final Map <? extends KEYTYPE, ? extends VALUETYPE> aMap) { super (aMap); } @Nonnull public final CallbackList <IBeforeSetValueCallback <KEYTYPE, VALUETYPE>> beforeSetValueCallbacks () { return m_aBeforeCallbacks; } @Nonnull public final CallbackList <IAfterSetValueCallback <KEYTYPE, VALUETYPE>> afterSetValueCallbacks () { return m_aAfterCallbacks; } @Override public boolean containsKey (@Nullable final Object aKey) { // Cannot handle null keys! return aKey != null && super.containsKey (aKey); } @Override @Nullable public VALUETYPE get (@Nullable final Object aKey) { // Cannot handle null keys! return aKey != null ? super.get (aKey) : null; } @Override public boolean equals (final Object o) { if (o == this) return true; if (o == null || !getClass ().equals (o.getClass ())) return false; return super.equals (o); } @Override public int hashCode () { final HashCodeGenerator aGen = new HashCodeGenerator (this); for (final Map.Entry <KEYTYPE, VALUETYPE> aEntry : entrySet ()) aGen.append (aEntry.getKey ()).append (aEntry.getValue ()); return aGen.getHashCode (); } }
[ "philip@helger.com" ]
philip@helger.com
45f1f684a41116aeab9f9c5ee663fd84bb1c47b6
7c24b96d91255f94f79bc6f6d51fd301e1f23a71
/AndBaseDemo/src/com/andbase/demo/activity/SlidingMenuZoomActivity.java
4b99865e73fbce63c0e939979120c21c591d44c2
[]
no_license
GGOOKK/andbase
88ac72278844aadfb6409f8e79ec156b3391da7c
4a82a52d3c33c7ceaa93c4aad155f6c476e6b108
refs/heads/master
2020-12-28T23:45:29.424975
2013-11-12T06:37:05
2013-11-12T06:37:05
null
0
0
null
null
null
null
GB18030
Java
false
false
2,595
java
package com.andbase.demo.activity; import android.graphics.Canvas; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import com.ab.activity.AbActivity; import com.ab.view.slidingmenu.SlidingMenu; import com.ab.view.slidingmenu.SlidingMenu.CanvasTransformer; import com.ab.view.titlebar.AbTitleBar; import com.andbase.R; public class SlidingMenuZoomActivity extends AbActivity { private SlidingMenu menu; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setAbContentView(R.layout.sliding_menu_content); AbTitleBar mAbTitleBar = this.getTitleBar(); mAbTitleBar.setTitleText(R.string.sliding_menu_name); mAbTitleBar.setLogo(R.drawable.button_selector_back); mAbTitleBar.setTitleLayoutBackground(R.drawable.top_bg); mAbTitleBar.setTitleTextMargin(10, 0, 0, 0); mAbTitleBar.setLogoLine(R.drawable.line); mAbTitleBar.getLogoView().setBackgroundResource(R.drawable.button_selector_menu); //主视图的Fragment添加 getSupportFragmentManager() .beginTransaction() .replace(R.id.content_frame, new Fragment1()) .commit(); //SlidingMenu的配置 menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowWidthRes(R.dimen.shadow_width); menu.setShadowDrawable(R.drawable.shadow); menu.setBehindOffsetRes(R.dimen.slidingmenu_offset); menu.setFadeDegree(0.35f); menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT); //menu视图的Fragment添加 menu.setMenu(R.layout.sliding_menu_menu); getSupportFragmentManager() .beginTransaction() .replace(R.id.menu_frame, new SampleListFragment()) .commit(); //动画配置 menu.setBehindCanvasTransformer(new CanvasTransformer() { @Override public void transformCanvas(Canvas canvas, float percentOpen) { //将画布默认的黑背景替换掉 canvas.drawColor(SlidingMenuZoomActivity.this.getResources().getColor(R.color.gray_white)); float scale = (float) (percentOpen*0.25 + 0.75); canvas.scale(scale, scale, canvas.getWidth()/2, canvas.getHeight()/2); } }); mAbTitleBar.getLogoView().setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (menu.isMenuShowing()) { menu.showContent(); } else { menu.showMenu(); } } }); } @Override public void onBackPressed() { if (menu.isMenuShowing()) { menu.showContent(); } else { super.onBackPressed(); } } }
[ "zhaoqp2010@163.com" ]
zhaoqp2010@163.com
79bb187e4979cd8e4e052a43b55abbfa3074c43d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_2b74befcd7384a149471589aa6110c58aa3209e3/MonthView/2_2b74befcd7384a149471589aa6110c58aa3209e3_MonthView_t.java
bbb6383f1013547998a78e1e6eaef41ed2b9b087
[]
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,463
java
import javax.swing.*; import java.awt.*; import java.awt.event.*; /** * Month view for the calendar * * @author gordon * */ public class MonthView extends BaseView { private static final long serialVersionUID = 1L; private JTable month; private MonthDataModel monthView; private GridBagConstraints gbc; Integer[] days = Date.getDaysInMonth(currentDate.getYear()); public MonthView(CalendarModel model, JLabel viewLabel) { super(model, viewLabel); } protected void setupCalendar() { setUpGBC(); addPreviousButton(); addTable(); addNextButton(); this.add(panel, BorderLayout.CENTER); } private void addTable() { int offset = 5; // 1st of January 2011 was a Saturday monthView = new MonthDataModel(offset, days[currentDate.getMonth() - 1]); month = new JTable(monthView); month.getTableHeader().setReorderingAllowed(false); month.setRowHeight(100); month.setRowSelectionAllowed(false); JScrollPane scrollPane = new JScrollPane(month); this.add(scrollPane, BorderLayout.CENTER); panel.add(scrollPane, gbc); } private void setUpGBC() { gbc = new GridBagConstraints(); gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.BOTH; } private void addPreviousButton() { previousB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int month = currentDate.getMonth(); currentDate.decrement(); while (month == currentDate.getMonth()) { currentDate.decrement(); } int offset = monthView.getOffset(); int numDays = days[currentDate.getMonth() - 1]; offset = (offset - numDays) % 7; if (offset < 0) offset += 7; numDays = days[currentDate.getMonth() - 1]; monthView.setOffset(offset); monthView.setDays(numDays); monthView.fireTableDataChanged(); viewLabel.setText(MonthView.this.toString()); } }); panel.add(previousB); } private void addNextButton() { nextB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { currentDate.increment(); while (currentDate.getDay() != 1) { currentDate.increment(); } int offset = monthView.getOffset(); int numDays = monthView.getDays(); offset = (offset + numDays) % 7; numDays = days[currentDate.getMonth() - 1]; monthView.setOffset(offset); monthView.setDays(numDays); monthView.fireTableDataChanged(); viewLabel.setText(MonthView.this.toString()); } }); panel.add(nextB); } public String toString() { return monthName(currentDate.getMonth()) + " " + currentDate.getYear(); } private String monthName(int i) { return Date.monthNames[i-1]; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1187e83e3f48bda3f346cf0f361394ee92637ffe
0e06e096a9f95ab094b8078ea2cd310759af008b
/classes77-dex2jar/com/google/android/gms/ads/internal/overlay/zzx.java
e4da4ae974402d8319c5893fbf08b562f4653dd7
[]
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
295
java
// // Decompiled by Procyon v0.5.34 // package com.google.android.gms.ads.internal.overlay; import android.app.Activity; import com.google.android.gms.internal.ads.zzadh; @zzadh public final class zzx extends zzd { public zzx(final Activity activity) { super(activity); } }
[ "querky1231@gmail.com" ]
querky1231@gmail.com
95b5defb38229ba22e0f310444e2f5ce41dc355a
5741045375dcbbafcf7288d65a11c44de2e56484
/reddit-decompilada/com/reddit/frontpage/GoogleSignInActivity$$Lambda$0.java
0d6d0725103006a9579d72cf91fac127f5a0b5e3
[]
no_license
miarevalo10/ReporteReddit
18dd19bcec46c42ff933bb330ba65280615c281c
a0db5538e85e9a081bf268cb1590f0eeb113ed77
refs/heads/master
2020-03-16T17:42:34.840154
2018-05-11T10:16:04
2018-05-11T10:16:04
132,843,706
0
0
null
null
null
null
UTF-8
Java
false
false
697
java
package com.reddit.frontpage; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.net.Uri; final /* synthetic */ class GoogleSignInActivity$$Lambda$0 implements OnClickListener { private final GoogleSignInActivity f19871a; GoogleSignInActivity$$Lambda$0(GoogleSignInActivity googleSignInActivity) { this.f19871a = googleSignInActivity; } public final void onClick(DialogInterface dialogInterface, int i) { this.f19871a.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.reddit.frontpage&hl=en"))); } }
[ "mi.arevalo10@uniandes.edu.co" ]
mi.arevalo10@uniandes.edu.co
ed24176ab129a4cd48dbb03c276f53e4e4ce8eff
82bfbbf0da07fdd35a7cf5ba78a560cbf9fba591
/WebApplication2/src/java/Controller/LoginController.java
d6ca600d06663464dd986dd1bece240288db1dd6
[]
no_license
kunzz009/demoWeb
1e14733741339eb5198e3966dc2f8533f11b0629
77fd1133f3b83c3176e42a00528db2b58c6b1b04
refs/heads/master
2023-03-22T18:43:50.801863
2021-03-10T10:26:14
2021-03-10T10:26:14
346,315,253
0
0
null
null
null
null
UTF-8
Java
false
false
3,376
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Controller; import Model.Account; import Model.AccountDAO; import java.io.IOException; import java.io.PrintWriter; import static java.lang.System.out; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; /** * * @author DELL */ public class LoginController extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); if (session.getAttribute("Username") != null) { response.sendRedirect("trangchu"); } String err = request.getParameter("err"); RequestDispatcher dispatcher = request.getRequestDispatcher("dangnhap"); request.setAttribute("err", err); dispatcher.include(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String user = request.getParameter("user"); String pass = request.getParameter("pass"); if (user.equals("") || pass.equals("")) { response.sendRedirect("LoginController"); } Account ac = new Account(user, pass); boolean checkLogin = AccountDAO.login(ac); if (checkLogin) { HttpSession session = request.getSession(); session.setAttribute("username", user); response.sendRedirect("trangchu"); } else { response.sendRedirect("login?err=1"); } } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "you@example.com" ]
you@example.com
251cae70b2de9fd6b8e1e2b2043472120d58a6de
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE190_Integer_Overflow/s07/CWE190_Integer_Overflow__int_getParameter_Servlet_preinc_73b.java
70aedc7cf8646d94f85c4d2c5fe168bca534111d
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
2,256
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int_getParameter_Servlet_preinc_73b.java Label Definition File: CWE190_Integer_Overflow__int.label.xml Template File: sources-sinks-73b.tmpl.java */ /* * @description * CWE: 190 Integer Overflow * BadSource: getParameter_Servlet Read data from a querystring using getParameter() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: increment * GoodSink: Ensure there will not be an overflow before incrementing data * BadSink : Increment data, which can cause an overflow * Flow Variant: 73 Data flow: data passed in a LinkedList from one method to another in different source files in the same package * * */ package testcases.CWE190_Integer_Overflow.s07; import testcasesupport.*; import java.util.LinkedList; import javax.servlet.http.*; public class CWE190_Integer_Overflow__int_getParameter_Servlet_preinc_73b { public void badSink(LinkedList<Integer> dataLinkedList , HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataLinkedList.remove(2); /* POTENTIAL FLAW: if data == Integer.MAX_VALUE, this will overflow */ int result = (int)(++data); IO.writeLine("result: " + result); } /* goodG2B() - use GoodSource and BadSink */ public void goodG2BSink(LinkedList<Integer> dataLinkedList , HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataLinkedList.remove(2); /* POTENTIAL FLAW: if data == Integer.MAX_VALUE, this will overflow */ int result = (int)(++data); IO.writeLine("result: " + result); } /* goodB2G() - use BadSource and GoodSink */ public void goodB2GSink(LinkedList<Integer> dataLinkedList , HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataLinkedList.remove(2); /* FIX: Add a check to prevent an overflow from occurring */ if (data < Integer.MAX_VALUE) { int result = (int)(++data); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too large to increment."); } } }
[ "you@example.com" ]
you@example.com
aa02fdc7bab6d4552d85a095eea66e6aa7c07c25
47db875a6bcc0a5c231abd682c3e218d64949a26
/gmall-passport-web/src/main/java/com/danbro/gmall/passport/web/thirdSocialAccountLogin/userProvider/WeiboUserProvider.java
4c666bf1226293eeefc8554bd7174933d7efe2d4
[]
no_license
Danbro007/gmall
245532f02f131c0893e9ad49d75559e7e802a20e
dcf9c1ef39ca25de52377985705ecb158509f93e
refs/heads/master
2022-09-23T04:31:22.372874
2019-12-24T03:10:38
2019-12-24T03:10:38
206,494,975
0
0
null
2022-09-01T23:12:41
2019-09-05T06:50:49
CSS
UTF-8
Java
false
false
2,350
java
package com.danbro.gmall.passport.web.thirdSocialAccountLogin.userProvider; import com.alibaba.fastjson.JSON; import com.danbro.gmall.api.po.MemberPo; import com.danbro.gmall.common.utils.util.HttpClientUtil; import com.danbro.gmall.common.utils.util.ObjectUtil; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.LoginInterface; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.OauthUser; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.accessToken.AccessToken; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.accessToken.WeiboAccessToken; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.postParam.PostParam; import com.danbro.gmall.passport.web.thirdSocialAccountLogin.postParam.WeiboPostParam; import java.util.Map; /** * @author Danrbo * @date 2019/11/12 21:06 * description 新浪微博账户登录 **/ public class WeiboUserProvider implements LoginInterface { @Override public WeiboAccessToken getAccessToken(PostParam postParam) { WeiboPostParam weiboPostParam = (WeiboPostParam) postParam; String token = HttpClientUtil.doPost("https://api.weibo.com/oauth2/access_token", ObjectUtil.objectToMap(weiboPostParam)); return JSON.parseObject(token, WeiboAccessToken.class); } @Override public MemberPo getUserInfo(AccessToken accessToken) { WeiboAccessToken weiboAccessToken = (WeiboAccessToken) accessToken; String weiboUserInfo = HttpClientUtil.doGet("https://api.weibo.com/2/users/show.json?access_token=" + weiboAccessToken.getAccessToken() + "&" + "uid=" + weiboAccessToken.getUid()); Map userInfoMap = JSON.parseObject(weiboUserInfo, Map.class); MemberPo memberPo = new MemberPo(); memberPo.setCity((String) userInfoMap.get("location")); memberPo.setAccessToken(weiboAccessToken.getAccessToken()); memberPo.setAccessCode(weiboAccessToken.getCode()); Integer gender = userInfoMap.get("gender").equals("m") ? 1 : 2; memberPo.setGender(gender); memberPo.setSourceUid((String) userInfoMap.get("idstr")); memberPo.setNickname((String) userInfoMap.get("screen_name")); memberPo.setIcon((String) userInfoMap.get("profile_image_url")); memberPo.setSourceType(OauthUser.WEIBO_USER.getType()); return memberPo; } }
[ "710170342@qq.com" ]
710170342@qq.com
525df4f2afcc4fda4964e157b9ed7e05603b4625
124df74bce796598d224c4380c60c8e95756f761
/com.raytheon.uf.edex.datadelivery.harvester/src/com/raytheon/uf/edex/datadelivery/harvester/crawler/MainSequenceCrawlLauncher.java
7ab85f2738ad4649af920893f5812960c97b9a26
[]
no_license
Mapoet/AWIPS-Test
19059bbd401573950995c8cc442ddd45588e6c9f
43c5a7cc360b3cbec2ae94cb58594fe247253621
refs/heads/master
2020-04-17T03:35:57.762513
2017-02-06T17:17:58
2017-02-06T17:17:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,324
java
package com.raytheon.uf.edex.datadelivery.harvester.crawler; import java.util.ArrayList; import java.util.List; import com.raytheon.uf.common.datadelivery.harvester.Agent; import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent; import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig; import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfigurationManager; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.edex.datadelivery.harvester.cron.HarvesterJobController; /** * Launch crawler in the same JVM. * * <pre> * * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 14, 2012 00357 dhladky Initial creation * Jun 12, 2012 00609 djohnson Update path to crawl script. * Aug 06, 2012 01022 djohnson Launch the crawler in the same JVM. * Oct 28, 2013 2361 dhladky Fixed up JAXBManager. * * </pre> * * @author dhladky * @version 1.0 */ public class MainSequenceCrawlLauncher extends CrawlLauncher { private static final IUFStatusHandler statusHandler = UFStatus .getHandler(MainSequenceCrawlLauncher.class); private final List<HarvesterJobController<MainSequenceCrawlLauncher>> harvesterJobs = new ArrayList<HarvesterJobController<MainSequenceCrawlLauncher>>(); public MainSequenceCrawlLauncher() { harvesterJobs.clear(); init(); } @Override public void addHarvesterJobs(String providerName, CrawlAgent agent) { getHarvesterJobs().add( new HarvesterJobController<MainSequenceCrawlLauncher>( providerName + "-" + getType(), agent.getMainScan(), MainSequenceCrawlLauncher.class)); statusHandler.handle(Priority.DEBUG, "Added " + providerName + " Main Scan entry."); } /** * launches the crawl */ @Override public void crawl(String providerName) { try { // first get the Localization directory and find all harvester // configs IPathManager pm = PathManagerFactory.getPathManager(); LocalizationContext lc = pm.getContext( LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); LocalizationFile lfds = pm.getLocalizationFile(lc, "datadelivery/harvester"); final String siteConfig = lfds.getFile().getAbsolutePath(); // if many, start many for (LocalizationFile lf : getLocalizedFiles()) { HarvesterConfig hc = HarvesterConfigurationManager .getHarvesterFile(lf.getFile()); if (hc.getProvider().getName().equals(providerName)) { if (hc.getAgent() != null) { // we only want crawler types for CrawlerMetadata Agent agent = hc.getAgent(); if (agent instanceof CrawlAgent) { // Send the actual file with the paths for context final String[] args = new String[] { siteConfig, lf.getFile().getAbsolutePath() }; // start it MainSequenceCrawler.main(args); } } } } } catch (Exception e) { statusHandler.handle(Priority.ERROR, "Crawler failed to initialize!", e); } } public List<HarvesterJobController<MainSequenceCrawlLauncher>> getHarvesterJobs() { return harvesterJobs; } @Override public String getType() { return "main"; } }
[ "joshua.t.love@saic.com" ]
joshua.t.love@saic.com
ad6b9dfc9a52be7e32c5adb4b5c71ab5d6edd4eb
f8abb6d2242b4c234495e1c8c71d29ac92d00ef9
/android/diva-solve/diva-beta_de/src/android/support/v7/internal/view/menu/SubMenuBuilder.java
08929085317c097aabee59fd26880dd1f256c191
[]
no_license
H4oK3/Arsenal
9b51111c9054d13667625e8426a2d4a994b22dec
463773e61520151b63d4b20c79ce8ea59fdcea43
refs/heads/master
2021-01-22T05:01:12.301386
2019-09-24T03:22:36
2019-09-24T03:22:36
102,276,557
9
3
null
null
null
null
UTF-8
Java
false
false
3,560
java
// // Decompiled by Procyon v0.5.30 // package android.support.v7.internal.view.menu; import android.view.View; import android.graphics.drawable.Drawable; import android.support.v4.content.ContextCompat; import android.view.Menu; import android.view.MenuItem; import android.content.Context; import android.view.SubMenu; public class SubMenuBuilder extends MenuBuilder implements SubMenu { private MenuItemImpl mItem; private MenuBuilder mParentMenu; public SubMenuBuilder(final Context context, final MenuBuilder mParentMenu, final MenuItemImpl mItem) { super(context); this.mParentMenu = mParentMenu; this.mItem = mItem; } @Override public boolean collapseItemActionView(final MenuItemImpl menuItemImpl) { return this.mParentMenu.collapseItemActionView(menuItemImpl); } @Override boolean dispatchMenuItemSelected(final MenuBuilder menuBuilder, final MenuItem menuItem) { return super.dispatchMenuItemSelected(menuBuilder, menuItem) || this.mParentMenu.dispatchMenuItemSelected(menuBuilder, menuItem); } @Override public boolean expandItemActionView(final MenuItemImpl menuItemImpl) { return this.mParentMenu.expandItemActionView(menuItemImpl); } public String getActionViewStatesKey() { int itemId; if (this.mItem != null) { itemId = this.mItem.getItemId(); } else { itemId = 0; } if (itemId == 0) { return null; } return super.getActionViewStatesKey() + ":" + itemId; } public MenuItem getItem() { return (MenuItem)this.mItem; } public Menu getParentMenu() { return (Menu)this.mParentMenu; } @Override public MenuBuilder getRootMenu() { return this.mParentMenu; } public boolean isQwertyMode() { return this.mParentMenu.isQwertyMode(); } @Override public boolean isShortcutsVisible() { return this.mParentMenu.isShortcutsVisible(); } @Override public void setCallback(final Callback callback) { this.mParentMenu.setCallback(callback); } public SubMenu setHeaderIcon(final int n) { super.setHeaderIconInt(ContextCompat.getDrawable(this.getContext(), n)); return (SubMenu)this; } public SubMenu setHeaderIcon(final Drawable headerIconInt) { super.setHeaderIconInt(headerIconInt); return (SubMenu)this; } public SubMenu setHeaderTitle(final int n) { super.setHeaderTitleInt(this.getContext().getResources().getString(n)); return (SubMenu)this; } public SubMenu setHeaderTitle(final CharSequence headerTitleInt) { super.setHeaderTitleInt(headerTitleInt); return (SubMenu)this; } public SubMenu setHeaderView(final View headerViewInt) { super.setHeaderViewInt(headerViewInt); return (SubMenu)this; } public SubMenu setIcon(final int icon) { this.mItem.setIcon(icon); return (SubMenu)this; } public SubMenu setIcon(final Drawable icon) { this.mItem.setIcon(icon); return (SubMenu)this; } @Override public void setQwertyMode(final boolean qwertyMode) { this.mParentMenu.setQwertyMode(qwertyMode); } @Override public void setShortcutsVisible(final boolean shortcutsVisible) { this.mParentMenu.setShortcutsVisible(shortcutsVisible); } }
[ "Hao.Ke@nccgroup.trust" ]
Hao.Ke@nccgroup.trust
c10fa8f3a0e655740188b81eed10ad4da57c7d04
89ec26aa743a73a7196e108f6f0a85f276c5c007
/sinnori_framework/core_build/src/kr/pe/sinnori/server/threadpool/accept/processor/handler/AcceptProcessor.java
6f169b839f6afd0fb32b1c5b7e34b0455bf0b309
[ "Apache-2.0" ]
permissive
mait/gitsinnori
10f11f999d92422c6df547e5df931c0908a20129
e206ed997645e6a3919a639080ff4496252d22a3
refs/heads/master
2020-12-26T01:13:07.419409
2013-12-13T07:31:31
2013-12-13T07:31:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,144
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 kr.pe.sinnori.server.threadpool.accept.processor.handler; // import java.util.logging.Level; import java.net.Socket; import java.nio.channels.SocketChannel; import java.util.concurrent.LinkedBlockingQueue; import kr.pe.sinnori.common.exception.NoMoreDataPacketBufferException; import kr.pe.sinnori.common.lib.CommonRootIF; import kr.pe.sinnori.server.threadpool.inputmessage.InputMessageReaderPoolIF; /** * 서버에 접속 승인된 클라이언트(=소켓 채널) 등록 처리 쓰레드 * * @author Jonghoon Won * */ public class AcceptProcessor extends Thread implements CommonRootIF { private int index; // AcceptSelectorPool에서 생성한 순서 private LinkedBlockingQueue<SocketChannel> acceptQueue; private InputMessageReaderPoolIF inputMessageReaderPoolIF = null; /** * AcceptProcessor 생성자 * * @param index * AcceptProcessorPool에서 생성한 순서 */ public AcceptProcessor(int index, LinkedBlockingQueue<SocketChannel> acceptQueue, InputMessageReaderPoolIF inputMessageReaderPoolIF) { this.index = index; this.acceptQueue = acceptQueue; this.inputMessageReaderPoolIF = inputMessageReaderPoolIF; } /** * <b>Accept Qeueue</b> 에서 OP_ACCEPT 이벤트 발생한 socket channel을 꺼내와서 <br/> * 비동기로 세팅후 * {@link InputMessageReaderPoolIF#addNewClient(java.nio.channels.SocketChannel) } * 에게 전달한다. * * @see InputMessageReaderPoolIF#addNewClient(java.nio.channels.SocketChannel) */ @Override public void run() { // log.info("Index[%d] start", index); try { while (!Thread.currentThread().isInterrupted()) { SocketChannel clientSC = acceptQueue.take(); clientSC.configureBlocking(false); Socket sc = clientSC.socket(); sc.setKeepAlive(true); sc.setTcpNoDelay(true); // sc.setSendBufferSize(io_buffer_size); // sc.setReceiveBufferSize(io_buffer_size); try { inputMessageReaderPoolIF.addNewClient(clientSC); } catch (NoMoreDataPacketBufferException e) { log.warn("NoMoreDataPacketBufferException", e); clientSC.close(); } } log.warn("Thread loop exit"); } catch (InterruptedException e) { log.warn(String.format("Index[%d] stop", index), e); } catch (Exception e) { log.warn(String.format("Index[%d] error", index), e); } } }
[ "k9200544@hanmail.net" ]
k9200544@hanmail.net
16358a345f60900fe24ee65c0bf321732c6c8038
eb2690583fc03c0d9096389e1c07ebfb80e7f8d5
/src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00386.java
65dbe237754482211ee212b78834d8d375a4ba35
[]
no_license
leroy-habberstad/java-benchmark
126671f074f81bd7ab339654ed1b2d5d85be85dd
bce2a30bbed61a7f717a9251ca2cbb38b9e6a732
refs/heads/main
2023-03-15T03:02:42.714614
2021-03-23T00:03:36
2021-03-23T00:03:36
350,495,796
0
0
null
null
null
null
UTF-8
Java
false
false
2,289
java
/** * OWASP Benchmark Project v1.2 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The OWASP Benchmark 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, version 2. * * The OWASP Benchmark 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. * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(value="/xss-00/BenchmarkTest00386") public class BenchmarkTest00386 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String param = request.getParameter("BenchmarkTest00386"); if (param == null) param = ""; String bar = "safe!"; java.util.HashMap<String,Object> map8057 = new java.util.HashMap<String,Object>(); map8057.put("keyA-8057", "a_Value"); // put some stuff in the collection map8057.put("keyB-8057", param); // put it in a collection map8057.put("keyC", "another_Value"); // put some stuff in the collection bar = (String)map8057.get("keyB-8057"); // get it back out bar = (String)map8057.get("keyA-8057"); // get safe value back out response.setHeader("X-XSS-Protection", "0"); Object[] obj = { bar, "b"}; response.getWriter().printf("Formatted like: %1$s and %2$s.",obj); } }
[ "jjohnson@gitlab.com" ]
jjohnson@gitlab.com
5c30fd8be080bd8f47799350b7ac5f5ed0bf57dd
b9244095c3762d2196ac948668db8be9676a3b56
/sliderview/src/main/java/com/wandrip/imageslider/Transformers/BackgroundToForegroundTransformer.java
403459911a1d38ffdfbbd353b5054d58c923107d
[]
no_license
barenece9/ClubApp
459d5d4b4dd77e184ff817c597cba418d5023b10
4b10b996e4af7b9bbef9ada0077b42e7fddb4e3c
refs/heads/master
2021-04-09T10:14:20.476976
2018-03-16T10:35:53
2018-03-16T10:35:53
125,501,905
0
0
null
null
null
null
UTF-8
Java
false
false
799
java
package com.wandrip.imageslider.Transformers; import android.view.View; import com.nineoldandroids.view.ViewHelper; public class BackgroundToForegroundTransformer extends BaseTransformer { @Override protected void onTransform(View view, float position) { final float height = view.getHeight(); final float width = view.getWidth(); final float scale = min(position < 0 ? 1f : Math.abs(1f - position), 0.5f); ViewHelper.setScaleX(view,scale); ViewHelper.setScaleY(view,scale); ViewHelper.setPivotX(view,width*0.5f); ViewHelper.setPivotY(view,height*0.5f); ViewHelper.setTranslationX(view,position < 0 ? width * position : -width * position * 0.25f); } private static final float min(float val, float min) { return val < min ? min : val; } }
[ "baren.lnsel@gmail.com" ]
baren.lnsel@gmail.com
08babba3e6bc8b78df4a1f1d3c24216a3693f4ac
af0d1cb2999d25ecf6e5e854138bbc6f62d326c7
/src/main/java/ci/projetSociaux/repository/PrgPaiementReportStatutViewRepository.java
9701b0e56e1e9755f345907ea62906c5e9c378d3
[]
no_license
syliGaye/ProjetSocial_Dev_2019
48deee4f5d870de22a939bc313c496c26be4fee4
8ce08aa7cd53ee8de531063371f2ea71d4c5d81a
refs/heads/master
2023-04-01T00:45:21.665087
2019-05-27T12:24:50
2019-05-27T12:24:50
187,012,842
0
0
null
2023-03-27T22:16:32
2019-05-16T11:19:00
Java
UTF-8
Java
false
false
501
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ci.projetSociaux.repository; import ci.projetSociaux.entity.PrgPaiementReportStatutView; import org.springframework.data.jpa.repository.JpaRepository; /** * * @author soumabkar */ public interface PrgPaiementReportStatutViewRepository extends JpaRepository<PrgPaiementReportStatutView, String> { }
[ "sylvestregaye@gmail.com" ]
sylvestregaye@gmail.com
15a0c96f7add1f09d7ae4dab1f02f48621b5aed2
07de2a7700430dc991d6844eb2589810f592d066
/app/src/main/java/com/example/ranjith/attendencereco/google/android/gms/signin/internal/AuthAccountResult.java
34e2cdf843b0273cea7c6cbf3bd54efd2cebad8d
[]
no_license
Maheshwari-Vamsi/AttendenceReco
b8d46ebd496bcea16f2291de42f10a88676d424d
e8e7e3b08fd6642ca7a4fd3fb0bf73fea04e5848
refs/heads/master
2021-01-13T11:39:56.828209
2016-09-27T11:20:28
2016-09-27T11:20:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package com.google.android.gms.signin.internal; import android.content.Intent; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; public class AuthAccountResult implements Result, SafeParcelable { public static final Parcelable.Creator<AuthAccountResult> CREATOR = new zza(); final int mVersionCode; private int zzbbS; private Intent zzbbT; public AuthAccountResult() { this(0, null); } AuthAccountResult(int paramInt1, int paramInt2, Intent paramIntent) { this.mVersionCode = paramInt1; this.zzbbS = paramInt2; this.zzbbT = paramIntent; } public AuthAccountResult(int paramInt, Intent paramIntent) { this(2, paramInt, paramIntent); } public int describeContents() { return 0; } public Status getStatus() { if (this.zzbbS == 0) { return Status.zzaeX; } return Status.zzafb; } public void writeToParcel(Parcel paramParcel, int paramInt) { zza.zza(this, paramParcel, paramInt); } public int zzDR() { return this.zzbbS; } public Intent zzDS() { return this.zzbbT; } } /* Location: D:\Apk\dex2jar-0.0.9.15\classes-dex2jar.jar!\com\google\android\gms\signin\internal\AuthAccountResult.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "walabalakumar@gmail.com" ]
walabalakumar@gmail.com
c4083e09d22510e09ea0d9f150af2c9b5f2e0445
8b1f1398a584049cebc6a0f7fb4319e5199769e4
/src/main/java/com/cts/wt/workouttrackerbackend/entities/Workout.java
9c8225134e7ea2f4accd7d8b6da87ecdef1b8f68
[]
no_license
puneetvashisht/backend-spring
81752d154c3d2ebb33c35c905d66f743e11e0e3f
b5292fad06a018053a4e9ab2c374b55fa0280093
refs/heads/master
2020-03-28T12:30:55.937945
2018-09-19T11:45:37
2018-09-19T11:45:37
148,305,942
0
0
null
null
null
null
UTF-8
Java
false
false
1,345
java
package com.cts.wt.workouttrackerbackend.entities; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity(name="workout_collection") public class Workout { @Id @GeneratedValue(strategy=GenerationType.AUTO) int id; String title; String note; int caloriesBurntPerMinute; @ManyToOne(cascade=CascadeType.ALL) Category category; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public int getCaloriesBurntPerMinute() { return caloriesBurntPerMinute; } public void setCaloriesBurntPerMinute(int caloriesBurntPerMinute) { this.caloriesBurntPerMinute = caloriesBurntPerMinute; } public Category getCategory() { return category; } public void setCategory(Category category) { this.category = category; } @Override public String toString() { return "Workout [id=" + id + ", title=" + title + ", note=" + note + ", caloriesBurntPerMinute=" + caloriesBurntPerMinute + "]"; } }
[ "puneetvashsiht@gmail.com" ]
puneetvashsiht@gmail.com
513de4b49a9ea6d3366ab209904201cbd5bf2722
05f4560027847b46c5677041033951341d001e5e
/src/java/com/core/QuartzMain.java
8ebeedb2b737d96e6e7288529e36f00043efdf70
[]
no_license
lawale4me/JobService
bb51ce7ce2b704a227438d7faf90fb9432b818d7
a292f839f0002318ae6fe55b24ed43d02b144905
refs/heads/master
2020-05-25T15:40:44.952132
2016-09-27T13:52:35
2016-09-27T13:52:35
69,362,053
2
0
null
null
null
null
UTF-8
Java
false
false
4,823
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.core; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import static org.quartz.CronScheduleBuilder.dailyAtHourAndMinute; import static org.quartz.JobBuilder.newJob; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import static org.quartz.SimpleScheduleBuilder.simpleSchedule; import org.quartz.Trigger; import static org.quartz.TriggerBuilder.newTrigger; import org.quartz.impl.StdSchedulerFactory; /** * * @author Ahmed */ @WebServlet(name="QuartzMain", loadOnStartup = 1) public class QuartzMain extends HttpServlet{ @Override public void init() throws ServletException { try { // Grab the Scheduler instance from the Factory Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); // and start it off scheduler.start(); //.....QUICKTELLER.....QUICKTELLER.....QUICKTELLER // define the job and tie it to our HelloJob class JobDetail job = newJob(TaskBean.class) .withIdentity("jobserv", "jbgroup1") .build(); // Trigger the job to run now, and then repeat every 60 seconds Trigger trigger = newTrigger() .withIdentity("jbtrigger1", "jbgroup1") .startNow() .withSchedule(simpleSchedule() .withIntervalInSeconds(90) .repeatForever()) .build(); //.....SEND JOB........SEND JOB....SEND JOB..... // define another job and tie it to our sendSMS class JobDetail sendjob = newJob(SendBean.class) .withIdentity("sendjob", "sendjobgroup") .build(); // Trigger the job to run now, and then repeat every 60 seconds Trigger sendTrigger = newTrigger() .withIdentity("sendTrigger", "sendjobgroup") .startNow() .withSchedule(simpleSchedule() .withIntervalInSeconds(60) .repeatForever()) .build(); //.....EMAIL JOB........EMAIL JOB....EMAIL JOB..... // define another job and tie it to our sendEmail class JobDetail emailjob = newJob(EmailBean.class) .withIdentity("emailjob", "emailjobgroup") .build(); // Trigger the job to run now, and then repeat every 60 seconds Trigger emailTrigger = newTrigger() .withIdentity("emailTrigger", "emailjobgroup") .startNow() .withSchedule(simpleSchedule() .withIntervalInSeconds(180) .repeatForever()) .build(); //SCHEDULING......SCHEDULING........SCHEDULING // define another job and tie it to our sendSMS class JobDetail schedulejob = newJob(ScheduleBean.class) .withIdentity("schedulejob", "schedulejobgroup") .build(); // Trigger the job to run now, and then repeat every 60 seconds Trigger scheduleTrigger = newTrigger() .withIdentity("trigger3", "schedulejobgroup") .startNow() .withSchedule(dailyAtHourAndMinute(10, 0)) // fire every day at 10:00 // .withSchedule(simpleSchedule() // .withIntervalInSeconds(60) // .repeatForever()) .build(); // Tell quartz to schedule the job using our trigger scheduler.scheduleJob(job, trigger); scheduler.scheduleJob(sendjob, sendTrigger); scheduler.scheduleJob(schedulejob, scheduleTrigger); scheduler.scheduleJob(emailjob, emailTrigger); //scheduler.shutdown(); } catch (SchedulerException se) { se.printStackTrace(); } } }
[ "ahmed.oladele@vanso.com" ]
ahmed.oladele@vanso.com
a405a8cd792108d8fa8d1398a6e118d56914ab4e
1f5c68f68b12b314d062c8c94b4824a533b4a7a3
/com/planet_ink/coffee_mud/Races/HalfElf.java
8b6524138cf631da706812637de3e0cdac6a9f94
[ "Apache-2.0" ]
permissive
leonlee/CoffeeMud
ff29abc60a77d03675375a9097572780a14b86c3
c35383fc53bd3947b6b8579a581e9eb792e15ef9
refs/heads/master
2020-06-09T15:47:32.771688
2016-12-08T07:12:47
2016-12-08T07:12:47
76,030,486
1
0
null
2016-12-09T11:38:35
2016-12-09T11:38:34
null
UTF-8
Java
false
false
6,229
java
package com.planet_ink.coffee_mud.Races; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2001-2016 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ public class HalfElf extends StdRace { @Override public String ID() { return "HalfElf"; } private final static String localizedStaticName = CMLib.lang().L("Half Elf"); @Override public String name() { return localizedStaticName; } @Override public int shortestMale() { return 64; } @Override public int shortestFemale() { return 59; } @Override public int heightVariance() { return 12; } @Override public int lightestWeight() { return 90; } @Override public int weightVariance() { return 90; } @Override public long forbiddenWornBits() { return 0; } private final static String localizedStaticRacialCat = CMLib.lang().L("Elf"); @Override public String racialCategory() { return localizedStaticRacialCat; } private final String[] culturalAbilityNames = { "Elvish", "Fishing", "Skill_CulturalAdaptation" }; private final int[] culturalAbilityProficiencies = { 50, 50, 50 }; @Override public String[] culturalAbilityNames() { return culturalAbilityNames; } @Override public int[] culturalAbilityProficiencies() { return culturalAbilityProficiencies; } // an ey ea he ne ar ha to le fo no gi mo wa ta wi private static final int[] parts={0 ,2 ,2 ,1 ,1 ,2 ,2 ,1 ,2 ,2 ,1 ,0 ,1 ,1 ,0 ,0 }; @Override public int[] bodyMask() { return parts; } private final int[] agingChart = { 0, 1, 4, 20, 62, 93, 125, 131, 137 }; @Override public int[] getAgingChart() { return agingChart; } protected static Vector<RawMaterial> resources = new Vector<RawMaterial>(); @Override public int availabilityCode() { return Area.THEME_FANTASY; } @Override public void affectPhyStats(Physical affected, PhyStats affectableStats) { super.affectPhyStats(affected,affectableStats); affectableStats.setSensesMask(affectableStats.sensesMask()|PhyStats.CAN_SEE_INFRARED); } @Override public void affectCharStats(MOB affectedMOB, CharStats affectableStats) { super.affectCharStats(affectedMOB, affectableStats); affectableStats.setStat(CharStats.STAT_SAVE_MAGIC,affectableStats.getStat(CharStats.STAT_SAVE_MAGIC)+5); affectableStats.setStat(CharStats.STAT_SAVE_JUSTICE,affectableStats.getStat(CharStats.STAT_SAVE_JUSTICE)+5); } @Override public List<Item> outfit(MOB myChar) { if(outfitChoices==null) { // Have to, since it requires use of special constructor final Armor s1=CMClass.getArmor("GenShirt"); if(s1 == null) return new Vector<Item>(); outfitChoices=new Vector<Item>(); outfitChoices.add(s1); final Armor s2=CMClass.getArmor("GenShoes"); outfitChoices.add(s2); final Armor p1=CMClass.getArmor("GenPants"); outfitChoices.add(p1); final Armor s3=CMClass.getArmor("GenBelt"); outfitChoices.add(s3); } return outfitChoices; } @Override public Weapon myNaturalWeapon() { return funHumanoidWeapon(); } @Override public String healthText(MOB viewer, MOB mob) { final double pct=(CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints())); if(pct<.10) return L("^r@x1^r is mortally wounded and will soon die.^N",mob.name(viewer)); else if(pct<.20) return L("^r@x1^r is covered in blood.^N",mob.name(viewer)); else if(pct<.30) return L("^r@x1^r is bleeding badly from lots of wounds.^N",mob.name(viewer)); else if(pct<.40) return L("^y@x1^y has numerous bloody wounds and gashes.^N",mob.name(viewer)); else if(pct<.50) return L("^y@x1^y has some bloody wounds and gashes.^N",mob.name(viewer)); else if(pct<.60) return L("^p@x1^p has a few bloody wounds.^N",mob.name(viewer)); else if(pct<.70) return L("^p@x1^p is cut and bruised.^N",mob.name(viewer)); else if(pct<.80) return L("^g@x1^g has some minor cuts and bruises.^N",mob.name(viewer)); else if(pct<.90) return L("^g@x1^g has a few bruises and scratches.^N",mob.name(viewer)); else if(pct<.99) return L("^g@x1^g has a few small bruises.^N",mob.name(viewer)); else return L("^c@x1^c is in perfect health.^N",mob.name(viewer)); } @Override public List<RawMaterial> myResources() { synchronized(resources) { if(resources.size()==0) { resources.addElement(makeResource (L("a @x1 brain",name().toLowerCase()),RawMaterial.RESOURCE_MEAT)); resources.addElement(makeResource (L("some @x1 blood",name().toLowerCase()),RawMaterial.RESOURCE_BLOOD)); resources.addElement(makeResource (L("a pile of @x1 bones",name().toLowerCase()),RawMaterial.RESOURCE_BONE)); } } return resources; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
1c38caf7bd8567b27bd2676ceeaaffb162c827f8
39e32f672b6ef972ebf36adcb6a0ca899f49a094
/dcm4che14/tags/DCM4CHEE_2_11_0_BRANCHA_TAG1/src/java/org/dcm4che/data/DcmElement.java
5aad0c15aa8ffaec72677d0989f363d9adae763f
[ "Apache-2.0" ]
permissive
medicayun/medicayundicom
6a5812254e1baf88ad3786d1b4cf544821d4ca0b
47827007f2b3e424a1c47863bcf7d4781e15e814
refs/heads/master
2021-01-23T11:20:41.530293
2017-06-05T03:11:47
2017-06-05T03:11:47
93,123,541
0
2
null
null
null
null
UTF-8
Java
false
false
4,982
java
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is part of dcm4che, an implementation of DICOM(TM) in * Java(TM), hosted at http://sourceforge.net/projects/dcm4che. * * The Initial Developer of the Original Code is * TIANI Medgraph AG. * Portions created by the Initial Developer are Copyright (C) 2002-2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Gunter Zeilinger <gunter.zeilinger@tiani.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ package org.dcm4che.data; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Date; /** Element in <code>DcmObject</code>. * * @author <a href="mailto:gunter@tiani.com">gunter zeilinger</a> * @since March 2002 * @version $Revision: 3994 $ $Date: 2006-05-18 06:10:23 +0800 (周四, 18 5月 2006) $ * @see "DICOM Part 5: Data Structures and Encoding, 7.1 Data Elements" * @see "DICOM Part 7: Message Exchange, 6.3.1 Command Set Structure" */ public interface DcmElement { int tag(); int vr(); /** * @deprecated may return wrong number in case of multi-byte char sets; * use {@link #vm(SpecificCharacterSet)} or for number of items/fragments * in sequences {@link #countItems()} instead. */ int vm(); int vm(SpecificCharacterSet cs); int countItems(); int length(); boolean isEmpty(); int hashCode(); DcmElement share(); ByteBuffer getByteBuffer(); ByteBuffer getByteBuffer(ByteOrder byteOrder); boolean hasDataFragments(); ByteBuffer getDataFragment(int index); ByteBuffer getDataFragment(int index, ByteOrder byteOrder); int getDataFragmentLength(int index); String getString(SpecificCharacterSet cs) throws DcmValueException; String getString(int index, SpecificCharacterSet cs) throws DcmValueException; String[] getStrings(SpecificCharacterSet cs) throws DcmValueException; String getBoundedString(int maxLen, SpecificCharacterSet cs) throws DcmValueException; String getBoundedString(int maxLen, int index, SpecificCharacterSet cs) throws DcmValueException; String[] getBoundedStrings(int maxLen, SpecificCharacterSet cs) throws DcmValueException; int getInt() throws DcmValueException; int getInt(int index) throws DcmValueException; int[] getInts() throws DcmValueException; int getTag() throws DcmValueException; int getTag(int index) throws DcmValueException; int[] getTags() throws DcmValueException; float getFloat() throws DcmValueException; float getFloat(int index) throws DcmValueException; float[] getFloats() throws DcmValueException; double getDouble() throws DcmValueException; double getDouble(int index) throws DcmValueException; double[] getDoubles() throws DcmValueException; Date getDate() throws DcmValueException; Date getDate(int index) throws DcmValueException; Date[] getDates() throws DcmValueException; Date[] getDateRange() throws DcmValueException; PersonName getPersonName(SpecificCharacterSet cs) throws DcmValueException; PersonName getPersonName(int index, SpecificCharacterSet cs) throws DcmValueException; PersonName[] getPersonNames(SpecificCharacterSet cs) throws DcmValueException; void addDataFragment(ByteBuffer byteBuffer); boolean hasItems(); Dataset addNewItem(); void addItem(Dataset item); Dataset getItem(); Dataset getItem(int index); DcmElement setStreamPosition(long streamPos); long getStreamPosition(); }
[ "liliang_lz@icloud.com" ]
liliang_lz@icloud.com
3c9c7fb2d7e16dac54a5646d6a40fa4f38a4b1ae
baf3d8642e437858808503e9d82e7f1fb52dd9e4
/working/src/main/java/com/unistrong/working/ui/adapter/Adapter_I_Participated.java
3294101860ca427b5d7203ba7680a74481672998
[]
no_license
Laughing952/MobileProjectManagement
47c3d01b2f50772bfd70f3ef75da59684bfb081d
d85916c0a59a4dab6bdd4e45155cdba2d1ecb274
refs/heads/master
2020-03-21T22:36:03.812124
2018-06-29T09:38:28
2018-06-29T09:38:28
139,130,709
0
0
null
null
null
null
UTF-8
Java
false
false
1,533
java
package com.unistrong.working.ui.adapter; import android.databinding.DataBindingUtil; import com.global.listener.ItemClickListener; import com.global.listener.ItemLongClickListener; import com.unistrong.working.R; import com.unistrong.working.bean.IParticipatedBean; import com.unistrong.working.databinding.ItemIParticipatedBinding; import com.unistrong.working.ui.viewmodel.IParticipatedVM; import com.waterbase.widget.recycleview.BaseAdapter; import com.waterbase.widget.recycleview.BaseViewHolder; /** * 我参与的(任务) * 作者:Laughing on 2018/5/3 10:15 * 邮箱:719240226@qq.com */ public class Adapter_I_Participated extends BaseAdapter<IParticipatedBean> { private ItemClickListener itemClickListener; private ItemLongClickListener itemLongClickListener; public void setItemClickListener(ItemClickListener itemClickListener) { this.itemClickListener = itemClickListener; } @Override public int getLayoutRes(int index) { return R.layout.item_i_participated; } @Override public void convert(BaseViewHolder holder, IParticipatedBean data, int index) { ItemIParticipatedBinding bind = DataBindingUtil.bind(holder.itemView); bind.setViewmodel(new IParticipatedVM(data)); holder.itemView.setOnClickListener(v -> { if (itemClickListener != null) itemClickListener.itemClick(v, data, index); }); } @Override public void bind(BaseViewHolder holder, int layoutRes) { } }
[ "719240226@qq.com" ]
719240226@qq.com
aae6270d89d17e8340f200694999c85bf248d635
90e9ec6fa6c90174ad4cb652af63834e16b90815
/Email/app/src/test/java/com/example/peter/email/ExampleUnitTest (2019_04_17 17_37_00 UTC).java
f439df963d8b51e4d34eed1acf20ac7fb165ee19
[]
no_license
terriljoel/Android-Basic-Apps-
478e208cd147cd2083fde0f9284400fa4c99bf38
b38ed84006914c443cdaa52b8dac8ad0ffcf7fcc
refs/heads/master
2022-12-22T14:41:37.171823
2020-09-23T18:43:45
2020-09-23T18:43:45
298,059,514
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.example.peter.email; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals( 4, 2 + 2 ); } }
[ "terriljoel@gmail.com" ]
terriljoel@gmail.com
cf111bb2ff8aa20dde75842ae8abbff07998ed12
6874d9db78dea1fe39eba52d2eaef20a66b32948
/gwt-jackson-apt-api/src/main/java/com/progressoft/brix/domino/gwtjackson/deser/array/PrimitiveIntegerArrayJsonDeserializer.java
01eb02a2b0c2c3dc07d20d9084763951b3981521
[ "Apache-2.0" ]
permissive
ibaca/gwt-jackson-apt
6880960ebd02fc09e46842b860419d103fe3c768
0da5c1f8933436d1cdfdf71c32b235313d072231
refs/heads/master
2021-09-03T03:42:59.449282
2018-01-05T08:39:21
2018-01-05T08:39:21
116,362,459
0
0
null
2018-01-05T08:40:03
2018-01-05T08:40:02
null
UTF-8
Java
false
false
2,514
java
/* * Copyright 2013 Nicolas Morel * * 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.progressoft.brix.domino.gwtjackson.deser.array; import com.progressoft.brix.domino.gwtjackson.JsonDeserializerParameters; import com.progressoft.brix.domino.gwtjackson.JsonDeserializationContext; import com.progressoft.brix.domino.gwtjackson.JsonDeserializer; import com.progressoft.brix.domino.gwtjackson.deser.BaseNumberJsonDeserializer.IntegerJsonDeserializer; import com.progressoft.brix.domino.gwtjackson.stream.JsonReader; import java.util.List; /** * Default {@link JsonDeserializer} implementation for array of int. * * @author Nicolas Morel * @version $Id: $ */ public class PrimitiveIntegerArrayJsonDeserializer extends AbstractArrayJsonDeserializer<int[]> { private static final PrimitiveIntegerArrayJsonDeserializer INSTANCE = new PrimitiveIntegerArrayJsonDeserializer(); /** * <p>getInstance</p> * * @return an instance of {@link PrimitiveIntegerArrayJsonDeserializer} */ public static PrimitiveIntegerArrayJsonDeserializer getInstance() { return INSTANCE; } private PrimitiveIntegerArrayJsonDeserializer() { } /** * {@inheritDoc} */ @Override public int[] doDeserializeArray(JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params) { List<Integer> list = deserializeIntoList(reader, ctx, IntegerJsonDeserializer.getInstance(), params); int[] result = new int[list.size()]; int i = 0; for (Integer value : list) { if (null != value) { result[i] = value; } i++; } return result; } /** * {@inheritDoc} */ @Override protected int[] doDeserializeSingleArray(JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params) { return new int[]{IntegerJsonDeserializer.getInstance().deserialize(reader, ctx, params)}; } }
[ "akabme@gmail.com" ]
akabme@gmail.com
d49c6db65e0393fdfc20d00ff3b3ddb69e947dbf
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
/iotlink/src/main/java/com/jdcloud/sdk/service/iotlink/client/OpenIotFlowExecutor.java
4b7e05da4690a2ac75c7f58e52e96ac31d5fc4c2
[ "Apache-2.0" ]
permissive
jdcloud-api/jdcloud-sdk-java
3fec9cf552693520f07b43a1e445954de60e34a0
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
refs/heads/master
2023-07-25T07:03:36.682248
2023-07-25T06:54:39
2023-07-25T06:54:39
126,275,669
47
61
Apache-2.0
2023-09-07T08:41:24
2018-03-22T03:41:41
Java
UTF-8
Java
false
false
1,374
java
/* * Copyright 2018 JDCLOUD.COM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:#www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Iotlink-Related-API * 物联网卡服务相关API * * OpenAPI spec version: v1 * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ package com.jdcloud.sdk.service.iotlink.client; import com.jdcloud.sdk.client.JdcloudExecutor; import com.jdcloud.sdk.service.JdcloudResponse; import com.jdcloud.sdk.service.iotlink.model.OpenIotFlowResponse; /** * 物联网卡开启流量操作 */ class OpenIotFlowExecutor extends JdcloudExecutor { @Override public String method() { return "POST"; } @Override public String url() { return "/regions/{regionId}/openIotFlow"; } @Override public Class<? extends JdcloudResponse> returnType() { return OpenIotFlowResponse.class; } }
[ "tancong@jd.com" ]
tancong@jd.com
184210cc0d369290eb1a8f82c7f2249028b7834e
dac548797905984302537804379f53736512bef4
/yi-core/src/main/java/com/yi/core/finance/service/IPlatformSaleStatService.java
532dc899439c9c9dac061ffb67c6f3e0c4b7c146
[]
no_license
TanoteAlex/yi
4c593b71e3285e62775f6293b0c3c0633853bc6d
e877aca354180a3b77db4d2995eff569b6aa4292
refs/heads/master
2023-01-09T02:38:44.546467
2019-10-22T10:04:59
2019-10-22T10:04:59
216,754,013
0
1
null
2023-01-05T23:34:27
2019-10-22T07:48:51
TypeScript
UTF-8
Java
false
false
226
java
/* * Powered By [yihz-framework] * Web Site: yihz * Since 2018 - 2018 */ package com.yi.core.finance.service; /** * * @author lemosen * @version 1.0 * @since 1.0 **/ public interface IPlatformSaleStatService { }
[ "582175148@qq.com" ]
582175148@qq.com
dca48211e22260e37b157bc14134fea875070c3f
495283a9782e20f7ca336c303bf9355e98a9fa14
/wsn-sdn/src/main/java/org/oasis_open/docs/wsn/brw_2/PublisherRegistrationRejectedFault.java
1dea091520615dcf3c4ee292bb0c6e074b1443f9
[]
no_license
lingboling1991/SDN-based-PubSub-System
ea2a935f4c416e951177552979f8ba2e987f8c3e
ac582632c3c26b4ec14c7817c73c0fea2f53acce
refs/heads/master
2021-01-21T07:53:26.607374
2016-05-24T13:19:18
2016-05-24T13:19:18
42,028,245
0
0
null
2015-09-07T02:58:22
2015-09-07T02:58:22
null
UTF-8
Java
false
false
1,555
java
package org.oasis_open.docs.wsn.brw_2; import javax.xml.ws.WebFault; /** * This class was generated by Apache CXF 2.3.2 * 2012-11-13T15:21:18.393+08:00 * Generated source version: 2.3.2 */ @WebFault(name = "PublisherRegistrationRejectedFault", targetNamespace = "http://docs.oasis-open.org/wsn/br-2") public class PublisherRegistrationRejectedFault extends Exception { public static final long serialVersionUID = 20121113152118L; private org.oasis_open.docs.wsn.br_2.PublisherRegistrationRejectedFaultType publisherRegistrationRejectedFault; public PublisherRegistrationRejectedFault() { super(); } public PublisherRegistrationRejectedFault(String message) { super(message); } public PublisherRegistrationRejectedFault(String message, Throwable cause) { super(message, cause); } public PublisherRegistrationRejectedFault(String message, org.oasis_open.docs.wsn.br_2.PublisherRegistrationRejectedFaultType publisherRegistrationRejectedFault) { super(message); this.publisherRegistrationRejectedFault = publisherRegistrationRejectedFault; } public PublisherRegistrationRejectedFault(String message, org.oasis_open.docs.wsn.br_2.PublisherRegistrationRejectedFaultType publisherRegistrationRejectedFault, Throwable cause) { super(message, cause); this.publisherRegistrationRejectedFault = publisherRegistrationRejectedFault; } public org.oasis_open.docs.wsn.br_2.PublisherRegistrationRejectedFaultType getFaultInfo() { return this.publisherRegistrationRejectedFault; } }
[ "mikezang625@gmail.com" ]
mikezang625@gmail.com
64d704e962de7a13e272c02942b228deb3e4af7f
2cae00e8a3ac1317e3871af8dde3679913344268
/.svn/pristine/53/5369eaa466fd27b8ce27475e1b027ed13eed7d1e.svn-base
241c9f3ba7299709189333af8f42d6bb72429478
[]
no_license
guanyiGit/qlw
a25c5115efc4ab8c76e72c46228349ee08476aab
a353bbf738247dffd6a0d41a1a58f7bb61a21a83
refs/heads/master
2022-12-26T16:30:41.910066
2019-10-31T08:08:36
2019-10-31T08:08:36
186,968,080
0
0
null
null
null
null
UTF-8
Java
false
false
1,435
package com.soholy.dogmanager.entity; import java.util.Date; public class TDistrict { private Integer districtId; private Integer districtType; private String districtName; private Integer parentId; private String districtLevStatus; private Date creationTime; public Integer getDistrictId() { return districtId; } public void setDistrictId(Integer districtId) { this.districtId = districtId; } public Integer getDistrictType() { return districtType; } public void setDistrictType(Integer districtType) { this.districtType = districtType; } public String getDistrictName() { return districtName; } public void setDistrictName(String districtName) { this.districtName = districtName == null ? null : districtName.trim(); } public Integer getParentId() { return parentId; } public void setParentId(Integer parentId) { this.parentId = parentId; } public String getDistrictLevStatus() { return districtLevStatus; } public void setDistrictLevStatus(String districtLevStatus) { this.districtLevStatus = districtLevStatus == null ? null : districtLevStatus.trim(); } public Date getCreationTime() { return creationTime; } public void setCreationTime(Date creationTime) { this.creationTime = creationTime; } }
[ "guanyimail@126.com" ]
guanyimail@126.com
308ecc91fb63605b0300832b6d1d19dede2d3c09
1b6353dbe9a6e480d78a945ee68e1823d961c1d0
/app/src/main/java/kapadokia/nyandoro/shoping/views/OrderFragment.java
851355898fe8f7920a79999fc6eb3b4798c09882
[]
no_license
Kapadokia-Titus/Shopping-
a14040a5a1f8d95bb06eb1be016601aa4c1886b1
ff207af1289ce608347bf346a9376815d7b70c95
refs/heads/master
2022-12-09T20:51:16.118356
2020-09-15T00:56:47
2020-09-15T00:56:47
295,561,081
0
0
null
null
null
null
UTF-8
Java
false
false
652
java
package kapadokia.nyandoro.shoping.views; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import kapadokia.nyandoro.shoping.R; public class OrderFragment extends Fragment { public OrderFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_order, container, false); } }
[ "ktnyandoch@gmail.com" ]
ktnyandoch@gmail.com
7088c59e8948d060ff0748e6e81f6a61b573c343
be608e227e7e385cd8e68bdfae4c79283ee88595
/service-edi271/target/generated-sources/xjc/org/delta/b2b/edi/t271/EINS12DateTimePeriod.java
46f7a520e268b8b6c3d139eda8f880cbaba681b3
[]
no_license
msen2000/services
4867cdc3e2be12e9b5f54f2568e7c9844e91af25
cb84c48792aee88ab8533f407b8150430c5da2dd
refs/heads/master
2016-08-04T19:08:09.872078
2014-02-16T08:11:16
2014-02-16T08:11:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,954
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.5-b02-fcs // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2011.07.30 at 07:43:57 PM PDT // package org.delta.b2b.edi.t271; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * Expression of a date, a time, or range of dates, times or dates and times * * <p>Java class for E-INS12-Date_Time_Period complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="E-INS12-Date_Time_Period"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}string" default="Element" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "E-INS12-Date_Time_Period") public class EINS12DateTimePeriod { @XmlAttribute(name = "Type") protected String type; /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { if (type == null) { return "Element"; } else { return type; } } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } }
[ "msen2000@gmail.com" ]
msen2000@gmail.com
212633f8be5ed66c7711692c2606f4213c892a27
1888844df190d5c3845a9ac377912c9e7d2633c8
/src/main/java/com/hypercell/productcatalog/security/jwt/JWTFilter.java
4bd263a11ab627e93d77b9eaf693d25af9ad0123
[]
no_license
nesmaelhebeary/productCatalog
a53ab7a0099ce8674bce90bcafaa2f132f41dbe3
0d2ceecbd9403331c8b97ce1d0fe3d148450fc20
refs/heads/main
2023-01-28T19:25:01.531482
2020-12-09T00:56:54
2020-12-09T00:56:54
319,801,669
0
0
null
2020-12-09T00:57:27
2020-12-09T00:56:42
Java
UTF-8
Java
false
false
1,859
java
package com.hypercell.productcatalog.security.jwt; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.util.StringUtils; import org.springframework.web.filter.GenericFilterBean; /** * Filters incoming requests and installs a Spring Security principal if a header corresponding to a valid user is * found. */ public class JWTFilter extends GenericFilterBean { public static final String AUTHORIZATION_HEADER = "Authorization"; private final TokenProvider tokenProvider; public JWTFilter(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; String jwt = resolveToken(httpServletRequest); if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) { Authentication authentication = this.tokenProvider.getAuthentication(jwt); SecurityContextHolder.getContext().setAuthentication(authentication); } filterChain.doFilter(servletRequest, servletResponse); } private String resolveToken(HttpServletRequest request) { String bearerToken = request.getHeader(AUTHORIZATION_HEADER); if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) { return bearerToken.substring(7); } return null; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
1a4dff5fb2d44a113dd8e256d450d2837e1664b6
c6d4872031fe7f9d20c6a5c01eb07c92aab3a205
/integrations/dynamodb/src/main/java/de/quantummaid/mapmaid/dynamodb/rearranging/Transformation.java
e8eb128a6a9a3c0af4705cd11bc95acc42894ff7
[ "Apache-2.0" ]
permissive
quantummaid/mapmaid
22cae89fa09c7cab1d1f73e20f2b92718f59bd49
348ed54a2dd46ffb66204ae573f242a01acb73c5
refs/heads/master
2022-12-24T06:56:45.809221
2021-08-03T09:56:58
2021-08-03T09:56:58
228,895,012
5
1
Apache-2.0
2022-12-14T20:53:54
2019-12-18T18:01:43
Java
UTF-8
Java
false
false
2,460
java
/* * Copyright (c) 2020 Richard Hauswald - https://quantummaid.de/. * * 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 de.quantummaid.mapmaid.dynamodb.rearranging; import de.quantummaid.mapmaid.mapper.marshalling.Marshaller; import de.quantummaid.mapmaid.mapper.marshalling.Unmarshaller; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import java.util.Map; @RequiredArgsConstructor(access = AccessLevel.PRIVATE) public final class Transformation<T> implements Rearranger { private final String key; private final Marshaller<T> transformingMarshaller; private final Unmarshaller<T> reversingMarshaller; public static <T> Transformation<T> transform(final String key, final Marshaller<T> transformatingMarshaller, final Unmarshaller<T> reversingMarshaller) { return new Transformation<>(key, transformatingMarshaller, reversingMarshaller); } @Override public void rearrange(final Map<String, Object> mutableMap) throws Exception { final Object value = mutableMap.remove(this.key); if (value == null) { return; } final T marshalled = transformingMarshaller.marshal(value); mutableMap.put(key, marshalled); } @SuppressWarnings("unchecked") @Override public void reverse(final Map<String, Object> mutableMap) throws Exception { final T value = (T) mutableMap.remove(this.key); if (value == null) { return; } final Object unmarshalled = reversingMarshaller.unmarshal(value); mutableMap.put(key, unmarshalled); } }
[ "developer@quantummaid.de" ]
developer@quantummaid.de
73a2b018873534e419fbbadb1bbc1dfc30d5c557
a76e89949e23805f55d477ceecc7f83dc25f3ef9
/DAP/android/sub_app/fermat-dap-android-sub-app-asset-user-community/src/main/java/org/fermat/fermat_dap_android_sub_app_asset_user_community/navigation_drawer/UserCommunityNavigationAdapter.java
36831370a541810eef47435fa139737ca7d410f7
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
darkestpriest/fermat
d7505c9224a8d46aa3dae23c90fbc3423a530916
32f43e2da7033590ceddecf741589ef405378f6c
refs/heads/bounty
2021-01-17T16:25:30.222457
2016-06-29T12:54:52
2016-06-29T12:54:52
52,879,671
1
14
null
2016-08-07T19:01:35
2016-03-01T13:42:58
Java
UTF-8
Java
false
false
3,473
java
package org.fermat.fermat_dap_android_sub_app_asset_user_community.navigation_drawer; import android.content.Context; import android.graphics.Typeface; import android.view.View; import com.bitdubai.fermat_android_api.ui.Views.BadgeDrawable; import com.bitdubai.fermat_android_api.ui.adapters.FermatAdapter; import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.MenuItem; import com.bitdubai.fermat_dap_android_sub_app_asset_user_community_bitdubai.R; import java.util.List; /** * Created by Matias Furszyfer on 2015.09.30.. * Modified by Jose Manuel De Sousa */ public class UserCommunityNavigationAdapter extends FermatAdapter<MenuItem, UserNavigationHolder> { Typeface tf; protected UserCommunityNavigationAdapter(Context context) { super(context); } public UserCommunityNavigationAdapter(Context context, List<MenuItem> dataSet) { super(context, dataSet); tf = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Regular.ttf"); } public void setOnClickListerAcceptButton(View.OnClickListener onClickListener) { } public void setOnClickListerRefuseButton(View.OnClickListener onClickListener) { } /** * Create a new holder instance * * @param itemView View object * @param type int type * @return ViewHolder */ @Override protected UserNavigationHolder createHolder(View itemView, int type) { return new UserNavigationHolder(itemView); } /** * Get custom layout to use it. * * @return int Layout Resource id: Example: R.layout.row_item */ @Override protected int getCardViewResource() { return R.layout.dap_navigation_drawer_community_user_content; } /** * Bind ViewHolder * * @param holder ViewHolder object * @param data Object data to render * @param position position to render */ @Override protected void bindHolder(UserNavigationHolder holder, MenuItem data, int position) { try { holder.getLabel().setText(data.getLabel()); if (data.isSelected()) holder.getRow_container().setBackgroundResource(R.color.black_overlay_2); switch (position) { case 0: holder.getIcon().setImageResource(R.drawable.ic_nav_home_active); break; case 1: holder.getIcon().setImageResource(R.drawable.ic_nav_connections); break; case 2: holder.getIcon().setImageResource(R.drawable.ic_nav_notifications); if (data.getNotifications() != 0) { holder.getBadge().setBackground(new BadgeDrawable.BadgeDrawableBuilder(context) .setCount(data.getNotifications()) .setTextSize(32) .setPosition(BadgeDrawable.Position.CENTER) .build()); } break; case 3: holder.getIcon().setImageResource(R.drawable.ic_nav_connections); break; case 4: holder.getIcon().setImageResource(R.drawable.ic_nav_settings_active); break; } } catch (Exception e) { e.printStackTrace(); } } }
[ "marsvicam@gmail.com" ]
marsvicam@gmail.com
5ec950eb880a846477e329de1cbeaa4155b404df
def05482f0797b3a37d72df6b8ed62d2bbc2c277
/src/main/java/com/epam/courses/jf/se7/deadlock/Operator.java
ead695890b8dd3f6b8bc2c68e15007d29a754870
[]
no_license
Danil9966/core-java-epam-2017-Oct-Nov
7d5849d9a215a55fdbc73d78e19c76185ab74ca9
644f342a34e3c9ade36c05a053b1de4735dd7e24
refs/heads/master
2021-07-23T00:26:14.651541
2017-10-29T12:46:10
2017-10-29T12:46:10
109,187,915
0
0
null
2017-11-02T12:12:22
2017-11-01T21:53:56
Java
UTF-8
Java
false
false
891
java
package com.epam.courses.jf.se7.deadlock; public class Operator extends Thread { private final Account account1; private final Account account2; public Operator(Account account1, Account account2, int number) { super("Operator thread " + number); this.account1 = account1; this.account2 = account2; } @Override public void run() { for (int i = 0; i < 3; i++) { operationDeposit(10); } } private void operationDeposit(int depositSum) { synchronized (account1) { System.out.println("Заблокирован первый счет."); synchronized (account2) { System.out.println("Заблокирован второй счет."); account1.deposit(depositSum); account2.withdraw(depositSum); } } } }
[ "elefus@yandex.ru" ]
elefus@yandex.ru
ebfd23544250c1fba94d6ab39c496cd51fa5f7bb
86654f0ee983cb1afed3bdf74bc5342a514dd60c
/aliyun-java-sdk-scsp/src/main/java/com/aliyuncs/scsp/model/v20200702/TransferCallToSkillGroupRequest.java
5426278e0eccae0e259dd4a7eed2772a61338bae
[ "Apache-2.0" ]
permissive
MyStarrySkies/aliyun-openapi-java-sdk
4d2902ff4dc4108b7dd4ed4af5caf697c45c332a
b2b30626573641cf416075d455b7c1eb0472a063
refs/heads/master
2023-03-17T04:09:21.240731
2021-03-15T07:09:04
2021-03-15T07:09:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,107
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.aliyuncs.scsp.model.v20200702; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.scsp.Endpoint; /** * @author auto create * @version */ public class TransferCallToSkillGroupRequest extends RpcAcsRequest<TransferCallToSkillGroupResponse> { private String clientToken; private String instanceId; private String accountName; private Long skillGroupId; private String callId; private String jobId; private String connectionId; private String holdConnectionId; private Integer type; private Boolean isSingleTransfer; public TransferCallToSkillGroupRequest() { super("scsp", "2020-07-02", "TransferCallToSkillGroup", "scsp"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getClientToken() { return this.clientToken; } public void setClientToken(String clientToken) { this.clientToken = clientToken; if(clientToken != null){ putBodyParameter("ClientToken", clientToken); } } public String getInstanceId() { return this.instanceId; } public void setInstanceId(String instanceId) { this.instanceId = instanceId; if(instanceId != null){ putBodyParameter("InstanceId", instanceId); } } public String getAccountName() { return this.accountName; } public void setAccountName(String accountName) { this.accountName = accountName; if(accountName != null){ putBodyParameter("AccountName", accountName); } } public Long getSkillGroupId() { return this.skillGroupId; } public void setSkillGroupId(Long skillGroupId) { this.skillGroupId = skillGroupId; if(skillGroupId != null){ putBodyParameter("SkillGroupId", skillGroupId.toString()); } } public String getCallId() { return this.callId; } public void setCallId(String callId) { this.callId = callId; if(callId != null){ putBodyParameter("CallId", callId); } } public String getJobId() { return this.jobId; } public void setJobId(String jobId) { this.jobId = jobId; if(jobId != null){ putBodyParameter("JobId", jobId); } } public String getConnectionId() { return this.connectionId; } public void setConnectionId(String connectionId) { this.connectionId = connectionId; if(connectionId != null){ putBodyParameter("ConnectionId", connectionId); } } public String getHoldConnectionId() { return this.holdConnectionId; } public void setHoldConnectionId(String holdConnectionId) { this.holdConnectionId = holdConnectionId; if(holdConnectionId != null){ putBodyParameter("HoldConnectionId", holdConnectionId); } } public Integer getType() { return this.type; } public void setType(Integer type) { this.type = type; if(type != null){ putBodyParameter("Type", type.toString()); } } public Boolean getIsSingleTransfer() { return this.isSingleTransfer; } public void setIsSingleTransfer(Boolean isSingleTransfer) { this.isSingleTransfer = isSingleTransfer; if(isSingleTransfer != null){ putBodyParameter("IsSingleTransfer", isSingleTransfer.toString()); } } @Override public Class<TransferCallToSkillGroupResponse> getResponseClass() { return TransferCallToSkillGroupResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
c929a05404ddb94d2496e8b85e533a800e263c4c
d8ad0d5cf732573a7cf3395ca0a6aa14312c4d1d
/QueryExpress/easeui/src/main/java/com/hyphenate/easeui/utils/EaseUserUtils.java
2346b1eab64612dd6a88c1270242c6abcc7f059c
[]
no_license
fenggeZhang/MyDemo
87ee9a99f1675728117a9f3f5c11e8ed15bf9836
36d496a8f1affce3ea855ea2d7d68df876c733d3
refs/heads/master
2021-01-23T07:55:24.849719
2017-04-09T14:06:08
2017-04-09T14:06:08
86,464,200
2
0
null
null
null
null
UTF-8
Java
false
false
2,342
java
package com.hyphenate.easeui.utils; import android.content.Context; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.hyphenate.easeui.R; import com.hyphenate.easeui.controller.EaseUI; import com.hyphenate.easeui.controller.EaseUI.EaseUserProfileProvider; import com.hyphenate.easeui.domain.EaseUser; public class EaseUserUtils { static EaseUserProfileProvider userProvider; static { userProvider = EaseUI.getInstance().getUserProfileProvider(); } /** * get EaseUser according username * @param username * @return */ public static EaseUser getUserInfo(String username){ if(userProvider != null) return userProvider.getUser(username); return null; } /** * set user avatar * @param username */ public static void setUserAvatar(Context context, String username, ImageView imageView){ EaseUser user = getUserInfo(username); if(user != null && user.getAvatar() != null){ try { int avatarResId = Integer.parseInt(user.getAvatar()); Glide.with(context).load(avatarResId) // .bitmapTransform(new CropCircleTransformation(context)) .into(imageView); } catch (Exception e) { //use default avatar Glide.with(context) .load(user.getAvatar()) .diskCacheStrategy(DiskCacheStrategy.ALL) .placeholder(R.drawable.ease_default_avatar) .into(imageView); } }else{ Glide.with(context).load(R.drawable.ease_default_avatar) // .bitmapTransform(new CropCircleTransformation(context)) .into(imageView); } } /** * set user's nickname */ public static void setUserNick(String username,TextView textView){ if(textView != null){ EaseUser user = getUserInfo(username); if(user != null && user.getNick() != null){ textView.setText(user.getNick()); }else{ textView.setText(username); } } } }
[ "123@163.com" ]
123@163.com
6c62529a66188abf27ad22823e4b155c8d557d1f
0c1715a49c9c6b50e94104b42be0b6bc734ef509
/collector/src/main/java/com/navercorp/pinpoint/collector/config/GrpcSpanReceiverConfiguration.java
86b5f1b6229f275c5b25636b097badef071ad077
[ "DOC", "LicenseRef-scancode-free-unknown", "CC0-1.0", "OFL-1.1", "GPL-1.0-or-later", "CC-PDDC", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference", "MITNFA", "MIT", "CC-BY-4.0", "OFL-1.0" ]
permissive
mzsilak/pinpoint
cdd8459a0ccfdcc76c1c89bce82818144920be43
616b90b7aecad846ff0b2aa95225661c812fa02a
refs/heads/master
2023-03-21T19:12:03.244498
2021-03-16T10:14:55
2021-03-16T10:14:55
289,222,813
0
0
Apache-2.0
2021-03-16T10:14:55
2020-08-21T08:49:27
null
UTF-8
Java
false
false
7,084
java
/* * Copyright 2019 NAVER Corp. * * 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.navercorp.pinpoint.collector.config; import com.navercorp.pinpoint.common.server.config.AnnotationVisitor; import com.navercorp.pinpoint.common.server.config.LoggingEvent; import com.navercorp.pinpoint.common.util.Assert; import com.navercorp.pinpoint.grpc.server.ServerOption; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import javax.annotation.PostConstruct; import java.util.Objects; /** * @author Taejin Koo */ //@ConfigurationProperties(prefix=GRPC_PREFIX) spring-boot public class GrpcSpanReceiverConfiguration { private final Logger logger = LoggerFactory.getLogger(getClass()); private static final String GRPC_PREFIX = "collector.receiver.grpc.span"; @Value("${collector.receiver.grpc.span.enable}") private boolean isGrpcEnable; @Value("${collector.receiver.grpc.span.ip:0.0.0.0}") private String grpcBindIp; @Value("${collector.receiver.grpc.span.port:9993}") private int grpcBindPort; @Value("${collector.receiver.grpc.span.server.executor.thread.size:128}") private int grpcServerExecutorThreadSize; @Value("${collector.receiver.grpc.span.server.executor.queue.size:5120}") private int grpcServerExecutorQueueSize; @Value("${collector.receiver.grpc.span.server.executor.monitor.enable}") private boolean grpcServerExecutorMonitorEnable; @Value("${collector.receiver.grpc.span.worker.executor.thread.size:128}") private int grpcWorkerExecutorThreadSize; @Value("${collector.receiver.grpc.span.worker.executor.queue.size:5120}") private int grpcWorkerExecutorQueueSize; @Value("${collector.receiver.grpc.span.worker.executor.monitor.enable}") private boolean grpcWorkerExecutorMonitorEnable; @Value("${collector.receiver.grpc.span.stream.scheduler.thread.size:1}") private int grpcStreamSchedulerThreadSize; @Value("${collector.receiver.grpc.span.stream.call.init.request.count:1000}") private int grpcStreamCallInitRequestCount; @Value("${collector.receiver.grpc.span.stream.scheduler.period.millis:64}") private int grpcStreamSchedulerPeriodMillis; @Value("${collector.receiver.grpc.span.stream.scheduler.recovery.message.count:10}") private int grpcStreamSchedulerRecoveryMessageCount; private ServerOption grpcServerOption; public GrpcSpanReceiverConfiguration(Environment environment) { this.grpcServerOption = logServerOption(environment); } public static ServerOption logServerOption(Environment environment) { Objects.requireNonNull(environment, "properties"); // Server option final ServerOption.Builder serverOptionBuilder = GrpcPropertiesServerOptionBuilder.newBuilder(environment, GRPC_PREFIX); return serverOptionBuilder.build(); } @PostConstruct public void validate() { logger.info("{}", this); AnnotationVisitor<Value> visitor = new AnnotationVisitor<>(Value.class); visitor.visit(this, new LoggingEvent(logger)); // Server executor Assert.isTrue(grpcServerExecutorThreadSize > 0, "grpcServerExecutorThreadSize must be greater than 0"); Assert.isTrue(grpcServerExecutorQueueSize > 0, "grpcServerExecutorQueueSize must be greater than 0"); // Work executor Assert.isTrue(grpcWorkerExecutorThreadSize > 0, "grpcWorkerExecutorThreadSize must be greater than 0"); Assert.isTrue(grpcWorkerExecutorQueueSize > 0, "grpcWorkerExecutorQueueSize must be greater than 0"); Assert.isTrue(grpcStreamSchedulerThreadSize > 0, "grpcStreamSchedulerThreadSize must be greater than 0"); } public boolean isGrpcEnable() { return isGrpcEnable; } public String getGrpcBindIp() { return grpcBindIp; } public int getGrpcBindPort() { return grpcBindPort; } public int getGrpcServerExecutorThreadSize() { return grpcServerExecutorThreadSize; } public int getGrpcServerExecutorQueueSize() { return grpcServerExecutorQueueSize; } public boolean isGrpcServerExecutorMonitorEnable() { return grpcServerExecutorMonitorEnable; } public int getGrpcWorkerExecutorThreadSize() { return grpcWorkerExecutorThreadSize; } public int getGrpcWorkerExecutorQueueSize() { return grpcWorkerExecutorQueueSize; } public boolean isGrpcWorkerExecutorMonitorEnable() { return grpcWorkerExecutorMonitorEnable; } public int getGrpcStreamSchedulerThreadSize() { return grpcStreamSchedulerThreadSize; } public int getGrpcStreamCallInitRequestCount() { return grpcStreamCallInitRequestCount; } public int getGrpcStreamSchedulerPeriodMillis() { return grpcStreamSchedulerPeriodMillis; } public int getGrpcStreamSchedulerRecoveryMessageCount() { return grpcStreamSchedulerRecoveryMessageCount; } public ServerOption getGrpcServerOption() { return grpcServerOption; } @Override public String toString() { final StringBuilder sb = new StringBuilder("GrpcSpanReceiverConfiguration{"); sb.append("isGrpcEnable=").append(isGrpcEnable); sb.append(", grpcBindIp='").append(grpcBindIp).append('\''); sb.append(", grpcBindPort=").append(grpcBindPort); sb.append(", grpcServerExecutorThreadSize=").append(grpcServerExecutorThreadSize); sb.append(", grpcServerExecutorQueueSize=").append(grpcServerExecutorQueueSize); sb.append(", grpcServerExecutorMonitorEnable=").append(grpcServerExecutorMonitorEnable); sb.append(", grpcWorkerExecutorThreadSize=").append(grpcWorkerExecutorThreadSize); sb.append(", grpcWorkerExecutorQueueSize=").append(grpcWorkerExecutorQueueSize); sb.append(", grpcWorkerExecutorMonitorEnable=").append(grpcWorkerExecutorMonitorEnable); sb.append(", grpcStreamSchedulerThreadSize=").append(grpcStreamSchedulerThreadSize); sb.append(", grpcStreamCallInitRequestCount=").append(grpcStreamCallInitRequestCount); sb.append(", grpcStreamSchedulerPeriodMillis=").append(grpcStreamSchedulerPeriodMillis); sb.append(", grpcStreamSchedulerRecoveryMessageCount=").append(grpcStreamSchedulerRecoveryMessageCount); sb.append(", grpcServerOption=").append(grpcServerOption); sb.append('}'); return sb.toString(); } }
[ "wd.kang@navercorp.com" ]
wd.kang@navercorp.com
60d22b2df3daa20b52766d35c01d5c68b7feac6c
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/python/src/com/jetbrains/python/debugger/remote/vfs/PyRemoteDebugVirtualFS.java
d5627b1e11b90fe768f6b2a89a0e454cd40e1563
[ "Apache-2.0" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Java
false
false
3,944
java
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.debugger.remote.vfs; import com.google.common.collect.Maps; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.VirtualFileListener; import com.intellij.openapi.vfs.VirtualFileSystem; import com.intellij.util.IncorrectOperationException; import com.jetbrains.python.debugger.PyDebugProcess; import com.jetbrains.python.debugger.PyLocalPositionConverter; import com.jetbrains.python.remote.PyRemotePathMapper; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.io.IOException; import java.util.Map; public class PyRemoteDebugVirtualFS extends VirtualFileSystem { @NonNls private static final String PROTOCOL = "remoteDebugVfs"; private final PyRemotePathMapper myPathMapper; private final PyDebugProcess myDebugProcess; private final PyRemotePositionConverter myRemotePositionConverter; private final Map<String, PyRemoteDebugVirtualFile> myFileCache = Maps.newHashMap(); public PyRemoteDebugVirtualFS(PyDebugProcess debugProcess, PyRemotePathMapper pathMapper, PyRemotePositionConverter remotePositionConverter) { myDebugProcess = debugProcess; myRemotePositionConverter = remotePositionConverter; myPathMapper = pathMapper; } @NotNull @Override public String getProtocol() { return PROTOCOL; } @Override public VirtualFile findFileByPath(@NotNull @NonNls String path) { String localPath = myPathMapper.convertToLocal(path); VirtualFile file = LocalFileSystem.getInstance().findFileByPath(localPath); if (file == null) { file = PyLocalPositionConverter.findEggEntry(LocalFileSystem.getInstance(), localPath); } if (file == null) { if (!myFileCache.containsKey(path)) { PyRemoteDebugVirtualFile vFile = new PyRemoteDebugVirtualFile(this, path, myPathMapper); myFileCache.put(path, vFile); } file = myFileCache.get(path); } return file; } public PyRemotePositionConverter getRemotePositionConverter() { return myRemotePositionConverter; } public PyDebugProcess getDebugProcess() { return myDebugProcess; } @Override public void refresh(boolean asynchronous) { } @Override public VirtualFile refreshAndFindFileByPath(@NotNull String path) { return null; } @Override public void addVirtualFileListener(@NotNull VirtualFileListener listener) { } @Override public void removeVirtualFileListener(@NotNull VirtualFileListener listener) { } @Override protected void deleteFile(Object requestor, @NotNull VirtualFile vFile) throws IOException { } @Override protected void moveFile(Object requestor, @NotNull VirtualFile vFile, @NotNull VirtualFile newParent) throws IOException { } @Override protected void renameFile(Object requestor, @NotNull VirtualFile vFile, @NotNull String newName) throws IOException { } @NotNull @Override protected VirtualFile createChildFile(Object requestor, @NotNull VirtualFile vDir, @NotNull String fileName) throws IOException { throw new IncorrectOperationException(); } @NotNull @Override protected VirtualFile createChildDirectory(Object requestor, @NotNull VirtualFile vDir, @NotNull String dirName) throws IOException { throw new IncorrectOperationException(); } @NotNull @Override protected VirtualFile copyFile(Object requestor, @NotNull VirtualFile virtualFile, @NotNull VirtualFile newParent, @NotNull String copyName) throws IOException { return virtualFile; } @Override public boolean isReadOnly() { return true; } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
5cedce5334c7d2a6e6f74c3651ade86183d84e4b
e2b768c14ac30d1412430f25b3d0b6871848e52e
/SinaStorageSDK/scs-java-sdk-core/src/main/java/com/sina/cloudstorage/auth/SystemPropertiesCredentialsProvider.java
490af2f017eeb720369a57e23f18afac22385456
[]
no_license
SinaCloudStorage/SinaStorage-SDK-Android
3de2d343143dabd2580bb392f9204ba9dd8650b1
59ad1098733fc42d5c189ca96ec41d33a055b2b7
refs/heads/master
2020-06-02T04:05:53.868306
2015-05-14T07:14:33
2015-05-14T07:14:33
24,451,274
7
4
null
null
null
null
UTF-8
Java
false
false
1,847
java
/* * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.sina.cloudstorage.auth; import static com.sina.cloudstorage.SDKGlobalConfiguration.ACCESS_KEY_SYSTEM_PROPERTY; import static com.sina.cloudstorage.SDKGlobalConfiguration.SECRET_KEY_SYSTEM_PROPERTY; import com.sina.cloudstorage.SCSClientException; /** * {@link AWSCredentialsProvider} implementation that provides credentials by * looking at the <code>aws.accessKeyId</code> and <code>aws.secretKey</code> * Java system properties. */ public class SystemPropertiesCredentialsProvider implements AWSCredentialsProvider { public AWSCredentials getCredentials() { if (System.getProperty(ACCESS_KEY_SYSTEM_PROPERTY) != null && System.getProperty(SECRET_KEY_SYSTEM_PROPERTY) != null) { return new BasicAWSCredentials( System.getProperty(ACCESS_KEY_SYSTEM_PROPERTY), System.getProperty(SECRET_KEY_SYSTEM_PROPERTY)); } throw new SCSClientException( "Unable to load AWS credentials from Java system properties " + "(" + ACCESS_KEY_SYSTEM_PROPERTY + " and " + SECRET_KEY_SYSTEM_PROPERTY + ")"); } public void refresh() {} @Override public String toString() { return getClass().getSimpleName(); } }
[ "poorevil@gmail.com" ]
poorevil@gmail.com
65c7f6086a4484ef0fb46146500952f922c9a9d7
7219f75733d906ff930e1b6ba1be249d6007b582
/src/com/vikings/sanguo/message/GameEnterReq.java
578a52ae215b0398445dc4b1224061b433f1eab9
[]
no_license
wongainia/sanguo
9c9b528a3b4cfaf58f94badf71add1b8bb77e038
55e38be665f1b9e3a4dc7a1caaa09728563cf4b2
refs/heads/master
2020-05-23T09:51:26.455001
2019-05-14T22:44:06
2019-05-14T22:44:06
186,711,060
0
1
null
null
null
null
UTF-8
Java
false
false
659
java
package com.vikings.sanguo.message; import java.io.OutputStream; import com.vikings.sanguo.config.Config; import com.vikings.sanguo.protos.MsgGameEnterReq; public class GameEnterReq extends BaseReq { private MsgGameEnterReq req; public GameEnterReq(int clientType, int clientVer) { req = new MsgGameEnterReq().setClientType(clientType).setClientVer( clientVer); if (Config.getChannel() > 0) req.setChannelId(Config.getChannel()); } @Override public short cmd() { return (short) com.vikings.sanguo.protos.CMD.MSG_REQ_GAME_ENTER .getNumber(); } @Override protected void toBytes(OutputStream out) { writeProbuf(req, out); } }
[ "dengyuanming@dengyuanming" ]
dengyuanming@dengyuanming
802d2004f505680d297f067196e0c338b4b4167e
0e3f1ace4ca773d2190f44bacc7f718d4c4a10ca
/PlantCell Core/src/au/edu/unimelb/plantcell/core/cells/SummarySequenceRenderer.java
08206458286712a1b990cb216888e15efd5fa9b9
[]
no_license
BioKNIME/plantcell
35cf74347e4447668f17e359c2e0574f99bb6a9d
c02c7d9cbc86ee26db86047dbb46dee1e2aae20e
refs/heads/master
2021-01-19T14:28:37.099349
2014-09-03T05:25:16
2014-09-03T05:25:16
88,166,799
0
0
null
null
null
null
UTF-8
Java
false
false
1,997
java
package au.edu.unimelb.plantcell.core.cells; import org.knime.core.data.renderer.DataValueRenderer; import org.knime.core.data.renderer.MultiLineStringValueRenderer; public class SummarySequenceRenderer extends MultiLineStringValueRenderer { private static final String DESCR = "Summary"; public SummarySequenceRenderer(String description) { super(description); } /** * for serialisation */ private static final long serialVersionUID = -1356987884400232879L; /** * used by the {@link SequenceUtilityFactory} to render {@link SequenceValue}'s */ public static final DataValueRenderer INSTANCE = new SummarySequenceRenderer(DESCR); @Override public String getDescription() { return DESCR; } @Override public void setValue(Object o) { if (o instanceof SequenceValue) { StringBuilder sb = new StringBuilder(1024); SequenceValue sv = (SequenceValue) o; String descr = sv.getDescription(); if (descr != null) { sb.append(sv.getID()+": "+descr); } else { sb.append(sv.getID()); } sb.append('\n'); sb.append("Length: "+sv.getStringValue().length()); sb.append(' '); sb.append(sv.getSequenceType().name()); sb.append('\n'); int track_cnt = sv.countTracks(); sb.append("Tracks: "+track_cnt); StringBuilder sb_tracks = new StringBuilder(1024); StringBuilder sb_annot = new StringBuilder(1024); sb.append('\n'); if (track_cnt > 0) { sb.append("Totals by track: "); for (Track t : sv.getTracks()) { sb_tracks.append(t.getName()); sb_tracks.append(" ("); sb_tracks.append(t.countAnnotations()); sb_tracks.append(") "); if (t.countAnnotations() > 0) { sb_annot.append(t.toString()); sb_annot.append('\n'); } } sb.append(sb_tracks.toString()); sb.append('\n'); } sb.append(sb_annot.toString()); super.setValue(sb.toString()); } else { super.setValue(""); } } }
[ "pcbrc-enquiries@unimelb.edu.au@dddfb942-a9a2-2c26-f143-85623fb4cac2" ]
pcbrc-enquiries@unimelb.edu.au@dddfb942-a9a2-2c26-f143-85623fb4cac2
550a0ba920622c81d3f5639f732d14855960479f
0e1856be304acc143aeb41dfdae5945915d6d749
/src/java/hr/fer/zemris/jcms/web/actions/MPGroupsAdmin.java
26467fca26e4c702d83a502627d039df1e2e2cb6
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
KarloKnezevic/Ferko
8395c67309b586bb66db7a3eeb92da08683ed709
21308e9939d5d3379c16893167f7deb91bcf6627
refs/heads/master
2021-01-23T03:59:21.073071
2014-01-03T15:54:08
2014-01-03T15:54:08
15,610,583
5
0
null
null
null
null
UTF-8
Java
false
false
2,702
java
package hr.fer.zemris.jcms.web.actions; import hr.fer.zemris.jcms.beans.ext.MarketPlaceBean; import hr.fer.zemris.jcms.service.BasicBrowsing; import hr.fer.zemris.jcms.web.actions.data.MPGroupsAdminData; import hr.fer.zemris.jcms.web.actions.data.support.AbstractActionData; import hr.fer.zemris.jcms.web.actions.data.support.MessageLoggerFactory; @Deprecated public class MPGroupsAdmin extends ExtendedActionSupport { private static final long serialVersionUID = 2L; private String courseInstanceID; private Long parentID; private MarketPlaceBean bean = new MarketPlaceBean(); private MPGroupsAdminData data = null; public String execute() throws Exception { return input(); } public String input() throws Exception { // Ako korisnik nije logiran - van! String check = checkUser(null, true); if(check != null) return check; // Stvori objekt koji ce napuniti SVIM potrebnim podacima iz baze za ovu akciju data = new MPGroupsAdminData(MessageLoggerFactory.createMessageLogger(this, true)); // Pozovi sloj usluge koji će napuniti navedenu strukturu... BasicBrowsing.getMPGroupsAdminData(data, getCurrentUser().getUserID(), getCourseInstanceID(), getParentID(), getBean(), "input"); if(data.getResult().equals(AbstractActionData.RESULT_FATAL)) { return SHOW_FATAL_MESSAGE; } return INPUT; } public String update() throws Exception { // Ako korisnik nije logiran - van! String check = checkUser(null, true); if(check != null) return check; // Stvori objekt koji ce napuniti SVIM potrebnim podacima iz baze za ovu akciju data = new MPGroupsAdminData(MessageLoggerFactory.createMessageLogger(this, true)); // Pozovi sloj usluge koji će napuniti navedenu strukturu... BasicBrowsing.getMPGroupsAdminData(data, getCurrentUser().getUserID(), getCourseInstanceID(), getParentID(), getBean(), "update"); if(data.getResult().equals(AbstractActionData.RESULT_FATAL)) { return SHOW_FATAL_MESSAGE; } if(data.getResult().equals(AbstractActionData.RESULT_INPUT)) { return INPUT; } return SUCCESS; } public String getCourseInstanceID() { return courseInstanceID; } public void setCourseInstanceID(String courseInstanceID) { this.courseInstanceID = courseInstanceID; } public MPGroupsAdminData getData() { return data; } public void setData(MPGroupsAdminData data) { this.data = data; } public Long getParentID() { return parentID; } public void setParentID(Long parentID) { this.parentID = parentID; } public MarketPlaceBean getBean() { return bean; } public void setBean(MarketPlaceBean bean) { this.bean = bean; } }
[ "knezevic.karlo1@gmail.com" ]
knezevic.karlo1@gmail.com
46a8901f4e194c9ba5f6e873726f4c33ab8ba03d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_b673d1018464d25c4b03b97dc90bec710eda6226/FlyingEnemy/28_b673d1018464d25c4b03b97dc90bec710eda6226_FlyingEnemy_s.java
e4b06d7e08983a3e7d7dcd757195b6376c5a2196
[]
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,093
java
package com.me.ampdom; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.physics.box2d.Body; import com.badlogic.gdx.physics.box2d.BodyDef; import com.badlogic.gdx.physics.box2d.FixtureDef; import com.badlogic.gdx.physics.box2d.PolygonShape; import com.badlogic.gdx.physics.box2d.World; public class FlyingEnemy extends Character { float speedX = 2.0f; float speedY = 1.0f; int count=0; float spawnX; float spawnY; float spawnX0; float spawnY0; Body directPos; float patX,patY; boolean directMove = false; public FlyingEnemy(World world, String path, float x, float y,int sizeW,int sizeH) { super(world, x, y); BodyDef entityDef = new BodyDef(); entity = world.createBody(entityDef); entityDef.type = BodyDef.BodyType.DynamicBody; entityDef.position.set(x, y); /** * Load up the overall texture and chop it in to pieces. In this case,* piece.*/ texture = new Texture(Gdx.files.internal(path)); texture.setFilter(TextureFilter.Linear, TextureFilter.Linear); sprite = new Sprite(texture, 0, 0, sizeW, sizeH); rect = new Rectangle(x,y,texture.getWidth(),texture.getHeight()); /** * Boxes are defined by their "half width" and "half height", hence the * 2 multiplier. */ PolygonShape shape = new PolygonShape(); shape.setAsBox(sprite.getWidth() / (2 * PIXELS_PER_METER), sprite.getHeight() / (2 * PIXELS_PER_METER)); entity.setFixedRotation(true); fixtureDef = new FixtureDef(); fixtureDef.shape = shape; fixtureDef.density = 1.0f; //FixtureDef.friction = 5.0f; fixtureDef.restitution = 0.0f; fixtureDef.isSensor = true; entity = world.createBody(entityDef); entity.createFixture(fixtureDef); spawnX = entity.getPosition().x; spawnY = entity.getPosition().y; spawnX0 = spawnX; spawnY0 = spawnY; entity.setUserData("ENEMY"); shape.dispose(); facingRight = false; } public FlyingEnemy getFlyingEnemy() { return this; } @Override public void move() { if(directMove == false) { if(entity.getPosition().x<(spawnX-3.0f)) { speedX = 2.0f; //facingRight = true; } else if (entity.getPosition().x>(spawnX+3.0f)) { speedX = -2.0f; //facingRight = false; } if(entity.getPosition().y<(spawnY-1.5f)) speedY = 1.0f; if(entity.getPosition().y>(spawnY+1.5f)) speedY = -1.0f; entity.setLinearVelocity(speedX, speedY); //if (facingRight) { //sprite.flip(true, false); //facingRight = true; //} //else {//(facingRight == true) { //sprite.flip(true, false); //facingRight = false; //} } else { if(entity.getPosition().x<(spawnX)) { speedX = 2.0f; //facingRight = true; } else if (entity.getPosition().x>(spawnX)) { speedX = -2.0f; //facingRight = false; } if(entity.getPosition().y<(spawnY)) speedY = 1.0f; if(entity.getPosition().y>(spawnY)) speedY = -1.0f; entity.setLinearVelocity(1.6f*speedX, 1.8f*speedY); } } @Override public void attack() { // TODO Auto-generated method stub } @Override public void speak() { // TODO Auto-generated method stub } public void die() { sprite.setScale(0, 0); entity.setActive(false); } public void batchRender(TiledMapHelper tiledMapHelper) { batch.setProjectionMatrix(tiledMapHelper.getCamera().combined); batch.begin(); sprite.setPosition(PIXELS_PER_METER * entity.getPosition().x- sprite.getWidth() / 2, PIXELS_PER_METER * entity.getPosition().y - sprite.getHeight() / 2); sprite.draw(batch); batch.end(); } @Override public void reset(float x, float y) { entityDef.position.set(x, y); // TODO Auto-generated method stub } @Override public void reset() { // TODO Auto-generated method stub } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8b84a91bc9599b62dbaaf7237c63ae856bc655dc
c606b6395c88dfbbd3a2973ba6008515f1bf13d9
/Cy_3/src/org/apache/commons/math3/ode/sampling/StepNormalizer.java
17cf391d95a4085cdc186c490b0565d60e6060c0
[]
no_license
OliverKramer02/Cy_3
1dfcc9d16ce54a491d9ec2133e3789d4754b6561
7458d36ce13b716f9d104dd7b2f7f05c8c4fd539
refs/heads/master
2020-05-17T07:57:48.802053
2014-09-12T21:42:52
2014-09-12T21:42:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,918
java
/* 1: */ package org.apache.commons.math3.ode.sampling; /* 2: */ /* 3: */ import org.apache.commons.math3.util.FastMath; /* 4: */ import org.apache.commons.math3.util.Precision; /* 5: */ /* 6: */ public class StepNormalizer /* 7: */ implements StepHandler /* 8: */ { /* 9: */ private double h; /* 10: */ private final FixedStepHandler handler; /* 11: */ private double firstTime; /* 12: */ private double lastTime; /* 13: */ private double[] lastState; /* 14: */ private double[] lastDerivatives; /* 15: */ private boolean forward; /* 16: */ private final StepNormalizerBounds bounds; /* 17: */ private final StepNormalizerMode mode; /* 18: */ /* 19: */ public StepNormalizer(double h, FixedStepHandler handler) /* 20: */ { /* 21:126 */ this(h, handler, StepNormalizerMode.INCREMENT, StepNormalizerBounds.FIRST); /* 22: */ } /* 23: */ /* 24: */ public StepNormalizer(double h, FixedStepHandler handler, StepNormalizerMode mode) /* 25: */ { /* 26:139 */ this(h, handler, mode, StepNormalizerBounds.FIRST); /* 27: */ } /* 28: */ /* 29: */ public StepNormalizer(double h, FixedStepHandler handler, StepNormalizerBounds bounds) /* 30: */ { /* 31:151 */ this(h, handler, StepNormalizerMode.INCREMENT, bounds); /* 32: */ } /* 33: */ /* 34: */ public StepNormalizer(double h, FixedStepHandler handler, StepNormalizerMode mode, StepNormalizerBounds bounds) /* 35: */ { /* 36:164 */ this.h = FastMath.abs(h); /* 37:165 */ this.handler = handler; /* 38:166 */ this.mode = mode; /* 39:167 */ this.bounds = bounds; /* 40:168 */ this.firstTime = (0.0D / 0.0D); /* 41:169 */ this.lastTime = (0.0D / 0.0D); /* 42:170 */ this.lastState = null; /* 43:171 */ this.lastDerivatives = null; /* 44:172 */ this.forward = true; /* 45: */ } /* 46: */ /* 47: */ public void init(double t0, double[] y0, double t) /* 48: */ { /* 49:178 */ this.firstTime = (0.0D / 0.0D); /* 50:179 */ this.lastTime = (0.0D / 0.0D); /* 51:180 */ this.lastState = null; /* 52:181 */ this.lastDerivatives = null; /* 53:182 */ this.forward = true; /* 54: */ /* 55: */ /* 56:185 */ this.handler.init(t0, y0, t); /* 57: */ } /* 58: */ /* 59: */ public void handleStep(StepInterpolator interpolator, boolean isLast) /* 60: */ { /* 61:202 */ if (this.lastState == null) /* 62: */ { /* 63:203 */ this.firstTime = interpolator.getPreviousTime(); /* 64:204 */ this.lastTime = interpolator.getPreviousTime(); /* 65:205 */ interpolator.setInterpolatedTime(this.lastTime); /* 66:206 */ this.lastState = ((double[])interpolator.getInterpolatedState().clone()); /* 67:207 */ this.lastDerivatives = ((double[])interpolator.getInterpolatedDerivatives().clone()); /* 68: */ /* 69: */ /* 70:210 */ this.forward = (interpolator.getCurrentTime() >= this.lastTime); /* 71:211 */ if (!this.forward) { /* 72:212 */ this.h = (-this.h); /* 73: */ } /* 74: */ } /* 75:217 */ double nextTime = this.mode == StepNormalizerMode.INCREMENT ? this.lastTime + this.h : (FastMath.floor(this.lastTime / this.h) + 1.0D) * this.h; /* 76:220 */ if ((this.mode == StepNormalizerMode.MULTIPLES) && (Precision.equals(nextTime, this.lastTime, 1))) { /* 77:222 */ nextTime += this.h; /* 78: */ } /* 79:226 */ boolean nextInStep = isNextInStep(nextTime, interpolator); /* 80:227 */ while (nextInStep) /* 81: */ { /* 82:229 */ doNormalizedStep(false); /* 83: */ /* 84: */ /* 85:232 */ storeStep(interpolator, nextTime); /* 86: */ /* 87: */ /* 88:235 */ nextTime += this.h; /* 89:236 */ nextInStep = isNextInStep(nextTime, interpolator); /* 90: */ } /* 91:239 */ if (isLast) /* 92: */ { /* 93:243 */ boolean addLast = (this.bounds.lastIncluded()) && (this.lastTime != interpolator.getCurrentTime()); /* 94: */ /* 95:245 */ doNormalizedStep(!addLast); /* 96:246 */ if (addLast) /* 97: */ { /* 98:247 */ storeStep(interpolator, interpolator.getCurrentTime()); /* 99:248 */ doNormalizedStep(true); /* 100: */ } /* 101: */ } /* 102: */ } /* 103: */ /* 104: */ private boolean isNextInStep(double nextTime, StepInterpolator interpolator) /* 105: */ { /* 106:264 */ return nextTime <= interpolator.getCurrentTime(); /* 107: */ } /* 108: */ /* 109: */ private void doNormalizedStep(boolean isLast) /* 110: */ { /* 111:274 */ if ((!this.bounds.firstIncluded()) && (this.firstTime == this.lastTime)) { /* 112:275 */ return; /* 113: */ } /* 114:277 */ this.handler.handleStep(this.lastTime, this.lastState, this.lastDerivatives, isLast); /* 115: */ } /* 116: */ /* 117: */ private void storeStep(StepInterpolator interpolator, double t) /* 118: */ { /* 119:287 */ this.lastTime = t; /* 120:288 */ interpolator.setInterpolatedTime(this.lastTime); /* 121:289 */ System.arraycopy(interpolator.getInterpolatedState(), 0, this.lastState, 0, this.lastState.length); /* 122: */ /* 123:291 */ System.arraycopy(interpolator.getInterpolatedDerivatives(), 0, this.lastDerivatives, 0, this.lastDerivatives.length); /* 124: */ } /* 125: */ } /* Location: C:\Users\Olli\Desktop\NetworkPrioritizer-1.01.jar * Qualified Name: org.apache.commons.math3.ode.sampling.StepNormalizer * JD-Core Version: 0.7.0.1 */
[ "ok082355@uni-greifswald.de" ]
ok082355@uni-greifswald.de
d614af444abfe61488d4d3d9863d2138d8a3466b
0c11613c21ebe12f48d6cebb6339887e10e72219
/rmidemo/src/main/java/com/ggd543/rmi/test/Setup.java
aa69e9e6807203df0bded10c656d843148ca1675
[]
no_license
mustang2247/demo
a3347a2994448086814383c67757f659208368cd
35598ed0a3900afc759420b7100a7d310db2597d
refs/heads/master
2021-05-09T17:28:22.631386
2014-06-10T12:03:26
2014-06-10T12:03:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,871
java
package com.ggd543.rmi.test; import com.ggd543.rmi.HelloService; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.io.IOException; import java.net.URL; import java.rmi.MarshalledObject; import java.rmi.RemoteException; import java.rmi.activation.*; import java.util.Properties; /** * Created by IntelliJ IDEA. * User: Administrator * Date: 11-9-12 * Time: 下午10:18 * To change this template use File | Settings | File Templates. */ public class Setup { public static void main(String[] args) throws ActivationException, IOException, NamingException { URL serverPolicyUrl = Setup.class.getResource("/server.policy"); System.out.println("The path of server.policy: "+serverPolicyUrl); Properties prop = new Properties(); prop.put("java.security.policy",serverPolicyUrl.toString()); //创建激活组描述符ActivationGroupDesc对象 ActivationGroupDesc groupDesc = new ActivationGroupDesc(prop,null); //注册ActivationGroup ActivationGroupID groupId = ActivationGroup.getSystem().registerGroup(groupDesc); String classURL = System.getProperty("java.rmi.server.codebase"); MarshalledObject param = new MarshalledObject("HelloService"); //创建激活对象描述符ActivationDesc对象 ActivationDesc desc = new ActivationDesc(groupId, "com.ggd543.rmi.impl.HelloServiceImpl", classURL, param); //向rmid注册激活对象 HelloService hs = (HelloService) Activatable.register(desc); System.out.println(hs.getClass().getName()); Context context = new InitialContext(); //向rmiregistry注册两个激活对象 context.rebind("rmi:HelloService",hs); System.out.println("服务器注册了一个可激活的HelloService对象"); } }
[ "ggd543@gmail.com" ]
ggd543@gmail.com
20f05740b0a98646c3ee980afb716c3f21e5dc65
ad660ae2037e48ebd827e3564550bc051fe81ca8
/apple-web/src/main/java/com/appleframework/web/ApiParam.java
d685ae2fd5dd471e5f19aecf39e312eb8f905276
[ "Apache-2.0" ]
permissive
wangscript007/appleframework
931f35e1ba7c9747c80094e9066161c06ab3ba08
65c035b4ab1805417f5eed88258d9d82ba6f29a8
refs/heads/master
2023-05-05T05:34:57.798574
2021-01-20T09:35:40
2021-01-20T09:35:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,099
java
package com.appleframework.web; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; import com.alibaba.fastjson.JSONObject; import com.appleframework.web.bean.Consts; /** * 客户端传来的参数放在这里. * * @author tanghc * */ public class ApiParam extends JSONObject implements Param { private static final long serialVersionUID = 6718200590738465201L; public ApiParam(Map<String, Object> map) { super(map); } private boolean ignoreSign; private boolean ignoreValidate; private String restName; private String restVersion; private boolean standardMode; /** * 获取sign,并从param中删除 * @return 返回sign内容 */ public String fatchSignAndRemove() { String sign = this.fatchSign(); this.remove(ParamNames.SIGN_NAME); return sign; } public HttpServletRequest fatchRequest() { return ApiContext.getRequest(); } /** * 是否忽略验证签名 * @return 返回true,忽略签名 */ public boolean fatchIgnoreSign() { return ignoreSign; } public void setIgnoreSign(boolean ignoreSign) { this.ignoreSign = ignoreSign; } public boolean fatchIgnoreValidate() { return ignoreValidate; } public void setIgnoreValidate(boolean ignoreValidate) { this.ignoreValidate = ignoreValidate; } /** * 接口名,如:goods.list */ @Override public String fatchName() { String name = getString(ParamNames.API_NAME); if(name == null) { name = this.restName; } return name; } public void setName(String name) { this.restName = name; } public String fatchNameVersion() { return buildNameVersion(this.fatchName(), this.fatchVersion()); } public static String buildNameVersion(String name,String version) { if (StringUtils.isEmpty(version)) { return name; } else { return name + version; } } /** * 版本号 */ @Override public String fatchVersion() { String version = getString(ParamNames.VERSION_NAME); if(version == null) { version = this.restVersion; } return version; } public void setVersion(String version) { this.restVersion = version; } public boolean isStandardMode() { return standardMode; } public void setStandardMode(boolean standardMode) { this.standardMode = standardMode; } /** * 接入应用ID */ @Override public String fatchAppKey() { return getString(ParamNames.APP_KEY_NAME); } public void setAppKey(String appKey) { put(ParamNames.APP_KEY_NAME, appKey); } /** * 参数,urlencode后的 */ @Override public String fatchData() { return getString(ParamNames.DATA_NAME); } public void setData(String json) { put(ParamNames.DATA_NAME, json); } /** * 时间戳,格式为yyyy-MM-dd HH:mm:ss,例如:2015-01-01 12:00:00 */ @Override public String fatchTimestamp() { return getString(ParamNames.TIMESTAMP_NAME); } public void setTimestamp(String timestamp) { put(ParamNames.TIMESTAMP_NAME, timestamp); } /** * 签名串 */ @Override public String fatchSign() { return getString(ParamNames.SIGN_NAME); } public void setSign(String sign) { put(ParamNames.SIGN_NAME, sign); } @Override public String fatchFormat() { String format = getString(ParamNames.FORMAT_NAME); if (format == null || "".equals(format)) { return Consts.FORMAT_JSON; } return format; } public void setFormat(String format) { put(ParamNames.FORMAT_NAME, format); } @Override public String fatchAccessToken() { return getString(ParamNames.ACCESS_TOKEN_NAME); } @Override public String fatchSignMethod() { String signMethod = getString(ParamNames.SIGN_METHOD_NAME); if(signMethod == null) { return Consts.DEFAULT_SIGN_METHOD; }else{ return signMethod; } } @Override public ApiParam clone() { ApiParam param = new ApiParam(this); param.ignoreSign = this.ignoreSign; param.ignoreValidate = this.ignoreValidate; return param; } /** * 获取系统参数 */ @Override public String fatchSystemParam(String paramName) { return getString(paramName); } public void setSystemParam(String paramName, String paramValue) { put(paramName, paramValue); } /** * 调用链ID */ @Override public String fatchTraceId() { return getString(ParamNames.TRACE_ID); } public void setTraceId(String traceId) { put(ParamNames.TRACE_ID, traceId); } }
[ "xushaomin@foxmail.com" ]
xushaomin@foxmail.com
1b34a98685fdc1404eb7440d99388ca4039276a5
3a5985651d77a31437cfdac25e594087c27e93d6
/ojc-core/component-common/wsdl4jext/src/com/sun/wsdl4j/ext/WSDLElementEx.java
f5f3b126f85f1348bf6441e6089441a471c97dbf
[]
no_license
vitalif/openesb-components
a37d62133d81edb3fdc091abd5c1d72dbe2fc736
560910d2a1fdf31879e3d76825edf079f76812c7
refs/heads/master
2023-09-04T14:40:55.665415
2016-01-25T13:12:22
2016-01-25T13:12:33
48,222,841
0
5
null
null
null
null
UTF-8
Java
false
false
1,651
java
/* * BEGIN_HEADER - DO NOT EDIT * * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the "License"). You may not use this file except * in compliance with the License. * * You can obtain a copy of the license at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * HEADER in each file and include the License file at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * If applicable add the following below this CDDL HEADER, * with the fields enclosed by brackets "[]" replaced with * your own identifying information: Portions Copyright * [year] [name of copyright owner] */ /* * @(#)WSDLElementEx.java * * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. * * END_HEADER - DO NOT EDIT */ package com.sun.wsdl4j.ext; import javax.wsdl.Definition; import javax.wsdl.WSDLElement; /** * Extends WSDLElement to be able to get the WSDL definition it belongs to. * * @author Jun Xu * @version $Revision: 1.2 $ */ public interface WSDLElementEx extends WSDLElement { /** * Gets the WSDL definition this element belongs to. * * @return The WSDL definition. */ public Definition getContainingDefinition(); /** * Sets the WSDL definition this element belongs to. * * @param definition the WSDL definition this element belongs to */ public void setContainingDefinition(Definition definition); }
[ "bitbucket@bitbucket02.private.bitbucket.org" ]
bitbucket@bitbucket02.private.bitbucket.org
a2b981b6802e7eb0ebc2c185268f7c2b49c2b9d4
f87b023f7437d65ed29eae1f2b1a00ddfd820177
/bitcamp-java-basic/src/step22_FileIO/ex3_DataIO/Exam04_2.java
9055892463c1cf917b2e0b706735a0e6c2b4b9f4
[]
no_license
GreedHJC/BitCamp
c0d01fc0713744e01832fabf06d2663577fde6e5
028894ab5171ef1fd89de73c3654e11cbc927a25
refs/heads/master
2021-01-24T10:28:07.820330
2018-06-04T07:51:58
2018-06-04T07:51:58
123,054,159
0
0
null
null
null
null
UTF-8
Java
false
false
1,055
java
// 데이터 읽기 - String 값 읽기 package step22_FileIO.ex3_DataIO; import java.io.FileInputStream; public class Exam04_2 { public static void main(String[] args) throws Exception { FileInputStream in = new FileInputStream("temp/test3.data"); byte[] buf = new byte[100]; int count = in.read(buf); // Exam04_1의 실행 결과로 만들어진 파일을 읽어라! // 바이트 배열에 들어있는 값을 사용하여 String 인스턴스를 만든다. // new String(바이트배열, 시작번호, 개수, 문자코드표) // => 예) new String(buf, 0, 10, "UTF-8") // buf 배열에서 0번부터 10개의 바이트를 꺼낸다. // 그 바이트는 UTF-8 코드로 되어 있다. // 이 UTF-8 코드 배열을 UTF-16 문자 배열로 만들어 String 객체를 리턴한다. String str = new String(buf, 0, count, "UTF-8"); in.close(); System.out.printf("%s\n", str); } }
[ "qweqwe472@naver.com" ]
qweqwe472@naver.com
f56f1db40a3a5442c2333989d459942eba437f16
bad6db50d8059d818722ceb6a0b43a8f965af413
/integration/mediation-tests/tests-transport/src/test/java/org/wso2/carbon/esb/generic/inbound/transport/test/GenericInboundTransportTestCase.java
c7619f008351c7d7e1b7a7715808fab8525edffb
[ "Apache-2.0" ]
permissive
garystearn/product-ei
c73166269465f78bf6126ca88ccefb895cd49e64
4be8d80e6a9194e6315eaee836270fd5a52ba018
refs/heads/master
2021-06-27T02:08:40.426727
2017-09-12T04:28:28
2017-09-12T04:28:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,900
java
/* * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. 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.wso2.carbon.esb.generic.inbound.transport.test; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.util.AXIOMUtil; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.integration.common.admin.client.LogViewerClient; import org.wso2.carbon.logging.view.stub.types.carbon.LogEvent; import org.wso2.esb.integration.common.clients.inbound.endpoint.InboundAdminClient; import org.wso2.esb.integration.common.utils.ESBIntegrationTest; import org.wso2.esb.integration.common.utils.JMSEndpointManager; import org.wso2.esb.integration.common.utils.common.ServerConfigurationManager; import java.io.File; public class GenericInboundTransportTestCase extends ESBIntegrationTest { private LogViewerClient logViewerClient = null; //TODO: Add this jar to correct location private final String CLASS_JAR = "org.wso2.carbon.inbound.endpoint.test-1.0.jar"; private final String JAR_LOCATION = "/artifacts/ESB/jar"; private InboundAdminClient inboundAdminClient; private ServerConfigurationManager serverConfigurationManager; @BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { init(); serverConfigurationManager = new ServerConfigurationManager(context); serverConfigurationManager.copyToComponentLib(new File(getClass().getResource(JAR_LOCATION + File.separator + CLASS_JAR).toURI())); OMElement synapse = esbUtils.loadResource("/artifacts/ESB/generic/inbound/transport/generic_inbound_transport_config.xml"); updateESBConfiguration(JMSEndpointManager.setConfigurations(synapse)); serverConfigurationManager.restartGracefully(); init(); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); } @Test(groups = { "wso2.esb" }, description = "Test Adding Generic Inbound End point") public void testAddingGenericInboundEndpoints() throws Exception { int beforeLogCount = logViewerClient.getAllSystemLogs().length; addInboundEndpoint(addEndpoint1()); Thread.sleep(5000); LogEvent[] logs = logViewerClient.getAllSystemLogs(); boolean status = false; for (int i = 0; i < (logs.length - beforeLogCount); i++) { if (logs[i].getMessage().contains("Generic Polling Consumer Invoked")) { status = true; break; } } Assert.assertTrue(status, "There is no Generic Inbound Endpoint."); deleteInboundEndpoints(); } @Test(groups = { "wso2.esb" }, description = "Test creating Generic Inbound EP without sequence") public void testInjectingInvalidSequence() throws Exception { int beforeLogCount = logViewerClient.getAllSystemLogs().length; addInboundEndpoint(addEndpoint2()); LogEvent[] logs = logViewerClient.getAllSystemLogs(); boolean status = false; for (int i = 0; i < (logs.length - beforeLogCount); i++) { if (logs[i].getMessage().contains("Sequence name not specified")) { status = true; break; } } Assert.assertTrue(status, "There is no Generic Inbound Endpoint."); deleteInboundEndpoints(); } @Test(groups = { "wso2.esb" }, description = "Test creating Generic Inbound EP without implementation class") public void testWithoutImplementationClass() throws Exception { int beforeLogCount = logViewerClient.getAllSystemLogs().length; addInboundEndpoint(addEndpoint3()); LogEvent[] logs = logViewerClient.getAllSystemLogs(); boolean status = false; for (int i = 0; i < (logs.length - beforeLogCount); i++) { if (logs[i].getMessage().contains("Please check the required class is added to the classpath")) { status = true; break; } } Assert.assertTrue(status, "There is no Generic Inbound Endpoint."); deleteInboundEndpoints(); } @AfterClass(alwaysRun = true) public void destroy() throws Exception { super.cleanup(); serverConfigurationManager.removeFromComponentLib(CLASS_JAR); serverConfigurationManager.restartGracefully(); serverConfigurationManager = null; } private OMElement addEndpoint1() throws Exception { OMElement synapseConfig = null; synapseConfig = AXIOMUtil .stringToOM("<inboundEndpoint xmlns=\"http://ws.apache.org/ns/synapse\"\n" + " name=\"Test1\"\n" + " sequence=\"requestHandlerSeq\"\n" + " onError=\"inFault\"\n" + " class=\"org.wso2.carbon.inbound.endpoint.test.GenericConsumer\"\n" + " suspend=\"false\">\n" + " <parameters>\n" + " <parameter name=\"interval\">1000</parameter>\n" + " </parameters>\n" + "</inboundEndpoint>"); return synapseConfig; } private OMElement addEndpoint2() throws Exception { OMElement synapseConfig = null; synapseConfig = AXIOMUtil .stringToOM("<inboundEndpoint xmlns=\"http://ws.apache.org/ns/synapse\"\n" + " name=\"Test2\"\n" + " sequence=\"\"\n" + " onError=\"inFault\"\n" + " class=\"org.wso2.carbon.inbound.endpoint.test.GenericConsumer\"\n" + " suspend=\"false\">\n" + " <parameters>\n" + " <parameter name=\"interval\">1000</parameter>\n" + " </parameters>\n" + "</inboundEndpoint>"); return synapseConfig; } private OMElement addEndpoint3() throws Exception { OMElement synapseConfig = null; synapseConfig = AXIOMUtil .stringToOM("<inboundEndpoint xmlns=\"http://ws.apache.org/ns/synapse\"\n" + " name=\"Test4\"\n" + " sequence=\"requestHandlerSeq\"\n" + " onError=\"inFault\"\n" + " class=\"\"\n" + " suspend=\"false\">\n" + " <parameters>\n" + " <parameter name=\"interval\">1000</parameter>\n" + " </parameters>\n" + "</inboundEndpoint>"); return synapseConfig; } }
[ "madhawag@wso2.com" ]
madhawag@wso2.com
61ef1173f0351b6f95940144c1a35ca2b6a5bb15
f3bf4e9c33098dfc98332775881493d65349810d
/JavaEE6_Zaawansowany_przewodnik/connectors/mailconnector/mailconnector-ra/src/java/mailconnector/ra/inbound/EndpointConsumer.java
74f0bf16e28b3022f143b9f6afc36b42b2e42c5b
[]
no_license
tomekb82/JavaProjects
588ffe29e79e0999413ee9fd0d8a9596ecd6ef0b
88ed90da4f3bb930962002da22a46dad9b2ef6ca
refs/heads/master
2021-01-01T18:29:21.055062
2015-11-20T00:21:53
2015-11-20T00:21:53
20,363,504
2
0
null
null
null
null
UTF-8
Java
false
false
5,865
java
/* * Copyright 2013 Oracle and/or its affiliates. * All rights reserved. You may not modify, use, * reproduce, or distribute this software except in * compliance with the terms of the License at: * http://developers.sun.com/license/berkeley_license.html */ package mailconnector.ra.inbound; import java.lang.reflect.Method; import java.rmi.RemoteException; import java.util.logging.Level; import java.util.logging.Logger; import javax.mail.AuthenticationFailedException; import javax.mail.Flags.Flag; import javax.mail.Message; import javax.resource.spi.endpoint.MessageEndpoint; import javax.resource.spi.endpoint.MessageEndpointFactory; import mailconnector.api.JavaMailMessageListener; /** * JavaMail Client RMI interface. * * This is a singleton class that represents the Client interface * used by the JavaMail Service. * * @author Alejandro Murillo */ public class EndpointConsumer { static final Logger logger = Logger.getLogger("mailconnector.ra.inbound"); public Method onMessage = null; ActivationSpecImpl activationSpec; MailServerFolder folder = null; MessageEndpointFactory endpointFactory; /** * Constructor. Creates a JavaMail Client Interface object and exports it * so that the server can access it. * * @param endpointFactory a MessageEndpointFactory * @param activationSpec the activation spec */ public EndpointConsumer( MessageEndpointFactory endpointFactory, ActivationSpecImpl activationSpec) throws Exception { logger.info("[Inbound:EndpointConsumer] Constructor"); this.endpointFactory = endpointFactory; this.activationSpec = activationSpec; try { folder = new MailServerFolder(activationSpec); } catch (AuthenticationFailedException ie) { logger.log( Level.INFO, "[Inbound:EndpointConsumer] Authentication problem when opening Mail Folder: {0} Wrong password?", getUniqueKey()); throw ie; } catch (Exception ie) { logger.log( Level.INFO, "[Inbound:EndpointConsumer] Expected Error while opening Mail Folder: {0} -- " + "missing foldername, hostname, username, or password", getUniqueKey()); throw ie; } logger.log( Level.INFO, "[EndpointConsumer] Created EndpointConsumer for: {0}", getUniqueKey()); } /** * Delivers it to the appropriate EndPoint. * * @param message the message to be delivered */ public void deliverMessage(Message message) throws RemoteException { MessageEndpoint endpoint = null; Object[] args = { message }; try { // o Create endpoint, passing XAResource. // o Call beforeDelivery to allow the appserver // to engage delivery in transaction, if required. // o Deliver Message. if ((endpoint = endpointFactory.createEndpoint(null)) != null) { // If this was an XA capable RA then invoke // endpoint.beforeDelivery(); logger.info("[Inbound:EndpointConsumer] Invoking onMessage"); ((JavaMailMessageListener) endpoint).onMessage(message); } } catch (Exception e) { logger.log( Level.WARNING, "[Inbound:EndpointConsumer] deliverMessage.onmessageexception", e.getMessage()); } catch (Error error) { logger.log( Level.WARNING, "[Inbound:EndpointConsumer] deliverMessage.onmessageexception", error.getMessage()); } catch (Throwable t) { logger.log( Level.WARNING, "[Inbound:EndpointConsumer] deliverMessage.onmessageexception", t.getMessage()); } finally { // o Call afterDelivery to to permit the Application Server to // complete or rollback transaction on delivery. This should // occur even if an exception has been thrown. // o Call release to indicate the endpoint can be recycled. if (endpoint != null) { //If this was an XA capable RA then invoke // endpoint.afterDelivery(); endpoint.release(); } } } public boolean hasNewMessages() throws Exception { logger.log( Level.INFO, "[Inbound:EndpointConsumer] Checking for new messages on: {0}", getUniqueKey()); return folder.hasNewMessages(); } public final String getUniqueKey() { logger.info("[Inbound:EndpointConsumer] Invoking getUniqueKey"); return activationSpec.getUserName() + "-" + activationSpec.getFolderName() + "@" + activationSpec.getServerName(); } public Message[] getNewMessages() { logger.info("[Inbound:EndpointConsumer] Invoking getNewMessages"); Message[] msgs = null; try { msgs = folder.getNewMessages(); if (msgs != null) { for (int i = 0; i < msgs.length; i++) { if (!msgs[i].isSet(Flag.SEEN)) //Deliver only once { //deliverMessage(msgs[i]); // Mark message as seen msgs[i].setFlag(Flag.SEEN, true); } } } } catch (Exception ie) { logger.severe( "[InboundEndpointConsumer] getNewMessages caught an exception. Bailing out"); } return msgs; } }
[ "tomasz.belina@qualent.eu" ]
tomasz.belina@qualent.eu
0c013b04c555ffbe791224f87da5bd6607d61c4d
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/3/org/jfree/chart/axis/DateAxis_calculateDateForPosition_1063.java
6862e1827212bf17cb53f60c60dbefd8195b9836
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,984
java
org jfree chart axi base ax displai date find easier understand axi work bear mind displai measur integ data integ millisecond midnight jan displai tick label millisecond valu convert back date code date format dateformat code instanc creat link org jfree chart axi timelin suppli constructor creat axi domain valu creat date axi work dai date axi dateaxi axi valueaxi cloneabl serializ return link java util date posit link regular time period regulartimeperiod param period period param posit posit code code permit date date calcul date posit calculatedateforposit regular time period regulartimeperiod period date tick mark posit datetickmarkposit posit posit illeg argument except illegalargumentexcept null 'position' argument date result posit date tick mark posit datetickmarkposit start result date period millisecond getfirstmillisecond posit date tick mark posit datetickmarkposit middl result date period middl millisecond getmiddlemillisecond posit date tick mark posit datetickmarkposit end result date period millisecond getlastmillisecond result
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
733ef3329677898a4301aa371f0d4990385dfca0
8a242b6b0ed8e436412f101ddbaa3bebac6c4bdb
/src/academy/everyonecodes/java/week2/set1/exercise3/Recipe.java
ce6fdf0701841a216785976bf7a1330352416fdb
[]
no_license
Thomas-Ortsik/java-module
873d650107a270a50919e662818c14ec898d7b95
1ce18598eacc1e08624b47c6cf1d45436e8f21e6
refs/heads/master
2022-12-01T12:04:51.126265
2020-08-05T15:13:53
2020-08-05T15:13:53
226,830,926
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
package academy.everyonecodes.java.week2.set1.exercise3; import java.util.List; public class Recipe { private String name; private int timeToPrepare; private List<String> ingredients; private List<String> steps; public Recipe(String name, int time, List<String> ingredients, List<String> steps){ this.name = name; timeToPrepare = time; this.ingredients = ingredients; this.steps = steps; } public String getName(){ return name; } public int getTimeToPrepare(){ return timeToPrepare; } public List<String> getIngredients(){ return ingredients; } public List<String> getSteps(){ return steps; } }
[ "doctor.strangethumb@gmail.com" ]
doctor.strangethumb@gmail.com
18ced4eb3025fd01477e854c1429c100ef461d7b
16683182f7703f465afd396827dc059bf89706f1
/src/main/java/org/apache/pulsar/manager/entity/PulsarManagerTopicStats.java
649bdaf4c21a80943ff747852f8d07715da936b8
[ "Apache-2.0" ]
permissive
apache/pulsar-manager
53281537baecc894bb9d339b7f5474f3e9b7c3c4
f8304b4d49bcee31e5b47d960ff7b698bd08757e
refs/heads/master
2023-09-03T11:41:22.999167
2023-08-09T09:57:23
2023-08-09T09:57:23
155,603,142
459
251
Apache-2.0
2023-08-09T09:57:25
2018-10-31T18:09:47
Vue
UTF-8
Java
false
false
1,908
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 org.apache.pulsar.manager.entity; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.ArrayList; import java.util.HashMap; @Getter @Setter @NoArgsConstructor public class PulsarManagerTopicStats { /** Total rate of messages published on the topic. msg/s */ private double msgRateIn; /** Total throughput of messages published on the topic. byte/s */ private double msgThroughputIn; /** Total rate of messages dispatched for the topic. msg/s */ private double msgRateOut; /** Total throughput of messages dispatched for the topic. byte/s */ private double msgThroughputOut; /** Average size of published messages. bytes */ private double averageMsgSize; /** Space used to store the messages for the topic. bytes */ private long storageSize; private int pendingAddEntriesCount; /** List of connected publishers on this topic w/ their stats */ private ArrayList<PulsarManagerPublisherStats> publishers; /** Map of subscriptions with their individual statistics */ private HashMap<String, PulsarManagerSubscriptionStats> subscriptions; /** Map of replication statistics by remote cluster context */ private HashMap<String, PulsarManagerReplicatorStats> replication; private String deduplicationStatus; }
[ "sijie@apache.org" ]
sijie@apache.org
4f52bfdc0e14e122f37e6618455af71b2b4b8edd
dc2abd1a2d7153f429e909355b8e40d03531eb7a
/src/com/primeresponse/testcases/Enterprise/Verify_ExternalFeedsDefaultSorting.java
0be4945c7dfcbebca2cc894e5d0afc0085d791ad
[]
no_license
rajkrsingh/Prime-Project
acdf4bb466f9a821fffe2d96031af06b6257cd21
60e0250cafcd93a7d58ea98fa30d1550b4028a5d
refs/heads/master
2020-03-19T02:53:49.344714
2018-06-01T05:47:00
2018-06-01T05:47:00
135,672,472
0
0
null
null
null
null
UTF-8
Java
false
false
2,078
java
package com.primeresponse.testcases.Enterprise; import org.testng.annotations.AfterMethod; import org.testng.annotations.Test; import com.primeresponse.pagehelper.EnterpriseHelper; import com.primeresponse.pagehelper.HeaderHelper; import com.primeresponse.pagehelper.LoginHelper; import com.primeresponse.util.DriverTestCase; import com.primeresponse.util.ExecutionLog; public class Verify_ExternalFeedsDefaultSorting extends DriverTestCase { @Test public void testVerify_ExternalFeedsDefaultSorting() throws Exception { // Initialize objects loginHelper = new LoginHelper(getWebDriver()); headerHelper = new HeaderHelper(getWebDriver()); EnterpriseHelper enterpriseHelper = new EnterpriseHelper(getWebDriver()); ExecutionLog.LogAddClass(this.getClass().getName() + " and Test method " + Thread.currentThread().getStackTrace()[1].getMethodName()); try { // Open application getWebDriver().navigate().to(applicationUrl); ExecutionLog.Log("open application giturl"); // login to the application login("Admin"); ExecutionLog.Log("log-in into application"); //Select "Selenium Test" Account if not selected selectAccount(); ExecutionLog.Log("Select Selenium Test Ford Account if not selected"); // Go to Enterprise > External Feed headerHelper.clickonEnterpriseExternalFeed(); ExecutionLog.Log("Go to Enterprise > External Feed"); // Select Group enterpriseHelper.selectGroupAtEnterprise(); ExecutionLog.Log("Select Group at external feed screen"); // Check default sorting of date column enterpriseHelper.checkDateSort(); ExecutionLog.Log("Check default sorting of date column"); } catch (Error e) { captureScreenshot("testVerify_ExternalFeedsDefaultSorting"); ExecutionLog.LogErrorMessage(e); throw e; } catch (Exception e) { captureScreenshot("testVerify_ExternalFeedsDefaultSorting"); ExecutionLog.LogExceptionMessage(e); throw e; } } @AfterMethod public void endMethods() throws Exception { ExecutionLog.LogEndClass(this.getClass().getName()); } }
[ "you@example.com" ]
you@example.com
11fb554d28db0ac729d52170844f633273c4e472
ea1c976b26b3918a567aa2e4545724fed36b14ae
/app/src/main/java/com/example/shadow/heartrecreation/ui/order/mvp/bean/ReasonBean.java
09b210b067e07791731af4da81efbadf7fdcf16b
[]
no_license
ljx123456/Bixin
a1f56fdd5cfc35a27490b96265814e412eb18a96
3e0f4c6f402514b936b2cfdb11f5e326fd5dc7b5
refs/heads/master
2021-05-18T11:04:39.668370
2020-03-30T07:45:42
2020-03-30T07:45:42
251,219,799
0
0
null
null
null
null
UTF-8
Java
false
false
1,658
java
package com.example.shadow.heartrecreation.ui.order.mvp.bean; import java.util.List; public class ReasonBean { /** * code : 0 * message : 请求成功. * data : [{"reasonId":1,"describe":"疑似提供色情服务或其它违法行为"},{"reasonId":2,"describe":"达人态度不好"},{"reasonId":3,"describe":"不是本人"},{"reasonId":4,"describe":"其他"}] */ private int code; private String message; private List<DataBean> data; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean { /** * reasonId : 1 * describe : 疑似提供色情服务或其它违法行为 */ private int reasonId; private String describe; private boolean isFlag=false; public boolean isFlag() { return isFlag; } public void setFlag(boolean flag) { isFlag = flag; } public int getReasonId() { return reasonId; } public void setReasonId(int reasonId) { this.reasonId = reasonId; } public String getDescribe() { return describe; } public void setDescribe(String describe) { this.describe = describe; } } }
[ "911015964@qq.com" ]
911015964@qq.com
21bfcd149897cc3ccf197c7d0e66a30ee846a799
cdbdddac426bce27ad97401b779392327a6a77eb
/spring/mixed/JpaTest/src/com/java/spring/client/Test1.java
c3b9e718aece084457a726b22d47347a3c4c20aa
[]
no_license
dhirajn72/allmylocalstuff
87dc68dfe014f31f6c96e996d6b251ff4bda4de8
2f50ab2f3f6b37f71cd02cc253639c540006b933
refs/heads/master
2022-12-23T09:42:59.221342
2021-07-28T19:11:40
2021-07-28T19:11:40
97,965,789
1
1
null
2022-12-16T09:55:29
2017-07-21T16:08:29
Roff
UTF-8
Java
false
false
793
java
package com.java.spring.client; import javax.persistence.EntityManager; import javax.persistence.EntityTransaction; import com.java.spring.Customer; import com.java.spring.jpautil.JPAUtil; public class Test1 { public static void main(String[] args) { EntityTransaction entityTransaction = null; try { EntityManager entityManager = JPAUtil.getEntityManagerFactory() .createEntityManager(); entityTransaction = entityManager.getTransaction(); entityTransaction.begin(); Customer customer = (Customer) entityManager .find(Customer.class, 2); System.out.println(customer); entityTransaction.commit(); entityManager.close(); } catch (Exception e) { e.printStackTrace(); if (entityTransaction != null) entityTransaction.rollback(); } } }
[ "dhirajn72@gmail.com" ]
dhirajn72@gmail.com
17e1ed2978540fa9b7a1ba8c825149194181cec8
be541e9fe7300536c5b31c264822d556c186d826
/kafka-eagle-common/src/main/java/org/smartloli/kafka/eagle/common/util/KConstants.java
a98ce24ae99d789a7fa5158bf5f5393030702226
[ "Apache-2.0" ]
permissive
L1116/chronic-disease1
6869c98e727951be55dd5d53b3300b802cc2efa0
27e1d95aff23b510759b87729e99fca910d9398e
refs/heads/master
2021-09-04T01:42:47.769620
2018-01-14T05:26:42
2018-01-14T05:26:42
112,591,954
0
0
Apache-2.0
2018-01-14T05:26:43
2017-11-30T09:26:41
JavaScript
UTF-8
Java
false
false
3,790
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.smartloli.kafka.eagle.common.util; /** * Define constants in the system. * * @author smartloli. * * Created by Jan 3, 2017 */ public class KConstants { /** D3 data plugin size. */ public interface D3 { public final static int SIZE = 40; } /** Kafka parameter setting. */ public interface Kafka { public final static String CONSUMER_OFFSET_TOPIC = "__consumer_offsets"; public final static String KAFKA_EAGLE_SYSTEM_GROUP = "kafka.eagle.system.group"; public final static String JAVA_SECURITY = "java.security.auth.login.config"; public final static int TIME_OUT = 100; public final static long POSITION = 5000;// default 5000 public final static String PARTITION_CLASS = "partitioner.class"; public final static String KEY_SERIALIZER = "key.serializer"; public final static String VALUE_SERIALIZER = "value.serializer"; } /** Mail args setting. */ public interface Mail { public final static String[] ARGS = new String[] { "toAddress", "subject", "content" }; } /** Zookeeper session. */ public interface SessionAlias { public final static String CLUSTER_ALIAS = "clusterAlias"; } /** Login session. */ public interface Login { public final static String SESSION_USER = "LOGIN_USER_SESSION"; public final static String UNKNOW_USER = "__unknow__"; public final static String ERROR_LOGIN = "error_msg"; } /** Role Administrator. */ public interface Role { public final static String ADMIN = "admin"; public final static int ADMINISRATOR = 1; public final static int ANONYMOUS = 0; public final static String WHETHER_SYSTEM_ADMIN = "WHETHER_SYSTEM_ADMIN"; } /** Kafka jmx mbean. */ public interface MBean { public final static String COUNT = "Count"; public final static String EVENT_TYPE = "EventType"; public final static String FIFTEEN_MINUTE_RATE = "FifteenMinuteRate"; public final static String FIVE_MINUTE_RATE = "FiveMinuteRate"; public final static String MEAN_RATE = "MeanRate"; public final static String ONE_MINUTE_RATE = "OneMinuteRate"; public final static String RATE_UNIT = "RateUnit"; public final static String VALUE = "Value"; /** Messages in /sec. */ public final static String MESSAGES_IN = "msg"; /** Bytes in /sec. */ public final static String BYTES_IN = "ins"; /** Bytes out /sec. */ public final static String BYTES_OUT = "out"; /** Bytes rejected /sec. */ public final static String BYTES_REJECTED = "rejected"; /** Failed fetch request /sec. */ public final static String FAILED_FETCH_REQUEST = "fetch"; /** Failed produce request /sec. */ public final static String FAILED_PRODUCE_REQUEST = "produce"; /** MBean keys. */ public final static String MESSAGEIN = "MessageIn"; public final static String BYTEIN = "ByteIn"; public final static String BYTEOUT = "ByteOut"; public final static String FAILEDFETCHREQUEST = "FailedFetchRequest"; public final static String FAILEDPRODUCEREQUEST = "FailedProduceRequest"; } }
[ "smartloli.org@gmail.com" ]
smartloli.org@gmail.com
2f28ee989d4ec13b09a783349a9db806805bbcd5
c5f0b9a449b0e22ad87a05f2a4d7a010ed167cb3
/3_implementation/src/net/hudup/logistic/math/BitDatasetStatsProcessor.java
763ce19ea35f9842787c3f4b835d00df91389510
[ "MIT" ]
permissive
sunflowersoft/hudup-ext
91bcd5b48d84ab33d6d8184e381d27d8f42315f7
cb62d5d492a82f1ecc7bc28955a52e767837afd3
refs/heads/master
2023-08-03T12:25:02.578863
2023-07-21T08:23:52
2023-07-21T08:23:52
131,940,602
0
0
null
null
null
null
UTF-8
Java
false
false
5,646
java
/** * HUDUP: A FRAMEWORK OF E-COMMERCIAL RECOMMENDATION ALGORITHMS * (C) Copyright by Loc Nguyen's Academic Network * Project homepage: hudup.locnguyen.net * Email: ng_phloc@yahoo.com * Phone: +84-975250362 */ package net.hudup.logistic.math; import java.io.Serializable; import java.util.BitSet; import java.util.Collection; import java.util.List; import net.hudup.core.data.Attribute; import net.hudup.core.data.Profile; import net.hudup.core.data.bit.BitData; import net.hudup.core.data.bit.BitItem; import net.hudup.core.logistic.DSUtil; /** * This is utility class which calculates probabilities on bit data (binary data). * * @author Loc Nguyen * @version 10.0 * */ public final class BitDatasetStatsProcessor implements Serializable { /** * Default serial version UID. */ private static final long serialVersionUID = 1L; /** * Bit data (binary data). */ protected BitData bitData = null; /** * Constructor with bit data (binary data). * @param bitData bit data (binary data). */ public BitDatasetStatsProcessor(BitData bitData) { this.bitData = bitData; } /** * Calculating probability of specified bit item id. * @param bitItemId specified bit item id. * @return probability of specified bit item id. */ public double prob(int bitItemId) { return bitData.get(bitItemId).getSupport(); } /** * Calculating AND probability of a collection of bit item id (s). * @param bitItemIds collection of bit item id (s). * @return AND probability of a collection of bit item id (s). */ public double probAnd(Collection<Integer> bitItemIds) { BitSet bs = null; for (int bitItemId : bitItemIds) { BitItem item1 = bitData.get(bitItemId); BitSet bs1 = item1.bitItem().getBitSet(); if (bs == null) bs = (BitSet)bs1.clone(); else bs.and(bs1); } return (double)DSUtil.countSetBit(bs) / (double) bitData.realSessionIds().size(); } /** * Calculating AND probability of two bit item id (s). * @param bitItemId1 bit item id 1. * @param bitItemId2 bit item id 2. * @return AND probability of two bit item id (s). */ public double probAnd(int bitItemId1, int bitItemId2) { BitItem item1 = bitData.get(bitItemId1); BitSet bs1 = (BitSet)item1.bitItem().getBitSet().clone(); BitItem item2 = bitData.get(bitItemId2); BitSet bs2 = item2.bitItem().getBitSet(); bs1.and(bs2); return (double)DSUtil.countSetBit(bs1) / (double) bitData.realSessionIds().size(); } /** * Calculating AND probability of two bit item id (s). * @param bitItemId1 bit item id 1. * @param bitItemId2 bit item id 2. * @return AND probability of two bit item id (s). */ public double probAndNot(int bitItemId1, int bitItemId2) { BitItem item1 = bitData.get(bitItemId1); BitSet bs1 = (BitSet)item1.bitItem().getBitSet().clone(); BitItem item2 = bitData.get(bitItemId2); BitSet bs2 = item2.bitItem().getBitSet(); bs1.andNot(bs2); return (double)DSUtil.countSetBit(bs1) / (double) bitData.realSessionIds().size(); } /** * Calculating probability of a nominal session (often, a user) on bit item id. * @param sessionNominalAtt session nominal attribute. Session id is often user id. * @param sessionNominalAttValue value of session nominal attribute. Session id is often user id. * @param bitItemId bit item id. * @param occur flag to indicate whether bit is set. * @return probability of a nominal session (often, a user) on bit item id. */ public double probSessionOnBitItem( Attribute sessionNominalAtt, int sessionNominalAttValue, int bitItemId, boolean occur) { if (!sessionNominalAtt.isCategory()) throw new RuntimeException("Attribute not category"); BitItem item = bitData.get(bitItemId); BitSet bs = (BitSet)item.bitItem().getBitSet(); int count = 0; List<Integer> realSessionIds = bitData.realSessionIds(); int n = realSessionIds.size(); for (int i = 0; i < n; i++) { if (bs.get(i) != occur) continue; int realSessionId = realSessionIds.get(i); Profile realSessionProfile = bitData.getRealSessionProfile(realSessionId); if (realSessionProfile == null) continue; int value = realSessionProfile.getValueAsInt(sessionNominalAtt.getIndex()); if (value == sessionNominalAttValue) count ++; } return (double)count / (double)n; } /** * Calculating probability of a nominal session (often, a user) on bit item id. * @param sessionNominalAtt session nominal attribute. Session id is often user id. * @param sessionNominalAttValue value of session nominal attribute. Session id is often user id. * @param bitItemId bit item id. * @return probability of a nominal session (often, a user) on bit item id. */ public double probSessionOnBitItem( Attribute sessionNominalAtt, int sessionNominalAttValue, int bitItemId) { return probSessionOnBitItem(sessionNominalAtt, sessionNominalAttValue, bitItemId, true); } /** * Calculating probability of a nominal session (often, a user) on bit item id with note that bit is set. * @param sessionNominalAtt session nominal attribute. Session id is often user id. * @param sessionNominalAttValue value of session nominal attribute. Session id is often user id. * @param bitItemId bit item id. * @return probability of a nominal session (often, a user) on bit item id. */ public double probSessionOnNotBitItem( Attribute sessionNominalAtt, int sessionNominalAttValue, int bitItemId) { return probSessionOnBitItem(sessionNominalAtt, sessionNominalAttValue, bitItemId, false); } }
[ "ngphloc@gmail.com" ]
ngphloc@gmail.com
7fb9c7213ee00e9a308920e61aa40c057dc934b7
1a32d704493deb99d3040646afbd0f6568d2c8e7
/BOOT-INF/lib/ch/qos/logback/core/rolling/helper/MonoTypedConverter.java
12b14ca953adc52d9f76c1700641cbe1afe05865
[]
no_license
yanrumei/bullet-zone-server-2.0
e748ff40f601792405143ec21d3f77aa4d34ce69
474c4d1a8172a114986d16e00f5752dc019cdcd2
refs/heads/master
2020-05-19T11:16:31.172482
2019-03-25T17:38:31
2019-03-25T17:38:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package ch.qos.logback.core.rolling.helper; public abstract interface MonoTypedConverter { public abstract boolean isApplicable(Object paramObject); } /* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\logback-core-1.1.11.jar!\ch\qos\logback\core\rolling\helper\MonoTypedConverter.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ishankatwal@gmail.com" ]
ishankatwal@gmail.com
bcfa08d818acc01abce177710d7f06d668486e92
f41f362b88e118dcace37c5ae1a1bf85005c9ce3
/eng-stanford/src/test/java/org/swtk/eng/stanford/ShallowParseTest.java
ef5bac153eb82858b66f921af545849809ad1b39
[ "Apache-2.0" ]
permissive
torrances/swtk-eng
60238e10c41b4fb1f77ad7fb1332fc878cece3b7
1b89f9975fb7a15fffa86e18cbb860df8c39d64e
refs/heads/master
2021-01-20T18:24:33.022928
2016-01-27T19:20:18
2016-01-27T19:20:18
25,320,891
0
0
null
null
null
null
UTF-8
Java
false
false
3,175
java
package org.swtk.eng.stanford; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.util.Collection; import org.junit.Test; import org.swtk.eng.stanford.dmo.CombineNounPhrases; import org.swtk.eng.stanford.dmo.ShallowParse; import org.swtk.eng.stanford.dto.TreeNode; import org.swtk.eng.stanford.dto.adapter.TreeNodeAdapter; import com.trimc.blogger.commons.LogManager; import com.trimc.blogger.commons.type.Codepage; import com.trimc.blogger.commons.utils.SetUtils; public final class ShallowParseTest { private static final Codepage CODEPAGE = Codepage.WINDOWS_1252; private static final String INPUT = "The quick brown fox jumped over the lazy dog."; public static LogManager logger = new LogManager(ShallowParseTest.class); @Test public void run1() throws Throwable { /* * Expected Output * * text = The, pos = DT * text = quick, pos = JJ * text = brown, pos = JJ * text = fox, pos = NN * text = jumped, pos = VBD * text = over, pos = IN * text = the, pos = DT * text = lazy, pos = JJ * text = dog, pos = NN * text = ., pos = # */ ShallowParse shallowParse = new ShallowParse(INPUT, CODEPAGE).parse(); assertNotNull(shallowParse); TreeNode treenode = shallowParse.results(); assertNotNull(treenode); logger.info("%s", TreeNodeAdapter.toString(treenode)); assertEquals(10, treenode.getChildren().size()); /* NOUNS */ Collection<String> nouns = shallowParse.nouns(); assertNotNull(nouns); assertFalse(nouns.isEmpty()); assertEquals(2, nouns.size()); String result1 = SetUtils.toString(nouns, ", "); assertEquals("dog, fox", result1); logger.info("Nouns:\n%s", result1); /* ADJ-NOUNS */ Collection<String> adjNouns = shallowParse.adjNouns(); assertNotNull(adjNouns); assertFalse(adjNouns.isEmpty()); assertEquals(2, adjNouns.size()); String result2 = SetUtils.toString(adjNouns, ", "); assertEquals("lazy dog, quick brown fox", result2); logger.info("Adj-Nouns:\n%s", result2); } @Test public void run2() throws Throwable { /* * Expected Output * * text = The_quick_brown_fox, pos = NNP * text = jumped, pos = VBD * text = over, pos = IN * text = the_lazy_dog, pos = VBG <== this is a problem in the CombineNounPhrases class * text = ., pos = # */ String text = new CombineNounPhrases(INPUT, CODEPAGE).infer().combine(true, true).text(); assertEquals("The_quick_brown_fox jumped over the_lazy_dog.", text); ShallowParse shallowParse = new ShallowParse(text, CODEPAGE).parse(); assertNotNull(shallowParse); TreeNode treenode = shallowParse.results(); assertNotNull(treenode); logger.info("Shallow Parse Output:\n%s", TreeNodeAdapter.toString(treenode)); assertEquals(5, treenode.getChildren().size()); Collection<String> nouns = shallowParse.nouns(); assertNotNull(nouns); assertFalse(nouns.isEmpty()); assertEquals(2, nouns.size()); String result1 = SetUtils.toString(nouns, ", "); assertEquals("The_quick_brown_fox, the_lazy_dog", result1); logger.info("Nouns:\n%s", result1); } }
[ "cmtrim@us.ibm.com" ]
cmtrim@us.ibm.com
38b46e02a0ca415cd4d5dc88b9c1ba81f6f46d3a
6bcae0ccde174ecd90db7574eb89e641bf33966c
/src/main/java/eu/mihosoft/ext/j3d/com/sun/j3d/loaders/lw3d/ParserObject.java
82ef93c9311d34a35237561cf90242c3a889dea3
[]
no_license
miho/ExtJ3D
addf6cc4f3b49af2bbb7deed42abc4d6c2ad067c
87a1fce815e656dba4d3ee3744d35365932e622c
refs/heads/master
2021-01-10T06:31:07.107446
2016-02-17T18:49:00
2016-02-17T18:49:07
51,943,509
1
1
null
null
null
null
UTF-8
Java
false
false
2,894
java
/* * Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY * EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL * NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF * USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR * ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, * CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND * REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR * INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * * You acknowledge that this software is not designed, licensed or * intended for use in the design, construction, operation or * maintenance of any nuclear facility. * */ package eu.mihosoft.ext.j3d.com.sun.j3d.loaders.lw3d; /** * This class is a superclass of the binary parsing classes. It provides * some basic debugging utilities. */ class ParserObject { final static int TRACE = DebugOutput.TRACE, VALUES = DebugOutput.VALUES; final static int MISC = DebugOutput.MISC, LINE_TRACE = DebugOutput.LINE_TRACE; final static int NONE = DebugOutput.NONE, EXCEPTION = DebugOutput.EXCEPTION; final static int TIME = DebugOutput.TIME, WARNING = DebugOutput.WARNING; protected DebugOutput debugPrinter; ParserObject() { debugPrinter = new DebugOutput(EXCEPTION); } ParserObject(int debugVals) { this(); debugPrinter.setValidOutput(debugVals); } protected void debugOutputLn(int outputType, String theOutput) { if (theOutput.equals("")) debugPrinter.println(outputType, theOutput); else debugPrinter.println(outputType, getClass().getName() + "::" + theOutput); } protected void debugOutput(int outputType, String theOutput) { debugPrinter.print(outputType, theOutput); } }
[ "info@michaelhoffer.de" ]
info@michaelhoffer.de
9b2b3d2280c72b44f4cc6925c51364215c204340
d67f6450b24fb08f2f61b74dcdecce3025ee3efc
/gemp-swccg-cards/src/main/java/com/gempukku/swccgo/cards/set204/light/Card204_019.java
985a48831bf69b6ca3c4f06c5bd3696f1c246941
[ "MIT" ]
permissive
cburyta/gemp-swccg-public
00a974d042195e69d3c104e61e9ee5bd48728f9a
05529086de91ecb03807fda820d98ec8a1465246
refs/heads/master
2023-01-09T12:45:33.347296
2020-10-26T14:39:28
2020-10-26T14:39:28
309,400,711
0
0
MIT
2020-11-07T04:57:04
2020-11-02T14:47:59
null
UTF-8
Java
false
false
3,648
java
package com.gempukku.swccgo.cards.set204.light; import com.gempukku.swccgo.cards.AbstractLostInterrupt; import com.gempukku.swccgo.cards.GameConditions; import com.gempukku.swccgo.cards.effects.AddBattleDestinyEffect; import com.gempukku.swccgo.common.*; import com.gempukku.swccgo.filters.Filters; import com.gempukku.swccgo.game.PhysicalCard; import com.gempukku.swccgo.game.SwccgGame; import com.gempukku.swccgo.logic.actions.PlayInterruptAction; import com.gempukku.swccgo.logic.effects.RespondablePlayCardEffect; import com.gempukku.swccgo.logic.effects.choose.DeployCardAboardFromReserveDeckEffect; import com.gempukku.swccgo.logic.timing.Action; import java.util.LinkedList; import java.util.List; /** * Set: Set 4 * Type: Interrupt * Subtype: Lost * Title: I'm Getting Pretty Good At This */ public class Card204_019 extends AbstractLostInterrupt { public Card204_019() { super(Side.LIGHT, 5, "I'm Getting Pretty Good At This", Uniqueness.UNIQUE); setLore("Starship blaster, often slung in turret mounts to take advantage of light weight and quick targeting motions. Installed on many starships including the Millennium Falcon."); setGameText("If Finn and either Poe or Rey are in battle together, you may add two battle destiny. OR [Download] Finn aboard any starship or vehicle."); addIcons(Icon.EPISODE_VII, Icon.VIRTUAL_SET_4); } @Override protected List<PlayInterruptAction> getGameTextTopLevelActions(final String playerId, SwccgGame game, final PhysicalCard self) { List<PlayInterruptAction> actions = new LinkedList<PlayInterruptAction>(); // Check condition(s) if (GameConditions.isDuringBattleWithParticipant(game, Filters.Finn) && GameConditions.isDuringBattleWithParticipant(game, Filters.or(Filters.Poe, Filters.Rey)) && GameConditions.canAddBattleDestinyDraws(game, self)) { final PlayInterruptAction action = new PlayInterruptAction(game, self); action.setText("Add two battle destiny"); // Allow response(s) action.allowResponses( new RespondablePlayCardEffect(action) { @Override protected void performActionResults(Action targetingAction) { // Perform result(s) action.appendEffect( new AddBattleDestinyEffect(action, 2)); } } ); actions.add(action); } GameTextActionId gameTextActionId = GameTextActionId.IM_GETTING_KIND_OF_GOOD_AT_THIS__DOWNLOAD_FINN; // Check condition(s) if (GameConditions.canDeployCardFromReserveDeck(game, playerId, self, gameTextActionId, Title.Finn)) { final PlayInterruptAction action = new PlayInterruptAction(game, self, gameTextActionId); action.setText("Deploy Finn from Reserve Deck"); // Allow response(s) action.allowResponses("Deploy Finn aboard any starship or vehicle from Reserve Deck", new RespondablePlayCardEffect(action) { @Override protected void performActionResults(Action targetingAction) { // Perform result(s) action.appendEffect( new DeployCardAboardFromReserveDeckEffect(action, Filters.Finn, true)); } } ); actions.add(action); } return actions; } }
[ "andrew@bender.io" ]
andrew@bender.io
76aa97b35c4e7cc6c9fb8c90a6afa073d2629679
b8ebab3b577719283100f7d85051666c9696da9c
/code/MyApplication/app/src/main/java/com/ckt/testauxiliarytool/autosleepwake/WakeUpActivity.java
7bbf562dcc4eb6e8f73e0bcac16b8d3e5901ef6f
[]
no_license
KitChenZhou/NoteStudy
bc73c99f0e214bceb773f1174ab2c7bb0df4f650
8b0f106d4e5dfc2fb099a70a55f25a0e859ce947
refs/heads/master
2020-03-26T07:51:38.499300
2018-08-15T00:56:30
2018-08-15T00:56:30
144,674,799
0
1
null
null
null
null
UTF-8
Java
false
false
1,726
java
package com.ckt.testauxiliarytool.autosleepwake; import android.os.PowerManager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.WindowManager; /** * 该Activity仅用于唤醒屏幕,在Android 6.0下不需要PowerManager.WakeLock唤醒锁 * 也可唤醒屏幕,但是Android 7.0加强了电量优化,必须配合PowerManager.WakeLock * 唤醒锁才能唤醒屏幕,因此还不如直接利用PowerManager来唤醒屏幕,故将该类废弃 */ @Deprecated public class WakeUpActivity extends AppCompatActivity { private PowerManager.WakeLock mWakeLock; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON); PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); mWakeLock = powerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.FULL_WAKE_LOCK, "CKT"); mWakeLock.acquire(); } @Override protected void onResume() { super.onResume(); finish(); } @Override protected void onStop() { super.onStop(); mWakeLock.release(); finish(); } @Override protected void onRestart() { super.onRestart(); finish(); } @Override protected void onDestroy() { super.onDestroy(); } }
[ "lei.chen@ck-telecom.com" ]
lei.chen@ck-telecom.com
b95691b85a755d3564643b86ac95d65a8d4aece0
cfb277d54bd8b1dc54ee8e4449d3bfe4e88031ec
/taotao-cloud-starter/taotao-cloud-common-starter/src/main/java/com/taotao/cloud/common/utils/Sequence.java
591bb3d5918660ca7fb2e5d5072bab1b7917b850
[]
no_license
FanWenTao-Felix/taotao-cloud
37255e95cc03f3ae21573baba7f371553a306ae9
f5370970958d473071b7e365a47ae33f1b5e4c64
refs/heads/master
2022-09-08T16:01:11.927529
2020-05-27T08:03:00
2020-05-27T08:03:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,373
java
package com.taotao.cloud.common.utils; import cn.hutool.core.date.SystemClock; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.toolkit.StringPool; import lombok.extern.slf4j.Slf4j; import java.lang.management.ManagementFactory; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.concurrent.ThreadLocalRandom; /** * 分布式高效有序ID生成器 * 优化开源项目:http://git.oschina.net/yu120/sequence * <p> * Twitter_Snowflake<br> * SnowFlake的结构如下(每部分用-分开):<br> * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - * 000000000000 <br> * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0<br> * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截) * 得到的值),这里的的开始时间截,一般是我们的id生成器开始使用的时间,由我们程序来指定的(如下下面程序IdWorker类的startTime属性)。41位的时间截,可以使用69年,年T * = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69<br> * 10位的数据机器位,可以部署在1024个节点,包括5位datacenterId和5位workerId<br> * 12位序列,毫秒内的计数,12位的计数顺序号支持每个节点每毫秒(同一机器,同一时间截)产生4096个ID序号<br> * 加起来刚好64位,为一个Long型。<br> * SnowFlake的优点是,整体上按照时间自增排序,并且整个分布式系统内不会产生ID碰撞(由数据中心ID和机器ID作区分),并且效率较高,经测试,SnowFlake每秒能够产生26万ID左右。 * * @author dengtao * @date 2019/3/5 */ @Slf4j public class Sequence { /** * 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动) */ private final long twepoch = 1288834974657L; /** * 机器标识位数 */ private final long workerIdBits = 5L; private final long datacenterIdBits = 5L; private final long maxWorkerId = -1L ^ (-1L << workerIdBits); private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); /** * 毫秒内自增位 */ private final long sequenceBits = 12L; private final long workerIdShift = sequenceBits; private final long datacenterIdShift = sequenceBits + workerIdBits; /** * 时间戳左移动位 */ private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; private final long sequenceMask = -1L ^ (-1L << sequenceBits); private final long workerId; /** * 数据标识 ID 部分 */ private final long datacenterId; /** * 并发控制 */ private long sequence = 0L; /** * 上次生产 ID 时间戳 */ private long lastTimestamp = -1L; /** * 时间回拨最长时间(ms),超过这个时间就抛出异常 */ private long timestampOffset = 5L; public Sequence() { this.datacenterId = getDatacenterId(maxDatacenterId); this.workerId = getMaxWorkerId(datacenterId, maxWorkerId); } /** * <p> * 有参构造器 * </p> * * @param workerId 工作机器 ID * @param datacenterId 序列号 */ public Sequence(long workerId, long datacenterId) { Assert.isFalse(workerId > maxWorkerId || workerId < 0, String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); Assert.isFalse(datacenterId > maxDatacenterId || datacenterId < 0, String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); this.workerId = workerId; this.datacenterId = datacenterId; } /** * <p> * 获取 maxWorkerId * </p> */ protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) { StringBuilder mpid = new StringBuilder(); mpid.append(datacenterId); String name = ManagementFactory.getRuntimeMXBean().getName(); if (StrUtil.isNotEmpty(name)) { /* * GET jvmPid */ mpid.append(name.split(StringPool.AT)[0]); } /* * MAC + PID 的 hashcode 获取16个低位 */ return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1); } /** * <p> * 数据标识id部分 * </p> */ protected static long getDatacenterId(long maxDatacenterId) { long id = 0L; try { InetAddress ip = InetAddress.getLocalHost(); NetworkInterface network = NetworkInterface.getByInetAddress(ip); if (network == null) { id = 1L; } else { byte[] mac = network.getHardwareAddress(); if (null != mac) { id = ((0x000000FF & (long) mac[mac.length - 1]) | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6; id = id % (maxDatacenterId + 1); } } } catch (Exception e) { log.warn(" getDatacenterId: " + e.getMessage()); } return id; } /** * 获取下一个ID * * @return */ public synchronized long nextId() { long timestamp = timeGen(); //闰秒 if (timestamp < lastTimestamp) { long offset = lastTimestamp - timestamp; if (offset <= timestampOffset) { try { wait(offset << 1); timestamp = timeGen(); if (timestamp < lastTimestamp) { throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); } } catch (Exception e) { throw new RuntimeException(e); } } else { throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", offset)); } } if (lastTimestamp == timestamp) { // 相同毫秒内,序列号自增 sequence = (sequence + 1) & sequenceMask; if (sequence == 0) { // 同一毫秒的序列数已经达到最大 timestamp = tilNextMillis(lastTimestamp); } } else { // 不同毫秒内,序列号置为 1 - 3 随机数 sequence = ThreadLocalRandom.current().nextLong(1, 3); } lastTimestamp = timestamp; // 时间戳部分 | 数据中心部分 | 机器标识部分 | 序列号部分 return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence; } protected long tilNextMillis(long lastTimestamp) { long timestamp = timeGen(); while (timestamp <= lastTimestamp) { timestamp = timeGen(); } return timestamp; } protected long timeGen() { return SystemClock.now(); } }
[ "981376577@qq.com" ]
981376577@qq.com
d8d6f98ba9f26e4c8950c69344b99607dc66349e
ddadb5924dac0fc96554a8139e657b94a14b8fb4
/src/main/java/com/hxqh/filemanager/controller/CustomerConfig.java
cd11afa2539ea195abd071e8feacb455f1ff0389
[]
no_license
hklhai/file-manager
51f3dec64e66459fdfe08a4a51632abfeeb7cd09
ebc42e015cf59c7fd93394f011c1d39b4cdf9ced
refs/heads/master
2022-06-26T03:26:55.149522
2019-08-29T03:30:09
2019-08-29T03:30:09
155,333,370
0
0
null
2022-06-17T02:00:47
2018-10-30T06:09:07
Java
UTF-8
Java
false
false
669
java
package com.hxqh.filemanager.controller; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.text.SimpleDateFormat; /** * Created by Ocean lin on 2018/10/30. * * @author Ocean lin */ @Configuration public class CustomerConfig { /** * 制定jsckson工具转换时对日期格式的处理 * * @return */ @Bean public ObjectMapper getObjectMapper() { ObjectMapper mapper = new ObjectMapper(); mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); return mapper; } }
[ "hkhai@outlook.com" ]
hkhai@outlook.com
8b3f4c1ec62a09ed91af6eaacd0f7020b5c1f91f
27cf8537b8fc1c8ddc49d815e3ee93dfa0423fc6
/app/src/main/java/com/example/android/guardiannews/newsLoader.java
7dfc295f9527c0e9d90f867d729e61d6c79977b2
[]
no_license
Hesham-XQ/GuardianNews_with_navigation_drawer
3f43a5718f87d81bac66e2ee7de3aece071f5635
9526ae2167fa8f0220a5e7e080c7ee059ff2007b
refs/heads/master
2020-03-14T07:19:18.954522
2018-09-17T19:09:58
2018-09-17T19:09:58
131,502,377
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
package com.example.android.guardiannews; import android.content.AsyncTaskLoader; import android.content.Context; import android.os.Bundle; import java.util.List; /** * Created by SAMO on 3/23/2018. */ public class newsLoader extends AsyncTaskLoader<List<News>> { private List<News> listInCacheMemory; private final Bundle pBundle; public newsLoader(Context context, Bundle bundle) { super(context); pBundle = bundle; } @Override protected void onStartLoading() { if (listInCacheMemory == null) { forceLoad(); } else { deliverResult(listInCacheMemory); } } @Override public List<News> loadInBackground() { List<News> newsList = null; // If bundle has data get articles if (pBundle != null) { newsList = QueryUtils.getDataFromHttp(pBundle.getString("uri")); } return newsList; } @Override public void deliverResult(List<News> data) { listInCacheMemory = data; super.deliverResult(data); } }
[ "example@example.com" ]
example@example.com
d2207494bf42b87c65765e49f16e96e952423036
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_11837.java
eda3d1d7ee3ca2af97e9041bbadcde1bcfcd6c8c
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
private void validateDataPointMethods(List<Throwable> errors){ Method[] methods=getTestClass().getJavaClass().getDeclaredMethods(); for ( Method method : methods) { if (method.getAnnotation(DataPoint.class) == null && method.getAnnotation(DataPoints.class) == null) { continue; } if (!Modifier.isStatic(method.getModifiers())) { errors.add(new Error("DataPoint method " + method.getName() + " must be static")); } if (!Modifier.isPublic(method.getModifiers())) { errors.add(new Error("DataPoint method " + method.getName() + " must be public")); } } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
79e6ccb433520a5153644f1b990590418c949ddf
f539bfda3a620f76177f7812391d6d25df26f47b
/AppCode/src/main/java/gov/cdc/epiinfo/interpreter/Rule_View_Checkcode_Statement.java
3c49de7a2c9b74c9858d303c4418f67e72c58001
[ "Apache-2.0" ]
permissive
Epi-Info/Epi-Info-Android
c5f8efb8c6434249a46cf50fd82d935ca6035d19
e293bbc204c29bff591c5df164361724750ae45a
refs/heads/master
2023-09-01T03:08:18.344846
2023-08-21T20:37:19
2023-08-21T20:37:19
112,626,339
1
2
null
null
null
null
UTF-8
Java
false
false
2,198
java
package gov.cdc.epiinfo.interpreter; import com.creativewidgetworks.goldparser.engine.Reduction; import com.creativewidgetworks.goldparser.engine.Token; import com.creativewidgetworks.goldparser.parser.ProcessRule; public class Rule_View_Checkcode_Statement extends EnterRule { private EnterRule BeginBefore = null; private EnterRule BeginAfter = null; //private String TextField = null; public Rule_View_Checkcode_Statement(Rule_Context pContext, Reduction pToken) { super(pContext); //this.TextField = pToken.this.ExtractTokensWithFormat(pToken..Tokens); // <View_Checkcode_Statement> ::= View <Begin_Before_statement> <Begin_After_statement> End for (int i = 1; i < pToken.size(); i++) { Token T = pToken.get(i); if(T.getName().equalsIgnoreCase("<Begin_Before_statement>")) { this.BeginBefore = EnterRule.BuildStatements(pContext, pToken.get(i).asReduction()); } else if(T.getName().equalsIgnoreCase("<Begin_After_statement>")) { this.BeginAfter = EnterRule.BuildStatements(pContext, pToken.get(i).asReduction()); } } } /// <summary> /// performs execute command /// </summary> /// <returns>object</returns> @Override public Object Execute() { this.Context.View_Checkcode = this; //if (this.BeginBefore.Statements != null) //{ if (this.Context.BeforeCheckCode.containsKey("view")) { this.Context.BeforeCheckCode.remove("view"); } this.Context.BeforeCheckCode.put("view", this.BeginBefore); //} //if (this.BeginAfter.Statements != null) //{ if (this.Context.AfterCheckCode.containsKey("view")) { this.Context.AfterCheckCode.remove("view"); } this.Context.AfterCheckCode.put("view", this.BeginAfter); //} return null; } /* @Override public String toString() { return this.TextField; }*/ @Override public boolean IsNull() { return BeginBefore == null && BeginAfter == null; } }
[ "mii0@cdc.gov" ]
mii0@cdc.gov