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
3e32b3e90d71ca0bb1184a3649a929b16f448e1f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/26/26_287d6bd01806afaa575f5b0b5d4b3223d9a35dd8/Supers/26_287d6bd01806afaa575f5b0b5d4b3223d9a35dd8_Supers_s.java
aaf5f63d80d3ebe24136d33216fa1876c198bcd3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,771
java
package com.analog.lyric.collect; import java.lang.reflect.Array; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collections; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableList; /** * Static utility methods related to super classes. */ public abstract class Supers { private Supers() {} // prevent subclassing // JAVA7: In Java 7 it would be better to subclass ClassValue<ImmutableList<Class<?>>> to implement the cache. private static class SuperClassCacheLoader extends CacheLoader<Class<?>,ImmutableList<Class<?>>> { @Override public ImmutableList<Class<?>> load(Class<?> c) throws Exception { ArrayList<Class<?>> supers = new ArrayList<Class<?>>(); while (true) { Class<?> s = c.getSuperclass(); if (s == null) { break; } supers.add(s); c = s; } Collections.reverse(supers); return ImmutableList.copyOf(supers); } } private static final LoadingCache<Class<?>,ImmutableList<Class<?>>> _superClassCache = CacheBuilder.newBuilder().weakKeys().build(new SuperClassCacheLoader()); /** * Returns an array of super classes above {@code c}. The first class will always be {@link Object} * or the array will be empty. Returns a cached value. */ public static ImmutableList<Class<?>> superClasses(Class<?> c) { return _superClassCache.getUnchecked(c); } /** * Returns a new array containing {@code elements} with component type set to the nearest common superclass * {@link #nearestCommonSuperClass(Object...)} of the objects it contains. */ public static <T extends Object> T[] narrowArrayOf(T...elements) { return narrowArrayOf(Object.class, Integer.MAX_VALUE, elements); } /** * Returns a new array containing {@code elements}, which must be a subclass of {@code rootClass}, * with component type set to nearest common superclass ({@link #nearestCommonSuperClass(Object...)}) * of the objects it contains that is no deeper than {@code maxClassDepthBelowRoot} below {@code rootClass}. * * @see #narrowArrayOf(Object...) * @see #copyOf(Class, Object...) */ public static <T extends Object> T[] narrowArrayOf( Class<? extends Object> rootClass, int maxRelativeClassDepth, T...elements) { Class<?> c = nearestCommonSuperClass(elements); if (maxRelativeClassDepth < 500) { ImmutableList<Class<?>> supers = superClasses(c); final int maxClassDepth = numberOfSuperClasses(rootClass) + maxRelativeClassDepth; System.out.format("maxDepth %d, supers size %d\n", maxClassDepth, supers.size()); if (maxClassDepth < supers.size()) { c = supers.get(maxClassDepth); } } return copyOf(c, elements); } /** * Returns a new array containing {@code elements} with specified {@code componentType}, which must * be a super class or interface of all the elements. * * @see #narrowArrayOf(T...) * @see #copyOf(Class, T...) */ public static <T extends Object> T[] copyOf(Class<?> componentType, T...elements) { final int n = elements.length; T[] array = (T[])Array.newInstance(componentType, n); for (int i = 0; i <n; ++i) { array[i] = elements[i]; } return array; } /** * Returns nearest common super class between {@code c1} and {@code c2}. * <ul> * <li>If {@code c1} and {@code c2} are equal, then {@code c1} will be returned, * even if it is an interface or primitive. * <li>Likewise if {@code c1} is assignable from {@code c2} ({@link Class#isAssignableFrom}) * then {@code c1} will be returned even if it is an interface, and vice versa if the * {@code c2} is assignable from {@code c1}. * <li>If the above is not true, and either argument is a primitive, then null will be returned. * <li>If the above is not true, and either argument is an interface, then {@link Object} will * be returned. * <li>Otherwise, the nearest superclass of both {@code c1} and {@code c2} will be returned. * </ul> */ public static Class<?> nearestCommonSuperClass(Class<?> c1, Class<?> c2) { if (c1.isAssignableFrom(c2)) { return c1; } else if (c2.isAssignableFrom(c1)) { return c2; } // At this point we know that the common superclass cannot be c1 or c2. if (c1.isPrimitive() || c2.isPrimitive()) { return null; } if (c1.isInterface() || c2.isInterface()) { return Object.class; } ImmutableList<Class<?>> supers1 = superClasses(c1); ImmutableList<Class<?>> supers2 = superClasses(c2); Class<?> common = Object.class; for (int i = 0, end = Math.min(supers1.size(), supers2.size()); i < end; ++i) { Class<?> super1 = supers1.get(i); if (super1.equals(supers2.get(i))) { common = super1; } else { break; } } return common; } /** * Returns the nearest common superclass (not interface) for all of the objects. * Returns {@link Object} if array contains no objects. */ public static <T> Class<?> nearestCommonSuperClass(T...objects) { int n = objects.length; if (n == 0) { return Object.class; } // Skip over empty slots int i = 0; while (objects[i] == null) { if (++i == n) { return Object.class; } } Class<?> declaredType = objects.getClass().getComponentType(); if (declaredType.isInterface()) { declaredType = Object.class; } else if (declaredType.isEnum() || Modifier.isFinal(declaredType.getModifiers())) { // There cannot be any subclasses return declaredType; } Class<?> c = objects[i].getClass(); // Compute common superclass for all of the classes of elements in the array. while (++i < n) { if (objects[i] == null) { continue; } if (c.isAssignableFrom(declaredType)) { break; } c = nearestCommonSuperClass(c, objects[i].getClass()); } return c; } /** * Computes the number of super classes above (and not including) this one. Returns 0 if * {@code c} is {@link Object}, a primitive type or is an interface. */ public static int numberOfSuperClasses(Class<?> c) { return superClasses(c).size(); } // TODO: methods for computing nearest common super interface (or class). Much harder because it // requires searching two DAGs instead of just a list. Because some interfaces such as Clonable, // Comparable, and Serializable are very common, methods dealing with interface probably should // specify root interfaces of interest. }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b14f129726015aca2c717115a4d60f5a479a5494
939c05442baf790867d4e8c6393fbdb1e8a0be30
/zh/or_zh2_160517_meo_vargadia/2/rmi/KerdesGyujtemeny.java
9229f20d3ec405f6f1ecb59e0117056996387c2f
[]
no_license
8emi95/elte-ik-or
560748d3dbc99605d833e6ca44e0c77d4274254f
f5eed356e83c688fbbfa4bb58cfe3bb5d49889bd
refs/heads/master
2020-04-23T18:29:40.843849
2019-02-18T23:04:09
2019-02-18T23:04:09
171,369,082
0
0
null
null
null
null
UTF-8
Java
false
false
1,763
java
package rmi; import java.io.*; import java.rmi.*; import java.rmi.server.*; import java.util.*; public class KerdesGyujtemeny extends UnicastRemoteObject implements KerdesGyujtemenyI{ ArrayList kerdes = new ArrayList<String>(); ArrayList valasz = new ArrayList<Integer>(); FileReader reader; KerdesGyujtemeny()throws RemoteException{} @Override public void feltolt(String file) throws RemoteException{ try{ reader = new FileReader(file); }catch(FileNotFoundException fe){System.err.println("File nem létezik");} BufferedReader file_br = new BufferedReader(reader); String line; try{ while (file_br.ready()) { line = file_br.readLine(); kerdes.add(line); line = file_br.readLine(); valasz.add(Integer.parseInt(line)); } file_br.close(); reader.close(); }catch(IOException e){System.err.println("Hiba");} } @Override public void ujKerdesValasz(String kerdes, int valasz) throws RemoteException{ this.kerdes.add(kerdes); this.valasz.add(valasz); } @Override public String kovetkezoKerdesValasz() throws RemoteException{ //visszaadja, és a saját listájából eltávolítja a soron következő kérdés-választ párt egyetlen Stringben összefűzve. A kérdést és a választ egy sortörés választja el egymástól. String q = this.kerdes.get(0).toString(); String a = this.valasz.get(0).toString(); String kesz = q + "\n" + a; this.kerdes.remove(0); this.valasz.remove(0); return kesz; } }
[ "8emi95@inf.elte.hu" ]
8emi95@inf.elte.hu
729de4e60806ba6be3f6c27e6de853d6edba8d65
337cb92559eff5f2055d304b464a6289f64c20eb
/support/cas-server-support-saml-idp-metadata-git/src/main/java/org/apereo/cas/config/SamlIdPGitIdPMetadataConfiguration.java
bb4591954b6c8b1b9f589919855b019cb9e9e65c
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
quibeLee/cas
a2b845ae390919e00a9d3ef07e2cb1c7b3889711
49eb3617c9a870e65faa1f3d04384000adfb9a6f
refs/heads/master
2022-12-25T18:31:39.013523
2020-09-25T17:02:06
2020-09-25T17:02:06
299,008,041
1
0
Apache-2.0
2020-09-27T10:33:58
2020-09-27T10:33:57
null
UTF-8
Java
false
false
4,050
java
package org.apereo.cas.config; import org.apereo.cas.configuration.CasConfigurationProperties; import org.apereo.cas.git.GitRepository; import org.apereo.cas.git.GitRepositoryBuilder; import org.apereo.cas.support.saml.idp.metadata.GitSamlIdPMetadataCipherExecutor; import org.apereo.cas.support.saml.idp.metadata.GitSamlIdPMetadataGenerator; import org.apereo.cas.support.saml.idp.metadata.GitSamlIdPMetadataLocator; import org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGenerator; import org.apereo.cas.support.saml.idp.metadata.generator.SamlIdPMetadataGeneratorConfigurationContext; import org.apereo.cas.support.saml.idp.metadata.locator.SamlIdPMetadataLocator; import org.apereo.cas.support.saml.idp.metadata.writer.SamlIdPCertificateAndKeyWriter; import org.apereo.cas.util.cipher.CipherExecutorUtils; import org.apereo.cas.util.crypto.CipherExecutor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import lombok.val; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * This is {@link SamlIdPGitIdPMetadataConfiguration}. * * @author Misagh Moayyed * @since 5.2.0 */ @Configuration("samlIdPGitIdPMetadataConfiguration") @EnableConfigurationProperties(CasConfigurationProperties.class) @Slf4j public class SamlIdPGitIdPMetadataConfiguration { @Autowired private ConfigurableApplicationContext applicationContext; @Autowired private CasConfigurationProperties casProperties; @Autowired @Qualifier("samlSelfSignedCertificateWriter") private ObjectProvider<SamlIdPCertificateAndKeyWriter> samlSelfSignedCertificateWriter; @Bean @ConditionalOnMissingBean(name = "gitSamlIdPMetadataCipherExecutor") @RefreshScope public CipherExecutor gitSamlIdPMetadataCipherExecutor() { val idp = casProperties.getAuthn().getSamlIdp(); val crypto = idp.getMetadata().getGit().getCrypto(); if (crypto.isEnabled()) { return CipherExecutorUtils.newStringCipherExecutor(crypto, GitSamlIdPMetadataCipherExecutor.class); } LOGGER.info("Git SAML IdP metadata encryption/signing is turned off and " + "MAY NOT be safe in a production environment. " + "Consider using other choices to handle encryption, signing and verification of " + "metadata artifacts"); return CipherExecutor.noOp(); } @Bean @RefreshScope @ConditionalOnMissingBean(name = "gitIdPMetadataRepositoryInstance") public GitRepository gitIdPMetadataRepositoryInstance() { val git = casProperties.getAuthn().getSamlIdp().getMetadata().getGit(); return GitRepositoryBuilder.newInstance(git).build(); } @Bean @SneakyThrows @RefreshScope public SamlIdPMetadataGenerator samlIdPMetadataGenerator() { val context = SamlIdPMetadataGeneratorConfigurationContext.builder() .samlIdPMetadataLocator(samlIdPMetadataLocator()) .samlIdPCertificateAndKeyWriter(samlSelfSignedCertificateWriter.getObject()) .applicationContext(applicationContext) .casProperties(casProperties) .metadataCipherExecutor(gitSamlIdPMetadataCipherExecutor()) .build(); return new GitSamlIdPMetadataGenerator(context, gitIdPMetadataRepositoryInstance()); } @Bean @SneakyThrows @RefreshScope public SamlIdPMetadataLocator samlIdPMetadataLocator() { return new GitSamlIdPMetadataLocator(gitIdPMetadataRepositoryInstance()); } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
498ddd3534253cc2aa22a4b285d04babce431cde
98baffdba561c3f44a6a5fdb1d13c60c7ea6b7e3
/sido-schema/src/test/java/net/sf/sido/schema/model/DefaultSidoRefPropertyTest.java
6298de828ac7d8a40a3072f6fce36ca7064bcc0c
[]
no_license
dcoraboeuf/jsido
e6449e37faee33f490f57b5ccf6d25c3a738d3a4
09d7590c5f43ed338e23d33018ab55543b58bb4c
refs/heads/master
2020-03-29T18:13:44.917017
2012-05-14T18:51:36
2012-05-14T18:51:36
2,900,788
0
0
null
null
null
null
UTF-8
Java
false
false
2,267
java
package net.sf.sido.schema.model; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import net.sf.sido.schema.SidoType; import org.junit.Test; public class DefaultSidoRefPropertyTest { @Test(expected = NullPointerException.class) public void constructor_no_name() { new DefaultSidoRefProperty(null, null, false, false, null); } @Test(expected = IllegalArgumentException.class) public void constructor_blank_name() { new DefaultSidoRefProperty(" ", null, false, false, null); } @Test(expected = NullPointerException.class) public void constructor_no_ref() { new DefaultSidoRefProperty("name", null, false, false, null); } @Test public void constructor() { SidoType ref = mock(SidoType.class); DefaultSidoRefProperty p = new DefaultSidoRefProperty("name", ref, false, false, null); assertEquals("name", p.getName()); assertSame(ref, p.getType()); assertFalse(p.isNullable()); assertFalse(p.isCollection()); assertNull(p.getCollectionIndex()); } @Test public void constructor_nullable() { SidoType ref = mock(SidoType.class); DefaultSidoRefProperty p = new DefaultSidoRefProperty("name", ref, true, false, null); assertEquals("name", p.getName()); assertSame(ref, p.getType()); assertTrue(p.isNullable()); assertFalse(p.isCollection()); assertNull(p.getCollectionIndex()); } @Test public void constructor_collection() { SidoType ref = mock(SidoType.class); DefaultSidoRefProperty p = new DefaultSidoRefProperty("name", ref, false, true, null); assertEquals("name", p.getName()); assertSame(ref, p.getType()); assertFalse(p.isNullable()); assertTrue(p.isCollection()); assertNull(p.getCollectionIndex()); } @Test public void constructor_indexed_collection() { SidoType ref = mock(SidoType.class); DefaultSidoRefProperty p = new DefaultSidoRefProperty("users", ref, false, true, "name"); assertEquals("users", p.getName()); assertSame(ref, p.getType()); assertFalse(p.isNullable()); assertTrue(p.isCollection()); assertEquals("name", p.getCollectionIndex()); } }
[ "damien.coraboeuf@gmail.com" ]
damien.coraboeuf@gmail.com
7d2d90dcf8bbe193d1b2e2e44e6f45f0d71d79fe
9358108f386b8c718f10c0150043f3af60e64712
/integrella-microservices-producer-fpml/src/main/java/com/integrella/fpML/schema/PrincipalMovement.java
1ddfd5f0f286813e86ee1ba8f59473eb7cefcad6
[]
no_license
kashim-git/integrella-microservices
6148b7b1683ff6b787ff5d9dba7ef0b15557caa4
f92d6a2ea818267364f90f2f1b2d373fbab37cfc
refs/heads/master
2021-01-20T02:53:03.118896
2017-04-28T13:31:55
2017-04-28T13:31:55
89,459,083
0
0
null
null
null
null
UTF-8
Java
false
false
5,122
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.04.26 at 04:37:38 PM BST // package com.integrella.fpML.schema; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for PrincipalMovement complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="PrincipalMovement"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;group ref="{http://www.fpml.org/FpML-5/master}PaymentDetails.model"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PrincipalMovement", propOrder = { "identifier", "payerPartyReference", "payerAccountReference", "receiverPartyReference", "receiverAccountReference", "paymentAmount" }) public class PrincipalMovement { protected PaymentId identifier; protected PartyReference payerPartyReference; protected AccountReference payerAccountReference; protected PartyReference receiverPartyReference; protected AccountReference receiverAccountReference; protected Money paymentAmount; /** * Gets the value of the identifier property. * * @return * possible object is * {@link PaymentId } * */ public PaymentId getIdentifier() { return identifier; } /** * Sets the value of the identifier property. * * @param value * allowed object is * {@link PaymentId } * */ public void setIdentifier(PaymentId value) { this.identifier = value; } /** * Gets the value of the payerPartyReference property. * * @return * possible object is * {@link PartyReference } * */ public PartyReference getPayerPartyReference() { return payerPartyReference; } /** * Sets the value of the payerPartyReference property. * * @param value * allowed object is * {@link PartyReference } * */ public void setPayerPartyReference(PartyReference value) { this.payerPartyReference = value; } /** * Gets the value of the payerAccountReference property. * * @return * possible object is * {@link AccountReference } * */ public AccountReference getPayerAccountReference() { return payerAccountReference; } /** * Sets the value of the payerAccountReference property. * * @param value * allowed object is * {@link AccountReference } * */ public void setPayerAccountReference(AccountReference value) { this.payerAccountReference = value; } /** * Gets the value of the receiverPartyReference property. * * @return * possible object is * {@link PartyReference } * */ public PartyReference getReceiverPartyReference() { return receiverPartyReference; } /** * Sets the value of the receiverPartyReference property. * * @param value * allowed object is * {@link PartyReference } * */ public void setReceiverPartyReference(PartyReference value) { this.receiverPartyReference = value; } /** * Gets the value of the receiverAccountReference property. * * @return * possible object is * {@link AccountReference } * */ public AccountReference getReceiverAccountReference() { return receiverAccountReference; } /** * Sets the value of the receiverAccountReference property. * * @param value * allowed object is * {@link AccountReference } * */ public void setReceiverAccountReference(AccountReference value) { this.receiverAccountReference = value; } /** * Gets the value of the paymentAmount property. * * @return * possible object is * {@link Money } * */ public Money getPaymentAmount() { return paymentAmount; } /** * Sets the value of the paymentAmount property. * * @param value * allowed object is * {@link Money } * */ public void setPaymentAmount(Money value) { this.paymentAmount = value; } }
[ "Kashim@192.168.47.69" ]
Kashim@192.168.47.69
8239895a92d5ff1ac352b4a9f452d4b4032a22be
a666c798a28223f97d74d21786f9a4f4000d5acb
/edu.harvard.i2b2.ontology/gensrc/edu/harvard/i2b2/ontology/datavo/crc/setfinder/query/FindByChildType.java
f95bf77a789a400d634229b57e704204183a8cde
[]
no_license
gmacdonnell/i2b2-fsu-1704
d65239edf95aa3b25844a6ed9af599e06dcaa185
12638996fe46a7014ac827e359c40e5b0e8c1d3e
refs/heads/master
2021-01-23T07:02:31.537241
2015-01-27T15:09:33
2015-01-27T15:09:33
29,916,117
0
0
null
null
null
null
UTF-8
Java
false
false
5,355
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.01.26 at 12:47:09 PM EST // package edu.harvard.i2b2.ontology.datavo.crc.setfinder.query; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; /** * <p>Java class for findBy_childType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="findBy_childType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="match_str" type="{http://www.i2b2.org/xsd/cell/crc/psm/1.1/}match_strType"/> * &lt;element name="create_date" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/> * &lt;element name="user_id" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="ascending" type="{http://www.w3.org/2001/XMLSchema}boolean"/> * &lt;/sequence> * &lt;attribute name="max" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * &lt;attribute name="category" default="top"> * &lt;simpleType> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="@"/> * &lt;enumeration value="top"/> * &lt;enumeration value="results"/> * &lt;enumeration value="pdo"/> * &lt;/restriction> * &lt;/simpleType> * &lt;/attribute> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "findBy_childType", propOrder = { "matchStr", "createDate", "userId", "ascending" }) public class FindByChildType { @XmlElement(name = "match_str", required = true) protected MatchStrType matchStr; @XmlElement(name = "create_date") @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar createDate; @XmlElement(name = "user_id", required = true) protected String userId; @XmlElement(defaultValue = "false") protected boolean ascending; @XmlAttribute(required = true) protected int max; @XmlAttribute protected String category; /** * Gets the value of the matchStr property. * * @return * possible object is * {@link MatchStrType } * */ public MatchStrType getMatchStr() { return matchStr; } /** * Sets the value of the matchStr property. * * @param value * allowed object is * {@link MatchStrType } * */ public void setMatchStr(MatchStrType value) { this.matchStr = value; } /** * Gets the value of the createDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getCreateDate() { return createDate; } /** * Sets the value of the createDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setCreateDate(XMLGregorianCalendar value) { this.createDate = value; } /** * Gets the value of the userId property. * * @return * possible object is * {@link String } * */ public String getUserId() { return userId; } /** * Sets the value of the userId property. * * @param value * allowed object is * {@link String } * */ public void setUserId(String value) { this.userId = value; } /** * Gets the value of the ascending property. * */ public boolean isAscending() { return ascending; } /** * Sets the value of the ascending property. * */ public void setAscending(boolean value) { this.ascending = value; } /** * Gets the value of the max property. * */ public int getMax() { return max; } /** * Sets the value of the max property. * */ public void setMax(int value) { this.max = value; } /** * Gets the value of the category property. * * @return * possible object is * {@link String } * */ public String getCategory() { if (category == null) { return "top"; } else { return category; } } /** * Sets the value of the category property. * * @param value * allowed object is * {@link String } * */ public void setCategory(String value) { this.category = value; } }
[ "gmacdonnell@fsu.edu" ]
gmacdonnell@fsu.edu
7eefb600ba1c54ec11db6986813601906da3ae53
79b081f6ea18ad0af5bb57712eaba90a17b4957a
/hyc-kernel/kernel-core/src/main/java/com/hyc/telehealth/core/config/PropertiesAutoConfiguration.java
2f744e0cc339b9116c5bc0498234e0b90005883d
[]
no_license
ztNozdormu/hyc-master
752d2fbf835d5a7f542e1f5bb0fd64823cbd2b38
569449dd321086aa4332495b4229dccffd12098b
refs/heads/master
2020-04-24T23:56:13.172328
2019-02-24T16:31:35
2019-02-24T16:31:35
172,361,496
0
1
null
null
null
null
UTF-8
Java
false
false
1,364
java
/** * Copyright 2018-2020 stylefeng & fengshuonan (sn93@qq.com) * <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 com.hyc.telehealth.core.config; import com.hyc.telehealth.core.config.properties.AppNameProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; /** * 默认的配置 * * @author fengshuonan * @date 2018-01-07 12:33 */ @Configuration @PropertySource("classpath:/default-config.properties") public class PropertiesAutoConfiguration { @Bean @ConfigurationProperties(prefix = "spring.application.name") public AppNameProperties appNameProperties() { return new AppNameProperties(); } }
[ "w1999wtw3537@sina.com" ]
w1999wtw3537@sina.com
1272d61e55ce62d5fb12655078851d6dc1339e5a
8ee7f4839bbdd2246065701409285044b0bb01d3
/src/main/java/top/cellargalaxy/mycloud/service/security/SecurityServiceImpl.java
197354b2a2c738ab5f625d8feb06802e26685e7d
[]
no_license
cellargalaxy/mycloud
528f302b2653f1217acf097a83e9124bdf3dfe03
0f52dc783bfb6b9ce17212f1776a5fd193d95402
refs/heads/master
2021-07-12T00:44:15.904544
2019-01-09T09:56:24
2019-01-09T09:56:24
107,125,513
12
1
null
null
null
null
UTF-8
Java
false
false
5,539
java
package top.cellargalaxy.mycloud.service.security; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import top.cellargalaxy.mycloud.configuration.MycloudConfiguration; import top.cellargalaxy.mycloud.model.bo.AuthorizationBo; import top.cellargalaxy.mycloud.model.bo.UserBo; import top.cellargalaxy.mycloud.model.po.UserPo; import top.cellargalaxy.mycloud.model.vo.UserVo; import top.cellargalaxy.mycloud.service.UserService; import top.cellargalaxy.mycloud.util.model.SecurityUser; import javax.servlet.http.HttpServletRequest; import java.util.*; /** * @author cellargalaxy * @time 2018/7/31 */ @Service public class SecurityServiceImpl implements SecurityService { public static final int EXPIRATION_TIME = 1000 * 60 * 60 * 6; public static final String USER_ID_KEY = "userId"; public static final String CREATE_TIME_KEY = "createTime"; public static final String UPDATE_TIME_KEY = "updateTime"; public static final String PERMISSIONS_KEY = "permissions"; private final Logger logger = LoggerFactory.getLogger(this.getClass()); private final String secret; @Autowired private UserService userService; @Autowired public SecurityServiceImpl(MycloudConfiguration mycloudConfiguration) { secret = mycloudConfiguration.getSecret(); } public static final SecurityUserImpl getSecurityUser(HttpServletRequest request) { return (SecurityUserImpl) request.getAttribute(USER_KEY); } @Override public SecurityUser checkSecurityUser(String username, String password) { logger.debug("checkSecurityUser: {}", username); SecurityUser securityUser = getSecurityUser(username); if (securityUser != null && securityUser.getPassword().equals(password)) { return securityUser; } else { return null; } } @Override public SecurityUser getSecurityUser(String username) { logger.debug("getSecurityUser: {}", username); UserPo userPo = new UserPo(); userPo.setUsername(username); UserVo userVo = userService.getUserVo(userPo); if (userVo != null) { SecurityUserImpl securityUser = new SecurityUserImpl(); UserBo userBo = userVo.getUser(); BeanUtils.copyProperties(userBo, securityUser); List<AuthorizationBo> authorizationBos = userVo.getAuthorizations(); authorizationBos.stream().forEach(authorizationBo -> securityUser.getPermissions().add(authorizationBo.getPermission().toString())); return securityUser; } return null; } @Override public String createToken(String username) { logger.debug("createToken:{}", username); return createToken(getSecurityUser(username)); } @Override public String createToken(SecurityUser securityUser) { logger.debug("createToken:{}", securityUser); if (securityUser == null) { return null; } SecurityUserImpl securityUserImpl = (SecurityUserImpl) securityUser; //获取账号的权限,然后变成用逗号相间隔的字符串 StringBuilder stringBuilder = new StringBuilder(); Iterator<String> iterator = securityUserImpl.getPermissions().iterator(); if (iterator.hasNext()) { stringBuilder.append(iterator.next()); } while (iterator.hasNext()) { stringBuilder.append("," + iterator.next()); } String jwt = Jwts.builder() .claim(USER_ID_KEY, securityUserImpl.getUserId()) .claim(CREATE_TIME_KEY, securityUserImpl.getCreateTime().getTime()) .claim(UPDATE_TIME_KEY, securityUserImpl.getUpdateTime().getTime()) //保存权限/角色 .claim(PERMISSIONS_KEY, stringBuilder.toString()) //用户名写入标题 .setSubject(securityUserImpl.getUsername()) //有效期设置 .setExpiration(new Date(System.currentTimeMillis() + EXPIRATION_TIME)) //签名设置 .signWith(SignatureAlgorithm.HS512, secret) .compact(); return jwt; } @Override public SecurityUser checkToken(String token) { logger.debug("checkToken:{}", token); if (token == null) { return null; } try { Claims claims = Jwts.parser() .setSigningKey(secret) .parseClaimsJws(token) .getBody(); int userId = claims.get(USER_ID_KEY, Integer.class); String username = claims.getSubject(); Date createTime = new Date(claims.get(CREATE_TIME_KEY, Long.class)); Date updateTime = new Date(claims.get(UPDATE_TIME_KEY, Long.class)); final String[] permissions = claims.get(PERMISSIONS_KEY, String.class).split(","); return new SecurityUserImpl() {{ setUserId(userId); setUsername(username); setCreateTime(createTime); setUpdateTime(updateTime); for (String permission : permissions) { getPermissions().add(permission); } }}; } catch (Exception e) { // e.printStackTrace(); logger.info("checkToken:token解析失败:" + e); return null; } } public static class SecurityUserImpl extends UserPo implements SecurityUser { private final Set<String> permissions; public SecurityUserImpl() { permissions = new HashSet<>(); } @Override public String getUsername() { return super.getUsername(); } @Override public String getPassword() { return super.getPassword(); } @Override public Set<String> getPermissions() { return permissions; } @Override public String toString() { return "SecurityUserImpl{" + "username=" + getUsername() + ", permissions=" + permissions + '}'; } } }
[ "cellargalaxy@gmail.com" ]
cellargalaxy@gmail.com
8d21428896ef8cbb40fdc5ffce6644297188d9e8
dbeb9a7117042832bdc4311e3a556b43e425da32
/app/src/main/java/com/nokelock/utils/ToastUtil.java
f8ac6b3dc32092437174f0d7e4f2d79370fc850c
[]
no_license
yzbbanban/OpenBLE-master-2Bl
cc65c2684e9f90c017f161ad5b7bd928b42d7570
4557f66577aa8e5f3fb36c8dc988c3d59588254d
refs/heads/master
2020-06-17T23:38:54.159295
2019-07-10T15:21:26
2019-07-10T15:21:26
196,100,936
0
0
null
null
null
null
UTF-8
Java
false
false
3,153
java
package com.nokelock.utils; import android.view.Gravity; import android.widget.Toast; import com.nokelock.nokelockble.App; /** * Created by brander on 2017/9/21. * 吐司工具 */ public class ToastUtil { private static Toast toast;//实现不管我们触发多少次Toast调用,都只会持续一次Toast显示的时长 /** * 短时间显示Toast【居下】 * * @param msg 显示的内容-字符串 */ public static void showShortToast(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_SHORT); } else { toast.setText(msg); } toast.show(); } } /** * 短时间显示Toast【居中】 * * @param msg 显示的内容-字符串 */ public static void showShortToastCenter(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0, 0); } else { toast.setText(msg); } toast.show(); } } /** * 短时间显示Toast【居上】 * * @param msg 显示的内容-字符串 */ public static void showShortToastTop(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_SHORT); toast.setGravity(Gravity.TOP, 0, 0); } else { toast.setText(msg); } toast.show(); } } /** * 长时间显示Toast【居下】 * * @param msg 显示的内容-字符串 */ public static void showLongToast(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_LONG); } else { toast.setText(msg); } toast.show(); } } /** * 长时间显示Toast【居中】 * * @param msg 显示的内容-字符串 */ public static void showLongToastCenter(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); } else { toast.setText(msg); } toast.show(); } } /** * 长时间显示Toast【居上】 * * @param msg 显示的内容-字符串 */ public static void showLongToastTop(String msg) { if (App.getInstance() != null) { if (toast == null) { toast = Toast.makeText(App.getInstance(), msg, Toast.LENGTH_LONG); toast.setGravity(Gravity.TOP, 0, 0); } else { toast.setText(msg); } toast.show(); } } }
[ "yzbbanban@live.com" ]
yzbbanban@live.com
dcec40115b08a1317f0652d38dde8ebdedc134bc
56d3f56b1b773992e888aeb36a9d64b41a3767da
/SeleniumWebdriver/src/day9/Xpaths2.java
22342b091f8b234853e9a2241e37c91fe372bc22
[]
no_license
SaiKrishna12/March2BatchSeleniumPrograms
918467ddf2b9827adededa62d3d06a93e933c535
6c54d4794c84a88631596911af09e3d421786e52
refs/heads/master
2016-09-03T06:48:24.253829
2015-04-12T10:47:07
2015-04-12T10:47:07
33,812,959
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package day9; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Xpaths2 { public static void main(String[] args) { FirefoxDriver driver=new FirefoxDriver(); driver.get("http://facebook.com"); List<WebElement> input=driver.findElements(By.xpath ("//input[@type='text' or @type='password']")); System.out.println(input.size()); String[] str={"one","two","three","four","five","six", "seven","eight"}; for(int i=0;i<input.size();i++) { input.get(i).sendKeys(str[i]); } } }
[ "saikrishna_gandham@yahoo.co.in" ]
saikrishna_gandham@yahoo.co.in
6b2c6471f0941b7f1cd338b6765f13db882e45fe
356dad203c0f684c356235d8a7f2a9f9afcd7c95
/app/src/main/java/re/android/hiddenapi/MainActivity.java
c40c7a10ce503cca87f8b0812ccf1625b026cf66
[]
no_license
LH-413x/AndroidDriverFuzzer
012bdfeb908671363061c6f44e58518a6f83ced2
d1b7440d046d1eb40e1cf37eddfb05ec62fd97d7
refs/heads/master
2020-06-30T23:49:44.582496
2019-08-07T06:28:33
2019-08-07T06:28:33
200,986,792
1
0
null
null
null
null
UTF-8
Java
false
false
439
java
package re.android.hiddenapi; public class MainActivity { static { System.loadLibrary("hiddenapi-bypass"); } public void disable() { this.disableProtectedNamespace(); this.disableHiddenApi(); } public native boolean isHiddenApiEnabled(); public native boolean isProtectedNamespaceEnabled(); public native void disableProtectedNamespace(); public native void disableHiddenApi(); }
[ "you@example.com" ]
you@example.com
b244b199aea17c2bf5c1452607f7db362bcbd56a
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/io/vavr/collection/euler/Euler27Test.java
b7be938dd623f3a6e1459b21419fb6eb0b8630ea
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,291
java
/** * __ __ __ __ __ ___ * \ \ / / \ \ / / __/ * \ \/ / /\ \ \/ / / * \____/__/ \__\____/__/ * * Copyright 2014-2019 Vavr, http://vavr.io * * 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.vavr.collection.euler; import org.junit.Test; /** * <strong>Problem 27: Quadratic primes</strong> * <p> * Euler discovered the remarkable quadratic formula: * <p> * n? + n + 41 * <p> * It turns out that the formula will produce 40 primes for the consecutive * values n = 0 to 39. However, when n = 40, 40^2 + 40 + 41 = 40(40 + 1) + 41 is * divisible by 41, and certainly when n = 41, 41? + 41 + 41 is clearly * divisible by 41. * <p> * The incredible formula n? ? 79n + 1601 was discovered, which produces 80 * primes for the consecutive values n = 0 to 79. The product of the * coefficients, ?79 and 1601, is ?126479. * <p> * Considering quadratics of the form: * <p> * n? + an + b, where |a| < 1000 and |b| < 1000 <p> * where |n| is the modulus/absolute value of n e.g. |11| = 11 and |?4| = 4 * <p> * Find the product of the coefficients, a and b, for the quadratic expression * that produces the maximum number of primes for consecutive values of n, * starting with n = 0. * <p> * See also * <a href="https://projecteuler.net/problem=27">projecteuler.net problem 27 * </a>. */ public class Euler27Test { @Test public void shouldSolveProblem27() { assertThat(Euler27Test.numberOfConsecutivePrimesProducedByFormulaWithCoefficients(1, 41)).isEqualTo(40); assertThat(Euler27Test.numberOfConsecutivePrimesProducedByFormulaWithCoefficients((-79), 1601)).isEqualTo(80); assertThat(Euler27Test.productOfCoefficientsWithMostConsecutivePrimes((-999), 999)).isEqualTo((-59231)); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
ebc041633fd16eff31297c7607cd3313615b123f
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/lucene/2.4/org/apache/lucene/search/function/ReverseOrdFieldSource.java
65f22542ad637b9638cf6632a1883dffd65fd2f0
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
3,293
java
package org.apache.lucene.search.function; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.FieldCache; import java.io.IOException; /** * Expert: obtains the ordinal of the field value from the default Lucene * {@link org.apache.lucene.search.FieldCache FieldCache} using getStringIndex() * and reverses the order. * <p> * The native lucene index order is used to assign an ordinal value for each field value. * <p> * Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. * <br> * Example of reverse ordinal (rord): * <br>If there were only three field values: "apple","banana","pear" * <br>then rord("apple")=3, rord("banana")=2, ord("pear")=1 * <p> * WARNING: * rord() depends on the position in an index and can thus change * when other documents are inserted or deleted, * or if a MultiSearcher is used. * * <p><font color="#FF0000"> * WARNING: The status of the <b>search.function</b> package is experimental. * The APIs introduced here might change in the future and will not be * supported anymore in such a case.</font> * */ public class ReverseOrdFieldSource extends ValueSource { public String field; /** * Contructor for a certain field. * @param field field whose values reverse order is used. */ public ReverseOrdFieldSource(String field) { this.field = field; } /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#description() */ public String description() { return "rord("+field+')'; } /*(non-Javadoc) @see org.apache.lucene.search.function.ValueSource#getValues(org.apache.lucene.index.IndexReader) */ public DocValues getValues(IndexReader reader) throws IOException { final FieldCache.StringIndex sindex = FieldCache.DEFAULT.getStringIndex(reader, field); final int arr[] = sindex.order; final int end = sindex.lookup.length; return new DocValues() { /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#floatVal(int) */ public float floatVal(int doc) { return (float)(end - arr[doc]); } /* (non-Javadoc) @see org.apache.lucene.search.function.DocValues#intVal(int) */ public int intVal(int doc) { return end - arr[doc]; } /* (non-Javadoc) @see org.apache.lucene.search.function.DocValues#strVal(int) */ public String strVal(int doc) { return Integer.toString(intVal(doc)); } /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#toString(int) */ public String toString(int doc) { return description() + '=' + strVal(doc); } /*(non-Javadoc) @see org.apache.lucene.search.function.DocValues#getInnerArray() */ Object getInnerArray() { return arr; } }; } /*(non-Javadoc) @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object o) { if (o.getClass() != ReverseOrdFieldSource.class) return false; ReverseOrdFieldSource other = (ReverseOrdFieldSource)o; return this.field.equals(other.field); } private static final int hcode = ReverseOrdFieldSource.class.hashCode(); /*(non-Javadoc) @see java.lang.Object#hashCode() */ public int hashCode() { return hcode + field.hashCode(); } }
[ "hvdthong@github.com" ]
hvdthong@github.com
52b610e769e09b0585c83f9bbdbc81ce3bf8b67c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_d71d4be5f633e8d0765bd2deb2a9cc09d8093c0a/Ingredient/2_d71d4be5f633e8d0765bd2deb2a9cc09d8093c0a_Ingredient_s.java
d447e65140d63baeda5b4f2fe9cf2f7e62aad868
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,774
java
package ca.ualberta.cmput301w13t11.FoodBook.model; import android.content.ContentValues; /** * Class which models an ingredient (as part of a recipe, or in the User's MyIngredients Db). * @author Marko Babic * */ public class Ingredient { private String name; private String unit; private float quantity; /** * Constructor -- creates an Ingredient object from the given parameters. * @param name The name of the Ingredient. * @param unit The unit type of the Ingredient. * @param quantity The quantity of this Ingredient. */ public Ingredient(String name, String unit, float quantity) { this.name = name; this.unit = unit; this.quantity = quantity; } public String getName() { return this.name; } public String getUnit() { return this.unit; } public float getQuantity() { return this.quantity; } public void setName(String name) { this.name = name; } public void setUnit(String unit) { this.unit = unit; } public void setQuantity(float quantity) { this.quantity = quantity; } /** * Converts an Ingredient object to a ContentValues object to be stored in the database. * @param ingred The ingredient to be transformed. * @return An appropriately transformed cop of the Ingredient for database storage. */ public ContentValues toContentValues() { ContentValues values = new ContentValues(); values.put("name", name); values.put("unit", unit); values.put("quantity", quantity); return values; } /** * Returns a string representation of the object */ public String toString(){ return unit + " " + quantity + " " + name ; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b83d4859302e783cbd1fcc05156d39960c911cf2
2d33e8f5ea8b65ecd65202e6b2a8b27f54d6c11a
/MixedServer/src/main/java/mixedserver/protocol/SessionAttributes.java
e02fb625a6227d74b9c08f0f8a50c857bc84765c
[]
no_license
zhangxhbeta/MixedLibrary
10e49c0c4aab652aa9d860cfee5ac0f1501185ba
94cef9af4be6fa354699ef290a580914c9b6a086
refs/heads/master
2021-01-19T00:12:54.248941
2017-02-04T09:11:12
2017-02-04T09:11:12
16,190,871
1
0
null
null
null
null
UTF-8
Java
false
false
238
java
package mixedserver.protocol; public interface SessionAttributes { public abstract Object getAttribute(String s); public abstract void setAttribute(String s, Object obj); public abstract void removeAttribute(String s); }
[ "zhangxhbeta@gmail.com" ]
zhangxhbeta@gmail.com
7a30f7f61977102cfc9e81282bdb10fd59acc4d1
ee19a74c2260c4b31a2fce69bb6b872050b9f055
/src/org/traccar/protocol/LaipacProtocol.java
f642047495b041e8046191cae96bebb3371704f6
[ "Apache-2.0" ]
permissive
jgraham0325/traccar
85638d4dbec34e0eee56e7840b4dc687e2a2fda6
4e716070ebf212f2a7589b9ddffe0f25dca2ec9b
refs/heads/master
2021-05-04T08:44:16.894935
2016-10-30T21:26:58
2016-10-30T21:26:58
70,417,997
1
0
null
2016-10-30T21:26:59
2016-10-09T17:06:58
Java
UTF-8
Java
false
false
1,762
java
/* * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.traccar.protocol; import org.jboss.netty.bootstrap.ServerBootstrap; import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder; import org.jboss.netty.handler.codec.string.StringDecoder; import org.jboss.netty.handler.codec.string.StringEncoder; import org.traccar.BaseProtocol; import org.traccar.TrackerServer; import java.util.List; public class LaipacProtocol extends BaseProtocol { public LaipacProtocol() { super("laipac"); } @Override public void initTrackerServers(List<TrackerServer> serverList) { serverList.add(new TrackerServer(new ServerBootstrap(), getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("stringEncoder", new StringEncoder()); pipeline.addLast("stringDecoder", new StringDecoder()); pipeline.addLast("objectDecoder", new LaipacProtocolDecoder(LaipacProtocol.this)); } }); } }
[ "anton.tananaev@gmail.com" ]
anton.tananaev@gmail.com
6fb568c930a0ddc7917f14325f5c4a2ae5a8550f
447520f40e82a060368a0802a391697bc00be96f
/apks/malware/app49/source/com/google/android/gms/common/fr.java
46697fa87990ee3526d45936ec7d5b0eacf5057e
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
244
java
package com.google.android.gms.common; final class fr { static final i[] a = { new fs(i.a("0‚\003ï0‚\002× \003\002\001\002\002\t\000ãÓÆØxŠÉù0")), new ft(i.a("0‚\003ï0‚\002× \003\002\001\002\002\t\000ŒÉFð¡\0161a0")) }; }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
091c7ac94aca84ed792e2bdb1c21a837e4ab5ff4
af2f9b780338830f6b9f6f5dab9150b9e530841d
/src/main/java/com/febspringjdbc/febspringjdbcdemo/repos/StudentRepo.java
1a3c0a0ecbf5f43972edebe97fdcba7f4a0d2df7
[]
no_license
abhijeetvc/febspringjdbcdemo
6ff610d2858ed39fdb1a645fe3add1512f454f15
950c39d96e9562bb33a23b820e68d49ad80c08dd
refs/heads/master
2020-04-20T14:55:03.247898
2019-02-03T05:35:45
2019-02-03T05:35:45
168,913,487
0
0
null
null
null
null
UTF-8
Java
false
false
285
java
package com.febspringjdbc.febspringjdbcdemo.repos; import com.febspringjdbc.febspringjdbcdemo.model.Student; import java.util.List; /** * Created by abhi on 02/02/19. */ public interface StudentRepo { List<Student> getStudentData(); Student getStudentById(Integer id); }
[ "abhijeetvc7@gmail.com" ]
abhijeetvc7@gmail.com
15a319e29aded4da74d196cb34e78597825c94d7
9d4427e04ba63a1df778b359dd5b76477ba270ce
/src/main/java/org/yx/http/ErrorCode.java
9def7b012e71f4e468cf75080846d73f76582274
[]
no_license
wanshijiain/sumk
be95ce37dc1daea256bc48c5c33ed51deed946b5
ba71bf171d6666131e5e6f63af092580354f28e7
refs/heads/master
2021-01-11T08:35:55.363632
2016-09-08T13:38:17
2016-09-08T13:38:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package org.yx.http; public interface ErrorCode { /** * 登陆失败 */ int LOGINFAILED=1001; /** * session过期 */ int SESSION_ERROR = 1002; }
[ "Administrator@youxia" ]
Administrator@youxia
5d8095af05aa2420db588d06059a96dfd0fb3797
893a7d8299a6cf2fef057449808ad578a116a868
/src/com/cisoft/action/Pages.java
02303db92ab61c66862f76162d7caf83a157e03f
[]
no_license
liuguicheng/CisoftOnline
1c32f2a4e7ef3cccba76c0a2f0345244f8763730
fc517c287e07f3bb610c4df6284c182cb2aacbc5
refs/heads/master
2021-01-13T10:21:24.758189
2016-10-28T08:14:54
2016-10-28T08:14:54
72,187,847
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.cisoft.action; import com.cisoft.model.PageResponse; public class Pages<T> extends BaseController{ //用来接受前端传递过来的值 protected int page; protected int rows; //用来返回 protected PageResponse<T> pageResponse=new PageResponse<T>(); public int getPage() { return page; } public void setPage(int page) { this.page = page; } public int getRows() { return rows; } public void setRows(int rows) { this.rows = rows; } public PageResponse<T> getPageResponse() { return pageResponse; } }
[ "282303392@qq.com" ]
282303392@qq.com
fa00feaa81f396f195b84230ca10947f25ecc8a6
c5498743036544b67876707222d974582d435b40
/DesignPattern/创建型模式/Creation_mode/chapter7_prototype/src/chapter7_4/DataSet.java
bf1c51e56cb80bb9cf1afeb2c62c4aa5b2f600f3
[]
no_license
lhang662543608/Java_Notes
3035dd5eedc98eec9d154d081cddb0007d36ecf5
10b816c0c7fffc7dfe7876c643a2beefb4557b3d
refs/heads/master
2020-05-25T22:06:03.871757
2020-01-11T02:13:40
2020-01-11T02:13:40
188,006,603
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package chapter7_4; import java.io.Serializable; /** * @author lhang * @create 2019-10-16 22:02 */ public class DataSet implements Serializable { }
[ "ljh_662543608@163.com" ]
ljh_662543608@163.com
a22f4dd465458f32ff7fe5e05b9580201ea158ce
3b5bae84267cd885f4e3bbc3f0cf46d2cb1a0d43
/source/kone-basic-commons-src/kxd/net/SimpleNetResponse.java
c99bc4e621751c474baa067779be858ccc19d526
[]
no_license
deerme/KXD
ef0e3f5e2bf5c0397cc67fab7601a6ac3b16ba54
9f7210ab01f827dd1abbedab70ea35d6eae641c7
refs/heads/master
2021-06-18T09:54:33.585911
2017-06-08T02:12:53
2017-06-08T02:12:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
908
java
package kxd.net; import java.util.Date; /** * 简单响应 * * */ public class SimpleNetResponse implements NetResponse { private static final long serialVersionUID = 1L; Date recvTime; Object value; public SimpleNetResponse() { super(); } /** * 创建一个简单的响应包 * * @param value * 响应数据 * @param recvTime * 响应数据 */ public SimpleNetResponse(Object value, Date recvTime) { super(); this.recvTime = recvTime; this.value = value; } @Override public void setRecvTime(Date value) { recvTime = value; } @Override public Date getRecvTime() { return recvTime; } /** * 获取响应数据 * */ public Object getValue() { return value; } /** * 设置响应数据 * */ public void setValue(Object value) { this.value = value; } }
[ "wangyz@wangyz-PC" ]
wangyz@wangyz-PC
fbb2036950a9a18b6e387a360a463dac9517a676
d92ce06a7f2f288f619b4d056aebe34d141fcab2
/ProtocolInterfaces/src/engine3DInterfaces/.svn/text-base/IEngine3D.java.svn-base
2a31660ddaed55203fb385e957b3342c3e7f3b45
[]
no_license
mgordo/software-engineering2
623de13924d5f42dc9a251b9fad3effc88793454
1ba3eea364ec579ffa46052370bf6cd08323e2e9
refs/heads/master
2021-01-10T06:30:47.661657
2015-10-17T18:18:31
2015-10-17T18:18:31
43,981,466
1
0
null
null
null
null
UTF-8
Java
false
false
935
package engine3DInterfaces; import geometry.Geometry; import java.net.URI; import java.util.List; import java.util.Map; import org.pnml.tools.epnk.pnmlcoremodel.PetriNetDoc; import animations.Animation; /** * @brief This is the expected interface for any Engine3D * @author Miguel Gordo & Diego Gonzalez * @date 17-X-13 */ public interface IEngine3D { /** * @brief This function creates a new IItem with the given parameters * @param shape Reference to the shape of the IItem to be created * @param geometry Reference to the geometry of the IItem to be created * @param activity Reference to the activity of the IItem to be created * @return An IItem correctly initialized */ public IItem createIItem(String shape, String geometry, Animation activity); /** * This should have these 2 arguments * @param geoRoot */ public void run(PetriNetDoc pet, Geometry geoRoot, Map<String,List<URI>> list); }
[ "masterkai_1977@hotmail.com" ]
masterkai_1977@hotmail.com
27e2393fe08e24c7bea74431be396e2b9b17318f
9b294c3bf262770e9bac252b018f4b6e9412e3ee
/camerazadas/source/apk/com.sonyericsson.android.camera/src-cfr/com/google/android/gms/internal/br.java
bef8bd2affe9806f855d49107892e561a5555933
[]
no_license
h265/camera
2c00f767002fd7dbb64ef4dc15ff667e493cd937
77b986a60f99c3909638a746c0ef62cca38e4235
refs/heads/master
2020-12-30T22:09:17.331958
2015-08-25T01:22:25
2015-08-25T01:22:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,142
java
/* * Decompiled with CFR 0_100. */ package com.google.android.gms.internal; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; import android.os.RemoteException; import com.google.android.gms.dynamic.d; public interface br extends IInterface { public void as() throws RemoteException; public String bt() throws RemoteException; public d bu() throws RemoteException; public d bv() throws RemoteException; public String bw() throws RemoteException; public double bx() throws RemoteException; public String by() throws RemoteException; public String bz() throws RemoteException; public String getBody() throws RemoteException; public void i(int var1) throws RemoteException; public static abstract class a extends Binder implements br { public a() { this.attachInterface(this, "com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); } @Override public IBinder asBinder() { return this; } @Override public boolean onTransact(int n, Parcel object, Parcel parcel, int n2) throws RemoteException { d d = null; d d2 = null; switch (n) { default: { return super.onTransact(n, (Parcel)object, parcel, n2); } case 1598968902: { parcel.writeString("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); return true; } case 1: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); this.i(object.readInt()); parcel.writeNoException(); return true; } case 2: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); this.as(); parcel.writeNoException(); return true; } case 3: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); object = this.bt(); parcel.writeNoException(); parcel.writeString((String)object); return true; } case 4: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); d = this.bu(); parcel.writeNoException(); object = d2; if (d != null) { object = d.asBinder(); } parcel.writeStrongBinder((IBinder)object); return true; } case 5: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); object = this.getBody(); parcel.writeNoException(); parcel.writeString((String)object); return true; } case 6: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); d2 = this.bv(); parcel.writeNoException(); object = d; if (d2 != null) { object = d2.asBinder(); } parcel.writeStrongBinder((IBinder)object); return true; } case 7: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); object = this.bw(); parcel.writeNoException(); parcel.writeString((String)object); return true; } case 8: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); double d3 = this.bx(); parcel.writeNoException(); parcel.writeDouble(d3); return true; } case 9: { object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); object = this.by(); parcel.writeNoException(); parcel.writeString((String)object); return true; } case 10: } object.enforceInterface("com.google.android.gms.ads.internal.formats.client.INativeAppInstallAd"); object = this.bz(); parcel.writeNoException(); parcel.writeString((String)object); return true; } } }
[ "jmrm@ua.pt" ]
jmrm@ua.pt
6981d0119a81080fd3145f34b70c1ebf8503e894
b74aab5a21a9f0a81ee0c55ee9a7bf37d1e68ecc
/rocketmq-broker/src/main/java/com/alibaba/rocketmq/broker/longpolling/PullRequestHoldService.java
e08015c277d7d98a66b314df1368c19a790fd973
[ "Apache-2.0" ]
permissive
jinfei21/RocketMQ
71544d0e55d53268ed15cf97970c953b9a66072b
bd0d2008cd6b227964d42c893559acabe409aa6e
refs/heads/master
2020-04-08T05:15:47.706706
2016-06-01T06:17:02
2016-06-01T06:17:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,539
java
/** * Copyright (C) 2010-2013 Alibaba Group Holding Limited * <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 com.alibaba.rocketmq.broker.longpolling; import com.alibaba.rocketmq.broker.BrokerController; import com.alibaba.rocketmq.common.ServiceThread; import com.alibaba.rocketmq.common.constant.LoggerName; import com.alibaba.rocketmq.remoting.exception.RemotingCommandException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ConcurrentHashMap; /** * 拉消息请求管理,如果拉不到消息,则在这里Hold住,等待消息到来 * * @author shijia.wxr<vintage.wang@gmail.com> * @since 2013-7-26 */ public class PullRequestHoldService extends ServiceThread { private static final Logger log = LoggerFactory.getLogger(LoggerName.BrokerLoggerName); private static final String TOPIC_QUEUEID_SEPARATOR = "@"; private final BrokerController brokerController; private ConcurrentHashMap<String/* topic@queueid */, ManyPullRequest> pullRequestTable = new ConcurrentHashMap<String, ManyPullRequest>(1024); public PullRequestHoldService(final BrokerController brokerController) { this.brokerController = brokerController; } private String buildKey(final String topic, final int queueId) { StringBuilder sb = new StringBuilder(); sb.append(topic); sb.append(TOPIC_QUEUEID_SEPARATOR); sb.append(queueId); return sb.toString(); } public void suspendPullRequest(final String topic, final int queueId, final PullRequest pullRequest) { String key = this.buildKey(topic, queueId); ManyPullRequest mpr = this.pullRequestTable.get(key); if (null == mpr) { mpr = new ManyPullRequest(); ManyPullRequest prev = this.pullRequestTable.putIfAbsent(key, mpr); if (prev != null) { mpr = prev; } } mpr.addPullRequest(pullRequest); } private void checkHoldRequest() { for (String key : this.pullRequestTable.keySet()) { String[] kArray = key.split(TOPIC_QUEUEID_SEPARATOR); if (kArray != null && 2 == kArray.length) { String topic = kArray[0]; int queueId = Integer.parseInt(kArray[1]); final long offset = this.brokerController.getMessageStore().getMaxOffsetInQuque(topic, queueId); this.notifyMessageArriving(topic, queueId, offset); } } } public void notifyMessageArriving(final String topic, final int queueId, final long maxOffset) { String key = this.buildKey(topic, queueId); ManyPullRequest mpr = this.pullRequestTable.get(key); if (mpr != null) { List<PullRequest> requestList = mpr.cloneListAndClear(); if (requestList != null) { List<PullRequest> replayList = new ArrayList<PullRequest>(); for (PullRequest request : requestList) { // 查看是否offset OK if (maxOffset > request.getPullFromThisOffset()) { try { this.brokerController.getPullMessageProcessor().excuteRequestWhenWakeup( request.getClientChannel(), request.getRequestCommand()); } catch (RemotingCommandException e) { log.error("", e); } continue; } // 尝试取最新Offset else { final long newestOffset = this.brokerController.getMessageStore().getMaxOffsetInQuque(topic, queueId); if (newestOffset > request.getPullFromThisOffset()) { try { this.brokerController.getPullMessageProcessor().excuteRequestWhenWakeup( request.getClientChannel(), request.getRequestCommand()); } catch (RemotingCommandException e) { log.error("", e); } continue; } } // 查看是否超时 if (System.currentTimeMillis() >= (request.getSuspendTimestamp() + request .getTimeoutMillis())) { try { this.brokerController.getPullMessageProcessor().excuteRequestWhenWakeup( request.getClientChannel(), request.getRequestCommand()); } catch (RemotingCommandException e) { log.error("", e); } continue; } // 当前不满足要求,重新放回Hold列表中 replayList.add(request); } if (!replayList.isEmpty()) { mpr.addPullRequest(replayList); } } } } @Override public void run() { log.info(this.getServiceName() + " service started"); while (!this.isStoped()) { try { this.waitForRunning(1000); this.checkHoldRequest(); } catch (Exception e) { log.warn(this.getServiceName() + " service has exception. ", e); } } log.info(this.getServiceName() + " service end"); } @Override public String getServiceName() { return PullRequestHoldService.class.getSimpleName(); } }
[ "diwayou@qq.com" ]
diwayou@qq.com
70d6e754ba0bc5faaf4a1688e392a2c54cd9edf7
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-78b-2-16-FEMO-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/analysis/solvers/BrentSolver_ESTest_scaffolding.java
9da9c54e8b343ff3f3b4b11c8e83ff243d05a2ea
[]
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
3,267
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Jan 20 14:45:35 UTC 2020 */ package org.apache.commons.math.analysis.solvers; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class BrentSolver_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.analysis.solvers.BrentSolver"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BrentSolver_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.FunctionEvaluationException", "org.apache.commons.math.analysis.solvers.BrentSolver", "org.apache.commons.math.MathException", "org.apache.commons.math.ConvergingAlgorithm", "org.apache.commons.math.ConvergenceException", "org.apache.commons.math.analysis.solvers.UnivariateRealSolver", "org.apache.commons.math.analysis.QuinticFunction", "org.apache.commons.math.ConvergingAlgorithmImpl", "org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl", "org.apache.commons.math.MathRuntimeException", "org.apache.commons.math.analysis.DifferentiableUnivariateRealFunction", "org.apache.commons.math.analysis.UnivariateRealFunction", "org.apache.commons.math.MathRuntimeException$1", "org.apache.commons.math.MathRuntimeException$2", "org.apache.commons.math.MaxIterationsExceededException", "org.apache.commons.math.MathRuntimeException$3", "org.apache.commons.math.MathRuntimeException$4", "org.apache.commons.math.MathRuntimeException$5", "org.apache.commons.math.MathRuntimeException$6", "org.apache.commons.math.MathRuntimeException$7", "org.apache.commons.math.MathRuntimeException$8", "org.apache.commons.math.MathRuntimeException$10", "org.apache.commons.math.MathRuntimeException$9" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
e8c56c0b3606ee1fafc75b5b164ae8137d0dde86
bcc74924cb65aa228f664dfc16486852bb0eec41
/src/test/java/ClassA.java
d1455ce3cc003fea74443cc4346bb0df03dbeaf8
[ "Apache-2.0" ]
permissive
tvd12/test-util
dcefba149eca876ab9a2051ace8a895ed4c5df0c
ad7a8a7ebaaa3b9b177bc6b57b8719a6766089fc
refs/heads/master
2023-06-12T01:39:09.782099
2023-06-04T14:35:38
2023-06-04T14:35:38
56,928,692
4
3
Apache-2.0
2023-06-04T14:35:39
2016-04-23T16:17:25
Java
UTF-8
Java
false
false
139
java
import com.tvd12.test.base.QuickLog; public class ClassA extends QuickLog { public void log() { info("i'm a class"); } }
[ "itprono3@gmail.com" ]
itprono3@gmail.com
7907fd68c40183db978c7489d5e1536bf3ca6eea
8d0d2b1e3684ef15aeeca158ebedcf921fdf94c2
/app/src/main/java/mg/etech/mobile/etechapp/contrainte/factory/dto/poste/PosteDtoFromDOFactoryImpl.java
aa0d6ec2130741d4fec6309f73ce00b4f77381b8
[]
no_license
maheryhaja/etechappFinal
2e4e100888b41ebb5c58077fc86f2637e9312f84
c12cd6ff5d3edfe1a0f69bf4503027c9017904fd
refs/heads/master
2021-01-20T21:35:25.460148
2017-12-21T18:58:07
2017-12-21T18:58:07
101,771,844
3
0
null
null
null
null
UTF-8
Java
false
false
489
java
package mg.etech.mobile.etechapp.contrainte.factory.dto.poste; import org.androidannotations.annotations.EBean; import mg.etech.mobile.etechapp.contrainte.factory.BaseFactory; import mg.etech.mobile.etechapp.donnee.domainobject.Poste; import mg.etech.mobile.etechapp.donnee.dto.PosteDto; /** * Created by maheryHaja on 9/11/2017. */ @EBean(scope = EBean.Scope.Singleton) public class PosteDtoFromDOFactoryImpl extends BaseFactory<Poste, PosteDto> implements PosteDtoFromDOFactory { }
[ "ygunion@gmail.com" ]
ygunion@gmail.com
1ebc6e982431fc0164d458be18a25a9955efd7ce
0ac28b7e3cb0c11a028c529d1720547ec7b60a06
/src/main/java/osm5/ns/riftware/_1/_0/project/nsd/rev170228/nsr/nsd/placement/groups/PlacementGroups.java
aa407a2114573495baaf56381a63f17fb69daeb1
[ "Apache-2.0" ]
permissive
openslice/io.openslice.sol005nbi.osm5
5d76e8dd9b4170bdbb9b2359459371abb2324d41
f4f6cf80dbd61f5336052ebfcd572ae238d68d89
refs/heads/master
2021-11-18T00:35:31.753227
2020-06-15T15:50:33
2020-06-15T15:50:33
198,384,737
0
0
Apache-2.0
2021-08-02T17:18:18
2019-07-23T08:16:53
Java
UTF-8
Java
false
false
2,868
java
/*- * ========================LICENSE_START================================= * io.openslice.sol005nbi.osm5 * %% * Copyright (C) 2019 openslice.io * %% * 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. * =========================LICENSE_END================================== */ package osm5.ns.riftware._1._0.project.nsd.rev170228.nsr.nsd.placement.groups; import java.lang.Override; import java.util.List; import javax.annotation.Nullable; import org.opendaylight.yangtools.yang.binding.Augmentable; import org.opendaylight.yangtools.yang.binding.ChildOf; import org.opendaylight.yangtools.yang.binding.Identifiable; import org.opendaylight.yangtools.yang.common.QName; import osm5.ns.riftware._1._0.project.nsd.rev170228.$YangModuleInfoImpl; import osm5.ns.riftware._1._0.project.nsd.rev170228.NsrNsdPlacementGroups; import osm5.ns.riftware._1._0.project.nsd.rev170228.nsr.nsd.placement.groups.placement.groups.MemberVnfd; import osm5.ns.yang.nfvo.mano.types.rev170208.PlacementGroupInfo; /** * List of placement groups at NS level * * <p> * This class represents the following YANG schema fragment defined in module <b>project-nsd</b> * <pre> * list placement-groups { * key name; * uses manotypes:placement-group-info; * list member-vnfd { * key member-vnf-index-ref; * leaf member-vnf-index-ref { * type string; * } * leaf vnfd-id-ref { * type string; * } * } * } * </pre>The schema path to identify an instance is * <i>project-nsd/nsr-nsd-placement-groups/placement-groups</i> * * <p>To create instances of this class use {@link PlacementGroupsBuilder}. * @see PlacementGroupsBuilder * @see PlacementGroupsKey * */ public interface PlacementGroups extends ChildOf<NsrNsdPlacementGroups>, Augmentable<PlacementGroups>, PlacementGroupInfo, Identifiable<PlacementGroupsKey> { public static final QName QNAME = $YangModuleInfoImpl.qnameOf("placement-groups"); /** * List of VNFDs that are part of this placement group * * * * @return <code>java.util.List</code> <code>memberVnfd</code>, or <code>null</code> if not present */ @Nullable List<MemberVnfd> getMemberVnfd(); @Override PlacementGroupsKey key(); }
[ "tranoris@gmail.com" ]
tranoris@gmail.com
6ad616ddff81b212f77d07f9e9c302cde605d58d
680c7582d4df6e7dc17ff59c5718ff883e12a085
/retrokit/src/main/java/com/theah64/retrokit/activities/BaseDynamicActivity.java
0a92795090a31cd7e552af57d184e9feaf6abc9c
[ "Apache-2.0" ]
permissive
theapache64/RetroKit
2180707d6a466a0ffae153c3fbb044947e72e4a5
40b9f560273d9a97c54dc0e17b359bc17f10f450
refs/heads/master
2021-01-19T22:59:18.497297
2018-09-22T07:42:37
2018-09-22T07:42:37
101,259,851
0
0
null
null
null
null
UTF-8
Java
false
false
3,946
java
package com.theah64.retrokit.activities; import android.support.annotation.NonNull; import com.theah64.bugmailer.core.BugMailer; import com.theah64.retrokit.R; import com.theah64.retrokit.callbacks.OnErrorTrueCallback; import com.theah64.retrokit.exceptions.ServerException; import com.theah64.retrokit.retro.BaseAPIResponse; import com.theah64.retrokit.retro.RetroKit; import com.theah64.retrokit.retro.RetrofitClient; import com.theah64.retrokit.utils.ProgressManager; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; /** * Created by theapache64 on 25/8/17. */ public abstract class BaseDynamicActivity<DATA, APIINTERFACE> extends BaseRefreshableActivity<DATA> { private DATA response; private Call<BaseAPIResponse<DATA>> call; @Override public void loadData(final boolean isClearList) { if (!isSetupCalled()) { throw new IllegalArgumentException("You should call setup() before calling loadData()"); } if (call != null) { call.cancel(); } getProgressMan().showLoading(getLoadingMessage()); this.call = getCall((APIINTERFACE) RetrofitClient.getClient().create(RetroKit.getInstance().getApiInterface())); if (this.call != null) { this.call.enqueue(new Callback<BaseAPIResponse<DATA>>() { @Override public void onResponse(@NonNull Call<BaseAPIResponse<DATA>> call, @NonNull final Response<BaseAPIResponse<DATA>> response) { if (response.body() != null) { if (response.body().isError()) { final String message = response.body().getMessage(); //Checking if custom error handling enabled final String errorMessage = RetroKit.getInstance().getErrorMessage(); final OnErrorTrueCallback errorCallback = RetroKit.getInstance().getErrorCallback(); if (errorMessage != null && errorCallback != null && errorMessage.equals(message)) { errorCallback.onError(BaseDynamicActivity.this); } else { onErrorTrue(message); } } else { BaseDynamicActivity.this.response = response.body().getData(); onSuccess(response.body().getData(), isClearList); getProgressMan().showMainView(); } } else { BugMailer.report(new ServerException()); getProgressMan().showError(ProgressManager.ERROR_TYPE_SERVER_ERROR, R.string.server_error); } } @Override public void onFailure(@NonNull Call<BaseAPIResponse<DATA>> call, Throwable t) { t.printStackTrace(); if (!call.isCanceled()) { getProgressMan().showError(ProgressManager.ERROR_TYPE_NETWORK_ERROR, R.string.network_error); } } }); } } protected void onErrorTrue(String message) { getProgressMan().showError(ProgressManager.ERROR_TYPE_SERVER_ERROR, message); } public DATA getResponse() { return response; } protected abstract void onSuccess(DATA response, boolean isClearList); protected String getLoadingMessage() { return getString(R.string.Loading); } protected abstract Call<BaseAPIResponse<DATA>> getCall(APIINTERFACE apiInterface); @Override protected void onStop() { super.onStop(); if (this.call != null && !this.call.isCanceled()) { System.out.println("Pending call cancelled"); this.call.cancel(); } } }
[ "theapache64@gmail.com" ]
theapache64@gmail.com
ec7a5043b996cfecdff8ed9d12c149547e45abe1
91aa0b8905d9ad457c6034b999b40f4c7d82b64c
/tools/src/main/java/org/baize/excel/Test.java
07364b1afb92e07a6279a76e00f622dc23831bb8
[]
no_license
zglbig/x2
e129812a61b31f43d6cf3423088be719bb9ffe4c
f7c41752dcfa67e2a21d729a3c825297bc9cb71a
refs/heads/master
2021-09-03T18:44:07.262451
2018-01-11T06:27:23
2018-01-11T06:27:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
584
java
package org.baize.excel; import org.baize.assemblybean.annon.ExcelInversion; import org.baize.assemblybean.annon.ExcelValue; /** * 作者: 白泽 * 时间: 2017/11/3. * 描述: */ @ExcelInversion public class Test{ @ExcelValue(value = "奥术大师多") public static final int ASD = 1; public static final int SAD = 2; @ExcelValue(value = "体育空压机") public static final int FGH = 3; @ExcelValue(value = "weygrewtfwef") public static final int FDG = 4; @ExcelValue(value = "一天里访问") public static final int TYU = 5; }
[ "1030681978@qq.com" ]
1030681978@qq.com
ea65cfee1e874bb4871e0d827b0a817628673288
2737a1237fc93ef085fec064315cdeb2f804a81a
/ebean-core/src/test/java/io/ebeaninternal/server/dto/DtoMetaBuilderTest.java
a3cf2a2fdc4b5688fa9f17fe6e837dfe215e2cc7
[ "Apache-2.0" ]
permissive
ooknight/ebean
97b0236904ccbafaf3cbf8bae05a66f93c00dad2
b85bb5f459e9ce8dcf650119716cf387b92e5c3f
refs/heads/master
2022-04-01T20:58:23.210289
2022-03-27T07:31:17
2022-03-27T07:31:17
157,489,446
0
0
NOASSERTION
2018-11-14T04:13:46
2018-11-14T04:13:46
null
UTF-8
Java
false
false
2,923
java
package io.ebeaninternal.server.dto; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; public class DtoMetaBuilderTest { @Test public void includeMethod() { Map<String, Method> methods = getIncludedMethodsFor(D0.class); assertThat(methods).hasSize(2); assertThat(methods.get("setName")).isNotNull(); assertThat(methods.get("setId")).isNotNull(); } @Test public void includeMethod_when_notStrictlySetters() { Map<String, Method> methods = getIncludedMethodsFor(D1.class); assertThat(methods).hasSize(3); assertThat(methods.get("setNameThen")).isNotNull(); assertThat(methods.get("setIdFor")).isNotNull(); assertThat(methods.get("setI")).isNotNull(); } @Test public void propertyType() { Map<String, Method> methods = getIncludedMethodsFor(D0.class); assertThat(methods).hasSize(2); Assertions.assertThat(DtoMetaProperty.propertyClass(methods.get("setName"))).isEqualTo(String.class); assertThat(DtoMetaProperty.propertyClass(methods.get("setId"))).isEqualTo(long.class); assertThat(DtoMetaProperty.propertyType(methods.get("setName"))).isEqualTo(String.class); assertThat(DtoMetaProperty.propertyType(methods.get("setId"))).isEqualTo(long.class); } @Test public void propertyName() { Assertions.assertThat(DtoMetaBuilder.propertyName("setName")).isEqualTo("name"); assertThat(DtoMetaBuilder.propertyName("setId")).isEqualTo("id"); assertThat(DtoMetaBuilder.propertyName("setI")).isEqualTo("i"); assertThat(DtoMetaBuilder.propertyName("setfoo")).isEqualTo("foo"); } private Map<String, Method> getIncludedMethodsFor(Class<?> cls) { Map<String,Method> included = new HashMap<>(); for (Method method : cls.getMethods()) { if (DtoMetaBuilder.includeMethod(method)) { included.put(method.getName(), method); } } return included; } @SuppressWarnings("unused") static class D0 { private String name; private long id; public String getName() { return name; } public void setName(String name) { this.name = name; } public void setId(long id) { this.id = id; } public void setNamePlus(String name, long id) { this.name = name; this.id = id; } public static void setFoo(String foo) { } protected void setProtected(String foo) { } private void setPrivate(String foo) { } private void setPackage(String foo) { } } @SuppressWarnings("unused") static class D1 { public void setNameThen(String name) { } public void setIdFor(long id) { } public void setI(long val) { } public void set(long val) { } public D1 setA(long val) { return this; } } }
[ "robin.bygrave@gmail.com" ]
robin.bygrave@gmail.com
34d83cf0fbbedd1c55e0fd1434aecd20859cab52
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project20/src/main/java/org/gradle/test/performance20_1/Production20_100.java
2495ca68f259a77b8fb2346c5ee6b6dc4f3ab2f1
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance20_1; public class Production20_100 extends org.gradle.test.performance11_1.Production11_100 { private final String property; public Production20_100() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
b9a612d1c13294fd92b6e89101b63341cf7a59b4
32c6fcf9faf5ad1787c5a3164c33136c5d4962cc
/resourcemanager-20200331/src/main/java/com/aliyun/resourcemanager20200331/models/ListPolicyVersionsRequest.java
bcfa3b95ab636d6b5b7cf4f17960e053c9f60cb5
[ "Apache-2.0" ]
permissive
foreverlyl/alibabacloud-java-sdk
0117700d8e217118c2980e09b90a13ef7d4054fa
1134eae866442721b7a33b028a916ce343a33c2b
refs/heads/master
2023-02-24T05:13:14.705586
2021-02-01T06:39:41
2021-02-01T06:39:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.resourcemanager20200331.models; import com.aliyun.tea.*; public class ListPolicyVersionsRequest extends TeaModel { @NameInMap("PolicyType") @Validation(required = true) public String policyType; @NameInMap("PolicyName") @Validation(required = true) public String policyName; public static ListPolicyVersionsRequest build(java.util.Map<String, ?> map) throws Exception { ListPolicyVersionsRequest self = new ListPolicyVersionsRequest(); return TeaModel.build(map, self); } public ListPolicyVersionsRequest setPolicyType(String policyType) { this.policyType = policyType; return this; } public String getPolicyType() { return this.policyType; } public ListPolicyVersionsRequest setPolicyName(String policyName) { this.policyName = policyName; return this; } public String getPolicyName() { return this.policyName; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
b89e335af305b83aec898a485e65d21a67a26a78
17c44a99eaa709e0ec402aa0a25c9ef7c91c978c
/impl/src/main/java/pico/erp/warehouse/location/rack/RackRepositoryJpa.java
0d8ef8bb873cb7adf49f1eb2fbe67bea59b92d73
[]
no_license
kkojaeh/pico-erp-warehouse
18a0ad826157b9f357878adb5ec2c853ba544922
c82e3e71a40fee72c7ff81caeecfa8e66c01da71
refs/heads/master
2020-03-30T22:04:52.489893
2019-04-05T03:20:30
2019-04-05T03:20:30
151,653,830
0
0
null
2019-04-03T05:35:55
2018-10-05T00:47:36
Java
UTF-8
Java
false
false
2,218
java
package pico.erp.warehouse.location.rack; import java.util.Optional; import java.util.stream.Stream; import javax.validation.constraints.NotNull; import lombok.val; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import pico.erp.warehouse.location.LocationCode; import pico.erp.warehouse.location.zone.ZoneId; @Repository interface RackEntityRepository extends CrudRepository<RackEntity, RackId> { @Query("SELECT CASE WHEN COUNT(wr) > 0 THEN true ELSE false END FROM Rack wr WHERE wr.locationCode = :locationCode AND wr.deleted = false") boolean exists(@Param("locationCode") LocationCode locationCode); @Query("SELECT wr FROM Rack wr WHERE wr.zoneId = :zoneId AND wr.deleted = false ORDER BY wr.code") Stream<RackEntity> findAllBy(@Param("zoneId") ZoneId zoneId); } @Repository @Transactional public class RackRepositoryJpa implements RackRepository { @Autowired private RackEntityRepository repository; @Autowired private RackMapper mapper; @Override public Rack create(@NotNull Rack rack) { val entity = mapper.jpa(rack); val created = repository.save(entity); return mapper.jpa(created); } @Override public void deleteBy(@NotNull RackId id) { repository.deleteById(id); } @Override public boolean exists(@NotNull RackId id) { return repository.existsById(id); } @Override public boolean exists(@NotNull LocationCode locationCode) { return repository.exists(locationCode); } @Override public Stream<Rack> findAllBy(@NotNull ZoneId zoneId) { return repository.findAllBy(zoneId) .map(mapper::jpa); } @Override public Optional<Rack> findBy(@NotNull RackId id) { return repository.findById(id) .map(mapper::jpa); } @Override public void update(@NotNull Rack rack) { val entity = repository.findById(rack.getId()).get(); mapper.pass(mapper.jpa(rack), entity); repository.save(entity); } }
[ "kkojaeh@gmail.com" ]
kkojaeh@gmail.com
306eeeff27d345c74f60ad08484363d093537889
a3e9de23131f569c1632c40e215c78e55a78289a
/mall/manage/e3managerpojo/src/main/java/com/jiao/pojo/TbContent.java
220e5eb0eb53ad28add6bc23a1058724499f0be9
[]
no_license
P79N6A/java_practice
80886700ffd7c33c2e9f4b202af7bb29931bf03d
4c7abb4cde75262a60e7b6d270206ee42bb57888
refs/heads/master
2020-04-14T19:55:52.365544
2019-01-04T07:39:40
2019-01-04T07:39:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package com.jiao.pojo; import java.io.Serializable; import java.util.Date; public class TbContent implements Serializable { private Long id; private Long categoryId; private String title; private String subTitle; private String titleDesc; private String url; private String pic; private String pic2; private Date created; private Date updated; private String content; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getCategoryId() { return categoryId; } public void setCategoryId(Long categoryId) { this.categoryId = categoryId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title == null ? null : title.trim(); } public String getSubTitle() { return subTitle; } public void setSubTitle(String subTitle) { this.subTitle = subTitle == null ? null : subTitle.trim(); } public String getTitleDesc() { return titleDesc; } public void setTitleDesc(String titleDesc) { this.titleDesc = titleDesc == null ? null : titleDesc.trim(); } public String getUrl() { return url; } public void setUrl(String url) { this.url = url == null ? null : url.trim(); } public String getPic() { return pic; } public void setPic(String pic) { this.pic = pic == null ? null : pic.trim(); } public String getPic2() { return pic2; } public void setPic2(String pic2) { this.pic2 = pic2 == null ? null : pic2.trim(); } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } public String getContent() { return content; } public void setContent(String content) { this.content = content == null ? null : content.trim(); } }
[ "jiaojianjun1991@gmail.com" ]
jiaojianjun1991@gmail.com
9a75d458688303dac8791f481b5cbe3d589357bf
6636854f8d55c1cb9dc8d55a9ba4e01d17c360f1
/tika-core/src/main/java/org/apache/tika/metadata/filter/MetadataFilter.java
21eb3eced1671a80154a91599a642c9965dc1223
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-unknown", "EPL-1.0", "ICU", "LicenseRef-scancode-bsd-simplified-darwin", "MPL-2.0", "LicenseRef-scancode-iptc-2006", "LicenseRef-scancode-proprietary-license", "MIT", "NetCDF", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unrar", "Classpath-exception-2.0", "LGPL-2.1-or-later", "CDDL-1.0", "CDDL-1.1", "GPL-2.0-only" ]
permissive
apache/tika
ff4fe69a76a3c84f947223fe9b806045ee693f71
40910015849aba5a57e59ad0f3aeff803744f3ab
refs/heads/main
2023-08-31T11:19:31.578196
2023-08-31T06:12:10
2023-08-31T06:12:10
206,427
1,817
856
Apache-2.0
2023-09-14T19:27:42
2009-05-21T02:12:11
Java
UTF-8
Java
false
false
2,094
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tika.metadata.filter; import java.io.IOException; import java.io.Serializable; import org.w3c.dom.Element; import org.apache.tika.config.ConfigBase; import org.apache.tika.exception.TikaConfigException; import org.apache.tika.exception.TikaException; import org.apache.tika.metadata.Metadata; /** * Filters the metadata in place after the parse * * @since Apache Tika 1.25 */ public abstract class MetadataFilter extends ConfigBase implements Serializable { /** * Loads the metadata filter from the config file if it exists, otherwise returns NoOpFilter * @param root * @return * @throws TikaConfigException * @throws IOException */ public static MetadataFilter load(Element root, boolean allowMissing) throws TikaConfigException, IOException { try { return buildComposite("metadataFilters", CompositeMetadataFilter.class, "metadataFilter", MetadataFilter.class, root); } catch (TikaConfigException e) { if (allowMissing && e.getMessage().contains("could not find metadataFilters")) { return new NoOpFilter(); } throw e; } } public abstract void filter(Metadata metadata) throws TikaException; }
[ "tallison@apache.org" ]
tallison@apache.org
bad3006cc571435d898d782284f0f2f981816513
87f06e39e40ad51afe673fac25c9f3305dc4ed9a
/wyApp/app/src/main/java/com/example/live/MyLiveListActivity.java
5bdb7c069602f0822e9d2a91bc7d295f745112be
[]
no_license
jaronho/demos_android
0f8024dcd608a83d5f2ddd3d64f0f7d3f0f8be2f
148240f550c1fcc95a66de33ebb2a836e0229c70
refs/heads/master
2021-01-19T05:05:53.339867
2018-11-03T09:17:34
2018-11-03T09:17:34
87,407,713
2
0
null
null
null
null
UTF-8
Java
false
false
6,701
java
package com.example.live; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import com.example.nyapp.R; import com.jaronho.sdk.utils.adapter.QuickFragmentPageAdapter; import java.util.ArrayList; import java.util.List; public class MyLiveListActivity extends AppCompatActivity { private ViewPager mViewpagerList = null; private ListFragment mMyJoinListFragment = null; private ListFragment mMyCollectListFragment = null; private ListFragment mMyStartListFragment = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.live_my_list_activity); ImageView imageviewBack = (ImageView)findViewById(R.id.imageview_back); imageviewBack.setOnClickListener(onClickImageviewBack); RelativeLayout layoutTabJoin = (RelativeLayout)findViewById(R.id.layout_tab_join); layoutTabJoin.setOnClickListener(onClickLayoutTabJoin); RelativeLayout layoutTabCollect = (RelativeLayout)findViewById(R.id.layout_tab_collect); layoutTabCollect.setOnClickListener(onClickLayoutTabCollect); RelativeLayout layoutTabStart = (RelativeLayout)findViewById(R.id.layout_tab_start); layoutTabStart.setOnClickListener(onClickLayoutTabStart); mViewpagerList = (ViewPager)findViewById(R.id.viewpager_list); mViewpagerList.addOnPageChangeListener(onPageChangeViewpagerList); mViewpagerList.setOffscreenPageLimit(2); mMyJoinListFragment = ListFragment.create(ListFragment.TYPE_MY_JOIN); mMyCollectListFragment = ListFragment.create(ListFragment.TYPE_MY_COLLECT); mMyStartListFragment = ListFragment.create(ListFragment.TYPE_MY_START); List<Fragment> fragments = new ArrayList<>(); fragments.add(mMyJoinListFragment); fragments.add(mMyCollectListFragment); fragments.add(mMyStartListFragment); mViewpagerList.setAdapter(new QuickFragmentPageAdapter<>(getSupportFragmentManager(), fragments)); switchTabJoin(); } OnClickListener onClickImageviewBack = new OnClickListener() { @Override public void onClick(View v) { finish(); } }; OnClickListener onClickLayoutTabJoin = new OnClickListener() { @Override public void onClick(View v) { switchTabJoin(); mViewpagerList.setCurrentItem(0); } }; OnClickListener onClickLayoutTabCollect = new OnClickListener() { @Override public void onClick(View v) { switchTabCollect(); mViewpagerList.setCurrentItem(1); } }; OnClickListener onClickLayoutTabStart = new OnClickListener() { @Override public void onClick(View v) { switchTabStart(); mViewpagerList.setCurrentItem(2); } }; ViewPager.OnPageChangeListener onPageChangeViewpagerList = new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { if (0 == position) { switchTabJoin(); } else if (1 == position) { switchTabCollect(); } else if (2 == position) { switchTabStart(); } } @Override public void onPageScrollStateChanged(int state) { } }; void invalidTabs() { RelativeLayout layoutTabJoin= (RelativeLayout)findViewById(R.id.layout_tab_join); layoutTabJoin.setEnabled(true); TextView textviewJoin = (TextView)findViewById(R.id.textview_join); textviewJoin.setTextColor(getResources().getColor(R.color.gray2)); View viewJoinUnderline = findViewById(R.id.view_join_underline); viewJoinUnderline.setVisibility(View.INVISIBLE); RelativeLayout layoutTabCollect = (RelativeLayout)findViewById(R.id.layout_tab_collect); layoutTabCollect.setEnabled(true); TextView textviewCollect = (TextView)findViewById(R.id.textview_collect); textviewCollect.setTextColor(getResources().getColor(R.color.gray2)); View viewCollectUnderline = findViewById(R.id.view_collect_underline); viewCollectUnderline.setVisibility(View.INVISIBLE); RelativeLayout layoutTabStart = (RelativeLayout)findViewById(R.id.layout_tab_start); layoutTabStart.setEnabled(true); TextView textviewStart = (TextView)findViewById(R.id.textview_start); textviewStart.setTextColor(getResources().getColor(R.color.gray2)); View viewStartUnderline = findViewById(R.id.view_start_underline); viewStartUnderline.setVisibility(View.INVISIBLE); } void switchTabJoin() { invalidTabs(); RelativeLayout layoutTabJoin= (RelativeLayout)findViewById(R.id.layout_tab_join); layoutTabJoin.setEnabled(false); TextView textviewJoin = (TextView)findViewById(R.id.textview_join); textviewJoin.setTextColor(getResources().getColor(R.color.black)); View viewJoinUnderline = findViewById(R.id.view_join_underline); viewJoinUnderline.setVisibility(View.VISIBLE); mMyJoinListFragment.setCanInitList(); } void switchTabCollect() { invalidTabs(); RelativeLayout layoutTabCollect = (RelativeLayout)findViewById(R.id.layout_tab_collect); layoutTabCollect.setEnabled(false); TextView textviewCollect = (TextView)findViewById(R.id.textview_collect); textviewCollect.setTextColor(getResources().getColor(R.color.black)); View viewCollectUnderline = findViewById(R.id.view_collect_underline); viewCollectUnderline.setVisibility(View.VISIBLE); mMyCollectListFragment.setCanInitList(); } void switchTabStart() { invalidTabs(); RelativeLayout layoutTabStart = (RelativeLayout)findViewById(R.id.layout_tab_start); layoutTabStart.setEnabled(false); TextView textviewStart = (TextView)findViewById(R.id.textview_start); textviewStart.setTextColor(getResources().getColor(R.color.black)); View viewStartUnderline = findViewById(R.id.view_start_underline); viewStartUnderline.setVisibility(View.VISIBLE); mMyStartListFragment.setCanInitList(); } }
[ "892134825@qq.com" ]
892134825@qq.com
d59edfd148b2e4e98604e3d303de32f4703e97d2
ca0e9689023cc9998c7f24b9e0532261fd976e0e
/src/com/tencent/mm/plugin/accountsync/model/a$a.java
dd017f1c977e9fcd11634617def9991cd5da46ad
[]
no_license
honeyflyfish/com.tencent.mm
c7e992f51070f6ac5e9c05e9a2babd7b712cf713
ce6e605ff98164359a7073ab9a62a3f3101b8c34
refs/heads/master
2020-03-28T15:42:52.284117
2016-07-19T16:33:30
2016-07-19T16:33:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.tencent.mm.plugin.accountsync.model; import android.content.Context; public abstract interface a$a { public abstract int aX(Context paramContext); } /* Location: * Qualified Name: com.tencent.mm.plugin.accountsync.model.a.a * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
06a5000389f52707f5779d7616221854a1b560ec
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/81/2047.java
db317aeca64af62c8eec2889e908500668cac40a
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,277
java
package <missing>; public class GlobalMembers { public static int[] p = new int[5]; public static int m; public static int n; public static int i; public static int j; public static int temp; public static int c; public static int trans() { //C++ TO JAVA CONVERTER TODO TASK: The memory management function 'calloc' has no equivalent in Java: p = (int [5])calloc(5,5 * (Integer.SIZE / Byte.SIZE)); for (i = 0;i < 5;i++) { for (j = 0;j < 5;j++) { String tempVar = ConsoleInput.scanfRead(); if (tempVar != null) { p[i] + j = tempVar; } } } String tempVar2 = ConsoleInput.scanfRead(); if (tempVar2 != null) { m = Integer.parseInt(tempVar2); } String tempVar3 = ConsoleInput.scanfRead(); if (tempVar3 != null) { n = Integer.parseInt(tempVar3); } if (m < 5 && n < 5) { for (j = 0;j < 5;j++) { temp = (p[m] + j); *(p[m] + j) = *(p[n] + j); *(p[n] + j) = temp; } return 1; } else { return 0; } } public static int Main() { c = trans(); if (c != 0) { for (i = 0;i < 5;i++) { for (j = 0;j < 4;j++) { System.out.printf("%d ",*(p[i] + j)); } System.out.printf("%d\n",*(p[i] + 4)); } } else { System.out.print("error"); } } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
cb83bc4c5945e232f16ba0656db8daacc25ee9b7
f6dacb34c10fa1c3be84ebbc7cb482344b6fbd5d
/pdf-as-tests/src/test/java/at/gv/egiz/param_tests/testinfo/SignaturePositionTestInfo.java
04b75edce7c041b63f5a4aab0d0c282ee9636ddf
[]
no_license
primesign/pdf-as-4
2f2a2f4cfdbff64ecf926fee64327c93c07d3473
29c19a50b93ea379feae1bb0d7f576c758be175b
refs/heads/master
2023-04-28T06:31:36.838914
2023-01-23T14:09:11
2023-01-23T14:10:33
30,864,921
4
2
null
2023-04-27T23:54:32
2015-02-16T11:14:06
Java
UTF-8
Java
false
false
3,704
java
package at.gv.egiz.param_tests.testinfo; import java.awt.Rectangle; import java.util.List; /** * Test information class for signature position test. * * @author mtappler * */ public class SignaturePositionTestInfo extends TestInfo { /** * Class containing attributes for non-standard parameters of signature * position tests. * * @author mtappler * */ public static class SignaturePositionParameters { /** * positioning string which specifies the position of the signature * block */ private String positionString; /** * The page number of the page, which shows the signature block. */ private int sigPageNumber; /** * A list of rectangular areas, which will be ignored for image * comparison */ private List<Rectangle> ignoredAreas; /** * the file name of the reference file for image comparison */ private String refImageFileName; /** * if set to true, a reference image is captured during the test, but no * actual comparison will be performed */ private boolean captureReferenceImage; public String getPositionString() { return positionString; } public void setPositionString(String positionString) { this.positionString = positionString; } public int getSigPageNumber() { return sigPageNumber; } public void setSigPageNumber(int sigPageNumber) { this.sigPageNumber = sigPageNumber; } public List<Rectangle> getIgnoredAreas() { return ignoredAreas; } public void setIgnoredAreas(List<Rectangle> ignoredAreas) { this.ignoredAreas = ignoredAreas; } public String getRefImageFileName() { return refImageFileName; } public void setRefImageFileName(String refImageFileName) { this.refImageFileName = refImageFileName; } public boolean isCaptureReferenceImage() { return captureReferenceImage; } public void setCaptureReferenceImage(boolean captureReferenceImage) { this.captureReferenceImage = captureReferenceImage; } } /** * additional/non-standard parameter of signature position tests */ private SignaturePositionParameters additionParameters = new SignaturePositionParameters(); /** * file name of the reference image with ignored areas */ private String refImageIgnored; /** * file name of the signature page image with ignored areas */ private String sigPageImageIgnored; /** * file name of difference image */ private String diffImage; public String getRefImageIgnored() { return refImageIgnored; } public String getSigPageImageIgnored() { return sigPageImageIgnored; } public String getDiffImage() { return diffImage; } public SignaturePositionParameters getAdditionParameters() { return additionParameters; } public void setAdditionParameters( SignaturePositionParameters additionParameters) { this.additionParameters = additionParameters; } public void setRefImageIgnored(String refImageIgnored) { this.refImageIgnored = refImageIgnored; } public void setSigPageImageIgnored(String sigPageImageIgnored) { this.sigPageImageIgnored = sigPageImageIgnored; } public void setDiffImage(String diffImage) { this.diffImage = diffImage; } }
[ "andreas.fitzek@iaik.tugraz.at" ]
andreas.fitzek@iaik.tugraz.at
d4b2e1e3fd010dd561ad9307498a6ea291b0b7a7
9dfb06fb888a7f5d79f590eb11f62618d893af93
/dp/1D/204. Count Primes.java
296825ef6314ddcacae8b07cf5238aefcb7db619
[]
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
792
java
/** * Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. */ /* e.g: 10 when i=2 since [2]==F count++ loop j=2 make[4]=T [6]=T [8]=T when i=3 since [3]==F count++ loop j=2 make[6]=T [9]=T when i=4 since [4]==T when i=5 since [5]==F count++ loop j=2 make[10]=T when i=6 since [6]==T ... */ class Solution { public int countPrimes(int n) { boolean[] notPrime = new boolean[n]; int count=0; for(int i=2; i<n; i++) { if(notPrime[i] == false) { count++; for(int j=2; j*i<n; j++) { notPrime[i*j] = true; } } } return count; } }
[ "fan.yang@oath.com" ]
fan.yang@oath.com
b2d91860fe4c8da5ce0f446d8367acf445f3c868
1085c5511bc0d094d6c37cbdfab0378de057adaf
/src/test/java/com/komodo/cards/security/DomainUserDetailsServiceIntTest.java
8007d62ca934c102cb49dbd3234eb9860789db9d
[]
no_license
venkyup/Converse
c13f600e20c6dcf031495591aec98ff794136024
d11a34474760d791476635a75d10dc7601d52368
refs/heads/master
2022-12-14T10:01:40.408651
2018-03-22T07:27:41
2018-03-22T07:27:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,639
java
package com.komodo.cards.security; import com.komodo.cards.ConverseApp; import com.komodo.cards.domain.User; import com.komodo.cards.repository.UserRepository; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Locale; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for DomainUserDetailsService. * * @see DomainUserDetailsService */ @RunWith(SpringRunner.class) @SpringBootTest(classes = ConverseApp.class) @Transactional public class DomainUserDetailsServiceIntTest { private static final String USER_ONE_LOGIN = "test-user-one"; private static final String USER_ONE_EMAIL = "test-user-one@localhost"; private static final String USER_TWO_LOGIN = "test-user-two"; private static final String USER_TWO_EMAIL = "test-user-two@localhost"; private static final String USER_THREE_LOGIN = "test-user-three"; private static final String USER_THREE_EMAIL = "test-user-three@localhost"; @Autowired private UserRepository userRepository; @Autowired private UserDetailsService domainUserDetailsService; private User userOne; private User userTwo; private User userThree; @Before public void init() { userOne = new User(); userOne.setLogin(USER_ONE_LOGIN); userOne.setPassword(RandomStringUtils.random(60)); userOne.setActivated(true); userOne.setEmail(USER_ONE_EMAIL); userOne.setFirstName("userOne"); userOne.setLastName("doe"); userOne.setLangKey("en"); userRepository.save(userOne); userTwo = new User(); userTwo.setLogin(USER_TWO_LOGIN); userTwo.setPassword(RandomStringUtils.random(60)); userTwo.setActivated(true); userTwo.setEmail(USER_TWO_EMAIL); userTwo.setFirstName("userTwo"); userTwo.setLastName("doe"); userTwo.setLangKey("en"); userRepository.save(userTwo); userThree = new User(); userThree.setLogin(USER_THREE_LOGIN); userThree.setPassword(RandomStringUtils.random(60)); userThree.setActivated(false); userThree.setEmail(USER_THREE_EMAIL); userThree.setFirstName("userThree"); userThree.setLastName("doe"); userThree.setLangKey("en"); userRepository.save(userThree); } @Test @Transactional public void assertThatUserCanBeFoundByLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByLoginIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmail() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmailIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatEmailIsPrioritizedOverLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test(expected = UserNotActivatedException.class) @Transactional public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
40a3f04b199b169969b129425b6d0b585f864186
b97bc0706448623a59a7f11d07e4a151173b7378
/src/main/java/com/tcmis/internal/invoice/beans/InvoiceAddChargeDetailBean.java
fe04d638733829da3148c39f793e88fb0aa3ef32
[]
no_license
zafrul-ust/tcmISDev
576a93e2cbb35a8ffd275fdbdd73c1f9161040b5
71418732e5465bb52a0079c7e7e7cec423a1d3ed
refs/heads/master
2022-12-21T15:46:19.801950
2020-02-07T21:22:50
2020-02-07T21:22:50
241,601,201
0
0
null
2022-12-13T19:29:34
2020-02-19T11:08:43
Java
UTF-8
Java
false
false
5,146
java
package com.tcmis.internal.invoice.beans; import java.math.BigDecimal; import java.sql.SQLData; import java.sql.SQLException; import java.sql.SQLInput; import java.sql.SQLOutput; import com.tcmis.common.framework.BaseDataBean; /****************************************************************************** * CLASSNAME: InvoiceAddChargeDetailBean <br> * @version: 1.0, Mar 9, 2005 <br> *****************************************************************************/ public class InvoiceAddChargeDetailBean extends BaseDataBean implements SQLData { private BigDecimal invoice; private BigDecimal invoiceLine; private BigDecimal issueId; private String companyId; private String itemType; private BigDecimal prNumber; private String lineItem; private String additionalChargeDesc; private BigDecimal additionalChargeAmount; private BigDecimal additionalChargeItemId; private BigDecimal issueCostRevision; private String salesTaxApplied; private String sqlType = "INVOICE_ADD_CHARGE_DETAIL_OBJ"; //constructor public InvoiceAddChargeDetailBean() { } //setters public void setInvoice(BigDecimal invoice) { this.invoice = invoice; } public void setInvoiceLine(BigDecimal invoiceLine) { this.invoiceLine = invoiceLine; } public void setIssueId(BigDecimal issueId) { this.issueId = issueId; } public void setCompanyId(String companyId) { this.companyId = companyId; } public void setItemType(String itemType) { this.itemType = itemType; } public void setPrNumber(BigDecimal prNumber) { this.prNumber = prNumber; } public void setLineItem(String lineItem) { this.lineItem = lineItem; } public void setAdditionalChargeDesc(String additionalChargeDesc) { this.additionalChargeDesc = additionalChargeDesc; } public void setAdditionalChargeAmount(BigDecimal additionalChargeAmount) { this.additionalChargeAmount = additionalChargeAmount; } public void setAdditionalChargeItemId(BigDecimal additionalChargeItemId) { this.additionalChargeItemId = additionalChargeItemId; } public void setIssueCostRevision(BigDecimal issueCostRevision) { this.issueCostRevision = issueCostRevision; } public void setSalesTaxApplied(String salesTaxApplied) { this.salesTaxApplied = salesTaxApplied; } //getters public BigDecimal getInvoice() { return invoice; } public BigDecimal getInvoiceLine() { return invoiceLine; } public BigDecimal getIssueId() { return issueId; } public String getCompanyId() { return companyId; } public String getItemType() { return itemType; } public BigDecimal getPrNumber() { return prNumber; } public String getLineItem() { return lineItem; } public String getAdditionalChargeDesc() { return additionalChargeDesc; } public BigDecimal getAdditionalChargeAmount() { return additionalChargeAmount; } public BigDecimal getAdditionalChargeItemId() { return additionalChargeItemId; } public BigDecimal getIssueCostRevision() { return issueCostRevision; } public String getSalesTaxApplied() { return salesTaxApplied; } public String getSQLTypeName() { return this.sqlType; } public void readSQL(SQLInput stream, String type) throws SQLException { sqlType = type; try { this.setInvoice(stream.readBigDecimal()); this.setInvoiceLine(stream.readBigDecimal()); this.setIssueId(stream.readBigDecimal()); this.setCompanyId(stream.readString()); this.setItemType(stream.readString()); this.setPrNumber(stream.readBigDecimal()); this.setLineItem(stream.readString()); this.setAdditionalChargeDesc(stream.readString()); this.setAdditionalChargeAmount(stream.readBigDecimal()); this.setAdditionalChargeItemId(stream.readBigDecimal()); this.setIssueCostRevision(stream.readBigDecimal()); this.setSalesTaxApplied(stream.readString()); } catch (SQLException e) { throw (SQLException) e; } catch (Exception e) { new IllegalStateException(getClass().getName() + ".readSQL method failed"). initCause(e); } } public void writeSQL(SQLOutput stream) throws SQLException { try { stream.writeBigDecimal(this.getInvoice()); stream.writeBigDecimal(this.getInvoiceLine()); stream.writeBigDecimal(this.getIssueId()); stream.writeString(this.getCompanyId()); stream.writeString(this.getItemType()); stream.writeBigDecimal(this.getPrNumber()); stream.writeString(this.getLineItem()); stream.writeString(this.getAdditionalChargeDesc()); stream.writeBigDecimal(this.getAdditionalChargeAmount()); stream.writeBigDecimal(this.getAdditionalChargeItemId()); stream.writeBigDecimal(this.getIssueCostRevision()); stream.writeString(this.getSalesTaxApplied()); } catch (SQLException e) { throw (SQLException) e; } catch (Exception e) { new IllegalStateException(getClass().getName() + ".writeSQL method failed"). initCause(e); } } }
[ "julio.rivero@wescoair.com" ]
julio.rivero@wescoair.com
48a4297a35dd2358058b071346d6564411153c91
104cda8eafe0617e2a5fa1e2b9f242d78370521b
/aliyun-java-sdk-vs/src/main/java/com/aliyuncs/vs/model/v20181212/ContinuousAdjustRequest.java
b950b965e61d1d61cc66b5e2c11bb942bac8b30e
[ "Apache-2.0" ]
permissive
SanthosheG/aliyun-openapi-java-sdk
89f9b245c1bcdff8dac0866c36ff9a261aa40684
38a910b1a7f4bdb1b0dd29601a1450efb1220f79
refs/heads/master
2020-07-24T00:00:59.491294
2019-09-09T23:00:27
2019-09-11T04:29:56
207,744,099
2
0
NOASSERTION
2019-09-11T06:55:58
2019-09-11T06:55:58
null
UTF-8
Java
false
false
2,121
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.vs.model.v20181212; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.vs.Endpoint; /** * @author auto create * @version */ public class ContinuousAdjustRequest extends RpcAcsRequest<ContinuousAdjustResponse> { public ContinuousAdjustRequest() { super("vs", "2018-12-12", "ContinuousAdjust", "vs"); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } private String focus; private String id; private String iris; private Long ownerId; public String getFocus() { return this.focus; } public void setFocus(String focus) { this.focus = focus; if(focus != null){ putQueryParameter("Focus", focus); } } public String getId() { return this.id; } public void setId(String id) { this.id = id; if(id != null){ putQueryParameter("Id", id); } } public String getIris() { return this.iris; } public void setIris(String iris) { this.iris = iris; if(iris != null){ putQueryParameter("Iris", iris); } } public Long getOwnerId() { return this.ownerId; } public void setOwnerId(Long ownerId) { this.ownerId = ownerId; if(ownerId != null){ putQueryParameter("OwnerId", ownerId.toString()); } } @Override public Class<ContinuousAdjustResponse> getResponseClass() { return ContinuousAdjustResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
77cfddcaf586c2ee15d47e6a7a80fb0e0c66784e
8243e1469a5549e4a5e2e79c264b3c6239b3fc66
/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/jwt/idp/JWTGeneratorUtil.java
febdf57a56940e9102c2697e731efb2226d50d77
[ "LicenseRef-scancode-unknown", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "EPL-1.0", "Classpath-exception-2.0", "GPL-2.0-only", "BSD-3-Clause", "MPL-1.0", "MPL-2.0", "EPL-2.0", "LGPL-2.0-only", "CDDL-1.0", "MIT" ]
permissive
kanchw/test
90ee017aed7f389f992abd19d210be1d2124e629
67bdc0ae3cd804059743a1f761deea44f8600336
refs/heads/master
2022-12-22T16:25:42.534417
2020-01-18T13:30:25
2020-01-18T13:30:25
234,825,728
0
1
Apache-2.0
2022-12-16T00:42:51
2020-01-19T02:06:27
Java
UTF-8
Java
false
false
5,991
java
/* *Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * *WSO2 Inc. licenses this file to you under the Apache License, *Version 2.0 (the "License"); you may not use this file except *in compliance with the License. *You may obtain a copy of the License at * *http://www.apache.org/licenses/LICENSE-2.0 * *Unless required by applicable law or agreed to in writing, *software distributed under the License is distributed on an *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *KIND, either express or implied. See the License for the *specific language governing permissions and limitations *under the License. */ package org.wso2.am.integration.tests.jwt.idp; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.JOSEObjectType; import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.jose.JWSHeader; import com.nimbusds.jose.JWSSigner; import com.nimbusds.jose.crypto.RSASSASigner; import com.nimbusds.jose.util.Base64URL; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.interfaces.RSAPrivateKey; import java.util.Date; import java.util.Map; import java.util.UUID; public class JWTGeneratorUtil { public static String generatedJWT(File privateKeyFile, String keyAlias, String keyStorePassword, String keyPassword, String subject, Map<String, String> attributes) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, UnrecoverableKeyException, JOSEException { JWSHeader header = buildHeader(privateKeyFile, keyAlias, keyStorePassword); JWTClaimsSet jwtClaimsSet = buildBody(subject, attributes); return signJWT(header, jwtClaimsSet, privateKeyFile, keyAlias, keyStorePassword, keyPassword); } private static String signJWT(JWSHeader header, JWTClaimsSet jwtClaimsSet, File privateKeyLocation, String keyAlias, String keyStorePassword, String keyPassword) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException, UnrecoverableKeyException, JOSEException { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream fileInputStream = new FileInputStream(privateKeyLocation); keyStore.load(fileInputStream, keyStorePassword.toCharArray()); Key privateKey = keyStore.getKey(keyAlias, keyPassword.toCharArray()); JWSSigner signer = new RSASSASigner((RSAPrivateKey) privateKey); SignedJWT signedJWT = new SignedJWT(header, jwtClaimsSet); signedJWT.sign(signer); return signedJWT.serialize(); } private static JWTClaimsSet buildBody(String subject, Map<String, String> attributes) { JWTClaimsSet.Builder jwtClaimSetBuilder = new JWTClaimsSet.Builder(); jwtClaimSetBuilder.issuer("https://test.apim.integration"); jwtClaimSetBuilder.issueTime(new Date(System.currentTimeMillis())); jwtClaimSetBuilder.jwtID(UUID.randomUUID().toString()); jwtClaimSetBuilder.subject(subject); jwtClaimSetBuilder.notBeforeTime(new Date(System.currentTimeMillis())); jwtClaimSetBuilder.expirationTime(new Date(System.currentTimeMillis() + 15 * 60*1000)); attributes.forEach((key, value) -> { jwtClaimSetBuilder.claim(key, value); }); return jwtClaimSetBuilder.build(); } private static JWSHeader buildHeader(File privateKeyFile, String keyAlias, String keyStorePassword) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream fileInputStream = new FileInputStream(privateKeyFile); keyStore.load(fileInputStream, keyStorePassword.toCharArray()); Certificate publicCert = keyStore.getCertificate(keyAlias); MessageDigest digestValue = MessageDigest.getInstance("SHA-1"); byte[] der = publicCert.getEncoded(); digestValue.update(der); byte[] digestInBytes = digestValue.digest(); String publicCertThumbprint = hexify(digestInBytes); JWSHeader.Builder jwsHeaderBuilder = new JWSHeader.Builder(JWSAlgorithm.RS256); jwsHeaderBuilder.type(JOSEObjectType.JWT); jwsHeaderBuilder.x509CertThumbprint(new Base64URL(publicCertThumbprint)); jwsHeaderBuilder.keyID(getKID(publicCertThumbprint, JWSAlgorithm.RS256)); return jwsHeaderBuilder.build(); } /** * Helper method to hexify a byte array. * * @param bytes - The input byte array * @return hexadecimal representation */ private static String hexify(byte bytes[]) { char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; StringBuilder buf = new StringBuilder(bytes.length * 2); for (byte aByte : bytes) { buf.append(hexDigits[(aByte & 0xf0) >> 4]); buf.append(hexDigits[aByte & 0x0f]); } return buf.toString(); } /** * Helper method to add algo into to JWT_HEADER to signature verification. * * @param certThumbprint * @param signatureAlgorithm * @return */ private static String getKID(String certThumbprint, JWSAlgorithm signatureAlgorithm) { return certThumbprint + "_" + signatureAlgorithm.toString(); } }
[ "tharindua@wso2.com" ]
tharindua@wso2.com
c4a26e1b1f18685eb8b9a0e18a147212a27c80c0
882e77219bce59ae57cbad7e9606507b34eebfcf
/mi2s_10_miui12/src/main/java/miui/telephony/DefaultSlotSelector.java
010df978d79590b0778b0b622ef7599866fc1936
[]
no_license
CrackerCat/XiaomiFramework
17a12c1752296fa1a52f61b83ecf165f328f4523
0b7952df317dac02ebd1feea7507afb789cef2e3
refs/heads/master
2022-06-12T03:30:33.285593
2020-05-06T11:30:54
2020-05-06T11:30:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package miui.telephony; public abstract interface DefaultSlotSelector { public abstract int getDefaultDataSlot(int[] paramArrayOfInt, int paramInt); public abstract void onSimRemoved(int paramInt, String[] paramArrayOfString); } /* Location: /Users/sanbo/Desktop/framework/miui/framework/classes4-dex2jar.jar!/miui/telephony/DefaultSlotSelector.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "sanbo.xyz@gmail.com" ]
sanbo.xyz@gmail.com
d12da2a4063a27eede9fe6f89bb2b824795a8a30
bb60768a6eb5435a4b315f4af861b25addfd3b44
/dingtalk/java/src/main/java/com/aliyun/dingtalktodo_1_0/models/CountTodoTasksResponse.java
c87c47261b328e2989a119f7b61c9ccfec4e8209
[ "Apache-2.0" ]
permissive
yndu13/dingtalk-sdk
f023e758d78efe3e20afa1456f916238890e65dd
700fb7bb49c4d3167f84afc5fcb5e7aa5a09735f
refs/heads/master
2023-06-30T04:49:11.263304
2021-08-12T09:54:35
2021-08-12T09:54:35
395,271,690
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.dingtalktodo_1_0.models; import com.aliyun.tea.*; public class CountTodoTasksResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public CountTodoTasksResponseBody body; public static CountTodoTasksResponse build(java.util.Map<String, ?> map) throws Exception { CountTodoTasksResponse self = new CountTodoTasksResponse(); return TeaModel.build(map, self); } public CountTodoTasksResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public CountTodoTasksResponse setBody(CountTodoTasksResponseBody body) { this.body = body; return this; } public CountTodoTasksResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
beff4729bd6a6a72d1ae4fb641cffd4439684c89
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE90_LDAP_Injection/CWE90_LDAP_Injection__URLConnection_53b.java
9f89984e1340670b054d76dd4631bc17d26131d7
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
1,114
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE90_LDAP_Injection__URLConnection_53b.java Label Definition File: CWE90_LDAP_Injection.label.xml Template File: sources-sink-53b.tmpl.java */ /* * @description * CWE: 90 LDAP Injection * BadSource: URLConnection Read data from a web server with URLConnection * GoodSource: A hardcoded string * Sinks: * BadSink : data concatenated into LDAP search, which could result in LDAP Injection * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * * */ package testcases.CWE90_LDAP_Injection; import testcasesupport.*; import javax.servlet.http.*; public class CWE90_LDAP_Injection__URLConnection_53b { public void badSink(String data ) throws Throwable { (new CWE90_LDAP_Injection__URLConnection_53c()).badSink(data ); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String data ) throws Throwable { (new CWE90_LDAP_Injection__URLConnection_53c()).goodG2BSink(data ); } }
[ "you@example.com" ]
you@example.com
38a8cbfe29f3c72af725870dff6738bcba5d7b25
e06f6d05cd38815235e2f5b8925de479b9a42038
/thinkinginjava/src/main/java/com/zsun/java/tij/chapter8/Shapes.java
becb96f9b96c3a30fb218c4203d743efa33fe250
[ "MIT" ]
permissive
danielsunzhongyuan/java_advanced
02cccba28ea4c30434473164f51cd1fafdbed897
3cc08d4c2f0ce8e33a2617c3e7e5618b91e1c566
refs/heads/master
2021-07-02T22:37:47.219044
2020-09-18T02:18:59
2020-09-18T02:18:59
182,041,843
1
0
MIT
2020-10-13T17:05:36
2019-04-18T07:50:38
Java
UTF-8
Java
false
false
680
java
package com.zsun.java.tij.chapter8; import com.zsun.java.tij.chapter8.polymorphism.shape.RandomShapeGenerator; import com.zsun.java.tij.chapter8.polymorphism.shape.Shape; /** * Created by zsun. * DateTime: 2019/05/01 17:51 */ public class Shapes { private static RandomShapeGenerator gen = new RandomShapeGenerator(); public static void main(String[] args) { Shape[] shapes = new Shape[9]; for (int i = 0; i < shapes.length; i++) { shapes[i] = gen.next(); } for (Shape s : shapes) { s.draw(); System.out.print("\t\t"); s.wheels(); System.out.print("\n"); } } }
[ "sunzhongyuan@lvwan.com" ]
sunzhongyuan@lvwan.com
4d8bd383158c189e7ac976a57f91e449b33a2554
4c03af53e4bf38961923b167bcc3fd5fb4d4a789
/core/spoofax.compiler/src/main/java/mb/spoofax/compiler/ImmutableStyle.java
abfb51b0b1be2542d4e354729ac38b2ba5064523
[ "Apache-2.0" ]
permissive
metaborg/spoofax-pie
a367b679bd21d7f89841f4ef3e984e5c1653d5af
98f49ef75fcd4d957a65c9220e4dc4c01d354b01
refs/heads/develop
2023-07-27T06:08:28.446264
2023-07-16T14:46:02
2023-07-16T14:46:02
102,472,170
10
16
Apache-2.0
2023-02-06T17:30:58
2017-09-05T11:19:03
Java
UTF-8
Java
false
false
504
java
package mb.spoofax.compiler; import org.immutables.value.Value; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({ElementType.PACKAGE, ElementType.TYPE}) @Retention(RetentionPolicy.CLASS) // Class retention for incremental compilation. @Value.Style( jdkOnly = true, typeImmutableEnclosing = "*Data", deepImmutablesDetection = true ) public @interface ImmutableStyle {}
[ "gabrielkonat@gmail.com" ]
gabrielkonat@gmail.com
be0af8b2d06cecec045cb09bbeff9f9b53126bbd
e0c69cd94fdb647eff5806d66fa3a51d9a8892ff
/springbasic/src/main/java/com/trainig/spring/jpa/DBOperations.java
aeb32380e817e0a2e22c51b2d2dc719b1b24d131
[]
no_license
osmanyoy/Sarmal
7c3267080b30c88a277d7f686d90304df70a614d
89d90f8ef8b31896ed5a5144221c6fb577901652
refs/heads/master
2021-01-01T18:01:08.145559
2017-10-03T16:07:03
2017-10-03T16:07:03
98,227,710
3
3
null
null
null
null
UTF-8
Java
false
false
648
java
package com.trainig.spring.jpa; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; @Repository public class DBOperations { @Autowired private EntityManagerFactory entityManagerFactory; public void save(Employee employee){ EntityManager entityManager = entityManagerFactory.createEntityManager(); entityManager.getTransaction().begin(); entityManager.persist(employee); entityManager.getTransaction().commit(); entityManager.close(); } }
[ "osman.yaycioglu@gmail.com" ]
osman.yaycioglu@gmail.com
110dc6d3d819742a0dd092e6af5c9f0e70be5ec1
320a43287196b09eb160137a33a22312e6677c6a
/cf-forgot-jdk/src/main/java/org/cf/forgot/jdk/concurrent/RunnableDemo.java
1f212a0aa17bf46042886f395208e6d8d08de709
[]
no_license
yangzw137/cf-forgot-java
050a389069d5da0b294f2511755798e68ebd9a8a
7b23eefaa1e58790eef81367779b6eece2f94ecb
refs/heads/master
2023-05-14T05:44:43.899461
2021-06-06T03:05:58
2021-06-06T03:05:58
287,706,495
0
2
null
null
null
null
UTF-8
Java
false
false
550
java
package org.cf.forgot.jdk.concurrent; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; /** * @author 杨志伟 * @date 2020/7/24 */ public class RunnableDemo implements Runnable { private Lock lock; public RunnableDemo(Lock lock) { this.lock = lock; } @Override public void run() { try { lock.tryLock(10000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("11``````"); } }
[ "yangzhiwei@jd.com" ]
yangzhiwei@jd.com
eba0d78ff5caaf4dfcf70b4ed32e841711e4002f
296cdd8a3ef1d7436c1957e403b47f6a62ba5efb
/src/main/java/com/sds/acube/luxor/security/symmetric/EnDecoder.java
dddf39ea3433604297c8db064038b6a7702cc980
[]
no_license
seoyoungrag/byucksan_luxor
6611276e871c13cbb5ea013d49ac79be678f03e5
7ecb824ec8e78e95bd2a962ce4d6c54e3c51b6b3
refs/heads/master
2021-03-16T05:17:42.571476
2017-07-24T08:28:47
2017-07-24T08:28:47
83,280,413
0
0
null
null
null
null
UTF-8
Java
false
false
1,072
java
package com.sds.acube.luxor.security.symmetric; import com.sds.acube.esso.security.des.*; import com.sds.acube.luxor.security.*; public class EnDecoder implements SecurityEncoder, SecurityDecoder { public String encode(String sourceData) { return encode(sourceData, null); } public String encode(String sourceData, String key) { StringBuffer buff = new StringBuffer(); buff.append(":"); buff.append(sourceData); buff.append(":sisenc"); return Encrypt.com_Encode(buff.toString()); } public String decode(String encodedData) { return decode(encodedData, null); } public String decode(String encodedData, String key) { String decodedData = Encrypt.com_Decode(encodedData); int e = decodedData.indexOf(":"); int d = decodedData.lastIndexOf(":sisenc"); if (e > -1 && d > -1) { decodedData = decodedData.substring(e + 1, d); } return decodedData; } }
[ "truezure@gmail.com" ]
truezure@gmail.com
4a2d9a3f0ad43eb90589a3b94ea8e75ae8e5a3ce
0319afb5c64ed401fc4bcadc20fe39fe2634cb8e
/trunk/icepdf/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/OneColumnPageView.java
cf5560a0a42802caaa1675b4f0171c8c1789e592
[]
no_license
svn2github/icepdf-6_3_0_all
e3334b1d98c8fb3b400a57b05a32a7bcc2c86d99
e73b943f4449c8967472a1f5a477c8c136afb803
refs/heads/master
2023-09-03T10:39:31.313071
2018-09-06T03:00:25
2018-09-06T03:00:25
133,867,237
1
0
null
null
null
null
UTF-8
Java
false
false
6,397
java
/* * Copyright 2006-2018 ICEsoft Technologies Canada Corp. * * 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.icepdf.ri.common.views; import org.icepdf.ri.common.CurrentPageChanger; import org.icepdf.ri.common.KeyListenerPageColumnChanger; import javax.swing.*; import java.awt.*; import java.util.List; /** * <p>Constructs a one column page view as defined in the PDF specification. A one * column page view displays pages continuously in one column.</p> * <br> * <p>Page views are basic containers which use Swing Layout Containers to * place pages </p> * * @since 2.5 */ @SuppressWarnings("serial") public class OneColumnPageView extends AbstractDocumentView { // specialized listeners for different gui operations protected CurrentPageChanger currentPageChanger; protected KeyListenerPageColumnChanger keyListenerPageChanger; public OneColumnPageView(DocumentViewController documentDocumentViewController, JScrollPane documentScrollpane, DocumentViewModel documentViewModel) { super(documentDocumentViewController, documentScrollpane, documentViewModel); // put all the gui elements together buildGUI(); // add the first of many tools need for this views and others like it. currentPageChanger = new CurrentPageChanger(documentScrollpane, this, documentViewModel.getPageComponents()); // add page changing key listeners keyListenerPageChanger = KeyListenerPageColumnChanger.install(this.documentViewController.getParentController(), documentViewModel.getDocumentViewScrollPane(), this, currentPageChanger); } private void buildGUI() { // add all page components to grid layout panel pagesPanel = new JPanel(); pagesPanel.setBackground(backgroundColour); // one column equals single page view continuous GridLayout gridLayout = new GridLayout(0, 1, horizontalSpace, verticalSpace); pagesPanel.setLayout(gridLayout); // use a grid bag to center the page component panel GridBagConstraints gbc = new GridBagConstraints(); gbc.weighty = 1.0; // allows vertical resizing gbc.weightx = 1.0; // allows horizontal resizing gbc.insets = // component spacer [top, left, bottom, right] new Insets(layoutInserts, layoutInserts, layoutInserts, layoutInserts); gbc.gridwidth = GridBagConstraints.REMAINDER; // one component per row this.setLayout(new GridBagLayout()); this.add(pagesPanel, gbc); // finally add all the components // add components for every page in the document List<AbstractPageViewComponent> pageComponents = documentViewController.getDocumentViewModel().getPageComponents(); if (pageComponents != null) { for (PageViewComponent pageViewComponent : pageComponents) { if (pageViewComponent != null) { pageViewComponent.setDocumentViewCallback(this); // add component to layout pagesPanel.add(new PageViewDecorator( (AbstractPageViewComponent) pageViewComponent)); } } } } // nothing needs to be done for a column view as all components are already // available public void updateDocumentView() { } /** * Returns a next page increment of one. */ public int getNextPageIncrement() { return 1; } /** * Returns a previous page increment of one. */ public int getPreviousPageIncrement() { return 1; } public void dispose() { disposing = true; // remove utilities if (currentPageChanger != null) { currentPageChanger.dispose(); } if (keyListenerPageChanger != null) { keyListenerPageChanger.uninstall(); } // trigger a re-layout pagesPanel.removeAll(); pagesPanel.invalidate(); // make sure we call super. super.dispose(); } public Dimension getDocumentSize() { float pageViewWidth = 0; float pageViewHeight = 0; if (pagesPanel != null) { int currCompIndex = documentViewController.getCurrentPageIndex(); int numComponents = pagesPanel.getComponentCount(); if (currCompIndex >= 0 && currCompIndex < numComponents) { Component comp = pagesPanel.getComponent(currCompIndex); if (comp instanceof PageViewDecorator) { PageViewDecorator pvd = (PageViewDecorator) comp; Dimension dim = pvd.getPreferredSize(); pageViewWidth = dim.width; pageViewHeight = dim.height; } } } // normalize the dimensions to a zoom level of zero. float currentZoom = documentViewController.getDocumentViewModel().getViewZoom(); pageViewWidth = Math.abs(pageViewWidth / currentZoom); pageViewHeight = Math.abs(pageViewHeight / currentZoom); // add any horizontal padding from layout manager pageViewWidth += AbstractDocumentView.horizontalSpace * 2; pageViewHeight += AbstractDocumentView.verticalSpace * 2; return new Dimension((int) pageViewWidth, (int) pageViewHeight); } public void paintComponent(Graphics g) { Rectangle clipBounds = g.getClipBounds(); // paint background gray g.setColor(backgroundColour); g.fillRect(clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height); // paint selection box super.paintComponent(g); } }
[ "patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74" ]
patrick.corless@8668f098-c06c-11db-ba21-f49e70c34f74
304d4d0345e5f07d5f33a5cdd75f4f6ad867ddcc
384e298b94511490ed20a07a8659d2188401a6bc
/GeniusBI/src/negotiator/NegotiationEventListener.java
b3a86ec3226fdcb41a1f56a736d94b91f5a37fb4
[]
no_license
erelsgl-nlp/GeniusWebSocket
d60c91eb49cd6a75f5078d58e7cb79e9291c2448
07e901d6726f066ee7e86cf7e9a1db561333465a
refs/heads/master
2021-05-26T15:34:39.845968
2013-05-06T10:20:59
2013-05-06T10:20:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,092
java
package negotiator; import negotiator.events.ActionEvent; import negotiator.events.BilateralAtomicNegotiationSessionEvent; import negotiator.events.LogMessageEvent; import negotiator.events.NegotiationEndedEvent; import negotiator.events.NegotiationSessionEvent; /** * implement this class in order to subscribe with the NegotiationManager * to get callback on handleEvent(). * * @author wouter * */ public interface NegotiationEventListener { /** IMPORTANT: * in handleEvent, don't do more than just storing the event and * notifying your interface that a new event has arrived. * Doing more than this will snoop time from the negotiation, * which will disturb the negotiation. * @param evt */ public void handleActionEvent(ActionEvent evt); public void handleNegotiationEndedEvent(NegotiationEndedEvent evt); public void handleLogMessageEvent(LogMessageEvent evt); public void handleNegotiationSessionEvent(NegotiationSessionEvent evt); public void handleBlateralAtomicNegotiationSessionEvent(BilateralAtomicNegotiationSessionEvent evt); }
[ "erelsgl@gmail.com" ]
erelsgl@gmail.com
48f4402812f4711342cd20fdabda6bc72bfd8453
706dae6cc6526064622d4f5557471427441e5c5e
/src/test/java/com/anbo/juja/patterns/builder_20/classic/case1_doubleBraceInitialization/MainTest.java
ade87b75eaa94e3ce8e324be1037a3b011acc42a
[]
no_license
Anton-Bondar/Design-patterns-JUJA-examples-
414edabfd8c4148640de7de8d01f809b01c3c17c
9e3d628f7e45c0106514f8f459ea30fffed702d5
refs/heads/master
2021-10-09T04:45:42.372993
2018-12-21T12:09:00
2018-12-21T12:11:14
121,509,668
0
0
null
null
null
null
UTF-8
Java
false
false
578
java
package com.anbo.juja.patterns.builder_20.classic.case1_doubleBraceInitialization; import org.junit.Test; import ua.com.juja.patterns.objectPool.ConsoleMock; import static org.junit.Assert.assertEquals; /** * Created by oleksandr.baglai on 11.01.2016. */ public class MainTest { ConsoleMock console = new ConsoleMock(); @Test public void test() throws Exception { // when Main.main(new String[0]); // then assertEquals("SomeObject{field1='data1', field2='data2', field3='data3'}\n", console.getOut()); } }
[ "AntonBondar2013@gmail.com" ]
AntonBondar2013@gmail.com
6cc19439b8b4207e4f8cb5c4a8fc3870f3459d7c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_cfe3a43d947c0f66c347a223ffcce5d91e625d0d/TwigBlockParser/11_cfe3a43d947c0f66c347a223ffcce5d91e625d0d_TwigBlockParser_s.java
56a58826a18ee5bad3728d17ecc8ba5b4dd04c26
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,893
java
package fr.adrienbrault.idea.symfony2plugin.templating.dict; import com.intellij.psi.PsiFile; import com.jetbrains.twig.TwigFile; import fr.adrienbrault.idea.symfony2plugin.TwigHelper; import java.util.ArrayList; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; public class TwigBlockParser { public static String EXTENDS_TEMPLATE_NAME_PATTERN = "^[\\s+]*\\{%\\s+extends[\\s+]*['|\"](.*?)['|\"]"; private Map<String, TwigFile> twigFilesByName; public TwigBlockParser(Map<String, TwigFile> twigFilesByName) { this.twigFilesByName = twigFilesByName; } public ArrayList<TwigBlock> walk(PsiFile file) { return this.walk(file, "self", new ArrayList<TwigBlock>(), 0); } public ArrayList<TwigBlock> walk(PsiFile file, String shortcutName, ArrayList<TwigBlock> current, int depth) { // @TODO: we dont use psielements here, check if Pattern faster or not // dont match on self file !? if(depth > 0) { Matcher matcherBlocks = Pattern.compile("\\{%[\\s+]*block[\\s+]*(.*?)[\\s+]*%}").matcher(file.getText()); while(matcherBlocks.find()){ current.add(new TwigBlock(matcherBlocks.group(1), shortcutName, file)); } } // limit recursive calls if(depth++ > 20) { return current; } // find extend in self Matcher matcher = Pattern.compile(EXTENDS_TEMPLATE_NAME_PATTERN).matcher(file.getText()); while(matcher.find()){ if(twigFilesByName.containsKey(TwigHelper.normalizeTemplateName(matcher.group(1)))) { TwigFile twigFile = twigFilesByName.get(matcher.group(1)); this.walk(twigFile, matcher.group(1), current, depth); } } return current; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9edb7a8806a52898ccfcfe29ca61da318427b48e
f2d335d14a5957e847659d028642e67917ed6d50
/android/src/com/android/tools/idea/rendering/AddMissingAttributesFix.java
f3da4382561bd87223c26f43311aac42b47c8d4f
[]
no_license
IllusionRom-deprecated/android_platform_tools_adt_idea
4803521b933ff03d77e1f84f9d49a7689fcf6143
25b756a1778968ac8bab97f48a06fb2e87ab68e5
refs/heads/master
2016-09-06T07:22:40.282736
2013-12-10T23:47:12
2013-12-10T23:47:12
15,299,718
1
0
null
null
null
null
UTF-8
Java
false
false
7,317
java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.idea.rendering; import com.android.ide.common.rendering.api.ResourceValue; import com.android.ide.common.rendering.api.StyleResourceValue; import com.android.ide.common.resources.ResourceResolver; import com.google.common.collect.Lists; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.Result; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.xml.XmlAttribute; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.List; import static com.android.SdkConstants.*; public class AddMissingAttributesFix extends WriteCommandAction<Void> { @NotNull private final XmlFile myFile; @Nullable private final ResourceResolver myResourceResolver; public AddMissingAttributesFix(@NotNull Project project, @NotNull XmlFile file, @Nullable ResourceResolver resourceResolver) { super(project, "Add Size Attributes", file); myFile = file; myResourceResolver = resourceResolver; } @NotNull public List<XmlTag> findViewsMissingSizes() { final List<XmlTag> missing = Lists.newArrayList(); ApplicationManager.getApplication().runReadAction(new Runnable() { @Override public void run() { Collection<XmlTag> xmlTags = PsiTreeUtil.findChildrenOfType(myFile, XmlTag.class); for (XmlTag tag : xmlTags) { if (requiresSize(tag)) { if (!definesWidth(tag, myResourceResolver) || !definesHeight(tag, myResourceResolver)) { missing.add(tag); } } } } }); return missing; } @Override protected void run(Result<Void> result) throws Throwable { final List<XmlTag> missing = findViewsMissingSizes(); for (XmlTag tag : missing) { if (!definesWidth(tag, myResourceResolver)) { tag.setAttribute(ATTR_LAYOUT_WIDTH, ANDROID_URI, getDefaultWidth(tag)); } if (!definesHeight(tag, myResourceResolver)) { tag.setAttribute(ATTR_LAYOUT_HEIGHT, ANDROID_URI, getDefaultHeight(tag)); } } } public static boolean definesHeight(@NotNull XmlTag tag, @Nullable ResourceResolver resourceResolver) { XmlAttribute height = tag.getAttribute(ATTR_LAYOUT_HEIGHT, ANDROID_URI); boolean definesHeight = height != null; if (definesHeight) { String value = height.getValue(); if (value == null || value.isEmpty()) { return false; } return value.equals(VALUE_WRAP_CONTENT) || value.equals(VALUE_FILL_PARENT) || value.equals(VALUE_MATCH_PARENT) || value.startsWith(PREFIX_RESOURCE_REF) || value.startsWith(PREFIX_THEME_REF) || Character.isDigit(value.charAt(0)); } else if (resourceResolver != null) { String style = tag.getAttributeValue(ATTR_STYLE); if (style != null) { ResourceValue st = resourceResolver.findResValue(style, false); if (st instanceof StyleResourceValue) { StyleResourceValue styleValue = (StyleResourceValue)st; definesHeight = resourceResolver.findItemInStyle(styleValue, ATTR_LAYOUT_HEIGHT, true) != null; } } } return definesHeight; } public static boolean definesWidth(@NotNull XmlTag tag, @Nullable ResourceResolver resourceResolver) { XmlAttribute width = tag.getAttribute(ATTR_LAYOUT_WIDTH, ANDROID_URI); boolean definesWidth = width != null; if (definesWidth) { String value = width.getValue(); if (value == null || value.isEmpty()) { return false; } return value.equals(VALUE_WRAP_CONTENT) || value.equals(VALUE_FILL_PARENT) || value.equals(VALUE_MATCH_PARENT) || value.startsWith(PREFIX_RESOURCE_REF) || value.startsWith(PREFIX_THEME_REF) || Character.isDigit(value.charAt(0)); } else if (resourceResolver != null) { String style = tag.getAttributeValue(ATTR_STYLE); if (style != null) { ResourceValue st = resourceResolver.findResValue(style, false); if (st instanceof StyleResourceValue) { StyleResourceValue styleValue = (StyleResourceValue)st; definesWidth = resourceResolver.findItemInStyle(styleValue, ATTR_LAYOUT_WIDTH, true) != null; } } } return definesWidth; } @NotNull private static String getDefaultWidth(@NotNull XmlTag tag) { // Depends on parent and child. For now, just do wrap unless it's a layout //String tagName = tag.getName(); // See Change-Id: I335a3bd8e2d7f7866692898ed73492635a5b61ea // For the platform layouts the default value is WRAP_CONTENT (and is // defined in the ViewGroup.LayoutParams class). The special cases // are accommodated in LayoutParams subclasses in the following cases: // Subclass width height // FrameLayout.LayoutParams: MATCH_PARENT, MATCH_PARENT // TableLayout.LayoutParams: MATCH_PARENT, WRAP_CONTENT // TableRow.LayoutParams: MATCH_PARENT, WRAP_CONTENT XmlTag parentTag = getParentTag(tag); if (parentTag != null) { String parent = parentTag.getName(); if (parent.equals(FRAME_LAYOUT) || parent.equals(TABLE_LAYOUT) || parent.equals(TABLE_ROW)) { return VALUE_MATCH_PARENT; // TODO: VALUE_FILL_PARENT? } // TODO: If custom view, check its parentage! } return VALUE_WRAP_CONTENT; } @NotNull private static String getDefaultHeight(@NotNull XmlTag tag) { // See #getDefaultWidth for a description of the defaults XmlTag parentTag = getParentTag(tag); if (parentTag != null) { String parent = parentTag.getName(); if (parent.equals(FRAME_LAYOUT) ) { return VALUE_MATCH_PARENT; } } return VALUE_WRAP_CONTENT; } @Nullable private static XmlTag getParentTag(@NotNull XmlTag tag) { PsiElement parent = tag.getParent(); if (parent instanceof XmlTag) { return (XmlTag)parent; } return null; } private static boolean requiresSize(XmlTag tag) { XmlTag parentTag = getParentTag(tag); if (parentTag != null) { String parentName = parentTag.getName(); if (GRID_LAYOUT.equals(parentName) || FQCN_GRID_LAYOUT_V7.equals(parentName)) { return false; } } String tagName = tag.getName(); if (tagName.equals(REQUEST_FOCUS) || tagName.equals(VIEW_MERGE) || tagName.equals(VIEW_INCLUDE)) { return false; } return true; } }
[ "tnorbye@google.com" ]
tnorbye@google.com
ad64d454f07107c0aabd767a98468f74efb7c549
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_210590421e6a507d5f76f1498d75928d2715a592/InbandGenerator/28_210590421e6a507d5f76f1498d75928d2715a592_InbandGenerator_s.java
c991090a4e9629c71ce85244f30d513605457148
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,209
java
/* * The source code contained in this file is in in the public domain. * It can be used in any project or product without prior permission, * license or royalty payments. There is NO WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, * THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, * AND DATA ACCURACY. We do not warrant or make any representations * regarding the use of the software or the results thereof, including * but not limited to the correctness, accuracy, reliability or * usefulness of the software. */ package org.mobicents.media.server.impl.dtmf; import java.io.IOException; import java.util.Random; import java.util.Timer; import java.util.TimerTask; import org.mobicents.media.Buffer; import org.mobicents.media.Format; import org.mobicents.media.format.AudioFormat; import org.mobicents.media.protocol.BufferTransferHandler; import org.mobicents.media.protocol.ContentDescriptor; import org.mobicents.media.protocol.PushBufferStream; import org.mobicents.media.server.impl.jmf.dsp.Codec; import org.mobicents.media.server.impl.jmf.dsp.CodecLocator; /** * * @author Oleg Kulikov */ public class InbandGenerator implements PushBufferStream { private final static AudioFormat LINEAR = new AudioFormat( AudioFormat.LINEAR, 8000, 16, 1); public final static String[][] events = new String[][] { {"1", "2", "3", "A"}, {"4", "5", "6", "B"}, {"7", "8", "9", "C"}, {"*", "0", "#", "D"} }; private int[] lowFreq = new int[]{697, 770, 852, 941}; private int[] highFreq = new int[]{1209, 1336, 1477, 1633}; private BufferTransferHandler transferHandler; private boolean started = false; private byte[] data; private long seqNumber = 0; private Timer timer = new Timer(); private int offset = 0; private int sizeInBytes; private int duration; private Codec codec; public InbandGenerator(String tone, int duration) { this.duration = duration; codec = CodecLocator.getCodec(Codec.LINEAR_AUDIO, Codec.PCMU); sizeInBytes = (int)( (LINEAR.getSampleRate()/ 1000) * (LINEAR.getSampleSizeInBits()/8) * duration ); System.out.println("Size in bytes=" + sizeInBytes); int len = (int)LINEAR.getSampleRate(); data = new byte[LINEAR.getSampleSizeInBits() / 8 * len]; int[] freq = getFreq(tone); System.out.println("f0=" + freq[0] + ", f1=" + freq[1]); Random rnd = new Random(); int k = 0; for (int i = 0; i < len; i++) { short s = (short) ( (short)(Short.MAX_VALUE/2 * Math.sin(2 * Math.PI * freq[0] * i / len)) + (short)(Short.MAX_VALUE/2 * Math.sin(2 * Math.PI * freq[1] * i / len)) ); data[k++] = (byte) (s); data[k++] = (byte) (s >> 8); //System.out.println("s=" + s); } } public static void print(byte[] data) { System.out.println("--------------------"); for (int i = 0; i < data.length; i++) { System.out.print(data[i] + " "); } System.out.println(); System.out.println("--------------------"); } public void read(Buffer buffer) throws IOException { //System.out.println("reading"); byte[] media = new byte[sizeInBytes]; int count = Math.min(data.length - offset, sizeInBytes); System.arraycopy(data, offset, media, 0, count); offset += count; if (offset == data.length) { offset = 0; } //System.out.println("src="); //print(media); byte[] media1 = codec.process(media); //System.out.println("compressed="); //print(media1); buffer.setOffset(0); buffer.setLength(media1.length); buffer.setSequenceNumber(seqNumber); buffer.setDuration(duration); buffer.setTimeStamp(seqNumber * duration); //@todo: synchronize clock buffer.setData(media1); buffer.setFormat(Codec.PCMU); seqNumber++; } private int[] getFreq(String tone) { int freq[] = new int[2]; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (events[i][j].equalsIgnoreCase(tone)) { freq[0] = lowFreq[i]; freq[1]= highFreq[j]; } } } return freq; } public Format getFormat() { return codec.PCMU; } public void setTransferHandler(BufferTransferHandler transferHandler) { this.transferHandler = transferHandler; if (transferHandler != null) { start(); } } public ContentDescriptor getContentDescriptor() { return new ContentDescriptor(ContentDescriptor.RAW); } public long getContentLength() { return LENGTH_UNKNOWN; } public boolean endOfStream() { return false; } public Object[] getControls() { return null; } public Object getControl(String string) { return null; } protected void start() { if (!started && transferHandler != null) { timer = new Timer(); timer.scheduleAtFixedRate(new Transmitter(this), 0, duration); started = true; } } protected void stop() { if (started) { timer.cancel(); timer.purge(); started = false; } } private class Transmitter extends TimerTask { private PushBufferStream stream; public Transmitter(PushBufferStream stream) { this.stream = stream; } public void run() { transferHandler.transferData(stream); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6d3e852b05e120c590a6a36d84c867cc63e9a789
c5a67e2aeabbde81c93a329ae2e9c7ccc3631246
/src/main/java/com/vnw/data/jooq/tables/records/TblmsUserRecord.java
d962cea6142594adf0460accc816d51b4b7a9a47
[]
no_license
phuonghuynh/dtools
319d773d01c32093fd17d128948ef89c81f3f4bf
883d15ef19da259396a7bc16ac9df590e8add015
refs/heads/master
2016-09-14T03:46:53.463230
2016-05-25T04:04:32
2016-05-25T04:04:32
59,534,869
1
0
null
null
null
null
UTF-8
Java
false
false
7,326
java
/** * This class is generated by jOOQ */ package com.vnw.data.jooq.tables.records; import com.vnw.data.jooq.tables.TblmsUser; import java.sql.Timestamp; import javax.annotation.Generated; import org.jooq.Field; import org.jooq.Record2; import org.jooq.Record6; import org.jooq.Row6; import org.jooq.impl.UpdatableRecordImpl; import org.jooq.types.UInteger; /** * This class is generated by jOOQ. */ @Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class TblmsUserRecord extends UpdatableRecordImpl<TblmsUserRecord> implements Record6<UInteger, String, Timestamp, String, Byte, UInteger> { private static final long serialVersionUID = -1012213494; /** * Setter for <code>vnw_core.tblms_user.userid</code>. */ public void setUserid(UInteger value) { set(0, value); } /** * Getter for <code>vnw_core.tblms_user.userid</code>. */ public UInteger getUserid() { return (UInteger) get(0); } /** * Setter for <code>vnw_core.tblms_user.siteName</code>. */ public void setSitename(String value) { set(1, value); } /** * Getter for <code>vnw_core.tblms_user.siteName</code>. */ public String getSitename() { return (String) get(1); } /** * Setter for <code>vnw_core.tblms_user.registerDate</code>. Same createddate for user register via microsite, diff for old user update require info for microsite */ public void setRegisterdate(Timestamp value) { set(2, value); } /** * Getter for <code>vnw_core.tblms_user.registerDate</code>. Same createddate for user register via microsite, diff for old user update require info for microsite */ public Timestamp getRegisterdate() { return (Timestamp) get(2); } /** * Setter for <code>vnw_core.tblms_user.descr</code>. */ public void setDescr(String value) { set(3, value); } /** * Getter for <code>vnw_core.tblms_user.descr</code>. */ public String getDescr() { return (String) get(3); } /** * Setter for <code>vnw_core.tblms_user.status</code>. 1:active; 0: inactive */ public void setStatus(Byte value) { set(4, value); } /** * Getter for <code>vnw_core.tblms_user.status</code>. 1:active; 0: inactive */ public Byte getStatus() { return (Byte) get(4); } /** * Setter for <code>vnw_core.tblms_user.djCount</code>. */ public void setDjcount(UInteger value) { set(5, value); } /** * Getter for <code>vnw_core.tblms_user.djCount</code>. */ public UInteger getDjcount() { return (UInteger) get(5); } // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public Record2<UInteger, String> key() { return (Record2) super.key(); } // ------------------------------------------------------------------------- // Record6 type implementation // ------------------------------------------------------------------------- /** * {@inheritDoc} */ @Override public Row6<UInteger, String, Timestamp, String, Byte, UInteger> fieldsRow() { return (Row6) super.fieldsRow(); } /** * {@inheritDoc} */ @Override public Row6<UInteger, String, Timestamp, String, Byte, UInteger> valuesRow() { return (Row6) super.valuesRow(); } /** * {@inheritDoc} */ @Override public Field<UInteger> field1() { return TblmsUser.TBLMS_USER.USERID; } /** * {@inheritDoc} */ @Override public Field<String> field2() { return TblmsUser.TBLMS_USER.SITENAME; } /** * {@inheritDoc} */ @Override public Field<Timestamp> field3() { return TblmsUser.TBLMS_USER.REGISTERDATE; } /** * {@inheritDoc} */ @Override public Field<String> field4() { return TblmsUser.TBLMS_USER.DESCR; } /** * {@inheritDoc} */ @Override public Field<Byte> field5() { return TblmsUser.TBLMS_USER.STATUS; } /** * {@inheritDoc} */ @Override public Field<UInteger> field6() { return TblmsUser.TBLMS_USER.DJCOUNT; } /** * {@inheritDoc} */ @Override public UInteger value1() { return getUserid(); } /** * {@inheritDoc} */ @Override public String value2() { return getSitename(); } /** * {@inheritDoc} */ @Override public Timestamp value3() { return getRegisterdate(); } /** * {@inheritDoc} */ @Override public String value4() { return getDescr(); } /** * {@inheritDoc} */ @Override public Byte value5() { return getStatus(); } /** * {@inheritDoc} */ @Override public UInteger value6() { return getDjcount(); } /** * {@inheritDoc} */ @Override public TblmsUserRecord value1(UInteger value) { setUserid(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord value2(String value) { setSitename(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord value3(Timestamp value) { setRegisterdate(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord value4(String value) { setDescr(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord value5(Byte value) { setStatus(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord value6(UInteger value) { setDjcount(value); return this; } /** * {@inheritDoc} */ @Override public TblmsUserRecord values(UInteger value1, String value2, Timestamp value3, String value4, Byte value5, UInteger value6) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); value6(value6); return this; } // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- /** * Create a detached TblmsUserRecord */ public TblmsUserRecord() { super(TblmsUser.TBLMS_USER); } /** * Create a detached, initialised TblmsUserRecord */ public TblmsUserRecord(UInteger userid, String sitename, Timestamp registerdate, String descr, Byte status, UInteger djcount) { super(TblmsUser.TBLMS_USER); set(0, userid); set(1, sitename); set(2, registerdate); set(3, descr); set(4, status); set(5, djcount); } }
[ "phuonghqh@gmail.com" ]
phuonghqh@gmail.com
e5552b3aec2b515ed321f461d9dfc7df281d2e54
339061e3a250d14e709e21f6b814cebedf0ffd3f
/spring-mvn-admin/spring-mvn-core/spring-mvn-core-amain/src/main/java/cn/spring/mvn/core/amain/entity/service/OrganizationService.java
e6dcde9530e178a9ecbc9a495ff94d73e336aa61
[]
no_license
liutao1024/github-mvn
f277daeabfdd58835d0c466c01a5b39107cc21fe
0b58abc929c0d7ad771a8eeccdfdddc75d999b3f
refs/heads/master
2021-07-08T16:51:46.482698
2019-01-30T05:24:20
2019-01-30T05:24:20
139,798,131
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package cn.spring.mvn.core.amain.entity.service; import java.util.List; import cn.spring.mvn.basic.ibatis.IBatisService; import cn.spring.mvn.core.amain.entity.Organization; public interface OrganizationService extends IBatisService<Organization>{ public List<Organization> selectAll(); }
[ "979497772@qq.com" ]
979497772@qq.com
9e1b08e7b895b9439c24d5a47abf4644e772d69c
36155fc6d1b1cd36edb4b80cb2fc2653be933ebd
/lc/src/LC/SOL/SearchinaSortedArrayofUnknownSize.java
4f9a9c997a8bb31b7a0ff1bc6528f4f2d6e50b39
[]
no_license
Delon88/leetcode
c9d46a6e29749f7a2c240b22e8577952300f2b0f
84d17ee935f8e64caa7949772f20301ff94b9829
refs/heads/master
2021-08-11T05:52:28.972895
2021-08-09T03:12:46
2021-08-09T03:12:46
96,177,512
0
0
null
null
null
null
UTF-8
Java
false
false
586
java
package LC.SOL; public class SearchinaSortedArrayofUnknownSize { class Solution { interface ArrayReader { public int get(int index) ; } public int search(ArrayReader reader, int target) { int start = 0, end = 20000; while ( start <= end ) { int mid = ( start + end ) / 2; int v = reader.get(mid); if ( v == target) return mid; else if (v < target ) start= mid + 1; else end = mid - 1; } return -1; } } }
[ "Mr.AlainDelon@gmail.com" ]
Mr.AlainDelon@gmail.com
835085393409584740f983d080028a51e770109a
e70eb4b70b484e1f9f00019f4cbf32488f38d40d
/VideoStore_Class_Sequence_diagrams/5/Rental.java
7a4e761ab2256f264c3ed0492d4d00400fd3daa2
[]
no_license
MatinMan/RefactoringMiner
3d4033c53cfcbbca4a23ed0153faa8d0346f4cc5
6d2895ca96ec71394a2bff4d1b6f12eeccddc01e
refs/heads/master
2020-04-08T14:31:20.874512
2016-05-18T14:01:49
2016-05-18T14:01:49
60,316,879
1
0
null
2016-06-03T03:53:19
2016-06-03T03:53:18
null
UTF-8
Java
false
false
1,148
java
public class Rental { private Movie _movie; private int _daysRented; public Rental(Movie movie, int daysRented) { _movie = movie; _daysRented = daysRented; } public int getDaysRented() { return _daysRented; } public Movie getMovie() { return _movie; } public double getCharge() { double result = 0; switch(getMovie().getPriceCode()) { case Movie.REGULAR: result += 2; if (getDaysRented() > 2) result += (getDaysRented() - 2) * 1.5; break; case Movie.NEW_RELEASE: result += getDaysRented() * 3; break; case Movie.CHILDRENS: result += 1.5; if (getDaysRented() > 3) result += (getDaysRented() - 3) * 1.5; break; } return result; } public int getFrequentRenterPoints() { //add bonus for a two day new release rental if((getMovie().getPriceCode() == Movie.NEW_RELEASE) && getDaysRented() > 1) return 2; else return 1; } }
[ "tsantalis@gmail.com" ]
tsantalis@gmail.com
a7a8b1dcadbf85384bf8c2811e2067e6da9fa81a
ffeaf567e9b1aadb4c00d95cd3df4e6484f36dcd
/Talagram/com/google/android/gms/internal/clearcut/zzft.java
5b15e82da61921289673290da7decccfdd0ab699
[]
no_license
danielperez9430/Third-party-Telegram-Apps-Spy
dfe541290c8512ca366e401aedf5cc5bfcaa6c3e
f6fc0f9c677bd5d5cd3585790b033094c2f0226d
refs/heads/master
2020-04-11T23:26:06.025903
2018-12-18T10:07:20
2018-12-18T10:07:20
162,166,647
0
0
null
null
null
null
UTF-8
Java
false
false
452
java
package com.google.android.gms.internal.clearcut; import java.io.IOException; public final class zzft extends IOException { zzft(int arg3, int arg4) { StringBuilder v0 = new StringBuilder(108); v0.append("CodedOutputStream was writing to a flat byte array and ran out of space (pos "); v0.append(arg3); v0.append(" limit "); v0.append(arg4); v0.append(")."); super(v0.toString()); } }
[ "dpefe@hotmail.es" ]
dpefe@hotmail.es
df22081b8d2ab0ff1371d5526928924749ced8ff
097e701d4735e4a01125c005a4a2769337a494c2
/brederplugin/src/breder/plugin/swt/BLabel.java
bb163acdb552a0c9c770dfbc520488906d138a7e
[]
no_license
bernardobreder/monograph
f937631945cab0c439e01b6831138b3a27cf301d
a8ebb1c7a119cebb1ebee365c0c8748575c2b311
refs/heads/master
2021-07-05T02:24:06.585183
2017-09-22T23:56:11
2017-09-22T23:56:11
104,519,515
0
0
null
null
null
null
UTF-8
Java
false
false
710
java
package breder.plugin.swt; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; public class BLabel extends BComponent { private String text; private Label component; public BLabel(String text) { this.text = text; } public String getText() { return text; } @Override public Label getComposite() { return this.component; } @Override public Control build() { // TODO Auto-generated method stub return null; } @Override protected Control build(Composite parent) { this.component = new Label(parent, SWT.NULL); this.component.setText(this.getText()); return this.component; } }
[ "bernardobreder@gmail.com" ]
bernardobreder@gmail.com
3abe86381a19b388c40d6e8a709be5df3dcd6cd3
05402fc0ffd11a84bb9619152d2a28f1b2e10047
/fase2/ine5404/programasEmJava/bingoServidor/fontes/comportamento/cartela/cartelaQuadrada/NaoPossoCriarCartelaComOrdemOuNumeroMaximoMenorQueUm.java
a718ae7ce218590b543319201c81a7eb5e158bb8
[]
no_license
grazipauluka/cienciasDaComputacaoUfsc
61c14d724e6852529e5d8b0a576be819a1a1547d
13357b174f9d520874514194efd446747e11be5b
refs/heads/master
2023-07-24T12:45:42.635201
2015-12-09T20:42:27
2015-12-09T20:42:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
547
java
package comportamento.cartela.cartelaQuadrada; import infra.Cenario; import modelo.cartela.CartelaQuadrada; import org.junit.Test; public class NaoPossoCriarCartelaComOrdemOuNumeroMaximoMenorQueUm extends Cenario { private final int ORDEM = 10; private final int NUMERO_MAXIMO = 50; public void dadoQue() { } public void quando() { } public void entao() { naoConsigoCriarACartela(); } @Test(expected = AssertionError.class) public void naoConsigoCriarACartela() { new CartelaQuadrada(ORDEM, NUMERO_MAXIMO); } }
[ "lucas@dominiol.com.br" ]
lucas@dominiol.com.br
db19821ae14e4e1f90fd97ab93b234d46982e215
99acbc9e9be1f9e733b44b0264984825c469cae5
/src/main/java/mchorse/metamorph/api/creative/categories/UserCategory.java
33a3f9c100379f8539c4c8b95ce4acfac85cea7f
[ "MIT" ]
permissive
mchorse/metamorph
55338112811f4661a79a03fc89c1ef6d6d93b6e3
f5a03039420ea0f2064cf9d1364aeba37a31c565
refs/heads/1.12
2023-08-15T09:14:59.278708
2023-05-14T17:06:11
2023-07-26T13:52:37
70,312,994
71
52
NOASSERTION
2023-07-26T13:52:39
2016-10-08T07:30:29
Java
UTF-8
Java
false
false
1,537
java
package mchorse.metamorph.api.creative.categories; import mchorse.metamorph.api.creative.sections.MorphSection; import mchorse.metamorph.api.creative.sections.UserSection; import mchorse.metamorph.api.morphs.AbstractMorph; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class UserCategory extends MorphCategory { public UserCategory(MorphSection parent, String title) { super(parent, title); } @Override @SideOnly(Side.CLIENT) public String getTitle() { return this.title; } @Override public boolean isHidden() { return this.hidden; } @Override public void addMorph(AbstractMorph morph) { super.addMorph(morph); if (this.parent instanceof UserSection) { ((UserSection) this.parent).save(); } } @Override public boolean isEditable(AbstractMorph morph) { return this.morphs.indexOf(morph) != -1; } @Override public void edit(AbstractMorph morph) { int index = this.morphs.indexOf(morph); if (index >= 0 && this.parent instanceof UserSection) { ((UserSection) this.parent).save(); } } @Override public boolean remove(AbstractMorph morph) { boolean result = super.remove(morph); if (result && this.parent instanceof UserSection) { ((UserSection) this.parent).save(); } return result; } }
[ "mchorselessrider@gmail.com" ]
mchorselessrider@gmail.com
a0637b36dc4d7f75ed0ecad62f817ffede5012ee
1c063eb00f42ad3e11fd4f29591329daa0007bb0
/src/main/java/com/bit2016/emaillist/controller/EmailListController.java
2f0d9165c67562922b0ed01f1007c815f33faef1
[]
no_license
babamba/emaillist4
2f0e33cb564610761882f1ddad2f9f2301ee0609
90b4a99e80e74f60857a4e8a3fb0eaf0d5851b35
refs/heads/master
2021-01-13T13:14:29.216624
2016-11-03T07:37:15
2016-11-03T07:37:15
72,710,544
0
0
null
null
null
null
UTF-8
Java
false
false
1,062
java
package com.bit2016.emaillist.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.bit2016.emaillist.vo.EmailListVo; @Controller public class EmailListController { @Autowired private com.bit2016.emaillist.dao.EmailListDao EmailListDao; @RequestMapping("") public String list(Model model){ List<EmailListVo> list = EmailListDao.getList(); model.addAttribute("list", list); return "/WEB-INF/views/list.jsp"; } @RequestMapping("/form") public String form(){ return "/WEB-INF/views/form.jsp"; } @RequestMapping(value="/insert", method=RequestMethod.POST) public String insert(@ModelAttribute EmailListVo vo){ EmailListDao.insert(vo); return "redirect:/"; } }
[ "bit-user@bit" ]
bit-user@bit
8825fec524e3b7282947f1721a719b6379339757
aa5f25d714519ccfda2a89f382dfcefe1b3642fc
/trunk/dmisArea/src/com/techstar/dmis/dao/impl/FsApprovebookdetailDaoImpl.java
bdd3c223ea9369695b952bd9593e5ecf36cfe2dd
[]
no_license
BGCX261/zhouwei-repository-svn-to-git
2b85060757568fadc0d45b526e2546ed1965d48a
cd7f50db245727418d5f1c0061681c11703d073e
refs/heads/master
2021-01-23T03:44:27.914196
2015-08-25T15:45:29
2015-08-25T15:45:29
41,599,666
0
0
null
null
null
null
UTF-8
Java
false
false
2,198
java
/** * 持久化对象数据操纵实现类 * @author * @date */ package com.techstar.dmis.dao.impl; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.List; import com.techstar.framework.dao.IBaseHbnDao; import com.techstar.framework.dao.model.QueryListObj; import com.techstar.dmis.dao.IFsApprovebookdetailDao; import com.techstar.dmis.entity.FsApprovebookdetail; public class FsApprovebookdetailDaoImpl implements IFsApprovebookdetailDao { private IBaseHbnDao baseHbnDao; public void delete(FsApprovebookdetail fsApprovebookdetail){ baseHbnDao.delete(fsApprovebookdetail); } public void deleteAll(List pos){ baseHbnDao.deleteAll(pos); } public void saveOrUpdate(FsApprovebookdetail fsApprovebookdetail) { baseHbnDao.saveOrUpdate("FsApprovebookdetail", fsApprovebookdetail); } public FsApprovebookdetail findByPk(Object fapprovexcuteno) { return (FsApprovebookdetail) baseHbnDao.findById(FsApprovebookdetail.class, (Serializable) fapprovexcuteno); } public QueryListObj getQueryList() { return baseHbnDao.getQueryListByEntityName("FsApprovebookdetail"); } public QueryListObj getQueryList(int beginPage, int pageSize) { return baseHbnDao.getQueryListByEntityName("FsApprovebookdetail", beginPage, pageSize); } public void merge(FsApprovebookdetail fsApprovebookdetail){ baseHbnDao.merge("FsApprovebookdetail", fsApprovebookdetail); } public QueryListObj getQueryListByHql(String hql) { return baseHbnDao.getQueryListByHql(hql); } public QueryListObj getQueryListByHql(String hql,int beginPage,int pageSize) { return baseHbnDao.getQueryListByHql(hql, beginPage, pageSize); } public List getObjPropertySums(String sql) { List result = new ArrayList(); if(sql!=null && !"".equals(sql)) result = baseHbnDao.queryList(sql); return result; } public void saveOrUpdateAll(Collection objs){ baseHbnDao.saveOrUpdateAll(objs); } public IBaseHbnDao getBaseHbnDao() { return baseHbnDao; } public void setBaseHbnDao(IBaseHbnDao baseHbnDao) { this.baseHbnDao = baseHbnDao; } }
[ "you@example.com" ]
you@example.com
68dbda7c456ddc3fe202277f60d6e602519eef09
792f9a4b222e8ec6ee32fb819b840cdf4625d7d3
/datarouter-web/src/main/java/io/datarouter/web/browse/DatarouterClientHandlerService.java
d044ce071a7858727d2dcac7c8e5544121a451ae
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hotpads/datarouter
83385f668f5b35342b59d147a099454ed5cc23e3
0b1f8caad6adb95847611ee0539e60f756fdfd5d
refs/heads/master
2023-08-08T22:06:19.787666
2023-07-21T20:48:19
2023-07-21T20:48:19
93,588,679
40
10
Apache-2.0
2019-10-24T22:40:23
2017-06-07T03:29:55
Java
UTF-8
Java
false
false
5,177
java
/* * Copyright © 2009 HotPads (admin@hotpads.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.datarouter.web.browse; import static j2html.TagCreator.a; import static j2html.TagCreator.caption; import static j2html.TagCreator.div; import static j2html.TagCreator.span; import static j2html.TagCreator.table; import static j2html.TagCreator.tbody; import static j2html.TagCreator.td; import static j2html.TagCreator.tr; import java.util.ArrayList; import java.util.List; import io.datarouter.storage.client.ClientId; import io.datarouter.storage.client.ClientInitializationTracker; import io.datarouter.storage.client.DatarouterClients; import io.datarouter.web.config.DatarouterWebPaths; import io.datarouter.web.config.ServletContextSupplier; import io.datarouter.web.monitoring.latency.CheckResult.CheckResultJspDto; import io.datarouter.web.monitoring.latency.LatencyMonitoringService; import j2html.TagCreator; import j2html.tags.ContainerTag; import j2html.tags.specialized.DivTag; import j2html.tags.specialized.TdTag; import jakarta.inject.Inject; import jakarta.inject.Singleton; @Singleton public class DatarouterClientHandlerService{ @Inject private DatarouterClients datarouterClients; @Inject private LatencyMonitoringService monitoringService; @Inject private ClientInitializationTracker clientInitializationTracker; @Inject private ServletContextSupplier servletContext; @Inject private DatarouterWebPaths paths; public DivTag buildClientsTable(){ boolean hasUninitializedClients = false; List<ClientsJspDto> clients = new ArrayList<>(); for(ClientId clientId : datarouterClients.getClientIds()){ boolean initialized = clientInitializationTracker.isInitialized(clientId); hasUninitializedClients = hasUninitializedClients || !initialized; String clientTypeName = datarouterClients.getClientTypeInstance(clientId).getName(); CheckResultJspDto checkResultJspDto = new CheckResultJspDto( monitoringService.getLastResultForDatarouterClient(clientId), monitoringService.getGraphLinkForDatarouterClient(clientId)); clients.add(new ClientsJspDto(clientId.getName(), clientTypeName, initialized, checkResultJspDto)); } String servletContextPath = servletContext.get().getContextPath(); var tbody = tbody(); clients.forEach(clientsJspDto -> { String clientName = clientsJspDto.clientName; TdTag leftTd; TdTag rightTd; if(clientsJspDto.initialized){ ContainerTag<?> latencyGraphTag; CheckResultJspDto checkResultJspDto = clientsJspDto.checkResult; if(checkResultJspDto == null || checkResultJspDto.getCheckResult() == null){ latencyGraphTag = span().withClass("status"); }else{ latencyGraphTag = a() .withHref(checkResultJspDto.getGraphLink()) .withClass("status " + checkResultJspDto.getCssClass()); } String inspectLinkPath = servletContextPath + paths.datarouter.client.inspectClient.toSlashedString() + "?clientName=" + clientName; leftTd = td(TagCreator.join( latencyGraphTag, a(clientName).withHref(inspectLinkPath))); rightTd = td(clientsJspDto.clientTypeName); }else{ leftTd = td(TagCreator.join( span().withClass("status"), clientName)); String initLinkPath = servletContextPath + paths.datarouter.client.initClient.toSlashedString() + "?clientName=" + clientName; rightTd = td(TagCreator.join("[", a("init").withHref(initLinkPath), "]")); } tbody.with(tr(leftTd, rightTd)); }); var caption = caption("Clients"); if(hasUninitializedClients){ String linkPath = servletContextPath + paths.datarouter.client.initAllClients.toSlashedString(); caption = caption(TagCreator.join("Clients [", a("init remaining clients").withHref(linkPath), "]")); } var table = table(caption.withStyle("caption-side: top"), tbody) .withClass("table table-striped table-bordered table-sm"); return div(table); } public static class ClientsJspDto{ private final String clientName; private final String clientTypeName; private final Boolean initialized; private final CheckResultJspDto checkResult; public ClientsJspDto(String clientName, String clientTypeName, Boolean initialized, CheckResultJspDto checkResult){ this.clientName = clientName; this.clientTypeName = clientTypeName; this.initialized = initialized; this.checkResult = checkResult; } public String getClientName(){ return clientName; } public Boolean getInitialized(){ return initialized; } public String getClientTypeName(){ return clientTypeName; } public CheckResultJspDto getCheckResult(){ return checkResult; } } }
[ "pranavb@zillowgroup.com" ]
pranavb@zillowgroup.com
6a8672130f572f83ee5e682e7286780d41bc0e69
bbfdc7cb2bb11740d3f1656bd4837c88f1ebd82c
/src/main/java/week03/Position.java
91ae2d3f3fb4e1b3b3e09fb4e003515cb2e68b4f
[]
no_license
Sztzoli/re-struktura
87d540db60c5b9006ce84225224bc9ac346a91e1
cfe6858a4de18dc009ec68ce8e0316a0158edd0b
refs/heads/master
2023-04-04T11:58:51.858358
2021-04-07T18:20:29
2021-04-07T18:20:29
346,095,708
0
0
null
null
null
null
UTF-8
Java
false
false
1,864
java
package week03; import java.util.List; import java.util.stream.Collectors; public class Position { public static final int BONUS_LINE = 150_000; /* Írj egy Position osztályt, melynek van egy name és egy bonus attribútuma! Egy alkalmazotti pozíciót jelöl, melynek a bonus attribútuma tárolja, hogy ebben a pozícióban évente mennyi bónuszt kap egy alkalmazott. A main metódusban hozz létre egy Position objektumokat tartalmazo listát! Menj végig a lista elemein, és írd ki azokat, ahol a bónusz magasabb, mint 150_000. Azonban a kiírás formátumát a Position osztály toString() metódusában implementáld! */ private final String name; private final int bonus; public Position(String name, int bonus) { this.name = name; this.bonus = bonus; } private static boolean bonusBiggerThenBonusLine(Position x) { return x.bonus > BONUS_LINE; } public String getName() { return name; } public int getBonus() { return bonus; } @Override public String toString() { return "Position{" + "name='" + name + '\'' + ", bonus='" + bonus + '\'' + '}'; } static List<Position> filterByBonus(List<Position> positions) { return positions.stream() .filter(Position::bonusBiggerThenBonusLine) .collect(Collectors.toList()); } public static void main(String[] args) { List<Position> positions = List.of( new Position("Director",300_000), new Position("Worker",200_000), new Position("Worker2",140_000), new Position("Worker3",100_000), new Position("Worker4",350_000) ); System.out.println(filterByBonus(positions)); } }
[ "bezraat@gmail.com" ]
bezraat@gmail.com
82f720a08adb3cff2eeed2a4b1e8caae53d37386
b061924f1a304355e79fefa735485dfeb9f4d349
/src/com/wenyuankeji/spring/service/IUserProfessionLevelService.java
6ecae7e7985325b855b190d0984b4c0f1b843e17
[]
no_license
EvilCodes/ShunJianMeiWeb
7895373bfcdc9f824267eec1d0a98e6eaeee343e
7a4f3bf7c1c675b7ad8f0f62414c3c006178de5c
refs/heads/master
2021-01-18T16:08:41.157128
2017-03-30T14:59:42
2017-03-30T14:59:42
86,715,440
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package com.wenyuankeji.spring.service; import com.wenyuankeji.spring.model.UserProfessionLevelModel; import com.wenyuankeji.spring.util.BaseException; public interface IUserProfessionLevelService { /** * 根据职称等级和服务编码查询发型师职称等级服务价格 * @param levelid 职称等级ID * @return */ public UserProfessionLevelModel searchUserProfessionLevel(int levelid)throws BaseException; }
[ "huangy_tao@126.com" ]
huangy_tao@126.com
8ab63e5362c3b77da18c76bf3cc57132145ba25c
613201ce7f5aa310ff0839d6f3551d4e3973f026
/code-fragment/src/main/java/com/leolian/code/fragment/book/nettyaction/chapter09/AbsIntegerEncoder.java
3008d4e98a2881186f17fb92fb40626e94ae3a8b
[]
no_license
comeonlian/code-set
10586410390c1c7c19e51b0f9db605aac9da5dcf
5f78ac702bc3d3611be9bdcc7899c60a8e1ecfa0
refs/heads/master
2023-03-18T16:41:43.025657
2021-03-04T03:23:09
2021-03-04T03:23:09
336,192,819
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package com.leolian.code.fragment.book.nettyaction.chapter09; import java.util.List; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageEncoder; public class AbsIntegerEncoder extends MessageToMessageEncoder<ByteBuf> { @Override protected void encode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception { while(msg.readableBytes()>=4) { int value = Math.abs(msg.readInt()); out.add(value); } } }
[ "lianliang@oppo.com" ]
lianliang@oppo.com
3c593bbba0866d5265cbf3ebe5bba398b65b28c1
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_75c881e271c82610bfde1b3f757f62f5025c6bc3/VGMStreamPlugin/9_75c881e271c82610bfde1b3f757f62f5025c6bc3_VGMStreamPlugin_t.java
4c396ef1fe04d962baa3f801ee77269554317acd
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,604
java
package com.ssb.droidsound.plugins; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import android.util.Log; import com.ssb.droidsound.app.Application; public class VGMStreamPlugin extends DroidSoundPlugin { private static final String TAG = VGMStreamPlugin.class.getSimpleName(); static { System.loadLibrary("vgmstream"); } /* These are the supported extensions so far. I can guarantee more will come in the future. */ /* Most of the formats need to be tested before being actually added to the list */ /* Status of extensions in terms of stability: * * ADX: Plays back fine. * AAX: Plays back fine. * DSP: Plays back too fast (needs upsampling). [Test file was 32000Hz] * HPS: Plays back, cuts out before song is done (needs upsampling). [Test file was 32000Hz] * RSF: Plays back too fast (needs upsampling) [Test file used was 32000Hz] * YMF: Plays back slightly too slow. [Test file used was 48000Hz] * * */ private static final Set<String> EXTENSIONS = new HashSet<String>(Arrays.asList("AAX", "ADX", "YMF", "RSF", "HPS", "DSP")); @Override public boolean canHandle(String name) { String ext = name.substring(name.indexOf('.') + 1).toUpperCase(); return EXTENSIONS.contains(ext); } private long currentSong; @Override protected boolean load(String name, byte[] data) { throw new RuntimeException("This should not be called"); } @Override public boolean load(String f1, byte[] data1, String f2, byte[] data2) { File tmpDir = Application.getTmpDirectory(); for (File f : tmpDir.listFiles()) { if (! f.getName().startsWith(".")) { f.delete(); } } try { FileOutputStream fo1 = new FileOutputStream(new File(tmpDir, f1)); fo1.write(data1); fo1.close(); if (f2 != null) { FileOutputStream fo2 = new FileOutputStream(new File(tmpDir, f2)); fo2.write(data2); fo2.close(); } } catch (IOException ioe) { throw new RuntimeException(ioe); } currentSong = N_loadFile(new File(tmpDir, f1).getPath()); return currentSong != 0; } @Override public int getSoundData(short[] dest) { return N_getSoundData(currentSong, dest, dest.length); } @Override public void unload() { N_unload(currentSong); currentSong = 0; } @Override public String[] getDetailedInfo() { String channels = N_getStringInfo(currentSong, 50); String sampleRate = N_getStringInfo(currentSong, 51); String totalPlaySamples = N_getStringInfo(currentSong, 52); String frameSize = N_getStringInfo(currentSong, 53); String samplesPerFrame = N_getStringInfo(currentSong, 54); return new String[] { String.format("Channels: %s", channels), "", String.format("Sample Rate: %s Hz", sampleRate), "", String.format("Total Play Samples: %s", totalPlaySamples), "", String.format("Frame Size: %s bytes", frameSize), "", String.format("Samples Per Frame: %s", samplesPerFrame) }; } @Override public void setOption(String string, Object val) { /* To be implemented */ } @Override public boolean setTune(int tune) { return N_setTune(currentSong, tune); } @Override public String getVersion() { return "vgmstream revision 973"; } @Override protected MusicInfo getMusicInfo(String name, byte[] module) { /* To be implemented */ return null; } @Override public int getIntInfo(int what){ return N_getIntInfo(currentSong, what); } @Override public int getFrameRate() { int freq = N_getFrameRate(currentSong); Log.v(TAG, "Frequency reported by Android: " + freq + "hz"); return 44100; //N_getFrameRate(currentSong); } native private static int N_getFrameRate(long song); native private static void N_setOption(int what, int val); native private long N_loadFile(String name); native private void N_unload(long song); // Expects Stereo, 44.1Khz, signed, big-endian shorts native private int N_getSoundData(long song, short [] dest, int size); native private boolean N_seekTo(long song, int seconds); native private boolean N_setTune(long song, int tune); native private String N_getStringInfo(long song, int what); native private int N_getIntInfo(long song, int what); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
02d2001531a336baa67b1cb32b6397c58ff46eae
9670db75a08f4517d2893d3e29110c4a70643349
/springWebflux/src/main/java/org/springframework/web/reactive/socket/server/upgrade/TomcatRequestUpgradeStrategy.java
08f03df705840271c2e5ebf8294d1ac985f4eac8
[]
no_license
raoxiaosi/spring-source
f05c8ed62fb6311e232323e13005365342768558
a9a0003919898fe28d6bce1397da8c03a998dd6c
refs/heads/master
2023-04-22T03:20:26.701239
2021-05-10T13:40:49
2021-05-10T13:40:49
366,054,833
0
0
null
null
null
null
UTF-8
Java
false
false
7,337
java
/* * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.web.reactive.socket.server.upgrade; import java.util.Collections; import java.util.function.Supplier; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.websocket.Endpoint; import javax.websocket.server.ServerContainer; import org.apache.tomcat.websocket.server.WsServerContainer; import reactor.core.publisher.Mono; import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.http.server.reactive.AbstractServerHttpRequest; import org.springframework.http.server.reactive.AbstractServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpRequestDecorator; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpResponseDecorator; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.web.reactive.socket.HandshakeInfo; import org.springframework.web.reactive.socket.WebSocketHandler; import org.springframework.web.reactive.socket.adapter.StandardWebSocketHandlerAdapter; import org.springframework.web.reactive.socket.adapter.TomcatWebSocketSession; import org.springframework.web.reactive.socket.server.RequestUpgradeStrategy; import org.springframework.web.server.ServerWebExchange; /** * A {@link RequestUpgradeStrategy} for use with Tomcat. * * @author Violeta Georgieva * @author Rossen Stoyanchev * @since 5.0 */ public class TomcatRequestUpgradeStrategy implements RequestUpgradeStrategy { private static final String SERVER_CONTAINER_ATTR = "javax.websocket.server.ServerContainer"; @Nullable private Long asyncSendTimeout; @Nullable private Long maxSessionIdleTimeout; @Nullable private Integer maxTextMessageBufferSize; @Nullable private Integer maxBinaryMessageBufferSize; @Nullable private WsServerContainer serverContainer; /** * Exposes the underlying config option on * {@link ServerContainer#setAsyncSendTimeout(long)}. */ public void setAsyncSendTimeout(Long timeoutInMillis) { this.asyncSendTimeout = timeoutInMillis; } @Nullable public Long getAsyncSendTimeout() { return this.asyncSendTimeout; } /** * Exposes the underlying config option on * {@link ServerContainer#setDefaultMaxSessionIdleTimeout(long)}. */ public void setMaxSessionIdleTimeout(Long timeoutInMillis) { this.maxSessionIdleTimeout = timeoutInMillis; } @Nullable public Long getMaxSessionIdleTimeout() { return this.maxSessionIdleTimeout; } /** * Exposes the underlying config option on * {@link ServerContainer#setDefaultMaxTextMessageBufferSize(int)}. */ public void setMaxTextMessageBufferSize(Integer bufferSize) { this.maxTextMessageBufferSize = bufferSize; } @Nullable public Integer getMaxTextMessageBufferSize() { return this.maxTextMessageBufferSize; } /** * Exposes the underlying config option on * {@link ServerContainer#setDefaultMaxBinaryMessageBufferSize(int)}. */ public void setMaxBinaryMessageBufferSize(Integer bufferSize) { this.maxBinaryMessageBufferSize = bufferSize; } @Nullable public Integer getMaxBinaryMessageBufferSize() { return this.maxBinaryMessageBufferSize; } @Override public Mono<Void> upgrade(ServerWebExchange exchange, WebSocketHandler handler, @Nullable String subProtocol, Supplier<HandshakeInfo> handshakeInfoFactory){ ServerHttpRequest request = exchange.getRequest(); ServerHttpResponse response = exchange.getResponse(); HttpServletRequest servletRequest = getNativeRequest(request); HttpServletResponse servletResponse = getNativeResponse(response); HandshakeInfo handshakeInfo = handshakeInfoFactory.get(); DataBufferFactory bufferFactory = response.bufferFactory(); Endpoint endpoint = new StandardWebSocketHandlerAdapter( handler, session -> new TomcatWebSocketSession(session, handshakeInfo, bufferFactory)); String requestURI = servletRequest.getRequestURI(); DefaultServerEndpointConfig config = new DefaultServerEndpointConfig(requestURI, endpoint); config.setSubprotocols(subProtocol != null ? Collections.singletonList(subProtocol) : Collections.emptyList()); // Trigger WebFlux preCommit actions and upgrade return exchange.getResponse().setComplete() .then(Mono.fromCallable(() -> { WsServerContainer container = getContainer(servletRequest); //fixme: 协议升级干掉 // container.doUpgrade(servletRequest, servletResponse, config, Collections.emptyMap()); return null; })); } private static HttpServletRequest getNativeRequest(ServerHttpRequest request) { if (request instanceof AbstractServerHttpRequest) { return ((AbstractServerHttpRequest) request).getNativeRequest(); } else if (request instanceof ServerHttpRequestDecorator) { return getNativeRequest(((ServerHttpRequestDecorator) request).getDelegate()); } else { throw new IllegalArgumentException( "Couldn't find HttpServletRequest in " + request.getClass().getName()); } } private static HttpServletResponse getNativeResponse(ServerHttpResponse response) { if (response instanceof AbstractServerHttpResponse) { return ((AbstractServerHttpResponse) response).getNativeResponse(); } else if (response instanceof ServerHttpResponseDecorator) { return getNativeResponse(((ServerHttpResponseDecorator) response).getDelegate()); } else { throw new IllegalArgumentException( "Couldn't find HttpServletResponse in " + response.getClass().getName()); } } private WsServerContainer getContainer(HttpServletRequest request) { if (this.serverContainer == null) { Object container = request.getServletContext().getAttribute(SERVER_CONTAINER_ATTR); Assert.state(container instanceof WsServerContainer, "ServletContext attribute 'javax.websocket.server.ServerContainer' not found."); this.serverContainer = (WsServerContainer) container; //fixme:协议升级干掉 // initServerContainer(this.serverContainer); } return this.serverContainer; } private void initServerContainer(ServerContainer serverContainer) { if (this.asyncSendTimeout != null) { serverContainer.setAsyncSendTimeout(this.asyncSendTimeout); } if (this.maxSessionIdleTimeout != null) { serverContainer.setDefaultMaxSessionIdleTimeout(this.maxSessionIdleTimeout); } if (this.maxTextMessageBufferSize != null) { serverContainer.setDefaultMaxTextMessageBufferSize(this.maxTextMessageBufferSize); } if (this.maxBinaryMessageBufferSize != null) { serverContainer.setDefaultMaxBinaryMessageBufferSize(this.maxBinaryMessageBufferSize); } } }
[ "1770561005@qq.com" ]
1770561005@qq.com
d4436745e9ad09e6ffe706d965b6b438f02b0150
2d7401358fe7ee3f6e7f6f130c216013802c3dff
/app/src/main/java/com/bw/jpushdemo/MainActivity.java
8435c05e36f933489ece401beac083f2b150189e
[]
no_license
yyyyyBean/JPushDemo
3f9ac417994bd297a537c21370e1acf65a189b0b
2f9b7dcd94bf2ab5e537faeb97f72d4599a39fd5
refs/heads/master
2020-06-10T18:46:23.517824
2019-06-25T13:14:54
2019-06-25T13:14:54
193,710,669
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.bw.jpushdemo; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "you@example.com" ]
you@example.com
022cf90123b3ba7975fb0ac3f45e327747a86cfd
60eab9b092bb9d5a50b807f45cbe310774d0e456
/dataset/cm3/src/test/org/apache/commons/math/stat/descriptive/moment/FourthMomentTest.java
80babe73e5ccd2a02125988d1294d21e71a15167
[ "Apache-2.0" ]
permissive
SpoonLabs/nopol-experiments
7b691c39b09e68c3c310bffee713aae608db61bc
2cf383cb84a00df568a6e41fc1ab01680a4a9cc6
refs/heads/master
2022-02-13T19:44:43.869060
2022-01-22T22:06:28
2022-01-22T22:14:45
56,683,489
6
1
null
2019-03-05T11:02:20
2016-04-20T12:05:51
Java
UTF-8
Java
false
false
1,642
java
/* * Copyright 2003-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.math.stat.descriptive.moment; import org.apache.commons.math.stat.descriptive.StorelessUnivariateStatisticAbstractTest; import org.apache.commons.math.stat.descriptive.UnivariateStatistic; /** * Test cases for the {@link FourthMoment} class. * @version $Revision: 1.1 $ $Date: 2004/10/08 05:08:20 $ */ public class FourthMomentTest extends StorelessUnivariateStatisticAbstractTest{ /** descriptive statistic. */ protected FourthMoment stat; /** * @param name */ public FourthMomentTest(String name) { super(name); } /** * @see org.apache.commons.math.stat.descriptive.UnivariateStatisticAbstractTest#getUnivariateStatistic() */ public UnivariateStatistic getUnivariateStatistic() { return new FourthMoment(); } /** * @see org.apache.commons.math.stat.descriptive.UnivariateStatisticAbstractTest#expectedValue() */ public double expectedValue() { return this.fourthMoment; } }
[ "durieuxthomas@hotmail.com" ]
durieuxthomas@hotmail.com
576d2edf5e6ac4de9b92090a4be4555c42231c27
d6c0f4ab515d6553716281c9112bfe7c602c6a5a
/app/src/main/java/com/ysxsoft/fragranceofhoney/view/TradePwdActivity.java
c9fbe3d5677675a00b2c02a2e35041ce30ecf846
[]
no_license
huguangcai/FragranceOfHoney
db43a3593e92c62e41b32da2db294e7312a24209
8571698d505b95979e4cd8149f8a69d9ca0acb12
refs/heads/master
2020-08-10T11:24:39.676665
2019-11-07T10:11:07
2019-11-07T10:11:07
214,332,396
0
0
null
null
null
null
UTF-8
Java
false
false
4,035
java
package com.ysxsoft.fragranceofhoney.view; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.ysxsoft.fragranceofhoney.R; import com.ysxsoft.fragranceofhoney.impservice.ImpService; import com.ysxsoft.fragranceofhoney.modle.ModifyTradePwdBean; import com.ysxsoft.fragranceofhoney.utils.BaseActivity; import com.ysxsoft.fragranceofhoney.utils.NetWork; import com.ysxsoft.fragranceofhoney.widget.PayPwdEditText; import rx.Observer; import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; public class TradePwdActivity extends BaseActivity { private PayPwdEditText ed_ppet; private String pwd; private String modify_pwd; private TextView tv_setting_pwd; private String uid; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.trade_pwd_layout); Intent intent = getIntent(); modify_pwd = intent.getStringExtra("modify_pwd"); uid = intent.getStringExtra("uid"); initView(); } private void initView() { View img_back = getViewById(R.id.img_back); TextView tv_title = getViewById(R.id.tv_title); tv_title.setText("交易密码"); final Button btn_submit = getViewById(R.id.btn_submit); ed_ppet = getViewById(R.id.ed_ppet); tv_setting_pwd = getViewById(R.id.tv_setting_pwd); if ("modify_pwd".equals(modify_pwd)) { tv_setting_pwd.setText("修改密码"); } else { tv_setting_pwd.setText("设置密码"); } img_back.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); ed_ppet.initStyle(R.drawable.edit_num_bg_red, 6, 0.33f, R.color.black, R.color.black, 20); ed_ppet.setFocus(); ed_ppet.setOnTextFinishListener(new PayPwdEditText.OnTextFinishListener() { @Override public void onFinish(String str) { pwd = str; } }); ed_ppet.setOnChangeListener(new PayPwdEditText.OnChangeListener() { @Override public void change(int length) { if (length < 6) { btn_submit.setVisibility(View.GONE); } else { btn_submit.setVisibility(View.VISIBLE); } } }); btn_submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { submitData(); } }); } private void submitData() { NetWork.getRetrofit() .create(ImpService.class) .ModifyTradePwd(uid, pwd) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Observer<ModifyTradePwdBean>() { private ModifyTradePwdBean modifyTradePwdBean; @Override public void onCompleted() { showToastMessage(modifyTradePwdBean.getMsg()); if ("0".equals(modifyTradePwdBean.getCode())) { Intent intent = new Intent("FINISH"); sendBroadcast(intent); finish(); } } @Override public void onError(Throwable e) { showToastMessage(e.getMessage()); } @Override public void onNext(ModifyTradePwdBean modifyTradePwdBean) { this.modifyTradePwdBean = modifyTradePwdBean; } }); } }
[ "2694675654@qq.com" ]
2694675654@qq.com
54cb91986248f6053f5962bf38edd9dcdb36a223
67e94be3e7db237a680cc14d264a7da0294f40aa
/initializr-web/src/test/java/io/spring/initializr/web/test/JsonFieldProcessor.java
062bc7547b4bf74d7f9f7e14993fe5077430713e
[ "Apache-2.0" ]
permissive
fluig/initializr
0b79f0e4f5757de864b5d342a1c7b84373421648
899f6d3967143a8db3fa234bd709f592de1a819a
refs/heads/master
2020-03-11T03:35:22.906768
2018-04-12T16:04:47
2018-04-12T16:04:47
129,752,225
0
1
Apache-2.0
2018-04-16T14:00:12
2018-04-16T14:00:11
null
UTF-8
Java
false
false
5,624
java
/* * Copyright 2014-2016 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 io.spring.initializr.web.test; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; /** * A {@code JsonFieldProcessor} processes a payload's fields, allowing them to be * extracted and removed. * * @author Andy Wilkinson */ // Copied from RestDocs to make it visible final class JsonFieldProcessor { boolean hasField(JsonFieldPath fieldPath, Object payload) { final AtomicReference<Boolean> hasField = new AtomicReference<>(false); traverse(new ProcessingContext(payload, fieldPath), match -> hasField.set(true)); return hasField.get(); } Object extract(JsonFieldPath path, Object payload) { final List<Object> matches = new ArrayList<>(); traverse(new ProcessingContext(payload, path), match -> matches.add(match.getValue())); if (matches.isEmpty()) { throw new IllegalArgumentException("Field does not exist: " + path); } if ((!path.isArray()) && path.isPrecise()) { return matches.get(0); } else { return matches; } } void remove(final JsonFieldPath path, Object payload) { traverse(new ProcessingContext(payload, path), Match::remove); } private void traverse(ProcessingContext context, MatchCallback matchCallback) { final String segment = context.getSegment(); if (JsonFieldPath.isArraySegment(segment)) { if (context.getPayload() instanceof List) { handleListPayload(context, matchCallback); } } else if (context.getPayload() instanceof Map && ((Map<?, ?>) context.getPayload()).containsKey(segment)) { handleMapPayload(context, matchCallback); } } private void handleListPayload(ProcessingContext context, MatchCallback matchCallback) { List<?> list = context.getPayload(); final Iterator<?> items = list.iterator(); if (context.isLeaf()) { while (items.hasNext()) { Object item = items.next(); matchCallback.foundMatch( new ListMatch(items, list, item, context.getParentMatch())); } } else { while (items.hasNext()) { Object item = items.next(); traverse( context.descend(item, new ListMatch(items, list, item, context.parent)), matchCallback); } } } private void handleMapPayload(ProcessingContext context, MatchCallback matchCallback) { Map<?, ?> map = context.getPayload(); Object item = map.get(context.getSegment()); MapMatch mapMatch = new MapMatch(item, map, context.getSegment(), context.getParentMatch()); if (context.isLeaf()) { matchCallback.foundMatch(mapMatch); } else { traverse(context.descend(item, mapMatch), matchCallback); } } private static final class MapMatch implements Match { private final Object item; private final Map<?, ?> map; private final String segment; private final Match parent; private MapMatch(Object item, Map<?, ?> map, String segment, Match parent) { this.item = item; this.map = map; this.segment = segment; this.parent = parent; } @Override public Object getValue() { return this.item; } @Override public void remove() { this.map.remove(this.segment); if (this.map.isEmpty() && this.parent != null) { this.parent.remove(); } } } private static final class ListMatch implements Match { private final Iterator<?> items; private final List<?> list; private final Object item; private final Match parent; private ListMatch(Iterator<?> items, List<?> list, Object item, Match parent) { this.items = items; this.list = list; this.item = item; this.parent = parent; } @Override public Object getValue() { return this.item; } @Override public void remove() { this.items.remove(); if (this.list.isEmpty() && this.parent != null) { this.parent.remove(); } } } private interface MatchCallback { void foundMatch(Match match); } private interface Match { Object getValue(); void remove(); } private static final class ProcessingContext { private final Object payload; private final List<String> segments; private final Match parent; private final JsonFieldPath path; private ProcessingContext(Object payload, JsonFieldPath path) { this(payload, path, null, null); } private ProcessingContext(Object payload, JsonFieldPath path, List<String> segments, Match parent) { this.payload = payload; this.path = path; this.segments = segments == null ? path.getSegments() : segments; this.parent = parent; } private String getSegment() { return this.segments.get(0); } @SuppressWarnings("unchecked") private <T> T getPayload() { return (T) this.payload; } private boolean isLeaf() { return this.segments.size() == 1; } private Match getParentMatch() { return this.parent; } private ProcessingContext descend(Object payload, Match match) { return new ProcessingContext(payload, this.path, this.segments.subList(1, this.segments.size()), match); } } }
[ "snicoll@pivotal.io" ]
snicoll@pivotal.io
a211d0fa9d34b36ce06967bd24d05a6ee359454b
8816bd99163d4adc357e76664a64be036b9be1c1
/AL-Game7/data/scripts/system/handlers/quest/event/_80993EventDailyFlusiasEnquiry.java
174f5fe5b55f2b07d76c87042a750fb9989d244a
[]
no_license
w4terbomb/SPP-AionGermany
274b250b7b7b73cdd70485aef84b3900c205a928
a77b4ef188c69f2bc3b850e021545f9ad77e66f3
refs/heads/master
2022-11-25T23:31:21.049612
2019-09-23T13:45:58
2019-09-23T13:45:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,898
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package quest.event; import com.aionemu.gameserver.model.DialogAction; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; /** * @author QuestGenerator by Mariella */ public class _80993EventDailyFlusiasEnquiry extends QuestHandler { private final static int questId = 80993; public _80993EventDailyFlusiasEnquiry() { super(questId); } @Override public void register() { qe.registerQuestNpc(836130).addOnQuestStart(questId); // Flusia qe.registerQuestNpc(836130).addOnTalkEvent(questId); // Flusia } @Override public boolean onLvlUpEvent(QuestEnv env) { return defaultOnLvlUpEvent(env, 1000, true); } @Override public boolean onDialogEvent(QuestEnv env) { Player player = env.getPlayer(); QuestState qs = player.getQuestStateList().getQuestState(questId); DialogAction dialog = env.getDialog(); int targetId = env.getTargetId(); if (qs == null || qs.getStatus() == QuestStatus.NONE || qs.canRepeat()) { if (targetId == 836130) { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 4762); } case QUEST_ACCEPT_1: case QUEST_ACCEPT_SIMPLE: { return sendQuestStartDialog(env); } case QUEST_REFUSE_SIMPLE: { return closeDialogWindow(env); } default: break; } } } else if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 836130: { switch (dialog) { case QUEST_SELECT: { return sendQuestDialog(env, 1011); } case CHECK_USER_HAS_QUEST_ITEM: { return checkQuestItems(env, 0, 0, true, 5, 2716); } case FINISH_DIALOG: { return sendQuestSelectionDialog(env); } default: break; } break; } default: break; } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 836130) { return sendQuestEndDialog(env); } } return false; } }
[ "conan_513@hotmail.com" ]
conan_513@hotmail.com
c1d322cd56e7238bc1042d1a47db9cdae87ad0d6
2b6b6ffc5a17089798b80665dca66813e00e088a
/app/src/main/java/com/dotawang/mvpperfectworld/constant/Constant.java
eb131f1d7ce07c0ad37dfb8c69ade8809b3eda21
[]
no_license
gitwangyang/MVPPerfectWorld
5cfb66702b940a634db9e458003d03199460bfbb
9d40fb454d44508c110fb2819881559b972349bb
refs/heads/master
2020-04-30T00:37:35.044181
2019-11-21T10:11:37
2019-11-21T10:11:37
176,507,425
1
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package com.dotawang.mvpperfectworld.constant; import android.os.Environment; import com.dotawang.mvpperfectworld.utils.KLog; import java.io.File; /** * Created on 2019/3/21 * Title: 常量 * @author Android-汪洋 * @Description: */ public class Constant { /** * baseUrl */ public static String mBaseUrl = "http://www.wanandroid.com"; /** * 文件存储路径 */ public static String basePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/"; /** * 文件分隔符 */ public static String SAVE_IMAGE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separatorChar; /** * 服务端接口版本号 */ public static String serviceVersion = "v1"; /** * 正式/测试环境 */ static { if (KLog.IS_SHOW_LOG){ //调试模式 mBaseUrl = "http://www.wanandroid.com"; }else { //正式环境 mBaseUrl = "http://www.wanandroid.com"; } } /** * 请求头信息 */ public static final String USER_AGENT = "User-Agent"; public static final String IMEI = "imei"; public static final String TOKEN = "token"; public static final String MEMBER_ID = "memberId"; public static String USER_AGENT_VALUE = "1fy8LLuCLgc="; /** * 接口返回参数 */ public static final String NULL_RESPONSE = ""; public static final String FAILURE_RESPONSE = "0"; //请求失败 public static final String SUCCESS_RESPONSE = "1"; //请求成功 public static final String KEEP_KEY_RESPONSE = "2"; //账号锁定 /** * 用户信息保存key值 */ public static final String SHARED_PRENFENCE_MEMBERID = "saas_memberid"; public static final String SHARED_PRENFENCE_LOGINID = "saas_loginid"; public static final String SHARED_PRENFENCE_ACCOUNT = "saas_account"; public static final String SHARED_PRENFENCE_PASSWORD = "saas_password"; public static final String SHARED_PRENFENCE_EMAIL = "saas_email"; public static final String SHARED_PRENFENCE_PHONE = "saas_phone"; public static final String SHARED_PRENFENCE_USERNAME = "saas_username"; public static final String SHARED_PRENFENCE_TOKEN = "saas_token"; public static final String SHARED_PRENFENCE_POINTS = "saas_points"; }
[ "gitwangyang@aliyun.com" ]
gitwangyang@aliyun.com
eba26068a420697bacf78648e1c5c79f8d2eb3b4
a821819de6679d222d49fde7bc9a1e09a4f56d25
/admin-example/src/com/rootls/model/Contract.java
274525b54229b95ba74739bac1d799c4921c6fab
[]
no_license
luowei/simple-projects
82741193d303e07d0cb0b0f1194faa1136905b24
89273a4ad240a312a70e149c4cbb6d90a5b2a124
refs/heads/master
2021-01-19T11:22:24.648258
2014-09-23T17:01:32
2014-09-23T17:01:32
8,043,446
1
1
null
null
null
null
UTF-8
Java
false
false
3,429
java
package com.rootls.model; import org.apache.commons.lang.StringUtils; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; import static org.apache.commons.lang.StringUtils.isBlank; /** * 合同表 */ public class Contract implements Serializable { //企业名称 String companyName; String userName; //合同编号 String htbianhao; //到账日期 Date daozhangtime; //操作人 Integer adminId; //客户id Integer guestId; //唯一id Integer id; //款项类型 Integer kuanxianglx; //开票地 String huikuandi; //合同类型 Integer htlx; Integer accessoryType; public Contract() { super(); } public Contract(String companyName, String userName, String htbianhao, Integer htlx, Date daozhangtime, Integer accessoryType, Integer adminId) { super(); this.companyName = companyName; this.userName = userName; this.htbianhao = htbianhao; this.htlx = htlx; this.daozhangtime = daozhangtime; this.accessoryType = accessoryType; this.adminId = adminId; } public String getCompanyName() { return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getHtbianhao() { return htbianhao; } public void setHtbianhao(String htbianhao) { this.htbianhao = htbianhao; } public Integer getHtlx() { return htlx; } public void setHtlx(Integer htlx) { this.htlx = htlx; } public Date getDaozhangtime() { return daozhangtime; } public void setDaozhangtime(Date daozhangtime) { this.daozhangtime = daozhangtime; } public Integer getAccessoryType() { return accessoryType; } public void setAccessoryType(Integer accessoryType) { this.accessoryType = accessoryType; } public Integer getAdminId() { return adminId; } public void setAdminId(Integer adminId) { this.adminId = adminId; } public Integer getGuestId() { return guestId; } public void setGuestId(Integer guestId) { this.guestId = guestId; } public Integer getId() { return id; } public Contract setId(Integer id) { this.id = id; return this; } public Integer getKuanxianglx() { return kuanxianglx; } public Contract setKuanxianglx(Integer kuanxianglx) { this.kuanxianglx = kuanxianglx; return this; } public String getHuikuandi() { return huikuandi; } public Contract setHuikuandi(String huikuandi) { this.huikuandi = huikuandi; return this; } public boolean checkDaozhangtime(String daoZhangTime) { if (isBlank(daoZhangTime)) { return false; } if (this.daozhangtime != null) { Boolean eq = new SimpleDateFormat("yyyy-MM-dd").format(this.daozhangtime).equals(daoZhangTime); if (eq) { return false; } else { return true; } } return false; } }
[ "luowei505050@126.com" ]
luowei505050@126.com
e22b776bf27fa6a779b3d7181d5238be38ddbca8
337cb92559eff5f2055d304b464a6289f64c20eb
/support/cas-server-support-x509-webflow/src/main/java/org/apereo/cas/web/flow/X509WebflowConfigurer.java
ef505b36fd9c3817b69b5bc5b0f7c608055ee7a1
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
quibeLee/cas
a2b845ae390919e00a9d3ef07e2cb1c7b3889711
49eb3617c9a870e65faa1f3d04384000adfb9a6f
refs/heads/master
2022-12-25T18:31:39.013523
2020-09-25T17:02:06
2020-09-25T17:02:06
299,008,041
1
0
Apache-2.0
2020-09-27T10:33:58
2020-09-27T10:33:57
null
UTF-8
Java
false
false
3,553
java
package org.apereo.cas.web.flow; import org.apereo.cas.configuration.CasConfigurationProperties; import org.apereo.cas.web.flow.configurer.AbstractCasWebflowConfigurer; import lombok.val; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; import org.springframework.webflow.engine.ActionState; import org.springframework.webflow.engine.builder.support.FlowBuilderServices; /** * The {@link X509WebflowConfigurer} is responsible for * adjusting the CAS webflow context for x509 integration. * <p> * Creates a flow that starts by trying to construct credentials using an X509 * certificate found as request attribute with key javax.servlet.request.X509Certificate * {@link X509CertificateCredentialsNonInteractiveAction}. * If the check of the certificate is valid, flow goes to sendTicketGrantingTicket. * On error or authenticationFailure, the user is sent to the login page. * The authenticationFailure outcome can happen when CAS got a valid certificate but * couldn't find entry for the certificate in an attribute repository. * <p> * Credentials are cleared out at the end of the action in case the user * is sent to the login page where the X509 credentials object will cause * errors (e.g. no username property) * <p> * The X509 action is added to the main login flow by overriding the @link CasWebflowConstants#TRANSITION_ID_SUCCESS} * outcome of the {@link CasWebflowConstants#STATE_ID_INIT_LOGIN_FORM} action. * * @author Misagh Moayyed * @since 4.2 */ public class X509WebflowConfigurer extends AbstractCasWebflowConfigurer { /** * State id to start X.509 authentication. */ public static final String STATE_ID_START_X509 = "startX509Authenticate"; public X509WebflowConfigurer(final FlowBuilderServices flowBuilderServices, final FlowDefinitionRegistry loginFlowDefinitionRegistry, final ConfigurableApplicationContext applicationContext, final CasConfigurationProperties casProperties) { super(flowBuilderServices, loginFlowDefinitionRegistry, applicationContext, casProperties); setOrder(casProperties.getAuthn().getX509().getWebflow().getOrder()); } @Override protected void doInitialize() { val flow = getLoginFlow(); if (flow != null) { val actionState = createActionState(flow, STATE_ID_START_X509, createEvaluateAction("x509Check")); val transitionSet = actionState.getTransitionSet(); transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.STATE_ID_CREATE_TICKET_GRANTING_TICKET)); transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_WARN, CasWebflowConstants.TRANSITION_ID_WARN)); transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_ERROR, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM)); transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE, CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM)); actionState.getExitActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_CLEAR_WEBFLOW_CREDENTIALS)); val state = getState(flow, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM, ActionState.class); createTransitionForState(state, CasWebflowConstants.TRANSITION_ID_SUCCESS, STATE_ID_START_X509, true); } } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
747d7600c5ef9730875577ccadd39bceee4c475b
4525db535c18d40cbc1870d83b402e1bcf64416c
/06.Jpa/exercise/blog-manager/src/main/java/com/project/service/CategoryService.java
ce36ddda04a60c4ef172cf389b46adfbcb6dfd11
[]
no_license
Lnnaf/C0720G1_NguyenVanLinh-Module4
e48453833b9f55e5ee401b4e52b337ec1098410a
901587eca1e53f368c3a96e441b98757d9008705
refs/heads/main
2023-01-31T23:19:43.678433
2020-12-17T09:22:15
2020-12-17T09:22:15
314,421,197
0
1
null
null
null
null
UTF-8
Java
false
false
296
java
package com.project.service; import com.project.entity.Category; import java.util.List; import java.util.Optional; public interface CategoryService { List<Category> findAll(); void save(Category category); void delete(Category category); Optional<Category> findById(int id); }
[ "vanlinh12b5@gmail.com" ]
vanlinh12b5@gmail.com
82b0d1b2ab891bbf04a3241f252b9305dc74eed0
195d28f3af6b54e9859990c7d090f76ce9c49983
/issac-security-core/src/main/java/com/issac/security/core/verify/code/image/ImageCodeGenerator.java
26736dc991aec00af3392dcce50187729de76f5f
[]
no_license
IssacYoung2013/security
a00aa95b7c385937aa1add882d499db91f693253
00564b7f1406638cf4fb4cf89d46e1d65e566f1a
refs/heads/master
2020-04-18T21:28:00.116411
2019-01-29T01:27:27
2019-01-29T01:27:27
167,765,923
0
0
null
null
null
null
UTF-8
Java
false
false
2,723
java
package com.issac.security.core.verify.code.image; import com.issac.security.core.properties.SecurityProperties; import com.issac.security.core.verify.code.VerifyCodeGenerator; import com.issac.security.core.verify.code.image.ImageCode; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.context.request.ServletWebRequest; import java.awt.*; import java.awt.image.BufferedImage; import java.util.Random; /** * author: ywy * date: 2019-01-27 * desc: */ @Data public class ImageCodeGenerator implements VerifyCodeGenerator { @Autowired SecurityProperties securityProperties; @Override public ImageCode generate(ServletWebRequest request) { int width = ServletRequestUtils.getIntParameter(request.getRequest(),"width" ,securityProperties.getCode().getImage().getWidth()); int height = ServletRequestUtils.getIntParameter(request.getRequest(),"height" ,securityProperties.getCode().getImage().getHeight()); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics g = image.getGraphics(); Random random = new Random(); g.setColor(getRandColor(200, 250)); g.fillRect(0, 0, width, height); g.setFont(new Font("Times New Roman", Font.ITALIC, 20)); g.setColor(getRandColor(160, 200)); for (int i = 0; i < 155; i++) { int x = random.nextInt(width); int y = random.nextInt(height); int xl = random.nextInt(12); int yl = random.nextInt(12); g.drawLine(x, y, x + xl, y + yl); } String sRand = ""; for (int i = 0; i < securityProperties.getCode().getImage().getLength(); i++) { String rand = String.valueOf(random.nextInt(10)); sRand += rand; g.setColor(new Color(20 + random.nextInt(110), 20 + random.nextInt(110), 20 + random.nextInt(110))); g.drawString(rand, 13 * i + 6, 16); } g.dispose(); return new ImageCode(image, sRand, securityProperties.getCode().getImage().getExpireIn()); } /** * 生成随机背景条纹 * * @param fc * @param bc * @return */ private Color getRandColor(int fc, int bc) { Random random = new Random(); if (fc > 255) { fc = 255; } if (bc > 255) { bc = 255; } int r = fc + random.nextInt(bc - fc); int g = fc + random.nextInt(bc - fc); int b = fc + random.nextInt(bc - fc); return new Color(r, g, b); } }
[ "issacyoung@msn.cn" ]
issacyoung@msn.cn
66f68128e965d1387cc4a5f47af3dfb82b09c2ab
25a91c33745c6b4476ea6cc67b8c12d1cf10c472
/TIJ4/src/za/co/coach/learning/tij/generics/LinkedStack.java
ecbc50151e4b4bfa5fc58a790d14c9147f6e5834
[]
no_license
kumbirai/Learning
f3148b90c8d532316397d87b3027d5efff801d5e
73573e416acf26c069a5f5240532e940b4a8fafa
refs/heads/master
2021-01-15T17:07:12.084262
2013-01-03T09:31:14
2013-01-03T09:31:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
930
java
package za.co.coach.learning.tij.generics; //: za.co.coach.learning.tij.generics/LinkedStack.java // A stack implemented with an internal linked structure. public class LinkedStack<T> { private static class Node<U> { U item; Node<U> next; Node() { item = null; next = null; } Node(U item, Node<U> next) { this.item = item; this.next = next; } boolean end() { return item == null && next == null; } } private Node<T> top = new Node<T>(); // End sentinel public void push(T item) { top = new Node<T>(item, top); } public T pop() { T result = top.item; if (!top.end()) top = top.next; return result; } public static void main(String[] args) { LinkedStack<String> lss = new LinkedStack<String>(); for (String s : "Phasers on stun!".split(" ")) lss.push(s); String s; while ((s = lss.pop()) != null) System.out.println(s); } } /* Output: stun! on Phasers *///:~
[ "kumbirai@gmail.com" ]
kumbirai@gmail.com
042cfa41ce84ae4494411898806b6e0a0fda1ac0
24605743dbd29461804c94bccde1c28fe7b57703
/fr/unedic/cali/fabriques/FabriqueStrategieReglesArSurCiPuisReprise.java
21428a33d16ac17addbb96c61331ec955ac91d8a
[]
no_license
foretjerome/ARE
aa00cee993ed3e61c47f246616dc2c6cc3ab8f45
d8e2b5c67ae0370e254742cd5f6fcf50c0257994
refs/heads/master
2020-05-02T15:21:27.784344
2019-03-27T16:58:56
2019-03-27T16:58:56
178,038,731
0
0
null
null
null
null
UTF-8
Java
false
false
1,632
java
package fr.unedic.cali.fabriques; import fr.unedic.cali.outilsfonctionnels.strategies.CritereStrategie; import fr.unedic.cali.outilsfonctionnels.strategies.StrategieReglesArSurCiPuisRepriseApresMEP09SI2; import fr.unedic.cali.outilsfonctionnels.strategies.StrategieReglesArSurCiPuisRepriseAvantMEP09SI2; import fr.unedic.cali.outilsfonctionnels.strategies.StrategieReglesArSurCiPuisRepriseSpec; import fr.unedic.cali.outilsfonctionnels.strategies.StrategieSpec; import fr.unedic.util.temps.Damj; public class FabriqueStrategieReglesArSurCiPuisReprise implements FabriqueStrategieSpec { public static final Damj DATE_MEP_09SI2 = new Damj(2009, 7, 1); private static FabriqueStrategieReglesArSurCiPuisReprise s_instance = new FabriqueStrategieReglesArSurCiPuisReprise(); public static FabriqueStrategieReglesArSurCiPuisReprise getInstance() { return s_instance; } public StrategieSpec getStrategie(CritereStrategie p_critereStrategie) { StrategieReglesArSurCiPuisRepriseSpec strategie = null; Damj datePivot = p_critereStrategie.getDatePivot(); if (datePivot == null) { throw new UnsupportedOperationException("FabriqueStrategieReglesArSurCiPuisReprise : la date pivot est nulle."); } if (datePivot.estApresOuCoincideAvec(DATE_MEP_09SI2)) { strategie = new StrategieReglesArSurCiPuisRepriseApresMEP09SI2(); } else { strategie = new StrategieReglesArSurCiPuisRepriseAvantMEP09SI2(); } return strategie; } } /* Location: * Qualified Name: FabriqueStrategieReglesArSurCiPuisReprise * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "jerome.foret@codecasesoftware.com" ]
jerome.foret@codecasesoftware.com
07b103c9b9fe9a1cacd7db9e01e42c58271953f6
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-3.0.0-M2/core/src/main/java/org/mule/model/AbstractModel.java
513442b583c1162e83ffc083b2ad138eeef7fdf8
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
6,607
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.model; import org.mule.api.MuleContext; import org.mule.api.MuleException; import org.mule.api.component.LifecycleAdapterFactory; import org.mule.api.context.MuleContextAware; import org.mule.api.context.notification.ServerNotification; import org.mule.api.lifecycle.InitialisationException; import org.mule.api.model.EntryPointResolver; import org.mule.api.model.EntryPointResolverSet; import org.mule.api.model.Model; import org.mule.component.DefaultLifecycleAdapterFactory; import org.mule.context.notification.ModelNotification; import org.mule.model.resolvers.DefaultEntryPointResolverSet; import org.mule.model.resolvers.LegacyEntryPointResolverSet; import org.mule.service.DefaultServiceExceptionStrategy; import org.mule.util.ClassUtils; import java.beans.ExceptionListener; import java.util.Collection; import java.util.Iterator; import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * <code>MuleModel</code> is the default implementation of the Model. The model * encapsulates and manages the runtime behaviour of a Mule Server instance. It is * responsible for maintaining the service instances and their configuration. */ public abstract class AbstractModel implements Model { public static final String DEFAULT_MODEL_NAME = "main"; private String name = DEFAULT_MODEL_NAME; private EntryPointResolverSet entryPointResolverSet = null; // values are supplied below as required private LifecycleAdapterFactory lifecycleAdapterFactory = new DefaultLifecycleAdapterFactory(); private AtomicBoolean initialised = new AtomicBoolean(false); private AtomicBoolean started = new AtomicBoolean(false); private ExceptionListener exceptionListener = new DefaultServiceExceptionStrategy(); protected transient Log logger = LogFactory.getLog(getClass()); protected MuleContext muleContext; public String getName() { return name; } public void setName(String name) { this.name = name; } public EntryPointResolverSet getEntryPointResolverSet() { if (null == entryPointResolverSet) { entryPointResolverSet = new LegacyEntryPointResolverSet(); } return entryPointResolverSet; } public void setEntryPointResolverSet(EntryPointResolverSet entryPointResolverSet) { this.entryPointResolverSet = entryPointResolverSet; } /** * This allows us to configure entry point resolvers incrementally * * @param entryPointResolvers Resolvers to add */ public void setEntryPointResolvers(Collection entryPointResolvers) { if (null == entryPointResolverSet) { entryPointResolverSet = new DefaultEntryPointResolverSet(); } for (Iterator resolvers = entryPointResolvers.iterator(); resolvers.hasNext();) { entryPointResolverSet.addEntryPointResolver((EntryPointResolver) resolvers.next()); } } public LifecycleAdapterFactory getLifecycleAdapterFactory() { return lifecycleAdapterFactory; } public void setLifecycleAdapterFactory(LifecycleAdapterFactory lifecycleAdapterFactory) { this.lifecycleAdapterFactory = lifecycleAdapterFactory; } /** Destroys any current components */ public void dispose() { fireNotification(new ModelNotification(this, ModelNotification.MODEL_DISPOSING)); fireNotification(new ModelNotification(this, ModelNotification.MODEL_DISPOSED)); } /** * Stops any registered components * * @throws MuleException if a Service fails tcomponent */ public void stop() throws MuleException { fireNotification(new ModelNotification(this, ModelNotification.MODEL_STOPPING)); started.set(false); fireNotification(new ModelNotification(this, ModelNotification.MODEL_STOPPED)); } /** * Starts all registered components * * @throws MuleException if any of the components fail to start */ public void start() throws MuleException { if (!initialised.get()) { throw new IllegalStateException("Not Initialised"); } if (!started.get()) { fireNotification(new ModelNotification(this, ModelNotification.MODEL_STARTING)); started.set(true); fireNotification(new ModelNotification(this, ModelNotification.MODEL_STARTED)); } else { logger.debug("Model already started"); } } public void initialise() throws InitialisationException { if (!initialised.get()) { fireNotification(new ModelNotification(this, ModelNotification.MODEL_INITIALISING)); initialised.set(true); fireNotification(new ModelNotification(this, ModelNotification.MODEL_INITIALISED)); } else { logger.debug("Model already initialised"); } } public ExceptionListener getExceptionListener() { return exceptionListener; } public void setExceptionListener(ExceptionListener exceptionListener) { this.exceptionListener = exceptionListener; } void fireNotification(ServerNotification notification) { if (muleContext != null) { muleContext.fireNotification(notification); } else if (logger.isWarnEnabled()) { logger.debug("MuleContext is not yet available for firing notifications, ignoring event: " + notification); } } public void setMuleContext(MuleContext context) { this.muleContext = context; //Because we allow a default Exception strategy for the model we need to inject the //muleContext when we get it if (exceptionListener instanceof MuleContextAware) { ((MuleContextAware)exceptionListener).setMuleContext(muleContext); } } @Override public String toString() { return String.format("%s{%s}", ClassUtils.getSimpleName(this.getClass()), getName()); } }
[ "dfeist@bf997673-6b11-0410-b953-e057580c5b09" ]
dfeist@bf997673-6b11-0410-b953-e057580c5b09
6ecd7fe421319730d7667802abe71f3a3b0cd239
124c01837d18db003370ab1655d9f705be82f7fe
/droidparts/src/org/droidparts/inner/reader/DependencyReader.java
fba84d3519051231bec602879d17fafb8e8bcbc0
[ "Apache-2.0" ]
permissive
djbone/droidparts
fa5de23cd208e200969dfa5377abee047e7f124a
0789109f323483906cf09249dfadc4ac0665aa20
refs/heads/master
2021-01-16T20:13:13.800053
2013-08-06T00:33:44
2013-08-06T00:33:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,822
java
/** * Copyright 2013 Alex Yanchenko * * 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.droidparts.inner.reader; import static android.content.pm.PackageManager.GET_META_DATA; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.HashMap; import org.droidparts.AbstractDependencyProvider; import org.droidparts.contract.Constants.ManifestMeta; import org.droidparts.inner.ann.Ann; import org.droidparts.inner.ann.MethodSpec; import org.droidparts.util.L; import android.content.Context; import android.content.pm.PackageManager; import android.os.Bundle; public class DependencyReader { private static volatile boolean inited = false; private static AbstractDependencyProvider dependencyProvider; private static HashMap<Class<?>, MethodSpec<VoidAnn>> methodRegistry = new HashMap<Class<?>, MethodSpec<VoidAnn>>(); public static void init(Context ctx) { if (!inited) { synchronized (DependencyReader.class) { if (!inited) { dependencyProvider = getDependencyProvider(ctx); if (dependencyProvider != null) { Method[] methods = dependencyProvider.getClass() .getMethods(); for (Method method : methods) { methodRegistry.put(method.getReturnType(), new MethodSpec<VoidAnn>(method, new VoidAnn())); } } inited = true; } } } } public static void tearDown() { if (dependencyProvider != null) { dependencyProvider.getDB().close(); } dependencyProvider = null; } @SuppressWarnings("unchecked") public static <T> T readVal(Context ctx, Class<T> valType) throws RuntimeException { init(ctx); T val = null; if (dependencyProvider != null) { MethodSpec<VoidAnn> spec = methodRegistry.get(valType); try { int paramCount = spec.paramTypes.length; if (paramCount == 0) { val = (T) spec.method.invoke(dependencyProvider); } else { val = (T) spec.method.invoke(dependencyProvider, ctx); } } catch (Exception e) { throw new RuntimeException( "No valid DependencyProvider method for " + valType.getName() + ".", e); } } return val; } private static AbstractDependencyProvider getDependencyProvider(Context ctx) { PackageManager pm = ctx.getPackageManager(); String className = null; try { Bundle metaData = pm.getApplicationInfo(ctx.getPackageName(), GET_META_DATA).metaData; className = metaData.getString(ManifestMeta.DEPENDENCY_PROVIDER); } catch (Exception e) { L.d(e); } if (className == null) { L.e("No <meta-data android:name=\"%s\" android:value=\"...\"/> in AndroidManifest.xml.", ManifestMeta.DEPENDENCY_PROVIDER); return null; } if (className.startsWith(".")) { className = ctx.getPackageName() + className; } try { Class<?> cls = Class.forName(className); Constructor<?> constr = cls.getConstructor(Context.class); AbstractDependencyProvider adp = (AbstractDependencyProvider) constr .newInstance(ctx.getApplicationContext()); return adp; } catch (Exception e) { L.e("Not a valid DroidParts dependency provider: %s.", className); L.d(e); return null; } } private static class VoidAnn extends Ann<Annotation> { public VoidAnn() { super(null); } } }
[ "alex@yanchenko.com" ]
alex@yanchenko.com
780ca531b4b56727df42e390d3beb1351420da1b
7d7d2093dda33095ad3e95c48eeac4ef2724751c
/src/com/siwuxie095/designpattern/category/chapter3rd/example1st/DarkRoastWithSoy.java
c411cd7578db4513feb2e9a01259fef9139ea77f
[]
no_license
siwuxie095/DesignPattern
8cf0f7ad6591b9574dc950099ba2df05ac317eeb
1f31e6e0277a068a096fe9dbef5c44b18999b7e8
refs/heads/master
2020-07-02T14:55:51.576373
2019-11-12T05:56:13
2019-11-12T05:56:13
201,562,114
0
0
null
null
null
null
UTF-8
Java
false
false
278
java
package com.siwuxie095.designpattern.category.chapter3rd.example1st; /** * 带豆浆的深焙咖啡 * * @author Jiajing Li * @date 2019-09-14 17:32:58 */ class DarkRoastWithSoy extends Beverage { @Override public double cost() { return 6.0 + 1.5; } }
[ "834879583@qq.com" ]
834879583@qq.com
8dda606b966daca32df4003ab80aa99cb0600c7c
b8411ebb061dd56427b5aa0bb99e2e01a0e69023
/pinju-biz/src/main/java/com/yuwang/pinju/core/order/dao/pay/impl/PaySendLogDaoImpl.java
4862577ee4bc302011651ba50cf1f2e293915564
[]
no_license
sgrass/double11_bugfix_asst_acct
afce8261bb275474f792e1cb41d9ff4fabad06b0
8eea9a16b43600c0c7574db5353c3d3b86cf4694
refs/heads/master
2021-01-19T04:48:03.445861
2017-04-06T06:34:17
2017-04-06T06:34:17
87,394,668
0
1
null
null
null
null
UTF-8
Java
false
false
235
java
package com.yuwang.pinju.core.order.dao.pay.impl; import com.yuwang.pinju.core.common.BaseDAO; import com.yuwang.pinju.core.order.dao.pay.PaySendLogDao; public class PaySendLogDaoImpl extends BaseDAO implements PaySendLogDao { }
[ "xgrass@foxmail.com" ]
xgrass@foxmail.com
7378a200dcafb9aa2b508e776110617470e38844
84db686827b51c273cd589cffbf39f9d08332a2a
/Armani/rpos/src/com/chelseasystems/cs/swing/builder/TaxIdBldr_EUR.java
261b856b7ad6999444a2bb6e658aa4c5b15ffa9b
[]
no_license
bchelli/armani
0ec55106135496e1dd0ebb20a359d2ccbd507210
d84baec9a4df9328ac0bd03c1141502eae601968
refs/heads/master
2020-03-28T20:20:36.813175
2018-09-06T07:23:58
2018-09-06T07:23:58
149,061,353
1
0
null
2018-09-17T03:02:15
2018-09-17T03:02:15
null
UTF-8
Java
false
false
4,296
java
/* * @copyright (c) 2001 Chelsea Market Systems LLC * * formatted with JxBeauty (c) johann.langhofer@nextra.at */ /* History: +------+------------+-----------+-----------+----------------------------------------------+ | Ver# | Date | By | Defect # | Description | +------+------------+-----------+-----------+----------------------------------------------| | 1 | 06-13-2005 | Khyati | |Europe: Tax Exempt | -------------------------------------------------------------------------------------------- | 0 | 06-13-2005 | Khyati | |Added From Global Implementation | -------------------------------------------------------------------------------------------- */ package com.chelseasystems.cs.swing.builder; import com.chelseasystems.cr.appmgr.*; import com.chelseasystems.cr.swing.CMSApplet; import com.chelseasystems.cs.swing.menu.MenuConst; import com.chelseasystems.cs.swing.dlg.TaxExemptDlg; import com.chelseasystems.cr.util.ResourceManager; import com.chelseasystems.cs.swing.dlg.*; /** */ public class TaxIdBldr_EUR implements IObjectBuilder { private IObjectBuilderManager theBldrMgr; private CMSApplet applet; private IApplicationManager theAppMgr; private String taxId; private String strActionCommand; private GenericChooseFromTableDlg overRideDlg; /** */ public TaxIdBldr_EUR() { } /** * @param theBldrMgr * @param theAppMgr */ public void init(IObjectBuilderManager theBldrMgr, IApplicationManager theAppMgr) { this.theBldrMgr = theBldrMgr; this.theAppMgr = theAppMgr; } /** */ public void cleanup() {} /** * @param theCommand * @param theEvent */ public void EditAreaEvent(String theCommand, Object theEvent) { if (theEvent == null || ((String)theEvent).trim().length() < 1) return; if (theCommand == strActionCommand) { taxId = ((String)theEvent).toUpperCase(); } if (completeAttributes()) theBldrMgr.processObject(applet, strActionCommand, taxId, this); } /** * @param Command * @param applet * @param initValue */ public void build(String Command, CMSApplet applet, Object initValue) { this.strActionCommand = Command; System.out.println("strCommand " + strActionCommand); taxId = null; this.applet = applet; // theAppMgr.showMenu(MenuConst.TAX_EXEMPT, applet.theOpr); // register for call backs if (completeAttributes()) theBldrMgr.processObject(applet, strActionCommand, taxId, this); } /** * @return */ private boolean completeAttributes() { if (taxId == null) { // theAppMgr.setSingleEditArea(applet.res.getString("Enter tax exempt ID. Press 'Enter' to remove ID."), strActionCommand); //ks: Comment enter tax exempt ID for Europe and display tax exempt reason dlg box // theAppMgr.setSingleEditArea(applet.res.getString("Enter tax exempt ID."), strActionCommand); theAppMgr.setSingleEditArea(applet.res.getString("Select Tax Exempt Reason.")); //Display tax exempt dlg box displayTaxExemptReasons(); overRideDlg.setVisible(true); if (overRideDlg.isOK()) { Object reasonCode = overRideDlg.getSelectedRow().getRowKeyData(); taxId = (String)reasonCode; Object reasons[] = overRideDlg.getSelectedRow().getDisplayRow(); theAppMgr.showMenu(MenuConst.ADD_ITEM_MENU, applet.theOpr, null); theAppMgr.setSingleEditArea(applet.res.getString( "Enter or scan item code; enter \"S\" to search."), "ITEM", theAppMgr.ITEM_MASK); } else { taxId = ""; theAppMgr.setSingleEditArea(applet.res.getString("Select options")); theAppMgr.showMenu(MenuConst.TAX_EXEMPT, "TAX_EXEMPT", applet.theOpr); return false; } } return true; } /** *Display Tax Exempt Reason description */ private void displayTaxExemptReasons() { TaxExemptDlg taxReasonHelper = new TaxExemptDlg(); String[] titles = {ResourceManager.getResourceBundle().getString("Vat Exempt Reason") }; overRideDlg = new GenericChooseFromTableDlg(theAppMgr.getParentFrame(), theAppMgr , taxReasonHelper.getTabelData(), titles); } }
[ "saptarshi.mukhaty@skillnetinc.com" ]
saptarshi.mukhaty@skillnetinc.com
1c24b7e5adcf3f3effa42a82034a741bdb042ebd
fb06a56b61aa8bc429bc4359d03bf5085fd0ec81
/app/src/main/java/com/qianhua/market/view/AutoTextView.java
873d70ce07e25d46c176537d8e6ca36373dcbaf4
[]
no_license
hackerlcg/QHMarket
d05c38e7acb8638d68ea7ea10814b50b719fa943
820291267ea7fbfb95beb2b4fc6fa927b123c485
refs/heads/master
2021-08-31T10:27:26.482419
2017-12-21T02:51:37
2017-12-21T02:51:37
114,954,982
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package com.qianhua.market.view; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.TextView; public class AutoTextView extends TextView { public static final String TAG = "AutoTextView"; /** 字幕滚动的速度 快,普通,慢 */ public static final int SCROLL_SLOW = 0; public static final int SCROLL_NORM = 1; public static final int SCROLL_FAST = 2; /** 字幕内容 */ private String mText; /** 字幕字体颜色 */ private int mTextColor; /** 字幕字体大小 */ private float mTextSize; private float offX = 0f; private float mStep = 0.5f; private Rect mRect = new Rect(); private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);; public AutoTextView(Context context) { super(context); setSingleLine(true); } public AutoTextView(Context context, AttributeSet attr) { super(context, attr); setSingleLine(true); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); mText = getText().toString(); mTextColor = getCurrentTextColor(); mTextSize = getTextSize(); mPaint.setColor(mTextColor); mPaint.setTextSize(mTextSize); mPaint.getTextBounds(mText, 0, mText.length(), mRect); }; @Override protected void onDraw(Canvas canvas) { float x, y; x = getMeasuredWidth() - offX; y = getMeasuredHeight() / 2 + (mPaint.descent() - mPaint.ascent()) / 2; canvas.drawText(mText, x, y, mPaint); offX += mStep; if (offX >= getMeasuredWidth() + mRect.width()) { offX = 0f; } invalidate(); } /** * 设置字幕滚动的速度 */ public void setScrollMode(int scrollMod) { if (scrollMod == SCROLL_SLOW) { mStep = 0.5f; } else if (scrollMod == SCROLL_NORM) { mStep = 1f; } else { mStep = 1.5f; } } }
[ "812405389@qq.com" ]
812405389@qq.com
2d0b68160f6de0d8199c9a2a598beac55f9e8a0a
387512c01b777ccda571194607808056ecc5d3f4
/app/src/main/java/com/dace/textreader/adapter/UnReadCommentAdapter.java
6b95543cfc6753579948e82ac43436302cfcc56a
[]
no_license
jackyhezhenguo/TextReader
dde925c8b43fbf9f93711640fbf8f2dc2db39fcb
4ea392b199991e209d57baa0faccb9e01daebe52
refs/heads/master
2020-05-20T04:10:47.904616
2019-05-06T11:23:44
2019-05-06T11:23:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,883
java
package com.dace.textreader.adapter; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.support.v7.widget.RecyclerView; import android.text.Spannable; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.dace.textreader.R; import com.dace.textreader.activity.UserHomepageActivity; import com.dace.textreader.bean.UnReadComment; import com.dace.textreader.util.GlideUtils; import com.dace.textreader.util.HttpUrlPre; import java.util.List; /** * 未读消息列表的适配器 * Created by 70391 on 2017/8/13. */ public class UnReadCommentAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private Context mContext; private List<UnReadComment> mList; public UnReadCommentAdapter(Context context, List<UnReadComment> list) { this.mContext = context; this.mList = list; } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(mContext) .inflate(R.layout.item_unread_comment_layout, parent, false); ViewHolder holder = new ViewHolder(view); return holder; } @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { final UnReadComment unReadComment = mList.get(position); GlideUtils.loadUserImage(mContext, HttpUrlPre.FILE_URL + unReadComment.getCommentUserImg(), ((ViewHolder) holder).iv_head); ((ViewHolder) holder).tv_reply_username.setText(unReadComment.getCommentUsername()); ((ViewHolder) holder).tv_reply_time.setText(unReadComment.getCommentTime()); String username = unReadComment.getReplyUsername(); String comment = "回复" + username + ":" + unReadComment.getCommentContent(); int length = 2 + username.length(); SpannableStringBuilder ssb = new SpannableStringBuilder(comment); ForegroundColorSpan foregroundColorSpan = new ForegroundColorSpan(Color.parseColor("#557FDF")); ssb.setSpan(foregroundColorSpan, 2, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ((ViewHolder) holder).tv_reply_comment.setText(ssb); String replyComment; SpannableStringBuilder ssb_reply; if (unReadComment.getReReplyUserId() == -1) { replyComment = username + ":" + unReadComment.getReplyCommentContent(); ssb_reply = new SpannableStringBuilder(replyComment); ssb_reply.setSpan(new ForegroundColorSpan(Color.parseColor("#557FDF")), 0, username.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } else { String reReplyUsername = unReadComment.getReReplyUsername(); replyComment = username + "回复" + reReplyUsername + ":" + unReadComment.getReplyCommentContent(); ssb_reply = new SpannableStringBuilder(replyComment); ssb_reply.setSpan(new ForegroundColorSpan(Color.parseColor("#557FDF")), 0, username.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); int l = username.length() + 2; int end = l + reReplyUsername.length(); ssb_reply.setSpan(new ForegroundColorSpan(Color.parseColor("#557FDF")), l, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } ((ViewHolder) holder).tv_user_comment.setText(ssb_reply); ((ViewHolder) holder).tv_essayTitle.setText(unReadComment.getEssayTitle()); ((ViewHolder) holder).iv_head.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { turnToUserHomePage(unReadComment.getReplyUserId()); } }); ((ViewHolder) holder).tv_reply.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mOnItemClickListener != null) { mOnItemClickListener.onItemClick(position); } } }); ((ViewHolder) holder).ll_essay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mOnItemArticleClickListener != null) { mOnItemArticleClickListener.onItemClick(position); } } }); } /** * 前往用户首页 * * @param userId */ private void turnToUserHomePage(int userId) { if (userId != -1) { Intent intent = new Intent(mContext, UserHomepageActivity.class); intent.putExtra("userId", userId); mContext.startActivity(intent); } } @Override public int getItemCount() { return mList.size(); } //自定义监听事件 public interface OnUnReadCommentReplyClickListener { void onItemClick(int position); } private OnUnReadCommentReplyClickListener mOnItemClickListener; public void setOnReplyClickListener(OnUnReadCommentReplyClickListener listener) { mOnItemClickListener = listener; } //自定义监听事件 public interface OnUnReadCommentArticleClickListener { void onItemClick(int position); } private OnUnReadCommentArticleClickListener mOnItemArticleClickListener; public void setOnArticleClickListener(OnUnReadCommentArticleClickListener listener) { mOnItemArticleClickListener = listener; } class ViewHolder extends RecyclerView.ViewHolder { ImageView iv_head; TextView tv_reply_username; TextView tv_reply_time; TextView tv_reply_comment; TextView tv_user_comment; LinearLayout ll_essay; TextView tv_essayTitle; TextView tv_reply; public ViewHolder(View itemView) { super(itemView); iv_head = itemView.findViewById(R.id.iv_head_unread_comments_item); tv_reply_username = itemView.findViewById(R.id.tv_reply_username_unread_comments_item); tv_reply_time = itemView.findViewById(R.id.tv_reply_time_unread_comments_item); tv_reply_comment = itemView.findViewById(R.id.tv_reply_comment_unread_comments_item); tv_user_comment = itemView.findViewById(R.id.tv_user_comment_unread_comments_item); ll_essay = itemView.findViewById(R.id.ll_essay_info_unread_comments_item); tv_essayTitle = itemView.findViewById(R.id.tv_essay_title_unread_comments_item); tv_reply = itemView.findViewById(R.id.tv_reply_unread_comments_item); } } }
[ "cheung29@foxmail.com" ]
cheung29@foxmail.com
23baf77c027cbe05683bb308dab9e978ff338abb
055eaf577c681d5a45646284f1f78d831aade206
/src/main/java/net/selte/application/service/dto/UserDTO.java
4e1831f289f1cc9d96587bbe7eeb1edcf4f152cb
[]
no_license
seltenet/MicroServiceApplication
99e5872e23dbc180f51d3c16a07562acbd5fd4b2
d5c83710922723d7d4487583c15b7d918f411a03
refs/heads/master
2021-05-05T04:08:42.199385
2018-01-23T06:18:58
2018-01-23T06:18:58
118,566,939
0
1
null
2020-09-18T11:57:04
2018-01-23T06:18:55
Java
UTF-8
Java
false
false
4,648
java
package net.selte.application.service.dto; import net.selte.application.config.Constants; import net.selte.application.domain.Authority; import net.selte.application.domain.User; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.NotBlank; import javax.validation.constraints.*; import java.time.Instant; import java.util.Set; import java.util.stream.Collectors; /** * A DTO representing a user, with his authorities. */ public class UserDTO { private Long id; @NotBlank @Pattern(regexp = Constants.LOGIN_REGEX) @Size(min = 1, max = 50) private String login; @Size(max = 50) private String firstName; @Size(max = 50) private String lastName; @Email @Size(min = 5, max = 100) private String email; @Size(max = 256) private String imageUrl; private boolean activated = false; @Size(min = 2, max = 6) private String langKey; private String createdBy; private Instant createdDate; private String lastModifiedBy; private Instant lastModifiedDate; private Set<String> authorities; public UserDTO() { // Empty constructor needed for Jackson. } public UserDTO(User user) { this.id = user.getId(); this.login = user.getLogin(); this.firstName = user.getFirstName(); this.lastName = user.getLastName(); this.email = user.getEmail(); this.activated = user.getActivated(); this.imageUrl = user.getImageUrl(); this.langKey = user.getLangKey(); this.createdBy = user.getCreatedBy(); this.createdDate = user.getCreatedDate(); this.lastModifiedBy = user.getLastModifiedBy(); this.lastModifiedDate = user.getLastModifiedDate(); this.authorities = user.getAuthorities().stream() .map(Authority::getName) .collect(Collectors.toSet()); } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getImageUrl() { return imageUrl; } public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; } public boolean isActivated() { return activated; } public void setActivated(boolean activated) { this.activated = activated; } public String getLangKey() { return langKey; } public void setLangKey(String langKey) { this.langKey = langKey; } public String getCreatedBy() { return createdBy; } public void setCreatedBy(String createdBy) { this.createdBy = createdBy; } public Instant getCreatedDate() { return createdDate; } public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; } public String getLastModifiedBy() { return lastModifiedBy; } public void setLastModifiedBy(String lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; } public Instant getLastModifiedDate() { return lastModifiedDate; } public void setLastModifiedDate(Instant lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public Set<String> getAuthorities() { return authorities; } public void setAuthorities(Set<String> authorities) { this.authorities = authorities; } @Override public String toString() { return "UserDTO{" + "login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", imageUrl='" + imageUrl + '\'' + ", activated=" + activated + ", langKey='" + langKey + '\'' + ", createdBy=" + createdBy + ", createdDate=" + createdDate + ", lastModifiedBy='" + lastModifiedBy + '\'' + ", lastModifiedDate=" + lastModifiedDate + ", authorities=" + authorities + "}"; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
2e2bd099c0fce80d8c7172d8c7a2c90172bf6622
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/test/java/org/gradle/test/performancenull_195/Testnull_19429.java
6bbe6bcacc8176765e414e0ca0c18b5a02f4c27c
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
308
java
package org.gradle.test.performancenull_195; import static org.junit.Assert.*; public class Testnull_19429 { private final Productionnull_19429 production = new Productionnull_19429("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
c83b14dafdfc6f9a3f0d30619969caf4bd5f45ec
56456387c8a2ff1062f34780b471712cc2a49b71
/com/google/ads/mediation/MediationAdapter.java
c41551735923d74b787187302f4560a208fd6fc0
[]
no_license
nendraharyo/presensimahasiswa-sourcecode
55d4b8e9f6968eaf71a2ea002e0e7f08d16c5a50
890fc86782e9b2b4748bdb9f3db946bfb830b252
refs/heads/master
2020-05-21T11:21:55.143420
2019-05-10T19:03:56
2019-05-10T19:03:56
186,022,425
1
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.google.ads.mediation; public abstract interface MediationAdapter { public abstract void destroy(); public abstract Class getAdditionalParametersType(); public abstract Class getServerParametersType(); } /* Location: C:\Users\haryo\Desktop\enjarify-master\presensi-enjarify.jar!\com\google\ads\mediation\MediationAdapter.class * Java compiler version: 5 (49.0) * JD-Core Version: 0.7.1 */
[ "haryo.nendra@gmail.com" ]
haryo.nendra@gmail.com
b7dc6520f1f55b854f51c0102d818480b6fa7b09
71dc08ecd65afd5096645619eee08c09fc80f50d
/src/main/java/com/tomatolive/library/utils/litepal/tablemanager/model/GenericModel.java
5cb768978ee07f85bbbb403864e0b675307fa4aa
[]
no_license
lanshifu/FFmpegDemo
d5a4a738feadcb15d8728ee92f9eb00f00c77413
fdbafde0bb8150503ae68c42ae98361c030bf046
refs/heads/master
2020-06-25T12:24:12.590952
2019-09-08T07:35:16
2019-09-08T07:35:16
199,304,834
0
0
null
null
null
null
UTF-8
Java
false
false
1,131
java
package com.tomatolive.library.utils.litepal.tablemanager.model; public class GenericModel { private String getMethodName; private String tableName; private String valueColumnName; private String valueColumnType; private String valueIdColumnName; public String getTableName() { return this.tableName; } public void setTableName(String str) { this.tableName = str; } public String getValueColumnName() { return this.valueColumnName; } public void setValueColumnName(String str) { this.valueColumnName = str; } public String getValueColumnType() { return this.valueColumnType; } public void setValueColumnType(String str) { this.valueColumnType = str; } public String getValueIdColumnName() { return this.valueIdColumnName; } public void setValueIdColumnName(String str) { this.valueIdColumnName = str; } public String getGetMethodName() { return this.getMethodName; } public void setGetMethodName(String str) { this.getMethodName = str; } }
[ "lanxiaobin@jiaxincloud.com" ]
lanxiaobin@jiaxincloud.com
98c8b1783fa4c68504ac90d727d7c6fe478fc77f
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/android/opengl/EGLObjectHandle.java
d87a3266ad4a7d17e9e451b4d06f77cc8f694ed7
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package android.opengl; public abstract class EGLObjectHandle { private final long mHandle; @Deprecated protected EGLObjectHandle(int handle) { this.mHandle = (long) handle; } protected EGLObjectHandle(long handle) { this.mHandle = handle; } @Deprecated public int getHandle() { long j = this.mHandle; if ((4294967295L & j) == j) { return (int) j; } throw new UnsupportedOperationException(); } public long getNativeHandle() { return this.mHandle; } public int hashCode() { long j = this.mHandle; return (17 * 31) + ((int) (j ^ (j >>> 32))); } }
[ "dstmath@163.com" ]
dstmath@163.com