blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
sequencelengths
1
1
author_id
stringlengths
1
79
bcd25caaa922afb114fa952bc068623774c56da6
b24a5af8ba7fa4073d79ea0a449801b4d0ffc004
/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/Spread.java
749121c52d2459d1ef0d4c28504aa9f3bbd9a64f
[]
no_license
vitordeatorreao/jMetal
1cdf04c75e4312837285551ea32ef33431ede3e9
29601499ee820231ec224119bd96790cb83e47ab
refs/heads/master
2020-12-11T08:07:54.176541
2015-05-18T19:26:40
2015-05-18T19:26:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,273
java
// Spread.java // // Author: // Antonio J. Nebro <[email protected]> // Juan J. Durillo <[email protected]> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 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 Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package org.uma.jmetal.qualityindicator.impl; import org.uma.jmetal.qualityindicator.QualityIndicator; import org.uma.jmetal.solution.Solution; import org.uma.jmetal.util.JMetalException; import org.uma.jmetal.util.front.Front; import org.uma.jmetal.util.front.imp.ArrayFront; import org.uma.jmetal.util.front.util.FrontUtils; import org.uma.jmetal.util.naming.impl.SimpleDescribedEntity; import org.uma.jmetal.util.point.impl.LexicographicalPointComparator; import org.uma.jmetal.util.point.impl.PointUtils; import java.util.List; /** * This class implements the spread quality indicator. It must be only to two bi-objective problem. * Reference: Deb, K., Pratap, A., Agarwal, S., Meyarivan, T.: A fast and * elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans. on Evol. Computation 6 (2002) 182-197 */ public class Spread extends SimpleDescribedEntity implements QualityIndicator { /** * Constructor. * Creates a new instance of a Spread object */ public Spread() { super("SPREAD", "SPREAD quality indicator") ; } @Override public double execute(Front paretoFrontApproximation, Front trueParetoFront) { if (paretoFrontApproximation == null) { throw new JMetalException("The pareto front approximation object is null") ; } else if (trueParetoFront == null) { throw new JMetalException("The pareto front object is null"); } return spread(paretoFrontApproximation, trueParetoFront); } @Override public double execute(List<? extends Solution> paretoFrontApproximation, List<? extends Solution> trueParetoFront) { if (paretoFrontApproximation == null) { throw new JMetalException("The pareto front approximation object is null") ; } else if (trueParetoFront == null) { throw new JMetalException("The pareto front object is null"); } return this.execute(new ArrayFront(paretoFrontApproximation), new ArrayFront(trueParetoFront)) ; } /** * Calculates the Spread metric. * * @param front The front. * @param trueParetoFront The true pareto front. */ public double spread(Front front, Front trueParetoFront) { double[] maximumValue; double[] minimumValue; Front normalizedFront; Front normalizedParetoFront; // STEP 1. Obtain the maximum and minimum values of the Pareto front maximumValue = FrontUtils.getMaximumValues(trueParetoFront); minimumValue = FrontUtils.getMinimumValues(trueParetoFront); // STEP 2. Get the normalized front and true Pareto fronts normalizedFront = FrontUtils.getNormalizedFront(front, maximumValue, minimumValue); normalizedParetoFront = FrontUtils.getNormalizedFront(trueParetoFront, maximumValue, minimumValue); // STEP 3. Sort normalizedFront and normalizedParetoFront; normalizedFront.sort(new LexicographicalPointComparator()); normalizedParetoFront.sort(new LexicographicalPointComparator()); // STEP 4. Compute df and dl (See specifications in Deb's description of the metric) double df = PointUtils.euclideanDistance(normalizedFront.getPoint(0), normalizedParetoFront.getPoint(0)) ; double dl = PointUtils.euclideanDistance( normalizedFront.getPoint(normalizedFront.getNumberOfPoints()-1), normalizedParetoFront.getPoint(normalizedParetoFront.getNumberOfPoints()-1)) ; double mean = 0.0; double diversitySum = df + dl; int numberOfPoints = normalizedFront.getNumberOfPoints() ; // STEP 5. Calculate the mean of distances between points i and (i - 1). // (the points are in lexicografical order) for (int i = 0; i < (numberOfPoints - 1); i++) { mean += PointUtils.euclideanDistance(normalizedFront.getPoint(i), normalizedFront.getPoint(i + 1)); } mean = mean / (double) (numberOfPoints - 1); // STEP 6. If there are more than a single point, continue computing the // metric. In other case, return the worse value (1.0, see metric's description). if (numberOfPoints > 1) { for (int i = 0; i < (numberOfPoints - 1); i++) { diversitySum += Math.abs(PointUtils.euclideanDistance(normalizedFront.getPoint(i), normalizedFront.getPoint(i + 1)) - mean); } return diversitySum / (df + dl + (numberOfPoints - 1) * mean); } else { return 1.0; } } @Override public String getName() { return super.getName() ; } }
fea39bac36b8e110831b0b22e397573924be678a
f0ec508f4b480d8d5399a2880e4cbb0533fc2fc1
/com.gzedu.xlims.biz/src/main/java/com/gzedu/xlims/serviceImpl/exam/temp/ExportExamStudentSeat2VO.java
3298b656e7b86bd87e9f98d4660e3d3b0bbf56f5
[]
no_license
lizm335/MyLizm
a327bd4d08a33c79e9b6ef97144d63dae7114a52
1bcca82395b54d431fb26817e61a294f9d7dd867
refs/heads/master
2020-03-11T17:25:25.687426
2018-04-19T03:10:28
2018-04-19T03:10:28
130,146,458
3
0
null
null
null
null
UTF-8
Java
false
false
402
java
/** * Copyright(c) 2013 版权所有:广州远程教育中心 www.969300.com */ package com.gzedu.xlims.serviceImpl.exam.temp; /** * 功能说明: * * @author 李明 [email protected] * @Date 2016年12月9日 * @version 2.5 * */ public class ExportExamStudentSeat2VO { // 学号 姓名 卷号 科目名称 考试形式 考试日期 考试时间 考场及座位号 考点 考点地址 }
bbe81c43fa2d35a6a9c41cefc68b19a546e3cae7
66d3122f8f031d6e8b27e8ead7aa5ae0d7e33b45
/net/minecraft/client/block/ColoredBlock.java
14659f8be885b993d4cc08f37bb8ea260f550858
[]
no_license
gurachan/minecraft1.14-dp
c10059787555028f87a4c8183ff74e6e1cfbf056
34daddc03be27d5a0ee2ab9bc8b1deb050277208
refs/heads/master
2022-01-07T01:43:52.836604
2019-05-08T17:18:13
2019-05-08T17:18:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
133
java
package net.minecraft.client.block; import net.minecraft.util.DyeColor; public interface ColoredBlock { DyeColor getColor(); }
ae161284341cf6d75d2da03e930f11f0857974af
87ffe6cef639e2b96b8d5236b5ace57e16499491
/app/src/main/java/com/xiaomi/mipush/sdk/MiPushMessage.java
a2dcf4d33c05001b32d80db0cb91752a5365761f
[]
no_license
leerduo/FoodsNutrition
24ffeea902754b84a2b9fbd3299cf4fceb38da3f
a448a210e54f789201566da48cc44eceb719b212
refs/heads/master
2020-12-11T05:45:34.531682
2015-08-28T04:35:05
2015-08-28T04:35:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package com.xiaomi.mipush.sdk; import java.util.HashMap; import java.util.Map; public class MiPushMessage implements PushMessageHandler.a { private String a; private int b; private String c; private String d; private String e; private int f; private int g; private int h; private boolean i; private String j; private String k; private String l; private HashMap<String, String> m = new HashMap(); public String a() { return this.a; } public void a(int paramInt) { this.b = paramInt; } public void a(String paramString) { this.a = paramString; } public void a(Map<String, String> paramMap) { this.m.clear(); if (paramMap != null) { this.m.putAll(paramMap); } } public void a(boolean paramBoolean) { this.i = paramBoolean; } public String b() { return this.c; } public void b(int paramInt) { this.g = paramInt; } public void b(String paramString) { this.c = paramString; } public String c() { return this.d; } public void c(int paramInt) { this.h = paramInt; } public void c(String paramString) { this.d = paramString; } public String d() { return this.e; } public void d(int paramInt) { this.f = paramInt; } public void d(String paramString) { this.e = paramString; } public void e(String paramString) { this.j = paramString; } public boolean e() { return this.i; } public String f() { return this.l; } public void f(String paramString) { this.k = paramString; } public int g() { return this.f; } public void g(String paramString) { this.l = paramString; } public Map<String, String> h() { return this.m; } public String toString() { return "messageId={" + this.a + "},passThrough={" + this.f + "},alias={" + this.d + "},topic={" + this.e + "},content={" + this.c + "},description={" + this.j + "},title={" + this.k + "},isNotified={" + this.i + "},notifyId={" + this.h + "},notifyType={" + this.g + "}, category={" + this.l + "}, extra={" + this.m + "}"; } } /* Location: D:\15036015\反编译\shiwuku\classes_dex2jar.jar * Qualified Name: com.xiaomi.mipush.sdk.MiPushMessage * JD-Core Version: 0.7.0-SNAPSHOT-20130630 */
559184be4c3a524eaee389a33d51d95276fe5e9b
a26ef48d26ec3d5d1091910edfd4acc8a679faa8
/vertx/src/main/java/net/kuujo/copycat/vertx/VertxEventBusProtocolServer.java
da666e80caf3f27b6c070b100393e3f650af2e1c
[ "Apache-2.0" ]
permissive
y-higuchi/copycat
07920bfc7968ea0963db03ff1147f7cecd35d966
968b153131e732a241d84ac3a0525bd812ffb60f
refs/heads/master
2021-01-15T16:37:07.723942
2015-02-05T10:59:03
2015-02-05T10:59:03
26,004,909
0
1
null
null
null
null
UTF-8
Java
false
false
3,046
java
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.kuujo.copycat.vertx; import net.kuujo.copycat.protocol.ProtocolHandler; import net.kuujo.copycat.protocol.ProtocolServer; import org.vertx.java.core.Context; import org.vertx.java.core.Handler; import org.vertx.java.core.Vertx; import org.vertx.java.core.eventbus.Message; import org.vertx.java.core.eventbus.ReplyFailure; import java.nio.ByteBuffer; import java.util.concurrent.CompletableFuture; /** * Vert.x event bus protocol server. * * @author <a href="http://github.com/kuujo">Jordan Halterman</a> */ public class VertxEventBusProtocolServer implements ProtocolServer, Handler<Message<byte[]>> { private final String address; private final Vertx vertx; private final Context context; private ProtocolHandler handler; public VertxEventBusProtocolServer(String address, Vertx vertx) { this.address = address; this.vertx = vertx; this.context = vertx.currentContext(); } @Override public void handle(Message<byte[]> message) { if (handler != null) { handler.apply(ByteBuffer.wrap(message.body())).whenComplete((reply, error) -> { context.runOnContext(v -> { if (error != null) { message.fail(0, error.getMessage()); } else { byte[] bytes = new byte[reply.remaining()]; reply.get(bytes); message.reply(bytes); } }); }); } else { message.fail(ReplyFailure.NO_HANDLERS.toInt(), "No message handler registered"); } } @Override public void handler(ProtocolHandler handler) { this.handler = handler; } @Override public CompletableFuture<Void> listen() { final CompletableFuture<Void> future = new CompletableFuture<>(); vertx.eventBus().registerHandler(address, this, result -> { if (result.failed()) { future.completeExceptionally(result.cause()); } else { future.complete(null); } }); return future; } @Override public CompletableFuture<Void> close() { final CompletableFuture<Void> future = new CompletableFuture<>(); vertx.eventBus().unregisterHandler(address, this, result -> { if (result.failed()) { future.completeExceptionally(result.cause()); } else { future.complete(null); } }); return future; } @Override public String toString() { return String.format("%s[address=%s]", getClass().getSimpleName(), address); } }
6c6ff06204ad7dc7e5175724ebf3e9fedd940f66
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/yelpInterview/_LL25ReverseLLSizeK.java
e5ca98d170ce4636be50a3466ea068fcfaff3590
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
1,409
java
package yelpInterview; import java.util.Stack; public class _LL25ReverseLLSizeK { static class Node{ int value; Node next; public Node(int value) { this.value=value; } } public static void main(String a[]){ Node n=new Node(1); n.next=new Node(2); n.next.next=new Node(3); n.next.next.next=new Node(4); n.next.next.next.next=new Node(5); n.next.next.next.next.next=new Node(6); n.next.next.next.next.next.next=new Node(7); n.next.next.next.next.next.next.next=new Node(8); n.next.next.next.next.next.next.next.next=new Node(9); n=reverseLL(n,3); print(n); } private static Node reverseLL(Node n,int k) { Node outputNode=new Node(-1); Node ptr=outputNode; boolean flag=false; while(n!=null) { if(!flag){ Stack<Integer> stack=new Stack<>(); for (int i = 0; i < k; i++) { if(n!=null) stack.push(n.value); else break; n=n.next; } while(!stack.isEmpty()) { outputNode.next=new Node(stack.pop()); outputNode=outputNode.next; } } else{ for (int i = 0; i < k; i++) { if(n!=null){ outputNode.next=new Node(n.value); outputNode=outputNode.next; } else break; n=n.next; } } flag=!flag; } return ptr.next; } private static void print(Node n) { while(n!=null) { System.out.print(n.value+"/"); n=n.next; } } }
728fbc015a20c265de0f7750c93c498a599adc08
6d82f06048d330216b17c19790f29075e62e47d5
/snapshot/runtime/util/i18n/src/java/org/apache/avalon/util/i18n/ResourceManager.java
56dab609a5fe20d64c62dc8077c25e4719c59d5b
[]
no_license
IdelsTak/dpml-svn
7d1fc3f1ff56ef2f45ca5f7f3ae88b1ace459b79
9f9bdcf0198566ddcee7befac4a3b2c693631df5
refs/heads/master
2022-03-19T15:50:45.872930
2009-11-23T08:45:39
2009-11-23T08:45:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,448
java
/* * Copyright 1999-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied. * * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.avalon.util.i18n; import java.lang.ref.WeakReference; import java.util.HashMap; /** * Manager for resources. * * @author <a href="mailto:[email protected]">Avalon Development Team</a> */ public class ResourceManager { /** * Permission needed to clear complete cache. */ private static final RuntimePermission CLEAR_CACHE_PERMISSION = new RuntimePermission( "i18n.clearCompleteCache" ); private static final HashMap c_resources = new HashMap(); /** * Retrieve resource with specified basename. * * @param baseName the basename * @return the Resources */ public static final Resources getBaseResources( final String baseName ) { return getBaseResources( baseName, null ); } /** * Retrieve resource with specified basename. * * @param baseName the basename * @param classLoader the classLoader to load resources from * @return the Resources */ public synchronized static final Resources getBaseResources( final String baseName, final ClassLoader classLoader ) { Resources resources = getCachedResource( baseName ); if( null == resources ) { resources = new Resources( baseName, classLoader ); putCachedResource( baseName, resources ); } return resources; } /** * Clear the cache of all resources currently loaded into the * system. This method is useful if you need to dump the complete * cache and because part of the application is reloading and * thus the resources may need to be reloaded. * * <p>Note that the caller must have been granted the * "i18n.clearCompleteCache" {@link RuntimePermission} or * else a security exception will be thrown.</p> * * @throws SecurityException if the caller does not have * permission to clear cache */ public synchronized static final void clearResourceCache() throws SecurityException { final SecurityManager sm = System.getSecurityManager(); if( null != sm ) { sm.checkPermission( CLEAR_CACHE_PERMISSION ); } c_resources.clear(); } /** * Cache specified resource in weak reference. * * @param baseName the resource key * @param resources the resources object */ private synchronized static final void putCachedResource( final String baseName, final Resources resources ) { c_resources.put( baseName, new WeakReference( resources ) ); } /** * Retrieve cached resource. * * @param baseName the resource key * @return resources the resources object */ private synchronized static final Resources getCachedResource( final String baseName ) { final WeakReference weakReference = (WeakReference)c_resources.get( baseName ); if( null == weakReference ) { return null; } else { return (Resources)weakReference.get(); } } /** * Retrieve resource for specified name. * The basename is determined by name postfixed with ".Resources". * * @param name the name to use when looking up resources * @return the Resources */ public static final Resources getResources( final String name ) { return getBaseResources( name + ".Resources" ); } /** * Retrieve resource for specified Classes package. * The basename is determined by name of classes package * postfixed with ".Resources". * * @param clazz the Class * @return the Resources */ public static final Resources getPackageResources( final Class clazz ) { return getBaseResources( getPackageResourcesBaseName( clazz ), clazz.getClassLoader() ); } /** * Retrieve resource for specified Class. * The basename is determined by name of Class * postfixed with "Resources". * * @param clazz the Class * @return the Resources */ public static final Resources getClassResources( final Class clazz ) { return getBaseResources( getClassResourcesBaseName( clazz ), clazz.getClassLoader() ); } /** * Retrieve resource basename for specified Classes package. * The basename is determined by name of classes package * postfixed with ".Resources". * * @param clazz the Class * @return the resource basename */ public static final String getPackageResourcesBaseName( final Class clazz ) { final Package pkg = clazz.getPackage(); String baseName; if( null == pkg ) { final String name = clazz.getName(); if( -1 == name.lastIndexOf( "." ) ) { baseName = "Resources"; } else { baseName = name.substring( 0, name.lastIndexOf( "." ) ) + ".Resources"; } } else { baseName = pkg.getName() + ".Resources"; } return baseName; } /** * Retrieve resource basename for specified Class. * The basename is determined by name of Class * postfixed with "Resources". * * @param clazz the Class * @return the resource basename */ public static final String getClassResourcesBaseName( final Class clazz ) { return clazz.getName() + "Resources"; } /** * Private Constructor to block instantiation. */ private ResourceManager() { } }
[ "niclas@00579e91-1ffa-0310-aa18-b241b61564ef" ]
niclas@00579e91-1ffa-0310-aa18-b241b61564ef
2e5330d2dd4a02e3cdd13a6677701d42248f79fb
4d490754183a5a0f0c73703954561ccdadfb8698
/src/net/dzikoysk/funnyguilds/util/configuration/ConfigurationParser.java
ba653328242bb2049e27381df3a91361f55f4ba3
[]
no_license
miki226/FunnyGuilds
1e85671d7314faf8cb80275caaf90c0dce0d37ca
cbbe878b7d70c591c7068b53fda6c8c51531bac7
refs/heads/master
2021-01-21T09:06:13.194197
2014-11-17T21:24:02
2014-11-17T21:24:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,118
java
package net.dzikoysk.funnyguilds.util.configuration; import java.util.Map; import java.util.Stack; public class ConfigurationParser { private final String[] code; private Map<String, ConfigurationObject> result; public ConfigurationParser(String[] code){ this.code = code; this.run(); } public void run(){ //Stack<String> keys = new Stack<>(); //Stack<String> elements = new Stack<>(); Stack<Character> operators = new Stack<>(); StringBuilder chars = new StringBuilder(); for(String line : code){ if(line == null || line.isEmpty()) continue; boolean whitespace = true; for(char c : line.toCharArray()){ switch(c){ case ' ': if(whitespace) continue; case ':': operators.push(c); case '-': operators.push(c); default: chars.append(c); } whitespace = false; } String string = chars.toString(); if(string.isEmpty()) continue; /* * key: value * key: value * * list: * - value * - value * */ } } public Map<String, ConfigurationObject> getResult(){ return this.result; } }
e80aaa58aff01a02ea13e4306a639dabfc9bd91d
11bc2c26ba2c3e8cfb58e5dd7ab430ec0e16a375
/ACORD_PC_JAXB/src/org/acord/standards/pc_surety/acord1/xml/PersInlandMarineLineBusinessType.java
1d6eac445dfae92a8ec1a2cf2bfd3c10993e171c
[]
no_license
TimothyDH/neanderthal
b295b3e3401ab403fb89950f354c83f3690fae38
1444b21035e3a846d85ea1bf32638a1e535bca67
refs/heads/master
2021-05-04T10:25:54.675556
2019-09-05T13:49:14
2019-09-05T13:49:14
45,859,747
0
0
null
null
null
null
UTF-8
Java
false
false
8,092
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147 // 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: 2010.02.24 at 10:20:12 PM EST // package org.acord.standards.pc_surety.acord1.xml; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PersInlandMarineLineBusiness_Type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PersInlandMarineLineBusiness_Type"> * &lt;complexContent> * &lt;extension base="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}PCLINEBUSINESS"> * &lt;sequence> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}Coverage" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}SafeVaultCharacteristics" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}AlarmAndSecurity" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}PropertySchedule" maxOccurs="unbounded"/> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}Dwell" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://www.ACORD.org/standards/PC_Surety/ACORD1/xml/}QuestionAnswer" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PersInlandMarineLineBusiness_Type", propOrder = { "coverage", "safeVaultCharacteristics", "alarmAndSecurity", "propertySchedule", "dwell", "questionAnswer" }) public class PersInlandMarineLineBusinessType extends PCLINEBUSINESS { @XmlElement(name = "Coverage") protected List<CoverageType> coverage; @XmlElement(name = "SafeVaultCharacteristics") protected List<SafeVaultCharacteristicsType> safeVaultCharacteristics; @XmlElement(name = "AlarmAndSecurity") protected List<AlarmAndSecurityType> alarmAndSecurity; @XmlElement(name = "PropertySchedule", required = true) protected List<PropertyScheduleType> propertySchedule; @XmlElement(name = "Dwell") protected List<DwellType> dwell; @XmlElement(name = "QuestionAnswer") protected List<QuestionAnswerType> questionAnswer; /** * Gets the value of the coverage 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 coverage property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCoverage().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CoverageType } * * */ public List<CoverageType> getCoverage() { if (coverage == null) { coverage = new ArrayList<CoverageType>(); } return this.coverage; } /** * Gets the value of the safeVaultCharacteristics 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 safeVaultCharacteristics property. * * <p> * For example, to add a new item, do as follows: * <pre> * getSafeVaultCharacteristics().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SafeVaultCharacteristicsType } * * */ public List<SafeVaultCharacteristicsType> getSafeVaultCharacteristics() { if (safeVaultCharacteristics == null) { safeVaultCharacteristics = new ArrayList<SafeVaultCharacteristicsType>(); } return this.safeVaultCharacteristics; } /** * Gets the value of the alarmAndSecurity 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 alarmAndSecurity property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAlarmAndSecurity().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link AlarmAndSecurityType } * * */ public List<AlarmAndSecurityType> getAlarmAndSecurity() { if (alarmAndSecurity == null) { alarmAndSecurity = new ArrayList<AlarmAndSecurityType>(); } return this.alarmAndSecurity; } /** * Gets the value of the propertySchedule 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 propertySchedule property. * * <p> * For example, to add a new item, do as follows: * <pre> * getPropertySchedule().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link PropertyScheduleType } * * */ public List<PropertyScheduleType> getPropertySchedule() { if (propertySchedule == null) { propertySchedule = new ArrayList<PropertyScheduleType>(); } return this.propertySchedule; } /** * Gets the value of the dwell 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 dwell property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDwell().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link DwellType } * * */ public List<DwellType> getDwell() { if (dwell == null) { dwell = new ArrayList<DwellType>(); } return this.dwell; } /** * Gets the value of the questionAnswer 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 questionAnswer property. * * <p> * For example, to add a new item, do as follows: * <pre> * getQuestionAnswer().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link QuestionAnswerType } * * */ public List<QuestionAnswerType> getQuestionAnswer() { if (questionAnswer == null) { questionAnswer = new ArrayList<QuestionAnswerType>(); } return this.questionAnswer; } }
[ "Bryan.Bringle@3f59fb54-24d0-11df-be41-57e7d1eefd51" ]
Bryan.Bringle@3f59fb54-24d0-11df-be41-57e7d1eefd51
d1f20e13694d0d547b79b8994b610f07685f7e49
9dadd9ae01e963ff7a103069776e83053fc6a6f6
/src/main/java/es/upcnet/domain/Authority.java
f4c0ece319cfa66bbed1dcb533d7206c21d14cb8
[]
no_license
aplaza74/jhipsterSampleApplication
0866f78618720570a21e16e14d267d065b364496
07c8827f7597570ceaa35075561acc5e7c8d7925
refs/heads/master
2021-09-01T19:10:52.950091
2017-12-28T10:56:58
2017-12-28T10:56:58
115,614,520
0
0
null
null
null
null
UTF-8
Java
false
false
1,447
java
package es.upcnet.domain; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Column; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; /** * An authority (a security role) used by Spring Security. */ @Entity @Table(name = "jhi_authority") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Authority implements Serializable { private static final long serialVersionUID = 1L; @NotNull @Size(max = 50) @Id @Column(length = 50) private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Authority authority = (Authority) o; return !(name != null ? !name.equals(authority.name) : authority.name != null); } @Override public int hashCode() { return name != null ? name.hashCode() : 0; } @Override public String toString() { return "Authority{" + "name='" + name + '\'' + "}"; } }
9ec35d6164a2eb6340d8409a462bb7b0e9e0ddb6
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
/java/classes2/com/megvii/zhimasdk/d/b.java
ef86a8e5fde1dec162050e3f84c84bcf2dbd6905
[ "Apache-2.0" ]
permissive
Paladin1412/house
2bb7d591990c58bd7e8a9bf933481eb46901b3ed
b9e63db1a4975b614c422fed3b5b33ee57ea23fd
refs/heads/master
2021-09-17T03:37:48.576781
2018-06-27T12:39:38
2018-06-27T12:41:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,962
java
package com.megvii.zhimasdk.d; import android.content.Context; import android.content.res.Resources; import android.util.Base64; import com.megvii.zhimasdk.R.raw; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Collection; import java.util.Iterator; import java.util.UUID; public class b { public static double a(Collection<Double> paramCollection) { paramCollection = paramCollection.iterator(); for (double d = 0.0D; paramCollection.hasNext(); d = ((Double)paramCollection.next()).doubleValue() + d) {} return d; } public static final String a(byte[] paramArrayOfByte) { try { Object localObject = MessageDigest.getInstance("SHA-1"); ((MessageDigest)localObject).update(paramArrayOfByte); localObject = ((MessageDigest)localObject).digest(); StringBuilder localStringBuilder = new StringBuilder(); int j = localObject.length; int i = 0; while (i < j) { for (paramArrayOfByte = Integer.toHexString(localObject[i] & 0xFF); paramArrayOfByte.length() < 2; paramArrayOfByte = "0" + paramArrayOfByte) {} localStringBuilder.append(paramArrayOfByte); i += 1; } paramArrayOfByte = localStringBuilder.toString(); return paramArrayOfByte; } catch (NoSuchAlgorithmException paramArrayOfByte) { paramArrayOfByte.printStackTrace(); } return ""; } public static byte[] a(Context paramContext) { localObject = null; Context localContext = null; ByteArrayOutputStream localByteArrayOutputStream = new ByteArrayOutputStream(); byte[] arrayOfByte = new byte['Ѐ']; try { paramContext = paramContext.getResources().openRawResource(R.raw.livenessmodel); for (;;) { localContext = paramContext; localObject = paramContext; int i = paramContext.read(arrayOfByte); if (i == -1) { break; } localContext = paramContext; localObject = paramContext; localByteArrayOutputStream.write(arrayOfByte, 0, i); } try { ((InputStream)localObject).close(); throw paramContext; } catch (IOException localIOException) { for (;;) { localIOException.printStackTrace(); } } } catch (IOException paramContext) { localObject = localContext; paramContext.printStackTrace(); if (localContext != null) {} try { localContext.close(); for (;;) { return localByteArrayOutputStream.toByteArray(); localContext = paramContext; localObject = paramContext; localByteArrayOutputStream.close(); if (paramContext != null) { try { paramContext.close(); } catch (IOException paramContext) { paramContext.printStackTrace(); } } } } catch (IOException paramContext) { for (;;) { paramContext.printStackTrace(); } } } finally { if (localObject == null) {} } } public static String b(Context paramContext) { n localn = new n(paramContext); String str = localn.a("key_uuid"); if (str != null) { return str; } if (str != null) { paramContext = str; if (str.trim().length() != 0) {} } else { paramContext = Base64.encodeToString(UUID.randomUUID().toString().getBytes(), 0); } localn.a("key_uuid", paramContext); return paramContext; } } /* Location: /Users/gaoht/Downloads/zirom/classes2-dex2jar.jar!/com/megvii/zhimasdk/d/b.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
2c3b9bd213b9e6183682c42f1b307d30e871824e
01d1b40592982e978e195c451d5d45c4126e3550
/evcache-server-spring-cloud-autoconfigure/src/main/java/com/github/aafwu00/evcache/server/spring/cloud/MemcachedReactiveHealthIndicator.java
6da7893287a8632a353d6979271f48fc02e5e032
[ "Apache-2.0" ]
permissive
maisonarmani/netflix-evcache-spring
296ddcd61584692eea8f3fc4ca4cdc7e8d9ae125
ec4cf05b8c323cbf69d8dec5df5e063f8645df2f
refs/heads/master
2022-04-14T09:34:37.407834
2020-04-11T04:07:28
2020-04-11T04:07:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,615
java
/* * Copyright 2017-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.aafwu00.evcache.server.spring.cloud; import net.spy.memcached.MemcachedClient; import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.ReactiveHealthIndicator; import reactor.core.publisher.Mono; import static com.github.aafwu00.evcache.server.spring.cloud.MemcachedHealthIndicator.DURATION; import static com.github.aafwu00.evcache.server.spring.cloud.MemcachedHealthIndicator.EXPIRATION; import static com.github.aafwu00.evcache.server.spring.cloud.MemcachedHealthIndicator.KEY; import static com.github.aafwu00.evcache.server.spring.cloud.MemcachedHealthIndicator.VALUE; import static java.util.Objects.requireNonNull; import static java.util.concurrent.TimeUnit.SECONDS; /** * Simple implementation of a {@link ReactiveHealthIndicator} returning status information for Memcached. * * @author Taeho Kim */ public class MemcachedReactiveHealthIndicator extends AbstractReactiveHealthIndicator { private final MemcachedClient client; public MemcachedReactiveHealthIndicator(final MemcachedClient client) { super(); this.client = requireNonNull(client); } @Override protected Mono<Health> doHealthCheck(final Health.Builder builder) { return trySetOperation().zipWith(tryGetOperation(), this::isSuccess) .map(success -> success ? builder.up().build() : builder.outOfService().build()); } private Mono<Boolean> tryGetOperation() { return Mono.fromCallable(() -> client.asyncGet(KEY).get(DURATION, SECONDS)) .map(VALUE::equals); } private Mono<Boolean> trySetOperation() { return Mono.fromCallable(() -> client.set(KEY, EXPIRATION, VALUE).get(DURATION, SECONDS)); } private Boolean isSuccess(final Boolean isSuccessSet, final Boolean isSuccessGet) { return isSuccessSet && isSuccessGet; } }
290eeef54a1db416a35ef204631c59030b7c2b33
590cebae4483121569983808da1f91563254efed
/Router/eps2-src/balancer/src/main/java/ru/acs/fts/eps2/balancer/dispatch/IMessageDispatcher.java
6100c786ee266d606e75d87a6005d51ed44567b7
[]
no_license
ke-kontur/eps
8b00f9c7a5f92edeaac2f04146bf0676a3a78e27
7f0580cd82022d36d99fb846c4025e5950b0c103
refs/heads/master
2020-05-16T23:53:03.163443
2014-11-26T07:00:34
2014-11-26T07:01:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package ru.acs.fts.eps2.balancer.dispatch; import javax.jms.Message; import ru.acs.fts.eps2.balancer.exceptions.MessageDispatchException; public interface IMessageDispatcher { void dispatch( Message message ) throws MessageDispatchException; void discard( Message message ) throws MessageDispatchException; }
976d860200be9607f1a542dc35cfc47a2a2b70f4
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/retailbot-20210224/src/main/java/com/aliyun/retailbot20210224/models/AddCoreEntryRequest.java
3c7594b5df296c3fa68839359729403793c62f57
[ "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
2,267
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.retailbot20210224.models; import com.aliyun.tea.*; public class AddCoreEntryRequest extends TeaModel { @NameInMap("RobotCode") public String robotCode; @NameInMap("SimilarEntry") public AddCoreEntryRequestSimilarEntry similarEntry; @NameInMap("SlotId") public Integer slotId; public static AddCoreEntryRequest build(java.util.Map<String, ?> map) throws Exception { AddCoreEntryRequest self = new AddCoreEntryRequest(); return TeaModel.build(map, self); } public AddCoreEntryRequest setRobotCode(String robotCode) { this.robotCode = robotCode; return this; } public String getRobotCode() { return this.robotCode; } public AddCoreEntryRequest setSimilarEntry(AddCoreEntryRequestSimilarEntry similarEntry) { this.similarEntry = similarEntry; return this; } public AddCoreEntryRequestSimilarEntry getSimilarEntry() { return this.similarEntry; } public AddCoreEntryRequest setSlotId(Integer slotId) { this.slotId = slotId; return this; } public Integer getSlotId() { return this.slotId; } public static class AddCoreEntryRequestSimilarEntry extends TeaModel { @NameInMap("CoreValue") public String coreValue; @NameInMap("SimilarValues") public java.util.List<String> similarValues; public static AddCoreEntryRequestSimilarEntry build(java.util.Map<String, ?> map) throws Exception { AddCoreEntryRequestSimilarEntry self = new AddCoreEntryRequestSimilarEntry(); return TeaModel.build(map, self); } public AddCoreEntryRequestSimilarEntry setCoreValue(String coreValue) { this.coreValue = coreValue; return this; } public String getCoreValue() { return this.coreValue; } public AddCoreEntryRequestSimilarEntry setSimilarValues(java.util.List<String> similarValues) { this.similarValues = similarValues; return this; } public java.util.List<String> getSimilarValues() { return this.similarValues; } } }
4ac0f8aebb2764861f147ffe480aa65c669fffab
e966c5abcd225460feee543f9c439467a3b957b4
/src/main/java/sexy/kostya/serena/network/SerenaPacketProcessor.java
a25af4f07598d91442299b82c85c2a66a9b5bee8
[]
no_license
RinesThaix/Serena
d668ac7cf818c0d47f4102c2ec8951511aefe255
0b30110293e2aee76791279749d7e464472f5035
refs/heads/master
2020-04-06T07:08:48.285470
2018-03-07T16:02:22
2018-03-07T16:02:22
124,180,295
1
0
null
null
null
null
UTF-8
Java
false
false
1,415
java
package sexy.kostya.serena.network; import org.inmine.network.Packet; import org.inmine.network.PacketProcessor; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; /** * Created by RINES on 07.03.2018. */ public abstract class SerenaPacketProcessor extends PacketProcessor { private final static Executor packetsExecutor = Executors.newFixedThreadPool(getExecutorThreadsAmount(), new ThreadFactory() { private AtomicInteger id = new AtomicInteger(); @Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setDaemon(true); thread.setName("PacketProcessor-" + this.id.incrementAndGet()); return thread; } }); private static int getExecutorThreadsAmount() { return SerenaNetworkServer.getInstance() == null ? 4 : 16; } @Override protected <T extends Packet> void addHandler(Class<T> packet, Consumer<T> handler) { super.addHandler(packet, p -> packetsExecutor.execute(() -> { try { handler.accept(p); }catch(Throwable t) { new Exception("Can not handle packet " + packet.getSimpleName(), t).printStackTrace(); } })); } }
23c089d8232de14420e86a87f0f659a199f997a3
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
/Chrystalz/src/studio/ignitionigloogames/chrystalz/manager/asset/MusicManager.java
74b4a0a53d789d769f8dd28c737c2996875a6ac6
[ "Unlicense" ]
permissive
retropipes/older-java-games
777574e222f30a1dffe7936ed08c8bfeb23a21ba
786b0c165d800c49ab9977a34ec17286797c4589
refs/heads/master
2023-04-12T14:28:25.525259
2021-05-15T13:03:54
2021-05-15T13:03:54
235,693,016
0
0
null
null
null
null
UTF-8
Java
false
false
1,992
java
/* Chrystalz: A dungeon-crawling, roguelike game Licensed under MIT. See the LICENSE file for details. All support is handled via the GitHub repository: https://github.com/IgnitionIglooGames/chrystalz */ package studio.ignitionigloogames.chrystalz.manager.asset; import java.net.URL; import java.nio.BufferUnderflowException; import studio.ignitionigloogames.chrystalz.Chrystalz; import studio.ignitionigloogames.chrystalz.manager.file.Extension; import studio.ignitionigloogames.common.oggplayer.OggPlayer; public class MusicManager { private static final String DEFAULT_LOAD_PATH = "/assets/music/"; private static String LOAD_PATH = MusicManager.DEFAULT_LOAD_PATH; private static Class<?> LOAD_CLASS = MusicManager.class; private static OggPlayer CURRENT_MUSIC; private static OggPlayer getMusic(final String filename) { final URL modFile = MusicManager.LOAD_CLASS .getResource(MusicManager.LOAD_PATH + filename + Extension.getMusicExtensionWithPeriod()); return new OggPlayer(modFile); } public static void playMusic(final int musicID) { MusicManager.CURRENT_MUSIC = MusicManager .getMusic(MusicConstants.getMusicName(musicID)); if (MusicManager.CURRENT_MUSIC != null) { // Play the music MusicManager.CURRENT_MUSIC.playLoop(); } } public static void stopMusic() { if (MusicManager.CURRENT_MUSIC != null) { // Stop the music try { MusicManager.CURRENT_MUSIC.stopLoop(); } catch (final BufferUnderflowException bue) { // Ignore } catch (final Throwable t) { Chrystalz.getErrorLogger().logError(t); } } } public static boolean isMusicPlaying() { if (MusicManager.CURRENT_MUSIC != null) { return MusicManager.CURRENT_MUSIC.isAlive(); } return false; } }
a48fcce10b8f1abd5ad63653e29f02d5af0eab8e
4c8f1a68b02bdfe613f4cb9cdc5c7363a43aaff5
/src/main/java/com/cjburkey/claimchunk/config/ccconfig/CCConfigParser.java
ab59ec95210f5e241a39d07a4f0854ccce398fe3
[ "MIT" ]
permissive
duwhyy/ClaimChunk
b1723c9a0329c3ee8e1e37dd8a8e840663cc545e
7e2eadb700da2c5247b7f3b90b2c0add8f35498e
refs/heads/master
2023-07-07T12:00:55.684433
2021-07-27T05:48:14
2021-07-27T05:48:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,221
java
package com.cjburkey.claimchunk.config.ccconfig; import javax.annotation.Nonnull; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CCConfigParser { private static final int REGEX_FLAGS = Pattern.COMMENTS // This makes the regex a lot easier to read :D | Pattern.UNICODE_CHARACTER_CLASS // UTF-8 support | Pattern.UNIX_LINES // Single '\n' lines ; // The comment regex @SuppressWarnings("RegExpRedundantEscape") // Necessary? private static final String COMMENT = "^ \\s*? \\# \\s*? (.*?) \\s*? $"; private static final Pattern COMMENT_PAT = Pattern.compile(COMMENT, REGEX_FLAGS); // The label regex private static final String IDENTIFIER = "[a-zA-Z0-9_\\-@]+ [a-zA-Z0-9_\\-.@]*?"; private static final String LABEL = "^ \\s*? (" + IDENTIFIER + ") \\s*? : \\s*? $"; private static final Pattern LABEL_PAT = Pattern.compile(LABEL, REGEX_FLAGS); // The property value definition regex private static final String PROPERTY = "^ \\s*? (" + IDENTIFIER + ") \\s*? (.*?) \\s*? ; \\s*? $"; private static final Pattern PROPERTY_PAT = Pattern.compile(PROPERTY, REGEX_FLAGS); public List<CCConfigParseError> parse(@Nonnull CCConfig config, @Nonnull String input) { // Keep track of errors as we go final ArrayList<CCConfigParseError> errors = new ArrayList<>(); // Parsing information int currentPos = 0; int currentLine = 0; final List<String> currentLabel = new ArrayList<>(); final Matcher commentMatcher = COMMENT_PAT.matcher(input); final Matcher labelMatcher = LABEL_PAT.matcher(input); final Matcher propertyMatcher = PROPERTY_PAT.matcher(input); final String[] lines = input.split("\n"); // Loop until there is no input (or only one character what can you do // with that) for (String line : lines) { // Trim the line if ((line = line.trim()).isEmpty()) { // Skip empty lines continue; } int previousLine = currentLine; int previousPos = currentPos; currentPos += line.length(); currentLine ++; // Try to match a comment commentMatcher.reset(line); if (commentMatcher.find()) { // Skip comments continue; } // Try to match a label labelMatcher.reset(line); if (labelMatcher.find()) { // Update the current label currentLabel.clear(); Collections.addAll(currentLabel, labelMatcher.group(1).trim().split("\\.")); continue; } // Try to match a property propertyMatcher.reset(line); if (propertyMatcher.find()) { String key = String.join(".", currentLabel) + "." + propertyMatcher.group(1).trim(); String value = propertyMatcher.group(2).trim(); // Update the config value config.set(key, value); continue; } // Add an error for lines that fail to parse errors.add(new CCConfigParseError(previousLine, previousPos, currentLine, currentPos, line, "failed_to_parse_line")); } // Return all of the errors matched; return errors; } @SuppressWarnings("unused") private static String namespacedKey(Collection<String> categories, String key) { // If the category is none, the value is just under the key if (categories.isEmpty()) { return key; } // Create an empty string builder StringBuilder builder = new StringBuilder(key); // Build up the category-named key. for (String category : categories) { builder.append(category); builder.append('.'); } // Convert the builder back into a string return builder.toString(); } }
c8fa63407bd3aad31416b5d6ebc9a3dc63260d6b
d620ab67aa540c7d8466325a39f962fcf074bd06
/modules/dsb-cxfutils/src/test/java/org/petalslink/dsb/cxf/HelloServiceImpl.java
ccaf37b1e90f21c832b0c6e1450729ce232b100f
[]
no_license
chamerling/petals-dsb
fa8439f28bb4077a9324371d7eb691b484a12d24
58b355b79f4a4d753a3c762f619ec2b32833549a
refs/heads/master
2016-09-05T20:44:59.125937
2012-03-27T10:28:37
2012-03-27T10:28:37
3,722,608
0
1
null
null
null
null
UTF-8
Java
false
false
348
java
/** * */ package org.petalslink.dsb.cxf; /** * @author chamerling * */ public class HelloServiceImpl implements HelloService { /* (non-Javadoc) * @see org.petalslink.dsb.cxf.HelloService#sayHello(java.lang.String) */ public String sayHello(String in) { System.out.println("WS Called"); return in; } }
6c658fd45a1d9f1314ed888da10cd3b04a03d58b
90f3a8153d4b55d854c570d3ef90f69e965e7bfd
/Coding Ninjas/KaranAtThePg.java
0ba3d3fee448b0a8fe6f4ac55115c3b8e3f947af
[]
no_license
uditiarora/Competitive
d75c3b60d4818736f428517a0f944f3854b2c47a
f57b0202d02ab15b147bf50e9357a2a6e256fa93
refs/heads/master
2023-07-07T09:12:15.098829
2020-10-26T12:45:34
2020-10-26T12:45:34
203,732,572
0
0
null
null
null
null
UTF-8
Java
false
false
2,666
java
import java.util.*; public class Main { public static void main(String args[] ) throws Exception { Scanner s = new Scanner(System.in); int q=s.nextInt(); for(int t=0;t<q;t++) { int n=s.nextInt(); String s1[]=(s.next()).split(":"); int in=Integer.parseInt(s1[0])*60+Integer.parseInt(s1[1]); s1=(s.next()).split(":"); int wake=Integer.parseInt(s1[0])*60+Integer.parseInt(s1[1]); s1=(s.next()).split(":"); int open=Integer.parseInt(s1[0])*60+Integer.parseInt(s1[1]); int travel=s.nextInt(); int select=s.nextInt(); int f[][]=new int[n][2]; for(int i=0;i<n;i++) { s1=(s.next()).split(":"); f[i][0]=Integer.parseInt(s1[0])*60+Integer.parseInt(s1[1]); s1=(s.next()).split(":"); f[i][1]=Integer.parseInt(s1[0])*60+Integer.parseInt(s1[1]); } /*System.out.println(in+" "+wake+" "+open+" "+travel+" "+select); for(int i=0;i<n;i++) { System.out.println(f[i][0]+" "+f[i][1]); }*/ if(n==0 || wake>in || open>in) { System.out.println("Case "+(t+1)+": -1"); continue; } int consume=2*travel+select; int min=Integer.MAX_VALUE; int friend=-1; int max=0; if(wake+travel<=open) max=open-travel; else //if(wake<=open && wake+travel>=open) max=wake; for(int i=0;i<n;i++) { if(max+consume<f[i][0] && max+consume<min && max+consume<in) { min=max+consume; friend=i; //System.out.println("1min :"+min+" friend : "+friend); } if(wake<f[i][1] && open<f[i][1] && f[i][1]+consume<in && f[i][1]+consume<min) { min=f[i][1]+consume; friend=i; //System.out.println("2min :"+min+" friend : "+friend); } else if(max>f[i][1] && max+consume<in && max+consume<min) { min=max+consume; friend=i; //System.out.println("3min :"+min+" friend : "+friend); } } if(friend==-1) System.out.println("Case "+(t+1)+": -1"); else System.out.println("Case "+(t+1)+": "+(friend+1)); } } }
3c7da686685871fe7b82d6fe5b1c3a888aee13df
cca87c4ade972a682c9bf0663ffdf21232c9b857
/com/tencent/mm/boot/svg/a/a/dl.java
b0485a27d24a2e92a79f763a111d199d8aa4adb7
[]
no_license
ZoranLi/wechat_reversing
b246d43f7c2d7beb00a339e2f825fcb127e0d1a1
36b10ef49d2c75d69e3c8fdd5b1ea3baa2bba49a
refs/heads/master
2021-07-05T01:17:20.533427
2017-09-25T09:07:33
2017-09-25T09:07:33
104,726,592
12
1
null
null
null
null
UTF-8
Java
false
false
3,659
java
package com.tencent.mm.boot.svg.a.a; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Paint.Cap; import android.graphics.Paint.Join; import android.graphics.Paint.Style; import android.graphics.Path; import android.os.Looper; import com.tencent.mm.svg.c; import com.tencent.smtt.sdk.WebView; import com.tencent.tmassistantsdk.downloadservice.DownloadHelper; public final class dl extends c { private final int height = 50; private final int width = 50; protected final int b(int i, Object... objArr) { switch (i) { case 0: return 50; case 1: return 50; case 2: Canvas canvas = (Canvas) objArr[0]; Looper looper = (Looper) objArr[1]; Matrix d = c.d(looper); float[] c = c.c(looper); Paint g = c.g(looper); g.setFlags(385); g.setStyle(Style.FILL); Paint g2 = c.g(looper); g2.setFlags(385); g2.setStyle(Style.STROKE); g.setColor(WebView.NIGHT_MODE_COLOR); g2.setStrokeWidth(1.0f); g2.setStrokeCap(Cap.BUTT); g2.setStrokeJoin(Join.MITER); g2.setStrokeMiter(4.0f); g2.setPathEffect(null); c.a(g2, looper).setStrokeWidth(1.0f); canvas.save(); Paint a = c.a(g, looper); a.setColor(-1); c = c.a(c, 1.0f, 0.0f, -289.0f, 0.0f, 1.0f, -369.0f); d.reset(); d.setValues(c); canvas.concat(d); canvas.save(); c = c.a(c, 1.0f, 0.0f, 302.0f, 0.0f, 1.0f, 370.0f); d.reset(); d.setValues(c); canvas.concat(d); canvas.save(); Paint a2 = c.a(a, looper); Path h = c.h(looper); h.moveTo(0.0f, DownloadHelper.SAVE_FATOR); h.cubicTo(0.0f, 0.6715728f, 0.6715728f, 0.0f, DownloadHelper.SAVE_FATOR, 0.0f); h.lineTo(2.5f, 0.0f); h.cubicTo(3.3284273f, 0.0f, 4.0f, 0.6715728f, 4.0f, DownloadHelper.SAVE_FATOR); h.lineTo(4.0f, 46.5f); h.cubicTo(4.0f, 47.328426f, 3.3284273f, 48.0f, 2.5f, 48.0f); h.lineTo(DownloadHelper.SAVE_FATOR, 48.0f); h.cubicTo(0.6715728f, 48.0f, 0.0f, 47.328426f, 0.0f, 46.5f); h.lineTo(0.0f, DownloadHelper.SAVE_FATOR); h.close(); canvas.drawPath(h, a2); canvas.restore(); canvas.save(); a2 = c.a(a, looper); h = c.h(looper); h.moveTo(20.0f, DownloadHelper.SAVE_FATOR); h.cubicTo(20.0f, 0.6715728f, 20.671574f, 0.0f, 21.5f, 0.0f); h.lineTo(22.5f, 0.0f); h.cubicTo(23.328426f, 0.0f, 24.0f, 0.6715728f, 24.0f, DownloadHelper.SAVE_FATOR); h.lineTo(24.0f, 46.5f); h.cubicTo(24.0f, 47.328426f, 23.328426f, 48.0f, 22.5f, 48.0f); h.lineTo(21.5f, 48.0f); h.cubicTo(20.671574f, 48.0f, 20.0f, 47.328426f, 20.0f, 46.5f); h.lineTo(20.0f, DownloadHelper.SAVE_FATOR); h.close(); canvas.drawPath(h, a2); canvas.restore(); canvas.restore(); canvas.restore(); c.f(looper); break; } return 0; } }
d1568b9454b6c5d7ec26263a47f6ebd3d7b060e9
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/1/org/apache/commons/lang3/math/NumberUtils_max_1211.java
1b3788996f380aa2b4a81a0f3f94d0e7718b07a6
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,567
java
org apach common lang3 math extra function java number class version number util numberutil maximum code code valu param param param largest valu max
2d89ffd2a4f93a64edd81cb0501b035f995060ea
0f1a73dc0329cead4fa60981c1c1eb141d758a5d
/kfs-parent/core/src/main/java/org/kuali/kfs/gl/businessobject/PosterOutputSummaryBalanceTypeFiscalYearAndPeriodTotal.java
10242c316cc37cb91084bd606307aa5fa2851272
[]
no_license
r351574nc3/kfs-maven
20d9f1a65c6796e623c4845f6d68834c30732503
5f213604df361a874cdbba0de057d4cd5ea1da11
refs/heads/master
2016-09-06T15:07:01.034167
2012-06-01T07:40:46
2012-06-01T07:40:46
3,441,165
0
0
null
null
null
null
UTF-8
Java
false
false
3,266
java
/* * Copyright 2011 The Kuali Foundation. * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.kfs.gl.businessobject; import java.util.LinkedHashMap; import org.kuali.kfs.sys.KFSKeyConstants; /** * A poster output summary total line, for transactions with a given fiscal year, fiscal period, and balance type */ public class PosterOutputSummaryBalanceTypeFiscalYearAndPeriodTotal extends PosterOutputSummaryBalanceTypeFiscalYearTotal { private String fiscalPeriodCode; /** * Constructs a PosterOutputSummaryBalanceTypeFiscalYearAndPeriodTotal * @param balanceTypeCode the balance type code to total * @param universityFiscalYear the fiscal year to total * @param universityFiscalPeriodCode the fiscal period code to total */ public PosterOutputSummaryBalanceTypeFiscalYearAndPeriodTotal(String balanceTypeCode, Integer universityFiscalYear, String universityFiscalPeriodCode) { super(balanceTypeCode, universityFiscalYear); this.fiscalPeriodCode = universityFiscalPeriodCode; } /** * @return the fiscal period associated with this total line */ public String getFiscalPeriodCode() { return fiscalPeriodCode; } /** * @see org.kuali.kfs.gl.businessobject.PosterOutputSummaryBalanceTypeFiscalYearTotal#getSummaryMessageName() */ @Override protected String getSummaryMessageName() { return KFSKeyConstants.MESSAGE_REPORT_POSTER_OUTPUT_SUMMARY_BALANCE_TYPE_FISCAL_YEAR_AND_PERIOD_TOTAL; } /** * @see org.kuali.kfs.gl.businessobject.PosterOutputSummaryBalanceTypeFiscalYearTotal#getSummaryMessageParameters() */ @Override protected String[] getSummaryMessageParameters() { return new String[] { this.getFiscalPeriodCode(), this.getUniversityFiscalYear().toString(), this.getBalanceTypeCode() }; } /** * A map of the "keys" of this transient business object * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() */ @Override protected LinkedHashMap toStringMapper() { LinkedHashMap pks = new LinkedHashMap<String, Object>(); pks.put("universityFiscalYear", this.getUniversityFiscalYear()); pks.put("fiscalPeriodCode",this.getFiscalPeriodCode()); pks.put("balanceTypeCode",this.getBalanceTypeCode()); pks.put("objectTypeCode",this.getObjectTypeCode()); pks.put("creditAmount",this.getCreditAmount()); pks.put("debitAmount",this.getDebitAmount()); pks.put("budgetAmount",this.getBudgetAmount()); pks.put("netAmount",this.getNetAmount()); return pks; } }
d7b49a7f3691ab946859a456aa43f1782d22ca98
33f7b7950db2398877157eea5651f7bb9497cef9
/backend/src/main/java/com/algamoney/api/model/Endereco.java
fff1e847202a7ad81e1472215cb6fa09dbcf496f
[]
no_license
marcelosoliveira/projeto-controle-financeiro
95ec03d0c2f805845e931c91c30228144e9b5044
202836ae725b45941378870fe0c19441b1785f1a
refs/heads/master
2023-09-04T05:29:57.520078
2021-10-24T14:37:46
2021-10-24T14:37:46
403,731,699
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package com.algamoney.api.model; import javax.persistence.Embeddable; import lombok.Data; @Data @Embeddable public class Endereco { private String logradouro; private String numero; private String complemento; private String bairro; private String cep; private String cidade; private String estado; }
ed4b63f5b008999e35eabfc9dc6f1f4ac87d6d53
fd49852c3426acf214b390c33927b5a30aeb0e0a
/aosp/javalib/android/app/Instrumentation$1ContextMenuRunnable.java
8673052b1ecd5dc9657cfba365b8d3f519edeae9
[]
no_license
HanChangHun/MobilePlus-Prototype
fb72a49d4caa04bce6edb4bc060123c238a6a94e
3047c44a0a2859bf597870b9bf295cf321358de7
refs/heads/main
2023-06-10T19:51:23.186241
2021-06-26T08:28:58
2021-06-26T08:28:58
333,411,414
0
0
null
null
null
null
UTF-8
Java
false
false
708
java
package android.app; class ContextMenuRunnable implements Runnable { private final Activity activity; private final int flags; private final int identifier; boolean returnValue; public ContextMenuRunnable(Activity paramActivity, int paramInt1, int paramInt2) { this.activity = paramActivity; this.identifier = paramInt1; this.flags = paramInt2; } public void run() { this.returnValue = this.activity.getWindow().performContextMenuIdentifierAction(this.identifier, this.flags); } } /* Location: /home/chun/Desktop/temp/!/android/app/Instrumentation$1ContextMenuRunnable.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
b7a775b708b28ec3914a41e34948f7bf9482d953
921b73fb6a0964210b9f513b9aa08b4d1c2cf7d7
/src/main/java/TercerParcialClase/Bridge/basic/Implementor.java
811b2737958f08fadccee15be3875d7bb3cdbad3
[]
no_license
X4TKC/PatronesDeDiseno
d781ff5b4c7459f01dfe484cdc18e7a9ec89d75b
0ccbadc36ae5355707193766cec3e71dac5830b3
refs/heads/master
2020-08-10T03:14:55.449201
2019-11-15T12:26:14
2019-11-15T12:26:14
214,243,199
1
1
null
null
null
null
UTF-8
Java
false
false
134
java
package TercerParcialClase.Bridge.basic; public interface Implementor { public void operationA(); public void operationB(); }
df3be69dc940cefd520621b03d96e021e7d0f3cd
f8c25703d021e75771bb23e8f118f747ba2720d4
/gazetteer-osm/src/main/java/io/gazetteer/osm/rocksdb/RocksdbConsumer.java
c835ee2b77793ddf630a1535cdab52b79e59e72e
[ "Apache-2.0" ]
permissive
fossabot/gazetteer
b11f888ee27ab4b7966374484c7bb48b9e42a84f
00c976bc59ded4a77debf715dbf743d441eaedd3
refs/heads/master
2020-04-20T16:12:25.085820
2019-02-03T14:08:47
2019-02-03T14:08:47
168,952,013
0
0
null
2019-02-03T14:08:46
2019-02-03T14:08:46
null
UTF-8
Java
false
false
876
java
package io.gazetteer.osm.rocksdb; import io.gazetteer.osm.domain.Node; import io.gazetteer.osm.domain.Way; import io.gazetteer.osm.osmpbf.DataBlock; import java.util.Collection; import java.util.function.Consumer; import static com.google.common.base.Preconditions.checkNotNull; public class RocksdbConsumer implements Consumer<DataBlock> { private final EntityStore<Node> nodeStore; private final EntityStore<Way> wayStore; public RocksdbConsumer(EntityStore<Node> nodeStore, EntityStore<Way> wayStore) { checkNotNull(nodeStore); checkNotNull(wayStore); this.nodeStore = nodeStore; this.wayStore = wayStore; } @Override public void accept(DataBlock dataBlock) { try { nodeStore.addAll(dataBlock.getNodes()); wayStore.addAll(dataBlock.getWays()); } catch (EntityStoreException e) { e.printStackTrace(); } } }
3ffce640ddf9a6cde9579ab4fe67abeb73e243af
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/LANG-19b-1-14-PESA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang3/text/translate/NumericEntityUnescaper_ESTest_scaffolding.java
268c18d40528d8ad0a5672698f2ff22212ea0d61
[]
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
466
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Jan 19 16:38:15 UTC 2020 */ package org.apache.commons.lang3.text.translate; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class NumericEntityUnescaper_ESTest_scaffolding { // Empty scaffolding for empty test suite }
4e74ef8893f55fff59387aabe00f324a0df48e83
385af1ff329d32af6aa66fd24626304f193b41ae
/src/main/java/com/my/rental/adaptor/RentalConsumer.java
8d348beef085226bc90b5fe912078e94e46f2a48
[]
no_license
PaengE/book-rental-service-rental
1f0abd3674a2d6fa67d6c0f5142370d168dac23e
bbfe3b4d6a42cb99db1c743528fec09f06e6ef96
refs/heads/master
2023-06-07T11:13:19.705601
2021-07-05T09:16:41
2021-07-05T09:16:41
373,809,177
1
0
null
2021-07-05T09:16:42
2021-06-04T10:43:19
Java
UTF-8
Java
false
false
3,275
java
package com.my.rental.adaptor; import com.fasterxml.jackson.databind.ObjectMapper; import com.my.rental.config.KafkaProperties; import com.my.rental.domain.Rental; import com.my.rental.domain.event.UserIdCreated; import com.my.rental.service.RentalService; import java.time.Duration; import java.util.Collections; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.PostConstruct; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.errors.WakeupException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @Service public class RentalConsumer { private final Logger log = LoggerFactory.getLogger(RentalConsumer.class); private final AtomicBoolean closed = new AtomicBoolean(false); public static final String TOPIC = "topic_rental"; private final KafkaProperties kafkaProperties; private KafkaConsumer<String, String> kafkaConsumer; private final RentalService rentalService; private ExecutorService executorService = Executors.newCachedThreadPool(); public RentalConsumer(KafkaProperties kafkaProperties, RentalService rentalService) { this.kafkaProperties = kafkaProperties; this.rentalService = rentalService; } @PostConstruct public void start() { log.info("Kafka consumer starting ..."); this.kafkaConsumer = new KafkaConsumer<>(kafkaProperties.getConsumerProps()); Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown)); kafkaConsumer.subscribe(Collections.singleton(TOPIC)); log.info("Kafka consumer started"); executorService.execute( () -> { try { while (!closed.get()) { ConsumerRecords<String, String> records = kafkaConsumer.poll(Duration.ofSeconds(3)); for (ConsumerRecord<String, String> record : records) { log.info("Consumed message in {} : {}", TOPIC, record.value()); ObjectMapper objectMapper = new ObjectMapper(); UserIdCreated userIdCreated = objectMapper.readValue(record.value(), UserIdCreated.class); Rental rental = rentalService.createRental(userIdCreated); } } kafkaConsumer.commitSync(); } catch (WakeupException e) { if (!closed.get()) { throw e; } } catch (Exception e) { log.error(e.getMessage(), e); } finally { log.info("kafka consumer close"); kafkaConsumer.close(); } } ); } public KafkaConsumer<String, String> getKafkaConsumer() { return kafkaConsumer; } public void shutdown() { log.info("Shutdown Kafka consumer"); closed.set(true); kafkaConsumer.wakeup(); } }
50ef247865b6d78cfc10de4431ba12694d874029
5076e9c5113ed349680e2e10be701f3184c44b66
/libraries/ExoPlayer-r2.6.1/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp3/XingSeeker.java
3bfa9f8e7f4d525f1a105fa3c26ac6dda57a656f
[ "MIT", "Apache-2.0" ]
permissive
gmplemenos/transistor
56205743caf16a9d16f4a085e03309b8827139e5
67c7e499244fdd270ac10f54622aa3b789ba8a41
refs/heads/master
2021-05-13T23:05:39.624776
2018-01-05T19:35:37
2018-01-05T19:35:42
116,503,701
0
0
null
2018-01-06T17:52:21
2018-01-06T17:52:21
null
UTF-8
Java
false
false
6,754
java
/* * Copyright (C) 2016 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.google.android.exoplayer2.extractor.mp3; import android.util.Log; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.extractor.MpegAudioHeader; import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.Util; /** * MP3 seeker that uses metadata from a Xing header. */ /* package */ final class XingSeeker implements Mp3Extractor.Seeker { private static final String TAG = "XingSeeker"; /** * Returns a {@link XingSeeker} for seeking in the stream, if required information is present. * Returns {@code null} if not. On returning, {@code frame}'s position is not specified so the * caller should reset it. * * @param inputLength The length of the stream in bytes, or {@link C#LENGTH_UNSET} if unknown. * @param position The position of the start of this frame in the stream. * @param mpegAudioHeader The MPEG audio header associated with the frame. * @param frame The data in this audio frame, with its position set to immediately after the * 'Xing' or 'Info' tag. * @return A {@link XingSeeker} for seeking in the stream, or {@code null} if the required * information is not present. */ public static XingSeeker create(long inputLength, long position, MpegAudioHeader mpegAudioHeader, ParsableByteArray frame) { int samplesPerFrame = mpegAudioHeader.samplesPerFrame; int sampleRate = mpegAudioHeader.sampleRate; int flags = frame.readInt(); int frameCount; if ((flags & 0x01) != 0x01 || (frameCount = frame.readUnsignedIntToInt()) == 0) { // If the frame count is missing/invalid, the header can't be used to determine the duration. return null; } long durationUs = Util.scaleLargeTimestamp(frameCount, samplesPerFrame * C.MICROS_PER_SECOND, sampleRate); if ((flags & 0x06) != 0x06) { // If the size in bytes or table of contents is missing, the stream is not seekable. return new XingSeeker(position, mpegAudioHeader.frameSize, durationUs); } long dataSize = frame.readUnsignedIntToInt(); long[] tableOfContents = new long[100]; for (int i = 0; i < 100; i++) { tableOfContents[i] = frame.readUnsignedByte(); } // TODO: Handle encoder delay and padding in 3 bytes offset by xingBase + 213 bytes: // delay = (frame.readUnsignedByte() << 4) + (frame.readUnsignedByte() >> 4); // padding = ((frame.readUnsignedByte() & 0x0F) << 8) + frame.readUnsignedByte(); if (inputLength != C.LENGTH_UNSET && inputLength != position + dataSize) { Log.w(TAG, "XING data size mismatch: " + inputLength + ", " + (position + dataSize)); } return new XingSeeker(position, mpegAudioHeader.frameSize, durationUs, dataSize, tableOfContents); } private final long dataStartPosition; private final int xingFrameSize; private final long durationUs; /** * Data size, including the XING frame. */ private final long dataSize; /** * Entries are in the range [0, 255], but are stored as long integers for convenience. */ private final long[] tableOfContents; private XingSeeker(long dataStartPosition, int xingFrameSize, long durationUs) { this(dataStartPosition, xingFrameSize, durationUs, C.LENGTH_UNSET, null); } private XingSeeker(long dataStartPosition, int xingFrameSize, long durationUs, long dataSize, long[] tableOfContents) { this.dataStartPosition = dataStartPosition; this.xingFrameSize = xingFrameSize; this.durationUs = durationUs; this.dataSize = dataSize; this.tableOfContents = tableOfContents; } @Override public boolean isSeekable() { return tableOfContents != null; } @Override public long getPosition(long timeUs) { if (!isSeekable()) { return dataStartPosition + xingFrameSize; } double percent = (timeUs * 100d) / durationUs; double scaledPosition; if (percent <= 0) { scaledPosition = 0; } else if (percent >= 100) { scaledPosition = 256; } else { int prevTableIndex = (int) percent; double prevScaledPosition = tableOfContents[prevTableIndex]; double nextScaledPosition = prevTableIndex == 99 ? 256 : tableOfContents[prevTableIndex + 1]; // Linearly interpolate between the two scaled positions. double interpolateFraction = percent - prevTableIndex; scaledPosition = prevScaledPosition + (interpolateFraction * (nextScaledPosition - prevScaledPosition)); } long positionOffset = Math.round((scaledPosition / 256) * dataSize); // Ensure returned positions skip the frame containing the XING header. positionOffset = Util.constrainValue(positionOffset, xingFrameSize, dataSize - 1); return dataStartPosition + positionOffset; } @Override public long getTimeUs(long position) { long positionOffset = position - dataStartPosition; if (!isSeekable() || positionOffset <= xingFrameSize) { return 0L; } double scaledPosition = (positionOffset * 256d) / dataSize; int prevTableIndex = Util.binarySearchFloor(tableOfContents, (long) scaledPosition, true, true); long prevTimeUs = getTimeUsForTableIndex(prevTableIndex); long prevScaledPosition = tableOfContents[prevTableIndex]; long nextTimeUs = getTimeUsForTableIndex(prevTableIndex + 1); long nextScaledPosition = prevTableIndex == 99 ? 256 : tableOfContents[prevTableIndex + 1]; // Linearly interpolate between the two table entries. double interpolateFraction = prevScaledPosition == nextScaledPosition ? 0 : ((scaledPosition - prevScaledPosition) / (nextScaledPosition - prevScaledPosition)); return prevTimeUs + Math.round(interpolateFraction * (nextTimeUs - prevTimeUs)); } @Override public long getDurationUs() { return durationUs; } /** * Returns the time in microseconds for a given table index. * * @param tableIndex A table index in the range [0, 100]. * @return The corresponding time in microseconds. */ private long getTimeUsForTableIndex(int tableIndex) { return (durationUs * tableIndex) / 100; } }
30c3fb8809d496845e0308cf39029f9a0c3e0289
a47f5306c4795d85bf7100e646b26b614c32ea71
/sphairas-libs/couchdb/src/org/thespheres/betula/couchdb/ui/CouchDBCredentialsController.java
e8dadf75c31585ddfe91dd4160895c23991d2982
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
sphairas/sphairas-desktop
65aaa0cd1955f541d3edcaf79442e645724e891b
f47c8d4ea62c1fc2876c0ffa44e5925bfaebc316
refs/heads/master
2023-01-21T12:02:04.146623
2020-10-22T18:26:52
2020-10-22T18:26:52
243,803,115
2
1
Apache-2.0
2022-12-06T00:34:25
2020-02-28T16:11:33
Java
UTF-8
Java
false
false
2,629
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 org.thespheres.betula.couchdb.ui; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import javax.swing.JComponent; import org.netbeans.spi.options.OptionsPanelController; import org.openide.util.HelpCtx; import org.openide.util.Lookup; /** * * @author boris.heithecker */ public abstract class CouchDBCredentialsController extends OptionsPanelController { private CouchDBCredentialsPanel panel; protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this); private boolean changed; @Override public final void update() { getPanel().load(); changed = false; } @Override public final void applyChanges() { // SwingUtilities.invokeLater(() -> { if (isChanged()) { getPanel().store(); } changed = false; // }); } @Override public final void cancel() { // need not do anything special, if no changes have been persisted yet } @Override public final boolean isValid() { return getPanel().valid(); } @Override public final boolean isChanged() { return changed; } @Override public HelpCtx getHelpCtx() { return null; // new HelpCtx("...ID") if you have a help set } @Override public JComponent getComponent(Lookup masterLookup) { return getPanel(); } private CouchDBCredentialsPanel getPanel() { if (panel == null) { panel = new CouchDBCredentialsPanel(this); } return panel; } final void changed() { if (!changed) { changed = true; pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); } pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); } public abstract String loadCouchDBDatabase(); public abstract void storeCouchDBDatabase(String db); public abstract String loadCouchDBUser(); public abstract void storeCouchDBUser(String user); public abstract boolean hasStoredPassword(); public abstract void storeCouchDBPassword(char[] pw); @Override public void addPropertyChangeListener(PropertyChangeListener l) { pcs.addPropertyChangeListener(l); } @Override public void removePropertyChangeListener(PropertyChangeListener l) { pcs.removePropertyChangeListener(l); } }
bf4bca340506c9cd4922e4965bc8b2bfb17c178e
0708888b1ae0b9827d02afa113818ea07088b6cc
/v2/datastream-to-spanner/src/test/java/com/google/cloud/teleport/v2/templates/spanner/ProcessInformationSchemaTest.java
e9ec99e4abe8d8d8b116072758224a781e361c8a
[ "Apache-2.0" ]
permissive
Pio1006/DataflowTemplates
93201954a5b4b5bd7804a5631c2f2a35d40cd971
7c054cec559d5df69451d98a825647a890b56ecf
refs/heads/master
2023-07-12T03:17:21.596892
2021-06-24T11:41:15
2021-06-24T11:41:15
397,986,386
0
0
Apache-2.0
2021-08-19T15:19:17
2021-08-19T15:16:27
null
UTF-8
Java
false
false
5,240
java
/* * Copyright (C) 2021 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.cloud.teleport.v2.templates.spanner; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import com.google.cloud.teleport.v2.templates.spanner.ddl.Ddl; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.beam.sdk.io.gcp.spanner.SpannerConfig; import org.junit.Test; /** * Unit tests for ProcessInformationSchema class. */ public class ProcessInformationSchemaTest { static Ddl getTestDdl() { /* Creates DDL with 2 tables with the same fields but with different primary key * columns and their associated shadow tables. */ Ddl ddl = Ddl.builder() .createTable("Users") .column("first_name").string().max().endColumn() .column("last_name").string().size(5).endColumn() .column("age").int64().endColumn() .column("bool_field").bool().endColumn() .column("int64_field").int64().endColumn() .column("float64_field").float64().endColumn() .column("string_field").string().max().endColumn() .column("bytes_field").bytes().max().endColumn() .column("timestamp_field").timestamp().endColumn() .column("date_field").date().endColumn() .primaryKey().asc("first_name").desc("last_name") .asc("age").asc("bool_field") .asc("int64_field").asc("float64_field") .asc("string_field").asc("bytes_field") .asc("timestamp_field").asc("date_field").end() .endTable() .createTable("shadow_Users") .column("first_name").string().max().endColumn() .column("last_name").string().size(5).endColumn() .column("age").int64().endColumn() .column("bool_field").bool().endColumn() .column("int64_field").int64().endColumn() .column("float64_field").float64().endColumn() .column("string_field").string().max().endColumn() .column("bytes_field").bytes().max().endColumn() .column("timestamp_field").timestamp().endColumn() .column("date_field").date().endColumn() .column("version").int64().endColumn() .primaryKey().asc("first_name").desc("last_name") .asc("age").asc("bool_field") .asc("int64_field").asc("float64_field") .asc("string_field").asc("bytes_field") .asc("timestamp_field").asc("date_field").end() .endTable() .createTable("Users_interleaved") .column("first_name").string().max().endColumn() .column("last_name").string().size(5).endColumn() .column("age").int64().endColumn() .column("bool_field").bool().endColumn() .column("int64_field").int64().endColumn() .column("float64_field").float64().endColumn() .column("string_field").string().max().endColumn() .column("bytes_field").bytes().max().endColumn() .column("timestamp_field").timestamp().endColumn() .column("date_field").date().endColumn() .column("id").int64().endColumn() .primaryKey().asc("first_name").desc("last_name") .asc("age").asc("bool_field") .asc("int64_field").asc("float64_field") .asc("string_field").asc("bytes_field") .asc("timestamp_field").asc("date_field").asc("id").end() .endTable() .build(); return ddl; } @Test public void canListShadowTablesInDdl() throws Exception { SpannerConfig spannerConfig = mock(SpannerConfig.class); ProcessInformationSchema.ProcessInformationSchemaFn processInformationSchema = new ProcessInformationSchema.ProcessInformationSchemaFn(spannerConfig, /*shouldCreateShadowTables=*/true, "shadow_", "oracle"); Set<String> shadowTables = processInformationSchema.getShadowTablesInDdl(getTestDdl()); assertThat(shadowTables, is(new HashSet<String>(Arrays.asList("shadow_Users")))); } @Test public void canListDataTablesWithNoShadowTablesInDdl() throws Exception { SpannerConfig spannerConfig = mock(SpannerConfig.class); ProcessInformationSchema.ProcessInformationSchemaFn processInformationSchema = new ProcessInformationSchema.ProcessInformationSchemaFn(spannerConfig, /*shouldCreateShadowTables=*/true, "shadow_", "oracle"); List<String> dataTablesWithNoShadowTables = processInformationSchema.getDataTablesWithNoShadowTables(getTestDdl()); assertThat(dataTablesWithNoShadowTables, is(Arrays.asList("Users_interleaved"))); } }
08e0142876a7503223f7241adddfa6ef102d15d9
6882f778ff961d5c87e838f2027d61d7021bd6bc
/org.jvoicexml.callmanager.text/unittests/src/org/jvoicexml/callmanager/text/TestTextApplication.java
233b6359aae7d8afbe540fdef4bb691abe8a8b95
[]
no_license
ridixcr/JVoiceXML
ac75ce5484e41dcf720269e63caeb262b14fb2c8
3b36d974ec41b3d5a277fd2454957fd3331a6fe4
refs/heads/master
2021-01-18T03:45:57.337021
2015-09-16T07:05:52
2015-09-16T07:05:52
42,839,146
1
0
null
2015-09-21T02:21:46
2015-09-21T02:21:45
null
UTF-8
Java
false
false
3,322
java
/* * File: $HeadURL$ * Version: $LastChangedRevision$ * Date: $Date$ * Author: $LastChangedBy$ * * JVoiceXML - A free VoiceXML implementation. * * Copyright (C) 2012-2013 JVoiceXML group - http://jvoicexml.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ package org.jvoicexml.callmanager.text; import java.net.URI; import org.junit.Assert; import org.junit.Test; /** * Test cases for {@link TextApplication}. * @author Dirk Schnelle-Walka * */ public final class TestTextApplication { /** * Test method for {@link org.jvoicexml.callmanager.text.TextApplication#getUriObject()}. * @exception Exception * test failed */ @Test public void testGetUriObject() throws Exception { final TextApplication application1 = new TextApplication(); application1.setUri("http:localhost:8080"); final URI uri1 = new URI("http:localhost:8080"); Assert.assertEquals(uri1, application1.getUriObject()); final TextApplication application2 = new TextApplication(); Assert.assertNull(application2.getUriObject()); } /** * Test method for {@link org.jvoicexml.callmanager.text.TextApplication#getPort()}. */ @Test public void testGetPort() { final TextApplication application1 = new TextApplication(); application1.setPort(4242); Assert.assertEquals(4242, application1.getPort()); final TextApplication application2 = new TextApplication(); Assert.assertEquals(0, application2.getPort()); } /** * Test method for {@link org.jvoicexml.callmanager.text.TextApplication#getUri()}. */ @Test public void testGetUri() { final TextApplication application1 = new TextApplication(); application1.setUri("http:localhost:8080"); Assert.assertEquals("http:localhost:8080", application1.getUri()); final TextApplication application2 = new TextApplication(); Assert.assertNull(application2.getUri()); } public void testSetUri() { final TextApplication application = new TextApplication(); application.setUri("foo"); Assert.assertEquals("foo", application); application.setUri(null); Assert.assertNull(application.getUri()); } /** * Test method for {@link org.jvoicexml.callmanager.text.TextApplication#setUri(String)}. */ @Test(expected = IllegalArgumentException.class) public void testSetUriInvalid() { final TextApplication application = new TextApplication(); application.setUri("#foo#"); } }
f5848808e6031b2b364b687924e8188bac488fcc
7dbbe21b902fe362701d53714a6a736d86c451d7
/BzenStudio-5.6/Source/com/zend/ide/cb/a/oc.java
f59b4ec7fc74406e663d70965dcf8b6765e95d10
[]
no_license
HS-matty/dev
51a53b4fd03ae01981549149433d5091462c65d0
576499588e47e01967f0c69cbac238065062da9b
refs/heads/master
2022-05-05T18:32:24.148716
2022-03-20T16:55:28
2022-03-20T16:55:28
196,147,486
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.zend.ide.cb.a; import com.zend.ide.util.c.h; import com.zend.ide.util.ct; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; class oc extends AbstractAction { final dd a; public oc(dd paramdd) { super(ct.a(116)); } public void actionPerformed(ActionEvent paramActionEvent) { if (dd.b()) return; dd.a(this.a, true); he localhe = new he(this); h.c().a(localhe, true); } } /* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar * Qualified Name: com.zend.ide.cb.a.oc * JD-Core Version: 0.6.0 */
132d8e4967e22d72b42a536f452d2a74a6e6f48d
7f20b1bddf9f48108a43a9922433b141fac66a6d
/csplugins/trunk/ucsd/kono/NCBIUI/src/edu/ucsd/bioeng/idekerlab/ncbiclientui/NCBIUIPlugin.java
1eafd4bf9b7db413141905ebc067d2044acd7734
[]
no_license
ahdahddl/cytoscape
bf783d44cddda313a5b3563ea746b07f38173022
a3df8f63dba4ec49942027c91ecac6efa920c195
refs/heads/master
2020-06-26T16:48:19.791722
2013-08-28T04:08:31
2013-08-28T04:08:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,340
java
/* Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org) The Cytoscape Consortium is: - Institute for Systems Biology - University of California San Diego - Memorial Sloan-Kettering Cancer Center - Institut Pasteur - Agilent Technologies This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder is on an "as is" basis, and the Institute for Systems Biology and the Whitehead Institute have no obligations to provide maintenance, support, updates, enhancements or modifications. In no event shall the Institute for Systems Biology and the Whitehead Institute be liable to any party for direct, indirect, special, incidental or consequential damages, including lost profits, arising out of the use of this software and its documentation, even if the Institute for Systems Biology and the Whitehead Institute have been advised of the possibility of such damage. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ package edu.ucsd.bioeng.idekerlab.ncbiclientui; import cytoscape.Cytoscape; import cytoscape.plugin.CytoscapePlugin; import edu.ucsd.bioeng.idekerlab.ncbiclientui.ui.NCBIGeneDialog; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JDialog; import javax.swing.JMenuItem; /** * */ public class NCBIUIPlugin extends CytoscapePlugin { /** * Creates a new NCBIUIPlugin object. */ public NCBIUIPlugin() { Cytoscape.getDesktop().getCyMenus().getMenuBar().getMenu("File.Import").add(new JMenuItem(new AbstractAction("Import Attributes from NCBI Entrez Gene...") { public void actionPerformed(ActionEvent e) { JDialog dialog = new NCBIGeneDialog(); dialog.setVisible(true); } })); } }
[ "kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5" ]
kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5
078447b0fa2fb7b08aeef47e951d44255c1ffe35
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_1c01ecdc8bdb26db006a9e7fca946214d646ed8b/ImageLayer/8_1c01ecdc8bdb26db006a9e7fca946214d646ed8b_ImageLayer_s.java
c5365bfe5b2263d3707a183718cc5010ef11e0ba
[]
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
6,409
java
package net.coobird.paint.image; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import net.coobird.paint.BlendingMode; /************************* * TODO Clean up this class!! */ /** * Represents a image layer within the Untitled Image Manipulation Application * @author coobird * */ public class ImageLayer { private static final int THUMBNAIL_SCALE = 8; private static final int DEFAULT_IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB; public static int getDefaultType() { return DEFAULT_IMAGE_TYPE; } private BufferedImage image; private BufferedImage thumbImage; private Graphics2D g; private String caption; private boolean visible; { visible = true; } // TODO // Location of ImageLayer wrt some origin private int x; private int y; private int width; private int height; private float alpha = 1.0f; private BlendingMode mode = BlendingMode.LAYER_NORMAL; /** * ImageLayer must be constructed with a width and height parameter. * TODO fix this javadoc: * @see ImageLayer(int,int) */ @SuppressWarnings("unused") private ImageLayer() {}; public ImageLayer(BufferedImage image) { initInstance(); setImage(image); thumbImage = new BufferedImage( this.width / THUMBNAIL_SCALE, this.height / THUMBNAIL_SCALE, DEFAULT_IMAGE_TYPE ); renderThumbnail(); } /** * Instantiate a new ImageLayer. * @param width The width of the ImageLayer. * @param height The height of the ImageLayer. */ public ImageLayer(int width, int height) { initInstance(); image = new BufferedImage( width, height, DEFAULT_IMAGE_TYPE ); setImage(image); thumbImage = new BufferedImage( width / THUMBNAIL_SCALE, height / THUMBNAIL_SCALE, DEFAULT_IMAGE_TYPE ); renderThumbnail(); } /** * Creates a thumbnail image */ private void renderThumbnail() { // TODO //@resize "image" to "thumbImage" Graphics2D g = thumbImage.createGraphics(); g.drawImage(image, 0, 0, thumbImage.getWidth(), thumbImage.getHeight(), null ); g.dispose(); } /** * Updates the state of the ImageLayer */ public void update() { // Perform action to keep imagelayer up to date // Here, renderThumbnail to synch the image and thumbImage representation renderThumbnail(); } /** * Initializes the instance of ImageLayer. */ private void initInstance() { this.x = 0; this.y = 0; this.setCaption("Untitled Layer"); } /** * TODO * @return */ public Graphics2D getGraphics() { return g; } /** * Checks if this ImageLayer is set as visible. * @return The visibility of this ImageLayer. */ public boolean isVisible() { return visible; } /** * @return the image */ public BufferedImage getImage() { return image; } /** * @param image the image to set */ public void setImage(BufferedImage image) { /* * If the type of the given BufferedImage is not the DEFAULT_IMAGE_TYPE, * then create a new BufferedImage with the DEFAULT_IMAGE_TYPE, and * draw the given image onto the new BufferedImage. */ if (image.getType() == DEFAULT_IMAGE_TYPE) { this.image = image; this.width = image.getWidth(); this.height = image.getHeight(); this.g = image.createGraphics(); } else { this.width = image.getWidth(); this.height = image.getHeight(); this.image = new BufferedImage( this.width, this.height, DEFAULT_IMAGE_TYPE ); this.g = this.image.createGraphics(); g.drawImage(image, 0, 0, null); } } /** * @return the thumbImage */ public BufferedImage getThumbImage() { return thumbImage; } /** * @param thumbImage the thumbImage to set */ public void setThumbImage(BufferedImage thumbImage) { this.thumbImage = thumbImage; } /** * Sets the visibility of this ImageLayer. * @param visible The visibility of this ImageLayer. */ public void setVisible(boolean visible) { this.visible = visible; } /** * Returns the caption of the ImageLayer. * @return The caption of the ImageLayer. */ public String getCaption() { return caption; } /** * Sets the caption of the ImageLayer. * @param caption The caption to set the ImageLayer to. */ public void setCaption(String caption) { this.caption = caption; } /** * Returns the width of the ImageLayer. * @return The width of the ImageLayer. */ public int getWidth() { return image.getWidth(); } /** * Returns the height of the ImageLayer. * @return The height of the ImageLayer. */ public int getHeight() { return image.getHeight(); } /** * @return the x */ public int getX() { return x; } /** * @param x the x to set */ public void setX(int x) { this.x = x; } /** * @return the y */ public int getY() { return y; } /** * @param y the y to set */ public void setY(int y) { this.y = y; } /** * Sets the ImageLayer offset. * @param x * @param y */ public void setLocation(int x, int y) { this.x = x; this.y = y; } /** * @return the alpha */ public float getAlpha() { return alpha; } /** * @param alpha the alpha to set */ public void setAlpha(float alpha) { this.alpha = alpha; } /** * @return the mode */ public BlendingMode getMode() { return mode; } /** * @param mode the mode to set */ public void setMode(BlendingMode mode) { this.mode = mode; } /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { String msg = "Image Layer: " + this.caption + ", x: " + this.x + ", y: " + this.y + ", width: " + this.width + ", height: " + this.height; return msg; } }
d8e3eddda8bfc9cd3515cea2c7cd5aafd206037c
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project35/src/main/java/org/gradle/test/performance35_3/Production35_255.java
2f93c0972b8febcebe63cfe32eaa5999042bdd4d
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance35_3; public class Production35_255 extends org.gradle.test.performance12_3.Production12_255 { private final String property; public Production35_255() { this.property = "foo"; } public String getProperty() { return property; } }
0a9e401bc21e3381ce75407993a61682c63a1dec
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/kylin/learning/4524/AclPermissionFactory.java
49015984c13d2983b5f9699181d65662a6143bb3
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,034
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.kylin.rest.security; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import org.springframework.security.acls.domain.DefaultPermissionFactory; import org.springframework.security.acls.model.Permission; /** * @author xduo * */ public class AclPermissionFactory extends DefaultPermissionFactory { public AclPermissionFactory() { super(); registerPublicPermissions(AclPermission.class); } public static List<Permission> getPermissions() { List<Permission> permissions = new ArrayList<Permission>(); Field[] fields = AclPermission.class.getFields(); for (Field field : fields) { try { Object fieldValue = field.get(null); if (Permission.class.isAssignableFrom(fieldValue.getClass())) { Permission perm = (Permission) fieldValue; String permissionName = field.getName(); if (permissionName.equals(AclPermissionType.ADMINISTRATION) || permissionName.equals(AclPermissionType.MANAGEMENT ) || permissionName.equals(AclPermissionType.OPERATION) || permissionName.equals(AclPermissionType.READ)) { // Found a Permission static field permissions.add(perm); } } } catch (Exception ignore) { //ignore on purpose } } return permissions; } public static Permission getPermission(String perName) { Field[] fields = AclPermission.class.getFields(); for (Field field : fields) { try { Object fieldValue = field.get(null); if (Permission.class.isAssignableFrom(fieldValue.getClass())) { // Found a Permission static field if (perName.equals(field.getName())) { return (Permission) fieldValue; } } } catch (Exception ignore) { //ignore on purpose } } return null; } }
6b6bfe8682473a61231be5fb30050116aa7eeb5f
f11d0634c95a3340dd6b880ddd892a8da85729a9
/way-cnab/src/test/java/br/com/objectos/way/cnab/TesteDeLoteExtItau.java
7aad95c7dc1b0eaf13e7a5d0eb1c7661993753d2
[ "Apache-2.0" ]
permissive
fredwilliamtjr/jabuticava
11e27091cffd080853b6811ef364c8c9ab9aa9aa
3235e3cc2f48e2145c86dfe73b88ebeed141cddb
refs/heads/master
2023-03-18T05:16:17.925964
2014-09-27T22:00:56
2014-09-27T22:00:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,735
java
/* * Copyright 2014 Objectos, Fábrica de Software LTDA. * * 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.objectos.way.cnab; import static br.com.objectos.way.base.testing.WayMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; import java.util.List; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; /** * @author [email protected] (Marcio Endo) */ @Test public class TesteDeLoteExtItau extends TesteDeLoteExtAbstrato { @Override MiniCnab cnab() { return CnabsFalso.RETORNO_341_01; } public void nosso_numero() { List<String> prova = ImmutableList.<String> builder() .add("193892026") .add("160103779") .add("184020447") .add("187458040") .add("193891788") .add("193891887") .add("193892059") .add("201773655") .add("201773663") .add("201773713") .add("201773721") .add("201773739") .add("202456342") .add("202456391") .add("193892257") .add("236942283") .add("172464003") .add("172464003") .add("172464326") .add("172464326") .add("172464334") .add("172464334") .add("172464342") .add("172464342") .add("256421408") .add("256421416") .add("256421424") .add("256421432") .add("256421440") .add("256421457") .add("256421465") .add("256421473") .add("256421481") .add("256421499") .add("256421507") .add("256421515") .add("256421523") .add("256421531") .add("256421549") .add("256421556") .add("256421564") .add("256421572") .add("256421580") .add("256421598") .add("256421606") .add("256421614") .add("256421622") .add("256421630") .add("256421648") .add("256421655") .add("256421663") .add("256421671") .add("256421689") .add("256421697") .add("256421705") .build(); List<String> res = lotesTo(LoteExtToNossoNumero.INSTANCE); assertThat(res, equalTo(prova)); } }
cfc1ebeb266be1443b99ff05aa755ddd9616ad0a
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE523_Unprotected_Cred_Transport/CWE523_Unprotected_Cred_Transport__Servlet_16.java
a6fb029c5150ef5ae04c2e34caa6d12f101f218a
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
4,205
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE523_Unprotected_Cred_Transport__Servlet_16.java Label Definition File: CWE523_Unprotected_Cred_Transport__Servlet.label.xml Template File: point-flaw-16.tmpl.java */ /* * @description * CWE: 523 Unprotected Transport of Credentials * Sinks: non_ssl * GoodSink: Send across SSL connection * BadSink : Send across non-SSL connection * Flow Variant: 16 Control flow: while(true) * * */ package testcases.CWE523_Unprotected_Cred_Transport; import testcasesupport.*; import javax.servlet.http.*; import java.io.PrintWriter; import java.io.IOException; import java.util.logging.Level; public class CWE523_Unprotected_Cred_Transport__Servlet_16 extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { while(true) { PrintWriter writer = null; try { writer = response.getWriter(); /* FLAW: transmitting login credentials across a non-SSL connection */ writer.println("<form action='http://hostname.com/j_security_check' method='post'>"); writer.println("<table>"); writer.println("<tr><td>Name:</td>"); writer.println("<td><input type='text' name='j_username'></td></tr>"); writer.println("<tr><td>Password:</td>"); writer.println("<td><input type='password' name='j_password' size='8'></td>"); writer.println("</tr>"); writer.println("</table><br />"); writer.println("<input type='submit' value='login'>"); writer.println("</form>"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "There was a problem writing", exceptIO); } finally { if (writer != null) { writer.close(); } } break; } } /* good1() change the conditions on the while statements */ private void good1(HttpServletRequest request, HttpServletResponse response) throws Throwable { while(true) { PrintWriter writer = null; try { writer = response.getWriter(); /* FIX: ensure the connection is secure (https) */ writer.println("<form action='https://hostname.com/j_security_check' method='post'>"); writer.println("<table>"); writer.println("<tr><td>Name:</td>"); writer.println("<td><input type='text' name='j_username'></td></tr>"); writer.println("<tr><td>Password:</td>"); writer.println("<td><input type='password' name='j_password' size='8'></td>"); writer.println("</tr>"); writer.println("</table><br />"); writer.println("<input type='submit' value='login'>"); writer.println("</form>"); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "There was a problem writing", exceptIO); } finally { if (writer != null) { writer.close(); } } break; } } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { good1(request, response); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
47005dc7fab5bbc636f3416b8fa20cfb34332a4d
4b02716fe4b91399d2bfda4dda3becc31a9d793a
/huigou-uasp/src/main/java/com/huigou/uasp/bmp/dataManage/domain/query/OpdatakindQueryRequest.java
1605326ab3854c15d6ee444cf77fcc7c3edb6017
[]
no_license
wuyounan/drawio
19867894fef13596be31f4f5db4296030f2a19b6
d0d1a0836e6b3602c27a53846a472a0adbe15e93
refs/heads/develop
2022-12-22T05:12:08.062112
2020-02-06T07:28:12
2020-02-06T07:28:12
241,046,824
0
2
null
2022-12-16T12:13:57
2020-02-17T07:38:48
JavaScript
UTF-8
Java
false
false
1,077
java
package com.huigou.uasp.bmp.dataManage.domain.query; import com.huigou.data.domain.query.QueryAbstractRequest; /** * 数据管理权限维度定义 * * @author xx * SA_OPDATAKIND * @date 2018-09-04 10:52 */ public class OpdatakindQueryRequest extends QueryAbstractRequest { /** * 编码 **/ protected String code; /** * 名称 **/ protected String name; /** * 类型 **/ protected String dataKind; private Integer status; public String getCode() { return this.code; } public void setCode(String code) { this.code = code; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDataKind() { return this.dataKind; } public void setDataKind(String dataKind) { this.dataKind = dataKind; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } }
2732c8ce1e8442a7b2842b0f60c42f872a758f8b
97386b00aa112044a46b55db632c6be1195ed79d
/src/main/java/com/adpf/tracking/entity/TAppLogin.java
daf0d0a484a6bbf0fbbf500e93f82f9b857922c4
[]
no_license
mayongcan/adpf
8f1a036c05afdb8978730eebaa5860b5bc56219e
69d3be034e4270501f56da5a3ac3a82825c4aac9
refs/heads/master
2022-07-09T21:57:35.733201
2020-01-20T07:04:48
2020-01-20T07:04:48
255,856,674
0
0
null
2022-06-29T18:04:31
2020-04-15T08:43:22
Java
UTF-8
Java
false
false
2,571
java
/* * Copyright(c) 2018 gimplatform(通用信息管理平台) All rights reserved. */ package com.adpf.tracking.entity; import java.io.Serializable; import java.util.Date; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.Table; import javax.persistence.TableGenerator; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.gimplatform.core.annotation.CustomerDateAndTimeDeserialize; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * TAppLogin数据库映射实体类 * @version 1.0 * @author */ @Data @NoArgsConstructor @AllArgsConstructor @Entity @Table(name = "t_app_login") public class TAppLogin implements Serializable { private static final long serialVersionUID = 1L; // 登录id @Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "TAppLoginIdGenerator") @TableGenerator(name = "TAppLoginIdGenerator", table = "sys_tb_generator", pkColumnName = "GEN_NAME", valueColumnName = "GEN_VALUE", pkColumnValue = "T_APP_LOGIN_PK", allocationSize = 1) @Column(name = "id", unique = true, nullable = false) private Long id; // 发生时间 @JsonDeserialize(using = CustomerDateAndTimeDeserialize.class) @Temporal(TemporalType.TIMESTAMP) @Column(name = "when1") private Date when1; // 接入key @Column(name = "app_key", length = 200) private String appKey; // 产品id @Column(name = "app_id") private String appId; // 平台类型 @Column(name = "app_type", length = 100) private String appType; // 安卓id @Column(name = "android_id", length = 100) private String androidId; // IOS IDFA @Column(name = "idfa", length = 100) private String idfa; // 设备IP @Column(name = "ip", length = 100) private String ip; // 设备ua @Column(name = "ua", length = 100) private String ua; // 设备imei @Column(name = "imei", length = 100) private String imei; // 设备mac @Column(name = "mac", length = 100) private String mac; // 用户账号 @Column(name = "account_id", length = 100) private String accountId; // 创建时间 @JsonDeserialize(using = CustomerDateAndTimeDeserialize.class) @Temporal(TemporalType.TIMESTAMP) @Column(name = "create_time") private Date createTime; }
218cb5fc2e92f76fa058f2caf06aa4bd016139ab
72e1e90dd8e1e43bad4a6ba46a44d1f30aa76fe6
/java/core/javaee7-samples-master/websocket/atmosphere-chat/src/main/java/org/javaee7/websocket/atmosphere/JacksonDecoder.java
94ef5505f1e21f3b124246ffdfa8e36b31f61805
[ "CDDL-1.0", "MIT", "GPL-2.0-only", "LicenseRef-scancode-oracle-openjdk-exception-2.0", "Apache-2.0" ]
permissive
fernando-romulo-silva/myStudies
bfdf9f02778d2f4993999f0ffc0ddd0066ec41b4
aa8867cda5edd54348f59583555b1f8fff3cd6b3
refs/heads/master
2023-08-16T17:18:50.665674
2023-08-09T19:47:15
2023-08-09T19:47:15
230,160,136
3
0
Apache-2.0
2023-02-08T19:49:02
2019-12-25T22:27:59
null
UTF-8
Java
false
false
1,159
java
/* * Copyright 2013 Jeanfrancois Arcand * * 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.javaee7.websocket.atmosphere; import org.atmosphere.config.managed.Decoder; import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; /** * Decode a String into a {@link Message}. */ public class JacksonDecoder implements Decoder<String, Message> { private final ObjectMapper mapper = new ObjectMapper(); @Override public Message decode(String s) { try { return mapper.readValue(s, Message.class); } catch (IOException e) { throw new RuntimeException(e); } } }
451cba03a14387cf157941dbc671c652e02646de
559d78fd7b69995001e74c7d34c2500d6ea4b18a
/pettrade/src/main/java/com/chongwu/pettrade/controller/OrdersController.java
2c3a99b9d4ca455b03286d28a3aac0d7c4e2849a
[]
no_license
BoWen98/pettrade_parent
98e17ea11c92188d654772528ca3abf4222523a1
295d9e92b94cc6a6abb7477091c036965fb5b288
refs/heads/master
2022-12-24T13:11:14.081303
2019-12-07T00:43:00
2019-12-07T00:43:00
226,434,242
0
0
null
2022-12-16T08:06:34
2019-12-07T00:42:11
Java
UTF-8
Java
false
false
4,017
java
package com.chongwu.pettrade.controller; import com.chongwu.pettrade.bean.Cart; import com.chongwu.pettrade.bean.CartItem; import com.chongwu.pettrade.service.entity.OrderItem; import com.chongwu.pettrade.service.entity.Orders; import com.chongwu.pettrade.service.entity.User; import com.chongwu.pettrade.service.service.OrderService; import com.chongwu.pettrade.service.service.PayService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpSession; import java.util.*; /** * 客户订单控制层 * * @author zhaoxianhai * */ @Controller public class OrdersController { @Autowired private OrderService orderService; @Autowired private PayService payService; /** * 提交订单 * * @return */ @RequestMapping(value = "/submitOrders") public String submitOrders(HttpSession session, Map<String, Object> map) { /** * 判断客户是否登陆 */ User user = (User) session.getAttribute("user"); if (user == null) { map.put("withoutLogin", "withoutLogin"); return "message"; } /** * 若登陆则从session中获取购物车对象 * */ Cart cart = (Cart) session.getAttribute("cart"); /** * 判断购物车是否为空 */ if (cart == null) { return "redirect:myCart"; } /** * 创建订单对象 订单状态1:未付款,2:已付款,3:已发货,4:未发货 */ Orders order = new Orders(); order.setTotal(cart.getTotal()); order.setState(1); order.setOrdertime(new Date()); order.setUser(user); /** * 获取订单项 * */ Set<OrderItem> sets = new HashSet<OrderItem>(); for (CartItem cartItem : cart.getCartItems()) { OrderItem orderItem = new OrderItem(); orderItem.setCount(cartItem.getCount()); orderItem.setSubtotal(cartItem.getSubtotal()); orderItem.setPet(cartItem.getPet()); orderItem.setOrder(order); sets.add(orderItem); } order.setOrderItems(sets); orderService.save(order); /** * 提交订单后清除购物车 * */ cart.clearCart(); map.put("order", order); return "order"; } /** * 确认订单,跳至支付页面,修改订单状态 * * @return */ @RequestMapping(value = "/orderPay") public String orderPay(Integer oid, String addr, String name, String phone, String total, Integer paytype, Map<String, Object> map) { Orders order = orderService.findByOid(oid); /** * 订单支付 */ if (paytype == 0) { int index = payService.payOrderByWallet(order, addr, name, phone, total); if(index == 0){ map.put("payment", "payok"); return "message"; }else { map.put("payment", "payerror"); return "message"; } } else { //在线支付 map.put("payment", "payment"); return "message"; } } /** * 分页查询订单 * @param session * @param map * @param page * @return */ @RequestMapping(value = "/findOrderByUid/{page}") public String findOrderByUid(HttpSession session, Map<String, Object> map, @PathVariable("page") Integer page) { /** * 从session中获取客户 */ User user = (User) session.getAttribute("user"); if(user == null) { map.put("withoutLogin", "withoutLogin"); return "message"; } Integer count = orderService.findCountByUid(user.getUid()); List<Orders> orders = orderService.findByUid(user.getUid(), page); /** * 放到map中 */ map.put("page", page); map.put("count", count); map.put("orders", orders); return "orderList"; } /** * 我的订单页点击付款 * 通过订单id查询订单 * @param session * @param map * @param page * @return */ @RequestMapping(value = "/findByOid/{oid}") public String findByOid(@PathVariable("oid") Integer oid, Map<String, Object> map) { Orders order = orderService.findByOid(oid); map.put("order", order); return "order"; } }
e54fb3b6ea2a4f76391210dba979709b255d134c
4a3fb28c181be627a7b7cb58de0ad23989a47d63
/src/test/java/hu/akarnokd/reactive4javaflow/tck/FromArrayTckTest.java
e4ca852d561750269e0a707ba667490e9292eec7
[ "Apache-2.0" ]
permissive
akarnokd/Reactive4JavaFlow
b2d4ffcf035c9148d60a4375c7a9404a867319cf
a976aca7f8c16a097374df033d283780c7c37829
refs/heads/master
2023-02-04T08:36:10.625961
2022-12-01T08:29:56
2022-12-01T08:29:56
98,419,292
50
5
Apache-2.0
2023-01-30T04:03:08
2017-07-26T12:16:51
Java
UTF-8
Java
false
false
1,105
java
/* * Copyright 2017 David Karnok * * 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 hu.akarnokd.reactive4javaflow.tck; import hu.akarnokd.reactive4javaflow.Folyam; import org.reactivestreams.Publisher; import org.testng.annotations.Test; import java.util.concurrent.Flow; @Test public class FromArrayTckTest extends BaseTck<Long> { @Override public Flow.Publisher<Long> createFlowPublisher(long elements) { return Folyam.fromArray(array(elements)) ; } @Override public long maxElementsFromPublisher() { return 1024 * 1024; } }
1bd85eb9157e2fab45906b105abd9b8c49b7d83e
f4d4daae54ad24ae1907267c003332b398150f2e
/src/main/java/com/arenacampeao/config/KafkaProperties.java
9424da57e142c944889b67aee862aad3c3ac9c47
[]
no_license
ferreira-amaral/arena-campeao
69fc815632484a99a936d3b563b7e94becb1381a
94535ae2e778c056eac0005acce14b48ec8b0d80
refs/heads/master
2023-01-04T13:24:31.967250
2020-10-26T00:02:15
2020-10-26T00:02:15
307,218,130
0
0
null
null
null
null
UTF-8
Java
false
false
1,491
java
package com.arenacampeao.config; import java.util.HashMap; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @Configuration @ConfigurationProperties(prefix = "kafka") public class KafkaProperties { private String bootStrapServers = "localhost:9092"; private Map<String, String> consumer = new HashMap<>(); private Map<String, String> producer = new HashMap<>(); public String getBootStrapServers() { return bootStrapServers; } public void setBootStrapServers(String bootStrapServers) { this.bootStrapServers = bootStrapServers; } public Map<String, Object> getConsumerProps() { Map<String, Object> properties = new HashMap<>(this.consumer); if (!properties.containsKey("bootstrap.servers")) { properties.put("bootstrap.servers", this.bootStrapServers); } return properties; } public void setConsumer(Map<String, String> consumer) { this.consumer = consumer; } public Map<String, Object> getProducerProps() { Map<String, Object> properties = new HashMap<>(this.producer); if (!properties.containsKey("bootstrap.servers")) { properties.put("bootstrap.servers", this.bootStrapServers); } return properties; } public void setProducer(Map<String, String> producer) { this.producer = producer; } }
1db6ae866ac1ada1eef8b3263d66a5fd4c0d1855
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_1b46dc2d94e1e52fc12cbd7e6b865516f7046041/UDPReceiver/5_1b46dc2d94e1e52fc12cbd7e6b865516f7046041_UDPReceiver_s.java
2ba1d94568d0b6edf988c8c007fb3a5ca69701f8
[]
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,947
java
package Communications; import java.io.*; import java.net.SocketException; import java.util.concurrent.*; import Messages.Message; import Utilities.Parser; public class UDPReceiver { protected PipedInputStream data=null; protected UDPReceiverThread thread=null; protected Thread t; protected ConcurrentLinkedQueue<Byte> queue=new ConcurrentLinkedQueue<Byte>(); protected boolean needsMore=false; int size=132; int moreNeeded=Integer.MAX_VALUE; byte[] current=null; byte[] body=null; Parser parser=new Parser(); public UDPReceiver() throws SocketException{ data=new PipedInputStream(); thread=new UDPReceiverThread(queue); t=(new Thread(thread)); t.start(); } // public byte[] getPacket(){ // if(queue.size()<size){ // return new byte[0]; // } // else{ // byte[] packet = new byte[size]; // for(int i=0;i<size;i++){ // packet[i]=queue.poll(); // } // } // } public Message read(){ if (!needsMore) { if (queue.size() >= size) { System.out.println("getting first"); current = new byte[size]; for (int i = 0; i < size; i++) { current[i] = queue.poll(); } moreNeeded=parser.parse(current); if(queue.size()>=moreNeeded){ System.out.println("Second is there alredy"); for (int i = 0; i < moreNeeded; i++) { body[i] = queue.poll(); } needsMore=false; moreNeeded=Integer.MAX_VALUE; return parser.addBody(body); } needsMore=true; return null; } else { return null; } } else if(queue.size()>=moreNeeded){ System.out.println("getting second"); for (int i = 0; i < moreNeeded; i++) { body[i] = queue.poll(); } needsMore=false; moreNeeded=Integer.MAX_VALUE; return parser.addBody(body); } return null; } public void stop() throws InterruptedException{ thread.setRunning(false); t.join(); } }
85c67d1f8bbac791dc0dc415dcc1eab4c31e8187
385722dc7221c59df50c3077b6bdf6ce66163439
/spring-boot-demo-neo4j/src/main/java/com/xkcoding/neo4j/SpringBootDemoNeo4jApplication.java
c9e8f4d0a22c4377cda600c1524b28c8c3dc67da
[ "MIT" ]
permissive
cuijxin/spring-boot-demo
f2a166391db1844adbe2c594b6be375e2004402a
115a8fe5b539b4afe930b6a3604c3d9fb0d8ad6c
refs/heads/master
2020-04-06T21:18:31.116461
2018-11-15T12:04:46
2018-11-15T12:04:46
157,799,298
1
0
MIT
2018-11-16T02:10:04
2018-11-16T02:10:04
null
UTF-8
Java
false
false
348
java
package com.xkcoding.neo4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootDemoNeo4jApplication { public static void main(String[] args) { SpringApplication.run(SpringBootDemoNeo4jApplication.class, args); } }
36147909f90b57d7660e064aab94a2d2423c4cbf
9329071c7a74c2bf206b7bdf7edd984748d205b3
/src/main/java/io/sporkpgm/module/modules/region/exception/InvalidRegionException.java
d8f9ea28593204b556ae8c80e7cf45e80cd3d33d
[]
no_license
simba3rcks/SporkPGM
c102e0ee55dcab5ef59360b79d3e9caf39029942
a32f017f579967e9ae66e11e2edf614bcce0d700
refs/heads/master
2021-01-18T06:05:10.373516
2014-06-10T21:49:24
2014-06-10T21:49:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package io.sporkpgm.module.modules.region.exception; import io.sporkpgm.module.exceptions.ModuleBuildException; import org.jdom2.Element; public class InvalidRegionException extends ModuleBuildException { private static final long serialVersionUID = -8988962714866893205L; public InvalidRegionException(Element element, String message) { super(element, message); } }
493ed8f3e3ed5a9d46874e887dfcae6d3d4f6d6e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_5d2a05ba329424f9b95b3cf72c7c50c2eba28c48/EnvelopeHandlerBasedConsumer/34_5d2a05ba329424f9b95b3cf72c7c50c2eba28c48_EnvelopeHandlerBasedConsumer_t.java
1f620f6acb09d5895f3e082afbc1656758740755
[]
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,304
java
package pegasus.eventbus.rabbitmq; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import pegasus.eventbus.client.Envelope; import pegasus.eventbus.client.EnvelopeHandler; import pegasus.eventbus.client.EventResult; import com.rabbitmq.client.Channel; import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.ShutdownSignalException; import com.rabbitmq.client.AMQP.BasicProperties; class EnvelopeHandlerBasedConsumer extends DefaultConsumer { private final Logger LOG; private final String queueName; private final EnvelopeHandler consumer; public EnvelopeHandlerBasedConsumer(Channel channel, String queueName, EnvelopeHandler handler) { super(channel); this.queueName = queueName; this.consumer = handler; //TODO: PEGA-727 Need to add tests to assert that this logger name is always valid (i.e. queue names with . and any other illegal chars are correctly mangled.) LOG = LoggerFactory.getLogger(String.format("%s$>%s", this.getClass().getCanonicalName(), queueName.replace('.', '_'))); } @Override public void handleConsumeOk(String consumerTag) { LOG.debug("ConsumeOk received for ConsumerTag [{}].", consumerTag); super.handleConsumeOk(consumerTag); } @Override public void handleCancel(String consumerTag) throws IOException { LOG.debug("Subscription Cancel received for ConsumerTag [{}].", consumerTag); super.handleCancel(consumerTag); } @Override public void handleCancelOk(String consumerTag) { LOG.debug("Subscription CancelOk received for ConsumerTag [{}].", consumerTag); super.handleCancelOk(consumerTag); } @Override public void handleRecoverOk(String consumerTag) { LOG.debug("Subscription RecoverOk received for ConsumerTag [{}].", consumerTag); super.handleRecoverOk(consumerTag); } @Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { LOG.debug("Subscription ShutdownSignal received for ConsumerTag [{}].", consumerTag); super.handleShutdownSignal(consumerTag, sig); } @Override public void handleDelivery(String consumerTag, com.rabbitmq.client.Envelope amqpEnvelope, BasicProperties properties, byte[] body) throws IOException { try { super.handleDelivery(consumerTag, amqpEnvelope, properties, body); Channel channel = this.getChannel(); LOG.trace("Handling delivery for ConsumerTag [{}].", consumerTag); long deliveryTag = amqpEnvelope.getDeliveryTag(); LOG.trace("DeliveryTag is [{}] for message on ConsumerTag [{}]", deliveryTag, consumerTag); Envelope envelope = RabbitMessageBus.createEnvelope(properties, body); LOG.trace("Envelope create for DeliveryTag [{}].", deliveryTag); EventResult result; try { LOG.trace("Handling envelope for DeliveryTag [{}].", deliveryTag); //TODO: PEGA-726 what if handler incorrectly returns null? I think we should assume Failed to be safe. result = consumer.handleEnvelope(envelope); } catch (Throwable e) { result = EventResult.Failed; String id; try { id = envelope.getId().toString(); } catch (Throwable ee) { id = "<message id not available>"; } LOG.error("Envelope handler of type " + consumer.getClass().getCanonicalName() + " on queue " + queueName + " threw exception of type " + e.getClass().getCanonicalName() + " handling message " + id + ", DeliveryTag: " + deliveryTag, e); } LOG.trace("Determining how to handle EventResult [{}]", result); switch (result) { case Handled: LOG.trace("Accepting DeliveryTag [{}]", deliveryTag); channel.basicAck(deliveryTag, false); break; case Failed: LOG.trace("Rejecting DeliveryTag [{}]", deliveryTag); channel.basicReject(deliveryTag, false); break; case Retry: LOG.trace("Retrying DeliveryTag [{}]", deliveryTag); channel.basicReject(deliveryTag, true); break; } } catch (Throwable e) { LOG.error("handleDelivery failed on queue " + queueName + ".", e); } } }
f94a4f38dd5c384c1a2c7b1009b78b4c50e225d9
f09e549c92dfebe1fb467575916ed56e6a6e327e
/snap/src/main/java/org/snapscript/tree/define/EnumConstantGenerator.java
b928a66177920e4621c9be3b69ef88ab9099466b
[]
no_license
karino2/FileScripting
10e2ff7f5d688a7a107d01f1b36936c00bc4d6ad
4790830a22c2effacaaff6b109ced57cb6a5a230
refs/heads/master
2021-04-27T19:28:23.138720
2018-05-04T11:09:18
2018-05-04T11:09:18
122,357,523
0
0
null
null
null
null
UTF-8
Java
false
false
892
java
package org.snapscript.tree.define; import static org.snapscript.core.Reserved.ENUM_NAME; import static org.snapscript.core.Reserved.ENUM_ORDINAL; import org.snapscript.core.scope.State; import org.snapscript.core.scope.instance.Instance; import org.snapscript.core.type.TypeState; import org.snapscript.core.type.Type; import org.snapscript.core.variable.Value; public class EnumConstantGenerator extends TypeState { private final String name; private final int index; public EnumConstantGenerator(String name, int index) { this.index = index; this.name = name; } public void generate(Instance instance, Type type) throws Exception { State state = instance.getState(); Value key = Value.getConstant(name); Value ordinal = Value.getConstant(index); state.add(ENUM_NAME, key); state.add(ENUM_ORDINAL, ordinal); } }
[ "hogeika2@gmailcom" ]
hogeika2@gmailcom
750dce2c320bac29dd26802e9041451782fb58d8
9282591635f3cf5a640800f2b643cd57048ed29f
/app/src/main/java/com/android/p2pflowernet/project/view/fragments/mine/orderflow/refund/ApplyforRefundActivity.java
fd13248f0fe5a3e1c849dedaa9b97ae2b15d3ced
[]
no_license
AHGZ/B2CFlowerNetProject
de5dcbf2cbb67809b00f86639d592309d84b3283
b1556c4b633fa7c0c1463af94db9f91285070714
refs/heads/master
2020-03-09T17:27:14.889919
2018-04-10T09:36:33
2018-04-10T09:36:33
128,908,791
1
0
null
null
null
null
UTF-8
Java
false
false
1,362
java
package com.android.p2pflowernet.project.view.fragments.mine.orderflow.refund; import android.text.TextUtils; import android.view.KeyEvent; import com.android.p2pflowernet.project.entity.OrderDetailItemBean; import com.android.p2pflowernet.project.entity.OrderListBean; import com.android.p2pflowernet.project.mvp.KActivity; import com.android.p2pflowernet.project.mvp.KFragment; /** * Created by caishen on 2017/11/17. * by--申请退款 */ public class ApplyforRefundActivity extends KActivity { @Override protected KFragment getFirstFragment() { OrderDetailItemBean orderDetailItemBean = (OrderDetailItemBean) getIntent().getSerializableExtra("ordergooddetail"); OrderListBean.ListsBean orderlists = (OrderListBean.ListsBean) getIntent().getSerializableExtra("orderlists"); String ogid = getIntent().getStringExtra("ogid"); String ordernum = getIntent().getStringExtra("ordernum"); return ApplyforRefundFragment.newIntence(TextUtils.isEmpty(ogid) ? "" : ogid, TextUtils.isEmpty(ordernum) ? "" : ordernum, orderlists,orderDetailItemBean); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { removeFragment(); return true; } return super.onKeyDown(keyCode, event); } }
1dc60e592b4a44a53e51fea050aa50f86e418cf8
74f1bca93f8019e5b9db4e98793a0b8ff0fc309f
/AdvancedTraining/src/com/training/advanced/java/JavaMain.java
8c9681dbcb7c560063f9797ca8681cc60eafd027
[]
no_license
osmanyoy/beyaz
cf64952baae3588e2b4a3bf03abec59cc3eb5ac1
baaf10922163df01eacd7dd9d4051f6df8aa508d
refs/heads/master
2021-05-06T06:24:08.447465
2018-05-30T13:14:05
2018-05-30T13:14:05
113,846,413
1
0
null
null
null
null
ISO-8859-9
Java
false
false
1,629
java
package com.training.advanced.java; public class JavaMain { public static void main(final String[] args) { IIslem<Double, Double, String> myIslem = (a, b) -> "" + (a + b); IOperation<Double> toplama2 = (d, f) -> d + f; Double dResult = toplama2.execute(100D, 50D); IOperation<Double> cikarma = (d, f) -> { double sonuc = (d * 2) - (f / 3); return sonuc; }; Double dResult2 = toplama2.execute(100D, 50D); IToplama toplama = (i1, i2) -> i1 + i2; System.out.println("Toplama sonucu : " + (toplama.topla(30, 20))); System.out.println("Toplama sonucu : " + ((IToplama) (i1, i2) -> i1 + i2).topla(30, 20)); System.out.println("Çıkarma sonucu : " + (JavaMain.toplamaSonucu((l1, l2) -> l1 - l2, 30, 20))); System.out.println("Çarpma sonucu : " + (JavaMain.toplamaSonucu((l1, l2) -> l1 * l2, 30, 20))); IToplama toplama3 = new ToplaImpl(); System.out.println("Toplama sonucu : " + (toplama3.topla(10, 20))); } public static int toplamaSonucu(final IToplama toplama, final int x, final int y) { return toplama.topla(x, y); } }
e728ca7c4952385b19e94fe4ebd7bd53c641b154
95bca8b42b506860014f5e7f631490f321f51a63
/dhis-2/dhis-support/dhis-support-xml/src/main/java/org/amplecode/staxwax/framework/OutputPort.java
3163f83a67675c14c47f42ba355755d98030a9e4
[ "BSD-3-Clause" ]
permissive
hispindia/HP-2.7
d5174d2c58423952f8f67d9846bec84c60dfab28
bc101117e8e30c132ce4992a1939443bf7a44b61
refs/heads/master
2022-12-25T04:13:06.635159
2020-09-29T06:32:53
2020-09-29T06:32:53
84,940,096
0
0
BSD-3-Clause
2022-12-15T23:53:32
2017-03-14T11:13:27
Java
UTF-8
Java
false
false
2,254
java
package org.amplecode.staxwax.framework; /* * Copyright (c) 2004-2005, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the <ORGANIZATION> nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import javax.xml.transform.Result; /** * Simple tuple providing named xml results. * * @author bobj * @version created 14-Dec-2009 */ public class OutputPort { public OutputPort( String name, Result result ) { this.name = name; this.result = result; } protected String name; protected Result result; public String getName() { return name; } public void setName( String name ) { this.name = name; } public Result getResult() { return result; } public void setResult( Result result ) { this.result = result; } }
30ec9f5d20a638531c5c7a90cbdfd53b1b4fcecd
65f1313dc5ee176307e2c4594f9600f08f445c9c
/presto-main/src/main/java/com/facebook/presto/sql/planner/RelationPlan.java
70b7b227709f2bb949579a8d8dd038403c7c2188
[ "Apache-2.0" ]
permissive
zhyzhyzhy/presto-0.187
5254fcd953526595de50b235fc2fd9d6343216f5
84ca7d57b1e9ca0a2e1ad72d1d2aaed669d9faf4
refs/heads/master
2022-09-18T09:32:43.863865
2020-01-30T06:55:28
2020-01-30T06:55:28
237,153,678
0
0
Apache-2.0
2022-06-27T16:15:25
2020-01-30T06:33:10
Java
UTF-8
Java
false
false
3,286
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto.sql.planner; import com.facebook.presto.sql.analyzer.RelationType; import com.facebook.presto.sql.analyzer.Scope; import com.facebook.presto.sql.planner.plan.PlanNode; import com.google.common.collect.ImmutableList; import java.util.List; import java.util.Optional; import static com.google.common.base.Preconditions.checkArgument; import static java.util.Objects.requireNonNull; /** * The purpose of this class is to hold the current plan built so far * for a relation (query, table, values, etc.), and the mapping to * indicate how the fields (by position) in the relation map to * the outputs of the plan. * <p> * Fields are resolved by {@link TranslationMap} within local scopes hierarchy. * Indexes of resolved parent scope fields start from "total number of child scope fields". * For instance if a child scope has n fields, then first parent scope field * will have index n. */ class RelationPlan { private final PlanNode root; private final List<Symbol> fieldMappings; // for each field in the relation, the corresponding symbol from "root" private final Scope scope; public RelationPlan(PlanNode root, Scope scope, List<Symbol> fieldMappings) { requireNonNull(root, "root is null"); requireNonNull(fieldMappings, "outputSymbols is null"); requireNonNull(scope, "scope is null"); int allFieldCount = getAllFieldCount(scope); checkArgument(allFieldCount == fieldMappings.size(), "Number of outputs (%s) doesn't match number of fields in scopes tree (%s)", fieldMappings.size(), allFieldCount); this.root = root; this.scope = scope; this.fieldMappings = ImmutableList.copyOf(fieldMappings); } public Symbol getSymbol(int fieldIndex) { checkArgument(fieldIndex >= 0 && fieldIndex < fieldMappings.size() && fieldMappings.get(fieldIndex) != null, "No field->symbol mapping for field %s", fieldIndex); return fieldMappings.get(fieldIndex); } public PlanNode getRoot() { return root; } public List<Symbol> getFieldMappings() { return fieldMappings; } public RelationType getDescriptor() { return scope.getRelationType(); } public Scope getScope() { return scope; } private static int getAllFieldCount(Scope root) { int allFieldCount = 0; Optional<Scope> current = Optional.of(root); while (current.isPresent()) { allFieldCount += current.get().getRelationType().getAllFieldCount(); current = current.get().getLocalParent(); } return allFieldCount; } }
5cbb921aa51379293c7b043b216d914c5c02a467
4627d514d6664526f58fbe3cac830a54679749cd
/results/cling/time-org.joda.time.format.DateTimeFormatterBuilder$PaddedNumber-org.joda.time.format.DateTimeFormatterBuilder-8/org/joda/time/format/DateTimeFormatterBuilder$PaddedNumber_ESTest.java
9319601312cefe6f4525c6abaeb096e695339124
[]
no_license
STAMP-project/Cling-application
c624175a4aa24bb9b29b53f9b84c42a0f18631bd
0ff4d7652b434cbfd9be8d8bb38cfc8d8eaa51b5
refs/heads/master
2022-07-27T09:30:16.423362
2022-07-19T12:01:46
2022-07-19T12:01:46
254,310,667
2
2
null
2021-07-12T12:29:50
2020-04-09T08:11:35
null
UTF-8
Java
false
false
3,634
java
/* * Tue Mar 03 18:27:03 GMT 2020 */ package org.joda.time.format; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.io.Writer; import java.util.Locale; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.joda.time.DateTimeFieldType; import org.joda.time.Partial; import org.joda.time.ReadablePartial; import org.joda.time.chrono.IslamicChronology; import org.joda.time.format.DateTimeFormatterBuilder; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) public class DateTimeFormatterBuilder$PaddedNumber_ESTest extends DateTimeFormatterBuilder$PaddedNumber_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { IslamicChronology islamicChronology0 = IslamicChronology.getInstance(); DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.halfdayOfDay(); Partial partial0 = new Partial(dateTimeFieldType0, 1, islamicChronology0); partial0.getFormatter(); DateTimeFormatterBuilder.FixedNumber dateTimeFormatterBuilder_FixedNumber0 = new DateTimeFormatterBuilder.FixedNumber(dateTimeFieldType0, 1, false); Locale locale0 = Locale.US; // Undeclared exception! try { dateTimeFormatterBuilder_FixedNumber0.printTo((StringBuffer) null, (ReadablePartial) partial0, locale0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.joda.time.format.DateTimeFormatterBuilder", e); } } @Test(timeout = 4000) public void test1() throws Throwable { IslamicChronology islamicChronology0 = IslamicChronology.getInstance(); DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.hourOfDay(); Partial partial0 = new Partial(dateTimeFieldType0, 1, islamicChronology0); partial0.getFormatter(); DateTimeFormatterBuilder.FixedNumber dateTimeFormatterBuilder_FixedNumber0 = new DateTimeFormatterBuilder.FixedNumber(dateTimeFieldType0, 1, false); Locale locale0 = Locale.US; // Undeclared exception! try { dateTimeFormatterBuilder_FixedNumber0.printTo((StringBuffer) null, (ReadablePartial) partial0, locale0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.joda.time.format.DateTimeFormatterBuilder", e); } } @Test(timeout = 4000) public void test2() throws Throwable { DateTimeFieldType dateTimeFieldType0 = DateTimeFieldType.halfdayOfDay(); Partial partial0 = new Partial(dateTimeFieldType0, 1); partial0.getFormatter(); DateTimeFormatterBuilder.FixedNumber dateTimeFormatterBuilder_FixedNumber0 = new DateTimeFormatterBuilder.FixedNumber(dateTimeFieldType0, 1, false); // Undeclared exception! try { dateTimeFormatterBuilder_FixedNumber0.printTo((Writer) null, (ReadablePartial) partial0, (Locale) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.joda.time.format.DateTimeFormatterBuilder", e); } } }
f3a1a506bad03a1ed264e8711a813eed0135dcd3
d72cdc4a0158ee3ecae5e1b2d9cdb9bb7e241763
/tools/base/lint/libs/lint-api/src/main/java/com/android/tools/lint/detector/api/Category.java
a14baf8937577bec075b8e2d47ef1eaf176ebdf1
[ "Apache-2.0" ]
permissive
yanex/uast-lint-common
700fc4ca41a3ed7d76cb33cab280626a0c9d717b
34f5953acd5e8c0104bcc2548b2f2e3f5ab8c675
refs/heads/master
2021-01-20T18:08:31.404596
2016-06-08T19:58:58
2016-06-08T19:58:58
60,629,527
3
0
null
null
null
null
UTF-8
Java
false
false
5,761
java
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.lint.detector.api; import com.android.annotations.NonNull; import com.android.annotations.Nullable; import com.google.common.annotations.Beta; /** * A category is a container for related issues. * <p/> * <b>NOTE: This is not a public or final API; if you rely on this be prepared * to adjust your code for the next tools release.</b> */ @Beta public final class Category implements Comparable<Category> { private final String mName; private final int mPriority; private final Category mParent; /** * Creates a new {@link Category}. * * @param parent the name of a parent category, or null * @param name the name of the category * @param priority a sorting priority, with higher being more important */ private Category( @Nullable Category parent, @NonNull String name, int priority) { mParent = parent; mName = name; mPriority = priority; } /** * Creates a new top level {@link Category} with the given sorting priority. * * @param name the name of the category * @param priority a sorting priority, with higher being more important * @return a new category */ @NonNull public static Category create(@NonNull String name, int priority) { return new Category(null, name, priority); } /** * Creates a new top level {@link Category} with the given sorting priority. * * @param parent the name of a parent category, or null * @param name the name of the category * @param priority a sorting priority, with higher being more important * @return a new category */ @NonNull public static Category create(@Nullable Category parent, @NonNull String name, int priority) { return new Category(parent, name, priority); } /** * Returns the parent category, or null if this is a top level category * * @return the parent category, or null if this is a top level category */ public Category getParent() { return mParent; } /** * Returns the name of this category * * @return the name of this category */ public String getName() { return mName; } /** * Returns a full name for this category. For a top level category, this is just * the {@link #getName()} value, but for nested categories it will include the parent * names as well. * * @return a full name for this category */ public String getFullName() { if (mParent != null) { return mParent.getFullName() + ':' + mName; } else { return mName; } } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Category category = (Category) o; //noinspection SimplifiableIfStatement if (!mName.equals(category.mName)) { return false; } return mParent != null ? mParent.equals(category.mParent) : category.mParent == null; } @Override public String toString() { return getFullName(); } @Override public int hashCode() { return mName.hashCode(); } @Override public int compareTo(@NonNull Category other) { if (other.mPriority == mPriority) { if (mParent == other) { return 1; } else if (other.mParent == this) { return -1; } } int delta = other.mPriority - mPriority; if (delta != 0) { return delta; } return mName.compareTo(other.mName); } /** Issues related to running lint itself */ public static final Category LINT = create("Lint", 110); /** Issues related to correctness */ public static final Category CORRECTNESS = create("Correctness", 100); /** Issues related to security */ public static final Category SECURITY = create("Security", 90); /** Issues related to performance */ public static final Category PERFORMANCE = create("Performance", 80); /** Issues related to usability */ public static final Category USABILITY = create("Usability", 70); /** Issues related to accessibility */ public static final Category A11Y = create("Accessibility", 60); /** Issues related to internationalization */ public static final Category I18N = create("Internationalization", 50); // Sub categories /** Issues related to icons */ public static final Category ICONS = create(USABILITY, "Icons", 73); /** Issues related to typography */ public static final Category TYPOGRAPHY = create(USABILITY, "Typography", 76); /** Issues related to messages/strings */ public static final Category MESSAGES = create(CORRECTNESS, "Messages", 95); /** Issues related to right to left and bidirectional text support */ public static final Category RTL = create(I18N, "Bidirectional Text", 40); }
2998ff262417206313a58fdbfe1a9680d1da2e82
4fa7a1c5c8e0c1e44ff64554e221dc61feb8ad57
/uippush-client-api/src/main/java/com/sinoif/esb/query/model/dto/FirmwareDTO.java
593594e0d9546c0634a07580213a8df284c67d73
[]
no_license
yuanyixiong/esb
66e7912ab844497cb9a8f23c8439320dae5699bf
7dfafe71e530d3e704045303830b2403cfd39078
refs/heads/master
2022-12-25T00:47:29.128583
2020-01-17T08:32:40
2020-01-17T08:32:40
234,504,607
5
2
null
2022-12-16T04:49:31
2020-01-17T08:26:40
Java
UTF-8
Java
false
false
1,378
java
package com.sinoif.esb.query.model.dto; import java.io.Serializable; public class FirmwareDTO implements Serializable { /** * 制造商 */ private String manufacturer; /** * 名称 */ private String name; /** * 简介 */ private String description; /** * 版本 */ private String version; /** * 出厂日期 */ private String releaseDate; public String getManufacturer() { return manufacturer; } public FirmwareDTO setManufacturer(String manufacturer) { this.manufacturer = manufacturer; return this; } public String getName() { return name; } public FirmwareDTO setName(String name) { this.name = name; return this; } public String getDescription() { return description; } public FirmwareDTO setDescription(String description) { this.description = description; return this; } public String getVersion() { return version; } public FirmwareDTO setVersion(String version) { this.version = version; return this; } public String getReleaseDate() { return releaseDate; } public FirmwareDTO setReleaseDate(String releaseDate) { this.releaseDate = releaseDate; return this; } }
6ad8e257db70ba7a37983cc09393f744eecb963c
6f4edc431304c13535410c9ced498b336a426ec7
/jms-spring/src/main/java/com/easylab/jms/consumer/myListenner.java
4be825d42df955ae6934f6df7c68879da209a6c2
[]
no_license
MrLiu1227/ActiveMQ
fdb31302359c986dc733493364cbea8d97d7fe77
82c87e6b117b61f8a8f077c7ceeda05827387775
refs/heads/master
2020-05-17T12:51:13.123687
2019-04-27T04:30:57
2019-04-27T04:30:57
182,504,026
0
0
null
null
null
null
UTF-8
Java
false
false
1,251
java
package com.easylab.jms.consumer; import com.easylab.jms.entity.Student; public class myListenner { //方法里面的参数可以是那五种消息类型,在接受的时候会自动通过反射转换,而不是想别的监听器需要在onmessage房中手动转换 public void handleMessage(Student message) { System.out.println("ConsumerListener通过handleMessage接收到一个纯文本消息,消息内容是:" + message.toString()); } public void receiveMessage(Student message) { System.out.println("ConsumerListener通过receiveMessage接收到一个纯文本消息,消息内容是:" + message.toString()); } public void handleMessage(String message) { System.out.println("ConsumerListener通过handleMessage接收到一个纯文本消息,消息内容是:" + message.toString()); } //一旦defaultListenerMethod设置的方法,返回值不是null,就说明要把返回值自动回复给发送者 public String receiveMessage(String message) { System.out.println("ConsumerListener通过receiveMessage接收到一个纯文本消息,消息内容是:" + message.toString()); return"自动给你回复消息了哦,你接到了吗?"; } }
372c025ec121a79074156be2813b5a114e49ad88
70103ef5ed97bad60ee86c566c0bdd14b0050778
/src/main/java/com/credex/fs/digital/web/rest/errors/InvalidPasswordException.java
58f8857cadd0a404f39790a5d9114cb0a58088bf
[]
no_license
alexjilavu/Smarthack-2021
7a127166cef52bfc9ee08ef1840c0fde2d2b79aa
564abdc14df4981cdcad984a661f105327758559
refs/heads/master
2023-08-29T18:34:44.280519
2021-11-07T10:42:00
2021-11-07T10:42:00
423,957,218
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package com.credex.fs.digital.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class InvalidPasswordException extends AbstractThrowableProblem { private static final long serialVersionUID = 1L; public InvalidPasswordException() { super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST); } }
ba925f6d9c251e34eed5cf7d482c967008a1477c
f5a7d8d8ac72aad84e2b514858d7aed1426ea0ee
/revature_java/arrays_demo/src/examples/Demo3.java
10ccc8452966e9700e9a741d5fa6263b8f16a938
[]
no_license
mealtracker/java_batch1_revature
b037d99f98c6c93c3259e998310ed474274703d7
0b6340d0b97f86546975a8343caff8e83d615fe1
refs/heads/master
2020-11-25T11:53:34.362089
2019-10-02T17:02:25
2019-10-02T17:02:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,115
java
package examples; import java.util.Scanner; public class Demo3 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the size of array"); int size = sc.nextInt(); int ar2[] = new int[size]; System.out.println("Enter " + size + " no of element/s"); for (int i = 0; i < ar2.length; i++) { ar2[i] = sc.nextInt(); } Demo3 d3=new Demo3(); d3.printArray(ar2);//pass by reference System.out.println("Enter the search element"); int ele=sc.nextInt(); if(!d3.searchArray(ar2, ele)) { System.out.println(ele+" not found"); } } public void printArray(int arr[]) { System.out.println("Contents of your array is"); for (int i = 0; i < arr.length; i++) { System.out.print(arr[i]+" "); } System.out.println(); } public boolean searchArray(int ar[],int ele) { boolean b=false; int c=0; for (int i = 0; i < ar.length; i++) { if(ar[i]==ele) { b=true; System.out.println(ele+" found at index "+(i+1)); //break; c++; } } System.out.println(ele+" occured "+c+" no of time/s"); return b; } }
5dc5291b4ea5caf2e8a304f6f343bde87d73ec3d
63e36d35f51bea83017ec712179302a62608333e
/OnePlusCamera/com/adobe/xmp/XMPIterator.java
6a0ea81fd5740a667f8b0eccbd0a92b501309780
[]
no_license
hiepgaf/oneplus_blobs_decompiled
672aa002fa670bdcba8fdf34113bc4b8e85f8294
e1ab1f2dd111f905ff1eee18b6a072606c01c518
refs/heads/master
2021-06-26T11:24:21.954070
2017-08-26T12:45:56
2017-08-26T12:45:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.adobe.xmp; import java.util.Iterator; public abstract interface XMPIterator extends Iterator { public abstract void skipSiblings(); public abstract void skipSubtree(); } /* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/com/adobe/xmp/XMPIterator.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
aa8a7125de156e88286ca803167ccb44496af7a5
c0b825047815ac4b4a18eca135b9a5f9739824c4
/src/main/modified/io/reactivex/super/io/reactivex/internal/schedulers/ScheduledDirectPeriodicTask.java
70d70ad90bad140a146420e9c126c368993e2078
[ "Apache-2.0" ]
permissive
intendia-oss/rxjava-gwt
74650a11215829c8ee8cb84ad58b15ae5611d660
8dacda90d32868de08acdf46b7ac7fce98e119c0
refs/heads/2.x
2022-05-17T04:49:52.641745
2022-04-17T20:21:59
2022-04-17T20:21:59
24,603,615
51
11
Apache-2.0
2022-04-13T20:53:59
2014-09-29T16:43:31
Java
UTF-8
Java
false
false
1,520
java
/** * Copyright (c) 2016-present, RxJava Contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.reactivex.internal.schedulers; import io.reactivex.annotations.GwtIncompatible; import io.reactivex.plugins.RxJavaPlugins; /** * A Callable to be submitted to an ExecutorService that runs a Runnable * action periodically and manages completion/cancellation. * @since 2.0.8 */ @GwtIncompatible("java.util.concurrent.FutureTask") public final class ScheduledDirectPeriodicTask extends AbstractDirectTask implements Runnable { private static final long serialVersionUID = 1811839108042568751L; public ScheduledDirectPeriodicTask(Runnable runnable) { super(runnable); } @Override public void run() { runner = Thread.currentThread(); try { runnable.run(); runner = null; } catch (Throwable ex) { runner = null; lazySet(FINISHED); RxJavaPlugins.onError(ex); } } }
603ea4958a24a15c87310614673d973068ffd2e9
35866b73337b94e8adbdf13c19415ec8f5f1cc63
/JAVA-SE Applications/collectionFramework/Set/StringTreeSet.java
02bbd12e3cf58b563d3605d76a249b2b9e29653f
[]
no_license
debiprasadmishra50/All-Core-Java-Applications---JAVA-SE
fe7080cbf3c21e18bc02b56f5adbccd98d4599ae
c8cbcac0257357035122e91575772ecb84545236
refs/heads/master
2022-11-11T20:56:05.011844
2020-06-28T08:10:17
2020-06-28T08:10:17
275,537,700
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package collectionFramework.Set; import java.util.TreeSet; public class StringTreeSet { public static void main(String[] args) { TreeSet<String> set = new TreeSet<String>(); //Orders the string set in alphabetical order set.add("ABC"); set.add("XYZ"); set.add("KJH"); set.add("DTR"); for (String res : set) System.out.println(res); //It will print in the alphabatical order } }
4236c9d4de1cc487c84833b4985d2de3c2d7e12c
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/1e937add5f846a026373c06f978efdf6cff2dada/before/DeleteAction.java
63dccd6254f2f44109e6a2762f32541660e3862e
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,947
java
/* * Copyright 2000-2009 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.uiDesigner.actions; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.util.IconLoader; import com.intellij.uiDesigner.designSurface.GuiEditor; import com.intellij.uiDesigner.FormEditingUtil; import com.intellij.uiDesigner.CaptionSelection; import com.intellij.uiDesigner.UIDesignerBundle; /** * @author yole */ public final class DeleteAction extends AnAction { public DeleteAction() { getTemplatePresentation().setIcon(IconLoader.getIcon("/com/intellij/uiDesigner/icons/deleteCell.png")); } public void actionPerformed(final AnActionEvent e) { final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext()); CaptionSelection selection = e.getData(CaptionSelection.DATA_KEY); if (editor == null || selection == null || selection.getFocusedIndex() < 0) return; FormEditingUtil.deleteRowOrColumn(editor, selection.getContainer(), selection.getSelection(), selection.isRow()); selection.getContainer().revalidate(); } public void update(final AnActionEvent e) { final Presentation presentation = e.getPresentation(); CaptionSelection selection = e.getData(CaptionSelection.DATA_KEY); if(selection == null || selection.getContainer() == null){ presentation.setVisible(false); return; } presentation.setVisible(true); if (selection.getSelection().length > 1) { presentation.setText(!selection.isRow() ? UIDesignerBundle.message("action.delete.columns") : UIDesignerBundle.message("action.delete.rows")); } else { presentation.setText(!selection.isRow() ? UIDesignerBundle.message("action.delete.column") : UIDesignerBundle.message("action.delete.row")); } int minCellCount = selection.getContainer().getGridLayoutManager().getMinCellCount(); if (selection.getContainer().getGridCellCount(selection.isRow()) - selection.getSelection().length < minCellCount) { presentation.setEnabled(false); } else if (selection.getFocusedIndex() < 0) { presentation.setEnabled(false); } else { presentation.setEnabled(true); } } }
8bf9f0d7d96bcd276594adcee62b57574dfe2166
2448d6c8338ea5328aa44da6ca27cb54d37a2196
/common/src/main/java/org/broadleafcommerce/common/cache/engine/HydrationItemDescriptor.java
391cce6ae0d26f43e3a65d58c588d0d879e4b2ed
[]
no_license
RDeztroyer/StartUP-master
8077240074816a3535eac309a009d9d0d5e36df6
5262bbd0a5225529a38e5a68eb651177b029050c
refs/heads/master
2023-03-05T20:08:52.418953
2013-07-06T17:44:38
2013-07-06T17:44:38
338,304,002
0
1
null
null
null
null
UTF-8
Java
false
false
1,214
java
/* * Copyright 2008-2012 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.broadleafcommerce.common.cache.engine; import java.lang.reflect.Method; /** * * @author jfischer * */ public class HydrationItemDescriptor { private String factoryMethod; private Method[] mutators; public String getFactoryMethod() { return factoryMethod; } public void setFactoryMethod(String factoryMethod) { this.factoryMethod = factoryMethod; } public Method[] getMutators() { return mutators; } public void setMutators(Method[] mutators) { this.mutators = mutators; } }
1f5c384699522f41fbf3d7ce307377d8b46ceb58
bfbfdb87807191e08f40a3853b000cd5d8da47d8
/common/service/facade/src/main/java/com/xianglin/appserv/common/service/facade/model/vo/PageParam.java
04b6c9951cb1f342aa6e4182a56f9f298852f30b
[]
no_license
1amfine2333/appserv
df73926f5e70b8c265cc32277d8bf76af06444cc
ca33ff0f9bc3b5daf0ee32f405a2272cc4673ffa
refs/heads/master
2021-10-10T09:59:03.114589
2019-01-09T05:39:20
2019-01-09T05:40:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
781
java
package com.xianglin.appserv.common.service.facade.model.vo; import java.io.Serializable; /** * @author xingyali * @description Created by xingyali */ public class PageParam<T> implements Serializable { private static final long serialVersionUID = 1604192717721580125L; private int pageSize; private int curPage; private T param; public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } public int getCurPage() { return curPage; } public void setCurPage(int curPage) { this.curPage = curPage; } public T getParam() { return param; } public void setParam(T param) { this.param = param; } }
3c1ca468ec172acd6b32d6eab472d92d9b674cc3
0af8b92686a58eb0b64e319b22411432aca7a8f3
/api-vs-impl-small/domain/src/main/java/org/gradle/testdomain/performancenull_34/Productionnull_3377.java
d8e1d76d9275bdce889c3755891abfbc3a926060
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
591
java
package org.gradle.testdomain.performancenull_34; public class Productionnull_3377 { private final String property; public Productionnull_3377(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
6846bc3230ed0621c6990f9dcb290e9b9b34d6dd
722deb2dc4dc683f5da09f0a668ac07f8b6f7aaf
/webflux.intro/src/main/clients/WebClientExample2.java
8f0e9b27167b33c46b2e95f1dae539ea2e392bea
[]
no_license
anatali/iss2020LabBo
f98874d961b10feaea760c5c78edf9f322372e75
60282c8b2160792348516130c2ac33eb92919746
refs/heads/master
2022-12-20T10:14:42.736826
2021-06-08T09:27:31
2021-06-08T09:27:31
241,646,373
2
3
null
2022-12-12T05:16:03
2020-02-19T14:45:07
HTML
UTF-8
Java
false
false
805
java
package clients; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; public class WebClientExample2 { public static void main(String[] args) throws InterruptedException { WebClient webClient = WebClient.create("http://localhost:8082"); Mono<String> result = webClient.get() .retrieve() .bodyToMono(String.class); result.subscribe(WebClientExample2::handleResponse); System.out.println("After subscribe"); //wait for a while for the response Thread.sleep(1000); } private static void handleResponse(String s) { System.out.println("WebClientExample2 handle response"); System.out.println(s); } }
2ad30e0a62f98cb93d938e2ca6be03b0aed79afe
625b87d8a86ea049c2fba665936a1f91cbb27135
/src/main/java/com/nbcuni/test/cms/utils/jsonparsing/tvecms/parser/RuleListConditionsJsonDefault.java
7d38ca690b3db567d9db332e1bda9b34c588f84c
[]
no_license
coge9/ott
fd8c362aeff267783b73f31d4620c08515cfad23
edd929d1c70555ebab33a02b2c8d5a981608a636
refs/heads/master
2020-12-02T22:56:01.568675
2017-07-04T11:29:00
2017-07-04T11:29:00
96,206,363
1
0
null
2017-07-04T11:29:01
2017-07-04T10:30:32
Java
UTF-8
Java
false
false
2,655
java
package com.nbcuni.test.cms.utils.jsonparsing.tvecms.parser; import com.google.gson.annotations.SerializedName; /** * Created by Aleksandra_Lishaeva on 1/22/16. */ public class RuleListConditionsJsonDefault implements RuleListConditions { private static final String DEFAULT_FIELD = "fullEpisode"; private static final String DEFAULT_OPERATOR = "eq"; private static final Boolean DEFAULT_VALUE = true; @SerializedName("field") private String field; @SerializedName("value") private Boolean value; @SerializedName("operator") private String operator; public String getDEFAULT_FIELD() { return DEFAULT_FIELD; } public String getDEFAULT_OPERATOR() { return DEFAULT_OPERATOR; } @Override public String getField() { return field; } @Override public void setField(String field) { this.field = field; } public Boolean getValue() { return value; } public void setValue(Boolean value) { this.value = value; } @Override public String getOperator() { return operator; } @Override public void setOperator(String operator) { this.operator = operator; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } RuleListConditionsJsonDefault other = (RuleListConditionsJsonDefault) obj; if (field == null) { if (other.field != null) { return false; } } else if (!field.equals(other.field)) { return false; } if (value == null) { if (other.value != null) { return false; } } else if (!value.equals(other.value)) { return false; } if (operator == null) { if (other.operator != null) { return false; } } else if (!operator.equals(other.operator)) { return false; } return true; } @Override public int hashCode() { int result = 1; result = 31 * result + ((field == null) ? 0 : field.hashCode()); result = 31 * result + ((value == null) ? 0 : value.hashCode()); result = 31 * result + ((operator == null) ? 0 : operator.hashCode()); return result; } public RuleListConditionsJsonDefault getListConditionsObject() { setField(DEFAULT_FIELD); setOperator(DEFAULT_OPERATOR); setValue(DEFAULT_VALUE); return this; } }
4f72f8258cdaa063799ebc2b8bd49b56a9807f90
5c57c399921f2363955107b70a8cd82f470b1166
/src/main/java/com/sofrecom/cos/mw/config/LocaleConfiguration.java
2b988180a6411639b41f4f88d3ce9754c8dc9b09
[]
no_license
khabane1992/reamenagement-management
f348415d17587b783cfefc1eb24ceb2f3778dfe4
8cb838cc5d39a82e4725ff9e3f48c2858473a67a
refs/heads/main
2023-04-26T00:34:04.215459
2021-06-03T17:47:12
2021-06-03T17:47:12
373,594,728
0
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
package com.sofrecom.cos.mw.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import tech.jhipster.config.locale.AngularCookieLocaleResolver; @Configuration public class LocaleConfiguration implements WebMvcConfigurer { @Bean public LocaleResolver localeResolver() { AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); return cookieLocaleResolver; } @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("language"); registry.addInterceptor(localeChangeInterceptor); } }
8a58c54565b0fd179beff974a318cb83cfcebd18
35206400dbb3cf062feb5a65e8151c0069d7fa08
/CafePerfeito/xsd_Config_Nfe/src/main/java/br/com/cafeperfeito/xsd/config_nfe/layoutConfig/CertificadoCfg.java
c3d47d912c29ae441805c50a4c1d79517825a403
[]
no_license
tlmacedo/_olds
6427af8ce0c51ca4426c42c98fc97f6424096bdf
4c47e682e5cca61123d9d1bf1521cc797f55f900
refs/heads/main
2023-07-17T04:54:28.782611
2021-09-02T14:29:06
2021-09-02T14:29:06
402,447,345
0
0
null
null
null
null
UTF-8
Java
false
false
2,245
java
// // Este arquivo foi gerado pela Arquitetura JavaTM para Implementaxe7xe3o de Referxeancia (JAXB) de Bind XML, v2.3.1-b171012.0423 // Consulte <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Todas as modificaxe7xf5es neste arquivo serxe3o perdidas apxf3s a recompilaxe7xe3o do esquema de origem. // Gerado em: 2020.12.09 xe0s 02:48:49 PM AMT // package br.com.cafeperfeito.xsd.config_nfe.layoutConfig; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java de CertificadoCfg complex type. * * <p>O seguinte fragmento do esquema especifica o contexFAdo esperado contido dentro desta classe. * * <pre> * &lt;complexType name="CertificadoCfg"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;attribute name="tipo" use="required" type="{}Tstr_14" /&gt; * &lt;attribute name="path" use="required" type="{}Tstr" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CertificadoCfg") public class CertificadoCfg { @XmlAttribute(name = "tipo", required = true) protected String tipo; @XmlAttribute(name = "path", required = true) protected String path; /** * ObtxE9m o valor da propriedade tipo. * * @return possible object is * {@link String } */ public String getTipo() { return tipo; } /** * Define o valor da propriedade tipo. * * @param value allowed object is * {@link String } */ public void setTipo(String value) { this.tipo = value; } /** * ObtxE9m o valor da propriedade path. * * @return possible object is * {@link String } */ public String getPath() { return path; } /** * Define o valor da propriedade path. * * @param value allowed object is * {@link String } */ public void setPath(String value) { this.path = value; } }
9c5b3f703c8b5ded77640e46de85eaceb4136342
88f01463c9d1305136c4213fbddaa8e6b362a627
/src/test/java/com/mailler/controller/sender/EmailJacksonSerializationTest.java
96fbd3803d7e06c3f445d2297655efcfd3f0afc8
[]
no_license
waffle-iron/mailler
572a6a9548daae1eb8a9aef9cba5ec83151d5d6b
90162c619a33dcb5120fceb246b5d656b865005a
refs/heads/master
2020-12-07T15:17:53.112154
2016-07-23T05:21:10
2016-07-23T05:21:10
64,000,390
0
0
null
2016-07-23T05:21:09
2016-07-23T05:21:09
null
UTF-8
Java
false
false
2,095
java
package com.mailler.controller.sender; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasValue; import static org.hamcrest.Matchers.is; import java.io.File; import java.util.HashMap; import java.util.Map; import org.junit.Test; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; import com.mailler.controller.sender.Content; import com.mailler.controller.sender.Email; public class EmailJacksonSerializationTest { @Test public void shouldCheckIfEmailObjectIsTheSameAsTheEmailJsonObject() throws Exception { Map<String, String> properties = new HashMap<>(); properties.put("name", "Alexandre Gama"); properties.put("message", "Welcome to Mailler Gama"); Content bodyContent = new Content(); bodyContent.setProperties(properties); Email email = new Email(); email.setEmailFrom("[email protected]"); email.setEmailTo("[email protected]"); email.setTemplate("http://s3.amazon.com/mailler/template/email.html"); email.setContent(bodyContent); email.setSubject("Welcome"); ObjectWriter prettyWriter = new ObjectMapper().writerWithDefaultPrettyPrinter(); prettyWriter.writeValue(new File("email-pretty.json"), email); ObjectWriter writer = new ObjectMapper().writer(); writer.writeValue(new File("email-ugly.json"), email); ObjectMapper mapper = new ObjectMapper(); Email emailFromJson = mapper.readValue(new File("email-pretty.json"), Email.class); assertThat(emailFromJson.getEmailFrom(), is(equalTo("[email protected]"))); assertThat(emailFromJson.getEmailTo(), is(equalTo("[email protected]"))); assertThat(emailFromJson.getSubject(), is(equalTo("Welcome"))); assertThat(emailFromJson.getTemplate(), is(equalTo("http://s3.amazon.com/mailler/template/email.html"))); assertThat(emailFromJson.getContent().getProperties(), hasValue("Alexandre Gama")); assertThat(emailFromJson.getContent().getProperties(), hasValue("Welcome to Mailler Gama")); } }
c0d12ae97234412e5e53305a4178e1ae2e680937
37271a875a728ee888ccb1e220e5771474dfd979
/storio-content-resolver/src/test/java/com/pushtorefresh/storio/contentresolver/design/OperationDesignTest.java
6d27fe41601bdf595be66217d1e72b72aa169491
[ "Apache-2.0" ]
permissive
taimur97/storio
e9e74287fd742175663e9794f6e0031985f0319d
3dd8c0830ee91bc5c337e25e0d3c88b38697722b
refs/heads/master
2020-02-26T13:18:03.197639
2015-07-01T12:28:27
2015-07-01T12:28:27
38,390,784
1
0
null
2015-07-01T19:31:18
2015-07-01T19:31:18
null
UTF-8
Java
false
false
450
java
package com.pushtorefresh.storio.contentresolver.design; import android.support.annotation.NonNull; import com.pushtorefresh.storio.contentresolver.StorIOContentResolver; abstract class OperationDesignTest { @NonNull private final StorIOContentResolver storIOContentResolver = new DesignTestStorIOContentResolver(); @NonNull protected StorIOContentResolver storIOContentResolver() { return storIOContentResolver; } }
7915292264959f799d300b3115252d4fa2f88c03
3647f3da5e8348d5449e2e6f7575a99a2b244849
/sday14_Regex/src/demo05PatternMatcher/RegexDemo.java
5f8df0db93aea9a58d1322b56ba6aba5e4ac092b
[]
no_license
NianDUI/chuanzhi
f3f04b5da5c15797a9134846b1d20013363e853d
9d4a60b14801ee1483ddade080cf059a4037eacb
refs/heads/master
2022-07-02T01:14:07.768575
2019-11-24T12:45:15
2019-11-24T12:45:15
223,742,493
0
0
null
2022-06-21T02:18:19
2019-11-24T12:43:30
Java
GB18030
Java
false
false
353
java
package demo05PatternMatcher; import java.util.regex.Matcher; import java.util.regex.Pattern; /* * 获取功能 * Pattern和Matcher类的使用 */ public class RegexDemo { public static void main(String[] args) { Pattern p = Pattern.compile("a*b"); Matcher m = p.matcher("aaaaab"); boolean b = m.matches(); System.out.println(b); } }
e26a58dac2e34fe02ccf47e4b7384fa4e04c25b4
2d0de05ba47ad7200e3091bad8b2fbf1dc127684
/Books-Code-Example/HeadFirstDesignPatterns/src/main/java/com/sayem/state/gumballstate/SoldState.java
b572cff889c310e385f3151b47e7e618618f8826
[]
no_license
alvarozs/OnlineCode
10a05685ef515b42468521ae19a0e9e1061b49ad
c859d36c14520a11c1af31f12c20e89a19b4e24c
refs/heads/master
2021-01-22T01:04:42.278651
2013-07-24T03:16:12
2013-07-24T03:16:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
package com.sayem.state.gumballstate; public class SoldState implements State { GumballMachine gumballMachine; public SoldState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; } public void insertQuarter() { System.out.println("Please wait, we're already giving you a gumball"); } public void ejectQuarter() { System.out.println("Sorry, you already turned the crank"); } public void turnCrank() { System.out.println("Turning twice doesn't get you another gumball!"); } public void dispense() { gumballMachine.releaseBall(); if (gumballMachine.getCount() > 0) { gumballMachine.setState(gumballMachine.getNoQuarterState()); } else { System.out.println("Oops, out of gumballs!"); gumballMachine.setState(gumballMachine.getSoldOutState()); } } public String toString() { return "dispensing a gumball"; } }
96ae3951ba4e938e8825ed056dbab60e3e1493a7
e94aaf1de1b04ef422dd6323d0b6e6a8ce1000f8
/src/sqlancer/postgres/ast/PostgresAggregate.java
f92de9e8b86ccc24a46166eeedd311ee59262a3d
[ "MIT" ]
permissive
inboxs/sqlancer
d4fe09deec6b784ce9e32d5d7659c37b7d751db9
85ebbd9f4b7b927d31ecbb6b8553cbd6c0275069
refs/heads/master
2022-11-17T01:55:50.919837
2020-06-29T21:32:06
2020-06-30T07:02:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,610
java
package sqlancer.postgres.ast; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import sqlancer.Randomly; import sqlancer.ast.FunctionNode; import sqlancer.postgres.PostgresSchema.PostgresDataType; import sqlancer.postgres.ast.PostgresAggregate.PostgresAggregateFunction; /** * @see https://www.sqlite.org/lang_aggfunc.html */ public class PostgresAggregate extends FunctionNode<PostgresAggregateFunction, PostgresExpression> implements PostgresExpression { public enum PostgresAggregateFunction { AVG(PostgresDataType.INT, PostgresDataType.FLOAT, PostgresDataType.REAL, PostgresDataType.DECIMAL), BIT_AND( PostgresDataType.INT), BIT_OR(PostgresDataType.INT), BOOL_AND(PostgresDataType.BOOLEAN), BOOL_OR( PostgresDataType.BOOLEAN), COUNT( PostgresDataType.INT), EVERY(PostgresDataType.BOOLEAN), MAX, MIN, // STRING_AGG SUM(PostgresDataType.INT, PostgresDataType.FLOAT, PostgresDataType.REAL, PostgresDataType.DECIMAL); private PostgresDataType[] supportedReturnTypes; PostgresAggregateFunction(PostgresDataType... supportedReturnTypes) { this.supportedReturnTypes = supportedReturnTypes.clone(); } public static PostgresAggregateFunction getRandom() { return Randomly.fromOptions(values()); } public static PostgresAggregateFunction getRandom(PostgresDataType type) { return Randomly.fromOptions(values()); } public List<PostgresDataType> getTypes(PostgresDataType returnType) { return Arrays.asList(returnType); } public boolean supportsReturnType(PostgresDataType returnType) { return Arrays.asList(supportedReturnTypes).stream().anyMatch(t -> t == returnType) || supportedReturnTypes.length == 0; } public static List<PostgresAggregateFunction> getAggregates(PostgresDataType type) { return Arrays.asList(values()).stream().filter(p -> p.supportsReturnType(type)) .collect(Collectors.toList()); } public PostgresDataType getRandomReturnType() { if (supportedReturnTypes.length == 0) { return Randomly.fromOptions(PostgresDataType.getRandomType()); } else { return Randomly.fromOptions(supportedReturnTypes); } } } public PostgresAggregate(List<PostgresExpression> args, PostgresAggregateFunction func) { super(func, args); } }
400896989d4a684cadae0e240fe2ca29f5a84a89
53510b2f25f4fab32b9a0494500b84f6c79cb2ee
/FQPMall/app/src/main/java/com/fengqipu/mall/main/acty/mine/EditPasswordActy.java
5e92e9fa529646c46a2a973e7c1b672b13e1d045
[]
no_license
shenkuen88/FQPMall
14c594172e9e70c8c752c1a452bd898161c796c6
6b81cc076844f126c5e682e9c1d5f5c7bc5add6e
refs/heads/master
2020-12-03T00:42:41.203339
2017-11-30T06:48:29
2017-11-30T06:48:29
96,063,803
0
1
null
null
null
null
UTF-8
Java
false
false
5,935
java
package com.fengqipu.mall.main.acty.mine; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import com.fengqipu.mall.R; import com.fengqipu.mall.bean.BaseResponse; import com.fengqipu.mall.bean.NetResponseEvent; import com.fengqipu.mall.bean.NoticeEvent; import com.fengqipu.mall.bean.mine.EditPasswordResponse; import com.fengqipu.mall.constant.Constants; import com.fengqipu.mall.constant.ErrorCode; import com.fengqipu.mall.constant.Global; import com.fengqipu.mall.constant.IntentCode; import com.fengqipu.mall.constant.NotiTag; import com.fengqipu.mall.main.base.BaseActivity; import com.fengqipu.mall.main.base.BaseApplication; import com.fengqipu.mall.main.base.HeadView; import com.fengqipu.mall.network.GsonHelper; import com.fengqipu.mall.network.UserServiceImpl; import com.fengqipu.mall.tools.GeneralUtils; import com.fengqipu.mall.tools.NetLoadingDialog; import com.fengqipu.mall.tools.StringEncrypt; import com.fengqipu.mall.tools.ToastUtil; import de.greenrobot.event.EventBus; /** * 设置密码 */ public class EditPasswordActy extends BaseActivity implements View.OnClickListener { private Button comfirmBn; private String phoneNum = ""; private EditText etPsdComfirm; private EditText psdEt; /** * 旧密码 */ private EditText etOld; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_find_password_reset); phoneNum = getIntent().getStringExtra(IntentCode.REGISTER_PHONE); initAll(); } private void initTitle() { View view = findViewById(R.id.common_back); HeadView headView = new HeadView((ViewGroup) view); headView.setTitleText("修改密码"); headView.setLeftImage(R.mipmap.app_title_back); headView.setHiddenRight(); } @Override public void initView() { initTitle(); psdEt = (EditText) findViewById(R.id.app_phone_et); etOld = (EditText) findViewById(R.id.app_old_et); etPsdComfirm = (EditText) findViewById(R.id.app_code_et); comfirmBn = (Button) findViewById(R.id.app_register_next_bn); comfirmBn.setOnClickListener(this); etPsdComfirm.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (GeneralUtils.isNotNullOrZeroLenght(etPsdComfirm.getText().toString())) { comfirmBn.setEnabled(true); } } }); } @Override public void initViewData() { } @Override public void initEvent() { } @Override public void onEventMainThread(BaseResponse event) { if (event instanceof NoticeEvent) { String tag = ((NoticeEvent) event).getTag(); if (NotiTag.TAG_CLOSE_ACTIVITY.equals(tag) && BaseApplication.currentActivity.equals(this.getClass().getName())) { finish(); } } else if (event instanceof NetResponseEvent) { NetLoadingDialog.getInstance().dismissDialog(); String tag = ((NetResponseEvent) event).getTag(); String result = ((NetResponseEvent) event).getResult(); if (tag.equals(EditPasswordResponse.class.getName()) && BaseApplication.currentActivity.equals(this.getClass().getName())) { if (GeneralUtils.isNotNullOrZeroLenght(result)) { EditPasswordResponse mCheck = GsonHelper.toType(result, EditPasswordResponse.class); if (Constants.SUCESS_CODE.equals(mCheck.getResultCode())) { //密码修改成功 ToastUtil.makeText(mContext, "密码修改成功,请用新密码登录"); Global.loginOut(mContext); EventBus.getDefault().post(new NoticeEvent(NotiTag.TAG_LOGIN_OUT)); startActivity(new Intent(mContext,LoginActy.class)); finish(); } else { ErrorCode.doCode(mContext, mCheck.getResultCode(), mCheck.getDesc()); NetLoadingDialog.getInstance().dismissDialog(); } } else { NetLoadingDialog.getInstance().dismissDialog(); ToastUtil.showError(mContext); } } } } @Override public void onClick(View v) { switch (v.getId()) { case R.id.app_register_next_bn: if (GeneralUtils.isNullOrZeroLenght(etOld.getText().toString().trim())) { ToastUtil.makeText(mContext, "请输入旧密码"); return; } else if (etPsdComfirm.getText().toString().trim().equals(psdEt.getText().toString().trim())) { if (etPsdComfirm.getText().toString().trim().length() >= 6) { UserServiceImpl.instance().editPassword("1", phoneNum, etOld.getText().toString().trim(), StringEncrypt.Encrypt(etPsdComfirm.getText().toString().trim()), EditPasswordResponse.class.getName()); } else { ToastUtil.makeText(mContext, "请输入大于六位数的密码"); } } else { ToastUtil.makeText(mContext, "两次密码输入不一致"); } break; } } }
25f9e9684acbdc23fd81d789dc624d21ceeb1fc0
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.ocms-OCMS/sources/com/facebook/quicklog/identifiers/Ufi.java
1b5aa3104a839dafc9eefa471363d7e14f99e22f
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
5,825
java
package com.facebook.quicklog.identifiers; public class Ufi { public static final int COMMENT_FLYOUT_TTRC = 3735607; public static final int DASH_FLYOUT_LOAD_CACHED = 3735565; public static final int DASH_FLYOUT_LOAD_NETWORK = 3735566; public static final int FLYOUT_NETWORK_TIME_EXECUTOR_FEEDBACK_ID = 3735568; public static final int FLYOUT_NETWORK_TIME_FEEDBACK_ID = 3735567; public static final int FLYOUT_NETWORK_TIME_PHOTO_ID = 3735569; public static final int LOAD_MORE_COMMENTS = 3735577; public static final short MODULE_ID = 57; public static final int NNF_FLYOUT_ANIMATION_ADJUSTED_WAIT_TIME = 3735578; public static final int NNF_FLYOUT_ANIMATION_TO_DATA_FETCH = 3735580; public static final int NNF_FLYOUT_ANIMATION_WAIT_TIME = 3735575; public static final int NNF_FLYOUT_BG_INFLATABLE_FEEDBACK_TOTAL_TIME = 3735584; public static final int NNF_FLYOUT_BG_INFLATION_TIME = 3735585; public static final int NNF_FLYOUT_FRAGMENT_CREATE_TIME = 3735562; public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW = 3735559; public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER = 3735560; public static final int NNF_FLYOUT_LOAD_COMPLETE_FLOW_TO_RENDER = 3735576; public static final int NNF_FLYOUT_LOAD_DB_CACHE = 3735553; public static final int NNF_FLYOUT_LOAD_DB_CACHE_AND_RENDER = 3735554; public static final int NNF_FLYOUT_LOAD_NETWORK = 3735555; public static final int NNF_FLYOUT_LOAD_NETWORK_AND_RENDER = 3735556; public static final int NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE = 3735557; public static final int NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE_AND_RENDER = 3735558; public static final int NNF_FLYOUT_LOAD_NETWORK_WITH_CACHE = 3735583; public static final int NNF_FLYOUT_ON_ACTIVITYCRAETED_TIME = 3735572; public static final int NNF_FLYOUT_ON_CREATEVIEW_TIME = 3735570; public static final int NNF_FLYOUT_ON_CREATE_TIME = 3735561; public static final int NNF_FLYOUT_ON_RESUME_TIME = 3735573; public static final int NNF_FLYOUT_ON_VIEWCREATED_TIME = 3735571; public static final int NNF_FLYOUT_RESUME_TO_ANIMATION_WAIT = 3735579; public static final int NNF_FLYOUT_RESUME_TO_RENDER_TIME = 3735574; public static final int PERF_MARKER_OPTIMISTIC_COMMENT = 3735582; public static final int PERF_MARKER_POST_COMMENT = 3735581; public static final int PHOTO_FLYOUT_LOAD_CACHED = 3735563; public static final int PHOTO_FLYOUT_LOAD_NETWORK = 3735564; public static final int SINGLELINECOMMENTCOMPOSERVIEW_INITIALIZATION = 3735588; public static final int THREADED_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER = 3735587; public static String getMarkerName(int i) { if (i == 35) { return "UFI_THREADED_FLYOUT_LOAD_COMPLETE_FLOW_AND_RENDER"; } if (i == 36) { return "UFI_SINGLELINECOMMENTCOMPOSERVIEW_INITIALIZATION"; } if (i == 55) { return "UFI_COMMENT_FLYOUT_TTRC"; } switch (i) { case 1: return "UFI_NNF_FLYOUT_LOAD_DB_CACHE"; case 2: return "UFI_NNF_FLYOUT_LOAD_DB_CACHE_AND_RENDER"; case 3: return "UFI_NNF_FLYOUT_LOAD_NETWORK"; case 4: return "UFI_NNF_FLYOUT_LOAD_NETWORK_AND_RENDER"; case 5: return "UFI_NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE"; case 6: return "UFI_NNF_FLYOUT_LOAD_NETWORK_WITHOUT_CACHE_AND_RENDER"; case 7: return "NNF_FlyoutLoadCompleteFlow"; case 8: return "NNF_FlyoutLoadCompleteFlowAndRender"; case 9: return "UFI_NNF_FLYOUT_ON_CREATE_TIME"; case 10: return "UFI_NNF_FLYOUT_FRAGMENT_CREATE_TIME"; case 11: return "UFI_PHOTO_FLYOUT_LOAD_CACHED"; case 12: return "UFI_PHOTO_FLYOUT_LOAD_NETWORK"; case 13: return "UFI_DASH_FLYOUT_LOAD_CACHED"; case 14: return "UFI_DASH_FLYOUT_LOAD_NETWORK"; case 15: return "UFI_FLYOUT_NETWORK_TIME_FEEDBACK_ID"; case 16: return "UFI_FLYOUT_NETWORK_TIME_EXECUTOR_FEEDBACK_ID"; case 17: return "UFI_FLYOUT_NETWORK_TIME_PHOTO_ID"; case 18: return "UFI_NNF_FLYOUT_ON_CREATEVIEW_TIME"; case 19: return "UFI_NNF_FLYOUT_ON_VIEWCREATED_TIME"; case 20: return "UFI_NNF_FLYOUT_ON_ACTIVITYCRAETED_TIME"; case 21: return "UFI_NNF_FLYOUT_ON_RESUME_TIME"; case 22: return "UFI_NNF_FLYOUT_RESUME_TO_RENDER_TIME"; case 23: return "UFI_NNF_FLYOUT_ANIMATION_WAIT_TIME"; case 24: return "UFI_NNF_FLYOUT_LOAD_COMPLETE_FLOW_TO_RENDER"; case 25: return "UfiLoadMoreComments"; case 26: return "UFI_NNF_FLYOUT_ANIMATION_ADJUSTED_WAIT_TIME"; case 27: return "UFI_NNF_FLYOUT_RESUME_TO_ANIMATION_WAIT"; case 28: return "UFI_NNF_FLYOUT_ANIMATION_TO_DATA_FETCH"; case 29: return "UfiFuturesPostComment"; case 30: return "UFI_PERF_MARKER_OPTIMISTIC_COMMENT"; case 31: return "NNF_FlyoutLoadNetworkWithCache"; case 32: return "UFI_NNF_FLYOUT_BG_INFLATABLE_FEEDBACK_TOTAL_TIME"; case 33: return "UFI_NNF_FLYOUT_BG_INFLATION_TIME"; default: return "UNDEFINED_QPL_EVENT"; } } }
e5335870a18bb87564b890279a50b38d89481506
863acb02a064a0fc66811688a67ce3511f1b81af
/sources/p005cm/aptoide/p006pt/promotions/C4526ec.java
491db3d6410c9e583c4e1f4e8cc86f6573cb3ad9
[ "MIT" ]
permissive
Game-Designing/Custom-Football-Game
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
47283462b2066ad5c53b3c901182e7ae62a34fc8
refs/heads/master
2020-08-04T00:02:04.876780
2019-10-06T06:55:08
2019-10-06T06:55:08
211,914,568
1
1
null
null
null
null
UTF-8
Java
false
false
534
java
package p005cm.aptoide.p006pt.promotions; import p005cm.aptoide.p006pt.presenter.View.LifecycleEvent; import p026rx.p027b.C0132p; /* renamed from: cm.aptoide.pt.promotions.ec */ /* compiled from: lambda */ public final /* synthetic */ class C4526ec implements C0132p { /* renamed from: a */ public static final /* synthetic */ C4526ec f8144a = new C4526ec(); private /* synthetic */ C4526ec() { } public final Object call(Object obj) { return PromotionsPresenter.m8895a((LifecycleEvent) obj); } }
79eaf91f8e5c62eb9954e86b712de0d3df265fd4
b19d9b53d8ae9f50e0bc3e6030d6b9713f9c16c3
/src/main/java/org/tinymediamanager/ui/actions/BugReportAction.java
d98f3b89bb478e8de1b5fdfba126ccfb9bf97d05
[ "Apache-2.0" ]
permissive
jmulvaney1/tinyMediaManager
3606cba26e24cfaaa378224dd4cf7aa343bf1480
bff0c13c5d0f286bac4f2b675c75bbafa111fc16
refs/heads/master
2021-01-12T00:35:11.536908
2016-12-27T09:58:21
2016-12-27T09:58:21
78,743,595
1
0
null
2017-01-12T12:32:26
2017-01-12T12:32:26
null
UTF-8
Java
false
false
1,818
java
/* * Copyright 2012 - 2016 Manuel Laggner * * 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.tinymediamanager.ui.actions; import java.awt.event.ActionEvent; import java.util.ResourceBundle; import javax.swing.AbstractAction; import javax.swing.JDialog; import org.tinymediamanager.ui.IconManager; import org.tinymediamanager.ui.MainWindow; import org.tinymediamanager.ui.UTF8Control; import org.tinymediamanager.ui.dialogs.BugReportDialog; /** * The BugReportAction to send bug reports directly from tmm * * @author Manuel Laggner */ public class BugReportAction extends AbstractAction { private static final long serialVersionUID = 2468561945547768259L; private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("messages", new UTF8Control()); //$NON-NLS-1$ public BugReportAction() { putValue(NAME, BUNDLE.getString("BugReport")); //$NON-NLS-1$ putValue(SHORT_DESCRIPTION, BUNDLE.getString("BugReport")); //$NON-NLS-1$ putValue(SMALL_ICON, IconManager.BUG); putValue(LARGE_ICON_KEY, IconManager.BUG); } @Override public void actionPerformed(ActionEvent e) { JDialog dialog = new BugReportDialog(); dialog.setLocationRelativeTo(MainWindow.getActiveInstance()); dialog.setVisible(true); dialog.pack(); } }
178c4f5584c1075c93ea42e886aec0d687272e57
473b76b1043df2f09214f8c335d4359d3a8151e0
/benchmark/bigclonebenchdata_partial/6371580.java
4d9142bb92b4cb5bb36a950b307d06d6b6c868d4
[]
no_license
whatafree/JCoffee
08dc47f79f8369af32e755de01c52d9a8479d44c
fa7194635a5bd48259d325e5b0a190780a53c55f
refs/heads/master
2022-11-16T01:58:04.254688
2020-07-13T20:11:17
2020-07-13T20:11:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,460
java
class c6371580 { public void insertDomain(final List<String> domains) { try { connection.setAutoCommit(false); new ProcessEnvelope().executeNull(new ExecuteProcessAbstractImpl(connection, false, false, true, true) { @Override public void executeProcessReturnNull() throws SQLException { psImpl = connImpl.prepareStatement(sqlCommands.getProperty("domain.add")); Iterator<String> iter = domains.iterator(); String domain; while (iter.hasNext()) { domain = iter.next(); psImpl.setString(1, domain); psImpl.setString(2, domain.toLowerCase(locale)); psImpl.executeUpdate(); } } }); connection.commit(); cmDB.updateDomains(null, null); } catch (SQLException sqle) { log.error(sqle); if (connection != null) { try { connection.rollback(); } catch (SQLException ex) { } } } finally { if (connection != null) { try { connection.setAutoCommit(true); } catch (SQLException ex) { log.error(ex); } } } } }
b07a0f983fdf0f70efd4f194610209d225678363
3e19e438c259a47e28f567047c0d5ec174dcd412
/app/src/main/java/com/audio/demo/audiointeraction/MainApplication.java
0064ceb8c3fe4dd9db6df9c3d62d843ba0c34430
[]
no_license
ScottTamg/AudioInteraction
594b4bd0ea8944e9f236f97b5e9459650e75224e
61c31464e7eef0565e687b0e5c2cf24d04ad7cca
refs/heads/master
2020-03-24T13:11:02.753788
2018-08-10T06:46:47
2018-08-10T06:46:47
142,737,556
0
0
null
null
null
null
UTF-8
Java
false
false
1,042
java
package com.audio.demo.audiointeraction; import android.app.Application; import com.audio.demo.audiointeraction.callback.MyTTTRtcEngineEventHandler; import com.wushuangtech.wstechapi.TTTRtcEngine; import java.util.Random; public class MainApplication extends Application{ public MyTTTRtcEngineEventHandler mMyTTTRtcEngineEventHandler; @Override public void onCreate() { super.onCreate(); Random mRandom = new Random(); LocalConfig.mLoginUserID = mRandom.nextInt(999999); //1.设置SDK的回调接收类 mMyTTTRtcEngineEventHandler = new MyTTTRtcEngineEventHandler(getApplicationContext()); //2.创建SDK的实例对象 // 音视频模式用a967ac491e3acf92eed5e1b5ba641ab7 纯音频模式用496e737d22ecccb8cfa780406b9964d0 TTTRtcEngine mTTTEngine = TTTRtcEngine.create(getApplicationContext(), "a967ac491e3acf92eed5e1b5ba641ab7", mMyTTTRtcEngineEventHandler); if (mTTTEngine == null) { System.exit(0); } } }
8ee460dbcd85e7c4fe7d71857b861afa98d6e56e
7475645dfba27bc75eba07e780b116116178e7b9
/exec/java-exec/src/main/codegen/templates/CastHigh.java
934b60b8895e85e784082031e344d7bf8fb59027
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
yssharma/pig-on-drill
9c25b4f493a768a2d8d3218281a2975bf4d924d0
16bc26320c0ffac545982c6f3d9f381160af3630
refs/heads/master
2016-09-11T10:30:37.633663
2014-10-22T07:20:18
2014-10-22T07:20:18
25,564,723
1
0
null
null
null
null
UTF-8
Java
false
false
2,236
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. */ <@pp.dropOutputFile /> <@pp.changeOutputFile name="/org/apache/drill/exec/expr/fn/impl/gcast/CastHighFunctions.java" /> <#include "/@includes/license.ftl" /> package org.apache.drill.exec.expr.fn.impl.gcast; import org.apache.drill.exec.expr.DrillSimpleFunc; import org.apache.drill.exec.expr.annotations.FunctionTemplate; import org.apache.drill.exec.expr.annotations.FunctionTemplate.NullHandling; import org.apache.drill.exec.expr.annotations.Output; import org.apache.drill.exec.expr.annotations.Param; import org.apache.drill.exec.expr.holders.*; import javax.inject.Inject; import io.netty.buffer.DrillBuf; import org.apache.drill.exec.record.RecordBatch; public class CastHighFunctions { static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(CastHighFunctions.class); <#list casthigh.types as type> @SuppressWarnings("unused") @FunctionTemplate(name = "casthigh", scope = FunctionTemplate.FunctionScope.SIMPLE, nulls=NullHandling.NULL_IF_NULL) public static class CastHigh${type.from} implements DrillSimpleFunc { @Param ${type.from}Holder in; <#if type.from.contains("Decimal")> @Output ${type.from}Holder out; <#else> @Output ${type.to}Holder out; </#if> public void setup(RecordBatch incoming) {} public void eval() { <#if type.value > out.value = (double) in.value; <#else> out = in; </#if> } } </#list> }
bd046bd1f2e1a000d7ae3c9b4cca7269453c6ead
80b0bbe0ffb8578874a1e9014e249254fc1bb343
/src/main/java/com/officer/policeofiicer/repository/BikerRepository.java
816476e5728ff6b70a8048210d20342c025724d7
[]
no_license
arshamsedaghatbin/police-office
58221fdf792adf7ed4a4562100ddfcad89d80598
5ba881fe5fe66408ebf8826442b259ccf0b05a49
refs/heads/master
2021-02-05T13:49:55.272596
2020-03-01T17:38:57
2020-03-01T17:38:57
243,787,841
0
0
null
2020-02-29T23:09:08
2020-02-28T15:00:42
Java
UTF-8
Java
false
false
377
java
package com.officer.policeofiicer.repository; import com.officer.policeofiicer.domain.Biker; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; /** * Spring Data repository for the Biker entity. */ @SuppressWarnings("unused") @Repository public interface BikerRepository extends JpaRepository<Biker, Long> { }
4b181749d42d2aa5320ce462c978a98f5a9fb38c
0205999a193bf670cd9d6e5b37e342b75f4e15b8
/spring-context/src/main/java/org/springframework/format/datetime/standard/YearFormatter.java
e93771bc70dbb9dc812d5d8d3d46291494c8cbab
[ "Apache-2.0" ]
permissive
leaderli/spring-source
18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0
0edd75b2cedb00ad1357e7455a4fe9474b3284da
refs/heads/master
2022-02-18T16:34:19.625966
2022-01-29T08:56:48
2022-01-29T08:56:48
204,468,286
0
0
null
null
null
null
UTF-8
Java
false
false
1,281
java
/* * Copyright 2002-2018 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.format.datetime.standard; import org.springframework.format.Formatter; import java.text.ParseException; import java.time.Year; import java.util.Locale; /** * {@link Formatter} implementation for a JSR-310 {@link Year}, * following JSR-310's parsing rules for a Year. * * @author Juergen Hoeller * @see Year#parse * @since 5.0.4 */ class YearFormatter implements Formatter<Year> { @Override public Year parse(String text, Locale locale) throws ParseException { return Year.parse(text); } @Override public String print(Year object, Locale locale) { return object.toString(); } }
a49753200aa9d40667469dbb4959244da7734e28
3feb60a78b4c36218793caa62302ffe2766964ea
/app/src/main/java/com/dev/novel/HomePage.java
9948e6ce1cbc87f9aef544d1369c6a3d2daa02ce
[]
no_license
chiuthuy/hoanglinh
ae5baaec0327f68386aaa63977059cd6729e70f0
519e2fab8039f03bba34f11467c661e3656c8bfd
refs/heads/master
2022-07-04T12:42:25.028456
2020-05-14T15:37:48
2020-05-14T15:37:48
263,954,994
0
0
null
null
null
null
UTF-8
Java
false
false
4,694
java
package com.dev.novel; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import com.dev.novel.Adapters.NovelAdapter; import com.dev.novel.Models.Novel; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.OnFailureListener; import com.google.android.gms.tasks.Task; import com.google.firebase.firestore.CollectionReference; import com.google.firebase.firestore.DocumentSnapshot; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.Query; import com.google.firebase.firestore.QueryDocumentSnapshot; import com.google.firebase.firestore.QuerySnapshot; import java.util.ArrayList; import java.util.List; public class HomePage extends AppCompatActivity { // private EditText searchBar; private FirebaseFirestore db; private ListView listOfNovels; private Button logOutButton, searchButton; @Override protected void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.home_page); initState(); getNovels(); logOutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { logOut(); navigateToLogInPage(); } }); searchButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { navigateToSearchPage(); } }); } private void initState() { db = FirebaseFirestore.getInstance(); logOutButton = (Button) findViewById(R.id.logOutButton); searchButton = (Button) findViewById(R.id.searchButton); listOfNovels = (ListView) findViewById(R.id.listOfNovels); } private void getNovels() { CollectionReference novels = db.collection("novels"); getAllNovels(novels); } private void getAllNovels(Query query) { query.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if (task.isSuccessful()) { List<Novel> listOfNovels = new ArrayList<>(); Novel[] novels = {}; for (QueryDocumentSnapshot novel: task.getResult()) { listOfNovels.add(responseToNovel(novel)); } novels = listOfNovels.toArray(novels); renderListOfNovels(novels); } } }).addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Toast.makeText(HomePage.this, e.getMessage(), Toast.LENGTH_SHORT).show(); } }); } private void renderListOfNovels(final Novel[] novels) { NovelAdapter adapter = new NovelAdapter(HomePage.this, novels); listOfNovels.setAdapter(adapter); listOfNovels.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Novel novel = novels[position]; navigateToNovelPage(novel.getId(), novel.getName()); } }); } private void logOut() { SharedPreferences sharedPreferences = getSharedPreferences("USERNAME", MODE_PRIVATE); sharedPreferences.edit().remove("username").apply(); } private void navigateToLogInPage() { Intent intent = new Intent(HomePage.this, MainActivity.class); startActivity(intent); finish(); } private void navigateToNovelPage(String novelId, String novelTitle) { Bundle bundle = new Bundle(); Intent intent = new Intent(HomePage.this, NovelPage.class); bundle.putString("NOVEL_ID", novelId); bundle.putString("NOVEL_TITLE", novelTitle); intent.putExtras(bundle); startActivity(intent); finish(); } private void navigateToSearchPage() { Intent intent = new Intent(HomePage.this, SearchPage.class); startActivity(intent); finish(); } private Novel responseToNovel(DocumentSnapshot snapshot) { return new Novel(snapshot.getId(), snapshot.getString("name")); } }
[ "=" ]
=
152988119824a3f31ba5c848951a897c92b6cf02
4e6473153ecde7c7451c94b60bac8836c94e424f
/baseio-core/src/main/java/com/generallycloud/nio/component/ssl/JdkAlpnSslEngine.java
09749823c356edeea81a00b2b6d2758dcbbb02fd
[]
no_license
pengp/baseio
df07daee2dd2d25c7dbf03f3f6eba0a1768af897
dfb5215f4f22f451d80f2435c3e47fc37b4da5cc
refs/heads/master
2020-06-10T17:16:45.090864
2016-12-06T06:13:02
2016-12-06T06:13:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,831
java
package com.generallycloud.nio.component.ssl; import java.util.LinkedHashSet; import java.util.List; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; import org.eclipse.jetty.alpn.ALPN; import org.eclipse.jetty.alpn.ALPN.ClientProvider; import org.eclipse.jetty.alpn.ALPN.ServerProvider; import com.generallycloud.nio.component.ssl.JdkApplicationProtocolNegotiator.ProtocolSelectionListener; import com.generallycloud.nio.component.ssl.JdkApplicationProtocolNegotiator.ProtocolSelector; final class JdkAlpnSslEngine extends JdkSslEngine { private static boolean available; static boolean isAvailable() { updateAvailability(); return available; } private static void updateAvailability() { if (available) { return; } try { // Always use bootstrap class loader. Class.forName("sun.security.ssl.ALPNExtension", true, null); available = true; } catch (Exception ignore) { // alpn-boot was not loaded. } } JdkAlpnSslEngine(SSLEngine engine, final JdkApplicationProtocolNegotiator applicationNegotiator, boolean server) { super(engine); if (server) { final ProtocolSelector protocolSelector = applicationNegotiator.protocolSelectorFactory().newSelector( this, new LinkedHashSet<String>(applicationNegotiator.protocols())); ALPN.put(engine, new ServerProvider() { @Override public String select(List<String> protocols) throws SSLException { try { return protocolSelector.select(protocols); } catch (SSLHandshakeException e) { throw e; } catch (Throwable t) { SSLHandshakeException e = new SSLHandshakeException(t.getMessage()); e.initCause(t); throw e; } } @Override public void unsupported() { protocolSelector.unsupported(); } }); } else { final ProtocolSelectionListener protocolListener = applicationNegotiator.protocolListenerFactory() .newListener(this, applicationNegotiator.protocols()); ALPN.put(engine, new ClientProvider() { @Override public List<String> protocols() { return applicationNegotiator.protocols(); } @Override public void selected(String protocol) throws SSLException { try { protocolListener.selected(protocol); } catch (SSLHandshakeException e) { throw e; } catch (Throwable t) { SSLHandshakeException e = new SSLHandshakeException(t.getMessage()); e.initCause(t); throw e; } } @Override public void unsupported() { protocolListener.unsupported(); } }); } } @Override public void closeInbound() throws SSLException { ALPN.remove(getWrappedEngine()); super.closeInbound(); } @Override public void closeOutbound() { ALPN.remove(getWrappedEngine()); super.closeOutbound(); } }
43bab0ee16fb9de99f5731ac985666ee1facf363
7079477d823d266ae2e1c9b287392fd6cbe1679c
/plugin/src/main/java/com/craftmend/openaudiomc/generic/migrations/MigrationWorker.java
556f697198e02e108f504271e854a80c60334144
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hrpdevelopment/OpenAudioMc
777a24fb3d01defa2c46b163b9cf51518623b286
db4f15a527601019cb5b96375e2bafbf5c4b9160
refs/heads/master
2022-07-28T02:38:41.764007
2020-05-08T17:36:40
2020-05-08T17:36:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,602
java
package com.craftmend.openaudiomc.generic.migrations; import com.craftmend.openaudiomc.OpenAudioMc; import com.craftmend.openaudiomc.generic.core.logging.OpenAudioLogger; import com.craftmend.openaudiomc.generic.migrations.interfaces.SimpleMigration; import com.craftmend.openaudiomc.generic.migrations.migrations.LocalClientToPlusMigration; import com.craftmend.openaudiomc.generic.migrations.migrations.MouseHoverMessageMigration; import com.craftmend.openaudiomc.generic.migrations.migrations.PlusAccessLevelMigration; import lombok.NoArgsConstructor; @NoArgsConstructor public class MigrationWorker { private final SimpleMigration[] migrations = new SimpleMigration[] { new LocalClientToPlusMigration(), // migrates old users to 6.2 and uploads old data to oa+, then resets config new PlusAccessLevelMigration(), // adds config values for the permissions patch new MouseHoverMessageMigration() // adds a config field for the hover-to-connect message }; public void handleMigrations(OpenAudioMc main) { for (SimpleMigration migration : migrations) { if (migration.shouldBeRun()) { OpenAudioLogger.toConsole("Migration Service: Running migration " + migration.getClass().getSimpleName()); migration.execute(); OpenAudioLogger.toConsole("Migration Service: Finished migrating " + migration.getClass().getSimpleName()); } else { OpenAudioLogger.toConsole("Skipping migration " + migration.getClass().getSimpleName()); } } } }
c4d5d6dfa31331afb39a83a70706706bae540c35
bd7b2f839e76e37bf8a3fd841a7451340f7df7a9
/archunit-example/example-plain/src/main/java/com/tngtech/archunit/example/layers/service/Async.java
9776066e6f5076fc15e26c82164aa540c074a70e
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
TNG/ArchUnit
ee7a1cb280360481a004c46f9861c5db181d7335
87cc595a281f84c7be6219714b22fbce337dd8b1
refs/heads/main
2023-09-01T14:18:52.601280
2023-08-29T09:15:13
2023-08-29T09:15:13
88,962,042
2,811
333
Apache-2.0
2023-09-14T08:11:13
2017-04-21T08:39:20
Java
UTF-8
Java
false
false
203
java
package com.tngtech.archunit.example.layers.service; import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Retention(RUNTIME) public @interface Async { }
16274b0a19a44421b9a01446f78c426a49dc8d48
e7e497b20442a4220296dea1550091a457df5a38
/main_project/search/LuceneTest/src/UserSearcher.java
940c64bd91fd6b060204acc4a77202fd177087e7
[]
no_license
gunner14/old_rr_code
cf17a2dedf8dfcdcf441d49139adaadc770c0eea
bb047dc88fa7243ded61d840af0f8bad22d68dee
refs/heads/master
2021-01-17T18:23:28.154228
2013-12-02T23:45:33
2013-12-02T23:45:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,285
java
import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Collector; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.search.Filter; import org.apache.lucene.search.Scorer; import org.apache.lucene.search.TopDocs; import org.apache.lucene.search.Weight; public class UserSearcher extends RenrenSearcher { // private static Log logger_ = LogFactory.getLog(UserSearcher.class); private int ids_[]; private Map<Integer, Integer> uid2Id_ = new HashMap<Integer, Integer>(); public UserSearcher(IndexReader reader, String filepath) throws CorruptIndexException, IOException { super(reader); ids_ = loadIDs(filepath);// 加载ID } @Override public void search(Weight weight, Filter filter, Collector collector) throws IOException { if (collector instanceof RelationCollector) { ((RelationCollector) collector).setRelation(uid2Id_, ids_); } if (filter == null) { for (int i = 0; i < subReaders.length; i++) { // search each // subreader collector.setNextReader(subReaders[i], docStarts[i]); Scorer scorer = weight.scorer(subReaders[i], !collector.acceptsDocsOutOfOrder(), true); if (scorer != null) { scorer.score(collector); } } } else { for (int i = 0; i < subReaders.length; i++) { // search each // subreader collector.setNextReader(subReaders[i], docStarts[i]); searchWithFilter(subReaders[i], weight, filter, collector); } } } private void searchWithFilter(IndexReader reader, Weight weight, final Filter filter, final Collector collector) throws IOException { assert filter != null; Scorer scorer = weight.scorer(reader, true, false); if (scorer == null) { return; } int docID = scorer.docID(); assert docID == -1 || docID == DocIdSetIterator.NO_MORE_DOCS; // CHECKME: use ConjunctionScorer here? DocIdSet filterDocIdSet = filter.getDocIdSet(reader); if (filterDocIdSet == null) { // this means the filter does not accept any documents. return; } DocIdSetIterator filterIter = filterDocIdSet.iterator(); if (filterIter == null) { // this means the filter does not accept any documents. return; } int filterDoc = filterIter.nextDoc(); int scorerDoc = scorer.advance(filterDoc); collector.setScorer(scorer); while (true) { if (scorerDoc == filterDoc) { // Check if scorer has exhausted, only before collecting. if (scorerDoc == DocIdSetIterator.NO_MORE_DOCS) { break; } collector.collect(scorerDoc); filterDoc = filterIter.nextDoc(); scorerDoc = scorer.advance(filterDoc); } else if (scorerDoc > filterDoc) { filterDoc = filterIter.advance(scorerDoc); } else { scorerDoc = scorer.advance(filterDoc); } } } public Document doc(int docid) throws CorruptIndexException, IOException { if (0 <= docid && docid < ids_.length) { Document doc = new Document(); doc.add(new Field("user_basic.id", String.valueOf(ids_[docid]), Field.Store.YES, Field.Index.NOT_ANALYZED)); return doc; } throw new IOException("Cannot find userid for docid " + docid); } public Document[] docidsToDocuments(int[] docids) throws IOException { Document[] documents = new Document[docids.length]; for (int i = 0; i < docids.length; ++i) { int docid = docids[i]; documents[i] = this.doc(docid); } return documents; } public int[] docidsToIDs(int[] docids) throws IOException { int[] ids = new int[docids.length]; for (int i = 0; i < docids.length; ++i) { int docid = docids[i]; if (0 <= docid && docid < ids_.length) { ids[i] = ids_[docid]; } else { throw new IOException("Cannot find userid for docid " + docid); } } return ids; } /** 加载ID **/ private int[] loadIDs(String filepath) throws IOException { System.out.println("loading docmap " + filepath); try { RandomAccessFile docfile = new RandomAccessFile(filepath, "r"); long filelength = docfile.length(); int length = (int) (filelength / 8 + 1); int[] ids = new int[length]; byte[] docid_bytes = new byte[4]; byte[] userid_bytes = new byte[4]; int docid = 0; int userid = 0; int res = 0; for (;;) { // 读取前四个字节到docid_bytes,返回读取到的字节数 res = docfile.read(docid_bytes, 0, 4); if (res <= 0) { break; } // 再读取四个字节到userid_bytes,返回读取到的字节数 res = docfile.read(userid_bytes, 0, 4); if (res <= 0) { break; } // 将他们转为int值 docid = ((docid_bytes[0] & 0xFF) << 24) | ((docid_bytes[1] & 0xFF) << 16) | ((docid_bytes[2] & 0xFF) << 8) | (docid_bytes[3] & 0xFF); userid = ((userid_bytes[0] & 0xFF) << 24) | ((userid_bytes[1] & 0xFF) << 16) | ((userid_bytes[2] & 0xFF) << 8) | (userid_bytes[3] & 0xFF); if (docid < ids.length) { ids[docid] = userid; uid2Id_.put(userid, docid); //System.out.println(userid + " " + docid); } else { throw new IOException("docid >= length: " + docid + " >= " + ids.length); } } System.out.println("loading docmap " + filepath + "...done"); return ids; } catch (FileNotFoundException e) { // ExceptionUtil.logException(e, logger_); throw new IOException("File cannot be open: " + filepath); } } @Override public TopDocs search(Weight weight, Filter filter, int nDocs, List<Integer> fids, List<Integer> commons) throws IOException { RelationCollector collector = new RelationCollector(nDocs, fids, commons); try { search(weight, filter, collector); return collector.topDocs(); } catch (IOException e) { e.printStackTrace(); } return null; } }
839e87227752a35bcb4796bd6e68ddec15f39391
95379ba98e777550a5e7bf4289bcd4be3c2b08a3
/java/net/sf/l2j/gameserver/model/item/MercenaryTicket.java
0c8b8da0691f9fd61619764ddc6a523dfc946930
[]
no_license
l2brutal/aCis_gameserver
1311617bd8ce0964135e23d5ac2a24f83023f5fb
5fa7fe086940343fb4ea726a6d0138c130ddbec7
refs/heads/master
2021-01-03T04:10:26.192831
2019-03-19T19:44:09
2019-03-19T19:44:09
239,916,465
0
1
null
2020-02-12T03:12:34
2020-02-12T03:12:33
null
UTF-8
Java
false
false
1,379
java
package net.sf.l2j.gameserver.model.item; import java.util.Arrays; import net.sf.l2j.gameserver.instancemanager.SevenSigns.CabalType; import net.sf.l2j.gameserver.templates.StatsSet; public final class MercenaryTicket { public enum TicketType { SWORD, POLE, BOW, CLERIC, WIZARD, TELEPORTER } private final int _itemId; private final TicketType _type; private final boolean _isStationary; private final int _npcId; private final int _maxAmount; private final CabalType[] _ssq; public MercenaryTicket(StatsSet set) { _itemId = set.getInteger("itemId"); _type = set.getEnum("type", TicketType.class); _isStationary = set.getBool("stationary"); _npcId = set.getInteger("npcId"); _maxAmount = set.getInteger("maxAmount"); final String[] ssq = set.getStringArray("ssq"); _ssq = new CabalType[ssq.length]; for (int i = 0; i < ssq.length; i++) _ssq[i] = Enum.valueOf(CabalType.class, ssq[i]); } public int getItemId() { return _itemId; } public TicketType getType() { return _type; } public boolean isStationary() { return _isStationary; } public int getNpcId() { return _npcId; } public int getMaxAmount() { return _maxAmount; } public boolean isSsqType(CabalType type) { return Arrays.asList(_ssq).contains(type); } }
efffdc2f471e197faa8234f006c5e2477767df96
fd22b41d370e72429e01b2f2a48f1c5cdd60279f
/src/net/admin/goods/action/AdminGoodsModifyAction.java
1016171d747c7bd259f984f113e585a6200ae066
[]
no_license
cayori/mall
d5bc151f686b446e01dadfff0bd8cb821d7889ba
e963a713d751e6dcdbc1fb874440d1e4bf656dd2
refs/heads/master
2021-07-18T23:49:56.534537
2017-10-24T06:10:18
2017-10-24T06:10:18
107,203,035
0
0
null
null
null
null
UHC
Java
false
false
1,321
java
package net.admin.goods.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.admin.goods.db.*; public class AdminGoodsModifyAction implements Action { public ActionForward execute(HttpServletRequest request, HttpServletResponse response) throws Exception{ request.setCharacterEncoding("euc-kr"); ActionForward forward=new ActionForward(); AdminGoodsDAO agoodsdao= new AdminGoodsDAO(); GoodsBean agb=new GoodsBean(); agb.setGOODS_NUM(Integer.parseInt(request.getParameter("goods_num"))); agb.setGOODS_CATEGORY(request.getParameter("goods_category")); agb.setGOODS_NAME(request.getParameter("goods_name")); agb.setGOODS_CONTENT(request.getParameter("goods_content")); agb.setGOODS_SIZE(request.getParameter("goods_size")); agb.setGOODS_COLOR(request.getParameter("goods_color")); agb.setGOODS_AMOUNT(Integer.parseInt(request.getParameter("goods_amount"))); agb.setGOODS_PRICE(Integer.parseInt(request.getParameter("goods_price"))); agb.setGOODS_BEST(Integer.parseInt(request.getParameter("goods_best"))); int result=agoodsdao.modifyGoods(agb); if(result<=0){ System.out.println("상품 수정 실패"); return null; } forward.setPath("./GoodsList.ag"); forward.setRedirect(true); return forward; } }
32fecc0cd20d736bb542dd93231ca818e0444531
0af8b92686a58eb0b64e319b22411432aca7a8f3
/api-vs-impl-small/domain/src/main/java/org/gradle/testdomain/performancenull_10/Productionnull_980.java
b84941c78182c14dd1a50083c1d1146e204f5184
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
589
java
package org.gradle.testdomain.performancenull_10; public class Productionnull_980 { private final String property; public Productionnull_980(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
a53c94e489d6011030ab1366c64d57baafb21585
0f1f95e348b389844b916c143bb587aa1c13e476
/bboss-core-entity/src-asm/bboss/org/objectweb/asm/tree/analysis/Subroutine.java
8ab607344ac1cdeb1724658ae70931dc75fd2af6
[ "Apache-2.0" ]
permissive
bbossgroups/bboss
78f18f641b18ea6dd388a1f2b28e06c4950b07c3
586199b68a8275aa59b76af10f408fec03dc93de
refs/heads/master
2023-08-31T14:48:12.040505
2023-08-29T13:05:46
2023-08-29T13:05:46
2,780,369
269
151
null
2016-04-04T13:25:20
2011-11-15T14:01:02
Java
UTF-8
Java
false
false
3,351
java
/*** * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2011 INRIA, France Telecom * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package bboss.org.objectweb.asm.tree.analysis; import java.util.ArrayList; import java.util.List; import bboss.org.objectweb.asm.tree.JumpInsnNode; import bboss.org.objectweb.asm.tree.LabelNode; /** * A method subroutine (corresponds to a JSR instruction). * * @author Eric Bruneton */ class Subroutine { LabelNode start; boolean[] access; List<JumpInsnNode> callers; private Subroutine() { } Subroutine(final LabelNode start, final int maxLocals, final JumpInsnNode caller) { this.start = start; this.access = new boolean[maxLocals]; this.callers = new ArrayList<JumpInsnNode>(); callers.add(caller); } public Subroutine copy() { Subroutine result = new Subroutine(); result.start = start; result.access = new boolean[access.length]; System.arraycopy(access, 0, result.access, 0, access.length); result.callers = new ArrayList<JumpInsnNode>(callers); return result; } public boolean merge(final Subroutine subroutine) throws AnalyzerException { boolean changes = false; for (int i = 0; i < access.length; ++i) { if (subroutine.access[i] && !access[i]) { access[i] = true; changes = true; } } if (subroutine.start == start) { for (int i = 0; i < subroutine.callers.size(); ++i) { JumpInsnNode caller = subroutine.callers.get(i); if (!callers.contains(caller)) { callers.add(caller); changes = true; } } } return changes; } }
8fd7990fd308f4421f6601c4a1a665f9155d3322
d395b4f055068d9375eabc23aac06f3fe906fb39
/src/main/java/org/drip/specialfunction/hankel/ZitaFromSmallH2.java
91db7987f00fd7986880bfca8e099d25ffc1b6e5
[ "Apache-2.0" ]
permissive
afcarl/DROP
2e2d339bfaaf04d303a28cde75a37de41282bbce
cecbaae4cb09fb11a2c895f4c2ba435d5ff1889a
refs/heads/master
2020-09-12T21:33:17.944759
2019-11-18T05:25:20
2019-11-18T05:25:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,865
java
package org.drip.specialfunction.hankel; /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! * Copyright (C) 2019 Lakshmi Krishnamurthy * * This file is part of DROP, an open-source library targeting risk, transaction costs, exposure, margin * calculations, and portfolio construction within and across fixed income, credit, commodity, equity, * FX, and structured products. * * https://lakshmidrip.github.io/DROP/ * * DROP is composed of three main modules: * * - DROP Analytics Core - https://lakshmidrip.github.io/DROP-Analytics-Core/ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/ * - DROP Numerical Core - https://lakshmidrip.github.io/DROP-Numerical-Core/ * * DROP Analytics Core implements libraries for the following: * - Fixed Income Analytics * - Asset Backed Analytics * - XVA Analytics * - Exposure and Margin Analytics * * DROP Portfolio Core implements libraries for the following: * - Asset Allocation Analytics * - Transaction Cost Analytics * * DROP Numerical Core implements libraries for the following: * - Statistical Learning Library * - Numerical Optimizer Library * - Machine Learning Library * - Spline Builder Library * * Documentation for DROP is Spread Over: * * - Main => https://lakshmidrip.github.io/DROP/ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki * - GitHub => https://github.com/lakshmiDRIP/DROP * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal * - Release Versions => https://lakshmidrip.github.io/DROP/version.html * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues * - JUnit => https://lakshmidrip.github.io/DROP/junit/index.html * - Jacoco => https://lakshmidrip.github.io/DROP/jacoco/index.html * * 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. */ /** * <i>ZitaFromSmallH2</i> implements the Estimator for the Riccati-Bessel Zita Function using the Spherical * Hankel Function of the Second Kind. The References are: * * <br><br> * <ul> * <li> * Abramowitz, M., and I. A. Stegun (2007): <i>Handbook of Mathematics Functions</i> <b>Dover Book * on Mathematics</b> * </li> * <li> * Arfken, G. B., and H. J. Weber (2005): <i>Mathematical Methods for Physicists 6<sup>th</sup> * Edition</i> <b>Harcourt</b> San Diego * </li> * <li> * Temme N. M. (1996): <i>Special Functions: An Introduction to the Classical Functions of * Mathematical Physics 2<sup>nd</sup> Edition</i> <b>Wiley</b> New York * </li> * <li> * Watson, G. N. (1995): <i>A Treatise on the Theory of Bessel Functions</i> <b>Cambridge University * Press</b> * </li> * <li> * Wikipedia (2019): Bessel Function https://en.wikipedia.org/wiki/Bessel_function * </li> * </ul> * * <br><br> * <ul> * <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/NumericalCore.md">Numerical Core Module</a></li> * <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/NumericalOptimizerLibrary.md">Numerical Optimizer</a></li> * <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/README.md">Special Function Project</a></li> * <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/specialfunction/ode/README.md">Special Function Ordinary Differential Equations</a></li> * </ul> * * @author Lakshmi Krishnamurthy */ public class ZitaFromSmallH2 extends org.drip.specialfunction.definition.RiccatiBesselZitaEstimator { private org.drip.specialfunction.definition.SphericalHankelSecondKindEstimator _sphericalHankelSecondKindEstimator = null; /** * ZitaFromSmallH2 Constructor * * @param sphericalHankelSecondKindEstimator Spherical Hankel Second Kind Estimator * * @throws java.lang.Exception Thrown if the Inputs are Invalid */ public ZitaFromSmallH2 ( final org.drip.specialfunction.definition.SphericalHankelSecondKindEstimator sphericalHankelSecondKindEstimator) throws java.lang.Exception { if (null == (_sphericalHankelSecondKindEstimator = sphericalHankelSecondKindEstimator)) { throw new java.lang.Exception ("ZitaFromSmallH2 Constructor => Invalid Inputs"); } } /** * Retrieve the Spherical Hankel Second Kind Estimator * * @return The Spherical Hankel Second Kind Estimator */ public org.drip.specialfunction.definition.SphericalHankelSecondKindEstimator sphericalHankelSecondKindEstimator() { return _sphericalHankelSecondKindEstimator; } @Override public org.drip.function.definition.CartesianComplexNumber zita ( final double alpha, final double z) { org.drip.function.definition.CartesianComplexNumber smallH2 = _sphericalHankelSecondKindEstimator.smallH2 ( alpha, z ); return null == smallH2 ? null : org.drip.function.definition.CartesianComplexNumber.Scale ( smallH2, z ); } }
80609cb7baedc40568fea0f276fc5dbbc9ab05e0
e808d3e97e19558d15bacbcfeb9785014f2eb93a
/onebusaway-webapp/src/main/java/org/onebusaway/webapp/gwt/oba_application/control/Score.java
2ef4787b7de5b3fc841a8398c3c0643e1fcb7627
[ "Apache-2.0" ]
permissive
isabella232/onebusaway-application-modules
82793b63678f21e28c98093cb71b333a2e22a3c1
d2ca6c6e0038d158c9df487cab9f75d18b1214ff
refs/heads/master
2023-03-08T20:02:35.766999
2019-01-03T16:41:11
2019-01-03T16:41:11
335,592,972
0
0
NOASSERTION
2021-02-24T05:43:58
2021-02-03T10:50:26
null
UTF-8
Java
false
false
1,725
java
/** * Copyright (C) 2011 Brian Ferris <[email protected]> * * 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.onebusaway.webapp.gwt.oba_application.control; public class Score { /* public double calcScore(){ return Math.round( 100 * ( calcPoints(1)/maxPoints ) ); } int calcPoints( int limit ){ int totalPoints = 0; for (int i = 0; i < snapSortedResults.length; i++) { for (int j = 0; j < limit && j < snapSortedResults[i].length; j++) { totalPoints += snapSortedResults[i][j].score(); } } return totalPoints; } QueryList.prototype.calcMaxPoints = function() { var maxPoints = 0; forEach(this.queryArray, function (item, n) { if (item[2] == Q_SINGLE || item[2] == Q_MULTI_START) maxPoints+=10; }); return maxPoints; } public void go() { var selector = Math.floor( 4 * convertMeters(this.snapDist(), UNITS_MI) ); //this is miles-based regardless of the country var score = 0; switch ( selector ) { case 0: this.score_ = 10; break case 1: this.score_ = 8; break case 2: this.score_ = 4; break case 3: this.score_ = 2; break default: this.score_ = 0; break } return this.score_; } */ }
b30ca4d6402c17bb6a294bfe7addb58bc1a3931e
56345887f87495c458a80373002159dbbbd7717f
/client-adapter/common/src/main/java/com/alibaba/otter/canal/client/adapter/support/JdbcTypeUtil.java
c24ff7de41fd7d9cc7f6b7dda560c57799b55763
[ "Apache-2.0" ]
permissive
cainiao22/canal-bigdata
724199c61632e98b43797d4fd276abcba7e426fb
a88362535faeda5f846a8f147d341f8d22ffd2e4
refs/heads/master
2022-12-26T16:59:50.256698
2018-12-05T07:27:17
2018-12-05T07:27:17
214,317,447
1
0
Apache-2.0
2022-12-14T20:35:10
2019-10-11T01:30:07
Java
UTF-8
Java
false
false
5,079
java
package com.alibaba.otter.canal.client.adapter.support; import java.math.BigDecimal; import java.math.BigInteger; import java.sql.*; import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 类型转换工具类 * * @author rewerma 2018-8-19 下午06:14:23 * @version 1.0.0 */ public class JdbcTypeUtil { private static Logger logger = LoggerFactory.getLogger(JdbcTypeUtil.class); public static Object getRSData(ResultSet rs, String columnName, int jdbcType) throws SQLException { if (jdbcType == Types.BIT || jdbcType == Types.BOOLEAN) { return rs.getByte(columnName); } else { return rs.getObject(columnName); } } public static Class<?> jdbcType2javaType(int jdbcType) { switch (jdbcType) { case Types.BIT: case Types.BOOLEAN: // return Boolean.class; case Types.TINYINT: return Byte.TYPE; case Types.SMALLINT: return Short.class; case Types.INTEGER: return Integer.class; case Types.BIGINT: return Long.class; case Types.DECIMAL: case Types.NUMERIC: return BigDecimal.class; case Types.REAL: return Float.class; case Types.FLOAT: case Types.DOUBLE: return Double.class; case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: return String.class; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.BLOB: return byte[].class; case Types.DATE: return java.sql.Date.class; case Types.TIME: return Time.class; case Types.TIMESTAMP: return Timestamp.class; default: return String.class; } } public static Object typeConvert(String columnName, String value, int sqlType, String mysqlType) { if (value == null || value.equals("")) { return null; } try { Object res; switch (sqlType) { case Types.INTEGER: res = Integer.parseInt(value); break; case Types.SMALLINT: res = Short.parseShort(value); break; case Types.BIT: case Types.TINYINT: res = Byte.parseByte(value); break; case Types.BIGINT: if (mysqlType.startsWith("bigint") && mysqlType.endsWith("unsigned")) { res = new BigInteger(value); } else { res = Long.parseLong(value); } break; // case Types.BIT: case Types.BOOLEAN: res = !"0".equals(value); break; case Types.DOUBLE: case Types.FLOAT: res = Double.parseDouble(value); break; case Types.REAL: res = Float.parseFloat(value); break; case Types.DECIMAL: case Types.NUMERIC: res = new BigDecimal(value); break; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.BLOB: res = value.getBytes("ISO-8859-1"); break; case Types.DATE: if (!value.startsWith("0000-00-00")) { value = value.trim().replace(" ", "T"); DateTime dt = new DateTime(value); res = new Date(dt.toDate().getTime()); } else { res = null; } break; case Types.TIME: value = "T" + value; DateTime dt = new DateTime(value); res = new Time(dt.toDate().getTime()); break; case Types.TIMESTAMP: if (!value.startsWith("0000-00-00")) { value = value.trim().replace(" ", "T"); dt = new DateTime(value); res = new Timestamp(dt.toDate().getTime()); } else { res = null; } break; case Types.CLOB: default: res = value; } return res; } catch (Exception e) { logger.error("table: {} column: {}, failed convert type {} to {}", columnName, value, sqlType); return value; } } }
6a31a84f85167c323d1cb285453d4f26e971f869
544cfadc742536618168fc80a5bd81a35a5f2c99
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/displayinfo/DisplayInfoFragment.java
f415e5be2dbe68a7dd74e33952f4fc2e90a8a7f7
[]
no_license
ZYHGOD-1/Aosp11
0400619993b559bf4380db2da0addfa9cccd698d
78a61ca023cbf1a0cecfef8b97df2b274ac3a988
refs/heads/main
2023-04-21T20:13:54.629813
2021-05-22T05:28:21
2021-05-22T05:28:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,076
java
/* * Copyright (C) 2016 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.google.android.car.kitchensink.displayinfo; import android.annotation.Nullable; import android.app.ActivityManager; import android.content.Context; import android.content.pm.ConfigurationInfo; import android.content.res.Resources; import android.graphics.Point; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.TextView; import androidx.fragment.app.Fragment; import com.google.android.car.kitchensink.R; /** * Displays info about the display this is run on. */ public class DisplayInfoFragment extends Fragment { private LinearLayout list; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.display_info, container, false); list = (LinearLayout) view.findViewById(R.id.list); return view; } @Override public void onStart() { super.onStart(); Point screenSize = new Point(); getActivity().getWindowManager().getDefaultDisplay().getSize(screenSize); addTextView("window size(px): " + screenSize.x + " x " + screenSize.y); addTextView("display density(dpi): " + getResources().getDisplayMetrics().densityDpi); addTextView("display default density(dpi): " + getResources().getDisplayMetrics().DENSITY_DEFAULT); addTextView("======================================"); ActivityManager am = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE); ConfigurationInfo ci = am.getDeviceConfigurationInfo(); addTextView("OpenGL ES version: " + ci.getGlEsVersion()); addTextView("======================================"); addTextView("All size are in DP."); View rootView = getActivity().findViewById(android.R.id.content); addTextView("view size: " + convertPixelsToDp(rootView.getWidth(), getContext()) + " x " + convertPixelsToDp(rootView.getHeight(), getContext())); addTextView("window size: " + convertPixelsToDp(screenSize.x, getContext()) + " x " + convertPixelsToDp(screenSize.y, getContext())); addDimenText("car_keyline_1"); addDimenText("car_keyline_2"); addDimenText("car_keyline_3"); addDimenText("car_keyline_4"); addDimenText("car_margin"); addDimenText("car_gutter_size"); addDimenText("car_primary_icon_size"); addDimenText("car_secondary_icon_size"); addDimenText("car_title_size"); addDimenText("car_title2_size"); addDimenText("car_headline1_size"); addDimenText("car_headline2_size"); addDimenText("car_headline3_size"); addDimenText("car_headline4_size"); addDimenText("car_body1_size"); addDimenText("car_body2_size"); addDimenText("car_body3_size"); addDimenText("car_body4_size"); addDimenText("car_body5_size"); addDimenText("car_action1_size"); addDimenText("car_touch_target_size"); addDimenText("car_action_bar_height"); } private void addDimenText(String dimenName) { String value; try { float dimen = convertPixelsToDp( getResources().getDimensionPixelSize( getResources().getIdentifier( dimenName, "dimen", getContext().getPackageName())), getContext()); value = Float.toString(dimen); } catch (Resources.NotFoundException e) { value = "Resource Not Found"; } addTextView(dimenName + " : " + value); } private void addTextView(String text) { TextView textView = new TextView(getContext()); textView.setTextAppearance(R.style.TextAppearance_CarUi_Body2); textView.setText(text); list.addView(textView); } private static float convertPixelsToDp(float px, Context context){ Resources resources = context.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); float dp = px / ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT); return dp; } }
22d4abd16549c2ec431d2bc979d0dc132a1df804
04653acfca56d9bab08beca174eb15eaee97e1ce
/eaccount-web-manage/src/main/java/com/ucsmy/eaccount/manage/dao/ManageIpScheduleTaskDao.java
7f50b62ba85d4f9219034cd1c08ee04a2623af6d
[]
no_license
msm3673763/eaccount
9fee55b68292326cebfe06486dd8a655fafad3a6
e38de479a1f602493bc82cf2a575f250fa37851a
refs/heads/master
2021-07-04T14:34:51.516682
2017-09-26T04:32:19
2017-09-26T04:32:19
104,832,964
0
0
null
null
null
null
UTF-8
Java
false
false
666
java
package com.ucsmy.eaccount.manage.dao; import com.ucsmy.core.dao.BasicDao; import com.ucsmy.eaccount.manage.entity.ManageIpScheduleTask; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; /** * 定时任务Dao * * @author chenqilin * @since 2017/9/7 */ @Repository public interface ManageIpScheduleTaskDao extends BasicDao<ManageIpScheduleTask> { /** * 任务码是否存在 * * @param taskCode 任务码 * @param id 排除的id * @return */ int isTaskCodeExist(@Param("taskCode") String taskCode, @Param("id") String id); int updateStatus(@Param("id") String id); }
9995d0ef7a0baf6df4614eefa42d776080c73330
be518806fd9880910b333bc51a56ccfbaad3c8e3
/src/main/java/info/jerrinot/nettyloc/StringUtil.java
85198237ad1639c373282e3b4d49b44cca2726e0
[]
no_license
alisheikh/hugecast
111e4ea59543bcd0ac54fe7b6806f940f852b7bf
bc3b201498ec46344d85336124bd29bccac547ab
refs/heads/master
2020-12-25T09:08:08.703169
2013-12-01T19:15:51
2013-12-01T19:15:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
/* * Copyright 2012 The Netty Project * * The Netty Project 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 info.jerrinot.nettyloc; import java.util.ArrayList; import java.util.Formatter; import java.util.List; /** * String utility class. */ public final class StringUtil { private StringUtil() { // Unused. } public static final String NEWLINE; static { String newLine; try { newLine = new Formatter().format("%n").toString(); } catch (Exception e) { newLine = "\n"; } NEWLINE = newLine; } }