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
42d0f59af98d73e2e8c3b05afb856476d94e32c4
a770e95028afb71f3b161d43648c347642819740
/sources/org/telegram/ui/ProfileActivity$SearchAdapter$$ExternalSyntheticLambda68.java
856d76eef9c047db17129bd350623fb89e103912
[]
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
494
java
package org.telegram.ui; import org.telegram.ui.ProfileActivity; public final /* synthetic */ class ProfileActivity$SearchAdapter$$ExternalSyntheticLambda68 implements Runnable { public final /* synthetic */ ProfileActivity.SearchAdapter f$0; public /* synthetic */ ProfileActivity$SearchAdapter$$ExternalSyntheticLambda68(ProfileActivity.SearchAdapter searchAdapter) { this.f$0 = searchAdapter; } public final void run() { this.f$0.lambda$new$76(); } }
[ "fabian_pastor@msn.com" ]
fabian_pastor@msn.com
bf819899329c779a43270adc815c687de716100a
99380e534cf51b9635fafeec91a740e8521e3ed8
/dbcp_src/src/org/apache/commons/dbcp/DriverConnectionFactory.java
9cbe94283fac402e30b48c4cfd60630b7e3ec2af
[]
no_license
khodabakhsh/cxldemo
d483c634e41bb2b6d70d32aff087da6fd6985d3f
9534183fb6837bfa11d5cad98489fdae0db526f1
refs/heads/master
2021-01-22T16:53:27.794334
2013-04-20T01:44:18
2013-04-20T01:44:18
38,994,185
1
0
null
null
null
null
UTF-8
Java
false
false
1,996
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.commons.dbcp; import java.sql.Connection; import java.sql.Driver; import java.sql.SQLException; import java.util.Properties; /** * 使用 {@link java.sql.Driver#connect(String, Properties)}来创建{@link Connection}. * <p> * A {@link Driver}-based implementation of {@link ConnectionFactory}. * * @author Rodney Waldhoff * @version $Revision: 479137 $ $Date: 2006-11-25 10:51:48 -0500 (Sat, 25 Nov 2006) $ */ public class DriverConnectionFactory implements ConnectionFactory { public DriverConnectionFactory(Driver driver, String connectUri, Properties props) { _driver = driver; _connectUri = connectUri; _props = props; } public Connection createConnection() throws SQLException { return _driver.connect(_connectUri,_props); } protected Driver _driver = null; protected String _connectUri = null; /** * 应该包含数据库"user" 和 "password" */ protected Properties _props = null; public String toString() { return this.getClass().getName() + " [" + String.valueOf(_driver) + ";" + String.valueOf(_connectUri) + ";" + String.valueOf(_props) + "]"; } }
[ "cxdragon@gmail.com" ]
cxdragon@gmail.com
d5f3d264beb162a284a1afa66626adf0650de987
72f750e4a5deb0a717245abd26699bd7ce06777f
/ehealth/src/main/java/jkt/hms/masters/business/base/BaseBloodOpeningStockDetail.java
96282189d5724146154254b9d16ccf4f7c78ae48
[]
no_license
vadhwa11/newproject3eh
1d68525a2dfbd7acb1a87f9d60f150cef4f12868
b28c7892e8b0c3f201abb3a730b21e75d9583ddf
refs/heads/master
2020-05-15T23:20:17.716904
2019-04-21T12:14:46
2019-04-21T12:14:46
182,526,354
0
0
null
null
null
null
UTF-8
Java
false
false
7,211
java
package jkt.hms.masters.business.base; import java.io.Serializable; /** * This is an object that contains data related to the * blood_opening_stock_detail table. Do not modify this class because it will be * overwritten if the configuration file related to this class is modified. * * @hibernate.class table="blood_opening_stock_detail" */ public abstract class BaseBloodOpeningStockDetail implements Serializable { public static String REF = "BloodOpeningStockDetail"; public static String PROP_QTY = "Qty"; public static String PROP_BLOOD_GROUP = "BloodGroup"; public static String PROP_UNIT_ADDRESS = "UnitAddress"; public static String PROP_COLLECTION_DATE = "CollectionDate"; public static String PROP_BLOOD_BAG_NO = "BloodBagNo"; public static String PROP_RANK = "Rank"; public static String PROP_EXPIRY_DATE = "ExpiryDate"; public static String PROP_COMPONENT = "Component"; public static String PROP_OPENING_MAIN = "OpeningMain"; public static String PROP_HIN = "Hin"; public static String PROP_NAME = "Name"; public static String PROP_ID = "Id"; // constructors public BaseBloodOpeningStockDetail() { initialize(); } /** * Constructor for primary key */ public BaseBloodOpeningStockDetail(java.lang.Integer id) { this.setId(id); initialize(); } protected void initialize() { } private int hashCode = Integer.MIN_VALUE; // primary key private java.lang.Integer id; // fields private java.lang.String bloodBagNo; private java.util.Date collectionDate; private java.lang.String unitAddress; private java.lang.String name; private java.util.Date expiryDate; private java.lang.Integer qty; // many to one private jkt.hms.masters.business.BloodOpeningStockMain openingMain; private jkt.hms.masters.business.BloodMasComponent component; private jkt.hms.masters.business.MasRank rank; private jkt.hms.masters.business.MasBloodGroup bloodGroup; private jkt.hms.masters.business.Patient hin; /** * Return the unique identifier of this class * * @hibernate.id generator-class="native" column="opening_detail_id" */ public java.lang.Integer getId() { return id; } /** * Set the unique identifier of this class * * @param id * the new ID */ public void setId(java.lang.Integer id) { this.id = id; this.hashCode = Integer.MIN_VALUE; } /** * Return the value associated with the column: blood_bag_no */ public java.lang.String getBloodBagNo() { return bloodBagNo; } /** * Set the value related to the column: blood_bag_no * * @param bloodBagNo * the blood_bag_no value */ public void setBloodBagNo(java.lang.String bloodBagNo) { this.bloodBagNo = bloodBagNo; } /** * Return the value associated with the column: collection_date */ public java.util.Date getCollectionDate() { return collectionDate; } /** * Set the value related to the column: collection_date * * @param collectionDate * the collection_date value */ public void setCollectionDate(java.util.Date collectionDate) { this.collectionDate = collectionDate; } /** * Return the value associated with the column: unit_address */ public java.lang.String getUnitAddress() { return unitAddress; } /** * Set the value related to the column: unit_address * * @param unitAddress * the unit_address value */ public void setUnitAddress(java.lang.String unitAddress) { this.unitAddress = unitAddress; } /** * Return the value associated with the column: name */ public java.lang.String getName() { return name; } /** * Set the value related to the column: name * * @param name * the name value */ public void setName(java.lang.String name) { this.name = name; } /** * Return the value associated with the column: expiry_date */ public java.util.Date getExpiryDate() { return expiryDate; } /** * Set the value related to the column: expiry_date * * @param expiryDate * the expiry_date value */ public void setExpiryDate(java.util.Date expiryDate) { this.expiryDate = expiryDate; } /** * Return the value associated with the column: qty */ public java.lang.Integer getQty() { return qty; } /** * Set the value related to the column: qty * * @param qty * the qty value */ public void setQty(java.lang.Integer qty) { this.qty = qty; } /** * Return the value associated with the column: opening_main_id */ public jkt.hms.masters.business.BloodOpeningStockMain getOpeningMain() { return openingMain; } /** * Set the value related to the column: opening_main_id * * @param openingMain * the opening_main_id value */ public void setOpeningMain( jkt.hms.masters.business.BloodOpeningStockMain openingMain) { this.openingMain = openingMain; } /** * Return the value associated with the column: component_id */ public jkt.hms.masters.business.BloodMasComponent getComponent() { return component; } /** * Set the value related to the column: component_id * * @param component * the component_id value */ public void setComponent( jkt.hms.masters.business.BloodMasComponent component) { this.component = component; } /** * Return the value associated with the column: rank_id */ public jkt.hms.masters.business.MasRank getRank() { return rank; } /** * Set the value related to the column: rank_id * * @param rank * the rank_id value */ public void setRank(jkt.hms.masters.business.MasRank rank) { this.rank = rank; } /** * Return the value associated with the column: blood_group_id */ public jkt.hms.masters.business.MasBloodGroup getBloodGroup() { return bloodGroup; } /** * Set the value related to the column: blood_group_id * * @param bloodGroup * the blood_group_id value */ public void setBloodGroup(jkt.hms.masters.business.MasBloodGroup bloodGroup) { this.bloodGroup = bloodGroup; } /** * Return the value associated with the column: hin_id */ public jkt.hms.masters.business.Patient getHin() { return hin; } /** * Set the value related to the column: hin_id * * @param hin * the hin_id value */ public void setHin(jkt.hms.masters.business.Patient hin) { this.hin = hin; } public boolean equals(Object obj) { if (null == obj) { return false; } if (!(obj instanceof jkt.hms.masters.business.BloodOpeningStockDetail)) { return false; } else { jkt.hms.masters.business.BloodOpeningStockDetail bloodOpeningStockDetail = (jkt.hms.masters.business.BloodOpeningStockDetail) obj; if (null == this.getId() || null == bloodOpeningStockDetail.getId()) { return false; } else { return (this.getId().equals(bloodOpeningStockDetail.getId())); } } } public int hashCode() { if (Integer.MIN_VALUE == this.hashCode) { if (null == this.getId()) { return super.hashCode(); } else { String hashStr = this.getClass().getName() + ":" + this.getId().hashCode(); this.hashCode = hashStr.hashCode(); } } return this.hashCode; } public String toString() { return super.toString(); } }
[ "vadhwa11@gmail.com" ]
vadhwa11@gmail.com
c328bf5523055dd8c6a6562b3886f0616f461ee7
e953930a5c841597e7d4b12e6cdce8c251395817
/parte-03/03-operadores/src/main/java/com/jornadajava/OperadorAritmetico.java
175e758561125c8f811636c48246e50b0bbf2fcd
[ "MIT" ]
permissive
igorgsousa/livro
a58110ce3d8241f6b7509913e32ec36a2c315f1e
8a04ae162b0936c2ff95bc2775100286252c9457
refs/heads/master
2022-11-17T03:22:13.677164
2020-07-22T12:40:28
2020-07-22T12:40:28
282,736,348
2
0
MIT
2020-07-26T21:29:06
2020-07-26T21:29:06
null
UTF-8
Java
false
false
191
java
package com.jornadajava; public class OperadorAritmetico { public static void main(String[] args) { int area = 3; area *= 3; System.out.println(area); } }
[ "sandrogiacom@gmail.com" ]
sandrogiacom@gmail.com
449395e37e98d342d25651fd8dd297295a6bd904
2dbbb7ff2a3f12523f5970288b5ab2eedf18bc13
/salespro/src/main/java/com/app/config/WebInitializer.java
8fa856edd8b52f5be2fdfcd04cb92de95066af43
[]
no_license
applifireAlgo/DefaultRepo
6582660a37c2c5f47cc9df2838fdacf21eb8693a
38ed513a1b33ed842be655b77d6c2b151d83d3e8
refs/heads/master
2020-12-22T02:49:43.475101
2016-06-03T13:29:34
2016-06-03T13:29:34
42,858,818
0
1
null
2016-03-10T18:11:36
2015-09-21T10:10:13
null
UTF-8
Java
false
false
5,024
java
package com.app.config; import java.util.EnumSet; import javax.servlet.FilterRegistration; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRegistration; import javax.servlet.SessionTrackingMode; import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.Configuration; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; import com.athena.config.appsetUp.model.AppConfiguration; import java.io.File; @Configuration public class WebInitializer implements WebApplicationInitializer { private final String APP_PKG = getPackage(); private final String SEARCHENGINE_HOME = getSolrHome(); @Override public void onStartup(ServletContext servletContext) throws ServletException { WebApplicationContext context = getContext(); ServletRegistration.Dynamic dispatcher = servletContext.addServlet("DispatcherServlet", new DispatcherServlet(context)); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/secure/*"); servletContext.addListener(new ContextLoaderListener(context)); servletContext.setSessionTrackingModes(EnumSet.of(SessionTrackingMode.COOKIE)); } private AnnotationConfigWebApplicationContext getContext() { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.setConfigLocation(APP_PKG); return context; } public void setSystemProperty(String propertyName, String propertyValue) { System.setProperty(propertyName, propertyValue); } public void setsearchEngineDispatcher(ServletContext servletContext) { FilterRegistration.Dynamic dynaFilterReg = servletContext.addFilter("SolrRequestFilter", "org.apache.solr.servlet.SolrDispatchFilter"); dynaFilterReg.addMappingForUrlPatterns(null, true, "/*"); } public String getsearchEngineHomeDir(ServletContext servletContext) { AppConfiguration appConfiguration = appSetup(servletContext); String searchEngineHomeDir = SEARCHENGINE_HOME; if (appConfiguration.getSearchEngineConfig().getBasePath() != null && appConfiguration.getSearchEngineConfig().getBasePath().length() > 0) { searchEngineHomeDir = appConfiguration.getSearchEngineConfig() != null && appConfiguration.getSearchEngineConfig().getBasePath() != null && appConfiguration.getSearchEngineConfig().getBasePath().length() > 0 ? appConfiguration.getSearchEngineConfig().getBasePath() : SEARCHENGINE_HOME; } return searchEngineHomeDir; } public AppConfiguration appSetup(ServletContext servletContext) { com.athena.config.app.xmlParser.AppXMLLoader appXMLLoader = null; try { appXMLLoader = new com.athena.config.app.xmlParser.AppXMLLoader(); appXMLLoader.loadAppProperties(new File(servletContext.getRealPath("/WEB-INF/conf/appConfiguration.xml"))); } catch (Exception e) { e.printStackTrace(); } return appXMLLoader.getAppConfiguration(); } public static boolean issearchEngineHomeExistOrNot(String searchEngineHome) { File file = new File(searchEngineHome); if (!file.exists()) { System.out.println("|*******************************************************************|"); System.out.println("| |"); System.out.println("| |"); System.out.println("| |"); System.out.println("| PLEASE CHECK |"); System.out.println("| searchEngine HOME NOT Exists, searchEngine WILL NOT WORK |"); System.out.println("| PATH For searchEngine HOME :" + searchEngineHome + " |"); System.out.println("| Is NOT Exists |"); System.out.println("| |"); System.out.println("| |"); System.out.println("| |"); System.out.println("|*******************************************************************|"); return false; } return true; } public String getSolrHome() { return "/home/applifire/workspace/IB2GTTAP9ZAK9QNF0QAGG/salesproSolr-4.9.0"; } public String getPackage() { return "com.app"; } }
[ "viral.patel@algorhythm.co.in" ]
viral.patel@algorhythm.co.in
4e650692b1dca084e95aa1e6233312554519f250
fae551eb54ab3a907ba13cf38aba1db288708d92
/chrome/browser/attribution_reporting/android/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionReportingProvider.java
1dc2d69176e5fed75b3e416bec8b46f65ec652aa
[ "BSD-3-Clause" ]
permissive
xtblock/chromium
d4506722fc6e4c9bc04b54921a4382165d875f9a
5fe0705b86e692c65684cdb067d9b452cc5f063f
refs/heads/main
2023-04-26T18:34:42.207215
2021-05-27T04:45:24
2021-05-27T04:45:24
371,258,442
2
1
BSD-3-Clause
2021-05-27T05:36:28
2021-05-27T05:36:28
null
UTF-8
Java
false
false
749
java
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.attribution_reporting; import org.chromium.chrome.browser.base.SplitCompatContentProvider; import org.chromium.chrome.browser.base.SplitCompatUtils; /** See {@link AttributionReportingProviderImpl}. */ public class AttributionReportingProvider extends SplitCompatContentProvider { private static final String IMPL_CLASS = "org.chromium.chrome.browser.attribution_reporting" + ".AttributionReportingProviderImpl"; public AttributionReportingProvider() { super(SplitCompatUtils.getIdentifierName(IMPL_CLASS)); } }
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
177f8958aa9bd500d57be6150d8a71a56bea089b
173ee15a41be8ad81a053716ef06a75dcf29dec1
/src/com/agile/ws/schema/project/v1/jaxws/AgileCreateBaselineRequestType.java
86593e2b36dc869ca218e6e3382abfec6e5b826f
[]
no_license
des-albert/gustFX
b0c1ca1619cf76b6617b2eea49e65bb5b437afd3
cbcf0f10cb8e62fb5dbfde89f97b84b272f7d9d5
refs/heads/master
2020-06-12T15:06:23.066047
2020-04-07T19:55:16
2020-04-07T19:55:16
194,340,150
0
0
null
null
null
null
UTF-8
Java
false
false
6,976
java
package com.agile.ws.schema.project.v1.jaxws; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.agile.ws.schema.common.v1.jaxws.PropertyListType; /** * Request object for the * 'createBaseline' operation. It contains information * about the Project Object and the name by which the new * baseline needs to be created. Baselines can only be * created on a root project. * @projectIdentifier - It is the unique Object name * which identifies an object in the Agile system, in this * case, the Root Project. @description - * It specifies the description of the baseline needs to be * created. @kickoffBaseline - It specifies * if this beaseline is a kickoff baseline. * The kickoff baseline can be used as the preliminary * version. @planOfRecord - It specifies * if this beaseline is a Plan of record. * Plan of record is a special type of baseline which you * may want to create at * major milestones during the execution of the project * @milestone - It specifies the name of the * milestone. This can be specified * only if the beaseline is a Plan of record. * * <p>Java class for AgileCreateBaselineRequestType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AgileCreateBaselineRequestType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="projectIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="kickoffBaseline" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="planOfRecord" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;element name="milestone" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="inputParameters" type="{http://xmlns.oracle.com/AgileObjects/Core/Common/V1}PropertyListType" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AgileCreateBaselineRequestType", propOrder = { "projectIdentifier", "description", "kickoffBaseline", "planOfRecord", "milestone", "inputParameters" }) public class AgileCreateBaselineRequestType { @XmlElement(required = true, nillable = true) protected String projectIdentifier; @XmlElement(required = true, nillable = true) protected String description; @XmlElement(nillable = true) protected Boolean kickoffBaseline; @XmlElement(nillable = true) protected Boolean planOfRecord; @XmlElement(nillable = true) protected String milestone; @XmlElement(nillable = true) protected List<PropertyListType> inputParameters; /** * Gets the value of the projectIdentifier property. * * @return * possible object is * {@link String } * */ public String getProjectIdentifier() { return projectIdentifier; } /** * Sets the value of the projectIdentifier property. * * @param value * allowed object is * {@link String } * */ public void setProjectIdentifier(String value) { this.projectIdentifier = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the kickoffBaseline property. * * @return * possible object is * {@link Boolean } * */ public Boolean isKickoffBaseline() { return kickoffBaseline; } /** * Sets the value of the kickoffBaseline property. * * @param value * allowed object is * {@link Boolean } * */ public void setKickoffBaseline(Boolean value) { this.kickoffBaseline = value; } /** * Gets the value of the planOfRecord property. * * @return * possible object is * {@link Boolean } * */ public Boolean isPlanOfRecord() { return planOfRecord; } /** * Sets the value of the planOfRecord property. * * @param value * allowed object is * {@link Boolean } * */ public void setPlanOfRecord(Boolean value) { this.planOfRecord = value; } /** * Gets the value of the milestone property. * * @return * possible object is * {@link String } * */ public String getMilestone() { return milestone; } /** * Sets the value of the milestone property. * * @param value * allowed object is * {@link String } * */ public void setMilestone(String value) { this.milestone = value; } /** * Gets the value of the inputParameters 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 inputParameters property. * * <p> * For example, to add a new item, do as follows: * <pre> * getInputParameters().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link PropertyListType } * * */ public List<PropertyListType> getInputParameters() { if (inputParameters == null) { inputParameters = new ArrayList<PropertyListType>(); } return this.inputParameters; } }
[ "dalbert@cray.com" ]
dalbert@cray.com
7eb072cc48671e2bc9ac230ec18247982d41cce8
f6dfb92a53472bd6980dc3cd4bb44bb5c4e9437d
/apps/SlimLauncher/src/com/slim/slimlauncher/AllAppsList.java
7f17e796acf339998518282107d0843e5d050b26
[ "Apache-2.0" ]
permissive
tuxafgmur/DhollmenK_packages
5d52da8ba58c60b7f4a0e92bf7b8818bba724d26
9a11d8225f07353ce3711f9e326b18e28c453fa5
refs/heads/master
2020-12-31T07:54:45.423581
2015-06-18T00:09:23
2015-06-18T00:09:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,133
java
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.slim.slimlauncher; import java.util.ArrayList; import java.util.List; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; /** * Stores the list of all applications for the all apps view. */ class AllAppsList { public static final int DEFAULT_APPLICATIONS_NUMBER = 42; /** The list off all apps. */ public ArrayList<AppInfo> data = new ArrayList<AppInfo>(DEFAULT_APPLICATIONS_NUMBER); /** The list of apps that have been added since the last notify() call. */ public ArrayList<AppInfo> added = new ArrayList<AppInfo>(DEFAULT_APPLICATIONS_NUMBER); /** The list of apps that have been removed since the last notify() call. */ public ArrayList<AppInfo> removed = new ArrayList<AppInfo>(); /** The list of apps that have been modified since the last notify() call. */ public ArrayList<AppInfo> modified = new ArrayList<AppInfo>(); private IconCache mIconCache; private AppFilter mAppFilter; /** * Boring constructor. */ public AllAppsList(IconCache iconCache, AppFilter appFilter) { mIconCache = iconCache; mAppFilter = appFilter; } /** * Add the supplied ApplicationInfo objects to the list, and enqueue it into the * list to broadcast when notify() is called. * * If the app is already in the list, doesn't add it. */ public void add(AppInfo info) { if (mAppFilter != null && !mAppFilter.shouldShowApp(info.componentName)) { return; } if (findActivity(data, info.componentName)) { return; } data.add(info); added.add(info); } public void clear() { data.clear(); // TODO: do we clear these too? added.clear(); removed.clear(); modified.clear(); } public int size() { return data.size(); } public AppInfo get(int index) { return data.get(index); } /** * Add the icons for the supplied apk called packageName. */ public void addPackage(Context context, String packageName) { final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName); if (matches.size() > 0) { for (ResolveInfo info : matches) { add(new AppInfo(context.getPackageManager(), info, mIconCache, null)); } } } /** * Remove the apps for the given apk identified by packageName. */ public void removePackage(String packageName) { final List<AppInfo> data = this.data; for (int i = data.size() - 1; i >= 0; i--) { AppInfo info = data.get(i); final ComponentName component = info.intent.getComponent(); if (packageName.equals(component.getPackageName())) { removed.add(info); data.remove(i); } } // This is more aggressive than it needs to be. mIconCache.flush(); } /** * Add and remove icons for this package which has been updated. */ public void updatePackage(Context context, String packageName) { final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName); if (matches.size() > 0) { // Find disabled/removed activities and remove them from data and add them // to the removed list. for (int i = data.size() - 1; i >= 0; i--) { final AppInfo applicationInfo = data.get(i); final ComponentName component = applicationInfo.intent.getComponent(); if (packageName.equals(component.getPackageName())) { if (!findActivity(matches, component)) { removed.add(applicationInfo); mIconCache.remove(component); data.remove(i); } } } // Find enabled activities and add them to the adapter // Also updates existing activities with new labels/icons int count = matches.size(); for (int i = 0; i < count; i++) { final ResolveInfo info = matches.get(i); AppInfo applicationInfo = findApplicationInfoLocked( info.activityInfo.applicationInfo.packageName, info.activityInfo.name); if (applicationInfo == null) { add(new AppInfo(context.getPackageManager(), info, mIconCache, null)); } else { mIconCache.remove(applicationInfo.componentName); mIconCache.getTitleAndIcon(applicationInfo, info, null); modified.add(applicationInfo); } } } else { // Remove all data for this package. for (int i = data.size() - 1; i >= 0; i--) { final AppInfo applicationInfo = data.get(i); final ComponentName component = applicationInfo.intent.getComponent(); if (packageName.equals(component.getPackageName())) { removed.add(applicationInfo); mIconCache.remove(component); data.remove(i); } } } } /** * Query the package manager for MAIN/LAUNCHER activities in the supplied package. */ static List<ResolveInfo> findActivitiesForPackage(Context context, String packageName) { final PackageManager packageManager = context.getPackageManager(); final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); mainIntent.setPackage(packageName); final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0); return apps != null ? apps : new ArrayList<ResolveInfo>(); } /** * Returns whether <em>apps</em> contains <em>component</em>. */ private static boolean findActivity(List<ResolveInfo> apps, ComponentName component) { final String className = component.getClassName(); for (ResolveInfo info : apps) { final ActivityInfo activityInfo = info.activityInfo; if (activityInfo.name.equals(className)) { return true; } } return false; } /** * Returns whether <em>apps</em> contains <em>component</em>. */ private static boolean findActivity(ArrayList<AppInfo> apps, ComponentName component) { final int N = apps.size(); for (int i=0; i<N; i++) { final AppInfo info = apps.get(i); if (info.componentName.equals(component)) { return true; } } return false; } /** * Find an ApplicationInfo object for the given packageName and className. */ private AppInfo findApplicationInfoLocked(String packageName, String className) { for (AppInfo info: data) { final ComponentName component = info.intent.getComponent(); if (packageName.equals(component.getPackageName()) && className.equals(component.getClassName())) { return info; } } return null; } }
[ "usuario@localhost.localdomain" ]
usuario@localhost.localdomain
b33520f32acf5943be88aa7d90c1f63e44224ad3
00626a6ff6da51326768ef8141a3244179a5ba99
/core/src/test/java/com/google/leafcoin/core/TestWithPeerGroup.java
226232f2c4d3d098b360cc17e10ffcb07497c670
[ "Apache-2.0" ]
permissive
leafcoin/leafcoinj
9b9bd7d961d6c0aa3dba78bf03465dc7c8ff3e1f
97b2e97aec3f19ff5491daaa63f7f7c7268b1135
refs/heads/master
2016-09-05T09:10:54.239577
2014-03-31T20:57:22
2014-03-31T20:57:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,441
java
/* * Copyright 2012 Matt Corallo. * * 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.leafcoin.core; import com.google.leafcoin.core.BloomFilter; import com.google.leafcoin.core.MemoryPoolMessage; import com.google.leafcoin.core.NetworkParameters; import com.google.leafcoin.core.NotFoundMessage; import com.google.leafcoin.core.Peer; import com.google.leafcoin.core.PeerGroup; import com.google.leafcoin.core.VersionAck; import com.google.leafcoin.core.VersionMessage; import com.google.leafcoin.net.BlockingClientManager; import com.google.leafcoin.net.NioClientManager; import com.google.leafcoin.params.UnitTestParams; import com.google.leafcoin.store.BlockStore; import com.google.leafcoin.utils.ExponentialBackoff; import com.google.common.base.Preconditions; import java.net.InetSocketAddress; import static com.google.common.base.Preconditions.checkArgument; import static org.junit.Assert.assertTrue; /** * Utility class that makes it easy to work with mock NetworkConnections in PeerGroups. */ public class TestWithPeerGroup extends TestWithNetworkConnections { protected static final NetworkParameters params = UnitTestParams.get(); protected PeerGroup peerGroup; protected VersionMessage remoteVersionMessage; private final ClientType clientType; public TestWithPeerGroup(ClientType clientType) { super(clientType); if (clientType != ClientType.NIO_CLIENT_MANAGER && clientType != ClientType.BLOCKING_CLIENT_MANAGER) throw new RuntimeException(); this.clientType = clientType; } public void setUp(BlockStore blockStore) throws Exception { super.setUp(blockStore); remoteVersionMessage = new VersionMessage(unitTestParams, 1); remoteVersionMessage.localServices = VersionMessage.NODE_NETWORK; remoteVersionMessage.clientVersion = NotFoundMessage.MIN_PROTOCOL_VERSION; initPeerGroup(); } protected void initPeerGroup() { if (clientType == ClientType.NIO_CLIENT_MANAGER) peerGroup = new PeerGroup(unitTestParams, blockChain, new NioClientManager()); else peerGroup = new PeerGroup(unitTestParams, blockChain, new BlockingClientManager()); peerGroup.setPingIntervalMsec(0); // Disable the pings as they just get in the way of most tests. } protected InboundMessageQueuer connectPeerWithoutVersionExchange(int id) throws Exception { Preconditions.checkArgument(id < PEER_SERVERS); InetSocketAddress remoteAddress = new InetSocketAddress("127.0.0.1", 2000 + id); Peer peer = peerGroup.connectTo(remoteAddress).getConnectionOpenFuture().get(); InboundMessageQueuer writeTarget = newPeerWriteTargetQueue.take(); writeTarget.peer = peer; return writeTarget; } protected InboundMessageQueuer connectPeer(int id) throws Exception { return connectPeer(id, remoteVersionMessage); } protected InboundMessageQueuer connectPeer(int id, VersionMessage versionMessage) throws Exception { checkArgument(versionMessage.hasBlockChain()); InboundMessageQueuer writeTarget = connectPeerWithoutVersionExchange(id); // Complete handshake with the peer - send/receive version(ack)s, receive bloom filter writeTarget.sendMessage(versionMessage); writeTarget.sendMessage(new VersionAck()); assertTrue(writeTarget.nextMessageBlocking() instanceof VersionMessage); assertTrue(writeTarget.nextMessageBlocking() instanceof VersionAck); if (versionMessage.isBloomFilteringSupported()) { assertTrue(writeTarget.nextMessageBlocking() instanceof BloomFilter); assertTrue(writeTarget.nextMessageBlocking() instanceof MemoryPoolMessage); } return writeTarget; } // handle peer discovered by PeerGroup protected InboundMessageQueuer handleConnectToPeer(int id) throws Exception { return handleConnectToPeer(id, remoteVersionMessage); } // handle peer discovered by PeerGroup protected InboundMessageQueuer handleConnectToPeer(int id, VersionMessage versionMessage) throws Exception { InboundMessageQueuer writeTarget = newPeerWriteTargetQueue.take(); checkArgument(versionMessage.hasBlockChain()); // Complete handshake with the peer - send/receive version(ack)s, receive bloom filter writeTarget.sendMessage(versionMessage); writeTarget.sendMessage(new VersionAck()); assertTrue(writeTarget.nextMessageBlocking() instanceof VersionMessage); assertTrue(writeTarget.nextMessageBlocking() instanceof VersionAck); if (versionMessage.isBloomFilteringSupported()) { assertTrue(writeTarget.nextMessageBlocking() instanceof BloomFilter); assertTrue(writeTarget.nextMessageBlocking() instanceof MemoryPoolMessage); } return writeTarget; } }
[ "root@ubuntu.(none)" ]
root@ubuntu.(none)
098031a8c7233d0bfe27c4de7a11df0688481289
8dcd6fac592760c5bff55349ffb2d7ce39d485cc
/org/apache/http/auth/MalformedChallengeException.java
214f4c2d601c4a3811587b8cd58e767cfe9a67b3
[]
no_license
andrepcg/hikam-android
9e3a02e0ba9a58cf8a17c5e76e2f3435969e4b3a
bf39e345a827c6498052d9df88ca58d8823178d9
refs/heads/master
2021-09-01T11:41:10.726066
2017-12-26T19:04:42
2017-12-26T19:04:42
115,447,829
2
2
null
null
null
null
UTF-8
Java
false
false
486
java
package org.apache.http.auth; import org.apache.http.ProtocolException; @Deprecated public class MalformedChallengeException extends ProtocolException { public MalformedChallengeException() { throw new RuntimeException("Stub!"); } public MalformedChallengeException(String message) { throw new RuntimeException("Stub!"); } public MalformedChallengeException(String message, Throwable cause) { throw new RuntimeException("Stub!"); } }
[ "andrepcg@gmail.com" ]
andrepcg@gmail.com
524ddbeeda9d90b8dd5ef1740829907d8abee5ea
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_1/src/g/j/f/Calc_1_1_6951.java
e723e7d61e693c211a5461164e5e8ce33732bc86
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
131
java
package g.j.f; public class Calc_1_1_6951 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
53fa3bd154e0c4325fcc2834b90c081c0e738ef6
aedb97ef89a833a168f0592c61117a3e582d22a0
/test/net/ion/nsearcher/index/WriterThread.java
114d03bfe7d470511d9bf6a819b3f263061ff781
[]
no_license
bleujin/ISearcher
ba78f6c92d0555faeda4cc236b31c616c6e63d62
7f44759dadb4c95176aab2972f949288771013c3
refs/heads/master
2021-01-17T11:39:59.535374
2017-12-29T16:10:22
2017-12-29T16:10:22
4,710,187
0
3
null
null
null
null
UTF-8
Java
false
false
1,270
java
package net.ion.nsearcher.index; import java.io.IOException; import net.ion.nsearcher.common.WriteDocument; import net.ion.nsearcher.index.channel.RelayChannel; import net.ion.nsearcher.index.policy.IWritePolicy; public class WriterThread extends Thread { private IndexSession isession; private IWritePolicy policy ; private RelayChannel<WriteDocument> channel; public WriterThread(String name, RelayChannel<WriteDocument> channel, IWritePolicy policy, IndexSession isession) { super(name); this.channel = channel; this.policy = policy ; this.isession = isession; } public void run() { try { isession.begin(this.getClass().getName()) ; getPolicy().begin(isession) ; while (true) { if (channel.isEndMessageOccured() && (!channel.hasMessage())) break; try { WriteDocument doc = channel.pollMessage(); getPolicy().apply(isession, doc) ; } catch (IOException ignore) { ignore.printStackTrace(); } } isession.commit() ; } catch(IOException ex){ ex.printStackTrace() ; isession.rollback() ; } finally { getPolicy().end(isession) ; isession.end(); } } private IWritePolicy getPolicy(){ return this.policy ; } }
[ "bleujin@gmail.com" ]
bleujin@gmail.com
ada99e50c53360483267afe0090d0b260e6000cd
40c035bac5965eba16d4db85f4d0aefd879c7604
/Editor/src/com/kotcrab/vis/editor/scene/EditorScene.java
422eef03c0b4c15e9ddfb8085561c212fe6312a4
[ "Apache-2.0" ]
permissive
code-disaster/VisEditor
072543cda829b5a6df429e3981c7e541347c60be
cb640cb483c4e301c82c9d23afffd7adade11805
refs/heads/master
2020-12-03T10:39:28.092095
2015-08-09T14:17:20
2015-08-09T14:17:20
36,494,916
0
0
null
2015-05-29T09:34:12
2015-05-29T09:34:11
null
UTF-8
Java
false
false
5,234
java
/* * Copyright 2014-2015 See AUTHORS file. * * 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.kotcrab.vis.editor.scene; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.IntMap; import com.esotericsoftware.kryo.serializers.TaggedFieldSerializer.Tag; import com.kotcrab.vis.editor.entity.EntityScheme; import com.kotcrab.vis.editor.util.BaseObservable; import com.kotcrab.vis.runtime.scene.SceneViewport; import com.kotcrab.vis.runtime.util.ImmutableArray; import java.util.Comparator; /** * Editor scene class, serialized by Kryo * @author Kotcrab */ public class EditorScene extends BaseObservable { public static final int ACTIVE_LAYER_CHANGED = 0; public static final int LAYER_ADDED = 1; public static final int LAYER_INSERTED = 2; public static final int LAYER_REMOVED = 3; public static final int LAYERS_SORTED = 4; public static final int LAYER_DATA_CHANGED = 5; private static final Comparator<Layer> LAYER_COMPARATOR = (o1, o2) -> (int) Math.signum(o1.id - o2.id); /** Scene file, path is relative to project Vis folder */ @Tag(0) public String path; @Tag(1) public float width; @Tag(2) public float height; @Tag(7) public float pixelsPerUnit; //this value is float to avoid calculations problems @Tag(3) public SceneViewport viewport; @Tag(4) private Array<Layer> layers = new Array<>(); @Tag(5) private int activeLayerId; @Tag(8) private IntMap<String> groupIds = new IntMap<>(); @Tag(6) private Array<EntityScheme> schemes; //for serialization //last tag is 8 public EditorScene (FileHandle file, SceneViewport viewport, float width, float height, int pixelsPerUnit) { if (width < 0 || height < 0) throw new IllegalArgumentException("Invalid scene size"); if (pixelsPerUnit <= 0) throw new IllegalArgumentException("Pixels per units cannot be smaller or equal zero"); this.path = file.path(); this.viewport = viewport; this.width = width; this.height = height; this.pixelsPerUnit = pixelsPerUnit; layers.add(new Layer("Background", 0)); schemes = new Array<>(); } @Override public void onDeserialize () { super.onDeserialize(); forceSortLayers(); } public void setSchemes (Array<EntityScheme> schemes) { this.schemes = schemes; } /** Returns entity schemes for this scene. Warning: if scene is currently opened in editor this list will be outdated if scene is dirty */ public Array<EntityScheme> getSchemes () { return schemes; } public FileHandle getFile () { return Gdx.files.absolute(path); } public String getGroupStringId (int id) { return groupIds.get(id, ""); } public void setGroupStringId (int id, String stringId) { if (stringId.equals("")) return; groupIds.put(id, stringId); } public IntMap<String> getGroups () { return groupIds; } public Layer getActiveLayer () { for (Layer layer : layers) { if (layer.id == activeLayerId) return layer; } throw new IllegalStateException("No active layer"); } public int getActiveLayerId () { return activeLayerId; } public boolean setActiveLayer (int layerId) { if (this.activeLayerId != layerId) { this.activeLayerId = layerId; postNotification(ACTIVE_LAYER_CHANGED); return true; } return false; } public Layer getLayerById (int id) { for (Layer layer : layers) { if (layer.id == id) return layer; } return null; } public Layer getLayerByName (String name) { for (Layer layer : layers) { if (layer.name.equals(name)) return layer; } return null; } public ImmutableArray<Layer> getLayers () { return new ImmutableArray<>(layers); } public Layer addLayer (String name) { Layer layer = new Layer(name, getFreeLayerID()); layers.add(layer); layers.sort(LAYER_COMPARATOR); postNotification(LAYER_ADDED); return layer; } public void insertLayer (Layer layer) { if (isLayerIdUsed(layer.id)) throw new IllegalStateException("Layer with this id already exist!"); layers.add(layer); layers.sort(LAYER_COMPARATOR); postNotification(LAYER_INSERTED); } public boolean removeLayer (Layer layer) { boolean result = layers.removeValue(layer, true); layers.sort(LAYER_COMPARATOR); if (layer.id == activeLayerId) activeLayerId = layers.first().id; postNotification(LAYER_REMOVED); return result; } public void forceSortLayers () { layers.sort(LAYER_COMPARATOR); postNotification(LAYERS_SORTED); } private int getFreeLayerID () { int freeID = 0; while (isLayerIdUsed(freeID)) { freeID++; } return freeID; } private boolean isLayerIdUsed (int id) { for (Layer layer : layers) { if (layer.id == id) return true; } return false; } }
[ "kotcrab@gmail.com" ]
kotcrab@gmail.com
79d09e80e1ea438ad6fe5262382d4fe969b94d8b
d7494dd4043a6c844830a9843330897b5fefcd21
/benchmark-applications/reiminfer-oopsla-2012/source/ejc/src/org/eclipse/jdt/internal/compiler/lookup/SignatureWrapper.java
acef92e98a0634808a9021f9dce3a5c1a54d59ff
[ "MIT" ]
permissive
terminiter/immutability-benchmark
bae71185e4527005d3886f67e6f11364198e8ecd
28931bd5720e671c68f3b3abf0869f83f5543b75
refs/heads/master
2021-01-22T17:53:09.644370
2016-12-14T21:36:19
2016-12-14T21:36:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,363
java
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.compiler.lookup; //import checkers.inference.ownership.quals.*;; import org.eclipse.jdt.core.compiler.CharOperation; public class SignatureWrapper { public char[] signature; public int start; public int end; public int bracket; public SignatureWrapper(char[] signature) { this.signature = signature; this.start = 0; this.end = this.bracket = -1; } public boolean atEnd() { return this.start < 0 || this.start >= this.signature.length; } public int computeEnd() { int index = this.start; while (this.signature[index] == '[') index++; switch (this.signature[index]) { case 'L' : case 'T' : this.end = CharOperation.indexOf(';', this.signature, this.start); if (this.bracket <= this.start) // already know it if its > start this.bracket = CharOperation.indexOf('<', this.signature, this.start); if (this.bracket > this.start && this.bracket < this.end) this.end = this.bracket; else if (this.end == -1) this.end = this.signature.length + 1; break; default : this.end = this.start; } this.start = this.end + 1; // skip ';' return this.end; } public char[] nextWord() { this.end = CharOperation.indexOf(';', this.signature, this.start); if (this.bracket <= this.start) // already know it if its > start this.bracket = CharOperation.indexOf('<', this.signature, this.start); int dot = CharOperation.indexOf('.', this.signature, this.start); if (this.bracket > this.start && this.bracket < this.end) this.end = this.bracket; if (dot > this.start && dot < this.end) this.end = dot; return CharOperation.subarray(this.signature, this.start, this.start = this.end); // skip word } public String toString() { return new String(this.signature) + " @ " + this.start; //$NON-NLS-1$ } }
[ "benjholla@gmail.com" ]
benjholla@gmail.com
d106125d81fba59f8bb89741ba661baae786df24
4b1c7b9d106344d9a30973219dfeff9060bd2ad0
/ngap/src/main/java/tr/havelsan/ueransim/ngap0/ies/bit_strings/NGAP_AMFPointer.java
eea7aba0dfaf19849160b025ac9216f4da48203c
[ "MIT" ]
permissive
kensinxie/UERANSIM
6384a17114e8a9ceb8bd94461edb5a393e39aba2
2c39c8f6895bc5bb60944797e7bcd50f7ff7011b
refs/heads/master
2022-12-07T13:41:28.552550
2020-09-07T13:54:15
2020-09-07T13:54:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,827
java
/* * MIT License * * Copyright (c) 2020 ALİ GÜNGÖR * * 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 tr.havelsan.ueransim.ngap0.ies.bit_strings; import tr.havelsan.ueransim.ngap0.core.*; import tr.havelsan.ueransim.ngap0.pdu.*; import tr.havelsan.ueransim.utils.bits.*; import tr.havelsan.ueransim.utils.octets.*; import tr.havelsan.ueransim.ngap0.ies.bit_strings.*; import tr.havelsan.ueransim.ngap0.ies.octet_strings.*; import tr.havelsan.ueransim.ngap0.ies.printable_strings.*; import tr.havelsan.ueransim.ngap0.ies.sequences.*; import tr.havelsan.ueransim.ngap0.ies.sequence_ofs.*; import tr.havelsan.ueransim.ngap0.ies.choices.*; import tr.havelsan.ueransim.ngap0.ies.integers.*; import tr.havelsan.ueransim.ngap0.ies.enumerations.*; import java.util.List; public class NGAP_AMFPointer extends NGAP_BitString { public NGAP_AMFPointer(BitString value) { super(value); } public NGAP_AMFPointer(OctetString octetString, int bitLength) { super(octetString, bitLength); } public NGAP_AMFPointer(OctetString octetString) { super(octetString); } public NGAP_AMFPointer(Octet[] octets, int bitLength) { super(octets, bitLength); } public NGAP_AMFPointer(Octet[] octets) { super(octets); } public NGAP_AMFPointer(byte[] octets, int bitLength) { super(octets, bitLength); } public NGAP_AMFPointer(byte[] octets) { super(octets); } public NGAP_AMFPointer(String hex, int bitLength) { super(hex, bitLength); } public NGAP_AMFPointer(String bits) { super(bits); } @Override public String getAsnName() { return "AMFPointer"; } @Override public String getXmlTagName() { return "AMFPointer"; } }
[ "aligng1620@gmail.com" ]
aligng1620@gmail.com
00117eb808585ad1c9cdad17b22a520a392d8bbe
e51de484e96efdf743a742de1e91bce67f555f99
/Android/triviacrack_src/src/com/etermax/gamescommon/b/af.java
b9f413d090bf11678e60490ea2f76ba98447c82c
[]
no_license
adumbgreen/TriviaCrap
b21e220e875f417c9939f192f763b1dcbb716c69
beed6340ec5a1611caeff86918f107ed6807d751
refs/heads/master
2021-03-27T19:24:22.401241
2015-07-12T01:28:39
2015-07-12T01:28:39
28,071,899
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.etermax.gamescommon.b; // Referenced classes of package com.etermax.gamescommon.b: // l public class af extends l { public af(String s) { e("login_fb_ok"); a("result", s); } }
[ "klayderpus@chimble.net" ]
klayderpus@chimble.net
e8d822000112c77b60a14bb43b69fcff472c03bb
42786befcc2abf65082812618f1bb8596c7fb7e4
/src/main/java/jpuppeteer/cdp/client/entity/target/AttachToBrowserTargetResponse.java
0f01950e349ef2e690ffc3deeebd0896a7f7db7c
[ "Apache-2.0" ]
permissive
sunshinex/jpuppeteer
3e30fcd434d7ddedabd0d9eeb35620707cd5bd87
0b60d1800e31decf309311671ee5f9262ea22ca5
refs/heads/2.0
2023-07-20T14:27:19.565745
2023-07-12T17:32:48
2023-07-12T17:32:48
203,903,640
33
7
Apache-2.0
2023-07-12T17:34:26
2019-08-23T01:49:32
Java
UTF-8
Java
false
false
502
java
package jpuppeteer.cdp.client.entity.target; /** */ public class AttachToBrowserTargetResponse { /** * Id assigned to the session. */ private String sessionId; public void setSessionId (String sessionId) { this.sessionId = sessionId; } public String getSessionId() { return this.sessionId; } public AttachToBrowserTargetResponse(String sessionId) { this.sessionId = sessionId; } public AttachToBrowserTargetResponse() { } }
[ "jarvis.xu@vipshop.com" ]
jarvis.xu@vipshop.com
d6973b0c92683369d11c63492f552ce2e0dc52d1
868bf400c0143e6a13c9dc2804726449816e4b68
/LintCode-master/Java/215. Kth Largest Element in an Array.java
8241e62845d559eb6234912746932ea61f6e86e9
[]
no_license
EngrDevDom/Java-Codes
7d39efd8fc7f5d9589c34f98adaa71fc923308b9
ab6934cbe5a3e0330b64cca53738180675a1f74a
refs/heads/master
2022-12-02T08:14:58.380076
2020-08-11T16:02:18
2020-08-11T16:02:18
286,783,520
1
0
null
null
null
null
UTF-8
Java
false
false
3,163
java
M tags: Divide and Conquer, Heap, PriorityQueue, MinHeap, Quick Sort, Quick Select time: O(nlogk) space: O(k) kth largest in array #### PriorityQueue, MinHeap - Use minHeap to maintain PQ of k size and return PQ.peek() - Maintain MinHeap: only allow larger elements (which will squzze out the min value) - Remove peek() of queue if over size - O(nlogk) #### Quick Select, Quick Sort - 用Quick Sort 里面partion的一部分: sort结束后是ascending的. - kth largest = (n - k)th smallest - in partioned array (quick sort), the portion before pivot are less than pivot - that is, the `pivot value` is the divider: anything after pivot is larger than it. - after `swap(nums, low, pivot)`: index low has the (n-k)th smallest, if `low = n-k` - Steps: - each iteration: pick pivot,然后从low,和high都和pivot作比较 - Find `low>pivot, high<pivot` to swap - The new low is the next partion point - Time: average O(n), worst case O(n^2) - space: O(1) extra spaces besides recursive stack ``` /** Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 1: Input: [3,2,1,5,6,4] and k = 2 Output: 5 Example 2: Input: [3,2,3,1,2,4,5,5,6] and k = 4 Output: 4 Note: You may assume k is always valid, 1 ≤ k ≤ array's length. */ /* sort O(nlogn). Better O(n) use a min-heap with size k, so min item will always be at top to be removed O(logk) Overall runtime O(nlogk) */ class Solution { public int findKthLargest(int[] nums, int k) { if (nums == null || nums.length == 0) return -1; PriorityQueue<Integer> queue = new PriorityQueue<>(); // min-heap for (int i = 0; i < nums.length; i++) { if (i < k || nums[i] > queue.peek()) queue.offer(nums[i]); if (queue.size() > k) queue.poll(); } return queue.poll(); } } /* - Quick sort/ partition - Partition to return the `low` index, which should match targetIndex. */ class Solution { public int findKthLargest(int[] nums, int k) { int n = nums.length; return partition(nums, 0, n - 1, n - k); } private int partition (int[] nums, int start, int end, int targetIndex) { // define low/high int pivot = end; int low = start, high = end, pivotNum = nums[pivot]; // move pointer and swap while (low < high) { while (low < high && nums[low] < pivotNum) low++; // break when nums[low] >= pivotNum while (low < high && nums[high] >= pivotNum) high--; // break when nums[high] < pivotNum swap(nums, low, high); } swap(nums, low, pivot); // compare if low == targetIndex; or recursively partition to find targetIndex if (low == targetIndex) return nums[low]; else if (low < targetIndex) return partition(nums, low + 1, end, targetIndex); return partition(nums, start, low - 1, targetIndex); } private void swap(int[] nums, int x, int y) { int temp = nums[x]; nums[x] = nums[y]; nums[y] = temp; } } ```
[ "60880034+EngrDevDom@users.noreply.github.com" ]
60880034+EngrDevDom@users.noreply.github.com
89b4d831b6d4218394be23091bbbc3cd22f0f662
4aae34d37572688d34c224e6b812ef4a3b633b55
/LTISystem/WEB-INF/src/com/lti/compiledstrategy/Andrew_Tobias__Three_Fund_Lazy_Portfolio263.java
bd48ed12d7c7ac85a3ec791c1e38444e457d2b81
[]
no_license
cpedia/xjany-jee-1
9300eabfc263e1f3a4346fccdceaed5c3b606f6d
2a9791b248c4f58c8113dbff2d32b8023244a0ec
refs/heads/master
2016-08-11T14:58:30.434979
2013-04-11T03:22:40
2013-04-11T03:22:40
55,684,098
0
1
null
null
null
null
UTF-8
Java
false
false
3,777
java
package com.lti.compiledstrategy; import com.lti.Exception.Security.NoPriceException; import com.lti.Exception.Strategy.ParameterException; import com.lti.Exception.Strategy.VariableException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.math.*; import com.lti.service.bo.*; import java.util.*; import com.lti.type.*; import com.lti.type.finance.*; import com.lti.type.executor.*; import com.lti.util.*; import com.tictactec.ta.lib.*; import com.lti.util.simulator.ParameterUtil; @SuppressWarnings({ "deprecation", "unused" }) public class Andrew_Tobias__Three_Fund_Lazy_Portfolio263 extends SimulateStrategy{ public Andrew_Tobias__Three_Fund_Lazy_Portfolio263(){ super(); StrategyID=263L; StrategyClassID=3L; } //---------------------------------------------------- //parameters //---------------------------------------------------- @SuppressWarnings("deprecation") public void fetchParameters()throws ParameterException{ Map<String,String> parameters=SimulateParameters; //curAsset=parameters.get("curAsset"); } //---------------------------------------------------- //variables //---------------------------------------------------- public String getVariables(){ StringBuffer sb=new StringBuffer(); return sb.toString(); } public void writeObject(ObjectOutputStream stream) throws IOException{ } public void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException{ } //---------------------------------------------------- //user defined functions //---------------------------------------------------- //---------------------------------------------------- //initialize code //---------------------------------------------------- @SuppressWarnings({ "deprecation", "unchecked" }) public void init() throws Exception{ Asset CurrentAsset; double TotalAmount = CurrentPortfolio.getTotalAmount(CurrentDate); CurrentPortfolio.sellAssetCollection(CurrentDate); CurrentAsset = new Asset(); CurrentAsset.setAssetStrategyID(getStrategyID("STATIC")); CurrentAsset.setName("1"); CurrentAsset.setClassID(getAssetClassID("US Equity")); CurrentAsset.setTargetPercentage(0.33); CurrentPortfolio.addAsset(CurrentAsset); CurrentPortfolio.buy(CurrentAsset.getName(), "VTSMX", TotalAmount * 0.33, CurrentDate); CurrentAsset = new Asset(); CurrentAsset.setAssetStrategyID(getStrategyID("STATIC")); CurrentAsset.setName("2"); CurrentAsset.setClassID(getAssetClassID("INTERNATIONAL Equity")); CurrentAsset.setTargetPercentage(0.33); CurrentPortfolio.addAsset(CurrentAsset); CurrentPortfolio.buy(CurrentAsset.getName(), "VGTSX", TotalAmount * 0.33, CurrentDate); CurrentAsset = new Asset(); CurrentAsset.setAssetStrategyID(getStrategyID("STATIC")); CurrentAsset.setName("3"); CurrentAsset.setClassID(getAssetClassID("US BONDS")); CurrentAsset.setTargetPercentage(0.33); CurrentPortfolio.addAsset(CurrentAsset); CurrentPortfolio.buy(CurrentAsset.getName(), "VIPSX", TotalAmount * 0.33, CurrentDate); } //---------------------------------------------------- //re-initialize code //---------------------------------------------------- @SuppressWarnings({ "deprecation", "unchecked" }) public void reinit() throws Exception{ } //---------------------------------------------------- //action code //---------------------------------------------------- @SuppressWarnings({ "deprecation", "unchecked" }) public void action() throws Exception{ if(new Boolean(true).equals(false)){ } else{ ; } } public double getVersion(){ return version; } } //
[ "xjany.p@gmail.com" ]
xjany.p@gmail.com
21c1beb6cf1339384cdceedef4fbeba493c06ae1
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/22/508.java
7c179020449fa19a23b9425b46ce39784a0e52fc
[ "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
1,351
java
package <missing>; public class GlobalMembers { public static int Main() { int[] a = new int[300]; String c = new String(new char[300]); int num = 0; int i; int j; int flag = 0; int t; for (i = 0;i < 300;i++) { String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { a[i] = Integer.parseInt(tempVar); } String tempVar2 = ConsoleInput.scanfRead(null, 1); if (tempVar2 != null) { c = tangible.StringFunctions.changeCharacter(c, i, tempVar2); } if (c.charAt(i) == ',') { num++; } else { break; } } num = num + 1; if (num == 1) { System.out.print("No\n"); //C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java: goto end; } for (i = 0;i < num;i++) { if (a[i] != a[0]) { flag = 1; break; } } if (flag == 0) { System.out.print("No\n"); //C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java: goto end; } for (i = 1;i < num;i++) { for (j = 0;j < num - i;j++) { if (a[j] < a[j + 1]) { t = a[j]; a[j] = a[j + 1]; a[j + 1] = t; } } } for (i = 1;i < num;i++) { if (a[i] != a[0]) { System.out.printf("%d\n",a[i]); break; } } //C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java: end: return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
b809e0749dfb45b019b30847b8d7b8915fb0a26a
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/LANG-57b-1-4-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/apache/commons/lang/LocaleUtils_ESTest.java
14298b29b2c2622140dbda9d08bc5ed24a5f9b57
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
/* * This file was automatically generated by EvoSuite * Tue Jan 21 20:14:00 UTC 2020 */ package org.apache.commons.lang; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class LocaleUtils_ESTest extends LocaleUtils_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
2e718a564cd7b0039330d3910b15853c57740d6a
7b82d70ba5fef677d83879dfeab859d17f4809aa
/tmp/sys/Oracle-MySQL-Jdbc/src/test/java/cn/kiwipeach/oracle/test/OracleUtilTest.java
9222c9e9e5e7d9476611dcec580c95f7229ae401
[ "Apache-2.0" ]
permissive
apollowesley/jun_test
fb962a28b6384c4097c7a8087a53878188db2ebc
c7a4600c3f0e1b045280eaf3464b64e908d2f0a2
refs/heads/main
2022-12-30T20:47:36.637165
2020-10-13T18:10:46
2020-10-13T18:10:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,128
java
package cn.kiwipeach.oracle.test; import cn.kiwipeach.bean.Employ; import cn.kiwipeach.util.DBTools; import oracle.sql.ROWID; import org.junit.Before; import org.junit.Test; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.List; /** * Created by liuburu on 2017/6/6. */ public class OracleUtilTest { /** * 初始化数据源 */ @Before public void beforeTest() { //默认将使用datasource.properties配置文件 DBTools.initDataSource(null); } @Test public void testQueryByPrimaryKey() { String sql = "SELECT * FROM emp WHERE empno = ?"; Employ employ = DBTools.queryByPrimaryKey(Employ.class, sql, "7777"); System.out.println(employ); /** console result: Employ{empno=7777, ename='卡卡罗特', job='程序员', mgr=7902, hireDate=Wed Dec 17 00:00:00 CST 1980, sal=0.0, comm=0.0, deptno=20} */ } @Test public void testQuery() { String sql = "SELECT * FROM emp"; List<Employ> employs = DBTools.queryList(Employ.class, sql); for (Employ employ : employs) { System.out.println(employ); } /** * console result: Employ{empno=7698, ename='BLAKE', job='MANAGER', mgr=7839, hireDate=Fri May 01 00:00:00 CST 1981, sal=2850.0, comm=0.0, deptno=30} Employ{empno=7782, ename='CLARK', job='MANAGER', mgr=7839, hireDate=Tue Jun 09 00:00:00 CST 1981, sal=2450.0, comm=0.0, deptno=10} Employ{empno=7839, ename='KING', job='PRESIDENT', mgr=0, hireDate=Tue Nov 17 00:00:00 CST 1981, sal=5000.0, comm=0.0, deptno=10} Employ{empno=7844, ename='TURNER', job='SALESMAN', mgr=7698, hireDate=Tue Sep 08 00:00:00 CST 1981, sal=1500.0, comm=0.0, deptno=30} Employ{empno=7900, ename='JAMES', job='CLERK', mgr=7698, hireDate=Thu Dec 03 00:00:00 CST 1981, sal=950.0, comm=0.0, deptno=30} Employ{empno=7902, ename='FORD', job='ANALYST', mgr=7566, hireDate=Thu Dec 03 00:00:00 CST 1981, sal=3000.0, comm=0.0, deptno=20} Employ{empno=7934, ename='MILLER', job='CLERK', mgr=7782, hireDate=Sat Jan 23 00:00:00 CST 1982, sal=1300.0, comm=0.0, deptno=10} */ } @Test public void testInsert() throws ParseException { Connection connection = DBTools.getConnection(); String sql = "INSERT INTO emp(empno,ename,job,mgr,sal,hiredate,comm,deptno) VALUES(?,?,?,?,?,?,?,?)"; java.util.Date myBirthday = new SimpleDateFormat("yyyy/MM/dd").parse("1994/11/12"); Object[] paramArgs = new Object[]{4444, "猕猴桃", "SALESMAN", 7902, 5000, new java.sql.Date(myBirthday.getTime()), 1600.00, 20}; int insertRow = DBTools.update(connection, sql, paramArgs); System.out.println(insertRow > 0 ? "插入成功!" : "插入失败"); /** console result: 插入成功! */ } @Test public void testUpdate() { String sql = "UPDATE emp SET sal=? WHERE empno = ?"; Connection connection = DBTools.getConnection(); Object[] paramArgs = new Object[]{"4000", 4444}; int insertRow = DBTools.update(connection, sql, paramArgs); System.out.println(insertRow > 0 ? "更新成功!" : "更新失败"); /** console result: 更新成功! */ } @Test public void testRemove() { String sql = "DELETE FROM emp WHERE empno = ?"; Connection connection = DBTools.getConnection(); Object[] paramArgs = new Object[]{4444}; int insertRow = DBTools.update(connection, sql, paramArgs); System.out.println(insertRow > 0 ? "删除成功!" : "删除失败"); /** console result: 删除成功! */ } /** * 获取统计值或者字段值 */ @Test public void testGetValue() { String sql = "SELECT COUNT(1) FROM emp WHERE deptno = ?"; Object result = DBTools.getValue(sql, 20); System.out.println("部门deptno=20的人员有? " + result + "个"); } /** * 插入同时获取主键值 */ @Test public void testGetPrimaryKey() throws ParseException { String sql = "INSERT INTO emp(empno,ename,job,mgr,sal,hiredate,comm,deptno) VALUES(?,?,?,?,?,?,?,?)"; java.util.Date myBirthday = new SimpleDateFormat("yyyy/MM/dd").parse("1994/11/12"); Object[] paramArgs = new Object[]{4444, "猕猴桃", "SALESMAN", 7902, 5000, new java.sql.Date(myBirthday.getTime()), 1600.00, 20}; Connection connection = DBTools.getConnection(); ROWID keyValue = (ROWID) DBTools.insert(connection, sql, paramArgs); System.out.println("返回主键值:" + keyValue.stringValue()); /** 返回主键值:AAAWCWAARAAAACWAAB(与oracle的rowid一致) */ } @Test public void testTransaction() { String sql1 = "INSERT INTO emp(empno,ename,job) VALUES(?,?,?)"; String sql2 = "INSERT INTO emp(empno,ename,job) VALUES(?,?,?)"; Connection connection = DBTools.getConnection(); DBTools.beginTransaction(connection); int resultRow1 = DBTools.update(connection, sql1, 1001, "xiaoming", "SALESMAN"); int resultRow2 = DBTools.update(connection, sql2, 1002, "xiaohong", "SALESMAN"); System.out.println("insertRow1:" + resultRow1); System.out.println("insertRow2:" + resultRow2); DBTools.rollback(connection);//回滚事务 //DBTools.commit(connection);//提交事务 } /** * 批量插入数据操作 * * @throws SQLException */ @Test public void batchInsert() throws SQLException { long beginTime = System.currentTimeMillis(); Connection connection = DBTools.getConnection(); String sql = "insert into emp(empno,ename,job) values(?,?,?)"; DBTools.beginTransaction(connection); try { PreparedStatement preparedStatement = connection.prepareStatement(sql); //批量插入9万条数据 for (int i = 10000; i < 100000; i++) { preparedStatement.setObject(1, i); preparedStatement.setObject(2, "u"+i); preparedStatement.setObject(3, "r"+i); preparedStatement.addBatch(); if (i % 100 == 0) { System.out.println("已经执行到:"+i); preparedStatement.executeBatch(); preparedStatement.clearBatch(); } } preparedStatement.executeBatch(); preparedStatement.clearBatch(); DBTools.commit(connection); } catch (SQLException e) { e.printStackTrace(); DBTools.rollback(connection); } connection.close(); long endTime = System.currentTimeMillis(); System.out.println("耗时:"+(endTime-beginTime)/1000+"秒"); /** console result: 耗时:3秒 */ } }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
90b85d0fcc3606d98f5a4517af506ba44c2f13e4
bc6b0667dd76713e535598e4c66a28467ee08cd9
/src/chapter7/shapes/CalculateCircleArea.java
4c5bd84caa6f7f14dcb06e99c0d88299e3372182
[ "MIT" ]
permissive
VladimirMetodiev/JavaByH.Schildt
b166b81f60581774d0d5cba7e8be54d7762cf024
c19e309a2fd10595b60685ab2991bf8b69ebd7da
refs/heads/main
2023-06-01T05:29:54.984195
2021-07-11T12:17:02
2021-07-11T12:17:02
343,064,763
0
0
null
null
null
null
UTF-8
Java
false
false
516
java
package chapter7.shapes; import java.util.Locale; import java.util.Scanner; public class CalculateCircleArea { public static void main(String[] args) { Scanner input = new Scanner(System.in); input.useLocale(Locale.US); System.out.println("Enter radius:"); Circle circle = new Circle(input.nextDouble()); circle.displayDimension(); circle.displayArea(); } } //Tests //5 //Radius = 5,00 //Circle area = 78,54 //8 //Radius = 8,00 //Circle area = 201,06
[ "iarilomail@gmail.com" ]
iarilomail@gmail.com
0496c7d12ecbfad90325a3b34646587bf409b0de
c85c460e7c7410e66aec5d2b1c5b44467a320d58
/src/test/java/com/alibaba/druid/bvt/sql/oracle/OracleSelectTest8.java
8475498fcf03dc7be787e328ed4b6551cd80f531
[]
no_license
Pengxiaolong/druid
f51900708114a34872b79a397a254344f066bb54
cc6956c7df7c2037d8d2169cea068444b20f7d5d
refs/heads/master
2020-12-25T17:03:11.640854
2012-08-18T14:28:42
2012-08-18T14:28:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package com.alibaba.druid.bvt.sql.oracle; import java.util.List; import junit.framework.Assert; import com.alibaba.druid.sql.OracleTest; import com.alibaba.druid.sql.ast.SQLStatement; import com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser; import com.alibaba.druid.sql.dialect.oracle.visitor.OracleSchemaStatVisitor; import com.alibaba.druid.stat.TableStat; public class OracleSelectTest8 extends OracleTest { public void test_0() throws Exception { String sql = "SELECT d.department_id, e.last_name" + // " FROM departments d, employees e" + // " WHERE d.department_id = e.department_id(+)" + // " ORDER BY d.department_id, e.last_name;"; OracleStatementParser parser = new OracleStatementParser(sql); List<SQLStatement> statementList = parser.parseStatementList(); SQLStatement statemen = statementList.get(0); print(statementList); Assert.assertEquals(1, statementList.size()); OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor(); statemen.accept(visitor); System.out.println("Tables : " + visitor.getTables()); System.out.println("fields : " + visitor.getColumns()); System.out.println("coditions : " + visitor.getConditions()); System.out.println("relationships : " + visitor.getRelationships()); System.out.println("orderBy : " + visitor.getOrderByColumns()); Assert.assertEquals(2, visitor.getTables().size()); Assert.assertTrue(visitor.getTables().containsKey(new TableStat.Name("departments"))); Assert.assertTrue(visitor.getTables().containsKey(new TableStat.Name("employees"))); Assert.assertEquals(3, visitor.getColumns().size()); Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("departments", "department_id"))); Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("employees", "department_id"))); Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("employees", "last_name"))); } }
[ "xiusiyan@gmail.com" ]
xiusiyan@gmail.com
0b29a61b99f1d02e2c2fc2b4b49b4f101e4fc3db
7662454b8c6345c74bfa426f109e42c19b9cd421
/src/main/java/de/weltraumschaf/registermachine/instr/Test.java
b2d64b0ed2ab58dea91127af449a256432da9559
[ "Beerware" ]
permissive
Weltraumschaf/registermachine
d1701f56178b5204c49a596c2302514f7ae7f7e2
d3ff10219585497275dc5ed7c64d0c0803d9699a
refs/heads/master
2021-01-01T19:52:30.417447
2013-02-17T19:52:53
2013-02-17T19:52:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,307
java
/* * LICENSE * * "THE BEER-WARE LICENSE" (Revision 43): * "Sven Strittmatter" <weltraumschaf@googlemail.com> wrote this file. * As long as you retain this notice you can do whatever you want with * this stuff. If we meet some day, and you think this stuff is worth it, * you can buy me a non alcohol-free beer in return. * * Copyright (C) 2012 "Sven Strittmatter" <weltraumschaf@googlemail.com> */ package de.weltraumschaf.registermachine.instr; import de.weltraumschaf.registermachine.vm.RuntimeConfiguration; /** * * @author Sven Strittmatter <weltraumschaf@googlemail.com> */ public class Test implements Instruction { /** * Register to test. */ private final int testReg; /** * Register with address to jump to. */ private final int jumpReg; public Test(int testReg, int jumpReg) { super(); this.testReg = testReg; this.jumpReg = jumpReg; } @Override public void evaluate(RuntimeConfiguration config) { if (config.getRegister(testReg).getBooleanValue()) { config.setProgramCounter(config.getRegister(jumpReg).getIntegerValue()); // Use arguemnt directly } } @Override public String toString() { return String.format("test %d %d", testReg, jumpReg); } }
[ "ich@weltraumschaf.de" ]
ich@weltraumschaf.de
b5009f113d7544dc8df47ea4075e8b4e208b60af
d40c84afc557191eac6e14a37cc5d714620b8ce9
/src/main/java/twilightforest/client/renderer/blocks/RenderBlockTFFireflyJar.java
0d2fed2f2f3b8dca6eab78b2d17f5c54dfe9f2ae
[]
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
4,780
java
package twilightforest.client.renderer.blocks; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; import org.lwjgl.opengl.GL11; import twilightforest.block.BlockTFFireflyJar; public class RenderBlockTFFireflyJar implements ISimpleBlockRenderingHandler { final int renderID; public RenderBlockTFFireflyJar(int blockComplexRenderID) { this.renderID = blockComplexRenderID; } public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { renderInvJar(renderer, block, metadata); } public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return renderJar(renderer, world, x, y, z, block); } public boolean shouldRender3DInInventory(int modelId) { return true; } public int getRenderId() { return this.renderID; } public static boolean renderJar(RenderBlocks renderblocks, IBlockAccess world, int x, int y, int z, Block block) { renderblocks.func_147771_a(); renderblocks.func_147782_a(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.875D, 0.8125D); renderblocks.func_147784_q(block, x, y, z); renderblocks.field_147840_d = BlockTFFireflyJar.jarCork; renderblocks.func_147782_a(0.25D, 0.75D, 0.25D, 0.75D, 1.0D, 0.75D); renderblocks.func_147784_q(block, x, y, z); renderblocks.func_147771_a(); block.func_149683_g(); return true; } public static void renderInvJar(RenderBlocks renderblocks, Block par1Block, int meta) { Tessellator tessellator = Tessellator.field_78398_a; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); renderblocks.func_147782_a(0.1875D, 0.0D, 0.1875D, 0.8125D, 0.875D, 0.8125D); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, -1.0F, 0.0F); renderblocks.func_147768_a(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarTop); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 1.0F, 0.0F); renderblocks.func_147806_b(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarTop); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 0.0F, -1.0F); renderblocks.func_147764_f(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarSide); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 0.0F, 1.0F); renderblocks.func_147798_e(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarSide); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(-1.0F, 0.0F, 0.0F); renderblocks.func_147761_c(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarSide); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(1.0F, 0.0F, 0.0F); renderblocks.func_147734_d(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarSide); tessellator.func_78381_a(); renderblocks.func_147782_a(0.25D, 0.75D, 0.25D, 0.75D, 1.0D, 0.75D); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, -1.0F, 0.0F); renderblocks.func_147768_a(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 1.0F, 0.0F); renderblocks.func_147806_b(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 0.0F, -1.0F); renderblocks.func_147764_f(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(0.0F, 0.0F, 1.0F); renderblocks.func_147798_e(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(-1.0F, 0.0F, 0.0F); renderblocks.func_147761_c(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); tessellator.func_78382_b(); tessellator.func_78375_b(1.0F, 0.0F, 0.0F); renderblocks.func_147734_d(par1Block, 0.0D, 0.0D, 0.0D, BlockTFFireflyJar.jarCork); tessellator.func_78381_a(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); par1Block.func_149683_g(); } }
[ "pturchan@yahoo.com" ]
pturchan@yahoo.com
06a742a11068f9c3dac7246b9e05bac655acecd2
15b260ccada93e20bb696ae19b14ec62e78ed023
/v2/src/main/java/com/alipay/api/request/AlipayLifeassistantProdBillGetRequest.java
ddbda1295e8056eb262b16fb0570f53dbe4d391f
[ "Apache-2.0" ]
permissive
alipay/alipay-sdk-java-all
df461d00ead2be06d834c37ab1befa110736b5ab
8cd1750da98ce62dbc931ed437f6101684fbb66a
refs/heads/master
2023-08-27T03:59:06.566567
2023-08-22T14:54:57
2023-08-22T14:54:57
132,569,986
470
207
Apache-2.0
2022-12-25T07:37:40
2018-05-08T07:19:22
Java
UTF-8
Java
false
false
3,833
java
package com.alipay.api.request; import java.util.Map; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayLifeassistantProdBillGetResponse; import com.alipay.api.AlipayObject; /** * ALIPAY API: alipay.lifeassistant.prod.bill.get request * * @author auto create * @since 1.0, 2023-05-29 19:56:58 */ public class AlipayLifeassistantProdBillGetRequest implements AlipayRequest<AlipayLifeassistantProdBillGetResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 业务类型 1-手机充值 2-公共事业缴费 3-信用卡还款 */ private String bizType; /** * 商户类型 10001——新浪 */ private String mType; /** * 付款方外部用户ID */ private String openId; /** * 支付宝订单号 */ private String orderId; /** * 付款方外部用户ID */ private String uid; public void setBizType(String bizType) { this.bizType = bizType; } public String getBizType() { return this.bizType; } public void setmType(String mType) { this.mType = mType; } public String getmType() { return this.mType; } public void setOpenId(String openId) { this.openId = openId; } public String getOpenId() { return this.openId; } public void setOrderId(String orderId) { this.orderId = orderId; } public String getOrderId() { return this.orderId; } public void setUid(String uid) { this.uid = uid; } public String getUid() { return this.uid; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "alipay.lifeassistant.prod.bill.get"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_type", this.bizType); txtParams.put("m_type", this.mType); txtParams.put("open_id", this.openId); txtParams.put("order_id", this.orderId); txtParams.put("uid", this.uid); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<AlipayLifeassistantProdBillGetResponse> getResponseClass() { return AlipayLifeassistantProdBillGetResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "auto-publish" ]
auto-publish
cf1070f1c6fa1377cff358735bde3ab2c3c5e8e0
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
/bazaar8.apk-decompiled/sources/c/c/a/f/pc.java
161916bf9653f2dd545d1b5b17510663fe4bd292
[]
no_license
BaseMax/PopularAndroidSource
a395ccac5c0a7334d90c2594db8273aca39550ed
bcae15340907797a91d39f89b9d7266e0292a184
refs/heads/master
2020-08-05T08:19:34.146858
2019-10-06T20:06:31
2019-10-06T20:06:31
212,433,298
2
0
null
null
null
null
UTF-8
Java
false
false
1,284
java
package c.c.a.f; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.appcompat.widget.AppCompatTextView; import androidx.databinding.ViewDataBinding; import b.l.g; import com.farsitel.bazaar.R; import com.farsitel.bazaar.ui.cinema.download.VideoDownloadQualityHeader; /* compiled from: ItemVideoDownloadHeaderBinding */ public abstract class pc extends ViewDataBinding { public final AppCompatTextView A; public final AppCompatTextView B; public final AppCompatTextView C; public VideoDownloadQualityHeader D; public pc(Object obj, View view, int i2, AppCompatTextView appCompatTextView, AppCompatTextView appCompatTextView2, AppCompatTextView appCompatTextView3) { super(obj, view, i2); this.A = appCompatTextView; this.B = appCompatTextView2; this.C = appCompatTextView3; } public static pc a(LayoutInflater layoutInflater, ViewGroup viewGroup, boolean z) { return a(layoutInflater, viewGroup, z, g.a()); } @Deprecated public static pc a(LayoutInflater layoutInflater, ViewGroup viewGroup, boolean z, Object obj) { return (pc) ViewDataBinding.a(layoutInflater, (int) R.layout.item_video_download_header, viewGroup, z, obj); } }
[ "MaxBaseCode@gmail.com" ]
MaxBaseCode@gmail.com
7550236214c08faa50ba3dd880ecb8dedff32aa6
ce44e9fec5f4ee3eff79c3e6fbb0064fbb94753d
/main/feature/src/boofcv/alg/segmentation/fh04/impl/FhEdgeWeights8_MsF32.java
6c0a4b43e69b1cb60e3f2a02cf5a8fa758bcb61e
[ "Apache-2.0" ]
permissive
wsjhnsn/BoofCV
74fc0687e29c45df1d2fc125b28d777cd91a8158
bdae47003090c03386b6b23e2a884bceba242241
refs/heads/master
2020-12-24T12:34:02.996379
2014-06-27T21:15:21
2014-06-27T21:15:21
21,334,100
1
0
null
null
null
null
UTF-8
Java
false
false
4,800
java
/* * Copyright (c) 2011-2014, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * 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 boofcv.alg.segmentation.fh04.impl; import boofcv.alg.segmentation.fh04.FhEdgeWeights; import boofcv.struct.image.ImageFloat32; import boofcv.struct.image.ImageType; import boofcv.struct.image.MultiSpectral; import org.ddogleg.struct.FastQueue; import static boofcv.alg.segmentation.fh04.SegmentFelzenszwalbHuttenlocher04.Edge; /** * <p>Computes edge weight as the F-norm different in pixel value for {@link MultiSpectral} images. * A 8-connect neighborhood is considered.</p> * * <p> * WARNING: Do not modify. Automatically generated by {@link GenerateFhEdgeWeights_MS}. * </p> * * @author Peter Abeles */ public class FhEdgeWeights8_MsF32 implements FhEdgeWeights<MultiSpectral<ImageFloat32>> { float pixelColor[]; int numBands; public FhEdgeWeights8_MsF32(int numBands) { this.numBands = numBands; pixelColor = new float[numBands]; } @Override public void process(MultiSpectral<ImageFloat32> input, FastQueue<Edge> edges) { edges.reset(); int w = input.width-1; int h = input.height-1; // First consider the inner pixels for( int y = 0; y < h; y++ ) { int indexSrc = input.startIndex + y*input.stride + 1; int indexDst = + y*input.width + 1; for( int x = 1; x < w; x++ , indexSrc++ , indexDst++ ) { float weight1=0,weight2=0,weight3=0,weight4=0; for( int i = 0; i < numBands; i++ ) { ImageFloat32 band = input.getBand(i); float color0 = band.data[indexSrc]; // (x,y) float color1 = band.data[indexSrc+1]; // (x+1,y) float color2 = band.data[indexSrc+input.stride]; // (x,y+1) float diff1 = color0-color1; float diff2 = color0-color2; weight1 += diff1*diff1; weight2 += diff2*diff2; float color3 = band.data[indexSrc+1+input.stride]; // (x+1,y+1) float color4 = band.data[indexSrc-1+input.stride]; // (x-1,y+1) float diff3 = color0-color3; float diff4 = color0-color4; weight3 += diff3*diff3; weight4 += diff4*diff4; } Edge e1 = edges.grow(); Edge e2 = edges.grow(); e1.sortValue = (float)Math.sqrt(weight1); e1.indexA = indexDst; e1.indexB = indexDst+1; e2.sortValue = (float)Math.sqrt(weight2); e2.indexA = indexDst; e2.indexB = indexDst+input.width; Edge e3 = edges.grow(); Edge e4 = edges.grow(); e3.sortValue = (float)Math.sqrt(weight3); e3.indexA = indexDst; e3.indexB = indexDst+1+input.width; e4.sortValue = (float)Math.sqrt(weight4); e4.indexA = indexDst; e4.indexB = indexDst-1+input.width; } } // Handle border pixels for( int y = 0; y < h; y++ ) { checkAround(0,y,input,edges); checkAround(w,y,input,edges); } for( int x = 0; x < w; x++ ) { checkAround(x,h,input,edges); } } private void checkAround( int x , int y , MultiSpectral<ImageFloat32> input , FastQueue<Edge> edges ) { int indexSrc = input.startIndex + y*input.stride + x; int indexA = y*input.width + x; for( int i = 0; i < numBands; i++ ) { ImageFloat32 band = input.getBand(i); pixelColor[i] = band.data[indexSrc]; } check(x+1, y, pixelColor,indexA,input,edges); check(x ,y+1,pixelColor,indexA,input,edges); check(x+1,y+1,pixelColor,indexA,input,edges); check(x-1,y+1,pixelColor,indexA,input,edges); } private void check( int x , int y , float color0[] , int indexA, MultiSpectral<ImageFloat32> input , FastQueue<Edge> edges ) { if( !input.isInBounds(x,y) ) return; int indexSrc = input.startIndex + y*input.stride + x; int indexB = + y*input.width + x; float weight = 0; for( int i = 0; i < numBands; i++ ) { ImageFloat32 band = input.getBand(i); float color = band.data[indexSrc]; float diff = color0[i]-color; weight += diff*diff; } Edge e1 = edges.grow(); e1.sortValue = (float)Math.sqrt(weight); e1.indexA = indexA; e1.indexB = indexB; } @Override public ImageType<MultiSpectral<ImageFloat32>> getInputType() { return ImageType.ms(3,ImageFloat32.class); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
a9bf92ffab2c9e98f265f961387311911f646e2a
0982fb84bcd47552dd9bc42d642f06eafb2118d6
/easy-rules-mvel/src/test/java/org/jeasy/rules/mvel/MVELRuleDefinitionReaderTest.java
cf180661d37f55eab0f7c3f58e31a803865528dd
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
rampatra/easy-rules
98f0a5f67352b8ed826fbfcdcff647c34088f306
2022c4b73907bef3ea8c21052f360fa37d4de35e
refs/heads/master
2021-08-30T17:53:17.083247
2017-12-18T22:13:51
2017-12-18T22:13:51
116,035,623
1
0
null
null
null
null
UTF-8
Java
false
false
2,328
java
/** * The MIT License * * Copyright (c) 2017, Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com) * * 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.jeasy.rules.mvel; import org.junit.Test; import java.io.File; import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; public class MVELRuleDefinitionReaderTest { private MVELRuleDefinitionReader ruleDefinitionReader = new MVELRuleDefinitionReader(); @Test public void testRuleDefinitionReading() throws Exception { // given File adultRuleDescriptor = new File("src/test/resources/adult-rule.yml"); // when MVELRuleDefinition adultRuleDefinition = ruleDefinitionReader.read(adultRuleDescriptor); // then assertThat(adultRuleDefinition).isNotNull(); assertThat(adultRuleDefinition.getName()).isEqualTo("adult rule"); assertThat(adultRuleDefinition.getDescription()).isEqualTo("when age is greater then 18, then mark as adult"); assertThat(adultRuleDefinition.getPriority()).isEqualTo(1); assertThat(adultRuleDefinition.getCondition()).isEqualTo("person.age > 18"); assertThat(adultRuleDefinition.getActions()).isEqualTo(Collections.singletonList("person.setAdult(true);")); } }
[ "mahmoud.benhassine@icloud.com" ]
mahmoud.benhassine@icloud.com
8a7f403475c1986b69b275bcbd2c883489c3d05b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_c9a3c633c1c84469d2cbccf489fc0cbcfb78c1ca/BasicProductionCountingOnStartupService/12_c9a3c633c1c84469d2cbccf489fc0cbcfb78c1ca_BasicProductionCountingOnStartupService_s.java
a6372e1aed12cf9028ff34b64d505c2852c540c3
[]
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
1,840
java
/** * *************************************************************************** * Copyright (c) 2010 Qcadoo Limited * Project: Qcadoo MES * Version: 1.1.1 * * This file is part of Qcadoo. * * Qcadoo 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *************************************************************************** */ package com.qcadoo.mes.basicProductionCounting; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.qcadoo.mes.orders.states.OrderStatesChangingService; import com.qcadoo.plugin.api.Module; @Component public class BasicProductionCountingOnStartupService extends Module { @Autowired private OrderStatesChangingService orderChangingService; @Autowired private BasicProductionCountingOrderStatesListener orderStatesListener; @Override public void enableOnStartup() { orderChangingService.addOrderStateListener(orderStatesListener); } @Override public void disableOnStartup() { orderChangingService.removeOrderStateListener(orderStatesListener); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
44f8eab9dee86cfa717ad2f9d4af377ce44f2d53
69ed18f94b2c1caf9742d983f5daf28f40614ca2
/BomLtsPortal/src/com/bomltsportal/service/CustomerDetailService.java
8b259b7b71b486c04d8fdd566197922518100643
[]
no_license
RodexterMalinao/springBoard
d1b4f9d2f7e76f63e2690f414863096e3e271369
aa4bf03395b12d923d28767e1561049c45ee3261
refs/heads/master
2020-09-03T07:21:15.415737
2019-12-16T07:12:22
2019-12-16T07:12:22
219,409,720
0
1
null
2019-12-16T07:12:23
2019-11-04T03:28:03
Java
UTF-8
Java
false
false
259
java
package com.bomltsportal.service; import com.bomwebportal.lts.dto.profile.CustomerDetailProfileLtsDTO; public interface CustomerDetailService { public abstract CustomerDetailProfileLtsDTO getLtsCustomerDetailByDocId( String pDocId, String pDocType); }
[ "acer_08_06@yahoo.com" ]
acer_08_06@yahoo.com
4f9380a53e63a1d0fd1633077244e0bdc23f5506
6f36e847fbacb814f7ba041fe060dab32fa1be74
/commons/common-utils/src/main/java/com/study/core/crypto/asymmetric/SignAlgorithm.java
d7705adf6577b6781b5181832261f4c68a007a76
[]
no_license
wcl19860926/springboot-demo
b3d31f2a03bb3edc3097abad55d356f0505a2d28
c71827acda26314ecd80dfd024e7858147f4c3b3
refs/heads/main
2023-03-09T15:31:28.805200
2021-02-28T11:34:05
2021-02-28T11:34:05
342,522,874
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package com.study.core.crypto.asymmetric; /** * 签名算法类型<br> * see: https://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Signature * * @author Looly * */ public enum SignAlgorithm { // The RSA signature algorithm NONEwithRSA("NONEwithRSA"), // // The MD2/MD5 with RSA Encryption signature algorithm MD2withRSA("MD2withRSA"), // MD5withRSA("MD5withRSA"), // // The signature algorithm with SHA-* and the RSA SHA1withRSA("SHA1withRSA"), // SHA256withRSA("SHA256withRSA"), // SHA384withRSA("SHA384withRSA"), // SHA512withRSA("SHA512withRSA"), // // The Digital Signature Algorithm NONEwithDSA("NONEwithDSA"), // // The DSA with SHA-1 signature algorithm SHA1withDSA("SHA1withDSA"), // // The ECDSA signature algorithms NONEwithECDSA("NONEwithECDSA"), // SHA1withECDSA("SHA1withECDSA"), // SHA256withECDSA("SHA256withECDSA"), // SHA384withECDSA("SHA384withECDSA"), // SHA512withECDSA("SHA512withECDSA");// private String value; /** * 构造 * * @param value 算法字符表示,区分大小写 */ private SignAlgorithm(String value) { this.value = value; } /** * 获取算法字符串表示,区分大小写 * * @return 算法字符串表示 */ public String getValue() { return this.value; } }
[ "694216530@qq.com" ]
694216530@qq.com
d6c15ed18bd54e9aebf3fd6be8fe05b44add791f
606cd7931bc5288ffe91cf58f45d3e4f64a9b3df
/pk-ejb/src/java/com/pelindo/ebtos/ejb/VesselScheduleVisual.java
7bdc905afd8c10e33e92ef7c86eb0dd94f35f8a1
[]
no_license
surachman/iconos-tarakan
5655284ac69059935922d92ee856b6926b656d1d
d7fa1c120d22d391983dab95c5654cb63b27e1f7
refs/heads/master
2021-01-20T20:21:40.937285
2016-06-27T14:51:22
2016-06-27T14:51:22
61,995,382
0
0
null
null
null
null
UTF-8
Java
false
false
8,003
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.pelindo.ebtos.ejb; import com.qtasnim.util.Padding; import com.pelindo.ebtos.ejb.facade.local.MasterDockFacadeLocal; import com.pelindo.ebtos.ejb.facade.local.PlanningVesselFacadeLocal; import com.pelindo.ebtos.ejb.remote.VesselScheduleVisualRemote; import com.pelindo.ebtos.model.db.master.MasterDock; import com.pelindo.ebtos.model.vesselplan.Block; import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.Serializable; import java.math.BigDecimal; import java.sql.Blob; import java.sql.SQLException; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.imageio.ImageIO; import javax.sql.rowset.serial.SerialBlob; import javax.sql.rowset.serial.SerialException; /** * * @author senoanggoro */ @Stateless public class VesselScheduleVisual implements Serializable, VesselScheduleVisualRemote { @EJB private PlanningVesselFacadeLocal planningVesselFacadeLocal; @EJB private MasterDockFacadeLocal masterDockFacadeLocal; private static final Integer MINIMUM_MEDIA_HEIGHT = 500; private static final Integer MINIMUM_Y_HEIGHT = 50; public static Padding padding = new Padding(30, 30, 30, 50); public static Dimension size = new Dimension(1000,500); public static Date yBoundMin, yBoundMax; public static int pixelX, pixelY; private String dock_code; @Override public void init(String dock_code, Integer w, Integer h, Date yBoundMin, Date yBoundMax){ if (h == null) { Calendar cal1 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance(); cal1.setTime(yBoundMin); cal2.setTime(yBoundMax); Integer range = Math.abs((cal2.get(Calendar.DAY_OF_YEAR) + ((Math.abs(cal2.get(Calendar.YEAR) - cal1.get(Calendar.YEAR))) * cal2.getActualMaximum(Calendar.DAY_OF_YEAR))) - cal1.get(Calendar.DAY_OF_YEAR)); int mediaHeight = MINIMUM_Y_HEIGHT * range; if (mediaHeight < MINIMUM_MEDIA_HEIGHT) { mediaHeight = MINIMUM_MEDIA_HEIGHT; } size.setSize(w, mediaHeight); } else { size.setSize(w, h); } this.dock_code = dock_code; VesselScheduleVisual.yBoundMin = yBoundMin; VesselScheduleVisual.yBoundMax = yBoundMax; } @Override public Blob generate(){ BufferedImage outImage = new BufferedImage((int) size.getWidth(),(int) size.getHeight(), BufferedImage.TYPE_INT_RGB); Graphics2D g2d = outImage.createGraphics(); FontRenderContext frc = g2d.getFontRenderContext(); TextLayout tl; MasterDock dock = masterDockFacadeLocal.find(dock_code); int x0 = padding.getPaddingLeft(); int y0 = size.height - padding.getPaddingBottom(); int dockWidth = (int) Math.ceil((dock.getToMeter() - dock.getFrMeter()) / 10); pixelY = (int) ((size.height - (padding.getPaddingTop() + padding.getPaddingBottom())) / ((yBoundMax.getTime() - yBoundMin.getTime()) / (1000 * 60 * 60 * 24) + 2)); pixelX = (size.width - (padding.getPaddingLeft() + padding.getPaddingRight())) / dockWidth; if (pixelX > 1 && pixelY > 1){ // ==== set image quality ==== // g2d.setComposite(AlphaComposite.Src); g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // ==== end ==== // g2d.setColor(Color.LIGHT_GRAY); g2d.fillRect(0, 0, (int)size.width, (int)size.height); g2d.setColor(Color.BLACK); g2d.setStroke(new BasicStroke(2.0f)); List<Object[]> vesselSchedules = planningVesselFacadeLocal.findVesselScheduleByDateRangeAndDock(yBoundMin, yBoundMax, dock_code); for (Object[] vesselSchedule: vesselSchedules) { Block b = new Block((String) vesselSchedule[0], (String) vesselSchedule[5], ((BigDecimal) vesselSchedule[1]).intValue(), ((BigDecimal) vesselSchedule[2]).intValue(), (Date) vesselSchedule[3], (Date) vesselSchedule[4], false); b.draw(g2d); } g2d.setColor(Color.BLACK); //draw media (x,y) g2d.drawLine(padding.getPaddingLeft(), (int)size.height - padding.getPaddingBottom(), (int)size.width - padding.getPaddingRight(), (int)size.height - padding.getPaddingBottom()); g2d.drawLine(padding.getPaddingLeft(), padding.getPaddingTop(), padding.getPaddingLeft(), (int)size.height - padding.getPaddingBottom()); //set x's value int index = 0; for (int i = x0 ; i < size.width - padding.getPaddingRight(); i += pixelX) { g2d.drawLine(i, (int)size.height - padding.getPaddingBottom() - 2, i, (int)size.height - padding.getPaddingBottom()); tl = new TextLayout(String.valueOf(String.valueOf(index++ * 10)), new Font("Helvetica",Font.BOLD, 9), frc); tl.draw(g2d, (int) (i - (tl.getBounds().getWidth() / 2)), (int)size.height - padding.getPaddingBottom() + 10); } //set y's value Calendar c = Calendar.getInstance(); c.setTime(yBoundMin); String prevMonth = ""; for (int i = y0; i > padding.getPaddingTop(); i -= pixelY) { g2d.drawLine(padding.getPaddingLeft(), i, padding.getPaddingLeft() + 2, i); if (i != y0) { String date = String.valueOf(c.get(Calendar.DATE)); String month = String.valueOf(c.get(Calendar.MONTH) + 1); String year = String.valueOf(c.get(Calendar.YEAR)); tl = new TextLayout(date, new Font("Helvetica",Font.BOLD, 10), frc); double dateTextWidth = tl.getBounds().getWidth(); tl.draw(g2d, padding.getPaddingLeft() - 5 - (int)(dateTextWidth), i + (int)(tl.getBounds().getHeight() / 2)); if (!month.equals(prevMonth)) { tl = new TextLayout(year.substring(2) + "." + month, new Font("Helvetica",Font.BOLD, 11), frc); tl.draw(g2d, padding.getPaddingLeft() - 5 - (int)(tl.getBounds().getWidth() + dateTextWidth + 5), i + (int)(tl.getBounds().getHeight() / 2)); prevMonth = month; g2d.setColor(Color.BLACK); } c.add(Calendar.DATE, 1); } } } g2d.dispose(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ImageIO.write(outImage, "PNG", baos); return new SerialBlob(baos.toByteArray()); } catch (IOException ex) { Logger.getLogger(BerthSchedule.class.getName()).log(Level.SEVERE, null, ex); } catch (SerialException ex) { Logger.getLogger(BerthSchedule.class.getName()).log(Level.SEVERE, null, ex); } catch (SQLException ex) { Logger.getLogger(BerthSchedule.class.getName()).log(Level.SEVERE, null, ex); } return null; } } //lieur juragaaann :((
[ "surachman026@gmail.com" ]
surachman026@gmail.com
b4d660fd04b348c069a1a023fd1e186a9f8ebdb0
b62c76ab304eaa5d4cfb1d7cddd13dce4a99e258
/library/logBack/logback-1.1.3/logback-core/src/test/java/ch/qos/logback/core/appender/DummyAppenderTest.java
f97d73de376a16666e602d09962b07f336ecfdfb
[ "MIT" ]
permissive
cscfa/bartleby
9fc069ff2fe1e0023355d8d70897b25e1b5f08a2
62a00d8710afc9c698d3336649d8da0fcf79f355
refs/heads/master
2021-01-01T19:30:51.933368
2015-06-27T23:10:10
2015-06-27T23:10:10
35,576,368
1
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/** * Logback: the reliable, generic, fast and flexible logging framework. * Copyright (C) 1999-2015, QOS.ch. All rights reserved. * * This program and the accompanying materials are dual-licensed under * either the terms of the Eclipse Public License v1.0 as published by * the Eclipse Foundation * * or (per the licensee's choosing) * * under the terms of the GNU Lesser General Public License version 2.1 * as published by the Free Software Foundation. */ package ch.qos.logback.core.appender; import static org.junit.Assert.assertEquals; import java.io.ByteArrayOutputStream; import java.io.IOException; import org.junit.Test; import ch.qos.logback.core.Appender; import ch.qos.logback.core.encoder.DummyEncoder; import ch.qos.logback.core.encoder.Encoder; import ch.qos.logback.core.layout.DummyLayout; public class DummyAppenderTest extends AbstractAppenderTest<Object> { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DummyWriterAppender<Object> da = new DummyWriterAppender<Object>(baos); protected Appender<Object> getAppender() { return da; } protected Appender<Object> getConfiguredAppender() { da.setEncoder(new DummyEncoder<Object>()); da.start(); return da; } @Test public void testBasic() throws IOException { Encoder<Object> encoder = new DummyEncoder<Object>(); encoder.init(baos); da.setEncoder(encoder); da.start(); da.doAppend(new Object()); assertEquals(DummyLayout.DUMMY, baos.toString()); } }
[ "matthieu.vallance@cscfa.fr" ]
matthieu.vallance@cscfa.fr
0ef59b0659a8ad2728b7cb380fa58514d9de8126
63f579466b611ead556cb7a257d846fc88d582ed
/XDRValidator/src/main/java/generated/ResourceGroupEntityType.java
e26d617677a24368e41c9410ef3d7e12929c20fa
[]
no_license
svalluripalli/soap
14f47b711d63d4890de22a9f915aed1bef755e0b
37d7ea683d610ab05477a1fdb4e329b5feb05381
refs/heads/master
2021-01-18T20:42:09.095152
2014-05-07T21:16:36
2014-05-07T21:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,065
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.07 at 05:07:17 PM EDT // package generated; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ResourceGroupEntityType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ResourceGroupEntityType"> * &lt;restriction base="{}cs"> * &lt;enumeration value="PRAC"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ResourceGroupEntityType") @XmlEnum public enum ResourceGroupEntityType { PRAC; public String value() { return name(); } public static ResourceGroupEntityType fromValue(String v) { return valueOf(v); } }
[ "konkapv@NCI-01874632-L.nci.nih.gov" ]
konkapv@NCI-01874632-L.nci.nih.gov
4d947f2944dc8003f9f8cacbb99bde9f40ae39ab
3d31bd81c8d211d3ced31f3e418c9b590b717c00
/concurrency/src/test/java/sc_jcip/SafeStates.java
dc3a0c5c33234d1d19e27d669adff404ae49ffee
[]
no_license
silloy/boot-in-action
2e709be73068fcb64a9b6dad6dc81d8f70425d4a
3c044de7af970d90fce069e7de065dcd232347a2
refs/heads/master
2021-05-06T09:30:58.908397
2018-04-20T14:16:03
2018-04-20T14:16:03
114,078,066
2
0
null
null
null
null
UTF-8
Java
false
false
603
java
package sc_jcip; import net.jcip.annotations.ThreadSafe; import java.util.HashMap; import java.util.Map; /** * SafeStates * <p/> * Initialization safety for immutable objects * * @author Brian Goetz and Tim Peierls */ @ThreadSafe public class SafeStates { private final Map<String, String> states; public SafeStates() { states = new HashMap<String, String>(); states.put("alaska", "AK"); states.put("alabama", "AL"); /*...*/ states.put("wyoming", "WY"); } public String getAbbreviation(String s) { return states.get(s); } }
[ "sshzh90@gmail.com" ]
sshzh90@gmail.com
089e7936ea6a2bee3f04233c863e01e251300462
3bcaebf7d69eaab5e4086568440b2ca56219b50d
/src/main/java/com/tinyolo/cxml/parsing/demo/jaxb/cxml/ApprovalRequestHeader.java
d056641a3b8e3957c54c97799a0c86389765d6a0
[]
no_license
augustine-d-nguyen/cxml-parsing-demo
2a419263b091b32e70fa84312b55d8217e691ac6
3cc169ee0392d88bbf0e03f0791a15287a8eba97
refs/heads/master
2023-01-18T19:07:27.094598
2020-11-20T14:52:52
2020-11-20T14:52:52
314,490,660
0
0
null
null
null
null
UTF-8
Java
false
false
7,602
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2020.11.20 at 08:07:34 PM ICT // package com.tinyolo.cxml.parsing.demo.jaxb.cxml; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "documentReference", "cxmlAttachment", "contact", "comments", "extrinsic" }) @XmlRootElement(name = "ApprovalRequestHeader") public class ApprovalRequestHeader { @XmlAttribute(name = "approvalStatus") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String approvalStatus; @XmlAttribute(name = "type", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String type; @XmlAttribute(name = "creationDate", required = true) @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String creationDate; @XmlAttribute(name = "approvalStartDate") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String approvalStartDate; @XmlAttribute(name = "approvalEndDate") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String approvalEndDate; @XmlElement(name = "DocumentReference", required = true) protected DocumentReference documentReference; @XmlElement(name = "cXMLAttachment", required = true) protected CXMLAttachment cxmlAttachment; @XmlElement(name = "Contact") protected Contact contact; @XmlElement(name = "Comments") protected Comments comments; @XmlElement(name = "Extrinsic") protected List<Extrinsic> extrinsic; /** * Gets the value of the approvalStatus property. * * @return * possible object is * {@link String } * */ public String getApprovalStatus() { return approvalStatus; } /** * Sets the value of the approvalStatus property. * * @param value * allowed object is * {@link String } * */ public void setApprovalStatus(String value) { this.approvalStatus = value; } /** * Gets the value of the type property. * * @return * possible object is * {@link String } * */ public String getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link String } * */ public void setType(String value) { this.type = value; } /** * Gets the value of the creationDate property. * * @return * possible object is * {@link String } * */ public String getCreationDate() { return creationDate; } /** * Sets the value of the creationDate property. * * @param value * allowed object is * {@link String } * */ public void setCreationDate(String value) { this.creationDate = value; } /** * Gets the value of the approvalStartDate property. * * @return * possible object is * {@link String } * */ public String getApprovalStartDate() { return approvalStartDate; } /** * Sets the value of the approvalStartDate property. * * @param value * allowed object is * {@link String } * */ public void setApprovalStartDate(String value) { this.approvalStartDate = value; } /** * Gets the value of the approvalEndDate property. * * @return * possible object is * {@link String } * */ public String getApprovalEndDate() { return approvalEndDate; } /** * Sets the value of the approvalEndDate property. * * @param value * allowed object is * {@link String } * */ public void setApprovalEndDate(String value) { this.approvalEndDate = value; } /** * Gets the value of the documentReference property. * * @return * possible object is * {@link DocumentReference } * */ public DocumentReference getDocumentReference() { return documentReference; } /** * Sets the value of the documentReference property. * * @param value * allowed object is * {@link DocumentReference } * */ public void setDocumentReference(DocumentReference value) { this.documentReference = value; } /** * Gets the value of the cxmlAttachment property. * * @return * possible object is * {@link CXMLAttachment } * */ public CXMLAttachment getCXMLAttachment() { return cxmlAttachment; } /** * Sets the value of the cxmlAttachment property. * * @param value * allowed object is * {@link CXMLAttachment } * */ public void setCXMLAttachment(CXMLAttachment value) { this.cxmlAttachment = value; } /** * Gets the value of the contact property. * * @return * possible object is * {@link Contact } * */ public Contact getContact() { return contact; } /** * Sets the value of the contact property. * * @param value * allowed object is * {@link Contact } * */ public void setContact(Contact value) { this.contact = value; } /** * Gets the value of the comments property. * * @return * possible object is * {@link Comments } * */ public Comments getComments() { return comments; } /** * Sets the value of the comments property. * * @param value * allowed object is * {@link Comments } * */ public void setComments(Comments value) { this.comments = value; } /** * Gets the value of the extrinsic 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 extrinsic property. * * <p> * For example, to add a new item, do as follows: * <pre> * getExtrinsic().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Extrinsic } * * */ public List<Extrinsic> getExtrinsic() { if (extrinsic == null) { extrinsic = new ArrayList<Extrinsic>(); } return this.extrinsic; } }
[ "augustine.d.nguyen@outlook.com" ]
augustine.d.nguyen@outlook.com
afbbd05c3b16a01061e37736c4568964a9572ee5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_c59c48b04e9763db83f8b4dc4a554d306e7d7058/FindByPersistentMethod/2_c59c48b04e9763db83f8b4dc4a554d306e7d7058_FindByPersistentMethod_t.java
11800b6738fc6ca9c4d000758cbe4c26310b8d9e
[]
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,761
java
/* Copyright 2004-2005 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.codehaus.groovy.grails.orm.hibernate.metaclass; import org.codehaus.groovy.grails.commons.GrailsApplication; import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsHibernateUtil; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Disjunction; import org.springframework.orm.hibernate3.HibernateCallback; import java.sql.SQLException; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.regex.Pattern; /** * The "findBy*" static persistent method. This method allows querying for * instances of grails domain classes based on their properties. This method returns the first result of the query * * eg. * Account.findByHolder("Joe Blogs"); // Where class "Account" has a property called "holder" * Account.findByHolderAndBranch("Joe Blogs", "London" ); // Where class "Account" has a properties called "holder" and "branch" * * @author Graeme Rocher * @since 31-Aug-2005 * */ public class FindByPersistentMethod extends AbstractClausedStaticPersistentMethod { private static final String OPERATOR_OR = "Or"; private static final String OPERATOR_AND = "And"; private static final String METHOD_PATTERN = "(findBy)(\\w+)"; private static final String[] OPERATORS = new String[]{ OPERATOR_AND, OPERATOR_OR }; public FindByPersistentMethod(GrailsApplication application,SessionFactory sessionFactory, ClassLoader classLoader) { super(application,sessionFactory, classLoader, Pattern.compile( METHOD_PATTERN ),OPERATORS); } protected Object doInvokeInternalWithExpressions(final Class clazz, String methodName, final Object[] arguments, final List expressions, String operatorInUse) { final String operator = OPERATOR_OR.equals(operatorInUse) ? OPERATOR_OR : OPERATOR_AND; return super.getHibernateTemplate().execute( new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria crit = session.createCriteria(clazz); if(arguments.length > 0) { if(arguments[0] instanceof Map) { Map argMap = (Map)arguments[0]; GrailsHibernateUtil.populateArgumentsForCriteria(clazz, crit,argMap); } } if(operator.equals(OPERATOR_OR)) { if(firstExpressionIsRequiredBoolean()) { GrailsMethodExpression expression = (GrailsMethodExpression) expressions.remove(0); crit.add(expression.getCriterion()); } Disjunction dis = Restrictions.disjunction(); for (Iterator i = expressions.iterator(); i.hasNext();) { GrailsMethodExpression current = (GrailsMethodExpression) i.next(); dis.add( current.getCriterion() ); } crit.add(dis); } else { for (Iterator i = expressions.iterator(); i.hasNext();) { GrailsMethodExpression current = (GrailsMethodExpression) i.next(); crit.add( current.getCriterion() ); } } try { return crit.uniqueResult(); } catch (HibernateException e) { crit.setMaxResults(1); return crit.uniqueResult(); } } }); } /** * Indicates if the first expression in the query is a required boolean property and as such should * be ANDed to the other expressions, not ORed. * * @return true if the first expression is a required boolean property, false otherwise * @see org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByBooleanPropertyPersistentMethod */ protected boolean firstExpressionIsRequiredBoolean() { return false; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1e3cd2f1e057b97d263fb0cd902e40927519ee57
e3990e8c3b1e0b8824a0a19bf9d12e48441def7a
/ebean-core/src/test/java/org/tests/inheritance/model/GroupConfiguration.java
e1b90aef42555ce379f0e17e2fb44bdcb3304c9e
[ "Apache-2.0" ]
permissive
ebean-orm/ebean
13c9c465f597dd2cf8b3e54e4b300543017c9dee
bfe94786de3c3b5859aaef5afb3a7572e62275c4
refs/heads/master
2023-08-22T12:57:34.271133
2023-08-22T11:43:41
2023-08-22T11:43:41
5,793,895
1,199
224
Apache-2.0
2023-09-11T14:05:26
2012-09-13T11:49:56
Java
UTF-8
Java
false
false
833
java
package org.tests.inheritance.model; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.OneToMany; import java.util.List; @Entity @DiscriminatorValue("2") public class GroupConfiguration extends Configuration { private String groupName; @OneToMany(mappedBy = "groupConfiguration") private List<CalculationResult> results; public GroupConfiguration() { super(); } public GroupConfiguration(String name) { super(); this.groupName = name; } public String getGroupName() { return groupName; } public void setGroupName(String groupName) { this.groupName = groupName; } public List<CalculationResult> getResults() { return results; } public void setResults(List<CalculationResult> results) { this.results = results; } }
[ "robin.bygrave@gmail.com" ]
robin.bygrave@gmail.com
a6eee7b638d88a6676c0f80c70368942ca126ed4
cd3535be1a64ebdf4a9a6148cc947c2b512f75a4
/bigtop-data-generators/bigtop-name-generator/src/main/java/org/apache/bigtop/datagenerators/namegenerator/NameGenerator.java
e8c9ebfcdebde210033553d9930cd190aa5209e5
[ "FreeBSD-DOC", "MIT", "DOC", "Apache-2.0" ]
permissive
apache/bigtop
cd9d2e3d19fffaac9e4de48445f3b3c1feb5a66f
9afe98b1730b98f6125b56973bbfbb25fed71216
refs/heads/master
2023-09-04T01:23:50.578377
2023-09-01T08:12:01
2023-09-01T08:12:01
2,155,500
509
510
Apache-2.0
2023-09-13T06:16:55
2011-08-04T16:09:56
Python
UTF-8
Java
false
false
1,842
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.bigtop.datagenerators.namegenerator; import org.apache.bigtop.datagenerators.samplers.SeedFactory; import org.apache.bigtop.datagenerators.samplers.samplers.RouletteWheelSampler; import org.apache.bigtop.datagenerators.samplers.samplers.Sampler; import org.apache.bigtop.datagenerators.samplers.wfs.MultinomialWF; import org.apache.commons.lang3.tuple.Pair; public class NameGenerator implements Sampler<Pair<String, String>> { private final Sampler<String> firstNameSampler; private final Sampler<String> lastNameSampler; public NameGenerator(SeedFactory seedFactory) throws Exception { Names names = new NameReader().readData(); firstNameSampler = RouletteWheelSampler.create(new MultinomialWF<String>(names.getFirstNames()).normalize(), seedFactory); lastNameSampler = RouletteWheelSampler.create(new MultinomialWF<String>(names.getLastNames()).normalize(), seedFactory); } public Pair<String, String> sample() throws Exception { return Pair.of(firstNameSampler.sample(), lastNameSampler.sample()); } }
[ "rnowling@gmail.com" ]
rnowling@gmail.com
426b0c7b252bce5fa404b75bb71ac259860d081f
eca4a253fe0eba19f60d28363b10c433c57ab7a1
/eclipse/de.tif.jacob.components.groupedlist/src/de/tif/jacob/components/groupedlist/impl/GroupedListboxPlugin.java
1263d4092c18b8d2b83e2392c7d644fe91fc39b4
[]
no_license
freegroup/Open-jACOB
632f20575092516f449591bf6f251772f599e5fc
84f0a6af83876bd21c453132ca6f98a46609f1f4
refs/heads/master
2021-01-10T11:08:03.604819
2015-05-25T10:25:49
2015-05-25T10:25:49
36,183,560
0
0
null
null
null
null
UTF-8
Java
false
false
1,389
java
/* * Created on 18.07.2009 * */ package de.tif.jacob.components.groupedlist.impl; import org.eclipse.jface.resource.ImageDescriptor; import de.tif.jacob.components.groupedlist.PluginId; import de.tif.jacob.components.groupedlist.GroupedListbox; import de.tif.jacob.components.groupedlist.GroupedListboxEventHandler; import de.tif.jacob.components.plugin.IComponentPlugin; import de.tif.jacob.core.Version; public class GroupedListboxPlugin extends IComponentPlugin { private final static Version version = new Version(2,8,8); public GroupedListboxPlugin() { } public String getName() { return "Grouped Listbox"; } public ImageDescriptor getPaletteImage() { return Activator.getDefault().getImageDescriptor("toolbar_groupedlistbox.png"); } public String getJavaImplClass() { return GroupedListbox.class.getName(); } public Class getFigureClass() { return GroupedListboxFigure.class; } @Override public String getPluginId() { return PluginId.ID; } @Override public Class getEventHandlerTemplateClass() { return GroupedListboxEventHandler.class; } @Override public Version getRequiredJacobVersion() { return version; } @Override public String getPluginVersion() { return (String)Activator.getDefault().getBundle().getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION); } }
[ "a.herz@freegroup.de" ]
a.herz@freegroup.de
a50b71a47a73fecb72ecf03ed914e4445793dc21
c2aa6319b44efbfe3ce3acaa08a7b09bb18daac8
/checker-framework/checkers/tests/report/Overrides.java
33d0983e15c2593636db710b8385eeec1c773db0
[]
no_license
checklt/checklt
132d34258157731b178f1e9fd5bf9ca7819f6ea4
14f8d05868cdaa3cd9da8691fb68c01fa3a94811
refs/heads/master
2016-09-06T11:53:38.395733
2015-10-02T15:42:49
2015-10-02T15:42:49
10,589,368
3
0
null
null
null
null
UTF-8
Java
false
false
442
java
import checkers.util.report.quals.*; class Overrides { class A { void m() {} } class B extends A { @ReportOverride void m() {} } class C extends B { //:: error: (override) void m() {} } // No explicit override -> no message. class D extends B {} class E extends A { // Overrides method on same level as B.m // -> no message. void m() {} } }
[ "jsinglet@gmail.com" ]
jsinglet@gmail.com
c69c03f26dc49d3ef6f136378e0fce5a7f9491d2
5f82aae041ab05a5e6c3d9ddd8319506191ab055
/Projects/Math/58/src/test/java/org/apache/commons/math/analysis/function/LogisticTest.java
e6ffcc5d19fa6bc605941d517dd00bd6986d18dc
[]
no_license
lingming/prapr_data
e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc
be9ababc95df45fd66574c6af01122ed9df3db5d
refs/heads/master
2023-08-14T20:36:23.459190
2021-10-17T13:49:39
2021-10-17T13:49:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,602
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.commons.math.analysis.function; import org.apache.commons.math.analysis.UnivariateRealFunction; import org.apache.commons.math.exception.NotStrictlyPositiveException; import org.apache.commons.math.util.FastMath; import org.junit.Assert; import org.junit.Test; /** * Test for class {@link Logistic}. */ public class LogisticTest { private final double EPS = Math.ulp(1d); @Test(expected=NotStrictlyPositiveException.class) public void testPreconditions1() { new Logistic(1, 0, 1, 1, 0, -1); } @Test(expected=NotStrictlyPositiveException.class) public void testPreconditions2() { new Logistic(1, 0, 1, 1, 0, 0); } @Test public void testCompareSigmoid() { final UnivariateRealFunction sig = new Sigmoid(); final UnivariateRealFunction sigL = new Logistic(1, 0, 1, 1, 0, 1); final double min = -2; final double max = 2; final int n = 100; final double delta = (max - min) / n; for (int i = 0; i < n; i++) { final double x = min + i * delta; Assert.assertEquals("x=" + x, sig.value(x), sigL.value(x), EPS); } } @Test public void testSomeValues() { final double k = 4; final double m = 5; final double b = 2; final double q = 3; final double a = -1; final double n = 2; final UnivariateRealFunction f = new Logistic(k, m, b, q, a, n); double x; x = m; Assert.assertEquals("x=" + x, a + (k - a) / FastMath.sqrt(1 + q), f.value(x), EPS); x = Double.NEGATIVE_INFINITY; Assert.assertEquals("x=" + x, a, f.value(x), EPS); x = Double.POSITIVE_INFINITY; Assert.assertEquals("x=" + x, k, f.value(x), EPS); } }
[ "2890268106@qq.com" ]
2890268106@qq.com
ca99881a903549277e1ebe98032dde44eb199957
a2acb2cf53acfa7cb0396a91832de205acfddf80
/app/src/main/java/cinta/tipsmemikatwanita/trick/util/DateUtil.java
cbc0a4dc9d88bf6bdd869036aa8b24a7d2c25c22
[]
no_license
asywalulfikri/katiakmasam-caramemikatwanita
b2e1bbea2992c53bcb23fff98f0a6f8f00613d3f
d116dcf5aa7450af1b10d12bbb26e383aaf6b488
refs/heads/master
2021-01-22T08:29:01.550520
2017-02-14T06:19:43
2017-02-14T06:19:43
81,904,785
0
0
null
null
null
null
UTF-8
Java
false
false
4,990
java
package cinta.tipsmemikatwanita.trick.util; import android.annotation.SuppressLint; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; @SuppressLint("SimpleDateFormat") public class DateUtil { public static String format(String date, String format) { Date dt = DateUtil.stringToDateTime(date); return DateUtil.dateToString(dt, format); } public static String format(String date) { Date dt = DateUtil.stringToDateTime(date); return DateUtil.dateToString(dt, "dd/MM/yy HH:mm"); } /** * Convert string to date. * * @param date String to convert with format yyyy-MM-dd * * @return Date */ public static Date stringToDate(String date) { if (date == null || date.equals("")) return null; DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date today = null; try { today = df.parse(date); } catch (ParseException e) {} return today; } /** * Convert string to date time. * * @param date String to convert with format yyyy-MM-dd HH:mm * * @return Date time */ public static Date stringToDateTime(String date) { if (date == null || date.equals("")) return null; DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date today = null; try { today = df.parse(date); } catch (ParseException e) {} return today; } public static Date stringToDateTimeWithZone(String date) { if (date == null || date.equals("")) return null; DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date today = null; try { today = df.parse(date); } catch (ParseException e) {} return today; } /** * Convert date to string. * * @param date Date to convert * @param format Date format * * @return String of date */ public static String dateToString(Date date, String format) { DateFormat df = new SimpleDateFormat(format); return df.format(date); } /** * Convert date to string with default format yyyy-MM-dd * * @param date Date to convert * * @return String of date. */ public static String dateToString(Date date) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); return df.format(date); } /* * Convert string time to milliseconds log * * @param time String to convert with format yyyy-MM-dd HH:mm:ss * * @return milliseconds */ public static long timeStringToMilis(String time) { long milis = 0; try { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = sd.parse(time); milis = date.getTime(); } catch (Exception e) { e.printStackTrace(); } return milis; } /** * Convert time in milliseconds to string with format yyyy-MM-dd HH:mm:ss. * * @param milis Milliseconds * * @return String of time */ public static String timeMilisToString(long milis) { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(milis); return sd.format(calendar.getTime()); } public static Date timeMilisTodate(long milis) { return DateUtil.stringToDateTime(DateUtil.timeMilisToString(milis)); } /** * Convert time in milliseconds to string with format yyyy-MM-dd HH:mm:ss. * * @param milis Milliseconds * * @return String of time */ public static String timeMilisToString(long milis, String format) { SimpleDateFormat sd = new SimpleDateFormat(format); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(milis); return sd.format(calendar.getTime()); } public static String getMonth(int month) { String str = "Jan"; switch (month) { case 1: str = "Jan"; break; case 2: str = "Feb"; break; case 3: str = "Mar"; break; case 4: str = "Apr"; break; case 5: str = "Mei"; break; case 6: str = "Jun"; break; case 7: str = "Jul"; break; case 8: str = "Agu"; break; case 9: str = "Sep"; break; case 10: str = "Okt"; break; case 11: str = "Nov"; break; case 12: str = "Des"; break; } return str; } public static String getAdvDate(String date) { //current Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH) + 1; int day = c.get(Calendar.DAY_OF_MONTH); //defined long milis = timeStringToMilis(date); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(milis); if (day == calendar.get(Calendar.DAY_OF_MONTH) && month == (calendar.get(Calendar.MONTH)+1) && year == calendar.get(Calendar.YEAR)) { return "Today, " + DateUtil.timeMilisToString(milis, "MMM dd"); } else if (year == calendar.get(Calendar.YEAR)) { return DateUtil.timeMilisToString(milis, "MMM dd"); } else { return DateUtil.timeMilisToString(milis, "MMM dd, yyyy"); } } }
[ "asywalulfikri@yahoo.co.id" ]
asywalulfikri@yahoo.co.id
9709b5d4d13f61af01d75608ff4757aaa7fda300
3db45557aef8a45f41c0f8dd706beeea8b1dea9f
/coolf/src/main/java/cool/lifted64.java
e4bfcd7dc86bd79bc2faf25249121a7c52de6d2d
[]
no_license
OpenUniversity/AOP-Awesome
7847f63ca88c9781ca0c2bcdcd8b0cd2e8c7ed56
b2dcbe3ee1369717dd2cf193503c632ade7d28ad
refs/heads/master
2020-04-05T00:29:22.270200
2018-12-21T17:04:28
2018-12-21T17:04:28
17,806,949
0
0
null
2014-03-22T14:39:49
2014-03-16T19:15:22
Java
UTF-8
Java
false
false
837
java
package cool; import org.strategoxt.stratego_lib.*; import org.strategoxt.java_front.*; import org.strategoxt.stratego_gpp.*; import org.strategoxt.stratego_sglr.*; import org.strategoxt.lang.*; import org.spoofax.interpreter.terms.*; import static org.strategoxt.lang.Term.*; import org.spoofax.interpreter.library.AbstractPrimitive; import java.util.ArrayList; import java.lang.ref.WeakReference; @SuppressWarnings("all") final class lifted64 extends Strategy { public static final lifted64 instance = new lifted64(); @Override public IStrategoTerm invoke(Context context, IStrategoTerm term) { Fail300: { if(term.getTermType() != IStrategoTerm.APPL || transform._consBoolean_0 != ((IStrategoAppl)term).getConstructor()) break Fail300; if(true) return term; } return null; } }
[ "arik.hadas@openu.ac.il" ]
arik.hadas@openu.ac.il
9b90261c7efd78d1315bfbdac230967ba20c1a9d
e962845a0567821e0928941b0bdb6e200d354ab3
/OnlineAssesmentB35/src/com/nacre/online_assesment/vo/StudentCourseDetailsBean.java
154f2491c9a63b22031cf3e609a2e546b469c1cf
[]
no_license
AjayKumar465/Java-POCs
527e5aec30432a1dab83b1ab04ba8877f0a4e2e1
10c21740c04a095bf0b711607342dd8daba8358a
refs/heads/master
2022-12-29T21:21:19.817526
2020-02-20T12:47:59
2020-02-20T12:47:59
96,673,181
1
0
null
2022-12-16T11:27:09
2017-07-09T09:10:11
Java
UTF-8
Java
false
false
952
java
package com.nacre.online_assesment.vo; import java.io.Serializable; /** * @authors Srikanth and krunal B35. */ public class StudentCourseDetailsBean implements Serializable { private String course; private String technology; private Integer technologyId; /** * @return the technologyId */ public Integer getTechnologyId() { return technologyId; } /** * @param technologyId the technologyId to set */ public void setTechnologyId(Integer technologyId) { this.technologyId = technologyId; } /** * @return the course */ public String getCourse() { return course; } /** * @param course the course to set */ public void setCourse(String course) { this.course = course; } /** * @return the technology */ public String getTechnology() { return technology; } /** * @param technology the technology to set */ public void setTechnology(String technology) { this.technology = technology; } }
[ "ajaykumark0213@gmail.com" ]
ajaykumark0213@gmail.com
d435e44ae4202c9871a71cc8a7302738005da7dd
1eaf18d3198d4279a3b538949cadf0926c8b775f
/src/zcy_算法与数据结构进阶班/trainingcamp001/class04/Code02_TreeEqual.java
8fe93c3c655c983d94746e59b1f9d92eff2b2646
[]
no_license
jhhelloworld/coding
0006645a4c9115f843c4b5f82608861b35de84b9
eff9d949c0b3d3b048717f49d7c9cc2a71c34d5b
refs/heads/master
2023-04-10T12:38:54.402231
2023-03-27T11:13:16
2023-03-27T11:13:16
129,262,492
0
0
null
null
null
null
UTF-8
Java
false
false
4,138
java
package zcy_算法与数据结构进阶班.trainingcamp001.class04; import java.util.ArrayList; public class Code02_TreeEqual { public static class Node { public int value; public Node left; public Node right; public Node(int v) { value = v; } } // big做头节点的树,其中是否有某棵子树的结构,是和small为头的树,完全一样的 public static boolean containsTree1(Node big, Node small) { if (small == null) { return true; } // small != null if (big == null) { return false; } // big!=null small!=null if (isSameValueStructure(big, small)) { return true; } return containsTree1(big.left, small) || containsTree1(big.right, small); } // head1为头的树,是否在结构对应上,完全和head2一样 public static boolean isSameValueStructure(Node head1, Node head2) { if (head1 == null && head2 != null) { return false; } if (head1 != null && head2 == null) { return false; } if (head1 == null && head2 == null) { return true; } if (head1.value != head2.value) { return false; } // head1.value == head2.value return isSameValueStructure(head1.left, head2.left) && isSameValueStructure(head1.right, head2.right); } public static boolean containsTree2(Node big, Node small) { if (small == null) { return true; } if (big == null) { return false; } ArrayList<String> b = preSerial(big); ArrayList<String> s = preSerial(small); String[] str = new String[b.size()]; for (int i = 0; i < str.length; i++) { str[i] = b.get(i); } String[] match = new String[s.size()]; for (int i = 0; i < match.length; i++) { match[i] = s.get(i); } return getIndexOf(str, match) != -1; } public static ArrayList<String> preSerial(Node head) { ArrayList<String> ans = new ArrayList<>(); pres(head, ans); return ans; } public static void pres(Node head, ArrayList<String> ans) { if (head == null) { ans.add(null); } else { ans.add(String.valueOf(head.value)); pres(head.left, ans); pres(head.right, ans); } } public static int getIndexOf(String[] str1, String[] str2) { if (str1 == null || str2 == null || str1.length < 1 || str1.length < str2.length) { return -1; } int x = 0; int y = 0; int[] next = getNextArray(str2); while (x < str1.length && y < str2.length) { if (isEqual(str1[x], str2[y])) { x++; y++; } else if (next[y] == -1) { x++; } else { y = next[y]; } } return y == str2.length ? x - y : -1; } public static int[] getNextArray(String[] ms) { if (ms.length == 1) { return new int[] { -1 }; } int[] next = new int[ms.length]; next[0] = -1; next[1] = 0; int i = 2; int cn = 0; while (i < next.length) { if (isEqual(ms[i - 1], ms[cn])) { next[i++] = ++cn; } else if (cn > 0) { cn = next[cn]; } else { next[i++] = 0; } } return next; } public static boolean isEqual(String a, String b) { if (a == null && b == null) { return true; } else { if (a == null || b == null) { return false; } else { return a.equals(b); } } } // for test public static Node generateRandomBST(int maxLevel, int maxValue) { return generate(1, maxLevel, maxValue); } // for test public static Node generate(int level, int maxLevel, int maxValue) { if (level > maxLevel || Math.random() < 0.5) { return null; } Node head = new Node((int) (Math.random() * maxValue)); head.left = generate(level + 1, maxLevel, maxValue); head.right = generate(level + 1, maxLevel, maxValue); return head; } public static void main(String[] args) { int bigTreeLevel = 7; int smallTreeLevel = 4; int nodeMaxValue = 5; int testTimes = 100000; System.out.println("test begin"); for (int i = 0; i < testTimes; i++) { Node big = generateRandomBST(bigTreeLevel, nodeMaxValue); Node small = generateRandomBST(smallTreeLevel, nodeMaxValue); boolean ans1 = containsTree1(big, small); boolean ans2 = containsTree2(big, small); if (ans1 != ans2) { System.out.println("Oops!"); } } System.out.println("test finish!"); } }
[ "jianghua07@meituan.com" ]
jianghua07@meituan.com
2aa0e5f70a8f3e77709c2f39f1ddf4c1fe605da8
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/matrix/report/e$b$b$$ExternalSyntheticLambda1.java
5c237dafa809dc279671761514095f443031e60a
[]
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
399
java
package com.tencent.matrix.report; import com.tencent.matrix.a.b.d; public final class e$b$b$$ExternalSyntheticLambda1 implements d { public final void accept(Object arg1) {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes7.jar * Qualified Name: com.tencent.matrix.report.e.b.b..ExternalSyntheticLambda1 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
59b1aa2ab1edcdc4312e6b45357074d2ff9553cb
4080f5a31c14c46ced4cfa02af5228664adf140d
/src/com/wen/EleventhFifty/BaseSeven.java
d999d614bd6fa0cf833239ad1958be7f57e47023
[]
no_license
Jeff-Playground/LeetCode
43aa5e760f694650048a9c1feb2a3cf8f444e6e9
2e2e3987ccc605835cf04c2db1330dfb339f34aa
refs/heads/master
2023-08-25T08:41:07.304552
2023-08-03T20:21:41
2023-08-03T20:21:41
166,677,973
3
0
null
null
null
null
UTF-8
Java
false
false
837
java
package com.wen.EleventhFifty; public class BaseSeven { // Recursive public String convertToBase7(int num) { if(num<0){ return "-"+convertToBase7(-num); } else if(num<7){ return String.valueOf(num); } else{ return convertToBase7(num/7)+String.valueOf(num%7); } } // // Iterative // public String convertToBase7(int num) { // boolean isNeg=false; // if(num<0){ // isNeg=true; // num=-num; // } // StringBuilder sb=new StringBuilder(); // do { // int remainder=num%7; // num/=7; // sb.append(String.valueOf(remainder)); // } while(num>0); // if(isNeg){ // sb.append("-"); // } // return sb.reverse().toString(); // } }
[ "wenjianxiong91@gmail.com" ]
wenjianxiong91@gmail.com
b287c114614c2b7678d7509ab85f69a89692053a
e082ffadd6482e20972a21b217e4e855ea5bbdf8
/study-patterns/src/main/java/com/sbt/SpringBeans/figure/Figure.java
b887cbff8fb6f0d413eef3f237ead9729e146c8e
[]
no_license
dimka668/java_study
ec01228f50bb1029a60b35151eca6d692b8d4116
f80caf089941cc041957c8ba146c3f076cef60cd
refs/heads/master
2022-12-25T01:19:31.756145
2020-05-14T16:11:02
2020-05-14T16:11:02
165,732,975
0
0
null
2022-12-16T10:37:10
2019-01-14T20:50:18
Java
UTF-8
Java
false
false
381
java
package com.sbt.SpringBeans.figure; /** * Created by SBT-Klyshov-DA on 16.05.2018. */ public abstract class Figure { private String name; public Figure(String name) { this.name = name; System.out.println("Bean " + name + " has been created"); } public String getName() { return this.name; } public abstract double square(); }
[ "11" ]
11
d4df752e6893353ac593cedf3dafc71c725d17d3
d048e0ae2d5d7e2c779836cf2377f0bc5ecd2744
/app/src/main/java/com/example/meechao/basemvp/utils/dialog/PopupDialog.java
a048feba9e1f0a146d8669a59edd755f5609203e
[]
no_license
jihaifeng/BaseMvp
5510db92cee4fb73917975761956c7f6736046bd
4858703b4b0d80a6d0c2b09b122fa874bebe9585
refs/heads/master
2021-04-26T23:43:23.283208
2018-03-12T06:45:51
2018-03-12T06:45:51
123,844,976
0
0
null
null
null
null
UTF-8
Java
false
false
4,269
java
package com.example.meechao.basemvp.utils.dialog; import android.app.Dialog; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.TextView; import com.example.meechao.basemvp.R; /** * Func:自定义dialog提示框,仿ios * Desc: * Author:JHF * Date:2018-03-01 16:14 * Mail:jihaifeng@meechao.com */ public class PopupDialog extends Dialog { private Context context;//上下文 private String title;//标题 private String confirmButtonText;//确定按钮文字 private String cancelButtonText;//取消按钮文字 private String content;//内容文本 private ClickListenerInterface clickListenerInterface;//确定 取消 按钮回调接口 public abstract static class ClickListenerInterface { //确定按钮回调 private void doConfirm(PopupDialog dialog) { dialog.dismiss(); _doConfirm(); } protected abstract void _doConfirm(); //取消按钮回调 private void doCancel(PopupDialog dialog) { dialog.dismiss(); _doCancel(); } void _doCancel() { } } /** * @param context 上下文 * @param title 标题 * @param contentText 内容 * @param confirmButtonText 确认按钮文字 * @param cancelButtonText 取消按钮文字 */ public PopupDialog(Context context, String title, String contentText, String confirmButtonText, String cancelButtonText) { super(context, R.style.dialog_style_ios); this.context = context; this.title = title; this.confirmButtonText = confirmButtonText; this.cancelButtonText = cancelButtonText; this.content = contentText; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); init(); } /** * 初始化 */ public void init() { LayoutInflater inflater = LayoutInflater.from(context); View view = inflater.inflate(R.layout.dialog_popup, null); setContentView(view); TextView tvTitle = view.findViewById(R.id.title); Button tvConfirm = view.findViewById(R.id.confirm); Button tvCancel = view.findViewById(R.id.cancel); TextView txt_content = view.findViewById(R.id.txt_content); txt_content.setText(content); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { tvConfirm.setBackground( context.getResources().getDrawable(R.drawable.dialog_bottom_right_btn)); } if (confirmButtonText != null && !confirmButtonText.equals("")) { tvConfirm.setText(confirmButtonText); } if (title != null && !title.equals("")) { tvTitle.setText(title); tvTitle.setVisibility(View.VISIBLE); } if (cancelButtonText != null && !cancelButtonText.equals("")) { tvCancel.setText(cancelButtonText); tvCancel.setVisibility(View.VISIBLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { tvConfirm.setBackground( context.getResources().getDrawable(R.drawable.dialog_bottom_right_btn)); } } tvConfirm.setOnClickListener(new clickListener()); tvCancel.setOnClickListener(new clickListener()); Window dialogWindow = getWindow(); WindowManager.LayoutParams lp = dialogWindow.getAttributes(); DisplayMetrics d = context.getResources().getDisplayMetrics(); // 获取屏幕宽、高用 lp.width = (int) (d.widthPixels * 0.8); // 高度设置为屏幕的0.6 dialogWindow.setAttributes(lp); } public void setClicklistener(ClickListenerInterface clickListenerInterface) { this.clickListenerInterface = clickListenerInterface; } private class clickListener implements View.OnClickListener { @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.confirm) { clickListenerInterface.doConfirm(PopupDialog.this); } else if (id == R.id.cancel) { clickListenerInterface.doCancel(PopupDialog.this); } } } }
[ "1104128141@qq.com" ]
1104128141@qq.com
e61060efd3026a1d5dda5e808e7fcf1166425930
7da6648b7b39329e49decc9f8103ce259ab37fbf
/TP/dc/src/main/java/cn/fintechstar/dc/config/RabbitConfig.java
c9312f1e164514d7ebc803101e778b3026b05731
[]
no_license
codingsf/source_code
8441775ccc89b0382b76bd9ceb6a6f8e47b7478c
7a247411a84386fa001882310e6478f9251b66f2
refs/heads/master
2020-03-22T03:37:04.588887
2018-06-12T06:25:12
2018-06-12T06:25:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,502
java
package cn.fintechstar.dc.config; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.BindingBuilder; import org.springframework.amqp.core.Queue; import org.springframework.amqp.core.TopicExchange; import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.core.RabbitAdmin; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Scope; import cn.fintechstar.dc.constant.RabbitProperties; @Configuration public class RabbitConfig { @Autowired private RabbitProperties rabbitProperties; @Bean public ConnectionFactory connectionFactory(){ CachingConnectionFactory connectionFactory = new CachingConnectionFactory(); connectionFactory.setAddresses(rabbitProperties.getHost()); connectionFactory.setPort(rabbitProperties.getPort()); connectionFactory.setVirtualHost(rabbitProperties.getVhost()); connectionFactory.setUsername(rabbitProperties.getUsername()); connectionFactory.setPassword(rabbitProperties.getPassword()); connectionFactory.setRequestedHeartBeat(0); connectionFactory.setChannelCacheSize(100); connectionFactory.setPublisherConfirms(false); connectionFactory.setPublisherReturns(false); return connectionFactory; } @Bean public RabbitAdmin rabbitAdmin(){ RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory()); rabbitAdmin.setAutoStartup(true); rabbitAdmin.declareQueue(); return rabbitAdmin; } @Bean @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public RabbitTemplate rabbitTemplate(){ return rabbitAdmin().getRabbitTemplate(); } @Bean public TopicExchange signalExchange() { return new TopicExchange(rabbitProperties.getSignalExchange(), false, false); } @Bean public Queue historySignalReqQueue() { return new Queue(rabbitProperties.getQueue().get("historySignalReq"), false, false, true); } @Bean public Binding historySignalReqBinding() { return BindingBuilder.bind(historySignalReqQueue()).to(signalExchange()).with(rabbitProperties.getQueue().get("historySignalReq")); } }
[ "kevin.fu@fintechstar.cn" ]
kevin.fu@fintechstar.cn
3f7f8aad67a0e56b09b606c9fa8c0a4365f1cd98
8eccff4732e2e88998e665a615a295e7e577fc20
/Webdriver/src/day4/WhileLoop.java
483932e4ed197b51dc1507424d8f41991ec8bd1f
[]
no_license
SaiKrishna12/August12BatchPrograms
7f418a2673599a01a8675010e9305fbe12db6163
795d261c96290d2710a330fe2d5ba385962f09f9
refs/heads/master
2021-01-10T15:35:26.912611
2015-10-03T07:37:02
2015-10-03T07:37:02
43,591,670
0
0
null
null
null
null
UTF-8
Java
false
false
230
java
package day4; public class WhileLoop { public static void main(String[] args) { int i=1; while(i<=10) { int j=1; while(j<=10) { System.out.println(i+"*"+j+"="+j*i); j=j+1; } i=i+1; } } }
[ "saikrishna_gandham@yahoo.co.in" ]
saikrishna_gandham@yahoo.co.in
081b5f926e13be458d42db915589d9e202c11d63
8c2e243ce8bcfce4f67c50c7ba6340e874633cda
/com/google/android/gms/internal/zzasa.java
966668e2e797160b0fe1037dec4016e29d30edf0
[]
no_license
atresumes/Tele-2
f84a095a48ccd5b423acf14268e600fc59635a36
e98d32baab40b8dfc7f2c30d165b73393a1b0dd9
refs/heads/master
2020-03-21T11:22:20.490680
2018-06-24T17:45:25
2018-06-24T17:45:25
138,503,432
0
1
null
null
null
null
UTF-8
Java
false
false
3,305
java
package com.google.android.gms.internal; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.zzb; import com.google.android.gms.common.internal.safeparcel.zzb.zza; import com.google.android.gms.common.internal.safeparcel.zzc; public class zzasa implements Creator<zzarz> { static void zza(zzarz com_google_android_gms_internal_zzarz, Parcel parcel, int i) { int zzaV = zzc.zzaV(parcel); zzc.zza(parcel, 1, com_google_android_gms_internal_zzarz.getRequestId(), false); zzc.zza(parcel, 2, com_google_android_gms_internal_zzarz.getExpirationTime()); zzc.zza(parcel, 3, com_google_android_gms_internal_zzarz.zzHG()); zzc.zza(parcel, 4, com_google_android_gms_internal_zzarz.getLatitude()); zzc.zza(parcel, 5, com_google_android_gms_internal_zzarz.getLongitude()); zzc.zza(parcel, 6, com_google_android_gms_internal_zzarz.getRadius()); zzc.zzc(parcel, 7, com_google_android_gms_internal_zzarz.zzHH()); zzc.zzc(parcel, 1000, com_google_android_gms_internal_zzarz.getVersionCode()); zzc.zzc(parcel, 8, com_google_android_gms_internal_zzarz.zzHI()); zzc.zzc(parcel, 9, com_google_android_gms_internal_zzarz.zzHJ()); zzc.zzJ(parcel, zzaV); } public /* synthetic */ Object createFromParcel(Parcel parcel) { return zzgT(parcel); } public /* synthetic */ Object[] newArray(int i) { return zzku(i); } public zzarz zzgT(Parcel parcel) { int zzaU = zzb.zzaU(parcel); int i = 0; String str = null; int i2 = 0; short s = (short) 0; double d = 0.0d; double d2 = 0.0d; float f = 0.0f; long j = 0; int i3 = 0; int i4 = -1; while (parcel.dataPosition() < zzaU) { int zzaT = zzb.zzaT(parcel); switch (zzb.zzcW(zzaT)) { case 1: str = zzb.zzq(parcel, zzaT); break; case 2: j = zzb.zzi(parcel, zzaT); break; case 3: s = zzb.zzf(parcel, zzaT); break; case 4: d = zzb.zzn(parcel, zzaT); break; case 5: d2 = zzb.zzn(parcel, zzaT); break; case 6: f = zzb.zzl(parcel, zzaT); break; case 7: i2 = zzb.zzg(parcel, zzaT); break; case 8: i3 = zzb.zzg(parcel, zzaT); break; case 9: i4 = zzb.zzg(parcel, zzaT); break; case 1000: i = zzb.zzg(parcel, zzaT); break; default: zzb.zzb(parcel, zzaT); break; } } if (parcel.dataPosition() == zzaU) { return new zzarz(i, str, i2, s, d, d2, f, j, i3, i4); } throw new zza("Overread allowed size end=" + zzaU, parcel); } public zzarz[] zzku(int i) { return new zzarz[i]; } }
[ "40494744+atresumes@users.noreply.github.com" ]
40494744+atresumes@users.noreply.github.com
c5fd63f0b0e05ffb97a4e079e4e257ef5817fa54
1b7c0afaa88978171266acf3b2a53615111784c0
/src/main/java/douglea/test1/Reactor.java
03a7db6299416827d81af0cda53f26f9c1463530
[]
no_license
huyuxiang/niostudy
0b483b4f80242da1c9037844bf176b6cd043e015
70468366684e01c7f4104bf8b979ff2909f06c83
refs/heads/master
2020-04-13T21:40:50.445467
2016-10-10T03:38:21
2016-10-10T03:38:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,537
java
package douglea.test1; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.Iterator; import java.util.Set; public class Reactor implements Runnable { final Selector selector; final ServerSocketChannel serverSocket; Reactor(int port) throws IOException { selector = Selector.open(); serverSocket = ServerSocketChannel.open(); serverSocket.socket().bind( new InetSocketAddress(port)); serverSocket.configureBlocking(false); SelectionKey sk = serverSocket.register(selector, SelectionKey.OP_ACCEPT); sk.attach(new Acceptor()); } public void run() { try { while(!Thread.interrupted()) { selector.select(); Set selected = selector.selectedKeys(); Iterator it = selected.iterator(); while(it.hasNext()) { dispatch((SelectionKey)(it.next())); } selected.clear(); } } catch(IOException e) { } } void dispatch(SelectionKey k) { Runnable r = (Runnable) (k.attachment()); if(r!=null) r.run(); } class Acceptor implements Runnable { public void run() { try { SocketChannel c = serverSocket.accept(); if(c!=null) new Handler(selector, c); } catch(IOException e) { } } } static final int MAXIN = 1024; static final int MAXOUT = 1024; final class Handler implements Runnable { final SocketChannel socket; final SelectionKey sk ; ByteBuffer input = ByteBuffer.allocate(MAXIN); ByteBuffer output = ByteBuffer.allocate(MAXOUT); static final int READING = 0, SENDING = 1; int state = READING; Handler(Selector sel, SocketChannel c) throws IOException { socket = c; c.configureBlocking(false); sk = socket.register(sel, 0); sk.attach(this); sk.interestOps(SelectionKey.OP_READ); sel.wakeup(); } boolean inputIsComplete() { return false; } boolean outputIsComplete() { return false; } void process() { } public void run() { try { if(state==READING) read(); else if(state ==SENDING) send(); } catch(IOException e) { } } void read() throws IOException { socket.read(input); if(inputIsComplete()) { process(); state = SENDING; sk.interestOps(SelectionKey.OP_WRITE); } } void send() throws IOException { socket.write(output); if(outputIsComplete()) sk.cancel(); } } }
[ "1678907570@qq.com" ]
1678907570@qq.com
c48e94e14360b4fb0f0782fde53af40a6490ad0f
75a8892e4be8c81cbebc07153d53ccc379528287
/capitulo9/exercicios/Exercicio02.java
cfc09ce2a45d901470133b04b4a9776dfd61104f
[]
no_license
lfbessegato/Estudos-Java
da2d50c5965eae6b804306fef0457885341f7ac1
d358a777feb967147c125bf10cf302a1e9b96e43
refs/heads/master
2020-08-07T02:04:22.877913
2019-10-06T22:26:50
2019-10-06T22:26:50
213,252,991
1
0
null
null
null
null
UTF-8
Java
false
false
1,611
java
package course.capitulo9.exercicios; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Scanner; import course.capitulo9.entities.ImportedProduct; import course.capitulo9.entities.Product; import course.capitulo9.entities.UsedProduct; public class Exercicio02 { public static void main(String[] args) throws ParseException { Locale.setDefault(Locale.US); Scanner sc = new Scanner(System.in); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); List<Product> list = new ArrayList<>(); System.out.print("Enter the number of products: "); int n = sc.nextInt(); for (int i=1; i<=n; i++) { System.out.println("Product #" + i + " data:"); System.out.print("Common, used or imported (c/u/i)? "); char type = sc.next().charAt(0); System.out.print("Name: "); sc.nextLine(); String name = sc.nextLine(); System.out.print("Price: "); double price = sc.nextDouble(); if (type == 'c') { list.add(new Product(name, price)); } else if (type == 'u') { System.out.print("Manufacture date (DD/MM/YYYY): "); Date date = sdf.parse(sc.next()); list.add(new UsedProduct(name, price, date)); } else { System.out.print("Customs fee: "); double customsFee = sc.nextDouble(); list.add(new ImportedProduct(name, price, customsFee)); } } System.out.println(); System.out.println("PRICE TAGS:"); for (Product prod : list) { System.out.println(prod.priceTag()); } sc.close(); } }
[ "lfrbessegato@gmail.com" ]
lfrbessegato@gmail.com
4c5cbaf71d9030e8353009f8a012dc65f55d90af
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XRENDERING-422-10-13-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener_ESTest_scaffolding.java
d5f883bcf6d85aaf06de9a1de30ffdd0c95d31cf
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
479
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Mar 31 20:08:51 UTC 2020 */ package org.xwiki.rendering.internal.parser.wikimodel; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DefaultXWikiGeneratorListener_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d23dde7d0c90061b79c91a4b77d3b20db01c5d78
69db466b12bf8152ed146178a99b3edc909b15a9
/tinyos.dlrc.parser.nesc12/src/tinyos/dlrc/nesc12/parser/ast/util/pushers/NesCFieldPusher.java
d9b6ddcef7b9e02ca9237bb78bcc6d54fb508eb8
[]
no_license
mahmoudimus/dlrc-tinyos-plugin
788a575a3cc909b049d4b5b9da9d6370a50eccc9
9e1c6e495f7ac15966a1463f66700f7f4b619381
refs/heads/master
2021-05-29T09:52:46.507638
2013-08-22T08:11:57
2013-08-22T08:11:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,468
java
/* * Dlrc 2, NesC development in Eclipse. * Copyright (C) 2009 DLRC * * 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/>. * * Web: http://tos-ide.ethz.ch * Mail: tos-ide@tik.ee.ethz.ch */ package tinyos.dlrc.nesc12.parser.ast.util.pushers; import java.util.ArrayList; import java.util.List; import tinyos.dlrc.ep.parser.Tag; import tinyos.dlrc.nesc12.ep.nodes.FieldModelNode; import tinyos.dlrc.nesc12.parser.ast.AnalyzeStack; import tinyos.dlrc.nesc12.parser.ast.elements.Field; import tinyos.dlrc.nesc12.parser.ast.elements.Name; import tinyos.dlrc.nesc12.parser.ast.elements.Type; public class NesCFieldPusher extends StandardFieldPusher{ public NesCFieldPusher( String name, AnalyzeStack stack ){ super( name, stack ); } /** * Ensures that the fields are functions */ protected void checkIsFunctionType(){ List<Name> names = new ArrayList<Name>(); for( Definition definition : definitions ){ if( !definition.typedef ){ Field field = definition.getField(); if( field != null ){ FieldModelNode node = field.asNode(); if( node != null && (node.getTags().contains( Tag.USES ) || node.getTags().contains( Tag.PROVIDES ))){ Type type = definition.type(); if( type == null || type.asFunctionType() == null ){ names.add( definition.getName() ); } } } } } if( names.size() > 0 ){ error( "'" + name + "' must have a function type", names ); } } /** * Checks whether the field is defined only once in the uses/provides clause. * @return the definition of the field */ protected Definition checkDefinedOnlyOnce(){ Definition result = null; List<Name> names = new ArrayList<Name>(); for( Definition definition : definitions ){ if( !definition.typedef ){ Field field = definition.getField(); if( field != null ){ FieldModelNode node = field.asNode(); if( node != null ){ if( node.getTags().contains( Tag.USES ) || node.getTags().contains( Tag.PROVIDES )){ Name name = node.getName(); if( name != null ){ names.add( name ); } result = definition; } } } } } if( names.size() > 1 ){ error( "multiple definitions of command/event '" + name + "'", names ); return null; } return result; } }
[ "heavey@heavey-ThinkPad-T420.(none)" ]
heavey@heavey-ThinkPad-T420.(none)
9f778548695f6a5a027db0dc003c73c0c97d45a8
a938c8162313da137e94d6a9d223d1ec8db5a5ca
/NicadOutputFile_maven/Clone Pairs 342/Nicad_maven683.java
18c344bdf7c2e97f2e03cf3098e9c5b02c0674f7
[]
no_license
ryosuke-ku/Nicad_ScrapinG
a94a61574dc17585047624b827639196b23b8e21
62200621eb293d7a8953ef6e18a7e0f2019ecc48
refs/heads/master
2020-06-29T22:03:44.189953
2019-08-05T13:17:57
2019-08-05T13:17:57
200,636,057
0
0
null
null
null
null
UTF-8
Java
false
false
599
java
//1618:maven/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java //maven/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java public class Nicad_maven683 { public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } IntItem intItem = (IntItem) o; return value == intItem.value; }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
2b22a920e152d7aa2d4de178db840449eb8d4dcc
9f27b9da45d5f54feddeb3367c1d7944b7283733
/lang/java/avro/src/main/java/org/apache/avro/MultiConverter.java
511a193c7dbf20f428c0ba90001fc76b055a2c4a
[ "Apache-2.0", "BSD-3-Clause", "MIT" ]
permissive
zolyfarkas/avro
a151b8d5cdd3e26e6cba2b34563e3a48f335a74e
dae9b44dc61a475f8c9d1164646bc3547fcb97ee
refs/heads/trunk
2023-01-04T01:57:17.409955
2022-12-22T12:48:14
2022-12-22T12:48:14
161,528,778
18
11
Apache-2.0
2019-05-22T09:34:34
2018-12-12T18:28:41
Java
UTF-8
Java
false
false
5,689
java
package org.apache.avro; import java.io.IOException; import java.nio.ByteBuffer; import java.util.Collection; import java.util.Map; import org.apache.avro.generic.GenericEnumSymbol; import org.apache.avro.generic.GenericFixed; import org.apache.avro.generic.IndexedRecord; import org.apache.avro.io.Decoder; import org.apache.avro.io.Encoder; import org.apache.avro.util.Optional; /** * An converter adapter, for conversion switching based on logical type. * @author Zoltan Farkas */ public class MultiConverter<T> extends Conversion<T> { public interface Chooser { int chose(LogicalType type); } private final Conversion<T>[] conversions; private final Chooser chooser; @SafeVarargs public MultiConverter(Chooser chooser, Conversion<T>... conversions) { this.conversions = conversions; this.chooser = chooser; } @Override public Class<T> getConvertedType() { return conversions[0].getConvertedType(); } @Override public String getLogicalTypeName() { return conversions[0].getLogicalTypeName(); } public Optional<T> tryDirectDecode(Decoder enc, Schema schema) throws IOException { return conversions[chooser.chose(schema.getLogicalType())].tryDirectDecode(enc, schema); } public boolean tryDirectEncode(T object, Encoder enc, Schema schema) throws IOException { return conversions[chooser.chose(schema.getLogicalType())].tryDirectEncode(object, enc, schema); } public int computehashCode(T object) { return conversions[0].computehashCode(object); } @Override public IndexedRecord toRecord(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toRecord(value, schema, type); } @Override public Map<?, ?> toMap(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toMap(value, schema, type); } @Override public Collection<?> toArray(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toArray(value, schema, type); } @Override public ByteBuffer toBytes(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toBytes(value, schema, type); } @Override public GenericFixed toFixed(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toFixed(value, schema, type); } @Override public GenericEnumSymbol toEnumSymbol(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toEnumSymbol(value, schema, type); } @Override public CharSequence toCharSequence(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toCharSequence(value, schema, type); } @Override public Double toDouble(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toDouble(value, schema, type); } @Override public Float toFloat(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toFloat(value, schema, type); } @Override public Long toLong(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toLong(value, schema, type); } @Override public Integer toInt(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toInt(value, schema, type); } @Override public Boolean toBoolean(T value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].toBoolean(value, schema, type); } @Override public T fromRecord(IndexedRecord value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromRecord(value, schema, type); } @Override public T fromMap(Map<?, ?> value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromMap(value, schema, type); } @Override public T fromArray(Collection<?> value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromArray(value, schema, type); } @Override public T fromBytes(ByteBuffer value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromBytes(value, schema, type); } @Override public T fromFixed(GenericFixed value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromFixed(value, schema, type); } @Override public T fromEnumSymbol(GenericEnumSymbol value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromEnumSymbol(value, schema, type); } @Override public T fromCharSequence(CharSequence value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromCharSequence(value, schema, type); } @Override public T fromDouble(Double value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromDouble(value, schema, type); } @Override public T fromFloat(Float value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromFloat(value, schema, type); } @Override public T fromLong(Long value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromLong(value, schema, type); } @Override public T fromInt(Integer value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromInt(value, schema, type); } @Override public T fromBoolean(Boolean value, Schema schema, LogicalType type) { return conversions[chooser.chose(type)].fromBoolean(value, schema, type); } @Override public String adjustAndSetValue(String varName, String valParamName) { return conversions[0].adjustAndSetValue(varName, valParamName); } }
[ "zolyfarkas@yahoo.com" ]
zolyfarkas@yahoo.com
89a94d3fc2518f99a1e94531530cd85c1084d86d
5456502f97627278cbd6e16d002d50f1de3da7bb
/testing/android/native_test/java/src/org/chromium/native_test/NativeUnitTest.java
19e03f8a6d69a0d3b5beee8dba059680b4ed070b
[ "BSD-3-Clause" ]
permissive
TrellixVulnTeam/Chromium_7C66
72d108a413909eb3bd36c73a6c2f98de1573b6e5
c8649ab2a0f5a747369ed50351209a42f59672ee
refs/heads/master
2023-03-16T12:51:40.231959
2017-12-20T10:38:26
2017-12-20T10:38:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,689
java
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.native_test; import android.app.Activity; import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.PathUtils; import org.chromium.base.PowerMonitor; import org.chromium.base.library_loader.NativeLibraries; /** * A helper for running native unit tests (i.e., not browser tests) */ public class NativeUnitTest extends NativeTest { private static final String TAG = "cr_NativeTest"; @Override public void preCreate(Activity activity) { super.preCreate(activity); // Necessary because NativeUnitTestActivity uses BaseChromiumApplication which does not // initialize ContextUtils. ContextUtils.initApplicationContext(activity.getApplicationContext()); // Needed by path_utils_unittest.cc PathUtils.setPrivateDataDirectorySuffix("chrome"); // Needed by system_monitor_unittest.cc PowerMonitor.createForTests(activity); // For NativeActivity based tests, // dependency libraries must be loaded before NativeActivity::OnCreate, // otherwise loading android.app.lib_name will fail loadLibraries(); } private void loadLibraries() { for (String library : NativeLibraries.LIBRARIES) { Log.i(TAG, "loading: %s", library); System.loadLibrary(library); Log.i(TAG, "loaded: %s", library); } ContextUtils.initApplicationContextForNative(); } }
[ "lixiaodonglove7@aliyun.com" ]
lixiaodonglove7@aliyun.com
dd914f68f4e07a2f72562be774ddaa7091e41186
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/draft/api/model/DraftIds.java
63d8324ee16e63e429d2c7dedcf85faf4ccbdaed
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
371
java
package com.zhihu.android.draft.api.model; import java.util.List; public class DraftIds { private List<String> ids; public List<String> getIds() { return this.ids; } public DraftIds() { } public DraftIds(List<String> list) { this.ids = list; } public void setIds(List<String> list) { this.ids = list; } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
231bb99908a064c28632365312f566ff2a384997
8dc84558f0058d90dfc4955e905dab1b22d12c08
/third_party/android_tools/sdk/sources/android-25/com/android/server/ethernet/EthernetServiceImpl.java
42996d6826f28fea48f225952442f159a49ccece
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause", "Apache-2.0", "LGPL-2.0-or-later", "GPL-1.0-or-later", "MIT" ]
permissive
meniossin/src
42a95cc6c4a9c71d43d62bc4311224ca1fd61e03
44f73f7e76119e5ab415d4593ac66485e65d700a
refs/heads/master
2022-12-16T20:17:03.747113
2020-09-03T10:43:12
2020-09-03T10:43:12
263,710,168
1
0
BSD-3-Clause
2020-05-13T18:20:09
2020-05-13T18:20:08
null
UTF-8
Java
false
false
6,420
java
/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.ethernet; import android.content.Context; import android.content.pm.PackageManager; import android.net.IEthernetManager; import android.net.IEthernetServiceListener; import android.net.IpConfiguration; import android.net.IpConfiguration.IpAssignment; import android.net.IpConfiguration.ProxySettings; import android.os.Binder; import android.os.Handler; import android.os.HandlerThread; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.provider.Settings; import android.util.Log; import android.util.PrintWriterPrinter; import com.android.internal.util.IndentingPrintWriter; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.concurrent.atomic.AtomicBoolean; /** * EthernetServiceImpl handles remote Ethernet operation requests by implementing * the IEthernetManager interface. * * @hide */ public class EthernetServiceImpl extends IEthernetManager.Stub { private static final String TAG = "EthernetServiceImpl"; private final Context mContext; private final EthernetConfigStore mEthernetConfigStore; private final AtomicBoolean mStarted = new AtomicBoolean(false); private IpConfiguration mIpConfiguration; private Handler mHandler; private final EthernetNetworkFactory mTracker; private final RemoteCallbackList<IEthernetServiceListener> mListeners = new RemoteCallbackList<IEthernetServiceListener>(); public EthernetServiceImpl(Context context) { mContext = context; Log.i(TAG, "Creating EthernetConfigStore"); mEthernetConfigStore = new EthernetConfigStore(); mIpConfiguration = mEthernetConfigStore.readIpAndProxyConfigurations(); Log.i(TAG, "Read stored IP configuration: " + mIpConfiguration); mTracker = new EthernetNetworkFactory(mListeners); } private void enforceAccessPermission() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.ACCESS_NETWORK_STATE, "EthernetService"); } private void enforceConnectivityInternalPermission() { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.CONNECTIVITY_INTERNAL, "ConnectivityService"); } public void start() { Log.i(TAG, "Starting Ethernet service"); HandlerThread handlerThread = new HandlerThread("EthernetServiceThread"); handlerThread.start(); mHandler = new Handler(handlerThread.getLooper()); mTracker.start(mContext, mHandler); mStarted.set(true); } /** * Get Ethernet configuration * @return the Ethernet Configuration, contained in {@link IpConfiguration}. */ @Override public IpConfiguration getConfiguration() { enforceAccessPermission(); synchronized (mIpConfiguration) { return new IpConfiguration(mIpConfiguration); } } /** * Set Ethernet configuration */ @Override public void setConfiguration(IpConfiguration config) { if (!mStarted.get()) { Log.w(TAG, "System isn't ready enough to change ethernet configuration"); } enforceConnectivityInternalPermission(); synchronized (mIpConfiguration) { mEthernetConfigStore.writeIpAndProxyConfigurations(config); // TODO: this does not check proxy settings, gateways, etc. // Fix this by making IpConfiguration a complete representation of static configuration. if (!config.equals(mIpConfiguration)) { mIpConfiguration = new IpConfiguration(config); mTracker.stop(); mTracker.start(mContext, mHandler); } } } /** * Indicates whether the system currently has one or more * Ethernet interfaces. */ @Override public boolean isAvailable() { enforceAccessPermission(); return mTracker.isTrackingInterface(); } /** * Addes a listener. * @param listener A {@link IEthernetServiceListener} to add. */ public void addListener(IEthernetServiceListener listener) { if (listener == null) { throw new IllegalArgumentException("listener must not be null"); } enforceAccessPermission(); mListeners.register(listener); } /** * Removes a listener. * @param listener A {@link IEthernetServiceListener} to remove. */ public void removeListener(IEthernetServiceListener listener) { if (listener == null) { throw new IllegalArgumentException("listener must not be null"); } enforceAccessPermission(); mListeners.unregister(listener); } @Override protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) != PackageManager.PERMISSION_GRANTED) { pw.println("Permission Denial: can't dump EthernetService from pid=" + Binder.getCallingPid() + ", uid=" + Binder.getCallingUid()); return; } pw.println("Current Ethernet state: "); pw.increaseIndent(); mTracker.dump(fd, pw, args); pw.decreaseIndent(); pw.println(); pw.println("Stored Ethernet configuration: "); pw.increaseIndent(); pw.println(mIpConfiguration); pw.decreaseIndent(); pw.println("Handler:"); pw.increaseIndent(); mHandler.dump(new PrintWriterPrinter(pw), "EthernetServiceImpl"); pw.decreaseIndent(); } }
[ "arnaud@geometry.ee" ]
arnaud@geometry.ee
24cdacb009470ce0eda0d279fba3588d280ba1fa
dadfba4c79dc3083cda8daf08a036dd3c281124c
/1.JavaSyntax/src/com/javarush/task/task04/task0402/Solution.java
4f4454f97ca994bad77b2a5ff5d397c1f38e34c6
[]
no_license
CosmicCis/JavaRushTasks
6e70f44605ef4d540b940f509c949b41b0613a37
4c4a2e437df583908547b94a739211d367073ad1
refs/heads/master
2023-07-27T11:22:51.228892
2021-09-04T15:12:36
2021-09-04T15:12:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package com.javarush.task.task04.task0402; /* Цена яблок */ public class Solution { public static void main(String[] args) { Apple apple = new Apple(); apple.addPrice(50); Apple apple2 = new Apple(); apple2.addPrice(100); System.out.println("Стоимость яблок " + Apple.applesPrice); } public static class Apple { public static int applesPrice = 0; public static void addPrice(int applesPrice) { Apple.applesPrice += applesPrice; //напишите тут ваш код } } }
[ "romanist-mike@yandex.ru" ]
romanist-mike@yandex.ru
59ee4c729e6f8066e16684607162544da39b4e1e
671daf60cdb46250214da19132bb7f21dbc29612
/android-lint/testData/lint/parcelLoader_after.java
cb4f6a19e62f5bcf107a61cf45219b95e5960e11
[ "Apache-2.0" ]
permissive
JetBrains/android
3732f6fe3ae742182c2684a13ea8a1e6a996c9a1
9aa80ad909cf4b993389510e2c1efb09b8cdb5a0
refs/heads/master
2023-09-01T14:11:56.555718
2023-08-31T16:50:03
2023-08-31T16:53:27
60,701,247
947
255
Apache-2.0
2023-09-05T12:44:24
2016-06-08T13:46:48
Kotlin
UTF-8
Java
false
false
906
java
package test.pkg; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.util.SparseArray; @SuppressWarnings("unused") @SuppressLint("NewApi") public class ParcelClassLoaderTest { private void testParcelable(Parcel in) { Parcelable error1 = in.readParcelable(getClass().getClassLoader()); Parcelable[] error2 = in.readParcelableArray(null); Bundle error3 = in.readBundle(null); Object[] error4 = in.readArray(null); SparseArray error5 = in.readSparseArray(null); Object error6 = in.readValue(null); Parcelable error7 = in.readPersistableBundle(null); Bundle error8 = in.readBundle(); Parcelable error9 = in.readPersistableBundle(); Parcelable ok = in.readParcelable(getClass().getClassLoader()); } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
2974f022b95653909030e7cc9412699381749f19
6254347eaf4e96dc77e69820bef34df0eaf2d906
/pdfsam-enhanced/pdfsam-console/tags/V_2_1_1e/src/java/org/pdfsam/console/business/pdf/handlers/interfaces/CmdExecutor.java
df2b1e45c4904a1fbca1a8c863ba836a3c88c6ad
[]
no_license
winsonrich/pdfsam-v2
9044913b14ec2e0c33801a77fbbc696367a8f587
0c7cc6dfeee88d1660e30ed53c7d09d40bf986aa
refs/heads/master
2020-04-02T16:20:17.751695
2018-12-07T14:52:22
2018-12-07T14:52:22
154,608,091
0
0
null
2018-10-25T04:03:03
2018-10-25T04:03:03
null
UTF-8
Java
false
false
2,261
java
/* * Created on 18-Oct-2007 * Copyright (C) 2006 by Andrea Vacondio. * * * This library is provided under dual licenses. * You may choose the terms of the Lesser General Public License version 2.1 or the General Public License version 2 * License at your discretion. * * * 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; * version 2.1 of the License. * * 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 * * * * 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. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program; * if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.pdfsam.console.business.pdf.handlers.interfaces; import org.pdfsam.console.business.dto.commands.AbstractParsedCommand; import org.pdfsam.console.exceptions.console.ConsoleException; /** * Interface for the command executors * @author Andrea Vacondio * */ public interface CmdExecutor { /** * Execute the tool command. On error an exception is thrown. * @param parsedCommand command to be executed * @throws ConsoleException */ public void execute(AbstractParsedCommand parsedCommand) throws ConsoleException; }
[ "torakiki@2703fb93-1e26-0410-8fff-b03f68e33ab9" ]
torakiki@2703fb93-1e26-0410-8fff-b03f68e33ab9
72754b1a401fcc3c0e1227d4b1a68d30d8e26844
e85b4ef0fd9fb4d56e63bb8fe6f28001feeb97b2
/build/tmp/recompileMc/sources/net/minecraft/command/CommandTitle.java
71737722dc168f725cb091153d32a05ecbdfa2f7
[]
no_license
kieranjazy/Chromatic-Engineering
c51fecbfc4b3dee8fee9a8c71649288c62c45893
78df5b912b9a58edcdf5ebd12ee3b5a89c0fcfc4
refs/heads/master
2021-01-01T15:28:28.584483
2018-03-01T14:48:01
2018-03-01T14:48:01
94,486,629
0
0
null
null
null
null
UTF-8
Java
false
false
5,965
java
package net.minecraft.command; import com.google.gson.JsonParseException; import java.util.Collections; import java.util.List; import javax.annotation.Nullable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.play.server.SPacketTitle; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class CommandTitle extends CommandBase { private static final Logger LOGGER = LogManager.getLogger(); /** * Gets the name of the command */ public String getName() { return "title"; } /** * Return the required permission level for this command. */ public int getRequiredPermissionLevel() { return 2; } /** * Gets the usage string for the command. * * @param sender The ICommandSender who is requesting usage details */ public String getUsage(ICommandSender sender) { return "commands.title.usage"; } /** * Callback for when the command is executed * * @param server The server instance * @param sender The sender who executed the command * @param args The arguments that were passed */ public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (args.length < 2) { throw new WrongUsageException("commands.title.usage", new Object[0]); } else { if (args.length < 3) { if ("title".equals(args[1]) || "subtitle".equals(args[1]) || "actionbar".equals(args[1])) { throw new WrongUsageException("commands.title.usage.title", new Object[0]); } if ("times".equals(args[1])) { throw new WrongUsageException("commands.title.usage.times", new Object[0]); } } EntityPlayerMP entityplayermp = getPlayer(server, sender, args[0]); SPacketTitle.Type spackettitle$type = SPacketTitle.Type.byName(args[1]); if (spackettitle$type != SPacketTitle.Type.CLEAR && spackettitle$type != SPacketTitle.Type.RESET) { if (spackettitle$type == SPacketTitle.Type.TIMES) { if (args.length != 5) { throw new WrongUsageException("commands.title.usage", new Object[0]); } else { int i = parseInt(args[2]); int j = parseInt(args[3]); int k = parseInt(args[4]); SPacketTitle spackettitle2 = new SPacketTitle(i, j, k); entityplayermp.connection.sendPacket(spackettitle2); notifyCommandListener(sender, this, "commands.title.success", new Object[0]); } } else if (args.length < 3) { throw new WrongUsageException("commands.title.usage", new Object[0]); } else { String s = buildString(args, 2); ITextComponent itextcomponent; try { itextcomponent = ITextComponent.Serializer.jsonToComponent(s); } catch (JsonParseException jsonparseexception) { /** * Convert a JsonParseException into a user-friendly exception */ throw toSyntaxException(jsonparseexception); } SPacketTitle spackettitle1 = new SPacketTitle(spackettitle$type, TextComponentUtils.processComponent(sender, itextcomponent, entityplayermp)); entityplayermp.connection.sendPacket(spackettitle1); notifyCommandListener(sender, this, "commands.title.success", new Object[0]); } } else if (args.length != 2) { throw new WrongUsageException("commands.title.usage", new Object[0]); } else { SPacketTitle spackettitle = new SPacketTitle(spackettitle$type, (ITextComponent)null); entityplayermp.connection.sendPacket(spackettitle); notifyCommandListener(sender, this, "commands.title.success", new Object[0]); } } } /** * Get a list of options for when the user presses the TAB key * * @param server The server instance * @param sender The ICommandSender to get tab completions for * @param args Any arguments that were present when TAB was pressed * @param targetPos The block that the player's mouse is over, <tt>null</tt> if the mouse is not over a block */ public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos targetPos) { if (args.length == 1) { return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames()); } else { return args.length == 2 ? getListOfStringsMatchingLastWord(args, SPacketTitle.Type.getNames()) : Collections.emptyList(); } } /** * Return whether the specified command parameter index is a username parameter. * * @param args The arguments of the command invocation * @param index The index */ public boolean isUsernameIndex(String[] args, int index) { return index == 0; } }
[ "kieranjayes@hotmail.com" ]
kieranjayes@hotmail.com
354a46f6f47aad8dea945bc2587f406e18e9bbf5
4baf428985775718d372f9e514479cbdbe411d94
/src/main/java/com/iqmsoft/struts/crud/service/EmployeeService.java
6458e928502360ee18608d788f4130aae61ee18f
[]
no_license
Murugar/PayaraStruts2
c849a7fb8fc3af695596382061f8c382efee0b23
279ad07584e4b14512814e4404e396ef8208a358
refs/heads/master
2021-05-16T07:20:33.764130
2017-09-16T12:16:38
2017-09-16T12:16:38
103,749,621
0
0
null
null
null
null
UTF-8
Java
false
false
373
java
package com.iqmsoft.struts.crud.service; import java.util.List; import com.iqmsoft.struts.crud.model.Employee; public interface EmployeeService { public List getAllEmployees(); public void updateEmployee(Employee emp); public void deleteEmployee(Integer id); public Employee getEmployee(Integer id); public void insertEmployee(Employee emp); }
[ "davanon2014@gmail.com" ]
davanon2014@gmail.com
83f8e1604c49b7199914fa17632df2f946b47d40
f00f814476cb0e296d2a713395925bfa43dd6a20
/src/main/java/org/optaplanner/examples/cloudbalancing/persistence/CloudBalanceRepository.java
6ec98fb01d88a3f1ce237819d7adac4e38cdad7c
[]
no_license
rhte2019-optaplanner/cloud-balancing-lab-step-1
27d77dbc157953a0ddfffdaf69a8f27c0c9c77d1
17c94e1b5e91fd4c45cb5f872fc3272b95f17061
refs/heads/master
2021-07-08T19:50:16.542409
2020-06-16T19:38:47
2020-06-16T19:38:47
202,514,503
0
2
null
2020-10-13T15:21:05
2019-08-15T09:36:07
Java
UTF-8
Java
false
false
707
java
package org.optaplanner.examples.cloudbalancing.persistence; import java.io.File; import org.optaplanner.examples.cloudbalancing.domain.CloudBalance; import org.optaplanner.examples.cloudbalancing.domain.CloudComputer; import org.optaplanner.examples.cloudbalancing.domain.CloudProcess; import org.optaplanner.persistence.xstream.impl.domain.solution.XStreamSolutionFileIO; public class CloudBalanceRepository { public static CloudBalance load(File inputSolutionFile) { XStreamSolutionFileIO<CloudBalance> solutionFileIO = new XStreamSolutionFileIO<>(CloudBalance.class, CloudProcess.class, CloudComputer.class); return solutionFileIO.read(inputSolutionFile); } }
[ "Duncan.Doyle@gmail.com" ]
Duncan.Doyle@gmail.com
c4039673e24666bdeb837c40ebc88003e6055672
6e9a5bddddfb841999a00bec00b9466d266cd1f0
/jun_ureport2/ureport2-core/src/main/java/com/bstek/ureport/expression/function/string/IndexOfFunction.java
22c07b017e07b2a03e75a979663af562c7dbe4de
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
cuilong1009/jun_bigdata
9c36dde7a5fe8fe85abfe43398f797decc7cb1d4
1ad4194eaab24735e3864831c9fede787361599a
refs/heads/master
2023-06-05T05:21:58.095287
2020-11-25T16:01:26
2020-11-25T16:01:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,477
java
/******************************************************************************* * Copyright 2017 Bstek * * 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.bstek.ureport.expression.function.string; import java.util.List; import com.bstek.ureport.Utils; import com.bstek.ureport.build.Context; import com.bstek.ureport.exception.ReportComputeException; import com.bstek.ureport.expression.model.data.ExpressionData; import com.bstek.ureport.expression.model.data.ObjectExpressionData; import com.bstek.ureport.model.Cell; /** * @author Wujun * @since 2017年1月24日 */ public class IndexOfFunction extends StringFunction { @Override public Object execute(List<ExpressionData<?>> dataList, Context context,Cell currentCell) { String text=buildString(dataList); String targetText=null; if(dataList.size()>1){ ExpressionData<?> exprData=dataList.get(1); if(exprData instanceof ObjectExpressionData){ ObjectExpressionData objData=(ObjectExpressionData)exprData; Object obj=objData.getData(); if(obj==null){ throw new ReportComputeException("Function ["+name()+"] parameter can not be null."); } targetText=obj.toString(); } } int start=0; if(dataList.size()==3){ ExpressionData<?> exprData=dataList.get(2); start=buildStart(exprData); } return text.indexOf(targetText, start); } private int buildStart(ExpressionData<?> exprData) { if(exprData instanceof ObjectExpressionData){ ObjectExpressionData objData=(ObjectExpressionData)exprData; Object obj=objData.getData(); if(obj==null){ throw new ReportComputeException("Function ["+name()+"] parameter can not be null."); } return Utils.toBigDecimal(obj).intValue(); } throw new ReportComputeException("Function ["+name()+"] start position data is invalid : "+exprData); } @Override public String name() { return "indexof"; } }
[ "wujun728@hotmail.com" ]
wujun728@hotmail.com
a53d4ef248075f6d347cac51d4601be757d4e026
0048deca25c643d2090f69fac14f12ac054c313f
/src/main/java/kr/or/ddit/clRegProject/service/ClRegProjectServiceImpl.java
03518754632005309a0481e24634afc6e7185b91
[]
no_license
dh37789/project_002
1a73d711eadc0071db4806bdbd20c1c5777eef96
65a95a53c54cec3eea34fd49bb22e34fca333d42
refs/heads/master
2020-05-02T03:03:05.253238
2019-03-26T05:34:31
2019-03-26T05:34:31
177,718,405
0
0
null
null
null
null
UTF-8
Java
false
false
782
java
package kr.or.ddit.clRegProject.service; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import kr.or.ddit.clRegProject.dao.ClRegProjectDao; import kr.or.ddit.vo.ProjectVO; @Service public class ClRegProjectServiceImpl implements ClRegProjectService{ @Autowired private ClRegProjectDao dao; @Transactional(propagation=Propagation.REQUIRED, readOnly=true) @Override public List<HashMap<String, Object>> regProjectList(Map<String, String> params) throws Exception { return dao.regProjectList(params); } }
[ "dhaudgkr@gmail.com" ]
dhaudgkr@gmail.com
530567aa0189ff2c05dd7accbb56c455f322956f
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/ahas-20180901/src/main/java/com/aliyun/ahas20180901/models/QueryQuickSceneCategoriesRequest.java
624ce9c534e3292ed2dbdeb749683433137aa334
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,460
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.ahas20180901.models; import com.aliyun.tea.*; public class QueryQuickSceneCategoriesRequest extends TeaModel { @NameInMap("AhasRegionId") public String ahasRegionId; @NameInMap("Args") public String args; @NameInMap("Lang") public String lang; @NameInMap("Namespace") public String namespace; public static QueryQuickSceneCategoriesRequest build(java.util.Map<String, ?> map) throws Exception { QueryQuickSceneCategoriesRequest self = new QueryQuickSceneCategoriesRequest(); return TeaModel.build(map, self); } public QueryQuickSceneCategoriesRequest setAhasRegionId(String ahasRegionId) { this.ahasRegionId = ahasRegionId; return this; } public String getAhasRegionId() { return this.ahasRegionId; } public QueryQuickSceneCategoriesRequest setArgs(String args) { this.args = args; return this; } public String getArgs() { return this.args; } public QueryQuickSceneCategoriesRequest setLang(String lang) { this.lang = lang; return this; } public String getLang() { return this.lang; } public QueryQuickSceneCategoriesRequest setNamespace(String namespace) { this.namespace = namespace; return this; } public String getNamespace() { return this.namespace; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
749a7bfec695e812c46b60f613022783388ff40d
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava6/Foo180Test.java
342b65c8d5a1a935a6476a539f3a57736d9af125
[]
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
741
java
package applicationModulepackageJava6; import org.junit.Test; public class Foo180Test { @Test public void testFoo0() { new Foo180().foo0(); } @Test public void testFoo1() { new Foo180().foo1(); } @Test public void testFoo2() { new Foo180().foo2(); } @Test public void testFoo3() { new Foo180().foo3(); } @Test public void testFoo4() { new Foo180().foo4(); } @Test public void testFoo5() { new Foo180().foo5(); } @Test public void testFoo6() { new Foo180().foo6(); } @Test public void testFoo7() { new Foo180().foo7(); } @Test public void testFoo8() { new Foo180().foo8(); } @Test public void testFoo9() { new Foo180().foo9(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
598e47a980639030f1db1702c2961b2778c952af
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_53efa023fce1a746dcbdf260d0e782297623d0ab/KmeansMapper/4_53efa023fce1a746dcbdf260d0e782297623d0ab_KmeansMapper_t.java
64587ea68ebda42e846abdbe587872c6e773c117
[]
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,326
java
package mapreduce; import java.io.IOException; import java.net.URISyntaxException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import vector.VectorDoubleWritable; import clusterer.KmeansCluster; import clusterer.KmeansClusterer; import config.Constants; import distanceMeasure.DistanceMeasure; import distanceMeasure.EuclideanDistance; public class KmeansMapper extends Mapper<LongWritable, Text, LongWritable, KmeansCluster> { protected VectorDoubleWritable point = null; protected KmeansClusterer clusterer = new KmeansClusterer(); protected LongWritable id = new LongWritable(0); int i = 0; @Override public void map(LongWritable key, Text values, Context context) throws IOException { point = new VectorDoubleWritable(values); KmeansCluster cluster = null; try { cluster = clusterer.findNearestCluster(point); KmeansCluster value = new KmeansCluster(cluster.getId(), point, point.times(point)); /* * System.out.println(value.getId() + "\t" + * value.getCentroid().get().toString() + "\t" + value.getS1().get() * + "\t" + value.getS2().get()); */ id.set(cluster.getId()); context.write(id, value); } catch (IllegalStateException e) { System.err.println("Error:\t" + e.getMessage() + " at row(" + key + ")"); } catch (InterruptedException e) { e.printStackTrace(); } } @Override public void setup(Context context) throws IOException, InterruptedException { super.setup(context); Configuration conf = context.getConfiguration(); DistanceMeasure dm = null; try { dm = (DistanceMeasure) Class.forName( "distanceMeasure." + conf.get(Constants.DISTANCE_MEASURE, "EuclideanDistance")).newInstance(); } catch (InstantiationException e) { dm = new EuclideanDistance(); e.printStackTrace(); } catch (IllegalAccessException e) { dm = new EuclideanDistance(); e.printStackTrace(); } catch (ClassNotFoundException e) { dm = new EuclideanDistance(); e.printStackTrace(); } this.clusterer = new KmeansClusterer(dm); String clusterPath = conf.get(Constants.CLUSTER_PATH); if (clusterPath != null && !clusterPath.isEmpty()) try { this.clusterer.loadClusters(clusterPath, conf); } catch (URISyntaxException e) { e.printStackTrace(); } context.getCounter(Constants.COUNTER_GROUP, Constants.COUNTER_TOTAL) .setValue(0); context.getCounter(Constants.COUNTER_GROUP, Constants.COUNTER_TOTAL) .setValue(this.clusterer.getClusters().size()); context.getCounter(Constants.COUNTER_GROUP, Constants.COUNTER_FILE) .increment(1); if (Constants.DEBUG) { System.out.println("Mapper setup: Total cluster=" + context.getCounter(Constants.COUNTER_GROUP, Constants.COUNTER_TOTAL).getValue()); for (KmeansCluster clu : clusterer.getClusters()) { System.out.println("Cluster " + clu.getId() + "/" + this.clusterer.getClusters().size() + ":\t" + clu.getCentroid()); } System.out.println("Cluster TOTAL:" + context.getCounter(Constants.COUNTER_GROUP, Constants.COUNTER_TOTAL).getValue()); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
88180566e12b6fdac2439c78b46b64d54a76dfe1
db2d7241afcb02a7de80503bf492fa02251f9018
/services/mpc/src/main/java/com/huaweicloud/sdk/mpc/v1/model/CreateQualityEnhanceTemplateResponse.java
66ca99fd796ae37d0f569ce2633908c63a000552
[ "Apache-2.0" ]
permissive
yasuor/huaweicloud-sdk-java-v3
64359e3ab599144d1dc2df08fb15f8e404295be5
3407632f294cdd40a62d4f9167f9708d95464cb8
refs/heads/master
2022-11-23T23:38:12.977127
2020-07-30T08:46:12
2020-07-30T08:46:12
286,420,644
1
0
NOASSERTION
2020-08-10T08:35:22
2020-08-10T08:35:21
null
UTF-8
Java
false
false
2,179
java
package com.huaweicloud.sdk.mpc.v1.model; import com.huaweicloud.sdk.core.SdkResponse; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.function.Consumer; import java.util.Objects; /** * Response Object */ public class CreateQualityEnhanceTemplateResponse extends SdkResponse { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="template_id") private Integer templateId; public CreateQualityEnhanceTemplateResponse withTemplateId(Integer templateId) { this.templateId = templateId; return this; } /** * 模板ID。 * minimum: 0 * maximum: 2147483647 * @return templateId */ public Integer getTemplateId() { return templateId; } public void setTemplateId(Integer templateId) { this.templateId = templateId; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CreateQualityEnhanceTemplateResponse createQualityEnhanceTemplateResponse = (CreateQualityEnhanceTemplateResponse) o; return Objects.equals(this.templateId, createQualityEnhanceTemplateResponse.templateId); } @Override public int hashCode() { return Objects.hash(templateId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CreateQualityEnhanceTemplateResponse {\n"); sb.append(" templateId: ").append(toIndentedString(templateId)).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
89b332a47ec287396464b7b4cf3bfa255dc3f531
0bbd91c9d231ee201db5964a8b6b14856dc2af4c
/android/src/com/google/appinventor/components/runtime/Twitter$5.java
e2115b00c78ce4e3a6b4a89631fd2a8c5ae3aa6e
[]
no_license
mafeosza/alertasTempranas_android
338d025e52b0b1dc2a94b095f3490fbd7c7c97b7
9721d2e0a2a41a9a618ddf273cc72cb8a8299c4f
refs/heads/master
2021-01-01T16:25:57.753339
2015-05-18T23:02:54
2015-05-18T23:02:54
35,839,030
1
0
null
null
null
null
UTF-8
Java
false
false
1,794
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.appinventor.components.runtime; import java.io.File; import twitter4j.StatusUpdate; import twitter4j.Twitter; import twitter4j.TwitterException; // Referenced classes of package com.google.appinventor.components.runtime: // Twitter, Form class val.status implements Runnable { final com.google.appinventor.components.runtime.Twitter this$0; final String val$imagePath; final String val$status; public void run() { String s = val$imagePath; Object obj = s; if (s.startsWith("file://")) { obj = val$imagePath.replace("file://", ""); } obj = new File(((String) (obj))); if (((File) (obj)).exists()) { StatusUpdate statusupdate = new StatusUpdate(val$status); statusupdate.setMedia(((File) (obj))); Twitter.access$200(com.google.appinventor.components.runtime.Twitter.this).updateStatus(statusupdate); return; } try { form.dispatchErrorOccurredEvent(com.google.appinventor.components.runtime.Twitter.this, "TweetWithImage", 315, new Object[0]); return; } catch (TwitterException twitterexception) { form.dispatchErrorOccurredEvent(com.google.appinventor.components.runtime.Twitter.this, "TweetWithImage", 306, new Object[] { twitterexception.getMessage() }); } return; } _cls9() { this$0 = final_twitter; val$imagePath = s; val$status = String.this; super(); } }
[ "fercha0202@hotmail.com" ]
fercha0202@hotmail.com
15a14880e396dbe3152281ebe96178e1aa33a5b0
2a4c1ae3ec63808019eb70ac4c4029402d67c8e0
/core/src/com/scs/libgdx/Ninepatch.java
dec6bb4778d655e8534157988e93a29f0f8f64f0
[ "MIT" ]
permissive
lulog1/SimplePlatformer
8ac3555012a49818fcb2f8c21930f14b97db5c4d
e0f57c01213fbff044430b673c6d0844ea7fa27b
refs/heads/master
2023-03-17T11:32:51.073303
2020-08-12T12:04:34
2020-08-12T12:04:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,412
java
package com.scs.libgdx; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Sprite; import com.scs.awt.Rect; public class Ninepatch { private Rect rect; // The insets! private String filename; public Ninepatch(String _filename, Rect _rect) { filename = _filename; rect = _rect; } public Sprite getImage(int w, int h) { Texture t1 = new Texture(filename); t1.getTextureData().prepare(); Pixmap p1 = t1.getTextureData().consumePixmap(); Pixmap basePixmap = new Pixmap(w, h, p1.getFormat()); // Left basePixmap.drawPixmap(p1, 0, 0, rect.left, t1.getHeight(), 0, 0, rect.left, h); // Top basePixmap.drawPixmap(p1, 0, t1.getHeight()-rect.top, t1.getWidth(), rect.top, 0, h-rect.top, w, rect.top); // Right basePixmap.drawPixmap(p1, t1.getWidth()-rect.right, 0, rect.right, t1.getHeight(), w-rect.right, 0, rect.right, h); // Bottom basePixmap.drawPixmap(p1, 0, 0, t1.getWidth(), rect.bottom, 0, 0, w, rect.bottom); // Middle basePixmap.drawPixmap(p1, rect.left, rect.bottom, t1.getWidth()-rect.left-rect.right, t1.getHeight()-rect.bottom-rect.top, rect.left, rect.bottom, w-rect.left-rect.right, h-rect.bottom-rect.top); Texture newTex = new Texture(basePixmap); basePixmap.dispose(); t1.dispose(); p1.dispose(); return new Sprite(newTex); } }
[ "stephen.carlylesmith@googlemail.com" ]
stephen.carlylesmith@googlemail.com
25a3dcd5ac27c777c1e81686d55b5fa910ca288c
c48733807b6e920b974644ff369f73f68b606a9d
/maven_project/src/main/java/cn/javass/dp/decorator/example6/Client.java
bfa0620049be73ba3e0214693f1ec9a9a938edb6
[]
no_license
sworderHB/maven_project
c4d45cf646f94b8e1c4eb0a9f602f40e43f2b376
29e1a81086f572b5128c826535a28010b8da48a3
refs/heads/master
2020-03-22T01:19:09.641233
2018-07-01T04:35:34
2018-07-01T04:35:34
139,297,569
0
0
null
null
null
null
UTF-8
Java
false
false
469
java
package cn.javass.dp.decorator.example6; public class Client { public static void main(String[] args) { //得到业务接口,组合装饰器 GoodsSaleEbi ebi = new CheckDecorator(new LogDecorator(new GoodsSaleEbo())); //准备测试数据 SaleModel saleModel = new SaleModel(); saleModel.setGoods("Moto手机"); saleModel.setSaleNum(2); //调用业务功能 ebi.sale("张三","张三丰", saleModel); ebi.sale("李四","张三丰", saleModel); } }
[ "sworder2018@gmail.com" ]
sworder2018@gmail.com
0caa115b97a341badea4561d79b9b450d560f5f5
d60e287543a95a20350c2caeabafbec517cabe75
/NLPCCd/Hadoop/1200_2.java
92660a8b013c449f715fafb26646c129fcd58c28
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
370
java
//,temp,sample_7197.java,2,6,temp,sample_8222.java,2,8 //,3 public class xxx { public void reInitializeContainerAsync(ContainerId containerId, ContainerLaunchContext containerLaunchContex, boolean autoCommit){ if (!(callbackHandler instanceof AbstractCallbackHandler)) { log.info("callback handler does not implement container re initialize callback methods"); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
06d2710478db69377f7aaa68122231cebdf8c43f
b9796495f4b0630578611fe5351e7f2c36809ebb
/src/main/java/com/dicka/serverweb/serverweb/controller/ControllerGudang.java
90f398e4d31f3f510a506060e93def9e0fa7f748
[]
no_license
dickanirwansyah/belajar-rest
bf54a3db077e0084b6807f14980efd3441181072
1806c0f0c172d5738a2d4893e4769393bba4d702
refs/heads/master
2021-08-14T16:42:00.442668
2017-11-16T07:51:18
2017-11-16T07:51:18
110,939,952
0
0
null
null
null
null
UTF-8
Java
false
false
3,726
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.dicka.serverweb.serverweb.controller; import com.dicka.serverweb.serverweb.dao.GudangDAO; import com.dicka.serverweb.serverweb.exception.AlreadyException; import com.dicka.serverweb.serverweb.model.Gudang; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.util.UriComponentsBuilder; /** * * @author java-spring */ @RestController @Service @RequestMapping(value = "/api") @CrossOrigin(value = {"http://localhost:9000"}) public class ControllerGudang { private GudangDAO gudangDAO; private static final Logger LOGGER = LoggerFactory.getLogger(ControllerGudang.class); @Autowired public ControllerGudang(GudangDAO gudangDAO){ this.gudangDAO = gudangDAO; } @GetMapping(value = "/gudangs") public ResponseEntity<List<Gudang>>GetListGudang(){ LOGGER.debug("DEBUG : list gudang"); List<Gudang> listgudang = gudangDAO.findAllGudang(); if(listgudang.isEmpty()){ LOGGER.debug("DEBUG : data tidak ada"); //400 bad request return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(listgudang, HttpStatus.OK); } @GetMapping(value = "/gudangs/{idgudang}") public ResponseEntity<Gudang>GetGudang(@PathVariable String idgudang){ LOGGER.debug("by igudang"); Gudang gudang = gudangDAO.findOneGudangById(Integer.parseInt(idgudang)); if(gudang == null){ return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(HttpStatus.OK); } @PostMapping(value = "/insertGudang") public ResponseEntity<Gudang>insertGudang(@RequestBody Gudang gudang, UriComponentsBuilder builder){ if(gudangDAO.ifGudangIsExist(gudang)){ LOGGER.info("Data is already exist"); return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } gudangDAO.insertGudang(gudang); HttpHeaders headers = new HttpHeaders(); headers.setLocation(builder.path("/insertGudang/{idgudang}") .buildAndExpand(gudang.getIdgudang()).toUri()); return new ResponseEntity<>(gudang, headers, HttpStatus.CREATED); } @DeleteMapping(value = "/deleteGudang/{idgudang}") public ResponseEntity<Void>deleteGudang(@PathVariable String idgudang){ LOGGER.info("delete gudang"); Gudang gudang = gudangDAO.findOneGudangById(Integer.parseInt(idgudang)); if(gudang == null){ LOGGER.info("idgudang sudah ada"); return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } gudangDAO.deleteGudang(gudang); return new ResponseEntity<>(HttpStatus.OK); } }
[ "dickanirwansyah@gmail.com" ]
dickanirwansyah@gmail.com
6745e60be90f7658aef2ef68e0258bfe04314667
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/10/org/apache/commons/math3/optim/AbstractConvergenceChecker_converged_67.java
6e99faab2e67ee309af598591a665f1dad5edb3b
[]
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
273
java
org apach common math3 optim base converg checker implement param pair type point pair version abstract converg checker abstractconvergencecheck pair inherit doc inheritdoc converg iter pair previou pair current
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
6a8acaed024fbce89bdce6aa574f1c00d7b349a3
a51778ee2a96630785541ce331e178ce15bdc7c4
/skola/Fel_bc/1.semestr/Algoritmizace/PrikladyPrednasky2007/Alg6/src/alg6/ObratPole2.java
b7f8a23f6005c3b180d1dc20cde6688231828206
[]
no_license
majacQ/migrace_databaze
45ed405ab0f0fc31578264c983a4f2e4beacb528
51cc735d7db6db1a6454e51ae596e09711783104
refs/heads/master
2023-05-08T19:01:09.294920
2021-05-24T20:15:33
2021-05-24T20:15:33
null
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
839
java
package alg6; import java.util.*; public class ObratPole2 { public static void main(String[] args) { int[] vstupniPole = ctiPole(); int[] vystupniPole = obratPole(vstupniPole); vypisPole(vystupniPole); } static int[] ctiPole() { Scanner sc = new Scanner(System.in); System.out.println("zadejte počet čísel"); int[] pole = new int[sc.nextInt()]; System.out.println("zadejte "+pole.length+" čísel"); for (int i=0; i<pole.length; i++) pole[i] = sc.nextInt(); return pole; } static int[] obratPole(int[] pole) { int[] novePole = new int[pole.length]; for (int i=0; i<pole.length; i++) novePole[i] = pole[pole.length-1-i]; return novePole; } static void vypisPole(int[] pole) { for (int i=0; i<pole.length; i++) System.out.println(pole[i]); } }
[ "wox2@seznam.cz" ]
wox2@seznam.cz
8f00e742abd7be164021ddd5983737ad2f20ae00
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-418-44-22-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/plugin/webdav/XWikiDavFilter_ESTest.java
141c55bac55965417facedcdb3168da843deaa85
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
/* * This file was automatically generated by EvoSuite * Wed Apr 08 05:04:15 UTC 2020 */ package com.xpn.xwiki.plugin.webdav; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWikiDavFilter_ESTest extends XWikiDavFilter_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
4448f21bbe3bdee8fb49bb371921dd816d7f0058
1196cad455eb96e29da620e529366fb7175bc566
/fiona-pet-account-rest-provider/src/main/java/cn/fiona/pet/account/extension/TraceInterceptor.java
807ff4d4b0377baa00bec5b62bc816634ccbbe07
[ "Apache-2.0" ]
permissive
fiona-pet/account
aedcc8bdc57b81345a54a8ff22287f4b504a9f43
4450a54d4e6b50c00713dc0e6a8cb99cfd44bcfd
refs/heads/master
2022-12-02T04:51:14.419984
2019-07-27T06:54:19
2019-07-27T06:54:19
72,513,160
1
1
Apache-2.0
2022-11-16T04:31:31
2016-11-01T07:19:38
JavaScript
UTF-8
Java
false
false
1,576
java
/** * Copyright 1999-2014 dangdang.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 cn.fiona.pet.account.extension; import javax.annotation.Priority; import javax.ws.rs.Priorities; import javax.ws.rs.WebApplicationException; import javax.ws.rs.ext.ReaderInterceptor; import javax.ws.rs.ext.ReaderInterceptorContext; import javax.ws.rs.ext.WriterInterceptor; import javax.ws.rs.ext.WriterInterceptorContext; import java.io.IOException; /** * @author */ @Priority(Priorities.USER) public class TraceInterceptor implements ReaderInterceptor, WriterInterceptor { public Object aroundReadFrom(ReaderInterceptorContext readerInterceptorContext) throws IOException, WebApplicationException { System.out.println("Reader interceptor invoked"); return readerInterceptorContext.proceed(); } public void aroundWriteTo(WriterInterceptorContext writerInterceptorContext) throws IOException, WebApplicationException { System.out.println("Writer interceptor invoked"); writerInterceptorContext.proceed(); } }
[ "tom@daoshenggroup.com" ]
tom@daoshenggroup.com
44c6329d82294ed28515f5d6148b34b202b165df
c82f89b0e6d1547c2829422e7de7664b378c1039
/src/com/hongyu/dao/HyPayablesElementDao.java
bf5f936504ae7af45505486d71a3af21ff3010de
[]
no_license
chenxiaoyin3/shetuan_backend
1bab5327cafd42c8086c25ade7e8ce08fda6a1ac
e21a0b14a2427c9ad52ed00f68d5cce2689fdaeb
refs/heads/master
2022-05-15T14:52:07.137000
2022-04-07T03:30:57
2022-04-07T03:30:57
250,762,749
1
2
null
null
null
null
UTF-8
Java
false
false
183
java
package com.hongyu.dao; import com.grain.dao.BaseDao; import com.hongyu.entity.HyPayablesElement; public interface HyPayablesElementDao extends BaseDao<HyPayablesElement,Long> { }
[ "925544714@qq.com" ]
925544714@qq.com
bbbb8dc21529d13f5e6612bd095161152a94757d
279bffecb84102ab7a91726607a5e4c1d18e961f
/sellercenter/sellercenter-component/src/main/java/com/qcloud/component/sellercenter/model/MerchantOrderForm.java
4afd37afbcd69fa78b34d04c27b06dd89106d30e
[]
no_license
ChiRains/forest
8b71de51c477f66a134d9b515b58039a8c94c2ee
cf0b41ff83e4cee281078afe338bba792de05052
refs/heads/master
2021-01-19T07:13:19.597344
2016-08-18T01:35:54
2016-08-18T01:35:54
65,869,894
0
2
null
null
null
null
UTF-8
Java
false
false
1,673
java
package com.qcloud.component.sellercenter.model; import java.util.Date; import java.math.BigDecimal; public class MerchantOrderForm { //ID private long id; //卖家 private long merchantId; //门店 private long storeId; //总单 private long orderId; //子单ID private long subOrderId; //状态 private int state; //下单时间 private Date time; public MerchantOrderForm(){ } public MerchantOrderForm(long id,long merchantId,long storeId,long orderId,long subOrderId,int state,Date time){ this.id = id; this.merchantId = merchantId; this.storeId = storeId; this.orderId = orderId; this.subOrderId = subOrderId; this.state = state; this.time = time; } public void setId(long id) { this.id = id; } public long getId() { return id; } public void setMerchantId(long merchantId) { this.merchantId = merchantId; } public long getMerchantId() { return merchantId; } public void setStoreId(long storeId) { this.storeId = storeId; } public long getStoreId() { return storeId; } public void setOrderId(long orderId) { this.orderId = orderId; } public long getOrderId() { return orderId; } public void setSubOrderId(long subOrderId) { this.subOrderId = subOrderId; } public long getSubOrderId() { return subOrderId; } public void setState(int state) { this.state = state; } public int getState() { return state; } public void setTime(Date time) { this.time = time; } public Date getTime() { return time; } }
[ "dengfei@ed19df75-bd51-b445-9863-9e54940520a8" ]
dengfei@ed19df75-bd51-b445-9863-9e54940520a8
a9dd0c5739a86df956d1d7bafa63e576c839f4d2
cdf1f17797d73bb6df76bccb805e30131362453d
/app/src/androidTest/java/it/cosenonjaviste/testableandroidapps/v7/ShareActivityTest.java
52f6875e035173dfd361b78db10db2b67920f7b3
[]
no_license
thekalinga/TestableAndroidAppsDroidCon15
ef24a7c6e1c690b04ccd7bff6e737b388097d8c7
169e52cc9be4db1523ec3697f1cec2ba3a95b8eb
refs/heads/master
2020-04-06T06:51:14.819102
2015-04-22T21:15:21
2015-04-22T21:15:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,811
java
package it.cosenonjaviste.testableandroidapps.v7; import android.content.Intent; import android.support.test.InstrumentationRegistry; import android.support.test.espresso.action.ViewActions; import android.support.test.rule.ActivityTestRule; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import javax.inject.Inject; import it.cosenonjaviste.testableandroidapps.CnjApplication; import it.cosenonjaviste.testableandroidapps.R; import it.cosenonjaviste.testableandroidapps.ShareExecutor; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static it.cosenonjaviste.testableandroidapps.utils.ErrorTextMatcher.hasErrorText; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.verify; public class ShareActivityTest { @Inject ShareExecutor shareExecutor; @Rule public final ActivityTestRule<ShareActivity> rule = new ActivityTestRule<ShareActivity>(ShareActivity.class, false, false) { @Override protected Intent getActivityIntent() { Intent intent = super.getActivityIntent(); ShareActivity.populateIntent(intent, new ShareModel("title", "body")); return intent; } }; @Before public void setUp() { TestComponent component = DaggerTestComponent.create(); CnjApplication application = (CnjApplication) InstrumentationRegistry.getTargetContext().getApplicationContext(); application.setComponent(component); component.inject(this); } @Test public void checkParameters() { rule.launchActivity(null); onView(withId(R.id.share_title)).check(matches(withText("title"))); onView(withId(R.id.share_body)).check(matches(withText("body"))); } @Test public void clickOnShare() { rule.launchActivity(null); onView(withId(R.id.share_button)).perform(click()); verify(shareExecutor).startSendActivity(eq("title"), eq("body")); } @Test public void checkValidationWhenEmpty() { rule.launchActivity(null); onView(withId(R.id.share_title)).perform(ViewActions.clearText()); onView(withId(R.id.share_body)).perform(ViewActions.clearText()); onView(withId(R.id.share_button)).perform(click()); String errorText = rule.getActivity().getString(R.string.mandatory_field); onView(withId(R.id.share_title)).check(matches(hasErrorText(errorText))); onView(withId(R.id.share_body)).check(matches(hasErrorText(errorText))); } }
[ "fabio.collini@gmail.com" ]
fabio.collini@gmail.com
597c586e60378316c473e50c2a93032480b65bf7
6d60a8adbfdc498a28f3e3fef70366581aa0c5fd
/codebase/selected/1063310.java
11889e01a5c911d9b1029f2282aa489f172ca0df
[]
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
3,826
java
package org.jsynthlib.synthdrivers.RolandMT32; import org.jsynthlib.core.Device; import org.jsynthlib.core.Driver; import org.jsynthlib.core.Logger; import org.jsynthlib.core.JSLFrame; import org.jsynthlib.core.Patch; import org.jsynthlib.core.SysexHandler; /** * System Driver for Roland MT32. */ public class RolandMT32SystemDriver extends Driver { private static final int HSIZE = 5; /** Single Patch size */ private static final int SSIZE = 3 + 0x17 + 1; /** Definition of the Request message RQ1 */ private static final SysexHandler SYS_REQ = new SysexHandler("F0 41 10 16 11 10 00 00 00 00 17 *checkSum* F7"); public RolandMT32SystemDriver(final Device device) { super(device, "System", "Fred Jan Kraan"); sysexID = "F041**16"; patchSize = HSIZE + SSIZE + 1; patchNameStart = 0; patchNameSize = 0; deviceIDoffset = 0; checksumStart = 5; checksumEnd = 10; checksumOffset = 0; bankNumbers = new String[] { "" }; patchNumbers = new String[] { "" }; } public void storePatch(Patch p, int bankNum, int patchNum) { try { Thread.sleep(100); } catch (Exception e) { Logger.reportStatus(e); } p.sysex[0] = (byte) 0xF0; p.sysex[5] = (byte) 0x10; p.sysex[6] = (byte) 0x00; p.sysex[7] = (byte) 0x00; calculateChecksum(p, HSIZE, HSIZE + SSIZE - 2, HSIZE + SSIZE - 1); try { sendPatchWorker(p); Thread.sleep(100); } catch (Exception e) { Logger.reportStatus(e); } } public void sendPatch(Patch p) { try { sendPatchWorker(p); Thread.sleep(100); } catch (Exception e) { Logger.reportStatus(e); } } protected void calculateChecksum(Patch p, int start, int end, int ofs) { int sum = 0; for (int i = start; i <= end; i++) { sum += p.sysex[i]; } sum = (0 - sum) & 0x7F; p.sysex[ofs] = (byte) (sum % 128); } public Patch createNewPatch() { byte[] sysex = new byte[HSIZE + SSIZE + 1]; sysex[0] = (byte) 0xF0; sysex[1] = (byte) 0x41; sysex[2] = (byte) 0x10; sysex[3] = (byte) 0x16; sysex[4] = (byte) 0x12; sysex[5] = (byte) 0x10; sysex[6] = (byte) 0x00; sysex[7] = (byte) 0x00; sysex[HSIZE + 0] = (byte) 0x28; sysex[HSIZE + 1] = (byte) 0x00; sysex[HSIZE + 2] = (byte) 0x05; sysex[HSIZE + 3] = (byte) 0x03; sysex[HSIZE + 22] = (byte) 0x3F; sysex[HSIZE + 4] = (byte) 0x03; sysex[HSIZE + 5] = (byte) 0x0A; sysex[HSIZE + 6] = (byte) 0x06; sysex[HSIZE + 7] = (byte) 0x04; sysex[HSIZE + 8] = (byte) 0x03; sysex[HSIZE + 9] = (byte) 0x00; sysex[HSIZE + 10] = (byte) 0x00; sysex[HSIZE + 11] = (byte) 0x00; sysex[HSIZE + 12] = (byte) 0x06; sysex[HSIZE + 13] = (byte) 0x01; sysex[HSIZE + 14] = (byte) 0x02; sysex[HSIZE + 15] = (byte) 0x03; sysex[HSIZE + 16] = (byte) 0x04; sysex[HSIZE + 17] = (byte) 0x05; sysex[HSIZE + 18] = (byte) 0x06; sysex[HSIZE + 19] = (byte) 0x07; sysex[HSIZE + 20] = (byte) 0x08; sysex[HSIZE + 21] = (byte) 0x09; sysex[HSIZE + SSIZE] = (byte) 0xF7; Patch p = new Patch(sysex, this); calculateChecksum(p, 5, HSIZE + SSIZE - 2, HSIZE + SSIZE - 1); return p; } public JSLFrame editPatch(Patch p) { return new RolandMT32SystemEditor(p); } public void requestPatchDump(int bankNum, int patchNum) { send(SYS_REQ.toSysexMessage(getChannel(), new SysexHandler.NameValue("checkSum", 0x59))); } }
[ "aaponcseku@gmail.com" ]
aaponcseku@gmail.com
d86e54ad31022938a54316d97c7da658d1d4c5e7
ff1c75334c246ed80b72f9a316beafb46d787416
/app/src/main/java/de/android/retrofit2elegionweather/ui/activities/DetailActivity.java
154c378d094b4bdcd6b098a092d00028f23abd29
[]
no_license
AIRAT1/Retrofit2ElegionWeather
1b9754cb455ac88ed96ffe540aea6f0cc7391b1b
1729e59a41bb3a0a48635c38461518eef13d44c3
refs/heads/master
2021-01-19T06:32:26.676606
2016-08-15T17:45:08
2016-08-15T17:45:08
65,173,837
0
0
null
null
null
null
UTF-8
Java
false
false
2,373
java
package de.android.retrofit2elegionweather.ui.activities; import android.os.Bundle; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; import android.widget.TextView; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import de.android.retrofit2elegionweather.R; import de.android.retrofit2elegionweather.data.managers.DataManager; import de.android.retrofit2elegionweather.utils.ConstantManager; public class DetailActivity extends BaseActivity { private static final String TAG = DetailActivity.class.getSimpleName(); private List<TextView> weatherInfoViews; private DataManager dataManager; private String city; @BindView(R.id.txt_city) TextView txtCity; @BindView(R.id.txt_temperature) TextView txtTemperature; @BindView(R.id.txt_status) TextView txtStatus; @BindView(R.id.txt_humidity) TextView txtHumidity; @BindView(R.id.txt_pressure) TextView txtPressure; @BindView(R.id.txt_time) TextView txtTime; @BindView(R.id.detail_coordinator_container) CoordinatorLayout coordinatorLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); ButterKnife.bind(this); dataManager = DataManager.getInstance(); city = getIntent().getStringExtra(ConstantManager.CITY_NAME); initWeatherInfoViews(); loadWeatherInfoValue(); } private void initWeatherInfoViews() { weatherInfoViews = new ArrayList<>(); weatherInfoViews.add(txtCity); weatherInfoViews.add(txtTemperature); weatherInfoViews.add(txtStatus); weatherInfoViews.add(txtHumidity); weatherInfoViews.add(txtPressure); weatherInfoViews.add(txtTime); } private void showSnackbar(String message) { Snackbar.make(coordinatorLayout, message, Snackbar.LENGTH_LONG).show(); } private void loadWeatherInfoValue() { // TODO load values from preferences if connection is failed List<String> weatherData = dataManager.getPreferenceManager().loadWeatherData(city); for (int i = 0; i < weatherData.size(); i++) { weatherInfoViews.get(i).setText(weatherData.get(i).toString()); } } }
[ "ayrat1@mail.ru" ]
ayrat1@mail.ru
24f05640b017c3cfe9c23fc545f19409ee245b50
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_23f428697a89644fdebdae9827c7c8a9065114fc/DefaultInterceptorHandlerFactory/11_23f428697a89644fdebdae9827c7c8a9065114fc_DefaultInterceptorHandlerFactory_t.java
9a678c96864ccbfb5e67ebefa862615e7fabebf4
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,480
java
/*** * Copyright (c) 2009 Caelum - www.caelum.com.br/opensource 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 br.com.caelum.vraptor.core; import java.util.Arrays; import java.util.List; import java.util.concurrent.ConcurrentMap; import javax.enterprise.inject.Default; import javax.inject.Inject; import br.com.caelum.vraptor.Intercepts; import br.com.caelum.vraptor.Lazy; import br.com.caelum.vraptor.interceptor.Interceptor; import br.com.caelum.vraptor.ioc.ApplicationScoped; import br.com.caelum.vraptor.ioc.Container; import br.com.caelum.vraptor4.interceptor.AspectStyleInterceptorHandler; import br.com.caelum.vraptor4.interceptor.StepInvoker; import com.google.common.collect.MapMaker; /** * * @author Lucas Cavalcanti * @author Alberto Souza * @since 3.2.0 * */ @ApplicationScoped @Default public class DefaultInterceptorHandlerFactory implements InterceptorHandlerFactory { private Container container; private ConcurrentMap<Class<?>, InterceptorHandler> cachedHandlers = new MapMaker().makeMap(); //CDI eyes only @Deprecated public DefaultInterceptorHandlerFactory() { } @Inject public DefaultInterceptorHandlerFactory(Container container) { this.container = container; } @Override public InterceptorHandler handlerFor(Class<?> type) { if (type.isAnnotationPresent(Lazy.class)) { InterceptorHandler handler = cachedHandlers.get(type); if (handler == null) { LazyInterceptorHandler value = new LazyInterceptorHandler(container, type); cachedHandlers.putIfAbsent(type, value); return value; } else { return handler; } } else{ if(type.isAnnotationPresent(Intercepts.class) && !Interceptor.class.isAssignableFrom(type)){ return new AspectStyleInterceptorHandler(type, new StepInvoker(), container); } } return new ToInstantiateInterceptorHandler(container, type); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
2eb9fa8414470c9c4d500bcad2fb922d3e6cd8b6
1358ea022879f498dbcc81eb29cdfc7aa10dfe68
/Cartographer2_ModuleExperimental/src/main/java/io/github/bananapuncher714/cartographer/module/experimental/menu/OverviewMenu.java
6d5201e7ffee74a4b01d1987ea583a785ff29f1a
[]
no_license
BananaPuncher714/Cartographer2
320211d737e77d70d2c065c875020340e1c9339c
2bc3879bcb0470ec3c90fa4038b7fc3b639f41e7
refs/heads/master
2023-06-24T18:08:45.477536
2023-06-18T05:23:23
2023-06-18T05:23:23
195,094,309
48
52
null
2020-12-27T21:06:47
2019-07-03T16:51:06
Java
UTF-8
Java
false
false
4,501
java
package io.github.bananapuncher714.cartographer.module.experimental.menu; import java.util.ArrayList; import java.util.List; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.map.MapCursor; import io.github.bananapuncher714.cartographer.core.Cartographer; import io.github.bananapuncher714.cartographer.core.api.SimpleImage; import io.github.bananapuncher714.cartographer.core.map.DefaultPlayerCursorProvider; import io.github.bananapuncher714.cartographer.core.map.MapViewer; import io.github.bananapuncher714.cartographer.core.map.Minimap; import io.github.bananapuncher714.cartographer.core.map.menu.MapInteraction; import io.github.bananapuncher714.cartographer.core.map.menu.MapMenu; import io.github.bananapuncher714.cartographer.core.map.menu.MenuComponent; import io.github.bananapuncher714.cartographer.core.map.process.DataCache; import io.github.bananapuncher714.cartographer.core.map.process.MapDataCache; import io.github.bananapuncher714.cartographer.core.renderer.FrameRenderTask; import io.github.bananapuncher714.cartographer.core.renderer.PlayerSetting; public class OverviewMenu extends MapMenu { private Cartographer plugin; private double scale = -1; private byte[] display = new byte[ 128 * 128 ]; private Location center; public OverviewMenu( Cartographer plugin ) { canvas.setDither( false ); this.plugin = plugin; } public boolean view( Player player, PlayerSetting setting ) { viewers.add( player.getUniqueId() ); canvas.getCursors().clear(); for ( MenuComponent component : components ) { if ( component.onView( canvas, player, setting.getCursorX() / 2.0 + 64, setting.getCursorY() / 2.0 + 64 ) ) { return true; } } String mapId = setting.getMap(); if ( mapId == null ) { return true; } Minimap map = plugin.getMapManager().getMinimaps().get( mapId ); Location location = setting.getLocation(); if ( scale == -1 ) { scale = setting.getScale(); center = location.clone(); } else { int x = ( int ) Math.max( -128, Math.min( 127, setting.getCursorX() ) ); int y = ( int ) Math.max( -128, Math.min( 127, setting.getCursorY() ) ); if ( x == -128 ) { center.subtract( scale * 2, 0, 0 ); } else if ( x == 127 ) { center.add( scale * 2, 0, 0 ); } if ( y == -128 ) { center.subtract( 0, 0, scale * 2 ); } else if ( y == 127 ) { center.add( 0, 0, scale * 2 ); } } // Render the minimap List< FrameRenderTask > tasks = new ArrayList< FrameRenderTask >(); DataCache cache = map.getDataCache(); MapViewer viewer = plugin.getPlayerManager().getViewerFor( player.getUniqueId() ); SimpleImage backgroundImage = plugin.getSettings().getBackground(); if ( map.getBackgroundImage() != null ) { backgroundImage = map.getBackgroundImage(); } else if ( viewer.getBackground() != null ) { backgroundImage = viewer.getBackground(); } // Everything after this point can be done async CustomRenderInfo renderInfo = new CustomRenderInfo(); CustomPlayerSetting customSetting = new CustomPlayerSetting( null, setting.getUUID(), mapId, center ); customSetting.setScale( scale ); customSetting.setRotation( false ); renderInfo.setSetting( customSetting ); renderInfo.setUUID( player.getUniqueId() ); renderInfo.setMap( map ); renderInfo.setCache( cache ); if ( backgroundImage != null ) { renderInfo.setBackgroundImage( backgroundImage ); } renderInfo.getWorldCursors().addAll( new DefaultPlayerCursorProvider().getCursors( player, map, setting ) ); // Create a new task per player and run FrameRenderTask task = new CustomRenderTask( renderInfo ); tasks.add( task ); // Fork and join task.fork(); task.join(); display = renderInfo.getData(); for ( MapCursor cursor : renderInfo.getCursors() ) { canvas.getCursors().add( cursor ); } return false; } public boolean interact( Player player, PlayerSetting setting ) { for ( MenuComponent component : components ) { if ( component.onInteract( player, setting.getCursorX() / 2.0 + 64, setting.getCursorY() / 2.0 + 64, setting.getInteraction() ) ) { return true; } } if ( setting.getInteraction() == MapInteraction.Q ) { return true; } else if ( setting.getInteraction() == MapInteraction.LEFT ) { scale /= 2; } else if ( setting.getInteraction() == MapInteraction.RIGHT ) { scale *= 2; } return false; } @Override public byte[] getDisplay() { return display; } }
[ "banana@aaaaahhhhhhh.com" ]
banana@aaaaahhhhhhh.com
b40b22d74681cb37b153b6ab5a04afeb3aa2d3da
e1c0102a1f58eb39914cd78349a9357f2f17b538
/jun_books/book04/src/main/java/com/zccoder/space/interview/thread/User.java
66a8ab10d6f35639c6b99bd2946fd91fbd510a88
[]
no_license
hhhcommon/jun_plugin
377e5f677c9cf8c0f160b6e83325e4947daa49fd
f1af5351707b3627ca62157716669325649e3b11
refs/heads/master
2022-12-31T23:24:07.679466
2020-10-22T09:44:30
2020-10-22T09:44:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
380
java
package com.zccoder.space.interview.thread; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * 用户实体 * * @author zc * @date 2020/05/02 */ @Data @NoArgsConstructor @AllArgsConstructor public class User { /** * 用户名 */ private String userName; /** * 年龄 */ private Integer age; }
[ "wujun728@163.com" ]
wujun728@163.com
e7479eef8fd249cdb92a52b587da7866fb4022c7
c00dc3d94bb888c0ef5c590df8386730367e5f2f
/src/main/java/org/panda/utility/statistics/TTest.java
954f6edc44c888b36ed74a04c9bd2f0192e4dbd0
[]
no_license
fredyww/utility
fdc0424ab9f74d056ef132ace1981c84305b0e44
c0790a41d5d556aaf9805fccab04bf84c112d7d5
refs/heads/master
2020-03-30T06:24:01.343404
2018-09-22T00:22:57
2018-09-22T00:22:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,295
java
package org.panda.utility.statistics; import org.apache.commons.math3.distribution.TDistribution; import org.apache.commons.math3.stat.inference.TestUtils; import org.panda.utility.ArrayUtil; import org.panda.utility.Tuple; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.stream.IntStream; /** * Created by babur on 4/18/16. */ public class TTest { public static double getPValOfMeanDifference(double[] x0, double[] x1) { if (x0.length < 2 || x1.length < 2) return Double.NaN; return TestUtils.tTest(x0, x1); // double t = t(x0, x1); // return pval(t, length(x0) + length(x1) - 2); } public static double t(double[] x1, double[] x2) { double M1 = ArrayUtil.mean(x1); double M2 = ArrayUtil.mean(x2); double N1 = length(x1); double N2 = length(x2); return (M2 - M1) / Math.sqrt(((sumOfSquares(x1, M1) + sumOfSquares(x2, M2)) / (N1 + N2 - 2)) * ((1 / N1) + (1 / N2))); } private static double sumOfSquares(double[] x, double mean) { double sum = 0; for (int i = 0; i < x.length; i++) { if (!Double.isNaN(x[i])) { double v = x[i] - mean; v *= v; sum += v; } } return sum; } private static double variance(double[] x, double mean) { double var = 0; int cnt = 0; for (double v : x) { if (!Double.isNaN(v)) { double term = v - mean; var += term * term; cnt++; } } return cnt == 0 ? Double.NaN : var / (cnt - 1); } private static int length(double[] x) { return (int) IntStream.range(0, x.length).filter(i -> !Double.isNaN(x[i])).count(); } public static double pval(double t, int df) { TDistribution distribution = new TDistribution(df); return 2.0 * distribution.cumulativeProbability(-Math.abs(t)); } public static double getPValOfMeanEqualTo(double[] x, double mean) { if (x.length < 2) return Double.NaN; return TestUtils.tTest(mean, x); } public static Tuple test(double[] x0, double[] x1) { if (x0.length > 2 && x1.length > 2) { return new Tuple(TestUtils.t(x0, x1), getPValOfMeanDifference(x0, x1)); } else if (x0.length == 2 && x1.length > 2) { return testFewValuesAgainstASample(x0, x1); } else if (x0.length == 1 && x1.length > 2) { return test(x0[0], x1); } else if (x1.length == 2 && x0.length > 2) { return testFewValuesAgainstASample(x1, x0); } else if (x1.length == 1 && x0.length > 2) { return test(x1[0], x0); } return new Tuple(Double.NaN, Double.NaN); } /** * Tests if the given value belongs to the drawn sample. */ public static Tuple test(double x0, double[] x1) { if (x1.length < 2) return new Tuple(Double.NaN, Double.NaN); TDistribution dist = new TDistribution(x1.length - 1); double t = (x0 - Summary.mean(x1)) / Summary.stdev(x1); double cdf = dist.cumulativeProbability(t); double p = cdfToPval(cdf); return new Tuple(t, p); } /** * Tests if the given value belongs to the drawn sample. */ public static Tuple testFewValuesAgainstASample(double[] few, double[] sample) { if (sample.length < 2) return new Tuple(Double.NaN, Double.NaN); TDistribution dist = new TDistribution(sample.length - 1); double t = (Summary.mean(few) - Summary.mean(sample)) / (Summary.stdev(sample) / Math.sqrt(few.length)); double cdf = dist.cumulativeProbability(t); double p = cdfToPval(cdf); return new Tuple(t, p); } /** * Cumulative distribution function value to 2-tailed p-value. */ public static double cdfToPval(double cdf) { return cdf < 0.5 ? cdf * 2 : (1 - cdf) * 2; } public static void main(String[] args) { Random r = new Random(); List<Double> pvals = new ArrayList<>(); for (int i = 0; i < 1000; i++) { List<List<Double>> list = new ArrayList<>(); for (int j = 0; j < 2; j++) { list.add(new ArrayList<>()); } for (int j = 0; j < 10; j++) { list.get(r.nextInt(list.size())).add(r.nextGaussian()); // list.get(r.nextDouble() < 0.2 ? 0 : 1).add(r.nextDouble()); } List<double[]> groups = new ArrayList<>(); for (List<Double> doubles : list) { groups.add(ArrayUtil.toArray(doubles)); } double p = getPValOfMeanDifference(groups.get(0), groups.get(1)); if (!Double.isNaN(p)) pvals.add(p); } UniformityChecker.plot(pvals); } }
[ "ozgunbabur@gmail.com" ]
ozgunbabur@gmail.com
9cdf0634b31921f1d4cb64d415614ffd35299ff2
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/listing/utils/TextSetting$$Lambda$4.java
00c9e629cf714e9b736fe7ae8a9161de704a60c3
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
487
java
package com.airbnb.android.listing.utils; import com.airbnb.android.core.models.Listing; import p032rx.functions.Func1; final /* synthetic */ class TextSetting$$Lambda$4 implements Func1 { private static final TextSetting$$Lambda$4 instance = new TextSetting$$Lambda$4(); private TextSetting$$Lambda$4() { } public static Func1 lambdaFactory$() { return instance; } public Object call(Object obj) { return ((Listing) obj).getSpace(); } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
6fe08a4989f7a58dff89edec5c6324d020585261
45e40c967cd659ce95640de153b9a79524eabd5a
/module/01.web/src/com/realart/DeleteQrCodeLogoAction.java
6d871ce8155d0a3188b013a62d3b18d5751e3b72
[]
no_license
GuanXianghui/realart
a3409c2b5d5e681ae7cb1f3f59dc9decbc62ee4c
2271846462d4c395dc137c27c4e6c5ae707249f3
refs/heads/master
2021-01-10T20:19:31.649259
2014-07-13T16:27:52
2014-07-13T16:27:52
20,245,513
0
2
null
null
null
null
GB18030
Java
false
false
1,141
java
package com.realart; import com.realart.interfaces.QrCodeInterface; import org.apache.commons.lang.StringUtils; import org.apache.struts2.ServletActionContext; import java.io.File; /** * 删除二维码logo * * @author Gxx * @module oa * @datetime 14-5-10 19:20 */ public class DeleteQrCodeLogoAction extends BaseAction implements QrCodeInterface{ private String qrLogo; /** * 入口 * @return */ public String execute() throws Exception { logger.info("qrLogo:[" + qrLogo + "]"); //服务器上的路径 String qrCodePhotoPath = ServletActionContext.getServletContext().getRealPath("images/qr_logo/") + "/"; File[] files = new File(qrCodePhotoPath).listFiles(); for(int i=0;i<files.length;i++){ if(StringUtils.equals(StringUtils.EMPTY + (i+1), qrLogo)){ logger.info(files[i].delete()); } } message = "删除二维码logo成功!"; return SUCCESS; } public String getQrLogo() { return qrLogo; } public void setQrLogo(String qrLogo) { this.qrLogo = qrLogo; } }
[ "419066357@163.com" ]
419066357@163.com
8199cb34968c179ed2099e4215b800c7cdd0fd27
521e2e3bf8accbd49b22dc00cace7ca71bd57d6e
/src/main/java/com/github/rmannibucau/javaeefactory/service/event/CreateProject.java
f9665e254a3b676e79eacaad378c24ceb7871692
[]
no_license
rmannibucau/factorEE
1a8057468cd3f067db98dfb06cbde0e99b796af3
aebc587d276554d19b8526bd754a486a5bddac2f
refs/heads/master
2021-01-10T05:13:23.434523
2016-04-05T17:27:45
2016-04-05T17:27:45
54,557,266
3
0
null
null
null
null
UTF-8
Java
false
false
194
java
package com.github.rmannibucau.javaeefactory.service.event; import lombok.Data; import java.util.Collection; @Data public class CreateProject { private final Collection<String> facets; }
[ "rmannibucau@gmail.com" ]
rmannibucau@gmail.com
576222ca08802e77cee317cc5bd1b3cfb32c9fa9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_a86822054114bef7e4ef32b91e8a28bdf18d1424/FootTag/5_a86822054114bef7e4ef32b91e8a28bdf18d1424_FootTag_t.java
a8e010a80a6a9d5020f8a2c9319e72ca42005f1c
[]
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,111
java
// Copyright (c) 2004 ScenPro, Inc. // $Header: /share/content/gforge/sentinel/sentinel/src/gov/nih/nci/cadsr/sentinel/tags/FootTag.java,v 1.2 2009-04-09 14:41:10 hebell Exp $ // $Name: not supported by cvs2svn $ package gov.nih.nci.cadsr.sentinel.tags; import gov.nih.nci.cadsr.sentinel.tool.Constants; import java.io.IOException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.TagSupport; import org.apache.struts.util.MessageResources; import org.apache.struts.Globals; import org.jboss.Version; /** * This is used to place a standard footer on every JSP in the Sentinel Tool * interface. * * @author Larry Hebel */ public class FootTag extends TagSupport { /** * Constructor. */ public FootTag() { } /** * Output the standard footer * * @return EVAL_PAGE to continue processing the JSP. */ public int doEndTag() { try { String jboss = Version.getInstance().getMajor() + "." + Version.getInstance().getMinor() + "." + Version.getInstance().getRevision(); MessageResources msgs = (MessageResources) pageContext .findAttribute(Globals.MESSAGES_KEY); JspWriter out = pageContext.getOut(); out .print("<table class=\"table3\"><colgroup></colgroup><tbody class=\"secttbody\" />\n" + "<tr><td class=\"ncifmenu\"><span style=\"color: #dddddd\">" + msgs.getMessage(Constants._APLVERS).replace(" ", "&nbsp;") + "&nbsp;(" + jboss + "/" + System.getProperty("java.version") + ")" + "</span></td></tr>\n" + "<tr>\n<td class=\"nciftrtable\">\n" + "<a href=\"mailto:ncicb@pop.nci.nih.gov?subject=caDSR%20Sentinel%20Tool\"><img border=\"0\" src=\"/cadsrsentinel/images/email_icon.gif\" alt=\"Email NCI Help Desk\" title=\"Email NCI Help Desk\"></a>\n" + "<a target=\"_blank\" href=\"http://www.cancer.gov/\"><img border=\"0\" src=\"/cadsrsentinel/images/footer_nci.gif\" alt=\"National Cancer Institute Logo\" title=\"National Cancer Institute\"></a>\n" + "<a target=\"_blank\" href=\"http://www.dhhs.gov/\"><img border=\"0\" src=\"/cadsrsentinel/images/footer_hhs.gif\" alt=\"Department of Health and Human Services Logo\" title=\"Department of Health and Human Services\"></a>\n" + "<a target=\"_blank\" href=\"http://www.nih.gov/\"><img border=\"0\" src=\"/cadsrsentinel/images/footer_nih.gif\" alt=\"National Institutes of Health Logo\" title=\"National Institutes of Health\"></a>\n" + "<a target=\"_blank\" href=\"http://www.usa.gov/\"><img border=\"0\" src=\"/cadsrsentinel/images/footer_usagov.gif\" alt=\"USA.gov\" title=\"USA.gov\"></a>\n" + "</td>\n</tr>\n</table>\n"); } catch (IOException ex) { } return EVAL_PAGE; } private static final long serialVersionUID = -4073456777204188509L; }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
50e92df360302438e7de61a900e75b291313f3b4
0252a04e5a388e1f12229b2541589bf655084828
/src/leetCode/problems/_1091_Shortest_Path_in_Binary_Matrix/Solution.java
24061f01ac4b1db02f0138986b1e6f45ad644861
[]
no_license
alanHarper123/LeetCode
bd60e4e0a2ba278f648b504bfdd928ca22403506
312b86a6f1e7adccb7a1f100b664cd9272a85473
refs/heads/master
2021-06-25T15:31:38.069169
2021-01-19T12:56:43
2021-01-19T12:56:43
193,816,741
0
0
null
null
null
null
UTF-8
Java
false
false
2,184
java
package leetCode.problems._1091_Shortest_Path_in_Binary_Matrix; import java.util.LinkedList; public class Solution { private int[][] dirs = new int[][] {{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}}; public int shortestPathBinaryMatrix(int[][] grid) { int n = grid.length; if(grid[0][0]!=0||grid[n-1][n-1]!=0) return -1; if(n==1) return 1; boolean[][] isVisited = new boolean[n][n]; LinkedList<Integer> frontiers = new LinkedList<>(); frontiers.add(0); frontiers.add(0); isVisited[0][0] = true; int step = 1; while (!frontiers.isEmpty()) { step++; int size = frontiers.size()/2; while (size>0) { size--; int i = frontiers.pollFirst(); int j = frontiers.pollFirst(); for(int[] dir:dirs) { int ni = i+dir[0]; int nj = j+dir[1]; if(ni>=0&&ni<n&&nj>=0&&nj<n&&grid[ni][nj]==0&&!isVisited[ni][nj]) { if(ni==n-1&&nj==n-1) return step; isVisited[ni][nj] = true; frontiers.add(ni); frontiers.add(nj); } } } } return -1; } } /* 1091. Shortest Path in Binary Matrix Medium In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and only if it is composed of cells C_1, C_2, ..., C_k such that: Adjacent cells C_i and C_{i+1} are connected 8-directionally (ie., they are different and share an edge or corner) C_1 is at location (0, 0) (ie. has value grid[0][0]) C_k is at location (N-1, N-1) (ie. has value grid[N-1][N-1]) If C_i is located at (r, c), then grid[r][c] is empty (ie. grid[r][c] == 0). Return the length of the shortest such clear path from top-left to bottom-right. If such a path does not exist, return -1. Example 1: Input: [[0,1],[1,0]] Output: 2 Example 2: Input: [[0,0,0],[1,1,0],[1,1,0]] Output: 4 Note: 1 <= grid.length == grid[0].length <= 100 grid[r][c] is 0 or 1 */
[ "1531508001@qq.com" ]
1531508001@qq.com
eee5c5d02b65081d57e41be71ed0a9428af9fdc0
be37aa95857f8dcbc627f7cfd5ebfb693f1f79e8
/com/sun/corba/se/PortableActivationIDL/_InitialNameServiceStub.java
d3dcad7c04a7d5b9a1fd8a9fbdd05d968921508b
[]
no_license
woniper/java_source_reading
aca54710b76be4635b197b3594d1c8c77c8eb5d4
8e6cfdba5fea15b2d3f0360b12453a3e73f306e8
refs/heads/master
2021-01-01T05:29:40.308753
2016-05-19T04:06:14
2016-05-19T04:06:14
59,172,081
0
0
null
null
null
null
UTF-8
Java
false
false
2,988
java
package com.sun.corba.se.PortableActivationIDL; /** * com/sun/corba/se/PortableActivationIDL/_InitialNameServiceStub.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /HUDSON3/workspace/8-2-build-macosx-x86_64/jdk8u66/4988/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl * Tuesday, October 6, 2015 4:10:32 PM PDT */ /** Interface used to support binding references in the bootstrap name * service. */ public class _InitialNameServiceStub extends org.omg.CORBA.portable.ObjectImpl implements com.sun.corba.se.PortableActivationIDL.InitialNameService { /** bind initial name */ public void bind (String name, org.omg.CORBA.Object obj, boolean isPersistant) throws com.sun.corba.se.PortableActivationIDL.InitialNameServicePackage.NameAlreadyBound { org.omg.CORBA.portable.InputStream $in = null; try { org.omg.CORBA.portable.OutputStream $out = _request ("bind", true); $out.write_string (name); org.omg.CORBA.ObjectHelper.write ($out, obj); $out.write_boolean (isPersistant); $in = _invoke ($out); return; } catch (org.omg.CORBA.portable.ApplicationException $ex) { $in = $ex.getInputStream (); String _id = $ex.getId (); if (_id.equals ("IDL:PortableActivationIDL/InitialNameService/NameAlreadyBound:1.0")) throw com.sun.corba.se.PortableActivationIDL.InitialNameServicePackage.NameAlreadyBoundHelper.read ($in); else throw new org.omg.CORBA.MARSHAL (_id); } catch (org.omg.CORBA.portable.RemarshalException $rm) { bind (name, obj, isPersistant ); } finally { _releaseReply ($in); } } // bind // Type-specific CORBA::Object operations private static String[] __ids = { "IDL:PortableActivationIDL/InitialNameService:1.0"}; public String[] _ids () { return (String[])__ids.clone (); } private void readObject (java.io.ObjectInputStream s) throws java.io.IOException { String str = s.readUTF (); String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { org.omg.CORBA.Object obj = orb.string_to_object (str); org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); _set_delegate (delegate); } finally { orb.destroy() ; } } private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException { String[] args = null; java.util.Properties props = null; org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props); try { String str = orb.object_to_string (this); s.writeUTF (str); } finally { orb.destroy() ; } } } // class _InitialNameServiceStub
[ "lkw1989@wemakeprice.com" ]
lkw1989@wemakeprice.com