blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
286ce57297cf414c6f31279a818e711bd893e61c
d71fc6f733e494f35f1ea855f25c5e830efea632
/kernel/api/fabric3-host-api/src/main/java/org/fabric3/api/host/runtime/DefaultHostInfoBuilder.java
f2ded508265ec0f17766d2565bd3618d9a191d03
[ "Apache-2.0" ]
permissive
carecon/fabric3-core
d92ba6aa847386ee491d16f7802619ee1f65f493
14a6c6cd5d7d3cabf92e670ac89432a5f522c518
refs/heads/master
2020-04-02T19:54:51.148466
2018-12-06T19:56:50
2018-12-06T19:56:50
154,750,871
0
0
null
2018-10-25T23:39:54
2018-10-25T23:39:54
null
UTF-8
Java
false
false
2,953
java
package org.fabric3.api.host.runtime; import java.io.File; import java.net.URI; import java.util.List; import org.fabric3.api.host.os.OperatingSystem; import org.fabric3.api.model.type.RuntimeMode; public class DefaultHostInfoBuilder { private String runtimeName; private String zoneName; private RuntimeMode runtimeMode; private String environment; private URI domain; private File baseDir; private File sharedDirectory; private File dataDirectory; private File tempDirectory; private List<File> deployDirectories; private OperatingSystem operatingSystem; private boolean javaEEXAEnabled; public DefaultHostInfoBuilder runtimeName(String runtimeName) { this.runtimeName = runtimeName; return this; } public DefaultHostInfoBuilder zoneName(String zoneName) { this.zoneName = zoneName; return this; } public DefaultHostInfoBuilder runtimeMode(RuntimeMode runtimeMode) { this.runtimeMode = runtimeMode; return this; } public DefaultHostInfoBuilder environment(String environment) { this.environment = environment; return this; } public DefaultHostInfoBuilder domain(URI domain) { this.domain = domain; return this; } public DefaultHostInfoBuilder baseDir(File baseDir) { this.baseDir = baseDir; return this; } public DefaultHostInfoBuilder sharedDirectory(File sharedDirectory) { this.sharedDirectory = sharedDirectory; return this; } public DefaultHostInfoBuilder dataDirectory(File dataDirectory) { this.dataDirectory = dataDirectory; return this; } public DefaultHostInfoBuilder tempDirectory(File tempDirectory) { this.tempDirectory = tempDirectory; return this; } public DefaultHostInfoBuilder deployDirectories(List<File> deployDirectories) { this.deployDirectories = deployDirectories; return this; } public DefaultHostInfoBuilder operatingSystem(OperatingSystem operatingSystem) { this.operatingSystem = operatingSystem; return this; } public DefaultHostInfoBuilder javaEEXAEnabled(boolean javaEEXAEnabled) { this.javaEEXAEnabled = javaEEXAEnabled; return this; } public DefaultHostInfo build() { return new DefaultHostInfo(runtimeName, zoneName, runtimeMode, environment, domain, baseDir, sharedDirectory, dataDirectory, tempDirectory, deployDirectories, operatingSystem, javaEEXAEnabled); } }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com
deeece058d20cc5e721b0122144bbd9ef1c57c63
fcfae160bf9c66c60928c5ee29149f0a26740c24
/connectors/kfaka/src/main/java/consumer/kafka/ProcessedOffsetManager.java
804b4f36e7f4f92e3b736b627be8b035606ebfd7
[ "Apache-2.0" ]
permissive
sand-stone/krocks
4bffb5efddf6248ac0d476a0027e688856158b18
18077c1bc9032a0dc2bde4a5c3cc49cfaac12eab
refs/heads/master
2020-07-24T19:06:20.364970
2016-12-30T22:30:59
2016-12-30T22:30:59
73,785,244
0
0
null
null
null
null
UTF-8
Java
false
false
3,163
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 consumer.kafka; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.stream.Stream; import com.google.common.collect.ImmutableMap; public class ProcessedOffsetManager { public static Map<Integer, Iterable<Long>> getPartitionOffset(KDBContext ctx) { Map<Integer, Iterable<Long>> partitonOffset = new HashMap<Integer, Iterable<Long>>(); return partitonOffset; } public static void persists(Map<Integer, Iterable<Long>> partitonOffset, Properties props) { Map<Integer, Long> partitionOffsetMap = new HashMap<Integer, Long>(); for(Map.Entry<Integer, Iterable<Long>> entry : partitonOffset.entrySet()) { int partition = entry.getKey(); Long offset = getMaximum(entry.getValue()); partitionOffsetMap.put(partition, offset); persistProcessedOffsets(props, partitionOffsetMap); } } private static <T extends Comparable<T>> T getMaximum(Iterable<T> values) { T max = null; for (T value : values) { if (max == null || max.compareTo(value) < 0) { max = value; } } return max; } private static void persistProcessedOffsets(Properties props, Map<Integer, Long> partitionOffsetMap) { ZkState state = new ZkState(props.getProperty(Config.ZOOKEEPER_CONSUMER_CONNECTION)); for(Map.Entry<Integer, Long> po : partitionOffsetMap.entrySet()) { Map<Object, Object> data = (Map<Object, Object>) ImmutableMap .builder() .put("consumer",ImmutableMap.of("id",props.getProperty(Config.KAFKA_CONSUMER_ID))) .put("offset", po.getValue()) .put("partition",po.getKey()) .put("broker",ImmutableMap.of("host", "", "port", "")) .put("topic", props.getProperty(Config.KAFKA_TOPIC)).build(); String path = processedPath(po.getKey(), props); try{ state.writeJSON(path, data); }catch (Exception ex) { state.close(); throw ex; } } state.close(); } private static String processedPath(int partition, Properties props) { return props.getProperty(Config.ZOOKEEPER_CONSUMER_PATH) + "/" + props.getProperty(Config.KAFKA_CONSUMER_ID) + "/" + props.getProperty(Config.KAFKA_TOPIC) + "/processed/" + "partition_"+ partition; } }
[ "sand.m.stone@gmail.com" ]
sand.m.stone@gmail.com
69af63bb2be23ee4569fcc601a749d15abfd775e
ab1b6e7b92517e4425bb3ae817041b7697f98558
/drools-compiler/src/main/java/org/drools/compiler/xml/processes/WorkItemNodeHandler.java
bd0b8e00f9ed969d9a7a75323a9b0569a78e13a4
[]
no_license
jayzhk/drools51
2a1ee1a3a9284e79b294aa39d7050b35ffac6f31
98c4067df30c060ec19c0ae70244cc089ae43e56
refs/heads/master
2021-05-08T07:11:39.985092
2017-10-18T15:13:50
2017-10-18T15:13:50
106,695,906
0
0
null
null
null
null
UTF-8
Java
false
false
4,576
java
package org.drools.compiler.xml.processes; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.Map; import org.drools.compiler.xml.XmlWorkflowProcessDumper; import org.drools.process.core.ParameterDefinition; import org.drools.process.core.Work; import org.drools.process.core.datatype.DataType; import org.drools.workflow.core.Node; import org.drools.workflow.core.node.WorkItemNode; import org.drools.xml.ExtensibleXmlParser; import org.w3c.dom.Element; import org.xml.sax.SAXException; public class WorkItemNodeHandler extends AbstractNodeHandler { public void handleNode(final Node node, final Element element, final String uri, final String localName, final ExtensibleXmlParser parser) throws SAXException { super.handleNode(node, element, uri, localName, parser); WorkItemNode workItemNode = (WorkItemNode) node; final String waitForCompletion = element.getAttribute("waitForCompletion"); workItemNode.setWaitForCompletion(!"false".equals(waitForCompletion)); for (String eventType: workItemNode.getActionTypes()) { handleAction(workItemNode, element, eventType); } } protected Node createNode() { return new WorkItemNode(); } public Class<?> generateNodeFor() { return WorkItemNode.class; } public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) { WorkItemNode workItemNode = (WorkItemNode) node; writeNode("workItem", workItemNode, xmlDump, includeMeta); visitParameters(workItemNode, xmlDump); xmlDump.append(">" + EOL); if (includeMeta) { writeMetaData(workItemNode, xmlDump); } Work work = workItemNode.getWork(); visitWork(work, xmlDump, includeMeta); visitInMappings(workItemNode.getInMappings(), xmlDump); visitOutMappings(workItemNode.getOutMappings(), xmlDump); for (String eventType: workItemNode.getActionTypes()) { writeActions(eventType, workItemNode.getActions(eventType), xmlDump); } writeTimers(workItemNode.getTimers(), xmlDump); endNode("workItem", xmlDump); } protected void visitParameters(WorkItemNode workItemNode, StringBuilder xmlDump) { if (!workItemNode.isWaitForCompletion()) { xmlDump.append("waitForCompletion=\"false\" "); } } protected void visitInMappings(Map<String, String> inMappings, StringBuilder xmlDump) { for (Map.Entry<String, String> inMapping: inMappings.entrySet()) { xmlDump.append( " <mapping type=\"in\" " + "from=\"" + inMapping.getValue() + "\" " + "to=\"" + inMapping.getKey() + "\" />" + EOL); } } protected void visitOutMappings(Map<String, String> outMappings, StringBuilder xmlDump) { for (Map.Entry<String, String> outMapping: outMappings.entrySet()) { xmlDump.append( " <mapping type=\"out\" " + "from=\"" + outMapping.getKey() + "\" " + "to=\"" + outMapping.getValue() + "\" />" + EOL); } } protected void visitWork(Work work, StringBuilder xmlDump, boolean includeMeta) { if (work != null) { xmlDump.append(" <work name=\"" + work.getName() + "\" >" + EOL); List<ParameterDefinition> parameterDefinitions = new ArrayList<ParameterDefinition>(work.getParameterDefinitions()); Collections.sort(parameterDefinitions, new Comparator<ParameterDefinition>() { public int compare(ParameterDefinition o1, ParameterDefinition o2) { return o1.getName().compareTo(o2.getName()); } }); for (ParameterDefinition paramDefinition: parameterDefinitions) { DataType dataType = paramDefinition.getType(); xmlDump.append(" <parameter name=\"" + paramDefinition.getName() + "\" >" + EOL + " "); XmlWorkflowProcessDumper.visitDataType(dataType, xmlDump); Object value = work.getParameter(paramDefinition.getName()); if (value != null) { xmlDump.append(" "); XmlWorkflowProcessDumper.visitValue(value, dataType, xmlDump); } xmlDump.append(" </parameter>" + EOL); } xmlDump.append(" </work>" + EOL); } } }
[ "jay.zeng@hotmail.com" ]
jay.zeng@hotmail.com
7ac912a36f8f965d4c16550f3544fb252eb86b5c
3c1e9fe5fc7a34cd2b21084f725405ce1bb5623b
/src/main/java/Calculator.java
f16c88ff85b960ef9ced3d655e2d3a8d25f814bb
[]
no_license
MpenduloNk/Calculator
e15d7e1b27c254b44c268ec19c8cfe3024879523
d6f8372e5783391ee2c8cd1172c38a725363758e
refs/heads/master
2021-01-08T01:11:20.112684
2020-02-20T12:01:05
2020-02-20T12:01:05
241,870,593
0
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
import java.awt.*; import java.sql.SQLOutput; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; import java.util.function.DoubleToIntFunction; public class Calculator { public static int addSum(ArrayList<Integer> values){ int sum =0; for (int i = 0; i < values.size(); i++){ sum = sum + values.get(i); } return sum; } public static int multiplication(ArrayList<Integer> values){ int total = 1; for (int i = 0; i < values.size(); i++){ total = total * values.get(i); } return total; } public static boolean ExceptionHandler(String num){ try { Integer.parseInt(num); } catch (NumberFormatException e){ return false; } return true; } public static void main(String[] args){ ArrayList<Integer> number = new ArrayList<>(); Scanner scanner = new Scanner(System.in); System.out.println("Please Enter any number of your wish and type [Stop] to terminate : "); String total = scanner.next(); if (total != " "){ while (ExceptionHandler(total)) { int newTotal = Integer.parseInt(total); number.add(newTotal); if (!total.trim().equals("Stop")){ System.out.println("Please Enter any number of your wish and type [Stop] to terminate : "); total = scanner.next(); } else { break; } } } System.out.println("The sum of "+number+" is = "+addSum(number)); System.out.println("The multiplication of "+number+" is = "+multiplication(number)); } }
[ "you@example.com" ]
you@example.com
0f40124d3cd407c82e2b1e74a5440575bdfbb6f8
efcf3233a2a21411eb1ae2bff3b71baa548c6f04
/math/src/test/java/org/lcsim/spacegeom/CartesianPathTest.java
18397cbca6e63eca6690556dce6dbe047f98b9b2
[ "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
slaclab/lcsim
95af8a8821bd1e7638f3c9c039655f9b4f797a92
afdee47b0e511a6f96595deae758dedaef2f4ae3
refs/heads/master
2023-07-06T19:40:04.589633
2023-03-20T21:38:33
2023-03-20T21:38:33
95,500,068
1
7
NOASSERTION
2023-03-20T21:10:47
2017-06-27T00:08:43
Java
UTF-8
Java
false
false
4,276
java
package org.lcsim.spacegeom; // CartesianPathTest.cpp // Test the SpacePath class. import junit.framework.TestCase; import org.lcsim.spacegeom.CartesianPath; import org.lcsim.spacegeom.CylindricalPath; import org.lcsim.spacegeom.SpacePath; import org.lcsim.spacegeom.SphericalPath; public class CartesianPathTest extends TestCase { //********************************************************************** boolean debug = false; private static final boolean myequal(double x1, double x2) { return Math.abs(x2-x1) < 1.e-10; } //********************************************************************** public void testCartesianPath() { String name = "SpacePoint"; String ok_prefix = name + " test (I): "; String error_prefix = name + " test (E): "; if (debug) System.out.println( ok_prefix + "------- Testing component " + name + ". -------" ); double x = 1.23; double y = 2.46; double z = 3.69; double dx = 0.23; double dy = 0.45; double dz = 0.67; //********************************************************************** if (debug) System.out.println( ok_prefix + "Testing constructors." ); // Create a space path element CartesianPath cart = new CartesianPath(x,y,z,dx,dy,dz); if (debug) System.out.println( cart ); // Create in cylindrical coordinates. CylindricalPath cyl = new CylindricalPath( cart.getStartPoint().rxy(), cart.getStartPoint().phi(), cart.getStartPoint().z(), cart.drxy(), cart.rxy_dphi(), cart.dz() ); if (debug) System.out.println( cyl ); // Create in spherical coordinates. SphericalPath sph = new SphericalPath( cyl.getStartPoint().rxyz(), cyl.getStartPoint().phi(), cyl.getStartPoint().theta(), cyl.drxyz(), cyl.rxyz_dtheta(), cyl.rxy_dphi() ); if (debug) System.out.println( sph ); assertTrue( myequal(sph.getStartPoint().x(),x) ); assertTrue( myequal(sph.getStartPoint().y(),y) ); assertTrue( myequal(sph.getStartPoint().z(),z) ); assertTrue( myequal(sph.dx(),dx) ); assertTrue( myequal(sph.dy(),dy) ); assertTrue( myequal(sph.dz(),dz) ); //********************************************************************** if (debug) System.out.println( ok_prefix + "Testing assignment." ); SpacePath dpth = new SpacePath(); if (debug) System.out.println( dpth ); assertTrue( dpth.magnitude() == 0.0 ); dpth = sph; if (debug) System.out.println( dpth ); assertTrue( myequal(dpth.getStartPoint().x(),x) ); assertTrue( myequal(dpth.getStartPoint().y(),y) ); assertTrue( myequal(dpth.getStartPoint().z(),z) ); assertTrue( myequal(dpth.dx(),dx) ); assertTrue( myequal(dpth.dy(),dy) ); assertTrue( myequal(dpth.dz(),dz) ); //********************************************************************** if (debug) System.out.println( ok_prefix + "Testing normalizations." ); double n0 = dx*dx + dy*dy + dz*dz; if (debug) System.out.println( n0 ); double ncart = dpth.dx()*dpth.dx() + dpth.dy()*dpth.dy() + dpth.dz()*dpth.dz(); if (debug) System.out.println( ncart ); double ncyl = dpth.drxy()*dpth.drxy() + // FIXME dpth.rxy_dphi()*dpth.rxy_dphi() + dpth.dz()*dpth.dz(); if (debug) System.out.println( ncyl ); double nsph = dpth.drxyz()*dpth.drxyz(); // FIXME dpth.rxy_dphi()*dpth.rxy_dphi() + dpth.rxyz_dtheta()*dpth.rxyz_dtheta(); if (debug) System.out.println( nsph ); assertTrue( myequal(ncart,n0) ); assertTrue( myequal(ncyl,n0) ); assertTrue( myequal(nsph,n0) ); assertTrue( myequal( Math.sqrt(n0), dpth.magnitude() ) ); //********************************************************************** if (debug) System.out.println( ok_prefix + "------------- All tests passed. ------------" ); } }
[ "jermccormick@gmail.com" ]
jermccormick@gmail.com
a793edd31c00d98d6c2451eee901a3af6a84178b
0af45a5d4357bc7ab57fc2b03f7fdc156a504cb9
/src/main/java/fpinscala/chapter5/Exercise_5_12.java
da743b29b8b57d508db6eb4d64592bf73e802063
[]
no_license
googl3r/fpinscala-jdk8
c33edd4480bb17f6df855228ca1a51b143e1455b
2461a185f6c13a40360cfec35075e0e7ce5550ea
refs/heads/master
2020-08-29T14:01:36.228184
2014-04-21T22:09:56
2014-04-21T22:25:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,529
java
/* * Copyright (c) 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 fpinscala.chapter5; import fpinscala.chapter4.Option; public class Exercise_5_12 { public static Flow<Integer> fibs() { return Exercise_5_11.unfold(new Pair<>(0, 1), p -> Option.of(new Pair<>(p.x, new Pair<>(p.y, p.x + p.y)))); } public static Flow<Integer> from(int n) { return Exercise_5_11.unfold(n, i -> Option.of(new Pair<>(i, i + 1))); } public static <S> Flow<S> constant(S s) { return Exercise_5_11.unfold(s, i -> Option.of(new Pair<>(s, s))); } public static void main(String[] args) { Flow<Integer> fibs = fibs(); System.out.println(Exercise_5_02.take(fibs, 10).toCons()); Flow<Integer> from = from(42); System.out.println(Exercise_5_02.take(from, 5).toCons()); Flow<Integer> constant = constant(13); System.out.println(Exercise_5_02.take(constant, 5).toCons()); } }
[ "simone.bordet@gmail.com" ]
simone.bordet@gmail.com
57fb5d603b2214748a0a388128e3982c1d0792e1
4e5d61b632c452dafbfbe2bf47cfb1247877c729
/Java Repository/Spring Core/src/_30/jdbc/programmatic/transaction/model/Person.java
a4b751e875a97aa76d029f0e1fef833093676adf
[]
no_license
tugcankoparan/Java-EE-Spring-Framework
520c943d472afe6266ddf15ed91dd3120c1768c0
ca565dfd29287b33d61acfe477d6980ad69c0866
refs/heads/master
2020-03-30T11:16:10.432834
2018-10-18T17:19:46
2018-10-18T17:19:46
151,164,255
0
1
null
null
null
null
UTF-8
Java
false
false
1,144
java
package _30.jdbc.programmatic.transaction.model; public class Person { private int id; private String name; private String surname; private int birthYear; private Address address; public Person() { } public Person(int id, String name, String surname, int birthYear) { super(); this.id = id; this.name = name; this.surname = surname; this.birthYear = birthYear; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public int getBirthYear() { return birthYear; } public void setBirthYear(int birthYear) { this.birthYear = birthYear; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @Override public String toString() { return "Person [id=" + id + ", name=" + name + ", surname=" + surname + ", birthYear=" + birthYear + ", address=" + address + "]"; } }
[ "tugcankoparan10@gmail.com" ]
tugcankoparan10@gmail.com
937c0781022b1c1082b3a3dadbd1ca69f1c6ebff
7df903184a4c6ce0a5e8e010534c2ce022076c80
/4.JavaCollections/src/com/javarush/task/task39/task3904/Solution.java
0369a13f5e510903cb6a752248394190e57eaf9a
[]
no_license
tasya671/JavaRushTasks
a91d37e7a1fe0418f572a24a0ecd2f1921c037a5
dcf46d0317cf69ff78da69209c66da95efcf632e
refs/heads/master
2020-12-22T21:55:26.271744
2020-06-22T08:28:42
2020-06-22T08:28:42
236,935,502
0
0
null
null
null
null
UTF-8
Java
false
false
829
java
package com.javarush.task.task39.task3904; import java.util.HashMap; import java.util.List; import java.util.Map; /* Лестница */ public class Solution { private static int n = 70; private static final Map<Integer, Long> cache = new HashMap<>(); public static void main(String[] args) { System.out.println("The number of possible ascents for " + n + " steps is: " + numberOfPossibleAscents(n)); } public synchronized static long numberOfPossibleAscents(int n) { if(n < 0) return 0; if(n == 0) return 1; long pr1 = 1; long pr2 = 1; long pr3 = 2; long var = 0; for (int i = 3; i <= n ; i++) { var = pr1 + pr2 + pr3; pr1 = pr2; pr2 = pr3; pr3 = var; } return var; } }
[ "tasya671@rambler.ru" ]
tasya671@rambler.ru
5d6c7e04949ef80807f87f82736c5dddd25bd208
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/CHART-4b-5-3-Single_Objective_GGA-WeightedSum-BasicBlockCoverage/org/jfree/chart/plot/XYPlot_ESTest.java
0e5723939f8d74d895d490c0df585afd278208db
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
1,659
java
/* * This file was automatically generated by EvoSuite * Thu May 14 12:31:29 UTC 2020 */ package org.jfree.chart.plot; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import java.awt.Color; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.jfree.chart.annotations.TextAnnotation; import org.jfree.chart.axis.CyclicNumberAxis; import org.jfree.chart.plot.IntervalMarker; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYItemRenderer; import org.jfree.chart.util.Layer; import org.jfree.data.xy.XYDataset; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XYPlot_ESTest extends XYPlot_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { XYDataset xYDataset0 = mock(XYDataset.class, new ViolatedAssumptionAnswer()); doReturn((String) null, (String) null).when(xYDataset0).toString(); doReturn(0).when(xYDataset0).getSeriesCount(); Color color0 = (Color)TextAnnotation.DEFAULT_PAINT; IntervalMarker intervalMarker0 = new IntervalMarker((-396.34809981196014), (-396.34809981196014), color0); Layer layer0 = Layer.BACKGROUND; CyclicNumberAxis cyclicNumberAxis0 = new CyclicNumberAxis(10.0, ""); cyclicNumberAxis0.setTickLabelsVisible(true); XYPlot xYPlot0 = new XYPlot(xYDataset0, cyclicNumberAxis0, cyclicNumberAxis0, (XYItemRenderer) null); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
445a5b1ca660f8c0c970157a3204f29c8491be07
53b2063a4cd2ae22b61ebe09d292f92f0dc75417
/core/base/base-plugins/org.csstudio.vtype.pv/src/org/csstudio/vtype/pv/pva/PVA_Context.java
7548107a09dc536e69191ed362d24093f5a27ecd
[]
no_license
ATNF/cs-studio
886d6cb2a3d626b761d4486f4243dd04cb21c055
f3ef004fd1566b8b47161b13a65990e8c741086a
refs/heads/master
2021-01-21T08:29:54.345483
2015-05-29T04:04:33
2015-05-29T04:04:33
11,189,876
1
0
null
null
null
null
UTF-8
Java
false
false
2,055
java
/******************************************************************************* * Copyright (c) 2014 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.vtype.pv.pva; import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; import org.epics.pvaccess.ClientFactory; import org.epics.pvaccess.client.ChannelProvider; import org.epics.pvaccess.client.ChannelProviderRegistry; import org.epics.pvaccess.client.ChannelProviderRegistryFactory; /** Singleton context for pvAccess * @author Kay Kasemir */ @SuppressWarnings("nls") public class PVA_Context { private static PVA_Context instance; final private ChannelProvider provider; private PVA_Context() throws Exception { ClientFactory.start(); final ChannelProviderRegistry registry = ChannelProviderRegistryFactory.getChannelProviderRegistry(); provider = registry.getProvider("pva"); if (provider == null) throw new Exception("Tried to locate 'pva' provider, found " + Arrays.toString(registry.getProviderNames())); Logger.getLogger(getClass().getName()).log(Level.CONFIG, "PVA Provider {0}", provider.getProviderName()); } /** @return Singleton instance */ public static synchronized PVA_Context getInstance() throws Exception { if (instance == null) instance = new PVA_Context(); return instance; } /** @return {@link ChannelProvider} */ public ChannelProvider getProvider() { return provider; } /** In tests, the context can be closed to check cleanup, * but operationally the singleton will remain open. */ public void close() { ClientFactory.stop(); } }
[ "kasemirk@ornl.gov" ]
kasemirk@ornl.gov
eff918bfd42257535f67786850ddc36d15ac80cf
5455cb795588916e525be7f91d5203e59b4380ea
/tools/core/src/main/java/org/jboss/mapper/model/ModelBuilder.java
f88eda9f223621a0f461083800e9db18e986839a
[ "Apache-2.0" ]
permissive
jewzaam/data-mapper
cb4d893e3125dc90474bef2ac56d8dd93ba9dd54
fb055312e5f484a4e3c8f3b190c91dfc046cd5c0
refs/heads/master
2021-01-17T01:50:24.998582
2014-12-18T22:00:38
2014-12-18T22:00:38
28,236,129
0
0
null
null
null
null
UTF-8
Java
false
false
4,230
java
/* * Copyright 2014 Red Hat Inc. and/or its affiliates and other 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 org.jboss.mapper.model; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Collection; import java.util.LinkedList; import java.util.List; public class ModelBuilder { public static Model fromJavaClass(Class<?> javaClass) { Model model = new Model(javaClass.getSimpleName(), javaClass.getName()); addFieldsToModel(getFields(javaClass), model); model.setModelClass(javaClass); return model; } public static Class<?> getFieldType(Field field) { Class<?> type; if (field.getType().isArray()) { return field.getType().getComponentType(); } else if (Collection.class.isAssignableFrom(field.getType())) { Type t = field.getGenericType(); if (t instanceof ParameterizedType) { type = (Class<?>)((ParameterizedType)t).getActualTypeArguments()[0]; } else { type = Object.class; } } else { type = field.getType(); } return type; } public static String getListName(Class<?> listType) { return "[" + listType.getName() + "]"; } public static String getListType(String listName) { return listName.split("\\[")[1].split("\\]")[0]; } private static void addFieldsToModel(List<Field> fields, Model model) { for (Field field : fields) { String fieldType; List<Field> childFields = null; boolean isCollection = false; if (field.getType().isArray()) { isCollection = true; fieldType = getListName(field.getType().getComponentType()); childFields = getFields(field.getType().getComponentType()); } else if (Collection.class.isAssignableFrom(field.getType())) { isCollection = true; Type t = field.getGenericType(); if (t instanceof ParameterizedType) { Class<?> tClass = (Class<?>)((ParameterizedType)t).getActualTypeArguments()[0]; fieldType = getListName(tClass); childFields = getFields(tClass); } else { fieldType = getListName(Object.class); } } else { fieldType = field.getType().getName(); if (!field.getType().isPrimitive() && !field.getType().getName().equals(String.class.getName()) && !field.getType().getName().startsWith("java.lang") && !Number.class.isAssignableFrom(field.getType())) { childFields = getFields(field.getType()); } } Model child = model.addChild(field.getName(), fieldType); child.setIsCollection(isCollection); if (childFields != null) { addFieldsToModel(childFields, child); } } } private static List<Field> getFields(Class<?> clazz) { LinkedList<Field> fields = new LinkedList<Field>(); getFields(clazz, fields); return fields; } private static void getFields(Class<?> clazz, List<Field> fields) { // check if we've hit rock bottom if (clazz == null || Object.class.equals(clazz)) { return; } for (Field field : clazz.getDeclaredFields()) { fields.add(field); } getFields(clazz.getSuperclass(), fields); } }
[ "kbabo@redhat.com" ]
kbabo@redhat.com
aff9a566951fd9da17247df419c816313913d283
777a85607ce615ffd4bbf70d241974ea40295f6d
/src/main/java/zollerngalaxy/biomes/oasis/BiomeRedlands.java
724e6a3be421b46acda7fa18002e26de7800fe33
[]
no_license
RedShakespeare/Zollern-Galaxy
98b1a59809cd650c88d10ca517f1e26cc52b6f38
2b113b13b415979310e4bd2d2da2289cad291645
refs/heads/master
2021-01-07T07:48:51.075801
2020-02-19T13:38:55
2020-02-19T13:38:55
241,624,795
0
0
null
2020-02-19T13:10:16
2020-02-19T13:10:16
null
UTF-8
Java
false
false
1,028
java
package zollerngalaxy.biomes.oasis; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import zollerngalaxy.blocks.ZGBlocks; import zollerngalaxy.core.enums.EnumBiomeTypeZG; public class BiomeRedlands extends BiomeOasisBase { public BiomeRedlands(BiomeProperties props) { super("redlands", props); props.setBaseHeight(1.5F); props.setHeightVariation(1.0F); props.setTemperature(4.0F); this.setTempCategory(TempCategory.MEDIUM); this.setTemp(4.0F); this.setBiomeHeight(62); this.setBiomeType(EnumBiomeTypeZG.LUSH); this.enableSnow = false; this.decorator.generateFalls = true; this.biomeDecor.waterLakesPerChunk = 1; this.grassFoliageColor = 0x9fcc8b; this.waterColor = 0x8b2cff; this.topBlock = ZGBlocks.oasisRock.getDefaultState(); this.fillerBlock = ZGBlocks.oasisGravel.getDefaultState(); this.stoneBlock = ZGBlocks.oasisStone; } @Override @SideOnly(Side.CLIENT) public int getSkyColorByTemp(float p_76731_1_) { return 0xff4f2e; } }
[ "admin@zollernverse.org" ]
admin@zollernverse.org
1992a6c9395a3d21e7e7326965c2cf0de94940d7
7e713646a0619267b421aafa41a9afeeaf7a0108
/src/main/java/com/gdztyy/inca/service/impl/PubCustomVarietyServiceImpl.java
fdce12863e15bc5c1384f1bf89c953f000e86816
[]
no_license
liutaota/ipl
4757e35d1100ca892f2137b690ee4b43b908dc19
9d53b9044ba56b6ea65f1347a779d4b66e075bea
refs/heads/master
2023-03-21T11:28:42.663574
2021-03-05T08:49:33
2021-03-05T08:49:33
344,747,852
0
0
null
null
null
null
UTF-8
Java
false
false
551
java
package com.gdztyy.inca.service.impl; import com.gdztyy.inca.entity.PubCustomVariety; import com.gdztyy.inca.mapper.PubCustomVarietyMapper; import com.gdztyy.inca.service.IPubCustomVarietyService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author peiqy * @since 2020-08-18 */ @Service public class PubCustomVarietyServiceImpl extends ServiceImpl<PubCustomVarietyMapper, PubCustomVariety> implements IPubCustomVarietyService { }
[ "liutao@qq.com" ]
liutao@qq.com
725a771aac567da337b94af6d2fda68e6f17e2a5
7b8fb3c97951cd4be702c820333d9bda505db060
/大数据/笔记/代码/1606Zebra-jobtracker/src/main/java/cn/tarena/zebra/file/FileCollector.java
52aea0437cec16ac5647993bce1ee08212b598fb
[]
no_license
pinggaimuir/Document
12d886d580efd95c0dc482a259fdc80bfc30585d
da91004811326d48b6cec6bbff3c8ea17042d15c
refs/heads/master
2021-01-01T16:42:04.122148
2018-05-11T08:41:54
2018-05-11T08:41:54
97,893,348
0
2
null
null
null
null
UTF-8
Java
false
false
1,251
java
package cn.tarena.zebra.file; import java.io.File; import cn.tarena.zebra.common.GlobalEnv; /** * 这个类是一个线程类,用于定期扫面指定目录下的日志文件 * 然后把日志文件放到队列里,供后续处理 * @author ysq * */ public class FileCollector implements Runnable{ @Override public void run() { try { while(true){ File dir=new File(GlobalEnv.getDir()); File[] files=dir.listFiles(); //要考虑到日志被扫描到之后,要做处理,避免重复扫描 //引入标识文件概念,扫描标识文件,根据标识文件找对应的日志文件 //当日志文件扫描后,将日志文件删除,这样能够避免重复扫描 for(File file:files){ if(file.getName().endsWith(".ctr")){ //103_20150615143630_00_00_000.csv String csvfilename=file.getName().split(".ctr")[0]+".csv"; //得到日志文件 File csvFile=new File(dir,csvfilename); //将日志文件存到队列里 GlobalEnv.getFileQueue().add(csvFile); //将标识文件删除掉 file.delete(); } } Thread.sleep(GlobalEnv.getScannningInterval()); } } catch (Exception e) { // TODO: handle exception } } }
[ "pinggaimuir@sina.com" ]
pinggaimuir@sina.com
19f8ed064889834d9a8f29a193fc060f407de510
0daf64ae6a724ef4d09e15cc9b9ec84c47ba13bd
/seasar2/s2-framework/src/test/java/org/seasar/framework/container/cooldeploy/creator/web/ccc/CccAction.java
ca31ab5f57fe4ae40c83408067c5348e48172b5b
[ "Apache-2.0" ]
permissive
gndpig/seasar2
0eeef17c22386e3a91c9018520e790e29e113846
28ad9a4925b0e601c09c842937ac2f3930d7c732
refs/heads/master
2020-12-26T01:49:45.057109
2016-03-02T02:59:24
2016-03-02T02:59:24
44,322,315
0
0
null
2015-10-15T14:17:27
2015-10-15T14:17:27
null
UTF-8
Java
false
false
845
java
/* * Copyright 2004-2015 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.framework.container.cooldeploy.creator.web.ccc; /** * @author koichik * */ public class CccAction extends DddAction { /** */ public DddAction ccc_dddAction; }
[ "koichik@improvement.jp" ]
koichik@improvement.jp
fa9c4ddb169cfad25896fbbe74cb516a1da050db
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
/rds/src/main/java/com/jdcloud/sdk/service/rds/client/EnableSSLExecutor.java
116b9e127d5ec8ee83cf46fbd9fc185e0fae9926
[ "Apache-2.0" ]
permissive
jdcloud-api/jdcloud-sdk-java
3fec9cf552693520f07b43a1e445954de60e34a0
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
refs/heads/master
2023-07-25T07:03:36.682248
2023-07-25T06:54:39
2023-07-25T06:54:39
126,275,669
47
61
Apache-2.0
2023-09-07T08:41:24
2018-03-22T03:41:41
Java
UTF-8
Java
false
false
1,407
java
/* * Copyright 2018 JDCLOUD.COM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http:#www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * 实例管理 * 实例管理相关接口 * * OpenAPI spec version: v1 * Contact: * * NOTE: This class is auto generated by the jdcloud code generator program. */ package com.jdcloud.sdk.service.rds.client; import com.jdcloud.sdk.client.JdcloudExecutor; import com.jdcloud.sdk.service.JdcloudResponse; import com.jdcloud.sdk.service.rds.model.EnableSSLResponse; /** * 开启数据库的加密连接, 同时会重启数据库实例 */ class EnableSSLExecutor extends JdcloudExecutor { @Override public String method() { return "POST"; } @Override public String url() { return "/regions/{regionId}/instances/{instanceId}/ssl:enableSSL"; } @Override public Class<? extends JdcloudResponse> returnType() { return EnableSSLResponse.class; } }
[ "tancong@jd.com" ]
tancong@jd.com
622f70006be77cc8feac3f26cf7739aa3dbc3084
0205999a193bf670cd9d6e5b37e342b75f4e15b8
/spring-test/src/test/java/org/springframework/mock/web/MockMultipartHttpServletRequestTests.java
8a0782d300b0e0be681c60d5c7944ec543a5dcaf
[ "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
4,106
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.mock.web; import org.junit.Test; import org.springframework.util.FileCopyUtils; import org.springframework.util.ObjectUtils; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; /** * @author Juergen Hoeller */ public class MockMultipartHttpServletRequestTests { @Test public void mockMultipartHttpServletRequestWithByteArray() throws IOException { MockMultipartHttpServletRequest request = new MockMultipartHttpServletRequest(); assertThat(request.getFileNames().hasNext()).isFalse(); assertThat(request.getFile("file1")).isNull(); assertThat(request.getFile("file2")).isNull(); assertThat(request.getFileMap().isEmpty()).isTrue(); request.addFile(new MockMultipartFile("file1", "myContent1".getBytes())); request.addFile(new MockMultipartFile("file2", "myOrigFilename", "text/plain", "myContent2".getBytes())); doTestMultipartHttpServletRequest(request); } @Test public void mockMultipartHttpServletRequestWithInputStream() throws IOException { MockMultipartHttpServletRequest request = new MockMultipartHttpServletRequest(); request.addFile(new MockMultipartFile("file1", new ByteArrayInputStream("myContent1".getBytes()))); request.addFile(new MockMultipartFile("file2", "myOrigFilename", "text/plain", new ByteArrayInputStream( "myContent2".getBytes()))); doTestMultipartHttpServletRequest(request); } private void doTestMultipartHttpServletRequest(MultipartHttpServletRequest request) throws IOException { Set<String> fileNames = new HashSet<>(); Iterator<String> fileIter = request.getFileNames(); while (fileIter.hasNext()) { fileNames.add(fileIter.next()); } assertThat(fileNames.size()).isEqualTo(2); assertThat(fileNames.contains("file1")).isTrue(); assertThat(fileNames.contains("file2")).isTrue(); MultipartFile file1 = request.getFile("file1"); MultipartFile file2 = request.getFile("file2"); Map<String, MultipartFile> fileMap = request.getFileMap(); List<String> fileMapKeys = new LinkedList<>(fileMap.keySet()); assertThat(fileMapKeys.size()).isEqualTo(2); assertThat(fileMap.get("file1")).isEqualTo(file1); assertThat(fileMap.get("file2")).isEqualTo(file2); assertThat(file1.getName()).isEqualTo("file1"); assertThat(file1.getOriginalFilename()).isEqualTo(""); assertThat(file1.getContentType()).isNull(); assertThat(ObjectUtils.nullSafeEquals("myContent1".getBytes(), file1.getBytes())).isTrue(); assertThat(ObjectUtils.nullSafeEquals("myContent1".getBytes(), FileCopyUtils.copyToByteArray(file1.getInputStream()))).isTrue(); assertThat(file2.getName()).isEqualTo("file2"); assertThat(file2.getOriginalFilename()).isEqualTo("myOrigFilename"); assertThat(file2.getContentType()).isEqualTo("text/plain"); assertThat(ObjectUtils.nullSafeEquals("myContent2".getBytes(), file2.getBytes())).isTrue(); assertThat(ObjectUtils.nullSafeEquals("myContent2".getBytes(), FileCopyUtils.copyToByteArray(file2.getInputStream()))).isTrue(); } }
[ "429243408@qq.com" ]
429243408@qq.com
b3a40b3d879cf872b20de8a9c26be995a77003c7
019edd34f4e9a6086a17f9dbc4606e08bb76557b
/io.reactivex.core/src/io/reactivex/core/internal/fuseable/SimplePlainQueue.java
eadf5b3c6a652bcdb4d1b825141e80c469fbd0c8
[ "Apache-2.0" ]
permissive
Prerna11082/rxjava
7f74c920789ac6486d1278b6e4f6a9d09935e900
2b5d4b55ad112d38a3599d4981fb2d35da6978f5
refs/heads/master
2020-04-06T13:29:23.714616
2018-11-21T17:46:04
2018-11-21T17:46:04
157,502,034
0
0
null
null
null
null
UTF-8
Java
false
false
954
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.core.internal.fuseable; import io.reactivex.common.annotations.Nullable; /** * Override of the SimpleQueue interface with no throws Exception on poll(). * * @param <T> the value type to offer and poll, not null */ public interface SimplePlainQueue<T> extends SimpleQueue<T> { @Nullable @Override T poll(); }
[ "sumersingh@PS-MacBook.local" ]
sumersingh@PS-MacBook.local
eb86e43101d9cf466237dca75848f892ed7d3201
52019a46c8f25534afa491a5f68bf5598e68510b
/core/metamodel/src/main/java/org/nakedobjects/metamodel/runtimecontext/noruntime/AuthenticationSessionNoRuntime.java
e92d051f0480d4790e291f7857a2bb74662bcf33
[ "Apache-2.0" ]
permissive
JavaQualitasCorpus/nakedobjects-4.0.0
e765b4980994be681e5562584ebcf41e8086c69a
37ee250d4c8da969eac76749420064ca4c918e8e
refs/heads/master
2023-08-29T13:48:01.268876
2020-06-02T18:07:23
2020-06-02T18:07:23
167,005,009
0
1
Apache-2.0
2022-06-10T22:44:43
2019-01-22T14:08:50
Java
UTF-8
Java
false
false
660
java
package org.nakedobjects.metamodel.runtimecontext.noruntime; import java.io.IOException; import org.nakedobjects.metamodel.authentication.AuthenticationSessionAbstract; import org.nakedobjects.metamodel.commons.encoding.DataInputExtended; import org.nakedobjects.metamodel.commons.encoding.DataInputStreamExtended; public class AuthenticationSessionNoRuntime extends AuthenticationSessionAbstract { private static final long serialVersionUID = 1L; public AuthenticationSessionNoRuntime() { super("metamodel", "dummy"); } public AuthenticationSessionNoRuntime(DataInputExtended input) throws IOException { super(input); } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
bd2402ad519771c3e007a2eba1112fc02d2fcf99
aaabffe8bf55973bfb1390cf7635fd00ca8ca945
/src/main/java/com/microsoft/graph/requests/extensions/WorkbookFunctionsTypeRequestBuilder.java
e2631ad0e1762859bd2f7c0741942256b20f9322
[ "MIT" ]
permissive
rgrebski/msgraph-sdk-java
e595e17db01c44b9c39d74d26cd925b0b0dfe863
759d5a81eb5eeda12d3ed1223deeafd108d7b818
refs/heads/master
2020-03-20T19:41:06.630857
2018-03-16T17:31:43
2018-03-16T17:31:43
137,648,798
0
0
null
2018-06-17T11:07:06
2018-06-17T11:07:05
null
UTF-8
Java
false
false
1,631
java
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.requests.extensions; import com.microsoft.graph.concurrency.*; import com.microsoft.graph.core.*; import com.microsoft.graph.models.extensions.*; import com.microsoft.graph.models.generated.*; import com.microsoft.graph.http.*; import com.microsoft.graph.requests.extensions.*; import com.microsoft.graph.requests.generated.*; import com.microsoft.graph.options.*; import com.microsoft.graph.serializer.*; import java.util.Arrays; import java.util.EnumSet; // This file is available for extending, afterwards please submit a pull request. /** * The class for the Workbook Functions Type Request Builder. */ public class WorkbookFunctionsTypeRequestBuilder extends BaseWorkbookFunctionsTypeRequestBuilder implements IWorkbookFunctionsTypeRequestBuilder { /** * The request builder for this WorkbookFunctionsType * * @param requestUrl the request URL * @param client the service client * @param requestOptions the options for this request * @param value the value */ public WorkbookFunctionsTypeRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends Option> requestOptions, final com.google.gson.JsonElement value) { super(requestUrl, client, requestOptions, value); } }
[ "caitbal@microsoft.com" ]
caitbal@microsoft.com
d034f5e0a690cf4b228dcd5b0b47d3bf1d11e88f
19809d0be46f6582a7802a773afc792868304942
/java9SrcStudy/src/java.corba/org/omg/PortableServer/CurrentPackage/NoContext.java
447122c36ce61ab4b8783318ecb3fdd0bf68f591
[]
no_license
jxxiangwen/JavaStudy
fa5194630a0c46d498d1a49acba8449fa4d447e9
fbf2accf3e9ec24b633ef26d2f3328e6b021d054
refs/heads/master
2022-12-21T20:46:04.447682
2019-09-02T09:35:27
2019-09-02T09:35:27
48,320,572
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
package org.omg.PortableServer.CurrentPackage; /** * org/omg/PortableServer/CurrentPackage/NoContext.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /scratch/HUDSON/workspace/9-2-build-linux-amd64-phase2/jdk9/6725/corba/src/java.corba/share/classes/org/omg/PortableServer/poa.idl * Thursday, August 3, 2017 3:57:54 AM UTC */ public final class NoContext extends org.omg.CORBA.UserException { public NoContext () { super(NoContextHelper.id()); } // ctor public NoContext (String $reason) { super(NoContextHelper.id() + " " + $reason); } // ctor } // class NoContext
[ "xiangwen.zou@ymm56.com" ]
xiangwen.zou@ymm56.com
24c423f0cd8838c1ca82be75ce118ee87a663045
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/67/org/apache/commons/math/complex/Complex_conjugate_167.java
aef238a9c221121513758049cc9deb4f41274089
[]
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,775
java
org apach common math complex represent complex number number real imaginari part implement arithmet oper handl code nan code infinit valu rule link java lang doubl arithmet appli definit formula return code nan code infinit valu real imaginari part aris comput individu method javadoc detail link equal identifi valu code nan code real imaginari part pre code nani nan nan nani code pre serializ version revis date complex field element fieldel complex serializ return conjug complex number conjug link nan return real imaginari part complex number equal code doubl nan code imaginari part infinit real part nan return infinit imaginari part opposit sign conjug code posit infin code code neg infin code conjug complex object complex conjug isnan nan creat complex createcomplex real imaginari
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
7a2e6be92b219938c163f0da380448679d885bf1
c8bf1df473f0a1cf5d4bd58e697570a6803790a6
/cpactf/src/test/java/ctf/jdo/tc7x/ColSortedSet.java
6a432fdd08fba4ce3c732e889f99685950dcc790
[]
no_license
j-white/hacked-castor
0adbe590c359fa5567856ea89e61541507800d76
6cd86a43f892643d15cfb089d34fc25cf49b6a69
refs/heads/master
2021-01-20T16:55:33.166799
2017-02-24T14:04:16
2017-02-24T14:04:16
82,838,036
0
1
null
2017-02-23T21:35:39
2017-02-22T18:20:40
Java
UTF-8
Java
false
false
3,275
java
/** * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 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. The name "Exolab" must not be used to endorse or promote * products derived from this Software without prior written * permission of Intalio, Inc. For written permission, * please contact info@exolab.org. * * 4. Products derived from this Software may not be called "Exolab" * nor may "Exolab" appear in their names without prior written * permission of Intalio, Inc. Exolab is a registered * trademark of Intalio, Inc. * * 5. Due credit should be given to the Exolab Project * (http://www.exolab.org/). * * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED 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 * INTALIO, INC. OR ITS 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. * * Copyright 2000 (C) Intalio, Inc. All Rights Reserved. * * $Id$ */ package ctf.jdo.tc7x; import java.util.Iterator; import java.util.SortedSet; import java.util.TreeSet; /** * Test object for different collection types. */ public final class ColSortedSet extends Col { private SortedSet _item; public boolean containsItem(final Item item) { return false; } public boolean containsItem(final ComparableItem item) { if ((_item == null) || (_item.size() == 0)) { return false; } return _item.contains(item); } public Iterator itemIterator() { if ((_item == null) || (_item.size() == 0)) { return EMPTY_ITORATOR; } return _item.iterator(); } public void addItem(final Item item) { } public void addItem(final ComparableItem item) { if (_item == null) { _item = new TreeSet(); } _item.add(item); item.setTestCol(this); } public void removeItem(final Item item) { } public void removeItem(final ComparableItem item) { if (_item != null) { _item.remove(item); item.setTestCol(null); } } public int itemSize() { if (_item == null) { return 0; } return _item.size(); } public void setItem(final SortedSet items) { _item = items; } public SortedSet getItem() { return _item; } }
[ "jesse@opennms.org" ]
jesse@opennms.org
4519a5651d7b6fbae01c8e172d1fa9402cf0dbd7
440784abe37ecd833cdea5de0b95e9f35396c7f4
/opensrp-immunization/src/test/java/org/smartregister/immunization/fragment/mock/DrishtiApplicationShadow.java
2cf803307e3eb5a65f5280d2825916c996220025
[]
no_license
Shankar1056/temperorary
331d768925ff0ddd65d32c30e0f6f4046b28543f
ede0afac24ab6e90c1e42640d9a719e805782b0b
refs/heads/master
2020-07-29T07:22:07.120250
2019-09-20T05:44:33
2019-09-20T05:44:33
209,713,604
0
0
null
null
null
null
UTF-8
Java
false
false
1,561
java
package org.smartregister.immunization.fragment.mock; import android.content.Context; import org.mockito.Mockito; import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; import org.robolectric.shadow.api.Shadow; import org.smartregister.repository.Repository; import org.smartregister.util.OpenSRPImageLoader; import org.smartregister.view.activity.DrishtiApplication; /** * Created by kaderchowdhury on 12/12/17. */ @Implements (DrishtiApplication.class) public class DrishtiApplicationShadow extends Shadow { private static OpenSRPImageLoader openSRPImageLoader; Repository repository; public DrishtiApplicationShadow() { super(); repository = Mockito.mock(Repository.class); } @Implementation public static OpenSRPImageLoader getCachedImageLoaderInstance() { openSRPImageLoader = Mockito.mock(OpenSRPImageLoader.class); // Mockito.doNothing().when(openSRPImageLoader).getImageByClientId(Mockito.anyString(),Mockito.any(OpenSRPImageListener.class)); return openSRPImageLoader; } @Implementation public void onCreate() { } @Implementation protected void attachBaseContext(Context base) { } @Implementation public Repository getRepository() { return repository; } @Implementation public String getPassword() { return ""; } @Implementation public void setPassword(String password) { } @Implementation public void logoutCurrentUser() { } }
[ "dayashankargupta86@gmail.com" ]
dayashankargupta86@gmail.com
a10914884ce8ee66b66fa810930065f893fef6a8
55dca62e858f1a44c2186774339823a301b48dc7
/code/my-app/functions/5/addDummyConnection_Server.java
de184970ad8e33b66525d7000c442d606c9bb082
[]
no_license
jwiszowata/code_reaper
4fff256250299225879d1412eb1f70b136d7a174
17dde61138cec117047a6ebb412ee1972886f143
refs/heads/master
2022-12-15T14:46:30.640628
2022-02-10T14:02:45
2022-02-10T14:02:45
84,747,455
0
0
null
2022-12-07T23:48:18
2017-03-12T18:26:11
Java
UTF-8
Java
false
false
148
java
public void addDummyConnection(Connection connection) { if (!this.running) return; this.connections.put(new Socket(), connection); }
[ "wiszowata.joanna@gmail.com" ]
wiszowata.joanna@gmail.com
d92c81eb0cbc7298dfac14b4e415df7a656b8cae
8592ba0914fdbd076048d9ee1481c9d263ef1e8a
/framework/java/implementations/java/org.hl7.fhir.dstu2016may/src/org/hl7/fhir/dstu2016may/model/codesystems/QicorePatientMilitaryService.java
9fac4d63f5bd2ec920e3e887f4531eb280886492
[]
no_license
HL7/UTG
a6f35d038b76f4bf172c453c95fe0ed67cb88889
cc0ed03ee9b576e6d22bfd3e3ea34d694abc9d5b
refs/heads/master
2023-08-04T12:13:53.870641
2023-07-25T15:45:21
2023-07-25T15:45:21
133,315,209
9
9
null
2023-09-07T17:39:11
2018-05-14T06:33:02
Java
UTF-8
Java
false
false
5,182
java
package org.hl7.fhir.dstu2016may.model.codesystems; /* Copyright (c) 2011+, HL7, Inc. 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 HL7 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 HOLDER 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. */ // Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 import org.hl7.fhir.exceptions.FHIRException; public enum QicorePatientMilitaryService { /** * The military status is not indicated */ NOTINDICATED, /** * The subject has no history of military service */ NOMILITARYSERVICE, /** * The subject is has served in the military but is no longer active */ VETERAN, /** * The subject is not a reserve member and is currently engaged in full-time military activity */ ACTIVEDUTY, /** * The subject is a reserve member and is currently engaged in full-time military activity */ ACTIVERESERVE, /** * The subject is a reserve member and is not currently engaged in full-time military activity */ INACTIVERESERVE, /** * added to help the parsers */ NULL; public static QicorePatientMilitaryService fromCode(String codeString) throws FHIRException { if (codeString == null || "".equals(codeString)) return null; if ("not-indicated".equals(codeString)) return NOTINDICATED; if ("no-military-service".equals(codeString)) return NOMILITARYSERVICE; if ("veteran".equals(codeString)) return VETERAN; if ("active-duty".equals(codeString)) return ACTIVEDUTY; if ("active-reserve".equals(codeString)) return ACTIVERESERVE; if ("inactive-reserve".equals(codeString)) return INACTIVERESERVE; throw new FHIRException("Unknown QicorePatientMilitaryService code '"+codeString+"'"); } public String toCode() { switch (this) { case NOTINDICATED: return "not-indicated"; case NOMILITARYSERVICE: return "no-military-service"; case VETERAN: return "veteran"; case ACTIVEDUTY: return "active-duty"; case ACTIVERESERVE: return "active-reserve"; case INACTIVERESERVE: return "inactive-reserve"; default: return "?"; } } public String getSystem() { return "http://hl7.org/fhir/qicore-military-service"; } public String getDefinition() { switch (this) { case NOTINDICATED: return "The military status is not indicated"; case NOMILITARYSERVICE: return "The subject has no history of military service"; case VETERAN: return "The subject is has served in the military but is no longer active"; case ACTIVEDUTY: return "The subject is not a reserve member and is currently engaged in full-time military activity"; case ACTIVERESERVE: return "The subject is a reserve member and is currently engaged in full-time military activity"; case INACTIVERESERVE: return "The subject is a reserve member and is not currently engaged in full-time military activity"; default: return "?"; } } public String getDisplay() { switch (this) { case NOTINDICATED: return "Not Indicated"; case NOMILITARYSERVICE: return "No Military Service"; case VETERAN: return "Veteran"; case ACTIVEDUTY: return "Active Duty"; case ACTIVERESERVE: return "Active Reserve"; case INACTIVERESERVE: return "Inactive Reserve"; default: return "?"; } } }
[ "ywang@imo-online.com" ]
ywang@imo-online.com
91308d1668dd949511330829361128ff0e6a4921
1327601033c4e0b695459770a39a7eb99e3e842b
/src/learn/threadJoin/ThreadJoinLearn.java
d989297dd184231586e6aae3f1f2d194e5b24afb
[]
no_license
Appetence/Thread
c49e7e7a0ff3876c6601e4989053fede6ceb2a99
325f4a39107011efb2c6d6002158106b6c0be7d7
refs/heads/master
2023-05-05T03:40:08.004718
2023-04-24T03:08:18
2023-04-24T03:08:18
246,775,081
2
0
null
null
null
null
UTF-8
Java
false
false
2,862
java
package learn.threadJoin; import java.util.concurrent.locks.LockSupport; import java.util.concurrent.locks.ReentrantLock; /** * @program: Thread * @description: * @author: liuhao * @date: 2022-07-11 16:31 */ public class ThreadJoinLearn { public static void delay() { int j = 1; for (int i = 0; i < 10; i++) { j = j + i; try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } static Thread thread2 = null; static Thread thread = null; public static void main(String[] args) { thread = new Thread(() -> { for (int i = 0; i < 10; i++) { delay(); System.out.println("t2 线程状态" + thread2.getState()); n(); System.out.println("t1 运行结束"); } }); thread2 = new Thread(() -> { for (int i = 0; i < 10; i++) { delay(); System.out.println("t1 线程状态" + thread.getState()); try { /** * thread.join() * thread优先执行 thread2 进入waiting状态 * 底层为wait 阻塞的是当前线程 */ thread.join(); // w(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("t2 运行结束"); } }); thread.setName("thread1"); thread2.setName("thread2"); thread2.start(); thread.start(); } private static void n() { // 想要唤醒需要用wait sync中lock的对账进行操作 synchronized (thread2) { System.out.println("开始notify"); thread2.notifyAll(); System.out.println("结束notify"); } } private static void w() throws InterruptedException { synchronized (thread2) { System.out.println("开始sleep"); // 必须拥有锁,wait会释放获取到的锁 thread2.wait(); // sleep无法被notify唤醒,因为不会释放 // Thread.sleep(10000); System.out.println("结束sleep"); } /** * // IllegalMonitorStateException *ReentrantLock reentrantLock = new ReentrantLock(); *try { *reentrantLock.lock(); *thread2.wait(); *} finally { *reentrantLock.unlock(); *} */ /* LockSupport reentrantLock = new LockSupport(); try { reentrantLock.lock(); thread2.wait(); } finally { reentrantLock.unlock(); }*/ } }
[ "15834260040@163.com" ]
15834260040@163.com
1d545b84c6fa86a18813517adc779982e6438a20
a26ec63279caad0dd0f57120f10440bbd3645ba4
/tradelinkbundle/src/main/java/com/yunos/tvtaobao/tradelink/buildorder/view/AddressEditRelativeLayout.java
47d2c2bff448785ee216adbbe667a4c130115dd2
[]
no_license
P79N6A/tvtao
6b0af50a878e882ad2c0da399a0a8c0304394dff
4943116ec8cfb946b85cbfea9641e87834e675ed
refs/heads/master
2020-04-25T15:27:50.798979
2019-02-27T08:55:16
2019-02-27T08:55:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,280
java
package com.yunos.tvtaobao.tradelink.buildorder.view; import android.content.Context; import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.RelativeLayout; import com.yunos.tv.app.widget.focus.FocusLinearLayout; import com.yunos.tv.app.widget.focus.listener.ItemListener; import com.yunos.tv.app.widget.focus.params.FocusRectParams; public class AddressEditRelativeLayout extends RelativeLayout implements ItemListener { public AddressEditRelativeLayout(Context context) { super(context); } public AddressEditRelativeLayout(Context context, AttributeSet attrs) { super(context, attrs); } public AddressEditRelativeLayout(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override public boolean isScale() { return false; } @Override public FocusRectParams getFocusParams() { Rect focuse = getFocusedRect(); FocusRectParams focusRectParams = new FocusRectParams(focuse, 0.5f, 0.5f); return focusRectParams; } @Override public int getItemWidth() { return getWidth(); } @Override public int getItemHeight() { return getHeight(); } @Override public Rect getManualPadding() { return null; } @Override public void drawBeforeFocus(Canvas canvas) { } @Override public void drawAfterFocus(Canvas canvas) { } @Override public boolean isFinished() { return true; } private Rect getFocusedRect() { Rect r = new Rect(); ViewGroup root = (ViewGroup) getThisChildRootView(); r.left = 0; r.top = 0; r.right = root.getWidth(); r.bottom = root.getHeight(); // root.getFocusedRect(r); return r; } public View getThisChildRootView() { View parent = this; while (parent.getParent() != null && parent.getParent() instanceof View) { parent = (View) parent.getParent(); if (parent instanceof FocusLinearLayout) { break; } } return parent; } }
[ "wb-wht434871@alibaba-inc.com" ]
wb-wht434871@alibaba-inc.com
675bbeb1a32b53db703daa30fd53d5c9f537cf95
9dfb06fb888a7f5d79f590eb11f62618d893af93
/hashmap/567. Permutation in String.java
330b1caa538ea2f6984d1d5a3aacd8bbbbb0672a
[]
no_license
fanyang88/leetcode_java
ac1b009d2ae374a4a87c92610820af391ec530b8
73e145a7f8f5f76c1159e622ccc2c8f6ffa53f48
refs/heads/master
2022-07-20T00:47:04.826563
2022-07-18T22:25:37
2022-07-18T22:25:37
163,878,007
1
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
/* Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string. Example 1: Input:s1 = "ab" s2 = "eidbaooo" Output:True Explanation: s2 contains one permutation of s1 ("ba"). Example 2: Input:s1= "ab" s2 = "eidboaoo" Output: False Note: The input strings only contain lower case letters. The length of both given strings is in range [1, 10,000]. */ /* We can abstract all permutation strings of s to a map (Character -> Count). i.e. abba -> {a:2, b:2}. Since there are only 26 lower case letters in this problem, we can just use an array to represent the map. How do we know string s2 contains a permutation of s1? We just need to create a sliding window with length of s1, move from beginning to the end of s2. When a character moves in from right of the window, we subtract 1 to that character count from the map. When a character moves out from left of the window, we add 1 to that character count. So once we see all zeros in the map, meaning equal numbers of every characters between s1 and the substring in the sliding window, we know the answer is true. e.g: s1 = "ab" s2 = "eidbaooo" map= {a: 1, b:1} e: map {a: 1, b:1, e:-1} i: map {a: 1, b:1, e:-1, i: -1} d: map {a: 1, b:1, e:0, i: -1, d:-1} e move out b: map {a: 1, b:0, e:0, i: 0, d:-1} i move out a: map {a: 0, b:0, e:0, i: 0, d:0} d move out - all zero, so it is true o: map {a: 0, b:1, e:0, i: 0, d:0, o:-1} b move out o: map {a: 1, b:1, e:0, i: 0, d:0: o: -2} a move out o: map {a: 1, b:1, e:0, i: 0, d:0: o: -1} o move out The key is to find a window size s contains all chars in s1 */ class Solution { public boolean checkInclusion(String s1, String s2) { int[] map = new int[26]; int k = s1.length(); for(char c: s1.toCharArray()) map[c-'a'] ++; for(int i=0; i<s2.length(); i++) { map[s2.charAt(i) -'a'] --; if(i >= k) { // move out the first in the window map[s2.charAt(i-k) -'a'] ++; } if(allZero(map)) return true; } return false; } public boolean allZero(int[] map) { for(int i=0; i<26; i++) { if(map[i] !=0) return false; } return true; } }
[ "fan.yang@oath.com" ]
fan.yang@oath.com
565074284b2bfdd7d77dbff376aa106832d02d19
4f75a12e637e1ca5a31e1a14524747262e280efa
/intellij/org.eclipse.xtext.idea.common.types.tests/src/org/eclipse/xtext/idea/common/types/idea/RefactoringTestLanguageIdeaModule.java
3b0d2591cd4364c4e4c624a295651836da2b073b
[]
no_license
tokuty/xtext
c2660b24779a65a3f5c4b33e6201fba2bac7e365
0e6c37339c08efe6a0655ab15d82b4f9780bec70
refs/heads/master
2020-02-26T17:37:03.837733
2014-12-23T15:12:39
2014-12-23T15:12:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package org.eclipse.xtext.idea.common.types.idea; public class RefactoringTestLanguageIdeaModule extends AbstractRefactoringTestLanguageIdeaModule { }
[ "anton.kosyakov@itemis.de" ]
anton.kosyakov@itemis.de
235b3185bc6a1e1db138825cd2a96181483120e2
c2d8181a8e634979da48dc934b773788f09ffafb
/storyteller/output/keionbu/SetIntraUserUtnAction.java
8fae187882c43d9ab22ddfa5637d0ca26fdb5ca3
[]
no_license
toukubo/storyteller
ccb8281cdc17b87758e2607252d2d3c877ffe40c
6128b8d275efbf18fd26d617c8503a6e922c602d
refs/heads/master
2021-05-03T16:30:14.533638
2016-04-20T12:52:46
2016-04-20T12:52:46
9,352,300
0
0
null
null
null
null
UTF-8
Java
false
false
1,637
java
package net.keionbu.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.keionbu.model.*; import net.keionbu.model.crud.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.hibernate.Criteria; import org.hibernate.Transaction; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.SessionFactory; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.BeanFactory; import org.springframework.web.context.support.WebApplicationContextUtils; import net.enclosing.util.HibernateSession; import net.enclosing.util.HTTPGetRedirection; public class SetIntraUserUtnAction extends Action{ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception{ Session session = new HibernateSession().currentSession(this .getServlet().getServletContext()); Transaction transaction = session.beginTransaction(); Criteria criteria = session.createCriteria(IntraUser.class); criteria.add(Restrictions.idEq(Integer.valueOf(req.getParameter("id")))); IntraUser intraUser = (IntraUser) criteria.uniqueResult(); intraUser.setUtn(true); session.saveOrUpdate(intraUser); transaction.commit(); session.flush(); new HTTPGetRedirection(req, res, "IntraUsers.do", intraUser.getId().toString()); return null; } }
[ "toukubo@gmail.com" ]
toukubo@gmail.com
f2bcec40b319b02105c1c732a39a73e2e44286c9
afcc736dcb3bb07ac8f75e1c1246bd2953e91a70
/mall-third-party/src/test/java/com/sour/mall/thirdparty/MallThirdPartyApplicationTests.java
0c566c230b72705f2b49592929f6cf82d1c500e5
[]
no_license
Sourlun/mail-springCloud
2b94ad5b1cb384f349c43fa5c1c71e36d5bf7555
6770cf3c93e50f2ba799ad5df7f9e77b7a0fa38a
refs/heads/master
2023-04-18T14:10:53.724733
2021-05-09T12:06:24
2021-05-09T12:06:24
339,382,321
0
0
null
null
null
null
UTF-8
Java
false
false
1,231
java
package com.sour.mall.thirdparty; import com.aliyun.oss.OSS; import com.aliyun.oss.OSSClient; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; @SpringBootTest class MallThirdPartyApplicationTests { @Autowired OSS ossClient; /** * 阿里云文件上传 新 * 说明: https://github.com/alibaba/aliyun-spring-boot/tree/master/aliyun-spring-boot-samples/aliyun-oss-spring-boot-sample * spring cloud-mall 62个视频有解释 * * @author xgl * @date 2021/3/7 12:55 **/ @Test void uploadNew() throws FileNotFoundException { InputStream inputStream = new FileInputStream("D:\\Users\\SourLun\\Pictures\\20181120141017_37530.jpg"); // 填写Bucket名称和Object完整路径。Object完整路径中不能包含Bucket名称。 Bucket:存储空间 ossClient.putObject("sour-mall", "20181120141017_37530.jpg", inputStream); // 关闭OSSClient。 ossClient.shutdown(); System.out.println("上传成功!"); } }
[ "1141837289@qq.com" ]
1141837289@qq.com
7a6dad1794f9d8dd0d76fb3b117ce1cc89e55e2d
e4c22ea38a84eabd1fcbfb35301eff3f7a034da0
/Communicatie/src/main/java/nl/lakedigital/djfc/inloggen/Sessie.java
df1acc3e95afbd7f1d52f848147e3866f3526ce7
[]
no_license
pheidotting/symplex
36ae4a6ce61d172f622e703af4a47abb25608d87
3cafb5730f4d8c907f9f5b3c8388ab82b854f444
refs/heads/development
2021-07-13T07:44:54.437965
2018-12-11T18:11:34
2018-12-11T18:11:34
109,175,311
0
0
null
2018-12-11T18:47:25
2017-11-01T19:37:16
Java
UTF-8
Java
false
false
774
java
package nl.lakedigital.djfc.inloggen; import javax.servlet.http.HttpServletRequest; public final class Sessie { private Sessie() { } // Zodat Hibernate Envers deze uit kan lezen.. private static Long ingelogdeGebruiker; public static Long getIngelogdeGebruiker() { return ingelogdeGebruiker; } public static void setIngelogdeGebruiker(Long ingelogdeGebruiker) { Sessie.ingelogdeGebruiker = ingelogdeGebruiker; } public static void setIngelogdeGebruiker(HttpServletRequest httpServletRequest) { String ingelogdeGebruiker = httpServletRequest.getHeader("ingelogdeGebruiker"); if (ingelogdeGebruiker != null) { Sessie.ingelogdeGebruiker = Long.valueOf(ingelogdeGebruiker); } } }
[ "patrick@lakedigital.nl" ]
patrick@lakedigital.nl
0d989d3d5fc5c27e8840bdbd614def1772d5cc64
451ab328b09d3320c3b741efec116dc405939828
/TLint/app/src/main/java/com/gzsll/hupu/ui/account/AccountActivity.java
07e6435592db448c867a14097e2e3b984fbd7092
[ "Apache-2.0" ]
permissive
luoshihai/package
af9fa84100b6997cfc3559fdcadbf98663e73f36
4e837bbc858083f081720fb46ac5ae2742cb8e3a
refs/heads/master
2020-03-24T17:09:34.855173
2018-07-30T09:08:36
2018-07-30T09:08:36
142,851,008
0
0
null
null
null
null
UTF-8
Java
false
false
3,028
java
package com.gzsll.hupu.ui.account; import android.app.Activity; import android.content.Intent; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import com.gzsll.hupu.R; import com.gzsll.hupu.db.User; import com.gzsll.hupu.ui.BaseSwipeBackActivity; import java.util.List; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by sll on 2016/3/10. */ public class AccountActivity extends BaseSwipeBackActivity implements AccountContract.View, AccountAdapter.OnItemClickListener { public static void startActivity(Activity mActivity) { Intent intent = new Intent(mActivity, AccountActivity.class); mActivity.startActivity(intent); } @Inject AccountPresenter mPresenter; @Inject AccountAdapter mAdapter; @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.recyclerView) RecyclerView recyclerView; @Override public int initContentView() { return R.layout.activity_account; } @Override public void initInjector() { DaggerAccountComponent.builder() .applicationComponent(getApplicationComponent()) .activityModule(getActivityModule()) .accountModule(new AccountModule()) .build() .inject(this); } @Override public void initUiAndListener() { ButterKnife.bind(this); mPresenter.attachView(this); initToolBar(toolbar); setTitle("账号管理"); LinearLayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); recyclerView.setAdapter(mAdapter); mAdapter.setOnItemClickListener(this); } @Override protected boolean isApplyStatusBarTranslucency() { return true; } @Override protected boolean isApplyStatusBarColor() { return true; } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_account, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { // if (item.getItemId() == R.id.action_add) { // LoginActivity.startActivity(this); // finish(); // } return super.onOptionsItemSelected(item); } @Override public void renderUserList(List<User> users) { mAdapter.bind(users); } @Override protected void onDestroy() { super.onDestroy(); mPresenter.detachView(); } @Override public void onAccountItemDelClicked(User user) { mPresenter.onAccountDelClick(user); } @Override public void onAccountItemClicked(User user) { mPresenter.onAccountClick(user); mPresenter.onAccountClick(user); } }
[ "1206327668@qq.com" ]
1206327668@qq.com
3baafd9fa5816381d4c1daeb2a2887b39c19ff7e
6500848c3661afda83a024f9792bc6e2e8e8a14e
/output/com.google.android.finsky.av.b.java
ac7c4fe082d6c3ed62d618a40033e3aa370376ca
[]
no_license
enaawy/gproject
fd71d3adb3784d12c52daf4eecd4b2cb5c81a032
91cb88559c60ac741d4418658d0416f26722e789
refs/heads/master
2021-09-03T03:49:37.813805
2018-01-05T09:35:06
2018-01-05T09:35:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.google.android.finsky.av; import android.view.View; import com.google.android.finsky.d.ad; import com.google.android.finsky.d.d; import com.google.android.finsky.d.w; import com.google.android.finsky.installer.k; public final class com.google.android.finsky.av.b implements View$OnClickListener { public final com.google.android.finsky.d.w a; public final com.google.android.finsky.d.ad b; public final com.google.android.finsky.installer.k c; public final String d; public final View e; b(com.google.android.finsky.d.w p0, com.google.android.finsky.d.ad p1, com.google.android.finsky.installer.k p2, String p3, View p4) { this.a = p0; this.b = p1; this.c = p2; this.d = p3; this.e = p4; } public final void onClick(View p0) { this.a.b(new com.google.android.finsky.d.d(this.b).a(2911)); this.c.p(this.d); this.e.setVisibility(8); } }
[ "genius.ron@gmail.com" ]
genius.ron@gmail.com
50bc4ab9f6e3ed07a5f7d74fe36ec1817bb0d888
0b95a85deaf1c9fade3e2a5af2e816a5b00607a4
/tempcode/src/main/java/commons/mongodb/service/IMongoDbConnectService.java
24cfb061bee40ba82e70d11e1b5b599301eb19e3
[]
no_license
liwen666/lw_code
6009fb1a83ad74c987a5e58937c3a178537094b0
6fb3f4373fdf1363938ee4f30b39c9fd17c8a8d7
refs/heads/master
2020-04-09T22:58:38.355751
2019-04-25T07:37:52
2019-04-25T07:37:52
160,643,842
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
package commons.mongodb.service; import org.springframework.data.mongodb.core.MongoTemplate; public interface IMongoDbConnectService { public MongoTemplate mongoDbConnect(); }
[ "1316138287@qq.com" ]
1316138287@qq.com
04b447be2c4f0e0b99db7e0cf48296d307735cce
0d99dc277b469b474a238a9bd5c505c86cfdd80e
/src/headfirstjava/chapter_13/Button1.java
5331f22fd778ff72e697d2ddf87941b4f9838a90
[]
no_license
Borislove/Books
fa93d05274315b9440ae66c2c5a2109ef55f2a1e
248c1b4ca743c860c34c3eed3543d116f0c2a308
refs/heads/master
2023-01-23T16:03:18.683669
2023-01-18T23:42:52
2023-01-18T23:42:52
254,092,418
1
0
null
null
null
null
UTF-8
Java
false
false
999
java
package headfirstjava.chapter_13; import javax.swing.*; import java.awt.*; public class Button1 { public static void main(String[] args) { Button1 gui = new Button1(); gui.go(); } public void go() { JFrame frame = new JFrame(); //1 /*JButton button = new JButton("click me click me click me"); //займет ширину frame.getContentPane().add(BorderLayout.EAST, button);*/ //2 /*JButton button = new JButton("click me click me click me"); //займет ширину frame.getContentPane().add(BorderLayout.NORTH, button);*/ JButton button = new JButton("Click This!"); //займет ширину Font bigFont = new Font("serif",Font.BOLD,28); button.setFont(bigFont); frame.getContentPane().add(BorderLayout.NORTH, button); frame.setSize(200, 200); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.setVisible(true); } }
[ "abirme@yandex.ru" ]
abirme@yandex.ru
9c8dfc3b30364e37e5a25099758435dc7ceeb53c
bcaa1a733700b8be816982c239d9079fa8c334b7
/eu.openanalytics.phaedra.ui.curve/src/eu/openanalytics/phaedra/ui/curve/grid/GridColumnGroup.java
934c2baa7fa5354c0c45a08db24256888cbabffd
[]
no_license
openanalytics/phaedra
dfb16cc300d0d90ca9eab233068207452d458040
2b0b79000bfcac311072b91f31eb196b08d294fe
refs/heads/master
2020-12-31T07:01:38.108586
2020-12-16T12:30:35
2020-12-16T12:30:35
58,546,934
16
4
null
null
null
null
UTF-8
Java
false
false
363
java
package eu.openanalytics.phaedra.ui.curve.grid; public class GridColumnGroup { private String name; private int[] columns; public GridColumnGroup(String name, int[] columns) { this.name = name; this.columns = columns; } public String getGroupName() { return name; } public int[] getGroupColumns() { return columns; } }
[ "tobias.verbeke@openanalytics.eu" ]
tobias.verbeke@openanalytics.eu
d9a3224ef570d9f9e15f5efcf1c988ad758f8c1d
333595f031dd7bc736f63ea6ed6d24538d8c186d
/webx/turbine/src/main/java/com/alibaba/citrus/turbine/pipeline/valve/RenderTemplateValve.java
eaf7ae301afdddc3e43604c1326ac1ed7816d00f
[ "Apache-2.0" ]
permissive
iamacnhero/citrus
81e0ab8a3f9ae32c47ecbd62cde2be6e89cb4f0d
f989dd526ad11cf7843dfcf2e10cee4e12daf181
refs/heads/master
2022-04-17T20:00:45.850226
2020-03-07T02:49:20
2020-03-07T02:49:20
103,656,833
0
0
null
null
null
null
UTF-8
Java
false
false
4,331
java
/* * Copyright (c) 2002-2012 Alibaba Group Holding Limited. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.citrus.turbine.pipeline.valve; import static com.alibaba.citrus.turbine.TurbineConstant.*; import static com.alibaba.citrus.turbine.util.TurbineUtil.*; import static com.alibaba.citrus.util.Assert.*; import static com.alibaba.citrus.util.BasicConstant.*; import static com.alibaba.citrus.util.ObjectUtil.*; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import com.alibaba.citrus.service.mappingrule.MappingRuleService; import com.alibaba.citrus.service.pipeline.PipelineContext; import com.alibaba.citrus.service.pipeline.support.AbstractValve; import com.alibaba.citrus.service.pipeline.support.AbstractValveDefinitionParser; import com.alibaba.citrus.service.requestcontext.buffered.BufferedRequestContext; import com.alibaba.citrus.service.template.TemplateException; import com.alibaba.citrus.service.template.TemplateService; import com.alibaba.citrus.turbine.Context; import com.alibaba.citrus.turbine.TurbineRunDataInternal; import com.alibaba.citrus.turbine.support.ContextAdapter; import org.springframework.beans.factory.annotation.Autowired; /** * 渲染模板。 * * @author Michael Zhou */ public class RenderTemplateValve extends AbstractValve { @Autowired private BufferedRequestContext bufferedRequestContext; @Autowired private HttpServletRequest request; @Autowired private TemplateService templateService; @Autowired private MappingRuleService mappingRuleService; public void invoke(PipelineContext pipelineContext) throws Exception { TurbineRunDataInternal rundata = (TurbineRunDataInternal) getTurbineRunData(request); String target = assertNotNull(rundata.getTarget(), "Target was not specified"); // 检查重定向标志,如果是重定向,则不需要将页面输出。 if (!rundata.isRedirected()) { Context context = rundata.getContext(); renderTemplate(getScreenTemplate(target), context, rundata); // layout可被禁用。 if (rundata.isLayoutEnabled() && bufferedRequestContext.isBuffering()) { String layoutTemplateOverride = rundata.getLayoutTemplateOverride(); if (layoutTemplateOverride != null) { target = layoutTemplateOverride; } String layoutTemplate = getLayoutTemplate(target); if (templateService.exists(layoutTemplate)) { String screenContent = defaultIfNull(bufferedRequestContext.popCharBuffer(), EMPTY_STRING); context.put(SCREEN_PLACEHOLDER_KEY, screenContent); renderTemplate(layoutTemplate, context, rundata); } } } pipelineContext.invokeNext(); } protected String getScreenTemplate(String target) { return mappingRuleService.getMappedName(SCREEN_TEMPLATE, target); } protected String getLayoutTemplate(String target) { return mappingRuleService.getMappedName(LAYOUT_TEMPLATE, target); } protected void renderTemplate(String templateName, Context context, TurbineRunDataInternal rundata) throws TemplateException, IOException { rundata.pushContext(context); try { templateService.writeTo(templateName, new ContextAdapter(context), rundata.getResponse().getWriter()); } finally { rundata.popContext(); } } public static class DefinitionParser extends AbstractValveDefinitionParser<RenderTemplateValve> { } }
[ "yizhi@taobao.com" ]
yizhi@taobao.com
453a2876770164857ad3dff737c468bbff23c5a9
87824f73929b4e17a6ce61fb76d639b34345be50
/bpjs-common/src/main/java/id/co/pegadaian/simulator/entity/Pembayaran.java
ae3d8b7cf7125c51149ce397dddf9091d0283f7c
[]
no_license
tedisetiawan/training-pegadaian-2015-03
db68743d523c0860a002fbd48fd49bb1b2509d33
4e0fe8affe32d0b637c694a7a06c4baf7e5c6bff
refs/heads/master
2021-01-15T21:45:21.041006
2015-03-31T09:35:45
2015-03-31T09:35:45
35,461,735
0
1
null
2015-05-12T02:20:20
2015-05-12T02:20:20
null
UTF-8
Java
false
false
1,825
java
package id.co.pegadaian.simulator.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import org.hibernate.annotations.GenericGenerator; @Entity @Table(name = "pembayaran") public class Pembayaran { @Id @GeneratedValue(generator = "uuid") @GenericGenerator(name = "uuid", strategy = "uuid2") private String id; @OneToOne @JoinColumn(name = "id_tagihan", nullable = false) private Tagihan tagihan; @Temporal(TemporalType.TIMESTAMP) @Column(nullable = false, name = "waktu_transaksi") private Date waktuTransaksi = new Date(); @Column(nullable = false, name = "user_loket") private String userLoket; @Column(nullable = false, name = "kode_loket") private String kodeLoket; public String getId() { return id; } public void setId(String id) { this.id = id; } public Tagihan getTagihan() { return tagihan; } public void setTagihan(Tagihan tagihan) { this.tagihan = tagihan; } public Date getWaktuTransaksi() { return waktuTransaksi; } public void setWaktuTransaksi(Date waktuTransaksi) { this.waktuTransaksi = waktuTransaksi; } public String getUserLoket() { return userLoket; } public void setUserLoket(String userLoket) { this.userLoket = userLoket; } public String getKodeLoket() { return kodeLoket; } public void setKodeLoket(String kodeLoket) { this.kodeLoket = kodeLoket; } }
[ "endy.muhardin@gmail.com" ]
endy.muhardin@gmail.com
9f1d949cd5af973ca8a01a45835493a274e7b044
31fb1748f763f6f96eb148545216b5b434504d62
/src/sun/natee/app/db/Database.java
9f7704b515e66e256357fd4d6e454c138bfb0071
[]
no_license
nateesoft/ExpenseNote
75d77e6180563bc1dd7373807888b30f67f13272
d70cea8d17d2c066c13c332e1dcbd291bc60d02a
refs/heads/master
2022-11-09T18:00:25.127865
2020-06-22T14:07:19
2020-06-22T14:07:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,601
java
package sun.natee.app.db; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import org.apache.log4j.Logger; import sun.natee.app.AppConstants; import sun.natee.app.main.util.AppUI; import sun.natee.app.main.util.MsgUtil; public class Database { private static Connection conn = null; private static final Logger logger = Logger.getLogger(Database.class); public static Connection getConnect() { if (conn == null) { try { Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance(); conn = DriverManager.getConnection("jdbc:derby:" + AppUI.DATA_DB + ";create=true;user=app;password=app"); // conn = DriverManager.getConnection("jdbc:derby:" + AppUI.DATA_DB + ";upgrade=true;user=app;password=app"); return conn; } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | SQLException e) { } } return conn; } public static boolean isTableExists(String tableName) throws SQLException { return Database.getConnect().getMetaData().getTables(null, null, tableName.toUpperCase(), null).next(); } public static boolean dropTable(String tableName) throws SQLException { return Database.getConnect().createStatement().execute("drop table " + tableName); } public static boolean execute(String sql) throws SQLException { return Database.getConnect().createStatement().execute(sql); } public static void initTable(String tableName) { Statement stmt; try { stmt = Database.getConnect().createStatement(); String sql; if (tableName.equalsIgnoreCase(AppConstants.TABLE_EXPENSE)) { sql = "CREATE TABLE " + tableName + " (" + "id INT not null primary key GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," + "date date, " + "time varchar(10), " + "incomeAmt decimal(10,2), " + "outcomeAmt decimal(10,2), " + "totalAmt decimal(10,2), " + "descript varchar(250), " + "username varchar(150), " + "place varchar(150) " + ")"; if (!isTableExists(tableName)) { logger.debug(sql); stmt.execute(sql); MsgUtil.printLog("create table " + tableName + " already."); } } else if (tableName.equalsIgnoreCase(AppConstants.TABLE_POPUP_DESC)) { sql = "CREATE TABLE " + tableName + " (" + "id INT not null primary key GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," + "item_desc varchar(255), " + "item_type varchar(100) " + ")"; if (!isTableExists(tableName)) { logger.debug(sql); stmt.execute(sql); MsgUtil.printLog("create table " + tableName + " already."); } } else if (tableName.equalsIgnoreCase(AppConstants.TABLE_SCHEDULE)) { sql = "CREATE TABLE " + tableName + " (" + "id INT not null primary key GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," + "item_desc varchar(255), " + "item_type varchar(100), " + "month_date varchar(20), " + "year_date varchar(20), " + "end_month varchar(50), " + "holidy_skip varchar(50), " + "month_at int, " + "before_deadline varchar(1), " + "is_success varchar(1) " + ")"; if (!isTableExists(tableName)) { logger.debug(sql); stmt.execute(sql); MsgUtil.printLog("create table " + tableName + " already."); } } stmt.close(); } catch (SQLException ex) { MsgUtil.printLog(ex.getMessage()); } } public static void close() { if (conn != null) { try { conn.close(); conn = null; } catch (SQLException ex) { } } } }
[ "natee.live@gmail.com" ]
natee.live@gmail.com
ef88e6635292f42294d4fac4021965bf0ac31cf7
a5d5384f8ae51cc867bc67d1ae902cff6728116c
/day5/encog/src/main/java/org/encog/mathutil/BoundMath.java
121ab8d4254b030543952c0ac2536e7532ca2f78
[]
no_license
joshuajnoble/SecretLifeOfObjects
66be3bca0559014f224b4dbe7030e7651c6b2805
aae0f631860d3f01f1252e8a157bb3425c29596b
refs/heads/master
2020-04-29T03:18:00.959777
2015-06-13T15:53:11
2015-06-13T15:53:11
35,483,832
6
2
null
null
null
null
UTF-8
Java
false
false
2,988
java
/* * Encog(tm) Core v3.3 - Java Version * http://www.heatonresearch.com/encog/ * https://github.com/encog/encog-java-core * Copyright 2008-2014 Heaton Research, 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. * * For more information on Heaton Research copyrights, licenses * and trademarks visit: * http://www.heatonresearch.com/copyright */ package org.encog.mathutil; /** * Java will sometimes return Math.NaN or Math.Infinity when numbers get to * large or too small. This can have undesirable effects. This class provides * some basic math functions that may be in danger of returning such a value. * This class imposes a very large and small ceiling and floor to keep the * numbers within range. * * @author jheaton * */ public final class BoundMath { /** * Calculate the cos. * * @param a * The value passed to the function. * @return The result of the function. */ public static double cos(final double a) { return BoundNumbers.bound(Math.cos(a)); } /** * Calculate the exp. * * @param a * The value passed to the function. * @return The result of the function. */ public static double exp(final double a) { return BoundNumbers.bound(Math.exp(a)); } /** * Calculate the log. * * @param a * The value passed to the function. * @return The result of the function. */ public static double log(final double a) { return BoundNumbers.bound(Math.log(a)); } /** * Calculate the power of a number. * * @param a * The base. * @param b * The exponent. * @return The result of the function. */ public static double pow(final double a, final double b) { return BoundNumbers.bound(Math.pow(a, b)); } /** * Calculate the sin. * * @param a * The value passed to the function. * @return The result of the function. */ public static double sin(final double a) { return BoundNumbers.bound(Math.sin(a)); } /** * Calculate the square root. * * @param a * The value passed to the function. * @return The result of the function. */ public static double sqrt(final double a) { return Math.sqrt(a); } /** * Private constructor. */ private BoundMath() { } /** * Calculate TANH, within bounds. * @param d The value to calculate for. * @return The result. */ public static double tanh(final double d) { return BoundNumbers.bound(Math.tanh(d)); } }
[ "jnoble@teague.com" ]
jnoble@teague.com
a4b91207b1c836ae52a00776698603b70ea8fa81
247284c42d81900eee055977b88c97aed27ee681
/ch.elexis.core.data/src/ch/elexis/util/WikipediaSearchAction.java
e80ae978bf0fb0a6e93e595527d76b034d3d5b7b
[]
no_license
elexis/elexis-next
6d982c5b11eae57f62385b802356de6d8f8a7bec
e760412d2d431b0ff291538376790d23875bc1fb
refs/heads/master
2020-05-19T07:58:56.760253
2013-06-26T10:25:44
2013-06-26T10:25:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,311
java
/******************************************************************************* * Copyright (c) 2007-2011, G. Weirich and Elexis * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * G. Weirich - initial API and implementation ******************************************************************************/ package ch.elexis.util; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IHandler; import org.eclipse.core.commands.IHandlerListener; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.program.Program; import ch.elexis.text.EnhancedTextField; import ch.elexis.text.IRichTextDisplay; import ch.rgw.tools.GenericRange; import ch.rgw.tools.StringTool; public class WikipediaSearchAction extends Action implements IKonsExtension, IHandler { public static final String ID = "ch.elexis.util.WikipediaSearchAction"; //$NON-NLS-1$ private static IRichTextDisplay textField; private static WikipediaSearchAction instance; public String connect(IRichTextDisplay tf){ WikipediaSearchAction.textField = (EnhancedTextField) tf; return "ch.elexis.util.WikipediaSearchAction"; //$NON-NLS-1$ } public WikipediaSearchAction(){ super(Messages.getString("WikipediaSearchAction.DisplayName")); //$NON-NLS-1$ } public boolean doLayout(StyleRange n, String provider, String id){ return false; } public boolean doXRef(String refProvider, String refID){ return false; } @Override public void run(){ String search = ""; //$NON-NLS-1$ if (textField != null) { String text = textField.getContentsPlaintext(); GenericRange gr = textField.getSelectedRange(); if (gr.getLength() == 0) { search = StringTool.getWordAtIndex(text, gr.getPos()); } else { search = text.substring(gr.getPos(), gr.getPos() + gr.getLength()); } search = search.trim().replace("\r\n", " "); //$NON-NLS-1$ //$NON-NLS-2$ } String url = "http://de.wikipedia.org/wiki/" + search; //$NON-NLS-1$ Program.launch(url); } public IAction[] getActions(){ return new IAction[] { this }; } public void insert(Object o, int pos){ // TODO Auto-generated method stub } public void removeXRef(String refProvider, String refID){ // TODO Auto-generated method stub } public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException{ // TODO Auto-generated method stub } public void addHandlerListener(IHandlerListener handlerListener){ // TODO Auto-generated method stub } public void dispose(){ // TODO Auto-generated method stub } public Object execute(ExecutionEvent event) throws ExecutionException{ if (instance != null) instance.run(); return null; } public void removeHandlerListener(IHandlerListener handlerListener){ // TODO Auto-generated method stub } }
[ "marco@descher.at" ]
marco@descher.at
c2a0f6b2cc073319b67d1a2f5609587628b424fb
c6cd1b0c8c465e12aaba21e610788af98d860e86
/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/TimeSecondModificationTracker.java
1b8731d3c302ca665a295eea59ec54ca63cb3ca7
[ "MIT" ]
permissive
Haehnchen/idea-php-symfony2-plugin
41c8a38761333d9a9283e47490e0d24c42cd8b32
a50a2fad93b02bebe03ffb23d67095f632b7b7d7
refs/heads/master
2023-09-03T18:15:34.639587
2023-09-03T08:01:11
2023-09-03T08:01:11
9,279,386
679
144
MIT
2023-09-03T08:01:12
2013-04-07T16:25:16
Java
UTF-8
Java
false
false
1,024
java
package fr.adrienbrault.idea.symfony2plugin.util; import com.intellij.openapi.util.ModificationTracker; import java.time.Instant; /** * Provide a modification on nearest second value * * @author Daniel Espendiller <daniel@espendiller.net> */ public class TimeSecondModificationTracker implements ModificationTracker { public static ModificationTracker TIMED_MODIFICATION_TRACKER_60 = new TimeSecondModificationTracker(60); private final int expiresAfter; public TimeSecondModificationTracker(int expiresAfter) { this.expiresAfter = expiresAfter; } @Override public long getModificationCount() { long unixTime = Instant.now().getEpochSecond(); return roundNearest(unixTime); } private long roundNearest(long n) { // Smaller multiple long a = (n / this.expiresAfter) * this.expiresAfter; // Larger multiple long b = a + this.expiresAfter; // Return of closest of two return (n - a > b - n) ? b : a; } }
[ "daniel@espendiller.net" ]
daniel@espendiller.net
57899099464328e0931d98f7ccc0d7e1cdbe2120
94a2c1a2b1becb0b84fa47772309d8d332488059
/colourful/colourful-common/colourful-common-security/src/main/java/com/colourful/colourful/common/security/component/ColourfulUserAuthenticationConverter.java
e035ae411e2ee863222590958305b75dc97230b0
[]
no_license
edjian/bak
f5493709a4184322bd6947700e9065f985fe437a
bb8bca82b69381b2a1a8454a9c59129f6bfb4ed5
refs/heads/master
2023-01-20T22:37:31.992663
2020-12-01T09:49:13
2020-12-01T09:49:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,868
java
/* * Copyright (c) 2018-2025, colourful 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 pig4cloud.com developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: colourful */ package com.colourful.colourful.common.security.component; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; import com.colourful.colourful.common.core.constant.CommonConstants; import com.colourful.colourful.common.core.constant.SecurityConstants; import com.colourful.colourful.common.security.exception.ColourfulAuth2Exception; import com.colourful.colourful.common.security.service.ColourfulUser; import lombok.extern.slf4j.Slf4j; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.SpringSecurityMessageSource; import org.springframework.security.core.authority.AuthorityUtils; import org.springframework.security.oauth2.provider.token.UserAuthenticationConverter; import org.springframework.util.StringUtils; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; import java.util.Optional; /** * @author colourful * @date 2019-03-07 * <p> * 根据checktoken 的结果转化用户信息 */ @Slf4j public class ColourfulUserAuthenticationConverter implements UserAuthenticationConverter { private static final String N_A = "N/A"; /** * Extract information about the user to be used in an access token (i.e. for resource * servers). * @param authentication an authentication representing a user * @return a map of key values representing the unique information about the user */ @Override public Map<String, ?> convertUserAuthentication(Authentication authentication) { Map<String, Object> response = new LinkedHashMap<>(); response.put(USERNAME, authentication.getName()); if (authentication.getAuthorities() != null && !authentication.getAuthorities().isEmpty()) { response.put(AUTHORITIES, AuthorityUtils.authorityListToSet(authentication.getAuthorities())); } return response; } /** * Inverse of {@link #convertUserAuthentication(Authentication)}. Extracts an * Authentication from a map. * @param responseMap a map of user information * @return an Authentication representing the user or null if there is none */ @Override public Authentication extractAuthentication(Map<String, ?> responseMap) { if (responseMap.containsKey(USERNAME)) { Collection<? extends GrantedAuthority> authorities = getAuthorities(responseMap); Map<String, ?> map = MapUtil.get(responseMap, SecurityConstants.DETAILS_USER, Map.class); validateTenantId(map); String username = MapUtil.getStr(map, SecurityConstants.DETAILS_USERNAME); Integer id = MapUtil.getInt(map, SecurityConstants.DETAILS_USER_ID); Integer deptId = MapUtil.getInt(map, SecurityConstants.DETAILS_DEPT_ID); Integer tenantId = MapUtil.getInt(map, SecurityConstants.DETAILS_TENANT_ID); String phone = MapUtil.getStr(map, SecurityConstants.DETAILS_PHONE); String avatar = MapUtil.getStr(map, SecurityConstants.DETAILS_AVATAR); ColourfulUser user = new ColourfulUser(id, deptId, phone, avatar, tenantId, username, N_A, true, true, true, true, authorities); return new UsernamePasswordAuthenticationToken(user, N_A, authorities); } return null; } private Collection<? extends GrantedAuthority> getAuthorities(Map<String, ?> map) { Object authorities = map.get(AUTHORITIES); if (authorities instanceof String) { return AuthorityUtils.commaSeparatedStringToAuthorityList((String) authorities); } if (authorities instanceof Collection) { return AuthorityUtils.commaSeparatedStringToAuthorityList( StringUtils.collectionToCommaDelimitedString((Collection<?>) authorities)); } return AuthorityUtils.NO_AUTHORITIES; } private void validateTenantId(Map<String, ?> map) { String headerValue = getCurrentTenantId(); Integer userValue = MapUtil.getInt(map, SecurityConstants.DETAILS_TENANT_ID); if (StrUtil.isNotBlank(headerValue) && !userValue.toString().equals(headerValue)) { log.warn("请求头中的租户ID({})和用户的租户ID({})不一致", headerValue, userValue); // TODO: 不要提示租户ID不对,可能被穷举 throw new ColourfulAuth2Exception(SpringSecurityMessageSource.getAccessor() .getMessage("AbstractUserDetailsAuthenticationProvider.badTenantId", "Bad tenant ID")); } } private Optional<HttpServletRequest> getCurrentHttpRequest() { return Optional.ofNullable(RequestContextHolder.getRequestAttributes()).filter( requestAttributes -> ServletRequestAttributes.class.isAssignableFrom(requestAttributes.getClass())) .map(requestAttributes -> ((ServletRequestAttributes) requestAttributes)) .map(ServletRequestAttributes::getRequest); } private String getCurrentTenantId() { return getCurrentHttpRequest() .map(httpServletRequest -> httpServletRequest.getHeader(CommonConstants.TENANT_ID)).orElse(null); } }
[ "ryan.wu@colourchina.com" ]
ryan.wu@colourchina.com
3bd7be19cff5284ca45b7a01efd9c3e45220d1ee
7941d6ed6d1f87954de73876c6d70b2b4b9e8a8c
/src/PART_II_OOP/Day40_accessModifiers_final_hiding/Task6/Rodent/TestMouse.java
be013bb043ac27513353a5d5a70b6b2580cb5b9c
[]
no_license
Isso-Chan/Java-b13
d91524f41788882b85b8fa7ba69b770cd0042a98
a8d3697c7b8d77aba197077880b9657190da34a0
refs/heads/master
2022-11-14T05:47:48.062951
2020-07-02T11:23:43
2020-07-02T11:23:43
276,617,741
0
0
null
null
null
null
UTF-8
Java
false
false
243
java
package PART_II_OOP.Day40_accessModifiers_final_hiding.Task6.Rodent; public class TestMouse { public static void main(String[] args) { Mouse mouse=new Mouse(); mouse.getRodentDetails(); mouse.getMouseDetails(); } }
[ "ismailozcan73@gmail.com" ]
ismailozcan73@gmail.com
1201eeefe1686c07b5d2c925d4de3c26d5ff8550
c2a5fb6e1715d34c54c9ed47b53a0433e77d2805
/src/main/java/io/proleap/cobol/asg/metamodel/procedure/merge/impl/OutputProcedureImpl.java
d4bb6c5cb8262334a42dda5e3903cf44479af399
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
sebdei/cobol85parser
9e8656a2918a3a9ac0d6c4c106918540da3a1573
62c6303cf577355bc68abd752bb853fea83ca752
refs/heads/master
2021-01-23T05:56:38.772614
2017-03-27T11:00:08
2017-03-27T11:00:08
86,324,646
0
0
null
2017-03-27T10:56:50
2017-03-27T10:56:50
null
UTF-8
Java
false
false
1,822
java
/* * Copyright (C) 2016, Ulrich Wolffgang <u.wol@wwu.de> * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD 3-clause license. See the LICENSE file for details. */ package io.proleap.cobol.asg.metamodel.procedure.merge.impl; import io.proleap.cobol.Cobol85Parser.MergeOutputProcedurePhraseContext; import io.proleap.cobol.Cobol85Parser.MergeOutputThroughContext; import io.proleap.cobol.asg.metamodel.ProgramUnit; import io.proleap.cobol.asg.metamodel.call.Call; import io.proleap.cobol.asg.metamodel.impl.CobolDivisionElementImpl; import io.proleap.cobol.asg.metamodel.procedure.merge.OutputProcedure; import io.proleap.cobol.asg.metamodel.procedure.merge.OutputThrough; public class OutputProcedureImpl extends CobolDivisionElementImpl implements OutputProcedure { protected final MergeOutputProcedurePhraseContext ctx; protected OutputThrough outputThrough; protected Call procedureCall; public OutputProcedureImpl(final ProgramUnit programUnit, final MergeOutputProcedurePhraseContext ctx) { super(programUnit, ctx); this.ctx = ctx; } @Override public OutputThrough addOutputThrough(final MergeOutputThroughContext ctx) { OutputThrough result = (OutputThrough) getASGElement(ctx); if (result == null) { result = new OutputThroughImpl(programUnit, ctx); // procedure call final Call procedureCall = createCall(ctx.procedureName()); result.setProcedureCall(procedureCall); outputThrough = result; registerASGElement(result); } return result; } @Override public OutputThrough getOutputThrough() { return outputThrough; } @Override public Call getProcedureCall() { return procedureCall; } @Override public void setProcedureCall(final Call procedureCall) { this.procedureCall = procedureCall; } }
[ "u.wol@wwu.de" ]
u.wol@wwu.de
6fd2e6a5f16703f911a9dad74ab9bc1e0f46da72
5979994b215fabe125cd756559ef2166c7df7519
/aimir-service-system/src/main/java/com/aimir/service/system/impl/demandResponseMgmt/eventstate/SmartClientDREventData.java
42963eb5c739f702a07b1b8356f28b459b4bc933
[]
no_license
TechTinkerer42/Haiti
91c45cb1b784c9afc61bf60d43e1d5623aeba888
debaea96056d1d4611b79bd846af8f7484b93e6e
refs/heads/master
2023-04-28T23:39:43.176592
2021-05-03T10:49:42
2021-05-03T10:49:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,600
java
package com.aimir.service.system.impl.demandResponseMgmt.eventstate; 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.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; /** * This is used to represent all the information associated with a DR Event. It can be used by Smart DRAS Clients. * * * <p>Java class for SmartClientDREventData complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SmartClientDREventData"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="notificationTime" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> * &lt;element name="startTime" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> * &lt;element name="endTime" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> * &lt;element name="eventInfoInstances" type="{http://www.openadr.org/DRAS/EventState}EventInfoInstance" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SmartClientDREventData", propOrder = { "notificationTime", "startTime", "endTime", "eventInfoInstances" }) public class SmartClientDREventData { @XmlElement(required = true) @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar notificationTime; @XmlElement(required = true) @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar startTime; @XmlElement(required = true) @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar endTime; @XmlElement(nillable = true) protected List<EventInfoInstance> eventInfoInstances; /** * Gets the value of the notificationTime property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getNotificationTime() { return notificationTime; } /** * Sets the value of the notificationTime property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setNotificationTime(XMLGregorianCalendar value) { this.notificationTime = value; } /** * Gets the value of the startTime property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getStartTime() { return startTime; } /** * Sets the value of the startTime property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setStartTime(XMLGregorianCalendar value) { this.startTime = value; } /** * Gets the value of the endTime property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getEndTime() { return endTime; } /** * Sets the value of the endTime property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setEndTime(XMLGregorianCalendar value) { this.endTime = value; } /** * Gets the value of the eventInfoInstances 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 eventInfoInstances property. * * <p> * For example, to add a new item, do as follows: * <pre> * getEventInfoInstances().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link EventInfoInstance } * * */ public List<EventInfoInstance> getEventInfoInstances() { if (eventInfoInstances == null) { eventInfoInstances = new ArrayList<EventInfoInstance>(); } return this.eventInfoInstances; } }
[ "marsr0913@nuritelecom.com" ]
marsr0913@nuritelecom.com
580ec6cfb018f3716b7bac9342bed60a6446b4b0
6f4a457d95af91c27a675ce15a05e100439f39e5
/roadtools/src/com/changshagaosu/roadtools/callback/ITreeSelectCallback.java
b016f2272cdaf549df86cf33b12d4016b3ac1ae7
[]
no_license
SunnyLy/RoadTools
bcd99d4354c094fa98bcd426aed0c68b0ec8e5b5
8e8d3a3a3ae5323c98f0b4a56eeed28679176629
refs/heads/master
2021-01-23T05:51:07.042551
2017-11-02T06:02:26
2017-11-02T06:02:26
102,479,489
0
0
null
null
null
null
UTF-8
Java
false
false
229
java
package com.changshagaosu.roadtools.callback; /** * @Annotation <p>描述</p> * @Auth Sunny * @date 2017/9/8 * @Version V1.0.0 */ public interface ITreeSelectCallback { void onItemSelected(int id, boolean selected); }
[ "450512747@qq.com" ]
450512747@qq.com
9596679dad24fadb00cad2db203ec14d44bf1499
dbb8f8642ca95a2e513c9afae27c7ee18b3ab7d8
/anchor-image-feature/src/main/java/org/anchoranalysis/image/feature/bean/object/pair/Minimum.java
6934dd9b86a3dc08aec963431f27d13b27817cd7
[ "MIT", "Apache-2.0" ]
permissive
anchoranalysis/anchor
19c2a40954515e93da83ddfc99b0ff4a95dc2199
b3b589e0d76f51b90589893cfc8dfbb5d7753bc9
refs/heads/master
2023-07-19T17:38:19.940164
2023-07-18T08:33:10
2023-07-18T08:33:10
240,029,306
3
0
MIT
2023-07-18T08:33:11
2020-02-12T14:12:28
Java
UTF-8
Java
false
false
2,127
java
/*- * #%L * anchor-image-feature * %% * Copyright (C) 2010 - 2020 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche * %% * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * #L% */ package org.anchoranalysis.image.feature.bean.object.pair; import lombok.NoArgsConstructor; import org.anchoranalysis.feature.bean.Feature; import org.anchoranalysis.feature.calculate.FeatureCalculationException; import org.anchoranalysis.feature.calculate.FeatureCalculationInput; import org.anchoranalysis.image.feature.input.FeatureInputPairObjects; import org.anchoranalysis.image.feature.input.FeatureInputSingleObject; /** * Ratio of first-object to second-object in a pair * * @author Owen Feehan */ @NoArgsConstructor public class Minimum extends FeatureDeriveFromPair { public Minimum(Feature<FeatureInputSingleObject> item) { super(item); } @Override public double calculate(FeatureCalculationInput<FeatureInputPairObjects> input) throws FeatureCalculationException { return Math.min(valueFromFirst(input), valueFromSecond(input)); } }
[ "owenfeehan@users.noreply.github.com" ]
owenfeehan@users.noreply.github.com
6c1301a565117d2bbf5ef6c86c41fe14386cb406
a820f8f4637876480c967dd4669862bb67734647
/aliyun-java-sdk-batchcompute/src/main/java/com/aliyuncs/batchcompute/transform/v20151111/ChangeClusterDesiredVMCountResponseUnmarshaller.java
b4839446b532231ffc21d4ea0248cff31c4e5cb2
[ "Apache-2.0" ]
permissive
remgoo/aliyun-openapi-java-sdk
6c0128ed1f51bfb395f3022105996c9e9fa5aa09
546e6887d88a5c3a8a9964aa990f8229ca7f9797
refs/heads/master
2020-12-03T09:21:30.460238
2016-04-01T09:31:27
2016-04-01T09:31:27
55,586,102
1
0
null
2016-04-06T07:47:52
2016-04-06T07:47:52
null
UTF-8
Java
false
false
1,271
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 com.aliyuncs.batchcompute.transform.v20151111; import com.aliyuncs.batchcompute.model.v20151111.ChangeClusterDesiredVMCountResponse; import com.aliyuncs.transform.UnmarshallerContext; public class ChangeClusterDesiredVMCountResponseUnmarshaller { public static ChangeClusterDesiredVMCountResponse unmarshall(ChangeClusterDesiredVMCountResponse res, UnmarshallerContext context) { res.setHttpResponse(context.getHttpResponse()); return res; } }
[ "346340936@qq.com" ]
346340936@qq.com
e02ed865d69a39a0e949cbdf0b4280dcce370f32
70e9540a8c6f409145b8974952c86ac32a62ce01
/reactive/src/main/java/reactive/repository/ProductRepositoryImpl.java
dfe3f4396dc1203058f679a22ccc43bb3926d073
[]
no_license
kayartaya-vinod/2018_02_EXILANT_RXJAVA
aeb9b541cd2096efe2fe59d578d9eba0910612c5
351d7a1f38ebbb2323d576dc65263eadb8a439a7
refs/heads/master
2020-03-18T12:32:20.936739
2019-11-19T13:15:45
2019-11-19T13:15:45
134,730,916
2
0
null
null
null
null
UTF-8
Java
false
false
2,153
java
package reactive.repository; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import io.reactivex.Observable; import reactive.model.Product; public class ProductRepositoryImpl implements ProductRepository { private Connection createConnection() throws ClassNotFoundException, SQLException { String url = "jdbc:h2:tcp://localhost/~/test1"; String username = "sa"; String password = ""; Class.forName("org.h2.Driver"); return DriverManager.getConnection(url, username, password); } @Override public List<Product> getAllProducts() { List<Product> list = new ArrayList<>(); Connection conn = null; PreparedStatement stmt = null; ResultSet rs = null; try { conn = createConnection(); stmt = conn.prepareStatement("select * from products"); rs = stmt.executeQuery(); while(rs.next()) { Product p = new Product(rs.getInt("id") , rs.getString("name"), rs.getString("description"), rs.getDouble("unit_price")); list.add(p); System.out.println("Inside getAllProducts(), p.getName()="+p.getName()); } return list; } catch (Exception e) { // ducking the exception // VERY VERY BAD IDEA } finally { try { rs.close(); stmt.close(); conn.close(); } catch (Exception e2) { } } return null; } @Override public Observable<Product> getAllProductsAsync() { return Observable.create(sub->{ Connection conn = createConnection(); PreparedStatement stmt = conn.prepareStatement("select * from products"); ResultSet rs = stmt.executeQuery(); while(rs.next()) { Product p = new Product(rs.getInt("id") , rs.getString("name"), rs.getString("description"), rs.getDouble("unit_price")); System.out.println("Inside getAllProductsAsync(), p.getName()="+p.getName()); // emit the data to all the subscribers sub.onNext(p); } rs.close(); stmt.close(); conn.close(); sub.onComplete(); }); } }
[ "kayartaya.vinod@gmail.com" ]
kayartaya.vinod@gmail.com
80e4915241513df9cb96a7c9535ebe32a2c54daf
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/TIME-14b-4-25-SPEA2-WeightedSum:TestLen:CallDiversity/org/joda/time/MonthDay_ESTest_scaffolding.java
697c76143b6876b5a188df31081d91b2a8c91361
[]
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
426
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 06 20:04:19 BST 2020 */ package org.joda.time; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class MonthDay_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a98da5f3b0574e1955eb5fe278c79da30014cfd6
65a09e9f4450c6133e6de337dbba373a5510160f
/naifg29/src/main/java/co/simasoft/Setup/FileUploadRelations.java
af25633c7856a3d4856c1ae3b0d08c3f1013054a
[]
no_license
nelsonjava/simasoft
c0136cdf0c208a5e8d01ab72080330e4a15b1261
be83eb8ef67758be82bbd811b672572eff1910ee
refs/heads/master
2021-01-23T15:21:01.981277
2017-04-27T12:46:16
2017-04-27T12:46:16
27,980,384
0
0
null
null
null
null
UTF-8
Java
false
false
7,432
java
package co.simasoft.setup; import co.simasoft.beans.*; import co.simasoft.utils.*; import co.simasoft.models.*; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Iterator; import java.util.*; import java.util.Calendar; import java.util.Random; import javax.ejb.LocalBean; import javax.ejb.Singleton; import javax.inject.Named; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import org.jboss.logging.Logger; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import javax.servlet.http.Part; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; import org.primefaces.event.FileUploadEvent; import org.primefaces.model.UploadedFile; import javax.ejb.LocalBean; import javax.ejb.Singleton; import javax.inject.Named; @Singleton @LocalBean @Named("fileUploadRelations") public class FileUploadRelations { private String filePath = ""; @PersistenceContext(unitName = "naifg29PU-JTA") private EntityManager em; FindBean findBean = new FindBean(); private UploadedFile file; public UploadedFile getFile() { return file; } public void setFile(UploadedFile file) { this.file = file; } public void setFilePath(String filePath) { this.filePath = filePath; } public void upload() { try { FileTxt f = new FileTxt(); if(file != null) { filePath = "\\docs\\"+file.getFileName(); } if(!filePath.equals("")) { FacesMessage message = new FacesMessage("Succesful", filePath + " is uploaded."); FacesContext.getCurrentInstance().addMessage(null, message); String model = ""; String groupIds = ""; Models models = new Models(); // read the json file FileReader reader = new FileReader(filePath); JSONParser jsonParser = new JSONParser(); JSONObject jsonObject = (JSONObject) jsonParser.parse(reader); // get an array from the JSON object JSONArray arrayProperties = (JSONArray) jsonObject.get("properties"); Iterator iteProperties = arrayProperties.iterator(); while (iteProperties.hasNext()) { JSONObject propertiesObj = (JSONObject) iteProperties.next(); model = (String)propertiesObj.get("model"); groupIds = (String)propertiesObj.get("groupIds"); models = findBean.nameModels(model,em); if (models == null){ models = new Models(); models.setName(model); GroupIds groupId = new GroupIds(); groupId = findBean.artifactIdGroupIds(groupIds,em); models.setGroupIds(groupId); f.line("model:"+models.getName()); f.line("groupIds:"+models.getGroupIds().getArtifactId()); } em.persist(models); em.flush(); models = findBean.nameModels(model,em); } // while // get an array from the JSON object JSONArray arrayRelationships = (JSONArray) jsonObject.get("Relationships"); Iterator iteRelation = arrayRelationships.iterator(); while (iteRelation.hasNext()) { JSONObject relationObj = (JSONObject) iteRelation.next(); String relationshipsOrden = (String)relationObj.get("orden"); String from = (String)relationObj.get("From"); String to = (String)relationObj.get("To"); String relationName = (String)relationObj.get("name"); Boolean isOptionality = (Boolean)relationObj.get("isOptionality"); Boolean isEmbedded = (Boolean)relationObj.get("isEmbedded"); Boolean isSimplified = (Boolean)relationObj.get("isSimplified"); String cardinalities = (String)relationObj.get("Cardinalities"); Relationships relationships = new Relationships(); relationships.setOrden(Double.parseDouble(relationshipsOrden)); relationships.setName(relationName); relationships.setIsOptionality(isOptionality); relationships.setIsCreate(true); relationships.setIsSearch(true); relationships.setIsView(true); Entities entityFrom = new Entities(); entityFrom = findBean.nameEntities(from,em); relationships.setFrom(entityFrom); Entities entityTo = new Entities(); entityTo = findBean.nameEntities(to,em); relationships.setTo(entityTo); Cardinalities cardinality = new Cardinalities(); cardinality = findBean.nameCardinalities(cardinalities,em); relationships.setCardinalities(cardinality); f.line(String.valueOf(relationships.getFrom().getId())+":"+ relationships.getFrom().getName()+" "+ relationships.getCardinalities().getName()+" "+ String.valueOf(relationships.getTo().getId())+":"+ relationships.getTo().getName()); f.line(""); em.persist(relationships); em.flush(); Relationships relations = new Relationships(); // relations = findBean.relationships(relationships.getFrom().getId(),relationships.getTo().getId(),relationships.getCardinalities().getId(),em); /* Long ff = 112L; Long tt = 117L; Long cc = 81L; */ Long ff = entityFrom.getId(); Long tt = entityTo.getId(); Long cc = cardinality.getId(); relations = findBean.xrelationships(ff,tt,cc,em); f.line("---"); f.line(String.valueOf(relations.getId())); f.line(String.valueOf(relations.getFrom().getId())); f.line(String.valueOf(relations.getTo().getId())); f.line(String.valueOf(relations.getCardinalities().getId())); models = findBean.nameModels(model,em); ModelRelationships modelRelationships = new ModelRelationships(); modelRelationships.setOrden(relations.getOrden()); modelRelationships.setName(Utils.nameRandom()); modelRelationships.setModels(models); modelRelationships.setRelationships(relations); em.persist(modelRelationships); em.flush(); } // while f.saveFile("\\docs", "relations.txt"); } // if } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } catch (ParseException ex) { ex.printStackTrace(); } catch (NullPointerException ex) { ex.printStackTrace(); } catch(Exception ioe) { ioe.printStackTrace(); } } // upload() }
[ "nelsonjava@gmail.com" ]
nelsonjava@gmail.com
9dab1b7968e97b80a012272688dbe9422072328d
b6a97a77f46aff5b5f5c198d122eb58118338562
/hutool-extra/src/test/java/cn/hutool/extra/compress/ArchiverTest.java
d8ec5e4b7e2a677e3b3dd84299a054ba65c307d6
[ "LicenseRef-scancode-mulanpsl-2.0-en", "LicenseRef-scancode-unknown-license-reference", "MulanPSL-2.0" ]
permissive
jackblack369/hutool
dcbb3a8bb8156c1fa8cf0f1d1eaab04c3ac941cc
181b83a75eabb966ce17eb1ddee3a82059515e7a
refs/heads/v5-master
2023-01-29T23:39:15.159518
2020-12-02T08:18:58
2020-12-02T08:18:58
319,193,434
1
0
NOASSERTION
2020-12-07T03:29:39
2020-12-07T03:29:39
null
UTF-8
Java
false
false
1,760
java
package cn.hutool.extra.compress; import cn.hutool.core.io.FileUtil; import cn.hutool.core.lang.Console; import cn.hutool.core.util.CharsetUtil; import cn.hutool.extra.compress.archiver.StreamArchiver; import org.apache.commons.compress.archivers.ArchiveStreamFactory; import org.junit.Ignore; import org.junit.Test; import java.io.File; public class ArchiverTest { @Test @Ignore public void zipTest(){ final File file = FileUtil.file("d:/test/compress/test.zip"); StreamArchiver.create(CharsetUtil.CHARSET_UTF_8, ArchiveStreamFactory.ZIP, file) .add(FileUtil.file("d:/Java"), (f)->{ Console.log("Add: {}", f.getPath()); return true; }) .finish().close(); } @Test @Ignore public void tarTest(){ final File file = FileUtil.file("d:/test/compress/test.tar"); StreamArchiver.create(CharsetUtil.CHARSET_UTF_8, ArchiveStreamFactory.TAR, file) .add(FileUtil.file("d:/Java"), (f)->{ Console.log("Add: {}", f.getPath()); return true; }) .finish().close(); } @Test @Ignore public void cpioTest(){ final File file = FileUtil.file("d:/test/compress/test.cpio"); StreamArchiver.create(CharsetUtil.CHARSET_UTF_8, ArchiveStreamFactory.CPIO, file) .add(FileUtil.file("d:/Java"), (f)->{ Console.log("Add: {}", f.getPath()); return true; }) .finish().close(); } @Test @Ignore public void senvenZTest(){ final File file = FileUtil.file("d:/test/compress/test.7z"); CompressUtil.createArchiver(CharsetUtil.CHARSET_UTF_8, ArchiveStreamFactory.SEVEN_Z, file) .add(FileUtil.file("d:/Java/apache-maven-3.6.3"), (f)->{ Console.log("Add: {}", f.getPath()); return true; }) .finish().close(); } }
[ "loolly@gmail.com" ]
loolly@gmail.com
9e1c29db6d2670d20a188719f264a9169b9b90ce
3e81486524e9f366b0cd4cb01ea1a78a84437beb
/kaleido-core/src/main/java/org/kaleidofoundry/core/env/EnvironmentController.java
cbbe4988ece0f5501649b9e8d5539345b1af6ed3
[ "Apache-2.0" ]
permissive
jraduget/kaleido-repository
952a2bd21db5df5478657d73242da128154070d0
19b0b931874fa76cf69fb36d70596760ebd506e7
refs/heads/master
2023-06-30T09:33:00.020680
2022-01-05T22:24:07
2022-01-05T22:24:07
743,632
0
1
Apache-2.0
2023-06-20T02:53:54
2010-06-27T19:10:16
Java
UTF-8
Java
false
false
3,075
java
/* * Copyright 2008-2021 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.kaleidofoundry.core.env; import javax.ejb.Stateless; import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; import javax.ws.rs.core.UriInfo; import org.kaleidofoundry.core.env.model.EnvironmentInfo; import org.kaleidofoundry.core.env.model.EnvironmentStatus; /** * Environment Initializer Controller :<br/> * * @author jraduget */ @Stateless(mappedName = "ejb/environments/manager") // @Singleton @Path("/environments/") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public class EnvironmentController { private final EnvironmentInitializer envInitializer; /** injected and used to handle security context */ @Context SecurityContext securityContext; /** injected and used to handle URIs */ @Context UriInfo uriInfo; public EnvironmentController() { envInitializer = EnvironmentInitializer.instance; } /** * @return application environment */ @GET @Path("info") public EnvironmentInfo getInfo() { return envInitializer.getInfo(); } /** * @return application status */ @GET @Path("status") public EnvironmentStatus getStatus() { return envInitializer.getStatus(); } /** * Load I18n / FileStore / CacheManager / Configuration <br/> * it can be overloaded */ @PUT @Path("start") public Response start() { try { envInitializer.start(); return Response.ok(envInitializer.getStatus()).build(); } catch (IllegalStateException ise) { envInitializer.getLogger().error(ise.getMessage()); return Response.status(javax.ws.rs.core.Response.Status.FORBIDDEN).build(); } catch (RuntimeException re) { envInitializer.getLogger().error("start error", re); return Response.serverError().build(); } } /** * destroy and free */ @PUT @Path("stop") public Response stop() { try { envInitializer.stop(); return Response.ok(envInitializer.getStatus()).build(); } catch (IllegalStateException ise) { envInitializer.getLogger().error(ise.getMessage()); return Response.status(javax.ws.rs.core.Response.Status.FORBIDDEN).build(); } catch (RuntimeException re) { envInitializer.getLogger().error("start error", re); return Response.serverError().build(); } } }
[ "jraduget@gmail.com" ]
jraduget@gmail.com
00ef06e7e72c236225b7db795781d51208ea8b5f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_0c3ced454f27f9476556d8d924e0209b80559066/FeedbackServiceClient/4_0c3ced454f27f9476556d8d924e0209b80559066_FeedbackServiceClient_t.java
53e5715e4fd9c1228522a7cac76fdf1b88da1483
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,972
java
package com.relayrides.pushy; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.ssl.SslHandler; import io.netty.util.concurrent.Future; import java.security.KeyStore; import java.util.ArrayList; import java.util.List; import java.util.Vector; public class FeedbackServiceClient { private final ApnsEnvironment environment; private final Bootstrap bootstrap; private final Vector<ExpiredToken> expiredTokens; protected FeedbackServiceClient(final ApnsEnvironment environment) { this(environment, null, null); } protected FeedbackServiceClient(final ApnsEnvironment environment, final KeyStore keyStore, final char[] keyStorePassword) { if (environment.isTlsRequired() && keyStore == null) { throw new IllegalArgumentException("Must pass a KeyStore and password for environments that require TLS."); } this.environment = environment; this.bootstrap = new Bootstrap(); this.bootstrap.group(new NioEventLoopGroup()); this.bootstrap.channel(NioSocketChannel.class); final FeedbackServiceClient feedbackClient = this; this.bootstrap.handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(final SocketChannel channel) throws Exception { final ChannelPipeline pipeline = channel.pipeline(); if (environment.isTlsRequired()) { pipeline.addLast("ssl", SslHandlerFactory.getSslHandler(keyStore, keyStorePassword)); } pipeline.addLast("decoder", new ExpiredTokenDecoder()); pipeline.addLast("handler", new FeedbackClientHandler(feedbackClient)); } }); this.expiredTokens = new Vector<ExpiredToken>(); } protected void addExpiredToken(final ExpiredToken expiredToken) { this.expiredTokens.add(expiredToken); } public synchronized List<ExpiredToken> getExpiredTokens() throws InterruptedException { this.expiredTokens.clear(); final ChannelFuture connectFuture = this.bootstrap.connect(this.environment.getFeedbackHost(), this.environment.getFeedbackPort()).sync(); if (connectFuture.isSuccess()) { if (this.environment.isTlsRequired()) { final Future<Channel> handshakeFuture = connectFuture.channel().pipeline().get(SslHandler.class).handshakeFuture().sync(); if (handshakeFuture.isSuccess()) { connectFuture.channel().closeFuture().sync(); } } else { connectFuture.channel().closeFuture().sync(); } } return new ArrayList<ExpiredToken>(this.expiredTokens); } protected void destroy() throws InterruptedException { this.bootstrap.group().shutdownGracefully().sync(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
5e824734cfaa2868a99042e6dce1d897b464b0bb
41763feae5c326dcfd36b75ed23a27ed5ee3e4a8
/src/main/java/com/online/controller/admin/productstandardname/ProductStandardNameController.java
cf17978945cb3d00e4cb07ba4dc958c82de8f694
[]
no_license
aner47/online
a7d53c8e7e6d72065c129a31d2e4ba5614c96e94
9ad7c285e170e6d5642c86eab95f657e9e23f4d7
refs/heads/master
2020-04-27T11:19:41.111136
2019-03-07T07:36:03
2019-03-07T07:36:03
174,291,169
0
0
null
null
null
null
UTF-8
Java
false
false
3,237
java
package com.online.controller.admin.productstandardname; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.online.Message; import com.online.Page; import com.online.Pageable; import com.online.Filter.Operator; import com.online.controller.base.BaseController; import com.online.entity.online.ProductStandardName; import com.online.service.ProductStandardNameService; @Controller @RequestMapping("/admin/productstandardname") public class ProductStandardNameController extends BaseController{ @Autowired private ProductStandardNameService productStandardNameService ; @RequestMapping("/list") public String list(){ return "/admin/productstandardname/list"; } /** * 增加产品标准名称配置页面 */ @RequestMapping(value = "addPage") public String addPage() { return "/admin/productstandardname/add"; } /** * 修改产品标准名称配置页面 */ @RequestMapping(value = "updatePage") public String updatePage(ModelMap model,Integer id) { model.put("productStandardName", productStandardNameService.find(id)); return "/admin/productstandardname/update"; } /** * 查看产品标准名称配置页面 */ @RequestMapping(value = "viewPage") public String viewPage(ModelMap model,Integer id) { model.put("productStandardName", productStandardNameService.find(id)); return "/admin/productstandardname/view"; } /** * 查询产品标准名称配置 */ @RequestMapping(value = "/query") @ResponseBody public Page<ProductStandardName> query(Pageable pageable,ProductStandardName productStandardName) { String standardName = productStandardName.getStandardName(); String industryCode = productStandardName.getIndustryCode(); if (StringUtils.isNotEmpty(standardName)) { pageable.addFilter("standardName", Operator.like, "%"+standardName.trim()+"%"); } if (StringUtils.isNotEmpty(industryCode)) { pageable.addFilter("industryCode", Operator.like,"%"+industryCode.trim()+"%"); } return productStandardNameService.findPage(pageable); } /** * 保存产品标准名称配置 */ @RequestMapping(value = "/save") @ResponseBody public Message save(ProductStandardName productStandardName) { productStandardNameService.save(productStandardName); return Message.success(); } /** * 更新产品标准名称配置 */ @RequestMapping(value = "/update", method = RequestMethod.POST) @ResponseBody public Message update(ProductStandardName productStandardName) { productStandardNameService.update(productStandardName); return Message.success(); } /** * 删除产品标准名称配置 */ @RequestMapping(value = "/delete", method = RequestMethod.POST) public @ResponseBody Message delete(Integer... ids) { for (int i = 0; i < ids.length; i++) { productStandardNameService.delete(ids[i]); } return Message.success(); } }
[ "zyq_glb@hqevn.com" ]
zyq_glb@hqevn.com
b1257cb412e7babc98a1ec2fd3e38329813796be
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13544-87-15-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/resource/servlet/RoutingFilter_ESTest_scaffolding.java
b549def6283298d444283ec854aede7c51027b6b
[]
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
444
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Jan 20 00:02:53 UTC 2020 */ package org.xwiki.resource.servlet; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class RoutingFilter_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
a1a3e570e09d409e3e72ede1b940cd2f3981bc41
2726de7f0d3e6b71677887fd22f25363fed27517
/diozero-imu-devices/src/main/java/com/diozero/imu/drivers/invensense/MPU9150DataFactory.java
10e2b8076c54237c7df3d496aca4be26407068b2
[ "MIT" ]
permissive
electro-dan/diozero
258b73d0ba35f9506f475be7245461e95596e907
e7a72673b097bc9517d5a8ed39393cc1c62badfc
refs/heads/master
2023-01-22T01:02:10.000356
2020-12-06T16:46:52
2020-12-06T16:46:52
255,297,983
0
0
MIT
2020-04-13T10:40:05
2020-04-13T10:40:04
null
UTF-8
Java
false
false
4,624
java
package com.diozero.imu.drivers.invensense; /* * #%L * Organisation: mattjlewis * Project: Device I/O Zero - IMU device classes * Filename: MPU9150DataFactory.java * * This file is part of the diozero project. More information about this project * can be found at http://www.diozero.com/ * %% * Copyright (C) 2016 - 2017 mattjlewis * %% * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * #L% */ import org.apache.commons.math3.complex.Quaternion; import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; import com.diozero.api.imu.ImuData; import com.diozero.api.imu.ImuDataFactory; public class MPU9150DataFactory { public static ImuData newInstance(MPU9150FIFOData fifoData, short[] compassData, double gyroScaleFactor, double accelScaleFactor, double compassScaleFactor, double quatScaleFactor, float temperature) { Vector3D gyro = ImuDataFactory.createVector(fifoData.getGyro(), gyroScaleFactor); Vector3D accel = ImuDataFactory.createVector(fifoData.getAccel(), accelScaleFactor); // TODO What is the scale factor for the quaternion data?! Quaternion quaternion = ImuDataFactory.createQuaternion(fifoData.getQuat(), quatScaleFactor); Vector3D compass = ImuDataFactory.createVector(compassData, compassScaleFactor); // From https://github.com/sparkfun/MPU-9150_Breakout/blob/master/firmware/MPU6050/Examples/MPU9150_AHRS.ino // The gyros and accelerometers can in principle be calibrated in addition to any factory calibration but they are generally // pretty accurate. You can check the accelerometer by making sure the reading is +1 g in the positive direction for each axis. // The gyro should read zero for each axis when the sensor is at rest. Small or zero adjustment should be needed for these sensors. // The magnetometer is a different thing. Most magnetometers will be sensitive to circuit currents, computers, and // other both man-made and natural sources of magnetic field. The rough way to calibrate the magnetometer is to record // the maximum and minimum readings (generally achieved at the North magnetic direction). The average of the sum divided by two // should provide a pretty good calibration offset. Don't forget that for the MPU9150, the magnetometer x- and y-axes are switched // compared to the gyro and accelerometer! // Sensors x (y)-axis of the accelerometer is aligned with the y (x)-axis of the magnetometer; // the magnetometer z-axis (+ down) is opposite to z-axis (+ up) of accelerometer and gyro! // We have to make some allowance for this orientation mismatch in feeding the output to the quaternion filter. // For the MPU-9150, we have chosen a magnetic rotation that keeps the sensor forward along the x-axis just like // in the LSM9DS0 sensor. This rotation can be modified to allow any convenient orientation convention. // This is ok by aircraft orientation standards! // From Richards Tech (not sure if this is needed if the orientation has been set correctly by the DMP driver!) // Sort out gyro axes //gyro = new Vector3D(gyro.getX(), -gyro.getY(), -gyro.getZ()); // Sort out accel axes //accel = new Vector3D(-accel.getX(), accel.getY(), accel.getZ()); // Sort out compass axes // TODO Can this be handled by a generic transformation matrix? compass = new Vector3D(compass.getY(), -compass.getX(), -compass.getZ()); long timestamp = fifoData.getTimestamp(); return new ImuData(gyro, accel, quaternion, compass, temperature, timestamp); } }
[ "matthew.lewis@btinternet.com" ]
matthew.lewis@btinternet.com
5a2be66e23cafb674204c3a499417651b927f7f6
21bcd1da03415fec0a4f3fa7287f250df1d14051
/sources/com/google/android/play/core/tasks/C7201k.java
7b0f1f0e36df782da6988272b84fad1d50f89b22
[]
no_license
lestseeandtest/Delivery
9a5cc96bd6bd2316a535271ec9ca3865080c3ec8
bc3fae8f30804a2520e6699df92c2e6a4a0a7cfc
refs/heads/master
2022-04-24T12:14:22.396398
2020-04-25T21:50:29
2020-04-25T21:50:29
258,875,870
0
1
null
null
null
null
UTF-8
Java
false
false
2,096
java
package com.google.android.play.core.tasks; import java.util.concurrent.Executor; /* renamed from: com.google.android.play.core.tasks.k */ final class C7201k<ResultT> implements C7204n<ResultT> { /* renamed from: a */ private final Executor f20339a; /* access modifiers changed from: private */ /* renamed from: b */ public final Object f20340b = new Object(); /* access modifiers changed from: private */ /* renamed from: c */ public C7190c<? super ResultT> f20341c; public C7201k(Executor executor, C7190c<? super ResultT> cVar) { this.f20339a = executor; this.f20341c = cVar; } /* JADX WARNING: Code restructure failed: missing block: B:10:0x0010, code lost: r2.f20339a.execute(new com.google.android.play.core.tasks.C7202l(r2, r3)); */ /* renamed from: a */ /* Code decompiled incorrectly, please refer to instructions dump. */ public final void mo28626a(com.google.android.play.core.tasks.C7191d<ResultT> r3) { /* r2 = this; boolean r0 = r3.mo28622d() if (r0 == 0) goto L_0x001e java.lang.Object r0 = r2.f20340b monitor-enter(r0) com.google.android.play.core.tasks.c<? super ResultT> r1 = r2.f20341c // Catch:{ all -> 0x001b } if (r1 != 0) goto L_0x000f monitor-exit(r0) // Catch:{ all -> 0x001b } return L_0x000f: monitor-exit(r0) // Catch:{ all -> 0x001b } java.util.concurrent.Executor r0 = r2.f20339a com.google.android.play.core.tasks.l r1 = new com.google.android.play.core.tasks.l r1.<init>(r2, r3) r0.execute(r1) goto L_0x001e L_0x001b: r3 = move-exception monitor-exit(r0) // Catch:{ all -> 0x001b } throw r3 L_0x001e: return */ throw new UnsupportedOperationException("Method not decompiled: com.google.android.play.core.tasks.C7201k.mo28626a(com.google.android.play.core.tasks.d):void"); } }
[ "zsolimana@uaedomain.local" ]
zsolimana@uaedomain.local
049101ebcfb5aa7999795231fbbd65401aa903c9
0e7a8943d743a26ff5ede167b97045e9a5dbf646
/IfSample.java
95c374be6c293b54ac7546036a5d9c5dc3ad02cf
[]
no_license
mooncrater31/Competitive-Programming
dd7657eda25b269ec3873cc78920fb87edbccc41
7cf2c8fc00e24d1575f8b1ebb1136a01d393979a
refs/heads/master
2020-03-31T04:32:20.498065
2020-01-19T09:58:38
2020-01-19T09:58:38
151,909,755
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
class IfSample{ public static void main(String args[]) { int x,y ; x=10; y=20 ; if(x<y) System.out.println("x is less than y"); x=x*2 ; if(x==y) System.out.println("x is now equal to y"); x=x*2 ; if(x>y) System.out.println("x is larger than y") ; if(x==y) System.out.println("You won't see this!") ; } }
[ "mooncraterrocks@gmail.com" ]
mooncraterrocks@gmail.com
0be0f064110ca3fac11a0fb5c1118495436b0751
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/defpackage/af.java
f11df2d3a4a1794c86d5888527cf59be39844b0b
[ "BSD-3-Clause" ]
permissive
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,267
java
package defpackage; import anet.channel.entity.ConnType; /* renamed from: af reason: default package */ /* compiled from: ConnInfo */ public final class af { public final bo a; public String b; public String c; public int d = 0; public int e = 0; public af(String str, String str2, bo boVar) { this.a = boVar; this.b = str; this.c = str2; } public final String a() { if (this.a != null) { return this.a.a(); } return null; } public final int b() { if (this.a != null) { return this.a.d(); } return 0; } public final ConnType c() { if (this.a != null) { return ConnType.a(this.a.e()); } return ConnType.a; } public final int d() { if (this.a != null) { return this.a.i(); } return 45000; } public final String toString() { StringBuilder sb = new StringBuilder("ConnInfo [ip="); sb.append(a()); sb.append(",port="); sb.append(b()); sb.append(",type="); sb.append(c()); sb.append(",hb"); sb.append(d()); sb.append("]"); return sb.toString(); } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
feabc16b493f76c5e3e283a729e414a48b0b72b4
bce8f8d6de0a84d1b359e23a2a1e0b10a8248eb5
/forum/src/main/java/br/dev/rodrigocury/forum/models/StatusTopico.java
9d837e37a9fec1a0468b58c194c440d719dc0b52
[ "MIT" ]
permissive
RodrigoCury/ForumApiRest
aea6a3dcf416de64bf2508be9495f1c0aaa76caf
1da0f2b6c8fb4c3f162a3f5281f91a3de83d5c43
refs/heads/main
2023-08-30T10:42:33.330739
2021-11-07T00:37:36
2021-11-07T00:37:36
417,553,049
0
0
null
null
null
null
UTF-8
Java
false
false
136
java
package br.dev.rodrigocury.forum.models; public enum StatusTopico { NAO_RESPONDIDO, NAO_SOLUCIONADO, SOLUCIONADO, FECHADO; }
[ "=" ]
=
20d4352837cd5d8fe202fadf392480e1c3b9eb8b
3075797fb20a62eeef01026c311b695d47322bbd
/branchs/msaf_validador/ValidadorCadastro/web/src/main/java/com/msaf/validador/integration/hibernate/impl/ValorCategoriaHibernateDAO.java
73a62ae5d878212fd162aff9d0d7d9ba6f17ec58
[ "Apache-2.0" ]
permissive
darciopacifico/omr
73dbc74934bb867b4abc82d851e66094c5da4d86
246a6960dc78559521b7585ad52e2b98dba93c82
refs/heads/master
2016-09-02T00:58:54.541758
2015-06-15T18:02:56
2015-06-15T18:02:56
37,481,404
1
1
null
null
null
null
UTF-8
Java
false
false
1,531
java
package com.msaf.validador.integration.hibernate.impl; import java.util.List; import javax.persistence.Query; import com.msaf.validador.consultaonline.solicitacaovalidacao.CategoriaVO; import com.msaf.validador.consultaonline.solicitacaovalidacao.ValorCategoriaVO; import com.msaf.validador.integration.hibernate.base.DAOGenericoHibernate; import com.msaf.validador.integration.hibernate.intf.IValorCategoriaHibernateDAO; public class ValorCategoriaHibernateDAO extends DAOGenericoHibernate<ValorCategoriaVO, Long> implements IValorCategoriaHibernateDAO { @SuppressWarnings("unchecked") public List<ValorCategoriaVO> pesquisarValorCategoria(CategoriaVO categoria){ Query query = super.getEntityManager().createQuery("Select v from ValorCategoriaVO v where v.categoria.nome = :nomeCategoria"); query.setParameter("nomeCategoria", categoria.getNome()); return query.getResultList(); } public boolean existisValorCategoria(ValorCategoriaVO valorCategoria) { boolean result = false; Query query = super.getEntityManager().createQuery("Select v from ValorCategoriaVO v where v.categoria.nome = :nomeCategoria and v.nome = :nomeValor"); query.setParameter("nomeCategoria", valorCategoria.getCategoria().getNome()); query.setParameter("nomeValor", valorCategoria.getNome()); try{ Object valorCategoriaResult = query.getSingleResult(); if(valorCategoriaResult != null) { result = true; } }catch(Exception e){ result = false; } return result; } }
[ "darcio.pacifico@walmart.com" ]
darcio.pacifico@walmart.com
e46760d928ae5415a16cbfe4e4ca00b305f32f1c
566a9252119593c099ac8bb572b291322eb17c47
/hasting-cluster/src/main/java/com/lindzh/hasting/cluster/etcd/EtcdRpcClient.java
71ea4026febfd482f4a4ebc84cc59cc63d5295e3
[ "MIT" ]
permissive
BiYiTuan/hasting
7743ecf709d7eb85e376c927ad355e679e4aa917
efed0dabcc5181b9f81bb54514048b38adfd7177
refs/heads/master
2020-04-16T13:28:11.481592
2018-04-15T03:52:09
2018-04-15T03:52:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,097
java
package com.lindzh.hasting.cluster.etcd; import com.lindzh.hasting.rpc.client.AbstractClientRemoteExecutor; import com.lindzh.hasting.rpc.cluster1.RpcClusterClient; public class EtcdRpcClient extends RpcClusterClient { private String etcdUrl; private String namespace; private EtcdRpcClientExecutor executor; public String getEtcdUrl() { return etcdUrl; } public void setEtcdUrl(String etcdUrl) { this.etcdUrl = etcdUrl; } public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } @Override public <T> T register(Class<T> iface, String version, String group) { this.checkExecutor(); return super.register(iface, version, group); } private void checkExecutor(){ if(executor==null){ executor = new EtcdRpcClientExecutor(); executor.setEtcdUrl(etcdUrl); if(namespace!=null){ executor.setNamespace(namespace); } super.setRemoteExecutor(executor); } } @Override public AbstractClientRemoteExecutor getRemoteExecutor() { this.checkExecutor(); return executor; } }
[ "linsony0@163.com" ]
linsony0@163.com
8f01a7514f33efa64e4966e4e4110e7e538cc353
2288357cf540728af8a4dd4758b55fb208cecf2f
/app/src/main/java/com/kippinretail/DashBoardMerchantActivity.java
0ede12746968889a285b16bb101fa88bfae981e9
[]
no_license
NTRsolutions/KippinProduction
d74951678246f368eb92cd6b50da52a54eb08686
31f789577aaf83390f90be3d64f034bf18a6b327
refs/heads/master
2020-03-27T08:46:31.514866
2018-08-18T10:25:24
2018-08-18T10:25:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,237
java
package com.kippinretail; import android.Manifest; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.view.Display; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.GridView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.reflect.TypeToken; import com.kippinretail.ApplicationuUlity.CommonData; import com.kippinretail.ApplicationuUlity.CommonUtility; import com.kippinretail.ApplicationuUlity.Log; import com.kippinretail.ApplicationuUlity.RequestType; import com.kippinretail.ApplicationuUlity.ShareType; import com.kippinretail.Modal.ModalGridElement; import com.kippinretail.Modal.UserAddress.MyGeoCoder; import com.kippinretail.Modal.UserAddress.Results; import com.kippinretail.loadingindicator.LoadingBox; import com.kippinretail.retrofit.RestClient; import com.kippinretail.sharedpreferences.Prefs; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; import retrofit.Callback; import retrofit.RetrofitError; import retrofit.client.Response; /** * Created by kamaljeet.singh on 3/11/2016. */ public class DashBoardMerchantActivity extends MyAbstractGridActivity { private GridView gridView; String[] TextMerchant = { "Add Employee", "Points/Loyality", "Gift Cards", "Vouchers", "Analytics", "Logout" }; private boolean isLogoutClicked = false; ImageView logoutButton; private Dialog dialog; private String compres; private boolean networkProvider = false; private boolean gpsProvider = false; private LocationManager locationmanager = null; private static final int MY_PERMISSION_ACCESS_COARSE_LOCATION = 11; private static final int MY_PERMISSION_ACCESS_FINE_LOCATION = 12; double lattitude, longitude; private String mCountry; private String address; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Initlzation(); updateToolbar();; updateUI(); } @Override protected void onResume() { super.onResume(); CommonUtility.isMerchantdashBoard = true; } @Override public void updateToolbar() { generateActionBar(R.string.title_merchant_dashboard, true, false, true); generateRightText("", null); moveLeftTowardsRight(); } @Override public void updateUI() { ArrayList<ModalGridElement> modalGridElements = new ArrayList<>(); modalGridElements.add(getElement(R.drawable.add_employee, "Add Employee")) ; modalGridElements.add(getElement(R.drawable.points_orange, "Points/Loyalty")) ; modalGridElements.add(getElement(R.drawable.gift_cards , "Gift Cards")) ; modalGridElements.add(getElement(R.drawable.promotions_green , "Promotions")) ; modalGridElements.add(getElement(R.drawable.analytics_blue , "Analytics")) ; modalGridElements.add(getElement(R.drawable.logout_orange, "Logout")) ; setData(modalGridElements, new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent i = new Intent(); switch (position) { case 0: i.setClass(DashBoardMerchantActivity.this, AddEmployeeMerchantActivity.class); startActivity(i); overridePendingTransition(R.anim.animation_from_right, R.anim.animation_to_left); break; case 1: i.setClass(DashBoardMerchantActivity.this, PointsMerchantActivity.class); startActivity(i); overridePendingTransition(R.anim.animation_from_right, R.anim.animation_to_left); break; case 2: i.setClass(DashBoardMerchantActivity.this, GiftCardsMerchantActivity.class); i.putExtra("parentButton", "GiftCard"); startActivity(i); overridePendingTransition(R.anim.animation_from_right, R.anim.animation_to_left); break; case 3: i.setClass(DashBoardMerchantActivity.this, VoucherMerchantActivity.class); startActivity(i); overridePendingTransition(R.anim.animation_from_right, R.anim.animation_to_left); break; case 4: i.setClass(DashBoardMerchantActivity.this, MerchantAnalyticsActivity.class); startActivity(i); overridePendingTransition(R.anim.animation_from_right, R.anim.animation_to_left); break; case 5: CommonUtility.isMerchantdashBoard = false; CommonUtility.logout(DashBoardMerchantActivity.this); break; } } }); } @Override public void handleNotification(boolean IsVoucher, boolean IsTradePoint, boolean IsFriendRequest, boolean IstransferGiftCard, boolean IsNewMerchant, boolean IsNonKippinPhysical, boolean IsNonKippinLoyalty) { } }
[ "amit@ucreate.co.in" ]
amit@ucreate.co.in
47dd2dc4fc089cdec00a07a38b17c51930b90d9b
eda1361ef1e7da596f03d4eed8f4981672a1678a
/backstage-framework-common/src/main/java/com/bowen/framework/exception/CustomException.java
62ee76b991df295f8eca04a21a5bd7275f311b9f
[]
no_license
BoWen98/GraduationProject-Backstage
7b13e0933d426a40819e7cbd7de3602f1b82ecb8
5929ad0d3c7be665a61951b8a18101670c31f87a
refs/heads/master
2022-07-18T02:05:27.032073
2019-10-30T06:09:28
2019-10-30T06:09:28
216,445,211
0
0
null
2022-06-25T07:29:57
2019-10-21T00:13:39
Java
UTF-8
Java
false
false
371
java
package com.bowen.framework.exception; import com.bowen.framework.model.response.ResultCode; public class CustomException extends RuntimeException { //错误代码 ResultCode resultCode; public CustomException(ResultCode resultCode){ this.resultCode = resultCode; } public ResultCode getResultCode(){ return resultCode; } }
[ "376512291@qq.com" ]
376512291@qq.com
1871ccca614cb3745e0d679e6125eface8d64615
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/kS.java
c8b466f61edacce2aa41d92ae0f74e4dac5331e9
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
2,065
java
import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; public abstract class kS extends Binder implements kR { public static kR a(IBinder paramIBinder) { Object localObject; if (paramIBinder == null) { localObject = null; } for (;;) { return localObject; IInterface localIInterface = paramIBinder.queryLocalInterface("com.google.android.gms.maps.internal.IInfoWindowAdapter"); if ((localIInterface != null) && ((localIInterface instanceof kR))) { localObject = (kR)localIInterface; } else { localObject = new kT(paramIBinder); } } } public boolean onTransact(int paramInt1, Parcel paramParcel1, Parcel paramParcel2, int paramInt2) { IBinder localIBinder = null; boolean bool; switch (paramInt1) { default: bool = super.onTransact(paramInt1, paramParcel1, paramParcel2, paramInt2); } for (;;) { return bool; paramParcel2.writeString("com.google.android.gms.maps.internal.IInfoWindowAdapter"); bool = true; continue; paramParcel1.enforceInterface("com.google.android.gms.maps.internal.IInfoWindowAdapter"); gU localgU2 = a(mJ.a(paramParcel1.readStrongBinder())); paramParcel2.writeNoException(); if (localgU2 != null) { localIBinder = localgU2.asBinder(); } paramParcel2.writeStrongBinder(localIBinder); bool = true; continue; paramParcel1.enforceInterface("com.google.android.gms.maps.internal.IInfoWindowAdapter"); gU localgU1 = b(mJ.a(paramParcel1.readStrongBinder())); paramParcel2.writeNoException(); if (localgU1 != null) { localIBinder = localgU1.asBinder(); } paramParcel2.writeStrongBinder(localIBinder); bool = true; } } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: kS * JD-Core Version: 0.7.0.1 */
[ "paras@protrafsolutions.com" ]
paras@protrafsolutions.com
76037b60ddac37391cf76dc1be75196da9d6bb95
dc2d45cc43c21a6424b84d5e9b50d882e22e5bd5
/deeplearning4j-ui-parent/deeplearning4j-ui-model/src/main/java/org/deeplearning4j/ui/stats/api/StatsUpdateConfiguration.java
87ac00d8e8c4d1d1b996b13f88f75e97a402c638
[ "Apache-2.0" ]
permissive
niilante/deeplearning4j
0a84d00d1587619167520f8e2777f27908b76f7a
85bfab0d37d56fc81f4464b42d3dcb3bc905ffdf
refs/heads/master
2021-05-03T13:25:41.581021
2016-10-27T19:57:33
2016-10-27T19:57:33
72,155,626
1
0
null
2016-10-27T23:12:34
2016-10-27T23:12:34
null
UTF-8
Java
false
false
2,552
java
package org.deeplearning4j.ui.stats.api; /** * Similar to {@link StatsInitializationConfiguration}, StatsUpdateConfiguration is an interface defining the stats * that should be collected and reported periodically. * In some implementations, this configuration may vary over time (i.e., stats may in principle be reconfigured by the user) * * @author Alex Black */ public interface StatsUpdateConfiguration { /** * Get the reporting frequency, in terms of listener calls */ int reportingFrequency(); //TODO //boolean useNTPTimeSource(); //--- Performance and System Stats --- /** * Should performance stats be collected/reported? * Total time, total examples, total batches, Minibatches/second, examples/second */ boolean collectPerformanceStats(); /** * Should JVM, off-heap and memory stats be collected/reported? */ boolean collectMemoryStats(); /** * Should garbage collection stats be collected and reported? */ boolean collectGarbageCollectionStats(); //TODO // boolean collectDataSetMetaData(); //--- General --- /** * Should per-parameter type learning rates be collected and reported? */ boolean collectLearningRates(); //--- Histograms --- /** * Should histograms (per parameter type, or per layer for activations) of the given type be collected? * * @param type Stats type: Parameters, Updates, Activations */ boolean collectHistograms(StatsType type); /** * Get the number of histogram bins to use for the given type (for use with {@link #collectHistograms(StatsType)} * * @param type Stats type: Parameters, Updates, Activatinos */ int numHistogramBins(StatsType type); //--- Summary Stats: Mean, Variance, Mean Magnitudes --- /** * Should the mean values (per parameter type, or per layer for activations) be collected? * * @param type Stats type: Parameters, Updates, Activations */ boolean collectMean(StatsType type); /** * Should the standard devication values (per parameter type, or per layer for activations) be collected? * * @param type Stats type: Parameters, Updates, Activations */ boolean collectStdev(StatsType type); /** * Should the mean magnitude values (per parameter type, or per layer for activations) be collected? * * @param type Stats type: Parameters, Updates, Activations */ boolean collectMeanMagnitudes(StatsType type); }
[ "blacka101@gmail.com" ]
blacka101@gmail.com
1859a0fce782874744104dec3371460dfd0898a1
0ecf2d067e8fe6cdec12b79bfd68fe79ec222ffd
/chrome/android/javatests/src/org/chromium/chrome/browser/vr/WebXrArSessionTest.java
1f269ec6d1b5a3a933939c4feeda6f2545b63175
[ "BSD-3-Clause" ]
permissive
yachtcaptain23/browser-android-tabs
e5144cee9141890590d6d6faeb1bdc5d58a6cbf1
a016aade8f8333c822d00d62738a922671a52b85
refs/heads/master
2021-04-28T17:07:06.955483
2018-09-26T06:22:11
2018-09-26T06:22:11
122,005,560
0
0
NOASSERTION
2019-05-17T19:37:59
2018-02-19T01:00:10
null
UTF-8
Java
false
false
5,970
java
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.vr; import static org.chromium.chrome.browser.vr.WebXrArTestFramework.PAGE_LOAD_TIMEOUT_S; import static org.chromium.chrome.browser.vr.WebXrArTestFramework.POLL_TIMEOUT_LONG_MS; import android.os.Build; import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.RuleChain; import org.junit.runner.RunWith; import org.chromium.base.test.params.ParameterAnnotations.ClassParameter; import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; import org.chromium.base.test.params.ParameterSet; import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.vr.rules.XrActivityRestriction; import org.chromium.chrome.browser.vr.util.XrTestRuleUtils; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.net.test.EmbeddedTestServer; import java.util.List; import java.util.concurrent.Callable; /** * End-to-end tests for testing WebXR for AR's requestSession behavior. */ @RunWith(ParameterizedRunner.class) @UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class) @CommandLineFlags. Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, "enable-features=WebXR,WebXRHitTest"}) @MinAndroidSdkLevel(Build.VERSION_CODES.N) // WebXR for AR is only supported on N+ public class WebXrArSessionTest { @ClassParameter private static List<ParameterSet> sClassParams = XrTestRuleUtils.generateDefaultTestRuleParameters(); @Rule public RuleChain mRuleChain; private ChromeActivityTestRule mTestRule; private WebXrArTestFramework mWebXrArTestFramework; private EmbeddedTestServer mServer; private boolean mShouldCreateServer; public WebXrArSessionTest(Callable<ChromeActivityTestRule> callable) throws Exception { mTestRule = callable.call(); mRuleChain = XrTestRuleUtils.wrapRuleInXrActivityRestrictionRule(mTestRule); } @Before public void setUp() throws Exception { mWebXrArTestFramework = new WebXrArTestFramework(mTestRule); // WebappActivityTestRule automatically creates a test server, and creating multiple causes // it to crash hitting a DCHECK. So, only handle the server ourselves if whatever test rule // we're using doesn't create one itself. mServer = mTestRule.getTestServer(); if (mServer == null) { mShouldCreateServer = true; mServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); } } @After public void tearDown() throws Exception { if (mServer != null && mShouldCreateServer) { mServer.stopAndDestroyServer(); } } /** * Tests that a session request for AR succeeds. */ @Test @MediumTest @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testArRequestSessionSucceeds() throws InterruptedException { mWebXrArTestFramework.loadUrlAndAwaitInitialization( mServer.getURL(WebXrArTestFramework.getEmbeddedServerPathForHtmlTestFile( "test_ar_request_session_succeeds")), PAGE_LOAD_TIMEOUT_S); mWebXrArTestFramework.enterSessionWithUserGestureOrFail(); mWebXrArTestFramework.assertNoJavaScriptErrors(); } /** * Tests that repeatedly starting and stopping AR sessions does not cause any unexpected * behavior. Regression test for https://crbug.com/837894. */ @Test @MediumTest @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testRepeatedArSessionsSucceed() throws InterruptedException { mWebXrArTestFramework.loadUrlAndAwaitInitialization( mServer.getURL(WebXrArTestFramework.getEmbeddedServerPathForHtmlTestFile( "test_ar_request_session_succeeds")), PAGE_LOAD_TIMEOUT_S); for (int i = 0; i < 2; i++) { mWebXrArTestFramework.enterSessionWithUserGestureOrFail(); mWebXrArTestFramework.endSession(); } mWebXrArTestFramework.assertNoJavaScriptErrors(); } /** * Tests that repeated calls to requestSession on the same page only prompts the user for * camera permissions once. */ @Test @MediumTest @XrActivityRestriction({XrActivityRestriction.SupportedActivity.ALL}) public void testRepeatedArSessionsOnlyPromptPermissionsOnce() throws InterruptedException { mWebXrArTestFramework.loadUrlAndAwaitInitialization( mServer.getURL(WebXrArTestFramework.getEmbeddedServerPathForHtmlTestFile( "test_ar_request_session_succeeds")), PAGE_LOAD_TIMEOUT_S); Assert.assertTrue(mWebXrArTestFramework.arSessionRequestWouldTriggerPermissionPrompt()); mWebXrArTestFramework.enterSessionWithUserGestureOrFail(); mWebXrArTestFramework.endSession(); // Manually run through the same steps as enterArSessionOrFail so that we don't trigger // its automatic permission acceptance. Assert.assertFalse(mWebXrArTestFramework.arSessionRequestWouldTriggerPermissionPrompt()); mWebXrArTestFramework.enterSessionWithUserGesture(); Assert.assertTrue(mWebXrArTestFramework.pollJavaScriptBoolean( "sessionInfos[sessionTypes.AR].currentSession != null", POLL_TIMEOUT_LONG_MS)); } }
[ "artem@brave.com" ]
artem@brave.com
93fe0c89a285c503beefcc4a21da85d6c153390f
40780eebdabaab6e430d4252dada2ac6a314c7f5
/c0005_finalProject_orderPage_delivery_control/src/main/java/www/dream/com/order/model/OrderList.java
5a72eeae6a2a65bcaffe35d2e670f630e0c37abb
[]
no_license
rkdntm1/FinalProject_
e3e458b081d5c7161ca51061b4f5cce8f69c956c
ca9267be626f3f2dcef561910157d8086a280b6f
refs/heads/master
2023-07-17T16:40:35.533550
2021-09-05T10:24:37
2021-09-05T10:24:37
381,608,612
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
package www.dream.com.order.model; import java.util.ArrayList; import java.util.List; import lombok.Data; import www.dream.com.common.model.CommonMngVO; @Data public class OrderList extends CommonMngVO { private String id; private String msg; public List<DetailOrder> listDetailOrder = new ArrayList<>(); }
[ "rkdntm1@gmail.com" ]
rkdntm1@gmail.com
16ec7aa97a084f441d670008d70632b8fd22ed56
5a20ea09b97ecfe2f49c44cb4a2f43591a26ca10
/src/main/java/dev/donghyeon/racingcar/domain/CarStadium.java
199d13f260834300557db288e873c99417be5114
[]
no_license
DaeAkin/tdd_racingcar
3c293ac48866db341e9618d6be1882169e1cc74d
86fe55636388476c39e9b3ab86a5382bc93454fd
refs/heads/master
2023-01-31T13:20:49.484524
2020-12-15T04:08:58
2020-12-15T04:08:58
312,283,111
0
0
null
null
null
null
UTF-8
Java
false
false
961
java
package dev.donghyeon.racingcar.domain; import dev.donghyeon.racingcar.view.Result; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; public class CarStadium { private final Cars cars; private final int count; private final MoveStrategy moveStrategy; public CarStadium(Cars cars, int count, MoveStrategy moveStrategy) { this.cars = cars; this.count = count; this.moveStrategy = moveStrategy; } public void letsRace() { for (int i = 0; i < count; i++) { cars.stream().forEach(car -> car.move(moveStrategy)); Result.printState(cars); } } public List<Car> findWinner() { return cars.stream().filter(car -> car.getMove() == maxMove()) .collect(Collectors.toList()); } private int maxMove() { return cars.stream().map(Car::getMove) .reduce(0,Math::max); } }
[ "mindonghyeon890@gmail.com" ]
mindonghyeon890@gmail.com
2ff52af6aa0e451dba25753b87a89bfea69876b2
c33b8307aa456d65184173e0fb1113a50f40dbd4
/java/mypro01/src/TestFor.java
a2e98e3f286c9bc1cb54dbd2a8a070dff7ba3874
[]
no_license
h5codefans/urlresource
9ed1d40fcafa616f7dabbd2424a5206738458b3c
163c843c5827f5a236c1f98b97b0c6fd85c79e17
refs/heads/master
2023-03-26T21:43:51.138430
2021-03-28T09:00:55
2021-03-28T09:00:55
302,877,949
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
public class TestFor { public static void main(String[] args){ int i; int oddSum=0; int evenSum=0; for(i=1;i<=100;i++){ if(i%2!=0) { oddSum+=i; }else{ evenSum+=i; } } System.out.println("奇数的和:"+oddSum+",偶数的和:"+evenSum); System.out.println("##################################"); for(int j=1;j<1000;j++){ if(j%5==0){ System.out.print(j+"\t"); } if(j%(5*3)==0){ System.out.println(); } } } }
[ "yucx1818@sina.com" ]
yucx1818@sina.com
90d64034c9191224607f981ae8dced9fb593556f
2bf30c31677494a379831352befde4a5e3d8ed19
/tools/apidocs/src/main/java/com/emc/apidocs/model/ApiField.java
e33e0c318183a61bf7f173c62da0c44026cc1faf
[]
no_license
dennywangdengyu/coprhd-controller
fed783054a4970c5f891e83d696a4e1e8364c424
116c905ae2728131e19631844eecf49566e46db9
refs/heads/master
2020-12-30T22:43:41.462865
2015-07-23T18:09:30
2015-07-23T18:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,490
java
/* * Copyright 2015 EMC Corporation * All Rights Reserved */ package com.emc.apidocs.model; import java.util.ArrayList; import java.util.List; /** * Describes a field or attribute in a Class or a Method parameter */ public class ApiField implements Comparable<ApiField>{ public String name; public boolean required = false; public String primitiveType = ""; public String wrapperName = ""; // Stores the value of XMLElementWrapper public ApiClass type; public String description = ""; public List<String> validValues = new ArrayList<String>(); public boolean collection = false; public int min = 0; public int max = 1; // Used during diff operations public ChangeState changeState = ChangeState.NOT_CHANGED; public ApiField() { } public boolean isPrimitive() { return type == null || !primitiveType.equals(""); } public void addValidValue(String value) { validValues.add(value); } public boolean isOptional() { return !required && min==0 & max==1; } /** Indicates if this Field has a type that has child elements, really only useful for XML generation */ public boolean hasChildElements() { return !isPrimitive() && (type != null && !type.fields.isEmpty()); } @Override public int compareTo(ApiField other) { return name.compareTo(other.name); //To change body of implemented methods use File | Settings | File Templates. } }
[ "review-coprhd@coprhd.org" ]
review-coprhd@coprhd.org
e4f14baa48f24f60e23a936d23fcb8e7b99960ae
afbfbe81569960e788f12cdd2c19bb57554998a2
/screencompat/src/main/java/com/dayouzc/e2eplatform/screencompat/com/screen/view/CompatRelativeLayout.java
5a584eb51262db139805884cee2dda72f6508b40
[]
no_license
hanlonglinandroidstudys/MaterialDesignStudy
5511545d933707170389e6616303af0a5234fcc7
988aedeea9933eac6c32a0da260b9b10ce171ccd
refs/heads/master
2020-05-15T14:19:28.714686
2019-07-21T04:15:54
2019-07-21T04:15:54
182,242,331
0
0
null
null
null
null
UTF-8
Java
false
false
1,787
java
package com.dayouzc.e2eplatform.screencompat.com.screen.view; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.RelativeLayout; import com.dayouzc.e2eplatform.screencompat.com.screen.util.UIUtil; /** * @author 韩龙林 * @date 2019/7/21 10:36 */ public class CompatRelativeLayout extends RelativeLayout { /** * 是否被缩放过 防止重复缩放 */ boolean isScaled = false; public CompatRelativeLayout(Context context) { super(context); } public CompatRelativeLayout(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (!isScaled) { float scaleX = UIUtil.getInstance(getContext()).getHorizatontalScaleValue(); float scaleY = UIUtil.getInstance(getContext()).getVerticalScaleValue(); int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); LayoutParams layoutParams = (LayoutParams) child.getLayoutParams(); layoutParams.width = (int) (layoutParams.width * scaleX); layoutParams.height = (int) (layoutParams.height * scaleY); layoutParams.leftMargin = (int) (layoutParams.leftMargin * scaleX); layoutParams.rightMargin = (int) (layoutParams.rightMargin * scaleX); layoutParams.topMargin = (int) (layoutParams.topMargin * scaleY); layoutParams.bottomMargin = (int) (layoutParams.bottomMargin * scaleY); } isScaled = true; } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } }
[ "1501295534@qq.com" ]
1501295534@qq.com
49210865b0bc2e88464d7f04a176e39d7cef107c
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE197_Numeric_Truncation_Error/s02/CWE197_Numeric_Truncation_Error__short_Property_75a.java
669e548995abe318e225ee2b37708620039b968d
[]
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
5,432
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE197_Numeric_Truncation_Error__short_Property_75a.java Label Definition File: CWE197_Numeric_Truncation_Error__short.label.xml Template File: sources-sink-75a.tmpl.java */ /* * @description * CWE: 197 Numeric Truncation Error * BadSource: Property Read data from a system property * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: to_byte * BadSink : Convert data to a byte * Flow Variant: 75 Data flow: data passed in a serialized object from one method to another in different source files in the same package * * */ package testcases.CWE197_Numeric_Truncation_Error.s02; import testcasesupport.*; import java.io.ByteArrayOutputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.io.IOException; import java.util.logging.Level; public class CWE197_Numeric_Truncation_Error__short_Property_75a extends AbstractTestCase { public void bad() throws Throwable { short data; data = Short.MIN_VALUE; /* Initialize data */ /* get system property user.home */ /* FLAW: Read data from a system property */ { String stringNumber = System.getProperty("user.home"); try { data = Short.parseShort(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception parsing data from string", exceptNumberFormat); } } /* serialize data to a byte array */ ByteArrayOutputStream streamByteArrayOutput = null; ObjectOutput outputObject = null; try { streamByteArrayOutput = new ByteArrayOutputStream() ; outputObject = new ObjectOutputStream(streamByteArrayOutput) ; outputObject.writeObject(data); byte[] dataSerialized = streamByteArrayOutput.toByteArray(); (new CWE197_Numeric_Truncation_Error__short_Property_75b()).badSink(dataSerialized ); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "IOException in serialization", exceptIO); } finally { /* clean up stream writing objects */ try { if (outputObject != null) { outputObject.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing ObjectOutputStream", exceptIO); } try { if (streamByteArrayOutput != null) { streamByteArrayOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing ByteArrayOutputStream", exceptIO); } } } public void good() throws Throwable { goodG2B(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { short data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; /* serialize data to a byte array */ ByteArrayOutputStream streamByteArrayOutput = null; ObjectOutput outputObject = null; try { streamByteArrayOutput = new ByteArrayOutputStream() ; outputObject = new ObjectOutputStream(streamByteArrayOutput) ; outputObject.writeObject(data); byte[] dataSerialized = streamByteArrayOutput.toByteArray(); (new CWE197_Numeric_Truncation_Error__short_Property_75b()).goodG2BSink(dataSerialized ); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "IOException in serialization", exceptIO); } finally { /* clean up stream writing objects */ try { if (outputObject != null) { outputObject.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing ObjectOutputStream", exceptIO); } try { if (streamByteArrayOutput != null) { streamByteArrayOutput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing ByteArrayOutputStream", exceptIO); } } } /* 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); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
020a1f639737eed335214a03c9cb5d26c5683759
458fe3e3b5e6fb37a7ff9938c09eeec4472cf70c
/p006_recycleview_alluses/src/main/java/com/example/p006_recycleview_alluses/activitys/Demo2Activity.java
478c3f74c21c656130c7ea33d5f064956c5d95d6
[]
no_license
imgt/myapplication2018
5cbebc825094927514ae56f2970452221eed5f72
4599093c12a7850499118589d362ed74539b2363
refs/heads/master
2020-04-10T16:18:11.701456
2018-08-08T02:24:50
2018-08-08T02:24:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,273
java
package com.example.p006_recycleview_alluses.activitys; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearSnapHelper; import android.support.v7.widget.OrientationHelper; import android.support.v7.widget.RecyclerView; import com.example.librecycleview.MultiTypeAdapter; import com.example.librecycleview.MultiTypeAsserts; import com.example.p006_recycleview_alluses.R; import com.example.p006_recycleview_alluses.models.demo2.ItemDemo2; import com.example.p006_recycleview_alluses.models.demo2.ItemDemo21; import com.example.p006_recycleview_alluses.viewholders.demo2.ItemDemo2ImageViewBinder; import com.example.p006_recycleview_alluses.viewholders.demo2.ItemDemo2TextViewBinder; import java.util.ArrayList; import java.util.List; public class Demo2Activity extends AppCompatActivity { private MultiTypeAdapter mAdapter; private RecyclerView mRecyclerView; private List<Object> items; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recycleview_demo2); mRecyclerView = findViewById(R.id.list); LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(OrientationHelper.VERTICAL); mRecyclerView.setLayoutManager(layoutManager); // mRecyclerView.setLayoutManager(new GridLayoutManager(this,1, OrientationHelper.VERTICAL,false)); new LinearSnapHelper().attachToRecyclerView(mRecyclerView); mAdapter = new MultiTypeAdapter(); mAdapter.register(ItemDemo2.class,new ItemDemo2TextViewBinder()); mAdapter.register(ItemDemo21.class,new ItemDemo2ImageViewBinder()); mRecyclerView.setAdapter(mAdapter); MultiTypeAsserts.assertHasTheSameAdapter(mRecyclerView,mAdapter); items = new ArrayList<>(); for (int i = 0; i < 20; i++) { items.add(new ItemDemo2(i+"",i)); items.add(new ItemDemo21(i+"",R.drawable.ic_fab_done)); } mAdapter.setItems(items); mAdapter.notifyDataSetChanged(); MultiTypeAsserts.assertAllRegistered(mAdapter,items); } }
[ "liangxiao@smart-haier.com" ]
liangxiao@smart-haier.com
2b4dd9208156515dcf9ae01165c0560760c8787b
91bba8add8cb61363731c3176210f02ce7f5ef8a
/src/main/java/tw/edu/ym/csis/maindb/dao/PatientDiagnosisMapper.java
74788ecd6430ae6258683b84648d946fa0e43d50
[]
no_license
twbinfo/csis-form-api
50e9dd124ecc35b21196d39e3961c2a2a500a92f
ffbeb30b4790ef0f83293929dddcb0ff4bfa7caa
refs/heads/master
2021-01-25T10:20:53.192172
2013-10-31T06:31:51
2013-10-31T06:31:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,532
java
package tw.edu.ym.csis.maindb.dao; import java.util.List; import org.apache.ibatis.annotations.Param; import tw.edu.ym.csis.maindb.model.PatientDiagnosis; import tw.edu.ym.csis.maindb.model.PatientDiagnosisExample; public interface PatientDiagnosisMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int countByExample(PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int deleteByExample(PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int insert(PatientDiagnosis record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int insertSelective(PatientDiagnosis record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ List<PatientDiagnosis> selectByExampleWithBLOBs(PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ List<PatientDiagnosis> selectByExample(PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int updateByExampleSelective(@Param("record") PatientDiagnosis record, @Param("example") PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int updateByExampleWithBLOBs(@Param("record") PatientDiagnosis record, @Param("example") PatientDiagnosisExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table PATIENTDIAGNOSIS * * @mbggenerated */ int updateByExample(@Param("record") PatientDiagnosis record, @Param("example") PatientDiagnosisExample example); }
[ "wnameless@gmail.com" ]
wnameless@gmail.com
8e64b86dbcdf12b8e2dc00805b4ce382835e3f7c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_9178cc763cd9de11a0f4c1ef5339c6edd1d45802/AbstractContinuumRunGoalsPhase/2_9178cc763cd9de11a0f4c1ef5339c6edd1d45802_AbstractContinuumRunGoalsPhase_s.java
fe53a10844adf75748be35b74d79210f2d1f4cf2
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,747
java
package org.apache.continuum.release.phase; /* * 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. */ import java.io.File; import java.util.Map; import org.apache.continuum.release.config.ContinuumReleaseDescriptor; import org.apache.continuum.utils.shell.ShellCommandHelper; import org.apache.maven.continuum.installation.InstallationService; import org.apache.maven.shared.release.ReleaseExecutionException; import org.apache.maven.shared.release.ReleaseResult; import org.apache.maven.shared.release.config.ReleaseDescriptor; import org.apache.maven.shared.release.phase.AbstractRunGoalsPhase; import org.codehaus.plexus.util.StringUtils; /** * @author <a href="mailto:ctan@apache.org">Maria Catherine Tan</a> */ public abstract class AbstractContinuumRunGoalsPhase extends AbstractRunGoalsPhase { /** * @plexus.requirement */ private ShellCommandHelper shellCommandHelper; /** * @plexus.requirement */ private InstallationService installationService; public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, File workingDirectory, String additionalArguments ) throws ReleaseExecutionException { ReleaseResult result = new ReleaseResult(); try { String goals = getGoals( releaseDescriptor ); if ( !StringUtils.isEmpty( goals ) ) { Map<String, String> environments = null; if ( releaseDescriptor instanceof ContinuumReleaseDescriptor ) { environments = ( (ContinuumReleaseDescriptor) releaseDescriptor ).getEnvironments(); } String executable = installationService.getExecutorConfigurator( InstallationService.MAVEN2_TYPE ).getExecutable(); if ( environments != null ) { String m2Home = environments.get( installationService.getEnvVar( InstallationService.MAVEN2_TYPE ) ); if ( StringUtils.isNotEmpty( m2Home ) ) { executable = m2Home + File.separator + "bin" + File.separator + executable; } } shellCommandHelper.executeGoals( determineWorkingDirectory( workingDirectory, releaseDescriptor.getScmRelativePathProjectDirectory() ), executable, goals, releaseDescriptor.isInteractive(), additionalArguments, result, environments ); } } catch ( Exception e ) { throw new ReleaseExecutionException( e.getMessage(), e ); } result.setResultCode( ReleaseResult.SUCCESS ); return result; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e6d13cb87de19915bdbfe808405a8072126e5e48
13639b9aa91611cbd03301db41cdc33a5ed4986a
/lichkin-projects-core-admin/src/main/java/com/lichkin/application/apis/api10001/O/n00/C.java
474da63ffe36f08476932ef6bff922287ec6e7c7
[ "MIT" ]
permissive
LichKinContributor/lichkin-projects-core
95fe3c36d2a754996fc6688ee2d725ffbf802982
2acc0c430b3107f0ef9b01fca16e58e95460d839
refs/heads/master
2020-03-30T01:13:14.117132
2019-05-21T14:58:13
2019-05-21T14:58:13
150,565,436
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
package com.lichkin.application.apis.api10001.O.n00; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.lichkin.framework.defines.LKFrameworkStatics; import com.lichkin.framework.web.annotations.LKApiType; import com.lichkin.framework.web.enums.ApiType; import com.lichkin.springframework.controllers.ApiKeyValues; import com.lichkin.springframework.controllers.LKApiBusGetOneController; import com.lichkin.springframework.entities.impl.SysCompEntity; import com.lichkin.springframework.services.LKApiBusGetOneService; @RestController("SysCompO00Controller") @RequestMapping(value = LKFrameworkStatics.WEB_MAPPING_API + "/SysComp/O") @LKApiType(apiType = ApiType.COMPANY_BUSINESS) public class C extends LKApiBusGetOneController<I, O, SysCompEntity> { @Autowired private S service; @Override protected LKApiBusGetOneService<I, O, SysCompEntity> getService(I cin, ApiKeyValues<I> params) { return service; } }
[ "zhuangxuxin@hotmail.com" ]
zhuangxuxin@hotmail.com
d4d7d995b74c768ccdafdc992dcbb4710631ef72
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/lib/host/stats/HostMonthlyEarningsRequest.java
bbfe0d0c034e44d4dd0950fa344af5b7dc868d3c
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
357
java
package com.airbnb.android.lib.host.stats; public class HostMonthlyEarningsRequest extends HostEarningsRequest { public static HostMonthlyEarningsRequest forCurrentUser() { return new HostMonthlyEarningsRequest(); } /* access modifiers changed from: protected */ public String getPeriodString() { return "monthly"; } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
cfa9d3660f8f25cf958d3eccd70419ecc060db34
c173fc0a3d23ffda1a23b87da425036a6b890260
/hrsaas/src/org/paradyne/bean/PAS/AwardsRecognition.java
e13b2f6c779d4ffef78064a2ccf5a4da772bc9be
[ "Apache-2.0" ]
permissive
ThirdIInc/Third-I-Portal
a0e89e6f3140bc5e5d0fe320595d9b02d04d3124
f93f5867ba7a089c36b1fce3672344423412fa6e
refs/heads/master
2021-06-03T05:40:49.544767
2016-08-03T07:27:44
2016-08-03T07:27:44
62,725,738
0
0
null
null
null
null
UTF-8
Java
false
false
2,978
java
package org.paradyne.bean.PAS; import java.util.ArrayList; import org.paradyne.lib.BeanBase; public class AwardsRecognition extends BeanBase{ private String apprId; private String apprCode; private String startDate; private String endDate; private String templateCode; private String templateName; private String phaseId; private String phase; private String rownum; private String hSectionId; private String chkAwardAppl; private String chkNominate; private String chkReason; private String mode; private String nominate; private String reason; private ArrayList phaseList; public String getChkNominate() { return chkNominate; } public void setChkNominate(String chkNominate) { this.chkNominate = chkNominate; } public String getChkReason() { return chkReason; } public void setChkReason(String chkReason) { this.chkReason = chkReason; } public String getNominate() { return nominate; } public void setNominate(String nominate) { this.nominate = nominate; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public ArrayList getPhaseList() { return phaseList; } public void setPhaseList(ArrayList phaseList) { this.phaseList = phaseList; } public String getApprId() { return apprId; } public void setApprId(String apprId) { this.apprId = apprId; } public String getApprCode() { return apprCode; } public void setApprCode(String apprCode) { this.apprCode = apprCode; } public String getStartDate() { return startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { return endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public String getTemplateCode() { return templateCode; } public void setTemplateCode(String templateCode) { this.templateCode = templateCode; } public String getTemplateName() { return templateName; } public void setTemplateName(String templateName) { this.templateName = templateName; } public String getPhaseId() { return phaseId; } public void setPhaseId(String phaseId) { this.phaseId = phaseId; } public String getPhase() { return phase; } public void setPhase(String phase) { this.phase = phase; } public String getRownum() { return rownum; } public void setRownum(String rownum) { this.rownum = rownum; } public String getHSectionId() { return hSectionId; } public void setHSectionId(String sectionId) { hSectionId = sectionId; } public String getChkAwardAppl() { return chkAwardAppl; } public void setChkAwardAppl(String chkAwardAppl) { this.chkAwardAppl = chkAwardAppl; } public String getMode() { return mode; } public void setMode(String mode) { this.mode = mode; } }
[ "Jigar.V@jigar_vasani.THIRDI.COM" ]
Jigar.V@jigar_vasani.THIRDI.COM
b1dbe44ccb5eabe97125dbc30c0670bd7bd37e06
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdas_ReducedClassCount/applicationModule/src/test/java/applicationModulepackageJava8/Foo402Test.java
54cf6162dd7d9a2b42d479967eb2e9a5ef11de54
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package applicationModulepackageJava8; import org.junit.Test; public class Foo402Test { @Test public void testFoo0() { new Foo402().foo0(); } @Test public void testFoo1() { new Foo402().foo1(); } @Test public void testFoo2() { new Foo402().foo2(); } @Test public void testFoo3() { new Foo402().foo3(); } @Test public void testFoo4() { new Foo402().foo4(); } @Test public void testFoo5() { new Foo402().foo5(); } @Test public void testFoo6() { new Foo402().foo6(); } @Test public void testFoo7() { new Foo402().foo7(); } @Test public void testFoo8() { new Foo402().foo8(); } @Test public void testFoo9() { new Foo402().foo9(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
eb82b0569bd1e08ef48eb23a9a734c2e64b51298
b0296d820c0400440232152485a0b3dff3e943be
/PDIPFramework/FrameWork/src/com/gridnode/pdip/framework/db/DefaultEntityHandler.java
6d9232f9d6f6c831579222228edf516975d64fce
[]
no_license
andytanoko/4.2.x_integration
74536c8933a98373b0118eeac66678b72b00aa8e
984842d92abaa797a19bd0f002ec45c9c37da288
refs/heads/master
2021-01-10T13:46:58.824451
2015-09-23T10:41:25
2015-09-23T10:41:25
46,325,977
0
1
null
null
null
null
UTF-8
Java
false
false
3,495
java
/** * This software is the proprietary information of GridNode Pte Ltd. * Use is subjected to license terms. * * Copyright 2001-2002 (C) GridNode Pte Ltd. All Rights Reserved. * * File: DefaultEntityHandler.java * **************************************************************************** * Date Author Changes **************************************************************************** * Apr 17 2002 Neo Sok Lay Modify to extend from AbstractEntityHandler. * Oct 31 2005 Neo Sok Lay Implement getHomeInterfaceClass(). * Override _jndiName in getHome() to get from entityejbmap */ package com.gridnode.pdip.framework.db; /** * <p>Title: </p> * <p>Description: * This class acts like a proxy for entity beans.It loads the * JNDI name from entityEjbMap.properties file and retervies Home object for the * entity using JNDI lookup. * * This class allows to create the entity,update the entity,remove the entity. * It also allows to do findByPrimaryKey and findByFilter which returns * reference to Remote Object or Collection of Remote Objects. * In order to get entities directly insted of remote reference we need to call * getEntityByKey or getEntityByFilter.</p> * * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author Mahesh * @version 1.0 */ import javax.ejb.EJBHome; import javax.ejb.EJBMetaData; import com.gridnode.pdip.framework.config.Configuration; import com.gridnode.pdip.framework.config.ConfigurationManager; import com.gridnode.pdip.framework.config.IFrameworkConfig; import com.gridnode.pdip.framework.log.Log; import com.gridnode.pdip.framework.util.ServiceLocator; public class DefaultEntityHandler extends AbstractEntityHandler { protected EJBMetaData _metaData; /** * Instantiates a entity handler. Default to use local context for locating * the entity bean service. * * @param entityName The class name of the entity */ public DefaultEntityHandler(String entityName) { super(entityName); } /** * Instantiates a entity handler. * * @param entityName The class name of the entity * @param isLocalContext Whether to use local context for locating the * entity bean service. */ public DefaultEntityHandler(String entityName, boolean isLocalContext) { super(entityName, isLocalContext); } /** * Looks up the Home interface using Local context when <CODE>isLocalContext</CODE> * is true, or Client context when <CODE>isLocalContext</CODE> is false. * * @return The EJBHome interface object. */ protected Object getHome() throws java.lang.Exception { Configuration config = ConfigurationManager.getInstance().getConfig(IFrameworkConfig.FRAMEWORK_ENTITY_EJB_MAP_CONFIG); _jndiName = (String)config.getString( _entityName+".jndi"); Log.debug(Log.DB, "[DefaultEntityHandler.getHome] JndiName = "+_jndiName); return ServiceLocator.instance(_isLocalContext? ServiceLocator.LOCAL_CONTEXT : ServiceLocator.CLIENT_CONTEXT).getHome(_jndiName); } /** * Get the Remote interface class. * * @returns The Remote interface class. */ protected Class getProxyInterfaceClass() throws java.lang.Exception { _metaData = ((EJBHome)_home).getEJBMetaData(); return _metaData.getRemoteInterfaceClass(); } protected Class getHomeInterfaceClass() throws Exception { return _home.getClass(); } }
[ "muhamadnazir@gmail.com" ]
muhamadnazir@gmail.com
5b4774d8f244fe052954790ee74679080071ccd4
aa126db53163bfb27d0161e6a5424eb56acbc1c7
/dist/game/data/scripts/ai/others/Bingo.java
d653af558a4c8cdd5991f00ac412e9bf715786a0
[ "MIT" ]
permissive
marlonprudente/L2JServer_C6_Interlude
6ce3ed34a8120223183921f41e6d517b2dcc89eb
f3d3b329657c0f031dab107e6d4ceb5ddad0bea6
refs/heads/master
2022-06-20T01:11:36.557960
2020-05-13T17:39:48
2020-05-13T17:39:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,635
java
/* * This file is part of the L2JServer project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package ai.others; import java.util.ArrayList; import java.util.List; import org.l2jserver.commons.util.Rnd; /** * Adapted from FirstTeam Interlude */ public class Bingo { protected static final String TEMPLATE = "%msg%<br><br>%choices%<br><br>%board%"; protected static final String TEMPLATE_FINAL = "%msg%<br><br>%board%"; protected static final String TEMPLATE_BOARD = "For your information, below is your current selection.<br><table border=\"1\" border color=\"white\" width=100><tr><td align=\"center\">%cell1%</td><td align=\"center\">%cell2%</td><td align=\"center\">%cell3%</td></tr><tr><td align=\"center\">%cell4%</td><td align=\"center\">%cell5%</td><td align=\"center\">%cell6%</td></tr><tr><td align=\"center\">%cell7%</td><td align=\"center\">%cell8%</td><td align=\"center\">%cell9%</td></tr></table>"; protected static final String MSG_AGAIN = "You have already selected that number. Choose your %choicenum% number again."; protected static final String MSG_BEGIN = "I've arranged 9 numbers on the panel.<br>Now, select your %choicenum% number."; protected static final String MSG_NEXT = "Now, choose your %choicenum% number."; protected static final String MSG_ZERO_LINES = "You are spectacularly unlucky! The red-colored numbers on the panel below are the ones you chose. As you can see, they didn't create even a single line. Did you know that it is harder not to create a single line than creating all 3 lines?"; protected static final String MSG_THREE_LINES = "You've created 3 lines! The red colored numbers on the bingo panel below are the numbers you chose. Congratulations!"; protected static final String MSG_LOSE = "Hmm... You didn't make 3 lines. Why don't you try again? The red-colored numbers on the panel are the ones you chose."; protected static final String[] NUMBERS = { "first", "second", "third", "fourth", "fifth", "final" }; private final String _template_choice; private final List<Integer> board; private final List<Integer> guesses; protected int lines; public Bingo(String templateChoice) { board = new ArrayList<>(); guesses = new ArrayList<>(); _template_choice = templateChoice; while (board.size() < 9) { final int num = Rnd.get(1, 9); if (!board.contains(num)) { board.add(num); } } } public String Select(String s) { try { return Select(Integer.parseInt(s)); } catch (Exception E) { return null; } } public String Select(int choise) { if ((choise < 1) || (choise > 9)) { return null; } if (guesses.contains(choise)) { return getDialog("You have already selected that number. Choose your %choicenum% number again."); } guesses.add(choise); if (guesses.size() == 6) { return getFinal(); } return getDialog(""); } protected String getBoard() { if (guesses.isEmpty()) { return ""; } String result = "For your information, below is your current selection.<br><table border=\"1\" border color=\"white\" width=100><tr><td align=\"center\">%cell1%</td><td align=\"center\">%cell2%</td><td align=\"center\">%cell3%</td></tr><tr><td align=\"center\">%cell4%</td><td align=\"center\">%cell5%</td><td align=\"center\">%cell6%</td></tr><tr><td align=\"center\">%cell7%</td><td align=\"center\">%cell8%</td><td align=\"center\">%cell9%</td></tr></table>"; for (int i = 1; i <= 9; ++i) { final String cell = "%cell" + i + "%"; final int num = board.get(i - 1); if (guesses.contains(num)) { result = result.replaceFirst(cell, "<font color=\"" + ((guesses.size() == 6) ? "ff0000" : "ffff00") + "\">" + num + "</font>"); } else { result = result.replaceFirst(cell, "?"); } } return result; } public String getDialog(String msg) { String result = "%msg%<br><br>%choices%<br><br>%board%"; if (guesses.isEmpty()) { result = result.replaceFirst("%msg%", "I've arranged 9 numbers on the panel.<br>Now, select your %choicenum% number."); } else { result = result.replaceFirst("%msg%", "".equalsIgnoreCase(msg) ? "Now, choose your %choicenum% number." : msg); } result = result.replaceFirst("%choicenum%", Bingo.NUMBERS[guesses.size()]); final StringBuilder choices = new StringBuilder(); for (int i = 1; i <= 9; ++i) { if (!guesses.contains(i)) { choices.append(_template_choice.replace("%n%", String.valueOf(i))); } } result = result.replaceFirst("%choices%", choices.toString()); result = result.replaceFirst("%board%", getBoard()); return result; } protected String getFinal() { String result = "%msg%<br><br>%board%".replaceFirst("%board%", getBoard()); calcLines(); switch (lines) { case 3: result = result.replaceFirst("%msg%", "You've created 3 lines! The red colored numbers on the bingo panel below are the numbers you chose. Congratulations!"); break; case 0: result = result.replaceFirst("%msg%", "You are spectacularly unlucky! The red-colored numbers on the panel below are the ones you chose. As you can see, they didn't create even a single line. Did you know that it is harder not to create a single line than creating all 3 lines?"); break; default: result = result.replaceFirst("%msg%", "Hmm... You didn't make 3 lines. Why don't you try again? The red-colored numbers on the panel are the ones you chose."); break; } return result; } public int calcLines() { lines = 0; lines += (checkLine(0, 1, 2) ? 1 : 0); lines += (checkLine(3, 4, 5) ? 1 : 0); lines += (checkLine(6, 7, 8) ? 1 : 0); lines += (checkLine(0, 3, 6) ? 1 : 0); lines += (checkLine(1, 4, 7) ? 1 : 0); lines += (checkLine(2, 5, 8) ? 1 : 0); lines += (checkLine(0, 4, 8) ? 1 : 0); return lines += (checkLine(2, 4, 6) ? 1 : 0); } public boolean checkLine(int idx1, int idx2, int idx3) { return guesses.contains(board.get(idx1)) && guesses.contains(board.get(idx2)) && guesses.contains(board.get(idx3)); } }
[ "libera.libera@gmail.com" ]
libera.libera@gmail.com
13c992e5c3ad6ed7569af377528ae520f7494a7a
11d4d1a9ccfcb00930b530eb4aeaf4ab860d8e4c
/mh-mapper/src/main/java/com/xiaowei/mh/mapper/mapper/OfflineLogV2Mapper.java
138137d7e403851ef10491ebfa20190b634b081c
[]
no_license
kanshunfu123/mh
37813b5a839ae1c0331e40e20e755334a0781b03
f29a3959e79d40176cbee9aa4ba8bced4f032482
refs/heads/master
2020-05-16T15:13:12.363212
2019-04-24T01:52:11
2019-04-24T01:52:11
183,125,589
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package com.xiaowei.mh.mapper.mapper; import com.xiaowei.mh.mapper.home.DeviceRoleDeviceRea; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 由于需要对分页支持,请直接使用对应的DAO类 * 注意:此结构有系统生成,禁止手工修改,以免被覆盖,请通过dalgen生成 * The Table D_OFFLINE_LOG. * 离线日志表(每天统计一次 */ public interface OfflineLogV2Mapper { int offlineCount(List<DeviceRoleDeviceRea> list, @Param("provinceId") Long provinceId, @Param("cityId") Long cityId, @Param("deviceType") String deviceType, @Param("beginTime") String beginTime, @Param("endTime") String endTime); }
[ "995234952@qq.com" ]
995234952@qq.com
81717cd1d1ce4ff61859087904dd7e73e5f81dca
df4539abf5d521be6fddd25734ccd7d7ac461428
/01-JavaSE/day13-常用API&异常/案例/学员练习代码/mySimpleDateFormat/src/com/itheima_02/DateDemo.java
c380593ee443da97e11320fa53a09ed0b0abe44d
[]
no_license
muzierixao/Learning-Java
c9bf6d1d020fd5b6e55d99c50172c465ea06fec0
893d9a730d6429626d1df5613fa7f81aca5bdd84
refs/heads/master
2023-04-18T06:48:46.280665
2020-12-27T05:32:02
2020-12-27T05:32:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package com.itheima_02; /* 测试类 */ public class DateDemo { public static void main(String[] args) { } }
[ "157514367@qq.com" ]
157514367@qq.com
4194b151d41855d7df7d383bd5a99d52b4271023
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_670d77da4d81d75c1ed68ac7cfd28a8aff0c8fa1/AbstractDiagramTypeProvider/28_670d77da4d81d75c1ed68ac7cfd28a8aff0c8fa1_AbstractDiagramTypeProvider_t.java
37e735e2a90a09a8a976ba42e8535cb5fc60a80d
[]
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
5,494
java
/******************************************************************************* * <copyright> * * Copyright (c) 2005, 2010 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * SAP AG - initial API, implementation and documentation * mwenz - Bug 329523 - Add notification of DiagramTypeProvider after saving a diagram * * </copyright> * *******************************************************************************/ package org.eclipse.graphiti.dt; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.graphiti.features.IFeatureProvider; import org.eclipse.graphiti.internal.util.T; import org.eclipse.graphiti.mm.pictograms.Diagram; import org.eclipse.graphiti.notification.DefaultNotificationService; import org.eclipse.graphiti.notification.INotificationService; import org.eclipse.graphiti.platform.AbstractExtension; import org.eclipse.graphiti.platform.IDiagramEditor; import org.eclipse.graphiti.platform.ga.IGraphicsAlgorithmRendererFactory; import org.eclipse.graphiti.tb.DefaultToolBehaviorProvider; import org.eclipse.graphiti.tb.IToolBehaviorProvider; /** * The Class AbstractDiagramTypeProvider. */ public abstract class AbstractDiagramTypeProvider extends AbstractExtension implements IDiagramTypeProvider { private IToolBehaviorProvider[] availableToolBehaviorProviders = null; private Diagram diagram; private IDiagramEditor diagramEditor; private IFeatureProvider featureProvider; private INotificationService notificationService; private int currentToolBahaviorIndex = 0; /** * Creates a new {@link AbstractDiagramTypeProvider}. */ public AbstractDiagramTypeProvider() { super(); } /** * Returns all available tool behavior providers * * @return An array of all registered tool behavior providers */ @Override public IToolBehaviorProvider[] getAvailableToolBehaviorProviders() { if (this.availableToolBehaviorProviders == null) { this.availableToolBehaviorProviders = new IToolBehaviorProvider[] { new DefaultToolBehaviorProvider(this) }; } return this.availableToolBehaviorProviders; } @Override public IToolBehaviorProvider getCurrentToolBehaviorProvider() { IToolBehaviorProvider ret = null; if (getAvailableToolBehaviorProviders().length > 0) { ret = getAvailableToolBehaviorProviders()[getCurrentToolBahaviorIndex()]; } return ret; } @Override public int getCurrentToolBahaviorIndex() { return this.currentToolBahaviorIndex; } @Override public void setCurrentToolBahaviorIndex(int index) { if (this.currentToolBahaviorIndex != index) { if (index < 0 || index >= getAvailableToolBehaviorProviders().length) { throw new IllegalArgumentException("Index not valid"); //$NON-NLS-1$ } this.currentToolBahaviorIndex = index; IDiagramEditor de = getDiagramEditor(); de.refresh(); de.refreshPalette(); } } @Override public Diagram getDiagram() { return this.diagram; } @Override public String getDiagramTitle() { String name = ""; //$NON-NLS-1$ if (getDiagram() != null) { name = getDiagram().getName(); } return name; } @Override public IDiagramEditor getDiagramEditor() { return this.diagramEditor; } @Override public IFeatureProvider getFeatureProvider() { if (this.featureProvider == null) { T.racer().error("featureProvider is null"); //$NON-NLS-1$ } return this.featureProvider; } @Override public void init(Diagram diagram, IDiagramEditor diagramEditor) { setDiagram(diagram); setDiagramEditor(diagramEditor); } private void setDiagramEditor(IDiagramEditor diagramEditor) { this.diagramEditor = diagramEditor; } /** * @param diagram * The diagram to set. */ private void setDiagram(Diagram diagram) { this.diagram = diagram; } /** * Sets the feature provider. * * @param featureProvider * The featureProvider to set. */ protected void setFeatureProvider(IFeatureProvider featureProvider) { this.featureProvider = featureProvider; } @Override public boolean isAutoUpdateAtRuntime() { return true; } @Override public boolean isAutoUpdateAtStartup() { return false; } @Override public boolean isAutoUpdateAtReset() { return true; } @Override public void dispose() { if (getCurrentToolBehaviorProvider() != null) { getCurrentToolBehaviorProvider().dispose(); } if (getFeatureProvider() != null) { getFeatureProvider().dispose(); } } @Override public INotificationService getNotificationService() { if (this.notificationService == null) { this.notificationService = new DefaultNotificationService(this); } return this.notificationService; } @Override public Object[] getRelatedBusinessObjects(Object[] bos) { return new Object[0]; } @Override public IGraphicsAlgorithmRendererFactory getGraphicsAlgorithmRendererFactory() { return null; } @Override public void postInit() { } @Override public void resourceReloaded(Diagram diagram) { setDiagram(diagram); } @Override public void resourcesSaved(Diagram diagram, Resource[] savedResources) { } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
32c6317f9974e484feec5729e346ab15190084c8
1374237fa0c18f6896c81fb331bcc96a558c37f4
/java/com/winnertel/ems/epon/iad/bbs4000/gui/r210/action/ResetMultiCardAction.java
f003ab09fc65322c3851ddbcbe2297052be2b51b
[]
no_license
fangniude/lct
0ae5bc550820676f05d03f19f7570dc2f442313e
adb490fb8d0c379a8b991c1a22684e910b950796
refs/heads/master
2020-12-02T16:37:32.690589
2017-12-25T01:56:32
2017-12-25T01:56:32
96,560,039
0
0
null
null
null
null
UTF-8
Java
false
false
3,722
java
package com.winnertel.ems.epon.iad.bbs4000.gui.r210.action; import com.winnertel.ems.epon.iad.bbs4000.mib.r210.EponModuleBoardSummaryTable; import com.winnertel.em.framework.IApplication; import com.winnertel.em.framework.gui.IGuiComposer; import com.winnertel.em.framework.task.Task; import com.winnertel.em.framework.util.OperationCanceledException; import com.winnertel.em.framework.util.OperationFailedException; import com.winnertel.em.framework.util.OperationFinishedWithoutLogException; import com.winnertel.em.standard.snmp.action.SnmpAction; import com.winnertel.em.standard.snmp.gui.MultipleOperationSummaryDialog; import com.winnertel.em.standard.snmp.gui.SnmpTableModel; import com.winnertel.em.standard.snmp.task.MultipleOperationSummary; import javax.swing.*; import java.awt.event.ActionEvent; public class ResetMultiCardAction extends SnmpAction { public ResetMultiCardAction(IApplication anApplication) { super(anApplication); } public void executeAction(ActionEvent e) throws OperationFailedException, OperationCanceledException, OperationFinishedWithoutLogException { int selectedRowCount = fTable.getSelectedRowCount(); if (selectedRowCount == 0) { // MessageDialog.showSelectRowDialog(fApplication); return; } // NMS00060620 IGuiComposer composer = fApplication.getActiveDeviceManager().getGuiComposer(); String warningTitle = composer.getString("Risky Operation Prompt"); String warningMessage = composer.getString("Are you sure to do this configuration?"); int confirmResult = JOptionPane.showConfirmDialog(fApplication.getTopMostFrame(), warningMessage, warningTitle, JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE); if (confirmResult != JOptionPane.OK_OPTION) { throw new OperationCanceledException("Reset Card action canceled"); } SnmpTableModel tableModel = (SnmpTableModel) fTable.getModel(); MultipleOperationSummary summary = new MultipleOperationSummary(); int[] selectedRows = fTable.getSelectedRows(); for ( int i = 0; i < selectedRows.length; i++ ) { EponModuleBoardSummaryTable onu = (EponModuleBoardSummaryTable)tableModel.getRow(selectedRows[i]); // Reset the card. Task t = new ResetCardTask(onu); t.setWaitPrompt(fApplication.getGlobalStringMap().getString("Please wait while configuring NE")); Boolean result = null; try { result = (Boolean) fApplication.getTaskManager().executeTask(t); } catch (Exception ex) { ex.printStackTrace(); result = Boolean.FALSE; } summary.add(onu.toString(), new Integer(result? Task.COMPLETED : Task.FAILED)); } /* try { // delay 10 seconds to wait for device ready; also according device side requirement. fApplication.getTaskManager().executeTask(new DelayTask()); } catch (Exception e1) { e1.printStackTrace(); } */ MultipleOperationSummaryDialog summaryDlg = new MultipleOperationSummaryDialog( fApplication, summary ); summaryDlg.pack(); summaryDlg.show(); } class ResetCardTask extends Task { EponModuleBoardSummaryTable card = null; public ResetCardTask(EponModuleBoardSummaryTable table) { card = table; } public Object execute() throws Exception { return card.reset() ? Boolean.TRUE : Boolean.FALSE; } } class DelayTask extends Task { public Object execute() throws Exception { try { setWaitPrompt(fApplication.getGlobalStringMap().getString("Please wait while configuring NE")); Thread.sleep(10 * 1000); } catch (Exception ex) { ex.printStackTrace(); } return null; } } }
[ "fangniude@gmail.com" ]
fangniude@gmail.com
a625bb4bb5edad7be237877d9542fc6ac0d25ec5
1126fb1f7b7b30a2153d3f365c3205ceed46c0ea
/src/yangTalkback/Codec/H264AndroidDecoder.java
ab14e9d09ec1d209e7aa8d4e7fe64a91a6e94e9e
[]
no_license
DevelopWb/ybdj
d34c18135ae4dfa8072f0c8772fbcae4222ccfa8
212f11e3f69e82eb5254adf2820ceaa816fd4b0c
refs/heads/master
2022-12-17T16:21:21.406574
2020-09-23T06:35:45
2020-09-23T06:35:45
297,876,366
0
0
null
null
null
null
GB18030
Java
false
false
1,201
java
package yangTalkback.Codec; import java.nio.ByteBuffer; import yangTalkback.Media.MediaFrame; import yangTalkback.Media.VideoDisplayFrame; import android.graphics.Bitmap; import h264.com.VView; import AXLib.Utility.Event; import AXLib.Utility.IDisposable; import AXLib.Utility.Queue; //H264解码器,没有用到 public class H264AndroidDecoder extends VView implements IDisposable { // 图片像素存放区域 protected byte[] mPixel = null; // 图片存放内存区间 protected ByteBuffer bmpBuffer = null; // 解码后的图片 protected Bitmap VideoBit = null; // 视频数据接收缓冲区 protected Queue<MediaFrame> qFrame = null; // 标识解码线程是否正在工作中 protected boolean decodeThreadWorking = false; // 最大缓冲时间 protected final int MaxBufferTime = 1; // 解码一桢图片的事件 // public final Event<Bitmap> Decoded = new Event<Bitmap>(); public final Event<Exception> Error = new Event<Exception>(); protected boolean inited = false; // 初始化 private void Init(MediaFrame mf) { } public VideoDisplayFrame Deocde(MediaFrame mf) throws Exception { return null; } @Override public void Dispose() { } }
[ "18701403668@163.com" ]
18701403668@163.com
23bba654b0d05702c1f7d9bb941e0db510a1c1d0
63e36d35f51bea83017ec712179302a62608333e
/Settings/android/support/v4/view/LayoutInflaterCompatHC.java
6bc975065919f8d55023f33ac11efb48ff0d9574
[]
no_license
hiepgaf/oneplus_blobs_decompiled
672aa002fa670bdcba8fdf34113bc4b8e85f8294
e1ab1f2dd111f905ff1eee18b6a072606c01c518
refs/heads/master
2021-06-26T11:24:21.954070
2017-08-26T12:45:56
2017-08-26T12:45:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,989
java
package android.support.v4.view; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.LayoutInflater.Factory2; import android.view.View; import java.lang.reflect.Field; class LayoutInflaterCompatHC { private static final String TAG = "LayoutInflaterCompatHC"; private static boolean sCheckedField; private static Field sLayoutInflaterFactory2Field; static void forceSetFactory2(LayoutInflater paramLayoutInflater, LayoutInflater.Factory2 paramFactory2) { if (!sCheckedField) {} try { sLayoutInflaterFactory2Field = LayoutInflater.class.getDeclaredField("mFactory2"); sLayoutInflaterFactory2Field.setAccessible(true); sCheckedField = true; if (sLayoutInflaterFactory2Field == null) {} } catch (NoSuchFieldException localNoSuchFieldException) { for (;;) { try { sLayoutInflaterFactory2Field.set(paramLayoutInflater, paramFactory2); return; } catch (IllegalAccessException paramFactory2) { Log.e("LayoutInflaterCompatHC", "forceSetFactory2 could not set the Factory2 on LayoutInflater " + paramLayoutInflater + "; inflation may have unexpected results.", paramFactory2); } localNoSuchFieldException = localNoSuchFieldException; Log.e("LayoutInflaterCompatHC", "forceSetFactory2 Could not find field 'mFactory2' on class " + LayoutInflater.class.getName() + "; inflation may have unexpected results.", localNoSuchFieldException); } } } static void setFactory(LayoutInflater paramLayoutInflater, LayoutInflaterFactory paramLayoutInflaterFactory) { FactoryWrapperHC localFactoryWrapperHC = null; if (paramLayoutInflaterFactory != null) { localFactoryWrapperHC = new FactoryWrapperHC(paramLayoutInflaterFactory); } paramLayoutInflater.setFactory2(localFactoryWrapperHC); paramLayoutInflaterFactory = paramLayoutInflater.getFactory(); if ((paramLayoutInflaterFactory instanceof LayoutInflater.Factory2)) { forceSetFactory2(paramLayoutInflater, (LayoutInflater.Factory2)paramLayoutInflaterFactory); return; } forceSetFactory2(paramLayoutInflater, localFactoryWrapperHC); } static class FactoryWrapperHC extends LayoutInflaterCompatBase.FactoryWrapper implements LayoutInflater.Factory2 { FactoryWrapperHC(LayoutInflaterFactory paramLayoutInflaterFactory) { super(); } public View onCreateView(View paramView, String paramString, Context paramContext, AttributeSet paramAttributeSet) { return this.mDelegateFactory.onCreateView(paramView, paramString, paramContext, paramAttributeSet); } } } /* Location: /Users/joshua/Desktop/system_framework/classes-dex2jar.jar!/android/support/v4/view/LayoutInflaterCompatHC.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "joshuous@gmail.com" ]
joshuous@gmail.com
1a4b547cf7d24959b085489bb3bfaa7010792eb8
c309358bb42528674d9449f29bbd8f7f36136678
/app/src/main/java/aws/apps/usbDeviceEnumerator/ui/usbinfo/LinuxUsbInfoFragment.java
d81272aa52049692f83b4613c2874ca2439238cf
[ "Apache-2.0" ]
permissive
xiat0tim/USB-Device-Info---Android
3926bd9da991eec0244d370084a75e8b400215b6
4936b470ffaff85c6b50c6743308e1b8651a93b1
refs/heads/master
2020-07-04T05:36:49.796859
2016-11-16T10:56:31
2016-11-16T10:56:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,369
java
/******************************************************************************* * Copyright 2011 Alexandros Schillings * <p/> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p/> * http://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package aws.apps.usbDeviceEnumerator.ui.usbinfo; import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TableLayout; import android.widget.TextView; import aws.apps.usbDeviceEnumerator.R; import aws.apps.usbDeviceEnumerator.data.DataProviderCompanyInfo; import aws.apps.usbDeviceEnumerator.data.DataProviderCompanyLogo; import aws.apps.usbDeviceEnumerator.data.DataProviderUsbInfo; import uk.co.alt236.usbdeviceenumerator.UsbConstants; import uk.co.alt236.usbdeviceenumerator.sysbususb.SysBusUsbDevice; public class LinuxUsbInfoFragment extends BaseInfoFragment { public final static String DEFAULT_STRING = "???"; private final static String EXTRA_DATA = LinuxUsbInfoFragment.class.getName() + ".BUNDLE_DATA"; private static final int LAYOUT_ID = R.layout.fragment_usb_info; private final String TAG = this.getClass().getName(); private SysBusUsbDevice device; private boolean validData; private InfoViewHolder viewHolder; private DataFetcher dataFetcher; public static Fragment create(final SysBusUsbDevice usbDevice) { final Fragment fragment = new LinuxUsbInfoFragment(); final Bundle bundle = new Bundle(); bundle.putParcelable(EXTRA_DATA, usbDevice); fragment.setArguments(bundle); return fragment; } @Override public void onAttach(final Context context) { super.onAttach(context); dataFetcher = new DataFetcher( new DataProviderCompanyInfo(context), new DataProviderUsbInfo(context), new DataProviderCompanyLogo(context)); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saved) { device = getArguments().getParcelable(EXTRA_DATA); final View view; if (device == null) { view = inflater.inflate(R.layout.fragment_error, container, false); validData = false; } else { view = inflater.inflate(LAYOUT_ID, container, false); validData = true; } return view; } @Override public void onViewCreated(View view, Bundle bundle) { super.onViewCreated(view, bundle); if (validData) { viewHolder = new InfoViewHolder(view); populateDataTable(LayoutInflater.from(getContext())); } else { final TextView textView = (TextView) view.findViewById(R.id.errorText); textView.setText(R.string.error_loading_device_info_unknown); } } private void populateDataTable(LayoutInflater inflater) { final String vid = CommonLogic.padLeft(device.getVID(), "0", 4); final String pid = CommonLogic.padLeft(device.getPID(), "0", 4); final String deviceClass = UsbConstants.resolveUsbClass(device.getDeviceClass()); viewHolder.getLogo().setImageResource(R.drawable.no_image); viewHolder.getVid().setText(vid); viewHolder.getPid().setText(pid); viewHolder.getDevicePath().setText(device.getDevicePath()); viewHolder.getDeviceClass().setText(deviceClass); viewHolder.getReportedVendor().setText(device.getReportedVendorName()); viewHolder.getReportedProduct().setText(device.getReportedProductName()); final TableLayout bottomTable = viewHolder.getBottomTable(); CommonLogic.addDataRow(inflater, bottomTable, getString(R.string.usb_version_), device.getUsbVersion()); CommonLogic.addDataRow(inflater, bottomTable, getString(R.string.speed_), device.getSpeed()); CommonLogic.addDataRow(inflater, bottomTable, getString(R.string.protocol_), device.getDeviceProtocol()); CommonLogic.addDataRow(inflater, bottomTable, getString(R.string.maximum_power_), device.getMaxPower()); CommonLogic.addDataRow(inflater, bottomTable, getString(R.string.serial_number_), device.getSerialNumber()); loadAsyncData(vid, pid, device.getReportedVendorName()); } private void loadAsyncData(String vid, String pid, String reportedVendorName) { dataFetcher.fetchData(vid, pid, reportedVendorName, new DataFetcher.Callback() { @Override public void onSuccess(final String vendorFromDb, final String productFromDb, final Bitmap bitmap) { if (isAdded() && getActivity() != null && getView() != null) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { viewHolder.getVendorFromDb().setText(vendorFromDb); viewHolder.getProductFromDb().setText(productFromDb); if (bitmap != null) { final BitmapDrawable drawable = new BitmapDrawable(getContext().getResources(), bitmap); viewHolder.getLogo().setImageDrawable(drawable); } else { viewHolder.getLogo().setImageResource(R.drawable.no_image); } } }); } } }); } @Override public String getSharePayload() { return CommonLogic.getSharePayload(viewHolder); } }
[ "aschillings@gmail.com" ]
aschillings@gmail.com
03a231dc7aafee793c8c74fd313e218c9131a46f
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava8/Foo630Test.java
bf9203bee0af0c53dcc0101fb7f72459d35ec390
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
481
java
package applicationModulepackageJava8; import org.junit.Test; public class Foo630Test { @Test public void testFoo0() { new Foo630().foo0(); } @Test public void testFoo1() { new Foo630().foo1(); } @Test public void testFoo2() { new Foo630().foo2(); } @Test public void testFoo3() { new Foo630().foo3(); } @Test public void testFoo4() { new Foo630().foo4(); } @Test public void testFoo5() { new Foo630().foo5(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
d368b75abd96f98d5686e702786b36fc93f762b8
038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad
/schemaOrgDomaConv/src/org/kyojo/schemaorg/m3n4/doma/core/container/SmokingAllowedConverter.java
7a3350c294ec26663e7c1c788d0772f02a90f112
[ "Apache-2.0" ]
permissive
nagaikenshin/schemaOrg
3dec1626781913930da5585884e3484e0b525aea
4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8
refs/heads/master
2021-06-25T04:52:49.995840
2019-05-12T06:22:37
2019-05-12T06:22:37
134,319,974
1
0
null
null
null
null
UTF-8
Java
false
false
598
java
package org.kyojo.schemaorg.m3n4.doma.core.container; import org.seasar.doma.ExternalDomain; import org.seasar.doma.jdbc.domain.DomainConverter; import org.kyojo.schemaorg.m3n4.core.impl.SMOKING_ALLOWED; import org.kyojo.schemaorg.m3n4.core.Container.SmokingAllowed; @ExternalDomain public class SmokingAllowedConverter implements DomainConverter<SmokingAllowed, Boolean> { @Override public Boolean fromDomainToValue(SmokingAllowed domain) { return domain.getNativeValue(); } @Override public SmokingAllowed fromValueToDomain(Boolean value) { return new SMOKING_ALLOWED(value); } }
[ "nagai@nagaikenshin.com" ]
nagai@nagaikenshin.com
e9f5556cc29f158995d29d4f67cb48c657a7af26
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/10/10_5ee59660c1ca925de7c3b4583d3d52c6a654fa06/Parser/10_5ee59660c1ca925de7c3b4583d3d52c6a654fa06_Parser_t.java
a729850a131fbc6a867fb1a22066f5271ba1e3ac
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,851
java
// Parser.java package ed.appserver.jxp; import java.io.*; import java.util.*; import ed.io.*; import ed.util.*; public class Parser { static List<Block> parse( JxpSource s ) throws IOException { String data = s.getContent(); int lastline = 1; int line = 1; Block.Type curType = s.getName().endsWith( ".jxp" ) ? Block.Type.HTML : Block.Type.CODE; StringBuilder buf = new StringBuilder(); boolean newLine = true; char lastChar = '\n'; char codeOpening = ' '; int numBrackets = 0; List<Block> blocks = new ArrayList<Block>(); for ( int i=0; i<data.length(); i++ ){ lastChar = i == 0 ? '\n' : data.charAt( i - 1 ); char c = data.charAt( i ); if ( c == '\n' ) line++; newLine = lastChar == '\n'; if ( curType == Block.Type.HTML ){ if ( ( newLine && c == '{' ) || ( c == '<' && i + 1 < data.length() && data.charAt( i + 1 ) == '%' ) ) { codeOpening = c; numBrackets = 0; blocks.add( Block.create( curType , buf.toString() , lastline ) ); buf.setLength( 0 ); lastline = line; curType = Block.Type.CODE; if ( c == '<' ) i++; if ( i + 1 < data.length() && data.charAt( i + 1 ) == '=' ){ i++; curType = Block.Type.OUTPUT; } continue; } } if ( curType == Block.Type.CODE || curType == Block.Type.OUTPUT ){ if ( c == '"' ){ buf.append( c ); i++; for ( ; i<data.length(); i++ ){ c = data.charAt( i ); buf.append( c ); if ( c == '"' ) break; } continue; } if ( ( numBrackets == 0 && codeOpening == '{' && c == '}' ) || ( codeOpening == '<' && c == '%' && i + 1 < data.length() && data.charAt( i + 1 ) == '>' ) ) { blocks.add( Block.create( curType , buf.toString() , lastline ) ); lastline = line; buf.setLength( 0 ); if ( codeOpening == '<' ) i++; curType = Block.Type.HTML; continue; } if ( codeOpening == '{' ){ if ( c == '}' && numBrackets > 0 ) numBrackets --; if ( c == '{' ) numBrackets++; } } buf.append( c ); } blocks.add( Block.create( curType , buf.toString() , lastline ) ); return blocks; } public static void main( String args[] ) throws Exception { System.out.println( parse( JxpSource.getSource( new File( "crap/www/index.jxp" ) ) ) ); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c5f9fdc5e8902a9774c8f106a48ca03121b4dd26
ac8e3cb273e4249c5b0abd219680e8dc16637f01
/rma-system/src/main/java/com/rma/system/vo/SysMenuPermission.java
11b18ccfcb56e8c83d51cd1cd7860e6c9e39c1a7
[]
no_license
glf134/rmaCloud
00035d735c5d3c959b8132306b0b82863d65eb8a
aa1dbe39dd4c8704522943b2f6c6acd74f214a14
refs/heads/master
2023-04-13T21:46:18.823955
2021-04-23T09:27:46
2021-04-23T09:27:46
357,098,418
1
0
null
null
null
null
UTF-8
Java
false
false
2,810
java
package com.rma.system.vo; import java.io.Serializable; import java.util.Date; /** * 权限 */ public class SysMenuPermission implements Serializable { private static final long serialVersionUID = 1L; private String id; private String parentId; private String struId; private Integer leaf; private String name; private String code; private String path; private String css; private String permission; private String permissionRemark; private Date createTime; /** * 1:菜单,2:按钮 */ private Integer permissionType; private Integer hidden; public String getId() { return id; } public void setId(String id) { this.id = id == null ? null : id.trim(); } public String getParentId() { return parentId; } public void setParentId(String parentId) { this.parentId = parentId == null ? null : parentId.trim(); } public String getStruId() { return struId; } public void setStruId(String struId) { this.struId = struId; } public Integer getLeaf() { return leaf; } public void setLeaf(Integer leaf) { this.leaf = leaf; } public String getName() { return name; } public void setName(String name) { this.name = name == null ? null : name.trim(); } public String getCode() { return code; } public void setCode(String code) { this.code = code == null ? null : code.trim(); } public String getPath() { return path; } public void setPath(String path) { this.path = path == null ? null : path.trim(); } public String getCss() { return css; } public void setCss(String css) { this.css = css == null ? null : css.trim(); } public String getPermission() { return permission; } public void setPermission(String permission) { this.permission = permission == null ? null : permission.trim(); } public String getPermissionRemark() { return permissionRemark; } public void setPermissionRemark(String permissionRemark) { this.permissionRemark = permissionRemark == null ? null : permissionRemark.trim(); } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getPermissionType() { return permissionType; } public void setPermissionType(Integer permissionType) { this.permissionType = permissionType; } public Integer getHidden() { return hidden; } public void setHidden(Integer hidden) { this.hidden = hidden; } }
[ "1347665919@qq.com" ]
1347665919@qq.com
266cc147014284bb03598eb7a509ed58fdaaa3dd
5a13f24c35c34082492ef851fb91d404827b7ddb
/src/main/java3/com/alipay/api/domain/AlipayPassTemplateAddModel.java
cf36488e8d10ae2b619472218b7f424c73fe2fe8
[]
no_license
featherfly/alipay-sdk
69b2f2fc89a09996004b36373bd5512664521bfd
ba2355a05de358dc15855ffaab8e19acfa24a93b
refs/heads/master
2021-01-22T11:03:20.304528
2017-09-04T09:39:42
2017-09-04T09:39:42
102,344,436
1
0
null
null
null
null
UTF-8
Java
false
false
1,054
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 卡券模板创建 * * @author auto create * @since 1.0, 2017-07-24 12:07:58 */ public class AlipayPassTemplateAddModel extends AlipayObject { private static final long serialVersionUID = 8796571371468622728L; /** * 模板内容信息,遵循JSON规范,详情参见tpl_content参数说明:https://doc.open.alipay.com/doc2/detail.htm?treeId=193&articleId=105249&docType=1#tpl_content */ @ApiField("tpl_content") private String tplContent; /** * 商户用于控制模版的唯一性。(可以使用时间戳保证唯一性) */ @ApiField("unique_id") private String uniqueId; public String getTplContent() { return this.tplContent; } public void setTplContent(String tplContent) { this.tplContent = tplContent; } public String getUniqueId() { return this.uniqueId; } public void setUniqueId(String uniqueId) { this.uniqueId = uniqueId; } }
[ "zhongj@cdmhzx.com" ]
zhongj@cdmhzx.com
1a57d35d434bb787e514388a85c1b586663184a3
ca1beeaba34710f4f41d5048bf58a89c1b9d8d29
/chatak-dao/src/test/java/com/chatak/pg/acq/dao/impl/BankDaoImplTest.java
44825ce552a6409daf005ba425354d900af5f68d
[]
no_license
itsbalamurali/test_build
f63796b78a050cc03e34527f56dd840e546b0102
11c491b17c5a2643e1400a23882ba82d6f3d8033
refs/heads/master
2020-04-02T21:16:11.430445
2018-06-19T04:14:38
2018-06-19T04:14:38
154,793,051
0
2
null
2018-10-26T07:15:38
2018-10-26T07:15:38
null
UTF-8
Java
false
false
7,977
java
/** * */ package com.chatak.pg.acq.dao.impl; import java.util.ArrayList; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Query; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; import org.springframework.context.MessageSource; import com.chatak.pg.acq.dao.model.PGAccount; import com.chatak.pg.acq.dao.model.PGBank; import com.chatak.pg.acq.dao.model.PGBankCurrencyMapping; import com.chatak.pg.acq.dao.model.PGCurrencyConfig; import com.chatak.pg.acq.dao.model.PGMerchant; import com.chatak.pg.acq.dao.repository.AccountRepository; import com.chatak.pg.acq.dao.repository.BankCurrencyConfigRepository; import com.chatak.pg.acq.dao.repository.BankCurrencyRepository; import com.chatak.pg.acq.dao.repository.BankRepository; import com.chatak.pg.acq.dao.repository.MerchantRepository; import com.chatak.pg.user.bean.BankRequest; /** * @Author: Girmiti Software * @Date: 16-Feb-2018 * @Time: 11:37:43 am * @Version: 1.0 * @Comments: * */ @RunWith(MockitoJUnitRunner.class) public class BankDaoImplTest { @InjectMocks BankDaoImpl bankDaoImpl; @Mock private EntityManager entityManager; @Mock Query query; @Mock private EntityManagerFactory emf; @Mock private BankRepository bankRepository; @Mock private BankCurrencyRepository bankCurrencyRepository; @Mock private AccountRepository accountRepository; @Mock private BankCurrencyConfigRepository bankCurrencyConfigRepository; @Mock MerchantRepository merchantRepository; @Mock MessageSource messageSource; @Test public void testCreateBank() { BankRequest bankRequest = new BankRequest(); PGBank pgBank = new PGBank(); PGAccount account = new PGAccount(); PGBankCurrencyMapping bankCurrencyMapped = new PGBankCurrencyMapping(); pgBank.setStatus("Deleted"); pgBank.setId(Long.parseLong("54")); Mockito.when(bankCurrencyRepository.findByBankId(Matchers.anyLong())).thenReturn(bankCurrencyMapped); Mockito.when(bankRepository.save(Matchers.any(PGBank.class))).thenReturn(pgBank); Mockito.when(accountRepository.findByEntityTypeAndCurrencyAndStatus(Matchers.anyString(), Matchers.anyString(), Matchers.anyString())).thenReturn(account); Mockito.when(bankRepository.findByBankName(Matchers.anyString())).thenReturn(pgBank); bankDaoImpl.createBank(bankRequest); } @Test public void testCreateBankElse() { BankRequest bankRequest = new BankRequest(); PGAccount response = new PGAccount(); PGBank bank = new PGBank(); PGBankCurrencyMapping bankCurrencyMapped = null; bank.setId(Long.parseLong("54")); Mockito.when(bankRepository.save(Matchers.any(PGBank.class))).thenReturn(bank); Mockito.when(bankCurrencyRepository.findByBankId(Matchers.anyLong())).thenReturn(bankCurrencyMapped); Mockito.when(accountRepository.save(Matchers.any(PGAccount.class))).thenReturn(response); bankDaoImpl.createBank(bankRequest); } @Test public void testCreateBankStatus() { BankRequest bankRequest = new BankRequest(); PGBank bank = new PGBank(); bank.setStatus("deleted"); Mockito.when(bankRepository.findByBankName(Matchers.anyString())).thenReturn(bank); bankDaoImpl.createBank(bankRequest); } @Test public void testUpdateBank() { BankRequest bankRequest = new BankRequest(); PGBank pgBank = new PGBank(); Mockito.when(bankRepository.findByBankNameAndStatusNotLike(Matchers.anyString(), Matchers.anyString())) .thenReturn(pgBank); bankDaoImpl.updateBank(bankRequest); } @Test public void testUpdateBankNull() { BankRequest bankRequest = new BankRequest(); bankDaoImpl.updateBank(bankRequest); } @Test public void testGetBankByName() { bankDaoImpl.getBankByName("abcd"); } @Test public void testGetBanklist() { BankRequest bankRequest = new BankRequest(); bankRequest.setNoOfRecords(Integer.parseInt("123")); bankRequest.setPageIndex(1); bankRequest.setPageSize(Integer.parseInt("23")); List<PGBank> pgBankList = new ArrayList<>(); PGBank bank = new PGBank(); pgBankList.add(bank); List<Object> tuplelist = new ArrayList<>(); Object objects[] = new Object[Integer.parseInt("8")]; objects[0] = "name"; objects[1] = "name"; objects[Integer.parseInt("2")] = "name"; objects[Integer.parseInt("3")] = "phone"; objects[Integer.parseInt("4")] = new Long("10"); objects[Integer.parseInt("5")] = "status"; objects[Integer.parseInt("6")] = "status"; objects[Integer.parseInt("7")] = "phone"; tuplelist.add(objects); Mockito.when(entityManager.getDelegate()).thenReturn(Object.class); Mockito.when(entityManager.createQuery(Matchers.anyString())).thenReturn(query); Mockito.when(entityManager.getEntityManagerFactory()).thenReturn(emf); Mockito.when(query.getResultList()).thenReturn(pgBankList, tuplelist); bankDaoImpl.getBanklist(bankRequest); } @Test public void testGetBanklistElse() { BankRequest bankRequest = new BankRequest(); bankRequest.setNoOfRecords(Integer.parseInt("123")); bankRequest.setPageIndex(1); bankRequest.setPageSize(Integer.parseInt("23")); Mockito.when(entityManager.getDelegate()).thenReturn(Object.class); Mockito.when(entityManager.createQuery(Matchers.anyString())).thenReturn(query); Mockito.when(entityManager.getEntityManagerFactory()).thenReturn(emf); bankDaoImpl.getBanklist(bankRequest); } @Test public void testGetBanklistException() { BankRequest bankRequest = new BankRequest(); bankDaoImpl.getBanklist(bankRequest); } @Test public void testDeleteBank() { PGBank pgBank = new PGBank(); List<PGMerchant> pgMerchant = new ArrayList<>(); PGMerchant merchant = new PGMerchant(); pgMerchant.add(merchant); Mockito.when(merchantRepository.findByBankId(Matchers.anyLong())).thenReturn(pgMerchant); Mockito.when(bankRepository.findByBankName(Matchers.anyString())).thenReturn(pgBank); bankDaoImpl.deleteBank("abcd"); } @Test public void testDeleteBankElse() { PGBank pgBank = new PGBank(); Mockito.when(bankRepository.findByBankName(Matchers.anyString())).thenReturn(pgBank); bankDaoImpl.deleteBank("Deleted"); } @Test public void testGetBankData() { List<Object> tuplelist = new ArrayList<>(); Object objects[] = new Object[Integer.parseInt("2")]; objects[0] = new Long("5"); objects[1] = "name"; tuplelist.add(objects); Mockito.when(entityManager.getDelegate()).thenReturn(Object.class); Mockito.when(entityManager.createQuery(Matchers.anyString())).thenReturn(query); Mockito.when(entityManager.getEntityManagerFactory()).thenReturn(emf); Mockito.when(query.getResultList()).thenReturn(tuplelist); bankDaoImpl.getBankData(); } @Test public void testGetCurrencyByBankId() { List<Object> tuplelist = new ArrayList<>(); Object objects[] = new Object[Integer.parseInt("3")]; objects[0] = new Long("5"); objects[1] = "name"; tuplelist.add(objects); Mockito.when(entityManager.getDelegate()).thenReturn(Object.class); Mockito.when(entityManager.createQuery(Matchers.anyString())).thenReturn(query); Mockito.when(entityManager.getEntityManagerFactory()).thenReturn(emf); Mockito.when(query.getResultList()).thenReturn(tuplelist); bankDaoImpl.getCurrencyByBankId(Long.parseLong("123")); } @Test public void testGetCurrencyAlpha() { PGCurrencyConfig pgCurrencyConfig = new PGCurrencyConfig(); Mockito.when(bankCurrencyConfigRepository.findById(Matchers.anyLong())).thenReturn(pgCurrencyConfig); bankDaoImpl.getCurrencyAlpha(Long.parseLong("123")); } @Test public void testGetCurrencyAlphaNull() { bankDaoImpl.getCurrencyAlpha(Long.parseLong("431")); } @Test public void testGetBankName() { bankDaoImpl.getBankName(Long.parseLong("431")); } @Test public void testCreateOrUpdateBank() { PGBank pgBank = new PGBank(); bankDaoImpl.createOrUpdateBank(pgBank); } }
[ "rajesh.bs@girmiti.com" ]
rajesh.bs@girmiti.com
23bf1134867ea307c1db428ee5ee7060b8a9a432
44a0e67273389aea6e0927559312729e9d3f5675
/fili-core/src/main/java/com/yahoo/bard/webservice/web/endpoints/EndpointServlet.java
d9dec0958ed1cd3682b31ba8a113632bcc4e3c2c
[ "Apache-2.0" ]
permissive
gitter-badger/fili
0159aae7d624dbfa4569a4fdd466c7c7d8819235
2adb1220975bee91fe2ecd0cbbe43380aea39df9
refs/heads/master
2020-12-25T16:03:06.076889
2016-06-21T16:33:35
2016-06-21T16:33:35
61,657,132
0
0
null
2016-06-21T18:27:16
2016-06-21T18:27:15
null
UTF-8
Java
false
false
3,240
java
// Copyright 2016 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE file distributed with this work for terms. package com.yahoo.bard.webservice.web.endpoints; import com.yahoo.bard.webservice.application.ObjectMappersSuite; import com.yahoo.bard.webservice.web.ApiRequest; import com.yahoo.bard.webservice.web.CsvResponse; import com.yahoo.bard.webservice.web.JsonResponse; import com.yahoo.bard.webservice.web.util.ResponseFormat; import com.fasterxml.jackson.core.JsonProcessingException; import java.util.List; import java.util.stream.Stream; import javax.inject.Inject; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; /** * Abstract class making available the common code between the servlets that serve the endpoints. */ public abstract class EndpointServlet { protected final ObjectMappersSuite objectMappers; @Inject public EndpointServlet(ObjectMappersSuite objectMappers) { this.objectMappers = objectMappers; } /** * Format and build the response as JSON or CSV. * * @param apiRequest The api request object * @param rows The stream that describes the data to be formatted * @param jsonName Top-level title for the JSON data * @param csvColumnNames Header for the CSV data * @param <T> The type of rows being processed * * @return The updated response builder with the new link header added * @throws JsonProcessingException If the Json response is invalid */ protected <T> Response formatResponse( ApiRequest apiRequest, Stream<T> rows, String jsonName, List<String> csvColumnNames ) throws JsonProcessingException { StreamingOutput output; Response.ResponseBuilder builder; switch (apiRequest.getFormat()) { case CSV: builder = apiRequest.getBuilder() .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=utf-8") .header( HttpHeaders.CONTENT_DISPOSITION, ResponseFormat.getCsvContentDispositionValue(apiRequest) ); output = new CsvResponse<>( rows, apiRequest.getPagination(), apiRequest.getUriInfo(), csvColumnNames, objectMappers ).getResponseStream(); break; case JSON: // Fall-through: Default is JSON default: builder = apiRequest.getBuilder() .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON + "; charset=utf-8"); output = new JsonResponse<>( rows, apiRequest.getPagination(), apiRequest.getUriInfo(), jsonName, objectMappers ).getResponseStream(); break; } return builder.entity(output).build(); } }
[ "mclawhor@yahoo-inc.com" ]
mclawhor@yahoo-inc.com