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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d236f985d53a9b9bca0744504c00e085a29490be
|
c2d8181a8e634979da48dc934b773788f09ffafb
|
/storyteller/output/startbahn/SetSelectionOfArtistThreadArtistAction.java
|
493c4f580b0d611c7bc8ab93e309976753efdcf4
|
[] |
no_license
|
toukubo/storyteller
|
ccb8281cdc17b87758e2607252d2d3c877ffe40c
|
6128b8d275efbf18fd26d617c8503a6e922c602d
|
refs/heads/master
| 2021-05-03T16:30:14.533638
| 2016-04-20T12:52:46
| 2016-04-20T12:52:46
| 9,352,300
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,529
|
java
|
package net.startbahn.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.startbahn.model.*;
import net.startbahn.model.crud.*;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.web.context.support.WebApplicationContextUtils;
import net.enclosing.util.HibernateSession;
public class SetSelectionOfArtistThreadArtistAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) throws Exception{
Session session = new HibernateSession().currentSession(this
.getServlet().getServletContext());
for (int I = 0; I < req.getParameterValues("id").length; i++) {
Criteria criteria2 = session.createCriteria(ArtistThread.class);
criteria2.add(Restrictions.idEq(Integer.valueOf(req.getParameterValues("id")[i])));
ArtistThread artistThread = (ArtistThread)criteria2.uniqueResult();
artistThread.setartist(true);
session.save(artistThread);
}
transaction.commit();
session.flush();
return mapping.findForward("success");
}
}
|
[
"toukubo@gmail.com"
] |
toukubo@gmail.com
|
5502c9b2f8a56d632f63df88d88222c94ab6fbc8
|
a6ff7a994ecfe54642752d9bc4d780c42eafce59
|
/unit/src/main/java/com/erayic/agr/unit/adapter/entity/UnitListItemByEnvironmentEntity.java
|
6d942584b71932f754530fd9ee195095f9463466
|
[] |
no_license
|
chenxizhe/monster
|
efdebc446c85f3b73258a669d67957ce512af76b
|
43314e29111065b1bf77fa74a864bec7818349ef
|
refs/heads/master
| 2023-05-06T12:48:51.978300
| 2017-07-27T02:05:37
| 2017-07-27T02:05:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,446
|
java
|
package com.erayic.agr.unit.adapter.entity;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import java.util.Map;
/**
* 作者:hejian
* 邮箱:hkceey@outlook.com
* 注解:
*/
public class UnitListItemByEnvironmentEntity implements MultiItemEntity {
public static final int TYPE_AIR_TEM = 0;//空气温度
public static final int TYPE_AIR_HUM = 1;//空气湿度
public static final int TYPE_SOIL_TEM = 2;//土壤温度
public static final int TYPE_SOIL_HUM = 3;//土壤湿度
public static final int TYPE_WATER = 4;//降水量
public static final int TYPE_ILL = 5;//光照强度
public static final int TYPE_WIND = 6;//风力
public static final int TYPE_CO2 = 7;//二氧化碳
private String name;
private String subName;
private Map<String,String> map;
private int itemType;
@Override
public int getItemType() {
return itemType;
}
public void setItemType(int itemType) {
this.itemType = itemType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSubName() {
return subName;
}
public void setSubName(String subName) {
this.subName = subName;
}
public Map<String, String> getMap() {
return map;
}
public void setMap(Map<String, String> map) {
this.map = map;
}
}
|
[
"hkceey@outlook.com"
] |
hkceey@outlook.com
|
77af3944a640dd60d5bb04e94271c2d5ba27024d
|
b481557b5d0e85a057195d8e2ed85555aaf6b4e7
|
/src/main/java/com/jlee/leetcodesolutions/LeetCode1089.java
|
fa1241349a70dc18023d6bfe33d71aebd727ed7c
|
[] |
no_license
|
jlee301/leetcodesolutions
|
b9c61d7fbe96bcb138a2727b69b3a39bbe153911
|
788ac8c1c95eb78eda27b21ecb7b29eea1c7b5a4
|
refs/heads/master
| 2021-06-05T12:27:42.795124
| 2019-08-11T23:04:07
| 2019-08-11T23:04:07
| 113,272,040
| 0
| 1
| null | 2020-10-12T23:39:27
| 2017-12-06T05:16:39
|
Java
|
UTF-8
|
Java
| false
| false
| 425
|
java
|
package com.jlee.leetcodesolutions;
public class LeetCode1089 {
/*
* https://leetcode.com/problems/duplicate-zeros/
*/
public void duplicateZeros(int[] arr) {
// [1,0,2,3,0,4,5,0]
for(int i = 0; i < arr.length; i++) {
if(arr[i] == 0) {
int j = arr.length-1;
while(j > i+1) {
arr[j] = arr[j-1];
j--;
}
arr[j] = 0;
i = j;
}
}
}
}
|
[
"john.m.lee@gmail.com"
] |
john.m.lee@gmail.com
|
0fc020d516492f88dffdabe421fec09db4e9b234
|
e0ce8cb64702eccce7f6940d283bc93e8f632745
|
/tags/1.1/src/org/jajim/interfaz/listeners/AceptarContactoActionListener.java
|
77305c9c9b6e1f15c8c868ed3b9608fde76794e7
|
[] |
no_license
|
BackupTheBerlios/jajim-svn
|
5842b35027d995358e605fbd2c5b61dc2b6f7e80
|
7fa2082094decb25e7765aaaebd611c418676f07
|
refs/heads/master
| 2021-01-01T17:56:36.627562
| 2013-12-06T20:16:30
| 2013-12-06T20:16:30
| 40,748,648
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,012
|
java
|
/*
Jabber client.
Copyright (C) 2010 Florencio Cañizal Calles
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.jajim.interfaz.listeners;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import org.jajim.controladores.ContactosControlador;
import org.jajim.excepciones.ImposibleAñadirContactoException;
import org.jajim.interfaz.dialogos.AceptarContactoFormulario;
import org.jajim.interfaz.dialogos.MensajeError;
/**
* @author Florencio Cañizal Calles
* @version 1.1
* Clase oyente que se ejecuta cuando se selecciona la opción aceptar del cuadro
* de diálogo de aceptar contacto. Utiliza los controladores para dar de alta al
* contacto.
*/
public class AceptarContactoActionListener implements ActionListener{
private AceptarContactoFormulario acf;
/**
* Constructor de la clase. Inicializa las variables necesarias.
* @param ctc Controlador de los contactos.
*/
public AceptarContactoActionListener(AceptarContactoFormulario acf){
this.acf = acf;
}
/**
* Método que se ejecuta cuando se selecciona la opción aceptar del cuadro de
* diálogo de aceptar contacto. Utiliza los controladores para dar de alta al
* contacto.
* @param e Evento que produce la ejecución del método.
*/
@Override
public void actionPerformed(ActionEvent e){
// Conseguir la información introducida por el usuario y el contacto que
// se va añadir
List<String> campos = acf.getCampos();
String contacto = campos.get(0);
String alias = campos.get(1);
String grupo = campos.get(2);
// Comprabar si los campos introducidos son correctos.
if(contacto.compareTo("") == 0 || alias.compareTo("") == 0){
new MensajeError(acf,"campos_invalidos_error",MensajeError.WARNING);
}
// Llamar al controlador de contactos para que realice las operaciones ne
// cesarias.
try{
ContactosControlador ctc = ContactosControlador.getInstancia();
ctc.aceptarContacto(contacto,alias,grupo);
// Cerrar el cuadro de diálogo
acf.dispose();
}catch(ImposibleAñadirContactoException iace){
new MensajeError(acf,"imposible_añadir_contacto_error",MensajeError.ERR);
acf.dispose();
}
}
}
|
[
"npi83@66271abf-8d89-0410-bfa2-80b8d0f357ea"
] |
npi83@66271abf-8d89-0410-bfa2-80b8d0f357ea
|
935eb17f4038423d6bf4dc6e412f693538cb4237
|
471579962eb0abf949c73685353ef0098a8ad127
|
/HelloGradle/src/main/java/com/ytgrading/bean/DepositForm.java
|
c0486e078e137a986afd4f383a53f98ec53f4824
|
[] |
no_license
|
huyulin11/gradle
|
a727c7e31b9a42aee6decd5d6a5f5ceac84180f3
|
3cdc3b8b02e9f48af93d1cc6087b61f67cf45a0e
|
refs/heads/master
| 2020-04-13T07:09:16.437325
| 2019-02-26T03:20:13
| 2019-02-26T03:20:13
| 163,042,029
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,446
|
java
|
package com.ytgrading.bean;
public class DepositForm {
private String entitytype;
private String innerno;
private String deposittimestart;
private String deposittimeend;
private String amountstart;
private String amountend;
private String amount;
private String depositstatus;
public String getEntitytype() {
return entitytype;
}
public void setEntitytype(String entitytype) {
this.entitytype = entitytype;
}
public String getInnerno() {
return innerno;
}
public void setInnerno(String innerno) {
this.innerno = innerno;
}
public String getDeposittimestart() {
return deposittimestart;
}
public void setDeposittimestart(String deposittimestart) {
this.deposittimestart = deposittimestart;
}
public String getDeposittimeend() {
return deposittimeend;
}
public void setDeposittimeend(String deposittimeend) {
this.deposittimeend = deposittimeend;
}
public String getAmountstart() {
return amountstart;
}
public void setAmountstart(String amountstart) {
this.amountstart = amountstart;
}
public String getAmountend() {
return amountend;
}
public void setAmountend(String amountend) {
this.amountend = amountend;
}
public String getAmount() {
return amount;
}
public void setAmount(String amount) {
this.amount = amount;
}
public String getDepositstatus() {
return depositstatus;
}
public void setDepositstatus(String depositstatus) {
this.depositstatus = depositstatus;
}
}
|
[
"huyulin11@sina.cn"
] |
huyulin11@sina.cn
|
27ada6d025e6a17ab7f9f6a6c961e283bccbac68
|
4fe05b350c2157f9153f369cb052ff1fd5b15edf
|
/src/main/java/com/dipgen/service/security/UserService.java
|
318c5675e3896e7de4819fab7b0517ec0afdf1f9
|
[
"BSD-3-Clause"
] |
permissive
|
jirkapinkas/dipgen
|
fb5d281e1de69b85bb2446cac162e987c16b2d30
|
a71cc945d2d47685ca3abbe90546b303aab67071
|
refs/heads/master
| 2020-05-30T04:27:44.684396
| 2013-10-28T08:40:35
| 2013-10-28T08:40:35
| 12,518,111
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,319
|
java
|
package com.dipgen.service.security;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.dipgen.entity.security.Role;
import com.dipgen.entity.security.Role.ROLE_TYPE;
import com.dipgen.entity.security.User;
import com.dipgen.repository.security.RoleRepository;
import com.dipgen.repository.security.UserRepository;
@SuppressWarnings("deprecation")
@Service
@Transactional
public class UserService {
@Autowired
private UserRepository userRepository;
@Autowired
private RoleRepository roleRepository;
public List<User> findAll() {
return userRepository.findAllUsersWithRoles();
}
public User create(User user) {
user.setEnabled(true);
user.setRegistrationDate(new Date());
PasswordEncoder encoder = new Md5PasswordEncoder();
String hashedPass = encoder.encodePassword(user.getPassword(), null);
user.setPassword(hashedPass);
return userRepository.save(user);
}
public User update(User user) {
return userRepository.save(user);
}
public User updateWithNewPassword(User user) {
PasswordEncoder encoder = new Md5PasswordEncoder();
String hashedPass = encoder.encodePassword(user.getPassword(), null);
user.setPassword(hashedPass);
return userRepository.save(user);
}
public User findOne(int userId) {
return userRepository.findOne(userId);
}
public User findOne(String name) {
return userRepository.findByName(name);
}
public void assignRole(int userId, int roleId) {
User user = userRepository.findOne(userId);
user.getRoles().add(roleRepository.findOne(roleId));
}
public boolean isPremium(String username) {
User user = userRepository.findByName(username);
List<Role> userRoles = user.getRoles();
for (Role role : userRoles) {
if (role.getName() == ROLE_TYPE.ROLE_PREMIUM) {
return true;
}
}
return false;
}
public void delete(int userId) {
userRepository.delete(userId);
}
public void deactivate(String name) {
User user = userRepository.findByName(name);
user.setEnabled(false);
}
}
|
[
"jirka.pinkas@gmail.com"
] |
jirka.pinkas@gmail.com
|
b48f870a811ea91afa64a406bd801cadfba3b0bb
|
8c9b743f156307cfb8781f95d2039f3697305b78
|
/src/com/gargoylesoftware/htmlunit/javascript/host/event/MediaStreamEvent.java
|
7790b0b43aac6b575f0398318c97e80769faea1b
|
[] |
no_license
|
jiafenggit/HtmlUnitTao
|
f8fbd9065b03b6cd0f3a4ce1db6b4fbfd4941000
|
ede3e10603d16f022b60798ea340c392f57495f7
|
refs/heads/master
| 2021-04-28T23:46:58.642674
| 2016-03-15T08:08:02
| 2016-03-15T08:08:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,403
|
java
|
/*
* Copyright (c) 2002-2015 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gargoylesoftware.htmlunit.javascript.host.event;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor;
import com.gargoylesoftware.htmlunit.javascript.configuration.WebBrowser;
/**
* A JavaScript object for {@code MediaStreamEvent}.
*
* @version $Revision: 10589 $
* @author Ahmed Ashour
*/
@JsxClass(browsers = { @WebBrowser(CHROME), @WebBrowser(FF) })
public class MediaStreamEvent extends Event {
/**
* Creates an instance.
*/
@JsxConstructor
public MediaStreamEvent() {
}
}
|
[
"jeruen@gmail.com"
] |
jeruen@gmail.com
|
6265bc54daa36bd52d1986d6454e07b5e1503352
|
fd1a5a6d21948d3e50742d617b40146acd326609
|
/src/examples/eAgenda/data/Meeting.java
|
dbf7fe75a0ad63c3a6234ec1f8083459fec0d299
|
[] |
no_license
|
Droop/DimaX
|
468c0b85c197695d8a4c044079539a729551fa69
|
886410ead3d8d89f7b517efa0e1245bc66773fa9
|
refs/heads/master
| 2021-01-01T05:41:32.873760
| 2011-12-12T14:53:12
| 2011-12-12T14:53:12
| 2,634,865
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,871
|
java
|
package examples.eAgenda.data;
import java.io.Serializable;
import java.util.ArrayList;
/** Structure for a meeting within the agenda */
public class Meeting extends Activity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -593275503402727257L;
int[] durationSet;
boolean selfNecessary;
Day limitDay;
People necessaryMembers;
People otherMembers;
/** Time in millisecond before wich the meeting should not take place */
long startLimit;
public Meeting() {
this("","", new int[2], null, null, null, true, false, System.currentTimeMillis());
}
public Meeting(final String titl, final int mini, final int maxi, final Day valid, final People necessary, final People wished, final boolean movable) {
this(titl, "", null, valid, necessary, wished, true, movable, System.currentTimeMillis());
this.setDuration(mini, maxi);
}
/** Create a meeting that may start from now */
public Meeting(final String titl, final String descript, final int[] duration, final Day valid, final People necessary, final People wished, final boolean selfNecess, final boolean movable) {
this(titl, descript, duration, valid, necessary, wished, selfNecess, movable, System.currentTimeMillis());
}
public Meeting(final String titl, final String descript, final int[] duration, final Day valid, final People necessary, final People wished, final boolean selfNecess, final boolean movable, final long sLimit) {
super(titl, descript, movable);
this.durationSet = duration;
this.limitDay = valid;
this.necessaryMembers = necessary;
this.otherMembers = wished;
this.selfNecessary = selfNecess;
this.startLimit = sLimit;
}
public ArrayList getAllParticipants() {
final ArrayList res = this.necessaryMembers.getCanonicalList();
res.addAll(this.otherMembers.getCanonicalList());
return res;
}
public ArrayList getNecessParticipants() {
if (this.necessaryMembers.getSize()!=0) {
final ArrayList res = this.necessaryMembers.getCanonicalList();
return res;}
else return new ArrayList();
}
public int[] getDurationSet() {
return this.durationSet;
}
public Day getLimitDay() {
return this.limitDay;
}
public People getNecessaryParticipants() {
return this.necessaryMembers;
}
public People getOtherParticipants() {
return this.otherMembers;
}
/** Time in millisecond before wich the meeting should not take place */
public long getStartLimit() {
return this.startLimit;
}
public boolean isSelfNecessary() {
return this.selfNecessary;
}
public void setDuration(final int mini, final int maxi) {
this.durationSet[0] = mini;
this.durationSet[1] = maxi;
}
public void setLimitDay(final Day d) {
this.limitDay = d;
}
public void setSelfNecessary(final boolean b) {
this.selfNecessary = b;
}
}
|
[
"sylvain.ductor@lip6.fr"
] |
sylvain.ductor@lip6.fr
|
0149f51b7449573b01ab66bea6be51a6f407d021
|
369270a14e669687b5b506b35895ef385dad11ab
|
/java.corba/org/omg/CORBA/WrongTransactionHelper.java
|
4e77ec60b5d3307caf313e7144b1aadca746d58e
|
[] |
no_license
|
zcc888/Java9Source
|
39254262bd6751203c2002d9fc020da533f78731
|
7776908d8053678b0b987101a50d68995c65b431
|
refs/heads/master
| 2021-09-10T05:49:56.469417
| 2018-03-20T06:26:03
| 2018-03-20T06:26:03
| 125,970,208
| 3
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,450
|
java
|
/*
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.omg.CORBA;
/**
* The Helper for {@code WrongTransaction}. For more information on
* Helper files, see <a href="doc-files/generatedfiles.html#helper">
* "Generated Files: Helper Files"</a>.<P>
* org/omg/CORBA/WrongTransactionHelper.java
* Generated by the IDL-to-Java compiler (portable), version "3.0"
* from CORBA.idl
* Thursday, August 24, 2000 5:32:50 PM PDT
*/
abstract public class WrongTransactionHelper
{
private static String _id = "IDL:omg.org/CORBA/WrongTransaction:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.WrongTransaction that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.CORBA.WrongTransaction extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
private static boolean __active = false;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
synchronized (org.omg.CORBA.TypeCode.class)
{
if (__typeCode == null)
{
if (__active)
{
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
}
__active = true;
org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [0];
org.omg.CORBA.TypeCode _tcOf_members0 = null;
__typeCode = org.omg.CORBA.ORB.init ().create_exception_tc (org.omg.CORBA.WrongTransactionHelper.id (), "WrongTransaction", _members0);
__active = false;
}
}
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.CORBA.WrongTransaction read (org.omg.CORBA.portable.InputStream istream)
{
org.omg.CORBA.WrongTransaction value = new org.omg.CORBA.WrongTransaction ();
// read and discard the repository ID
istream.read_string ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.WrongTransaction value)
{
// write the repository ID
ostream.write_string (id ());
}
}
|
[
"841617433@qq.com"
] |
841617433@qq.com
|
06c47c5571f84334f7898f55ce534597ef9ce899
|
899ffb948407321ec358a3d9c2d99038b54f0bc5
|
/lipang-li_chung-yang_001270144-0b29d9b83aeb/finalProject/src/UserInterface/CustodianEnterprise/TradingManagerWorkAreaJPanel.java
|
ad30bd0c1d5bf10af26c7c687f8ae534db99cae4
|
[] |
no_license
|
t0912398031/INFO-5100
|
78932a82973303851059ac24e4d1fd9d6262e320
|
f4106c3ac354fe7c64c9e0a88cd8fcc934caea31
|
refs/heads/master
| 2020-03-21T02:01:53.928611
| 2018-06-20T04:17:42
| 2018-06-20T04:17:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,285
|
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 UserInterface.CustodianEnterprise;
import UserInterface.AdminRole.*;
import Business.EcoSystem;
import Business.Enterprise.CustodyEnterprise;
import Business.Enterprise.Enterprise;
import Business.Organization.AccountingOrg;
import Business.Organization.AdminOrg;
import Business.Organization.Organization;
import Business.Organization.TradingOrg;
import Business.UserAccount.UserAccount;
import UserInterface.ShortMessage.ShortMessageJPanel;
import java.awt.CardLayout;
import javax.swing.JPanel;
/**
*
* @author Chung-Yang Li
*/
public class TradingManagerWorkAreaJPanel extends javax.swing.JPanel {
/**
* Creates new form AccountingWorkAreaJPanel
*/
private JPanel upc;
private TradingOrg organization;
private UserAccount account;
private Enterprise enterprise;
private EcoSystem ecoSystem;
public TradingManagerWorkAreaJPanel(JPanel upc, UserAccount account, TradingOrg organization, Enterprise enterprise, EcoSystem ecoSystem) {
initComponents();
this.upc = upc;
this.account = account;
this.organization = organization;
this.enterprise = enterprise;
this.ecoSystem = ecoSystem;
setBackground(new java.awt.Color(255, 255, 153));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel4 = new javax.swing.JLabel();
btnManageOrg = new javax.swing.JButton();
InMail = new javax.swing.JButton();
InMail1 = new javax.swing.JButton();
lbl_show_thephoto = new javax.swing.JLabel();
jLabel4.setFont(new java.awt.Font("新細明體", 0, 24)); // NOI18N
jLabel4.setText("Trading Manager Work Area");
btnManageOrg.setText("Trading");
btnManageOrg.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnManageOrgActionPerformed(evt);
}
});
InMail.setText("InMail");
InMail.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
InMailActionPerformed(evt);
}
});
InMail1.setText("Manage Rate");
InMail1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
InMail1ActionPerformed(evt);
}
});
lbl_show_thephoto.setBackground(new java.awt.Color(255, 255, 204));
lbl_show_thephoto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/manager.png"))); // NOI18N
lbl_show_thephoto.setOpaque(true);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnManageOrg, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(InMail, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(InMail1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lbl_show_thephoto)
.addGap(71, 71, 71))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(btnManageOrg)
.addGap(18, 18, 18)
.addComponent(InMail)
.addGap(18, 18, 18)
.addComponent(InMail1))
.addComponent(lbl_show_thephoto, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(288, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
private void btnManageOrgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnManageOrgActionPerformed
TradingJPanel mojp = new TradingJPanel(upc, account,organization,enterprise, ecoSystem);
upc.add("TradingJPanel", mojp);
CardLayout cardLayout = (CardLayout) upc.getLayout();
cardLayout.next(upc);// TODO add your handling code here:
}//GEN-LAST:event_btnManageOrgActionPerformed
private void InMailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InMailActionPerformed
ShortMessageJPanel smjp = new ShortMessageJPanel(upc, account, ecoSystem);
upc.add("ShortMessageJPanel_SysAdmin", smjp);
CardLayout layout = (CardLayout) upc.getLayout();
layout.next(upc);
}//GEN-LAST:event_InMailActionPerformed
private void InMail1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InMail1ActionPerformed
CustodyEnterprise ce = (CustodyEnterprise)enterprise;
ManageRateJPanel smjp = new ManageRateJPanel(upc, ce, ecoSystem);
upc.add("ManageRateJPanel", smjp);
CardLayout layout = (CardLayout) upc.getLayout();
layout.next(upc);// TODO add your handling code here:
}//GEN-LAST:event_InMail1ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton InMail;
private javax.swing.JButton InMail1;
private javax.swing.JButton btnManageOrg;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel lbl_show_thephoto;
// End of variables declaration//GEN-END:variables
}
|
[
"you@example.com"
] |
you@example.com
|
18cc0d4a7f016527e687f9af20b595532a4be0f3
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/eclipsejdt_cluster/68637/tar_1.java
|
3d6a8d338518bd19e5797e6120b325a00638efb7
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,076
|
java
|
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.core.dom;
import java.util.List;
/**
* Instanceof expression AST node type.
* <pre>
* InstanceofExpression:
* Expression <b>instanceof</b> Type
* </pre>
*
* @since 2.0
*/
public class InstanceofExpression extends Expression {
/**
* The "leftOperand" structural property of this node type.
* @since 3.0
*/
public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY =
new ChildPropertyDescriptor(InstanceofExpression.class, "leftOperand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
/**
* The "rightOperand" structural property of this node type.
* @since 3.0
*/
public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY =
new ChildPropertyDescriptor(InstanceofExpression.class, "rightOperand", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$
/**
* A list of property descriptors (element type:
* {@link StructuralPropertyDescriptor}),
* or null if uninitialized.
*/
private static final List PROPERTY_DESCRIPTORS;
static {
createPropertyList(InstanceofExpression.class);
addProperty(LEFT_OPERAND_PROPERTY);
addProperty(RIGHT_OPERAND_PROPERTY);
PROPERTY_DESCRIPTORS = reapPropertyList();
}
/**
* Returns a list of structural property descriptors for this node type.
* Clients must not modify the result.
*
* @param apiLevel the API level; one of the
* <code>AST.LEVEL_*</code>LEVEL
* @return a list of property descriptors (element type:
* {@link StructuralPropertyDescriptor})
* @since 3.0
*/
public static List propertyDescriptors(int apiLevel) {
return PROPERTY_DESCRIPTORS;
}
/**
* The left operand; lazily initialized; defaults to an unspecified,
* but legal, simple name.
*/
private Expression leftOperand = null;
/**
* The right operand; lazily initialized; defaults to an unspecified,
* but legal, simple type.
*/
private Type rightOperand = null;
/**
* Creates a new AST node for an instanceof expression owned by the given
* AST. By default, the node has unspecified (but legal) operator,
* left and right operands.
*
* @param ast the AST that is to own this node
*/
InstanceofExpression(AST ast) {
super(ast);
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
final List internalStructuralPropertiesForType(int apiLevel) {
return propertyDescriptors(apiLevel);
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
if (property == LEFT_OPERAND_PROPERTY) {
if (get) {
return getLeftOperand();
} else {
setLeftOperand((Expression) child);
return null;
}
}
if (property == RIGHT_OPERAND_PROPERTY) {
if (get) {
return getRightOperand();
} else {
setRightOperand((Type) child);
return null;
}
}
// allow default implementation to flag the error
return super.internalGetSetChildProperty(property, get, child);
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
public int getNodeType() {
return INSTANCEOF_EXPRESSION;
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
ASTNode clone0(AST target) {
InstanceofExpression result = new InstanceofExpression(target);
result.setSourceRange(this.getStartPosition(), this.getLength());
result.setLeftOperand((Expression) getLeftOperand().clone(target));
result.setRightOperand((Type) getRightOperand().clone(target));
return result;
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
public boolean subtreeMatch(ASTMatcher matcher, Object other) {
// dispatch to correct overloaded match method
return matcher.match(this, other);
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
void accept0(ASTVisitor visitor) {
boolean visitChildren = visitor.visit(this);
if (visitChildren) {
// visit children in normal left to right reading order
acceptChild(visitor, getLeftOperand());
acceptChild(visitor, getRightOperand());
}
visitor.endVisit(this);
}
/**
* Returns the left operand of this instanceof expression.
*
* @return the left operand node
*/
public Expression getLeftOperand() {
if (this.leftOperand == null) {
preLazyInit();
this.leftOperand= new SimpleName(this.ast);
postLazyInit(this.leftOperand, LEFT_OPERAND_PROPERTY);
}
return this.leftOperand;
}
/**
* Sets the left operand of this instanceof expression.
*
* @param expression the left operand node
* @exception IllegalArgumentException if:
* <ul>
* <li>the node belongs to a different AST</li>
* <li>the node already has a parent</li>
* <li>a cycle in would be created</li>
* </ul>
*/
public void setLeftOperand(Expression expression) {
if (expression == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.leftOperand;
preReplaceChild(oldChild, expression, LEFT_OPERAND_PROPERTY);
this.leftOperand = expression;
postReplaceChild(oldChild, expression, LEFT_OPERAND_PROPERTY);
}
/**
* Returns the right operand of this instanceof expression.
*
* @return the right operand node
*/
public Type getRightOperand() {
if (this.rightOperand == null) {
preLazyInit();
this.rightOperand= new SimpleType(this.ast);
postLazyInit(this.rightOperand, RIGHT_OPERAND_PROPERTY);
}
return this.rightOperand;
}
/**
* Sets the right operand of this instanceof expression.
*
* @param referenceType the right operand node
* @exception IllegalArgumentException if:
* <ul>
* <li>the node belongs to a different AST</li>
* <li>the node already has a parent</li>
* <li>a cycle in would be created</li>
* </ul>
*/
public void setRightOperand(Type referenceType) {
if (referenceType == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.rightOperand;
preReplaceChild(oldChild, referenceType, RIGHT_OPERAND_PROPERTY);
this.rightOperand = referenceType;
postReplaceChild(oldChild, referenceType, RIGHT_OPERAND_PROPERTY);
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
int memSize() {
// treat Operator as free
return BASE_NODE_SIZE + 2 * 4;
}
/* (omit javadoc for this method)
* Method declared on ASTNode.
*/
int treeSize() {
return
memSize()
+ (this.leftOperand == null ? 0 : getLeftOperand().treeSize())
+ (this.rightOperand == null ? 0 : getRightOperand().treeSize());
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
d9b8fe16fa0dbb9c8d9ee90cf651abf205e687a0
|
fc4e0c9d846bddb5768fde39ee07284a668a1e75
|
/0013_RomanToInt/Solution.java
|
bf3c56033c14eb0aebabddfd94f1ffb845b7178e
|
[] |
no_license
|
chialin-liu/Leetcode
|
d9f9ce94ac8cc3bdb71145d9fc59d7c2311e4ef7
|
bf5ee75fe266353ce574d8aa38973f325b239079
|
refs/heads/master
| 2020-06-19T09:48:08.036214
| 2020-03-14T09:55:00
| 2020-03-14T09:55:00
| 196,667,938
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 736
|
java
|
class Solution {
public int romanToInt(String s) {
int res = toNumber(s.charAt(0));
for(int i = 1; i < s.length(); i++){
if(toNumber(s.charAt(i)) > toNumber(s.charAt(i - 1))){
res += toNumber(s.charAt(i)) - 2 * toNumber(s.charAt(i - 1));
}
else{
res += toNumber(s.charAt(i));
}
}
return res;
}
public int toNumber(char s){
switch(s){
case 'I': return 1;
case 'V': return 5;
case 'X': return 10;
case 'L': return 50;
case 'C': return 100;
case 'D': return 500;
case 'M': return 1000;
}
return -1;
}
}
|
[
"charles.ee96@g2.nctu.edu.tw"
] |
charles.ee96@g2.nctu.edu.tw
|
2c955f6613d5d25e52d76125a304dcb4700d38e7
|
e8f7a323c46dd047460d9db5a899d1917f0dd332
|
/jbpm-designer-extensions-backend/src/main/java/org/jbpm/designer/extensions/emf/util/ShapeMap.java
|
0b9f52e169de4ed476c40553c386080d9d71e486
|
[] |
no_license
|
ifu-lobuntu/jbpm-designer-extensions
|
cc1e67366ea23bf4b7129730c502868a5f5e2035
|
8166cb1064b4e830d04346381f441a2e9830219d
|
refs/heads/master
| 2020-12-21T21:02:46.439177
| 2016-08-07T07:38:16
| 2016-08-07T07:38:16
| 31,703,967
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,520
|
java
|
package org.jbpm.designer.extensions.emf.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.jbpm.designer.extensions.api.StencilInfo;
import org.jbpm.designer.extensions.diagram.Shape;
import org.jbpm.designer.extensions.diagram.ShapeReference;
import org.omg.dd.di.DiagramElement;
public class ShapeMap {
private class Mapping {
Shape shape;
DiagramElement diagramElement;
public Mapping(Shape shape, DiagramElement diagramElement) {
super();
this.shape = shape;
this.diagramElement = diagramElement;
}
}
private Map<String, Mapping> shapeMap = new HashMap<String, Mapping>();
private Map<DiagramElement, Shape> diagramElementToShapeMap = new HashMap<DiagramElement, Shape>();
private Map<EObject, DiagramElement> modelElementToDiagramElementMap = new HashMap<EObject, DiagramElement>();
private XMLResource resource;
public ShapeMap(XMLResource resource) {
super();
this.resource = resource;
}
public void linkElements(DiagramElement de, Shape shape) {
this.shapeMap.put(shape.getResourceId(), new Mapping(shape, de));
if(de.getModelElement()!=null){
this.modelElementToDiagramElementMap.put(getModelElement(de), de);
}
this.diagramElementToShapeMap.put(de, shape);
}
protected EObject getModelElement(DiagramElement de) {
return de.getModelElement().isEmpty()?null:de.getModelElement().get(0);
}
public Shape getShape(DiagramElement de) {
return diagramElementToShapeMap.get(de);
}
public DiagramElement getDiagramElement(Shape shape) {
return shapeMap.get(shape.getResourceId()).diagramElement;
}
public Collection<Shape> values() {
Set<Shape> result = new HashSet<Shape>();
for (Mapping mapping : shapeMap.values()) {
result.add(mapping.shape);
}
return result;
}
public Shape get(String resourceId) {
return shapeMap.get(resourceId).shape;
}
public Shape get(ShapeReference ref) {
return get(ref.getResourceId());
}
public Map<Shape, Set<Shape>> buildIncomingMap() {
Map<Shape, Set<Shape>> incomingMap = new HashMap<Shape, Set<Shape>>();
for (Shape shape : values()) {
for (ShapeReference sr : shape.getOutgoing()) {
Shape outgoing = get(sr);
Set<Shape> set = incomingMap.get(outgoing);
if (set == null) {
incomingMap.put(outgoing, set = new HashSet<Shape>());
}
set.add(shape);
}
}
return incomingMap;
}
public XMLResource getResource() {
return resource;
}
public EObject getModelElement(String resourceId) {
Mapping mapping = this.shapeMap.get(resourceId);
DiagramElement de = mapping.diagramElement;
return getModelElement(de);
}
public DiagramElement getDiagramElement(String resourceId) {
return this.shapeMap.get(resourceId).diagramElement;
}
public Shape getShape(EObject element) {
return get(getId(element));
}
public String getId(EObject modelElement) {
return JBPMECoreHelper.getID(modelElement);
}
public <T extends EObject> List<T> getOutgoingModelElements(Shape shape, StencilInfo ... stencils){
List<T> result = new ArrayList<T>();
for (ShapeReference sr : shape.getOutgoing()) {
for (StencilInfo si : stencils) {
if(get(sr).getStencilId().equals(si.getStencilId())){
result.add((T) getModelElement(sr.getResourceId()));
break;
}
}
}
return result;
}
public <T extends EObject> T findEObjectById(String resourceId) {
EObject r = this.resource.getEObject(resourceId);
if(r==null){
for (Resource resource : this.resource.getResourceSet().getResources()) {
r=resource.getEObject(resourceId);
if(r!=null){
break;
}
}
}
return (T) r;
}
}
|
[
"ampieb@gmail.com"
] |
ampieb@gmail.com
|
3a5b989806caee44869a5cf67512681cb5cd1f72
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/eclipsejdt_cluster/10908/tar_1.java
|
d99a852b862741a2a8b7deef3915efcf0b2a5ba7
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,951
|
java
|
package org.eclipse.jdt.internal.core;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.core.resources.*;
import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.jdom.*;
/**
* <p>This operation creates an instance method.
*
* <p>Required Attributes:<ul>
* <li>Containing type
* <li>The source code for the method. No verification of the source is
* performed.
* </ul>
*/
public class CreateMethodOperation extends CreateTypeMemberOperation {
protected String[] fParameterTypes;
/**
* When executed, this operation will create a method
* in the given type with the specified source.
*/
public CreateMethodOperation(IType parentElement, String source, boolean force) {
super(parentElement, source, force);
}
/**
* Returns the type signatures of the parameter types of the
* current <code>DOMMethod</code>
*/
protected String[] convertDOMMethodTypesToSignatures() {
if (fParameterTypes == null) {
if (fDOMNode != null) {
String[] domParameterTypes = ((IDOMMethod)fDOMNode).getParameterTypes();
if (domParameterTypes != null) {
fParameterTypes = new String[domParameterTypes.length];
// convert the DOM types to signatures
int i;
for (i = 0; i < fParameterTypes.length; i++) {
fParameterTypes[i] = Signature.createTypeSignature(domParameterTypes[i].toCharArray(), false);
}
}
}
}
return fParameterTypes;
}
/**
* @see CreateTypeMemberOperation#generateElementDOM
*/
protected IDOMNode generateElementDOM() throws JavaModelException {
if (fDOMNode == null) {
fDOMNode = (new DOMFactory()).createMethod(fSource);
if (fDOMNode == null) { //syntactically incorrect source
fDOMNode = generateSyntaxIncorrectDOM();
}
if (fAlteredName != null && fDOMNode != null) {
fDOMNode.setName(fAlteredName);
}
}
return fDOMNode;
}
/**
* @see CreateElementInCUOperation#generateResultHandle
*/
protected IJavaElement generateResultHandle() {
String[] types = convertDOMMethodTypesToSignatures();
String name;
if (((IDOMMethod) fDOMNode).isConstructor()) {
name = fDOMNode.getParent().getName();
} else {
name = fDOMNode.getName();
}
return getType().getMethod(name, types);
}
/**
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
return Util.bind("operation.createMethodProgress"/*nonNLS*/);
}
/**
* @see CreateTypeMemberOperation#verifyNameCollision
*/
protected IJavaModelStatus verifyNameCollision() {
if (fDOMNode != null) {
IType type = getType();
String name = fDOMNode.getName();
if (name == null) { //constructor
name = type.getElementName();
}
String[] types = convertDOMMethodTypesToSignatures();
if (type.getMethod(name, types).exists()) {
return new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION);
}
}
return JavaModelStatus.VERIFIED_OK;
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
bed185710602c7e4e7f9e987eb95aa10107443a4
|
ce72413687bb0b9ebdc37c8df9a92ecd74dbd1a3
|
/scripts/rad/Event.java
|
c1790e3d081e7d9cacbbf86cafd3f2d2e22f490c
|
[] |
no_license
|
luiz158/jdf-collateral
|
ac7672bff1fb2d0754419e7254ccf9410712e4c8
|
27894943fd85077e724193e63c404ce4ff650dad
|
refs/heads/master
| 2020-12-30T20:05:33.233149
| 2014-03-26T09:46:15
| 2014-03-26T09:46:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,530
|
java
|
package com.acme.model;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@SuppressWarnings("serial")
@Entity
public class Event implements java.io.Serializable
{
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(updatable = false, nullable = false)
private Long id = null;
private String name;
private String description;
private String picture;
@ManyToMany
private Collection<Member> attendees = new ArrayList<Member>();
public String getDescription()
{
return this.description;
}
public Long getId()
{
return this.id;
}
public String getName()
{
return this.name;
}
public String getPicture()
{
return this.picture;
}
public void setDescription(final String description)
{
this.description = description;
}
public void setId(final Long id)
{
this.id = id;
}
public void setName(final String name)
{
this.name = name;
}
public void setPicture(final String picture)
{
this.picture = picture;
}
public Collection<Member> getAttendees()
{
return attendees;
}
public void setAttendees(Collection<Member> attendees)
{
this.attendees = attendees;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Event other = (Event) obj;
if (name == null)
{
if (other.name != null)
return false;
}
else if (!name.equals(other.name))
return false;
return true;
}
@Override
public String toString()
{
String result = "";
if (name != null && !name.trim().isEmpty())
result += name;
if (description != null && !description.trim().isEmpty())
result += " " + description;
if (picture != null && !picture.trim().isEmpty())
result += " " + picture;
return result;
}
}
|
[
"pmuir@bleepbleep.org.uk"
] |
pmuir@bleepbleep.org.uk
|
3590e7d58e78c6929e50e5cbe68d6ec20a3e4dbf
|
81597b9d6b50df808035699d741a4e6cb994398e
|
/study_pdf/src/main/java/com/spinach/frame/itextpdf/javaone/edition14/part1/Sample07_CorrectedWatermark.java
|
01563e2630460840532536bd9e5c5a986f0e9d40
|
[] |
no_license
|
spinachgit/study_frame_third
|
d78fa794c39adbaaa708eae6c05e4d9ed30eb32f
|
23fe388e291ffff7a5da7d0987117e3106d024d2
|
refs/heads/master
| 2021-05-12T18:19:08.267682
| 2018-03-04T06:27:22
| 2018-03-04T06:27:22
| 113,398,256
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,555
|
java
|
/*
* This code sample was written in the context of
*
* JavaOne 2014: PDF is dead. Long live PDF... and Java!
* Tutorial Session by Bruno Lowagie and Raf Hens
*
* Copyright 2014, iText Group NV
*/
package com.spinach.frame.itextpdf.javaone.edition14.part1;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Font.FontFamily;
import com.itextpdf.text.Phrase;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.ColumnText;
import com.itextpdf.text.pdf.PdfContentByte;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
/**
* Example that shows how NOT to watermark a less simple PDF.
*/
public class Sample07_CorrectedWatermark {
/** The original PDF file. */
public static final String SRC
= "src/main/webapp/resources/itextpdf/pdfs/superman.pdf";
/** The resulting PDF file. */
public static final String DEST
= "results/javaone/edition2014/part1/correct_watermark.pdf";
/**
* Fills out an interactive form.
* @param args no arguments needed
* @throws DocumentException
* @throws IOException
*/
public static void main(String[] args) throws DocumentException, IOException {
File file = new File(DEST);
file.getParentFile().mkdirs();
new Sample07_CorrectedWatermark().manipulatePdf(SRC, DEST);
}
/**
* Fills out and flattens a form with the name, company and country.
* @param src the path to the original form
* @param dest the path to the filled out form
* @throws DocumentException
* @throws IOException
*/
public void manipulatePdf(String src, String dest) throws DocumentException, IOException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
int n = reader.getNumberOfPages();
Rectangle pagesize;
for (int i = 1; i <= n; i++) {
PdfContentByte over = stamper.getOverContent(i);
pagesize = reader.getPageSize(i);
float x = (pagesize.getLeft() + pagesize.getRight()) / 2;
float y = (pagesize.getBottom() + pagesize.getTop()) / 2;
ColumnText.showTextAligned(over, Element.ALIGN_CENTER, new Phrase("Watermark", new Font(FontFamily.HELVETICA, 40)), x, y, 45);
}
stamper.close();
reader.close();
}
}
|
[
"1043204960@qq.com"
] |
1043204960@qq.com
|
e36254576c279ff2348f324230ff8a143be2976a
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/validation/org/glassfish/jersey/server/model/InnerClassWithGenericTypeTest.java
|
4c1a919e7a391863cf536c368d4db5a3e205fc11
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 3,346
|
java
|
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2010-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package org.glassfish.jersey.server.model;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import org.glassfish.jersey.server.ApplicationHandler;
import org.junit.Assert;
import org.junit.Test;
import static org.glassfish.jersey.server.RequestContextBuilder.from;
/**
* Taken from Jersey-1: jersey-tests:com.sun.jersey.impl.subresources.InnerClassWithGenericTypeTest
*
* @author Paul Sandoz
*/
public class InnerClassWithGenericTypeTest {
ApplicationHandler app;
@Path("/")
public static class RootResource {
@Path("sub")
public InnerClassWithGenericTypeTest.RootResource.SubResource getSub() {
return new InnerClassWithGenericTypeTest.RootResource.SubResource(new ArrayList<String>(), new HashSet<Integer>());
}
public class SubResource extends InnerClassWithGenericTypeTest.RootResource {
public SubResource(List<String> list, Set<Integer> s) {
}
@GET
public String get() {
return "sub";
}
}
}
@Test
public void testInnerClass() throws Exception {
app = createApplication(InnerClassWithGenericTypeTest.RootResource.class);
Assert.assertEquals("sub", app.apply(from("/sub", "GET").build()).get().getEntity());
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
25fa0787d380d05d2d9805e616673e50d15becd0
|
4e84c9dbc699cfdf090a2872a7e2bdf79b9dc971
|
/fanweHybridLive/src/main/java/com/fanwe/xianrou/manager/ImageViewManager.java
|
c15f187e919a415c87fc1aa8d0c1e91e136e93d3
|
[] |
no_license
|
nickoo123/FanweLive11
|
d994f5b6d36a0dd7ac06858f8c78239bfca629a4
|
2cecccf5c6795c4492f6c9d213d6cf27b6188dd4
|
refs/heads/master
| 2023-03-19T18:17:29.493984
| 2020-03-20T08:50:41
| 2020-03-20T08:50:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,932
|
java
|
package com.fanwe.xianrou.manager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
public class ImageViewManager {
private Bitmap[] mBitmaps = null;
private ImageView[] mItems = null;
private int mCurrentIndex = -1;
public int getCurrentIndex() {
return mCurrentIndex;
}
public void setItems(ImageView[] items, Bitmap[] bitmaps) {
if (items != null && items.length > 0) {
mItems = items;
mBitmaps = bitmaps;
for (int i = 0; i < mItems.length; i++) {
mItems[i].setId(i);
mItems[i].setImageBitmap(mBitmaps[i]);
mItems[i].setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
setSelectIndex(view, view.getId());
}
});
}
}
}
public boolean setSelectIndex(View view, int index) {
if (mItems != null && mItems.length > 0 && index < mItems.length) {
if (index != mCurrentIndex) {
mItems[index].setBackgroundColor(Color.YELLOW);
if (mCurrentIndex != -1) {
mItems[mCurrentIndex].setBackgroundColor(Color.TRANSPARENT);
}
mCurrentIndex = index;
if (mListener != null) {
mListener.onItemClick(view, index);
}
return true;
}
}
return false;
}
private OnItemClickListener mListener = null;
public void setOnItemClickListener(OnItemClickListener listener) {
this.mListener = listener;
}
public interface OnItemClickListener {
void onItemClick(View view, int index);
}
}
|
[
"zq090428"
] |
zq090428
|
c35a21c287b0f3134ea78864318c8578eb52fb81
|
59db133e64c4fa70fcc7a46d12c964569739b68d
|
/src/view/events/JFXAutoCompleteEvent.java
|
842389cfd78ef084993f262f7b9ba3a57d1f0135
|
[] |
no_license
|
newPersonKing/JAVAFX
|
00c335aabd7d26370464eeedbbe03311061a4c1f
|
f1e7a0d6ca1f5cb67594fbd6c91ac9a0199fddd6
|
refs/heads/master
| 2020-03-21T10:51:38.518278
| 2018-06-24T11:07:55
| 2018-06-24T11:07:55
| 138,475,006
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,375
|
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 view.events;
import javafx.event.Event;
import javafx.event.EventType;
/**
* @author Shadi Shaheen
* @version 1.0.0
* @since 2018-02-01
*/
public class JFXAutoCompleteEvent<T> extends Event {
private T object;
public JFXAutoCompleteEvent(EventType<? extends Event> eventType, T object) {
super(eventType);
this.object = object;
}
public T getObject(){
return object;
}
//TODO: more events to be added
public static final EventType<JFXAutoCompleteEvent> SELECTION =
new EventType<JFXAutoCompleteEvent>(Event.ANY, "DIALOG_CLOSED");
}
|
[
"guoyong@emcc.net.com"
] |
guoyong@emcc.net.com
|
b87c6ba4c22180cb602cf353e105ce9224835980
|
33e7e854745addbeeb53d5702793240d1927d583
|
/gulimall-coupon/src/main/java/com/honyelchak/gulimall/coupon/dao/HomeSubjectDao.java
|
700d813589d67faf3c9477ae9c7ce289fd197710
|
[
"Apache-2.0"
] |
permissive
|
Honyelchak/gulimall
|
64f1acfd134ca49dbe3ec81a9cbb5d639374405e
|
a6c21aa832a76f6816908dcf316177d0d602703c
|
refs/heads/main
| 2023-03-03T18:45:35.318563
| 2021-02-19T12:11:31
| 2021-02-19T12:11:31
| 333,087,073
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 496
|
java
|
package com.honyelchak.gulimall.coupon.dao;
import com.honyelchak.gulimall.coupon.entity.HomeSubjectEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】
*
* @author honyelchak
* @email 554417388@qq.com
* @date 2021-01-27 15:11:37
*/
@Mapper
public interface HomeSubjectDao extends BaseMapper<HomeSubjectEntity> {
}
|
[
"554417388@qq.com"
] |
554417388@qq.com
|
df23b972abf392c3a08a96527d8205b93e2400b2
|
cf8adc55995596f965bc0fd16b7089cc210068ad
|
/src/test/java/com/webstersys/demoapp/service/mapper/UserMapperTest.java
|
b3dec0110f0f113c06f997a8157918853663fc16
|
[] |
no_license
|
ubheamar/jhipster-demo-application
|
6dce913d7f68bea05775dfdecbbf96ab4a6cb8cc
|
fcca617771f10e811e8c934bda29a6c375dd3e63
|
refs/heads/master
| 2022-12-03T17:10:11.922931
| 2020-08-26T04:08:11
| 2020-08-26T04:08:11
| 289,977,251
| 0
| 0
| null | 2020-08-26T04:08:13
| 2020-08-24T16:14:10
|
Java
|
UTF-8
|
Java
| false
| false
| 4,336
|
java
|
package com.webstersys.demoapp.service.mapper;
import static org.assertj.core.api.Assertions.assertThat;
import com.webstersys.demoapp.domain.User;
import com.webstersys.demoapp.service.dto.UserDTO;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Unit tests for {@link UserMapper}.
*/
public class UserMapperTest {
private static final String DEFAULT_LOGIN = "johndoe";
private static final Long DEFAULT_ID = 1L;
private UserMapper userMapper;
private User user;
private UserDTO userDto;
@BeforeEach
public void init() {
userMapper = new UserMapper();
user = new User();
user.setLogin(DEFAULT_LOGIN);
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
user.setEmail("johndoe@localhost");
user.setFirstName("john");
user.setLastName("doe");
user.setImageUrl("image_url");
user.setLangKey("en");
userDto = new UserDTO(user);
}
@Test
public void usersToUserDTOsShouldMapOnlyNonNullUsers() {
List<User> users = new ArrayList<>();
users.add(user);
users.add(null);
List<UserDTO> userDTOS = userMapper.usersToUserDTOs(users);
assertThat(userDTOS).isNotEmpty();
assertThat(userDTOS).size().isEqualTo(1);
}
@Test
public void userDTOsToUsersShouldMapOnlyNonNullUsers() {
List<UserDTO> usersDto = new ArrayList<>();
usersDto.add(userDto);
usersDto.add(null);
List<User> users = userMapper.userDTOsToUsers(usersDto);
assertThat(users).isNotEmpty();
assertThat(users).size().isEqualTo(1);
}
@Test
public void userDTOsToUsersWithAuthoritiesStringShouldMapToUsersWithAuthoritiesDomain() {
Set<String> authoritiesAsString = new HashSet<>();
authoritiesAsString.add("ADMIN");
userDto.setAuthorities(authoritiesAsString);
List<UserDTO> usersDto = new ArrayList<>();
usersDto.add(userDto);
List<User> users = userMapper.userDTOsToUsers(usersDto);
assertThat(users).isNotEmpty();
assertThat(users).size().isEqualTo(1);
assertThat(users.get(0).getAuthorities()).isNotNull();
assertThat(users.get(0).getAuthorities()).isNotEmpty();
assertThat(users.get(0).getAuthorities().iterator().next().getName()).isEqualTo("ADMIN");
}
@Test
public void userDTOsToUsersMapWithNullAuthoritiesStringShouldReturnUserWithEmptyAuthorities() {
userDto.setAuthorities(null);
List<UserDTO> usersDto = new ArrayList<>();
usersDto.add(userDto);
List<User> users = userMapper.userDTOsToUsers(usersDto);
assertThat(users).isNotEmpty();
assertThat(users).size().isEqualTo(1);
assertThat(users.get(0).getAuthorities()).isNotNull();
assertThat(users.get(0).getAuthorities()).isEmpty();
}
@Test
public void userDTOToUserMapWithAuthoritiesStringShouldReturnUserWithAuthorities() {
Set<String> authoritiesAsString = new HashSet<>();
authoritiesAsString.add("ADMIN");
userDto.setAuthorities(authoritiesAsString);
User user = userMapper.userDTOToUser(userDto);
assertThat(user).isNotNull();
assertThat(user.getAuthorities()).isNotNull();
assertThat(user.getAuthorities()).isNotEmpty();
assertThat(user.getAuthorities().iterator().next().getName()).isEqualTo("ADMIN");
}
@Test
public void userDTOToUserMapWithNullAuthoritiesStringShouldReturnUserWithEmptyAuthorities() {
userDto.setAuthorities(null);
User user = userMapper.userDTOToUser(userDto);
assertThat(user).isNotNull();
assertThat(user.getAuthorities()).isNotNull();
assertThat(user.getAuthorities()).isEmpty();
}
@Test
public void userDTOToUserMapWithNullUserShouldReturnNull() {
assertThat(userMapper.userDTOToUser(null)).isNull();
}
@Test
public void testUserFromId() {
assertThat(userMapper.userFromId(DEFAULT_ID).getId()).isEqualTo(DEFAULT_ID);
assertThat(userMapper.userFromId(null)).isNull();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
5bf0a4a4d17ea534f5a76ffaf9696935a101f9da
|
a2272f1002da68cc554cd57bf9470322a547c605
|
/src/jdk/jdk.internal.vm.compiler/org/graalvm/compiler/hotspot/stubs/PluginFactory_UnwindExceptionToCallerStub.java
|
069f882a7efb3df80cbccb0ab9452e758951d33a
|
[] |
no_license
|
framework-projects/java
|
50af8953ab46c509432c467c9ad69cc63818fa63
|
2d131cb46f232d3bf909face20502e4ba4b84db0
|
refs/heads/master
| 2023-06-28T05:08:00.482568
| 2021-08-04T08:42:32
| 2021-08-04T08:42:32
| 312,414,414
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,789
|
java
|
// CheckStyle: stop header check
// CheckStyle: stop line length check
// GENERATED CONTENT - DO NOT EDIT
// GENERATORS: org.graalvm.compiler.replacements.processor.ReplacementsAnnotationProcessor, org.graalvm.compiler.replacements.processor.PluginGenerator
package org.graalvm.compiler.hotspot.stubs;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import org.graalvm.compiler.nodes.ConstantNode;
import org.graalvm.compiler.nodes.ValueNode;
import org.graalvm.compiler.nodes.graphbuilderconf.*;
import java.lang.annotation.Annotation;
// class: org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub
// method: assertionsEnabled(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)
// generated-by: org.graalvm.compiler.replacements.processor.GeneratedFoldPlugin
final class Plugin_UnwindExceptionToCallerStub_assertionsEnabled extends GeneratedInvocationPlugin {
@Override
public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args) {
if (!checkInjectedArgument(b, args[0], targetMethod)) {
return false;
}
org.graalvm.compiler.hotspot.GraalHotSpotVMConfig arg0 = injectedGraalHotSpotVMConfig;
boolean result = org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub.assertionsEnabled(arg0);
JavaConstant constant = JavaConstant.forInt(result ? 1 : 0);
ConstantNode node = ConstantNode.forConstant(constant, b.getMetaAccess(), b.getGraph());
b.push(JavaKind.Int, node);
b.notifyReplacedCall(targetMethod, node);
return true;
}
@Override
public Class<? extends Annotation> getSource() {
return org.graalvm.compiler.api.replacements.Fold.class;
}
private final org.graalvm.compiler.hotspot.GraalHotSpotVMConfig injectedGraalHotSpotVMConfig;
Plugin_UnwindExceptionToCallerStub_assertionsEnabled(NodeIntrinsicPluginFactory.InjectionProvider injection) {
this.injectedGraalHotSpotVMConfig = injection.getInjectedArgument(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.class);
}
}
// class: org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub
// method: exceptionHandlerForReturnAddress(org.graalvm.compiler.core.common.spi.ForeignCallDescriptor,org.graalvm.compiler.word.Word,org.graalvm.compiler.word.Word)
// generated-by: org.graalvm.compiler.replacements.processor.GeneratedNodeIntrinsicPlugin$ConstructorPlugin
final class Plugin_UnwindExceptionToCallerStub_exceptionHandlerForReturnAddress extends GeneratedInvocationPlugin {
@Override
public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args) {
org.graalvm.compiler.core.common.spi.ForeignCallsProvider arg0 = injectedForeignCallsProvider;
org.graalvm.compiler.core.common.type.Stamp arg1 = stamp;
org.graalvm.compiler.core.common.spi.ForeignCallDescriptor arg2;
if (args[0].isConstant()) {
arg2 = snippetReflection.asObject(org.graalvm.compiler.core.common.spi.ForeignCallDescriptor.class, args[0].asJavaConstant());
} else {
assert b.canDeferPlugin(this) : b.getClass().toString();
return false;
}
ValueNode arg3 = args[1];
ValueNode arg4 = args[2];
org.graalvm.compiler.hotspot.nodes.StubForeignCallNode node = new org.graalvm.compiler.hotspot.nodes.StubForeignCallNode(arg0, arg1, arg2, arg3, arg4);
b.addPush(JavaKind.Object, node);
return true;
}
@Override
public Class<? extends Annotation> getSource() {
return org.graalvm.compiler.graph.Node.NodeIntrinsic.class;
}
private final org.graalvm.compiler.core.common.spi.ForeignCallsProvider injectedForeignCallsProvider;
private final org.graalvm.compiler.api.replacements.SnippetReflectionProvider snippetReflection;
private final org.graalvm.compiler.core.common.type.Stamp stamp;
Plugin_UnwindExceptionToCallerStub_exceptionHandlerForReturnAddress(NodeIntrinsicPluginFactory.InjectionProvider injection) {
this.injectedForeignCallsProvider = injection.getInjectedArgument(org.graalvm.compiler.core.common.spi.ForeignCallsProvider.class);
this.snippetReflection = injection.getInjectedArgument(org.graalvm.compiler.api.replacements.SnippetReflectionProvider.class);
this.stamp = injection.getInjectedStamp(org.graalvm.compiler.word.Word.class, false);
}
}
// class: org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub
// method: logging(org.graalvm.compiler.options.OptionValues)
// generated-by: org.graalvm.compiler.replacements.processor.GeneratedFoldPlugin
final class Plugin_UnwindExceptionToCallerStub_logging extends GeneratedInvocationPlugin {
@Override
public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args) {
if (!checkInjectedArgument(b, args[0], targetMethod)) {
return false;
}
org.graalvm.compiler.options.OptionValues arg0 = b.getOptions();
boolean result = org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub.logging(arg0);
JavaConstant constant = JavaConstant.forInt(result ? 1 : 0);
ConstantNode node = ConstantNode.forConstant(constant, b.getMetaAccess(), b.getGraph());
b.push(JavaKind.Int, node);
b.notifyReplacedCall(targetMethod, node);
return true;
}
@Override
public Class<? extends Annotation> getSource() {
return org.graalvm.compiler.api.replacements.Fold.class;
}
}
public class PluginFactory_UnwindExceptionToCallerStub implements NodeIntrinsicPluginFactory {
@Override
public void registerPlugins(InvocationPlugins plugins, NodeIntrinsicPluginFactory.InjectionProvider injection) {
plugins.register(new Plugin_UnwindExceptionToCallerStub_assertionsEnabled(injection), org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub.class, "assertionsEnabled", org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.class);
plugins.register(new Plugin_UnwindExceptionToCallerStub_exceptionHandlerForReturnAddress(injection), org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub.class, "exceptionHandlerForReturnAddress", org.graalvm.compiler.core.common.spi.ForeignCallDescriptor.class, org.graalvm.compiler.word.Word.class, org.graalvm.compiler.word.Word.class);
plugins.register(new Plugin_UnwindExceptionToCallerStub_logging(), org.graalvm.compiler.hotspot.stubs.UnwindExceptionToCallerStub.class, "logging", org.graalvm.compiler.options.OptionValues.class);
}
}
|
[
"chovavea@outlook.com"
] |
chovavea@outlook.com
|
ef82097fa38f783860454374c5398da4fe3c2f09
|
982f6c3a3c006d2b03f4f53c695461455bee64e9
|
/src/main/java/com/alipay/api/response/AlipayDataDataserviceAntdataassetsCloudjobstatusQueryResponse.java
|
95e80daa9f86b7df0207e08809353634d57acd41
|
[
"Apache-2.0"
] |
permissive
|
zhaomain/Alipay-Sdk
|
80ffc0505fe81cc7dd8869d2bf9a894b823db150
|
552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3
|
refs/heads/master
| 2022-11-15T03:31:47.418847
| 2020-07-09T12:18:59
| 2020-07-09T12:18:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 971
|
java
|
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.data.dataservice.antdataassets.cloudjobstatus.query response.
*
* @author auto create
* @since 1.0, 2019-04-30 14:23:07
*/
public class AlipayDataDataserviceAntdataassetsCloudjobstatusQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 2153673182871285313L;
/**
* 上云任务失败时给出的任务错误信息
*/
@ApiField("error_message")
private String errorMessage;
/**
* 上云任务状态
*/
@ApiField("status")
private Long status;
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public String getErrorMessage( ) {
return this.errorMessage;
}
public void setStatus(Long status) {
this.status = status;
}
public Long getStatus( ) {
return this.status;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
77422fb46f3cf2a9e9c198e620ac063840fb0883
|
396b6f2171297a8f5d3f78dfc65d93759c2d2c13
|
/src/com/facebook/buck/swift/SwiftDescriptionsProvider.java
|
1eda1f3511bc24231681ed2112a351505290b12a
|
[
"Apache-2.0"
] |
permissive
|
chenxiao0228/buck
|
6dec1811c8ea10dd1095d6611141d3b87c85ba3c
|
c7922c53b92a21998066e7fd45e2814d42d97424
|
refs/heads/master
| 2020-03-17T19:42:02.767479
| 2018-05-17T16:34:39
| 2018-05-17T18:31:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,639
|
java
|
/*
* Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.swift;
import com.facebook.buck.config.BuckConfig;
import com.facebook.buck.cxx.toolchain.CxxBuckConfig;
import com.facebook.buck.rules.DescriptionCreationContext;
import com.facebook.buck.rules.DescriptionProvider;
import com.facebook.buck.rules.DescriptionWithTargetGraph;
import com.facebook.buck.toolchain.ToolchainProvider;
import java.util.Collection;
import java.util.Collections;
import org.pf4j.Extension;
@Extension
public class SwiftDescriptionsProvider implements DescriptionProvider {
@Override
public Collection<DescriptionWithTargetGraph<?>> getDescriptions(
DescriptionCreationContext context) {
ToolchainProvider toolchainProvider = context.getToolchainProvider();
BuckConfig config = context.getBuckConfig();
SwiftBuckConfig swiftBuckConfig = new SwiftBuckConfig(config);
CxxBuckConfig cxxBuckConfig = new CxxBuckConfig(config);
return Collections.singleton(
new SwiftLibraryDescription(toolchainProvider, cxxBuckConfig, swiftBuckConfig));
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
b06d236661834f51eab785877674acb6a055656c
|
b0fb112e5e51f43d1b50fcaef1fc36bad5223cad
|
/app/src/main/java/com/rainowood/wltraffic/ui/adapter/SubItemPlanManagerAdapter.java
|
83c15db4404af3316d28eda92189fa2f044998a1
|
[] |
no_license
|
maple00/WLTraffic
|
908a0d223149c92ed386fd89792093c596b99009
|
4ac9d3b8724366296f2e65e37738ebe5fbbc7f57
|
refs/heads/master
| 2022-03-31T20:52:18.973982
| 2020-01-16T05:45:13
| 2020-01-16T05:45:13
| 229,238,970
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,863
|
java
|
package com.rainowood.wltraffic.ui.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.rainowood.wltraffic.R;
import com.rainowood.wltraffic.domain.SubPlanManagerBean;
import java.util.List;
/**
* @Author: a797s
* @Date: 2019/12/23 15:06
* @Desc: 计划管理中的资金来源
*/
public class SubItemPlanManagerAdapter extends BaseAdapter {
private Context mContext;
private List<SubPlanManagerBean> mList;
public SubItemPlanManagerAdapter(Context mContext, List<SubPlanManagerBean> mList) {
this.mContext = mContext;
this.mList = mList;
}
@Override
public int getCount() {
return mList == null ? 0 : mList.size();
}
@Override
public SubPlanManagerBean getItem(int position) {
return mList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null){
convertView = LayoutInflater.from(mContext).inflate(R.layout.item_sub_plan_manager_capital, parent, false);
holder = new ViewHolder();
holder.tv_title = convertView.findViewById(R.id.tv_title);
holder.tv_value = convertView.findViewById(R.id.tv_value);
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
holder.tv_title.setText(getItem(position).getTitle());
holder.tv_value.setText(getItem(position).getValue());
return convertView;
}
private class ViewHolder{
private TextView tv_title, tv_value;
}
}
|
[
"a797shaoxuesong@163.com"
] |
a797shaoxuesong@163.com
|
ecf20ea768337779e5cc6f653cdd2bf3051e6fcc
|
3204a2d9ce419e761df72182526f9caf7b7a8f0e
|
/src/test/java/com/lykke/tests/api/service/referral/CommonReferralTests.java
|
e01fcca6e99caba9f009ff92475e66527045daf3
|
[
"MIT"
] |
permissive
|
OpenMAVN/MAVN.Service.Tests
|
e20b71d3352c658f4a80be1a287fd57d127ad897
|
e972731ccc697f5922e41fc7cf4e882e1e480741
|
refs/heads/master
| 2021-04-23T22:02:22.863785
| 2020-03-26T13:06:05
| 2020-03-26T13:06:05
| 250,015,230
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,194
|
java
|
package com.lykke.tests.api.service.referral;
import static com.lykke.api.testing.api.common.GenerateUtils.getRandomUuid;
import static com.lykke.tests.api.common.CommonConsts.REFERRAL_CODE_FIELD;
import static com.lykke.tests.api.service.customermanagement.RegisterCustomerUtils.registerCustomerWithReferralCode;
import static com.lykke.tests.api.service.customermanagement.RegisterCustomerUtils.registerDefaultVerifiedCustomer;
import static com.lykke.tests.api.service.referral.CommonReferralUtils.getCommonReferralByCustomerId;
import static com.lykke.tests.api.service.referral.CommonReferralUtils.getListOfCommonReferrals;
import static com.lykke.tests.api.service.referral.ReferralCodeUtils.setReferralCodeByCustomerId;
import static java.util.stream.Collectors.toList;
import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
import static org.apache.http.HttpStatus.SC_OK;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.params.provider.Arguments.of;
import com.lykke.api.testing.annotations.UserStoryId;
import com.lykke.tests.api.base.BaseApiTest;
import com.lykke.tests.api.common.model.CustomerInfo;
import com.lykke.tests.api.service.referral.model.ReferralErrorCode;
import com.lykke.tests.api.service.referral.model.common.CommonReferralByCustomerIdRequest;
import com.lykke.tests.api.service.referral.model.common.CommonReferralByCustomerIdResponse;
import com.lykke.tests.api.service.referral.model.common.CommonReferralByReferralIdsRequest;
import com.lykke.tests.api.service.referral.model.common.CommonReferralByReferralIdsResponse;
import com.lykke.tests.api.service.referral.model.common.CommonReferralModel;
import com.lykke.tests.api.service.referral.model.common.CommonReferralStatus;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
import lombok.val;
import org.apache.commons.collections4.map.HashedMap;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
public class CommonReferralTests extends BaseApiTest {
private CustomerInfo customerData;
private String customerId;
private String referralCode;
private CustomerInfo referral;
private static Stream<Arguments> getStatuses() {
return Stream.of(
of(Arrays.stream(new CommonReferralStatus[]{}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.EXPIRED}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.ACCEPTED}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.CONFIRMED}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.PENDING}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.CONFIRMED,
CommonReferralStatus.PENDING}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.ACCEPTED,
CommonReferralStatus.ACCEPTED}).collect(toList())),
of(Arrays.stream(new CommonReferralStatus[]{CommonReferralStatus.ACCEPTED, CommonReferralStatus.PENDING,
CommonReferralStatus.CONFIRMED, CommonReferralStatus.EXPIRED}).collect(toList()))
);
}
@BeforeEach
void methodSetup() {
customerData = registerDefaultVerifiedCustomer();
customerId = customerData.getCustomerId();
referralCode = setReferralCodeByCustomerId(customerId)
.then()
.assertThat()
.statusCode(SC_OK)
.extract().path(REFERRAL_CODE_FIELD);
referral = new CustomerInfo();
referral.setReferralCode(referralCode);
referral.setCustomerId(registerCustomerWithReferralCode(referral));
}
@ParameterizedTest
@MethodSource("getStatuses")
@UserStoryId(storyId = {3733, 3974})
void shouldGetCommonReferralByCustomerId(List<CommonReferralStatus> status) {
val actualResult = getCommonReferralByCustomerId(
CommonReferralByCustomerIdRequest
.builder()
.customerId(referral.getCustomerId())
.statuses(status.toArray(new CommonReferralStatus[]{}))
.build())
.then()
.assertThat()
.statusCode(SC_INTERNAL_SERVER_ERROR);
/*
.statusCode(SC_OK)
.extract()
.as(CommonReferralByCustomerIdResponse.class);
*/
}
@ParameterizedTest
@MethodSource("getStatuses")
@UserStoryId(storyId = {3733, 3974})
void shouldNotGetCommonReferralByNonReferredCustomerId(List<CommonReferralStatus> status) {
val expectedResult = CommonReferralByCustomerIdResponse
.commonReferralByCustomerIdResponseBuilder()
.referrals(new CommonReferralModel[]{})
.errorCode(ReferralErrorCode.NONE)
.build();
val actualResult = getCommonReferralByCustomerId(
CommonReferralByCustomerIdRequest
.builder()
.customerId(referral.getCustomerId())
.campaignId(getRandomUuid())
.statuses(status.toArray(new CommonReferralStatus[]{}))
.build())
.then()
.assertThat()
.statusCode(SC_INTERNAL_SERVER_ERROR);
/*
.statusCode(SC_OK)
.extract()
.as(CommonReferralByCustomerIdResponse.class);
assertEquals(expectedResult, actualResult);
*/
}
@Test
@UserStoryId(3733)
void shouldGetCommonReferralsList() {
val actualResult = getListOfCommonReferrals(CommonReferralByReferralIdsRequest
.builder()
.referralIds(new String[]{referral.getCustomerId(), customerData.getCustomerId()})
.build())
.then()
.assertThat()
.statusCode(SC_OK)
.extract()
.as(CommonReferralByReferralIdsResponse.class);
}
@Test
@UserStoryId(3733)
void shouldNotGetCommonReferralsListIfNoReferrals() {
val expectedResult = CommonReferralByReferralIdsResponse
.builder()
.commonReferrals(new HashedMap<>())
.build();
val actualResult = getListOfCommonReferrals(CommonReferralByReferralIdsRequest
.builder()
.referralIds(new String[]{customerData.getCustomerId()})
.build())
.then()
.assertThat()
.statusCode(SC_OK)
.extract()
.as(CommonReferralByReferralIdsResponse.class);
assertEquals(expectedResult, actualResult);
}
}
|
[
"mail@glushkov.us"
] |
mail@glushkov.us
|
8cbaae2b8c9052d95d37af83aecc436f56b59f63
|
91297ffb10fb4a601cf1d261e32886e7c746c201
|
/php.twig/src/org/netbeans/modules/php/twig/editor/lexer/TwigTokenId.java
|
693b916863cce2b0919fdde8fd0cf4dc72025124
|
[] |
no_license
|
JavaQualitasCorpus/netbeans-7.3
|
0b0a49d8191393ef848241a4d0aa0ecc2a71ceba
|
60018fd982f9b0c9fa81702c49980db5a47f241e
|
refs/heads/master
| 2023-08-12T09:29:23.549956
| 2019-03-16T17:06:32
| 2019-03-16T17:06:32
| 167,005,013
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,996
|
java
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Contributor(s): Sebastian Hörl
*
* Portions Copyrighted 2011 Sun Microsystems, Inc.
*/
package org.netbeans.modules.php.twig.editor.lexer;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import org.netbeans.api.lexer.InputAttributes;
import org.netbeans.api.lexer.Language;
import org.netbeans.api.lexer.LanguagePath;
import org.netbeans.api.lexer.Token;
import org.netbeans.api.lexer.TokenId;
import org.netbeans.modules.php.twig.editor.gsf.TwigLanguage;
import org.netbeans.spi.lexer.LanguageEmbedding;
import org.netbeans.spi.lexer.LanguageHierarchy;
import org.netbeans.spi.lexer.Lexer;
import org.netbeans.spi.lexer.LexerRestartInfo;
public enum TwigTokenId implements TokenId {
T_TWIG_NAME("twig_name"), //NOI18N
T_TWIG_STRING("twig_string"), //NOI18N
T_TWIG_NUMBER("twig_number"), //NOI18N
T_TWIG_OPERATOR("twig_operator"), //NOI18N
T_TWIG_PUNCTUATION("twig_punctuation"), //NOI18N
T_TWIG_WHITESPACE("twig_whitespace"), //NOI18N
T_TWIG_TAG("twig_tag"), //NOI18N
T_TWIG_BLOCK_START("twig_block"), //NOI18N
T_TWIG_BLOCK_END("twig_block"), //NOI18N
T_TWIG_VAR_START("twig_var"), //NOI18N
T_TWIG_VAR_END("twig_var"), //NOI18N
T_TWIG_COMMENT("twig_comment"), //NOI18N
T_TWIG_OTHER("twig_other"), //NOI18N
T_TWIG_INTERPOLATION_START("twig_interpolation"), //NOI18N
T_TWIG_INTERPOLATION_END("twig_interpolation"); //NOI18N
private final String primaryCategory;
TwigTokenId(String primaryCategory) {
this.primaryCategory = primaryCategory;
}
@Override
public String primaryCategory() {
return primaryCategory;
}
private static final Language<TwigTokenId> language =
new LanguageHierarchy<TwigTokenId>() {
@Override
protected Collection<TwigTokenId> createTokenIds() {
return EnumSet.allOf(TwigTokenId.class);
}
@Override
protected Map<String, Collection<TwigTokenId>> createTokenCategories() {
Map<String, Collection<TwigTokenId>> cats = new HashMap<String, Collection<TwigTokenId>>();
return cats;
}
@Override
protected Lexer<TwigTokenId> createLexer(LexerRestartInfo<TwigTokenId> info) {
return new TwigLexer(info);
}
@Override
protected String mimeType() {
return TwigLanguage.TWIG_MIME_TYPE + "-markup"; // NOI18N
}
@Override
protected LanguageEmbedding<?> embedding(Token<TwigTokenId> token,
LanguagePath languagePath, InputAttributes inputAttributes) {
return null;
}
}.language();
public static Language<TwigTokenId> language() {
return language;
}
}
|
[
"taibi@sonar-scheduler.rd.tut.fi"
] |
taibi@sonar-scheduler.rd.tut.fi
|
f4a49ec237730444f43b6905592a3312e517424c
|
91f71eb339be3627acb62291f4a79afbb611d026
|
/src/main/java/me/brunosantana/exam3/package1/Test41TestStudent.java
|
212638a4120a514b446e33ea9022db63fec4b91d
|
[] |
no_license
|
brunosantanati/1Z0-808
|
69ba0fe553e752df163bcea1649411a29418420c
|
4b3b251d016d046f765c6e45e2975f499a0ca50b
|
refs/heads/master
| 2022-03-16T15:18:18.823311
| 2022-02-17T13:35:44
| 2022-02-17T13:35:44
| 242,811,666
| 0
| 0
| null | 2020-10-13T19:48:48
| 2020-02-24T18:30:04
|
Java
|
UTF-8
|
Java
| false
| false
| 331
|
java
|
package me.brunosantana.exam3.package1;
class Student {
String name;
int age;
boolean result;
double height;
}
public class Test41TestStudent {
public static void main(String[] args) {
Student stud = new Student();
System.out.println(stud.name + stud.height + stud.result + stud.age);
}
}
|
[
"bruno.santana.ti@gmail.com"
] |
bruno.santana.ti@gmail.com
|
09b9c4f667cb298e79b95071c6c06fec8a7c697f
|
4426e78c9adb5b5ce9eba52a4775d9041c396188
|
/carassistant/src/main/java/org/cloud/carassistant/di/scopes/AppScope.java
|
d0a2e64a4571aa6d47e4cac24d0dfe9612506eb6
|
[] |
no_license
|
davidddw/AndroidDemo
|
fc53499193a36b0e7540516b31d592e64f65433b
|
f66a0f91a2e3918200a56c75f9637165463fdcd7
|
refs/heads/master
| 2020-07-20T19:02:47.273843
| 2017-03-03T07:46:34
| 2017-03-03T07:46:34
| 66,052,182
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 285
|
java
|
package org.cloud.carassistant.di.scopes;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;
/**
* @author d05660ddw
* @version 1.0 2017/2/28
*/
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface AppScope {
}
|
[
"d05660@163.com"
] |
d05660@163.com
|
b24a2156d34e30856958519380c36089f5a68f7a
|
8643a3eed82acddf80f93378fc1bca426bfd7a42
|
/subprojects/core-api/src/main/java/org/gradle/api/services/BuildService.java
|
289523c5c8937cab7b25bef1bb65d01ebfdf19ed
|
[
"BSD-3-Clause",
"LGPL-2.1-or-later",
"LicenseRef-scancode-mit-old-style",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"LGPL-2.1-only",
"Apache-2.0",
"MPL-2.0",
"EPL-1.0"
] |
permissive
|
gradle/gradle
|
f5666240739f96166647b20f9bc2d57e78f28ddf
|
1fd0b632a437ae771718982ef2aa1c3b52ee2f0f
|
refs/heads/master
| 2023-09-04T02:51:58.940025
| 2023-09-03T18:42:57
| 2023-09-03T18:42:57
| 302,322
| 15,005
| 4,911
|
Apache-2.0
| 2023-09-14T21:08:58
| 2009-09-09T18:27:19
|
Groovy
|
UTF-8
|
Java
| false
| false
| 2,339
|
java
|
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.api.services;
import org.gradle.api.Action;
import javax.inject.Inject;
/**
* Represents a user provided "service" that is used by a Gradle build. Often these services are shared by multiple tasks and hold
* some state that tasks use to do their work. A service implementation might hold, for example, an in-memory cache that tasks use
* to improve performance. Or, as another example, a service implementation might represent a web service that the build starts and
* uses.
*
* <p>To create a service, create an abstract subclass of this interface and use {@link BuildServiceRegistry#registerIfAbsent(String, Class, Action)}
* to register one or more instances. This method returns a {@link org.gradle.api.provider.Provider} that you can use to connect
* the service to tasks.</p>
*
* <p>A service implementation may optionally take parameters. To do this create a subtype of {@link BuildServiceParameters} and declare this
* type as the type parameter to the service implementation.</p>
*
* <p>A service may optionally implement {@link AutoCloseable}, in which case {@link AutoCloseable#close()} will be called when
* the service instance is no longer required. The implementation can release any resources it may be holding open.
*
* <p>It is important to note that service implementations must be thread-safe, as they may be used by multiple tasks concurrently.</p>
*
* @param <T> The type of parameters used by the service.
* @since 6.1
*/
public interface BuildService<T extends BuildServiceParameters> {
/**
* Returns the parameters of this service. You should not implement this method, but instead leave it abstract.
*/
@Inject
T getParameters();
}
|
[
"adam@gradle.com"
] |
adam@gradle.com
|
3db792ec70cb1b736f3ca6786de2f29d01d2e86f
|
2c1d85d1bdf4dd6816567998bc037669f7c5d85c
|
/src/main/java/demoMod/cards/CursedBullets.java
|
661ea14b54b13d4d55afd962c224b63e99283832
|
[] |
no_license
|
tldyl/demoMod
|
ecf996f47adfda0ffd78581c2405b22b960ac1f5
|
66e55a9aad53e65af65875bdb3edf3f396e92c47
|
refs/heads/master
| 2022-06-03T08:51:43.592210
| 2022-05-15T14:09:25
| 2022-05-15T14:09:25
| 243,190,716
| 4
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,724
|
java
|
package demoMod.cards;
import basemod.abstracts.CustomCard;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.StrengthPower;
import demoMod.DemoMod;
import demoMod.cards.interfaces.PostAddedToMasterDeckSubscriber;
import demoMod.characters.HuntressCharacter;
import demoMod.combo.Combo;
import demoMod.combo.ComboManager;
import demoMod.sounds.DemoSoundMaster;
@SuppressWarnings("Duplicates")
public class CursedBullets extends CustomCard implements PostAddedToMasterDeckSubscriber,
Combo {
public static final String ID = DemoMod.makeID("CursedBullets");
public static final String NAME;
public static final String DESCRIPTION;
public static final String IMG_PATH = "cards/cursedBullets.png";
public static final Texture comboTexture = new Texture(DemoMod.getResourcePath("combos/cards/cursedBullets.png"));
private static final CardStrings cardStrings;
private static final CardType TYPE = CardType.POWER;
private static final CardRarity RARITY = CardRarity.UNCOMMON;
private static final CardTarget TARGET = CardTarget.NONE;
private static final int COST = 1;
private static boolean combos[] = new boolean[]{false, false, false};
private boolean isRemoving = false;
private boolean isAdded = false;
public CursedBullets() {
super(ID, NAME, DemoMod.getResourcePath(IMG_PATH), COST, DESCRIPTION, TYPE, DemoMod.characterColor, RARITY, TARGET);
}
@Override
public void upgrade() {
if (!this.upgraded) {
this.upgradeName();
this.isInnate = true;
this.rawDescription = cardStrings.UPGRADE_DESCRIPTION;
this.initializeDescription();
}
}
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
if (p instanceof HuntressCharacter) {
if (HuntressCharacter.curse <= 0) return;
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new StrengthPower(p, (int)Math.ceil(HuntressCharacter.curse / 2.0))));
} else {
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new StrengthPower(p, 3)));
}
}
@Override
public void onAddedToMasterDeck() {
if (!isAdded) {
DemoSoundMaster.playV("CURSE_INCREASED", 0.1F);
if (AbstractDungeon.player instanceof HuntressCharacter) {
HuntressCharacter.curse += 1;
}
isAdded = true;
}
}
@Override
public void onRemoveFromMasterDeck() {
isRemoving = true;
ComboManager.detectCombo();
if (AbstractDungeon.player instanceof HuntressCharacter) {
HuntressCharacter.curse -= 1;
}
}
@Override
public String getItemId() {
return DemoMod.makeID("CursedBullets");
}
@Override
public void onComboActivated(String comboId) {
switch (comboId) {
case "DemoMod:Kaliber k'pow uboom k'bhang":
combos[0] = true;
break;
case "DemoMod:BlessingAndACurse":
combos[1] = true;
break;
case "DemoMod:NoxinCannon":
combos[2] = true;
break;
}
}
@Override
public void onComboDisabled(String comboId) {
switch (comboId) {
case "DemoMod:Kaliber k'pow uboom k'bhang":
combos[0] = false;
break;
case "DemoMod:BlessingAndACurse":
combos[1] = false;
break;
case "DemoMod:NoxinCannon":
combos[2] = false;
break;
}
}
@Override
public boolean isRemoving() {
return isRemoving;
}
@Override
public Texture getComboPortrait() {
return comboTexture;
}
static {
cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
NAME = cardStrings.NAME;
DESCRIPTION = cardStrings.DESCRIPTION;
ComboManager.addCombo(DemoMod.makeID("Kaliber k'pow uboom k'bhang:CursedBullets"), CursedBullets.class);
ComboManager.addCombo(DemoMod.makeID("BlessingAndACurse"), CursedBullets.class);
ComboManager.addCombo(DemoMod.makeID("NoxinCannon:CursedBullets"), CursedBullets.class);
}
}
|
[
"756560020@qq.com"
] |
756560020@qq.com
|
52821a94016ec68a6303b6f73e6882527f52c5be
|
63e36d35f51bea83017ec712179302a62608333e
|
/OnePlusCamera/android/support/v4/content/WakefulBroadcastReceiver.java
|
21674e8ab4f79c40160d2e8684934a5d1a92ddd2
|
[] |
no_license
|
hiepgaf/oneplus_blobs_decompiled
|
672aa002fa670bdcba8fdf34113bc4b8e85f8294
|
e1ab1f2dd111f905ff1eee18b6a072606c01c518
|
refs/heads/master
| 2021-06-26T11:24:21.954070
| 2017-08-26T12:45:56
| 2017-08-26T12:45:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,197
|
java
|
package android.support.v4.content;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.util.Log;
import android.util.SparseArray;
public abstract class WakefulBroadcastReceiver
extends BroadcastReceiver
{
private static final String EXTRA_WAKE_LOCK_ID = "android.support.content.wakelockid";
private static final SparseArray<PowerManager.WakeLock> mActiveWakeLocks = new SparseArray();
private static int mNextId = 1;
public static boolean completeWakefulIntent(Intent arg0)
{
int i = ???.getIntExtra("android.support.content.wakelockid", 0);
if (i != 0) {
synchronized (mActiveWakeLocks)
{
PowerManager.WakeLock localWakeLock = (PowerManager.WakeLock)mActiveWakeLocks.get(i);
if (localWakeLock == null)
{
Log.w("WakefulBroadcastReceiver", "No active wake lock id #" + i);
return true;
}
localWakeLock.release();
mActiveWakeLocks.remove(i);
return true;
}
}
return false;
}
public static ComponentName startWakefulService(Context paramContext, Intent paramIntent)
{
synchronized (mActiveWakeLocks)
{
int i = mNextId;
mNextId += 1;
if (mNextId > 0)
{
paramIntent.putExtra("android.support.content.wakelockid", i);
paramIntent = paramContext.startService(paramIntent);
if (paramIntent != null)
{
paramContext = ((PowerManager)paramContext.getSystemService("power")).newWakeLock(1, "wake:" + paramIntent.flattenToShortString());
paramContext.setReferenceCounted(false);
paramContext.acquire(60000L);
mActiveWakeLocks.put(i, paramContext);
return paramIntent;
}
}
else
{
mNextId = 1;
}
}
return null;
}
}
/* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/android/support/v4/content/WakefulBroadcastReceiver.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"joshuous@gmail.com"
] |
joshuous@gmail.com
|
97aac5066b666e9c76d2307d8aa2d7d2c2842109
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/MazeRunner/src/net/worldwizard/mazerunner/MazeNLock.java
|
2e028fbfe426ba4040b065435efe7034940e41b1
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259
| 2021-05-15T13:03:54
| 2021-05-15T13:03:54
| 235,693,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 989
|
java
|
package net.worldwizard.mazerunner;
public class MazeNLock extends MazeGenericInfiniteLock {
// Serialization
private static final long serialVersionUID = 614L;
// Constructors
public MazeNLock() {
super("NLock", "NLock", new MazeNKey());
}
public MazeNLock(final MazeNKey mk) {
super("NLock", "NLock", mk);
}
// Scriptability
@Override
public void preMoveAction(final Inventory inv) {
if (this.isConditionallySolid(inv)) {
Messager.showMessage("You need an N key");
}
}
@Override
public void preMoveAction(final boolean ie, final int dirX, final int dirY,
final Inventory inv) {
if (this.isConditionallyDirectionallySolid(ie, dirX, dirY, inv)) {
Messager.showMessage("You need an N key");
}
}
@Override
public String toString() {
return "NL";
}
@Override
public String getName() {
return "N Lock";
}
}
|
[
"eric.ahnell@puttysoftware.com"
] |
eric.ahnell@puttysoftware.com
|
4de88a1c74d275ca262e6b6adbad68f20976ba7f
|
f9e18b9a804d65d14613b79efe9664cb64710995
|
/src/main/java/org/hibernate/loader/plan/spi/AbstractPlanNode.java
|
eb789612a2a13696248ca541e3569a10db2f2eeb
|
[] |
no_license
|
sebersole/hibernate-loader-redesign
|
f436298076bdd662e3d68b357451ecd8db306d3f
|
f6271cfe7a01edf778f862bff6991b6b74478653
|
refs/heads/master
| 2021-01-10T22:14:06.025710
| 2013-03-01T15:33:50
| 2013-03-01T15:33:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,553
|
java
|
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2012, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.loader.plan.spi;
import org.hibernate.engine.spi.SessionFactoryImplementor;
/**
* Base class for LoadPlan nodes to hold references to the session factory.
*
* @author Steve Ebersole
*/
public abstract class AbstractPlanNode {
private final SessionFactoryImplementor sessionFactory;
public AbstractPlanNode(SessionFactoryImplementor sessionFactory) {
this.sessionFactory = sessionFactory;
}
protected SessionFactoryImplementor sessionFactory() {
return sessionFactory;
}
}
|
[
"steve@hibernate.org"
] |
steve@hibernate.org
|
3e541ebb3786eebd7503fcea255101067da996ee
|
41a5ce39648523be781f35cdc5b69f93d57829a5
|
/src/main/java/org/webguitoolkit/ui/tools/LogViewer.java
|
84bdc0a140e412658798be484ff112a262ad53c0
|
[
"Apache-2.0"
] |
permissive
|
webguitoolkit/wgt-ui
|
455dd35bbfcb6835e3834a4537e3ffc668f15389
|
747530b462e9377a0ece473b97ce2914fb060cb5
|
refs/heads/master
| 2020-04-06T05:46:43.511525
| 2012-03-02T08:40:44
| 2012-03-02T08:40:44
| 1,516,251
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 8,023
|
java
|
/*
Copyright 2008 Endress+Hauser Infoserve GmbH&Co KG
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.webguitoolkit.ui.tools;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggingEvent;
import org.webguitoolkit.ui.base.IDataBag;
import org.webguitoolkit.ui.base.WebGuiFactory;
import org.webguitoolkit.ui.controls.IBaseControl;
import org.webguitoolkit.ui.controls.Page;
import org.webguitoolkit.ui.controls.container.Canvas;
import org.webguitoolkit.ui.controls.event.ClientEvent;
import org.webguitoolkit.ui.controls.event.IActionListener;
import org.webguitoolkit.ui.controls.form.Button;
import org.webguitoolkit.ui.controls.form.Compound;
import org.webguitoolkit.ui.controls.form.Label;
import org.webguitoolkit.ui.controls.form.Select;
import org.webguitoolkit.ui.controls.form.Text;
import org.webguitoolkit.ui.controls.form.Textarea;
import org.webguitoolkit.ui.controls.layout.TableLayout;
import org.webguitoolkit.ui.controls.tab.StandardTabStrip;
import org.webguitoolkit.ui.controls.tab.Tab;
import org.webguitoolkit.ui.controls.table.AbstractTableListener;
import org.webguitoolkit.ui.controls.table.ITable;
import org.webguitoolkit.ui.controls.table.Table;
import org.webguitoolkit.ui.controls.table.TableColumn;
import org.webguitoolkit.ui.controls.util.conversion.ConvertUtil;
import org.webguitoolkit.ui.controls.util.style.Style;
import org.webguitoolkit.ui.controls.util.validation.ValidatorUtil;
import org.webguitoolkit.ui.http.ResourceServlet;
/**
* <pre>
* The LogViewer is used to show the output of the DWRAppender.
* </pre>
*/
public class LogViewer extends Page implements IActionListener{
public static final int maxEntries = 100;
static List<IDataBag> theLog = Collections.synchronizedList(new ArrayList<IDataBag>());
private Table logTable;
private Button buttonReload;
private Button buttonClear;
private Compound detailCompound;
private Select selectLevel;
private Compound logCompound;
private static final String ALL = "ALL";
private static final String DEBUG = "DEBUG";
private static final String INFO = "INFO";
private static final String WARN = "WARN";
private static final String ERROR = "ERROR";
private static final String FATAL = "FATAL";
private static final String OFF = "OFF";
private static final String TRACE="TRACE";
protected void pageInit() {
addHeaderCSS("./"+ ResourceServlet.SERVLET_URL_PATTERN+"/standard_theme.css");
TableLayout layoutLog=getFactory().newTableLayout(this);
Canvas canvas=getFactory().newCanvas(layoutLog);
logCompound = getFactory().newCompound(canvas);
TableLayout logLayout=getFactory().newTableLayout(logCompound);
Label lb=getFactory().newLabel(logLayout, "Log-Category:");
Text text=getFactory().newText(logLayout, "logCategory",lb);
text.addValidator(ValidatorUtil.MANDATORY_VALIDATOR);
logLayout.newLine();
Label lblLevel=getFactory().newLabel(logLayout, "Log-Level:");
selectLevel=getFactory().newSelect(logLayout, "logLevel");
selectLevel.setDescribingLabel(lblLevel);
selectLevel.getDefaultModel().setSingleValueList(new String[]{OFF,INFO,DEBUG,WARN,ERROR,FATAL,TRACE,ALL});
selectLevel.loadList();
logLayout.newLine();
getFactory().newButton(logLayout, null, "Save", "save", new SaveLogLevelListener());
logTable = getFactory().newTable(this, "Log", 20 );
getFactory().newTableColumn( logTable, "Thread Name", "threadName", true);
TableColumn logLevelCol = getFactory().newTableColumn( logTable, "Log Level", "loglevel", false);
logLevelCol.setWidth("70px");
logLevelCol.setConverter( ConvertUtil.NUM0_CONVERTER );
TableColumn loggerNameCol = getFactory().newTableColumn( logTable, "Logger Name", "loggerName", true);
loggerNameCol.setWidth("200px");
getFactory().newTableColumn( logTable, "Message", "renderedMessage", true);
buttonReload = getFactory().newButton(this, null, "reload", "reload", this);
buttonClear = getFactory().newButton(this, null, "clear", "clear", this);
StandardTabStrip tabStrip = getFactory().newTabStrip( this );
//tabStrip.setStyle("width: 1400px;");
tabStrip.getStyle().addWidth(1400, Style.PIXEL);
Tab detailTab = getFactory().newTab( tabStrip, "Details");
detailCompound = getFactory().newCompound( detailTab );
TableLayout layout = getFactory().newTableLayout( detailCompound );
Textarea messageArea = getFactory().newTextarea( layout, "renderedMessage" );
//messageArea.setStyle( "width: 1000px;heigth: 500px;" );
messageArea.getStyle().addWidth(1000, Style.PIXEL);
messageArea.getStyle().addHeight(500, Style.PIXEL);
messageArea.setColumns( 600 );
messageArea.setRows( 20 );
layout.newLine();
Textarea traceArea = getFactory().newTextarea( layout, "trace" );
//traceArea.setStyle( "width: 1000px;" );
traceArea.getStyle().addWidth(1000, Style.PIXEL);
traceArea.setColumns( 200 );
traceArea.setRows( 20 );
pageLoad();
}
protected void pageLoad() {
logTable.getDefaultModel().setTableData(theLog);
logTable.setListener(new AbstractTableListener() {
public void onRowSelection(ITable table, int row) {
detailCompound.setBag(table.getSelectedRow());
detailCompound.load();
}
});
WGTAppender.getInstance().setDelegate(this);
logTable.reload();
}
protected String title() {
return "LogViewer";
}
protected void append(LoggingEvent le) {
while (theLog.size()>maxEntries) {
// make space..
theLog.remove(theLog.size()-1);
}
IDataBag bag = WebGuiFactory.getInstance().createDataBag(le);
theLog.add(0, bag);
// convert additional data...
bag.addProperty("loglevel", le.getLevel().toString());
bag.addProperty("trace", StringUtils.join(le.getThrowableStrRep(), "\r\n" ));
//logTable.reload();
}
protected void close(){
theLog.clear();
}
public void onAction(ClientEvent event) {
IBaseControl control = event.getSource();
if (control == buttonClear) {
theLog.clear();
}
if (control == buttonReload) {
logTable.reload();
}
}
private class SaveLogLevelListener implements IActionListener{
public void onAction(ClientEvent event) {
LogDTO log=new LogDTO();
logCompound.setBag(WebGuiFactory.getInstance().createDataBag(log));
logCompound.save();
IDataBag bag=logCompound.getBag();
bag.save();
String categoryName=log.getLogCategory();
if(StringUtils.isBlank(categoryName)){
return;
}
Logger logger=LogManager.exists(categoryName);
if(logger==null){
logger=Logger.getLogger(categoryName);
}
String level=selectLevel.getValue();
if(StringUtils.equals(ALL, level)){
logger.setLevel(Level.ALL);
}else if(StringUtils.equals(DEBUG, level)){
logger.setLevel(Level.DEBUG);
}else if(StringUtils.equals(INFO, level)){
logger.setLevel(Level.INFO);
}else if(StringUtils.equals(WARN, level)){
logger.setLevel(Level.WARN);
}else if(StringUtils.equals(ERROR,level)){
logger.setLevel(Level.ERROR);
}else if(StringUtils.equals(FATAL , level)){
logger.setLevel(Level.FATAL);
}else if(StringUtils.equals(OFF, level)){
logger.setLevel(Level.OFF);
}else{
logger.setLevel(Level.TRACE);
}
logCompound.getPage().sendInfo("Save successed.");
}
}
public Compound getLogCompound() {
return logCompound;
}
}
|
[
"peter@17sprints.de"
] |
peter@17sprints.de
|
78d2d3d0e2d00914f07bc8af121f26050788ab0b
|
139aa575296282ad3d3756b2472e8f6518a5024c
|
/QHDemo3.1.0/app/src/main/java/com/qhcloud/home/app/start/account/login/LoginPresenter.java
|
0667a328584548ff0301e6a07342d5f428cbab75
|
[] |
no_license
|
Sarah-alsh/QLinqDemo
|
c02931f8057f34bbfa2d2986009aafcc83f02508
|
090de0cc2a4ebaee62c76b4be44a78e0ee608938
|
refs/heads/master
| 2020-04-18T02:26:12.445663
| 2019-01-23T10:22:24
| 2019-01-23T10:22:24
| 167,162,437
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,486
|
java
|
package com.qhcloud.home.app.start.account.login;
import android.content.Context;
import android.text.TextUtils;
import com.qhcloud.home.app.BasePresenter;
import com.qhcloud.home.entity.Constant;
import com.qhcloud.home.manager.model.LoginImp;
import com.qhcloud.home.manager.model.biz.ILogin;
import com.qhcloud.home.util.Log;
import com.qhcloud.home.util.StringUtil;
import com.qhcloud.net.NetInfo;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
/**
* 登录presenter
* @author youngbin
*/
public class LoginPresenter extends BasePresenter {
private static final String TAG = "LoginPresenter";
private ILoginView mILoginView;
private ILogin mILogin;
private LoginPresenter(Context context) {
super(context);
}
public LoginPresenter(Context context, ILoginView iLoginView) {
this(context);
mILoginView = iLoginView;
mILogin = new LoginImp();
init();
}
private void init() {
mPreference.readSharedPreferences(mContext);
mILoginView.setUser(mPreference.getValue(Constant.Configure.USER, ""));
mILoginView.setPassword(mPreference.getValue(Constant.Configure.PASSWORD, ""));
}
/**
* 登录
*/
public void login() {
final String user = mILoginView.getUser();
final String password = mILoginView.getPassword();
if(TextUtils.isEmpty(user)){
mILoginView.onFailed("手机号码不能为空");
return;
}
if(TextUtils.isEmpty(password)){
mILoginView.onFailed("密码不能空");
return;
}
/* if (!StringUtil.checkPhone(user)) {
mILoginView.onFailed("手机号码不正确");
return;
}*/
mDisposable.add(Flowable.just(1)
.map(new Function<Integer, Integer>() {
@Override
public Integer apply(Integer integer) throws Exception {
return mILogin.login(user, password);
}
}).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Integer>() {
@Override
public void accept(Integer integer) throws Exception {
Log.i(TAG, "onNext: i=" + integer);
switch (integer) {
case NetInfo.LOGIN_ERROR_ACCOUNT_NOT_FOUND:
mILoginView.onFailed("帐号不存在");
break;
case 0:
saveUserInfo();
break;
default:
mILoginView.onFailed("未知错误");
}
}
}));
}
/**
* 保存用户和密码
*/
private void saveUserInfo() {
mPreference.writeSharedPreferences(mContext);
mPreference.putValue(Constant.Configure.USER, mILoginView.getUser());
mPreference.putValue(Constant.Configure.PASSWORD, mILoginView.getPassword());
mPreference.commit();
}
}
|
[
"sarah.shughri@gmail.com"
] |
sarah.shughri@gmail.com
|
d0153be09c1f6804e7f48417650bb036049a2016
|
ef7c846fd866bbc748a2e8719358c55b73f6fc96
|
/library/weiui/src/main/java/vip/kuaifan/weiui/extend/integration/glide/load/model/UnitModelLoader.java
|
6e76b8574d2b8d47e89d9976ebc200ea5486161b
|
[
"MIT"
] |
permissive
|
shaibaoj/weiui
|
9e876fa3797537faecccca74a0c9206dba67e444
|
131a8e3a6ecad245f421f039d2bedc8a0362879d
|
refs/heads/master
| 2020-03-17T22:45:52.855193
| 2018-07-02T01:56:51
| 2018-07-02T01:56:51
| 134,017,696
| 0
| 0
| null | 2018-07-02T01:56:52
| 2018-05-19T01:01:44
|
Java
|
UTF-8
|
Java
| false
| false
| 3,521
|
java
|
package vip.kuaifan.weiui.extend.integration.glide.load.model;
import android.support.annotation.NonNull;
import vip.kuaifan.weiui.extend.integration.glide.Priority;
import vip.kuaifan.weiui.extend.integration.glide.load.DataSource;
import vip.kuaifan.weiui.extend.integration.glide.load.Options;
import vip.kuaifan.weiui.extend.integration.glide.load.data.DataFetcher;
import vip.kuaifan.weiui.extend.integration.glide.signature.ObjectKey;
/**
* A put of helper classes that performs no loading and instead always returns the given model as
* the data to decode.
*
* @param <Model> The type of model that will also be returned as decodable data.
*/
public class UnitModelLoader<Model> implements ModelLoader<Model, Model> {
@SuppressWarnings("deprecation")
private static final UnitModelLoader<?> INSTANCE = new UnitModelLoader<>();
@SuppressWarnings("unchecked")
public static <T> UnitModelLoader<T> getInstance() {
return (UnitModelLoader<T>) INSTANCE;
}
/**
* @deprecated Use {@link #getInstance()} instead.
*/
// Need constructor to document deprecation, will be removed, when constructor is privatized.
@SuppressWarnings({"PMD.UnnecessaryConstructor", "DeprecatedIsStillUsed"})
@Deprecated
public UnitModelLoader() {
// Intentionally empty.
}
@Override
public LoadData<Model> buildLoadData(@NonNull Model model, int width, int height,
@NonNull Options options) {
return new LoadData<>(new ObjectKey(model), new UnitFetcher<>(model));
}
@Override
public boolean handles(@NonNull Model model) {
return true;
}
private static class UnitFetcher<Model> implements DataFetcher<Model> {
private final Model resource;
UnitFetcher(Model resource) {
this.resource = resource;
}
@Override
public void loadData(@NonNull Priority priority,
@NonNull DataCallback<? super Model> callback) {
callback.onDataReady(resource);
}
@Override
public void cleanup() {
// Do nothing.
}
@Override
public void cancel() {
// Do nothing.
}
@NonNull
@SuppressWarnings("unchecked")
@Override
public Class<Model> getDataClass() {
return (Class<Model>) resource.getClass();
}
@NonNull
@Override
public DataSource getDataSource() {
return DataSource.LOCAL;
}
}
/**
* Factory for producing {@link vip.kuaifan.weiui.extend.integration.glide.load.model.UnitModelLoader}s.
*
* @param <Model> The type of model that will also be returned as decodable data.
*/
// PMD.SingleMethodSingleton false positive: https://github.com/pmd/pmd/issues/816
@SuppressWarnings("PMD.SingleMethodSingleton")
public static class Factory<Model> implements ModelLoaderFactory<Model, Model> {
@SuppressWarnings("deprecation")
private static final Factory<?> FACTORY = new Factory<>();
@SuppressWarnings("unchecked")
public static <T> Factory<T> getInstance() {
return (Factory<T>) FACTORY;
}
/** @deprecated Use {@link #getInstance()} instead. */
// Need constructor to document deprecation, will be removed, when constructor is privatized.
@SuppressWarnings("PMD.UnnecessaryConstructor")
@Deprecated
public Factory() {
// Intentionally empty.
}
@NonNull
@Override
public ModelLoader<Model, Model> build(MultiModelLoaderFactory multiFactory) {
return UnitModelLoader.getInstance();
}
@Override
public void teardown() {
// Do nothing.
}
}
}
|
[
"342210020@qq.com"
] |
342210020@qq.com
|
ae295c386564681e747ec54bc371572597b25c30
|
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
|
/src/testcases/CWE129_Improper_Validation_of_Array_Index/s05/CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53b.java
|
2afcbec2a6226ac11ae20b3aee4a2df3ceb82ee3
|
[] |
no_license
|
bqcuong/Juliet-Test-Case
|
31e9c89c27bf54a07b7ba547eddd029287b2e191
|
e770f1c3969be76fdba5d7760e036f9ba060957d
|
refs/heads/master
| 2020-07-17T14:51:49.610703
| 2019-09-03T16:22:58
| 2019-09-03T16:22:58
| 206,039,578
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,697
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53b.java
Label Definition File: CWE129_Improper_Validation_of_Array_Index.label.xml
Template File: sources-sinks-53b.tmpl.java
*/
/*
* @description
* CWE: 129 Improper Validation of Array Index
* BadSource: URLConnection Read data from a web server with URLConnection
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: array_size
* GoodSink: data is used to set the size of the array and it must be greater than 0
* BadSink : data is used to set the size of the array, but it could be set to 0
* Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package
*
* */
package testcases.CWE129_Improper_Validation_of_Array_Index.s05;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53b
{
public void badSink(int data ) throws Throwable
{
(new CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53c()).badSink(data );
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(int data ) throws Throwable
{
(new CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53c()).goodG2BSink(data );
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(int data ) throws Throwable
{
(new CWE129_Improper_Validation_of_Array_Index__URLConnection_array_size_53c()).goodB2GSink(data );
}
}
|
[
"bqcuong2212@gmail.com"
] |
bqcuong2212@gmail.com
|
a2185f96d0daebf36b1b57c150a64b915300ed5b
|
0c207c2c8996f9e5fd79077484858b217a22ca36
|
/day05_butterknife/src/main/java/com/nan/day05_butterknife/MainActivity2.java
|
fcd188fce0f914b23b66be4afbef9bc60386a19f
|
[] |
no_license
|
huannan/Architecture
|
13a75919eaa2a952125aa2c5868ee17ad111b9d5
|
f41ac58b1533c75bd8945a30efd9ff23c243bfe1
|
refs/heads/master
| 2022-08-23T07:52:43.482888
| 2022-06-30T08:45:23
| 2022-06-30T08:45:23
| 292,816,424
| 11
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 829
|
java
|
package com.nan.day05_butterknife;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import com.nan.day05_butterknife_annotations.BindView;
import com.nan.day05_butterknife_core.ButterKnife;
import com.nan.day05_butterknife_core.Unbinder;
public class MainActivity2 extends AppCompatActivity {
@BindView(R.id.tv3)
TextView tv3;
@BindView(R.id.tv4)
TextView tv4;
private Unbinder mUnbinder;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
mUnbinder = ButterKnife.bind(this);
tv3.setText("成功");
}
@Override
protected void onDestroy() {
mUnbinder.unbind();
super.onDestroy();
}
}
|
[
"wuhuannan@meizu.com"
] |
wuhuannan@meizu.com
|
8bb8401b77a9e005ed71fc13e33d0ff8fa5d24ad
|
2f3c04382a66dbf222c8587edd67a5df4bc80422
|
/src/com/cedar/cp/api/dimension/DimensionEditor.java
|
4ea4d7b9c03285da508d7405e8aef1120707e062
|
[] |
no_license
|
arnoldbendaa/cppro
|
d3ab6181cc51baad2b80876c65e11e92c569f0cc
|
f55958b85a74ad685f1360ae33c881b50d6e5814
|
refs/heads/master
| 2020-03-23T04:18:00.265742
| 2018-09-11T08:15:28
| 2018-09-11T08:15:28
| 141,074,966
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,700
|
java
|
// Decompiled by: Fernflower v0.8.6
// Date: 12.08.2012 13:04:17
// Copyright: 2008-2012, Stiver
// Home page: http://www.neshkov.com/ac_decompiler.html
package com.cedar.cp.api.dimension;
import com.cedar.cp.api.base.BusinessEditor;
import com.cedar.cp.api.base.CPException;
import com.cedar.cp.api.base.DuplicateNameValidationException;
import com.cedar.cp.api.base.ValidationException;
import com.cedar.cp.api.dimension.Dimension;
import com.cedar.cp.api.dimension.DimensionElement;
import com.cedar.cp.api.dimension.DimensionElementEditor;
import com.cedar.cp.api.model.ModelRef;
public interface DimensionEditor extends BusinessEditor {
void setType(int var1) throws ValidationException;
void setVisId(String var1) throws ValidationException;
void setDescription(String var1) throws ValidationException;
void setExternalSystemRef(Integer var1) throws ValidationException;
Dimension getDimension();
DimensionElement insertElement(String var1, String var2, int var3, boolean var4, boolean var5, int var6, boolean var7) throws DuplicateNameValidationException, ValidationException, CPException;
DimensionElement insertElement(String var1, String var2, int var3, boolean var4, boolean var5, int var6) throws DuplicateNameValidationException, ValidationException, CPException;
void removeElement(Object var1, String var2) throws ValidationException, CPException;
DimensionElementEditor getElementEditor(Object var1) throws ValidationException, CPException;
ModelRef queryOwningModel();
void setSubmitChangeManagementRequest(boolean var1);
boolean isAugmentMode();
}
|
[
"arnoldbendaa@gmail.com"
] |
arnoldbendaa@gmail.com
|
a2db3c2a7fd9ab3810a8fe77644ecde2eb8d28db
|
fc5f16c7dd1cd7aee2d2ca0eb414860b5ad6d384
|
/src/temp/src/minecraft/net/minecraft/src/Packet15Place.java
|
f9967ade1efba65eaa933168a5aa95e7c9049ca5
|
[] |
no_license
|
Nickorama21/Minecraft--TI-Nspire-CX-Port
|
44eeca7a742d199e223d712866352a9e12b3290c
|
95acc13c310f519ed8d4ed5a755ef70712da532f
|
refs/heads/master
| 2020-05-17T11:31:43.456900
| 2012-09-01T17:24:47
| 2012-09-01T17:24:52
| 5,623,326
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,802
|
java
|
package net.minecraft.src;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NetHandler;
import net.minecraft.src.Packet;
public class Packet15Place extends Packet {
private int field_73415_a;
private int field_73413_b;
private int field_73414_c;
private int field_73411_d;
private ItemStack field_73412_e;
private float field_73409_f;
private float field_73410_g;
private float field_73416_h;
public Packet15Place() {}
public Packet15Place(int p_i3366_1_, int p_i3366_2_, int p_i3366_3_, int p_i3366_4_, ItemStack p_i3366_5_, float p_i3366_6_, float p_i3366_7_, float p_i3366_8_) {
this.field_73415_a = p_i3366_1_;
this.field_73413_b = p_i3366_2_;
this.field_73414_c = p_i3366_3_;
this.field_73411_d = p_i3366_4_;
this.field_73412_e = p_i3366_5_;
this.field_73409_f = p_i3366_6_;
this.field_73410_g = p_i3366_7_;
this.field_73416_h = p_i3366_8_;
}
public void func_73267_a(DataInputStream p_73267_1_) throws IOException {
this.field_73415_a = p_73267_1_.readInt();
this.field_73413_b = p_73267_1_.read();
this.field_73414_c = p_73267_1_.readInt();
this.field_73411_d = p_73267_1_.read();
this.field_73412_e = func_73276_c(p_73267_1_);
this.field_73409_f = (float)p_73267_1_.read() / 16.0F;
this.field_73410_g = (float)p_73267_1_.read() / 16.0F;
this.field_73416_h = (float)p_73267_1_.read() / 16.0F;
}
public void func_73273_a(DataOutputStream p_73273_1_) throws IOException {
p_73273_1_.writeInt(this.field_73415_a);
p_73273_1_.write(this.field_73413_b);
p_73273_1_.writeInt(this.field_73414_c);
p_73273_1_.write(this.field_73411_d);
func_73270_a(this.field_73412_e, p_73273_1_);
p_73273_1_.write((int)(this.field_73409_f * 16.0F));
p_73273_1_.write((int)(this.field_73410_g * 16.0F));
p_73273_1_.write((int)(this.field_73416_h * 16.0F));
}
public void func_73279_a(NetHandler p_73279_1_) {
p_73279_1_.func_72472_a(this);
}
public int func_73284_a() {
return 19;
}
public int func_73403_d() {
return this.field_73415_a;
}
public int func_73402_f() {
return this.field_73413_b;
}
public int func_73407_g() {
return this.field_73414_c;
}
public int func_73401_h() {
return this.field_73411_d;
}
public ItemStack func_73405_i() {
return this.field_73412_e;
}
public float func_73406_j() {
return this.field_73409_f;
}
public float func_73404_l() {
return this.field_73410_g;
}
public float func_73408_m() {
return this.field_73416_h;
}
}
|
[
"nickparker.stl@gmail.com"
] |
nickparker.stl@gmail.com
|
e3c425eefe75490efb04d793c4bcbb285859026d
|
c156463cf82d43fff75cd484b0884a6b99404aa2
|
/ZeroToHero1/src/Object____Practice/Mobile_Application_TEST.java
|
fc722c08e1884b34549f49c6694cf707c6226ac6
|
[] |
no_license
|
bamboo1991/ZeroToHero1
|
39d71380d5e8f96beb4c4301cb3571b759d48a55
|
84402e09e63e176d5129f0460fd6087d218dabd8
|
refs/heads/master
| 2022-07-10T19:30:33.958922
| 2020-04-04T04:33:01
| 2020-04-04T04:33:01
| 241,712,319
| 0
| 1
| null | 2020-10-13T20:23:23
| 2020-02-19T19:56:37
|
Java
|
UTF-8
|
Java
| false
| false
| 3,013
|
java
|
package Object____Practice;
import java.util.Scanner;
public class Mobile_Application_TEST{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
Mobile_Aplication phone = new Mobile_Aplication();
System.out.println("Welcome to your contact list application");
System.out.println("please enter your name");
String name=input.next();
phone.personName=name;
System.out.println("please enter your passcode");
String code1= input.next();
phone.login("1234");
int exit=0;
do {
phone.instructions();
System.out.println("what instruction you want?");
int steps = input.nextInt();
switch (steps){
case 1:
System.out.println("enter your passcode");
String code =input.next();
phone.login(code);
break;
case 2:
phone.listOfContacts();
break;
case 3:
System.out.println("please add contact, enter name first");
String addName = input.next();
System.out.println("enter phone number");
String addPhoneNumber = input.next();
phone.addContacts(addName,addPhoneNumber);
break;
case 4:
System.out.println("please enter old name");
String oldName = input.next();
System.out.println("please enter your new name");
String newName=input.next();
phone.updateContacts(oldName,newName);
break;
case 5:
System.out.println("enter your old number");
String oldPhoneNum =input.next();
System.out.println("please enter new number");
String newNum = input.next();
phone.updatePhoneNum(oldPhoneNum,newNum);
break;
case 6:
System.out.println("please enter the name to remove from contact list");
String removeName=input.next();
phone.removeContacts(removeName);
break;
case 7:
System.out.println("please enter phone number");
String phoneNum = input.next();
System.out.println(phone.searchPhone(phoneNum));
break;
case 8:
System.out.println("please enter name to search");
String searchingName = input.next();
System.out.println(phone.searchName(searchingName));
break;
case 9:
exit=9;
break;
}
}while (exit!=9);
System.out.println("Thank you for using the Phone");
}
}
|
[
"stamovuber@gmail.com"
] |
stamovuber@gmail.com
|
c773889c16f33f5adf866d6cdd759bd4fb235969
|
129f58086770fc74c171e9c1edfd63b4257210f3
|
/src/testcases/CWE690_NULL_Deref_From_Return/CWE690_NULL_Deref_From_Return__System_getProperty_equals_22a.java
|
3eaa2640f16ca23ec2206158bb14adf548fb76e9
|
[] |
no_license
|
glopezGitHub/Android23
|
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
|
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
|
refs/heads/master
| 2023-03-07T15:14:59.447795
| 2023-02-06T13:59:49
| 2023-02-06T13:59:49
| 6,856,387
| 0
| 3
| null | 2023-02-06T18:38:17
| 2012-11-25T22:04:23
|
Java
|
UTF-8
|
Java
| false
| false
| 3,652
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE690_NULL_Deref_From_Return__System_getProperty_equals_22a.java
Label Definition File: CWE690_NULL_Deref_From_Return.label.xml
Template File: sources-sinks-22a.tmpl.java
*/
/*
* @description
* CWE: 690 Unchecked return value is null, leading to a null pointer dereference.
* BadSource: System_getProperty Set data to return of System.getProperty
* GoodSource: Set data to fixed, non-null String
* Sinks: equals
* GoodSink: Call equals() on string literal (that is not null)
* BadSink : Call equals() on possibly null object
* Flow Variant: 22 Control flow: Flow controlled by value of a public static variable. Sink functions are in a separate file from sources.
*
* */
package testcases.CWE690_NULL_Deref_From_Return;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
public class CWE690_NULL_Deref_From_Return__System_getProperty_equals_22a extends AbstractTestCase
{
/* The public static variable below is used to drive control flow in the sink function.
The public static variable mimics a global variable in the C/C++ language family. */
public static boolean bad_public_static = false;
public void bad() throws Throwable
{
String data;
/* POTENTIAL FLAW: data may be set to null */
data = System.getProperty("CWE690");
bad_public_static = true;
(new CWE690_NULL_Deref_From_Return__System_getProperty_equals_22b()).bad_sink(data );
}
/* The public static variables below are used to drive control flow in the sink functions.
The public static variable mimics a global variable in the C/C++ language family. */
public static boolean goodB2G1_public_static = false;
public static boolean goodB2G2_public_static = false;
public static boolean goodG2B_public_static = false;
public void good() throws Throwable
{
goodB2G1();
goodB2G2();
goodG2B();
}
/* goodB2G1() - use badsource and goodsink by setting the static variable to false instead of true */
private void goodB2G1() throws Throwable
{
String data;
/* POTENTIAL FLAW: data may be set to null */
data = System.getProperty("CWE690");
goodB2G1_public_static = false;
(new CWE690_NULL_Deref_From_Return__System_getProperty_equals_22b()).goodB2G1_sink(data );
}
/* goodB2G2() - use badsource and goodsink by reversing the blocks in the if in the sink function */
private void goodB2G2() throws Throwable
{
String data;
/* POTENTIAL FLAW: data may be set to null */
data = System.getProperty("CWE690");
goodB2G2_public_static = true;
(new CWE690_NULL_Deref_From_Return__System_getProperty_equals_22b()).goodB2G2_sink(data );
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data;
/* FIX: Set data to a fixed, non-null String */
data = "CWE690";
goodG2B_public_static = true;
(new CWE690_NULL_Deref_From_Return__System_getProperty_equals_22b()).goodG2B_sink(data );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"guillermo.pando@gmail.com"
] |
guillermo.pando@gmail.com
|
345282f0689b15d6d05783ac8701feb037a03be8
|
2b6c5004b2f467d453f6a227306ae9830c1b834f
|
/lib/test/on2017_08/on2017_08_18_Goldman_Sachs_CodeSprint/Time_Series_Queries/TimeSeriesQueries.java
|
0c4c82dd4a645e663290b6807a3add2cd69c67b8
|
[] |
no_license
|
gargoris/yaal
|
83edf0bb36627aa96ce0e66c836d56f92ec5f842
|
4f927166577b16faa99c7d3e6d870f59d6977cb3
|
refs/heads/master
| 2020-12-21T04:48:30.470138
| 2020-04-19T11:25:19
| 2020-04-19T11:25:19
| 178,675,652
| 0
| 0
| null | 2019-03-31T10:54:25
| 2019-03-31T10:54:24
| null |
UTF-8
|
Java
| false
| false
| 2,211
|
java
|
package on2017_08.on2017_08_18_Goldman_Sachs_CodeSprint.Time_Series_Queries;
import net.egork.generated.collections.list.IntArrayList;
import net.egork.generated.collections.list.IntList;
import net.egork.io.InputReader;
import net.egork.io.OutputWriter;
public class TimeSeriesQueries {
public void solve(int testNumber, InputReader in, OutputWriter out) {
int n = in.readInt();
int q = in.readInt();
int[] t = in.readIntArray(n);
int[] p = in.readIntArray(n);
IntList up = new IntArrayList();
for (int i = 0; i < n; i++) {
if (up.size() == 0 || p[up.last()] < p[i]) {
up.add(i);
}
}
IntList down = new IntArrayList();
for (int i = n - 1; i >= 0; i--) {
if (down.size() == 0 || p[down.last()] < p[i]) {
down.add(i);
}
}
down.inPlaceReverse();
for (int i = 0; i < q; i++) {
int type = in.readInt();
int value = in.readInt();
if (type == 1) {
int left = 0;
int right = up.size();
while (left < right) {
int middle = (left + right) >> 1;
if (p[up.get(middle)] >= value) {
right = middle;
} else {
left = middle + 1;
}
}
if (left == up.size()) {
out.printLine(-1);
} else {
out.printLine(t[up.get(left)]);
}
} else {
int left = 0;
int right = down.size();
while (left < right) {
int middle = (left + right) >> 1;
if (t[down.get(middle)] >= value) {
right = middle;
} else {
left = middle + 1;
}
}
if (left == down.size()) {
out.printLine(-1);
} else {
out.printLine(p[down.get(left)]);
}
}
}
}
}
|
[
"egor@egork.net"
] |
egor@egork.net
|
6b47c591cc938bc35a5586bc9d85756af60838a8
|
2b4f4b41e8a28a5024d41223b2876c87ee1eaa1a
|
/Eis-portlet/docroot/WEB-INF/service/com/idetronic/eis/NoSuchProjectStrategyException.java
|
b8c155d6fbb751cc9ddcfdcf2aebd5fd09f57b75
|
[] |
no_license
|
merbauraya/lportal6.2
|
48bb99e5b6b937fce6e20e5c76303c4982bcad02
|
e7446107fd793a8ab557b4748f3214a83dbe6ce6
|
refs/heads/master
| 2021-01-21T19:51:52.682108
| 2017-08-08T14:42:38
| 2017-08-08T14:42:38
| 92,167,957
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,076
|
java
|
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.idetronic.eis;
import com.liferay.portal.NoSuchModelException;
/**
* @author Mazlan Mat
*/
public class NoSuchProjectStrategyException extends NoSuchModelException {
public NoSuchProjectStrategyException() {
super();
}
public NoSuchProjectStrategyException(String msg) {
super(msg);
}
public NoSuchProjectStrategyException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchProjectStrategyException(Throwable cause) {
super(cause);
}
}
|
[
"mazlan.mat@gmail.com"
] |
mazlan.mat@gmail.com
|
044f199dc4f60057394ca6242cc4e4083455cb48
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/10/10_f8f5fb3c3a99be2b0ab8972e42538893958b0920/ConnectionManager/10_f8f5fb3c3a99be2b0ab8972e42538893958b0920_ConnectionManager_t.java
|
1b08bbb80cdb3cdb7ddab786c75a531ec1538f06
|
[] |
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,879
|
java
|
package com.topsy.jmxproxy.jmx;
import com.topsy.jmxproxy.JMXProxyServiceConfiguration;
import com.topsy.jmxproxy.core.Host;
import com.yammer.dropwizard.lifecycle.Managed;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.ws.rs.core.Response;
import javax.ws.rs.WebApplicationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConnectionManager implements Managed {
private static final Logger LOG = LoggerFactory.getLogger(ConnectionManager.class);
private final JMXProxyServiceConfiguration config;
private Map<String, ConnectionWorker> hosts;
private ScheduledExecutorService purge;
private boolean started = false;
public ConnectionManager(JMXProxyServiceConfiguration config) {
this.config = config;
hosts = new HashMap<String, ConnectionWorker>();
purge = Executors.newSingleThreadScheduledExecutor();
}
public Host getHost(String host) throws WebApplicationException {
return getHost(host, null);
}
public Host getHost(String host, ConnectionCredentials auth) throws WebApplicationException {
if (!config.getAllowedEndpoints().isEmpty() && !config.getAllowedEndpoints().contains(host)) {
throw new WebApplicationException(Response.Status.FORBIDDEN);
}
try {
synchronized (hosts) {
if (hosts.containsKey(host) && !hosts.get(host).checkCredentials(auth)) {
LOG.info("resetting credentials for " + host);
hosts.remove(host).shutdown();
}
if (!hosts.containsKey(host)) {
LOG.info("creating new worker for " + host);
hosts.put(host, new ConnectionWorker(host, auth, config.getCacheDuration()));
}
}
return hosts.get(host).getHost();
} catch (SecurityException e) {
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
} catch (Exception e) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
}
public boolean isStarted() {
return started;
}
public void start() {
LOG.info("starting jmx connection manager");
LOG.debug("allowedEndpoints: " + config.getAllowedEndpoints().size());
for (String ae : config.getAllowedEndpoints()) {
LOG.debug(" " + ae);
}
purge.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
LOG.debug("begin expiring stale hosts");
synchronized (hosts) {
for (Map.Entry<String, ConnectionWorker>hostEntry : hosts.entrySet()) {
if (hostEntry.getValue().isExpired(config.getAccessDuration())) {
LOG.debug("purging " + hostEntry.getKey());
hosts.remove(hostEntry.getKey()).shutdown();
}
}
}
LOG.debug("end expiring stale hosts");
}
}, config.getCleanInterval(), config.getCleanInterval(), TimeUnit.MINUTES);
started = true;
}
public void stop() {
LOG.info("stopping jmx connection manager");
purge.shutdown();
synchronized (hosts) {
for (Map.Entry<String, ConnectionWorker>hostEntry : hosts.entrySet()) {
LOG.debug("purging " + hostEntry.getKey());
hosts.remove(hostEntry.getKey()).shutdown();
}
}
hosts.clear();
started = false;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
bcf76ffbca099b67ffc14db33c9e09b01ed09476
|
22eb7d16cfeed30effe929feac681edfd0af3c76
|
/src/main/java/com/mycompany/mockito/reference/documentation/tutorial/User.java
|
5e8de280a29448a6275a9475ec37e45ea5f78b4d
|
[] |
no_license
|
colinbut/learning-mockito
|
9bd698f69f98077aff28ee3d648bfc1937d8d43f
|
504aa9a37577953f09fd9f09b7fc1fa47aabde57
|
refs/heads/master
| 2020-06-29T21:41:05.937962
| 2016-08-30T19:45:57
| 2016-08-30T19:45:57
| 66,972,144
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 587
|
java
|
/**
*
*/
package com.mycompany.mockito.reference.documentation.tutorial;
/**
* @author colin
*
*/
public class User {
private int userId;
private String username;
/**
* @return the userId
*/
public int getUserId() {
return userId;
}
/**
* @param userId the userId to set
*/
public void setUserId(int userId) {
this.userId = userId;
}
/**
* @return the username
*/
public String getUsername() {
return username;
}
/**
* @param username the username to set
*/
public void setUsername(String username) {
this.username = username;
}
}
|
[
"colinbut@users.noreply.github.com"
] |
colinbut@users.noreply.github.com
|
50958ab832eb087d5bc1b926c9866cff6a0aa997
|
8dadce08a76ce387608951673fc0364feaa9a06a
|
/flexodesktop/externalmodels/flexoexecutionmodel/src/main/java/org/openflexo/foundation/exec/EndOperationNodeActivation.java
|
67ea4e479ab946c285ad02da4e6fd4d4348024f0
|
[] |
no_license
|
melbarra/openflexo
|
b8e1a97d73a9edebad198df4e776d396ae8e9a09
|
9b2d8efe1982ec8f64dee8c43a2e7207594853f3
|
refs/heads/master
| 2021-01-24T02:22:47.141424
| 2012-03-12T00:15:57
| 2012-03-12T00:15:57
| 2,756,256
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,087
|
java
|
/*
* (c) Copyright 2010-2011 AgileBirds
*
* This file is part of OpenFlexo.
*
* OpenFlexo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenFlexo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenFlexo. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openflexo.foundation.exec;
import org.openflexo.antar.ControlGraph;
import org.openflexo.foundation.exec.inst.DeleteActivityTask;
import org.openflexo.foundation.exec.inst.DestroyRemainingTokensForActivity;
import org.openflexo.foundation.wkf.node.FlexoPreCondition;
import org.openflexo.foundation.wkf.node.OperationNode;
public class EndOperationNodeActivation extends NodeActivation<OperationNode> {
public EndOperationNodeActivation(OperationNode node, FlexoPreCondition pre)
{
super(node,pre);
}
public EndOperationNodeActivation(OperationNode node)
{
super(node);
}
@Override
public ControlGraph makeSpecificControlGraph(boolean interprocedural) throws NotSupportedException, InvalidModelException
{
ControlGraph DESTROY_REMAINING_TOKEN = new DestroyRemainingTokensForActivity(getNode().getAbstractActivityNode());
ControlGraph DELETE_ACTIVITY_TASK = new DeleteActivityTask(getNode().getAbstractActivityNode());
return makeSequentialControlGraph(
DESTROY_REMAINING_TOKEN,
DELETE_ACTIVITY_TASK);
}
/**
* Override parent method: we don't try here to activate a node above
*/
@Override
protected ControlGraph makeControlGraphCommonPostlude(boolean interprocedural) throws NotSupportedException, InvalidModelException
{
return NodeDesactivation.desactivateNode(getNode(),interprocedural);
}
}
|
[
"guillaume.polet@gmail.com"
] |
guillaume.polet@gmail.com
|
03b3bb0533c6cc7a77eb070da427c97563e622ee
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/14/14_dfba9c6863552cd3613cf3fbb053ef9e23989efe/Frontend/14_dfba9c6863552cd3613cf3fbb053ef9e23989efe_Frontend_s.java
|
776685c2398523d96cb4f3cc7f640b028bad1868
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 2,895
|
java
|
/*
* Copyright (c) 2009-2010, IETR/INSA of Rennes
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the IETR/INSA of Rennes nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
package net.sf.orcc.frontend;
import java.io.File;
import java.util.List;
import net.sf.orcc.OrccException;
import net.sf.orcc.OrccRuntimeException;
import net.sf.orcc.cal.cal.AstActor;
import net.sf.orcc.ir.Actor;
import net.sf.orcc.ir.serialize.IRWriter;
import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import com.google.inject.Inject;
/**
* This class defines an RVC-CAL front-end.
*
* @author Matthieu Wipliez
*
*/
public class Frontend {
@Inject
private AstTransformer astTransformer;
/**
* output folder
*/
private File outputFolder;
public Frontend() {
}
public void compile(String file, AstActor astActor) throws OrccException {
// only compile if actor has no errors
List<Diagnostic> errors = astActor.eResource().getErrors();
if (errors.isEmpty()) {
try {
Actor actor = astTransformer.transform(file, astActor);
new IRWriter(actor).write(outputFolder.toString());
} catch (OrccRuntimeException e) {
throw new OrccException(e.getMessage(), e);
}
}
}
public void setOutputFolder(String outputFolder) {
this.outputFolder = new File(outputFolder);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
5d793aba33e7a75d864306d3b33b6c76de5349f5
|
e5f0f957a4ab209cb7148c97759619c835b4d014
|
/src/main/java/com/example/user/controller/UserController.java
|
cb4fed354424a8c727e08c14ad8d5a5e14e6484d
|
[] |
no_license
|
Shin-JungYeon/demo
|
aadbd8c097763baca7724798f3494d55892a436f
|
0cc23d2390c2be7f98d5fb8be2deee7301e2ed0c
|
refs/heads/master
| 2022-11-26T05:59:14.830923
| 2022-07-25T07:39:20
| 2022-07-25T07:39:20
| 247,005,710
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 520
|
java
|
package com.example.user.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
public class UserController {
/**
* 사용자 페이지 이동 ( 새로고침 시 사용 됨 )
*/
@RequestMapping(value ={ "/user/**"}, method = RequestMethod.GET)
public String getUserIndex() {
System.out.println("나 탄당");
return "user/index";
}
}
|
[
"ssjy11@gmail.com"
] |
ssjy11@gmail.com
|
7d44f60e78ef1050f48254e5cc85de36db84f36f
|
929f13780c6d173845cce613b982e0a77a84fd25
|
/examples/src/main/java/fr/bmartel/speedtest/examples/FixedTimeUploadExample.java
|
03d5d9d636997e0f5572a6afd5affc3f5e3712ca
|
[
"MIT"
] |
permissive
|
richard457/speed-test-lib
|
671cef555f059afdeeea27225d759af49c933ab4
|
74c8f593f904c5186b2949b8a6f0bc7b726cc136
|
refs/heads/master
| 2021-06-21T04:42:56.619086
| 2017-07-18T19:08:21
| 2017-07-18T19:08:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,699
|
java
|
/*
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016-2017 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* <p/>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package fr.bmartel.speedtest.examples;
import fr.bmartel.speedtest.SpeedTestReport;
import fr.bmartel.speedtest.SpeedTestSocket;
import fr.bmartel.speedtest.inter.ISpeedTestListener;
import fr.bmartel.speedtest.model.SpeedTestError;
import fr.bmartel.speedtest.model.SpeedTestMode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
* Begin to upload a file from server & stop uploading when test duration is elapsed.
*
* @author Bertrand Martel
*/
public class FixedTimeUploadExample {
/**
* spedd examples server uri.
*/
private static final String SPEED_TEST_SERVER_URI_UL = "http://2.testdebit.info/";
/**
* upload 10Mo file size.
*/
private static final int FILE_SIZE = 100000000;
/**
* amount of time between each speed test reports set to 1s.
*/
private static final int REPORT_INTERVAL = 1000;
/**
* speed test duration set to 15s.
*/
private static final int SPEED_TEST_DURATION = 15000;
/**
* logger.
*/
private final static Logger LOGGER = LogManager.getLogger(FixedTimeUploadExample.class.getName());
/**
* Fixed time upload example main.
*
* @param args no args required
*/
public static void main(final String[] args) {
final SpeedTestSocket speedTestSocket = new SpeedTestSocket();
//speedTestSocket.setUploadStorageType(UploadStorageType.FILE_STORAGE);
speedTestSocket.addSpeedTestListener(new ISpeedTestListener() {
@Override
public void onError(final SpeedTestError speedTestError, final String errorMessage) {
if (LOGGER.isErrorEnabled()) {
LOGGER.error(errorMessage);
}
}
@Override
public void onCompletion(final SpeedTestReport report) {
//called when upload is finished
LogUtils.logFinishedTask(SpeedTestMode.UPLOAD, report.getTotalPacketSize(),
report.getTransferRateBit(),
report.getTransferRateOctet(), LOGGER);
}
@Override
public void onProgress(final float percent, final SpeedTestReport uploadReport) {
//notify progress
LogUtils.logSpeedTestReport(uploadReport, LOGGER);
}
});
speedTestSocket.startFixedUpload(SPEED_TEST_SERVER_URI_UL,
FILE_SIZE, SPEED_TEST_DURATION, REPORT_INTERVAL);
}
}
|
[
"bmartel.fr@gmail.com"
] |
bmartel.fr@gmail.com
|
233d7b92b27ad632a3856acbbd960ba79cbb298e
|
e0bc2f5563ccf72946f7ea8ed21ed1438144b398
|
/app/src/main/java/com/example/kouveepetshop/api/ApiPengadaan.java
|
b006f09e6ad5694288b4f61e778ce4d7fdc2a58e
|
[] |
no_license
|
mirokub/KouveePetShop
|
c401d3990b229dfb1acfe883492cbc6fdafd923f
|
255d1f200544481a859de38e3e3f980ab3defaca
|
refs/heads/master
| 2021-03-26T07:35:45.858115
| 2020-06-12T03:48:02
| 2020-06-12T03:48:02
| 247,684,620
| 0
| 0
| null | 2020-06-12T03:48:03
| 2020-03-16T11:26:27
|
Java
|
UTF-8
|
Java
| false
| false
| 3,187
|
java
|
package com.example.kouveepetshop.api;
import com.example.kouveepetshop.model.DetailPengadaanModel;
import com.example.kouveepetshop.model.DetailPenjualanProdukModel;
import com.example.kouveepetshop.model.PengadaanModel;
import com.example.kouveepetshop.model.PenjualanProdukModel;
import com.example.kouveepetshop.result.pengadaan.ResultDetailPengadaan;
import com.example.kouveepetshop.result.pengadaan.ResultOneDetailPengadaan;
import com.example.kouveepetshop.result.pengadaan.ResultOnePengadaan;
import com.example.kouveepetshop.result.pengadaan.ResultPengadaan;
import com.example.kouveepetshop.result.penjualan_produk.ResultDetailProduk;
import com.example.kouveepetshop.result.penjualan_produk.ResultOneDetailProduk;
import com.example.kouveepetshop.result.penjualan_produk.ResultOnePenjualanProduk;
import com.example.kouveepetshop.result.penjualan_produk.ResultPenjualanProduk;
import com.example.kouveepetshop.result.produk.ResultProduk;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
public interface ApiPengadaan {
//Pengadaan Produk
@GET("pengadaan")
Call<ResultPengadaan> getAll();
@GET("notification")
Call<ResultProduk> getNotification();
@GET("pengadaan/{id}")
Call<ResultOnePengadaan> getPengadaan(@Path("id") String id);
@POST("pengadaan")
Call<ResultOnePengadaan> createPengadaan(@Body PengadaanModel pengadaanModel);
@PUT("pengadaan/{id}")
Call<ResultOnePengadaan> updatePengadaan(@Path("id") String id,
@Body PengadaanModel pengadaanModel);
@PUT("pengadaan/updateTotal/{id}")
@FormUrlEncoded
Call<ResultOnePengadaan> updateTotal(@Path("id") String nomor_pengadaan,
@Field("total") String total);
@PUT("pengadaan/delete/{id}")
@FormUrlEncoded
Call<ResultOnePengadaan> deletePengadaan(@Path("id") String id,
@Field("pic") String pic);
@PUT("pengadaan/konfirmasi/{id}")
Call<ResultOnePengadaan> confirmationPengadaan(@Path("id") String id);
//Detail Pengadaan Produk
@GET("detail_pengadaan/getByTransaction/{id}")
Call<ResultDetailPengadaan> getAllDetail(@Path("id") String nomor_pengadaan);
@GET("detail_pengadaan/{id}")
Call<ResultOneDetailPengadaan> getDetail(@Path("id") String id_detail);
@POST("detail_pengadaan")
Call<ResultOneDetailPengadaan> createDetail(@Body DetailPengadaanModel detailPengadaanModel);
@PUT("detail_pengadaan/{id}")
Call<ResultOneDetailPengadaan> updateDetail(@Path("id") String id_detail,
@Body DetailPengadaanModel detailPengadaanModel);
@DELETE("detail_pengadaan/{id}")
Call<ResultOneDetailPengadaan> deleteDetail(@Path("id") String id_detail);
//Surat Pemesanan
@GET("pengadaan/surat/print/{id}")
Call<ResponseBody> printSuratPemesanan(@Path("id") String id);
}
|
[
"="
] |
=
|
6be0b346131974c7c6b88a124bcd769183687731
|
2a5a567c911a102be5ab6537c66b729c1033df70
|
/src/com/aggfi/digest/server/botty/digestbotty/model/ComplReplyProb.java
|
61663897850dd7ad48ceab76ca0f7cdf13cbfbe8
|
[] |
no_license
|
vega113/DigestBottyNGadget
|
c55cbcabbc218b854e9c3862c7261f8cfe41739b
|
5b80803375fe00176ec8af418f48f01a42f540b6
|
refs/heads/master
| 2021-01-01T18:17:43.800574
| 2010-10-16T09:54:56
| 2010-10-16T09:54:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,738
|
java
|
package com.aggfi.digest.server.botty.digestbotty.model;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.aggfi.digest.server.botty.digestbotty.utils.InfluenceUtils;
import com.google.gson.annotations.Expose;
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class ComplReplyProb {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Expose
private Long id;
@Expose
@Persistent
String projectId;
@Expose
@Persistent
Date forDate;
@Expose
@Persistent
String forDateStr;
@Expose
@Persistent(serialized = "true", defaultFetchGroup = "true")
Map<String,Double> complProbMap;
public ComplReplyProb(String projectId, Date forDate,
Map<String, Double> complProbMap) {
super();
this.projectId = projectId;
this.forDate = forDate;
this.complProbMap = complProbMap;
this.forDateStr = InfluenceUtils.getSdf().format(forDate);
}
@Override
public String toString() {
final int maxLen = 10;
StringBuilder builder = new StringBuilder();
builder.append("ComplReplyProb [id=");
builder.append(id);
builder.append(", projectId=");
builder.append(projectId);
builder.append(", forDate=");
builder.append(forDate);
builder.append(", forDateStr=");
builder.append(forDateStr);
builder.append(", complProbMap=");
builder.append(complProbMap != null ? toString(complProbMap.entrySet(),
maxLen) : null);
builder.append("]");
return builder.toString();
}
private String toString(Collection<?> collection, int maxLen) {
StringBuilder builder = new StringBuilder();
builder.append("[");
int i = 0;
for (Iterator<?> iterator = collection.iterator(); iterator.hasNext()
&& i < maxLen; i++) {
if (i > 0)
builder.append(", ");
builder.append(iterator.next());
}
builder.append("]");
return builder.toString();
}
public String getForDateStr() {
return forDateStr;
}
public void setForDateStr(String forDateStr) {
this.forDateStr = forDateStr;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public Date getForDate() {
return forDate;
}
public void setForDate(Date forDate) {
this.forDate = forDate;
}
public Map<String, Double> getComplProbMap() {
return complProbMap;
}
public void setComplProbMap(Map<String, Double> complProbMap) {
this.complProbMap = complProbMap;
}
public Long getId() {
return id;
}
}
|
[
"vega113@gmail.com"
] |
vega113@gmail.com
|
378cecd21db35f879bca5b73702528dfa88e7947
|
31a3b3d03997a770401e038d20bf9806c7484269
|
/Sorter/src/olefoens/sorter/Main.java
|
a2c894c738064f72d9aa6b214cc239a609f83cff
|
[] |
no_license
|
foens/LegoSorter
|
c90ddb13ffa0d8dedb5ae263493a2361e7cdc781
|
4414db6d31a7b6108cc722aea2b1e2fda4f0b965
|
refs/heads/master
| 2020-05-30T10:12:05.247384
| 2013-06-25T09:02:18
| 2013-06-25T09:02:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,653
|
java
|
package olefoens.sorter;
import lejos.nxt.*;
import lejos.nxt.addon.RCXLightSensor;
import lejos.util.Delay;
import olefoens.axlesorter.AxleSorter;
import olefoens.beamcounter.*;
import olefoens.communication.ClientRole;
import olefoens.communication.Communicator;
import java.io.IOException;
public class Main
{
/**
* If you want to run the Sorter without bluetooth communication, set this to true
*/
public static final boolean NO_MASTER_MODE = false;
public static void main(String[] args) throws InterruptedException
{
Button.ESCAPE.addButtonListener(new ButtonListener()
{
public void buttonPressed(Button b){ System.exit(0);}
public void buttonReleased(Button b){}
});
LightSensor floodLight = new LightSensor(SensorPort.S1);
LightSensor sensor = new LightSensor(SensorPort.S2);
BeltDrive beltDrive = new BeltDrive();
beltDrive.addBeltMotor(new BeltMotorDescription(Motor.B, DriveDirection.FORWARD));
beltDrive.addBeltMotor(new BeltMotorDescription(Motor.C, DriveDirection.REVERSE));
try
{
Communicator master = NO_MASTER_MODE ? null : Communicator.acceptConnectionFromMaster(ClientRole.Sorter);
BeamHoleCounter bhc = new BeamHoleCounter(floodLight, sensor, beltDrive);
AxleSorter axleSorter = new AxleSorter(Motor.A, new RCXLightSensor(SensorPort.S3), new RCXLightSensor(SensorPort.S4));
BeamAxleSorter beamAxleSorter = new BeamAxleSorter(bhc, master, axleSorter);
if(NO_MASTER_MODE)
beamAxleSorter.stopAndStartSorters();
else
beamAxleSorter.startSystem();
} catch(IOException e)
{
LCD.clear();
LCD.drawString("IOException!", 0, 0);
Delay.msDelay(10000);
}
}
}
|
[
"kfoens@gmail.com"
] |
kfoens@gmail.com
|
000a818d4847a2087d53a1996ca9249a4cb29216
|
b9889bc2c57927a8dd83062b6b53e3d424e8add5
|
/de.bht.fpa.mail.s778455.imapnavigation/src/de/bht/fpa/mail/s778455/imapnavigation/composite/IMAPItem.java
|
ec5ba61c6cb750be1f8382033afbb5f5b9ef21f7
|
[] |
no_license
|
sasfeld/FPA_SS2012
|
47c126aa88896d398a2a7845d5816bcc5c513567
|
9d2797555f8a31f5630fa06109a204da87f92934
|
refs/heads/master
| 2020-04-06T06:48:14.478093
| 2012-06-18T16:59:08
| 2012-06-18T16:59:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 488
|
java
|
package de.bht.fpa.mail.s778455.imapnavigation.composite;
/**
* The abstract component class. - transparency
*
* @author Sascha Feldmann
*
*/
public abstract class IMAPItem {
/**
* Check if the element has children.
*
* @return true if the element has children.
*/
public abstract boolean hasChildren();
/**
* Return an array of children.
*
* @return an array of children.
*/
public abstract IMAPItem[] getChildren();
}
|
[
"sascha.feldmann@gmx.de"
] |
sascha.feldmann@gmx.de
|
6736ed6c6b3a063e74a0fe80690fe50619adb78e
|
4d956d377eb465098c9de697fea9847d985a69d3
|
/src/main/java/io/jboot/db/model/Columns.java
|
f62be1a1f035dc56675b51f7fab2ab074e4064c7
|
[
"Apache-2.0"
] |
permissive
|
chenyongze/jboot
|
587be9d852a0aee1ce1a45a7a7d9e5bf05946a85
|
d35ea46f2ec666bdfaeca0c87da6f5e06d63871d
|
refs/heads/master
| 2020-04-05T17:38:05.679639
| 2018-11-01T08:49:04
| 2018-11-01T08:49:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,832
|
java
|
/**
* Copyright (c) 2015-2018, Michael Yang 杨福海 (fuhai999@gmail.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jboot.db.model;
import io.jboot.utils.StrUtils;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
/**
* Column 的工具类,用于方便组装sql
*/
public class Columns implements Serializable {
private List<Column> cols;
public static Columns create() {
return new Columns();
}
public static Columns create(Column column) {
Columns that = new Columns();
that.add(column);
return that;
}
public static Columns create(List<Column> columns) {
Columns that = new Columns();
that.cols = columns;
return that;
}
public static Columns create(String name, Object value) {
return create().eq(name, value);
}
/**
* add new column in Columns
*
* @param column
*/
public void add(Column column) {
//do not add null value column
if (column.isMustNeedValue() && column.getValue() == null) {
return;
}
if (this.cols == null) {
this.cols = new LinkedList<>();
}
this.cols.add(column);
}
public Columns add(String name, Object value) {
return eq(name, value);
}
/**
* equals
*
* @param name
* @param value
* @return
*/
public Columns eq(String name, Object value) {
this.add(Column.create(name, value));
return this;
}
/**
* not equals !=
*
* @param name
* @param value
* @return
*/
public Columns ne(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_NOT_EQUALS));
return this;
}
/**
* like
*
* @param name
* @param value
* @return
*/
public Columns like(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_LIKE));
return this;
}
/**
* 自动添加两边 % 的like
*
* @param name
* @param value
* @return
*/
public Columns likeAppendPercent(String name, Object value) {
if (value == null || StrUtils.isBlank(value.toString())) {
//do nothing
return this;
}
this.add(Column.create(name, "%" + value + "%", Column.LOGIC_LIKE));
return this;
}
/**
* 大于 great than
*
* @param name
* @param value
* @return
*/
public Columns gt(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_GT));
return this;
}
/**
* 大于等于 great or equal
*
* @param name
* @param value
* @return
*/
public Columns ge(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_GE));
return this;
}
/**
* 小于 less than
*
* @param name
* @param value
* @return
*/
public Columns lt(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_LT));
return this;
}
/**
* 小于等于 less or equal
*
* @param name
* @param value
* @return
*/
public Columns le(String name, Object value) {
this.add(Column.create(name, value, Column.LOGIC_LE));
return this;
}
public Columns is_null(String name) {
this.add(Column.create(name, null, Column.LOGIC_IS_NULL));
return this;
}
public Columns is_not_null(String name) {
this.add(Column.create(name, null, Column.LOGIC_IS_NOT_NULL));
return this;
}
public boolean isEmpty() {
return cols == null || cols.isEmpty();
}
static final Object[] NULL_PARA_ARRAY = new Object[0];
public Object[] getValueArray() {
if (isEmpty()) {
return null;
}
List<Object> values = new LinkedList<>();
for (Column column : cols) {
if (column.getValue() != null) values.add(column.getValue());
}
return values.isEmpty() ? NULL_PARA_ARRAY : values.toArray();
}
public List<Column> getList() {
return cols;
}
}
|
[
"fuhai999@gmail.com"
] |
fuhai999@gmail.com
|
7cadd9468d4be2bbbf8e14f9c90603349d6e0ca2
|
7ebc513fe01c6dfdb85b2dafbc6a2b1ec48bc20b
|
/src/java/c/b/b/a/f/b/q5.java
|
2aac2eda4565c5420ab098819b6568457113e52b
|
[] |
no_license
|
arnoldnekemiah/chessapp
|
b6c9b7a5aceb8912d699abf654f9ebc08a61f8d2
|
f3f0b141742f55c84c7ab98966256897c6bb07f4
|
refs/heads/main
| 2023-04-05T00:25:54.395071
| 2021-04-13T06:12:39
| 2021-04-13T06:12:39
| 357,438,812
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 739
|
java
|
/*
* Decompiled with CFR 0.0.
*
* Could not load the following classes:
* java.lang.Object
* java.lang.Runnable
* java.lang.String
*/
package c.b.b.a.f.b;
import c.b.b.a.f.b.j6;
public final class q5
implements Runnable {
public final /* synthetic */ String a;
public final /* synthetic */ String b;
public final /* synthetic */ Object c;
public final /* synthetic */ long d;
public final /* synthetic */ j6 e;
public q5(j6 j62, String string, String string2, Object object, long l2) {
this.e = j62;
this.a = string;
this.b = string2;
this.c = object;
this.d = l2;
}
public final void run() {
this.e.a(this.a, this.b, this.c, this.d);
}
}
|
[
"42886828+arnoldnekemiah@users.noreply.github.com"
] |
42886828+arnoldnekemiah@users.noreply.github.com
|
b27bfb77e469442af877562c42c39bd5fd249577
|
0e06e096a9f95ab094b8078ea2cd310759af008b
|
/classes91-dex2jar/com/tapjoy/internal/fz.java
|
2dcf023b7629c2c6826612bd70249e8a7755f795
|
[] |
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
| 1,440
|
java
|
//
// Decompiled by Procyon v0.5.34
//
package com.tapjoy.internal;
import android.os.Looper;
public final class fz
{
public static boolean a;
public static void a(final String s) {
if (fz.a) {
ac.a(4, "Tapjoy", s, null);
}
}
public static void a(final String s, final String s2, final String s3) {
if (fz.a) {
ac.a("Tapjoy", "{}: {} {}", s, s2, s3);
}
}
public static void a(final String s, final Object... array) {
if (fz.a) {
ac.a(4, "Tapjoy", s, array);
}
}
public static boolean a(final Object o, final String s) {
if (o == null) {
if (fz.a) {
b(s);
}
return false;
}
return true;
}
public static boolean a(final boolean b, final String s) {
if (fz.a && !b) {
b(s);
throw new IllegalStateException(s);
}
return b;
}
public static void b(final String s) {
if (fz.a) {
ac.a(6, "Tapjoy", s, null);
}
}
public static void b(final String s, final Object... array) {
if (fz.a) {
ac.a("Tapjoy", s, array);
}
}
public static boolean c(final String s) {
return a(Looper.myLooper() == Looper.getMainLooper(), s + ": Must be called on the main/ui thread");
}
}
|
[
"querky1231@gmail.com"
] |
querky1231@gmail.com
|
301bb249ddc08813529a0bc6090d8bc6f87f1181
|
3d0cbc81cfa7e484cf14662b003508f52f1d2b08
|
/translator-web-meta/translator-web-app/src/main/java/com/github/bogdanovmn/translator/web/app/admin/upload/UploadBookController.java
|
faa1b02b46ff5c8da692acb4586a36a56ba765b2
|
[
"BSD-2-Clause"
] |
permissive
|
bogdanovmn/translator
|
94a578aef866ee2ec48235dfb5c359296c0ff6ce
|
e9af02bd5768fcf51cf69e07ed11c1e5529f24c7
|
refs/heads/master
| 2022-10-06T04:51:13.376678
| 2022-10-03T23:11:14
| 2022-10-03T23:11:14
| 103,356,487
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,328
|
java
|
package com.github.bogdanovmn.translator.web.app.admin.upload;
import com.github.bogdanovmn.common.spring.menu.MenuItem;
import com.github.bogdanovmn.common.spring.mvc.ViewTemplate;
import com.github.bogdanovmn.translator.web.app.infrastructure.AbstractVisualAdminController;
import com.github.bogdanovmn.translator.web.app.infrastructure.menu.MainMenuItem;
import com.github.bogdanovmn.translator.web.orm.entity.Source;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import java.io.IOException;
@Slf4j
@Controller
class UploadBookController extends AbstractVisualAdminController {
private final UploadBookService uploadBookService;
@Autowired
UploadBookController(UploadBookService uploadBookService) {
this.uploadBookService = uploadBookService;
}
@Override
protected MenuItem currentMenuItem() {
return MainMenuItem.UPLOAD_BOOK;
}
@PostMapping("/upload-book")
String upload(
@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes
) {
try {
Source source = uploadBookService.upload(file);
redirectAttributes.addFlashAttribute("msg", "OK!");
redirectAttributes.addFlashAttribute("source", source);
}
catch (IOException e) {
LOG.error("Upload book error", e);
redirectAttributes.addFlashAttribute(
"customError",
String.format(
"Что-то пошло не так при загрузке файла (%s)",
e.getMessage()
)
);
}
catch (UploadDuplicateException e) {
redirectAttributes.addFlashAttribute("customError", e.getMessage());
}
return "redirect:/admin/upload-book";
}
@GetMapping("/upload-book")
ModelAndView form(
@RequestHeader(name = "referer", required = false) String referer)
{
return new ViewTemplate("upload_book")
.with("referer" , referer)
.modelAndView();
}
}
|
[
"bogdanovmn@gmail.com"
] |
bogdanovmn@gmail.com
|
2fe928a068f305595d490bce97d48a17a94e4ecd
|
1fbc7b819ded0824d28f4e24465b023e30c1f421
|
/core/src/main/java/org/mini2Dx/core/input/GamePadConnectionListener.java
|
57ae85e09bbbf481bb6c0e85a339ffa5c23c995a
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
mini2Dx/mini2Dx
|
959bfce4690f54cce68c9e8bb68328d2d48eaeaa
|
93a5c6cb59ff186926ca7005604aad5e707a7656
|
refs/heads/master
| 2023-09-03T14:37:58.044965
| 2023-08-19T18:47:09
| 2023-08-19T18:47:09
| 8,236,056
| 543
| 76
|
Apache-2.0
| 2022-12-05T21:53:34
| 2013-02-16T13:27:08
|
Java
|
UTF-8
|
Java
| false
| false
| 929
|
java
|
/*******************************************************************************
* Copyright 2020 Viridian Software Limited
*
* 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.mini2Dx.core.input;
public interface GamePadConnectionListener {
public void onConnect(GamePad gamePad);
public void onDisconnect(GamePad gamePad);
}
|
[
"thomascashman404@gmail.com"
] |
thomascashman404@gmail.com
|
f0fb87924d2d33ae9ff96549a62342c650f6fc9a
|
a22017d5e0bc78268e862350b3b53dfb9b4b15d6
|
/mainframe/src/main/java/com/taoxue/umeng/model/BasePageModel.java
|
4a56fa7b53650c6c4d65d177fe07bb40b8b4c1cc
|
[] |
no_license
|
hanks7/HjjAndroidFrame
|
1a0d8d43961b3f1d48ba09341391747f0f2dcf7a
|
928f649f67c699b50481b8dcb4ff652bd5a2ce3f
|
refs/heads/master
| 2021-05-12T18:57:14.857376
| 2018-03-23T04:32:17
| 2018-03-23T04:32:17
| 117,078,805
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 406
|
java
|
package com.taoxue.umeng.model;
import com.taoxue.umeng.base.BaseModel;
import java.io.Serializable;
/**
* Created by CC on 2016/12/11.
*/
public class BasePageModel<Data extends Serializable> extends BaseModel {
private PageModel<Data> page;
public PageModel<Data> getPage() {
return page;
}
public void setPage(PageModel<Data> page) {
this.page = page;
}
}
|
[
"474664736@qq.com"
] |
474664736@qq.com
|
439fc35d2966325ef1d213be6ab3c749f8698ed3
|
b85376d5c76246b2866a743d70a723e17f99b08e
|
/Algorithm_213_House Robber II.java
|
8bf17e6cbbe4afcf97780035ae203c134dae3c04
|
[] |
no_license
|
zclyne/LeetCode-Problems
|
db56a21ea6620ccb7506e24622490560c039225e
|
3f59e4c2ac7dc95e4b9e70e705616f5ee4915967
|
refs/heads/master
| 2022-08-27T12:00:49.477906
| 2022-08-22T20:23:10
| 2022-08-22T20:23:10
| 123,556,538
| 7
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,136
|
java
|
// 思路:首尾相连表明nums[0]和nums[nums.length - 1]中最多只能有一个被选中
// 因此可以看作2次Algorithm_198,没有环的情况
// 第一次为nums[0 : nums.length - 1],第二次为nums[1 : nums.length]
class Solution {
public int rob(int[] nums) {
if (nums == null || nums.length == 0) {
return 0;
} else if (nums.length == 1) {
return nums[0];
}
int lastRob = 0, lastNotRob = 0, result = 0;
for (int i = 0; i < nums.length - 1; i++) {
int curRob = lastNotRob + nums[i];
int curNotRob = Math.max(lastRob, lastNotRob);
lastRob = curRob;
lastNotRob = curNotRob;
}
result = Math.max(lastRob, lastNotRob);
lastRob = 0;
lastNotRob = 0;
for (int i = 1; i < nums.length; i++) {
int curRob = lastNotRob + nums[i];
int curNotRob = Math.max(lastRob, lastNotRob);
lastRob = curRob;
lastNotRob = curNotRob;
}
result = Math.max(result, Math.max(lastRob, lastNotRob));
return result;
}
}
|
[
"zyfinori@gmail.com"
] |
zyfinori@gmail.com
|
e9ae0fa281fbf06bafc2d5cff1985b904767b7fd
|
ea8013860ed0b905c64f449c8bce9e0c34a23f7b
|
/SystemUIGoogle/sources/com/android/systemui/biometrics/AuthBiometricUdfpsView.java
|
b2891cb41ee11e02e36f16deb64307aaea231cca
|
[] |
no_license
|
TheScarastic/redfin_b5
|
5efe0dc0d40b09a1a102dfb98bcde09bac4956db
|
6d85efe92477576c4901cce62e1202e31c30cbd2
|
refs/heads/master
| 2023-08-13T22:05:30.321241
| 2021-09-28T12:33:20
| 2021-09-28T12:33:20
| 411,210,644
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,627
|
java
|
package com.android.systemui.biometrics;
import android.content.Context;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.util.AttributeSet;
import com.android.systemui.biometrics.AuthDialog;
/* loaded from: classes.dex */
public class AuthBiometricUdfpsView extends AuthBiometricFingerprintView {
private UdfpsDialogMeasureAdapter mMeasureAdapter;
public AuthBiometricUdfpsView(Context context) {
this(context, null);
}
public AuthBiometricUdfpsView(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
/* access modifiers changed from: package-private */
public void setSensorProps(FingerprintSensorPropertiesInternal fingerprintSensorPropertiesInternal) {
UdfpsDialogMeasureAdapter udfpsDialogMeasureAdapter = this.mMeasureAdapter;
if (udfpsDialogMeasureAdapter == null || udfpsDialogMeasureAdapter.getSensorProps() != fingerprintSensorPropertiesInternal) {
this.mMeasureAdapter = new UdfpsDialogMeasureAdapter(this, fingerprintSensorPropertiesInternal);
}
}
/* access modifiers changed from: package-private */
@Override // com.android.systemui.biometrics.AuthBiometricView
public AuthDialog.LayoutParams onMeasureInternal(int i, int i2) {
AuthDialog.LayoutParams onMeasureInternal = super.onMeasureInternal(i, i2);
UdfpsDialogMeasureAdapter udfpsDialogMeasureAdapter = this.mMeasureAdapter;
return udfpsDialogMeasureAdapter != null ? udfpsDialogMeasureAdapter.onMeasureInternal(i, i2, onMeasureInternal) : onMeasureInternal;
}
}
|
[
"warabhishek@gmail.com"
] |
warabhishek@gmail.com
|
5f4921375ed08a2ba874c4cde3aec504a4cd5bd8
|
bd8a57ef41ee157ad68a082c6f7a3f5a3abfc553
|
/redisson/src/main/java/org/redisson/client/protocol/decoder/StreamInfoMapDecoder.java
|
1d3d449b3f05ca890dca5ba4242cc029e9f31c5a
|
[
"Apache-2.0"
] |
permissive
|
songshansitulv/redisson
|
f2bd48c7149abd9ade33ba8bed94c931836b8958
|
55cc12870d95452ceaa0e531d3520fd1eddbe6a5
|
refs/heads/master
| 2020-07-08T17:37:52.290324
| 2019-08-22T08:18:31
| 2019-08-22T08:18:31
| 203,734,152
| 0
| 0
|
Apache-2.0
| 2019-08-22T07:02:50
| 2019-08-22T07:02:49
| null |
UTF-8
|
Java
| false
| false
| 1,688
|
java
|
/**
* Copyright (c) 2013-2019 Nikita Koksharov
*
* 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.redisson.client.protocol.decoder;
import java.util.List;
import org.redisson.client.codec.Codec;
import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder;
/**
*
* @author Nikita Koksharov
*
*/
public class StreamInfoMapDecoder implements MultiDecoder<Object> {
boolean hasNonZeroLevel = false;
final StreamInfoDecoder streamInfo = new StreamInfoDecoder();
final ObjectMapDecoder decoder;
public StreamInfoMapDecoder(Codec codec) {
decoder = new ObjectMapDecoder(codec);
}
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
if (state.getLevel() > 0) {
hasNonZeroLevel = true;
}
if (state.getLevel() == 2) {
return decoder.getDecoder(paramNum, state);
}
return null;
}
@Override
public Object decode(List<Object> parts, State state) {
if (hasNonZeroLevel) {
return decoder.decode(parts, state);
}
return streamInfo.decode(parts, state);
}
}
|
[
"nkoksharov@redisson.pro"
] |
nkoksharov@redisson.pro
|
d9058c4988c1a0952536c56f3ba2d35da1c21a02
|
29f78bfb928fb6f191b08624ac81b54878b80ded
|
/generated_SPs_SCs/test/large2/src/main/java/large2/input/InputDataClassName_4_2.java
|
d67d981dc401efba7bb8696691580dc886a03825
|
[] |
no_license
|
MSPL4SOA/MSPL4SOA-tool
|
8a78e73b4ac7123cf1815796a70f26784866f272
|
9f3419e416c600cba13968390ee89110446d80fb
|
refs/heads/master
| 2020-04-17T17:30:27.410359
| 2018-07-27T14:18:55
| 2018-07-27T14:18:55
| 66,304,158
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,023
|
java
|
package large2.input;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "InputDataClassName_4_2")
@XmlType(name = "inputDataClassName_4_2", propOrder = { "InputName_4_2_3",
"InputName_4_2_4", "InputName_4_2_5", "InputName_4_2_6",
"InputName_4_2_1", "InputName_4_2_2" })
public class InputDataClassName_4_2 implements Serializable {
private static final long serialVersionUID = 1L;
@XmlElement(name = "InputName_4_2_3")
protected String InputName_4_2_3;
@XmlElement(name = "InputName_4_2_4")
protected Float InputName_4_2_4;
@XmlElement(name = "InputName_4_2_5")
protected String InputName_4_2_5;
@XmlElement(name = "InputName_4_2_6")
protected Float InputName_4_2_6;
@XmlElement(name = "InputName_4_2_1")
protected Integer InputName_4_2_1;
@XmlElement(name = "InputName_4_2_2")
protected Integer InputName_4_2_2;
public String getInputName_4_2_3() {
return InputName_4_2_3;
}
public Float getInputName_4_2_4() {
return InputName_4_2_4;
}
public String getInputName_4_2_5() {
return InputName_4_2_5;
}
public Float getInputName_4_2_6() {
return InputName_4_2_6;
}
public Integer getInputName_4_2_1() {
return InputName_4_2_1;
}
public Integer getInputName_4_2_2() {
return InputName_4_2_2;
}
public void setInputName_4_2_3(String value) {
this.InputName_4_2_3 = value;
}
public void setInputName_4_2_4(Float value) {
this.InputName_4_2_4 = value;
}
public void setInputName_4_2_5(String value) {
this.InputName_4_2_5 = value;
}
public void setInputName_4_2_6(Float value) {
this.InputName_4_2_6 = value;
}
public void setInputName_4_2_1(Integer value) {
this.InputName_4_2_1 = value;
}
public void setInputName_4_2_2(Integer value) {
this.InputName_4_2_2 = value;
}
}
|
[
"akram.kamoun@gmail.com"
] |
akram.kamoun@gmail.com
|
3c9058d41bacd5d81aeeaec9b6cd6362fa837c40
|
6b8e554436a8c7a765c6e73df3a4f7dcc7d0741d
|
/KIV-UPG/UPG - SP/src/upg/Projectiles.java
|
c103bfa7685c98c040b3c2397e3618c7a1a2651b
|
[] |
no_license
|
Hartrik/ZCU-FAV
|
543fc617c9015969a7af171853514a2485a83113
|
4f234c334fff66d77ebac4f6acc18afc94666277
|
refs/heads/master
| 2022-04-28T18:18:30.836076
| 2022-04-17T17:51:16
| 2022-04-17T17:51:16
| 63,448,700
| 1
| 0
| null | 2021-02-26T22:11:54
| 2016-07-15T20:18:23
|
PHP
|
UTF-8
|
Java
| false
| false
| 842
|
java
|
package upg;
/**
* Definuje nějaké projektily.
*
* @version 2016-05-04
* @author Patrik Harag
*/
public final class Projectiles {
private Projectiles() { }
public static final Projectile NORMAL = new Projectile(3, new int[][] {
{ 0, 0, 0, -1, 0, 0, 0},
{ 0, 0, -1, -4, -1, 0, 0},
{ 0, -1, -4, -8, -4, -1, 0},
{ -1, -4, -8, -10, -8, -4, -1},
{ 0, -1, -4, -8, -4, -1, 0},
{ 0, 0, -1, -4, -1, 0, 0},
{ 0, 0, 0, -1, 0, 0, 0},
});
public static final Projectile SMALL = new Projectile(2, new int[][] {
{ 0, 0, -1, 0, 0},
{ 0, -1, -3, -1, 0},
{ -1, -3, -8, -3, -1},
{ 0, -1, -3, -1, 0},
{ 0, 0, -1, 0, 0},
});
}
|
[
"patrikharag@gmail.com"
] |
patrikharag@gmail.com
|
48aeadf9751dc9abdd40a4f4282dd47c794c972a
|
721ba6454ad65397a7d16e88072f6d2e7944381b
|
/src/com/iscreate/op/pojo/rno/.svn/text-base/FreqInterIndex.java.svn-base
|
3a84c6432bef0cdd21bcf7dafb560d4c3d02d831
|
[] |
no_license
|
tianxiao666/rno-4g
|
dc8314d13d6835efb5ad554c9be8561a5b0d87c0
|
4cb02b6ef30d0bd42beed5ff80bde3b2475b7c4d
|
refs/heads/master
| 2021-04-03T02:59:56.154677
| 2018-03-12T09:30:49
| 2018-03-12T09:30:49
| 124,864,568
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 674
|
package com.iscreate.op.pojo.rno;
import java.util.List;
public class FreqInterIndex {
private String label;
private String cellTch;
private List<AdjFreqInterDetailed> adjFreqInterDetaList;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getCellTch() {
return cellTch;
}
public void setCellTch(String cellTch) {
this.cellTch = cellTch;
}
public List<AdjFreqInterDetailed> getAdjFreqInterDetaList() {
return adjFreqInterDetaList;
}
public void setAdjFreqInterDetaList(
List<AdjFreqInterDetailed> adjFreqInterDetaList) {
this.adjFreqInterDetaList = adjFreqInterDetaList;
}
}
|
[
"chao.xj@hgicreate.com"
] |
chao.xj@hgicreate.com
|
|
c6dea9cd6dfd079c26afd71a8a43520521654a10
|
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
|
/sources/com/avito/android/select/SelectDialogPresenterKt.java
|
da2f42c4532d140cdd07b8acd4a9b0d52766470d
|
[] |
no_license
|
Auch-Auch/avito_source
|
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
|
76fdcc5b7e036c57ecc193e790b0582481768cdc
|
refs/heads/master
| 2023-05-06T01:32:43.014668
| 2021-05-25T10:19:22
| 2021-05-25T10:19:22
| 370,650,685
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,594
|
java
|
package com.avito.android.select;
import com.avito.android.remote.auth.AuthSource;
import com.avito.android.remote.model.ParcelableEntity;
import java.util.Comparator;
import kotlin.Metadata;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0018\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\"\u0016\u0010\u0003\u001a\u00020\u00008\u0002@\u0002X\u0004¢\u0006\u0006\n\u0004\b\u0001\u0010\u0002\"2\u0010\t\u001a\u001e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00000\u00050\u0004j\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00000\u0005`\u00068\u0002@\u0002X\u0004¢\u0006\u0006\n\u0004\b\u0007\u0010\b¨\u0006\n"}, d2 = {"", AuthSource.SEND_ABUSE, "Ljava/lang/String;", "CLEAR_VARIANT_ID", "Ljava/util/Comparator;", "Lcom/avito/android/remote/model/ParcelableEntity;", "Lkotlin/Comparator;", AuthSource.BOOKING_ORDER, "Ljava/util/Comparator;", "COMPARATOR", "select_release"}, k = 2, mv = {1, 4, 2})
public final class SelectDialogPresenterKt {
public static final String a = a2.b.a.a.a.E2(SelectDialogPresenterImpl.class, new StringBuilder(), "_clear_variant_id");
public static final Comparator<ParcelableEntity<String>> b = a.a;
public static final class a<T> implements Comparator<ParcelableEntity<String>> {
public static final a a = new a();
@Override // java.util.Comparator
public int compare(ParcelableEntity<String> parcelableEntity, ParcelableEntity<String> parcelableEntity2) {
return parcelableEntity.getId().compareTo(parcelableEntity2.getId());
}
}
}
|
[
"auchhunter@gmail.com"
] |
auchhunter@gmail.com
|
5fc8e221210d4fdf5ee6742c2a97d8746e14cd15
|
801c39e8bbeee2e25ed1ba2b74aa039f8b3d62ae
|
/fizteh-java-2014/src/ru/fizteh/fivt/students/LevkovMiron/FileMap/StreamFileMap.java
|
87c405b2d5e77375acc41f83ede90450fc113018
|
[] |
no_license
|
grapefroot/mipt
|
2f6572b3120e28a0e63e28f2542782520384828f
|
51d13fa07b37bdbdda943bd47d7e356a3a126177
|
refs/heads/master
| 2020-12-24T21:12:03.706690
| 2016-11-08T07:40:20
| 2016-11-08T07:40:20
| 56,529,254
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 708
|
java
|
package ru.fizteh.fivt.students.LevkovMiron.FileMap;
import java.util.Scanner;
/**
* Created by Мирон on 22.09.2014 ru.fizteh.fivt.students.LevkovMiron.shell.
*/
class StreamFileMap extends FileMap {
StreamFileMap() {
super(System.out);
}
public void readCommands() {
System.out.println("$");
Scanner scanner = new Scanner(System.in);
if (scanner.hasNextLine()) {
String input = scanner.nextLine();
String[] commands = input.split(";");
for (String cmd : commands) {
runCommand(cmd, System.out);
}
readCommands();
} else {
System.exit(1);
}
}
}
|
[
"salnikov.dmitri@gmail.com"
] |
salnikov.dmitri@gmail.com
|
2517ee2759aca1f5be663c4d38c96200eb4a7be2
|
32bce52223a2191c9bb988c9a7414abb69106db0
|
/app/src/main/java/com/hjianfei/museum_beacon_exhibition/model/fragment/museum_news/museum/MuseumIndicatorImpl.java
|
d8d3d80d154a1683f2d910987d1145fd5b34a389
|
[] |
no_license
|
HJianFei/Museum_Beacon_Exhibition
|
264ed0ce5c5c161864a7fff18a4a3522a792af0e
|
7c7693890783d3ceeb9b116392f11f688786a20d
|
refs/heads/master
| 2021-01-12T06:32:43.227471
| 2018-05-25T02:10:14
| 2018-05-25T02:10:14
| 77,378,956
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,536
|
java
|
package com.hjianfei.museum_beacon_exhibition.model.fragment.museum_news.museum;
import com.hjianfei.museum_beacon_exhibition.bean.Museum;
import com.hjianfei.museum_beacon_exhibition.bean.ResultCode;
import com.hjianfei.museum_beacon_exhibition.utils.NetWorkUtils;
import java.util.Map;
import rx.Observer;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Created by HJianFei on 2016/11/5.
*/
public class MuseumIndicatorImpl implements MuseumIndicator {
@Override
public void getInitMuseumsData(String type, String page, final onFinishedListener listener, String search_condition) {
NetWorkUtils.getApi().getAllMuseums(type, page, search_condition)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Museum>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Museum museum) {
listener.onInitMuseumsFinished(museum.getMuseums());
}
});
}
@Override
public void getRefreshMuseumsData(String type, String page, final onFinishedListener listener, String search_condition) {
NetWorkUtils.getApi().getAllMuseums(type, page, search_condition)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Museum>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Museum museum) {
listener.onRefreshMuseumsFinished(museum.getMuseums());
}
});
}
@Override
public void getLoadMuseumsData(String type, String page, final onFinishedListener listener, String search_condition) {
NetWorkUtils.getApi().getAllMuseums(type, page, search_condition)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Museum>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(Museum museum) {
listener.onLoadMuseumsFinished(museum.getMuseums());
}
});
}
@Override
public void updateMuseumViewCount(Map<String, Object> map) {
NetWorkUtils.getApi().updateMuseumViewCount(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<ResultCode>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(ResultCode resultCode) {
}
});
}
}
|
[
"190766172@qq.com"
] |
190766172@qq.com
|
2a217f52da1230935bdf5f0a6892b1a3e9906645
|
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
|
/java/hazelcast/2015/4/ReplicatedRecord.java
|
71155768a8c3c1753e23bbb9632a67079cd49bc6
|
[] |
no_license
|
rosoareslv/SED99
|
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
|
a062c118f12b93172e31e8ca115ce3f871b64461
|
refs/heads/main
| 2023-02-22T21:59:02.703005
| 2021-01-28T19:40:51
| 2021-01-28T19:40:51
| 306,497,459
| 1
| 1
| null | 2020-11-24T20:56:18
| 2020-10-23T01:18:07
| null |
UTF-8
|
Java
| false
| false
| 8,187
|
java
|
/*
* Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.hazelcast.replicatedmap.impl.record;
import com.hazelcast.core.Member;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.replicatedmap.impl.operation.ReplicatedMapDataSerializerHook;
import com.hazelcast.util.Clock;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
/**
* A ReplicatedRecord is the actual data holding entity. It also collects statistic metadata.
*
* @param <K> key type
* @param <V> value type
*/
public class ReplicatedRecord<K, V> implements IdentifiedDataSerializable {
private static final AtomicLongFieldUpdater<ReplicatedRecord> HITS_UPDATER = AtomicLongFieldUpdater
.newUpdater(ReplicatedRecord.class, "hits");
private static final AtomicReferenceFieldUpdater<ReplicatedRecord, VectorClockTimestamp> VECTOR_CLOCK_UPDATER =
AtomicReferenceFieldUpdater.newUpdater(ReplicatedRecord.class, VectorClockTimestamp.class, "vectorClockTimestamp");
// These fields are only accessed through the updaters
@SuppressWarnings("unused")
private volatile long hits;
@SuppressWarnings("unused")
private volatile long lastAccessTime;
private K key;
private V value;
private volatile VectorClockTimestamp vectorClockTimestamp;
private int latestUpdateHash;
private long ttlMillis;
private volatile long updateTime = Clock.currentTimeMillis();
public ReplicatedRecord() {
}
public ReplicatedRecord(K key, V value, VectorClockTimestamp vectorClockTimestamp, int hash, long ttlMillis) {
this.key = key;
this.value = value;
this.vectorClockTimestamp = vectorClockTimestamp;
this.latestUpdateHash = hash;
this.ttlMillis = ttlMillis;
}
public K getKey() {
access();
return getKeyInternal();
}
public K getKeyInternal() {
return key;
}
public V getValue() {
access();
return getValueInternal();
}
public V getValueInternal() {
return value;
}
public boolean isTombstone() {
return value == null;
}
public VectorClockTimestamp getVectorClockTimestamp() {
return vectorClockTimestamp;
}
public VectorClockTimestamp applyAndIncrementVectorClock(VectorClockTimestamp otherVectorClockTimestamp, Member member) {
for (;;) {
VectorClockTimestamp vectorClockTimestamp = this.vectorClockTimestamp;
VectorClockTimestamp vectorClockTimestampCopy = VectorClockTimestamp.copyVector(vectorClockTimestamp);
vectorClockTimestampCopy = vectorClockTimestampCopy.applyVector0(otherVectorClockTimestamp);
vectorClockTimestampCopy = vectorClockTimestampCopy.incrementClock0(member);
if (VECTOR_CLOCK_UPDATER.compareAndSet(this, vectorClockTimestamp, vectorClockTimestampCopy)) {
return vectorClockTimestampCopy;
}
}
}
public VectorClockTimestamp applyVectorClock(VectorClockTimestamp otherVectorClockTimestamp) {
for (;;) {
VectorClockTimestamp vectorClockTimestamp = this.vectorClockTimestamp;
VectorClockTimestamp vectorClockTimestampCopy = VectorClockTimestamp.copyVector(vectorClockTimestamp);
vectorClockTimestampCopy = vectorClockTimestampCopy.applyVector0(otherVectorClockTimestamp);
if (VECTOR_CLOCK_UPDATER.compareAndSet(this, vectorClockTimestamp, vectorClockTimestampCopy)) {
return vectorClockTimestampCopy;
}
}
}
public VectorClockTimestamp incrementVectorClock(Member member) {
for (;;) {
VectorClockTimestamp vectorClockTimestamp = this.vectorClockTimestamp;
VectorClockTimestamp vectorClockTimestampCopy = VectorClockTimestamp.copyVector(vectorClockTimestamp);
vectorClockTimestampCopy = vectorClockTimestampCopy.incrementClock0(member);
if (VECTOR_CLOCK_UPDATER.compareAndSet(this, vectorClockTimestamp, vectorClockTimestampCopy)) {
return vectorClockTimestampCopy;
}
}
}
public long getTtlMillis() {
return ttlMillis;
}
public V setValue(V value, int hash, long ttlMillis) {
access();
return setValueInternal(value, hash, ttlMillis);
}
public V setValueInternal(V value, int hash, long ttlMillis) {
V oldValue = this.value;
this.value = value;
this.latestUpdateHash = hash;
this.updateTime = Clock.currentTimeMillis();
this.ttlMillis = ttlMillis;
return oldValue;
}
public long getUpdateTime() {
return updateTime;
}
public int getLatestUpdateHash() {
return latestUpdateHash;
}
public long getHits() {
return hits;
}
public long getLastAccessTime() {
return lastAccessTime;
}
private void access() {
HITS_UPDATER.incrementAndGet(this);
lastAccessTime = Clock.currentTimeMillis();
}
@Override
public int getFactoryId() {
return ReplicatedMapDataSerializerHook.F_ID;
}
@Override
public int getId() {
return ReplicatedMapDataSerializerHook.RECORD;
}
@Override
public void writeData(ObjectDataOutput out)
throws IOException {
out.writeObject(key);
out.writeObject(value);
vectorClockTimestamp.writeData(out);
out.writeInt(latestUpdateHash);
out.writeLong(ttlMillis);
}
@Override
public void readData(ObjectDataInput in)
throws IOException {
key = in.readObject();
value = in.readObject();
vectorClockTimestamp = new VectorClockTimestamp();
vectorClockTimestamp.readData(in);
latestUpdateHash = in.readInt();
ttlMillis = in.readLong();
}
//CHECKSTYLE:OFF
// Deactivated due to complexity of the equals method
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ReplicatedRecord that = (ReplicatedRecord) o;
if (latestUpdateHash != that.latestUpdateHash) {
return false;
}
if (ttlMillis != that.ttlMillis) {
return false;
}
if (key != null ? !key.equals(that.key) : that.key != null) {
return false;
}
if (value != null ? !value.equals(that.value) : that.value != null) {
return false;
}
return true;
}
//CHECKSTYLE:ON
@Override
public int hashCode() {
int result = key != null ? key.hashCode() : 0;
result = 31 * result + (value != null ? value.hashCode() : 0);
result = 31 * result + latestUpdateHash;
result = 31 * result + (int) (ttlMillis ^ (ttlMillis >>> 32));
return result;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ReplicatedRecord{");
sb.append("key=").append(key);
sb.append(", value=").append(value);
sb.append(", vector=").append(vectorClockTimestamp);
sb.append(", latestUpdateHash=").append(latestUpdateHash);
sb.append(", ttlMillis=").append(ttlMillis);
sb.append('}');
return sb.toString();
}
}
|
[
"rodrigosoaresilva@gmail.com"
] |
rodrigosoaresilva@gmail.com
|
f0bb7ca2c8a709fbad926b03cce37fee616d711d
|
5c756f78f8e62c3f49e303130629f1580c0b2b62
|
/src/main/java/com/wedian/site/modules/sys/entity/Menu.java
|
b18d6d3f5791b5d71a95f0fd84e40776b4245134
|
[
"Apache-2.0"
] |
permissive
|
jbigdata/wedian
|
99bfb445326401e9ca80b3a6b8f93e371b84479a
|
53da4f96126de5a3324dfcf2f5b8bbebd7c373ff
|
refs/heads/master
| 2016-08-07T10:14:48.128865
| 2015-08-04T10:10:48
| 2015-08-04T10:10:48
| 39,112,075
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,576
|
java
|
/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.wedian.site.modules.sys.entity;
import java.util.List;
import javax.validation.constraints.NotNull;
import com.wedian.site.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;
import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wedian.site.common.persistence.DataEntity;
/**
* 菜单Entity
* @author ThinkGem
* @version 2013-05-15
*/
public class Menu extends DataEntity<Menu> {
private static final long serialVersionUID = 1L;
private Menu parent; // 父级菜单
private String parentIds; // 所有父级编号
private String name; // 名称
private String href; // 链接
private String target; // 目标( mainFrame、_blank、_self、_parent、_top)
private String icon; // 图标
private Integer sort; // 排序
private String isShow; // 是否在菜单中显示(1:显示;0:不显示)
private String permission; // 权限标识
private String userId;
public Menu(){
super();
this.sort = 30;
this.isShow = "1";
}
public Menu(String id){
super(id);
}
@JsonBackReference
@NotNull
public Menu getParent() {
return parent;
}
public void setParent(Menu parent) {
this.parent = parent;
}
@Length(min=1, max=2000)
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Length(min=1, max=100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Length(min=0, max=2000)
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
@Length(min=0, max=20)
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
@Length(min=0, max=100)
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
@NotNull
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
@Length(min=1, max=1)
public String getIsShow() {
return isShow;
}
public void setIsShow(String isShow) {
this.isShow = isShow;
}
@Length(min=0, max=200)
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
public String getParentId() {
return parent != null && parent.getId() != null ? parent.getId() : "0";
}
@JsonIgnore
public static void sortList(List<Menu> list, List<Menu> sourcelist, String parentId, boolean cascade){
for (int i=0; i<sourcelist.size(); i++){
Menu e = sourcelist.get(i);
if (e.getParent()!=null && e.getParent().getId()!=null
&& e.getParent().getId().equals(parentId)){
list.add(e);
if (cascade){
// 判断是否还有子节点, 有则继续获取子节点
for (int j=0; j<sourcelist.size(); j++){
Menu child = sourcelist.get(j);
if (child.getParent()!=null && child.getParent().getId()!=null
&& child.getParent().getId().equals(e.getId())){
sortList(list, sourcelist, e.getId(), true);
break;
}
}
}
}
}
}
@JsonIgnore
public static String getRootId(){
return "1";
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
@Override
public String toString() {
return name;
}
}
|
[
"wan_liang@126.com"
] |
wan_liang@126.com
|
4af5f3f3090e5c8b98c662270e0bf2dfe1bc92f9
|
b111b77f2729c030ce78096ea2273691b9b63749
|
/db-example-large-multi-project/project75/src/test/java/org/gradle/test/performance/mediumjavamultiproject/project75/p378/Test7576.java
|
c3e1e0a31f98025ab1a53cdc12958cb627549cb5
|
[] |
no_license
|
WeilerWebServices/Gradle
|
a1a55bdb0dd39240787adf9241289e52f593ccc1
|
6ab6192439f891256a10d9b60f3073cab110b2be
|
refs/heads/master
| 2023-01-19T16:48:09.415529
| 2020-11-28T13:28:40
| 2020-11-28T13:28:40
| 256,249,773
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,556
|
java
|
package org.gradle.test.performance.mediumjavamultiproject.project75.p378;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test7576 {
Production7576 objectUnderTest = new Production7576();
@Test
public void testProperty0() throws Exception {
String value = "value";
objectUnderTest.setProperty0(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() throws Exception {
String value = "value";
objectUnderTest.setProperty1(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() throws Exception {
String value = "value";
objectUnderTest.setProperty2(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() throws Exception {
String value = "value";
objectUnderTest.setProperty3(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() throws Exception {
String value = "value";
objectUnderTest.setProperty4(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() throws Exception {
String value = "value";
objectUnderTest.setProperty5(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() throws Exception {
String value = "value";
objectUnderTest.setProperty6(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() throws Exception {
String value = "value";
objectUnderTest.setProperty7(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() throws Exception {
String value = "value";
objectUnderTest.setProperty8(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() throws Exception {
String value = "value";
objectUnderTest.setProperty9(value);
Thread.sleep(250);
assertEquals(value, objectUnderTest.getProperty9());
}
}
|
[
"nateweiler84@gmail.com"
] |
nateweiler84@gmail.com
|
c99fd04a5a832501f2ef11e5e4a8630c2fa4f691
|
2a5c0c08e934177c35c5438522257ba50539ab6c
|
/aws/core/src/test/java/org/jclouds/aws/ec2/services/BaseEC2AsyncClientTest.java
|
8b22a2c32872e0f279d1ce6a0e9ce2e6ff756c13
|
[
"Apache-2.0"
] |
permissive
|
kohsuke/jclouds
|
6258d76e94ad31cf51e1bf193e531ad301815b97
|
58f8a7eb1500f9574302b23d6382b379ebf187d9
|
refs/heads/master
| 2023-06-01T17:17:27.598644
| 2010-08-04T01:34:19
| 2010-08-04T01:34:19
| 816,000
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,574
|
java
|
/**
*
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.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 org.jclouds.aws.ec2.services;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.Properties;
import javax.inject.Named;
import org.jclouds.Constants;
import org.jclouds.aws.domain.Region;
import org.jclouds.aws.ec2.EC2Client;
import org.jclouds.aws.ec2.config.EC2RestClientModule;
import org.jclouds.aws.ec2.domain.AvailabilityZone;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.date.DateService;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.RequiresHttp;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.RestClientTest;
import org.jclouds.rest.RestContextFactory;
import org.jclouds.rest.RestContextFactory.ContextSpec;
import org.testng.annotations.BeforeTest;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Injector;
import com.google.inject.Module;
/**
*
*
* @author Adrian Cole
*/
public abstract class BaseEC2AsyncClientTest<T> extends RestClientTest<T> {
@RequiresHttp
@ConfiguresRestClient
protected static class StubEC2RestClientModule extends EC2RestClientModule {
@Override
protected String provideTimeStamp(final DateService dateService,
@Named(Constants.PROPERTY_SESSION_INTERVAL) final int expiration) {
return "2009-11-08T15:54:08.897Z";
}
@Override
protected Map<String, URI> provideRegions(Injector client) {
return ImmutableMap.<String, URI> of(Region.EU_WEST_1, URI.create("https://ec2.eu-west-1.amazonaws.com"),
Region.US_EAST_1, URI.create("https://ec2.us-east-1.amazonaws.com"), Region.US_WEST_1, URI
.create("https://ec2.us-west-1.amazonaws.com"));
}
@Override
protected Map<String, String> provideAvailabilityZoneToRegions(EC2Client client,
@org.jclouds.aws.Region Map<String, URI> regions) {
return ImmutableMap.<String, String> of(AvailabilityZone.US_EAST_1A, Region.US_EAST_1);
}
}
protected FormSigner filter;
@Override
protected void checkFilters(HttpRequest request) {
assertEquals(request.getFilters().size(), 1);
assertEquals(request.getFilters().get(0).getClass(), FormSigner.class);
}
public BaseEC2AsyncClientTest() {
super();
}
@Override
@BeforeTest
protected void setupFactory() throws IOException {
super.setupFactory();
this.filter = injector.getInstance(FormSigner.class);
}
@Override
protected Module createModule() {
return new StubEC2RestClientModule();
}
@Override
public ContextSpec<?, ?> createContextSpec() {
return new RestContextFactory().createContextSpec("ec2", "identity", "credential", new Properties());
}
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
078061260a7c7c5f18bcdee8fe4f17741b368e6b
|
c1b23a03926012ccee280b3895f100cec61d2407
|
/topdeep_web_common/server/common-core/src/main/java/topdeep/common/entity/db/SystemHisMsgPushDetailMapper.java
|
97d87ca9d8065047c6dadffeb90042bf8fbde3ad
|
[] |
no_license
|
zhuangxiaotian/project
|
a0e548c88f01339993097d99ac68adcba9d11171
|
d0c96854b3678209c9a25d07c9729c613fe66d38
|
refs/heads/master
| 2020-12-05T23:14:27.354448
| 2016-09-01T07:19:22
| 2016-09-01T07:19:22
| 67,108,931
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,084
|
java
|
package topdeep.common.entity.db;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import topdeep.common.entity.db.SystemHisMsgPushDetail;
import topdeep.common.entity.db.SystemHisMsgPushDetailExample;
public interface SystemHisMsgPushDetailMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int countByExample(SystemHisMsgPushDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int deleteByExample(SystemHisMsgPushDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int insert(SystemHisMsgPushDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int insertSelective(SystemHisMsgPushDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
List<SystemHisMsgPushDetail> selectByExample(SystemHisMsgPushDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
SystemHisMsgPushDetail selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") SystemHisMsgPushDetail record, @Param("example") SystemHisMsgPushDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int updateByExample(@Param("record") SystemHisMsgPushDetail record, @Param("example") SystemHisMsgPushDetailExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(SystemHisMsgPushDetail record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table t_system_his_msg_push_detail
*
* @mbggenerated
*/
int updateByPrimaryKey(SystemHisMsgPushDetail record);
}
|
[
"xtian.zhuang@topdeep.com"
] |
xtian.zhuang@topdeep.com
|
828babbe1dbba851c6d830e050ab742c96d7f981
|
b5695905d93af4d942d48054258fe7e0b4e8fe45
|
/module/nvt-consensus/nvt-consensus-pocbft/src/main/java/nerve/network/pocbft/storage/impl/RandomSeedsStorageServiceImpl.java
|
9615b40713655c387c3316f4e9965850850e0d43
|
[
"MIT"
] |
permissive
|
arkDelphi/nerve
|
d4cddb6916e380afff71adc551dc3bbf679cb518
|
b0950a2f882e7858db7f75beb4cf12f130f098a3
|
refs/heads/master
| 2022-04-20T10:22:20.442901
| 2020-04-09T09:20:44
| 2020-04-09T09:20:44
| 255,826,499
| 0
| 1
|
MIT
| 2020-04-15T06:33:21
| 2020-04-15T06:33:20
| null |
UTF-8
|
Java
| false
| false
| 4,714
|
java
|
package nerve.network.pocbft.storage.impl;
import io.nuls.base.basic.NulsByteBuffer;
import io.nuls.core.core.annotation.Component;
import io.nuls.core.exception.NulsException;
import io.nuls.core.log.Log;
import io.nuls.core.model.ArraysTool;
import io.nuls.core.parse.SerializeUtils;
import io.nuls.core.rockdb.service.RocksDBService;
import nerve.network.pocbft.constant.ConsensusConstant;
import nerve.network.pocbft.model.po.RandomSeedPo;
import nerve.network.pocbft.model.po.RandomSeedStatusPo;
import nerve.network.pocbft.storage.RandomSeedsStorageService;
import java.util.ArrayList;
import java.util.List;
/**
* @author Niels
*/
@Component
public class RandomSeedsStorageServiceImpl implements RandomSeedsStorageService {
@Override
public RandomSeedStatusPo getAddressStatus(int chainId, byte[] address) {
byte[] bytes = RocksDBService.get(ConsensusConstant.DB_NAME_RANDOM_SEEDS+ConsensusConstant.SEPARATOR + chainId, address);
if (null == bytes) {
return null;
}
RandomSeedStatusPo po = new RandomSeedStatusPo();
try {
po.parse(new NulsByteBuffer(bytes, 0));
po.setAddress(address);
} catch (NulsException e) {
Log.error(e);
}
return po;
}
@Override
public boolean saveAddressStatus(int chainId, byte[] address, long nowHeight, byte[] nextSeed, byte[] seedHash) {
RandomSeedStatusPo po = new RandomSeedStatusPo();
po.setAddress(address);
po.setHeight(nowHeight);
po.setNextSeed(nextSeed);
po.setSeedHash(seedHash);
try {
RocksDBService.put(ConsensusConstant.DB_NAME_RANDOM_SEEDS +ConsensusConstant.SEPARATOR + chainId, address, po.serialize());
return true;
} catch (Exception e) {
Log.error(e);
}
return false;
}
@Override
public void deleteAddressStatus(int chainId, byte[] address) {
try {
RocksDBService.delete(ConsensusConstant.DB_NAME_RANDOM_SEEDS+ConsensusConstant.SEPARATOR + chainId, address);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public boolean saveRandomSeed(int chainId, long height, long preHeight, byte[] seed, byte[] nextSeedHash) {
RandomSeedPo po = new RandomSeedPo();
po.setPreHeight(preHeight);
po.setSeed(seed);
po.setNextSeedHash(nextSeedHash);
try {
RocksDBService.put(ConsensusConstant.DB_NAME_RANDOM_SEEDS +ConsensusConstant.SEPARATOR + chainId, SerializeUtils.uint64ToByteArray(height), po.serialize());
return true;
} catch (Exception e) {
Log.error(e);
}
return false;
}
@Override
public boolean deleteRandomSeed(int chainId, long height) {
try {
RocksDBService.delete(ConsensusConstant.DB_NAME_RANDOM_SEEDS+ConsensusConstant.SEPARATOR + chainId, SerializeUtils.uint64ToByteArray(height));
return true;
} catch (Exception e) {
Log.error(e);
}
return false;
}
@Override
public RandomSeedPo getSeed(int chainId, long height) {
byte[] bytes = RocksDBService.get(ConsensusConstant.DB_NAME_RANDOM_SEEDS+ConsensusConstant.SEPARATOR + chainId, SerializeUtils.uint64ToByteArray(height));
if (null == bytes) {
return null;
}
RandomSeedPo po = new RandomSeedPo();
try {
po.parse(new NulsByteBuffer(bytes, 0));
po.setHeight(height);
} catch (NulsException e) {
Log.error(e);
}
return po;
}
@Override
public List<byte[]> getSeeds(int chainId, long maxHeight, int seedCount) {
List<byte[]> list = new ArrayList<>();
long minHeight = maxHeight - 1000L;
while (maxHeight > minHeight) {
RandomSeedPo po = getSeed(chainId, maxHeight--);
if (null != po && !ArraysTool.arrayEquals(po.getSeed(), ConsensusConstant.EMPTY_SEED)) {
list.add(po.getSeed());
}
if (list.size() >= seedCount) {
break;
}
}
return list;
}
@Override
public List<byte[]> getSeeds(int chainId, long startHeight, long endHeight) {
List<byte[]> list = new ArrayList<>();
long height = startHeight;
while (height <= endHeight) {
RandomSeedPo po = getSeed(chainId, height++);
if (null != po && !ArraysTool.arrayEquals(po.getSeed(), ConsensusConstant.EMPTY_SEED)) {
list.add(po.getSeed());
}
}
return list;
}
}
|
[
"jideas@163.com"
] |
jideas@163.com
|
e8353563f6d2b6d1d404e11bb044fff3532b334e
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/junit_cluster/767/tar_2.java
|
dba09621b84d67149a112ade8250b07e3cf99857
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,561
|
java
|
package org.junit.runners;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import org.junit.internal.runners.InitializationError;
import org.junit.internal.runners.ParentRunner;
import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier;
/**
* Using <code>Suite</code> as a runner allows you to manually
* build a suite containing tests from many classes. It is the JUnit 4 equivalent of the JUnit 3.8.x
* static {@link junit.framework.Test} <code>suite()</code> method. To use it, annotate a class
* with <code>@RunWith(Suite.class)</code> and <code>@SuiteClasses(TestClass1.class, ...)</code>.
* When you run this class, it will run all the tests in all the suite classes.
*/
public class Suite extends ParentRunner<Runner> {
/**
* The <code>SuiteClasses</code> annotation specifies the classes to be run when a class
* annotated with <code>@RunWith(Suite.class)</code> is run.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface SuiteClasses {
public Class<?>[] value();
}
private static Class<?>[] getAnnotatedClasses(Class<?> klass) throws InitializationError {
SuiteClasses annotation= klass.getAnnotation(SuiteClasses.class);
if (annotation == null)
throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName()));
return annotation.value();
}
private final List<Runner> fRunners;
/**
* Called reflectively on classes annotated with <code>@RunWith(Suite.class)</code>
*
* @param klass the root class
* @param builder builds runners for classes in the suite
* @throws InitializationError
*/
public Suite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
this(builder, klass, getAnnotatedClasses(klass));
validate();
}
/**
* Call this when there is no single root class (for example, multiple class names
* passed on the command line to {@link org.junit.runner.JUnitCore}
*
* @param builder builds runners for classes in the suite
* @param classes the classes in the suite
* @throws Throwable
*/
public Suite(RunnerBuilder builder, Class<?>[] classes) {
this(null, builder.runners(classes));
}
/**
* Called by this class and subclasses once the classes making up the suite have been determined
*
* @param builder builds runners for classes in the suite
* @param klass the root of the suite
* @param suiteClasses the classes in the suite
* @throws InitializationError
*/
protected Suite(RunnerBuilder builder, Class<?> klass, Class<?>[] suiteClasses) throws InitializationError {
this(klass, builder.runners(klass, suiteClasses));
}
/**
* Called by this class and subclasses once the runners making up the suite have been determined
*
* @param klass root of the suite
* @param runners for each class in the suite, a {@link Runner}
*/
protected Suite(Class<?> klass, List<Runner> runners) {
super(klass);
fRunners = runners;
}
@Override
protected void collectInitializationErrors(List<Throwable> errors) {
getTestClass().validateStaticMethods(errors);
}
@Override
protected List<Runner> getChildren() {
return fRunners;
}
@Override
protected Description describeChild(Runner child) {
return child.getDescription();
}
@Override
protected void runChild(Runner each, final RunNotifier notifier) {
each.run(notifier);
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
80bd0011f4ddc221dd360b4f0112a9031f738fd9
|
7adc8a0a46340f94cec9dce1a2042c25bf7ebac0
|
/backend/suyang_project_server/o2o-massage/o2o-mgt-web/src/main/java/com/o2o/nm/admin/service/ProviderInfoService.java
|
6fb59fd554f1caabcbf45f59fd3c621d1424b6b3
|
[] |
no_license
|
sonia630/suyang_project
|
23b651b4259a0359bde20fd082410b8a09235466
|
0701c1706cf7d45274758053bba3bb8d64bc9205
|
refs/heads/master
| 2021-04-12T10:34:54.413844
| 2018-07-25T01:35:47
| 2018-07-25T01:35:47
| 126,292,773
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 494
|
java
|
package com.o2o.nm.admin.service;
import com.baomidou.mybatisplus.service.IService;
import com.o2o.nm.admin.entity.ProviderInfo;
import com.o2o.nm.admin.vo.ProviderDetail;
/**
* <p>
* 服务提供者基本信息表 服务类
* </p>
*
* @author warning5
* @since 2018-03-11
*/
public interface ProviderInfoService extends IService<ProviderInfo> {
ProviderDetail getProviderDetailInfo(String userId);
void save(ProviderDetail providerDetail);
void audit(String userId);
}
|
[
"yongtali@cisco.com"
] |
yongtali@cisco.com
|
8784c4d9a2d24d9beb16554c16b4bd9c99852ca5
|
03df9c8385d0e7184f6cabd8b2ecbce2d5d2bb3f
|
/src/main/java/com/ecodation/a006/oop/StudentMain2.java
|
b9a4f24167bd3e3cee63eac1348c703215201603
|
[] |
no_license
|
hamitmizrak/EcodationJavaTutorialsExamples
|
1da23d2beefc3bed2052988a89ed39d45824a71a
|
a08034df2d64260f3ac8cb9158f0b8c14917112c
|
refs/heads/main
| 2023-01-14T12:33:06.409835
| 2020-11-22T10:47:39
| 2020-11-22T10:47:39
| 310,821,407
| 0
| 0
| null | null | null | null |
ISO-8859-16
|
Java
| false
| false
| 501
|
java
|
package com.ecodation.a006.oop;
public class StudentMain2 {
public static void main(String[] args) {
Student student = new Student();
student.setId(44);
student.setName("Hamit");
student.setSurname("Męzrak");
student.setCellPhone(4444);
System.out.println("Id: " + student.getId());
System.out.println("Telefon no: " + student.getCellPhone());
System.out.println("Ad no: " + student.getName());
System.out.println("Soyad no: " + student.getSurname());
}
}
|
[
"hamitmizrak@gmail.com"
] |
hamitmizrak@gmail.com
|
cf6bc028b231d262ba2621beaaeace8f87ba0c95
|
4e84c9dbc699cfdf090a2872a7e2bdf79b9dc971
|
/fanweHybridLive/src/main/java/com/fanwe/xianrou/interfaces/XRCommonOnItemUserHeadClickCallack.java
|
3762206a3b2bec488855f6e87f9777bf1afa1a8b
|
[] |
no_license
|
nickoo123/FanweLive11
|
d994f5b6d36a0dd7ac06858f8c78239bfca629a4
|
2cecccf5c6795c4492f6c9d213d6cf27b6188dd4
|
refs/heads/master
| 2023-03-19T18:17:29.493984
| 2020-03-20T08:50:41
| 2020-03-20T08:50:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 304
|
java
|
package com.fanwe.xianrou.interfaces;
import android.view.View;
/**
* @PACKAGE com.fanwe.xianrou.interfaces
* @DESCRIPTION
* @AUTHOR Su
* @DATE 2017/4/4 10:34
*/
public interface XRCommonOnItemUserHeadClickCallack<E> {
void onUserHeadClick(View view, E entity, int position);
}
|
[
"zq090428"
] |
zq090428
|
904cea8b8643fa8c96b8ebbd69845846aa11e0d6
|
36860121a82f9c666e538c896b1e5a9f7b36a09b
|
/jprotobuf-rpc-core/src/main/java/com/baidu/jprotobuf/pbrpc/server/IDLServiceInvoker.java
|
6eda78e7f2cef85fa9bc276aab6f9053ce3c82ab
|
[] |
no_license
|
Micheal-Bigmac/Jprotobuf-rpc-socket
|
2a1881c4739283039de53196c564d7f0d454f6e6
|
a852810032f4e2c5a4249ed2944e19cd4c2f3800
|
refs/heads/master
| 2021-01-15T10:36:42.198314
| 2016-05-23T10:38:55
| 2016-05-23T10:38:55
| 59,535,516
| 1
| 0
| null | 2016-05-24T02:55:32
| 2016-05-24T02:55:31
| null |
UTF-8
|
Java
| false
| false
| 1,558
|
java
|
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.baidu.jprotobuf.pbrpc.server;
import com.baidu.bjf.remoting.protobuf.IDLProxyObject;
/**
* IDL service invoker
*
* @author xiemalin
* @since 1.0
*/
public interface IDLServiceInvoker {
/**
* RPC service call back method.
*
* @param input
* request IDL proxy object by protobuf deserialized
* @param output
* return back IDL proxy object to serialized
* @throws Exception
* in case of any exception
*/
void invoke(IDLProxyObject input, IDLProxyObject output) throws Exception;
/**
* get input {@link IDLProxyObject} as for input parameter object. or null if no input parameter
*
* @return
*/
IDLProxyObject getInput();
/**
* get output {@link IDLProxyObject} as for return result. or null if no return result.
*
* @return
*/
IDLProxyObject getOutput();
}
|
[
"ant_miracle@hotmail.com"
] |
ant_miracle@hotmail.com
|
d9fc06127256a47cedf01fc8fa6e7210becb3f3a
|
466bbcea33a63219165bece2ae217db4a7fde59a
|
/cgo_db/src/main/java/com/cgo/db/service/IBizAuditsignfordelService.java
|
593171c279d35669dae8a365e75c2b6e0e07a849
|
[] |
no_license
|
hgdsys007/cgo_module
|
7ed38b6e7b199daeb65e2b08db629e5c97ace86a
|
4e1af510541cc4ae7eadf916034fd8e83abc69a4
|
refs/heads/master
| 2022-04-03T14:46:43.336331
| 2019-11-20T04:01:58
| 2019-11-20T04:02:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 297
|
java
|
package com.cgo.db.service;
import com.cgo.db.entity.BizAuditsignfordel;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author Mht
* @since 2019-11-18
*/
public interface IBizAuditsignfordelService extends IService<BizAuditsignfordel> {
}
|
[
"asd@1.com"
] |
asd@1.com
|
97ad31b4e0bdd6b662cacf5717bb86dc2cef4aa3
|
4cf81240325f64ef118fff4f1924d07f08cf26d9
|
/payments/src/main/java/pl/training/cloud/payments/NotifyPaymentStatusChange.java
|
6e0503e0be1a4cbae6b10f03945c13ae14204e34
|
[] |
no_license
|
bobkoby5i/spring-cloud-training
|
905ae2a81f03a9a1f9b4fb481002a5ca0785e963
|
2ba0502ad5e0d3dc1ca2672f22cb23c10abbb21d
|
refs/heads/master
| 2020-12-07T05:45:25.814278
| 2019-12-13T15:10:23
| 2019-12-13T15:10:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 311
|
java
|
package pl.training.cloud.payments;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface NotifyPaymentStatusChange {
}
|
[
"landrzejewski.poczta@gmail.com"
] |
landrzejewski.poczta@gmail.com
|
fac5a445f933d2c855f92d7f3e151a987d27db81
|
ad9c328aeb5ea617a1c056df45ae9acc3e5c1aad
|
/projects/projects-spring/projects-spring2.5.6/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
|
e6aa901241cd39582d06a76164aa49c6cd60436d
|
[] |
no_license
|
tangjiquan/collect
|
3fa4b3fd5fecc7e0d8d7a6bf89151464bd4e98bb
|
d059d89ae9899bd43b2f5b7d46b7ba88d5f066d4
|
refs/heads/master
| 2022-12-22T19:26:37.599708
| 2019-08-05T15:00:32
| 2019-08-05T15:00:48
| 126,582,519
| 1
| 0
| null | 2022-12-16T08:04:19
| 2018-03-24T09:03:08
|
Java
|
UTF-8
|
Java
| false
| false
| 2,724
|
java
|
/*
* Copyright 2002-2006 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.propertyeditors;
import java.beans.PropertyEditorSupport;
import java.io.IOException;
import java.net.URL;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceEditor;
import org.springframework.util.Assert;
/**
* Editor for <code>java.net.URL</code>, to directly populate a URL property
* instead of using a String property as bridge.
*
* <p>Supports Spring-style URL notation: any fully qualified standard URL
* ("file:", "http:", etc) and Spring's special "classpath:" pseudo-URL,
* as well as Spring's context-specific relative file paths.
*
* <p>Note: A URL must specify a valid protocol, else it will be rejected
* upfront. However, the target resource does not necessarily have to exist
* at the time of URL creation; this depends on the specific resource type.
*
* @author Juergen Hoeller
* @since 15.12.2003
* @see URL
* @see ResourceEditor
* @see org.springframework.core.io.ResourceLoader
* @see FileEditor
* @see InputStreamEditor
*/
public class URLEditor extends PropertyEditorSupport {
private final ResourceEditor resourceEditor;
/**
* Create a new URLEditor, using the default ResourceEditor underneath.
*/
public URLEditor() {
this.resourceEditor = new ResourceEditor();
}
/**
* Create a new URLEditor, using the given ResourceEditor underneath.
* @param resourceEditor the ResourceEditor to use
*/
public URLEditor(ResourceEditor resourceEditor) {
Assert.notNull(resourceEditor, "ResourceEditor must not be null");
this.resourceEditor = resourceEditor;
}
public void setAsText(String text) throws IllegalArgumentException {
this.resourceEditor.setAsText(text);
Resource resource = (Resource) this.resourceEditor.getValue();
try {
setValue(resource != null ? resource.getURL() : null);
}
catch (IOException ex) {
throw new IllegalArgumentException("Could not retrieve URL for " + resource + ": " + ex.getMessage());
}
}
public String getAsText() {
URL value = (URL) getValue();
return (value != null ? value.toExternalForm() : "");
}
}
|
[
"2495527426@qq.com"
] |
2495527426@qq.com
|
d27759cf3b3377d204f92aad699aa9eac33f8bdb
|
ba6d5993fa0a4a97ba525e74da5ffaa968812861
|
/app/src/main/java/com/likeits/simple/app/MyApplication.java
|
8d9292b6ca6c7bc356a0fdfa64283561865e6e2e
|
[] |
no_license
|
sengeiou/base
|
3d21bdc26479d00a3d8840bcc6797def1ad260b0
|
c8b609f8cee209bb8c2e86bd20b7099cbc0bf590
|
refs/heads/master
| 2021-10-11T11:32:47.882455
| 2019-01-25T09:43:26
| 2019-01-25T09:43:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,363
|
java
|
package com.likeits.simple.app;
import android.app.Application;
import android.content.Context;
import com.elvishew.xlog.LogConfiguration;
import com.elvishew.xlog.LogLevel;
import com.elvishew.xlog.XLog;
import com.likeits.simple.BuildConfig;
import com.likeits.simple.R;
import com.likeits.simple.activity.MainActivity;
import com.likeits.simple.network.model.BaseResponse;
import com.likeits.simple.network.model.main.MainNavigationModel;
import com.likeits.simple.network.util.RetrofitUtil;
import com.likeits.simple.utils.SharedPreferencesUtils;
import com.likeits.simple.utils.image.GImageLoader;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;
import java.util.List;
import okhttp3.OkHttpClient;
import rx.Subscriber;
public class MyApplication extends Application {
public static MyApplication mContext;
private static MyApplication instance;
public static Context applicationContext;
public static MyApplication getInstance() {
if (mContext == null) {
return new MyApplication();
} else {
return mContext;
}
}
@Override
public void onCreate() {
// MultiDex.install(this);
super.onCreate();
initImageLoad();
instance = this;
applicationContext = this;
// initBugly();
GImageLoader.init(this, new OkHttpClient.Builder().build()); //图片加载初始化
initLogger();//日志打印初始化
initData1();
// ZXingLibrary.initDisplayOpinion(this);
// initX5WebView();
//MobSDK.init(this);//shareSDk初始化
// DemoHelper.getInstance().init(mContext);
// initX5WebView();
}
private void initData1() {
RetrofitUtil.getInstance().getMainNavigation("1", new Subscriber<BaseResponse<MainNavigationModel>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<MainNavigationModel> baseResponse) {
XLog.d(baseResponse.getCode());
if (baseResponse.getCode() == 200) {
MainNavigationModel mainNavigationModel = baseResponse.getData();
SharedPreferencesUtils.put(mContext, "iconcolor", baseResponse.getData().getStyle().getIconcolor());
SharedPreferencesUtils.put(mContext, "iconcoloron", baseResponse.getData().getStyle().getIconcoloron());
// List<MainNavigationModel.ItemsBean> items = mainNavigationModel.getItems();
// for (int i = 0; i < items.size(); i++) {
// mTitles[i] = items.get(i).getText();
// mIconSelectIds[i] = items.get(i).getIconclasscode();
// }
// XLog.e(mTitles);
// XLog.e(mIconSelectIds);
}
}
});
}
private void initLogger() {
XLog.init(BuildConfig.DEBUG ? LogLevel.ALL : LogLevel.NONE,
config);
}
LogConfiguration config = new LogConfiguration.Builder()
.tag("HL").build();
/**
* Bugly更新
*/
private void initBugly() {
Bugly.init(getApplicationContext(), "54573e34e3", false);
Beta.autoCheckUpgrade = true;//设置自动检查
Beta.upgradeCheckPeriod = 60 * 60 * 1000;
Beta.largeIconId = R.mipmap.ic_launcher;
}
public static MyApplication getInstance(Context mContext) {
return instance;
}
// private void initX5WebView() {
// //搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。
// QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
// @Override
// public void onViewInitFinished(boolean arg0) {
// //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
// Log.d("app", " onViewInitFinished is " + arg0);
// }
//
// @Override
// public void onCoreInitFinished() {
// }
// };
// //x5内核初始化接口
// QbSdk.initX5Environment(getApplicationContext(), cb);
// }
private void initImageLoad() {
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.showImageForEmptyUri(R.mipmap.icon_default)
.showImageOnFail(R.mipmap.icon_default)
.cacheInMemory(true).cacheOnDisc(true).build();
// 图片加载工具配置
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext())
.defaultDisplayImageOptions(defaultOptions)
.discCacheSize(50 * 1024 * 1024)//
.discCacheFileCount(100)// 缓存一百张图片
.writeDebugLogs().build();
ImageLoader.getInstance().init(config);
}
}
|
[
"931317632@qq.com"
] |
931317632@qq.com
|
82b2b611ac1096efae28ed43e16220200dd0923c
|
3e856a6ecb2233e4b97e3a3ead5b36191f201fb8
|
/src/main/java/com/github/jnidzwetzki/bitfinex/v2/callback/api/TradeHandler.java
|
3353c207d34eab251b8a197425e6301c4d546995
|
[
"Apache-2.0"
] |
permissive
|
hansblafoo/bitfinex-v2-wss-api-java
|
23853bc96d75dec94526ba7b9f89e99b23562e1e
|
946a3a974e2162aed66efb9a46f4873c3e1e4a5b
|
refs/heads/master
| 2020-03-08T14:00:22.026686
| 2018-04-05T03:16:56
| 2018-04-05T03:16:56
| 128,173,046
| 0
| 0
| null | 2018-04-05T07:30:15
| 2018-04-05T07:30:15
| null |
UTF-8
|
Java
| false
| false
| 3,055
|
java
|
/*******************************************************************************
*
* Copyright (C) 2015-2018 Jan Kristof Nidzwetzki
*
* 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.github.jnidzwetzki.bitfinex.v2.callback.api;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker;
import com.github.jnidzwetzki.bitfinex.v2.entity.APIException;
import com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexCurrencyPair;
import com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexOrderType;
import com.github.jnidzwetzki.bitfinex.v2.entity.Trade;
public class TradeHandler implements APICallbackHandler {
/**
* The Logger
*/
final static Logger logger = LoggerFactory.getLogger(TradeHandler.class);
@Override
public void handleChannelData(final BitfinexApiBroker bitfinexApiBroker, final JSONArray jsonArray)
throws APIException {
logger.info("Got trade callback {}", jsonArray.toString());
final JSONArray trade = jsonArray.getJSONArray(2);
final String type = jsonArray.getString(1);
// Executed or update
boolean executed = true;
if("tu".equals(type)) {
executed = false;
}
handleTradeCallback(bitfinexApiBroker, trade, executed);
}
/**
* Handle a single trade callback
* @param bitfinexApiBroker
* @param orderArray
* @throws APIException
*/
private void handleTradeCallback(final BitfinexApiBroker bitfinexApiBroker, final JSONArray jsonTrade,
final boolean executed) throws APIException {
final Trade trade = new Trade();
trade.setExecuted(executed);
trade.setApikey(bitfinexApiBroker.getApiKey());
trade.setId(jsonTrade.getLong(0));
trade.setCurrency(BitfinexCurrencyPair.fromSymbolString(jsonTrade.getString(1)));
trade.setMtsCreate(jsonTrade.getLong(2));
trade.setOrderId(jsonTrade.getLong(3));
trade.setExecAmount(jsonTrade.getFloat(4));
trade.setExecPrice(jsonTrade.getFloat(5));
final String orderTypeString = jsonTrade.optString(6, null);
if(orderTypeString != null) {
trade.setOrderType(BitfinexOrderType.fromString(orderTypeString));
}
trade.setOrderPrice(jsonTrade.optFloat(7, -1));
trade.setMaker(jsonTrade.getInt(8) == 1 ? true : false);
trade.setFee(jsonTrade.optFloat(9, -1));
trade.setFeeCurrency(jsonTrade.optString(10, ""));
bitfinexApiBroker.getTradeManager().updateTrade(trade);
}
}
|
[
"jnidzwetzki@gmx.de"
] |
jnidzwetzki@gmx.de
|
9a4a63c67d84b1ee2ad88bc37065205379df9417
|
eb7b450eef54c7c7c43001b03a1a0a6ac27fbbd6
|
/SM/IS/src/research/prototype/transaction/TestTableMain.java
|
8d05c843a5dde6dea1d20bdede3cf47c0519a1b0
|
[] |
no_license
|
mjawath/jposible
|
e2feb7de7bfa80dc538639ae5ca13480f8dcc2db
|
b6fb1cde08dc531dd3aff1113520d106dd1a732c
|
refs/heads/master
| 2021-01-10T18:55:41.024529
| 2018-05-14T01:25:05
| 2018-05-14T01:25:05
| 32,131,366
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,701
|
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 research.prototype.transaction;
import javax.swing.UIManager;
/**
*
* @author Jawad
*/
public class TestTableMain extends javax.swing.JFrame {
/**
* Creates new form NewJFrame
*/
public TestTableMain() {
initComponents();
// System.out.println("--------------"+PropertyUtil.getApplicationmod());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane2 = new javax.swing.JScrollPane();
modelEditableTable1 = new org.components.controls.ModelEditableTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jScrollPane2.setViewportView(modelEditableTable1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(99, 99, 99)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(550, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 243, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
// for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
// if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// break;
// }
// }
} catch (Exception ex) {
java.util.logging.Logger.getLogger(TestTableMain.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new TestTableMain().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane2;
private org.components.controls.ModelEditableTable modelEditableTable1;
// End of variables declaration//GEN-END:variables
}
|
[
"mjawath@gmail.com"
] |
mjawath@gmail.com
|
a871e82efe7b2ee2ddf0e726d563ad003bd4750b
|
4eea13dc72e0ff8ec79c7a94deca38e55868b603
|
/chapter9/Etudiant.java
|
e32ef806c5ed827cc9b419959e24719d4a346bc4
|
[
"Apache-2.0"
] |
permissive
|
helloShen/thinkinginjava
|
1a9bfad9afa68b226684f6e063e9fa2ae36d898c
|
8986b74b2b7ea1753df33af84cd56287b21b4239
|
refs/heads/master
| 2021-01-11T20:38:09.259654
| 2017-03-07T03:52:54
| 2017-03-07T03:52:54
| 79,158,702
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 990
|
java
|
/**
* Chapter 9 - Interface - Adapter Pattern
* Canada etudiants have to study in elementary school, high school, preUniversity and university
* @author wei.shen@iro.umontreal.ca
* @version 1.0
*/
package com.ciaoshen.thinkinjava.chapter9;
import java.util.*;
interface Etudiant {
/**
* PUBLIC PROXY OF CONSTRUCTOR
*/
/**
* PUBLIC METHODS
*/
public void elementarySchoolGraduate();
public void highSchoolGraduate();
public void preUniversityGraduate();
public void universityGraduate();
public String getName();
public boolean getElementarySchoolGraduate();
public boolean getHighSchoolGraduate();
public boolean getPreUniversityGraduate();
public boolean getUniversityGraduate();
/**
* PRIVATE CONSTRUCTOR
*/
/**
* PRIVATE FIELDS
*/
/**
* MAIN
* @param args void
*/
public static void main(String[] args){
}
}
|
[
"symantec__@hotmail.com"
] |
symantec__@hotmail.com
|
fefc521524a657fa142d64d37c62bed0b72a39f5
|
cb78d919ff585376d6bf10aed221bfb344f526f8
|
/ExamPreparation/wedding_planner/src/main/java/soft_uni/wedding_planner/services/wedding/WeddingServiceImpl.java
|
fb8ecb5b88fb713a3e0c67cafdd86a71d4c78f9e
|
[
"MIT"
] |
permissive
|
itonov/Java-DB-Advanced
|
8decc2c326afbe36c2d10aea4bf55f5eecaa36ff
|
0291d0dad1c1505869ec66a330f956575d42d007
|
refs/heads/master
| 2020-03-12T14:07:33.832246
| 2018-04-23T07:54:11
| 2018-04-23T07:54:11
| 130,659,654
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 720
|
java
|
package soft_uni.wedding_planner.services.wedding;
import soft_uni.wedding_planner.models.entities.Wedding;
import soft_uni.wedding_planner.repositories.WeddingRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class WeddingServiceImpl implements WeddingService {
private final WeddingRepository weddingRepository;
@Autowired
public WeddingServiceImpl(WeddingRepository weddingRepository) {
this.weddingRepository = weddingRepository;
}
@Override
public void saveToDb(Wedding wedding) {
this.weddingRepository.saveAndFlush(wedding);
}
}
|
[
"itonov3@gmail.com"
] |
itonov3@gmail.com
|
2a6e4d7479b23305f9c493461772dbb990fa9fbf
|
122287275ec1666cc27a6b6d06bab4f8b1c4ff33
|
/jconstraints/src/main/java/gov/nasa/jpf/constraints/util/TransformVarVisitor.java
|
c0f5ae33c30e4fa88e276b210512e991ebb72e7d
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
NJUCWL/symbolic_tools
|
f036691918b147019c99584efb4dcbe1228ae6c0
|
669f549b0a97045de4cd95b1df43de93b1462e45
|
refs/heads/main
| 2023-05-09T12:00:57.836897
| 2021-06-01T13:34:40
| 2021-06-01T13:34:40
| 370,017,201
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,785
|
java
|
/*
* Copyright (C) 2015, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All rights reserved.
*
* The PSYCO: A Predicate-based Symbolic Compositional Reasoning environment
* platform is 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 gov.nasa.jpf.constraints.util;
import gov.nasa.jpf.constraints.api.Expression;
import gov.nasa.jpf.constraints.api.Variable;
import com.google.common.base.Function;
class TransformVarVisitor extends
DuplicatingVisitor<Function<? super Variable<?>, ? extends Expression<?>>> {
private static final TransformVarVisitor INSTANCE = new TransformVarVisitor();
public static TransformVarVisitor getInstance() {
return INSTANCE;
}
/* (non-Javadoc)
* @see gov.nasa.jpf.constraints.expressions.AbstractExpressionVisitor#visit(gov.nasa.jpf.constraints.api.Variable, java.lang.Object)
*/
@Override
public <E> Expression<?> visit(Variable<E> v,
Function<? super Variable<?>, ? extends Expression<?>> data) {
return data.apply(v);
}
public <T> Expression<T> apply(Expression<T> expr, Function<? super Variable<?>,? extends Expression<?>> transform) {
return visit(expr, transform).requireAs(expr.getType());
}
}
|
[
"48467952+NJUCWL@users.noreply.github.com"
] |
48467952+NJUCWL@users.noreply.github.com
|
41d9896ec5a3203df050d3eca392b1ea35bd4e80
|
73cc3242200fbead9fc36c21a8f80f4246628d6b
|
/basetool/src/main/java/com/zhuyongdi/basetool/widget/refresh/smart_refresh/api/RefreshHeader.java
|
310d94fd7cd915603475911a77023f968ed00e8b
|
[] |
no_license
|
zhuyongdi/base-tool
|
6338f562dd54fa1fb790a75da34aa5ec3096aed5
|
7c1a97c216058f4318076bbf5df58ad0cdb80420
|
refs/heads/master
| 2020-04-29T04:07:43.041059
| 2019-05-10T09:11:42
| 2019-05-10T09:11:42
| 175,837,141
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 185
|
java
|
package com.zhuyongdi.basetool.widget.refresh.smart_refresh.api;
/**
* 刷新头部
* Created by SCWANG on 2017/5/26.
*/
public interface RefreshHeader extends RefreshInternal {
}
|
[
"904507761@qq.com"
] |
904507761@qq.com
|
45e626f7a76aafc343c64038336bef72c9a03bd1
|
531452124c7cf2e89b878c07be41045b17ced567
|
/src/main/java/com/niche/ng/service/mapper/GodownMapper.java
|
67740931985dd7d8678dd9d3d2f2af0a19de1221
|
[] |
no_license
|
AnithaRaja90/ProjectGreenHands_isha
|
b93619014b74817c669c21b9bf5e7bfc29b5a03c
|
377e43e60ae78c7e27d7d8a8caaf4f2ade65b446
|
refs/heads/master
| 2020-03-26T19:34:46.965548
| 2018-08-19T04:39:04
| 2018-08-19T04:39:04
| 145,272,857
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 671
|
java
|
package com.niche.ng.service.mapper;
import com.niche.ng.domain.*;
import com.niche.ng.service.dto.GodownDTO;
import org.mapstruct.*;
/**
* Mapper for the entity Godown and its DTO GodownDTO.
*/
@Mapper(componentModel = "spring", uses = {})
public interface GodownMapper extends EntityMapper<GodownDTO, Godown> {
@Mapping(target = "godownPurchaseDetails", ignore = true)
@Mapping(target = "godownStocks", ignore = true)
Godown toEntity(GodownDTO godownDTO);
default Godown fromId(Long id) {
if (id == null) {
return null;
}
Godown godown = new Godown();
godown.setId(id);
return godown;
}
}
|
[
"ptnaveenraj@outlook.com"
] |
ptnaveenraj@outlook.com
|
3d37d3c72ab3a79b886e076e7df93db301c42d2a
|
4e516583021b884f45c1763698d38996fed326f6
|
/pcgen/code/src/java/pcgen/core/levelability/LevelAbilityList.java
|
800ba436b45e79f07754fff3fea3b25eaf364d9a
|
[] |
no_license
|
Manichee/pcgen
|
d993d04e75a8398b8cb9d577a717698a5ae8e3e9
|
5fb3937e5e196d2c0b244e9b4dacab2aecca381f
|
refs/heads/master
| 2020-04-09T01:55:53.634379
| 2016-04-11T03:41:50
| 2016-04-11T03:41:50
| 23,060,834
| 0
| 0
| null | 2014-08-18T22:37:19
| 2014-08-18T06:20:19
|
Java
|
UTF-8
|
Java
| false
| false
| 4,411
|
java
|
/*
* LevelAbilityList.java
* Copyright 2001 (C) Dmitry Jemerov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Created on July 24, 2001, 12:36 PM
*/
package pcgen.core.levelability;
import pcgen.core.PObject;
import pcgen.core.PlayerCharacter;
import pcgen.core.pclevelinfo.PCLevelInfo;
import pcgen.util.chooser.ChooserInterface;
import java.util.*;
/**
* Represents an option list that a character gets when gaining a level
* (an ADD:LIST entry in the LST file).
*
* @author Dmitry Jemerov <yole@spb.cityline.ru>
* @version $Revision: 1.11 $
*/
final class LevelAbilityList extends LevelAbility
{
private List aBonusList;
private List aChoiceList;
private int cnt = 0;
LevelAbilityList(final PObject aowner, final int aLevel, final String aList)
{
super(aowner, aLevel, aList);
}
List getChoicesList(final String bString, final PlayerCharacter aPC)
{
aChoiceList = new ArrayList();
aBonusList = new ArrayList();
return super.getChoicesList(bString.substring(5), aPC);
}
/**
* Performs the initial setup of a chooser.
* @param c
* @param aPC
* @return String
*/
String prepareChooser(final ChooserInterface c, PlayerCharacter aPC)
{
super.prepareChooser(c, aPC);
c.setTitle("Option List");
return rawTagData;
}
/**
* Process the choice selected by the user.
* @param selectedList
* @param aPC
* @param pcLevelInfo
* @param aArrayList
*/
public boolean processChoice(
final List aArrayList,
final List selectedList,
final PlayerCharacter aPC,
final PCLevelInfo pcLevelInfo)
{
for (int index = 0; index < selectedList.size(); ++index)
{
cnt = aArrayList.indexOf(selectedList.get(index).toString());
String theChoice = null;
String theBonus;
final List selectedBonusList = new ArrayList();
final String prefix = cnt + "|";
for (Iterator e = aBonusList.iterator(); e.hasNext();)
{
theBonus = (String) e.next();
if (theBonus.startsWith(prefix))
{
theBonus = theBonus.substring((cnt / 10) + 2);
selectedBonusList.add(theBonus);
}
}
for (Iterator e = aChoiceList.iterator(); e.hasNext();)
{
theChoice = (String) e.next();
if (theChoice.startsWith(prefix))
{
theChoice = theChoice.substring((cnt / 10) + 9);
break;
}
theChoice = "";
}
if ((theChoice != null) && (theChoice.length() > 0))
{
owner.getChoices(theChoice, selectedBonusList, aPC);
}
else if (selectedBonusList.size() > 0)
{
for (Iterator e1 = selectedBonusList.iterator(); e1.hasNext();)
{
owner.applyBonus((String) e1.next(), "", aPC);
}
}
}
return true;
}
/**
* Processes a single token in the comma-separated list of the ADD:
* field and adds the choices to be shown in the list to anArrayList.
*
* @param aToken the token to be processed.
* @param anArrayList the list to add the choice to.
* @param aPC the PC this Level ability is adding to.
*/
void processToken(
final String aToken,
final List anArrayList,
final PlayerCharacter aPC)
{
final StringTokenizer cTok = new StringTokenizer(aToken, "[]", false);
try
{
anArrayList.add(cTok.nextToken());
}
catch (NoSuchElementException e)
{
//do nothing, TODO add debug logger and log condition
}
while (cTok.hasMoreTokens())
{
final String bTokString = cTok.nextToken();
final String aString = new StringBuffer(cnt).append(String.valueOf(cnt)).append("|").append(bTokString)
.toString();
if (bTokString.startsWith("CHOOSE:"))
{
aChoiceList.add(aString);
}
if (bTokString.startsWith("BONUS:"))
{
aBonusList.add(aString);
}
}
cnt++;
}
}
|
[
"tladdjr@gmail.com"
] |
tladdjr@gmail.com
|
2e67ceedfacf1ef92df18d4a6aedba8394a9cc3b
|
8ead5ff8d527e4b4d98cd54e9b84f50ea824f2be
|
/cj.lns.chip.sos.website.market.app.cyberport/src/cj/lns/chip/sos/website/market/app/cyberport/component/GetMessagesComponent.java
|
042f9633928bbb1c49a21fd2efd41fa017be97ee
|
[] |
no_license
|
911Steven/cj.lns.sos
|
9976efcf28418094e315324a4ce145c56bb57478
|
af82a5e7555b99780a9606b5e848861ce1ae5503
|
refs/heads/master
| 2020-07-05T16:22:11.341767
| 2018-10-12T02:13:41
| 2018-10-12T02:13:41
| 202,696,541
| 1
| 0
| null | 2019-08-16T09:10:35
| 2019-08-16T09:10:35
| null |
UTF-8
|
Java
| false
| false
| 2,117
|
java
|
package cj.lns.chip.sos.website.market.app.cyberport.component;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.parser.Tag;
import cj.lns.chip.sos.website.framework.IServiceosWebsiteModule;
import cj.lns.chip.sos.website.framework.IServicewsContext;
import cj.lns.chip.sos.website.market.app.cyberport.services.FetchServciewsInfo;
import cj.lns.common.sos.website.customable.IComponent;
import cj.lns.common.sos.website.moduleable.ServiceosWebsiteModule;
import cj.studio.ecm.annotation.CjService;
import cj.studio.ecm.annotation.CjServiceRef;
import cj.studio.ecm.frame.Circuit;
import cj.studio.ecm.frame.Frame;
import cj.studio.ecm.graph.CircuitException;
import cj.studio.ecm.graph.IPlug;
import cj.studio.ecm.sns.mailbox.viewer.MailboxMessageViewer;
import cj.ultimate.util.StringUtil;
@CjService(name = "/popup/getMessages.html")
public class GetMessagesComponent implements IComponent {
@CjServiceRef(refByName = "FetchServciewsInfo")
FetchServciewsInfo dao;
@Override
public void flow(Frame frame, Circuit circuit, IPlug plug)
throws CircuitException {
// 作用适配客户端类型,并读取场景,为终端插件设画布
IServiceosWebsiteModule m = ServiceosWebsiteModule.get();
Document doc = m.context().html("/popup/getMessages.html",
m.site().contextPath(), "utf-8");
IServicewsContext ctx = IServicewsContext.context(frame);
String action = frame.parameter("action");
if (StringUtil.isEmpty(action)) {
throw new CircuitException("404", "参数:action不能为空");
}
String skip = frame.parameter("skip");
if(StringUtil.isEmpty(skip)){
skip="0";
}
String limit = frame.parameter("limit");
if(StringUtil.isEmpty(limit)){
limit="2000";
}
MailboxMessageViewer view=dao.getAllMessage(ctx.owner(),ctx.swsid(),action,skip,limit,m);
Element templi=doc.select(".app.msg").first();
Element container=new Element(Tag.valueOf("ul"), "");
dao.printMessages(action,view,templi,container,m);
container.appendChild(doc.head().children().first());
circuit.content().writeBytes(container.html().getBytes());
}
}
|
[
"carocean.jofers@icloud.com"
] |
carocean.jofers@icloud.com
|
0449fe6b7b4baf35fbd81a2679b2e7c7b43f521b
|
3c18841d5b169aaa14a4bbdcff4059fef9a99cc2
|
/src/main/java/mysticmods/mysticalworld/client/model/armor/AntlerHatModel.java
|
9ab9ba7da4e478985bd4e4f72599cea5b69e8229
|
[
"MIT"
] |
permissive
|
MysticMods/MysticalWorld
|
cb3d1073fa40c3d16a16e468df869855ad09ae27
|
8ca03f2a922ab42ee90b63bf918dc92571c11841
|
refs/heads/1.18
| 2023-04-07T16:34:51.082937
| 2023-02-19T03:19:05
| 2023-02-19T03:19:05
| 137,164,303
| 30
| 34
|
MIT
| 2023-04-02T17:21:19
| 2018-06-13T04:54:58
|
Java
|
UTF-8
|
Java
| false
| false
| 4,819
|
java
|
package mysticmods.mysticalworld.client.model.armor;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.CubeListBuilder;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.minecraft.world.entity.EquipmentSlot;
public class AntlerHatModel extends ArmorModel {
private final ModelPart hat;
private final ModelPart horn1;
private final ModelPart horn1_1;
private final ModelPart strap;
private final ModelPart horn3;
private final ModelPart horn6;
private final ModelPart horn8;
private final ModelPart horn3_1;
private final ModelPart horn6_1;
private final ModelPart horn8_1;
public AntlerHatModel(ModelPart pRoot) {
super(pRoot, EquipmentSlot.HEAD);
this.hat = pRoot.getChild("head");
this.horn1 = this.hat.getChild("horn1");
this.horn1_1 = this.hat.getChild("horn1_1");
this.strap = this.hat.getChild("strap");
this.horn3 = this.horn1.getChild("horn3");
this.horn3_1 = this.horn1_1.getChild("horn3_1");
this.horn6 = this.horn3.getChild("horn6");
this.horn6_1 = this.horn3_1.getChild("horn6_1");
this.horn8 = this.horn6.getChild("horn8");
this.horn8_1 = this.horn6_1.getChild("horn8_1");
}
@Override
public void renderToBuffer(PoseStack matrixStackIn, VertexConsumer bufferIn, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {
super.renderToBuffer(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha);
}
public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
partdefinition.addOrReplaceChild("hat", CubeListBuilder.create(), PartPose.ZERO);
partdefinition.addOrReplaceChild("body", CubeListBuilder.create(), PartPose.ZERO);
partdefinition.addOrReplaceChild("right_arm", CubeListBuilder.create(), PartPose.ZERO);
partdefinition.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO);
partdefinition.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO);
partdefinition.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO);
PartDefinition hat = partdefinition.addOrReplaceChild("head", CubeListBuilder.create().texOffs(64, 0).addBox(-3.0F, -10.0F, -3.0F, 6f, 3f, 6f), PartPose.offsetAndRotation(0f, 0f, 0f, 0f, 0f, 0f));
PartDefinition horn1_1 = hat.addOrReplaceChild("horn1_1", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(-2.0F, -9.0F, 0.0F, 0.0F, 0.0F, -0.08726646259971647F));
PartDefinition horn3_1 = horn1_1.addOrReplaceChild("horn3_1", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(-0.15F, -2.5F, 0.0F, 0.0F, -0.08726646259971647F, -1.0471975511965976F));
PartDefinition horn6_1 = horn3_1.addOrReplaceChild("horn6_1", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(0.3F, -3.2F, -0.2F, 0.0F, 0.08726646259971647F, 1.0471975511965976F));
horn6_1.addOrReplaceChild("horn8_1", CubeListBuilder.create().texOffs(70, 32).addBox(-0.5F, -3.0F, -0.5F, 1, 3, 1), PartPose.offsetAndRotation(0.0F, -2.0F, 0.0F, 0.0F, -0.17453292519943295F, -0.7853981633974483F));
PartDefinition horn1 = hat.addOrReplaceChild("horn1", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(2.0F, -9.0F, 0.0F, 0.0F, 0.0F, 0.08726646259971647F));
PartDefinition horn3 = horn1.addOrReplaceChild("horn3", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(0.15F, -2.5F, 0.0F, 0.0F, 0.08726646259971647F, 1.0471975511965976F));
PartDefinition horn6 = horn3.addOrReplaceChild("horn6", CubeListBuilder.create().texOffs(66, 32).addBox(-0.5F, -5.0F, -0.5F, 1, 5, 1), PartPose.offsetAndRotation(-0.3F, -3.2F, -0.2F, 0.0F, -0.08726646259971647F, -1.0471975511965976F));
horn6.addOrReplaceChild("horn8", CubeListBuilder.create().texOffs(70, 32).addBox(-0.5F, -3.0F, -0.5F, 1, 3, 1), PartPose.offsetAndRotation(0.0F, -2.0F, 0.0F, 0.0F, 0.17453292519943295F, 0.7853981633974483F));
hat.addOrReplaceChild("strap", CubeListBuilder.create().texOffs(64, 10).addBox(-4.5F, 0.0F, -0.5F, 9, 9, 1), PartPose.offsetAndRotation(0.0F, -8.1F, -0.5F, -0.25132741228718347F, 0.0F, 0.0F));
return LayerDefinition.create(meshdefinition, 128, 64);
}
}
|
[
"due@wxwhatever.com"
] |
due@wxwhatever.com
|
02e1db907ae96c5de8e110e150e3013fb4883938
|
cccccbd92a308c8b6fa4ec3ccd33cf0995345680
|
/src/test/java/TimElastixAPI.java
|
5c4779e125e72b41fc3571eeed85f12bd26f89df
|
[] |
no_license
|
tischi/DEPRECATED-fiji-plugin-elastixWrapper
|
9f06cc2a8a00c485fe9c0451ae37fbf487884013
|
d02bb91820d5912c68cc31b6e562f7d6e5d14145
|
refs/heads/master
| 2021-11-03T09:10:38.950890
| 2019-04-26T08:44:01
| 2019-04-26T08:44:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,779
|
java
|
import bdv.util.Bdv;
import de.embl.cba.elastixwrapper.elastix.ElastixSettings;
import de.embl.cba.elastixwrapper.elastix.ElastixWrapper;
import net.imagej.ImageJ;
public class TimElastixAPI
{
public static void main( String[] args )
{
final ImageJ ij = new ImageJ();
ij.ui().showUI();
ElastixSettings settings = new ElastixSettings();
settings.logService = ij.log();
settings.elastixDirectory = "/Applications/elastix_macosx64_v4.8" ;
settings.workingDirectory = "/Users/tischer/Desktop/elastix-tmp";
settings.transformationType = ElastixSettings.AFFINE;
settings.fixedImageFilePath = "/Users/tischer/Desktop/tim-elastix/template.tif";
settings.movingImageFilePath = "/Users/tischer/Desktop/tim-elastix/bUnwarpJ_pass.tif";
/**
* You want to match the first channel (0) in the fixed image,
* - which has only one channel -
* to the second channel (1) in the moving image
* - which has two channels -
*/
settings.fixedToMovingChannel.put( 0, 1 );
settings.downSamplingFactors = "10 10";
// settings.fixedMaskPath = "";
// settings.movingMaskPath = "";
// settings.bSplineGridSpacing = "50 50 50";
settings.iterations = 1000;
settings.spatialSamples = "3000";
// settings.channelWeights = new double[]{1.0, 3.0, 3.0, 1.0, 1.0};
// settings.finalResampler = ElastixSettings.FINAL_RESAMPLER_LINEAR;
final ElastixWrapper elastixWrapper = new ElastixWrapper( settings );
elastixWrapper.runElastix();
//elastixWrapper.createTransformedImagesAndSaveAsTiff();
final Bdv bdv = elastixWrapper.reviewResults();
bdv.close();
settings.logService.info( "Done!" );
}
private static String getImageFilePath( String relativePath )
{
return TimElastixAPI.class.getResource( relativePath ).getFile().toString();
}
}
|
[
"christian.tischer@embl.de"
] |
christian.tischer@embl.de
|
bb65259b6cdfc0cf509805c22539c1b9fc4f0da4
|
be28a7b64a4030f74233a79ebeba310e23fe2c3a
|
/generated-tests/rmosa/tests/s1024/19_jmca/evosuite-tests/com/soops/CEN4010/JMCA/JParser/JavaParserTokenManager_ESTest_scaffolding.java
|
ff5c29c58c5ac258fc24833dd40db9fc3fc2cc2a
|
[
"MIT"
] |
permissive
|
blindsubmissions/icse19replication
|
664e670f9cfcf9273d4b5eb332562a083e179a5f
|
42a7c172efa86d7d01f7e74b58612cc255c6eb0f
|
refs/heads/master
| 2020-03-27T06:12:34.631952
| 2018-08-25T11:19:56
| 2018-08-25T11:19:56
| 146,074,648
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,845
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Aug 23 16:34:39 GMT 2018
*/
package com.soops.CEN4010.JMCA.JParser;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class JavaParserTokenManager_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "com.soops.CEN4010.JMCA.JParser.JavaParserTokenManager";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("file.encoding", "UTF-8");
java.lang.System.setProperty("java.awt.headless", "true");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
java.lang.System.setProperty("user.country", "US");
java.lang.System.setProperty("user.dir", "/home/ubuntu/evosuite_readability_gen/projects/19_jmca");
java.lang.System.setProperty("user.home", "/home/ubuntu");
java.lang.System.setProperty("user.language", "en");
java.lang.System.setProperty("user.name", "ubuntu");
java.lang.System.setProperty("user.timezone", "Etc/UTC");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(JavaParserTokenManager_ESTest_scaffolding.class.getClassLoader() ,
"com.soops.CEN4010.JMCA.JParser.JavaCharStream",
"com.soops.CEN4010.JMCA.JParser.Token$GTToken",
"com.soops.CEN4010.JMCA.JParser.JavaParserTokenManager",
"com.soops.CEN4010.JMCA.JParser.TokenMgrError",
"com.soops.CEN4010.JMCA.JParser.JavaParserConstants",
"com.soops.CEN4010.JMCA.JParser.Token"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(JavaParserTokenManager_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"com.soops.CEN4010.JMCA.JParser.JavaParserTokenManager",
"com.soops.CEN4010.JMCA.JParser.JavaParserConstants",
"com.soops.CEN4010.JMCA.JParser.JavaCharStream",
"com.soops.CEN4010.JMCA.JParser.TokenMgrError",
"com.soops.CEN4010.JMCA.JParser.Token",
"com.soops.CEN4010.JMCA.JParser.Token$GTToken"
);
}
}
|
[
"my.submission.blind@gmail.com"
] |
my.submission.blind@gmail.com
|
d70393ed55868f3b0c70c8eaa6b8c3d09ab05e72
|
17e8438486cb3e3073966ca2c14956d3ba9209ea
|
/dso/tags/2.3.0/code/base/dso-l2/src/com/tc/objectserver/tx/TransactionAccountImpl.java
|
5182ae2d88b1faf898fb2d2c65d5e7be47db4697
|
[] |
no_license
|
sirinath/Terracotta
|
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
|
00a7662b9cf530dfdb43f2dd821fa559e998c892
|
refs/heads/master
| 2021-01-23T05:41:52.414211
| 2015-07-02T15:21:54
| 2015-07-02T15:21:54
| 38,613,711
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,168
|
java
|
/*
* All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
*/
package com.tc.objectserver.tx;
import com.tc.net.protocol.tcm.ChannelID;
import com.tc.object.tx.TransactionID;
import com.tc.util.Assert;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/**
* An account of the state of a given transaction. Keeps track of the initiating client, the state of the transaction
* (applied, committed, etc), clients the transaction has been broadcast to, and clients that have ACKed the
* transaction.
*
*/
public class TransactionAccountImpl implements TransactionAccount {
final ChannelID clientID;
private final Map waitees = Collections.synchronizedMap(new HashMap());
public TransactionAccountImpl(ChannelID clientID) {
this.clientID = clientID;
}
public String toString() {
return "TransactionAccount[" + clientID + ": waitees=" + waitees + "]\n";
}
public ChannelID getClientID() {
return clientID;
}
/*
* returns true if completed, false if not completed or if the client has sent a duplicate ACK.
*/
public boolean removeWaitee(ChannelID waitee, TransactionID requestID) {
TransactionRecord transactionRecord = getRecord(requestID);
if (transactionRecord == null) return false;
synchronized (transactionRecord) {
transactionRecord.remove(waitee);
return checkCompleted(requestID, transactionRecord);
}
}
public void addWaitee(ChannelID waitee, TransactionID requestID) {
TransactionRecord record = getOrCreateRecord(requestID);
synchronized (record) {
boolean added = record.addWaitee(waitee);
Assert.eval(added);
}
}
private TransactionRecord getOrCreateRecord(TransactionID requestID) {
synchronized (waitees) {
TransactionRecord transactionRecord = getRecord(requestID);
if (transactionRecord == null) {
waitees.put(requestID, (transactionRecord = new TransactionRecord()));
}
return transactionRecord;
}
}
private TransactionRecord getRecord(TransactionID requestID) {
TransactionRecord transactionRecord = (TransactionRecord) waitees.get(requestID);
return transactionRecord;
}
public boolean skipApplyAndCommit(TransactionID requestID) {
TransactionRecord transactionRecord = getOrCreateRecord(requestID);
synchronized (transactionRecord) {
transactionRecord.applyAndCommitSkipped();
return checkCompleted(requestID, transactionRecord);
}
}
public void applyStarted(TransactionID requestID) {
TransactionRecord transactionRecord = getOrCreateRecord(requestID);
synchronized (transactionRecord) {
transactionRecord.applyStarted();
}
}
public boolean applyCommitted(TransactionID requestID) {
TransactionRecord transactionRecord = getRecord(requestID);// (TransactionRecord) waitees.get(requestID);
if (transactionRecord == null) {
// this can happen when a client crashes and there are still some unprocessed apply messages in the
// queue. We dont want to try to send acks for such scenario.
return false;
}
synchronized (transactionRecord) {
transactionRecord.applyCommitted();
return checkCompleted(requestID, transactionRecord);
}
}
public boolean broadcastCompleted(TransactionID requestID) {
TransactionRecord transactionRecord = getRecord(requestID);// (TransactionRecord) waitees.get(requestID);
if (transactionRecord == null) {
// this could happen when a client crashes and there are still some unprocessed apply messages in the
// queue. We dont want to try to send acks for such scenario.
return false;
}
synchronized (transactionRecord) {
transactionRecord.broadcastCompleted();
return checkCompleted(requestID, transactionRecord);
}
}
public boolean relayTransactionComplete(TransactionID requestID) {
TransactionRecord transactionRecord = getOrCreateRecord(requestID);
synchronized (transactionRecord) {
transactionRecord.relayTransactionComplete();
return checkCompleted(requestID, transactionRecord);
}
}
public boolean hasWaitees(TransactionID requestID) {
TransactionRecord record = getRecord(requestID);
if (record == null) return false;
synchronized (record) {
return !record.isEmpty();
}
}
public Set requestersWaitingFor(ChannelID waitee) {
Set requesters = new HashSet();
synchronized (waitees) {
for (Iterator i = new HashSet(waitees.keySet()).iterator(); i.hasNext();) {
TransactionID requester = (TransactionID) i.next();
// if (((Set) waitees.get(requester)).contains(waitee))
if (getRecord(requester).contains(waitee)) {
requesters.add(requester);
}
}
}
return requesters;
}
private boolean checkCompleted(TransactionID requestID, TransactionRecord record) {
if (record.isComplete()) {
waitees.remove(requestID);
return true;
}
return false;
}
}
|
[
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] |
jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864
|
e9a0e4d9b7d933c308a40ff81577802012d59c8b
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/JetBrains--intellij-community/17c940fa479804a3da68b83caf85354a88783637/after/LibrariesValidatorContextImpl.java
|
30594fc7ae4caa1317d1f7a0e70f43d258e9cbb4
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,883
|
java
|
/*
* Copyright (c) 2000-2007 JetBrains s.r.o. All Rights Reserved.
*/
package com.intellij.facet.impl.ui.libraries;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.roots.ModuleRootModel;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable;
import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
import com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider;
import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainerFactory;
import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainer;
import com.intellij.openapi.roots.libraries.LibraryTable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.module.Module;
/**
* @author nik
*/
public class LibrariesValidatorContextImpl implements LibrariesValidatorContext {
private Module myModule;
private LibrariesContainer myLibrariesContainer;
public LibrariesValidatorContextImpl(final @NotNull Module module) {
myModule = module;
myLibrariesContainer = LibrariesContainerFactory.createContainer(module);
}
@Nullable
public ModuleRootModel getRootModel() {
return ModuleRootManager.getInstance(myModule);
}
@Nullable
public ModifiableRootModel getModifiableRootModel() {
return null;
}
private LibraryTable getProjectLibraryTable() {
return ProjectLibraryTable.getInstance(myModule.getProject());
}
@NotNull
public ModulesProvider getModulesProvider() {
return new DefaultModulesProvider(myModule.getProject());
}
@Nullable
public Project getProject() {
return myModule.getProject();
}
public LibrariesContainer getLibrariesContainer() {
return myLibrariesContainer;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
748d515ef4cc86a756999c7bdfac0060dcd546b6
|
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
|
/sources/com/google/android/gms/maps/model/ButtCap.java
|
bbd19b1dd95840a7943f47ef0d956d01078a7d45
|
[] |
no_license
|
Auch-Auch/avito_source
|
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
|
76fdcc5b7e036c57ecc193e790b0582481768cdc
|
refs/heads/master
| 2023-05-06T01:32:43.014668
| 2021-05-25T10:19:22
| 2021-05-25T10:19:22
| 370,650,685
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 278
|
java
|
package com.google.android.gms.maps.model;
public final class ButtCap extends Cap {
public ButtCap() {
super(0);
}
@Override // com.google.android.gms.maps.model.Cap, java.lang.Object
public final String toString() {
return "[ButtCap]";
}
}
|
[
"auchhunter@gmail.com"
] |
auchhunter@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.