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
dfa249cd653d6c6d035560ae266b50735a00bf53
0730753b531d1682e939ac1375c1febb38360cc9
/plugin/securityGroup/src/main/java/org/zstack/network/securitygroup/APIAddVmNicToSecurityGroupMsg.java
0f10c9836f67675555a5a32d0a300a67468be6b1
[ "Apache-2.0" ]
permissive
SoftwareKing/zstack
6f18d0df1370641b062920f993d532a6536be69a
4d0109f0312496e03dc7296d061838c537c1f4e3
refs/heads/master
2021-01-18T17:36:05.864815
2015-04-21T02:14:19
2015-04-21T02:14:19
34,370,895
1
0
null
2015-04-22T05:33:00
2015-04-22T05:33:00
null
UTF-8
Java
false
false
1,758
java
package org.zstack.network.securitygroup; import org.zstack.header.message.APIMessage; import org.zstack.header.message.APIParam; import java.util.List; /** * @api * add vm nic to a security group * * @category security group * * @since 0.1.0 * * @cli * * @httpMsg * { "org.zstack.network.securitygroup.APIAddVmNicToSecurityGroupMsg": { "securityGroupUuid": "3904b4837f0c4f539063777ed463b648", "vmNicUuids": [ "e93a0d92a37c4be7b26a6e565f24b063" ], "session": { "uuid": "47bd38c2233d469db97930ab8c71e699" } } } * * @msg * { "org.zstack.network.securitygroup.APIAddVmNicToSecurityGroupMsg": { "securityGroupUuid": "3904b4837f0c4f539063777ed463b648", "vmNicUuids": [ "e93a0d92a37c4be7b26a6e565f24b063" ], "session": { "uuid": "47bd38c2233d469db97930ab8c71e699" }, "timeout": 1800000, "id": "61f68cba51f8466893194a5af7801ab3", "serviceId": "api.portal" } } * * @result * * see :ref:`APIAddVmNicToSecurityGroupEvent` */ public class APIAddVmNicToSecurityGroupMsg extends APIMessage { /** * @desc security group uuid */ @APIParam(resourceType = SecurityGroupVO.class) private String securityGroupUuid; /** * @desc a list of vm nic uuid. See :ref:`VmNicInventory` */ @APIParam(nonempty = true) private List<String> vmNicUuids; public String getSecurityGroupUuid() { return securityGroupUuid; } public List<String> getVmNicUuids() { return vmNicUuids; } public void setVmNicUuids(List<String> vmNicUuids) { this.vmNicUuids = vmNicUuids; } public void setSecurityGroupUuid(String securityGroupUuid) { this.securityGroupUuid = securityGroupUuid; } }
[ "xing5820@gmail.com" ]
xing5820@gmail.com
eac6c1b661264a4b30c7adf6e29cb513138b6901
a94d20a6346d219c84cc97c9f7913f1ce6aba0f8
/mottak/web/webapp/src/main/java/no/nav/foreldrepenger/fordel/web/app/metrics/InntektsmeldingCache.java
b53e23467c06b9030b78b37276d180006b43ef8d
[ "MIT" ]
permissive
junnae/spsak
3c8a155a1bf24c30aec1f2a3470289538c9de086
ede4770de33bd896d62225a9617b713878d1efa5
refs/heads/master
2020-09-11T01:56:53.748986
2019-02-06T08:14:42
2019-02-06T08:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,202
java
package no.nav.foreldrepenger.fordel.web.app.metrics; import java.time.LocalDate; import java.util.HashMap; import java.util.Map; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; import no.nav.foreldrepenger.fordel.kodeverk.DokumentTypeId; import no.nav.foreldrepenger.fordel.kodeverk.Fagsystem; import no.nav.foreldrepenger.mottak.domene.oppgavebehandling.OpprettGSakOppgaveTask; import no.nav.foreldrepenger.mottak.task.KlargjorForVLTask; import no.nav.vedtak.util.FPDateUtil; @ApplicationScoped public class InntektsmeldingCache { private MetricRepository metricRepository; private static final long MAX_DATA_ALDER_MS = 10000; private Map<String, Long> total; private Map<String, Long> dagens; private Map<Fagsystem, String> taskNames; private long antallLestTidspunktMs = 0; InntektsmeldingCache() { // for CDI proxy } @Inject public InntektsmeldingCache(MetricRepository metricRepository) { this.metricRepository = metricRepository; this.total = new HashMap<>(); this.dagens = new HashMap<>(); this.taskNames = new HashMap<>(); taskNames.put(Fagsystem.GOSYS, OpprettGSakOppgaveTask.TASKNAME); taskNames.put(Fagsystem.FPSAK, KlargjorForVLTask.TASKNAME); } public Long hentInntektsMeldingerSendtTilSystem(Fagsystem fagsystem, LocalDate dag) { refreshDataIfNeeded(); String task = taskNames.get(fagsystem); return dag == null ? total.getOrDefault(task, 0l) : dagens.getOrDefault(task, 0l); } private void refreshDataIfNeeded() { long naaMs = System.currentTimeMillis(); long alderMs = naaMs - antallLestTidspunktMs; if (alderMs >= MAX_DATA_ALDER_MS) { for (String task : taskNames.values()) { dagens.put(task, metricRepository.tellAntallDokumentTypeIdForTaskType(task, DokumentTypeId.INNTEKTSMELDING.getKode(), FPDateUtil.iDag())); total.put(task, metricRepository.tellAntallDokumentTypeIdForTaskType(task, DokumentTypeId.INNTEKTSMELDING.getKode(), null)); } antallLestTidspunktMs = System.currentTimeMillis(); } } }
[ "roy.andre.gundersen@nav.no" ]
roy.andre.gundersen@nav.no
e4754c562f8f58cd166f8935ccd3bc5393c4415d
6129f61a656001aefc24463e5ca7da8fed75785a
/src/java/br/com/psystems/crud/command/BuscarFornecedorCommand.java
a64a53af67a0e3e1ee10f07d2f89e9f156db953c
[]
no_license
diegotpereira/Projeto-Web
aabbee15600926e44f55e08acf74b2e3744e413a
f86f38eb4d63be7e55a31fb65d6603bcdef7b724
refs/heads/master
2020-09-13T16:41:36.823729
2019-11-20T03:48:37
2019-11-20T03:48:37
222,844,290
0
0
null
null
null
null
UTF-8
Java
false
false
1,164
java
/** * */ package br.com.psystems.crud.command; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; import br.com.psystems.crud.base.AbstractCommand; import br.com.psystems.crud.base.BaseDAO; import br.com.psystems.crud.dao.FornecedorDAO; import br.com.psystems.crud.exception.DAOException; import br.com.psystems.crud.model.Fornecedor; /** * @author rafael.saldanha * */ public class BuscarFornecedorCommand extends AbstractCommand { public BuscarFornecedorCommand(FornecedorDAO dao) { this.dao = dao; } private static final long serialVersionUID = 7606485709102366372L; private static Logger logger = Logger.getLogger(BuscarFornecedorCommand.class); private String pagina = PAGE_FORNECEDOR_FORMULARIO; private BaseDAO<Fornecedor> dao; @Override public String execute(HttpServletRequest request) { try { Fornecedor fornecedor = dao.findById(getID(request)); setEntity(request, fornecedor); } catch (DAOException | ServletException e) { logger.error(e.getMessage()); pagina = PAGE_FORNECEDOR_LISTA; setException(request, e); } return pagina; } }
[ "diegoteixeirapereira@hotmail.com" ]
diegoteixeirapereira@hotmail.com
ff5a3c50ca1cce3658cdab5d3c36e958b8c89797
e27942cce249f7d62b7dc8c9b86cd40391c1ddd4
/modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201702/ContentBundleServiceInterfacecreateContentBundles.java
3d90e7b0164cbeded687f947b6eccfb3b178ee60
[ "Apache-2.0" ]
permissive
mo4ss/googleads-java-lib
b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a
efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641
refs/heads/master
2022-12-05T00:30:56.740813
2022-11-16T10:47:15
2022-11-16T10:47:15
108,132,394
0
0
Apache-2.0
2022-11-16T10:47:16
2017-10-24T13:41:43
Java
UTF-8
Java
false
false
2,929
java
// Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.api.ads.dfp.jaxws.v201702; 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.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * * Creates new {@link ContentBundle} objects. * * @param contentBundles the content bundles to create * @return the created content bundles with their IDs filled in * * * <p>Java class for createContentBundles element declaration. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;element name="createContentBundles"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="contentBundles" type="{https://www.google.com/apis/ads/publisher/v201702}ContentBundle" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "contentBundles" }) @XmlRootElement(name = "createContentBundles") public class ContentBundleServiceInterfacecreateContentBundles { protected List<ContentBundle> contentBundles; /** * Gets the value of the contentBundles 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 contentBundles property. * * <p> * For example, to add a new item, do as follows: * <pre> * getContentBundles().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ContentBundle } * * */ public List<ContentBundle> getContentBundles() { if (contentBundles == null) { contentBundles = new ArrayList<ContentBundle>(); } return this.contentBundles; } }
[ "api.cseeley@gmail.com" ]
api.cseeley@gmail.com
cf5628566b4c8d4e6f9e157ece4e0c98151e7f36
e0df638646bbb7891c5ff5ff996f8d3f4d08d0cb
/modules/mq/mq-service/mq-service-impl/src/main/java/grape/mq/service/impl/ApiMqProducerServiceImpl.java
6b81ecf50bbc40a2e25e5086bb0b593e810ba21c
[]
no_license
feihua666/grape
479f758600da13e7b43b2d60744c304ed72f71a4
22bd2eebd4952022dde72ea8ff9e85d6b1d79595
refs/heads/master
2023-01-22T13:00:02.901359
2020-01-02T05:01:22
2020-01-02T05:01:22
197,750,420
0
0
null
2023-01-04T08:23:17
2019-07-19T10:05:42
TSQL
UTF-8
Java
false
false
489
java
package grape.mq.service.impl; import grape.mq.service.api.ApiMqProducerService; import grape.mq.service.dto.MessageParam; import org.springframework.amqp.core.AmqpTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * Created by yangwei * Created at 2019/11/12 14:22 */ @Component public class ApiMqProducerServiceImpl implements ApiMqProducerService { @Autowired private AmqpTemplate amqpTemplate; }
[ "feihua666@sina.com" ]
feihua666@sina.com
34129fc9ae7ad75a359706560b55a9105a6d97b5
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__float_Property_divide_71a.java
398d44dd6ce242801a927c8bac4d00313aaf92bc
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
3,415
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__float_Property_divide_71a.java Label Definition File: CWE369_Divide_by_Zero__float.label.xml Template File: sources-sinks-71a.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: Property Read data from a system property * GoodSource: A hardcoded non-zero number (two) * Sinks: divide * GoodSink: Check for zero before dividing * BadSink : Dividing by a value that may be zero * Flow Variant: 71 Data flow: data passed as an Object reference argument 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 java.util.logging.Level; import java.util.logging.Logger; public class CWE369_Divide_by_Zero__float_Property_divide_71a extends AbstractTestCase { public void bad() throws Throwable { float data; data = -1.0f; /* Initialize data */ /* get system property user.home */ /* POTENTIAL FLAW: Read data from a system property */ { String s_data = System.getProperty("user.home"); if (s_data != null) { try { data = Float.parseFloat(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } (new CWE369_Divide_by_Zero__float_Property_divide_71b()).bad_sink((Object)data ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { float data; /* FIX: Use a hardcoded number that won't a divide by zero */ data = 2.0f; (new CWE369_Divide_by_Zero__float_Property_divide_71b()).goodG2B_sink((Object)data ); } /* goodB2G() - use badsource and goodsink */ private void goodB2G() throws Throwable { float data; data = -1.0f; /* Initialize data */ /* get system property user.home */ /* POTENTIAL FLAW: Read data from a system property */ { String s_data = System.getProperty("user.home"); if (s_data != null) { try { data = Float.parseFloat(s_data.trim()); } catch(NumberFormatException nfe) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", nfe); } } } (new CWE369_Divide_by_Zero__float_Property_divide_71b()).goodB2G_sink((Object)data ); } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
0c97115f7823bc2eae0797d98995b2352a0b2812
4be72dee04ebb3f70d6e342aeb01467e7e8b3129
/bin/ext-integration/sap/synchronousOM/sapordermgmtbol/src/de/hybris/platform/sap/sapordermgmtbol/transaction/salesdocument/backend/interf/erp/ConstantsR3Lrd.java
81e711a4f4767373d6fd4f2d8519821045c1a9e4
[]
no_license
lun130220/hybris
da00774767ba6246d04cdcbc49d87f0f4b0b1b26
03c074ea76779f96f2db7efcdaa0b0538d1ce917
refs/heads/master
2021-05-14T01:48:42.351698
2018-01-07T07:21:53
2018-01-07T07:21:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,529
java
/* * [y] hybris Platform * * Copyright (c) 2000-2015 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.interf.erp; import java.util.Date; /** * Interface containing names of function modules and UI Elements, RFC * Constants, field names <br> * * @version 1.0 */ public interface ConstantsR3Lrd { /** * Represents an initial date for the ERP backend layer. */ public static final Date DATE_INITIAL = new Date(0); /** * ID of function module ERP_LORD_SET to set sales document data in ERP. */ public static final String FM_LO_API_SET = "ERP_LORD_SET"; /** * ID of function module ERP_LORD_DO_ACTIONS to perform LO-API actions. */ public static final String FM_LO_API_DO_ACTIONS = "ERP_LORD_DO_ACTIONS"; /** * ID of function module ERP_LORD_LOAD which starts a LO-API session in ERP. */ public static final String FM_LO_API_LOAD = "ERP_WEC_ORDER_LOAD"; /** * ID of function module ERP_LORD_SAVE which saves the sales document data * in ERP. */ public static final String FM_LO_API_SAVE = "ERP_LORD_SAVE"; /** * ID of function module ERP_LORD_SET_ACTIVE_FIELDS which sets the LORD * active fields in ERP. */ public static final String FM_LO_API_SET_ACTIVE_FIELDS = "ERP_LORD_SET_ACTIVE_FIELDS"; /** * ID of function module ERP_LORD_SET_VCFG_ALL which sets data of * configurable products in ERP. */ public static final String FM_LO_API_SET_VCFG_ALL = "ERP_LORD_SET_VCFG_ALL"; /** * ID of function module ERP_WEC_GET_VCFG_ALL which gets data of * configurable products in ERP. */ public static final String FM_WEC_API_GET_VCFG_ALL = "ERP_WEC_GET_VCFG_ALL"; /** * ID of function module ERP_WEC_ORDER_GET which reads all necessary * attributes of a sales document via LO-API. */ public static final String FM_LO_API_WEC_ORDER_GET = "ERP_WEC_ORDER_GET"; /** * ID of function module ERP_LORD_CLOSE which closes a LO-API session */ public static final String FM_LO_API_CLOSE = "ERP_LORD_CLOSE"; /** * ID of function module ERP_LORD_COPY which copies a LO-API document, e.g. * when an order is created referring to a quotation */ public static final String FM_LO_API_COPY = "ERP_LORD_COPY"; /** * Ignore message variables for message comparison. This attribute needs to * be passed for the first message variable. The contents of the other ones * are then ignored. */ public static final String MESSAGE_IGNORE_VARS = "*"; /* Attributes for dynamic field control */ /** UI element */ public static String UI_ELEMENT_PURCHASE_ORDER_EXT = "order.purchaseOrderExt"; /** UI element */ public static String UI_ELEMENT_SHIPPING_METHOD = "order.shippingMethod"; /** UI element */ public static String UI_ELEMENT_HEADER_TEXT = "order.headerText"; /** UI element */ public static String UI_ELEMENT_SHIPPING_COUNTRY = "order.shippingCountry"; /** UI element */ public static String UI_ELEMENT_DELIVERY_REGION = "order.deliveryRegion"; /** UI element */ public static String UI_ELEMENT_DELIVERY_TYPE = "order.deliveryType"; /** UI element */ public static String UI_ELEMENT_DISCOUNTS = "order.rebatesValue"; /** UI element */ public static String UI_ELEMENT_HEADER_USERSTATUS = "order.userStatusList"; /** UI element */ public static String UI_ELEMENT_REFERENCES = "order.extRefNumbers"; /** UI element */ public static String UI_ELEMENT_RECALL_ID = "order.recallId"; /** UI element */ public static String UI_ELEMENT_EXT_REF_OBJECTS = "order.extRefObjects"; /** UI element */ public static String UI_ELEMENT_ITEM_REQDELIVDATE = "item.reqDeliveryDate"; /** UI element */ public static String UI_ELEMENT_ITEM_OVERALLSTATUS = "item.overallStatus"; // not there in UI control now /** UI element */ public static String UI_ELEMENT_ITEM_DESCRIPTION = "item.description"; /** * UI element: Item text */ public static String UI_ELEMENT_ITEM_TEXT = "item.itemText"; /** UI element */ public static String UI_ELEMENT_ITEM_PRODUCT = "item.productID"; /** UI element */ public static String UI_ELEMENT_ITEM_PRODUCT_ID = "item.productGUID"; /** UI element */ // not there in UI control now public static String UI_ELEMENT_ITEM_LATESTDELIVDATE = "item.latestDelivDate"; // not /** UI element */ public static String UI_ELEMENT_ITEM_PAYTERMS = "item.paymentterms"; /** UI element */ public static String UI_ELEMENT_ITEM_QTY = "item.quantity"; /** UI element */ public static String UI_ELEMENT_ITEM_UNIT = "item.unit"; /** UI element */ // not there in UI control now public static String UI_ELEMENT_ITEM_DELIVPRIO = "item.deliveryPriority"; /** UI element */ public static String UI_ELEMENT_ITEM_DELIVERTO = "item.deliverTo"; /** UI element */ public static String UI_ELEMENT_ITEM_CONFIG = "item.configuration"; /** UI element */ public static String UI_GROUP_ORDER = "order.header"; /** UI element */ public static String UI_GROUP_ITEM = "order.item"; /** UI element */ public static String UI_ELEMENT_ITEM_USERSTATUS = "item.userStatusList"; /** text control constant */ public static String LF = "\n"; /** text control constant */ public static String SEPARATOR = "/"; /** RFC constant. */ public static String BAPI_RETURN_ERROR = "E"; /** RFC constant. */ public static String BAPI_RETURN_WARNING = "W"; /** RFC constant. */ public static String BAPI_RETURN_INFO = "I"; /** RFC constant. */ public static String BAPI_RETURN_ABORT = "A"; /** RFC constant. */ public static String ROLE_CONTACT = "AP"; /** RFC constant. */ public static String ROLE_SOLDTO = "AG"; /** RFC constant. */ public static String ROLE_SHIPTO = "WE"; /** RFC constant. */ public static String ROLE_BILLPARTY = "RE"; /** RFC constant. */ public static String ROLE_PAYER = "RG"; /** * The scenario ID for the LO-API call. Will not be persistet, but can be * used to control LO-API processing. */ public static String scenario_LO_API_WEC = "CRM_WEC"; /** ABAP constant */ public static String ABAP_TRUE = "X"; /* * A list of commonly used RFC constants, to save memory via reducing the * number of static strings */ /** field name */ public static String FIELD_HANDLE = "HANDLE"; /** * Represents item number in SD */ public static String FIELD_POSNR = "POSNR"; /** field name */ public static String FIELD_HANDLE_PARENT = "HANDLE_PARENT"; /** field name */ public static String FIELD_OBJECT_ID = "OBJECT_ID"; /** field name */ public static String FIELD_ID = "ID"; /** field name */ public static String FIELD_SPRAS_ISO = "SPRAS_ISO"; /** field name */ public static String FIELD_TEXT_STRING = "TEXT_STRING"; /** field name */ public static String FIELD_HANDLE_ITEM = "HANDLE_ITEM"; }
[ "lun130220@gamil.com" ]
lun130220@gamil.com
2305779877b4dcebd75c7ad42be54eefeb827072
a95fbe4532cd3eb84f63906167f3557eda0e1fa3
/src/main/java/l2f/gameserver/network/loginservercon/gspackets/PlayerInGame.java
afb904f9642404e9c6eb3dd20d2b6fd78b36fd91
[ "MIT" ]
permissive
Kryspo/L2jRamsheart
a20395f7d1f0f3909ae2c30ff181c47302d3b906
98c39d754f5aba1806f92acc9e8e63b3b827be49
refs/heads/master
2021-04-12T10:34:51.419843
2018-03-26T22:41:39
2018-03-26T22:41:39
126,892,421
2
0
null
null
null
null
UTF-8
Java
false
false
351
java
package l2f.gameserver.network.loginservercon.gspackets; import l2f.gameserver.network.loginservercon.SendablePacket; public class PlayerInGame extends SendablePacket { private String account; public PlayerInGame(String account) { this.account = account; } @Override protected void writeImpl() { writeC(0x03); writeS(account); } }
[ "cristianleon48@gmail.com" ]
cristianleon48@gmail.com
b8533085077303210d172c8c1a5354a468f799a3
774d36285e48bd429017b6901a59b8e3a51d6add
/sources/com/google/android/gms/internal/ads/zzqh.java
145223251a1faff223c4ee6077634048dfc4af1c
[]
no_license
jorge-luque/hb
83c086851a409e7e476298ffdf6ba0c8d06911db
b467a9af24164f7561057e5bcd19cdbc8647d2e5
refs/heads/master
2023-08-25T09:32:18.793176
2020-10-02T11:02:01
2020-10-02T11:02:01
300,586,541
0
0
null
null
null
null
UTF-8
Java
false
false
535
java
package com.google.android.gms.internal.ads; import android.app.Activity; import android.app.Application; /* compiled from: com.google.android.gms:play-services-ads@@19.1.0 */ final class zzqh implements zzqk { private final /* synthetic */ Activity val$activity; zzqh(zzqc zzqc, Activity activity) { this.val$activity = activity; } public final void zza(Application.ActivityLifecycleCallbacks activityLifecycleCallbacks) { activityLifecycleCallbacks.onActivityDestroyed(this.val$activity); } }
[ "jorge.luque@taiger.com" ]
jorge.luque@taiger.com
b6a2a1042ff8341645b7c6baf91aadfcf2f3f680
30472cec0dbe044d52b029530051ab404701687f
/src/main/java/com/sforce/soap/tooling/ContainerAsyncRequestState.java
58cdbd10e2094dca9de319f2223799c412c1b3f9
[ "BSD-3-Clause" ]
permissive
madmax983/ApexLink
f8e9dcf8f697ed4e34ddcac353c13bec707f3670
30c989ce2c0098097bfaf586b87b733853913155
refs/heads/master
2020-05-07T16:03:15.046972
2019-04-08T21:08:06
2019-04-08T21:08:06
180,655,963
1
0
null
2019-04-10T20:08:30
2019-04-10T20:08:30
null
UTF-8
Java
false
false
1,112
java
package com.sforce.soap.tooling; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public enum ContainerAsyncRequestState { /** * Enumeration : Queued */ Queued("Queued"), /** * Enumeration : Invalidated */ Invalidated("Invalidated"), /** * Enumeration : Completed */ Completed("Completed"), /** * Enumeration : Failed */ Failed("Failed"), /** * Enumeration : Error */ Error("Error"), /** * Enumeration : Aborted */ Aborted("Aborted"), ; public static Map<String, String> valuesToEnums; static { valuesToEnums = new HashMap<String, String>(); for (ContainerAsyncRequestState e : EnumSet.allOf(ContainerAsyncRequestState.class)) { valuesToEnums.put(e.toString(), e.name()); } } private String value; private ContainerAsyncRequestState(String value) { this.value = value; } @Override public String toString() { return value; } }
[ "nawforce@gmail.com" ]
nawforce@gmail.com
204a7923b60919df981c116d23567efef9b6bcdf
5e93b90a0b7c3cee3570de82aec07559576eed13
/unmixin/src/unmixin/Parser.java
083fcf1e714433839b0de81e348efbda4e2d7416
[]
no_license
priangulo/BttFTestProjects
a6f37c83b52273f8b5f3d7cbb7116c85a0fd4ef2
cc2294d24f9b0fed46110b868bd3a8f6c8794475
refs/heads/master
2021-03-27T10:30:10.316285
2017-10-25T21:39:55
2017-10-25T21:39:55
64,432,711
0
0
null
null
null
null
UTF-8
Java
false
false
5,344
java
package unmixin; import java.io.File ; import java.io.FileInputStream ; import java.io.FileNotFoundException ; import java.io.InputStream ; import java.io.InputStreamReader ; import java.io.Reader ; import java.io.UnsupportedEncodingException ; import java.lang.reflect.Method ; import java.util.HashMap ; import java.util.Map ; //-----------------------------------------------------------------------// // Parser facade below: //-----------------------------------------------------------------------// /** * Facade for underlying {@link BaliParser} that provides factory methods * named <code>getInstance</code> for obtaining a <em>singleton</em> * instance of the parser. The factory methods should be used instead of * constructors or the {@link BaliParser#ReInit()} methods. * * @layer<kernel> */ final public class Parser { //-----------------------------------------------------------------------// // Static factory methods for instantiation: //-----------------------------------------------------------------------// /** * Return singleton <code>Parser</code> in current state. * * @layer<kernel> */ public static Parser getInstance() { return parser ; } /** * Re-initialize singleton <code>Parser</code> to start parsing from * a given {@link File}, returning the updated <code>Parser</code>. * * @layer<kernel> */ public static Parser getInstance( File inputFile ) throws FileNotFoundException { return getInstance( new FileInputStream( inputFile ) ) ; } /** * Re-initialize singleton <code>Parser</code> to start parsing from * an {@link InputStream}, returning the updated <code>Parser</code>. * * @layer<kernel> */ public static Parser getInstance( InputStream stream ) { try { return getInstance( new InputStreamReader( stream,"ISO-8859-1" ) ); } catch ( UnsupportedEncodingException except ) { return getInstance( new InputStreamReader( stream ) ) ; } } /** * Re-initialize singleton <code>Parser</code> to start parsing from * a {@link Reader} object, returning the updated <code>Parser</code>. * * @layer<kernel> */ public static Parser getInstance( Reader reader ) { if ( parser == null ) parser = new Parser( reader ) ; else parser.reset (reader) ; return parser ; } //-----------------------------------------------------------------------// // Parser instance methods: //-----------------------------------------------------------------------// /** * Returns the result of the last parse, <code>null</code> if none. **/ public AstNode getParse () { return lastParse ; } /** * Parses the input against the specified non-terminal rule. This method * doesn't require that a successful parse must be terminated by an * end-of-file. Instead, any non-matching input is allowed. * * @return an {@link AstNode} with the result of the parse. * @throws ParseException if the parse fails. **/ public AstNode parse (String rule) throws ParseException { try { Method method = (Method) ruleMap.get (rule) ; if (null == method) { Class klass = baliParser.getClass() ; method = klass.getMethod (rule, class0) ; if (! AstNode.class.isAssignableFrom (method.getReturnType())) throw new IllegalArgumentException (rule + " not found") ; ruleMap.put (rule, method) ; } return (AstNode) method.invoke (baliParser, object0) ; } catch (RuntimeException re) { throw re ; } catch (Exception except) { ParseException pe = baliParser.generateParseException() ; pe.initCause (except) ; throw pe ; } } /** * Parses the input against the start rule, then parses an end-of-file. * * @return an {@link AstNode} with the result of the parse. * * @throws ParseException * if input doesn't match the start rule or if it's not terminated by an * end-of-file. **/ public AstNode parseAll () throws ParseException { lastParse = BaliParser.getStartRoot (baliParser) ; return lastParse ; } /** * Parses an end-of-file from the input. * * @throws ParseException if input is not at end of file. **/ public void parseEOF () throws ParseException { baliParser.requireEOF() ; } /** * Resets the parser's input to another {@link Reader}. **/ private void reset (Reader reader) { baliParser.ReInit (reader) ; } //-----------------------------------------------------------------------// /** * Private constructor to create singleton of <code>Parser</code>. * * @layer<kernel> */ private Parser( Reader reader ) { if (null == reader) throw new NullPointerException ("\"reader\" is null") ; this.baliParser = new BaliParser (reader) ; this.lastParse = null ; this.ruleMap = new HashMap() ; } final private BaliParser baliParser ; private AstNode lastParse ; final private Map ruleMap ; final private static Class[] class0 = new Class [0] ; final private static Object[] object0 = new Object [0] ; private static Parser parser = null ; }
[ "priangulo@gmail.com" ]
priangulo@gmail.com
3a8a0be2aacde410d5a18207371eb2cee361ec2c
baf0c5152a9e1d1bfac648c15136a9d39a0a3341
/SSHJ/src/com/ssh/dao/BaseDao.java
962c09774df1e28959c383bc13d832f8c15db4fa
[]
no_license
zhaoccx/FrameWork
8a3015b5cfdaa3765ea45e93c9fe66786e1dfada
bbd4e121b6acb47e5330f315da4a74185c3e64ac
refs/heads/master
2020-05-21T23:21:00.880641
2018-07-06T04:44:17
2018-07-06T04:44:17
29,951,828
0
0
null
null
null
null
UTF-8
Java
false
false
368
java
package com.ssh.dao; import org.hibernate.Session; import org.hibernate.SessionFactory; public class BaseDao { private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public Session getSession() { return this.sessionFactory.getCurrentSession(); } }
[ "zhaoccx@hotmail.com" ]
zhaoccx@hotmail.com
884724ecd4116b893c05cb306ded4304e46db7d3
afb2a5da2693ddc7ae85e910bc255507789b3c38
/parceler-api/src/main/java/org/parceler/Generated.java
fa190c4db062f5ecb8b1d18aa720782cb588875e
[ "Apache-2.0" ]
permissive
FlyingHeem/parceler
e93d2a8881ac37788a0ef131937efdbd96c2af33
e03ce0f9ce6194d4ffff18f2d3c12e18f1fba6a0
refs/heads/master
2021-01-16T02:27:18.107164
2015-03-12T01:23:17
2015-03-12T01:23:17
32,388,159
1
0
null
2015-03-17T10:57:12
2015-03-17T10:57:12
null
UTF-8
Java
false
false
1,475
java
/** * Copyright 2013-2015 John Ericksen * * 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.parceler; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.SOURCE; /** * Copy of the Java Generated annotation (absent in Android implementation) * * @author John Ericksen */ @Documented @Retention(SOURCE) @Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER}) public @interface Generated { /** * Identifies the Generator used to generate the annotated class. */ java.lang.String[] value(); /** * Specifies the date in ISO 8601 format when this class was generated. */ java.lang.String date() default ""; /** * Contains any relevant comments. */ java.lang.String comments() default ""; }
[ "johncarl81@gmail.com" ]
johncarl81@gmail.com
42d4f718523a2e87148f624808b76ffc8004ba7f
a770e95028afb71f3b161d43648c347642819740
/sources/org/telegram/tgnet/TLRPC$TL_pageBlockTable.java
c2e182a62cd8d483a9972482eb7fca028fdbf4f0
[]
no_license
Edicksonjga/TGDecompiledBeta
d7aa48a2b39bbaefd4752299620ff7b72b515c83
d1db6a445d5bed43c1dc8213fb8dbefd96f6c51b
refs/heads/master
2023-08-25T04:12:15.592281
2021-10-28T20:24:07
2021-10-28T20:24:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,158
java
package org.telegram.tgnet; import java.util.ArrayList; public class TLRPC$TL_pageBlockTable extends TLRPC$PageBlock { public static int constructor = -NUM; public boolean bordered; public int flags; public ArrayList<TLRPC$TL_pageTableRow> rows = new ArrayList<>(); public boolean striped; public TLRPC$RichText title; public void readParams(AbstractSerializedData abstractSerializedData, boolean z) { int readInt32 = abstractSerializedData.readInt32(z); this.flags = readInt32; int i = 0; this.bordered = (readInt32 & 1) != 0; this.striped = (readInt32 & 2) != 0; this.title = TLRPC$RichText.TLdeserialize(abstractSerializedData, abstractSerializedData.readInt32(z), z); int readInt322 = abstractSerializedData.readInt32(z); if (readInt322 == NUM) { int readInt323 = abstractSerializedData.readInt32(z); while (i < readInt323) { TLRPC$TL_pageTableRow TLdeserialize = TLRPC$TL_pageTableRow.TLdeserialize(abstractSerializedData, abstractSerializedData.readInt32(z), z); if (TLdeserialize != null) { this.rows.add(TLdeserialize); i++; } else { return; } } } else if (z) { throw new RuntimeException(String.format("wrong Vector magic, got %x", new Object[]{Integer.valueOf(readInt322)})); } } public void serializeToStream(AbstractSerializedData abstractSerializedData) { abstractSerializedData.writeInt32(constructor); int i = this.bordered ? this.flags | 1 : this.flags & -2; this.flags = i; int i2 = this.striped ? i | 2 : i & -3; this.flags = i2; abstractSerializedData.writeInt32(i2); this.title.serializeToStream(abstractSerializedData); abstractSerializedData.writeInt32(NUM); int size = this.rows.size(); abstractSerializedData.writeInt32(size); for (int i3 = 0; i3 < size; i3++) { this.rows.get(i3).serializeToStream(abstractSerializedData); } } }
[ "fabian_pastor@msn.com" ]
fabian_pastor@msn.com
08c5652c8bd4fd6dee7f4d357caa43b989c0112d
0f35cd99303b8789f94cc767eba2c59feffd5b80
/basic/src/day36/StackQueue/StackExample.java
d972196393ce0f936162a0b6bd2b58d19a20bed0
[]
no_license
seungzz/java2020
6f8bae23fa3903e6df3aceaeb042ad31f0b5cc08
eb85d4ba04d69da267574e443a93cdcd59896527
refs/heads/master
2023-01-20T13:48:34.427394
2020-10-29T03:04:00
2020-10-29T03:04:00
297,261,422
0
0
null
null
null
null
UHC
Java
false
false
766
java
package day36.StackQueue; import java.util.Stack; public class StackExample { public static void main(String[] args) { Stack<Coin> coinBox = new Stack<Coin>(); coinBox.push(new Coin(100)); coinBox.push(new Coin(50)); coinBox.push(new Coin(500)); coinBox.push(new Coin(10)); //push() 메소드를 통해서 스택에 값을 넣어준다. while(!coinBox.isEmpty()) { Coin coin2 = coinBox.peek(); //peek()메소드는 꺼내지만 값을 삭제하지는 않는다. System.out.println("꺼내온 동전: "+coin2.getValue()); Coin coin = coinBox.pop(); //pop() 메소드를 사용하면 맨위 스택에서 값을 꺼내오면서 값을 삭제. System.out.println("꺼내온 동전: "+coin.getValue()); } } }
[ "KW505@505-07" ]
KW505@505-07
d20049aeaf8cb10efadc515da0255eb2c0d50ee1
896cca57024190fc3fbb62f2bd0188fff24b24c8
/2.7.x/choicemaker-cm/choicemaker-j2ee/com.choicemaker.cm.transitivity/src/main/java/com/choicemaker/cm/transitivity/util/GraphFilter.java
6da5595d93d174ae3477956e7def11fa65b2a27c
[]
no_license
fgregg/cm
0d4f50f92fde2a0bed465f2bec8eb7f2fad8362c
c0ab489285938f14cdf0a6ed64bbda9ac4d04532
refs/heads/master
2021-01-10T11:27:00.663407
2015-08-11T19:35:00
2015-08-11T19:35:00
55,807,163
0
1
null
null
null
null
UTF-8
Java
false
false
2,000
java
/* * Copyright (c) 2001, 2009 ChoiceMaker Technologies, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License * v1.0 which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * ChoiceMaker Technologies, Inc. - initial API and implementation */ package com.choicemaker.cm.transitivity.util; import java.util.List; import com.choicemaker.cm.io.blocking.automated.offline.data.MatchRecord2; import com.choicemaker.cm.transitivity.core.CompositeEntity; import com.choicemaker.cm.transitivity.core.EdgeProperty; import com.choicemaker.cm.transitivity.core.Link; /** * This object takes in a graph (CompositeEntity) and an EdgeProperty and * returns a graph satisfying that EdgeProperty. * * @author pcheung * * ChoiceMaker Technologies, Inc. */ @SuppressWarnings({"rawtypes", "unchecked"}) public class GraphFilter { private static GraphFilter filter = new GraphFilter(); private GraphFilter() { } public static GraphFilter getInstance() { return filter; } /** * This method returns a graph where the edges satisfy the given * EdgeProperty. * * @param ce * - input graph * @param ep * - property which the edges need to satisfy * @return CompositeEnity - new graph. */ public <T extends Comparable<T>> CompositeEntity<T> filter( CompositeEntity<T> ce, EdgeProperty ep) { UniqueSequence seq = UniqueSequence.getInstance(); CompositeEntity<T> ret = new CompositeEntity(seq.getNextInteger()); // get all the links List links = ce.getAllLinks(); for (int i = 0; i < links.size(); i++) { Link link = (Link) links.get(i); List mrs = link.getLinkDefinition(); for (int j = 0; j < mrs.size(); j++) { MatchRecord2 mr = (MatchRecord2) mrs.get(j); if (ep.hasProperty(mr)) { ret.addMatchRecord(mr); } } } return ret; } }
[ "rick@rphall.com" ]
rick@rphall.com
305aecad8d559685345cffbea51d3988c377db81
1ed0e7930d6027aa893e1ecd4c5bba79484b7c95
/keiji/source/java/com/vungle/publisher/qe.java
010152c109f58a71d65c1ad765481cfe83227264
[]
no_license
AnKoushinist/hikaru-bottakuri-slot
36f1821e355a76865057a81221ce2c6f873f04e5
7ed60c6d53086243002785538076478c82616802
refs/heads/master
2021-01-20T05:47:00.966573
2017-08-26T06:58:25
2017-08-26T06:58:25
101,468,394
0
1
null
null
null
null
UTF-8
Java
false
false
1,343
java
package com.vungle.publisher; import com.vungle.log.Logger; import javax.inject.Inject; /* compiled from: vungle */ public class qe implements qn { private boolean a; @Inject public ql eventBus; public void register() { if (this.a) { Logger.w(Logger.EVENT_TAG, getClass().getName() + " already listening"); return; } Logger.d(Logger.EVENT_TAG, getClass().getName() + " listening"); this.eventBus.b(this); this.a = true; } public void registerSticky() { if (this.a) { Logger.w(Logger.EVENT_TAG, getClass().getName() + " already listening sticky"); return; } Logger.d(Logger.EVENT_TAG, getClass().getName() + " listening sticky"); this.eventBus.a.a((Object) this, "onEvent", true); this.a = true; } public void unregister() { Logger.d(Logger.EVENT_TAG, getClass().getName() + " unregistered"); this.eventBus.a.a((Object) this); this.a = false; } public void registerOnce() { if (this.a) { Logger.v(Logger.EVENT_TAG, getClass().getName() + " already listening"); return; } Logger.d(Logger.EVENT_TAG, getClass().getName() + " listening"); this.eventBus.b(this); this.a = true; } }
[ "09f713c@sigaint.org" ]
09f713c@sigaint.org
70ce2c65d890def2ddb1843687380892c586e40e
7d895978f0a59360b67d675cff0742d68b5b9095
/src/NaryTree/Codec.java
8bc7868093ff53fa2aa56b54b292b24c5eabe00c
[]
no_license
sureshrmdec/Algorithm-Java
b77ce99988b895377382c804f9fafe56a20a0521
4674652f2e0fc3a9c41dd0045c41fb0da95d8e5c
refs/heads/master
2023-07-05T08:54:55.926110
2021-08-11T23:31:48
2021-08-11T23:31:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,698
java
package NaryTree; import java.util.ArrayList; import java.util.List; /** * Created by xhu on 6/23/17. */ public class Codec { final char endMarker = ')'; int index = 0; public String serialize(NTreeNode root){ if( root == null){ return ""; } StringBuilder result = new StringBuilder(); serializeHelper(root, result); return result.toString(); } private void serializeHelper(NTreeNode root, StringBuilder result){ if(root == null){ result.append(endMarker); } result.append(String.valueOf(root.vaule)); if(root.children == null || root.children.size() == 0){ result.append(endMarker); }else { for (NTreeNode n : root.children) { serializeHelper(n, result); } result.append(endMarker); } } public NTreeNode deserialize(String code){ if(code == null || code.length() == 0){ return null; } NTreeNode root = deserializeHelper(code); return root; } private NTreeNode deserializeHelper(String code){ if(index >= code.length() ){ return null; } if(code.charAt(index) == endMarker){ return null; } NTreeNode root = new NTreeNode(Character.getNumericValue(code.charAt(index))); index++; for(int i = 0; i<code.length() && index<code.length(); i++){ if(code.charAt(index) == endMarker){ break; } root.children.add(deserializeHelper(code)); index++; } return root; } }
[ "huyoucai.huxin@gmail.com" ]
huyoucai.huxin@gmail.com
dea03a882d9230ced4f003de994f17b76cadaf3f
fa34634b84455bf809dbfeeee19f8fb7e26b6f76
/4.JavaCollections/src/com/javarush/task/task38/task3810/Date.java
6100a458cf05c5bd045f8c0d954da95ab33711f0
[ "Apache-2.0" ]
permissive
Ponser2000/JavaRushTasks
3b4bdd2fa82ead3c72638f0f2826db9f871038cc
e6eb2e8ee2eb7df77273f2f0f860f524400f72a2
refs/heads/main
2023-04-04T13:23:52.626862
2021-03-25T10:43:04
2021-03-25T10:43:04
322,064,721
0
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.javarush.task.task38.task3810; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Date { //напиши свой код int year(); int month(); int day(); int hour(); int minute(); int second(); }
[ "ponser2000@gmail.com" ]
ponser2000@gmail.com
9ce805be5a5c9940009c386987142ce62c3fd8fd
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/58/org/apache/commons/math/random/MersenneTwister_setSeed_209.java
394f89bd949763a3ede7f1f5c3fc891721e715ae
[]
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
1,856
java
org apach common math random power pseudo random number gener develop makoto matsumoto takuji nishimura gener featur extrem period dimension equidistribut bit accuraci home page gener locat href http www math sci hiroshima mat emt html http www math sci hiroshima mat emt html gener paper makoto matsumoto takuji nishimura href http www math sci hiroshima mat articl pdf mersenn twister dimension equidistribut uniform pseudo random number gener acm transact model comput simul vol januari java port version gener written makoto matsumoto takuji nishimura origin copyright tabl border width cellpad align center bgcolor e0e0e0 copyright makoto matsumoto takuji nishimura right reserv redistribut sourc binari form modif permit provid condit met redistribut sourc code retain copyright notic list condit disclaim redistribut binari form reproduc copyright notic list condit disclaim document materi provid distribut name contributor endors promot product deriv softwar specif prior written permiss strong softwar provid copyright holder contributor express impli warranti includ limit impli warranti merchant fit purpos disclaim event copyright owner contributor liabl direct indirect incident special exemplari consequenti damag includ limit procur substitut good servic loss data profit busi interrupt caus theori liabil contract strict liabil tort includ neglig aris softwar advis possibl damag strong tabl version revis date mersenn twister mersennetwist bit stream gener bitsstreamgener serializ reiniti gener built seed state gener gener built seed param seed initi seed bit integ overrid set seed setse seed set seed setse seed seed 0xffffffffl
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
92057c94617037c89549234d465aa62fc9e52d4c
291541f10e39214307d21e7cc77f13bed5ffbe30
/app/src/main/java/com/ipd/xiangzui/utils/NavigationBarUtil.java
f15e9c8b5af187d6ee323545c71307fe407c295e
[]
no_license
RenVeCf/XiangZui
ae8ed965f749bfeadf9f2f2c07b4c1705a29656c
456679cd1be9e4949db2fbfa78aa5493bdd3d890
refs/heads/master
2020-06-27T13:43:42.509152
2019-10-11T05:49:23
2019-10-11T05:49:23
199,968,238
1
0
null
null
null
null
UTF-8
Java
false
false
2,982
java
package com.ipd.xiangzui.utils; import android.content.Context; import android.content.res.Resources; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import java.lang.reflect.Method; /** * Description : * Author : MengYang * Email : 942685687@qq.com * Time : 2018/9/2. */ public class NavigationBarUtil { public static void initActivity(View content) { new NavigationBarUtil(content); } private View mObserved;//被监听的视图 private int usableHeightView;//视图变化前的可用高度 private ViewGroup.LayoutParams layoutParams; private NavigationBarUtil(View content) { mObserved = content; //给View添加全局的布局监听器监听视图的变化 mObserved.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { resetViewHeight(); } }); layoutParams = mObserved.getLayoutParams(); } /** * 重置视图的高度,使不被底部虚拟键遮挡 */ private void resetViewHeight() { int usableHeightViewNow = CalculateAvailableHeight(); //比较布局变化前后的View的可用高度 if (usableHeightViewNow != usableHeightView) { //如果两次高度不一致 //将当前的View的可用高度设置成View的实际高度 layoutParams.height = usableHeightViewNow; mObserved.requestLayout();//请求重新布局 usableHeightView = usableHeightViewNow; } } /** * 计算视图高度 * * @return */ private int CalculateAvailableHeight() { Rect r = new Rect(); mObserved.getWindowVisibleDisplayFrame(r); // return (r.bottom - r.top);//如果不是沉浸状态栏,需要减去顶部高度 return (r.bottom);//如果是沉浸状态栏 } /** * 判断底部是否有虚拟键 * * @param context * @return */ public static boolean hasNavigationBar(Context context) { boolean hasNavigationBar = false; Resources rs = context.getResources(); int id = rs.getIdentifier("config_showNavigationBar", "bool", "android"); if (id > 0) { hasNavigationBar = rs.getBoolean(id); } try { Class systemPropertiesClass = Class.forName("android.os.SystemProperties"); Method m = systemPropertiesClass.getMethod("get", String.class); String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys"); if ("1".equals(navBarOverride)) { hasNavigationBar = false; } else if ("0".equals(navBarOverride)) { hasNavigationBar = true; } } catch (Exception e) { } return hasNavigationBar; } }
[ "942685687@qq.com" ]
942685687@qq.com
d4c2dba7f334cc463efc02475c849fe81ec09a25
15e2dd26a28a1243b56661035f3cc81683f08439
/main/recognition/test/boofcv/alg/tracker/meanshift/TestMeanShiftLikelihood.java
9d8ceecc90d385ead09fc76d54fe98a8dddf334b
[ "Apache-2.0" ]
permissive
agamsarup/BoofCV
acbf6b5e67f09b253150f7066988ae0ca86499f3
0d6f64c5b10f094c6ff85ecd540b80b5e81dcee4
refs/heads/master
2020-04-03T04:24:11.227975
2013-09-21T23:03:02
2013-09-21T23:03:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package boofcv.alg.tracker.meanshift; import org.junit.Test; import static org.junit.Assert.fail; /** * @author Peter Abeles */ public class TestMeanShiftLikelihood { @Test public void stuff() { fail("Implement"); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
32d5e869e40c8640e9da079d35f976dee957abeb
73fb3212274525b1ad47c4eeca7082a6a0a97250
/commonlibs/bhunheku/liblinkagerecyclerview/src/main/java/com/kunminx/linkagelistview/ui/DialogSampleFragment.java
1d32260d766fb7569a72d3c1087b841e51e0b506
[]
no_license
dahui888/androidkuangjia2021
d6ba565e14b50f2a484154d8fffdb486ee56f433
624e212b97bb4b47d4763f644be30ef2a26d244d
refs/heads/main
2023-07-18T00:00:43.079443
2021-08-26T10:15:53
2021-08-26T10:15:53
383,725,172
1
0
null
2021-07-07T08:18:31
2021-07-07T08:18:30
null
UTF-8
Java
false
false
3,830
java
package com.kunminx.linkagelistview.ui; /* * Copyright (c) 2018-present. KunMinX * * 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. */ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.button.MaterialButton; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.kunminx.linkage.LinkageRecyclerView; import com.kunminx.linkage.bean.DefaultGroupedItem; import com.kunminx.linkagelistview.R; import java.util.List; /** * Create by KunMinX at 19/5/8 */ public class DialogSampleFragment extends Fragment { private RecyclerView rv; private MaterialButton btn_preview; private static float DIALOG_HEIGHT = 400; private AlertDialog mDialog; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_dialogelm, container, false); rv = view.findViewById(R.id.rv); btn_preview = view.findViewById(R.id.btn_preview); setHasOptionsMenu(true); return view; } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); btn_preview.setOnClickListener(v -> { View view2 = View.inflate(getContext(), R.layout.layout_linkage, null); LinkageRecyclerView linkage = view2.findViewById(R.id.linkage); initLinkageData(linkage); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); mDialog = builder.setView(linkage).show(); linkage.setLayoutHeight(DIALOG_HEIGHT); }); } private void initLinkageData(LinkageRecyclerView linkage) { Gson gson = new Gson(); List<DefaultGroupedItem> items = gson.fromJson(getString(R.string.operators_json), new TypeToken<List<DefaultGroupedItem>>() { }.getType()); linkage.init(items); linkage.setScrollSmoothly(false); linkage.setDefaultOnItemBindListener( (primaryHolder, primaryClickView, title) -> { Snackbar.make(primaryClickView, title, Snackbar.LENGTH_SHORT).show(); }, (primaryHolder, title) -> { //TODO }, (secondaryHolder, item) -> { secondaryHolder.getView(R.id.level_2_item).setOnClickListener(v -> { if (mDialog != null && mDialog.isShowing()) { mDialog.dismiss(); } }); }, (headerHolder, item) -> { //TODO }, (footerHolder, item) -> { //TODO } ); } }
[ "liangxiao6@live.com" ]
liangxiao6@live.com
c7ffb936c18af33060316f38ed1059141029f0eb
bd1f3decd59ade0efcc8980eff6f97203311abf9
/src/main/java/com/areatecnica/sigf/converters/ModeloMarcaBusConverter.java
42110d32f88f5fe4ff993ab3ffcf14543ad511cb
[]
no_license
ianfranco/nanduapp
f4318755d859f57f50b94f0b67f02797a91634e6
330682a8666d0d30ac332caabe75eefee822f2d4
refs/heads/master
2021-03-24T12:48:03.761910
2018-01-08T16:58:06
2018-01-08T16:58:06
112,971,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
package com.areatecnica.sigf.converters; import com.areatecnica.sigf.entities.ModeloMarcaBus; import com.areatecnica.sigf.controllers.ModeloMarcaBusFacade; import com.areatecnica.sigf.beans.util.JsfUtil; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.convert.FacesConverter; import javax.inject.Inject; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; @FacesConverter(value = "modeloMarcaBusConverter") public class ModeloMarcaBusConverter implements Converter { @Inject private ModeloMarcaBusFacade ejbFacade; @Override public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) { return null; } return this.ejbFacade.find(getKey(value)); } java.lang.Integer getKey(String value) { java.lang.Integer key; key = Integer.valueOf(value); return key; } String getStringKey(java.lang.Integer value) { StringBuffer sb = new StringBuffer(); sb.append(value); return sb.toString(); } @Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null || (object instanceof String && ((String) object).length() == 0)) { return null; } if (object instanceof ModeloMarcaBus) { ModeloMarcaBus o = (ModeloMarcaBus) object; return getStringKey(o.getModeloMarcaBusId()); } else { Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[]{object, object.getClass().getName(), ModeloMarcaBus.class.getName()}); return null; } } }
[ "ianfr@DESKTOP-6NFGECR" ]
ianfr@DESKTOP-6NFGECR
e7d5cae59051bf4b047bcf7175cd678a66b736cd
26f522cf638887c35dd0de87bddf443d63640402
/src/main/java/com/cczu/aqzf/model/service/AqzfJcnrService.java
dadca354d720c36de0ad4b887b18a6f955ce6f6b
[]
no_license
wuyufei2019/JSLYG
4861ae1b78c1a5d311f45e3ee708e52a0b955838
93c4f8da81cecb7b71c2d47951a829dbf37c9bcc
refs/heads/master
2022-12-25T06:01:07.872153
2019-11-20T03:10:18
2019-11-20T03:10:18
222,839,794
0
0
null
2022-12-16T05:03:09
2019-11-20T03:08:29
JavaScript
UTF-8
Java
false
false
2,749
java
package com.cczu.aqzf.model.service; import com.cczu.aqzf.model.dao.AqzfJcnrDao; import com.cczu.aqzf.model.entity.AQZF_SafetyCheckContentEntity; import com.cczu.sys.comm.utils.DateUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.sql.Timestamp; import java.util.List; import java.util.Map; /** * 安全执法_检查内容Service */ @Transactional(readOnly = true) @Service("AqzfJcnrService") public class AqzfJcnrService { @Resource private AqzfJcnrDao aqzfJcnrDao; //添加信息 public void addInfo(AQZF_SafetyCheckContentEntity jcnr) { //添加检查方案 Timestamp t = DateUtils.getSysTimestamp(); jcnr.setS1(t); jcnr.setS2(t); jcnr.setS3(0); aqzfJcnrDao.save(jcnr); } //更新信息 public void updateInfo(AQZF_SafetyCheckContentEntity jcnr) { Timestamp t = DateUtils.getSysTimestamp(); jcnr.setS2(t); jcnr.setS3(0); aqzfJcnrDao.save(jcnr); } /** * 根据检查记录id和检查内容id获取检查内容对象 * * @param id2 * @return */ public AQZF_SafetyCheckContentEntity findNr(Long id1, String id2) { //获取中间表字段并修改操作状态 AQZF_SafetyCheckContentEntity a = aqzfJcnrDao.findNr(id1, id2); return a; } /** * 根据检查记录id删除存在问题 * * @param id1 * @return */ public void deleteCzwt(Long id1) { //获取中间表字段并修改操作状态 aqzfJcnrDao.deleteCzwt(id1); } /** * 根据检查记录id获取list * * @param id * @return */ public List<AQZF_SafetyCheckContentEntity> findByJlid(Long id) { return aqzfJcnrDao.findByJlid(id); } public List<Map<String, Object>> findAllByJlid(Long id, String version) { if (version.equals("2")) { return aqzfJcnrDao.findAllByJlidTwo(id); } else { return aqzfJcnrDao.findAllByJlid(id); } } public List<Map<String, Object>> findAllByids(String ids, String version) { if (version.equals("2")) { return aqzfJcnrDao.findAllByidsTwo(ids); } else { return aqzfJcnrDao.findAllByids(ids); } } public List<AQZF_SafetyCheckContentEntity> listHiddenContent(Long recordId) { return aqzfJcnrDao.listHiddenContent(recordId); } public List<Map<String, Object>> listHiddenMap(Long recordId) { return aqzfJcnrDao.listHiddenMap(recordId); } public void deleteByids(String ids) { aqzfJcnrDao.deleteByids(ids); } }
[ "wuyufei2019@sina.com" ]
wuyufei2019@sina.com
e9f6708b7c5d985055d81ca7a6ca5977a761851e
78348f3d385a2d1eddcf3d7bfee7eaf1259d3c6e
/examples/protocol-languages/FMPL/src/fmpl/State.java
6381343a191a107c0880b8de54d7b8448787471c
[]
no_license
damenac/puzzle
6ac0a2fba6eb531ccfa7bec3a5ecabf6abb5795e
f74b23fd14ed5d6024667bf5fbcfe0418dc696fa
refs/heads/master
2021-06-14T21:23:05.874869
2017-03-27T10:24:31
2017-03-27T10:24:31
40,361,967
3
1
null
null
null
null
UTF-8
Java
false
false
1,153
java
/** */ package fmpl; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>State</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link fmpl.State#getName <em>Name</em>}</li> * </ul> * </p> * * @see fmpl.FmplPackage#getState() * @model * @generated */ public interface State extends EObject { /** * Returns the value of the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Name</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Name</em>' attribute. * @see #setName(String) * @see fmpl.FmplPackage#getState_Name() * @model id="true" * @generated */ String getName(); /** * Sets the value of the '{@link fmpl.State#getName <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Name</em>' attribute. * @see #getName() * @generated */ void setName(String value); } // State
[ "damenac@gmail.com" ]
damenac@gmail.com
18b98a88771005ca6c1c1bde728a8d4d273294f9
54ff1e25087a5660f034342bcbccd4c645a65f0c
/lesson7hw/src/main/java/ru/geekbrains/android3_6/di/AppComponent.java
3d10ded412eccfa2206701c62b331210215c6254
[]
no_license
Keos99/GU_Android_Popular_Libraries
2229592cbcc2b46086a55f6587cfc7874c5a566f
f5cd75e890e675dd9aed6e364f5839dc8047f3a9
refs/heads/master
2020-04-16T18:56:04.783894
2019-02-27T14:00:03
2019-02-27T14:00:03
165,840,566
0
0
null
2019-02-27T14:00:04
2019-01-15T11:39:11
Java
UTF-8
Java
false
false
502
java
package ru.geekbrains.android3_6.di; import dagger.Component; import ru.geekbrains.android3_6.di.modules.*; import ru.geekbrains.android3_6.mvp.presenter.MainPresenter; import ru.geekbrains.android3_6.ui.activity.MainActivity; import javax.inject.Singleton; @Singleton @Component(modules = { AppModule.class, RepoModule.class, CiceroneModule.class }) public interface AppComponent { void inject(MainPresenter mainPresenter); void inject(MainActivity mainActivity); }
[ "keos99@bk.ru" ]
keos99@bk.ru
80a7fb6c0933b75f1eb2924f94ab5be1bf3119c1
ced962b409105817fad8e5ebf400a763ffdc1e77
/src/main/java/com/qwazr/cluster/client/ClusterSingleClient.java
eea3563c370cc6f94e6575a2096d1f81d98dd15e
[ "Apache-2.0" ]
permissive
Sebastien-Andrivet/qwazr-cluster
0472bdf88ea97cae729c41db4e553dc99b3539a6
3efcc7965a5a95eb37a30e99faaa50be3afbe394
refs/heads/master
2021-01-22T01:18:37.508807
2015-04-20T08:32:29
2015-04-20T08:32:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,457
java
/** * Copyright 2015 OpenSearchServer 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.qwazr.cluster.client; import java.io.IOException; import java.net.URISyntaxException; import java.util.List; import java.util.Map; import java.util.Set; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.fluent.Request; import org.apache.http.client.utils.URIBuilder; import org.apache.http.entity.ContentType; import com.fasterxml.jackson.core.type.TypeReference; import com.qwazr.cluster.service.ClusterNodeRegisterJson; import com.qwazr.cluster.service.ClusterNodeStatusJson; import com.qwazr.cluster.service.ClusterServiceInterface; import com.qwazr.cluster.service.ClusterServiceStatusJson; import com.qwazr.cluster.service.ClusterStatusJson; import com.qwazr.utils.http.HttpUtils; import com.qwazr.utils.json.client.JsonClientAbstract; public class ClusterSingleClient extends JsonClientAbstract implements ClusterServiceInterface { public ClusterSingleClient(String url, int msTimeOut) throws URISyntaxException { super(url, msTimeOut); } @Override public ClusterStatusJson list() { try { URIBuilder uriBuilder = getBaseUrl("/cluster"); Request request = Request.Get(uriBuilder.build()); return execute(request, null, msTimeOut, ClusterStatusJson.class, 200); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } public final static TypeReference<Map<String, Set<String>>> MapStringSetStringTypeRef = new TypeReference<Map<String, Set<String>>>() { }; @Override public Map<String, Set<String>> getNodes() { try { URIBuilder uriBuilder = getBaseUrl("/cluster/nodes"); Request request = Request.Get(uriBuilder.build()); return (Map<String, Set<String>>) execute(request, null, msTimeOut, MapStringSetStringTypeRef, 200); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } @Override public ClusterNodeStatusJson register(ClusterNodeRegisterJson register) { try { URIBuilder uriBuilder = getBaseUrl("/cluster"); Request request = Request.Post(uriBuilder.build()); return execute(request, register, msTimeOut, ClusterNodeStatusJson.class, 200); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } @Override public Response unregister(String address) { try { URIBuilder uriBuilder = getBaseUrl("/cluster"); uriBuilder.setParameter("address", address); Request request = Request.Delete(uriBuilder.build()); HttpResponse response = execute(request, null, msTimeOut); HttpUtils.checkStatusCodes(response, 200); return Response.status(response.getStatusLine().getStatusCode()) .build(); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } @Override public Response check(String checkValue) { return Response.status(Status.NOT_IMPLEMENTED).build(); } @Override public ClusterServiceStatusJson getServiceStatus(String service_name) { try { URIBuilder uriBuilder = getBaseUrl("/cluster/services/", service_name); Request request = Request.Get(uriBuilder.build()); return execute(request, null, msTimeOut, ClusterServiceStatusJson.class, 200); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } public final static TypeReference<List<String>> ListStringTypeRef = new TypeReference<List<String>>() { }; @Override public List<String> getActiveNodes(String service_name) { try { URIBuilder uriBuilder = getBaseUrl("/cluster/services/", service_name, "/active"); Request request = Request.Get(uriBuilder.build()); return (List<String>) execute(request, null, msTimeOut, ListStringTypeRef, 200); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } @Override public String getActiveNodeRandom(String service_name) { try { URIBuilder uriBuilder = getBaseUrl("/cluster/services/", service_name, "/active/random"); Request request = Request.Get(uriBuilder.build()); HttpResponse response = execute(request, null, msTimeOut); HttpUtils.checkStatusCodes(response, 200); return IOUtils.toString(HttpUtils.checkIsEntity(response, ContentType.TEXT_PLAIN).getContent()); } catch (URISyntaxException | IOException e) { throw new WebApplicationException(e.getMessage(), e, Status.INTERNAL_SERVER_ERROR); } } }
[ "ekeller@open-search-server.com" ]
ekeller@open-search-server.com
3364e40eea82efe9c3705f55f96cf0d4364e2c09
7fbc568f5f502eb0ae405022f7f34c79e0c49234
/baifei-boot-base-common/src/main/java/org/baifei/common/system/util/JwtUtil.java
05524270c748526977aeebc56957d7ff7ab046fc
[ "MIT" ]
permissive
yourant/logistics
c6271bae3e2d6add20df0ee7c815652f423e50de
3989d2f7b3213c6973bc76e7031248b8643ab5b1
refs/heads/master
2023-03-23T16:44:34.938698
2020-07-03T04:42:31
2020-07-03T04:42:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,235
java
package org.baifei.common.system.util; import com.auth0.jwt.JWT; import com.auth0.jwt.JWTVerifier; import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.interfaces.DecodedJWT; import com.google.common.base.Joiner; import java.util.Date; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.shiro.SecurityUtils; import org.baifei.common.constant.DataBaseConstant; import org.baifei.common.exception.JeecgBootException; import org.baifei.common.system.vo.LoginUser; import org.baifei.common.system.vo.SysUserCacheInfo; import org.baifei.common.util.SpringContextUtils; import org.baifei.common.util.oConvertUtils; /** * @Author Scott * @Date 2018-07-12 14:23 * @Desc JWT工具类 **/ public class JwtUtil { // Token过期时间30分钟(用户登录过期时间是此时间的两倍,以token在reids缓存时间为准) public static final long EXPIRE_TIME = 30 * 60 * 1000; /** * 校验token是否正确 * * @param token 密钥 * @param secret 用户的密码 * @return 是否正确 */ public static boolean verify(String token, String username, String secret) { try { // 根据密码生成JWT效验器 Algorithm algorithm = Algorithm.HMAC256(secret); JWTVerifier verifier = JWT.require(algorithm).withClaim("username", username).build(); // 效验TOKEN DecodedJWT jwt = verifier.verify(token); return true; } catch (Exception exception) { return false; } } /** * 获得token中的信息无需secret解密也能获得 * * @return token中包含的用户名 */ public static String getUsername(String token) { try { DecodedJWT jwt = JWT.decode(token); return jwt.getClaim("username").asString(); } catch (JWTDecodeException e) { return null; } } /** * 生成签名,5min后过期 * * @param username 用户名 * @param secret 用户的密码 * @return 加密的token */ public static String sign(String username, String secret) { Date date = new Date(System.currentTimeMillis() + EXPIRE_TIME); Algorithm algorithm = Algorithm.HMAC256(secret); // 附带username信息 return JWT.create().withClaim("username", username).withExpiresAt(date).sign(algorithm); } /** * 根据request中的token获取用户账号 * * @param request * @return * @throws JeecgBootException */ public static String getUserNameByToken(HttpServletRequest request) throws JeecgBootException { String accessToken = request.getHeader("X-Access-Token"); String username = getUsername(accessToken); if (oConvertUtils.isEmpty(username)) { throw new JeecgBootException("未获取到用户"); } return username; } /** * 从session中获取变量 * @param key * @return */ public static String getSessionData(String key) { //${myVar}% //得到${} 后面的值 String moshi = ""; if(key.indexOf("}")!=-1){ moshi = key.substring(key.indexOf("}")+1); } String returnValue = null; if (key.contains("#{")) { key = key.substring(2,key.indexOf("}")); } if (oConvertUtils.isNotEmpty(key)) { HttpSession session = SpringContextUtils.getHttpServletRequest().getSession(); returnValue = (String) session.getAttribute(key); } //结果加上${} 后面的值 if(returnValue!=null){returnValue = returnValue + moshi;} return returnValue; } /** * 从当前用户中获取变量 * @param key * @param user * @return */ //TODO 急待改造 sckjkdsjsfjdk public static String getUserSystemData(String key,SysUserCacheInfo user) { if(user==null) { user = JeecgDataAutorUtils.loadUserInfo(); } //#{sys_user_code}% // 获取登录用户信息 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String moshi = ""; if(key.indexOf("}")!=-1){ moshi = key.substring(key.indexOf("}")+1); } String returnValue = null; //针对特殊标示处理#{sysOrgCode},判断替换 if (key.contains("#{")) { key = key.substring(2,key.indexOf("}")); } else { key = key; } //替换为系统登录用户帐号 if (key.equals(DataBaseConstant.SYS_USER_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_CODE_TABLE)) { if(user==null) { returnValue = sysUser.getUsername(); }else { returnValue = user.getSysUserCode(); } } //替换为系统登录用户真实名字 else if (key.equals(DataBaseConstant.SYS_USER_NAME)|| key.toLowerCase().equals(DataBaseConstant.SYS_USER_NAME_TABLE)) { if(user==null) { returnValue = sysUser.getRealname(); }else { returnValue = user.getSysUserName(); } } //替换为系统用户登录所使用的机构编码 else if (key.equals(DataBaseConstant.SYS_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_ORG_CODE_TABLE)) { if(user==null) { returnValue = sysUser.getOrgCode(); }else { returnValue = user.getSysOrgCode(); } } //替换为系统用户所拥有的所有机构编码 else if (key.equals(DataBaseConstant.SYS_MULTI_ORG_CODE)|| key.toLowerCase().equals(DataBaseConstant.SYS_MULTI_ORG_CODE_TABLE)) { if(user.isOneDepart()) { returnValue = user.getSysMultiOrgCode().get(0); }else { returnValue = Joiner.on(",").join(user.getSysMultiOrgCode()); } } //替换为当前系统时间(年月日) else if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) { returnValue = user.getSysDate(); } //替换为当前系统时间(年月日时分秒) else if (key.equals(DataBaseConstant.SYS_TIME)|| key.toLowerCase().equals(DataBaseConstant.SYS_TIME_TABLE)) { returnValue = user.getSysTime(); } //流程状态默认值(默认未发起) else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) { returnValue = "1"; } if(returnValue!=null){returnValue = returnValue + moshi;} return returnValue; } public static void main(String[] args) { String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NjUzMzY1MTMsInVzZXJuYW1lIjoiYWRtaW4ifQ.xjhud_tWCNYBOg_aRlMgOdlZoWFFKB_givNElHNw3X0"; System.out.println(JwtUtil.getUsername(token)); } }
[ "56526925@qq.com" ]
56526925@qq.com
88dc63ca33e7f44d4ca25efd692d127047797d28
365dd8ebb72f54cedeed37272d4db23d139522f4
/src/main/java/thaumcraft/api/ItemApi.java
a1c7fc1f6ca7e33b5c49d697e6dc1a0c9f133cb9
[]
no_license
Bogdan-G/ThaumicHorizons
c05b1fdeda0bdda6d427a39b74cac659661c4cbe
83caf754f51091c6b7297c0c68fe8df309d7d7f9
refs/heads/master
2021-09-10T14:13:54.532269
2018-03-27T16:58:15
2018-03-27T16:58:15
122,425,516
0
0
null
null
null
null
UTF-8
Java
false
false
1,453
java
package thaumcraft.api; import cpw.mods.fml.common.FMLLog; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ItemApi { public static ItemStack getItem(String itemString, int meta) { ItemStack item = null; try { String ex = "thaumcraft.common.config.ConfigItems"; Object obj = Class.forName(ex).getField(itemString).get((Object)null); if(obj instanceof Item) { item = new ItemStack((Item)obj, 1, meta); } else if(obj instanceof ItemStack) { item = (ItemStack)obj; } } catch (Exception var5) { FMLLog.warning("[Thaumcraft] Could not retrieve item identified by: " + itemString, new Object[0]); } return item; } public static ItemStack getBlock(String itemString, int meta) { ItemStack item = null; try { String ex = "thaumcraft.common.config.ConfigBlocks"; Object obj = Class.forName(ex).getField(itemString).get((Object)null); if(obj instanceof Block) { item = new ItemStack((Block)obj, 1, meta); } else if(obj instanceof ItemStack) { item = (ItemStack)obj; } } catch (Exception var5) { FMLLog.warning("[Thaumcraft] Could not retrieve block identified by: " + itemString, new Object[0]); } return item; } }
[ "bogdangtt@gmail.com" ]
bogdangtt@gmail.com
7921958833bfe582d62a8cb5f277c9faba845621
38c4451ab626dcdc101a11b18e248d33fd8a52e0
/tokens/xalan-j-2.7.1/src/org/apache/xml/utils/res/CharArrayWrapper.java
008918cfcd0600176cff74ea06f01171fcfcba61
[]
no_license
habeascorpus/habeascorpus-data
47da7c08d0f357938c502bae030d5fb8f44f5e01
536d55729f3110aee058ad009bcba3e063b39450
refs/heads/master
2020-06-04T10:17:20.102451
2013-02-19T15:19:21
2013-02-19T15:19:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,361
java
package TokenNamepackage org TokenNameIdentifier . TokenNameDOT apache TokenNameIdentifier . TokenNameDOT xml TokenNameIdentifier . TokenNameDOT utils TokenNameIdentifier . TokenNameDOT res TokenNameIdentifier ; TokenNameSEMICOLON public TokenNamepublic class TokenNameclass CharArrayWrapper TokenNameIdentifier { TokenNameLBRACE private TokenNameprivate char TokenNamechar [ TokenNameLBRACKET ] TokenNameRBRACKET m_char TokenNameIdentifier ; TokenNameSEMICOLON public TokenNamepublic CharArrayWrapper TokenNameIdentifier ( TokenNameLPAREN char TokenNamechar [ TokenNameLBRACKET ] TokenNameRBRACKET arg TokenNameIdentifier ) TokenNameRPAREN { TokenNameLBRACE m_char TokenNameIdentifier = TokenNameEQUAL arg TokenNameIdentifier ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic char TokenNamechar getChar TokenNameIdentifier ( TokenNameLPAREN int TokenNameint index TokenNameIdentifier ) TokenNameRPAREN { TokenNameLBRACE return TokenNamereturn m_char TokenNameIdentifier [ TokenNameLBRACKET index TokenNameIdentifier ] TokenNameRBRACKET ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic int TokenNameint getLength TokenNameIdentifier ( TokenNameLPAREN ) TokenNameRPAREN { TokenNameLBRACE return TokenNamereturn m_char TokenNameIdentifier . TokenNameDOT length TokenNameIdentifier ; TokenNameSEMICOLON } TokenNameRBRACE } TokenNameRBRACE
[ "pschulam@gmail.com" ]
pschulam@gmail.com
907aa82ed311fc5313e9ba8553ac11be74dd9769
a744882fb7cf18944bd6719408e5a9f2f0d6c0dd
/sourcecode7/src/sun/security/util/AuthResources_it.java
cde167dd82967e0909f89a924c4664deba99cabe
[ "Apache-2.0" ]
permissive
hanekawasann/learn
a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33
eef678f1b8e14b7aab966e79a8b5a777cfc7ab14
refs/heads/master
2022-09-13T02:18:07.127489
2020-04-26T07:58:35
2020-04-26T07:58:35
176,686,231
0
0
Apache-2.0
2022-09-01T23:21:38
2019-03-20T08:16:05
Java
UTF-8
Java
false
false
7,009
java
/* * Copyright (c) 2000, 2011, 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. */ package sun.security.util; /** * <p> This class represents the <code>ResourceBundle</code> * for the following packages: * * <ol> * <li> com.sun.security.auth * <li> com.sun.security.auth.login * </ol> */ public class AuthResources_it extends java.util.ListResourceBundle { private static final Object[][] contents = { // NT principals { "invalid.null.input.value", "input nullo non valido: {0}" }, { "NTDomainPrincipal.name", "NTDomainPrincipal: {0}" }, { "NTNumericCredential.name", "NTNumericCredential: {0}" }, { "Invalid.NTSid.value", "Valore NTSid non valido" }, { "NTSid.name", "NTSid: {0}" }, { "NTSidDomainPrincipal.name", "NTSidDomainPrincipal: {0}" }, { "NTSidGroupPrincipal.name", "NTSidGroupPrincipal: {0}" }, { "NTSidPrimaryGroupPrincipal.name", "NTSidPrimaryGroupPrincipal: {0}" }, { "NTSidUserPrincipal.name", "NTSidUserPrincipal: {0}" }, { "NTUserPrincipal.name", "NTUserPrincipal: {0}" }, // UnixPrincipals { "UnixNumericGroupPrincipal.Primary.Group.name", "UnixNumericGroupPrincipal [gruppo primario]: {0}" }, { "UnixNumericGroupPrincipal.Supplementary.Group.name", "UnixNumericGroupPrincipal [gruppo supplementare]: {0}" }, { "UnixNumericUserPrincipal.name", "UnixNumericUserPrincipal: {0}" }, { "UnixPrincipal.name", "UnixPrincipal: {0}" }, // com.sun.security.auth.login.ConfigFile { "Unable.to.properly.expand.config", "Impossibile espandere correttamente {0}" }, { "extra.config.No.such.file.or.directory.", "{0} (file o directory inesistente)" }, { "Configuration.Error.No.such.file.or.directory", "Errore di configurazione:\n\tFile o directory inesistente" }, { "Configuration.Error.Invalid.control.flag.flag", "Errore di configurazione:\n\tflag di controllo non valido, {0}" }, { "Configuration.Error.Can.not.specify.multiple.entries.for.appName", "Errore di configurazione:\n\timpossibile specificare pi\u00F9 valori per {0}" }, { "Configuration.Error.expected.expect.read.end.of.file.", "Errore di configurazione:\n\tprevisto [{0}], letto [end of file]" }, { "Configuration.Error.Line.line.expected.expect.found.value.", "Errore di configurazione:\n\triga {0}: previsto [{1}], trovato [{2}]" }, { "Configuration.Error.Line.line.expected.expect.", "Errore di configurazione:\n\triga {0}: previsto [{1}]" }, { "Configuration.Error.Line.line.system.property.value.expanded.to.empty.value", "Errore di configurazione:\n\triga {0}: propriet\u00E0 di sistema [{1}] espansa a valore vuoto" }, // com.sun.security.auth.module.JndiLoginModule { "username.", "Nome utente: " }, { "password.", "Password: " }, // com.sun.security.auth.module.KeyStoreLoginModule { "Please.enter.keystore.information", "Immettere le informazioni per il keystore" }, { "Keystore.alias.", "Alias keystore: " }, { "Keystore.password.", "Password keystore: " }, { "Private.key.password.optional.", "Password chiave privata (opzionale): " }, // com.sun.security.auth.module.Krb5LoginModule { "Kerberos.username.defUsername.", "Nome utente Kerberos [{0}]: " }, { "Kerberos.password.for.username.", "Password Kerberos per {0}: " }, /*** EVERYTHING BELOW IS DEPRECATED ***/ // com.sun.security.auth.PolicyFile { ".error.parsing.", ": errore durante l'analisi " }, { "COLON", ": " }, { ".error.adding.Permission.", ": errore durante l'aggiunta dell'autorizzazione " }, { "SPACE", " " }, { ".error.adding.Entry.", ": errore durante l'aggiunta della voce " }, { "LPARAM", "(" }, { "RPARAM", ")" }, { "attempt.to.add.a.Permission.to.a.readonly.PermissionCollection", "tentativo di aggiungere un'autorizzazione a una PermissionCollection di sola lettura" }, // com.sun.security.auth.PolicyParser { "expected.keystore.type", "tipo keystore previsto" }, { "can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name", "impossibile specificare un principal con una classe carattere jolly senza un nome carattere jolly" }, { "expected.codeBase.or.SignedBy", "previsto codeBase o SignedBy" }, { "only.Principal.based.grant.entries.permitted", "sono consentiti solo valori garantiti basati sul principal" }, { "expected.permission.entry", "prevista voce di autorizzazione" }, { "number.", "numero " }, { "expected.expect.read.end.of.file.", "previsto {0}, letto end of file" }, { "expected.read.end.of.file", "previsto ';', letto end of file" }, { "line.", "riga " }, { ".expected.", ": previsto '" }, { ".found.", "', trovato '" }, { "QUOTE", "'" }, // SolarisPrincipals { "SolarisNumericGroupPrincipal.Primary.Group.", "SolarisNumericGroupPrincipal [gruppo primario]: " }, { "SolarisNumericGroupPrincipal.Supplementary.Group.", "SolarisNumericGroupPrincipal [gruppo supplementare]: " }, { "SolarisNumericUserPrincipal.", "SolarisNumericUserPrincipal: " }, { "SolarisPrincipal.", "SolarisPrincipal: " }, // provided.null.name is the NullPointerException message when a // developer incorrectly passes a null name to the constructor of // subclasses of java.security.Principal { "provided.null.name", "il nome fornito \u00E8 nullo" } }; /** * Returns the contents of this <code>ResourceBundle</code>. * * <p> * * @return the contents of this <code>ResourceBundle</code>. */ public Object[][] getContents() { return contents; } }
[ "763803382@qq.com" ]
763803382@qq.com
4c865ab0b09cf28cf6c210508f0bff973d684e62
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/com/google/firebase/remoteconfig/FirebaseRemoteConfigFetchThrottledException.java
3710f487ce20c37d514e0bcf10913cf76b690ca5
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
610
java
package com.google.firebase.remoteconfig; /* compiled from: com.google.firebase:firebase-config@@19.1.4 */ public class FirebaseRemoteConfigFetchThrottledException extends FirebaseRemoteConfigFetchException { private final long throttleEndTimeMillis; public FirebaseRemoteConfigFetchThrottledException(long j) { this("Fetch was throttled.", j); } public FirebaseRemoteConfigFetchThrottledException(String str, long j) { super(str); this.throttleEndTimeMillis = j; } public long getThrottleEndTimeMillis() { return this.throttleEndTimeMillis; } }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
68b476fa2870bdb53c3eea387cdd5fc3b3bb8a28
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_c201d712469b9510e63e2afa2a13f1c5bdb1ce18/RunCompile/2_c201d712469b9510e63e2afa2a13f1c5bdb1ce18_RunCompile_s.java
d62526c9a2f45d65f65a2b4aa2acff701a3eed59
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,076
java
package de.unisiegen.informatik.bs.alvis.commands; import java.io.File; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.ui.model.BaseWorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.ui.part.FileEditorInput; import de.unisiegen.informatik.bs.alvis.Activator; import de.unisiegen.informatik.bs.alvis.Run; import de.unisiegen.informatik.bs.alvis.compiler.CompilerAccess; import de.unisiegen.informatik.bs.alvis.tools.IO; public class RunCompile extends AbstractHandler { Run seri; ExecutionEvent myEvent; public Object execute(ExecutionEvent event) throws ExecutionException { // NOTE: event is null when executing from run editor. myEvent = event; // Save all Editors PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .saveAllEditors(true); new CloseRunPerspective().execute(event); // Instantiate IEditorInput IEditorInput input = null; /* * Register datatypes and packagenames to the compiler This is important * for compiling */ CompilerAccess.getDefault().setDatatypes( Activator.getDefault().getAllDatatypesInPlugIns()); CompilerAccess.getDefault().setDatatypePackages( Activator.getDefault().getAllDatatypesPackagesInPlugIns()); // System.out.println(Platform.getInstanceLocation().getURL().getPath()); // CompilerAccess.getDefault().testDatatypes(); try { // What to run? get the input (filepath) input = PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().getActiveEditor().getEditorInput(); } catch (NullPointerException e) { e.printStackTrace(); } // Instantiate a new Run object seri = null; /* * GET THE RUN OBJECT */ // Check if the input is a FileEditorInput if (input != null && input instanceof FileEditorInput) { // cast to FileEditorInput FileEditorInput fileInput = (FileEditorInput) input; // If the user has choosen a graph to run... if (fileInput.getFile().getFileExtension().equals("run")) { //$NON-NLS-1$ // get the path in system String systemPath = fileInput.getPath().toString(); // and deserialize the saved run to seri seri = (Run) IO.deserialize(systemPath); } else { // ask for run settings seri = getPreferencesByDialog(); } } else { // ask for run settings seri = getPreferencesByDialog(); } // END OF GET THE RUN OBJECT if (seri != null) { // GET THE ALGORITHM AS STRING try { // Translate the PseudoCode and get the translated file File javaCode = null; // if the algorithm is of type ".algo" it is pseudo code and it must be compiled // if not, it's passed on to the virtual machine if(seri.getAlgorithmFile().endsWith(".algo")){ // try to compile with compiler javaCode = CompilerAccess.getDefault().compile( seri.getAlgorithmFile()); // if fails if (null == javaCode) // compile with dummy throw new Exception();// TODO throw a meaningful exception } else{ javaCode = new File(Platform.getInstanceLocation().getURL().getPath() + seri.getAlgorithmFile()); } // Kill the extension String fileNameOfTheAlgorithm = javaCode.getCanonicalPath() .replaceAll("\\.java$", ""); //$NON-NLS-1$ // Get the path where the translated files are saved to. String pathToTheAlgorithm = javaCode.getParentFile() .getCanonicalPath(); // Register Algorithm to VM // TODO Warning, if we change the name of the translated file // this here will crash fileNameOfTheAlgorithm = "Algorithm"; // setJavaAlgorithmToVM has 2 parameter 1. is the path 2. is the // filename // if /usr/alvis/src/Algorithm.java then // 1.: /usr/alvis/src // 2.: Algorithm Activator.getDefault().setJavaAlgorithmToVM(pathToTheAlgorithm, fileNameOfTheAlgorithm, Activator.getDefault().getAllDatatypesInPlugIns()); Activator.getDefault().setActiveRun(seri); // Then activate command SwitchToRunPerspective new SwitchToRunPerspective().execute(event); } catch (Exception e) { // Create the required Status object Status status = new Status(IStatus.ERROR, "My Plug-in ID", 0, e.getMessage(), null); // Display the dialog ErrorDialog .openError( Display.getCurrent().getActiveShell(), "Error starting the Run", "An Error has occurred. The run could not start. Read the message shown below to solve the problem.", status); e.printStackTrace(); } finally { } } else { return null; } // IResource.refreshLocal(); new RefreshWorkspace().execute(event); return null; } private Run getPreferencesByDialog() { String extensions = Activator.getDefault().getFileExtensionsAsCommaSeparatedList(); Run seri = new Run(); while (seri.getAlgorithmFile().equals("") | seri.getExampleFile().equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider()); dialog.setTitle(Messages.RunCompile_7); dialog.setMessage(NLS.bind(Messages.RunCompile_8, "(" + extensions + ")")); dialog.setInput(ResourcesPlugin.getWorkspace().getRoot()); dialog.open(); if (dialog.getResult() != null) { String result = ""; //$NON-NLS-1$ for (Object o : dialog.getResult()) { result = o.toString(); for(String fileExtension : Activator.getDefault().getFileExtensions()){ if (result.startsWith("L") && result.endsWith(fileExtension)) { //$NON-NLS-1$ //$NON-NLS-2$ result = result.substring(2); // cut the first two chars seri.setExampleFile(result); } } if (result.startsWith("L") && (result.endsWith("algo")|| result.endsWith(".java"))) { //$NON-NLS-1$ //$NON-NLS-2$ result = result.substring(2); // cut the first two chars seri.setAlgorithmFile(result); } } } if (dialog.getReturnCode() == 1) // the user clicked cancel return null; } return seri; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
789f39ea21e2c68d0ceddbac81b78b42ca68e9d0
d7aa38b8309f7e6ce9b0a51491b2dee246cdf45a
/java/ru/myx/xstore/s3/concept/ReplacerConditionStateList.java
8b149de8d66acfcf47c7e7a67a0ed738bb3daa61
[]
no_license
acmcms/acm-plug-s3
2535d29fe41f074cbe12406aa87984c57cef9300
4a7f3152c51d6198b3d29c4cc3c271fe5e2b0f08
refs/heads/master
2023-04-07T08:01:54.501723
2023-03-22T22:43:14
2023-03-22T22:43:14
140,318,738
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
/* * Created on 14.01.2005 */ package ru.myx.xstore.s3.concept; import java.util.function.Function; import ru.myx.ae3.help.Convert; import ru.myx.query.OneCondition; import ru.myx.query.OneConditionSimple; final class ReplacerConditionStateList implements Function<OneCondition, OneCondition> { private final String stateList; ReplacerConditionStateList(final String stateList) { this.stateList = stateList; } @Override public OneCondition apply(final OneCondition condition) { return new OneConditionSimple(condition.isExact(), "o.objState", Convert.Any.toInt(condition.getValue(), 0) == 0 ? " NOT IN " : " IN ", this.stateList); } }
[ "myx@myx.co.nz" ]
myx@myx.co.nz
96d216105758bae43d9613ad038635fccdd4e8d7
7701d552e365428198021f53eb82006cfe29df3b
/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamToLoop/afterToArrayTypeMismatch.java
997c7d4354f55521bfe0cdb7976c81916f1aa354
[ "Apache-2.0" ]
permissive
aabb667/intellij-community
876743e4b739af6e0f8bc40ef41e0d06d33c1a9b
8719a0be53e26773584ae00b1c3558ad2f54aae6
refs/heads/master
2021-01-12T09:16:06.056172
2016-12-18T17:34:27
2016-12-18T17:41:51
76,807,010
1
0
null
2016-12-18T21:13:01
2016-12-18T21:13:01
null
UTF-8
Java
false
false
563
java
// "Replace Stream API chain with loop" "true" import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; public class Main { private static Number[] test(Object[] objects) { List<Object> list = new ArrayList<>(); for (Object object : objects) { if (Number.class.isInstance(object)) { list.add(object); } } return list.toArray(new Number[0]); } public static void main(String[] args) { System.out.println(Arrays.asList(test(new Object[]{1, 2, 3, "string", 4}))); } }
[ "Tagir.Valeev@jetbrains.com" ]
Tagir.Valeev@jetbrains.com
b2abcc74d20844b4dd776674086e01d6e28da09c
7b9392d2d6c34a12a26ee25a92dd0a137a9c4d33
/src/main/java/com/diwayou/utils/db/transaction/ShardTransactionTemplate.java
251118a04dc4f823e1ac01318c8251c6307f5a25
[]
no_license
tasfe/utils-db
558d784145dd861df2a94e3cf43fde801289b8f3
ebc9e33069f0f8c5c315e20cb5fc60dcffb3ca01
refs/heads/master
2021-01-11T18:16:06.214600
2015-09-11T10:00:29
2015-09-11T10:00:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,616
java
package com.diwayou.utils.db.transaction; import com.diwayou.utils.db.exception.ShardDaoException; import com.diwayou.utils.db.shard.ShardContextHolder; import com.diwayou.utils.db.shard.route.DbRouteStrategy; import com.diwayou.utils.db.shard.rule.DbRule; import com.diwayou.utils.db.util.RouteUtil; import org.springframework.transaction.TransactionException; import org.springframework.transaction.support.TransactionCallback; import org.springframework.transaction.support.TransactionTemplate; /** * Created by diwayou on 2015/9/10. */ public class ShardTransactionTemplate extends TransactionTemplate { @Override public <T> T execute(TransactionCallback<T> action) throws TransactionException { throw new UnsupportedOperationException(); } public <T> T execute(Object routeKey, ShardTransactionCallback<T> action) throws TransactionException { DbRule dbRule = action.getDbRule(); if (dbRule == null) { throw new ShardDaoException("Must set dbRule."); } DbRouteStrategy dbRouteStrategy = dbRule.getDbRouteStrategy(); String dbNameSuffix = dbRouteStrategy.getRouteSuffix(routeKey, dbRule.getDbCount()); String dbName = RouteUtil.buildDbName(dbRule.getDbName(), dbNameSuffix); try { TransactionContextHolder.setInTransaction(Boolean.TRUE); ShardContextHolder.setShardDataSourceName(dbName); return super.execute(action); } finally { TransactionContextHolder.clearInTransaction(); ShardContextHolder.clearShardDataSourceName(); } } }
[ "diwayou@qq.com" ]
diwayou@qq.com
c9004e81bcc10ef5baeef4ed80dd047ae26b2f96
4ff635b1f522fe2af863081d8c2ef9fd61778145
/src/main/java/com/galenframework/ide/devices/tasks/DeviceTask.java
21d5bf7fa776fb1427866b316fb0bc4d355d8c07
[ "Apache-2.0" ]
permissive
ishubin/galen-ide
8d40da309560f888e7ea305d3a965c8cf17f7213
8f199173240509c18362354302a815e36e65d9ff
refs/heads/master
2021-01-16T23:32:28.740908
2016-10-08T20:43:43
2016-10-08T20:43:43
50,373,614
2
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
/******************************************************************************* * Copyright 2016 Ivan Shubin http://galenframework.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.galenframework.ide.devices.tasks; import com.galenframework.ide.devices.commands.DeviceCommand; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import java.util.List; public class DeviceTask { private String name; private String taskId; private List<DeviceCommand> commands; public DeviceTask() { } public DeviceTask(String name, List<DeviceCommand> commands) { this.name = name; this.commands = commands; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<DeviceCommand> getCommands() { return commands; } public void setCommands(List<DeviceCommand> commands) { this.commands = commands; } public String getTaskId() { return taskId; } public void setTaskId(String taskId) { this.taskId = taskId; } @Override public int hashCode() { return new HashCodeBuilder() .append(taskId) .append(name) .append(commands) .toHashCode(); } @Override public boolean equals(Object obj) { if(obj == null) { return false; } else if(obj == this) { return true; } else if(!(obj instanceof DeviceTask)) { return false; } else { DeviceTask rhs = (DeviceTask) obj; return new EqualsBuilder() .append(rhs.taskId, this.taskId) .append(rhs.name, this.name) .append(rhs.commands, this.commands) .isEquals(); } } @Override public String toString() { return new ToStringBuilder(this) .append("taskId", taskId) .append("name", name) .append("commands", getCommands()) .toString(); } }
[ "ivan.ishubin@gmail.com" ]
ivan.ishubin@gmail.com
cabb7968e6610ba6882dacacf3dd91efd88c6ad7
88d3adf0d054afabe2bc16dc27d9e73adf2e7c61
/io/src/test/java/org/vietspider/nlp/TestCharsIndexOf.java
dc0e04e0e823856eac9d540fad428715dab7466a
[ "Apache-2.0" ]
permissive
nntoan/vietspider
5afc8d53653a1bb3fc2e20fb12a918ecf31fdcdc
79d563afea3abd93f7fdff5bcecb5bac2162d622
refs/heads/master
2021-01-10T06:23:20.588974
2020-05-06T09:44:32
2020-05-06T09:44:32
54,641,132
0
2
null
2020-05-06T07:52:29
2016-03-24T12:45:02
Java
UTF-8
Java
false
false
755
java
/*************************************************************************** * Copyright 2001-2009 The VietSpider All rights reserved. * **************************************************************************/ package org.vietspider.nlp; import org.vietspider.chars.CharsUtil; /** * Author : Nhu Dinh Thuan * nhudinhthuan@yahoo.com * Sep 26, 2009 */ public class TestCharsIndexOf { public static void main(String[] args) { char chars [] = " Bảo hành 12 tháng, giao hàng và lắp đặt miễn phí trong phạm vi thành phố Hồ Chí Minh. ".toCharArray(); char chars2 [] = "thành phố hồ chí minh".toCharArray(); System.out.println(CharsUtil.indexOfIgnoreCase(chars, chars2, 0)); } }
[ "nntoan@users.noreply.github.com" ]
nntoan@users.noreply.github.com
30c1cd8903a5af5522fe6eedada30f6c345fe1ac
9a5f1d72b2472c7bb0b27aaca08e2f4cef30f96a
/src/main/java/com/SpringBootAndMaterialize/SpringBootAndMaterialize/exception/NegocioException.java
efdf10171ee829bb2a955b090d12a7ed54e26d79
[ "MIT" ]
permissive
matheusfreitas70/SpringBootAndMaterialize
c4b8cb010b2552776219641e69d4cf79267b3cd2
f756e86bd93719da5db6b1a19f904dd044bd1d3a
refs/heads/master
2020-12-02T21:25:50.831906
2017-07-01T02:17:06
2017-07-01T02:17:06
96,316,220
1
0
null
2017-07-05T12:21:40
2017-07-05T12:21:40
null
UTF-8
Java
false
false
252
java
package com.SpringBootAndMaterialize.SpringBootAndMaterialize.exception; public class NegocioException extends RuntimeException { private static final long serialVersionUID = 1L; public NegocioException(String mensagem){ super(mensagem); } }
[ "lucas-barros28@hotmail.com" ]
lucas-barros28@hotmail.com
f7307a925ca7a3c8cd88a79970c95a88f255550d
f15bb0ddf9e28ea808f4c49e8c442c29e6f53218
/bus-office/src/main/java/org/aoju/bus/office/magic/Calc.java
e91a1eb785a5aacc2cd90ee5efcd4b0b14e5b3f4
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
erickwang/bus
7f31a19ace167b2ce525105d4393b379118a525e
a8ed185f2f1c0f085d8a2be5e005bcbf50431386
refs/heads/master
2022-04-15T15:28:06.342430
2020-03-26T06:14:42
2020-03-26T06:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,084
java
/********************************************************************************* * * * The MIT License * * * * Copyright (c) 2015-2020 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * ********************************************************************************/ package org.aoju.bus.office.magic; import com.sun.star.lang.XComponent; import com.sun.star.sheet.XSpreadsheetDocument; import org.aoju.bus.office.Builder; /** * 使Office Calc文档(电子表格)更容易使用的实用函数集合. * * @author Kimi Liu * @version 5.8.1 * @since JDK 1.8+ */ public final class Calc { /** * 获取给定文档是否为电子表格文档. * * @param document 要测试的文档. * @return 如果文档是电子表格文档,则为{@code true},否则为{@code false}. */ public static boolean isCalc(final XComponent document) { return Info.isDocumentType(document, Builder.CALC_SERVICE); } /** * 将给定的文档转换为{@link XSpreadsheetDocument}. * * @param document 要转换的文档. * @return 如果文档不是电子表格文档,则为null. */ public static XSpreadsheetDocument getCalcDoc(final XComponent document) { if (document == null) { return null; } return Lo.qi(XSpreadsheetDocument.class, document); } }
[ "839536@qq.com" ]
839536@qq.com
42399d55abe11b4b77afc0effc1529a9088d0327
c3c0a3116e2a0dee2610a057063d9638a66f3b70
/src/main/java/com/guchaolong/javalearn/base/StringTest.java
9b0a513cabdd96942b033241d52c73535b97825e
[]
no_license
guchaolong/java-learn
8523ecad5bb1ed4b61e563e0507cafb12b3ea95d
ac3b744551a185c7fc1601aa5633c9192c2b8aca
refs/heads/master
2023-08-19T07:49:15.351765
2023-08-17T14:25:47
2023-08-17T14:25:47
159,709,168
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package com.guchaolong.javalearn.base; /** * Description: * * @author AA * @date 2020/10/8 19:37 */ public class StringTest { public static void main(String[] args) { String str = "helloword"; String str2 = "hello".substring(1,5); System.out.println("substring " + str2); char[] chars = new char[]{'h', 'e', 'l', 'l','o'}; System.out.println(str + "-" +str.substring(2));//substring(n) 去掉前n个 System.out.println(new String(chars, 1, 4));//offset: 起始位置(0开始), count:字符个数 } }
[ "guclno1@qq.com" ]
guclno1@qq.com
e6a6f41cbdb482dae4c62b74d0e1a81fae20d2fa
08a57e8ee68882d06df4cd0f3cf34be77931e09b
/ttestapp1/src/main/java/com/nfinity/ll/ttestapp1/domain/model/PetsEntity.java
8d19a55900176677c2cd37115c84970dab6c7328
[]
no_license
musman013/sample1
397b9c00d63d83e10f92d91a1bb4d0e1534567fb
7659329adfedac945cb4aa867fc37978721cc06c
refs/heads/master
2022-09-19T09:10:39.126249
2020-03-27T11:06:11
2020-03-27T11:06:11
250,512,532
0
0
null
2022-05-20T21:31:13
2020-03-27T11:06:51
Java
UTF-8
Java
false
false
2,040
java
package com.nfinity.ll.ttestapp1.domain.model; import java.io.Serializable; import javax.persistence.*; import java.util.HashSet; import java.util.Set; import java.util.Date; @Entity @Table(name = "pets", schema = "sample") public class PetsEntity implements Serializable { private Date birthDate; private Integer id; private String name; public PetsEntity() { } @Basic @Column(name = "birthDate", nullable = true) public Date getBirthDate() { return birthDate; } public void setBirthDate(Date birthDate) { this.birthDate = birthDate; } @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @Basic @Column(name = "name", nullable = true, length =30) public String getName() { return name; } public void setName(String name) { this.name = name; } @ManyToOne @JoinColumn(name = "ownerId") public OwnersEntity getOwners() { return owners; } public void setOwners(OwnersEntity owners) { this.owners = owners; } private OwnersEntity owners; @ManyToOne @JoinColumn(name = "typeId") public TypesEntity getTypes() { return types; } public void setTypes(TypesEntity types) { this.types = types; } private TypesEntity types; @OneToMany(mappedBy = "pets", cascade = CascadeType.ALL) public Set<VisitsEntity> getVisitsSet() { return visitsSet; } public void setVisitsSet(Set<VisitsEntity> visits) { this.visitsSet = visits; } private Set<VisitsEntity> visitsSet = new HashSet<VisitsEntity>(); // @Override // public boolean equals(Object o) { // if (this == o) return true; // if (!(o instanceof PetsEntity)) return false; // PetsEntity pets = (PetsEntity) o; // return id != null && id.equals(pets.id); // } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
a546a50857f5e1736b322226fb47c9bbb2002dfa
6b0004ae36d4279cadf26746124c04c34e3c8e86
/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/run/DvrpConfigConsistencyChecker.java
216f7d4daa86c6cdbf355712c2400651e01778fb
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
matsim-eth/avtestbed-wip
dadcaeb1467b490dd2146672061f7f2f8cb723a4
95666132eeffb6dd4a1b6bc03f76b4d900518d7e
refs/heads/master
2021-05-15T02:44:50.629732
2017-10-12T09:26:53
2017-10-12T09:26:53
106,279,132
1
1
null
2017-10-12T09:26:54
2017-10-09T12:12:57
Java
UTF-8
Java
false
false
3,045
java
/* *********************************************************************** * * project: org.matsim.* * * * *********************************************************************** * * * * copyright : (C) 2016 by the members listed in the COPYING, * * LICENSE and WARRANTY file. * * email : info at matsim dot org * * * * *********************************************************************** * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * See also COPYING, LICENSE and WARRANTY file * * * * *********************************************************************** */ package org.matsim.contrib.dvrp.run; import org.apache.log4j.Logger; import org.matsim.contrib.dynagent.run.DynQSimConfigConsistencyChecker; import org.matsim.core.config.Config; public class DvrpConfigConsistencyChecker extends DynQSimConfigConsistencyChecker { private static final Logger log = Logger.getLogger(DvrpConfigConsistencyChecker.class); @Override public void checkConsistency(Config config) { super.checkConsistency(config); if (!config.qsim().isInsertingWaitingVehiclesBeforeDrivingVehicles()) { log.warn("Typically, vrp paths are calculated from startLink to endLink" + "(not from startNode to endNode). That requires making some assumptions" + "on how much time travelling on the first and last links takes. " + "The current implementation assumes freeflow travelling on the last link, " + "which is actually the case in QSim, and a 1-second stay on the first link. " + "The latter expectation is optimistic, and to make it more likely," + "departing vehicles must be inserted befor driving ones " + "(though that still does not guarantee 1-second stay"); } if (config.qsim().isRemoveStuckVehicles()) { throw new RuntimeException("Stuck DynAgents cannot be removed from simulation"); } DvrpConfigGroup dvrpCfg = DvrpConfigGroup.get(config); double alpha = dvrpCfg.getTravelTimeEstimationAlpha(); if (alpha > 1 || alpha <= 0) { throw new RuntimeException("travelTimeEstimationAlpha must be in (0,1]"); } } }
[ "hoerl.sebastian@gmail.com" ]
hoerl.sebastian@gmail.com
1ee307ab2707a746abbff25ed6f07eff15463095
96445cb77dc0d1c34b404793af01b17e17172871
/yarn/simple/src/test/java/org/springframework/yarn/examples/SimpleExampleTests.java
bb6c98c589b00b1af32d03f73e0f90db7ea9485c
[]
no_license
jvalkeal/spring-xd-yarn-examples
7b19ad9524eddec507303212f14ec69e563b6f1a
fdc1dfc0ae8c7a3f5425ec412f26e72a0797fd8e
refs/heads/master
2021-01-10T20:39:42.215344
2013-07-30T11:45:22
2013-07-30T11:45:22
11,173,036
1
0
null
null
null
null
UTF-8
Java
false
false
4,770
java
/* * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.yarn.examples; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; import java.net.URI; import java.util.Scanner; import java.util.concurrent.TimeUnit; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.YarnApplicationState; import org.junit.Test; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.test.annotation.Timed; import org.springframework.test.context.ContextConfiguration; import org.springframework.xd.rest.client.SpringXDOperations; import org.springframework.xd.rest.client.StreamOperations; import org.springframework.xd.rest.client.domain.StreamDefinitionResource; import org.springframework.xd.rest.client.impl.SpringXDTemplate; import org.springframework.yarn.test.context.MiniYarnCluster; import org.springframework.yarn.test.context.YarnDelegatingSmartContextLoader; import org.springframework.yarn.test.junit.AbstractYarnClusterTests; /** * Tests for Spring XD Yarn Simple example. * * @author Janne Valkealahti * */ @ContextConfiguration(loader=YarnDelegatingSmartContextLoader.class) @MiniYarnCluster public class SimpleExampleTests extends AbstractYarnClusterTests { @Test @Timed(millis=240000) public void testAppSubmission() throws Exception { // submit and wait running state ApplicationId applicationId = submitApplication(); assertNotNull(applicationId); YarnApplicationState state = waitState(applicationId, 120, TimeUnit.SECONDS, YarnApplicationState.RUNNING); assertNotNull(state); assertTrue(state.equals(YarnApplicationState.RUNNING)); // wait and do ticktock put Thread.sleep(20000); doTickTockTimeLogPut(applicationId); // assertTrue("Ticktock request failed", doTickTockTimeLogPut(applicationId)); // wait a bit for spring-xd containers to log something Thread.sleep(10000); // long running app, kill it and check that state is KILLED killApplication(applicationId); state = getState(applicationId); assertTrue(state.equals(YarnApplicationState.KILLED)); // get log files File workDir = getYarnCluster().getYarnWorkDir(); PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); String locationPattern = "file:" + workDir.getAbsolutePath() + "/**/*.std*"; Resource[] resources = resolver.getResources(locationPattern); // appmaster and 1 container should make it 4 log files assertThat(resources, notNullValue()); assertThat(resources.length, is(4)); // do some checks for log file content for (Resource res : resources) { File file = res.getFile(); if (file.getName().endsWith("stdout")) { // there has to be some content in stdout file assertThat(file.length(), greaterThan(0l)); if (file.getName().equals("Container.stdout")) { Scanner scanner = new Scanner(file); String content = scanner.useDelimiter("\\A").next(); scanner.close(); // this is what xd container should log assertThat(content, containsString("LoggingHandler")); } } } } private StreamDefinitionResource doTickTockTimeLogPut(ApplicationId applicationId) throws Exception { String url = findXdBaseUrl(applicationId); SpringXDOperations springXDOperations = new SpringXDTemplate(URI.create(url)); StreamOperations streamOperations = springXDOperations.streamOperations(); streamOperations.destroyStream("ticktock"); StreamDefinitionResource stream = streamOperations.createStream("ticktock", "time | log", true); return stream; } private String findXdBaseUrl(ApplicationId applicationId) { // returned track url is "<rm manager>:xxxx//<node>:xxxx", we need the last part return "http://" + getYarnClient().getApplicationReport(applicationId).getTrackingUrl().split("//")[1]; } }
[ "janne.valkealahti@gmail.com" ]
janne.valkealahti@gmail.com
d407026e934515370aa7c1ec8cce1a3eb45e23ca
b5c485493f675bcc19dcadfecf9e775b7bb700ed
/jee-utility-client-controller/src/main/java/org/cyk/utility/client/controller/ControllerFunction.java
0c24f2c582a8388bca23f5e94b5ad14367b119e8
[]
no_license
devlopper/org.cyk.utility
148a1aafccfc4af23a941585cae61229630b96ec
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
refs/heads/master
2023-03-05T23:45:40.165701
2021-04-03T16:34:06
2021-04-03T16:34:06
16,252,993
1
0
null
2022-10-12T20:09:48
2014-01-26T12:52:24
Java
UTF-8
Java
false
false
575
java
package org.cyk.utility.client.controller; import java.util.Collection; import org.cyk.utility.system.SystemFunctionClient; public interface ControllerFunction extends SystemFunctionClient { ControllerFunction setActionEntityClass(Class<?> entityClass); ControllerFunction addActionEntities(Object...entities); ControllerFunction setActionEntityIdentifierClass(Class<?> entityIdentifierClass); ControllerFunction addActionEntitiesIdentifiers(Collection<Object> entitiesIdentifiers); ControllerFunction addActionEntitiesIdentifiers(Object...entitiesIdentifiers); }
[ "kycdev@gmail.com" ]
kycdev@gmail.com
3d3097a1640649f153cf8fac5a144ecfaa2d37fe
7f383314fe0211526f8d743528c034fd50af64da
/app/src/main/java/com/poovarasan/miu/widget/FrameLayoutFixed.java
2db1be2aaa70aa0219036de7237650f0c0544f21
[]
no_license
poovarasanvasudevan/SHPT-AA
0f67142f60cac411dea1bc3644257fea4b12b8fc
183056d9c73938bbd8dd78292f32d59b32df7d02
refs/heads/master
2020-06-25T14:21:52.777602
2016-11-11T12:29:13
2016-11-11T12:29:13
66,633,398
0
0
null
null
null
null
UTF-8
Java
false
false
6,194
java
package com.poovarasan.miu.widget; /** * Created by poovarasanv on 3/11/16. */ import android.content.Context; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import java.util.ArrayList; public class FrameLayoutFixed extends FrameLayout { private final ArrayList<View> mMatchParentChildren = new ArrayList<View>(1); public FrameLayoutFixed(Context context) { super(context); } public FrameLayoutFixed(Context context, AttributeSet attrs) { super(context, attrs); } public FrameLayoutFixed(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public final int getMeasuredStateFixed(View view) { return (view.getMeasuredWidth() & 0xff000000) | ((view.getMeasuredHeight() >> 16) & (0xff000000 >> 16)); } public static int resolveSizeAndStateFixed(int size, int measureSpec, int childMeasuredState) { int result = size; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); switch (specMode) { case MeasureSpec.UNSPECIFIED: result = size; break; case MeasureSpec.AT_MOST: if (specSize < size) { result = specSize | 0x01000000; } else { result = size; } break; case MeasureSpec.EXACTLY: result = specSize; break; } return result | (childMeasuredState & 0xff000000); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { try { int count = getChildCount(); final boolean measureMatchParentChildren = MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY || MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY; mMatchParentChildren.clear(); int maxHeight = 0; int maxWidth = 0; int childState = 0; for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() != GONE) { measureChildWithMargins(child, widthMeasureSpec, 0, heightMeasureSpec, 0); final LayoutParams lp = (LayoutParams) child.getLayoutParams(); maxWidth = Math.max(maxWidth, child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin); maxHeight = Math.max(maxHeight, child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin); childState |= getMeasuredStateFixed(child); if (measureMatchParentChildren) { if (lp.width == LayoutParams.MATCH_PARENT || lp.height == LayoutParams.MATCH_PARENT) { mMatchParentChildren.add(child); } } } } // Account for padding too maxWidth += getPaddingLeft() + getPaddingRight(); maxHeight += getPaddingTop() + getPaddingBottom(); // Check against our minimum height and width maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight()); maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth()); // Check against our foreground's minimum height and width final Drawable drawable = getForeground(); if (drawable != null) { maxHeight = Math.max(maxHeight, drawable.getMinimumHeight()); maxWidth = Math.max(maxWidth, drawable.getMinimumWidth()); } setMeasuredDimension(resolveSizeAndStateFixed(maxWidth, widthMeasureSpec, childState), resolveSizeAndStateFixed(maxHeight, heightMeasureSpec, childState << MEASURED_HEIGHT_STATE_SHIFT)); count = mMatchParentChildren.size(); if (count > 1) { for (int i = 0; i < count; i++) { final View child = mMatchParentChildren.get(i); final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); int childWidthMeasureSpec; int childHeightMeasureSpec; if (lp.width == LayoutParams.MATCH_PARENT) { childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - lp.leftMargin - lp.rightMargin, MeasureSpec.EXACTLY); } else { childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec, getPaddingLeft() + getPaddingRight() + lp.leftMargin + lp.rightMargin, lp.width); } if (lp.height == LayoutParams.MATCH_PARENT) { childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight() - getPaddingTop() - getPaddingBottom() - lp.topMargin - lp.bottomMargin, MeasureSpec.EXACTLY); } else { childHeightMeasureSpec = getChildMeasureSpec(heightMeasureSpec, getPaddingTop() + getPaddingBottom() + lp.topMargin + lp.bottomMargin, lp.height); } child.measure(childWidthMeasureSpec, childHeightMeasureSpec); } } } catch (Exception e) { // FileLog.e("tmessages", e); super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } }
[ "poosan9@gmail.com" ]
poosan9@gmail.com
3745f252674992909c1a51fa1f615ad34f72a6e8
08afea497a4e7ea7211abb17a3ce94c34b867845
/oxygen-aop/src/test/java/vip/justlive/oxygen/aop/Conf.java
4e04410cd4de94dd45706c2c5e5aea732d58866e
[ "Apache-2.0" ]
permissive
zihai367/oxygen
22443bb20a64d63280c2af1303789fcf0e5b6c44
a2dfb4810dc0e533ef63ab291a4e09345487fd24
refs/heads/master
2020-07-20T08:04:36.956444
2019-08-29T01:42:35
2019-08-29T01:42:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,860
java
/* * Copyright (C) 2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package vip.justlive.oxygen.aop; import vip.justlive.oxygen.aop.annotation.Aspect; import vip.justlive.oxygen.aop.annotation.Aspect.TYPE; import vip.justlive.oxygen.ioc.annotation.Bean; import vip.justlive.oxygen.ioc.annotation.Inject; /** * @author wubo */ @Bean public class Conf { private final LogService logService; @Inject public Conf(LogService logService) { this.logService = logService; } @Aspect(annotation = Log.class, type = {TYPE.BEFORE, TYPE.AFTER, TYPE.CATCHING}, order = 1) public void log() { System.out.println("aop all log"); } @Aspect(annotation = Log.class, type = TYPE.BEFORE) public boolean log1(Invocation invocation) { System.out.println("aop before log1 " + invocation.getMethod()); logService.log(); return true; } @Aspect(annotation = Log.class, type = TYPE.AFTER) public void log2(Invocation invocation) { System.out.println("aop after log2 " + invocation.getMethod()); logService.log(); } @Aspect(annotation = Log.class, type = TYPE.CATCHING) public void log3(Invocation invocation) { System.out.println("aop catching log3 " + invocation.getMethod()); logService.log(); } @Log public void print() { System.out.println("print"); } }
[ "qq11419041@163.com" ]
qq11419041@163.com
e44a83d1f57dc8fec7a411078705824ac7e9f22b
310492655ac5490e1744b6b2de4f416a025a0186
/kaitou-office-excel/src/main/java/kaitou/office/excel/util/PropertyUtils.java
cd574c684dcd564ab1ecf2bad7b2105cbf4a7c23
[]
no_license
kaitouzhao/kaitou-office
28ed3dd8f69684f6c434392b11f2310be8598eb6
abb9c6393a2ba7b5c9812aeeb2193e3c02399777
refs/heads/master
2021-01-20T21:49:17.585773
2015-01-20T08:09:31
2015-01-20T08:09:31
29,518,948
1
0
null
null
null
null
UTF-8
Java
false
false
1,032
java
package kaitou.office.excel.util; import java.io.IOException; import java.util.Properties; /** * properties管理工具类. * User: 赵立伟 * Date: 2014/4/25 * Time: 10:31 */ public abstract class PropertyUtils { /** * 获取property值 * * @param name 名称 * @return 值 */ public static String getValue(String name) throws IOException { if (name == null || "".equals(name.trim())) { return ""; } java.io.InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"); Properties properties = new Properties(); properties.load(in); String value = properties.getProperty(name); return new String(value.getBytes("ISO-8859-1"), "gbk"); } /** * 获取项目文件 * * @param name 名称 * @return 路径 */ public static String getPath(String name) throws IOException { return System.getProperty("user.dir") + getValue(name); } }
[ "Kid.Zhao@gmail.com" ]
Kid.Zhao@gmail.com
5750697a5c2137b6c765ef5a8da6614b02006351
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/21/21_06003215c5d001cd52273df3fadf569188022b0d/Game/21_06003215c5d001cd52273df3fadf569188022b0d_Game_t.java
9a049fe86ccd708de21421237d65e384f6a626aa
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,739
java
package graphic; import military.Shipyard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.Display; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Vector2f; import org.newdawn.slick.state.BasicGameState; import org.newdawn.slick.state.StateBasedGame; import state.Economy; import state.Fleet; import state.HQ; import state.Lane; import state.Star; import state.Universe; import ui.EconomyDialog; import ui.FleetWidget; import ui.HQWidget; import ui.IndexedDialog; import ui.StarWidget; import event.GameEventQueue; public class Game extends BasicGameState { private Image background; private StarWidget starWidget; private FleetWidget fleetWidget; private HQWidget hqWidget; private EconomyDialog econDialog; private Object selected; private GameEventQueue eventQueue; private IndexedDialog currentDialog; private int mouseDownTime; public void init(GameContainer gc, StateBasedGame game) throws SlickException { // Run module initialization. Be careful with dependencies. // This is for now very hard-coded and not very modular. Economy.init(); Fleet.init(); Shipyard.init(); // TODO figure out universe sizes, 500x500 for now. Size should be in the universe, not the camera! new Camera(new Vector2f(gc.getWidth(), gc.getHeight()), new Vector2f(600, 400)); starWidget = new StarWidget(); fleetWidget = new FleetWidget(); hqWidget = new HQWidget(); selected = null; econDialog = new EconomyDialog(); eventQueue = new GameEventQueue(); new Universe(); mouseDownTime = -1; currentDialog = null; // TODO load resources in a more intelligent way... Render.init(); background = new Image("resources/bck1.jpg"); Star.img = new Image("resources/star.png"); gc.setTargetFrameRate(120); // Pass two turns to reach a valid starting point (where last turn expenses are based on existing colonies). eventQueue.nextTurn(); eventQueue.nextTurn(); } public void render(GameContainer gc, StateBasedGame game, Graphics g) throws SlickException { // Draw backgrounds background.draw(0, 0); // FIXME Only a test to check coordinate direction, although it looks kind of cool... g.setColor(Color.white); g.drawLine(5, 5, 5, 10); g.drawLine(5, 5, 10, 5); g.setAntiAlias(true); Camera.instance().pushWorldTransformation(g); // Draw Lanes Lane.renderAll(gc, g); // Draw Stars for(Star s : Universe.instance().getStars()) { s.render(gc, g); } // Draw fleets for(Fleet tf : Universe.instance().getFleets()) { tf.render(gc, g, (tf == selected) ? Render.SELECTED : 0); } // Draw HQ for(HQ hq : HQ.all()) { hq.render(gc, g, (hq == selected) ? Render.SELECTED : 0); } // Draw in world widgets if(currentDialog != null) currentDialog.render(gc, g); // FIXME Temporary drawing world boundaries. Camera.instance().drawWorldLimits(g); // Draw HUD widgets g.popTransform(); econDialog.render(gc, g); // Draw events // eventQueue.render(gc, g); } public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException { // Process events and stop processing if modal. if(eventQueue.update(gc, delta)) return; // Check for input Input input = gc.getInput(); // Some interfaces if(mouseDownTime >= 0 && currentDialog != null) { currentDialog.mouseClick(Mouse.isButtonDown(0) ? 0 : 1, mouseDownTime); mouseDownTime += delta; } // Window displacement Vector2f displacement = new Vector2f(0.0f, 0.0f); if(input.isKeyDown(Input.KEY_RIGHT) || Mouse.getX() > Display.getWidth() - 5) { displacement.x = 1; } if(input.isKeyDown(Input.KEY_LEFT) || Mouse.getX() < 5) { displacement.x = -1; } if(input.isKeyDown(Input.KEY_UP) || Mouse.getY() > Display.getHeight() - 5) { displacement.y = -1; } if(input.isKeyDown(Input.KEY_DOWN) || Mouse.getY() < 5) { displacement.y = 1; } // Update x and y positions. Camera.instance().move(displacement.scale(delta/10.0f)); } /** * Advances the game to the next turn. */ public void turn() { // Move the universe forward. eventQueue.nextTurn(); } /** * Used for single clicks. */ @Override public void keyPressed(int key, char c) { if(key == Input.KEY_PRIOR) Camera.instance().zoom(true, Camera.instance().getScreenCenter()); else if(key == Input.KEY_NEXT) Camera.instance().zoom(false, Camera.instance().getScreenCenter()); else if(key == Input.KEY_T) this.turn(); else if(key == Input.KEY_E) econDialog.setVisible(!econDialog.isVisible()); else if(key == Input.KEY_SPACE) currentDialog = null; } @Override public void keyReleased(int key, char c) { if(key == Input.KEY_SPACE) showDialogForSelection(); } @Override public void mousePressed(int button, int x, int y) { mouseDownTime = 0; if(currentDialog != null && currentDialog.isCursorInside()) return; // Check if the click corresponds to a star. Star selectedStar = null; for(Star s : Universe.instance().getStars()) { if(s.screenCLick((float)x, (float)y, button)) { selectedStar = s; break; } } // If a star, check if we add routepoints. if(selectedStar != null) { if(selected instanceof Fleet) { Fleet fleet = (Fleet)selected; // If a fleet was selected and a star was clicked, we might be adding a route point. if(button == 0) { fleet = fleetWidget.getFleetFromSelection(); fleet.addToRoute(selectedStar); } else fleet.removeFromRoute(selectedStar); return; } else selected = selectedStar; // TODO HQ relocation } else selected = null; // Check which objects may have received the click signal. for(Fleet tf : Universe.instance().getFleets()) { if(tf.screenCLick((float)x, (float)y, button)) { selected = tf; break; } } for(HQ hq : HQ.all()) { if(hq.screenCLick((float)x, (float)y, button)) { selected = hq; break; } } showDialogForSelection(); } private void showDialogForSelection() { // Toggle modal interfaces according to the new selection. if(selected instanceof Fleet) { fleetWidget.showFleet((Fleet)selected); currentDialog = fleetWidget; } else if(selected instanceof Star) { starWidget.showStar((Star)selected); currentDialog = starWidget; } else if(selected instanceof HQ) { hqWidget.showHQ((HQ)selected); currentDialog = hqWidget; } else currentDialog = null; System.out.format("selected: %s, dialog: %s\n", (selected == null ? "null" : selected.toString()), (currentDialog == null ? "null" : currentDialog.toString())); } @Override public void mouseReleased(int button, int x, int y) { mouseDownTime = -1; } @Override public void mouseWheelMoved(int change) { Camera.instance().zoom(change >= 0, new Vector2f(Mouse.getX(), Display.getHeight() - Mouse.getY())); } @Override public void mouseMoved(int oldx, int oldy, int newx, int newy) { if(currentDialog != null && currentDialog.moveCursor(oldx, oldy, newx, newy)) mouseDownTime = -1; } @Override public int getID() { return Main.GameStates.MAINGAME.ordinal(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
61984c2c8a6e1dbd06d54eef863f3c14798ab8e1
15ae8d4bd9e1085e0ba7a54beae2f0c126a2dce4
/src/jiuzhang/dp/CountPlane.java
5ddd864d171c765eebdcf476b05da39d0e5fd0ed
[]
no_license
qdh0520/Algorithm
aae9cc61cc020ba371afe4e638bdb5bff11150cf
40f626d95eb877005149631d4ffc228b2829cc89
refs/heads/master
2020-07-06T12:23:23.300710
2019-09-19T14:50:29
2019-09-19T14:50:29
203,016,025
1
0
null
2019-08-18T14:32:46
2019-08-18T14:32:45
null
UTF-8
Java
false
false
1,686
java
package jiuzhang.dp; import java.util.*; /** * 数飞机 * Created by Dell on 2017-08-20. */ public class CountPlane { public class Interval { int start, end; Interval(int start, int end) { this.start = start; this.end = end; } } public int countOfAirplanes(List<Interval> airplanes) { // write your code here ArrayList<Event> list=new ArrayList<>(); for (Interval plane:airplanes){ list.add(new Event(plane.start,1)); list.add(new Event(plane.end,0)); } Collections.sort(list,Event.getComparator()); int cur=0;int max=0; Event curEvent; for(int i=0;i<list.size();i++){ curEvent=list.get(i); if(curEvent.flag==1){ cur++; }else{ cur--; } max=Math.max(max,cur); } return max; } public static class Event{ int time; int flag; public Event(int time, int flag) { this.time = time; this.flag = flag; } public static Comparator<Event> getComparator(){ return new Comparator<Event>() { @Override public int compare(Event o1, Event o2) { if(o1.time!=o2.time){ return o1.time-o2.time; } return o1.flag-o2.flag; } }; } } }
[ "18103412880@163.com" ]
18103412880@163.com
6e85701dbbbadf8c1bfca22481dea8af6521f620
52af9468ca367aa65b5f7fb74d6dd61df021ad0d
/src/marsrover/enums/DirectionEnum.java
472a47621aa0707d8fdd528c2586c5b6d9254234
[]
no_license
zeynepcoskun/marsrover
28ee075b36fbdb0ec93ebe6bea24f7357654e856
223d8d643f835326709b27ee5a58a1cfacf22883
refs/heads/master
2023-06-04T21:29:21.955862
2021-06-20T21:13:46
2021-06-20T21:13:46
378,732,502
0
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package marsrover.enums; public enum DirectionEnum { NORTH("North", "N", true), EAST("East", "E", true), WEST("West", "W", true), SOUTH("South", "S", true); private final String direction; private final String directionLetter; private final boolean active; private DirectionEnum(String direction, String directionLetter, boolean active) { this.direction = direction; this.directionLetter = directionLetter; this.active = active; } public static DirectionEnum getNORTH() { return NORTH; } public static DirectionEnum getEAST() { return EAST; } public static DirectionEnum getWEST() { return WEST; } public static DirectionEnum getSOUTH() { return SOUTH; } public String getDirection() { return direction; } public String getDirectionLetter() { return directionLetter; } public boolean isActive() { return active; } }
[ "apple@apples-MacBook-Pro.local" ]
apple@apples-MacBook-Pro.local
47589b34153b3c75ae7313aa6c82c9dcc93ccdf5
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/97/501.java
06631370e53fb9fad9be1908a93d60524c3adaa4
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package <missing>; public class GlobalMembers { public static int Main() { int n; int m; String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { n = Integer.parseInt(tempVar); } m = n / 100; System.out.printf("%d\n",m); m = (n % 100) / 50; System.out.printf("%d\n",m); m = ((n % 100) % 50) / 20; System.out.printf("%d\n",m); m = (((n % 100) % 50) % 20) / 10; System.out.printf("%d\n",m); m = ((((n % 100) % 50) % 20) % 10) / 5; System.out.printf("%d\n",m); m = (((((n % 100) % 50) % 20) % 10) % 5) / 1; System.out.printf("%d\n",m); return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
47b74bbfd40a7813ee8357a3f86e03bbb564e76a
2ecfca74b3757ee574a29896ae4242d005b50dd3
/scarabei-red/src/com/jfixby/scarabei/red/db/simple/SimpleDBConfig.java
8390dbb12249dc880d1e52ea80ab21604877238b
[]
no_license
ekoi/Scarabei
edc6bceeba9612be8b19d951efcd17900f0901f1
300be6a937fc81e5c0496f33d9a6c2259ce13f04
refs/heads/master
2021-06-24T07:44:26.728005
2017-09-10T09:42:39
2017-09-10T09:42:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
256
java
package com.jfixby.scarabei.red.db.simple; import com.jfixby.scarabei.api.file.File; import com.jfixby.scarabei.api.names.ID; public class SimpleDBConfig { public ID dbName; public File storageFolder; public boolean readFromStorage; }
[ "github@jfixby.com" ]
github@jfixby.com
939348230bd399d1bbd570c8cff581fd104a1b81
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/neo4j--neo4j/033f6326bddfef6431b1bf4dad0770aea24f5325/before/BatchOperationService.java
040f64fa8567b3f0bceb3ddcf4925997cf16ff95
[]
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
7,419
java
/** * Copyright (c) 2002-2011 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.rest.web; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.net.URI; import java.util.Map; import javax.servlet.ServletException; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.codehaus.jackson.JsonFactory; import org.codehaus.jackson.JsonGenerator; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.JsonParser; import org.codehaus.jackson.JsonToken; import org.codehaus.jackson.map.ObjectMapper; import org.neo4j.graphdb.Transaction; import org.neo4j.kernel.AbstractGraphDatabase; import org.neo4j.server.database.Database; import org.neo4j.server.rest.domain.BatchOperationFailedException; import org.neo4j.server.rest.repr.BadInputException; import org.neo4j.server.rest.repr.BatchOperationResults; import org.neo4j.server.rest.repr.InputFormat; import org.neo4j.server.rest.repr.OutputFormat; import org.neo4j.server.web.WebServer; @Path( "/batch" ) public class BatchOperationService { private static final String ID_KEY = "id"; private static final String METHOD_KEY = "method"; private static final String BODY_KEY = "body"; private static final String TO_KEY = "to"; private static final JsonFactory jsonFactory = new JsonFactory(); private final OutputFormat output; private final WebServer webServer; private final Database database; public BatchOperationService( @Context Database database, @Context WebServer webServer, @Context InputFormat input, @Context OutputFormat output ) { this.output = output; this.webServer = webServer; this.database = database; } @POST public Response performBatchOperations( @Context UriInfo uriInfo, InputStream body ) throws BadInputException { AbstractGraphDatabase db = database.graph; Transaction tx = db.beginTx(); try { JsonParser jp = jsonFactory.createJsonParser(body); ObjectMapper mapper = new ObjectMapper(); BatchOperationResults results = new BatchOperationResults(); JsonToken token; String field; String jobMethod, jobPath, jobBody; Integer jobId; // TODO: Perhaps introduce a simple DSL for // deserializing streamed JSON? while( (token = jp.nextToken()) != null) { if(token == JsonToken.START_OBJECT) { jobMethod = jobPath = jobBody = ""; jobId = null; while( (token = jp.nextToken()) != JsonToken.END_OBJECT && token != null) { field = jp.getText(); token = jp.nextToken(); if(field.equals(METHOD_KEY)) { jobMethod = jp.getText().toUpperCase(); } else if(field.equals(TO_KEY)) { jobPath = jp.getText(); } else if(field.equals(ID_KEY)) { jobId = jp.getIntValue(); } else if(field.equals(BODY_KEY)) { JsonNode node = mapper.readTree(jp); StringWriter out = new StringWriter(); JsonGenerator gen = jsonFactory.createJsonGenerator(out); mapper.writeTree(gen, node); gen.flush(); gen.close(); jobBody = out.toString(); } } // Read one job description. Execute it. performJob(results, uriInfo, jobMethod, jobPath, jobBody, jobId); } } Response res = Response.ok() .entity( results.toJSON() ) .header( HttpHeaders.CONTENT_ENCODING, "UTF-8" ) .type( MediaType.APPLICATION_JSON ) .build(); tx.success(); return res; } catch ( Exception e ) { tx.failure(); return output.serverError( e ); } finally { tx.finish(); } } private void performJob( BatchOperationResults results, UriInfo uriInfo, String method, String path, String body, Integer id ) throws IOException, ServletException { InternalJettyServletRequest req = new InternalJettyServletRequest(); InternalJettyServletResponse res = new InternalJettyServletResponse(); // Replace {[ID]} placeholders with location values Map<Integer, String> locations = results.getLocations(); path = replaceLocationPlaceholders( path, locations ); body = replaceLocationPlaceholders( body, locations ); URI targetUri = calculateTargetUri( uriInfo, path ); req.setup( method, targetUri.toString(), body ); res.setup(); webServer.invokeDirectly( targetUri.getPath(), req, res ); if ( is2XXStatusCode( res.getStatus() ) ) { results.addOperationResult( path, id, res.getOutputStream() .toString(), res.getHeader( "Location" ) ); } else { throw new BatchOperationFailedException( res.getStatus(), res.getOutputStream() .toString() ); } } private URI calculateTargetUri( UriInfo serverUriInfo, String requestedPath ) { URI baseUri = serverUriInfo.getBaseUri(); if ( requestedPath.startsWith( baseUri.toString() ) ) { requestedPath = requestedPath.substring( baseUri.toString() .length() ); } if ( !requestedPath.startsWith( "/" ) ) { requestedPath = "/" + requestedPath; } return baseUri.resolve( "." + requestedPath ); } private String replaceLocationPlaceholders( String str, Map<Integer, String> locations ) { // TODO: Potential memory-hog on big requests, write smarter // implementation. for ( Integer jobId : locations.keySet() ) { str = str.replace( "{" + jobId + "}", locations.get( jobId ) ); } return str; } private boolean is2XXStatusCode( int statusCode ) { return statusCode >= 200 && statusCode < 300; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
383b7e8606a0c269499ebec10abadd956c93e331
e1a4acf1d41b152a0f811e82c27ad261315399cc
/examples/java/com/intel/daal/examples/neural_networks/ELULayerDenseBatch.java
58f303e0661e6a5997926588afebdd8a50dd5547
[ "Apache-2.0", "Intel" ]
permissive
ValeryiE/daal
e7572f16e692785db1e17bed23b6ab709db4e705
d326bdc5291612bc9e090d95da65aa579588b81e
refs/heads/master
2020-08-29T11:37:16.157315
2019-10-25T13:11:01
2019-10-25T13:11:01
218,020,419
0
0
Apache-2.0
2019-10-28T10:22:19
2019-10-28T10:22:19
null
UTF-8
Java
false
false
4,103
java
/* file: ELULayerDenseBatch.java */ /******************************************************************************* * Copyright 2014-2019 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ /* // Content: // Java example of ELU layer in the batch processing mode //////////////////////////////////////////////////////////////////////////////// */ package com.intel.daal.examples.neural_networks; import com.intel.daal.algorithms.neural_networks.layers.elu.*; import com.intel.daal.algorithms.neural_networks.layers.ForwardResultId; import com.intel.daal.algorithms.neural_networks.layers.ForwardResultLayerDataId; import com.intel.daal.algorithms.neural_networks.layers.ForwardInputId; import com.intel.daal.algorithms.neural_networks.layers.BackwardResultId; import com.intel.daal.algorithms.neural_networks.layers.BackwardInputId; import com.intel.daal.algorithms.neural_networks.layers.BackwardInputLayerDataId; import com.intel.daal.data_management.data.Tensor; import com.intel.daal.data_management.data.HomogenTensor; import com.intel.daal.examples.utils.Service; import com.intel.daal.services.DaalContext; /** * <a name="DAAL-EXAMPLE-JAVA-ELULAYERBATCH"> * @example ELULayerDenseBatch.java */ class ELULayerDenseBatch { private static final String datasetFileName = "../data/batch/layer.csv"; private static DaalContext context = new DaalContext(); public static void main(String[] args) throws java.io.FileNotFoundException, java.io.IOException { /* Read datasetFileName from a file and create a tensor to store forward input data */ Tensor tensorData = Service.readTensorFromCSV(context, datasetFileName); /* Create an algorithm to compute forward elu layer results using default method */ EluForwardBatch eluLayerForward = new EluForwardBatch(context, Float.class, EluMethod.defaultDense); /* Set input objects for the forward elu layer */ eluLayerForward.input.set(ForwardInputId.data, tensorData); /* Compute forward elu layer results */ EluForwardResult forwardResult = eluLayerForward.compute(); /* Print the results of the forward elu layer */ Service.printTensor("Forward ELU layer result (first 5 rows):", forwardResult.get(ForwardResultId.value), 5, 0); /* Get the size of forward elu layer output */ int nSize = (int)forwardResult.get(ForwardResultId.value).getSize(); long[] dims = forwardResult.get(ForwardResultId.value).getDimensions(); /* Create a tensor with backward input data */ double[] data = new double[nSize]; Tensor tensorDataBack = new HomogenTensor(context, dims, data, 1.0); /* Create an algorithm to compute backward elu layer results using default method */ EluBackwardBatch eluLayerBackward = new EluBackwardBatch(context, Float.class, EluMethod.defaultDense); /* Set input objects for the backward elu layer */ eluLayerBackward.input.set(BackwardInputId.inputGradient, tensorDataBack); eluLayerBackward.input.set(BackwardInputLayerDataId.inputFromForward, forwardResult.get(ForwardResultLayerDataId.resultForBackward)); /* Compute backward elu layer results */ EluBackwardResult backwardResult = eluLayerBackward.compute(); /* Print the results of the backward elu layer */ Service.printTensor("Backward ELU layer result (first 5 rows):", backwardResult.get(BackwardResultId.gradient), 5, 0); context.dispose(); } }
[ "nikolay.a.petrov@intel.com" ]
nikolay.a.petrov@intel.com
675f12faa0be32eb34aad9378539c4f0232b8b10
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/khi.java
72b86c51841f202b839726c731488a903e37ef0d
[]
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
637
java
import android.content.Intent; import android.view.View; import android.view.View.OnClickListener; import com.tencent.mobileqq.troop.activity.TroopCreateAvatarActivity; public class khi implements View.OnClickListener { public khi(TroopCreateAvatarActivity paramTroopCreateAvatarActivity) {} public void onClick(View paramView) { this.a.a.putExtra("isBack", 1); this.a.setResult(-1, this.a.a); this.a.finish(); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar * Qualified Name: khi * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
356211c3f7898d2477e473cf6ad635a1f6dfc37c
2e103182475666ed0a96804f5030efa74469a276
/ymate-platform-core/src/main/java/net/ymate/platform/core/module/impl/DefaultModuleConfigurer.java
9f2fdee9e3b6ace3a81bd515080d9fd2cf91824c
[ "Apache-2.0" ]
permissive
suninformation/ymate-platform-v2
057832ec37f527d136bcef70971e03460d969f98
a0c8549fa448c07610906b799a4e44ad3b7f0236
refs/heads/master
2023-07-22T17:26:57.261618
2023-07-08T06:11:10
2023-07-08T06:11:10
45,100,886
136
45
Apache-2.0
2023-03-14T23:54:25
2015-10-28T09:09:12
Java
UTF-8
Java
false
false
2,126
java
/* * Copyright 2007-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.ymate.platform.core.module.impl; import net.ymate.platform.core.configuration.IConfigReader; import net.ymate.platform.core.configuration.impl.MapSafeConfigReader; import net.ymate.platform.core.module.IModuleConfigurer; import org.apache.commons.lang.NullArgumentException; import org.apache.commons.lang3.StringUtils; import java.util.Collections; import java.util.Map; /** * @author 刘镇 (suninformation@163.com) on 2019-08-07 18:52 * @since 2.1.0 */ public class DefaultModuleConfigurer implements IModuleConfigurer { public static DefaultModuleConfigurer createEmpty(String moduleName) { return new DefaultModuleConfigurer(moduleName, Collections.emptyMap()); } private final String moduleName; private final IConfigReader configReader; public DefaultModuleConfigurer(String moduleName, Map<?, ?> cfgMap) { this(moduleName, MapSafeConfigReader.bind(cfgMap)); } public DefaultModuleConfigurer(String moduleName, IConfigReader configReader) { if (StringUtils.isBlank(moduleName)) { throw new NullArgumentException("moduleName"); } if (configReader == null) { throw new NullArgumentException("configReader"); } this.moduleName = moduleName; this.configReader = configReader; } @Override public String getModuleName() { return moduleName; } @Override public IConfigReader getConfigReader() { return configReader; } }
[ "suninformation@163.com" ]
suninformation@163.com
f0600bfbb5f9dfdaa9845a45e3b338b464dfb272
66848c4e6efe821af2ae7e41435092f272725d61
/src/com/agloco/action/UpdateTermsOfUseAction.java
e2e82cddd52d852f1a49b24c0243d83ad85977ba
[]
no_license
harrysun2006/ag_Guest
59168e01d23ed27bc50ce20e0ed57b1f66eff68a
331ada157fe7487901e11bae2e6f859fb80e398b
refs/heads/master
2021-01-01T06:33:07.027227
2014-09-03T10:58:39
2014-09-03T10:58:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,927
java
/** * Copyright (c) 2000-2006 Liferay, LLC. All rights reserved. * * 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.agloco.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.agloco.exception.CannotCatchedException; import com.agloco.exception.UserPasswordAuthenticateException; import com.agloco.exception.UserPasswordConfirmException; import com.agloco.model.AGMember; import com.agloco.service.util.MailServiceUtil; import com.agloco.service.util.MemberServiceUtil; import com.agloco.util.ValidateUtil; import com.liferay.util.servlet.SessionErrors; /** * <a href="UpdateTermsOfUseAction.java.html"><b><i>View Source</i></b></a> * * @author Erick Kong * */ public class UpdateTermsOfUseAction extends Action { private static Log _log = LogFactory.getLog(UpdateTermsOfUseAction.class); public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res){ try{ String password = req.getParameter("newPassword").trim(); String cfmPassword = req.getParameter("newPasswordCfm").trim(); if(ValidateUtil.isPassword(password) && ValidateUtil.isPassword(cfmPassword)) { if(!password.equals(cfmPassword)) throw new UserPasswordConfirmException(); } else throw new UserPasswordAuthenticateException(); AGMember member = MemberServiceUtil.updateAgreedToTermsOfUse(req.getRemoteUser(), true ,password); MailServiceUtil.sendFirstSigninMail(member); req.setAttribute("memberCode", member.getMemberCode()); //top.jsp use for referralcenter req.getSession().setAttribute(com.agloco.Constants.MEMBERCODE,member.getMemberCode()); return mapping.findForward("agloco.sign_up.sign-up-email-link.jsp"); } catch(Exception e){ if(e instanceof UserPasswordAuthenticateException || e instanceof UserPasswordConfirmException) SessionErrors.add(req, e.getClass().getName() , e); else { _log.error(e.getMessage()); SessionErrors.add(req, CannotCatchedException.class.getName() , new CannotCatchedException()); } return mapping.findForward("portal.terms_of_use"); } //remove this to MemberServiceImpl at 12/09/06 // AGMemberCount agmc = new AGMemberCount(); // agmc.setMemberId(member.getMemberId()); // MemberServiceUtil.addAGMemberCount(agmc); // AGMemberTemp member = MemberServiceUtil.getAGMemberTempByUserId(req.getRemoteUser()); // return mapping.findForward(Constants.COMMON_REFERER); } }
[ "harrysun2006@gmail.com" ]
harrysun2006@gmail.com
f662f888f0d8611ccded10e44ec5bcad69e0ea0e
939bc9b579671de84fb6b5bd047db57b3d186aca
/jdk.javadoc/jdk/javadoc/internal/doclets/toolkit/taglets/BaseTaglet.java
2292c090c6d853c7fa5429ec04d2943313f21a29
[]
no_license
lc274534565/jdk11-rm
509702ceacfe54deca4f688b389d836eb5021a17
1658e7d9e173f34313d2e5766f4f7feef67736e8
refs/heads/main
2023-01-24T07:11:16.084577
2020-11-16T14:21:37
2020-11-16T14:21:37
313,315,578
1
1
null
null
null
null
UTF-8
Java
false
false
4,409
java
/* * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.javadoc.internal.doclets.toolkit.taglets; import java.util.Set; import javax.lang.model.element.Element; import com.sun.source.doctree.DocTree; import jdk.javadoc.internal.doclets.toolkit.Content; /** * A base class that implements the {@link Taglet} interface. * * <p><b>This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. * This code and its internal interfaces are subject to change or * deletion without notice.</b> * * @author Jamie Ho */ public class BaseTaglet implements Taglet { /** * The different kinds of place where any given tag may be used. */ enum Site { OVERVIEW, MODULE, PACKAGE, TYPE, CONSTRUCTOR, METHOD, FIELD } protected final String name; private final boolean inline; private final Set<Site> sites; BaseTaglet(String name, boolean inline, Set<Site> sites) { this.name = name; this.inline = inline; this.sites = sites; } /** * Returns true if this {@code Taglet} can be used in constructor documentation. * @return true if this {@code Taglet} can be used in constructor documentation and false * otherwise. */ public final boolean inConstructor() { return sites.contains(Site.CONSTRUCTOR); } /** * Returns true if this {@code Taglet} can be used in field documentation. * @return true if this {@code Taglet} can be used in field documentation and false * otherwise. */ public final boolean inField() { return sites.contains(Site.FIELD); } /** * Returns true if this {@code Taglet} can be used in method documentation. * @return true if this {@code Taglet} can be used in method documentation and false * otherwise. */ public final boolean inMethod() { return sites.contains(Site.METHOD); } /** * Returns true if this {@code Taglet} can be used in overview documentation. * @return true if this {@code Taglet} can be used in method documentation and false * otherwise. */ public final boolean inOverview() { return sites.contains(Site.OVERVIEW); } /** * Returns true if this {@code Taglet} can be used in module documentation. * @return true if this {@code Taglet} can be used in module documentation and false * otherwise. */ public final boolean inModule() { return sites.contains(Site.MODULE); } /** * Returns true if this {@code Taglet} can be used in package documentation. * @return true if this {@code Taglet} can be used in package documentation and false * otherwise. */ public final boolean inPackage() { return sites.contains(Site.PACKAGE); } /** * Returns true if this {@code Taglet} can be used in type documentation (classes or interfaces). * @return true if this {@code Taglet} can be used in type documentation and false * otherwise. */ public final boolean inType() { return sites.contains(Site.TYPE); } /** * Returns true if this {@code Taglet} is an inline tag. * @return true if this {@code Taglet} represents an inline tag and false otherwise. */ public final boolean isInlineTag() { return inline; } /** * Returns the name of this tag. * @return the name of this tag. */ public String getName() { return name; } /** * {@inheritDoc} * @throws UnsupportedTagletOperationException thrown when the method is * not supported by the taglet. */ public Content getTagletOutput(Element element, DocTree tag, TagletWriter writer) { throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + "."); } /** * {@inheritDoc} * @throws UnsupportedTagletOperationException thrown when the method is not * supported by the taglet. */ public Content getTagletOutput(Element holder, TagletWriter writer) { throw new UnsupportedTagletOperationException("Method not supported in taglet " + getName() + "."); } }
[ "274534565@qq.com" ]
274534565@qq.com
9f1b881a96c9a5e2fcf46243be17c319d7d4c903
d40c84afc557191eac6e14a37cc5d714620b8ce9
/src/main/java/twilightforest/world/layer/GenLayerTFBiomeBorders.java
02cdcb47d70bcc2b4f0707a41e8bdaadacbe55e0
[]
no_license
Kerzachek/TwilightForest
a1b642aa40792658667ef2cdeb95556c4a3283c6
c782e6a14e6bf01977318884fa7efebf4631d299
refs/heads/master
2021-12-09T06:56:21.550342
2016-05-02T20:37:23
2016-05-02T20:37:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,232
java
package twilightforest.world.layer; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.IntCache; import twilightforest.biomes.TFBiomeBase; public class GenLayerTFBiomeBorders extends GenLayer { public GenLayerTFBiomeBorders(long l, GenLayer genlayer) { super(l); this.field_75909_a = genlayer; } public int[] func_75904_a(int x, int z, int width, int depth) { int nx = x - 1; int nz = z - 1; int nwidth = width + 2; int ndepth = depth + 2; int[] input = this.field_75909_a.func_75904_a(nx, nz, nwidth, ndepth); int[] output = IntCache.func_76445_a(width * depth); for (int dz = 0; dz < depth; ++dz) { for (int dx = 0; dx < width; ++dx) { int right = input[dx + 0 + (dz + 1) * nwidth]; int left = input[dx + 2 + (dz + 1) * nwidth]; int up = input[dx + 1 + (dz + 0) * nwidth]; int down = input[dx + 1 + (dz + 2) * nwidth]; int center = input[dx + 1 + (dz + 1) * nwidth]; if (this.onBorder(TFBiomeBase.tfLake.field_76756_M, center, right, left, up, down)) { output[dx + dz * width] = TFBiomeBase.fireflyForest.field_76756_M; } else if (this.onBorder(TFBiomeBase.clearing.field_76756_M, center, right, left, up, down)) { output[dx + dz * width] = TFBiomeBase.oakSavanna.field_76756_M; } else if (this.onBorder(TFBiomeBase.deepMushrooms.field_76756_M, center, right, left, up, down)) { output[dx + dz * width] = TFBiomeBase.mushrooms.field_76756_M; } else if (this.onBorder(TFBiomeBase.glacier.field_76756_M, center, right, left, up, down)) { output[dx + dz * width] = TFBiomeBase.tfSnow.field_76756_M; } else { output[dx + dz * width] = center; } } } return output; } boolean onBorder(int biome, int center, int right, int left, int up, int down) { return center != biome ? false : (right != biome ? true : (left != biome ? true : (up != biome ? true : down != biome))); } }
[ "pturchan@yahoo.com" ]
pturchan@yahoo.com
3cacfd541797c6f1e22121d091a5b7a5738fa639
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_bbdf3702f3ef65d1b31fc32cc613f71262e4e259/MultipleException/8_bbdf3702f3ef65d1b31fc32cc613f71262e4e259_MultipleException_t.java
a46f91cb13954da64d2b0855ddc2a5d605050530
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,800
java
/* * JBoss, Home of Professional Open Source. * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. Some portions may be licensed * to Red Hat, Inc. under one or more contributor license agreements. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. */ package com.metamatrix.api.exception; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.*; /** * Exception that represents the occurrence of multiple exceptions. */ public class MultipleException extends Exception implements Externalizable { /** *The set of Throwable instances that make up this exception * @link aggregation * @associates <b>java.lang.Throwable</b> * @supplierCardinality 1..* */ private List throwablesList = null; /** An error code. */ private String code; /** * No-arg Constructor */ public MultipleException() { super(); } /** * Construct an instance with the set of exceptions and error message * specified. * * @param throwables the set of exceptions that is to comprise * this exception * @param message The error message */ public MultipleException( Collection throwables, String message ) { this( throwables, null, message ); } /** * Construct an instance with the set of exceptions, and an error code and * message specified. * * @param throwables the set of exceptions that is to comprise * this exception * @param message The error message * @param code The error code */ public MultipleException( Collection<Throwable> throwables, String code, String message ) { super( message ); this.throwablesList = Collections.unmodifiableList(new ArrayList<Throwable>(throwables)); setCode( code ); } /** * Get the code for this exception. * @return the code value */ public String getCode(){ return code; } /** * Set the code for this exception. * @param code the new code value */ public void setCode(String code){ this.code = code; } /** * Obtain the set of exceptions that comprise this exception. * @return the set of Throwable instances that comprise this exception. */ public List getExceptions() { return this.throwablesList; } //## JDBC4.0-begin ## @Override //## JDBC4.0-end ## public void readExternal(ObjectInput in) throws IOException,ClassNotFoundException { this.code = (String)in.readObject(); this.throwablesList = ExceptionHolder.toThrowables((List<ExceptionHolder>)in.readObject()); } //## JDBC4.0-begin ## @Override //## JDBC4.0-end ## public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(code); out.writeObject(ExceptionHolder.toExceptionHolders(throwablesList)); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0e3736e163bb2ad908573540eba9d6818a1fca02
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/AP.java
b35544d01bdf9aefc5c88aa38a0779122fdc4cc8
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
1,992
java
public enum AP { public final int s; public final int t; public final int u; static { AP[] arrayOfAP = new AP[18]; arrayOfAP[0] = a; arrayOfAP[1] = b; arrayOfAP[2] = c; arrayOfAP[3] = d; arrayOfAP[4] = e; arrayOfAP[5] = f; arrayOfAP[6] = g; arrayOfAP[7] = h; arrayOfAP[8] = i; arrayOfAP[9] = j; arrayOfAP[10] = k; arrayOfAP[11] = l; arrayOfAP[12] = m; arrayOfAP[13] = n; arrayOfAP[14] = o; arrayOfAP[15] = p; arrayOfAP[16] = q; arrayOfAP[17] = r; v = arrayOfAP; } private AP(int paramInt1, int paramInt2, int paramInt3) { this.s = paramInt1; this.t = paramInt2; this.u = paramInt3; } public static AP a(int paramInt) { AP[] arrayOfAP = a(); int i1 = arrayOfAP.length; int i2 = 0; AP localAP; if (i2 < i1) { localAP = arrayOfAP[i2]; if (localAP.t != paramInt) {} } for (;;) { return localAP; i2++; break; localAP = null; } } public static AP[] a() { return (AP[])v.clone(); } public static AP b(int paramInt) { AP[] arrayOfAP = a(); int i1 = arrayOfAP.length; int i2 = 0; AP localAP; if (i2 < i1) { localAP = arrayOfAP[i2]; if (localAP.s != paramInt) {} } for (;;) { return localAP; i2++; break; localAP = null; } } public static AP c(int paramInt) { AP[] arrayOfAP = a(); int i1 = arrayOfAP.length; int i2 = 0; AP localAP; if (i2 < i1) { localAP = arrayOfAP[i2]; if (localAP.u != paramInt) {} } for (;;) { return localAP; i2++; break; localAP = null; } } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: AP * JD-Core Version: 0.7.0.1 */
[ "paras@protrafsolutions.com" ]
paras@protrafsolutions.com
20a4fc2f7de7d8932a0f705e74039fda99a44aff
7cab112a472df702c9b616c760b8940d50324550
/aionxemu-master/GameServer/data/scripts/system/handlers/quest/morheim/_2307IrresistibleSoup.java
e4290d947a56c2730cbc16a9baad381c81fcda56
[]
no_license
luckychenheng/server_demo
86d31c939fd895c7576156b643ce89354e102209
97bdcb1f6cd614fd360cfed800c479fbdb695cd3
refs/heads/master
2020-05-15T02:59:07.396818
2019-05-09T10:30:47
2019-05-09T10:30:47
182,059,222
2
0
null
null
null
null
UTF-8
Java
false
false
6,207
java
/* * This file is part of Aion X EMU <aionxemu.com>. * * This is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. If not, see <http://www.gnu.org/licenses/>. */ package quest.morheim; import gameserver.model.EmotionType; import gameserver.model.gameobjects.Npc; import gameserver.model.gameobjects.player.Player; import gameserver.network.aion.serverpackets.SM_DIALOG_WINDOW; import gameserver.network.aion.serverpackets.SM_EMOTION; import gameserver.network.aion.serverpackets.SM_USE_OBJECT; import gameserver.questEngine.handlers.QuestHandler; import gameserver.questEngine.model.QuestCookie; import gameserver.questEngine.model.QuestState; import gameserver.questEngine.model.QuestStatus; import gameserver.utils.PacketSendUtility; import gameserver.utils.ThreadPoolManager; /** * @author MrPoke remod By Nephis */ public class _2307IrresistibleSoup extends QuestHandler { private final static int questId = 2307; //INGREDIENT CHECK NEED TO SCRIPT public _2307IrresistibleSoup() { super(questId); } @Override public void register() { qe.setNpcQuestData(204378).addOnQuestStart(questId); //Favyr qe.setNpcQuestData(204378).addOnTalkEvent(questId); qe.setNpcQuestData(204336).addOnTalkEvent(questId); //Spedor qe.setNpcQuestData(700247).addOnTalkEvent(questId); //Aromatic Soup } @Override public boolean onDialogEvent(final QuestCookie env) { final Player player = env.getPlayer(); int targetId = 0; if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (targetId == 204378) //Favyr { if (qs == null || qs.getStatus() == QuestStatus.NONE) { if (env.getDialogId() == 25) return sendQuestDialog(env, 4762); else return defaultQuestStartDialog(env); } else if (qs != null && qs.getStatus() == QuestStatus.REWARD) { return defaultQuestEndDialog(env); } } else if (targetId == 204336) //Spedor { if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 1) { if (env.getDialogId() == 25) return sendQuestDialog(env, 1011); else if (env.getDialogId() == 10000) { qs.setQuestVar(2); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); player.getInventory().removeFromBagByItemId(182204106, 1); PacketSendUtility .sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } else if (env.getDialogId() == 1182) { qs.setQuestVar(1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); player.getInventory().removeFromBagByItemId(182204107, 1); PacketSendUtility .sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } else if (env.getDialogId() == 1267) { qs.setQuestVar(1); qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); player.getInventory().removeFromBagByItemId(182204108, 1); PacketSendUtility .sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } else return defaultQuestStartDialog(env); } } else if (qs != null && qs.getStatus() == QuestStatus.START && qs.getQuestVarById(0) == 0) { switch (targetId) { case 700247: //Aromatic Soup { if (qs.getQuestVarById(0) == 0 && env.getDialogId() == -1) { final int targetObjectId = env.getVisibleObject().getObjectId(); PacketSendUtility.sendPacket(player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 1)); PacketSendUtility.broadcastPacket(player, new SM_EMOTION(player, EmotionType.NEUTRALMODE2, 0, targetObjectId), true); ThreadPoolManager.getInstance().schedule(new Runnable() { final QuestState qs = player.getQuestStateList().getQuestState(questId); @Override public void run() { if (player.getTarget() == null || player.getTarget().getObjectId() != targetObjectId) return; PacketSendUtility.sendPacket(player, new SM_USE_OBJECT(player.getObjectId(), targetObjectId, 3000, 0)); PacketSendUtility.broadcastPacket(player, new SM_EMOTION(player, EmotionType.START_LOOT, 0, targetObjectId), true); qs.setQuestVar(1); updateQuestStatus(env); } }, 3000); } } } } return false; } }
[ "seemac@seedeMacBook-Pro.local" ]
seemac@seedeMacBook-Pro.local
78965ba894fd20cb6f7a7aee087b434a944d04ad
8d8fb4dfd7be299076651e02d26eba6cd879428c
/instrumentation/netty-4.0.8/src/main/java/com/agent/instrumentation/netty40/NettyUtil.java
4eeed8c282319df83c2aa8a45b5a0441c8f7ab5a
[ "Apache-2.0" ]
permissive
newrelic/newrelic-java-agent
db6dd20f6ba3f43909b004ce4a058f589dd4b017
eb298ecd8d31f93622388aa12d3ba1e68a58f912
refs/heads/main
2023-08-31T05:14:44.428903
2023-08-29T10:37:35
2023-08-30T18:08:38
275,016,355
177
150
Apache-2.0
2023-09-11T14:50:06
2020-06-25T21:13:42
Java
UTF-8
Java
false
false
1,895
java
/* * * * Copyright 2020 New Relic Corporation. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * */ package com.agent.instrumentation.netty40; import com.newrelic.agent.bridge.AgentBridge; import com.newrelic.agent.bridge.Token; import com.newrelic.api.agent.NewRelic; import io.netty.handler.codec.http.DefaultHttpResponse; import io.netty.handler.codec.http.HttpResponse; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.logging.Level; public class NettyUtil { public static String getNettyVersion() { return "4"; } public static void setAppServerPort(SocketAddress localAddress) { if (localAddress instanceof InetSocketAddress) { int port = ((InetSocketAddress) localAddress).getPort(); NewRelic.setAppServerPort(port); } else { AgentBridge.getAgent().getLogger().log(Level.FINE, "Unable to get Netty port number"); } } public static void setServerInfo() { AgentBridge.publicApi.setServerInfo("Netty", getNettyVersion()); } public static boolean processResponse(Object msg, Token token) { if (token != null) { if (msg instanceof HttpResponse) { com.newrelic.api.agent.Transaction tx = token.getTransaction(); if (tx != null) { try { tx.setWebResponse(new ResponseWrapper((HttpResponse) msg)); tx.addOutboundResponseHeaders(); tx.markResponseSent(); } catch (Exception e) { AgentBridge.getAgent().getLogger().log(Level.FINER, e, "Unable to set web request on transaction: {0}", tx); } } token.expire(); return true; } } return false; } }
[ "49817386+jeffalder@users.noreply.github.com" ]
49817386+jeffalder@users.noreply.github.com
5d45790cf8309ab550d3119287162bbae3c266ca
c6e4c765862b98d11f12f800789e0982a980e5d9
/apm-sniffer/apm-sdk-plugin/elasticsearch-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v6/interceptor/IndicesClientCreateMethodsInterceptor.java
e6f1db567068e3dbfc22b5d4f73718536a4dad94
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
Fxdemon/incubator-skywalking
ba70e8a481c2613aa966e941a187f6eb140a67f2
89183fbc3830313566b58dbbab0a45cd94023141
refs/heads/master
2020-04-19T03:23:51.307175
2019-12-09T03:33:10
2019-12-09T03:33:10
152,511,085
2
0
Apache-2.0
2019-01-28T01:10:09
2018-10-11T01:14:13
Java
UTF-8
Java
false
false
3,905
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.skywalking.apm.plugin.elasticsearch.v6.interceptor; import static org.apache.skywalking.apm.agent.core.conf.Config.Plugin.Elasticsearch.TRACE_DSL; import static org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.Constants.DB_TYPE; import java.lang.reflect.Method; import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; import org.apache.skywalking.apm.plugin.elasticsearch.v6.RestClientEnhanceInfo; import org.elasticsearch.client.indices.CreateIndexRequest; /** * @author aderm */ public class IndicesClientCreateMethodsInterceptor implements InstanceMethodsAroundInterceptor { @Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable { CreateIndexRequest createIndexRequest = (CreateIndexRequest)(allArguments[0]); RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst .getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { AbstractSpan span = ContextManager .createExitSpan(Constants.CREATE_OPERATOR_NAME, restClientEnhanceInfo.getPeers()); span.setComponent(ComponentsDefine.REST_HIGH_LEVEL_CLIENT); Tags.DB_TYPE.set(span, DB_TYPE); Tags.DB_INSTANCE.set(span, createIndexRequest.index()); if (TRACE_DSL) { //Store es mapping parameters Tags.DB_STATEMENT .set(span, createIndexRequest.mappings().utf8ToString()); } SpanLayer.asDB(span); } } @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst .getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { ContextManager.stopSpan(); } return ret; } @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) { RestClientEnhanceInfo restClientEnhanceInfo = (RestClientEnhanceInfo) (objInst .getSkyWalkingDynamicField()); if (restClientEnhanceInfo != null) { ContextManager.activeSpan().errorOccurred().log(t); } } }
[ "wu.sheng@foxmail.com" ]
wu.sheng@foxmail.com
940bd5887b65b35be867671b00871dffb0cd8133
e047870136e1958ce80dad88fa931304ada49a1b
/eu.cessar.ct.testutils/src/eu/cessar/ct/testutils/EDimension.java
1085ac51a700cd38768b4404640cdf89ea1d7591
[]
no_license
ONagaty/SEA-ModellAR
f4994a628459a20b9be7af95d41d5e0ff8a21f77
a0f6bdbb072503ea584d72f872f29a20ea98ade5
refs/heads/main
2023-06-04T07:07:02.900503
2021-06-19T20:54:47
2021-06-19T20:54:47
376,735,297
0
0
null
null
null
null
UTF-8
Java
false
false
972
java
package eu.cessar.ct.testutils; public enum EDimension { SystemTime (2), UsedJavaHeap (3), WorkingSet (4), Committed (7), WorkingSetPeak (8), ElapsedProcess (9), UserTime (10), KernelTime (11), PageFaults (19), CPUTime (20), CommitLimit (22), CommitPeak (23), PhysicalMemory (24), PhysicalAvailable (25), SystemCache (26), KernelTotal (27), KernelPaged (28), KernelNonpaged (29), PageSize (30), HandleCount (31), ProcessCount (32), ThreadCount (33), GDIObjects (34), USERObjects (35), OpenHandles (36), CommitTotal (37), ReadCount (38), WriteCount (39), BytesRead (40), BytesWritten (41), HardPageFaults (42), SoftPageFaults (43), TextSize (44), DataSize (45), LibrarySize (46), UsedMemory (48), FreeMemory (49), BuffersMemory (50), FreeJavaMemory (51), InvocationCount (52), ; private int dimension; EDimension(int dim) { dimension = dim; } public int getCode() { return(dimension); } }
[ "onagaty@a5sol.com" ]
onagaty@a5sol.com
a1aef8e330106f541200676443fd994b9adaf990
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava3/Foo246.java
2592c0e904085425c84b28ad8b1911e543c49f97
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
package applicationModulepackageJava3; public class Foo246 { public void foo0() { final Runnable anything0 = () -> System.out.println("anything"); new applicationModulepackageJava3.Foo245().foo9(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } public void foo9() { foo8(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
b85f54e6f516537a3f4036caf9792cc18b784b0e
6d60a8adbfdc498a28f3e3fef70366581aa0c5fd
/codebase/dataset/t1/1933_frag1.java
586e82c9a1d0d57cf33b7b3eb5eaa28dc23fb9c8
[]
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
372
java
username = ""; password = ""; JOptionPane.showMessageDialog(NeembuuUploader.getInstance(), "<html><b>" + HOSTNAME + "</b> " + TranslationProvider.get("neembuuuploader.accounts.loginerror") + "</html>", HOSTNAME, JOptionPane.WARNING_MESSAGE); AccountsManager.getInstance().setVisible(true); }
[ "aaponcseku@gmail.com" ]
aaponcseku@gmail.com
c9e7a36daa8cfaab1c4940b17e698a3e352ab9ab
024d3b80a0678923b33da780e6cad17eb80d405e
/jbehave-core/src/main/java/org/jbehave/core/reporters/ViewGenerator.java
b397fb9927d442844fbe5d5f410d499e64014009
[ "BSD-3-Clause" ]
permissive
xavierbourguignon/jbehave-core
4b0754add64c7f961bc9cedf10eeef6173200621
e07a6ed67d111446da1d5e3cbc1a3a9f65e6bd62
refs/heads/master
2021-01-15T23:02:58.303000
2010-11-13T22:07:46
2010-11-13T22:07:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
587
java
package org.jbehave.core.reporters; import java.io.File; import java.util.List; import java.util.Properties; import org.jbehave.core.model.StoryMaps; /** * A view generator is responsible for creating a collective views of stories, * either story maps or file-based reports of stories run. */ public interface ViewGenerator { void generateMapsView(File outputDirectory, StoryMaps storyMaps, Properties viewResources); void generateReportsView(File outputDirectory, List<String> formats, Properties viewResources); ReportsCount getReportsCount(); }
[ "mauro.talevi@aquilonia.org" ]
mauro.talevi@aquilonia.org
bf8180701e08e3f2d03d5c5a319b7ac3023bffbf
e013ec787e57af5c8c798f5714d9f930b76dfd32
/Library/Dynamic Programming/Sparse Table/Range GCD Query.java
2653eae866b15d9aeeef84e115f4744711eb6722
[]
no_license
omaryasser/Competitive-Programming
da66cb75bf6ed5495454d2f57333b02fe30a5b68
ba71b23ae3d0c4ef8bbdeff0cd12c3daca19d809
refs/heads/master
2021-04-29T00:39:29.663196
2019-02-19T04:20:56
2019-02-19T04:20:56
121,832,844
17
8
null
null
null
null
UTF-8
Java
false
false
1,093
java
public class Range_GCD_Query { static int Arr [] , table [][]; public static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a%b); } Range_GCD_Query(int [] in) { Arr = in.clone(); int N = Arr.length; int k = (int) Math.floor(Math.log(N) / Math.log(2)) + 1; table = new int[N][k]; for (int i = 0; i < N; i++) table[i][0] = Arr[i]; for (int j = 1; j <= k; j++) for (int i = 0; i <= N - (1 << j); i++) table[i][j] = gcd(table[i][j - 1] , table[i + (1 << (j - 1))][j - 1]); } int query (int i , int j) { int k = (int)Math.floor(Math.log(j-i+1) / Math.log(2)); // 2^k <= (j-i+1) int GCD = 0; for (int pow = k; pow >= 0; pow--) { if(pow == k) GCD = table[i][pow]; if (i + (1 << pow) - 1 <= j) { GCD = gcd(GCD,table[i][pow]); i += 1 << pow; // instead of having L', we increment L directly } } return GCD; } }
[ "oyaraouf@gmail.com" ]
oyaraouf@gmail.com
ac70a7048facde512ba825677faf6a641f483c63
5aa586fb3c6d1c5350af10e857f31a3daed9b970
/AC-Game/data/scripts/system/handlers/quest/morheim/_2036ACaptiveFlame.java
59442b196157bd2b13926217d68dd63992b44e8f
[]
no_license
JohannesPfau/aion48
c1b77a46b6f98759e3704507fd48a47c5da48021
ebed1fc243fa85ee56a2af49d84a6d6dcca6c027
refs/heads/master
2020-03-18T01:15:05.566820
2018-05-16T20:40:16
2018-05-16T20:40:16
134,134,369
0
1
null
null
null
null
UTF-8
Java
false
false
7,087
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning 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-Lightning 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-Lightning. * If not, see <http://www.gnu.org/licenses/>. * * * Credits goes to all Open Source Core Developer Groups listed below * Please do not change here something, ragarding the developer credits, except the "developed by XXXX". * Even if you edit a lot of files in this source, you still have no rights to call it as "your Core". * Everybody knows that this Emulator Core was developed by Aion Lightning * @-Aion-Unique- * @-Aion-Lightning * @Aion-Engine * @Aion-Extreme * @Aion-NextGen * @Aion-Core Dev. */ package quest.morheim; import com.aionemu.gameserver.model.DialogAction; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.network.aion.serverpackets.SM_DIALOG_WINDOW; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; import com.aionemu.gameserver.services.QuestService; import com.aionemu.gameserver.utils.PacketSendUtility; /** * @author Hellboy aion4Free */ public class _2036ACaptiveFlame extends QuestHandler { private final static int questId = 2036; private final static int[] npc_ids = { 204407, 204408, 700236, 204317 }; public _2036ACaptiveFlame() { super(questId); } @Override public void register() { qe.registerOnEnterZoneMissionEnd(questId); qe.registerOnLevelUp(questId); qe.registerQuestNpc(212878).addOnKillEvent(questId); for (int npc_id : npc_ids) { qe.registerQuestNpc(npc_id).addOnTalkEvent(questId); } } @Override public boolean onZoneMissionEndEvent(QuestEnv env) { return defaultOnZoneMissionEndEvent(env, 2035); } @Override public boolean onLvlUpEvent(QuestEnv env) { return defaultOnLvlUpEvent(env, 2300, true); } @Override public boolean onDialogEvent(final QuestEnv env) { final Player player = env.getPlayer(); final QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null) { return false; } int var = qs.getQuestVarById(0); int targetId = 0; if (env.getVisibleObject() instanceof Npc) { targetId = ((Npc) env.getVisibleObject()).getNpcId(); } if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 204407: { switch (env.getDialog()) { case QUEST_SELECT: if (var == 0) { return sendQuestDialog(env, 1011); } else if (var == 4) { return sendQuestDialog(env, 2375); } case SETPRO1: if (var == 0) { qs.setQuestVarById(0, var + 1); updateQuestStatus(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } case CHECK_USER_HAS_QUEST_ITEM: if (var == 4) { if (QuestService.collectItemCheck(env, true)) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 10000); } else { return sendQuestDialog(env, 10001); } } } } break; case 204408: { switch (env.getDialog()) { case QUEST_SELECT: if (var == 1) { return sendQuestDialog(env, 1352); } case SELECT_ACTION_1353: playQuestMovie(env, 79); break; case SETPRO2: if (var == 1) { qs.setQuestVarById(0, var + 1); updateQuestStatus(env); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 10)); return true; } } } break; case 700236: switch (env.getDialog()) { case USE_OBJECT: if (player.getInventory().getItemCountByItemId(182204014) == 0) { giveQuestItem(env, 182204014, 1); return false; } } break; } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 204317) { if (env.getDialog() == DialogAction.USE_OBJECT) { return sendQuestDialog(env, 10002); } else { return sendQuestEndDialog(env); } } } return false; } @Override public boolean onKillEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null) { return false; } int var = qs.getQuestVarById(0); int targetId = 0; if (env.getVisibleObject() instanceof Npc) { targetId = ((Npc) env.getVisibleObject()).getNpcId(); } if (qs.getStatus() != QuestStatus.START) { return false; } switch (targetId) { case 212878: if (var == 2) { qs.setQuestVarById(0, var + 2); updateQuestStatus(env); return true; } } return false; } }
[ "aion@gmx-topmail.de" ]
aion@gmx-topmail.de
6389eead936255c1ef7a5257c783473a5d7a5a17
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/servicestage/src/main/java/com/huaweicloud/sdk/servicestage/v2/model/LifecycleEntrypoint.java
d91aeb49e5fab4e0a658ed9e14a8928e47b1f883
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
3,312
java
package com.huaweicloud.sdk.servicestage.v2.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.function.Consumer; /** * 生命周期 */ public class LifecycleEntrypoint { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "command") private List<String> command = null; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "args") private List<String> args = null; public LifecycleEntrypoint withCommand(List<String> command) { this.command = command; return this; } public LifecycleEntrypoint addCommandItem(String commandItem) { if (this.command == null) { this.command = new ArrayList<>(); } this.command.add(commandItem); return this; } public LifecycleEntrypoint withCommand(Consumer<List<String>> commandSetter) { if (this.command == null) { this.command = new ArrayList<>(); } commandSetter.accept(this.command); return this; } /** * 执行命令行 * @return command */ public List<String> getCommand() { return command; } public void setCommand(List<String> command) { this.command = command; } public LifecycleEntrypoint withArgs(List<String> args) { this.args = args; return this; } public LifecycleEntrypoint addArgsItem(String argsItem) { if (this.args == null) { this.args = new ArrayList<>(); } this.args.add(argsItem); return this; } public LifecycleEntrypoint withArgs(Consumer<List<String>> argsSetter) { if (this.args == null) { this.args = new ArrayList<>(); } argsSetter.accept(this.args); return this; } /** * 运行参数 * @return args */ public List<String> getArgs() { return args; } public void setArgs(List<String> args) { this.args = args; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } LifecycleEntrypoint that = (LifecycleEntrypoint) obj; return Objects.equals(this.command, that.command) && Objects.equals(this.args, that.args); } @Override public int hashCode() { return Objects.hash(command, args); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class LifecycleEntrypoint {\n"); sb.append(" command: ").append(toIndentedString(command)).append("\n"); sb.append(" args: ").append(toIndentedString(args)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
2712e713bf359bf16fd00726613e717754ae0509
a69ed15e24e686c1c23dc863df46f4481ba66fc8
/corejavaexamples/swing/FillTest.java
675b34e3e6320f8451f8eef0ab541236ea8c5872
[]
no_license
namratajavactp/corejavademos
2d4b1198081ce4abbd92c785f118f2e34ac960bd
52de32f5915f0da350380c38f217a5e75c380f51
refs/heads/master
2021-01-13T02:02:37.922813
2015-08-20T11:33:47
2015-08-20T11:33:47
41,092,268
0
0
null
null
null
null
UTF-8
Java
false
false
2,982
java
/* To establish a common baseline, the AWT defines five logical font names: SansSerif Serif Monospaced Dialog DialogInput These names are always mapped to fonts that actually exist on the client machine. For example, on a Windows system, SansSerif is mapped to Arial. To draw characters in a font, you must first create an object of the class Font. You specify the font face name, the font style, and the point size. Here is an example of how you construct a Font object: Font helvb14 = new Font("Helvetica", Font.BOLD, 14); The third argument is the point size. Points are commonly used in typography to indicate the size of a font. There are 72 points per inch. You can use a logical font name in the place of a font face name in the Font constructor. You specify the style (plain, bold, italic, or bold italic) by setting the second Font constructor argument to one of the following values: Font.PLAIN Font.BOLD Font.ITALIC Font.BOLD + Font.ITALIC */ import java.awt.*; import java.awt.geom.*; import javax.swing.*; import javax.swing.border.BevelBorder; public class FillTest { public static void main(String[] args) { FillFrame frame = new FillFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } } /** A frame that contains a panel with drawings */ class FillFrame extends JFrame { public FillFrame() { setTitle("FillTest"); setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT); // add panel to frame FillPanel panel = new FillPanel(); add(panel); } public static final int DEFAULT_WIDTH = 400; public static final int DEFAULT_HEIGHT = 400; } /** A panel that displays filled rectangles and ellipses */ class FillPanel extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); Cursor c=new Cursor(Cursor.CROSSHAIR_CURSOR); setCursor(c); Graphics2D g2 = (Graphics2D) g; Color cc=new Color(255,0,0); cc.brighter().brighter().brighter(); // setForeground(Color.PINK); setBackground(Color.PINK); setForeground(cc); // draw a rectangle double leftX = 100; double topY = 100; double width = 200; double height = 150; Font sansbold14 = new Font("SansSerif", Font.BOLD, 14); g2.setFont(sansbold14); String message = "Hello, World!"; g2.drawString(message, 75, 80); // setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED,Color.GREEN,Color.BLUE)); setBorder(BorderFactory.createEtchedBorder()); setEnabled(false); Rectangle2D rect = new Rectangle2D.Double(leftX, topY, width, height); g2.setPaint(Color.RED); g2.fill(rect); // draw the enclosed ellipse Ellipse2D ellipse = new Ellipse2D.Double(); ellipse.setFrame(rect); g2.setPaint(new Color(0, 128, 128)); // a dull blue-green g2.fill(ellipse); } }
[ "namrata.marathe@citiustech.com" ]
namrata.marathe@citiustech.com
c139ef7ea8efe25baf0d6c3d1e8cd9767e175c4f
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/p177mm/plugin/sns/p516g/C43543g.java
3a8613b9416a33d85247e8e4cd768ef6b0827658
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
963
java
package com.tencent.p177mm.plugin.sns.p516g; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.p177mm.p183ai.C1202f; import com.tencent.p177mm.p183ai.C1207m; /* renamed from: com.tencent.mm.plugin.sns.g.g */ public final class C43543g implements C1202f { C39736h qQa; public final boolean coA() { AppMethodBeat.m2504i(36810); if (this.qQa == null || this.qQa.qPP.size() == 0) { AppMethodBeat.m2505o(36810); return false; } AppMethodBeat.m2505o(36810); return true; } public final C39736h coB() { AppMethodBeat.m2504i(36811); if (this.qQa == null || this.qQa.qPP.size() == 0) { AppMethodBeat.m2505o(36811); return null; } C39736h c39736h = this.qQa; AppMethodBeat.m2505o(36811); return c39736h; } public final void onSceneEnd(int i, int i2, String str, C1207m c1207m) { } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
434e3aeb8330204cf0c14e5d2982c660b7954600
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_3b08a4c1435dd46c764fe11e81bbe7879c407444/Application/5_3b08a4c1435dd46c764fe11e81bbe7879c407444_Application_t.java
ec699c2d0e3eca14a54a11408f3b916c81f5f89c
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,515
java
/** * */ package org.minnal.core; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.minnal.core.config.ApplicationConfiguration; import org.minnal.core.config.ConfigurationProvider; import org.minnal.core.config.ResourceConfiguration; import org.minnal.core.resource.ResourceClass; import org.minnal.core.route.RouteBuilder; import org.minnal.core.route.Routes; import org.minnal.core.server.exception.ApplicationException; import org.minnal.core.server.exception.ExceptionHandler; import org.minnal.core.util.Generics; import com.fasterxml.jackson.annotation.JsonValue; /** * @author ganeshs * */ public abstract class Application<T extends ApplicationConfiguration> implements Lifecycle { private List<Filter> filters = new ArrayList<Filter>(); private Routes routes = new Routes(); private Map<Class<?>, ResourceClass> resources = new HashMap<Class<?>, ResourceClass>(); private String path; private T configuration; private List<Plugin> plugins = new ArrayList<Plugin>(); private ConfigurationProvider configurationProvider = ConfigurationProvider.getDefault(); private ExceptionHandler exceptionHandler = new ExceptionHandler(); @SuppressWarnings({ "unchecked", "rawtypes" }) public Application() { this.configuration = (T) configurationProvider.provide((Class)Generics.getTypeParameter(getClass(), ApplicationConfiguration.class)); } public Application(T configuration) { this.configuration = configuration; } public ExceptionHandler getExceptionHandler() { return exceptionHandler; } public void addFilter(Filter filter) { filters.add(filter); } public void init() { registerPlugins(); addFilters(); defineResources(); defineRoutes(); for (Plugin plugin : plugins) { plugin.init(this); } } public void start() { for (ResourceClass resource : getResources()) { for (RouteBuilder builder : resource.getRouteBuilders()) { routes.addRoute(builder); } } } public void stop() { for (Plugin plugin : plugins) { plugin.destroy(); } } protected abstract void registerPlugins(); protected abstract void addFilters(); protected abstract void defineRoutes(); protected abstract void defineResources(); protected void addExceptionMapping(Class<? extends Exception> from, Class<? extends ApplicationException> to) { exceptionHandler.mapException(from, to); } protected void mapExceptions() { } protected void addResource(Class<?> resourceClass) { addResource(resourceClass, new ResourceConfiguration(resourceClass.getSimpleName(), configuration)); } protected void addResource(Class<?> resourceClass, ResourceConfiguration resourceConfiguration) { resourceConfiguration.setParent(configuration); ResourceClass resource = new ResourceClass(resourceConfiguration, resourceClass); addResource(resource); } public void addResource(ResourceClass resourceClass) { resources.put(resourceClass.getResourceClass(), resourceClass); } /** * @return the routes */ public Routes getRoutes() { return routes; } /** * Will be used by the container to set the absolute path for this application * * @return the path */ String getPath() { return path; } /** * Will be used by the container to set the absolute path for this application * * @param path the path to set */ void setPath(String path) { this.path = path; } protected ResourceClass resource(Class<?> clazz) { if (! resources.containsKey(clazz)) { throw new MinnalException("Resource - " + clazz.getName() + " not found"); } return resources.get(clazz); } /** * Returns all the resources managed by this application * * @return */ public Collection<ResourceClass> getResources() { return resources.values(); } /** * @return the configuration */ public T getConfiguration() { return configuration; } public void registerPlugin(Plugin plugin) { plugins.add(plugin); } /** * @return the filters */ public List<Filter> getFilters() { return Collections.unmodifiableList(filters); } public boolean shouldInstrument() { return false; } @JsonValue @Override public String toString() { return configuration.getName(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ab4e3c1d7a7b49fc5858c50f62c20272d8a8018d
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/apache-libraries/src/test/java/com/surya/apache/opennlp/ChunkerUnitTest.java
cd2ec39c91cde260bd1e31e9329804feabe96e8c
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
1,411
java
package com.surya.apache.opennlp; import java.io.FileInputStream; import java.io.InputStream; import opennlp.tools.chunker.ChunkerME; import opennlp.tools.chunker.ChunkerModel; import opennlp.tools.postag.POSModel; import opennlp.tools.postag.POSTaggerME; import opennlp.tools.tokenize.SimpleTokenizer; import static org.assertj.core.api.Assertions.assertThat; import org.junit.Test; public class ChunkerUnitTest { @Test public void givenChunkerModel_whenChunk_thenChunksAreDetected() throws Exception { SimpleTokenizer tokenizer = SimpleTokenizer.INSTANCE; String[] tokens = tokenizer.tokenize("He reckons the current account deficit will narrow to only 8 billion."); InputStream inputStreamPOSTagger = getClass().getResourceAsStream("/models/en-pos-maxent.bin"); POSModel posModel = new POSModel(inputStreamPOSTagger); POSTaggerME posTagger = new POSTaggerME(posModel); String tags[] = posTagger.tag(tokens); InputStream inputStreamChunker = new FileInputStream("src/main/resources/models/en-chunker.bin"); ChunkerModel chunkerModel = new ChunkerModel(inputStreamChunker); ChunkerME chunker = new ChunkerME(chunkerModel); String[] chunks = chunker.chunk(tokens, tags); assertThat(chunks).contains("B-NP", "B-VP", "B-NP", "I-NP", "I-NP", "I-NP", "B-VP", "I-VP", "B-PP", "B-NP", "I-NP", "I-NP", "O"); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
76c80790cd0d603cb09943fb27440386e8ba79c8
99a2c35ae486e64f4a20d376a9698ee6a15f5b80
/I2C.SPI/src/main/java/i2c/sensor/utils/PWMPin.java
f1d818e92018006cb0b294ade02d53213b509cf6
[]
no_license
chYatima03/raspberry-coffee
c50278e00eba4c5a9ec30269b552d2091d703ccf
6394b0388746ee17fceb2cac04564a8fa8561ea7
refs/heads/master
2020-12-23T01:43:23.988498
2020-01-21T21:20:56
2020-01-21T21:20:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,590
java
package i2c.sensor.utils; import com.pi4j.io.gpio.Pin; import com.pi4j.io.gpio.PinState; /** * "pure" PWM implementation. * Suitable for an LED, not for a servo (cycle width...) */ public class PWMPin extends GPIOPinAdapter { // 30 seems to be the maximum value. // You can really see the led blinking beyond that. private final static int CYCLE_WIDTH = 30; // ms private final Thread mainThread; private final boolean debug = "true".equals(System.getProperty("debug", "false")); public PWMPin(Pin p, String name, PinState originalState) { super(p, name, originalState); mainThread = Thread.currentThread(); } private boolean emittingPWM = false; private int pwmVolume = 0; // [0..CYCLE_WIDTH], percent / (100 / CYCLE_WIDTH); public void emitPWM(final int percent) { if (percent < 0 || percent > 100) { throw new IllegalArgumentException("Percent MUST be in [0, 100], not [" + percent + "]"); } if (debug) { System.out.println("Volume:" + percentToVolume(percent) + "/" + CYCLE_WIDTH); } Thread pwmThread = new Thread(() -> { emittingPWM = true; pwmVolume = percentToVolume(percent); while (emittingPWM) { if (pwmVolume > 0) { pin.pulse(pwmVolume, true); // set second argument to 'true' makes a blocking call } pin.low(); waitFor(CYCLE_WIDTH - pwmVolume); // Wait for the rest of the cycle } System.out.println("Stopping PWM"); // Notify the ones waiting for this thread to end synchronized (mainThread) { mainThread.notify(); } }); pwmThread.start(); } /** * return a number in [0..CYCLE_WIDTH] * * @param percent in [0..100] * @return a number in [0..CYCLE_WIDTH] */ private int percentToVolume(int percent) { if (percent < 0 || percent > 100) { throw new IllegalArgumentException("Percent MUST be in [0, 100], not [" + percent + "]"); } return percent / (100 / CYCLE_WIDTH); } public void adjustPWMVolume(int percent) { if (percent < 0 || percent > 100) { throw new IllegalArgumentException("Percent MUST be in [0, 100], not [" + percent + "]"); } pwmVolume = percentToVolume(percent); } public boolean isPWMing() { return emittingPWM; } public void stopPWM() { emittingPWM = false; synchronized (mainThread) { try { mainThread.wait(); } catch (InterruptedException ie) { System.out.println(ie.toString()); } } pin.low(); } private void waitFor(long ms) { // TODO Manage nano secs? Or use delay? if (ms > 0) { try { Thread.sleep(ms); } catch (InterruptedException ie) { ie.printStackTrace(); } } } }
[ "olivier.lediouris@oracle.com" ]
olivier.lediouris@oracle.com
1173a4a98841c651bb1c210e6187c76d1d11d207
0d99f22858afa00110201dccd2f177a04812bd94
/src/main/java/jp/plusplus/fbs/world/biome/WorldGenDirtyBirch.java
adff181b5f6711da332480597e05098abf6deaf5
[]
no_license
faroreJP/Insanity-Assorted-Magics
8123f70ac8c98dd85925fa1880a8591fdfffbc4d
fc2dddf445cbd2539d498f0dee172b05b28c58c4
refs/heads/master
2021-01-09T20:26:27.050434
2016-06-01T15:03:59
2016-06-01T15:03:59
60,179,531
0
0
null
null
null
null
UTF-8
Java
false
false
294
java
package jp.plusplus.fbs.world.biome; /** * Created by plusplus_F on 2015/08/20. * 紅葉した白樺 */ public class WorldGenDirtyBirch extends WorldGenDirtyOak { public WorldGenDirtyBirch(boolean notify) { super(notify, false); woodMeta=2; leaveMeta=1; } }
[ "creator.farore@gmail.com" ]
creator.farore@gmail.com
c70aa9c0cf4cd96f14e5da00f9214dc45cdc8c66
84db686827b51c273cd589cffbf39f9d08332a2a
/Armani/rpos/src/com/chelseasystems/cs/ajbauthorization/AJBMessageCodes.java
50d8bd2d77da83f99206218decd9c2e6857f80fd
[]
no_license
bchelli/armani
0ec55106135496e1dd0ebb20a359d2ccbd507210
d84baec9a4df9328ac0bd03c1141502eae601968
refs/heads/master
2020-03-28T20:20:36.813175
2018-09-06T07:23:58
2018-09-06T07:23:58
149,061,353
1
0
null
2018-09-17T03:02:15
2018-09-17T03:02:15
null
UTF-8
Java
false
false
3,164
java
package com.chelseasystems.cs.ajbauthorization; /** * @author Vivek M * */ import java.util.ArrayList; import java.util.Iterator; /** * Enum which contains all the constant values required in any of the AJB * request message. * */ public enum AJBMessageCodes { IX_CMD_REQUEST("100"), IX_CMD_RESPONSE("101"), IX_CMD_PROMPT_REQUEST("150"), IX_CMD_PROMPT_RESPONSE( "151"), IX_CMD_SAF_REQUEST("111"), IX_CMD_SAF_RESPONSE("111"), IX_CMD_GIFTCARD_SWIPE("107"), IX_CMD_ACK_REQUEST("901"), IX_ACTION_CODE_RESPONSE_AUTHORIZED("0"), IX_ACTION_CODE_RESPONSE_DECLINED( "1"), IX_ACTION_CODE_RESPONSE_CALL_REFERRAL("2"), IX_ACTION_CODE_RESPONSE_BANK_DOWN( "3"), IX_ACTION_CODE_RESPONSE_COMM_ISSUE("5"), IX_ACTION_CODE_RESPONSE_REPORT_ERROR( "6"), IX_ACTION_CODE_RESPONSE_TRY_LATER("8"), IX_ACTION_CODE_RESPONSE_TIME_OUT( "10"), IX_ACTION_CODE_RESPONSE_APPROVED_ADMIN("12"), IX_ACTION_CODE_RESPONSE_MAC_FAILURE( "14"), IX_DEBIT_CREDIT_CHECK("check"), IX_DEBIT_CREDIT_ECHECK("echeck"), IX_DEBIT_CREDIT_CREDIT( "credit"), IX_DEBIT_CREDIT_VOID("Void"), IX_DEBIT_CREDIT_DEBIT( "debit"), IX_DEBIT_CREDIT_GIFTCARD("giftcard"), IX_DEBIT_CREDIT_VOIDSALE( "VoidSale"), IX_DEBIT_CREDIT_FORCE("Force"), IX_DEBIT_CREDIT_GETCARD( "Getcard"), IX_DEBIT_CREDIT_GETEFT("GetEFT"), IX_OPTIONS_TOKENIZATION( "*Tokenization"), IX_TRAN_TYPE_DEBIT_BIN_LOOKUP("Binlookup"), IX_TRAN_TYPE_CARD_GET_TOKEN( "GetToken"), IX_TRAN_TYPE_CARD_SALE("Sale"), IX_TRAN_TYPE_GIFT_CARD_SALE("Redeem"), IX_GIFT_CARD_VOIDSALE( "voidSale"), IX_GIFT_CARD_VOIDACTIVATE( "voidActivate"), IX_GIFT_CARD_VOIDRELOAD( "voidReload"), IX_GIFT_CARD_VOIDREFUND( "voidRefund"), IX_GIFT_CARD_VOIDCASHOUT( "voidCashout"),IX_TRAN_TYPE_CHECK_SALE( "Sale"), IX_TRAN_TYPE_REFUND("Refund"), //Added by Himani for redeemable fipay integration IX_TRAN_TYPE_CASHOUT("cashout"), IX_TRAN_TYPE_DEBIT_INIT( "InitDebit"), IX_OPTIONS_BINLOOKUP("*Binlookup"), IX_VERIFONE_PROMPT( "Prompt"), IX_VERIFONE_POS_ITEMS("*POSITEMS"),IX_VERIFONE_RESET("*POSITEMS-Reset"), IX_VERIFONE_POS_ITEMS_CLEAR( "*POSITEMS-CLEAR"),IX_VERIFONE_POS_ITEMS_REMOVE( "*POSITEMS-REMOVE"), IX_VERIFONE_POS_ITEMS_CHANGE("*POSITEM-CHANGE"), IX_VERIFONE_POS_ITEMS_REFRESH( "*POSITEMS-REFRESH"), IX_VERIFONE_SIGNATURE("*SIGNATURE"),IX_OPTIONS_TELEAUTH("TELAUTH"), IX_TRAN_TYPE_BALANCE_INQUIRY("balanceInquiry"), IX_TRAN_TYPE_ACTIVATE("Activate"), IX_TRAN_TYPE_RELOAD("Reload"), //Added by Himani for GC Transaction History IX_TRAN_TYPE_TRANSACTION_HISTORY("ministatement"), IX_ENTRY_METHOD_MANUAL("*cem_manual"), IX_ENTRY_METHOD_MAGSWIPE( "*CEM_Swiped"), IX_ENTRY_METHOD_ICC("*CEM_Insert"), IX_ENTRY_METHOD_ICC_FALLBACK( "*FALLBACK_EMV"), IX_CHECK_VOID("Void"), //Vivek Mishra : Added to send verious track request with Gift Card 107 swipe request IX_SWIPE_MANUAL_ENTRY("0"), IX_SWIPE_TRACK1("1"), IX_SWIPE_TRACK2("2"), IX_SWIPE_TRACK1AND2("4"), IX_OPTIONS_VERIFY_CARD("VerifyCard"); private String value; private AJBMessageCodes(String value) { this.value = value; } public String getValue() { return this.value; } }
[ "saptarshi.mukhaty@skillnetinc.com" ]
saptarshi.mukhaty@skillnetinc.com
04dd747fe675bf10db943d7ecf802f803bec95f4
5d76b555a3614ab0f156bcad357e45c94d121e2d
/src-v2/com/google/android/gms/internal/bc.java
552b0e0bf866ea4e5a62a1dccb4b6fc8da5f319d
[]
no_license
BinSlashBash/xcrumby
8e09282387e2e82d12957d22fa1bb0322f6e6227
5b8b1cc8537ae1cfb59448d37b6efca01dded347
refs/heads/master
2016-09-01T05:58:46.144411
2016-02-15T13:23:25
2016-02-15T13:23:25
51,755,603
5
1
null
null
null
null
UTF-8
Java
false
false
189
java
/* * Decompiled with CFR 0_110. */ package com.google.android.gms.internal; import java.util.ArrayList; public interface bc { public void a(String var1, ArrayList<String> var2); }
[ "binslashbash@otaking.top" ]
binslashbash@otaking.top
36ad14a0f07d86b024bcf6eedc4d51b5cd0f2ce7
2ea1219ab522f4cabc695b065064830791c6b2c9
/Amin-Erdene/Classwork05012019_Aminerdene/Classwork/logicaloperationwithgiven3parameters.java
43373cc014bf7708ca47093297c03c32312fb679
[]
no_license
khangaikhuu/cs_intro_2019
d6f1ab58942a26ddde7bb89e8997eea6b219944e
98b096ba8648afcba60538fad320c64686530ea7
refs/heads/master
2020-05-05T13:32:02.548969
2019-06-04T06:32:26
2019-06-04T06:32:26
180,082,134
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
public class logicaloperationwithgiven3parameters { public boolean A; public boolean B; public boolean C; public boolean logicaloperationwithgiven3parameters(boolean A, boolean B, boolean C) { return (A && B && C) || (A || C) || (C && B); } }
[ "g12@asu.local" ]
g12@asu.local
d2f5887601a1cf82c8565a2383b38c2f1eb7714a
3a492d87ffc0e673878dbce45a5e171ce13eefb7
/implementation/src/main/java/io/smallrye/mutiny/operators/multi/MultiMapOp.java
304f5e9a073b47cf1c8073bb6f41c70e1fb321ee
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jlafourc/smallrye-mutiny
a56b48f4951bfe6a52b2a984989d7869154eff9e
66e7b19e2b85fb1b7037a613a997531ad0f59e9b
refs/heads/master
2022-11-25T21:20:51.021945
2020-07-23T16:54:07
2020-07-23T16:54:07
282,053,757
0
0
Apache-2.0
2020-07-23T20:55:48
2020-07-23T20:55:48
null
UTF-8
Java
false
false
1,735
java
package io.smallrye.mutiny.operators.multi; import static io.smallrye.mutiny.helpers.ParameterValidation.MAPPER_RETURNED_NULL; import java.util.function.Function; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.helpers.ParameterValidation; import io.smallrye.mutiny.subscription.MultiSubscriber; public final class MultiMapOp<T, U> extends AbstractMultiOperator<T, U> { private final Function<? super T, ? extends U> mapper; public MultiMapOp(Multi<T> upstream, Function<? super T, ? extends U> mapper) { super(upstream); this.mapper = ParameterValidation.nonNull(mapper, "mapper"); } @Override public void subscribe(MultiSubscriber<? super U> downstream) { if (downstream == null) { throw new NullPointerException("Subscriber is `null`"); } upstream.subscribe().withSubscriber(new MapProcessor<T, U>(downstream, mapper)); } static class MapProcessor<I, O> extends MultiOperatorProcessor<I, O> { private final Function<? super I, ? extends O> mapper; MapProcessor(MultiSubscriber<? super O> actual, Function<? super I, ? extends O> mapper) { super(actual); this.mapper = mapper; } @Override public void onItem(I item) { if (isDone()) { return; } O v; try { v = mapper.apply(item); } catch (Throwable ex) { failAndCancel(ex); return; } if (v == null) { failAndCancel(new NullPointerException(MAPPER_RETURNED_NULL)); } else { downstream.onItem(v); } } } }
[ "clement.escoffier@gmail.com" ]
clement.escoffier@gmail.com
4528decbfb875070d3ad5ad350476886b56f582a
cd8843d24154202f92eaf7d6986d05a7266dea05
/saaf-base-5.0/1008_saaf-schedule-model/src/main/java/com/sie/saaf/schedule/model/inter/server/ScheduleJobRespServer.java
6686d264144ee05bda1a08bcf202c6df62fede64
[]
no_license
lingxiaoti/tta_system
fbc46c7efc4d408b08b0ebb58b55d2ad1450438f
b475293644bfabba9aeecfc5bd6353a87e8663eb
refs/heads/master
2023-03-02T04:24:42.081665
2021-02-07T06:48:02
2021-02-07T06:48:02
336,717,227
0
0
null
null
null
null
UTF-8
Java
false
false
6,329
java
package com.sie.saaf.schedule.model.inter.server; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import com.sie.saaf.common.model.inter.server.BaseCommonServer; import com.sie.saaf.common.util.SaafToolUtils; import com.sie.saaf.schedule.model.entities.ScheduleJobRespEntity_HI; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.yhg.base.utils.SToolUtils; import com.yhg.hibernate.core.dao.DynamicViewObjectImpl; import com.yhg.hibernate.core.dao.ViewObject; import com.yhg.hibernate.core.paging.Pagination; import com.sie.saaf.schedule.model.entities.readonly.ScheduleJobsRespEntity_HI_RO; import com.sie.saaf.schedule.model.inter.IScheduleJobResp; @Component("scheduleJobRespServer") public class ScheduleJobRespServer extends BaseCommonServer<ScheduleJobRespEntity_HI> implements IScheduleJobResp { private static final Logger LOGGER = LoggerFactory.getLogger(ScheduleJobRespServer.class); @Autowired private ViewObject<ScheduleJobRespEntity_HI> scheduleJobRespDAO_HI; @Autowired DynamicViewObjectImpl<ScheduleJobsRespEntity_HI_RO> scheduleJobsRespDAO_HI_RO; public ScheduleJobRespServer() { super(); } public List<ScheduleJobRespEntity_HI> findSaafJobRespInfo(JSONObject queryParamJSON) { Map<String, Object> queryParamMap = SToolUtils.fastJsonObj2Map(queryParamJSON); List<ScheduleJobRespEntity_HI> findListResult = scheduleJobRespDAO_HI.findList("from SaafJobRespEntity_HI", queryParamMap); return findListResult; } public Object saveSaafJobRespInfo(JSONObject queryParamJSON) { ScheduleJobRespEntity_HI saafJobRespEntity_HI = JSON.parseObject(queryParamJSON.toString(), ScheduleJobRespEntity_HI.class); Object resultData = scheduleJobRespDAO_HI.save(saafJobRespEntity_HI); return resultData; } public Pagination<ScheduleJobsRespEntity_HI_RO> findJobRespAll(JSONObject queryParamJSON) { StringBuffer querySql = new StringBuffer(); querySql.append(ScheduleJobsRespEntity_HI_RO.QUERY_JOBS_SQL); Map<String, Object> map = new HashMap<String, Object>(); map.put("jobId", queryParamJSON.getInteger("jobId")); Pagination<ScheduleJobsRespEntity_HI_RO> rowSet = scheduleJobsRespDAO_HI_RO.findPagination(querySql, map, 1, 20); return rowSet; } /** * LOV:查询未分配给用户的所有职责 * @param parameters * @return */ public Pagination findRemainderJobResp(JSONObject parameters, Integer pageIndex, Integer pageRows) { try { StringBuffer querySql = new StringBuffer(); querySql.append(ScheduleJobsRespEntity_HI_RO.QUERY_ASSIGNED_RESP_TO_JOB_SQL); Map<String, Object> map = new HashMap<String, Object>(); map.put("jobId", SToolUtils.object2Int(parameters.getInteger("jobId"))); SaafToolUtils.parperParam(parameters, "sr.RESPONSIBILITY_NAME", "responsibilityName", querySql, map, "like"); //按平台控制分配权限 SaafToolUtils.parperParam(parameters, "sr.platform_code", "platformCode", querySql, map, "="); Pagination<ScheduleJobsRespEntity_HI_RO> rowSet = scheduleJobsRespDAO_HI_RO.findPagination(querySql, map, pageIndex, pageRows); return rowSet; } catch (Exception e) { LOGGER.info("saaf.commmon.fmw.schedule.model.inter.server.SaafJobRespServer.findRemainderJobResp(JSONObject, Integer, Integer) error:"+e.getMessage()); } return null; } /** * 编辑或创建用户职责 * @param parameters * @return */ public List saveSaafJobResp(JSONObject parameters) { ScheduleJobRespEntity_HI row = null; List userRespList = new ArrayList(); //获取页面数据 int varUserId = SToolUtils.object2Int(parameters.get("varUserId")); try { JSONArray valuesArray = parameters.getJSONArray("jobRespData"); for (int i = 0; i < valuesArray.size(); i++) { JSONObject valuesJson = valuesArray.getJSONObject(i); //判断是新增还是修改 row = new ScheduleJobRespEntity_HI(); row.setCreatedBy(varUserId); // 用户登录的userId,从session里面获取 row.setCreationDate(new Date()); row.setLastUpdatedBy(varUserId); row.setLastUpdateDate(new Date()); row.setLastUpdateLogin(varUserId); row.setStartDateActive(new Date()); row.setPlatformCode(SToolUtils.object2String(valuesJson.get("varPlatformCode") == null ? parameters.get("varPlatformCode") : valuesJson.get("varPlatformCode"))); row.setJobId(SToolUtils.object2Int(valuesJson.get("jobId"))); row.setResponsibilityId(SToolUtils.object2Int(valuesJson.get("respId") == null ? parameters.get("respId") : valuesJson.get("respId"))); row.setJobRespName(SToolUtils.object2String(valuesJson.get("JobRespName"))); userRespList.add(row); } scheduleJobRespDAO_HI.saveOrUpdateAll(userRespList); return userRespList; } catch (Exception e) { LOGGER.info("saaf.commmon.fmw.schedule.model.inter.server.SaafJobRespServer.saveSaafJobResp(JSONObject) error:"+e.getMessage()); } return null; } /** * 删除JOB职责 * @param parameters * @return */ public JSONObject deleteSaafJobResp(JSONObject parameters) { try { Integer jobRespId = null; jobRespId = parameters.getInteger("jobRespId"); ScheduleJobRespEntity_HI row = scheduleJobRespDAO_HI.getById(SToolUtils.object2Int(jobRespId)); scheduleJobRespDAO_HI.delete(row); return SToolUtils.convertResultJSONObj("S", "删除成功", 0, null); } catch (Exception e) { LOGGER.info("saaf.commmon.fmw.schedule.model.inter.server.SaafJobRespServer.deleteSaafJobResp(JSONObject) error:"+e.getMessage()); } return null; } }
[ "huang491591@qq.com" ]
huang491591@qq.com
dbce1ce6f7f1c0f5f0608aa8f90a4be5b34f4e3d
e71b5c7a699340373fbb1dc1a18703d3e927461f
/Week4/Day2/PlanetAPIV2/src/main/java/com/revature/service/PlanetService.java
70fa44b03c454bad18f6f9e206a42f1d28ea07d4
[]
no_license
lilmissrayna/Curriculum-Resources
20532514f25fc9fde8687b8f74d1051c064b3a5e
00b6bbd4e3d51628ac70009d8f144e39668872c9
refs/heads/main
2023-08-22T03:23:05.005118
2021-10-27T18:26:18
2021-10-27T18:26:18
414,344,454
0
0
null
2021-10-06T19:27:05
2021-10-06T19:27:04
null
UTF-8
Java
false
false
1,854
java
package com.revature.service; import java.util.ArrayList; import java.util.List; import com.revature.models.Planet; public class PlanetService { public PlanetService() { this.initalize(); } private List<Planet> planetList = new ArrayList<>(); public void initalize() { planetList.add(new Planet(0,"Mercury","small",false)); planetList.add(new Planet(1,"Venus","hot",false)); planetList.add(new Planet(2,"Earth","blue",false)); planetList.add(new Planet(3,"Mars","red",false)); planetList.add(new Planet(4,"Jupiter","BIG",true)); } public boolean addPlanet(Planet p) { return planetList.add(p); } public boolean deletePlanet(Planet p) { int index = -1; for(int i = 0; i< this.planetList.size(); i++) { if(p!= null && p.getId() == planetList.get(i).getId()) { index = i; }if(p == null) { return true; } } if(index > -1) { planetList.remove(index); return true; }else { return false; } } public Planet getPlanet(int id) { Planet p = null; try { for(int i = 0; i< this.planetList.size(); i++) { if(id == planetList.get(i).getId()) { p = planetList.get(i); } } }catch(Exception e) { return null; } return p; } public boolean updatePlanet(Planet updateDetails) { Planet p = this.getPlanet(updateDetails.getId()); p.setDescription(updateDetails.getDescription()); p.setRings(updateDetails.isRings()); p.setName(updateDetails.getName()); return true; } public Planet getPlanet(String name) { Planet planet = null; for(Planet p: planetList) { if(p.equals(name)) { planet = p; } } return planet; } public List<Planet> getAllPlanets(){ return planetList; } }
[ "ben.arayathel@gmail.com" ]
ben.arayathel@gmail.com
39200a5d63a5c335ef490bd5d92447091d205f74
44f32201be3c8e610b5c72a8ae487d64056d68e5
/.history/demo/test0325/src/main/java/com/hello/test0325/web/WebSecurityConfig_20200327160241.java
640175f3eda53550c5680134aeaea0328c4fac80
[]
no_license
hisouske/test0325
19e421ce5019a949e5a7887d863b1b997a9d5a3b
8efd4169cf6e6d2b70d32a991e3747174be9c7e9
refs/heads/master
2021-05-16T20:28:30.546404
2020-04-22T06:39:58
2020-04-22T06:39:58
250,457,284
0
0
null
null
null
null
UTF-8
Java
false
false
3,555
java
package com.hello.test0325.web; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.provisioning.InMemoryUserDetailsManager; @Configuration @EnableWebSecurity //Spring Security 설정한 클래스 public class WebSecurityConfig extends WebSecurityConfigurerAdapter /** WebSecurityConfig instence 생성 하기 위한 클래스 **/{ @Autowired AuthProvider authProvider; public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception { //모든 인증 Manager auth.userDetailsService(userservice).passwordEncoder(passwordEncoder()); auth.eraseCredentials(false); } private UserService userservice; @Bean // 비밀번호 암호화 객체 public PasswordEncoder passwordEncoder(){ return new BCryptPasswordEncoder(); } @Override protected void configure(HttpSecurity http)/** HTTP 요청에 대한 웹 기반 보안 구성 */ throws Exception { http .authorizeRequests() //페이지 접근 권한 설정.사용자 인증이 된 요청에 대해서만 요청을 허용한다. .antMatchers("/", "/home","/join","/login/*").permitAll() // home 경로 권한없이 접근 가능 .anyRequest().authenticated() //인증된 사용자만 접근 가능 하도록 설정 .and() .formLogin() //로그인 설정, httpSession 기본적 이용. 사용자는 폼기반 로그인으로 인증 할 수 있습니다. .loginPage("/login") //커스텀 로그인 폼, action 경로랑 일치 해야함 .failureUrl("/login?error") //로그인 실패시 이동 하는 페이지 설정 .defaultSuccessUrl("/home",true) // 로그인 성공시 이동 하는 페이지 설정 .permitAll() //로그인 페이지 모든 권한 설정 .and() .logout() //로그아웃 설정 .permitAll() //update 예정 // 로그인 프로세스가 진행될 provider .and() .httpBasic();//사용자는 HTTP기반 인증으로 인증 할 수 있습니다. // .authenticationProvider(authProvider); System.out.println("++++++//////"+http.formLogin()); System.out.println(authProvider); System.out.println(http); } // @Bean // @Override // public UserDetailsService userDetailsService() { // UserDetails user = // User.withDefaultPasswordEncoder() // .username("user") // .password("password") // .roles("USER") // .build(); // System.out.println("websecurityconfig : userpassword : "+user.getPassword()); // return new InMemoryUserDetailsManager(user); // } //회원가입시 필요 // @Override // protected void configure(AuthenticationManagerBuilder auth)throws Exception{ // auth.eraseCredentials(false).userDetailsService(userservice).passwordEncoder(passwordEnoder()); // } }
[ "zzang22yn@naver.com" ]
zzang22yn@naver.com
6dccba3ac9643097b6f43d90bd461bd5bb42c246
c4b56742efe25b0fb6ab64b4445351adc0493ffd
/ui/castafioreframework/src/main/java/org/castafiore/utils/CookieUtil.java
822abafa48d06ff405968165bfe3db550eb9cba9
[]
no_license
nuving/castafioreframework
459332ad67554617445b3476471c89803ce5b0ab
775a4c535d7910a7335aa8cddebcd1b7c95c5e13
refs/heads/master
2021-01-15T19:22:25.042926
2013-09-08T16:43:36
2013-09-08T16:43:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,206
java
/* * Copyright (C) 2007-2010 Castafiore * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see<http://www.gnu.org/licenses/>. */ package org.castafiore.utils; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; public class CookieUtil { public static String getCookieValue(HttpServletRequest request, String cookieName, String defaultValue) { Cookie[] cookies = request.getCookies(); for (int i = 0; i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookieName.equals(cookie.getName())) return (cookie.getValue()); } return (defaultValue); } }
[ "kureem@gmail.com" ]
kureem@gmail.com
4eb51ea45c7b622901787324a3c9f3851c912e9d
01563cf663b502102e22b73bd3ff6a16dde701d0
/src/main/java/com/jk51/modules/trades/mapper/MemberMapper.java
c23ac7b1d52ac7d46f0ece2f2d969c9441cd90b2
[]
no_license
tomzhang/springTestB
17cc2d866723d7200302b068a30239732a9cda26
af4bd2d5cc90d44f0b786fb115577a811d1eaac7
refs/heads/master
2020-05-02T04:35:50.729767
2018-10-24T02:24:35
2018-10-24T02:24:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,197
java
package com.jk51.modules.trades.mapper; import com.jk51.model.order.Member; import com.jk51.model.order.YBMember; import com.jk51.model.packageEntity.StoreAdminCloseIndex; import com.jk51.modules.appInterface.util.MemberInfo; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.*; /** * 版权所有(C) 2017 上海伍壹健康科技有限公司 * 描述: * 作者: hulan * 创建日期: 2017-02-20 * 修改记录: */ @Mapper public interface MemberMapper { void updateIntegral(Member member); Member getMember(int siteId, int buyerId); List<StoreAdminCloseIndex> findStoreAdminCloseIndex(@Param("now") Date now, @Param("before") Date before); Member findUserAndPasswordByMembersId(Integer siteId, String mobile, String passwd); /** * 通过手机号查找会员 * * @param siteId * @param mobile * @return */ Member findMobileById(Integer siteId, String mobile); //查询所有会员用于发放优惠券 List<Member> findAllMember(Integer siteId); List<Member> findMembersByMemberIds(@Param("siteId") Integer siteId, @Param("ids") List<String> ids); //查询所有会员用于发放优惠券 List<Member> findAllMemberByPage(@Param("siteId") int siteId, @Param("pageNum") int pageNum, @Param(value = "pageNo") int pageNo); void updateVipMember(@Param(value = "vipMemberAddSelectParams") Member member); Member getMemberByMemberId(int siteId, int memberId); Member getMemberByOpenId(@Param("siteId") int siteId, @Param("openId") String openId); Integer saveMemberInfo(@Param("member") Member member); Integer insertYbUser(@Param("member") YBMember member); YBMember selectYbMemberByPhone(String phone); Member selectByMobileAndSiteId(@Param("mobile") String mobile, @Param("siteId") int siteId); Member selectByMemberIdAndSiteId(@Param("memberId") String memberId, @Param("siteId") int siteId); int del(@Param("id") Integer id); Member getMemberById(@Param("member_id") String id); int update(@Param("member") Member membert); Map checkMember(Map m); int updatePassword(Map m); int updatePasswordByMobile(Map m); //-----------------------以下是web中迁移过来的方法 HashMap queryMemberInfoByPhoneNum(@Param("phone") String phone, @Param("site_id") Integer site_id); Integer updateMemberInfo(Map<String, Object> params); Integer updateMember(Map<String, Object> params); Integer queryMemberExist(@Param("phone") String phone, @Param("siteId") Integer siteId); Member queryMember(@Param("phone") String phone, @Param("siteId") Integer siteId); Map queryBStoreAdminExt(@Param("site_id") int site_id, @Param("store_user_id") int store_user_id); Integer saveMember(Map<String, Object> parameterMap); Integer saveMemberInfoMap(Map<String, Object> parameterMap); Map<String, Object> getIntegrateByBuyerId(@Param("buyerId") String buyerId, @Param("siteId") String siteId); Integer saveYbMember(Map<String, Object> parameterMap); List<HashMap> findBTriggerByTriggerCode(Integer site_id); Map queryGoodCatNameByCatId(@Param("siteId") int siteId, @Param("catId") String catId); Integer setCheckin(@Param("siteId") Integer siteId, @Param("memberId") Integer memberId, @Param("checkinNum") Integer checkinNum); Map<String, Object> getCheckin(@Param("siteId") Integer siteId, @Param("memberId") Integer memberId); //-----统计 List<Map<String, Object>> selectMemberCountBydays(@Param("siteId") Integer siteId, @Param("start") String startTime, @Param("end") String endTime); List<Map<String, Object>> getPullNewCount(@Param("siteId") Integer siteId, @Param("nowDay") String nowDay); List<Member> queryMemberListForCouponActive(@Param("siteId") Integer siteId, @Param("memberlist") Set paramSet); //-----查询 @MapKey("phone") Map<String, Map<String, Object>> queryForImportByPhoneAndSiteId(@Param("phoneList") List<String> phoneList, @Param("siteId") Integer siteId); String findMobilesByMemberIds(@Param("siteId") Integer siteId, @Param("ids") List<String> ids); List<Map<String, Object>> queryMembersInfoByMemberIds(@Param("siteId") Integer siteId, @Param("ids") List<String> ids); List<Map<String, Object>> selectMemberInfoList(Map<String, Object> params); int updateOpenId(@Param("member") Member membert); String findMobileByIdByTime(@Param("siteId") Integer siteId, @Param("mobile") String mobile); //查询APP会员详情 Map<String,Object> queryMemberInfoByBuyerId(@Param("buyerId") Integer buyerId,@Param("siteId") Integer siteId); Map<String,Object> getMembersLngAndLat(@Param("siteId")Integer siteId, @Param("memberId")Integer memberId); Map<String,Object> calculateDistance(Map<String,Object> map); List<String> queryMemberId(@Param("siteId") Integer siteId); MemberInfo getMemberByMobile(@Param("siteId") Integer siteId, @Param("mobile") String mobile); //APP查询会员列表 List<Map<String,Object>> queryCustomerByInfo(Map<String, Object> parameterMap); List<Map<String,Object>> queryCustomerByDrug(Map<String, Object> parameterMap); //根据标签查询会员列表 List<Map<String,Object>> getCustomerByLabel(Map<String, Object> parameterMap); String getMobileByTradesId(@Param("siteId") Integer siteId, @Param("tradesId") String tradesId); //根据OpenId查询会员信息 Map<String,Object> getMemberInfoByOpenId(Map<String, Object> parameterMap); Map<String,Object> queryMemInfo(@Param("openId") String openId, @Param("siteId") Integer siteId); //保存用户注册数据 int inserUserInfoLog(Map<String, Object> parameterMap); //保存检查结果 int saveCheckLog(Map<String, Object> parameterMap); Map<String,Object> queryBySiteIdAndPhone(@Param("siteId") Integer siteId, @Param("userPhone") String userPhone); //查询设备信息 Map<String,Object> queryEquipment(Map<String, Object> equipmentNumber); Map<String,Object> queryUserInfo(Map<String, Object> parameterMap); }
[ "gaojie@51jk.com" ]
gaojie@51jk.com
7c61feccf37d4f31bf10520b89879e7cfe5165b9
8b15962d5e55754c0db65c30027bb5b32090a339
/src/main/java/org/agilewiki/vcow/System_Realm.java
7ef00e1fc3263cf2a65919a91edf24bfedf41512
[]
no_license
laforge49/VirtualCow
4af6fd6bf043d659a442adc1a58a3e29ea4cd0f5
b8ef30433e08c064bacd703ff307b5120df2db38
refs/heads/master
2021-01-22T02:21:15.489705
2015-07-10T00:34:35
2015-07-10T00:34:35
34,136,810
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package org.agilewiki.vcow; import org.agilewiki.awdb.Node; import org.agilewiki.awdb.nodes.Lnk1_NodeFactory; import org.agilewiki.awdb.nodes.Realm_Node; import org.agilewiki.awdb.nodes.User_NodeFactory; public class System_Realm extends Realm_Node { public System_Realm(String nodeId, long timestamp) { super(nodeId, timestamp); } @Override public void newNode(Node node, String userId) { if (!User_NodeFactory.SYSTEM_USER_ID.equals(userId)) { node.createLnk1(Lnk1_NodeFactory.OF_DOMAIN_ID, NameIds.USERS_SYSTEM_DOMAIN_ID); } } }
[ "laforge49@gmail.com" ]
laforge49@gmail.com
1b072daff753107b9605a5328486de2e6484da79
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a179/A179824Test.java
027e3da44e7bcb75489097a2f66a9f73c4b5f671
[]
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
195
java
package irvine.oeis.a179; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A179824Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
218685291e9e9949106b8f820a72621772deb491
01b7af545cff6bc9c69e3b813148b7484449f104
/MODEL/PROGRAM/JPO/emxChange_mxJPO.java
484ca460e55ee6a4b1cec47b3c69798626026d5d
[]
no_license
rgarbhe-processia/Tiger-DEV
c674b417935076ef41e8cb99a60ba423f51a89a1
75d8ad323df5cbb309e52ae4017cc2d00f6d1f0e
refs/heads/master
2020-04-14T10:57:45.934483
2020-01-10T09:55:41
2020-01-10T09:55:41
163,800,729
0
0
null
null
null
null
UTF-8
Java
false
false
2,004
java
/* * emxChange.java * * Copyright (c) 1992-2015 Dassault Systemes. * * All Rights Reserved. This program contains proprietary and trade secret information of MatrixOne, Inc. Copyright notice is precautionary only and does not evidence any actual or intended * publication of such program. * */ import matrix.db.Context; import com.matrixone.apps.domain.util.EnoviaResourceBundle; import com.matrixone.apps.domain.util.i18nNow; /** * The <code>emxChange</code> JPO class is Wrapper JPO for emxChangeBase JPO which holds methods for executing JPO operations related to objects of the type Change. * @author Cambridge * @version Engineering Central - X3 - Copyright (c) 2007, MatrixOne, Inc. */ public class emxChange_mxJPO extends emxChangeBase_mxJPO { /** * Create a new Change object from a given id * @param context * context for this request * @param args * holds no arguments * @throws Exception * when unable to find object id in the AEF * @since EngineeringCentral X3 */ public emxChange_mxJPO(Context context, String[] args) throws Exception { super(context, args); } /** * Main entry point * @param context * context for this request * @param args * holds no arguments * @return an integer status code (0 = success) * @throws Exception * when problems occurred in the AEF * @since EngineeringCentral X3 */ public int mxMain(Context context, String[] args) throws Exception { if (!context.isConnected()) { i18nNow i18nnow = new i18nNow(); String strLanguage = context.getSession().getLanguage(); String strContentLabel = EnoviaResourceBundle.getProperty(context, "emxComponentsStringResource", context.getLocale(), "emxComponents.Error.UnsupportedClient"); throw new Exception(strContentLabel); } return 0; } }
[ "rgarbhe@processia.com" ]
rgarbhe@processia.com
f9e4f555ddbaf0c07cf1320478b5ee05f2b94e3b
edfb435ee89eec4875d6405e2de7afac3b2bc648
/tags/selenium-core/RELEASE_1_2_0/java/main/com/thoughtworks/selenium/TjwsSeleniumServer.java
6ad833064c4c524f69318e760081295428d3fefa
[]
no_license
Escobita/selenium
6c1c78fcf0fb71604e7b07a3259517048e584037
f4173df37a79ab6dd6ae3f1489ae0cd6cc7db6f1
refs/heads/master
2021-01-23T21:01:17.948880
2012-12-06T22:47:50
2012-12-06T22:47:50
8,271,631
1
0
null
null
null
null
UTF-8
Java
false
false
2,399
java
package com.thoughtworks.selenium; import Acme.Serve.Serve; import edu.emory.mathcs.util.concurrent.Exchanger; import edu.emory.mathcs.util.concurrent.Executors; import marquee.xmlrpc.XmlRpcServer; import marquee.xmlrpc.handlers.ReflectiveInvocationHandler; import java.io.IOException; /** * This is the local web server for Selenium. It serves the following content: * <ul> * <li>/ - the selenium html and js files * </li> * <li>/xmlrpc - test scripts * </li> * <li>/site - the site to be tested (via an internal tunnel) TODO * </li> * </ul> * @author Aslak Helles&oslash;y * @version $Revision: 1.1 $ */ public class TjwsSeleniumServer implements SeleniumServer { private class StoppableServe extends Serve { public void notifyStop() throws IOException { super.notifyStop(); } } private final Exchanger wikiRowExchanger; private final Exchanger resultExchanger; private StoppableServe webserver; public TjwsSeleniumServer(Exchanger commandExchanger, Exchanger resultExchanger) { this.wikiRowExchanger = commandExchanger; this.resultExchanger = resultExchanger; } public void start() { webserver = new StoppableServe(); // This makes it possible to serve files from the file system webserver.addDefaultServlets(null); XmlRpcServer xmlRpcServer = mountXmlRpcServlet(webserver); registerWikiTableRows(xmlRpcServer); Executors.newSingleThreadExecutor().execute(new Runnable() { public void run() { webserver.serve(); } }); } public void shutdown() { try { webserver.notifyStop(); } catch (IOException e) { throw new SeleniumException(e); } } private void registerWikiTableRows(XmlRpcServer xmlRpcServer) { WikiTableRows wikiTableRows = new WikiTableRows(wikiRowExchanger, resultExchanger); ReflectiveInvocationHandler wikiRowTableRowsHandler = new ReflectiveInvocationHandler(wikiTableRows); xmlRpcServer.registerInvocationHandler("wikiTableRows", wikiRowTableRowsHandler); } private XmlRpcServer mountXmlRpcServlet(Serve serve) { XmlRpcServer xmlRpcServer = new XmlRpcServer(); serve.addServlet("/xmlrpc", new XmlRpcServlet(xmlRpcServer)); return xmlRpcServer; } }
[ "simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9" ]
simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9
29f0abd3823cb15090c78e82728f509cfb346c73
88c62d0cabf7f0a884336f76ad4db8d4050d6ecd
/vcell-math/src/main/java/jscl/math/operator/product/MatrixProduct.java
c1b7bc7a804b4ffebb92ab911de3798597fb9933
[ "MIT" ]
permissive
virtualcell/vcell
51aadcd59c4c756aa7dcd43774f9236a8ddcbc37
a4783fec69c30d0a182da50293bfc3ee63af353e
refs/heads/master
2023-08-31T11:14:32.525164
2023-08-30T20:28:25
2023-08-30T20:28:25
101,466,853
55
21
NOASSERTION
2023-09-13T20:02:46
2017-08-26T06:14:17
Java
UTF-8
Java
false
false
1,070
java
package jscl.math.operator.product; import jscl.math.Generic; import jscl.math.Matrix; import jscl.math.Variable; import jscl.math.operator.VectorOperator; import jscl.mathml.MathML; public class MatrixProduct extends VectorOperator { public MatrixProduct(Generic matrix1, Generic matrix2) { super("matrix",new Generic[] {matrix1,matrix2}); } public Generic compute() { if(Matrix.product(parameter[0],parameter[1])) { return parameter[0].multiply(parameter[1]); } return expressionValue(); } public String toJava() { StringBuffer buffer=new StringBuffer(); buffer.append(parameter[0].toJava()); buffer.append(".multiply("); buffer.append(parameter[1].toJava()); buffer.append(")"); return buffer.toString(); } protected void bodyToMathML(MathML element) { parameter[0].toMathML(element,null); parameter[1].toMathML(element,null); } protected Variable newinstance() { return new MatrixProduct(null,null); } }
[ "schaff@uchc.edu" ]
schaff@uchc.edu
b8ae47d399a202460ab65e7db405a1d85fc45774
0cc3358e3e8f81b854f9409d703724f0f5ea2ff7
/src/za/co/mmagon/jwebswing/plugins/bootstrap/forms/controls/BSInput.java
f2861a4c0921f364df5f3be803332888b2c82490
[]
no_license
jsdelivrbot/JWebMP-CompleteFree
c229dd405fe44d6c29ab06eedaecb7a733cbb183
d5f020a19165418eb21507204743e596bee2c011
refs/heads/master
2020-04-10T15:12:35.635284
2018-12-10T01:03:58
2018-12-10T01:03:58
161,101,028
0
0
null
2018-12-10T01:45:25
2018-12-10T01:45:25
null
UTF-8
Java
false
false
2,100
java
/* * Copyright (C) 2017 Marc Magon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package za.co.mmagon.jwebswing.plugins.bootstrap.forms.controls; import za.co.mmagon.jwebswing.base.html.Input; import za.co.mmagon.jwebswing.base.html.attributes.GlobalAttributes; import za.co.mmagon.jwebswing.base.html.attributes.InputTypes; import za.co.mmagon.jwebswing.plugins.bootstrap.BootstrapPageConfigurator; import za.co.mmagon.jwebswing.plugins.bootstrap.forms.groups.BSComponentFormGroupOptions; import za.co.mmagon.jwebswing.plugins.bootstrap.forms.groups.BSFormGroupChildren; /** * Denotes a bootstrap input type * * @author GedMarc * @since 17 Jan 2017 * */ public class BSInput extends Input implements BSFormGroupChildren { private static final long serialVersionUID = 1L; /** * Allows construction of a bootstrap input component */ public BSInput() { BootstrapPageConfigurator.setBootstrapRequired(this, true); } /** * Allows construction of a bootstrap input component * * @param inputType */ public BSInput(InputTypes inputType) { super(inputType); BootstrapPageConfigurator.setBootstrapRequired(this, true); } @Override public void preConfigure() { if (!isConfigured()) { addAttribute(GlobalAttributes.Name, getID()); addClass(BSComponentFormGroupOptions.Form_Control); } super.preConfigure(); } }
[ "ged_marc@hotmail.com" ]
ged_marc@hotmail.com
1fa2e73b3a7179de319f0616ea28a9ff9f70f6dd
be61c5abaa65d542e69109ff0c58268ace1c5fca
/trunk/ipo/src/com/ejoysoft/util/CacheableBoolean.java
aa248ceeb7db0aecf13e9e64eaf470d7e7be598d
[]
no_license
BGCX261/zhishichanquan-svn-to-git
5152cebad62d49add7c7dcd515b4d5ec26038bb7
ecf3dc755640cfa09379c8b0797b7e1922b639e4
refs/heads/master
2016-09-16T10:52:19.964264
2015-08-25T15:43:58
2015-08-25T15:43:58
41,593,894
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
/** * $RCSfile: CacheableBoolean.java,v $ * $Revision: 1.1.1.1 $ * $Date: 2002/09/09 13:51:09 $ * * New Jive from Jdon.com. * * This software is the proprietary information of CoolServlets, Inc. * Use is subject to license terms. */ package com.ejoysoft.util; /** * Wrapper for boolean values so they can be treated as Cacheable objects. */ public class CacheableBoolean implements Cacheable { /** * Wrapped int value. */ private boolean booleanValue; /** * Creates a new CacheableBoolean. * * @param booleanValue the boolean value to wrap. */ public CacheableBoolean(boolean booleanValue) { this.booleanValue = booleanValue; } /** * Returns the underlying boolean value. * * @return the boolean value. */ public boolean getBoolean() { return booleanValue; } //FROM THE CACHEABLE INTERFACE// public long getSize() { return CacheSizes.sizeOfObject() + CacheSizes.sizeOfBoolean(); } }
[ "you@example.com" ]
you@example.com
2d1a96f78bbfc1593c2e3f6fc96b691c1a9f1944
b0bd8fb1d507a219563c25635cca2138d81e03a7
/src/day65/MapView_EntrySet.java
7424ce27e2d27f1ee42a449366da6c984690549f
[]
no_license
sharifamiri/JavaCodeExercises
8c490e65de79748950dc75caf28875e46f87cc4f
b2160e213d4a8bfb583e1878f916110860b7d5ce
refs/heads/master
2022-12-30T10:08:29.663767
2020-10-14T06:57:59
2020-10-14T06:57:59
222,198,225
0
0
null
null
null
null
UTF-8
Java
false
false
1,299
java
package day65; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; public class MapView_EntrySet { public static void main(String[] args) { Map<String, Double> priceMap = new HashMap<>(); priceMap.put("Cucumber", 4.12); priceMap.put("Potato", 3.02); priceMap.put("Celery", 1.2); priceMap.put("Corn", 0.99); priceMap.put("Tomato", 3.99); System.out.println(priceMap); //Set<Map.Entry<K, V>> entrySet(); // Map is not an Iterable so we can not iterate over them // However we can set entrySet view out of the map // and it will store the keyValue pair as single Entry // and store it into the Set Set< Entry<String, Double> > myEntry = priceMap.entrySet(); for (Entry<String, Double> entry : myEntry) { System.out.println("entry : " + entry); System.out.println("entry.getKey() : " + entry.getKey() ); System.out.println("entry.getValue() : " + entry.getValue() ); // update everything that more than 2$ to 0.55 if(entry.getValue() > 2.0 ) { entry.setValue(0.55); } } System.out.println(priceMap); } }
[ "sharif.amiri4@gmail.com" ]
sharif.amiri4@gmail.com
4138cd882f405b5167f17823fec7d92970c32a33
8f4a16dc6e3714260f51fb61d0098da01ea3af2c
/src/com/viptrip/hotel/model/Response_RefundQueryByAlipay.java
42122b65a1dd8f0b84e894808d5611f8ff593443
[]
no_license
bournecao24/wetripT
4ce5fc3daf5cf452f1a3d97a91922fc8159b8a79
fadf580a729b170721522c6a7f037073b04c388e
refs/heads/master
2021-09-10T05:24:54.961044
2018-03-21T02:48:01
2018-03-21T02:48:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
package com.viptrip.hotel.model; import com.viptrip.hotel.model.base.Response_Base; import com.viptrip.hotel.model.pay.RefundQueryByAlipay_Data; public class Response_RefundQueryByAlipay extends Response_Base{ /** * */ private static final long serialVersionUID = 6588883374752089299L; private RefundQueryByAlipay_Data data; public Response_RefundQueryByAlipay() { super(); } public Response_RefundQueryByAlipay(RefundQueryByAlipay_Data data) { this.data = data; } public RefundQueryByAlipay_Data getData() { return data; } public void setData(RefundQueryByAlipay_Data data) { this.data = data; } }
[ "zhenlongla0824@163.com" ]
zhenlongla0824@163.com
9c0ec045e94e7b6977991d150476da0626969acf
4b75bc0d8c00b9f22653d7895f866efd086147a2
/yiibai/netty/src/main/java/com/yiibai/netty/time/TimeClientHandler.java
4095342cb647505b8958780fbef23f60c7b363cd
[ "Apache-2.0" ]
permissive
King-Maverick007/websites
90e40eeb13ba4086ee1d78e755d8a1e9fc3f7c85
fd5ddf7f79ce12658e95e26cd58e3488c90749e2
refs/heads/master
2022-12-19T01:25:54.795195
2019-02-19T06:04:40
2019-02-19T06:04:40
300,188,105
0
0
Apache-2.0
2020-10-01T07:33:49
2020-10-01T07:30:32
null
UTF-8
Java
false
false
1,033
java
package com.yiibai.netty.time; import java.text.SimpleDateFormat; import java.util.Date; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; public class TimeClientHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { ByteBuf m = (ByteBuf) msg; // (1) try { long currentTimeMillis = (m.readUnsignedInt() - 2208988800L) * 1000L; Date currentTime = new Date(currentTimeMillis); System.out.println("Default Date Format:" + currentTime.toString()); SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); String dateString = formatter.format(currentTime); // 转换一下成中国人的时间格式 System.out.println("Date Format:" + dateString); ctx.close(); } finally { m.release(); } } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } }
[ "evangel_a@sina.com" ]
evangel_a@sina.com
a708354e55aa03ea994f0c6f048079588f9f6a1b
2cd64269df4137e0a39e8e67063ff3bd44d72f1b
/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/error/GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl.java
6aa72834e88399c31722dc46bce32f04a7c8c0f1
[ "Apache-2.0", "GPL-2.0-only", "EPL-2.0", "CDDL-1.0", "MIT", "BSD-3-Clause", "Classpath-exception-2.0" ]
permissive
commercetools/commercetools-sdk-java-v2
a8703f5f8c5dde6cc3ebe4619c892cccfcf71cb8
76d5065566ff37d365c28829b8137cbc48f14df1
refs/heads/main
2023-08-14T16:16:38.709763
2023-08-14T11:58:19
2023-08-14T11:58:19
206,558,937
29
13
Apache-2.0
2023-09-14T12:30:00
2019-09-05T12:30:27
Java
UTF-8
Java
false
false
1,149
java
package com.commercetools.api.predicates.query.error; import com.commercetools.api.predicates.query.*; public class GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl { public GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl() { } public static GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl of() { return new GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl(); } public StringComparisonPredicateBuilder<GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl> code() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("code")), p -> new CombinationQueryPredicate<>(p, GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl::of)); } public StringComparisonPredicateBuilder<GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl> exceededResource() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("exceededResource")), p -> new CombinationQueryPredicate<>(p, GraphQLMaxResourceLimitExceededErrorQueryBuilderDsl::of)); } }
[ "automation@commercetools.com" ]
automation@commercetools.com
f60f149d3b70f91ed1c2952ce73387964b28b1d1
5d6f0a5ff77a231ab9aaff08817ccf7f4eef1bda
/drools/src/com/intellij/plugins/drools/lang/psi/impl/DroolsLhsPatternBindVariableImpl.java
8c45634b79309ed5efbb002c244932703cd41b64
[ "Apache-2.0" ]
permissive
vikrant21st/intellij-plugins
b62a71e3410bc0a96c4d42ecdc0271c2d7d5fd00
b3b1c5b9079cee182e04a561b9da9a76dd952760
refs/heads/master
2023-01-12T20:51:07.916439
2022-12-14T19:57:03
2022-12-14T22:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,168
java
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.plugins.drools.lang.psi.impl; import com.intellij.lang.ASTNode; import com.intellij.plugins.drools.lang.psi.DroolsLhsPatternBind; import com.intellij.plugins.drools.lang.psi.DroolsNameId; import com.intellij.plugins.drools.lang.psi.util.DroolsResolveUtil; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiType; import org.jetbrains.annotations.NotNull; import java.util.Set; public abstract class DroolsLhsPatternBindVariableImpl extends DroolsAbstractVariableImpl implements DroolsLhsPatternBind { public DroolsLhsPatternBindVariableImpl(@NotNull ASTNode node) { super(node); } @Override public DroolsNameId getNamedIdElement() { return getNameId(); } @NotNull @Override public PsiType getType() { final Set<PsiClass> psiClasses = DroolsResolveUtil.getPatternBindType(this.getLhsPatternList()); return psiClasses.size() == 0 ? PsiType.NULL : JavaPsiFacade.getElementFactory(getProject()).createType(psiClasses.iterator().next()); } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com