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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a40517ae650e68bfe19225b9ae59b30f7b2e258c | cf0bcbb28bd33620fca30b0323432941779f29a6 | /latke/src/main/java/org/b3log/latke/servlet/renderer/AbstractHTTPResponseRenderer.java | 21948b794bdb7861fc21526bfd96a06ac76c2b13 | [
"Apache-2.0"
] | permissive | Letractively/latke | d16b947d93330cae195d975ab2e6ea1d825596a9 | ae3e9d70275af616a1d659263d3e9659a192bb98 | refs/heads/master | 2021-01-10T16:54:58.254490 | 2012-08-09T05:49:15 | 2012-08-09T05:49:15 | 45,962,566 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,114 | java | /*
* Copyright (c) 2009, 2010, 2011, 2012, B3log Team
*
* 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.b3log.latke.servlet.renderer;
import org.b3log.latke.servlet.HTTPRequestContext;
/**
* Abstract HTTP response renderer.
*
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.0, Jul 16, 2011
*/
public abstract class AbstractHTTPResponseRenderer {
/**
* Renders with the specified HTTP request context.
*
* @param context the specified HTTP request context
*/
public abstract void render(final HTTPRequestContext context);
}
| [
"DL88250@gmail.com"
] | DL88250@gmail.com |
6a87ba10e11b5358ed477b163483ff149b87f0df | 772336a5d78cc35dce78ef46a1913ff95f309da1 | /Class/src/Class/exp2.java | 1c27fe98e8c5ac42d5fb4aa1ff77cd87e3008f84 | [] | no_license | phuocdinh1144/phuocdinh | 2af0756b312b6ab55cc7b6158011b6d712587aec | 42ab21b76acd03448e701c784881a039de4f7a64 | refs/heads/master | 2020-05-29T19:57:08.111141 | 2019-06-22T09:55:30 | 2019-06-22T09:55:30 | 189,343,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 431 | java | package Class;
class setEdges
{
private float w,h;
public void setEdges(float W, float H)
{
w=W;
h=H;
}
public float dtich()
{
return w*h;
}
}
public class exp2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
setEdges r;
r = new setEdges();
r.setEdges(10.0f, 5.0f);
float dientich = r.dtich();
System.out.println( " Diện tich hình chữ nhật là:" + dientich);
}
}
| [
"="
] | = |
248c309e8e00d25b7d06cc0a93fd926d47c87839 | 5c41116d17ef8864423bcc5498c4efd6c696cbac | /com/rwtema/extrautils/inventory/LiquidInventory.java | 41166f7167e41c0f27557e6d0dc60b83aba61ca4 | [] | no_license | richardhendricks/ExtraUtilities | 519175ce14406f95620c34a425e1fd54964cbcf6 | 1b9d60a14cc7f76754eb8f0e7c1e1c77f3bda7a6 | refs/heads/master | 2021-07-14T11:56:53.480656 | 2017-10-19T16:03:19 | 2017-10-19T16:03:19 | 107,566,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,164 | java | /* 1: */ package com.rwtema.extrautils.inventory;
/* 2: */
/* 3: */ import net.minecraft.entity.player.EntityPlayer;
/* 4: */ import net.minecraft.inventory.ISidedInventory;
/* 5: */ import net.minecraft.item.ItemStack;
/* 6: */ import net.minecraft.tileentity.TileEntity;
/* 7: */ import net.minecraftforge.common.util.ForgeDirection;
/* 8: */ import net.minecraftforge.fluids.FluidContainerRegistry;
/* 9: */ import net.minecraftforge.fluids.FluidStack;
/* 10: */ import net.minecraftforge.fluids.FluidTankInfo;
/* 11: */ import net.minecraftforge.fluids.IFluidHandler;
/* 12: */
/* 13: */ public class LiquidInventory
/* 14: */ implements ISidedInventory
/* 15: */ {
/* 16: */ IFluidHandler tank;
/* 17: */ ForgeDirection side;
/* 18: */
/* 19: */ public LiquidInventory(IFluidHandler tank, ForgeDirection side)
/* 20: */ {
/* 21: 17 */ this.tank = tank;
/* 22: 18 */ this.side = side;
/* 23: */ }
/* 24: */
/* 25: */ public int[] getAccessibleSlotsFromSide(int var1)
/* 26: */ {
/* 27: 24 */ if (this.tank.getTankInfo(this.side) == null) {
/* 28: 25 */ return new int[0];
/* 29: */ }
/* 30: 27 */ int[] t = new int[this.tank.getTankInfo(this.side).length];
/* 31: 28 */ for (int i = 0; i < t.length; i++) {
/* 32: 29 */ t[i] = i;
/* 33: */ }
/* 34: 31 */ return t;
/* 35: */ }
/* 36: */
/* 37: */ public boolean canInsertItem(int var1, ItemStack var2, int var3)
/* 38: */ {
/* 39: 36 */ FluidStack f = FluidContainerRegistry.getFluidForFilledItem(var2);
/* 40: 37 */ return (f != null) && (f.getFluid() != null) && (this.tank.canFill(this.side, f.getFluid())) && (this.tank.fill(this.side, f, false) == f.amount);
/* 41: */ }
/* 42: */
/* 43: */ public boolean canExtractItem(int var1, ItemStack var2, int var3)
/* 44: */ {
/* 45: 42 */ FluidStack f = FluidContainerRegistry.getFluidForFilledItem(var2);
/* 46: 43 */ return (f != null) && (f.getFluid() != null) && (this.tank.canDrain(this.side, f.getFluid())) && (f.isFluidStackIdentical(this.tank.drain(this.side, f, false)));
/* 47: */ }
/* 48: */
/* 49: */ public int getSizeInventory()
/* 50: */ {
/* 51: 48 */ return this.tank.getTankInfo(this.side).length;
/* 52: */ }
/* 53: */
/* 54: 51 */ ItemStack[] genericItems = { FluidContainerRegistry.EMPTY_BUCKET, FluidContainerRegistry.EMPTY_BOTTLE };
/* 55: */
/* 56: */ public ItemStack getStackInSlot(int var1)
/* 57: */ {
/* 58: 55 */ FluidStack f = this.tank.getTankInfo(this.side)[var1].fluid;
/* 59: 56 */ for (ItemStack item : this.genericItems)
/* 60: */ {
/* 61: 57 */ ItemStack i = FluidContainerRegistry.fillFluidContainer(f, item);
/* 62: 58 */ if (i != null) {
/* 63: 59 */ return i;
/* 64: */ }
/* 65: */ }
/* 66: 61 */ return null;
/* 67: */ }
/* 68: */
/* 69: */ public ItemStack decrStackSize(int var1, int var2)
/* 70: */ {
/* 71: 66 */ FluidStack f = this.tank.getTankInfo(this.side)[var1].fluid;
/* 72: 67 */ for (ItemStack item : this.genericItems)
/* 73: */ {
/* 74: 68 */ ItemStack i = FluidContainerRegistry.fillFluidContainer(f, item);
/* 75: 69 */ if (i != null)
/* 76: */ {
/* 77: 70 */ FluidStack t = FluidContainerRegistry.getFluidForFilledItem(i);
/* 78: 71 */ if ((t != null) && (t.isFluidEqual(this.tank.drain(this.side, t, false))))
/* 79: */ {
/* 80: 72 */ this.tank.drain(this.side, t, true);
/* 81: 73 */ return i;
/* 82: */ }
/* 83: */ }
/* 84: */ }
/* 85: 78 */ return null;
/* 86: */ }
/* 87: */
/* 88: */ public ItemStack getStackInSlotOnClosing(int var1)
/* 89: */ {
/* 90: 83 */ return getStackInSlot(var1);
/* 91: */ }
/* 92: */
/* 93: */ public void setInventorySlotContents(int var1, ItemStack var2)
/* 94: */ {
/* 95: 88 */ FluidStack f = FluidContainerRegistry.getFluidForFilledItem(var2);
/* 96: 89 */ if ((f == null) || (f.getFluid() == null)) {
/* 97: 90 */ return;
/* 98: */ }
/* 99: 91 */ if (!this.tank.canFill(this.side, f.getFluid())) {
/* 100: 92 */ return;
/* 101: */ }
/* 102: 93 */ if (this.tank.fill(this.side, f, false) == f.amount) {
/* 103: 94 */ this.tank.fill(this.side, f, true);
/* 104: */ }
/* 105: */ }
/* 106: */
/* 107: */ public String getInventoryName()
/* 108: */ {
/* 109: 99 */ return "fakeTank";
/* 110: */ }
/* 111: */
/* 112: */ public boolean isInventoryNameLocalized()
/* 113: */ {
/* 114:104 */ return false;
/* 115: */ }
/* 116: */
/* 117: */ public int getInventoryStackLimit()
/* 118: */ {
/* 119:109 */ return this.tank.getTankInfo(this.side).length;
/* 120: */ }
/* 121: */
/* 122: */ public void onInventoryChanged()
/* 123: */ {
/* 124:114 */ if ((this.tank instanceof TileEntity)) {
/* 125:115 */ ((TileEntity)this.tank).onInventoryChanged();
/* 126: */ }
/* 127: */ }
/* 128: */
/* 129: */ public boolean isUseableByPlayer(EntityPlayer var1)
/* 130: */ {
/* 131:120 */ return false;
/* 132: */ }
/* 133: */
/* 134: */ public void openInventory() {}
/* 135: */
/* 136: */ public void closeInventory() {}
/* 137: */
/* 138: */ public boolean isItemValidForSlot(int var1, ItemStack var2)
/* 139: */ {
/* 140:135 */ return canInsertItem(var1, var2, 0);
/* 141: */ }
/* 142: */ }
/* Location: E:\TechnicPlatform\extrautilities\extrautilities-1.2.13.jar
* Qualified Name: com.rwtema.extrautils.inventory.LiquidInventory
* JD-Core Version: 0.7.0.1
*/ | [
"richard.hendricks@silabs.com"
] | richard.hendricks@silabs.com |
c61e048fd9f028ca6dca2a2a7b0b90ac4f262b74 | 1591de2de30d0e72699b143ea8792e0383debfef | /sga/sga-jee-api-criteria/src/main/java/mx/com/gm/sga/cliente/asociaciones/ClientesAsociacionesJPA.java | 488549750ea86c567eb69a4ee16d7fba2a7480ef | [] | no_license | barcvilla/javaee7 | 85fd60c4ae5b2852d187337fab2aefdd11c8ec7d | 0c8b047cb480ac4b2c140df499d590509c7c09fa | refs/heads/master | 2020-03-23T10:23:29.254887 | 2018-10-26T03:33:01 | 2018-10-26T03:33:01 | 141,440,495 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,942 | 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 mx.com.gm.sga.cliente.asociaciones;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import javax.validation.ConstraintViolationException;
import mx.com.gm.sga.domain.Persona;
import mx.com.gm.sga.domain.Usuario;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**
*
* @author PC
*/
public class ClientesAsociacionesJPA {
static Logger log = LogManager.getRootLogger();
public static void main(String[] args) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("ConsolaJpqlPU");
EntityManager em = emf.createEntityManager();
try
{
List<Persona> personas = em.createNamedQuery("Persona.findAll").getResultList();
// cerramos la transaccion
em.close();
//impresion de las personas
imprimirPersonas(personas);
}
catch (ConstraintViolationException e) {
log.log(Level.ERROR, "Exception: ");
e.getConstraintViolations().forEach(err -> log.log(Level.ERROR, err.toString()));
}
}
private static void imprimirPersonas(List<Persona> personas)
{
// objetos en estado detached o desconectado
for(Persona persona : personas)
{
log.debug("Persona: " + persona);
//recuperamos los usuarios de cada persona
for(Usuario usuario : persona.getUsuarioList())
{
log.debug("Usuario: " + usuario);
}
}
}
}
| [
"ceva_19@hotmail.com"
] | ceva_19@hotmail.com |
4e859145e179a55f88098683a2667f70f25b5683 | 1636150a6a3ea4168155be5ac218ee023f28ed4b | /mango-admin/src/main/java/com/wst/mango/admin/security/JwtAuthenticatioToken.java | 7030e62eb96fc8336322514932ef7ef7d2dba673 | [] | no_license | TaoWang4446/mango | e391e68113c7e41a637592d3d6093fe4ee1e5070 | f260ee9f31edc32ffe3346a5b2ea98f1504f57d6 | refs/heads/master | 2022-11-19T13:06:39.541285 | 2020-07-22T01:10:39 | 2020-07-22T01:10:39 | 281,082,645 | 0 | 0 | null | 2020-07-20T10:12:47 | 2020-07-20T10:11:53 | Java | UTF-8 | Java | false | false | 1,134 | java | package com.wst.mango.admin.security;
import java.util.Collection;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
/**
* 自定义令牌对象
* @author Wst
* @date Jan 14, 2019
*/
public class JwtAuthenticatioToken extends UsernamePasswordAuthenticationToken {
private static final long serialVersionUID = 1L;
private String token;
public JwtAuthenticatioToken(Object principal, Object credentials){
super(principal, credentials);
}
public JwtAuthenticatioToken(Object principal, Object credentials, String token){
super(principal, credentials);
this.token = token;
}
public JwtAuthenticatioToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities, String token) {
super(principal, credentials, authorities);
this.token = token;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}
| [
"2825586682@qq.com"
] | 2825586682@qq.com |
13639243cc572f0ae739575fa82c37b130261d21 | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/1438167/pmd-src-4.1/pmd-4.1/src/net/sourceforge/pmd/RuleViolation.java | fe80125619b44f2b626830917152aa6968ec9dc3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | Java | false | false | 6,292 | java | /**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd;
import net.sourceforge.pmd.ast.ASTClassOrInterfaceBodyDeclaration;
import net.sourceforge.pmd.ast.ASTClassOrInterfaceDeclaration;
import net.sourceforge.pmd.ast.ASTFieldDeclaration;
import net.sourceforge.pmd.ast.ASTFormalParameter;
import net.sourceforge.pmd.ast.ASTLocalVariableDeclaration;
import net.sourceforge.pmd.ast.ASTMethodDeclaration;
import net.sourceforge.pmd.ast.ASTTypeDeclaration;
import net.sourceforge.pmd.ast.ASTVariableDeclaratorId;
import net.sourceforge.pmd.ast.CanSuppressWarnings;
import net.sourceforge.pmd.ast.SimpleNode;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
public class RuleViolation implements IRuleViolation {
public static class RuleViolationComparator implements Comparator<IRuleViolation> {
//
// Changed logic of Comparator so that rules in the same file
// get grouped together in the output report.
// DDP 7/11/2002
//
public int compare(IRuleViolation r1, IRuleViolation r2) {
if (!r1.getFilename().equals(r2.getFilename())) {
return r1.getFilename().compareTo(r2.getFilename());
}
if (r1.getBeginLine() != r2.getBeginLine())
return r1.getBeginLine() - r2.getBeginLine();
if (r1.getDescription() != null && r2.getDescription() != null && !r1.getDescription().equals(r2.getDescription())) {
return r1.getDescription().compareTo(r2.getDescription());
}
if (r1.getBeginLine() == r2.getBeginLine()) {
return 1;
}
// line number diff maps nicely to compare()
return r1.getBeginLine() - r2.getBeginLine();
}
}
private Rule rule;
private String description;
private String filename;
private String className;
private String methodName;
private String variableName;
private String packageName;
private int beginLine;
private int endLine;
private int beginColumn;
private int endColumn;
private boolean isSuppressed;
public RuleViolation(Rule rule, RuleContext ctx, SimpleNode node) {
this(rule, ctx, node, rule.getMessage());
}
public RuleViolation(Rule rule, RuleContext ctx, SimpleNode node, String specificMsg) {
this.rule = rule;
this.filename = ctx.getSourceCodeFilename();
this.description = specificMsg;
if (node.getFirstParentOfType(ASTClassOrInterfaceDeclaration.class) == null) {
// This takes care of nodes which are outside a class definition - i.e., import declarations
className = "";
} else {
// default to symbol table lookup
className = node.getScope().getEnclosingClassScope().getClassName() == null ? "" : node.getScope().getEnclosingClassScope().getClassName();
}
setVariableNameIfExists(node);
methodName = node.getFirstParentOfType(ASTMethodDeclaration.class) == null ? "" : node.getScope().getEnclosingMethodScope().getName();
packageName = node.getScope().getEnclosingSourceFileScope().getPackageName() == null ? "" : node.getScope().getEnclosingSourceFileScope().getPackageName();
beginLine = node.getBeginLine();
endLine = node.getEndLine();
beginColumn = node.getBeginColumn();
endColumn = node.getEndColumn();
// TODO combine this duplicated code
// TODO same for duplicated code in ASTTypeDeclaration && ASTClassOrInterfaceBodyDeclaration
List<SimpleNode> parentTypes = new ArrayList<SimpleNode>(node.getParentsOfType(ASTTypeDeclaration.class));
if (node instanceof ASTTypeDeclaration) {
parentTypes.add(node);
}
parentTypes.addAll(node.getParentsOfType(ASTClassOrInterfaceBodyDeclaration.class));
if (node instanceof ASTClassOrInterfaceBodyDeclaration) {
parentTypes.add(node);
}
parentTypes.addAll(node.getParentsOfType(ASTFormalParameter.class));
if (node instanceof ASTFormalParameter) {
parentTypes.add(node);
}
parentTypes.addAll(node.getParentsOfType(ASTLocalVariableDeclaration.class));
if (node instanceof ASTLocalVariableDeclaration) {
parentTypes.add(node);
}
for (Iterator i = parentTypes.iterator(); i.hasNext();) {
CanSuppressWarnings t = (CanSuppressWarnings) i.next();
if (t.hasSuppressWarningsAnnotationFor(getRule())) {
isSuppressed = true;
}
}
}
private void setVariableNameIfExists(SimpleNode node) {
variableName = (node.getClass().equals(ASTFieldDeclaration.class))
? ((ASTFieldDeclaration) node).getVariableName() : "";
if ("".equals(variableName)) {
variableName = (node.getClass().equals(ASTLocalVariableDeclaration.class))
? ((ASTLocalVariableDeclaration) node).getVariableName() : "";
}
if ("".equals(variableName)) {
variableName = (node.getClass().equals(ASTVariableDeclaratorId.class))
? node.getImage() : "";
}
}
public Rule getRule() {
return rule;
}
public boolean isSuppressed() {
return this.isSuppressed;
}
public int getBeginColumn() {
return beginColumn;
}
public int getEndColumn() {
return endColumn;
}
public String getDescription() {
return description;
}
public String getFilename() {
return filename;
}
public String getClassName() {
return className;
}
public String getMethodName() {
return methodName;
}
public String getPackageName() {
return packageName;
}
public int getBeginLine() {
return beginLine;
}
public int getEndLine() {
return endLine;
}
public String getVariableName() {
return variableName;
}
public String toString() {
return getFilename() + ":" + getRule() + ":" + getDescription() + ":" + beginLine;
}
}
| [
"mmkaouer@umich.edu"
] | mmkaouer@umich.edu |
7a23aab363ac0b29832415d4421cd7da9b753d13 | 1519fd020a6a3717114aa99c1799f5baa4c8640b | /orm/plugin/runtime/org.jboss.tools.hibernate.runtime.v_5_3/src/org/jboss/tools/hibernate/runtime/v_5_3/internal/util/ConfigurationMetadataDescriptor.java | 80beba1fe49c1b83a77e38c69ed7fb016abd96e8 | [] | no_license | koentsje/jbosstools-hibernate | 8718305dc571f2ee329a31eb2d9052db8b2d46ea | 0f72a3b9296724f94252a50e907cf54b2758d13b | refs/heads/main | 2023-08-22T12:50:01.656531 | 2023-08-11T07:17:32 | 2023-08-11T07:17:32 | 6,763,576 | 0 | 0 | null | 2013-01-26T06:18:05 | 2012-11-19T16:40:51 | Java | UTF-8 | Java | false | false | 2,235 | java | package org.jboss.tools.hibernate.runtime.v_5_3.internal.util;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Properties;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.internal.MetadataImpl;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.tool.api.metadata.MetadataDescriptor;
import org.jboss.tools.hibernate.runtime.common.IFacade;
import org.jboss.tools.hibernate.runtime.spi.IConfiguration;
import org.jboss.tools.hibernate.runtime.spi.IPersistentClass;
import org.jboss.tools.hibernate.runtime.v_5_3.internal.ConfigurationFacadeImpl;
public class ConfigurationMetadataDescriptor implements MetadataDescriptor {
private IConfiguration configuration;
public ConfigurationMetadataDescriptor(IConfiguration configuration) {
this.configuration = configuration;
}
@Override
public Metadata createMetadata() {
Metadata result = null;
if (this.configuration instanceof ConfigurationFacadeImpl) {
result = ((ConfigurationFacadeImpl)configuration).getMetadata();
if (result != null) {
result = patch(result);
}
}
return result;
}
private Metadata patch(Metadata metadata) {
try {
if (metadata instanceof MetadataImpl ) {
MetadataImpl metadataImpl = (MetadataImpl)metadata;
Field entityBindingMapField = metadataImpl.getClass().getDeclaredField("entityBindingMap");
if (entityBindingMapField != null) {
entityBindingMapField.setAccessible(true);
Object object = entityBindingMapField.get(metadataImpl);
if (object instanceof HashMap<?, ?>) {
@SuppressWarnings("unchecked")
HashMap<String, PersistentClass> map = (HashMap<String, PersistentClass>)object;
for (IPersistentClass ipc : ((ConfigurationFacadeImpl)this.configuration).getAddedClasses()) {
PersistentClass pc = (PersistentClass)((IFacade)ipc).getTarget();
map.put(pc.getEntityName(), pc);
}
}
}
}
return metadata;
}
catch (Throwable t) {
throw new RuntimeException("Problem while creating metadata", t);
}
}
@Override
public Properties getProperties() {
return configuration.getProperties();
}
public IConfiguration getConfiguration() {
return this.configuration;
}
}
| [
"koen.aers@gmail.com"
] | koen.aers@gmail.com |
b7743b192652d74ba4dda7d163dfea4ce8578820 | 0fe59b1dfb5cf2454cef805da2804b2d3e52f742 | /bee-platform-system/platform-sidatadriver/src/test/java/com/bee/platform/datadriver/TestMP.java | 0203fcfa44001b5702fd9d1f3e0e512f4627f57e | [] | no_license | wensheng930729/platform | f75026113a841e8541017c364d30b80e94d6ad5c | 49c57f1f59b1e2e2bcc2529fdf6cb515d38ab55c | refs/heads/master | 2020-12-11T13:58:59.772611 | 2019-12-16T06:02:40 | 2019-12-16T06:02:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,691 | java | package com.bee.platform.datadriver;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.DbType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import org.junit.Test;
public class TestMP {
/**
* 代码生成 示例代码
*/
@Test
public void testGenerator() {
//1. 全局配置
GlobalConfig config = new GlobalConfig();
config.setActiveRecord(true) // 是否支持AR模式
.setAuthor("hongchuan.he") // 作者
.setOutputDir("E:\\bee-platform\\bee-platform-system\\platform-datadriver\\src\\main\\java") // 生成路径
.setFileOverride(true) // 文件覆盖
.setIdType(IdType.AUTO) // 主键策略
.setServiceName("%sService") // 设置生成的service接口的名字的首字母是否为I
// IEmployeeService
.setBaseResultMap(true)
.setBaseColumnList(true);
//2. 数据源配置
DataSourceConfig dsConfig = new DataSourceConfig();
dsConfig.setDbType(DbType.MYSQL) // 设置数据库类型
.setDriverName("com.mysql.jdbc.Driver")
.setUrl("jdbc:mysql://192.168.3.78:3306/st_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&verifyServerCertificate=false")
.setUsername("root")
.setPassword("bee@123456");
//3. 策略配置
StrategyConfig stConfig = new StrategyConfig();
stConfig.setCapitalMode(true) //全局大写命名
.setDbColumnUnderline(true) // 指定表名 字段名是否使用下划线
.setNaming(NamingStrategy.underline_to_camel) // 数据库表映射到实体的命名策略
// .setTablePrefix("erp_")
.setInclude(new String[]{"erp_opening_inventory_order"}); // 生成的表
//
//4. 包名策略配置
PackageConfig pkConfig = new PackageConfig();
pkConfig.setParent("com.bee.platform.datadriver")
.setMapper("dao.mapper")
.setService("service")
.setController("controller")
.setEntity("entity")
.setXml("dao.mapper");
//5. 整合配置
AutoGenerator ag = new AutoGenerator();
ag.setGlobalConfig(config)
.setDataSource(dsConfig)
.setStrategy(stConfig)
.setPackageInfo(pkConfig);
//6. 执行
ag.execute();
}
public static void main(String[] args) {
TestMP mp=new TestMP();
mp.testGenerator();
}
}
| [
"414608036@qq.com"
] | 414608036@qq.com |
2e51970b29319fb72676d9fa3d88adca852a6844 | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2012-05-19/seasar2-2.4.46/seasar2/s2-framework/src/main/java/org/seasar/framework/container/external/servlet/HttpSessionMap.java | 64b1fa5e4c5a0567aba8ede887203b143e435494 | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,483 | java | /*
* Copyright 2004-2012 the Seasar Foundation and the Others.
*
* 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.seasar.framework.container.external.servlet;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.seasar.framework.container.external.AbstractExternalContextMap;
import org.seasar.framework.util.AssertionUtil;
import org.seasar.framework.util.EmptyIterator;
import org.seasar.framework.util.EnumerationIterator;
/**
* {@link HttpSession}を {@link Map}としてアクセスするためのクラスです。
*
* @author shot
* @author higa
*/
public class HttpSessionMap extends AbstractExternalContextMap {
private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
private HttpServletRequest request;
/**
* {@link HttpSessionMap}を作成します。
*
* @param request
*/
public HttpSessionMap(HttpServletRequest request) {
AssertionUtil.assertNotNull("request is null.", request);
this.request = request;
}
protected Object getAttribute(String key) {
HttpSession session = getSession();
return (session != null) ? session.getAttribute(key) : null;
}
protected void setAttribute(String key, Object value) {
request.getSession(true).setAttribute(key, value);
}
protected Iterator getAttributeNames() {
HttpSession session = getSession();
return (session != null) ? new EnumerationIterator(session
.getAttributeNames()) : EMPTY_ITERATOR;
}
protected void removeAttribute(String key) {
HttpSession session = getSession();
if (session != null) {
session.removeAttribute(key);
}
}
private HttpSession getSession() {
return request.getSession(false);
}
}
| [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
f7b3a184dac8f74f39a15218953e48710aa10843 | 5d8511e247f894ccf3ce0e8679208cf212a577af | /JDrucker/src/test/java/org/braisdom/drucker/database/DefaultDatabaseSessionTest.java | 31e76959f2949557c7561adf91351c55dd5ec36f | [
"Apache-2.0"
] | permissive | braisdom/JDrucker | e7297b4b22b1aa5bd03cbaae7e3efafb36fe15bc | b3d4a2903d3c9f48c7ce737fe1b9f23e39bf15c1 | refs/heads/master | 2020-05-17T14:05:18.615368 | 2019-10-08T09:50:38 | 2019-10-08T09:50:38 | 183,754,562 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package org.braisdom.drucker.database;
import static org.mockito.Mockito.*;
import org.junit.Test;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class DefaultDatabaseSessionTest {
@Test
public void testExecuteQuery() throws SQLException {
DatabaseConnectionFactory databaseConnectionFactory = mock(DatabaseConnectionFactory.class);
Connection connection = mock(Connection.class);
Statement statement = mock(Statement.class);
when(connection.createStatement()).thenReturn(statement);
when(databaseConnectionFactory.getConnection()).thenReturn(connection);
}
}
| [
"yonghe.wang@joowing.com"
] | yonghe.wang@joowing.com |
cb1c38820543e4d6f6a0707b46ab9057ff06cbfe | 1afe2e3788b6eed0ae929b95353efbcd8aee19b8 | /src/exp/nullpointerworks/jscript/barcodes/todo/GS1DataBar.java | ddf6b00debdf9d681ffcd06dca46b277d9cc135c | [
"Unlicense"
] | permissive | NullpointerWorks/libjscript | 0e166a130d965bc42c5850241530b53f31485c42 | 0a7501b737c391254454aa38bf956a536dcb686d | refs/heads/main | 2023-08-28T12:04:04.135978 | 2021-10-27T13:47:22 | 2021-10-27T13:47:22 | 360,139,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | /*
* This is free and unencumbered software released into the public domain.
* (http://unlicense.org/)
* Nullpointer Works (2021)
*/
package exp.nullpointerworks.jscript.barcodes.todo;
/**
* TODO - GS1 DataBar Omnidirectional
*
* @author Michiel Drost - Nullpointer Works
* @see The CAB Programming Manual x4 - page 221
*/
public class GS1DataBar extends RSS14
{
}
| [
"38044500+NullpointerWorks@users.noreply.github.com"
] | 38044500+NullpointerWorks@users.noreply.github.com |
a8a86f829f68a572ecd8ca07a4e99e83be992eef | 44f1b987ddec54caf0ec5fc1ec8c8c4a410a8ca9 | /src/tree_divideConquer/TreeNode.java | 2b989ec75ae847f91ef7efcfdc93b6b5b087bba9 | [] | no_license | hanrick2000/Leetcode_Lintcode_Jun | 28feb74e660986b0792db0be009553ee679a08b7 | 7f23ddc7c7d54ac29e96e9fc4c1b8b4247e6dc48 | refs/heads/master | 2021-09-15T05:50:44.437621 | 2018-05-27T11:17:43 | 2018-05-27T11:17:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | package tree_divideConquer;
public class TreeNode {
int val;
TreeNode left;
TreeNode right;
public TreeNode(int x) {
val = x;
}
} | [
"jungan@juns-mbp.torolab.ibm.com"
] | jungan@juns-mbp.torolab.ibm.com |
c7819a674f3262bdd1283fd764b68f5318897011 | 63b9289fe4395b599545de10de7f1b46d3c367d3 | /ch3/src/ch3/IfTest1.java | 0a972796393015b7de486b6cf0498e193cdd1231 | [] | no_license | glglgl45/javasource | 7d83499a3e22cb0b5ce1651ff9a0f01e32650980 | b89a599db48ddd098a7951ae7ad2d83450ebcecf | refs/heads/master | 2022-06-20T10:55:14.829371 | 2020-05-08T08:18:43 | 2020-05-08T08:18:43 | 261,990,856 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 542 | java | package ch3;
public class IfTest1 {
public static void main(String[] args) {
// 조건문 : 프로그램의 실행 흐름을 변경
// if(조건문) {
// 실행할 문장들;
// }
int score = 85;
if (score >= 90) {
System.out.println("성적이 우수합니다.");
}
int x = 0;
if (x == 0) {
System.out.println("x == 0");
}
if (x != 0) {
System.out.println("x != 0");
}
if (!(x == 0)) {
System.out.println("!(x == 0)");
}
if (!(x != 0)) {
System.out.println("!(x != 0)");
}
}
}
| [
"glglgl47@naver.com"
] | glglgl47@naver.com |
89323a3f4d607dced528418f926c35e57bd4b84e | 5f7866af6535d6fa27cb4cdc209b9d1afc7fbd7e | /src/com/massivecraft/massivecore/teleport/DestinationPlayer.java | 48e52dc0f5a704c30a6fc05aec5f4d70b1852cef | [] | no_license | ulumulu1510/MassiveCore | d62d0613266e4b04ac8144590bd781025aca4189 | 145a9e5054b0f9da1d24e87946a910c390f648af | refs/heads/master | 2020-12-26T00:18:14.241707 | 2017-02-23T21:38:37 | 2017-02-23T21:38:47 | 27,668,178 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | package com.massivecraft.massivecore.teleport;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.massivecraft.massivecore.mixin.MixinDisplayName;
import com.massivecraft.massivecore.mixin.MixinPlayed;
import com.massivecraft.massivecore.mixin.MixinSenderPs;
import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.util.IdUtil;
import com.massivecraft.massivecore.util.Txt;
public class DestinationPlayer extends DestinationAbstract
{
private static final long serialVersionUID = 1L;
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
protected String playerId;
public String getPlayerId() { return this.playerId; }
public void setPlayerId(String playerId) { this.playerId = playerId; }
public void setPlayer(Object playerObject) { this.playerId = IdUtil.getId(playerObject); }
public CommandSender getSender() { return IdUtil.getSender(this.playerId); }
public Player getPlayer() { return IdUtil.getPlayer(this.playerId); }
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
public DestinationPlayer(String playerId)
{
this.setPlayerId(playerId);
}
public DestinationPlayer(Object playerObject)
{
this.setPlayer(playerObject);
}
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public PS getPsInner()
{
return MixinSenderPs.get().getSenderPs(this.playerId);
}
@Override
public String getDesc(Object watcherObject)
{
return this.getDesc(watcherObject, true);
}
public String getDesc(Object watcherObject, boolean prefix)
{
String ret = "";
// Player Prefix
if (prefix)
{
ret += "Player ";
}
// Display Name
ret += MixinDisplayName.get().getDisplayName(this.getPlayerId(), watcherObject);
// Offline Suffix
if (MixinPlayed.get().isOffline(this.getPlayerId()))
{
ret += Txt.parse(" <b>[Offline]");
}
return ret;
}
}
| [
"olof@sylt.nu"
] | olof@sylt.nu |
b5e214fa469eba6a231e91b686c8095f50be0a54 | de81142345bc619e607eb59d4372e980b866f75b | /runningcoin-cs/src/main/java/club/runningcoin/web/rest/AccountResource.java | 593eccf2b4cfd7a7cd9c56fede43040797439339 | [] | no_license | artbite008/running_coin | 96a37ca9b530ef03db2558f306887c6e05660eb0 | c72b55e17d6c6646dea10c30c1cbb06e1a68b3a2 | refs/heads/master | 2020-03-10T07:07:18.465609 | 2019-04-29T12:49:47 | 2019-04-29T12:49:47 | 129,255,460 | 5 | 7 | null | 2018-04-28T08:50:11 | 2018-04-12T13:27:23 | Java | UTF-8 | Java | false | false | 7,537 | java | package club.runningcoin.web.rest;
import com.codahale.metrics.annotation.Timed;
import club.runningcoin.domain.User;
import club.runningcoin.repository.UserRepository;
import club.runningcoin.security.SecurityUtils;
import club.runningcoin.service.MailService;
import club.runningcoin.service.UserService;
import club.runningcoin.service.dto.UserDTO;
import club.runningcoin.web.rest.errors.*;
import club.runningcoin.web.rest.vm.KeyAndPasswordVM;
import club.runningcoin.web.rest.vm.ManagedUserVM;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import club.runningcoin.service.dto.PasswordChangeDTO;
import java.util.*;
/**
* REST controller for managing the current user's account.
*/
@RestController
@RequestMapping("/api")
public class AccountResource {
private final Logger log = LoggerFactory.getLogger(AccountResource.class);
private final UserRepository userRepository;
private final UserService userService;
private final MailService mailService;
public AccountResource(UserRepository userRepository, UserService userService, MailService mailService) {
this.userRepository = userRepository;
this.userService = userService;
this.mailService = mailService;
}
/**
* POST /register : register the user.
*
* @param managedUserVM the managed user View Model
* @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect
* @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used
* @throws LoginAlreadyUsedException 400 (Bad Request) if the login is already used
*/
@PostMapping("/register")
@Timed
@ResponseStatus(HttpStatus.CREATED)
public void registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {
if (!checkPasswordLength(managedUserVM.getPassword())) {
throw new InvalidPasswordException();
}
userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase()).ifPresent(u -> {throw new LoginAlreadyUsedException();});
userRepository.findOneByEmailIgnoreCase(managedUserVM.getEmail()).ifPresent(u -> {throw new EmailAlreadyUsedException();});
User user = userService.registerUser(managedUserVM, managedUserVM.getPassword());
mailService.sendActivationEmail(user);
}
/**
* GET /activate : activate the registered user.
*
* @param key the activation key
* @throws RuntimeException 500 (Internal Server Error) if the user couldn't be activated
*/
@GetMapping("/activate")
@Timed
public void activateAccount(@RequestParam(value = "key") String key) {
Optional<User> user = userService.activateRegistration(key);
if (!user.isPresent()) {
throw new InternalServerErrorException("No user was found for this activation key");
}
}
/**
* GET /authenticate : check if the user is authenticated, and return its login.
*
* @param request the HTTP request
* @return the login if the user is authenticated
*/
@GetMapping("/authenticate")
@Timed
public String isAuthenticated(HttpServletRequest request) {
log.debug("REST request to check if the current user is authenticated");
return request.getRemoteUser();
}
/**
* GET /account : get the current user.
*
* @return the current user
* @throws RuntimeException 500 (Internal Server Error) if the user couldn't be returned
*/
@GetMapping("/account")
@Timed
public UserDTO getAccount() {
return userService.getUserWithAuthorities()
.map(UserDTO::new)
.orElseThrow(() -> new InternalServerErrorException("User could not be found"));
}
/**
* POST /account : update the current user information.
*
* @param userDTO the current user information
* @throws EmailAlreadyUsedException 400 (Bad Request) if the email is already used
* @throws RuntimeException 500 (Internal Server Error) if the user login wasn't found
*/
@PostMapping("/account")
@Timed
public void saveAccount(@Valid @RequestBody UserDTO userDTO) {
final String userLogin = SecurityUtils.getCurrentUserLogin().orElseThrow(() -> new InternalServerErrorException("Current user login not found"));
Optional<User> existingUser = userRepository.findOneByEmailIgnoreCase(userDTO.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(userLogin))) {
throw new EmailAlreadyUsedException();
}
Optional<User> user = userRepository.findOneByLogin(userLogin);
if (!user.isPresent()) {
throw new InternalServerErrorException("User could not be found");
}
userService.updateUser(userDTO.getFirstName(), userDTO.getLastName(), userDTO.getEmail(),
userDTO.getLangKey(), userDTO.getImageUrl());
}
/**
* POST /account/change-password : changes the current user's password
*
* @param passwordChangeDto current and new password
* @throws InvalidPasswordException 400 (Bad Request) if the new password is incorrect
*/
@PostMapping(path = "/account/change-password")
@Timed
public void changePassword(@RequestBody PasswordChangeDTO passwordChangeDto) {
if (!checkPasswordLength(passwordChangeDto.getNewPassword())) {
throw new InvalidPasswordException();
}
userService.changePassword(passwordChangeDto.getCurrentPassword(), passwordChangeDto.getNewPassword());
}
/**
* POST /account/reset-password/init : Send an email to reset the password of the user
*
* @param mail the mail of the user
* @throws EmailNotFoundException 400 (Bad Request) if the email address is not registered
*/
@PostMapping(path = "/account/reset-password/init")
@Timed
public void requestPasswordReset(@RequestBody String mail) {
mailService.sendPasswordResetMail(
userService.requestPasswordReset(mail)
.orElseThrow(EmailNotFoundException::new)
);
}
/**
* POST /account/reset-password/finish : Finish to reset the password of the user
*
* @param keyAndPassword the generated key and the new password
* @throws InvalidPasswordException 400 (Bad Request) if the password is incorrect
* @throws RuntimeException 500 (Internal Server Error) if the password could not be reset
*/
@PostMapping(path = "/account/reset-password/finish")
@Timed
public void finishPasswordReset(@RequestBody KeyAndPasswordVM keyAndPassword) {
if (!checkPasswordLength(keyAndPassword.getNewPassword())) {
throw new InvalidPasswordException();
}
Optional<User> user =
userService.completePasswordReset(keyAndPassword.getNewPassword(), keyAndPassword.getKey());
if (!user.isPresent()) {
throw new InternalServerErrorException("No user was found for this reset key");
}
}
private static boolean checkPasswordLength(String password) {
return !StringUtils.isEmpty(password) &&
password.length() >= ManagedUserVM.PASSWORD_MIN_LENGTH &&
password.length() <= ManagedUserVM.PASSWORD_MAX_LENGTH;
}
}
| [
"964999133@qq.com"
] | 964999133@qq.com |
99358021758d8bbca3c581e18acf29139bec2a44 | 83e0a61589395877822df28a56b9099fdcbd636a | /deploy/src/com/android/tools/idea/run/tasks/StartLiveUpdateMonitoringTask.java | b9ff8ee1148d1dcb752f67659bd174c7d2e4adde | [
"Apache-2.0"
] | permissive | jbeckers/android | 1ce4e9c33490e3f91299ad70cace70f17569314f | b69d0674223461ac2129f762110d121205999ee1 | refs/heads/master | 2023-03-17T01:54:41.955844 | 2023-02-14T15:52:19 | 2023-02-15T10:16:53 | 62,634,667 | 0 | 0 | null | 2019-06-04T05:36:09 | 2016-07-05T12:22:35 | Java | UTF-8 | Java | false | false | 2,049 | java | /*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.tools.idea.run.tasks;
import com.android.annotations.Nullable;
import com.intellij.openapi.diagnostic.Logger;
import java.util.concurrent.Callable;
import org.jetbrains.annotations.NotNull;
public class StartLiveUpdateMonitoringTask implements LaunchTask {
private static final String ID = "LIVE_UPDATE_MONITORING";
@Nullable private final Callable<?> myStartLiveUpdate;
public StartLiveUpdateMonitoringTask(@Nullable Callable<?> startLiveUpdate) {
myStartLiveUpdate = startLiveUpdate;
}
@Override
public @NotNull String getDescription() {
// This task only start LL under the right conditions so lets not
// lets not mention anything about LL on the status because
// users might not expect it in non-compose related projects.
return "";
}
@Override
public int getDuration() {
return 1;
}
@Override
public LaunchResult run(@NotNull LaunchContext launchContext) {
if (myStartLiveUpdate != null) {
try {
myStartLiveUpdate.call();
}
catch (Exception e) {
// TODO: better error handling and decide what to do with the remainder of the launch
Logger.getInstance(StartLiveUpdateMonitoringTask.class).warn("Error starting live edit", e);
}
}
// Monitoring should always successfully starts.
return LaunchResult.success();
}
@Override
public @NotNull String getId() {
return ID;
}
}
| [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
65b094e87b15c71b905d8afb54de9b4b4fa71de5 | 9e4f6638f3d20fb88a6d6c3c21d67607a209de18 | /src/org/nutz/ngqa/service/QuestionManageServiceImpl.java | 8272807088e1f9b7439cb149be9bc56eba40c537 | [] | no_license | Rekoe/ngqa | b12641688933427cd8c88eb839a27973aec46e75 | 0f76811f182589d359943731f5cd36d4adf75fb9 | refs/heads/master | 2021-01-23T22:06:30.004913 | 2012-02-21T09:13:44 | 2012-02-21T09:13:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package org.nutz.ngqa.service;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.mongo.MongoDao;
import org.nutz.mongo.util.MCur;
import org.nutz.ngqa.api.QuestionManageService;
import org.nutz.ngqa.api.meta.Pager;
import org.nutz.ngqa.api.meta.QuestionQuery;
import org.nutz.ngqa.bean.Answer;
import org.nutz.ngqa.bean.Question;
import org.nutz.ngqa.bean.User;
@IocBean(name="questionMS") //名字有点长,所以没用默认的名字,自己起一个
public class QuestionManageServiceImpl implements QuestionManageService {
/**核心查询方法,通用查询*/
public Pager<Question> query(QuestionQuery query) {
if (query == null)
query = new QuestionQuery();
MCur cur = MCur.DESC("updatedAt");
cur.skip(query.skip()).limit(query.limit());
Pager<Question> pager = new Pager<Question>();
pager.setCount(dao.count(Question.class, query.q));
pager.setPage(query.page);
pager.setPageSize(query.pageSize);
pager.setData(dao.find(Question.class, query.q, cur));
return pager;
}
@Inject("java:$commons.dao()")
private MongoDao dao;
@Override
public Question create(Question question) {
throw Lang.noImplement(); //未实现的方法,这语句最方便了
}
@Override
public void markDeleted(Question question) {
throw Lang.noImplement();
}
@Override
public Question addAnswer(Question question, Answer answer) {
throw Lang.noImplement();
}
@Override
public void watch(Question question, User user) {
throw Lang.noImplement();
}
@Override
public void unwatch(Question question, User user) {
throw Lang.noImplement();
}
}
| [
"wendal1985@gmail.com"
] | wendal1985@gmail.com |
a95d81867669b54b0a86de126b2de80501ede4df | e111147549097d4ee7a6a83e81f29defd6e5e35c | /timetable-management-system/core/src/main/java/org/vdragun/tms/core/application/exception/ResourceNotFoundException.java | 10625b5d92fb627ae9a8cc8cf2e1ba4d0bb8f439 | [] | no_license | VitaliyDragun1990/TMS | 6039a15afaa8ad3dbbbc6282fbaa96f210559d31 | 7414aad113d27feae7b10edac98c38d58e7c4894 | refs/heads/master | 2022-12-23T10:32:32.478567 | 2020-10-04T11:33:27 | 2020-10-04T11:33:27 | 301,111,321 | 0 | 0 | null | 2020-10-04T11:33:28 | 2020-10-04T11:23:34 | Java | UTF-8 | Java | false | false | 600 | java | package org.vdragun.tms.core.application.exception;
/**
* Signals that request resource can not be found
*
* @author Vitaliy Dragun
*
*/
public class ResourceNotFoundException extends ApplicationException {
private static final long serialVersionUID = 4930025280469096688L;
private final Class<?> resourceClass;
public ResourceNotFoundException(Class<?> resourceClass, String message, Object... args) {
super(String.format(message, args));
this.resourceClass = resourceClass;
}
public Class<?> getResourceClass() {
return resourceClass;
}
}
| [
"vdrag00n90@gmail.com"
] | vdrag00n90@gmail.com |
0791245204b33814e48aef602a0e7f2cf286da3c | 51cf893b29e0025e86efc571a0b20fbbec43f744 | /LuBanOne/app/src/main/java/com/example/administrator/lubanone/bean/message/TrainMessageResultBean.java | 39f1021138bfa861d9ca67af0be5cffb8dfc01ea | [] | no_license | quyang-xianzaishi/mylib | 1dfc3c141347a8eee5ad831efab5e18fb9d9f726 | 4cabe396090d820a58e6917f16e57a69cc6485b9 | refs/heads/master | 2018-09-29T16:19:05.253246 | 2018-07-15T15:52:46 | 2018-07-15T15:52:46 | 111,664,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package com.example.administrator.lubanone.bean.message;
import java.util.List;
/**
* Created by Administrator on 2017\8\9 0009.
*/
public class TrainMessageResultBean {
private List<TrainMessageBean> data;
public List<TrainMessageBean> getData() {
return data;
}
public void setData(
List<TrainMessageBean> data) {
this.data = data;
}
}
| [
"quyang@xianzaishi.com"
] | quyang@xianzaishi.com |
f13a55c9dd521fac073e4dc81a19a40d70a0aff6 | 329b2cb3c91a0c953458efd253c4fcdce6f539c4 | /graphsdk/src/main/java/com/microsoft/graph/generated/BaseWorkbookFunctionsAmorLincRequest.java | 397a348337f5adebd59df15218efd16fe34716f9 | [
"MIT"
] | permissive | sbolotovms/msgraph-sdk-android | 255eeddf19c1b15f04ee3b1549f0cae70d561fdd | 1320795ba1c0b5eb36ef8252b73799d15fc46ba1 | refs/heads/master | 2021-01-20T05:09:00.148739 | 2017-04-28T23:20:23 | 2017-04-28T23:20:23 | 89,751,501 | 1 | 0 | null | 2017-04-28T23:20:37 | 2017-04-28T23:20:37 | null | UTF-8 | Java | false | false | 2,794 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.generated;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.extensions.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.List;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Base Workbook Functions Amor Linc Request.
*/
public class BaseWorkbookFunctionsAmorLincRequest extends BaseRequest implements IBaseWorkbookFunctionsAmorLincRequest {
protected final WorkbookFunctionsAmorLincBody mBody;
/**
* The request for this WorkbookFunctionsAmorLinc
*
* @param requestUrl The request url
* @param client The service client
* @param requestOptions The options for this request
*/
public BaseWorkbookFunctionsAmorLincRequest(final String requestUrl, final IBaseClient client, final List<Option> requestOptions) {
super(requestUrl, client, requestOptions, WorkbookFunctionResult.class);
mBody = new WorkbookFunctionsAmorLincBody();
}
public void post(final ICallback<WorkbookFunctionResult> callback) {
send(HttpMethod.POST, callback, mBody);
}
public WorkbookFunctionResult post() throws ClientException {
return send(HttpMethod.POST, mBody);
}
/**
* Sets the select clause for the request
*
* @param value The select clause
* @return The updated request
*/
public IWorkbookFunctionsAmorLincRequest select(final String value) {
getQueryOptions().add(new QueryOption("$select", value));
return (WorkbookFunctionsAmorLincRequest)this;
}
/**
* Sets the top value for the request
*
* @param value The max number of items to return
* @return The updated request
*/
public IWorkbookFunctionsAmorLincRequest top(final int value) {
getQueryOptions().add(new QueryOption("$top", value+""));
return (WorkbookFunctionsAmorLincRequest)this;
}
/**
* Sets the expand clause for the request
*
* @param value The expand clause
* @return The updated request
*/
public IWorkbookFunctionsAmorLincRequest expand(final String value) {
getQueryOptions().add(new QueryOption("$expand", value));
return (WorkbookFunctionsAmorLincRequest)this;
}
}
| [
"brianmel@microsoft.com"
] | brianmel@microsoft.com |
3f33a0359e15a1555e2aae13886f8ef2fb1590ff | f7fbc015359f7e2a7bae421918636b608ea4cef6 | /base-one/tags/hsqldb_1_7_2_RC_4/src/org/hsqldb/lib/AsciiStringInputStream.java | 82a5d569a26be38e3867a28dfa257211b7628ab9 | [] | no_license | svn2github/hsqldb | cdb363112cbdb9924c816811577586f0bf8aba90 | 52c703b4d54483899d834b1c23c1de7173558458 | refs/heads/master | 2023-09-03T10:33:34.963710 | 2019-01-18T23:07:40 | 2019-01-18T23:07:40 | 155,365,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,112 | java | /* Copyright (c) 2001-2004, The HSQL Development Group
* 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 HSQL Development Group 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 HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hsqldb.lib;
import java.io.IOException;
/**
* minimal InputStream subclass to fetch low order bytes form a String
*
* @author fredt@users
* @version 1.7.0
*/
public class AsciiStringInputStream extends StringInputStream {
public AsciiStringInputStream(String s) {
super(s);
}
public int read() throws java.io.IOException {
super.read();
return super.read();
}
public int available() throws IOException {
return available / 2;
}
}
| [
"(no author)@7c7dc5f5-a22d-0410-a3af-b41755a11667"
] | (no author)@7c7dc5f5-a22d-0410-a3af-b41755a11667 |
57205685693d37d948203e2bbacedbbe81fbbf47 | 49d567a7c51da3ad6bdf45acfcfd14e8656bf621 | /src/main/java/SearchInsertPosition.java | 7cdb7c6821c66f65430c11d7a54845c707fe84ea | [] | no_license | nassimbg/Problems | 8528c05c3f47996f045eb8bf4d1a56271e04de45 | 6c0fb58ae46e66bce6537ea606b6677d2f1ba399 | refs/heads/master | 2021-06-06T09:04:51.633473 | 2021-03-10T10:01:36 | 2021-03-10T10:01:36 | 93,439,590 | 0 | 1 | null | 2020-11-15T11:37:57 | 2017-06-05T19:37:27 | Java | UTF-8 | Java | false | false | 451 | java | public class SearchInsertPosition {
public static int searchInsert(int[] nums, int target) {
int start = 0;
int last = nums.length - 1;
while (start <= last) {
int mid = (start + last)/2;
if (nums[mid] == target) {
return mid;
}
if (nums[mid] < target) {
start = mid +1;
} else {
last = mid - 1;
}
}
return start;
}
}
| [
"nassimboughannam@gmail.com"
] | nassimboughannam@gmail.com |
5e2edb34f40d658b5758b55ab586a0586b33fc8a | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/selected/2039681.java | 8824dac3e3e720665703d20ba43d0a5b94530b57 | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,218 | java | package project.util;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
private static String convertToHex(byte[] data) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < data.length; i++) {
int halfbyte = (data[i] >>> 4) & 0x0F;
int two_halfs = 0;
do {
if ((0 <= halfbyte) && (halfbyte <= 9)) buf.append((char) ('0' + halfbyte)); else buf.append((char) ('a' + (halfbyte - 10)));
halfbyte = data[i] & 0x0F;
} while (two_halfs++ < 1);
}
return buf.toString();
}
public static String getHashCode(String text) throws UnsupportedEncodingException, NoSuchAlgorithmException {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("UTF-8"), 0, text.length());
md5hash = md.digest();
return convertToHex(md5hash);
}
public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException {
System.out.println(getHashCode("123"));
}
}
| [
"aaponcseku@gmail.com"
] | aaponcseku@gmail.com |
34ce4181907651905ce5a184d81c3ff355075d5b | df89551a8aadbc7aa315289b0af3fdca0185c26a | /released/MyBox/src/main/java/mara/mybox/controller/DataFileCSVMergeController.java | e4a477de4789c55188ff7281c5b93c84163e94ee | [
"Apache-2.0"
] | permissive | Mararsh/MyBox | 90fea7bce7585798b5f490a2475082182f4c41ff | a33bd7408bc17645440215e87a34967aadde14e9 | refs/heads/master | 2023-08-17T18:57:20.659974 | 2023-08-17T13:14:20 | 2023-08-17T13:14:20 | 136,999,014 | 132 | 23 | Apache-2.0 | 2023-05-07T11:30:57 | 2018-06-12T01:12:24 | Java | UTF-8 | Java | false | false | 6,467 | java | package mara.mybox.controller;
import java.io.File;
import java.io.FileWriter;
import java.nio.charset.Charset;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;
import javafx.beans.binding.Bindings;
import javafx.fxml.FXML;
import mara.mybox.db.DerbyBase;
import mara.mybox.db.data.Data2DDefinition;
import mara.mybox.db.data.VisitHistory;
import mara.mybox.db.table.TableData2DDefinition;
import mara.mybox.dev.MyBoxLog;
import mara.mybox.tools.CsvTools;
import mara.mybox.tools.FileTools;
import mara.mybox.tools.TextFileTools;
import mara.mybox.value.Languages;
import static mara.mybox.value.Languages.message;
import mara.mybox.value.UserConfig;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.csv.CSVRecord;
/**
* @Author Mara
* @CreateDate 2021-2-13
* @License Apache License Version 2.0
*/
public class DataFileCSVMergeController extends FilesMergeController {
protected CSVFormat sourceFormat, targetFormat;
protected Charset sourceCharset, targetCharset;
protected CSVPrinter csvPrinter;
protected List<String> headers;
protected boolean sourceWithName, targetWithName;
@FXML
protected ControlTextOptions csvSourceController, csvTargetController;
public DataFileCSVMergeController() {
baseTitle = Languages.message("CsvMerge");
}
@Override
public void setFileType() {
setFileType(VisitHistory.FileType.CSV);
}
@Override
public void initControls() {
try {
super.initControls();
startButton.disableProperty().unbind();
startButton.disableProperty().bind(Bindings.isEmpty(tableData)
.or(targetFileController.valid.not())
.or(csvSourceController.delimiterController.delimiterInput.styleProperty().isEqualTo(UserConfig.badStyle()))
.or(csvTargetController.delimiterController.delimiterInput.styleProperty().isEqualTo(UserConfig.badStyle()))
);
} catch (Exception e) {
MyBoxLog.error(e);
}
}
@Override
public void initOptionsSection() {
try {
csvSourceController.setControls(baseName + "Source", true, false);
csvTargetController.setControls(baseName + "Target", false, false);
} catch (Exception e) {
MyBoxLog.error(e);
}
}
@Override
protected boolean openWriter() {
try {
if (csvSourceController.delimiterController.delimiterInput.getStyle().equals(UserConfig.badStyle())
|| (!csvSourceController.autoDetermine && csvSourceController.charset == null)) {
return false;
}
sourceCharset = csvSourceController.charset;
sourceWithName = csvSourceController.withNamesCheck.isSelected();
sourceFormat = CsvTools.csvFormat(csvSourceController.getDelimiterName(), sourceWithName);
targetCharset = csvTargetController.charset;
targetWithName = csvTargetController.withNamesCheck.isSelected();
targetFormat = CsvTools.csvFormat(csvTargetController.getDelimiterName(), targetWithName);
csvPrinter = new CSVPrinter(new FileWriter(targetFile, targetCharset), targetFormat);
headers = null;
return true;
} catch (Exception e) {
return false;
}
}
@Override
public String handleFile(File srcFile) {
if (csvSourceController.autoDetermine) {
sourceCharset = TextFileTools.charset(srcFile);
}
String result;
File validFile = FileTools.removeBOM(srcFile);
try ( CSVParser parser = CSVParser.parse(validFile, sourceCharset, sourceFormat)) {
if (headers == null && targetWithName && sourceWithName) {
headers = new ArrayList<>();
headers.addAll(parser.getHeaderNames());
csvPrinter.printRecord(headers);
}
List<String> rowData = new ArrayList<>();
for (CSVRecord record : parser) {
if (task == null || task.isCancelled()) {
return message("Cancelled");
}
for (int i = 0; i < record.size(); i++) {
rowData.add(record.get(i));
}
if (headers == null && targetWithName) {
headers = new ArrayList<>();
for (int i = 0; i < rowData.size(); i++) {
headers.add(Languages.message("Column") + i);
}
csvPrinter.printRecord(headers);
}
csvPrinter.printRecord(rowData);
rowData.clear();
}
result = Languages.message("Handled") + ": " + srcFile;
} catch (Exception e) {
result = srcFile + " " + e.toString();
}
return result;
}
@Override
protected boolean closeWriter() {
try {
csvPrinter.flush();
csvPrinter.close();
try ( Connection conn = DerbyBase.getConnection()) {
TableData2DDefinition tableData2DDefinition = new TableData2DDefinition();
Data2DDefinition def = tableData2DDefinition.queryFile(conn, Data2DDefinition.Type.CSV, targetFile);
if (def == null) {
def = Data2DDefinition.create();
}
def.setType(Data2DDefinition.Type.CSV)
.setFile(targetFile)
.setDataName(targetFile.getName())
.setCharset(targetCharset)
.setHasHeader(csvTargetController.withNamesCheck.isSelected())
.setDelimiter(csvTargetController.getDelimiterName());
if (def.getD2did() < 0) {
tableData2DDefinition.insertData(conn, def);
} else {
tableData2DDefinition.updateData(conn, def);
}
conn.commit();
} catch (Exception e) {
updateLogs(e.toString(), true, true);
return false;
}
return true;
} catch (Exception e) {
updateLogs(e.toString(), true, true);
return false;
}
}
}
| [
"rshmara@sina.com"
] | rshmara@sina.com |
614f7a0b6f96ff49ebca40ddae0e7a56cd6ead2c | d71e879b3517cf4fccde29f7bf82cff69856cfcd | /ExtractedJars/LibriVox_app.librivox.android/javafiles/com/google/android/gms/internal/ads/acj.java | b0bdb76cb8d5adda9a968057d04b043e4c6ab99e | [
"MIT"
] | permissive | Andreas237/AndroidPolicyAutomation | b8e949e072d08cf6c6166c3f15c9c63379b8f6ce | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | refs/heads/master | 2020-04-10T02:14:08.789751 | 2019-05-16T19:29:11 | 2019-05-16T19:29:11 | 160,739,088 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package com.google.android.gms.internal.ads;
// Referenced classes of package com.google.android.gms.internal.ads:
// aca, acl
final class acj
implements Runnable
{
acj(aca aca1)
{
a = aca1;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #12 <Field aca a>
super();
// 3 5:aload_0
// 4 6:invokespecial #15 <Method void Object()>
// 5 9:return
}
public final void run()
{
if(aca.a(a) != null)
//* 0 0:aload_0
//* 1 1:getfield #12 <Field aca a>
//* 2 4:invokestatic #22 <Method acl aca.a(aca)>
//* 3 7:ifnull 22
aca.a(a).c();
// 4 10:aload_0
// 5 11:getfield #12 <Field aca a>
// 6 14:invokestatic #22 <Method acl aca.a(aca)>
// 7 17:invokeinterface #27 <Method void acl.c()>
// 8 22:return
}
private final aca a;
}
| [
"silenta237@gmail.com"
] | silenta237@gmail.com |
b8d4d1ded92590a426f410ac43a3b3b7ad9cd35c | 7ee02c9ba2f22eadac01d4a60022d6e0fb66d6aa | /src/main/java/io/ruin/model/item/actions/impl/scrolls/boosts/BonusExpScroll.java | e4008d97be03e6398d9e783d76104ccbb1d777a5 | [] | no_license | Dmm-PS/os-fatality-184-runesuite | 1e5bbf3b9adc0e29132ee8c6131fbed0829fe58e | 655799fc3c56432055d91942a77992fd46bd2930 | refs/heads/master | 2022-07-26T02:15:42.725068 | 2020-05-24T21:20:03 | 2020-05-24T21:20:03 | 266,625,076 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,682 | java | package io.ruin.model.item.actions.impl.scrolls.boosts;
import io.ruin.model.entity.shared.listeners.LoginListener;
import io.ruin.model.inter.dialogue.ItemDialogue;
import io.ruin.model.inter.dialogue.MessageDialogue;
import io.ruin.model.inter.dialogue.OptionsDialogue;
import io.ruin.model.inter.utils.Option;
import io.ruin.model.item.actions.ItemAction;
public class BonusExpScroll {
private static final int BONUS_EXP_SCROLL = 6758;
static {
ItemAction.registerInventory(BONUS_EXP_SCROLL, "activate", (player, item) -> {
if(player.expBonus.isDelayed()) {
player.dialogue(new MessageDialogue("You already have an experience boost activated!"));
return;
}
player.dialogue(new MessageDialogue("Experience boost will be finished upon logging out"));
player.dialogue(new OptionsDialogue("Are you sure you want to active your scroll?",
new Option("Yes, active my experience boost scroll!", () -> {
item.remove();
player.expBonus.delaySeconds(60 * 60);
player.dialogue(new ItemDialogue().one(item.getId(), "You have activated your experience boost scroll. Your experience " +
"will be boosted by 100% for the next 60 minutes."));
}),
new Option("No, I'm not ready yet!")));
});
LoginListener.register(player -> {
if (player.expBonusTimeLeft > 0) {
player.expBonus.delay(player.expBonusTimeLeft);
player.expBonusTimeLeft = 0;
}
});
}
}
| [
"tardisfan121@gmail.com"
] | tardisfan121@gmail.com |
dd6bd4d077ea93d992d8c20f2d2a85356ee06561 | dd3821e321069670792065b79ce698ffa06a001f | /fhir/src/main/java/org/dhis2/fhir/adapter/fhir/transform/dhis/impl/program/DhisToFhirProgramStageRequestResolver.java | 6e973eb3b61156e4f30633fd6c42628eba8e9f18 | [
"BSD-3-Clause"
] | permissive | ArtBryanMoldon/dhis2-fhir-adapter | 214313477abf444e3d33138112d1fa0a2358a5b3 | 0342f3ef9d27c4ec080973f7ee5d46ddbede85c9 | refs/heads/master | 2020-04-16T13:00:02.382737 | 2019-01-10T08:28:19 | 2019-01-10T08:28:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,673 | java | package org.dhis2.fhir.adapter.fhir.transform.dhis.impl.program;
/*
* Copyright (c) 2004-2018, University of Oslo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* Neither the name of the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import org.dhis2.fhir.adapter.dhis.converter.ValueConverter;
import org.dhis2.fhir.adapter.dhis.model.DhisResource;
import org.dhis2.fhir.adapter.dhis.model.DhisResourceType;
import org.dhis2.fhir.adapter.dhis.model.Reference;
import org.dhis2.fhir.adapter.dhis.model.ReferenceType;
import org.dhis2.fhir.adapter.dhis.tracker.program.Event;
import org.dhis2.fhir.adapter.dhis.tracker.program.Program;
import org.dhis2.fhir.adapter.dhis.tracker.program.ProgramMetadataService;
import org.dhis2.fhir.adapter.dhis.tracker.program.ProgramStage;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityAttributes;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityInstance;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityMetadataService;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityService;
import org.dhis2.fhir.adapter.dhis.tracker.trackedentity.TrackedEntityType;
import org.dhis2.fhir.adapter.fhir.metadata.model.AbstractRule;
import org.dhis2.fhir.adapter.fhir.metadata.model.RuleInfo;
import org.dhis2.fhir.adapter.fhir.metadata.repository.FhirServerRepository;
import org.dhis2.fhir.adapter.fhir.metadata.repository.ProgramStageRuleRepository;
import org.dhis2.fhir.adapter.fhir.transform.TransformerDataException;
import org.dhis2.fhir.adapter.fhir.transform.dhis.impl.AbstractDhisToFhirRequestResolver;
import org.dhis2.fhir.adapter.fhir.transform.dhis.impl.DhisToFhirRequestResolver;
import org.dhis2.fhir.adapter.fhir.transform.scripted.ImmutableScriptedEvent;
import org.dhis2.fhir.adapter.fhir.transform.scripted.ImmutableScriptedTrackedEntityInstance;
import org.dhis2.fhir.adapter.fhir.transform.scripted.ScriptedDhisResource;
import org.dhis2.fhir.adapter.fhir.transform.scripted.ScriptedEvent;
import org.dhis2.fhir.adapter.fhir.transform.scripted.ScriptedTrackedEntityInstance;
import org.dhis2.fhir.adapter.fhir.transform.scripted.WritableScriptedEvent;
import org.dhis2.fhir.adapter.fhir.transform.scripted.WritableScriptedTrackedEntityInstance;
import org.springframework.stereotype.Component;
import javax.annotation.Nonnull;
import java.util.List;
import java.util.stream.Collectors;
/**
* Implementation of {@link DhisToFhirRequestResolver} for program stage based events.
*
* @author volsch
*/
@Component
public class DhisToFhirProgramStageRequestResolver extends AbstractDhisToFhirRequestResolver
{
private final ProgramMetadataService programMetadataService;
private final ProgramStageRuleRepository ruleRepository;
private final TrackedEntityService trackedEntityService;
private final TrackedEntityMetadataService trackedEntityMetadataService;
private final ValueConverter valueConverter;
public DhisToFhirProgramStageRequestResolver(
@Nonnull FhirServerRepository fhirServerRepository,
@Nonnull ProgramMetadataService programMetadataService,
@Nonnull ProgramStageRuleRepository ruleRepository,
@Nonnull TrackedEntityService trackedEntityService,
@Nonnull TrackedEntityMetadataService trackedEntityMetadataService,
@Nonnull ValueConverter valueConverter )
{
super( fhirServerRepository );
this.programMetadataService = programMetadataService;
this.ruleRepository = ruleRepository;
this.trackedEntityService = trackedEntityService;
this.trackedEntityMetadataService = trackedEntityMetadataService;
this.valueConverter = valueConverter;
}
@Nonnull
@Override
public DhisResourceType getDhisResourceType()
{
return DhisResourceType.PROGRAM_STAGE_EVENT;
}
@Nonnull
@Override
public List<RuleInfo<? extends AbstractRule>> resolveRules( @Nonnull ScriptedDhisResource dhisResource )
{
final ScriptedEvent event = (ScriptedEvent) dhisResource;
return ruleRepository.findAllExp( event.getProgram().getAllReferences(), event.getProgramStage().getAllReferences(), null ).stream()
.sorted().collect( Collectors.toList() );
}
@Nonnull
@Override
public ScriptedDhisResource convert( @Nonnull DhisResource dhisResource )
{
final Event event = (Event) dhisResource;
final TrackedEntityInstance tei = trackedEntityService.findOneById( event.getTrackedEntityInstanceId() )
.orElseThrow( () -> new TransformerDataException( "Tracked entity instance " + event.getTrackedEntityInstanceId() +
" of event " + event.getId() + " could not be found." ) );
final TrackedEntityType trackedEntityType = trackedEntityMetadataService.findTypeByReference( new Reference( tei.getTypeId(), ReferenceType.ID ) )
.orElseThrow( () -> new TransformerDataException( "Tracked entity type " + tei.getTypeId() + " of tracked entity instance " +
tei.getId() + " could not be found." ) );
final TrackedEntityAttributes trackedEntityAttributes = trackedEntityMetadataService.getAttributes();
final ScriptedTrackedEntityInstance scriptedTrackedEntityInstance = new ImmutableScriptedTrackedEntityInstance(
new WritableScriptedTrackedEntityInstance( trackedEntityAttributes, trackedEntityType, tei, valueConverter ) );
final Program program = programMetadataService.findProgramByReference( new Reference( event.getProgramId(), ReferenceType.ID ) )
.orElseThrow( () -> new TransformerDataException( "Program " + event.getProgramId() + " of event " + event.getId() + " could not be found." ) );
final ProgramStage programStage = program.getOptionalStage( new Reference( event.getProgramStageId(), ReferenceType.ID ) )
.orElseThrow( () -> new TransformerDataException( "Program stage " + event.getProgramStageId() + " of event " + event.getId() +
" could not be found as part of program " + event.getProgramId() + "." ) );
return new ImmutableScriptedEvent( new WritableScriptedEvent( program, programStage, event,
scriptedTrackedEntityInstance, valueConverter ) );
}
}
| [
"volker@volsch.eu"
] | volker@volsch.eu |
efa61b0e5ed72b0d84739f0488f79c27f441b7fb | 6ca44b23aa242ee098b3ec2edb47738098cf062b | /src/main/java/com/proofpoint/event/collector/Uploader.java | c7bb378596595dc4f221fa989c3a1a4b00e5ab87 | [
"Apache-2.0"
] | permissive | strategist922/event-collector | e2988a5db2abb0a13b88a5a736ce345a5ac157e0 | 727e3c69c9ebb1e832b5adc7f866a60c82fa694b | refs/heads/master | 2021-01-17T07:31:13.841166 | 2012-10-24T17:34:05 | 2012-10-24T17:34:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | /*
* Copyright 2011 Proofpoint, 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.proofpoint.event.collector;
import java.io.File;
public interface Uploader
{
File generateNextFilename();
void enqueueUpload(EventPartition partition, File file);
}
| [
"david@acz.org"
] | david@acz.org |
c5b0557b469714685e7d28fbb5ae0339429c7612 | dbad3213f6544564d580932e20dca31c7c1943da | /src/org/apache/tomcat/util/http/HttpMessages.java | c59b032b3a4bbbff6b519bd2bf3c47b67404e714 | [] | no_license | Lyon1994/MyTomcatServerApp | 0ef3db59bc3bc0ecdbd35e4d616ca75d082420be | 37304fdfa03a7d03f119ae7eaa54f13539021b50 | refs/heads/master | 2021-01-19T03:19:02.243034 | 2015-07-28T06:21:44 | 2015-07-28T06:58:51 | 39,816,568 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,051 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.tomcat.util.http;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.tomcat.util.res.StringManager;
/**
* Handle (internationalized) HTTP messages.
*
* @author James Duncan Davidson [duncan@eng.sun.com]
* @author James Todd [gonzo@eng.sun.com]
* @author Jason Hunter [jch@eng.sun.com]
* @author Harish Prabandham
* @author costin@eng.sun.com
*/
public class HttpMessages {
private static final Map<Locale,HttpMessages> instances =
new ConcurrentHashMap<>();
private static final HttpMessages DEFAULT = new HttpMessages(
StringManager.getManager("org.apache.tomcat.util.http.res",
Locale.getDefault()));
// XXX move message resources in this package
private final StringManager sm;
private String st_200 = null;
private String st_302 = null;
private String st_400 = null;
private String st_404 = null;
private HttpMessages(StringManager sm) {
this.sm = sm;
}
/** Get the status string associated with a status code.
* No I18N - return the messages defined in the HTTP spec.
* ( the user isn't supposed to see them, this is the last
* thing to translate)
*
* Common messages are cached.
*
*/
public String getMessage(int status) {
// method from Response.
// Does HTTP requires/allow international messages or
// are pre-defined? The user doesn't see them most of the time
switch( status ) {
case 200:
if(st_200 == null ) {
st_200 = sm.getString("sc.200");
}
return st_200;
case 302:
if(st_302 == null ) {
st_302 = sm.getString("sc.302");
}
return st_302;
case 400:
if(st_400 == null ) {
st_400 = sm.getString("sc.400");
}
return st_400;
case 404:
if(st_404 == null ) {
st_404 = sm.getString("sc.404");
}
return st_404;
}
return sm.getString("sc."+ status);
}
public static HttpMessages getInstance(Locale locale) {
HttpMessages result = instances.get(locale);
if (result == null) {
StringManager sm = StringManager.getManager(
"org.apache.tomcat.util.http.res", locale);
if (Locale.getDefault().equals(sm.getLocale())) {
result = DEFAULT;
} else {
result = new HttpMessages(sm);
}
instances.put(locale, result);
}
return result;
}
/**
* Filter the specified message string for characters that are sensitive
* in HTML. This avoids potential attacks caused by including JavaScript
* codes in the request URL that is often reported in error messages.
*
* @param message The message string to be filtered
*/
public static String filter(String message) {
if (message == null) {
return (null);
}
char content[] = new char[message.length()];
message.getChars(0, message.length(), content, 0);
StringBuilder result = new StringBuilder(content.length + 50);
for (int i = 0; i < content.length; i++) {
switch (content[i]) {
case '<':
result.append("<");
break;
case '>':
result.append(">");
break;
case '&':
result.append("&");
break;
case '"':
result.append(""");
break;
default:
result.append(content[i]);
}
}
return (result.toString());
}
/**
* Is the provided message safe to use in an HTTP header. Safe messages must
* meet the requirements of RFC2616 - i.e. must consist only of TEXT.
*
* @param msg The message to test
* @return <code>true</code> if the message is safe to use in an HTTP
* header else <code>false</code>
*/
public static boolean isSafeInHttpHeader(String msg) {
// Nulls are fine. It is up to the calling code to address any NPE
// concerns
if (msg == null) {
return true;
}
// Reason-Phrase is defined as *<TEXT, excluding CR, LF>
// TEXT is defined as any OCTET except CTLs, but including LWS
// OCTET is defined as an 8-bit sequence of data
// CTL is defined as octets 0-31 and 127
// LWS, if we exclude CR LF pairs, is defined as SP or HT (32, 9)
final int len = msg.length();
for (int i = 0; i < len; i++) {
char c = msg.charAt(i);
if (32 <= c && c <= 126 || 128 <= c && c <= 255 || c == 9) {
continue;
}
return false;
}
return true;
}
}
| [
"765211630@qq.com"
] | 765211630@qq.com |
e69a47e697524affebfd4d2de431b207c2707b76 | 4a1773d1d68f69a383ce44fd3d1342d76ef3bb59 | /swg-acs-application/cwmp-servlet/src/main/java/com/swg/acs/web/DummyAcsServlet.java | 88fc413d004f9a34003d27aec2a13cc746194960 | [] | no_license | swg-corp/swg-acs | ae74593b9996d3138c7a4cd5312cfe905550a3d4 | 9a2cdf5e87d718ca151ca6409f963309790277f7 | refs/heads/master | 2021-01-15T18:26:25.548637 | 2012-07-06T15:39:17 | 2012-07-06T15:39:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | /**
*
*/
package com.swg.acs.web;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import com.swg.acs.Message;
import com.swg.acs.message.GetRPCMethodsResponse;
import com.swg.acs.message.soap.CwmpMessageBuilder;
import com.swg.acs.message.soap.SoapUtil;
/**
* @author satriaprayoga
*
*/
public class DummyAcsServlet extends AcsServlet{
private static final long serialVersionUID = 1L;
@Override
protected void process(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
MessageFactory mf=null;
try {
mf=MessageFactory.newInstance();
SOAPMessage message=mf.createMessage(null, req.getInputStream());
String requestName=SoapUtil.getInstance().getRequestName(message);
logger.info("Accepting soap request: "+requestName);
if(requestName.equals("GetRPCMethods")){
Message respons=new GetRPCMethodsResponse();
resp.setContentType("text/xml");
resp.setStatus(HttpServletResponse.SC_OK);
SOAPMessage reply=CwmpMessageBuilder.getSoapMessageBuilderInstance().build(respons);
reply.writeTo(resp.getOutputStream());
}
} catch (SOAPException e) {
e.printStackTrace();
}
}
}
| [
"satria.prayoga@gmail.com"
] | satria.prayoga@gmail.com |
0444a355e73ba177bfacbc2809af414074d498c8 | 7303873dfd8c515337d99bb502a94884cb484f18 | /target/generated/src/main/java/org/cxrus/canonapi/service/GetCaseStudyResponse.java | 70aaa68a425d097d80a00f960df8cd144ecb0d7d | [] | no_license | sidie88/soap | b7b30213f8f8e7e6fa2004c008b29bd573d319b8 | bc81ca7af13063b34c0a07ffcfe38f85e88cec08 | refs/heads/master | 2021-03-12T23:56:03.794313 | 2015-05-11T02:23:22 | 2015-05-11T02:23:22 | 35,397,099 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,520 | java |
package org.cxrus.canonapi.service;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for getCaseStudyResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="getCaseStudyResponse">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://service.canonapi.cxrus.org/}caseStudyObjectV2" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getCaseStudyResponse", propOrder = {
"_return"
})
public class GetCaseStudyResponse {
@XmlElement(name = "return")
protected CaseStudyObjectV2 _return;
/**
* Gets the value of the return property.
*
* @return
* possible object is
* {@link CaseStudyObjectV2 }
*
*/
public CaseStudyObjectV2 getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
* @param value
* allowed object is
* {@link CaseStudyObjectV2 }
*
*/
public void setReturn(CaseStudyObjectV2 value) {
this._return = value;
}
}
| [
"sidie88@gmail.com"
] | sidie88@gmail.com |
ae95fa804799d211e0154ba49763c4aef31e34ae | 573b9c497f644aeefd5c05def17315f497bd9536 | /src/main/java/com/alipay/api/response/AlipayPassFileAddResponse.java | 33a7042075d40649eb9e8ab53b45e09fdbb38457 | [
"Apache-2.0"
] | permissive | zzzyw-work/alipay-sdk-java-all | 44d72874f95cd70ca42083b927a31a277694b672 | 294cc314cd40f5446a0f7f10acbb5e9740c9cce4 | refs/heads/master | 2022-04-15T21:17:33.204840 | 2020-04-14T12:17:20 | 2020-04-14T12:17:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,109 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.pass.file.add response.
*
* @author auto create
* @since 1.0, 2019-03-08 15:29:11
*/
public class AlipayPassFileAddResponse extends AlipayResponse {
private static final long serialVersionUID = 4739876229392911813L;
/**
* 业务结果
*/
@ApiField("biz_result")
private String bizResult;
/**
* 业务错误码
*/
@ApiField("error_code")
private String errorCode;
/**
* 是否成功标识:T-成功;F-失败
*/
@ApiField("success")
private String success;
public void setBizResult(String bizResult) {
this.bizResult = bizResult;
}
public String getBizResult( ) {
return this.bizResult;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getErrorCode( ) {
return this.errorCode;
}
public void setSuccess(String success) {
this.success = success;
}
public String getSuccess( ) {
return this.success;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
89e606a242f3978f96931f444a537033c04c55a0 | 40932015313603203356c659432147fcd5f75d4a | /R4_Saving_Collections/src/main/java/service/UserService.java | 0e64743f2bd65c65ed377446489ec6088093ec4f | [] | no_license | luiz158/hibernate-utils | 1123660cf3a22100a01ed73261e771f7260a03e4 | 3df6153b9e5782af1abd3f762546e113699ccc2f | refs/heads/master | 2021-01-19T22:21:46.566083 | 2014-09-01T08:22:25 | 2014-09-01T08:22:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 363 | java | package service;
import dao.IUserDao;
import entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* Author: Daniel
*/
public class UserService implements IUserService {
@Autowired
private IUserDao userDao;
@Override
public void saveUser(User user) {
userDao.saveUser(user);
}
}
| [
"michalskidaniel2@gmail.com"
] | michalskidaniel2@gmail.com |
0a54ceec1ddc52e6390350fb18a0bb90bf08899d | efc2750464b85396c4d415ed64c0f392b0b18716 | /app/src/main/java/activity/xz/com/lganhuo/ui/Fragment/HomeFragment.java | 8ae43717bd906ee981b92500d8e021a241eef828 | [] | no_license | xiongzhuo/Lganhuo | 3d2d04a3e2c13e11e7aec1b151bf948170294fd8 | 48d7ab35067c4dd7fb46d422c7fc76a4c1b21057 | refs/heads/master | 2021-01-01T08:19:00.154415 | 2017-07-18T07:59:03 | 2017-07-18T07:59:03 | 97,570,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,392 | java | package activity.xz.com.lganhuo.ui.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import activity.xz.com.lganhuo.R;
import activity.xz.com.lganhuo.ui.MainActivity;
import activity.xz.com.lganhuo.ui.adapter.HomeAdapter;
/**
* 作者:Leon
* 时间:2017/6/6
*/
public class HomeFragment extends Fragment {
private MainActivity mContext;
private View mView;
private ViewPager mViewPager;
private List<Fragment> mListFragments;
private String[] mTitles = new String[]{"Android", "IOS", "福利"};
private TabLayout mTabLayout;
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.mContext = (MainActivity) context;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (mView == null) {
mView = inflater.inflate(R.layout.fragment_home, container, false);
}
return mView;
}
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mTabLayout = (TabLayout) view.findViewById(R.id.tab_layout);
mViewPager = (ViewPager) view.findViewById(R.id.home_viewpager);
mTabLayout.addTab(mTabLayout.newTab().setText("Android"));
mTabLayout.addTab(mTabLayout.newTab().setText("IOS"));
mTabLayout.addTab(mTabLayout.newTab().setText("福利"));
initFragments();
HomeAdapter homeAdapter = new HomeAdapter(getChildFragmentManager(), mContext, mListFragments, mTitles);
mViewPager.setAdapter(homeAdapter);
mTabLayout.setupWithViewPager(mViewPager);
}
@Override
public void onResume() {
super.onResume();
}
private void initFragments() {
mListFragments = new ArrayList<>();
mListFragments.add(new HomeAndroidFragment());
mListFragments.add(new HomeIOSFragment());
mListFragments.add(new HomeGirlFragment());
}
}
| [
"15388953585@163.com"
] | 15388953585@163.com |
6ee8b5e62308c857fb6aa5f32eb25982cd0ee6be | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE369_Divide_By_Zero/CWE369_Divide_By_Zero__getCookiesServlet_modulo_61b.java | 0cb03f8f3878851181b34346d943d1afab7dbf5e | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,458 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_By_Zero__getCookiesServlet_modulo_61b.java
Label Definition File: CWE369_Divide_By_Zero.label.xml
Template File: sources-sinks-61b.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: getCookiesServlet Read data from the first cookie
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: modulo
* GoodSink: Check for zero before modulo
* BadSink : Modulo by a value that may be zero
* Flow Variant: 61 Data flow: data returned from one method to another in different classes in the same package
*
* */
package testcases.CWE369_Divide_By_Zero;
import testcasesupport.*;
import java.sql.*;
import javax.servlet.http.*;
import java.security.SecureRandom;
import javax.servlet.http.*;
import java.util.logging.Logger;
public class CWE369_Divide_By_Zero__getCookiesServlet_modulo_61b
{
public int bad_source(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
Logger log_bad = Logger.getLogger("local-logger");
/* init Data$ */
data = -1;
/* read parameter from cookie */
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
String s_data = cookieSources[0].getValue();
data = Integer.parseInt(s_data.trim());
}
return data;
}
/* goodG2B() - use goodsource and badsink */
public int goodG2B_source(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
return data;
}
/* goodB2G() - use badsource and goodsink */
public int goodB2G_source(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
Logger log_bad = Logger.getLogger("local-logger");
/* init Data$ */
data = -1;
/* read parameter from cookie */
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
String s_data = cookieSources[0].getValue();
data = Integer.parseInt(s_data.trim());
}
return data;
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
114cd518c8d9730afaa75f92e99b5f9a2b44f18c | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/jboss/as/test/integration/jca/lazyconnectionmanager/LazyAssociationSharableDefaultTestCase.java | 48e8fe022e5e6700a762dcb1ebeafe967dfc2524 | [] | 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 | 4,149 | java | /**
* JBoss, Home of Professional Open Source.
* Copyright 2015, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.test.integration.jca.lazyconnectionmanager;
import javax.annotation.Resource;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnection;
import org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionFactory;
import org.jboss.logging.Logger;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Test cases for deploying a lazy association resource adapter archive
*
* @author <a href="mailto:jesper.pedersen@ironjacamar.org">Jesper Pedersen</a>
* @author <a href="mailto:msimka@redhat.com">Martin Simka</a>
*/
@RunWith(Arquillian.class)
public class LazyAssociationSharableDefaultTestCase extends LazyAssociationAbstractTestCase {
private static Logger logger = Logger.getLogger(LazyAssociationSharableDefaultTestCase.class);
@Resource(mappedName = "java:/eis/Lazy")
private LazyConnectionFactory lcf;
@Test
public void testBasic() {
Assert.assertNotNull(lcf);
LazyConnection lc = null;
try {
lc = lcf.getConnection();
Assert.assertTrue(lc.isManagedConnectionSet());
Assert.assertTrue(lc.closeManagedConnection());
Assert.assertFalse(lc.isManagedConnectionSet());
Assert.assertTrue(lc.associate());
Assert.assertTrue(lc.isManagedConnectionSet());
Assert.assertFalse(lc.isEnlisted());
Assert.assertTrue(lc.enlist());
Assert.assertFalse(lc.isEnlisted());
} catch (Throwable t) {
LazyAssociationSharableDefaultTestCase.logger.error(t.getMessage(), t);
Assert.fail(("Throwable:" + (t.getMessage())));
} finally {
if (lc != null) {
lc.close();
}
}
}
/**
* Two connections - one managed connection
*
* @throws Throwable
* Thrown if case of an error
*/
@Test
public void testTwoConnections() {
Assert.assertNotNull(lcf);
LazyConnection lc1 = null;
LazyConnection lc2 = null;
try {
lc1 = lcf.getConnection();
Assert.assertTrue(lc1.isManagedConnectionSet());
lc2 = lcf.getConnection();
Assert.assertTrue(lc2.isManagedConnectionSet());
Assert.assertFalse(lc1.isManagedConnectionSet());
Assert.assertTrue(lc2.closeManagedConnection());
Assert.assertFalse(lc1.isManagedConnectionSet());
Assert.assertFalse(lc2.isManagedConnectionSet());
Assert.assertTrue(lc1.associate());
Assert.assertTrue(lc1.isManagedConnectionSet());
Assert.assertFalse(lc2.isManagedConnectionSet());
} catch (Throwable t) {
LazyAssociationSharableDefaultTestCase.logger.error(t.getMessage(), t);
Assert.fail(("Throwable:" + (t.getMessage())));
} finally {
if (lc1 != null) {
lc1.close();
}
if (lc2 != null) {
lc2.close();
}
}
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
7f5d26a05051ec9e3c0629a5e31b987da8a06c30 | 4cc6fb1fde80a1730b660ba5ec13ad5f3228ea5c | /java-lihongjie/thinking-in-java-4-code/src/main/java/control/LabeledFor.java | 609fa61e4e5babef134ce942498e619315410628 | [
"MIT"
] | permissive | lihongjie/tutorials | c598425b085549f5f7a29b1c7bf0c86ae9823c94 | c729ae0eac90564e6366bc4907dcb8a536519956 | refs/heads/master | 2023-08-19T05:03:23.754199 | 2023-08-11T08:25:29 | 2023-08-11T08:25:29 | 124,048,964 | 0 | 0 | MIT | 2018-04-01T06:26:19 | 2018-03-06T08:51:04 | Java | UTF-8 | Java | false | false | 1,594 | java | package control;//: control/LabeledFor.java
// For loops with "labeled break" and "labeled continue."
import static net.mindview.util.Print.*;
public class LabeledFor {
public static void main(String[] args) {
int i = 0;
outer:
// Can't have statements here
for (; true; ) { // infinite loop
inner:
// Can't have statements here
for (; i < 10; i++) {
print("i = " + i);
if (i == 2) {
print("continue");
continue;
}
if (i == 3) {
print("break");
i++; // Otherwise i never
// gets incremented.
break;
}
if (i == 7) {
print("continue outer");
i++; // Otherwise i never
// gets incremented.
continue outer;
}
if (i == 8) {
print("break outer");
break outer;
}
for (int k = 0; k < 5; k++) {
if (k == 3) {
print("continue inner");
continue inner;
}
}
}
}
// Can't break or continue to labels here
}
} /* Output:
i = 0
continue inner
i = 1
continue inner
i = 2
continue
i = 3
break
i = 4
continue inner
i = 5
continue inner
i = 6
continue inner
i = 7
continue outer
i = 8
break outer
*///:~
| [
"you@example.com"
] | you@example.com |
c6bc8ce5557a38fcfe36416e905c6fb690114292 | b9d3ed7a55b3176eff4ffe6634e4f79fac23465b | /algorithm-ex/src/main/java/cc/before30/algex/dp/ClimbingStairs2.java | d5e5cd5854e9200e996969135bb625a1f5de56c9 | [
"MIT"
] | permissive | before30/homesandbox | d70ef4e4e7abf944d9971166c58ad8a804a023e1 | 96f831b50c043d8f97950fb8ec828237660961d6 | refs/heads/master | 2020-04-19T15:06:02.784532 | 2019-06-19T13:49:13 | 2019-06-19T13:49:13 | 168,264,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package cc.before30.algex.dp;
/**
* ClimbingStairs2
*
* @author before30
* @since 2019-06-17
*/
public class ClimbingStairs2 {
public int climbStairs(int n) {
if (n == 1) {
return 1;
}
int[] dp = new int[n+1];
dp[1] = 1;
dp[2] = 2;
for (int i = 3; i <= n; i++) {
dp[i] = dp[i-1] + dp[i-2];
}
return dp[n];
}
}
| [
"before30@gmail.com"
] | before30@gmail.com |
b9cb139af6d74fb03c38606c1dfa3df3113ae23f | 8ccd1c071b19388f1f2e92c5e5dbedc78fead327 | /src/main/java/ohos/com/sun/org/apache/bcel/internal/generic/BALOAD.java | 2d63a7c46d8c7cdc22d41c7f3f61bf4954754879 | [] | no_license | yearsyan/Harmony-OS-Java-class-library | d6c135b6a672c4c9eebf9d3857016995edeb38c9 | 902adac4d7dca6fd82bb133c75c64f331b58b390 | refs/heads/main | 2023-06-11T21:41:32.097483 | 2021-06-24T05:35:32 | 2021-06-24T05:35:32 | 379,816,304 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package ohos.com.sun.org.apache.bcel.internal.generic;
public class BALOAD extends ArrayInstruction implements StackProducer {
public BALOAD() {
super(51);
}
@Override // ohos.com.sun.org.apache.bcel.internal.generic.Instruction
public void accept(Visitor visitor) {
visitor.visitStackProducer(this);
visitor.visitExceptionThrower(this);
visitor.visitTypedInstruction(this);
visitor.visitArrayInstruction(this);
visitor.visitBALOAD(this);
}
}
| [
"yearsyan@gmail.com"
] | yearsyan@gmail.com |
73a16067b4bb2d12b00999b518a4b48e81190ca1 | 080963e5c8f2cf5fd69b8cad789886b205485a23 | /src/main/java/com/fuhao/service/ZhRentContractService.java | 6503864263babdd2058b43b11906d21b4b7e67e4 | [] | no_license | aifujiahao/family_service_platform | 3ad40b85b48ad5040f16758fef5625ef119620ac | 1eb7c7c407b1bd5d6506e664eed48f522f7491ca | refs/heads/master | 2022-12-16T17:32:52.781394 | 2020-09-23T13:42:10 | 2020-09-23T13:42:10 | 297,979,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | package com.fuhao.service;
import com.fuhao.bean.ZhRentContract;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 租赁合同 服务类
* </p>
*
* @author hao
* @since 2020-09-21
*/
public interface ZhRentContractService extends IService<ZhRentContract> {
}
| [
"52033327+aifujiahao@users.noreply.github.com"
] | 52033327+aifujiahao@users.noreply.github.com |
527caeca970cf3df1384d94e7f2afd09a19cf850 | a01eaed695583aad70bd7e1da1af0ec736c7bf22 | /ncep/gov.noaa.nws.ncep.edex.plugin.sgwhv/src/gov/noaa/nws/ncep/edex/plugin/sgwhv/decoder/SgwhvDecoder.java | c0ff6edb1e59f7a6f3e2ff3bbf74d88499398b55 | [] | no_license | SeanTheGuyThatAlwaysHasComputerTrouble/awips2 | 600d3e6f7ea1b488471e387c642d54cb6eebca1a | c8f8c20ca34e41ac23ad8e757130e91c77b558fe | refs/heads/master | 2021-01-19T18:00:12.598133 | 2013-03-26T17:06:45 | 2013-03-26T17:06:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,234 | java | /**
* SgwhvDecoder
*
* This java class decodes SGWHV (Significant Wave Height from Various satellites) BUFR data
* from NAVOCEANO including Env and Jason 2.
*
** <pre>
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------- ------- -------- -----------
* 08/23/11 Chin J Chen Initial coding from BufrSgwhvDecoder
* </pre>
*
* @author Chin J. Chen
* @version 1.0
*/
package gov.noaa.nws.ncep.edex.plugin.sgwhv.decoder;
import gov.noaa.nws.ncep.common.dataplugin.sgwhv.SgwhvRecord;
import gov.noaa.nws.ncep.edex.plugin.sgwhv.util.SgwhvParser;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.IBinaryDecoder;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
public class SgwhvDecoder extends AbstractDecoder implements IBinaryDecoder {
private static String pluginName;
private Log logger = LogFactory.getLog(getClass());
/**
* Empty constructor required by DecoderFactory.
*
* @throws DecoderException
*/
public SgwhvDecoder(String name) throws DecoderException {
pluginName = name;
}
/**
* Decode the next SGWHV BUFR record.
*
* @return One record of decoded data.
* @throws DecoderException
* Thrown if no data is available.
*/
public PluginDataObject[] decode(byte[] bufrData) throws DecoderException {
SgwhvRecord sgwhvRec;
SgwhvSeparator sep = new SgwhvSeparator();
try {
if (bufrData != null) {
sep.setData(bufrData, null);
} else {
logger.info("No data to decode while creating SgwhvSeparator");
}
} catch (Exception e) {
// need to catch any number of exceptions. Report them here
// instead of letting them kill the PluginDataProxy.
if (sep != null) {
logger.error("Error in " + sep.getWmoHeader().getWmoHeader());
}
logger.error("Exception while creating SgwhvSeparator", e);
}
/*
* Process BUFR SGWHV and add to the database.
*/
List<PluginDataObject> pdoList = new ArrayList<PluginDataObject>();
int subsetNum = 0;
while (sep.hasNext()) {
subsetNum++;
sgwhvRec = SgwhvParser.processSgwhv(sep, subsetNum);
if (sgwhvRec != null) {
try {
sgwhvRec.setPluginName(pluginName);
sgwhvRec.constructDataURI();
sgwhvRec.setReportType("SGWHV");
} catch (PluginException e) {
logger.error("Error constructing dataURI", e);
}
}
if (!pdoList.contains(sgwhvRec)) {
pdoList.add(sgwhvRec);
}
}
logger.info("Processed " + subsetNum + " subsets");
return pdoList.toArray(new PluginDataObject[pdoList.size()]);
}
}
| [
"Steven_L_Harris@raytheon.com"
] | Steven_L_Harris@raytheon.com |
622179beb437b432ed66449d719e9292ebdb7987 | cf7278e9f104cbbbfaef4ec5ffac86e60a02e727 | /src/test/java/ar/gob/gcba/dgisis/mapa360/config/SecurityBeanOverrideConfiguration.java | e2e3e6cc3e58fc56320219ef58fd27537dcda711 | [] | no_license | scarabetta/mapa360 | 019a8319b2bc243731b7f1c447e901e85822879d | a1b4252edecccfefcf8227cb92dce8c4cff7ec99 | refs/heads/master | 2020-03-12T07:43:35.824417 | 2018-04-21T21:09:16 | 2018-04-21T21:09:16 | 130,512,243 | 0 | 0 | null | 2023-04-27T12:08:59 | 2018-04-21T21:09:14 | Java | UTF-8 | Java | false | false | 1,067 | java | package ar.gob.gcba.dgisis.mapa360.config;
import org.springframework.cloud.client.loadbalancer.RestTemplateCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.web.client.RestTemplate;
/**
* Overrides UAA specific beans, so they do not interfere the testing
* This configuration must be included in @SpringBootTest in order to take effect.
*/
@Configuration
public class SecurityBeanOverrideConfiguration {
@Bean
@Primary
public TokenStore tokenStore() {
return null;
}
@Bean
@Primary
public JwtAccessTokenConverter jwtAccessTokenConverter() {
return null;
}
@Bean
@Primary
public RestTemplate loadBalancedRestTemplate(RestTemplateCustomizer customizer) {
return null;
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
c366213b3346baea5ba768c7aa89b9ae8fe83ecd | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Time/25/org/joda/time/base/AbstractDateTime_getSecondOfDay_209.java | 2cf48597f4b4a80f17316b23706e123af86ebf24 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 778 | java |
org joda time base
abstract date time abstractdatetim common behaviour datetim class
gener directli api user
link readabl date time readabledatetim
kind date time object referenc
implement code readabl date time readabledatetim code
extend
abstract date time abstractdatetim subclass mutabl thread safe
author brian neill o'neil
author stephen colebourn
abstract date time abstractdatetim
dai field
dai
dai getsecondofdai
chronolog getchronolog dai secondofdai milli getmilli
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
115afe4174c512e91ee4ab3adabf3ac5a296fc7d | 4dd22e45d6216df9cd3b64317f6af953f53677b7 | /LMS/src/main/java/com/ulearning/ulms/bloger/exception/UpdateException.java | fac3108f4908b618fdb99d894d4b1ddc75f53a8a | [] | no_license | tianpeijun198371/flowerpp | 1325344032912301aaacd74327f24e45c32efa1e | 169d3117ee844594cb84b2114e3fd165475f4231 | refs/heads/master | 2020-04-05T23:41:48.254793 | 2008-02-16T18:03:08 | 2008-02-16T18:03:08 | 40,278,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 520 | java | /*
* Created on 2004-9-29
* Author: Huaxia, Copyright (C) 2004, Huaxia.
*/
package com.ulearning.ulms.bloger.exception;
/**
* TODO Description here...
*
* @author Huaxia
*/
public class UpdateException extends RuntimeException
{
public UpdateException()
{
}
public UpdateException(String msg)
{
super(msg);
}
public UpdateException(Throwable throwable)
{
super(throwable);
}
}
| [
"flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626"
] | flowerpp@aeb45441-6f43-0410-8555-aba96bfc7626 |
ee7156e41fc4b97f1ee3f0a1238196b1b26f1bec | e889d1054ca2cdc054efa708717a4a1fb9cae6c9 | /2019.2/2.28.内部类复习/src/Day28/Test/Test1.java | 4857d213b32152c9dc840e224078f8f5625c5018 | [] | no_license | Dangwuxie/JavaSE2019 | d56ef46c0cf4407773f257e954f6d27c03767c4d | 81f5c0c641bffd53537e93e4574411b91c67a789 | refs/heads/master | 2022-07-14T07:21:52.053672 | 2019-11-26T13:03:01 | 2019-11-26T13:03:28 | 164,305,445 | 1 | 0 | null | 2022-06-21T01:48:10 | 2019-01-06T12:34:52 | Java | UTF-8 | Java | false | false | 418 | java | package Day28.Test;
//内部类的简单定义;
class Outer{
private String words = "helloword";
class Inner{
public void print(){
System.out.println(words);
}
}
public void fun(){
Inner inner = new Inner();
inner.print();
}
}
public class Test1 {
public static void main(String[] args) {
Outer outer = new Outer();
outer.fun();
}
}
| [
"974079012@qq.com"
] | 974079012@qq.com |
4a1bd9736d88d4172d765d3b5bb00a722e08706f | fae2d0c92ff3125d2356e78456dc2b0920304f4a | /OpenJdk/src/sun/util/resources/cldr/zh/CalendarData_zh_Hans_SG.java | 32d9ba48f98c5b8ea9ace5fd29e41f039f3fa8c5 | [] | no_license | X-gao/TestPrj | 96267a7357ac18b5f8e8f2995f33d3084430ef2d | 43f127baa5f16e004798248425d6dd7e386f8231 | refs/heads/master | 2022-12-22T16:11:39.485389 | 2021-05-28T02:34:48 | 2021-05-28T02:34:48 | 252,669,057 | 1 | 0 | null | 2022-12-06T00:45:49 | 2020-04-03T08:04:06 | Java | UTF-8 | Java | false | false | 3,671 | java | /*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (C) 1991-2012 Unicode, Inc. All rights reserved. Distributed under
* the Terms of Use in http://www.unicode.org/copyright.html.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of the Unicode data files and any associated documentation (the "Data
* Files") or Unicode software and any associated documentation (the
* "Software") to deal in the Data Files or Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, and/or sell copies of the Data Files or Software, and
* to permit persons to whom the Data Files or Software are furnished to do so,
* provided that (a) the above copyright notice(s) and this permission notice
* appear with all copies of the Data Files or Software, (b) both the above
* copyright notice(s) and this permission notice appear in associated
* documentation, and (c) there is clear notice in each modified Data File or
* in the Software as well as in the documentation associated with the Data
* File(s) or Software that the data or software has been modified.
*
* THE DATA FILES AND SOFTWARE ARE 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 OF
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
* CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THE DATA FILES OR SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder shall not
* be used in advertising or otherwise to promote the sale, use or other
* dealings in these Data Files or Software without prior written authorization
* of the copyright holder.
*/
package sun.util.resources.cldr.zh;
import java.util.ListResourceBundle;
public class CalendarData_zh_Hans_SG extends ListResourceBundle {
@Override
protected final Object[][] getContents() {
final Object[][] data = new Object[][] {
{ "firstDayOfWeek", "1" },
{ "minimalDaysInFirstWeek", "1" },
};
return data;
}
}
| [
"1628803713@qq.com"
] | 1628803713@qq.com |
7310c0c139eab03c3d945c6537aa2cdf9a63030c | ac18681842cb0b13a6144059409dc70cf2a76dcd | /folioreader/src/main/java/com/folioreader/view/FolioView.java | ee654eb71af655602bfe5980c3436bc2d22da890 | [
"BSD-3-Clause"
] | permissive | mohsinalimat/FolioReader-Android | 2113d4b888e82ac7c1114877236999e506d17aff | 5bee85c37e7b89c5fb92e76e83d25dc06fc36e98 | refs/heads/master | 2021-01-18T00:54:38.958476 | 2016-02-16T02:35:14 | 2016-02-16T02:35:24 | 53,023,687 | 1 | 0 | null | 2016-03-03T05:32:57 | 2016-03-03T05:32:57 | null | UTF-8 | Java | false | false | 2,188 | java | /*
* Copyright (C) 2016 Pedro Paulo de Amorim
*
* 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.folioreader.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import com.folioreader.R;
public class FolioView extends FrameLayout implements View.OnClickListener {
private View shadowView;
private FolioViewCallback folioViewCallback;
public FolioView(Context context) {
this(context, null);
}
public FolioView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public FolioView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
/**
* Bind the attributes of the view and config
* the DragView with these params.
*/
@Override protected void onFinishInflate() {
super.onFinishInflate();
if (!isInEditMode()) {
inflateView();
}
}
@Override public void onClick(View view) {
folioViewCallback.onShadowClick();
}
public void setFolioViewCallback(FolioViewCallback folioViewCallback) {
this.folioViewCallback = folioViewCallback;
}
private void inflateView() {
inflate(getContext(), R.layout.view_folio, this);
shadowView = findViewById(R.id.shadow);
configClickListener();
}
private void configClickListener() {
shadowView.setOnClickListener(this);
}
public void updateShadowAlpha(float alpha) {
float invertedShadow = 1 - alpha;
shadowView.setAlpha(invertedShadow);
if (invertedShadow == 0.0) {
shadowView.setVisibility(GONE);
}
}
public void resetView() {
shadowView.setVisibility(VISIBLE);
}
}
| [
"pp.amorim@hotmail.com"
] | pp.amorim@hotmail.com |
a9dce9825c4c475e4973c8b58bca680466fe92fc | e23af2c4d54c00ba76537551afe361567f394d63 | /PhysicMasterApp/app/src/main/java/com/physicmaster/widget/BracketView.java | 056cf142aa7fafec38c3b05e79a4f24c543aa649 | [] | no_license | 00zhengfu00/prj | fc0fda2be28a9507afcce753077f305363d66c5c | 29fae890a3a6941ece6c0ab21e5a98b5395727fa | refs/heads/master | 2020-04-20T10:07:31.986565 | 2018-03-23T08:27:01 | 2018-03-23T08:27:01 | 168,782,201 | 1 | 0 | null | 2019-02-02T01:37:13 | 2019-02-02T01:37:13 | null | UTF-8 | Java | false | false | 914 | java | package com.physicmaster.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
/**
* Created by huashigen on 2017-07-21.
*/
public class BracketView extends View {
private Paint mPaint;
public BracketView(Context context) {
this(context, null);
}
public BracketView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public BracketView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
mPaint = new Paint();
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
int width = getWidth();
int height = getHeight();
}
}
| [
"869981597@qq.com"
] | 869981597@qq.com |
99a038809450d2836244b5579f9bb6b2e248619e | 3fc850cf7c240ee5fddbe36438d74b467fc841c9 | /src/main/java/net/thejrdev/EasyYML.java | 93e18863ec7e54d7b4723bce43e5d1be9e61f1e2 | [] | no_license | TheJDeveloper/EasySpigot | 8fa38781b4f3a4c4a06bd2689d066f9e662de89e | f2833d631a05026bf2d73ecef8977e7ad3e4f3bc | refs/heads/master | 2023-05-06T12:12:57.526122 | 2021-05-18T16:50:37 | 2021-05-18T16:50:37 | 367,748,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,847 | java | package net.thejrdev;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
/**
* <h1>EasyYML</h1>
* The EasyYML class is designed to simplify common tasks dealing with config files.
* <p>
* ItemStack yml format:
*
* (item):
* material: (material value)
* name: (display name)
* lore:
* -(lore line 1)
* -(lore line 2)
* (continue for each line of lore)
* enchantments:
* (enchantment enum name): (level)
*
* Example:
* helmet:
* material: IRON_HELMET
* name: Custom Helmet
* lore:
* -Helmet made for testing purposes
* enchantments:
* PROTECTION_ENVIRONMENTAL: 2
*
*
*
*/
public class EasyYML {
private FileConfiguration config;
/**
* @param config The plugin configuration file
*/
public EasyYML(@NotNull FileConfiguration config) {
this.config = config;
}
/** Creates an ItemStack from the config file using specific formatting.
*
* @param path Path to the Item to create
* @return new ItemStack
* @throws IllegalArgumentException Invalid Enum name
* @throws MissingConfigArgument Portions of the config are missing
* @see MissingConfigArgument
*/
public ItemStack createItemStack(@NotNull String path) throws IllegalArgumentException, MissingConfigArgument {
ConfigurationSection section = config.getConfigurationSection(path);
Set<String> keys = section.getKeys(false);
if(!keys.contains("material")){
throw new MissingConfigArgument("\"material\" is missing from the configuration file");
}
Material material = Material.valueOf(section.getString("material"));
ItemStack item = new ItemStack(material);
ItemMeta meta = item.getItemMeta();
if(keys.contains("name")){
meta.setDisplayName(section.getString("name"));
}
if(keys.contains("count")){
item.setAmount(section.getInt("amount"));
}
if(keys.contains("lore")){
meta.setLore(section.getStringList("lore"));
}
if(keys.contains("enchantments")){
ConfigurationSection enchantSection = section.getConfigurationSection("enchantments");
Set<String> enchants = enchantSection.getKeys(false);
for(String s: enchants){
Enchantment ench = Enchantment.getByKey(NamespacedKey.minecraft(s));
meta.addEnchant(ench, enchantSection.getInt(s), false);
}
}
item.setItemMeta(meta);
return item;
}
/** Creates a HashMap of ItemStacks from config file.
*
* @param path Path to the collection of items
* @param itemNames The collection of item names to create
* @return HashMap of item names to corresponding ItemStack
* @throws IllegalArgumentException Invalid Enum name; see createItemStack method
* @throws MissingConfigArgument Portions of the config are missing; see createItemStack method
* @see MissingConfigArgument
*/
public HashMap<String, ItemStack> createItemMap(@NotNull String path, Collection<String> itemNames) throws IllegalArgumentException, MissingConfigArgument{
HashMap<String, ItemStack> items = new HashMap<>();
for(String s: itemNames){
items.put(s, createItemStack(path + "." + s));
}
return items;
}
} | [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
611416557830228b7f8ef4f28b373aec5c218770 | c0be6dab69c9c47f838e1032238361ded25febee | /src/main/java/com/server/redis/lock/JedisLock.java | b00b4bd21307c22787cd0194312e04694114d2b9 | [] | no_license | laohu123456/springboot-server | 962be64d7b1028cccb2eb61e81ad2a23588970f5 | fa0a882a0aa81564096c21f816a9a233c3432c11 | refs/heads/master | 2023-06-24T13:54:57.201871 | 2021-07-22T01:48:55 | 2021-07-22T01:48:55 | 346,252,027 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,257 | java | package com.server.redis.lock;
import redis.clients.jedis.Jedis;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class JedisLock {
//加锁成功标志
private static final String LOCK_SUCCESS = "OK";
//解锁成功标志
private final static Long RELEASE_SUCCESS = 1L;
private final static String SET_IF_NOT_EXIST = "NX";
private final static String SET_WITH_EXPIRE_TIME = "PX";
// 加锁脚本
private final static String SCRIPT_LOCK = "if redis.call('setnx', KEYS[1], ARGV[1]) == 1 then redis.call('pexpire', KEYS[1], ARGV[2]) return 1 else return 0 end";
// 解锁脚本
private final static String SCRIPT_UNLOCK = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end";
public static boolean tryGetDistributedLock(Jedis jedis, String lockKey, String requestId, int expireTime) {
String result = jedis.set(lockKey, requestId, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, expireTime);
if (LOCK_SUCCESS.equals(result)) {
return true;
}
return false;
}
/**
* 释放分布式锁
* @param jedis Redis客户端
* @param lockKey 锁
* @param requestId 请求标识
* @return 是否释放成功
*/
public static boolean releaseDistributedLock(Jedis jedis, String lockKey, String requestId) {
Object result = jedis.eval(SCRIPT_UNLOCK, Collections.singletonList(lockKey), Collections.singletonList(requestId));
if (RELEASE_SUCCESS.equals(result)) {
return true;
}
return false;
}
/**
* 分布式锁续租
*/
public static boolean expandLockTime(Jedis jedis,String lockKey, String requestId, Long expireTime){
String script = "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('expire', KEYS[1],ARGV[2]) else return '0' end";
List<String> list = new ArrayList<String>();
list.add(requestId);
list.add(String.valueOf(expireTime));
Object result = jedis.eval(script, Collections.singletonList(lockKey), list);
if(RELEASE_SUCCESS.equals(result)){
return true;
}
return false;
}
}
| [
"aaa"
] | aaa |
75b22a22f65cd062d0d7c79d3e63aa2e74b604b4 | e93f1174b12d20a1e0a61edbc767ba727ddd3f2c | /class_1324.java | e52fc858d536e7499b5f6f101e9dd87f07b8d1ff | [] | no_license | a3535ed54a5ee6917a46cfa6c3f12679/7c314649_Menoria_OLD_SemiObf | 47319a81a8c0dcf371aa8b3fd72c1030edacb370 | d62d112cbedd5bb3007cd4f53c82e926dfc64e8a | refs/heads/master | 2021-04-27T16:19:45.530463 | 2018-02-22T13:59:19 | 2018-02-22T13:59:19 | 122,485,270 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 850 | java | import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
// $FF: renamed from: kM
public class class_1324 {
// $FF: renamed from: b int
public int field_6800;
// $FF: renamed from: c int
public int field_6801;
// $FF: renamed from: <init> () void
public void method_6960() {
super();
}
// $FF: renamed from: b () void
public void method_6961() {
Mouse.setGrabbed(true);
this.field_6800 = 0;
this.field_6801 = 0;
}
// $FF: renamed from: c () void
public void method_6962() {
Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
Mouse.setGrabbed(false);
}
// $FF: renamed from: d () void
public void method_6963() {
this.field_6800 = Mouse.getDX();
this.field_6801 = Mouse.getDY();
}
}
| [
"unknowlk@tuta.io"
] | unknowlk@tuta.io |
6fde62cf753fc8d6ebe7141c7836cb1501b2ec5e | 2269cb8ab3212dc973a3ecd8961373da4a97d22a | /src/com/liangxun/yuejiula/huanxin/chat/activity/HxContextMenu.java | aa3bcdc30a45b9dc4b400e1d8179503defd2c89b | [] | no_license | eryiyi/YuejiulaApp1 | c96d054cda0233d7b7e1bb2bfe430bb82e5733b8 | 4ecc5e8533dbd8ebdda493de0eebd5e04e6cc30f | refs/heads/master | 2021-01-16T23:53:08.377201 | 2016-12-01T07:33:26 | 2016-12-01T07:33:26 | 59,299,326 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,912 | java | /**
* Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
* <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
* 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.liangxun.yuejiula.huanxin.chat.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import com.easemob.chat.EMMessage;
import com.liangxun.yuejiula.R;
public class HxContextMenu extends HxBaseActivity {
private int position;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int txtValue = EMMessage.Type.TXT.ordinal();
int type = getIntent().getIntExtra("type", -1);
if (type == EMMessage.Type.TXT.ordinal()) {
setContentView(R.layout.context_menu_for_text);
} else if (type == EMMessage.Type.LOCATION.ordinal()) {
setContentView(R.layout.context_menu_for_location);
} else if (type == EMMessage.Type.IMAGE.ordinal()) {
setContentView(R.layout.context_menu_for_image);
} else if (type == EMMessage.Type.VOICE.ordinal()) {
setContentView(R.layout.context_menu_for_voice);
} else if (type == EMMessage.Type.VIDEO.ordinal()) {
setContentView(R.layout.context_menu_for_video);
}
position = getIntent().getIntExtra("position", -1);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
finish();
return true;
}
public void copy(View view) {
setResult(ChatActivity.RESULT_CODE_COPY, new Intent().putExtra("position", position));
finish();
}
public void delete(View view) {
setResult(ChatActivity.RESULT_CODE_DELETE, new Intent().putExtra("position", position));
finish();
}
public void forward(View view) {
setResult(ChatActivity.RESULT_CODE_FORWARD, new Intent().putExtra("position", position));
finish();
}
public void open(View v) {
setResult(ChatActivity.RESULT_CODE_OPEN, new Intent().putExtra("position", position));
finish();
}
public void download(View v) {
setResult(ChatActivity.RESULT_CODE_DWONLOAD, new Intent().putExtra("position", position));
finish();
}
public void toCloud(View v) {
setResult(ChatActivity.RESULT_CODE_TO_CLOUD, new Intent().putExtra("position", position));
finish();
}
}
| [
"826321978@qq.com"
] | 826321978@qq.com |
7fda80246774050b9ebf4ba5c88d3ad8cd868595 | d002e30b419d5900a5e72481258729372656bbdb | /.svn/pristine/7f/7fda80246774050b9ebf4ba5c88d3ad8cd868595.svn-base | 46d70e2752b9f972a7200cf7d999390548e606aa | [] | no_license | Escheck/core | dcfa533a01e81de16d668755b4b33c789772bc88 | 3ca6f36416e6788363e147e9ed2d7c0dfe0c4f29 | refs/heads/master | 2021-09-09T03:27:34.053784 | 2018-03-13T13:20:29 | 2018-03-13T13:20:29 | 125,054,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,080 | package list;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* creates all possible combinations of one element from each of the provided
* lists
*
* @param T
* the element type of all lists that we receive.
*/
public class Outer<T> extends AbstractImmutableList<ImmutableList<T>> {
private BigInteger size = BigInteger.ZERO;
private List<ImmutableList<T>> sourceLists = new ArrayList<>();
public Outer(ImmutableList<T>... lists) {
if (lists.length == 0) {
return;
}
size = BigInteger.ONE;
for (ImmutableList<T> l : lists) {
sourceLists.add(l);
size = size.multiply(l.size());
}
}
@Override
public ImmutableList<T> get(BigInteger index) {
List<T> element = new ArrayList<T>();
BigInteger i = index;
for (int item = 0; item < sourceLists.size(); item++) {
ImmutableList<T> l = sourceLists.get(item);
BigInteger n = l.size();
element.add(l.get(i.mod(n)));
i = i.divide(n);
}
return new ImArrayList<T>(element);
}
@Override
public BigInteger size() {
return size;
}
}
| [
"Escheck2000-o2@yahoo.de"
] | Escheck2000-o2@yahoo.de | |
f486a1c265320d210ad5cab3293983901d388ae6 | 92063b4798eef5b8fea0bf21899233c60ddb4f23 | /src/test/java/org/irods/jargon/irodsext/jwt/JwtIssueServiceImplTest.java | 7b4d1b1bb4c9414a20211632d6b41a221900b022 | [
"BSD-3-Clause"
] | permissive | DICE-UNC/jargon-extensions-jwt | 7e0d555c2e2cdc38ecc1d93e4141b578a55c7278 | 8b53b24d462d353c307a60094e65402447e5cf58 | refs/heads/master | 2022-12-25T16:19:20.904997 | 2022-12-15T15:48:51 | 2022-12-15T15:48:51 | 201,059,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,627 | java | package org.irods.jargon.irodsext.jwt;
import org.junit.Assert;
import org.junit.Test;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jws;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.WeakKeyException;
public class JwtIssueServiceImplTest {
@Test(expected = WeakKeyException.class)
public void testIssueJwtWeakKey() {
JwtServiceConfig config = new JwtServiceConfig();
config.setAlgo(SignatureAlgorithm.HS256.getValue());
config.setIssuer("test");
config.setSecret("thisisasecret");
JwtIssueServiceImpl jwtIssueServiceImpl = new JwtIssueServiceImpl(config);
jwtIssueServiceImpl.issueJwtToken("subject");
}
@Test
public void testIssueJwt() {
JwtServiceConfig config = new JwtServiceConfig();
config.setAlgo(SignatureAlgorithm.HS256.getValue());
config.setIssuer("test");
config.setSecret("thisisasecretthatisverysecretyouwillneverguessthiskey");
JwtIssueServiceImpl jwtIssueServiceImpl = new JwtIssueServiceImpl(config);
String jwt = jwtIssueServiceImpl.issueJwtToken("subject");
Assert.assertNotNull("no jwt issued", jwt);
}
@Test
public void testIssueAndDecodeJwt() {
JwtServiceConfig config = new JwtServiceConfig();
config.setAlgo(SignatureAlgorithm.HS256.getValue());
config.setIssuer("test");
config.setSecret("thisisasecretthatisverysecretyouwillneverguessthiskeyhurray");
JwtIssueServiceImpl jwtIssueServiceImpl = new JwtIssueServiceImpl(config);
String jwt = jwtIssueServiceImpl.issueJwtToken("subject");
Jws<Claims> actual = jwtIssueServiceImpl.decodeJwtToken(jwt);
Assert.assertNotNull("claims not returned", actual);
}
}
| [
"mike.conway@nih.gov"
] | mike.conway@nih.gov |
ded9725ae905d8d9e22213d464c3096c59aa51f9 | 35ca1144aaa0405079b59c2fcbcd726f2472246d | /src/main/java/us/fok/lenzenslijper/models/jooq/routines/GidxOut.java | 8920940fb7a05e9166ad90aca9af890dc413060e | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | fokus-llc/lenzenslijper | a1e152fdb0a808f97496e7b09b609b7101a1e956 | 861d741a739c976c96b2821d0b5361c8aae99f69 | refs/heads/master | 2021-01-16T00:22:18.583402 | 2014-10-28T02:39:16 | 2014-10-28T02:39:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,606 | java | /**
* This class is generated by jOOQ
*/
package us.fok.lenzenslijper.models.jooq.routines;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.0" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class GidxOut extends org.jooq.impl.AbstractRoutine<java.lang.Object> {
private static final long serialVersionUID = 897540537;
/**
* The parameter <code>public.gidx_out.RETURN_VALUE</code>.
*/
public static final org.jooq.Parameter<java.lang.Object> RETURN_VALUE = createParameter("RETURN_VALUE", org.jooq.impl.DefaultDataType.getDefaultDataType("cstring"));
/**
* The parameter <code>public.gidx_out._1</code>.
*/
public static final org.jooq.Parameter<java.lang.Object> _1 = createParameter("_1", org.jooq.impl.DefaultDataType.getDefaultDataType("USER-DEFINED"));
/**
* Create a new routine call instance
*/
public GidxOut() {
super("gidx_out", us.fok.lenzenslijper.models.jooq.Public.PUBLIC, org.jooq.impl.DefaultDataType.getDefaultDataType("cstring"));
setReturnParameter(RETURN_VALUE);
addInParameter(_1);
}
/**
* Set the <code>_1</code> parameter IN value to the routine
*/
public void set__1(java.lang.Object value) {
setValue(us.fok.lenzenslijper.models.jooq.routines.GidxOut._1, value);
}
/**
* Set the <code>_1</code> parameter to the function to be used with a {@link org.jooq.Select} statement
*/
public void set__1(org.jooq.Field<java.lang.Object> field) {
setField(_1, field);
}
}
| [
"oss+fokus@teleological.net"
] | oss+fokus@teleological.net |
cf00f534000fa6a7d4142b9b098eb8327e786a36 | d48cfe7bb65c3169dea931f605d62b4340222d75 | /chinahrd-hrbi/hrd-log/src/main/java/net/chinahrd/interceptor/UserTimeHandlerInterceptor.java | 91621b727fa42ddfb9791421a18cf3c81e146931 | [] | no_license | a559927z/doc | 7b65aeff1d4606bab1d7f71307d6163b010a226d | 04e812838a5614ed78f8bbfa16a377e7398843fc | refs/heads/master | 2022-12-23T12:09:32.360591 | 2019-07-15T17:52:54 | 2019-07-15T17:52:54 | 195,972,411 | 0 | 0 | null | 2022-12-16T07:47:50 | 2019-07-09T09:02:38 | JavaScript | UTF-8 | Java | false | false | 7,907 | java | package net.chinahrd.interceptor;
import lombok.extern.slf4j.Slf4j;
import net.chinahrd.dto.AopInformation;
import net.chinahrd.dto.EmpExtendDto;
import net.chinahrd.service.LogMgrService;
import net.chinahrd.utils.RemoteUtil;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.NamedThreadLocal;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map;
/**
* @author jxzhang on 2018年05月01
* @Verdion 1.0版本
*/
@Slf4j
public class UserTimeHandlerInterceptor extends HandlerInterceptorAdapter {
@Autowired
private LogMgrService logMgrService;
/**
* 回车
*/
private final String enter = "\r\n";
/**
* 当前线程池
*/
private NamedThreadLocal<Long> startTimeThreadLocal = new NamedThreadLocal<Long>("StopWatch-StartTime");
/**
* 该方法将在Controller处理之前进行调用
*
* @param request
* @param response
* @param handler
* @return
* @throws Exception
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//1、开始时间
long beginTime = System.currentTimeMillis();
//线程绑定变量(该数据只有当前请求的线程可见)
startTimeThreadLocal.set(beginTime);
return super.preHandle(request, response, handler);
}
/**
* 这个方法只会在当前这个Interceptor的preHandle方法返回值为true的时候才会执行。postHandle是进行处理器拦截用的,它的执行时间是在处理器进行处理之
* 后,也就是在Controller的方法调用之后执行,但是它会在DispatcherServlet进行视图的渲染之前执行
*
* @param request
* @param response
* @param handler
* @param modelAndView
* @throws Exception
*/
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
log.info("也就是在Controller的方法调用之后执行,但是它会在DispatcherServlet进行视图的渲染之前执行。");
super.postHandle(request, response, handler, modelAndView);
}
/**
* 该方法也是需要当前对应的Interceptor的preHandle方法的返回值为true时才会执行。该方法将在整个请求完成之后,也就是DispatcherServlet渲染了视图执行,
*
* @param request
* @param response
* @param handler
* @param ex
* @throws Exception
*/
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
long endTime = System.currentTimeMillis();
long beginTime = startTimeThreadLocal.get();
long useTime = endTime - beginTime;
log.info("Aop信息:");
log.info("=====前置通知开始=====");
try {
if (handler instanceof HandlerMethod) {
HandlerMethod handlerMethod = (HandlerMethod) handler;
//类
String beanName = handlerMethod.getBean().getClass().toString();
//方法名称
String methodName = handlerMethod.getMethod().getName();
if (methodName.equals("error") || methodName.equals("success")) {
log.error("方法名称错误");
}
//请求路径
String uri = request.getRequestURI();
//ip
String remoteAddr = RemoteUtil.getIp(request);
//请求方式
String method = request.getMethod();
String sbf = "";
if (StringUtils.equals(method, "GET")) {
StringBuffer tmpSbf = new StringBuffer();
Map<String, String[]> pramMap = request.getParameterMap();
int count = 0;
String forCunt = "";
for (Map.Entry<String, String[]> entry : pramMap.entrySet()) {
forCunt = "[" + count + "]" + " : ";
tmpSbf.append("paramName" + forCunt + entry.getKey() + " - " + "paramValue" +
forCunt + request.getParameter(entry.getKey()) + "\n");
count++;
}
sbf = tmpSbf.toString();
} else {
BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
String message = "";
String tmpSbf = null;
while ((tmpSbf = br.readLine()) != null) {
message += tmpSbf;
}
sbf = message;
}
EmpExtendDto empInfo = (EmpExtendDto) request.getSession().getAttribute("empInfo");
AopInformation aopInfo =
packDto(beginTime, endTime, beanName, methodName, uri, remoteAddr, method, sbf, useTime, empInfo);
logMgrService.information(aopInfo);
}
} catch (Exception e) {
//出错
log.error("用户操作日志记录异常");
}
log.info("=====前置通知结束=====");
super.afterCompletion(request, response, handler, ex);
}
/**
* 组装AopInformation
*
* @return
*/
private AopInformation packDto(
long beginTime, long endTime, String beanName, String methodName, String uri, String remoteAddr, String method, String sbf, long useTime,
EmpExtendDto empInfo) {
StringBuffer info = new StringBuffer();
info.append(enter)
.append("开始时间:" + new DateTime(beginTime).toString("yyyyMMdd HH:mm:ss:sss"))
.append(enter)
.append("类名:" + beanName)
.append(enter)
.append("方法名:" + methodName)
.append(enter)
.append("请求路径:" + uri)
.append(enter)
.append("地址:" + remoteAddr)
.append(enter)
.append("请求方式:" + method)
.append(enter)
.append("参数:" + sbf)
.append(enter)
.append("粍时======>:" + useTime + "ms")
.append(enter)
.append("结束时间:" + new DateTime(endTime).toString("yyyyMMdd HH:mm:ss:sss"))
;
log.info(info.toString());
AopInformation aopInfo = new AopInformation();
aopInfo.setIpAddress(remoteAddr);
aopInfo.setClazz(beanName);
aopInfo.setMethod(method + ": " + methodName);
aopInfo.setParams(sbf);
aopInfo.setPackageName(uri);
aopInfo.setUseTime(useTime);
aopInfo.setUserId(empInfo.getUserId());
aopInfo.setUserKey(empInfo.getUserKey());
aopInfo.setUserName(empInfo.getUserName());
aopInfo.setUserNameCh(empInfo.getUserNameCh());
// 1,登录, 2 登出, 3,查询、修改、添加
aopInfo.setType(3);
aopInfo.setWriteDb(true);
return aopInfo;
}
}
| [
"a559927z@163.com"
] | a559927z@163.com |
8fcba6bc2a94f3c1fa311d9309a4d0352d9c8ab5 | 75edf9c7d5d1e666135ab0d797a292f9781790b6 | /ui_web_library/release/pagecompile/ish/cartridges/ui_005fweb_005flibrary/default_/webcontrols/Placeholder_jsp.java | 3c244e558bf3a43f83ec7b6b4c5e79c62b20154d | [] | no_license | arthurAddamsSiebert/cartridges | 7808f484de6b06c98c59be49f816164dba21366e | cc1141019a601f76ad15727af442718f1f6bb6cb | refs/heads/master | 2020-06-11T08:58:02.419907 | 2019-06-26T12:16:31 | 2019-06-26T12:16:31 | 193,898,014 | 0 | 1 | null | 2019-11-02T23:33:49 | 2019-06-26T12:15:29 | Java | UTF-8 | Java | false | false | 4,391 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: JspCServletContext/1.0
* Generated at: 2019-02-07 18:11:27 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package ish.cartridges.ui_005fweb_005flibrary.default_.webcontrols;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.io.*;
import com.intershop.beehive.core.internal.template.*;
import com.intershop.beehive.core.internal.template.isml.*;
import com.intershop.beehive.core.capi.log.*;
import com.intershop.beehive.core.capi.resource.*;
import com.intershop.beehive.core.capi.util.UUIDMgr;
import com.intershop.beehive.core.capi.util.XMLHelper;
import com.intershop.beehive.foundation.util.*;
import com.intershop.beehive.core.internal.url.*;
import com.intershop.beehive.core.internal.resource.*;
import com.intershop.beehive.core.internal.wsrp.*;
import com.intershop.beehive.core.capi.pipeline.PipelineDictionary;
import com.intershop.beehive.core.capi.naming.NamingMgr;
import com.intershop.beehive.core.capi.pagecache.PageCacheMgr;
import com.intershop.beehive.core.capi.request.SessionMgr;
import com.intershop.beehive.core.internal.request.SessionMgrImpl;
import com.intershop.beehive.core.pipelet.PipelineConstants;
public final class Placeholder_jsp extends com.intershop.beehive.core.internal.template.AbstractTemplate
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 0, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
boolean _boolean_result=false;
TemplateExecutionConfig context = getTemplateExecutionConfig();
createTemplatePageConfig(context.getServletRequest());
printHeader(out);
setEncodingType("text/html");
{out.flush();processLocalIncludeByServer((com.intershop.beehive.core.capi.request.ServletResponse)response,"webcontrols/PlaceholderHead", null, "1");}
out.write('\n');
{out.flush();processLocalIncludeByServer((com.intershop.beehive.core.capi.request.ServletResponse)response,"webcontrols/PlaceholderControls", null, "2");}
out.write('\n');
printFooter(out);
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net"
] | root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net |
28c07aa072b7bf7d69ed014c6f3d4ae630cc708a | a1da47c5fdfc644e3029f03316fe76f6b5cf5bb4 | /components/core-services-exec/src/main/groovy/org/squonk/execution/steps/impl/SmilesStructuresStep.java | fa58c845c51f3e53c5c2ae59f386654bbf2d4f09 | [
"Apache-2.0"
] | permissive | InformaticsMatters/squonk | a25af0454f4637827136b19cc91f0ad22c0cbe87 | 56e826858bb495b064d215f7c4851429493cf639 | refs/heads/master | 2021-03-30T17:15:11.194844 | 2021-03-08T18:09:42 | 2021-03-08T18:09:42 | 94,418,987 | 7 | 4 | Apache-2.0 | 2021-03-08T18:09:43 | 2017-06-15T08:40:39 | Java | UTF-8 | Java | false | false | 4,283 | java | /*
* Copyright (c) 2019 Informatics Matters Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.squonk.execution.steps.impl;
import org.squonk.core.DefaultServiceDescriptor;
import org.squonk.core.ServiceConfig;
import org.squonk.dataset.Dataset;
import org.squonk.dataset.DatasetMetadata;
import org.squonk.execution.steps.AbstractStep;
import org.squonk.execution.steps.StepDefinitionConstants;
import org.squonk.io.IODescriptors;
import org.squonk.options.MultiLineTextTypeDescriptor;
import org.squonk.options.OptionDescriptor;
import org.squonk.types.MoleculeObject;
import java.util.*;
import java.util.logging.Logger;
/**
* Created by timbo on 13/09/16.
*/
public class SmilesStructuresStep extends AbstractStep {
private static final Logger LOG = Logger.getLogger(SmilesStructuresStep.class.getName());
public static final DefaultServiceDescriptor SERVICE_DESCRIPTOR = new DefaultServiceDescriptor("core.dataset.smiles.v1",
"SmilesStructures",
"Generate a dataset from provided SMILES strings",
new String[]{"structure", "smiles", "dataset"},
null, "icons/molecule.png",
ServiceConfig.Status.ACTIVE,
new Date(),
null,
IODescriptors.createMoleculeObjectDatasetArray(StepDefinitionConstants.VARIABLE_OUTPUT_DATASET),
new OptionDescriptor[]{
new OptionDescriptor<>(new MultiLineTextTypeDescriptor(10, 80, MultiLineTextTypeDescriptor.MIME_TYPE_TEXT_PLAIN),
StepDefinitionConstants.SmilesStructures.OPTION_SMILES, "Smiles",
"Smiles as text, with optional name", OptionDescriptor.Mode.User)
},
null, null, null,
SmilesStructuresStep.class.getName()
);
protected static final String OPTION_SMILES = StepDefinitionConstants.SmilesStructures.OPTION_SMILES;
protected static final String FIELD_NAME = "Name";
@Override
public Map<String, Object> doExecute(Map<String, Object> inputs) throws Exception {
statusMessage = MSG_PREPARING_INPUT;
String text = getOption(OPTION_SMILES, String.class);
if (text == null) {
throw new IllegalStateException("Smiles structures must be defined as option named " + OPTION_SMILES);
}
String[] lines = text.split("\n");
List<MoleculeObject> mols = new ArrayList<>();
boolean hasName = false;
for (String line : lines) {
line = line.trim();
if (line.length() > 0) {
String[] parts = line.split("\\s+", 2);
if (parts.length > 0) {
MoleculeObject mo = new MoleculeObject(parts[0], "smiles");
if (parts.length == 2) {
hasName = true;
mo.putValue(FIELD_NAME, parts[1]);
}
mols.add(mo);
}
}
}
DatasetMetadata<MoleculeObject> meta = new DatasetMetadata<>(MoleculeObject.class);
meta.getProperties().put(DatasetMetadata.PROP_CREATED, DatasetMetadata.now());
meta.getProperties().put(DatasetMetadata.PROP_SOURCE, "User provided Smiles");
meta.getProperties().put(DatasetMetadata.PROP_DESCRIPTION, "Read from user provided Smiles");
if (hasName) {
meta.createField(FIELD_NAME, "User provided name", "Name provided by user with smiles", String.class);
}
meta.setSize(mols.size());
statusMessage = mols.size() + " molecules";
Dataset<MoleculeObject> result = new Dataset<>(mols, meta);
return Collections.singletonMap(StepDefinitionConstants.VARIABLE_OUTPUT_DATASET, result);
}
}
| [
"tdudgeon@informaticsmatters.com"
] | tdudgeon@informaticsmatters.com |
1169f46010a5643115b36e3e13fcde9807500795 | f1b65f6ace564ef496ae97c237763a1e282b2189 | /tis-manage-pojo/src/main/java/com/qlangtech/tis/manage/biz/dal/pojo/ServerPool.java | 815376e75dd8851b5ba8a9d03a1de3b3c7cebc08 | [
"MIT"
] | permissive | fightingyuman/tis-solr | 27b65d3e4a89612ea9087a0f260a8c0a89b7f640 | 8655db7c32bb88928b931e2754291deb0e4ab4db | refs/heads/master | 2022-04-04T08:26:23.438875 | 2020-01-02T13:04:51 | 2020-01-02T13:04:51 | 258,164,459 | 1 | 0 | MIT | 2020-04-23T10:09:51 | 2020-04-23T10:09:51 | null | UTF-8 | Java | false | false | 2,761 | java | /*
* The MIT License
*
* Copyright (c) 2018-2022, qinglangtech Ltd
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.qlangtech.tis.manage.biz.dal.pojo;
import java.util.Date;
/* *
* @author 百岁(baisui@qlangtech.com)
* @date 2019年1月17日
*/
public class ServerPool {
private Integer spId;
private String serverName;
private String ipAddress;
private Integer deleteFlag;
private Date createTime;
private Date updateTime;
private Short runtEnvironment;
public Integer getSpId() {
return spId;
}
public void setSpId(Integer spId) {
this.spId = spId;
}
public String getServerName() {
return serverName;
}
public void setServerName(String serverName) {
this.serverName = serverName == null ? null : serverName.trim();
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress == null ? null : ipAddress.trim();
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Short getRuntEnvironment() {
return runtEnvironment;
}
public void setRuntEnvironment(Short runtEnvironment) {
this.runtEnvironment = runtEnvironment;
}
}
| [
"baisui@2dfire.com"
] | baisui@2dfire.com |
e1e526327f741bff1296c45b00c31e2a53a9c841 | db6215d91c02554bce4ee49b99f7318ffbf18f2d | /server/server-ba/src/main/java/org/neurosystem/modules/marketdata/indicator/basic/MACD.java | abea979043363f22eaa1edc855804ea2d80c795a | [] | no_license | senhadjielrhazi/Project.FIX | 79687c9807b906f3d06e70b390141004f8ecae0d | 8f4511b76d043d4dff183023e1a62035a25b9760 | refs/heads/master | 2021-05-06T12:36:37.648093 | 2017-12-05T09:22:11 | 2017-12-05T09:22:11 | 113,158,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,678 | java | package org.neurosystem.modules.marketdata.indicator.basic;
import org.neurosystem.modules.marketdata.AppliedPrice;
import org.neurosystem.modules.marketdata.IQuoteServer;
import org.neurosystem.modules.marketdata.indicator.Indicator;
import org.neurosystem.util.misc.Pair;
/**
* MACD
*/
public class MACD extends Indicator<Pair<Double,Double>> {
private final double p_fastMultip, p_slowMultip, p_triggerMultip;
private double p_fastEMA, p_slowEMA, p_triggerEMA;
public MACD(IQuoteServer qs, int fastLength, int slowLength, int trigger) {
this(qs, fastLength, slowLength, trigger, AppliedPrice.CLOSE);
}
public MACD(IQuoteServer qs, int fastLength, int slowLength, int trigger, AppliedPrice appliedPrice) {
super(qs, appliedPrice);
this.p_fastMultip = 2. / (fastLength + 1.);
this.p_slowMultip = 2. / (slowLength + 1.);
this.p_triggerMultip = 2. / (trigger + 1.);
}
@Override
public Pair<Double, Double> calculate() {
Pair<Double, Double> value;
double price = quoteServer().lastValue().getPrice(appliedPrice());
if(size() == 0){
this.p_fastEMA = price;
this.p_slowEMA = price;
this.p_triggerEMA = 0;
}else{
this.p_fastEMA += (price - this.p_fastEMA) * this.p_fastMultip;
this.p_slowEMA += (price - this.p_slowEMA) * this.p_slowMultip;
this.p_triggerEMA += ((this.p_fastEMA - this.p_slowEMA) - this.p_triggerEMA) * this.p_triggerMultip;
}
value = new Pair<Double, Double>(this.p_fastEMA - this.p_slowEMA, this.p_triggerEMA);
addValue(value);
return value;
}
}
| [
"senhadjielrhazi@gmail.com"
] | senhadjielrhazi@gmail.com |
de56a6971490ac76282dce26e41c400fa04a67f6 | 3ac2f87a7efb813366e5fbb73d4aeec903241858 | /backup/EasyEngenharia_Jsp/src/java/br/com/easynet/gwt/easyportal/jb/Plr_planilha_recebimentoConsultJB.java | 8e15f8b04a373c31f302065f59c2fa3943807ebd | [] | no_license | topfontes/EngenhariaSoluction | 97c1357803a781e4af94da9d3d0737058f01f840 | 36042f1099d058365f0d7db08a805c774542a194 | refs/heads/master | 2021-01-11T09:01:26.010283 | 2018-10-05T20:46:19 | 2018-10-05T20:46:19 | 77,538,830 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package br.com.easynet.gwt.easyportal.jb;
import java.util.List;
import br.com.easynet.jb.BeanBase;
import br.com.jdragon.dao.DAOFactory;
import br.com.easynet.gwt.easyportal.dao.*;
import br.com.easynet.gwt.easyportal.transfer.*;
/** Classe Criada Automaticamente pelo "EasyNet Generate JDragon" */
public class Plr_planilha_recebimentoConsultJB extends SystemBase {
// Atributos e propriedades
private Plr_planilha_recebimentoT plr_planilha_recebimentoT = new Plr_planilha_recebimentoT();
public void setPlr_planilha_permutaT(Plr_planilha_recebimentoT plr_planilha_recebimentoT) {
this.plr_planilha_recebimentoT = plr_planilha_recebimentoT;
}
public Plr_planilha_recebimentoT getPlr_planilha_recebimentoT() {
return plr_planilha_recebimentoT;
}
private List<Plr_planilha_recebimentoT> list;
public List<Plr_planilha_recebimentoT> getList() {
return list;
}
public void setList(List<Plr_planilha_recebimentoT> list) {
this.list = list;
}
public void pageLoad() throws Exception {
super.pageLoad();
}
public void consult() throws Exception {
try {
Plr_planilha_recebimentoDAO plr_planilha_permutaDAO = getPlr_planilha_permutaDAO();
list = plr_planilha_permutaDAO.getAll(plr_planilha_recebimentoT);
} catch (Exception e) {
e.printStackTrace();
setMsg("Falha ao realizar consulta!");
} finally {
close();
}
}
public void delete() throws Exception {
try {
Plr_planilha_recebimentoDAO plr_planilha_permutaDAO = getPlr_planilha_permutaDAO();
plr_planilha_permutaDAO.delete(plr_planilha_recebimentoT);
setMsg("Exclus�o efetuada com sucesso!");
plr_planilha_recebimentoT = new Plr_planilha_recebimentoT();
consult();
} catch (Exception e) {
e.printStackTrace();
setMsg("Falha ao realizar exclus�o!");
} finally {
close();
}
}
public void insert() throws Exception {
// TODO Insert
try {
String page = "plr_planilha_permutaInsert.jsp";// defina aqui a p�gina que deve ser chamada
getResponse().sendRedirect(page);
} catch (Exception e){} }
public void cancel() throws Exception {
// TODO Cancel
try {
String page = "";// defina aqui a p�gina que deve ser chamada
getResponse().sendRedirect(page);
} catch (Exception e){}
}
}
| [
"topfontes@gmail.com"
] | topfontes@gmail.com |
00bb7d68b05a89ebe2fe1679afcac21f0d72b710 | 2ea1ca34b31d73d1ca8732cc3ed45668e8cdaab0 | /macaovehicle/macaovehicle-dao/src/main/java/com/qcloud/project/macaovehicle/dao/mysql/DriverVehicleDaoMysqlImpl.java | c5691f19d34c0d99ff9b0f41dbab853cd69be70f | [] | no_license | ChiRain/snaker | 07008c6aa07f10ac79f1787b4969f5e45a9c19e5 | 808945ca4fe5e7b11a969531fd0801a571c21c17 | refs/heads/master | 2021-01-18T01:48:44.523645 | 2016-07-26T06:04:15 | 2016-07-26T06:04:15 | 65,979,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,801 | java | package com.qcloud.project.macaovehicle.dao.mysql;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;
import org.apache.commons.lang.NotImplementedException;
import com.qcloud.pirates.data.Page;
import com.qcloud.pirates.data.sql.mybatis.SqlOperator;
import com.qcloud.pirates.util.StringUtil;
import com.qcloud.project.macaovehicle.dao.DriverVehicleDao;
import com.qcloud.project.macaovehicle.model.DriverVehicle;
import com.qcloud.project.macaovehicle.model.key.TypeEnum.ProgressType;
import com.qcloud.project.macaovehicle.model.query.DriverVehicleQuery;
@Repository
public class DriverVehicleDaoMysqlImpl implements DriverVehicleDao {
@Resource(name = "sqlOperator-macaovehicle")
private SqlOperator sqlOperator;
@Override
public boolean add(DriverVehicle driverVehicle) {
return sqlOperator.insert("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.insert", driverVehicle) == 1;
}
@Override
public DriverVehicle get(Long id) {
return sqlOperator.selectOne("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.get", id);
}
@Override
public boolean delete(Long id) {
return sqlOperator.delete("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.delete", id) > 0;
}
@Override
public boolean update(DriverVehicle driverVehicle) {
return sqlOperator.update("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.update", driverVehicle) > 0;
}
@Override
public List<DriverVehicle> list(List<Long> idList) {
throw new NotImplementedException();
}
@Override
public Map<Long, DriverVehicle> map(Set<Long> idSet) {
throw new NotImplementedException();
}
@Override
public Page<DriverVehicle> page(int start, int count) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("start", start);
param.put("count", count);
List<DriverVehicle> list = sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.list4page", param);
int total = sqlOperator.selectOne("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.count4page", param);
Page<DriverVehicle> page = new Page<DriverVehicle>();
page.setCount(total);
page.setData(list);
return page;
}
@Override
public Page<DriverVehicle> page(DriverVehicleQuery query, int start, int count) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("start", start);
param.put("count", count);
param.put("formInstCode", StringUtil.emptyToNull(query.getFormInstCode()));
param.put("groupByStr", StringUtil.emptyToNull(query.getGroupByStr()));
param.put("carOwnerId", query.getCarOwnerId());
param.put("state", query.getState());
List<DriverVehicle> list = sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.list4query", param);
int total = sqlOperator.selectOne("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.count4query", param);
Page<DriverVehicle> page = new Page<DriverVehicle>();
page.setCount(total);
page.setData(list);
return page;
}
@Override
public List<DriverVehicle> listAll() {
List<DriverVehicle> list = sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.listAll");
return list;
}
@Override
public List<DriverVehicle> getListByFormInstCode(String formInstCode) {
return sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.getByFormInstCode", formInstCode);
}
@Override
public List<DriverVehicle> listByQuery(DriverVehicleQuery query) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("formInstCode", query.getFormInstCode());
param.put("carOwnerId", query.getCarOwnerId());
param.put("type", query.getType());
param.put("state", query.getState());
param.put("vehicleId", query.getVehicleId());
param.put("driverId", query.getDriverId());
param.put("ric", StringUtil.emptyToNull(query.getRic()));
param.put("driverIc", StringUtil.emptyToNull(query.getDriverIc()));
param.put("formInstanceId", query.getFormInstanceId());
param.put("groupByStr", query.getGroupByStr());
List<DriverVehicle> list = sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.listByQuery", param);
return list;
}
@Override
public List<DriverVehicle> getListByDriverId(Long driverId, ProgressType progressType) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("driverId", driverId);
param.put("type", progressType.getKey());
return sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.getListByDriverId", param);
}
@Override
public List<DriverVehicle> getListByFormInstanceId(Long formInstanceId) {
return sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.getListByFormInstanceId", formInstanceId);
}
@Override
public List<DriverVehicle> getListByVehicleId(Long vehicleId, ProgressType progressType) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("vehicleId", vehicleId);
param.put("type", progressType.getKey());
return sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.getListByVehicleId", param);
}
@Override
public List<DriverVehicle> getListByDriverIc(String driverIc, ProgressType progressType) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("driverIc", driverIc);
param.put("type", progressType.getKey());
return sqlOperator.selectList("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.getListByDriverIc", param);
}
@Override
public int countAllVehicle(Long carOwnerId) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("carOwnerId", carOwnerId);
return sqlOperator.selectOne("com.qcloud.project.macaovehicle.dao.mysql.mapper.DriverVehicleMapper.countAllVehicle", param);
}
}
| [
"lihuashan@ed19df75-bd51-b445-9863-9e54940520a8"
] | lihuashan@ed19df75-bd51-b445-9863-9e54940520a8 |
dcfcc1515af586704aa4ad64c131d5666c0da7b1 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/digits/08c7ea4ac39aa6a5ab206393bb4412de9d2c365ecdda9c1b391be963c1811014ed23d2722d7433b8e8a95305eee314d39da4950f31e01f9147f90af91a5c433a/001/mutations/2506/digits_08c7ea4a_001.java | 8cf75bf38df60f3c8c6cc31e3af490daa8a53d4f | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,702 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class digits_08c7ea4a_001 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
digits_08c7ea4a_001 mainClass = new digits_08c7ea4a_001 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
IntObj num = new IntObj (), numl = new IntObj (), n = new IntObj (), d0 =
new IntObj (), d1 = new IntObj (), d2 = new IntObj (), d3 =
new IntObj (), d4 = new IntObj (), d5 = new IntObj (), d6 =
new IntObj (), d7 = new IntObj (), d8 = new IntObj (), d9 =
new IntObj ();
output += (String.format ("\nEnter an integer > "));
num.value = scanner.nextInt ();
numl.value = num.value;
n.value = 0;
while (numl.value > 0) {
n.value += 1;
numl.value = numl.value / 10;
}
d0.value = num.value % 10;
num.value = (num.value - d0.value) / 10;
d1.value = num.value % 10;
num.value = (((num.value) - (d0.value)) / 10 - d1.value) / 10;
d2.value = num.value % 10;
num.value = (num.value - d2.value) / 10;
d3.value = num.value % 10;
num.value = (num.value - d3.value) / 10;
d4.value = num.value % 10;
num.value = (num.value - d4.value) / 10;
d5.value = num.value % 10;
num.value = (num.value - d5.value) / 10;
d6.value = num.value % 10;
num.value = (num.value - d6.value) / 10;
d7.value = num.value % 10;
num.value = (num.value - d7.value) / 10;
d8.value = num.value % 10;
num.value = (num.value - d8.value) / 10;
d9.value = num.value % 10;
num.value = (num.value - d9.value) / 10;
output += (String.format ("\n%d\n", d0.value));
if (n.value > 1) {
output += (String.format ("%d\n", d1.value));
}
if (n.value > 2) {
output += (String.format ("%d\n", d2.value));
}
if (n.value > 3) {
output += (String.format ("%d\n", d3.value));
}
if (n.value > 4) {
output += (String.format ("%d\n", d4.value));
}
if (n.value > 5) {
output += (String.format ("%d\n", d5.value));
}
if (n.value > 6) {
output += (String.format ("%d\n", d6.value));
}
if (n.value > 7) {
output += (String.format ("%d\n", d7.value));
}
if (n.value > 8) {
output += (String.format ("%d\n", d8.value));
}
if (n.value > 9) {
output += (String.format ("%d\n", d9.value));
}
output += (String.format ("That's all, have a nice day!\n"));
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
f181bf21659def22975aea4831e0ef62cf737b44 | 661aeb42473e31cf4b5e947c576852ee87351bd6 | /examples/jsr223/src/main/java/org/eclipse/krazo/test/jsr223/GroovyController.java | cc422682f5153727a893013f796d550b3ef823ee | [
"Apache-2.0"
] | permissive | keilw/krazo | a2251d8d873847b45afc9705121d43787cb2ec31 | 4c6d4daf57c0fc79a4c3a9095af58cbaaf0fbd13 | refs/heads/master | 2020-04-28T07:37:59.686646 | 2019-03-06T10:47:00 | 2019-03-06T10:47:00 | 175,099,368 | 0 | 0 | null | 2019-03-11T23:26:13 | 2019-03-11T23:26:13 | null | UTF-8 | Java | false | false | 1,254 | java | /*
* Copyright © 2017, 2018 Ivar Grimstad
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.eclipse.krazo.test.jsr223;
import javax.inject.Inject;
import javax.mvc.Controller;
import javax.mvc.Models;
import javax.mvc.View;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
/**
* A Groovy controller.
*
* @author Manfred Riem (manfred.riem@oracle.com)
*/
@Path("groovy")
public class GroovyController {
@Inject
private Models models;
@GET
@Controller
@Produces("text/html")
@View("index.groovy")
public void index(@QueryParam("name") String name) {
models.put("name", name);
}
}
| [
"christian@kaltepoth.de"
] | christian@kaltepoth.de |
cbef246e8ef9927e1eb4f7005e4b85cc8fc1e4c2 | 9b32926df2e61d54bd5939d624ec7708044cb97f | /src/main/java/com/rocket/summer/framework/boot/context/properties/EnableConfigurationPropertiesImportSelector.java | a14570bf008faa11e05bb4e50f6ca7bbcca136c5 | [] | no_license | goder037/summer | d521c0b15c55692f9fd8ba2c0079bfb2331ef722 | 6b51014e9a3e3d85fb48899aa3898812826378d5 | refs/heads/master | 2022-10-08T12:23:58.088119 | 2019-11-19T07:58:13 | 2019-11-19T07:58:13 | 89,110,409 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,945 | java | package com.rocket.summer.framework.boot.context.properties;
import com.rocket.summer.framework.beans.factory.support.AbstractBeanDefinition;
import com.rocket.summer.framework.beans.factory.support.BeanDefinitionBuilder;
import com.rocket.summer.framework.beans.factory.support.BeanDefinitionRegistry;
import com.rocket.summer.framework.context.annotation.ImportBeanDefinitionRegistrar;
import com.rocket.summer.framework.context.annotation.ImportSelector;
import com.rocket.summer.framework.core.annotation.AnnotationUtils;
import com.rocket.summer.framework.core.type.AnnotationMetadata;
import com.rocket.summer.framework.util.Assert;
import com.rocket.summer.framework.util.MultiValueMap;
import com.rocket.summer.framework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Import selector that sets up binding of external properties to configuration classes
* (see {@link ConfigurationProperties}). It either registers a
* {@link ConfigurationProperties} bean or not, depending on whether the enclosing
* {@link EnableConfigurationProperties} explicitly declares one. If none is declared then
* a bean post processor will still kick in for any beans annotated as external
* configuration. If one is declared then it a bean definition is registered with id equal
* to the class name (thus an application context usually only contains one
* {@link ConfigurationProperties} bean of each unique type).
*
* @author Dave Syer
* @author Christian Dupuis
* @author Stephane Nicoll
*/
class EnableConfigurationPropertiesImportSelector implements ImportSelector {
@Override
public String[] selectImports(AnnotationMetadata metadata) {
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(
EnableConfigurationProperties.class.getName(), false);
Object[] type = (attributes != null) ? (Object[]) attributes.getFirst("value")
: null;
if (type == null || type.length == 0) {
return new String[] {
ConfigurationPropertiesBindingPostProcessorRegistrar.class
.getName() };
}
return new String[] { ConfigurationPropertiesBeanRegistrar.class.getName(),
ConfigurationPropertiesBindingPostProcessorRegistrar.class.getName() };
}
/**
* {@link ImportBeanDefinitionRegistrar} for configuration properties support.
*/
public static class ConfigurationPropertiesBeanRegistrar
implements ImportBeanDefinitionRegistrar {
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata,
BeanDefinitionRegistry registry) {
MultiValueMap<String, Object> attributes = metadata
.getAllAnnotationAttributes(
EnableConfigurationProperties.class.getName(), false);
List<Class<?>> types = collectClasses(attributes.get("value"));
for (Class<?> type : types) {
String prefix = extractPrefix(type);
String name = (StringUtils.hasText(prefix) ? prefix + "-" + type.getName()
: type.getName());
if (!registry.containsBeanDefinition(name)) {
registerBeanDefinition(registry, type, name);
}
}
}
private String extractPrefix(Class<?> type) {
ConfigurationProperties annotation = AnnotationUtils.findAnnotation(type,
ConfigurationProperties.class);
if (annotation != null) {
return annotation.prefix();
}
return "";
}
private List<Class<?>> collectClasses(List<Object> list) {
ArrayList<Class<?>> result = new ArrayList<Class<?>>();
for (Object object : list) {
for (Object value : (Object[]) object) {
if (value instanceof Class && value != void.class) {
result.add((Class<?>) value);
}
}
}
return result;
}
private void registerBeanDefinition(BeanDefinitionRegistry registry,
Class<?> type, String name) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder
.genericBeanDefinition(type);
AbstractBeanDefinition beanDefinition = builder.getBeanDefinition();
registry.registerBeanDefinition(name, beanDefinition);
ConfigurationProperties properties = AnnotationUtils.findAnnotation(type,
ConfigurationProperties.class);
Assert.notNull(properties,
"No " + ConfigurationProperties.class.getSimpleName()
+ " annotation found on '" + type.getName() + "'.");
}
}
}
| [
"liujie152@hotmail.com"
] | liujie152@hotmail.com |
dc55c41950d1ac75ace403416e647a685a8b0db5 | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /cytoscape/tags/parent-2.8.0-beta3/application/src/test/java/cytoscape/util/ScalerFactoryTest.java | 6b0d32c28ca944d75588f16cf56ee174c5a03ae5 | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package cytoscape.util;
import junit.framework.*;
public class ScalerFactoryTest extends TestCase {
public void testGetKnownScaler() {
final Scaler linearScaler = ScalerFactory.getScaler("linear");
assertTrue(linearScaler instanceof LinearScaler);
final Scaler rankScaler = ScalerFactory.getScaler("rank");
assertTrue(rankScaler instanceof RankScaler);
}
public void testGetUnknownScaler() {
try {
final Scaler scaler = ScalerFactory.getScaler("random junk!#$");
fail();
} catch (final IllegalArgumentException e) {
assertTrue(true);
}
}
} | [
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
f55ce61f5609e9c7b08a0da65613280b14cf0616 | b0e9958c7af0af5133c3aa88be01b3b79296b425 | /StarHydro/src/app/worker/StreamNetworkWorker.java | 2942fc3f8024cbd9755f88cfd6390e34cf91af3a | [] | no_license | starteam/starhydro_workspace | fb9c43375e6a0a97e3158353664744e12e622a05 | 69a4ab61a29a2ab1137f6e7db0d5de52fd054d2c | refs/heads/master | 2021-01-22T22:50:12.903953 | 2013-06-24T17:23:08 | 2013-06-24T17:23:08 | 10,913,524 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,364 | java | package app.worker;
import java.awt.Point;
import javax.vecmath.Point3f;
import star.annotations.Handles;
import star.annotations.Properties;
import star.annotations.Property;
import star.annotations.SignalComponent;
import star.hydrology.data.interfaces.GridwStat;
import star.hydrology.events.GridStatisticsProviderChangeRaiser;
import star.hydrology.events.SelectWatershedOriginRaiser;
import star.hydrology.events.StreamRootChangeEvent;
import star.hydrology.events.StreamRootChangeRaiser;
import star.hydrology.events.interfaces.LayerConstants;
import star.hydrology.events.interfaces.PaletteRenderableLayer;
import star.hydrology.events.map.FilledMapLayerRaiser;
import star.hydrology.events.map.FlowaccumulationMapLayerRaiser;
import star.hydrology.events.map.FlowdirectionMapLayerRaiser;
import app.worker.streamnetwork.Channel;
import app.worker.streamnetwork.Stream;
@SignalComponent(extend = AbstractWorker.class)
@Properties( { @Property(name = "flowAccomulation", type = PaletteRenderableLayer.class), @Property(name = "flowDirection", type = PaletteRenderableLayer.class), @Property(name = "terrain", type = PaletteRenderableLayer.class), @Property(name = "center", type = Point3f.class),
@Property(name = "channelRoot", type = Channel.class), @Property(name = "watershedOrigin", type = Point.class), @Property(name = "streamRoot", type = Stream.class, getter = Property.PUBLIC) })
public class StreamNetworkWorker extends StreamNetworkWorker_generated
{
private float threshold = 256;
@Handles(raises = { StreamRootChangeRaiser.class })
void setTerrain(FilledMapLayerRaiser terrain, FlowaccumulationMapLayerRaiser flowAcc, FlowdirectionMapLayerRaiser flowDir)
{
setTerrain(terrain.getLayer());
setCenter(terrain.getLayer());
setFlowAccomulation(flowAcc.getLayer());
setFlowDirection(flowDir.getLayer());
updateLayer();
}
@Handles(raises = { StreamRootChangeRaiser.class })
void setAccumulationTreshold(GridStatisticsProviderChangeRaiser r)
{
if (r.getKind() == LayerConstants.STREAMS)
{
setAdjustableValue(r.getCurrent());
}
}
@Handles(raises = { StreamRootChangeRaiser.class })
void setWatershedOrigin(SelectWatershedOriginRaiser r)
{
enumerateStreams(r.getPoint());
}
public int getLayerKind()
{
return LayerConstants.STREAMNETWORK;
}
private void setCenter(PaletteRenderableLayer layer)
{
if (layer != null && layer.getDataset() instanceof GridwStat)
{
GridwStat gs = (GridwStat) layer.getDataset();
Point3f center = gs.getCenter();
setCenter(center);
}
}
protected void setStreamRoot(Stream streamRoot)
{
super.setStreamRoot(streamRoot);
(new StreamRootChangeEvent(this, streamRoot != null)).raise();
}
private void setAdjustableValue(float value)
{
this.threshold = value;
updateLayer();
}
private float getAdjustableValue()
{
return this.threshold;
}
private Point getNearestRiver(Point3f point)
{
if (getFlowAccomulation() != null && getFlowDirection() != null)
{
int rows = getFlowAccomulation().getDataset().getRows();
int cols = getFlowAccomulation().getDataset().getCols();
float distance = Float.MAX_VALUE;
int xmin = -1;
int ymin = -1;
float[] f1 = new float[3];
Point3f p = new Point3f();
for (int y = 0; y < rows - 1; y++)
{
for (int x = 0; x < cols - 1; x++)
{
float accomulation = getFlowAccomulation().getDataset().getElementAt(x, y);
if (accomulation > getAdjustableValue())
{
getFlowAccomulation().getDataset().getPoint(x, y, f1);
p.x = f1[0] - getCenter().x;
p.y = f1[1] - getCenter().y;
p.z = f1[2] - getCenter().z;
float d = distance2d(p, point);
if (d < distance)
{
distance = d;
xmin = x;
ymin = y;
}
}
}
}
return new Point(xmin, ymin);
}
return null;
}
private float distance2d(Point3f a, Point3f b)
{
float dx = a.x - b.x;
float dy = a.y - b.y;
float dz = 0;
float d2 = dx * dx + dy * dy + dz * dz;
return (float) Math.sqrt(d2);
}
private void enumerateStreams(Point3f point)
{
setWatershedOrigin(point != null && getCenter() != null ? getNearestRiver(point) : null);
updateLayer();
}
private void updateLayer()
{
Point watershedOrigin = getWatershedOrigin();
if (watershedOrigin != null)
{
Channel channelRoot = new Channel(getTerrain(), getFlowAccomulation());
walk(watershedOrigin.x, watershedOrigin.y, channelRoot);
setChannelRoot(channelRoot);
Stream streamRoot = consolidate(channelRoot);
setStreamRoot(streamRoot);
}
else
{
setChannelRoot(null);
setStreamRoot(null);
}
}
private int depth = 0;
private void walk(int x, int y, Channel c)
{
try
{
depth++;
c.addPoint(x, y);
int n = getNeighbourCount(x, y);
if (n == 1)
{
for (int i = 0; i < offsetX.length; i++)
{
if (offsetDir[i] == (int) getFlowDirection().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]) && threshold < getFlowAccomulation().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]))
{
walk(x + offsetX[i], y + offsetY[i], c);
}
}
}
else
{
for (int i = 0; i < offsetX.length; i++)
{
if (offsetDir[i] == (int) getFlowDirection().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]) && threshold < getFlowAccomulation().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]))
{
Channel child = new Channel(getTerrain(), getFlowAccomulation());
child.addPoint(x, y);
c.addChild(child);
walk(x + offsetX[i], y + offsetY[i], child);
}
}
}
depth--;
}
catch (StackOverflowError stack)
{
System.err.println("Stack Error " + depth);
}
}
private int[] offsetX = new int[] { 1, 1, 0, -1, -1, -1, 0, 1 };
private int[] offsetY = new int[] { 0, 1, 1, 1, 0, -1, -1, -1 };
private int[] offsetDir = new int[] { 16, 32, 64, 128, 1, 2, 4, 8 };
private int getNeighbourCount(int x, int y)
{
int ret = 0;
for (int i = 0; i < offsetX.length; i++)
{
if (offsetDir[i] == (int) getFlowDirection().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]) && threshold < getFlowAccomulation().getDataset().getElementAt(x + offsetX[i], y + offsetY[i]))
{
ret++;
}
}
return ret;
}
private Stream consolidate(Channel root)
{
Stream streams = new Stream(root);
return streams;
}
}
| [
"iceraj@gmail.com"
] | iceraj@gmail.com |
a56bc4c3732ff01d60219488325b3db93411d36f | f20b41c85d1d9a6ad8f74c2b815cd657954af0ad | /frontend/dist/src/test/java/org/smartdeveloperhub/harvesters/it/testing/util/AppAssembler.java | 6291ebcba4cacf6cd75b6a9adc974dfe62e5a9e0 | [
"Apache-2.0"
] | permissive | SmartDeveloperHub/sdh-it-harvester | 67e6f1fa002949e807f5fd69f019e84e7453c370 | 122c1cc79debc9f78567384d141f58d0d56369d5 | refs/heads/master | 2021-01-18T19:10:19.603775 | 2016-07-18T17:24:04 | 2016-07-18T17:24:04 | 56,482,219 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,756 | java | /**
* #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
* This file is part of the Smart Developer Hub Project:
* http://www.smartdeveloperhub.org/
*
* Center for Open Middleware
* http://www.centeropenmiddleware.com/
* #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
* Copyright (C) 2015-2016 Center for Open Middleware.
* #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
* 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.
* #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
* Artifact : org.smartdeveloperhub.harvesters.it.frontend:it-frontend-dist:0.1.0
* Bundle : it-frontend-dist-0.1.0.war
* #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
*/
package org.smartdeveloperhub.harvesters.it.testing.util;
public final class AppAssembler {
private AppAssembler() {
}
public static String applicationName(final Class<?> appClass) {
final String name = System.getProperty("app.name");
if(name==null) {
return appClass.getName();
}
String ext=".bat";
if(System.getenv("MSYSTEM")!=null) {
ext=".sh";
}
return name+ext;
}
}
| [
"m.esteban.gutierrez@gmail.com"
] | m.esteban.gutierrez@gmail.com |
34bc0fc5a5c8a103dcce434dd19a091acb5ddb8e | 8e615ccc5b96e64a3e50a74e668f658cff9640cb | /ccredit/src/main/java/ccredit/xtmodules/xtservice/XtUserinfoService.java | 80ebf0d2e536840ba094cc8af01b909e62afcfad | [] | no_license | Adoxhh/ccredit | bf6156cce6c207d2f7f852ce267e26b225beb665 | f52ae7b354adfec3556943904bbde7f047f81bc5 | refs/heads/master | 2022-12-25T00:57:24.501846 | 2018-05-21T03:01:44 | 2018-05-21T03:01:44 | 132,726,468 | 0 | 1 | null | 2022-12-16T08:04:04 | 2018-05-09T08:32:06 | JavaScript | UTF-8 | Java | false | false | 1,969 | java | package ccredit.xtmodules.xtservice;
import java.util.List;
import java.util.Map;
import ccredit.xtmodules.xtmodel.XtUserinfo;
/**
* 员工信息表
* 2015-05-12 11:04:35 邓纯杰
*/
public interface XtUserinfoService{
/**
* 分页
* @param condition
* @return
*/
public List<XtUserinfo> getXtUserinfoListByCondition(Map<String,Object> condition);
/**
* 已删除用户
* @param condition
* @return
*/
public List<XtUserinfo> getXtUserinfoDeletedListByCondition(Map<String,Object> condition);
/**
* 恢复用户
* @param condition
* @return
*/
public int recoverXtUserinfo(Map<String,Object> condition);
/**
* 查询对象
* @param xt_userinfo_id
* @return
*/
public XtUserinfo getXtUserinfoById(String xt_userinfo_id);
/**
* 添加
* @param xt_userinfo
* @return
*/
public int addXtUserinfo(XtUserinfo xt_Userinfo);
/**
* 修改
* @param xt_userinfo
* @return
*/
public int updateXtUserinfo(XtUserinfo xt_Userinfo);
/**
* 删除
* @param condition
* @return
*/
public int delXtUserinfo(Map<String,Object> condition);
/**
* 登录
* @param condition
* @return
*/
public XtUserinfo getXtUserinfoByUP(Map<String,Object> condition);
/**
* 读取所有用户根据各种情况非分页
* @param condition
* @return
*/
public List<XtUserinfo> getXtUserinfoListAllByCondition(Map<String,Object> condition);
/**
* 修改密码
* @param condition
* @return
*/
public int updatePwd(Map<String,Object> condition);
/**
* 验证用户名是否存在
* @return
*/
public int validateUser(Map<String,Object> condition);
/**
* 根据各种情况查找集合不分页(流程设计器中处理人 发起人 发起人组等使用)
* @param condition
* @return
*/
@SuppressWarnings("unchecked")
public List<XtUserinfo> getXtUserinfoList(Map<String,Object> condition);
}
| [
"87052113@qq.com"
] | 87052113@qq.com |
dd6f3f7cb173bf2f93992b6467067388b8ac3ffd | 5cff4e9d7e28f9d8d1892b2ceee72826d236c8b2 | /Tree/leetcode_058_GetKeysInBinaryTreeLayerByLayerZig-ZagOrder.java | 68b11f07b18ca90893afbbd622343768090c92c6 | [
"Apache-2.0"
] | permissive | FuyaoLi2017/leetcode | af98d1aafb438e764cf8d3c8f3378dd17e810cce | be6d5112944c08bef442d46960270af4f08fe7a8 | refs/heads/master | 2021-06-03T20:24:47.985641 | 2020-04-07T07:01:52 | 2020-04-07T07:01:52 | 125,790,003 | 1 | 1 | null | 2018-09-25T18:08:59 | 2018-03-19T02:21:25 | Java | UTF-8 | Java | false | false | 1,801 | java | /*
Get the list of keys in a given binary tree layer by layer in zig-zag order.
Examples
5
/ \
3 8
/ \ \
1 4 11
the result is [5, 3, 8, 11, 4, 1]
Corner Cases
What if the binary tree is null? Return an empty list in this case.
How is the binary tree represented?
We use the level order traversal sequence with a special symbol "#" denoting the null node.
For Example:
The sequence [1, 2, 3, #, #, 4] represents the following binary tree:
1
/ \
2 3
/
4
*/
/**
* public class TreeNode {
* public int key;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int key) {
* this.key = key;
* }
* }
*/
// my solution,
public class Solution {
public List<Integer> zigZag(TreeNode root) {
List<Integer> res = new ArrayList<>();
// 用BFS, 在奇数层反序排列
if (root == null)
return res;
Queue<TreeNode> q = new LinkedList<>();
q.offer(root);
int level = 1;
while (!q.isEmpty()) {
int size = q.size();
int resSize = res.size();
while (size > 0) {
TreeNode cur = q.poll();
if (cur != null)
res.add(cur.key);
if (cur.left != null)
q.offer(cur.left);
if (cur.right != null)
q.offer(cur.right);
size--;
}
if (level % 2 == 1) {
reverse(res, resSize, res.size() - 1);
}
level++;
}
return res;
}
private void reverse(List<Integer> array, int start, int end) {
// reverse the sequence between the array
while (start < end) {
int temp = array.get(start);
array.set(start, array.get(end));
array.set(end, temp);
start++;
end--;
}
}
}
// laicode answer
| [
"1605419584@qq.com"
] | 1605419584@qq.com |
ef235007d81bb44cbb4f121a82ae0058f6efddcd | 2b2fcb1902206ad0f207305b9268838504c3749b | /WakfuClientSources/srcx/class_977_aJa.java | 145751005a9ba87ebd022952883d37733bce2622 | [] | no_license | shelsonjava/Synx | 4fbcee964631f747efc9296477dee5a22826791a | 0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d | refs/heads/master | 2021-01-15T13:51:41.816571 | 2013-11-17T10:46:22 | 2013-11-17T10:46:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | public class aJa extends bzu
{
private aYn eiP;
public aJa(aYn paramaYn)
{
this.eiP = paramaYn;
}
public aYn aVj() {
return this.eiP;
}
} | [
"music_inme@hotmail.fr"
] | music_inme@hotmail.fr |
7ba89004e9bcd0223de96b078fba05e1062d657a | b9a71bb2805d5f0d5ac98c59d984246463285d34 | /testing/droolsjbpm-integration-master/kie-aries-blueprint/src/test/java/org/kie/aries/blueprint/tests/KieBlueprintEnvironmentTest.java | 760d95291eaf32c82da9d01121ab47dc8130ad3a | [
"MIT"
] | permissive | rokn/Count_Words_2015 | 486f3b292954adc76c9bcdbf9a37eb07421ddd2a | e07f6fc9dfceaf773afc0c3a614093e16a0cde16 | refs/heads/master | 2021-01-10T04:23:49.999237 | 2016-01-11T19:53:31 | 2016-01-11T19:53:31 | 48,538,207 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,671 | java | /*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* 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.kie.aries.blueprint.tests;
import org.apache.aries.blueprint.container.BlueprintContainerImpl;
import org.drools.core.base.CalendarsImpl;
import org.drools.core.base.MapGlobalResolver;
import org.drools.core.marshalling.impl.IdentityPlaceholderResolverStrategy;
import org.drools.core.marshalling.impl.SerializablePlaceholderResolverStrategy;
import org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy;
import org.jbpm.marshalling.impl.ProcessInstanceResolverStrategy;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.kie.api.marshalling.ObjectMarshallingStrategy;
import org.kie.api.runtime.Environment;
import org.kie.api.runtime.EnvironmentName;
import org.kie.aries.blueprint.KieBlueprintContainer;
import org.kie.aries.blueprint.mocks.MockEntityManager;
import org.kie.aries.blueprint.mocks.MockJpaTransactionManager;
import org.kie.aries.blueprint.mocks.MockObjectMarshallingStrategy;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;
@Ignore("Add when org.apache.aries.blueprint.noosgi 1.0.1 is released")
public class KieBlueprintEnvironmentTest {
static BlueprintContainerImpl container = null;
@BeforeClass
public static void runBeforeClass() throws Exception {
List<URL> urls = new ArrayList<URL>();
urls.add(KieBlueprintListenerTest.class.getResource("/org/kie/aries/blueprint/environment.xml"));
container = new KieBlueprintContainer(ClassLoader.getSystemClassLoader(), urls);
}
@Test
public void testCtxNotNull() throws Exception {
assertNotNull(container);
}
@Test
public void testEnvRef() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
}
@Test
public void testEnvRefTransManager() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
assertNotNull(environment.get(EnvironmentName.TRANSACTION_MANAGER));
assertTrue(environment.get(EnvironmentName.TRANSACTION_MANAGER) instanceof MockJpaTransactionManager);
}
@Test
public void testEnvRefEMF() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
assertNotNull(environment.get(EnvironmentName.ENTITY_MANAGER_FACTORY));
assertTrue(environment.get(EnvironmentName.ENTITY_MANAGER_FACTORY) instanceof MockEntityManager);
}
@Test
public void testEnvRefGlobals() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
assertNotNull(environment.get(EnvironmentName.GLOBALS));
assertTrue(environment.get(EnvironmentName.GLOBALS) instanceof MapGlobalResolver);
}
@Test
public void testEnvRefCalendars() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
assertNotNull(environment.get(EnvironmentName.CALENDARS));
assertTrue(environment.get(EnvironmentName.CALENDARS) instanceof CalendarsImpl);
}
@Test
public void testEmptyEnvRef() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-empty-env");
assertNotNull(environment);
}
@Test
public void testEnvCustomMarshallerRef() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env-custom-marshaller-ref");
assertNotNull(environment);
ObjectMarshallingStrategy[] objectMarshallingStrategies = (ObjectMarshallingStrategy[]) environment.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES);
assertEquals(1, objectMarshallingStrategies.length);
assertEquals(objectMarshallingStrategies[0].getClass().getName(), "org.kie.aries.blueprint.mocks.MockObjectMarshallingStrategy");
}
@Test
public void testEnvMarshallerOrder() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env");
assertNotNull(environment);
ObjectMarshallingStrategy[] objectMarshallingStrategies = (ObjectMarshallingStrategy[]) environment.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES);
assertEquals(4, objectMarshallingStrategies.length);
assertTrue(objectMarshallingStrategies[0] instanceof SerializablePlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[1] instanceof IdentityPlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[2] instanceof JPAPlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[3] instanceof ProcessInstanceResolverStrategy);
}
@Test
public void testEnvMarshallerOrderWithCustom() throws Exception {
Environment environment = (Environment) container.getComponentInstance("drools-env-custom-marshaller-mixed");
assertNotNull(environment);
ObjectMarshallingStrategy[] objectMarshallingStrategies = (ObjectMarshallingStrategy[]) environment.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES);
assertEquals(5, objectMarshallingStrategies.length);
assertTrue(objectMarshallingStrategies[0] instanceof SerializablePlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[1] instanceof IdentityPlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[2] instanceof JPAPlaceholderResolverStrategy);
assertTrue(objectMarshallingStrategies[3] instanceof MockObjectMarshallingStrategy);
assertTrue(objectMarshallingStrategies[4] instanceof ProcessInstanceResolverStrategy);
}
@AfterClass
public static void tearDown(){
container.destroy();
}
}
| [
"marto_dimitrov@mail.bg"
] | marto_dimitrov@mail.bg |
bcbfbbe393b2b4c116f37964ad83cf30c3b4399b | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/elastic--elasticsearch/0fa5b87fddc10ce487299c10fd3a833962058959/before/EsExecutors.java | 95397794509e8eb69aceaed461929906bf890d4e | [] | 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 | 6,346 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.common.util.concurrent;
import com.google.common.base.Joiner;
import org.elasticsearch.common.settings.Settings;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
*
*/
public class EsExecutors {
/**
* Settings key to manually set the number of available processors.
* This is used to adjust thread pools sizes etc. per node.
*/
public static final String PROCESSORS = "processors";
/**
* Returns the number of processors available but at most <tt>32</tt>.
*/
public static int boundedNumberOfProcessors(Settings settings) {
/* This relates to issues where machines with large number of cores
* ie. >= 48 create too many threads and run into OOM see #3478
* We just use an 32 core upper-bound here to not stress the system
* too much with too many created threads */
return settings.getAsInt(PROCESSORS, Math.min(32, Runtime.getRuntime().availableProcessors()));
}
public static PrioritizedEsThreadPoolExecutor newSinglePrioritizing(ThreadFactory threadFactory) {
return new PrioritizedEsThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, threadFactory);
}
public static EsThreadPoolExecutor newScaling(int min, int max, long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
ExecutorScalingQueue<Runnable> queue = new ExecutorScalingQueue<>();
// we force the execution, since we might run into concurrency issues in offer for ScalingBlockingQueue
EsThreadPoolExecutor executor = new EsThreadPoolExecutor(min, max, keepAliveTime, unit, queue, threadFactory, new ForceQueuePolicy());
queue.executor = executor;
return executor;
}
public static EsThreadPoolExecutor newCached(long keepAliveTime, TimeUnit unit, ThreadFactory threadFactory) {
return new EsThreadPoolExecutor(0, Integer.MAX_VALUE, keepAliveTime, unit, new SynchronousQueue<Runnable>(), threadFactory, new EsAbortPolicy());
}
public static EsThreadPoolExecutor newFixed(int size, int queueCapacity, ThreadFactory threadFactory) {
BlockingQueue<Runnable> queue;
if (queueCapacity < 0) {
queue = ConcurrentCollections.newBlockingQueue();
} else {
queue = new SizeBlockingQueue<>(ConcurrentCollections.<Runnable>newBlockingQueue(), queueCapacity);
}
return new EsThreadPoolExecutor(size, size, 0, TimeUnit.MILLISECONDS, queue, threadFactory, new EsAbortPolicy());
}
public static String threadName(Settings settings, String ... names) {
return threadName(settings, "[" + Joiner.on(".").skipNulls().join(names) + "]");
}
public static String threadName(Settings settings, String namePrefix) {
String name = settings.get("name");
if (name == null) {
name = "elasticsearch";
} else {
name = "elasticsearch[" + name + "]";
}
return name + "[" + namePrefix + "]";
}
public static ThreadFactory daemonThreadFactory(Settings settings, String namePrefix) {
return daemonThreadFactory(threadName(settings, namePrefix));
}
public static ThreadFactory daemonThreadFactory(Settings settings, String ... names) {
return daemonThreadFactory(threadName(settings, names));
}
public static ThreadFactory daemonThreadFactory(String namePrefix) {
return new EsThreadFactory(namePrefix);
}
static class EsThreadFactory implements ThreadFactory {
final ThreadGroup group;
final AtomicInteger threadNumber = new AtomicInteger(1);
final String namePrefix;
public EsThreadFactory(String namePrefix) {
this.namePrefix = namePrefix;
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
}
@Override
public Thread newThread(Runnable r) {
Thread t = new Thread(group, r,
namePrefix + "[T#" + threadNumber.getAndIncrement() + "]",
0);
t.setDaemon(true);
return t;
}
}
/**
* Cannot instantiate.
*/
private EsExecutors() {
}
static class ExecutorScalingQueue<E> extends LinkedTransferQueue<E> {
ThreadPoolExecutor executor;
public ExecutorScalingQueue() {
}
@Override
public boolean offer(E e) {
if (!tryTransfer(e)) {
int left = executor.getMaximumPoolSize() - executor.getCorePoolSize();
if (left > 0) {
return false;
} else {
return super.offer(e);
}
} else {
return true;
}
}
}
/**
* A handler for rejected tasks that adds the specified element to this queue,
* waiting if necessary for space to become available.
*/
static class ForceQueuePolicy implements XRejectedExecutionHandler {
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
try {
executor.getQueue().put(r);
} catch (InterruptedException e) {
//should never happen since we never wait
throw new EsRejectedExecutionException(e);
}
}
@Override
public long rejected() {
return 0;
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
fafde0038acc97515e84209ed7adcc0e270499aa | 8311139d16e04e0ada7a45b8c530ae2e5f600b1c | /jaxws/hugeWsdl.war/WEB-INF/classes/com/redhat/gss/ws20/BigObject11.java | 2a309e681926238dd8b09754f11597e79db8ff69 | [] | no_license | kylape/support-examples | b9a494bf7dbc3671b21def7d89a32e35d4d0d00c | ade17506093fa3f50bc8d8a685572cf6329868e7 | refs/heads/master | 2020-05-17T10:43:54.707699 | 2014-11-28T16:22:14 | 2014-11-28T16:22:14 | 6,583,210 | 2 | 2 | null | 2014-06-19T22:38:39 | 2012-11-07T17:27:56 | Java | UTF-8 | Java | false | false | 4,253 | java | package com.redhat.gss.ws20;
public class BigObject11
{
private String arg0 = null;
private String arg1 = null;
private String arg2 = null;
private String arg3 = null;
private String arg4 = null;
private String arg5 = null;
private String arg6 = null;
private String arg7 = null;
private String arg8 = null;
private String arg9 = null;
private String arg10 = null;
private String arg11 = null;
private String arg12 = null;
private String arg13 = null;
private String arg14 = null;
private String arg15 = null;
private String arg16 = null;
private String arg17 = null;
private String arg18 = null;
private String arg19 = null;
private String arg20 = null;
private String arg21 = null;
private String arg22 = null;
private String arg23 = null;
private String arg24 = null;
private String arg25 = null;
public String getArg25()
{
return this.arg25;
}
public void setArg25(String arg25)
{
this.arg25 = arg25;
}
public String getArg24()
{
return this.arg24;
}
public void setArg24(String arg24)
{
this.arg24 = arg24;
}
public String getArg23()
{
return this.arg23;
}
public void setArg23(String arg23)
{
this.arg23 = arg23;
}
public String getArg22()
{
return this.arg22;
}
public void setArg22(String arg22)
{
this.arg22 = arg22;
}
public String getArg21()
{
return this.arg21;
}
public void setArg21(String arg21)
{
this.arg21 = arg21;
}
public String getArg20()
{
return this.arg20;
}
public void setArg20(String arg20)
{
this.arg20 = arg20;
}
public String getArg19()
{
return this.arg19;
}
public void setArg19(String arg19)
{
this.arg19 = arg19;
}
public String getArg18()
{
return this.arg18;
}
public void setArg18(String arg18)
{
this.arg18 = arg18;
}
public String getArg17()
{
return this.arg17;
}
public void setArg17(String arg17)
{
this.arg17 = arg17;
}
public String getArg16()
{
return this.arg16;
}
public void setArg16(String arg16)
{
this.arg16 = arg16;
}
public String getArg15()
{
return this.arg15;
}
public void setArg15(String arg15)
{
this.arg15 = arg15;
}
public String getArg14()
{
return this.arg14;
}
public void setArg14(String arg14)
{
this.arg14 = arg14;
}
public String getArg13()
{
return this.arg13;
}
public void setArg13(String arg13)
{
this.arg13 = arg13;
}
public String getArg12()
{
return this.arg12;
}
public void setArg12(String arg12)
{
this.arg12 = arg12;
}
public String getArg11()
{
return this.arg11;
}
public void setArg11(String arg11)
{
this.arg11 = arg11;
}
public String getArg10()
{
return this.arg10;
}
public void setArg10(String arg10)
{
this.arg10 = arg10;
}
public String getArg9()
{
return this.arg9;
}
public void setArg9(String arg9)
{
this.arg9 = arg9;
}
public String getArg8()
{
return this.arg8;
}
public void setArg8(String arg8)
{
this.arg8 = arg8;
}
public String getArg7()
{
return this.arg7;
}
public void setArg7(String arg7)
{
this.arg7 = arg7;
}
public String getArg6()
{
return this.arg6;
}
public void setArg6(String arg6)
{
this.arg6 = arg6;
}
public String getArg5()
{
return this.arg5;
}
public void setArg5(String arg5)
{
this.arg5 = arg5;
}
public String getArg4()
{
return this.arg4;
}
public void setArg4(String arg4)
{
this.arg4 = arg4;
}
public String getArg3()
{
return this.arg3;
}
public void setArg3(String arg3)
{
this.arg3 = arg3;
}
public String getArg2()
{
return this.arg2;
}
public void setArg2(String arg2)
{
this.arg2 = arg2;
}
public String getArg1()
{
return this.arg1;
}
public void setArg1(String arg1)
{
this.arg1 = arg1;
}
public String getArg0()
{
return this.arg0;
}
public void setArg0(String arg0)
{
this.arg0 = arg0;
}
}
| [
"kyle.lape@redhat.com"
] | kyle.lape@redhat.com |
87fe1fb80c1ad226999ce4854144b7ca2d209390 | 14594fc1548a5c9e3ec2798a40e70102cce9949b | /my-service/my-service-algorithm/src/main/java/indi/uhyils/util/network/core/Loss.java | 6f892b231a47e958388a21f21b82a635a2351e4f | [] | no_license | WorldInEye/my | 7070d6b6dd421848673a1fe46c0c8fefc4e44619 | f0b7f458551afea420379edaac2eb5602d41f83f | refs/heads/master | 2023-07-20T10:05:54.527117 | 2021-07-01T00:42:31 | 2021-07-01T00:42:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package indi.uhyils.util.network.core;
/**
* 损失函数
*
* @author uhyils <247452312@qq.com>
* @date 文件创建日期 2020年07月25日 09时45分
*/
public interface Loss {
/**
* 计算损失函数后的值
*
* @param result 数据集
* @param label 标签
* @return 损失值
*/
Double[] getLossNum(Resultable result, Resultable label);
}
| [
"admin@example.com"
] | admin@example.com |
4c26fc4a90fe95c002e1457ce6f5ac20d2d5b796 | 9cc71443dfa5226118f76ae705ea09e30ae66f7a | /gameserver/src/gameserver/itemengine/actions/SkillLearnAction.java | 05d4ad1f92857ed6c37c7e784ab642c29399c48f | [] | no_license | osiris087/aionj | bedee651beb30b8e2e0163e60cbd03681077d80e | b12efe6d8f089f4ba313d519b32884b9395db904 | refs/heads/master | 2021-01-01T18:37:11.834976 | 2011-09-09T02:45:38 | 2011-09-09T02:45:38 | 2,353,467 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,006 | java | /*
* This file is part of aion-unique <www.aion-unique.com>.
*
* aion-unique 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.
*
* aion-unique 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 aion-unique. If not, see <http://www.gnu.org/licenses/>.
*/
package gameserver.itemengine.actions;
import gameserver.dataholders.DataManager;
import gameserver.model.PlayerClass;
import gameserver.model.gameobjects.Item;
import gameserver.model.gameobjects.player.Player;
import gameserver.model.templates.item.ItemTemplate;
import gameserver.network.aion.serverpackets.SM_DELETE_ITEM;
import gameserver.network.aion.serverpackets.SM_ITEM_USAGE_ANIMATION;
import gameserver.skill.model.SkillTemplate;
import gameserver.skill.model.learn.SkillClass;
import gameserver.skill.model.learn.SkillRace;
import gameserver.utils.PacketSendUtility;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* @author ATracer
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SkillLearnAction")
public class SkillLearnAction extends AbstractItemAction
{
@XmlAttribute
protected int skillid;
@XmlAttribute
protected int level;
@XmlAttribute(name = "class")
protected SkillClass playerClass;
@XmlAttribute
protected SkillRace race;
@Override
public boolean canAct(Player player, Item parentItem, Item targetItem)
{
return validateConditions(player);
}
@Override
public void act(Player player, Item parentItem, Item targetItem)
{
//item animation and message
ItemTemplate itemTemplate = parentItem.getItemTemplate();
//PacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.USE_ITEM(itemTemplate.getDescription()));
PacketSendUtility.broadcastPacket(player, new SM_ITEM_USAGE_ANIMATION(player.getObjectId(),
parentItem.getObjectId(), itemTemplate.getTemplateId()), true);
//add skill
player.getSkillList().addSkill(player, skillid, 1, true);
SkillTemplate skill = DataManager.SKILL_DATA.getSkillTemplate(skillid);
if(skill.isPassive())
player.getController().updatePassiveStats();
//remove book from inventory (assuming its not stackable)
Item item = player.getInventory().getItemByObjId(parentItem.getObjectId());
if(player.getInventory().removeFromBag(item, true))
PacketSendUtility.sendPacket(player, new SM_DELETE_ITEM(parentItem.getObjectId()));
}
private boolean validateConditions(Player player)
{
//1. check player level
if(player.getCommonData().getLevel() < level)
return false;
PlayerClass pc = player.getCommonData().getPlayerClass();
if(!validateClass(pc))
return false;
//4. check player race and SkillRace.ALL
if(player.getCommonData().getRace().ordinal() != race.ordinal()
&& race != SkillRace.ALL)
return false;
//5. check whether this skill is already learned
if(player.getSkillList().isSkillPresent(skillid))
return false;
return true;
}
private boolean validateClass(PlayerClass pc)
{
boolean result = false;
//2. check if current class is second class and book is for starting class
if(!pc.isStartingClass() && PlayerClass.getStartingClassFor(pc).ordinal() == playerClass.ordinal())
result = true;
//3. check player class and SkillClass.ALL
if(pc.ordinal() == playerClass.ordinal()
|| playerClass == SkillClass.ALL)
result = true;
return result;
}
}
| [
"osiris087@gmail.com@2632a3c6-4342-beac-f942-17b406f9b7bb"
] | osiris087@gmail.com@2632a3c6-4342-beac-f942-17b406f9b7bb |
beaee9d7d814812a83d04eea4411316213ebcfd8 | 47eb5bf54da6c19ca175fc8938ca9b6a2b545dfa | /smpp-esme/src/main/java/com/whty/smpp/esme/message/QuerySm.java | 6f6e33928117b22511a8dacc10673e8100479293 | [] | no_license | liszhu/whatever_ty | 44ddb837f2de19cb980c28fe06e6634f9d6bd8cb | e02ef9e125cac9103848c776e420edcf0dcaed2f | refs/heads/master | 2021-12-13T21:37:06.539805 | 2017-04-05T01:50:23 | 2017-04-05T01:50:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,609 | java | package com.whty.smpp.esme.message;
import org.jboss.netty.buffer.ChannelBuffer;
import com.cloudhopper.commons.util.StringUtil;
import com.whty.smpp.esme.constants.Address;
import com.whty.smpp.esme.constants.SmppConstants;
import com.whty.smpp.esme.exception.RecoverablePduException;
import com.whty.smpp.esme.exception.UnrecoverablePduException;
import com.whty.smpp.esme.util.ChannelBufferUtil;
import com.whty.smpp.esme.util.PduUtil;
/**
* @ClassName QuerySm
* @author Administrator
* @date 2017-1-23 下午3:23:32
* @Description TODO(这里用一句话描述这个类的作用)
*/
public class QuerySm extends PduRequest<QuerySmResp> {
private String messageId;
private Address sourceAddress;
public QuerySm() {
super(SmppConstants.CMD_ID_QUERY_SM, "query_sm");
}
public String getMessageId() {
return this.messageId;
}
public void setMessageId(String value) {
this.messageId = value;
}
public Address getSourceAddress() {
return this.sourceAddress;
}
public void setSourceAddress(Address value) {
this.sourceAddress = value;
}
@Override
public void readBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
this.messageId = ChannelBufferUtil.readNullTerminatedString(buffer);
this.sourceAddress = ChannelBufferUtil.readAddress(buffer);
}
@Override
public int calculateByteSizeOfBody() {
int bodyLength = 0;
bodyLength += PduUtil.calculateByteSizeOfNullTerminatedString(this.messageId);
bodyLength += PduUtil.calculateByteSizeOfAddress(this.sourceAddress);
return bodyLength;
}
@Override
public void writeBody(ChannelBuffer buffer) throws UnrecoverablePduException, RecoverablePduException {
ChannelBufferUtil.writeNullTerminatedString(buffer, this.messageId);
ChannelBufferUtil.writeAddress(buffer, this.sourceAddress);
}
@Override
public void appendBodyToString(StringBuilder buffer) {
buffer.append("(messageId [");
buffer.append(StringUtil.toStringWithNullAsEmpty(this.messageId));
buffer.append("] sourceAddr [");
buffer.append(StringUtil.toStringWithNullAsEmpty(this.sourceAddress));
buffer.append("])");
}
@Override
public QuerySmResp createResponse() {
QuerySmResp resp = new QuerySmResp();
resp.setSequenceNumber(this.getSequenceNumber());
return resp;
}
@Override
public Class<QuerySmResp> getResponseClass() {
return QuerySmResp.class;
}
}
| [
"652241956@qq.com"
] | 652241956@qq.com |
6cf5fe80ecba422669853f44dc4814d4c671bdfc | 8253a563255bdd5797873c9f80d2a48a690c5bb0 | /settingsengines/sdb/tests/com/symbian/sdb/mode/ModeParserTest.java | 1a99801f4575e10fcac333f16a2ce0e40cc0c2bb | [] | no_license | SymbianSource/oss.FCL.sftools.depl.swconfigmdw | 4e6ab52bf564299f1ed7036755cf16321bd656ee | d2feb88baf0e94da760738fc3b436c3d5d1ff35f | refs/heads/master | 2020-03-28T10:16:11.362176 | 2010-11-06T14:59:14 | 2010-11-06T14:59:14 | 73,009,096 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,266 | java | // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
package com.symbian.sdb.mode;
import junit.framework.Assert;
import junit.framework.JUnit4TestAdapter;
import org.junit.Test;
public class ModeParserTest {
ModeParser parser;
public static junit.framework.Test suite() {
return new JUnit4TestAdapter(ModeParserTest.class);
}
@Test
public void testSqliteContacts() {
parser = new ModeParser("sqlite.contacts");
Assert.assertEquals(parser.getDbMode(), DBMode.CONTACTS);
Assert.assertEquals(parser.getDbType(), DBType.SQLITE);
Assert.assertNull(parser.getDbSchema());
}
@Test
public void testSqlite() {
parser = new ModeParser("sqlite");
Assert.assertEquals(parser.getDbMode(), DBMode.GENERIC);
Assert.assertEquals(parser.getDbType(), DBType.SQLITE);
Assert.assertNull(parser.getDbSchema());
}
@Test
public void testDbmsContacts() {
parser = new ModeParser("dbms.contacts");
Assert.assertEquals(parser.getDbMode(), DBMode.CONTACTS);
Assert.assertEquals(parser.getDbType(), DBType.DBMS);
Assert.assertNull(parser.getDbSchema());
}
@Test
public void testDbms() {
parser = new ModeParser("dbms");
Assert.assertEquals(parser.getDbMode(), DBMode.GENERIC);
Assert.assertEquals(parser.getDbType(), DBType.DBMS);
Assert.assertNull(parser.getDbSchema());
}
@Test
public void testCed() {
parser = new ModeParser("ced");
Assert.assertEquals(parser.getDbMode(), DBMode.GENERIC);
Assert.assertEquals(parser.getDbType(), DBType.CED);
Assert.assertNull(parser.getDbSchema());
}
@Test
public void testGetDbSchema() {
parser = new ModeParser("ced.9.5");
Assert.assertEquals(parser.getDbMode(), DBMode.GENERIC);
Assert.assertEquals(parser.getDbType(), DBType.CED);
Assert.assertEquals(parser.getDbSchema(), "9.5");
}
}
| [
"none@none"
] | none@none |
a5b92a83b10b3378863d715db19f89ba98df93cc | c8a7974ebdf8c2f2e7cdc34436d667e3f1d29609 | /src/main/java/com/tencentcloudapi/gaap/v20180529/models/OpenSecurityPolicyResponse.java | 72bc6e9642f0f7f8b0f5fcdc2afb1e7a033cdbcc | [
"Apache-2.0"
] | permissive | TencentCloud/tencentcloud-sdk-java-en | d6f099a0de82ffd3e30d40bf7465b9469f88ffa6 | ba403db7ce36255356aeeb4279d939a113352990 | refs/heads/master | 2023-08-23T08:54:04.686421 | 2022-06-28T08:03:02 | 2022-06-28T08:03:02 | 193,018,202 | 0 | 3 | Apache-2.0 | 2022-06-28T08:03:04 | 2019-06-21T02:40:54 | Java | UTF-8 | Java | false | false | 2,842 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.gaap.v20180529.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class OpenSecurityPolicyResponse extends AbstractModel{
/**
* Async Process ID. Using DescribeAsyncTaskStatus to query process and status.
*/
@SerializedName("TaskId")
@Expose
private String TaskId;
/**
* The unique request ID, which is returned for each request. RequestId is required for locating a problem.
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* Get Async Process ID. Using DescribeAsyncTaskStatus to query process and status.
* @return TaskId Async Process ID. Using DescribeAsyncTaskStatus to query process and status.
*/
public String getTaskId() {
return this.TaskId;
}
/**
* Set Async Process ID. Using DescribeAsyncTaskStatus to query process and status.
* @param TaskId Async Process ID. Using DescribeAsyncTaskStatus to query process and status.
*/
public void setTaskId(String TaskId) {
this.TaskId = TaskId;
}
/**
* Get The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @return RequestId The unique request ID, which is returned for each request. RequestId is required for locating a problem.
*/
public String getRequestId() {
return this.RequestId;
}
/**
* Set The unique request ID, which is returned for each request. RequestId is required for locating a problem.
* @param RequestId The unique request ID, which is returned for each request. RequestId is required for locating a problem.
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "TaskId", this.TaskId);
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
| [
"zhiqiangfan@tencent.com"
] | zhiqiangfan@tencent.com |
52fb4f1d1d4433bec3ff55fffe0a70cd08359a98 | 71160c78ab169e3e3a479932768311a33ae7cae7 | /src/cn/ksdshpx/javase/juc/CopyOnWriteArrayListTest.java | 11e36ba971a23f15fb673341012a2c1b45a4a8fa | [] | no_license | ksdshpx/Pjavase | 167a0246dd3753ce4e48cc4be04d97cd2c76e422 | 524ddf5bd4856f0ef9901769ea06383cdbc4eac8 | refs/heads/master | 2021-07-05T23:08:24.589124 | 2019-02-16T02:05:21 | 2019-02-16T02:05:21 | 115,203,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,290 | java | package cn.ksdshpx.javase.juc;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Create with IntelliJ IDEA
* Create by peng.x
* Date: 2018/6/22
* Time: 16:11
* Description:CopyOnWriteArrayList类
* 写入并复制,适合大量遍历,少量写入的情况
*/
public class CopyOnWriteArrayListTest {
public static void main(String[] args) {
ExecutorService threadPool = Executors.newCachedThreadPool();
//Collection<String> list = Collections.synchronizedCollection(new ArrayList<>());//ConcurrentModificationException
CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();
list.add("AAA");
list.add("BBB");
list.add("CCC");
for (int i = 0; i < 2; i++) {
threadPool.execute(new Runnable() {
@Override
public void run() {
Iterator<String> iterator = list.iterator();
while (iterator.hasNext()){
System.out.println(iterator.next());
list.add("AAA");
}
}
});
}
threadPool.shutdown();
}
}
| [
"southeast_px@163.com"
] | southeast_px@163.com |
d20d94a71d92cb1814263d76a8bffe9369a5e987 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/tinder/presenters/ag.java | 1292d095e861ebcd4e7b6f4be2fc2ef253d3b8be | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 539 | java | package com.tinder.presenters;
import com.tinder.domain.profile.usecase.SMSUpdateSchool.OnSchoolChangedListener;
import java.util.List;
final /* synthetic */ class ag implements OnSchoolChangedListener {
/* renamed from: a */
private final C17744d f49838a;
/* renamed from: b */
private final String f49839b;
ag(C17744d c17744d, String str) {
this.f49838a = c17744d;
this.f49839b = str;
}
public void afterSchoolChanged(List list) {
this.f49838a.m64726a(this.f49839b, list);
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
348ca94bb2384ebb0b14cb21c025458d341f6dbe | 5f498d9c751a7c0263e129544c5a42606541627f | /org.eclipse.simpl.rrs.ui/src/org/eclipse/simpl/rrs/ui/client/ReferenceProperties.java | 5d4cefd487bbd0a2f29a2829cdba5ebf75a51db1 | [] | no_license | saatkamp/simpl09 | 2c2f65ea12245888b19283cdcddb8b73d03b9cf0 | 9d81c4f50bed863518497ab950af3d6726f2b3c8 | refs/heads/master | 2021-01-10T03:56:30.975085 | 2011-11-09T19:36:14 | 2011-11-09T19:36:14 | 55,900,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,521 | java |
package org.eclipse.simpl.rrs.ui.client;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ReferenceProperties complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ReferenceProperties">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="resolutionSystem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ReferenceProperties", propOrder = {
"resolutionSystem"
})
public class ReferenceProperties {
protected String resolutionSystem;
/**
* Gets the value of the resolutionSystem property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getResolutionSystem() {
return resolutionSystem;
}
/**
* Sets the value of the resolutionSystem property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setResolutionSystem(String value) {
this.resolutionSystem = value;
}
}
| [
"hahnml@t-online.de"
] | hahnml@t-online.de |
175cb6b6e97e4c92b1b0d8e7caf1253c74f76e8c | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2010-09-08/seasar2-2.4.43/seasar-benchmark/src/main/java/benchmark/wire/Bean00939AImpl.java | 4b0adc1e4af83765263c1aa3fdaa3f880ffe1484 | [] | no_license | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 340 | java | package benchmark.wire;
public class Bean00939AImpl implements Bean00939A {
private benchmark.wire.Bean00939B bean00939B;
public benchmark.wire.Bean00939B getBean00939B() {
return bean00939B;
}
public void setBean00939B(benchmark.wire.Bean00939B bean00939B) {
this.bean00939B = bean00939B;
}
}
| [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
11c3f05e2d51e983d17685038174ef71905cbbd2 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a018/A018864.java | e2920c63406e5348bf022c41ab9632c9d934f264 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 243 | java | package irvine.oeis.a018;
/**
* A018864 <code>6^a(n)</code> is smallest power of 6 beginning with <code>n</code>.
* @author Sean A. Irvine
*/
public class A018864 extends A018858 {
@Override
protected int base() {
return 6;
}
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
c438b7f34795b66da6361cb539bc9eb6cffd6a49 | cb9400fc0f0415c61b62853595abf2544641d8f0 | /src/main/java/com/climbingzone4/config/CloudDatabaseConfiguration.java | d354d1394db860eac60ad85e78f8f827769ed2e7 | [] | no_license | francoisauxietre/climbingzone4 | 507ea709fb7b746ed34dabbc80e025f232df47a1 | 678264514c50aa9bf3b5a1c95fd7eb8a2a4c045d | refs/heads/master | 2022-12-23T08:40:11.878273 | 2019-10-22T07:53:10 | 2019-10-22T07:53:10 | 216,656,062 | 0 | 0 | null | 2019-10-21T20:12:08 | 2019-10-21T20:08:37 | Java | UTF-8 | Java | false | false | 934 | java | package com.climbingzone4.config;
import io.github.jhipster.config.JHipsterConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.config.java.AbstractCloudConfig;
import org.springframework.context.annotation.*;
import javax.sql.DataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Configuration
@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD)
public class CloudDatabaseConfiguration extends AbstractCloudConfig {
private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class);
private static final String CLOUD_CONFIGURATION_HIKARI_PREFIX = "spring.datasource.hikari";
@Bean
@ConfigurationProperties(CLOUD_CONFIGURATION_HIKARI_PREFIX)
public DataSource dataSource() {
log.info("Configuring JDBC datasource from a cloud provider");
return connectionFactory().dataSource();
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
ae60606346dbf5bcd8ff1a804d6a29178901ac18 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/protocal/protobuf/cja.java | 219ebc44d7221845cbae4fe5c1933bc027f175cf | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 4,923 | java | package com.tencent.mm.protocal.protobuf;
import com.tencent.matrix.trace.core.AppMethodBeat;
import i.a.a.b;
import java.util.LinkedList;
public final class cja
extends esc
{
public gol YGV;
public int aarw;
public LinkedList<cix> aarx;
public cja()
{
AppMethodBeat.i(104797);
this.aarx = new LinkedList();
AppMethodBeat.o(104797);
}
public final int op(int paramInt, Object... paramVarArgs)
{
AppMethodBeat.i(104798);
if (paramInt == 0)
{
paramVarArgs = (i.a.a.c.a)paramVarArgs[0];
if (this.BaseResponse == null)
{
paramVarArgs = new b("Not all required fields were included: BaseResponse");
AppMethodBeat.o(104798);
throw paramVarArgs;
}
if (this.BaseResponse != null)
{
paramVarArgs.qD(1, this.BaseResponse.computeSize());
this.BaseResponse.writeFields(paramVarArgs);
}
paramVarArgs.bS(2, this.aarw);
paramVarArgs.e(3, 8, this.aarx);
if (this.YGV != null)
{
paramVarArgs.qD(4, this.YGV.computeSize());
this.YGV.writeFields(paramVarArgs);
}
AppMethodBeat.o(104798);
return 0;
}
if (paramInt == 1) {
if (this.BaseResponse == null) {
break label628;
}
}
label628:
for (paramInt = i.a.a.a.qC(1, this.BaseResponse.computeSize()) + 0;; paramInt = 0)
{
int i = paramInt + i.a.a.b.b.a.cJ(2, this.aarw) + i.a.a.a.c(3, 8, this.aarx);
paramInt = i;
if (this.YGV != null) {
paramInt = i + i.a.a.a.qC(4, this.YGV.computeSize());
}
AppMethodBeat.o(104798);
return paramInt;
if (paramInt == 2)
{
paramVarArgs = (byte[])paramVarArgs[0];
this.aarx.clear();
paramVarArgs = new i.a.a.a.a(paramVarArgs, unknownTagHandler);
for (paramInt = esc.getNextFieldNumber(paramVarArgs); paramInt > 0; paramInt = esc.getNextFieldNumber(paramVarArgs)) {
if (!super.populateBuilderWithField(paramVarArgs, this, paramInt)) {
paramVarArgs.kFT();
}
}
if (this.BaseResponse == null)
{
paramVarArgs = new b("Not all required fields were included: BaseResponse");
AppMethodBeat.o(104798);
throw paramVarArgs;
}
AppMethodBeat.o(104798);
return 0;
}
if (paramInt == 3)
{
Object localObject1 = (i.a.a.a.a)paramVarArgs[0];
cja localcja = (cja)paramVarArgs[1];
paramInt = ((Integer)paramVarArgs[2]).intValue();
Object localObject2;
switch (paramInt)
{
default:
AppMethodBeat.o(104798);
return -1;
case 1:
paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject1 = (byte[])paramVarArgs.get(paramInt);
localObject2 = new kd();
if ((localObject1 != null) && (localObject1.length > 0)) {
((kd)localObject2).parseFrom((byte[])localObject1);
}
localcja.BaseResponse = ((kd)localObject2);
paramInt += 1;
}
AppMethodBeat.o(104798);
return 0;
case 2:
localcja.aarw = ((i.a.a.a.a)localObject1).ajGk.aar();
AppMethodBeat.o(104798);
return 0;
case 3:
paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject1 = (byte[])paramVarArgs.get(paramInt);
localObject2 = new cix();
if ((localObject1 != null) && (localObject1.length > 0)) {
((cix)localObject2).parseFrom((byte[])localObject1);
}
localcja.aarx.add(localObject2);
paramInt += 1;
}
AppMethodBeat.o(104798);
return 0;
}
paramVarArgs = ((i.a.a.a.a)localObject1).aMP(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject1 = (byte[])paramVarArgs.get(paramInt);
localObject2 = new gol();
if ((localObject1 != null) && (localObject1.length > 0)) {
((gol)localObject2).dg((byte[])localObject1);
}
localcja.YGV = ((gol)localObject2);
paramInt += 1;
}
AppMethodBeat.o(104798);
return 0;
}
AppMethodBeat.o(104798);
return -1;
}
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.protocal.protobuf.cja
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
135ec4883b308a610437e2fa98afe2f3d1d5d516 | f38b4ae89f77411bb23166f40edc0330f7ea2521 | /src/main/java/gmd/addins/demo/client/application/beta/progress/ProgressLineBarView.java | 82974eb2957f48ab513eba43cfeff2aa28641eb5 | [
"Apache-2.0"
] | permissive | GwtMaterialDesign/gmd-addins-demo | f5ff839274d114b1144766ee404bde82af843d5d | 40f11769b7de1eeb03ed7711b5db487180cde4a9 | refs/heads/master | 2022-09-12T16:28:39.088792 | 2022-07-23T07:51:43 | 2022-07-23T07:51:43 | 157,949,192 | 0 | 2 | Apache-2.0 | 2021-09-06T22:19:31 | 2018-11-17T04:03:01 | Java | UTF-8 | Java | false | false | 1,947 | java | /*
* #%L
* GwtMaterial
* %%
* Copyright (C) 2015 - 2017 GwtMaterialDesign
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package gmd.addins.demo.client.application.beta.progress;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Widget;
import com.gwtplatform.mvp.client.ViewImpl;
import gwt.material.design.client.ui.MaterialToast;
import gwt.material.design.incubator.client.progress.ProgressLineBar;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;
public class ProgressLineBarView extends ViewImpl implements ProgressLineBarPresenter.MyView {
interface Binder extends UiBinder<Widget, ProgressLineBarView> {
}
@UiField
ProgressLineBar<Integer> progressLineBar;
@Inject
ProgressLineBarView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
for (int i = 0; i <= 10; i++) {
progressLineBar.addOption(i);
}
List<Integer> values = new ArrayList<>();
for (int i = 0; i <= 5; i++) {
values.add(i);
}
progressLineBar.setValues(values);
}
@UiHandler("getValue")
void getValue(ClickEvent event) {
MaterialToast.fireToast(progressLineBar.getValues() + "");
}
}
| [
"kevzlou7979@gmail.com"
] | kevzlou7979@gmail.com |
20c8922eff930a7761a1d725524d368d719271ea | e4aea93f2988e2cf1be4f96a39f6cc3328cbbd50 | /src/com/flagleader/builder/b/i.java | 7fd3137cd5b1ef58a529da82ea8d9aee2768cd7c | [] | no_license | lannerate/ruleBuilder | 18116282ae55e9d56e9eb45d483520f90db4a1a6 | b5d87495990aa1988adf026366e92f7cbb579b19 | refs/heads/master | 2016-09-05T09:13:43.879603 | 2013-11-10T08:32:58 | 2013-11-10T08:32:58 | 14,231,127 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 986 | java | package com.flagleader.builder.b;
import java.io.File;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.TableItem;
class i extends SelectionAdapter
{
i(h paramh)
{
}
public void widgetSelected(SelectionEvent paramSelectionEvent)
{
FileDialog localFileDialog = new FileDialog(this.a.getShell(), 4096);
localFileDialog.setFilterExtensions(new String[] { "*.jar" });
if (localFileDialog.open() == null)
return;
File localFile = new File(localFileDialog.getFilterPath(), localFileDialog.getFileName());
TableItem localTableItem = new TableItem(h.a(this.a), 0);
localTableItem.setText(0, localFile.getPath());
h.a(this.a, true);
this.a.a();
}
}
/* Location: D:\Dev_tools\ruleEngine\rbuilder.jar
* Qualified Name: com.flagleader.builder.b.i
* JD-Core Version: 0.6.0
*/ | [
"zhanghuizaizheli@hotmail.com"
] | zhanghuizaizheli@hotmail.com |
7daefc45f00e9a40acb0133b0731b2bc738a7184 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/ant/1.6/org/apache/tools/ant/taskdefs/ExecuteStreamHandler.java | 603eb898f83a9f260c198aae1527f787040692e0 | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,205 | java | package org.apache.tools.ant.taskdefs;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* Used by <code>Execute</code> to handle input and output stream of
* subprocesses.
*
* @since Ant 1.2
*/
public interface ExecuteStreamHandler {
/**
* Install a handler for the input stream of the subprocess.
*
* @param os output stream to write to the standard input stream of the
* subprocess
*/
void setProcessInputStream(OutputStream os) throws IOException;
/**
* Install a handler for the error stream of the subprocess.
*
* @param is input stream to read from the error stream from the subprocess
*/
void setProcessErrorStream(InputStream is) throws IOException;
/**
* Install a handler for the output stream of the subprocess.
*
* @param is input stream to read from the error stream from the subprocess
*/
void setProcessOutputStream(InputStream is) throws IOException;
/**
* Start handling of the streams.
*/
void start() throws IOException;
/**
* Stop handling of the streams - will not be restarted.
*/
void stop();
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
e61f1becc473cecc2d519e1d93ab7de65dec9d38 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /api-vs-impl-small/core/src/main/java/org/gradle/testcore/performancenull_24/Productionnull_2349.java | 636bc2f69307e02d0a5fd03beefe28ccb62f88a0 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 589 | java | package org.gradle.testcore.performancenull_24;
public class Productionnull_2349 {
private final String property;
public Productionnull_2349(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
1ee3dfa5155f7de1349fe5b96376b2d12fde081e | 92defe9a6cfb711df61df190bf8804ef82993742 | /engine/src/main/java/org/entando/entando/aps/system/services/api/model/ServiceParameterInfo.java | f5ed37244ca830e2a1f0b2f4e14336207be572ab | [] | no_license | DevBrandon/entando-core | e6ffeddd0d76ff5f3694e96834a313764c20a739 | 4d1f88b372d4b0ef604fdde2aa929eef3de0e6b2 | refs/heads/master | 2020-12-26T01:13:58.694861 | 2014-12-01T17:18:43 | 2014-12-01T17:18:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,869 | java | /*
*
* Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved.
*
* This file is part of Entando software.
* Entando is a free software;
* You can redistribute it and/or modify it
* under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2.
*
* See the file License for the specific language governing permissions
* and limitations under the License
*
*
*
* Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved.
*
*/
package org.entando.entando.aps.system.services.api.model;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* @author E.Santoboni
*/
@XmlRootElement(name = "serviceParameterInfo")
@XmlType(propOrder = {"key", "description", "required", "defaultValue"})
public class ServiceParameterInfo extends ApiMethodParameter {
public ServiceParameterInfo() {}
public ServiceParameterInfo(ApiMethodParameter parameter) {
this.setKey(parameter.getKey());
this.setDescription(parameter.getDescription());
this.setRequired(parameter.isRequired());
}
@XmlElement(name = "key", required = true)
@Override
public String getKey() {
return super.getKey();
}
@XmlElement(name = "description", required = true)
@Override
public String getDescription() {
return super.getDescription();
}
@XmlElement(name = "required", required = true)
@Override
public boolean isRequired() {
return super.isRequired();
}
@Override
public void setRequired(boolean required) {
super.setRequired(required);
}
@XmlElement(name = "defaultValue", required = true)
public String getDefaultValue() {
return _defaultValue;
}
public void setDefaultValue(String defaultValue) {
this._defaultValue = defaultValue;
}
private String _defaultValue;
} | [
"eugenio.santoboni@gmail.com"
] | eugenio.santoboni@gmail.com |
07da45f0c663d3e692ca8f26fc564862c0d315ee | d6b5b5e50347de72c375402efdba7a09f782689f | /ehmp/product/production/soap-handler/src/main/java/gov/va/med/jmeadows_2_3_0/webservice/Site.java | 2ac148d6c817d394cd6ed6bcf63876748f20221b | [
"Apache-2.0"
] | permissive | CoherentLogic/ehmp20 | 85879f30174dd5a5be88504d0fd1dcf4f36c69aa | fc674005ec7c226704dbc50f8f8d6216f847096e | refs/heads/master | 2021-01-22T04:02:05.698299 | 2017-02-09T21:19:57 | 2017-02-09T21:19:57 | 81,489,481 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,720 | java |
package gov.va.med.jmeadows_2_3_0.webservice;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for site complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="site">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="agency" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="dmisId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="endpoints" type="{http://webservice.vds.DNS /}endpoint" maxOccurs="unbounded" minOccurs="0"/>
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="moniker" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="permissions" type="{http://webservice.vds.DNS /}janusPermission" maxOccurs="unbounded" minOccurs="0"/>
* <element name="region" type="{http://webservice.vds.DNS /}region" minOccurs="0"/>
* <element name="siteCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "site", namespace = "http://webservice.vds.DNS /", propOrder = {
"agency",
"dmisId",
"endpoints",
"id",
"moniker",
"name",
"permissions",
"region",
"siteCode",
"status"
})
public class Site {
protected String agency;
protected String dmisId;
@XmlElement(nillable = true)
protected List<Endpoint> endpoints;
protected Integer id;
protected String moniker;
protected String name;
@XmlElement(nillable = true)
protected List<JanusPermission> permissions;
protected Region region;
protected String siteCode;
protected String status;
/**
* Gets the value of the agency property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAgency() {
return agency;
}
/**
* Sets the value of the agency property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAgency(String value) {
this.agency = value;
}
/**
* Gets the value of the dmisId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDmisId() {
return dmisId;
}
/**
* Sets the value of the dmisId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDmisId(String value) {
this.dmisId = value;
}
/**
* Gets the value of the endpoints property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the endpoints property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEndpoints().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Endpoint }
*
*
*/
public List<Endpoint> getEndpoints() {
if (endpoints == null) {
endpoints = new ArrayList<Endpoint>();
}
return this.endpoints;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setId(Integer value) {
this.id = value;
}
/**
* Gets the value of the moniker property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMoniker() {
return moniker;
}
/**
* Sets the value of the moniker property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMoniker(String value) {
this.moniker = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the permissions property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the permissions property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPermissions().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JanusPermission }
*
*
*/
public List<JanusPermission> getPermissions() {
if (permissions == null) {
permissions = new ArrayList<JanusPermission>();
}
return this.permissions;
}
/**
* Gets the value of the region property.
*
* @return
* possible object is
* {@link Region }
*
*/
public Region getRegion() {
return region;
}
/**
* Sets the value of the region property.
*
* @param value
* allowed object is
* {@link Region }
*
*/
public void setRegion(Region value) {
this.region = value;
}
/**
* Gets the value of the siteCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSiteCode() {
return siteCode;
}
/**
* Sets the value of the siteCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSiteCode(String value) {
this.siteCode = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStatus(String value) {
this.status = value;
}
}
| [
"jpw@coherent-logic.com"
] | jpw@coherent-logic.com |
9f38bebc49dcf43d107560425d4e7cae4c963dda | 17a0a0934f604119d0e2267bee263b4a6ff80244 | /app/src/main/java/com/twixttechnologies/tjss/model/network/request/PlanDetailsRequest.java | 1c5c68ed8c68893255154f34c6f495b7a0f460eb | [] | no_license | iamRAJASHEKAR/TJSS_fixed | b9473c266fab341917716167e6661b1800f4e28b | e0ae291f8e760c3b549cd8df870a0d98d5db2dae | refs/heads/master | 2020-03-24T20:42:19.219014 | 2018-07-31T09:32:18 | 2018-07-31T09:32:18 | 142,992,676 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | package com.twixttechnologies.tjss.model.network.request;
import com.twixttechnologies.tjss.model.network.request.serviceinterface.TjssNetworkInterface;
import com.twixttechnologies.tjss.model.network.response.PlanDetails;
import retrofit2.Call;
/**
* @author Sony Raj on 05-08-17.
*/
public class PlanDetailsRequest extends AbstractRequest<PlanDetails, TjssNetworkInterface> {
public PlanDetailsRequest(Class<TjssNetworkInterface> networkInterface, RequestCallback<PlanDetails> callback) {
super(networkInterface, callback);
}
public void get(String path, String planId) {
Call<PlanDetails> call = mNetworkInterface.getPlanDetails(path, planId);
call.enqueue(this);
}
}
| [
"rajashekar.reddy1995@gmail.com"
] | rajashekar.reddy1995@gmail.com |
3417d8e468a766e3a7f865c675755dea9849fb05 | e26a8434566b1de6ea6cbed56a49fdb2abcba88b | /model-sese-mx/src/generated/java/com/prowidesoftware/swift/model/mx/MxSese02100201.java | efc2b4d4c5365f1ba1d264171f8a2d8b3fbae71c | [
"Apache-2.0"
] | permissive | adilkangerey/prowide-iso20022 | 6476c9eb8fafc1b1c18c330f606b5aca7b8b0368 | 3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61 | refs/heads/master | 2023-09-05T21:41:47.480238 | 2021-10-03T20:15:26 | 2021-10-03T20:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,412 | java |
package com.prowidesoftware.swift.model.mx;
import com.prowidesoftware.swift.model.mx.dic.*;
import com.prowidesoftware.swift.model.mx.AbstractMX;
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;
import com.prowidesoftware.swift.model.MxSwiftMessage;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.MxRead;
import com.prowidesoftware.swift.model.mx.MxReadImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Class for sese.021.002.01 ISO 20022 message.
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document", propOrder = {
"sctiesTxStsQry"
})
@XmlRootElement(name = "Document", namespace = "urn:swift:xsd:sese.021.002.01")
public class MxSese02100201
extends AbstractMX
{
@XmlElement(name = "SctiesTxStsQry", required = true)
protected SecuritiesTransactionStatusQuery002V01 sctiesTxStsQry;
public final static transient String BUSINESS_PROCESS = "sese";
public final static transient int FUNCTIONALITY = 21;
public final static transient int VARIANT = 2;
public final static transient int VERSION = 1;
@SuppressWarnings("rawtypes")
public final static transient Class[] _classes = new Class[] {CopyDuplicate1Code.class, DateAndDateTimeChoice.class, DocumentIdentification16 .class, DocumentNumber2Choice.class, DocumentNumber4 .class, Extension2 .class, ExtensionEnvelope1 .class, GenericIdentification23 .class, GenericIdentification24 .class, GenericIdentification25 .class, Identification5 .class, MxSese02100201 .class, NameAndAddress12 .class, PartyIdentification16Choice.class, PartyIdentification18Choice.class, SecuritiesAccount17 .class, SecuritiesTransactionStatusQuery002V01 .class };
public final static transient String NAMESPACE = "urn:swift:xsd:sese.021.002.01";
public MxSese02100201() {
super();
}
/**
* Creates the MX object parsing the parameter String with the XML content
*
*/
public MxSese02100201(final String xml) {
this();
MxSese02100201 tmp = parse(xml);
sctiesTxStsQry = tmp.getSctiesTxStsQry();
}
/**
* Creates the MX object parsing the raw content from the parameter MxSwiftMessage
*
*/
public MxSese02100201(final MxSwiftMessage mxSwiftMessage) {
this(mxSwiftMessage.message());
}
/**
* Gets the value of the sctiesTxStsQry property.
*
* @return
* possible object is
* {@link SecuritiesTransactionStatusQuery002V01 }
*
*/
public SecuritiesTransactionStatusQuery002V01 getSctiesTxStsQry() {
return sctiesTxStsQry;
}
/**
* Sets the value of the sctiesTxStsQry property.
*
* @param value
* allowed object is
* {@link SecuritiesTransactionStatusQuery002V01 }
*
*/
public MxSese02100201 setSctiesTxStsQry(SecuritiesTransactionStatusQuery002V01 value) {
this.sctiesTxStsQry = value;
return this;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String getBusinessProcess() {
return BUSINESS_PROCESS;
}
@Override
public int getFunctionality() {
return FUNCTIONALITY;
}
@Override
public int getVariant() {
return VARIANT;
}
@Override
public int getVersion() {
return VERSION;
}
/**
* Creates the MX object parsing the raw content from the parameter XML
*
*/
public static MxSese02100201 parse(String xml) {
return ((MxSese02100201) MxReadImpl.parse(MxSese02100201 .class, xml, _classes));
}
/**
* Creates the MX object parsing the raw content from the parameter XML with injected read implementation
* @since 9.0.1
*
* @param parserImpl an MX unmarshall implementation
*/
public static MxSese02100201 parse(String xml, MxRead parserImpl) {
return ((MxSese02100201) parserImpl.read(MxSese02100201 .class, xml, _classes));
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
@SuppressWarnings("rawtypes")
public Class[] getClasses() {
return _classes;
}
/**
* Creates an MxSese02100201 messages from its JSON representation.
* <p>
* For generic conversion of JSON into the corresponding MX instance
* see {@link AbstractMX#fromJson(String)}
*
* @since 7.10.2
*
* @param json a JSON representation of an MxSese02100201 message
* @return
* a new instance of MxSese02100201
*/
public final static MxSese02100201 fromJson(String json) {
return AbstractMX.fromJson(json, MxSese02100201 .class);
}
}
| [
"sebastian@prowidesoftware.com"
] | sebastian@prowidesoftware.com |
fd6dacdbd9a852f17a4a4e5724f82a49a242db01 | 72240256fc4c63e1aed5b86c6880228db63017bf | /src/main/java/com/hx/eplate/state/FinalJson.java | d63a0fcd15665e632e772606d797d3fd2d9e35c5 | [] | no_license | AndyYHL/springMMControl | 64384bdbe40cc1fa9f48206f4b93af897678fcc7 | 17a13ddc80d4c1c95e9ce601d91d299eecc14204 | refs/heads/master | 2021-09-08T10:18:39.836419 | 2018-03-09T04:25:39 | 2018-03-09T04:25:39 | 124,476,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,580 | java | package com.hx.eplate.state;
/**
* Created by Administrator on 2017-04-05.
*/
public class FinalJson {
//请求公共值
public static final String appKey = "CheXiShiKey";
//JSON返回请求令牌和私密钥匙
public static final String access_key ="WeiXinConentKey"; //微信令牌
public static final String access_key_android ="9WEAY6UGMJXBDBLD"; //android令牌
public static final String access_key_ios ="3684ZJWVFVOALTA9"; //ios令牌
public static final String private_key = "WHOXLL3HCIPY4AE2WJBLRP87E70NT7XF"; //私密钥匙
public static final String baiduMap_key = "E4d8bcb7a7b3af88911d033df79ab13f"; //百度地图key
//JSON 返回的标识
public static final int STATUS_OK = 200; //请求成功
public static final int STATUS_CREATED = 201; //用户新建或修改数据成功。
public static final int STATUS_ACCEPTED = 202; //表示一个请求已经进入后台排队
public static final int STATUS_DELETE = 204; //用户删除数据成功。
public static final int STATUS_INVALIDREQUEST = 400; //用户发出的请求有错误,服务器没有进行新建或修改数据的操作,该操作是幂等的;
public static final int STATUS_UNAUTHORIZED = 401; //表示用户没有权限(令牌、用户名、密码错误)。
public static final int STATUS_FORBIDDEN = 403; //表示用户得到授权(与401错误相对),但是访问是被禁止的。
public static final int STATUS_NOTFOUND = 404; //用户发出的请求针对的是不存在的记录,服务器没有进行操作,该操作是幂等的。
public static final int STATUS_NOTACCEPTABLE = 406; //用户请求的格式不可得(比如用户请求JSON格式,但是只有XML格式)。
public static final int STATUS_GONE = 410; //用户请求的资源被永久删除,且不会再得到的。
public static final int STATUS_UNPROCESABLE = 422; //当创建一个对象时,发生一个验证错误。
public static final int STATUS_SERVERERROR = 500; //服务器发生错误,用户将无法判断发出的请求是否成功。
public static final int STATUS_CHECKCODE = 300; //校验CheckCode正确
//网络请求的格式
public enum HttpMediaType{
text,json
}
/**
* 页面条数
*/
public static final int pageSize = 10;
/**
* 页码
* @param pageIndex
* @return
*/
public static int pageIndex(int pageIndex,int pageSize){
return (pageIndex-1)*pageSize;
}
public static String GD_AMAP_KEY = "";
}
| [
"love90yhl@hotmail.com"
] | love90yhl@hotmail.com |
c21253b9a33c9a9b0fef9c04f05271202fadd4c0 | b404e33a674137306b113a837ac78b270e3ec382 | /OkNetworkMonitor/library/src/main/java/me/khrystal/util/stetho/DefaultResponseHandler.java | 5c4379ce6a9d8d92fa39d0a9ec7739c092095db9 | [] | no_license | kHRYSTAL/stupid | a77561578c2119659131ee471d50a1bf61cbbb93 | e2a02e2b7170c3fc5134cdd20332e2fe09cc9596 | refs/heads/master | 2021-07-05T05:49:55.559832 | 2021-05-25T09:48:56 | 2021-05-25T09:48:56 | 55,215,499 | 12 | 7 | null | null | null | null | UTF-8 | Java | false | false | 1,313 | java | package me.khrystal.util.stetho;
import java.io.IOException;
/**
* usage:
* author: kHRYSTAL
* create time: 18/6/11
* update time:
* email: 723526676@qq.com
*/
public class DefaultResponseHandler implements ResponseHandler {
private final NetworkEventReporter mEventReporter;
private final String mRequestId;
private int mBytesRead = 0;
private int mDecodedBytesRead = -1;
public DefaultResponseHandler(NetworkEventReporter eventReporter, String requestId) {
mEventReporter = eventReporter;
mRequestId = requestId;
}
@Override
public void onRead(int numBytes) {
mBytesRead += numBytes;
}
@Override
public void onReadDecoded(int numBytes) {
if (mDecodedBytesRead == -1) {
mDecodedBytesRead = 0;
}
mDecodedBytesRead += numBytes;
}
@Override
public void onEOF() {
reportDataReceived();
mEventReporter.responseReadFinished(mRequestId);
}
@Override
public void onError(IOException e) {
reportDataReceived();
mEventReporter.responseReadFailed(mRequestId, e.toString());
}
private void reportDataReceived() {
mEventReporter.dataReceived(mRequestId, mBytesRead, mDecodedBytesRead >= 0 ? mDecodedBytesRead : mBytesRead);
}
}
| [
"723526676@qq.com"
] | 723526676@qq.com |
07df8f515a6d6eaab72c249b8468a3ccf824b140 | 8727b1cbb8ca63d30340e8482277307267635d81 | /PolarServer/src/com/game/data/container/Q_activities_dropContainer.java | 4bd89fb465a6a7da07c8ba318bc5e76cc196f986 | [] | no_license | taohyson/Polar | 50026903ded017586eac21a7905b0f1c6b160032 | b0617f973fd3866bed62da14f63309eee56f6007 | refs/heads/master | 2021-05-08T12:22:18.884688 | 2015-12-11T01:44:18 | 2015-12-11T01:44:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package com.game.data.container;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import com.game.data.bean.Q_activities_dropBean;
import com.game.data.dao.Q_activities_dropDao;
/**
* @author ExcelUtil Auto Maker
*
* @version 1.0.0
*
* Q_activities_drop数据容器
*/
public class Q_activities_dropContainer {
private List<Q_activities_dropBean> list;
private HashMap<Integer, Q_activities_dropBean> map = new HashMap<Integer, Q_activities_dropBean>();
private Q_activities_dropDao dao = new Q_activities_dropDao();
public void load(){
list = dao.select();
Iterator<Q_activities_dropBean> iter = list.iterator();
while (iter.hasNext()) {
Q_activities_dropBean bean = (Q_activities_dropBean) iter
.next();
map.put(bean.getQ_id(), bean);
}
}
public List<Q_activities_dropBean> getList(){
return list;
}
public HashMap<Integer, Q_activities_dropBean> getMap(){
return map;
}
} | [
"zhuyuanbiao@ZHUYUANBIAO.rd.com"
] | zhuyuanbiao@ZHUYUANBIAO.rd.com |
a01c330009b9db4a4fa30e1fa5ec49bc0699a944 | 5017e89e42adaf46e790d5f0e76ad79baaf797ec | /src/main/java/com/fhd/ra/business/assess/oper/TempSyncRiskRbsBO.java | f39f3fe83939aa0618ebde837ed91603c876fc44 | [] | no_license | songjiavc/fhd-fdc | 41425584c266ea72c842ccba00b6207ca75cf2e1 | 96d96c1fdba9bcbdaffb17c023e8dbbda82ef630 | refs/heads/master | 2021-01-15T18:22:26.114087 | 2017-08-09T09:41:50 | 2017-08-09T09:41:50 | 99,781,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,010 | java | package com.fhd.ra.business.assess.oper;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fhd.dao.risk.TempSyncRiskrbsScoreDAO;
import com.fhd.entity.risk.TempSyncRiskrbsScore;
@Service
public class TempSyncRiskRbsBO {
@Autowired
private TempSyncRiskrbsScoreDAO tempSyncRiskrbsScoreDAO;
//save riskscore to riskku
public TempSyncRiskrbsScore getRiskScoreByRiskIdAndAssessPlanId(String riskId,String assessPlanId){
Criteria criteria = tempSyncRiskrbsScoreDAO.createCriteria();
criteria.add(Restrictions.eq("pk.riskId", riskId));
if(StringUtils.isNotBlank(assessPlanId)){
criteria.add(Restrictions.eq("pk.assessPlanId", assessPlanId));
}else{
criteria.add(Restrictions.isNull("pk.assessPlanId"));
}
return (TempSyncRiskrbsScore)criteria.uniqueResult();
}
} | [
"jia.song@pcitc.com"
] | jia.song@pcitc.com |
8f2a1a7f307f4fb395ca322e8e7214e280fe0b8b | cf18c1d3e78706b95120a37f5c30a802e39efde7 | /syh_mall/src/main/java/com/visionet/syh_mall/entity/goods/GoodsTagLink.java | fda1fdd2e09b6149502659d48ff3501041b98afa | [] | no_license | JavaLeeLi/shscce_syh | c31447ebc4aa5b1a555a7e99567ffe8459664e87 | 2ccc815aabfe23051a305964170310a1e8a9f4c1 | refs/heads/master | 2021-04-15T09:47:24.389650 | 2018-03-27T03:07:08 | 2018-03-27T03:07:08 | 126,915,503 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,252 | java | package com.visionet.syh_mall.entity.goods;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.visionet.syh_mall.entity.IdEntity;
/**
* 商品标签关联表实体类
* @author mulongfei
* @date 2017年8月30日下午5:18:27
*/
@Entity
@Table(name="tbl_goods_tag_link")
public class GoodsTagLink extends IdEntity{
private static final long serialVersionUID = 1L;
private String goodsId;//商品id
private String tagId;//标签id
private Date createTime;//创建时间
private Date updateTime;//更新时间
private Integer isDeleted;//是否删除
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public String getTagId() {
return tagId;
}
public void setTagId(String tagId) {
this.tagId = tagId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
}
| [
"liym@visionet.com.cn"
] | liym@visionet.com.cn |
f35bc640a59b219a46bf9632a7078ccca0bcbcd8 | aa19c82d45b8f02c0ab6c593c64a57b1e052103c | /src/main/java/br/com/systemsgs/exception/ValidaCamposException.java | e04eff8105aae6022577778a0f4a0d5472a8a5a0 | [] | no_license | GuilhermeJWT/Junit-Mockito-Spring-TravisCI | 45aa85cbb84f07e42617eea0e801b5a23d495290 | bf61ec40a75f2d8e60188db08374bbb2c7032f8c | refs/heads/master | 2023-03-29T11:35:58.488474 | 2021-03-31T14:23:32 | 2021-03-31T14:23:32 | 353,382,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package br.com.systemsgs.exception;
import org.springframework.validation.BindingResult;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ValidaCamposException {
private List<String> erros;
public ValidaCamposException(BindingResult bindingResult){
this.erros = new ArrayList<>();
bindingResult.getAllErrors().forEach(error -> this.erros.add(error.getDefaultMessage()));
}
public List<String> getErros() {
return erros;
}
public ValidaCamposException(RegraNegocioException regra){
this.erros = Arrays.asList(regra.getMessage());
}
}
| [
"guiromanno@gmail.com"
] | guiromanno@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.