blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
99f139233805f05ed221bf80bd1642c35cca190c
32bfeb552d5f1f70deb082298f288d7141984aa1
/SampleSpring/src/com/sandeep/MyClassV2.java
360a1cfcae3249af53e70f52edd418a1e5e5bb11
[]
no_license
sandeep709/Sample-ropo
2432ab30e6cbe41326c0a8abb9ed28c1b6feb6d4
75a4ead3f2be1b89789a8743bc41895f06af9929
refs/heads/master
2021-01-18T17:02:07.629820
2018-05-06T05:12:54
2018-05-06T05:12:54
86,781,991
0
0
null
2017-03-31T05:48:31
2017-03-31T05:39:14
null
UTF-8
Java
false
false
224
java
package com.sandeep; public class MyClassV2 { int number2; public void setNumber2 (int number2) { this.number2 = number2; } public void getNumber2 () { System.out.println(number2); } }
[ "a-7413@LE1024.local" ]
a-7413@LE1024.local
2d222303cd175a4a70aa8998f98f3b2269f17519
3b8d76a6bfc0a9fa57b2c7fbb584ca6e32226b21
/my-dependency-injection/src/main/java/com/haroldgao/context/ClassicComponentContext.java
773f7f45c03d49e5afa928bd3ba077961af2bc71
[]
no_license
xiangaoole/spring-practice
aecc6913b2b354bbb02ac3610049027864c32419
c85936bf79bcbc4232ed1e4ff900871cbfdcb036
refs/heads/master
2023-04-04T04:33:29.451812
2021-03-30T04:52:12
2021-03-30T04:52:12
342,810,802
0
0
null
null
null
null
UTF-8
Java
false
false
9,909
java
package com.haroldgao.context; import com.haroldgao.function.ThrowableAction; import com.haroldgao.function.ThrowableFunction; import com.haroldgao.log.Logger; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.naming.*; import javax.servlet.ServletContext; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Web 应用全局上下文 */ public class ClassicComponentContext implements ComponentContext { public static final String CONTEXT_NAME = ClassicComponentContext.class.getName(); private static ServletContext servletContext; private ClassLoader classLoader; private Context envContext; private final Map<String, Object> componentsMap = new HashMap<>(); /** * Cache for {@link PreDestroy} */ private final Map<Method, Object> preDestroyMethodCache = new LinkedHashMap<>(); private volatile AtomicBoolean enteredDestroy; public static ClassicComponentContext getInstance() { return (ClassicComponentContext) servletContext.getAttribute(CONTEXT_NAME); } public void init(ServletContext servletContext) throws RuntimeException { ClassicComponentContext.servletContext = servletContext; servletContext.setAttribute(CONTEXT_NAME, this); init(); } @Override public void init() { initClassLoader(); initEnvContext(); instantiateComponents(); initComponents(); registerShutdownHook(); } private void initClassLoader() { this.classLoader = servletContext.getClassLoader(); } private void initEnvContext() { if (this.envContext != null) { return; } Context context = null; try { context = new InitialContext(); this.envContext = (Context) context.lookup("java:comp/env"); } catch (NamingException e) { throw new RuntimeException(e); } finally { close(context); } } private void initComponents() { componentsMap.values().forEach(this::initComponent); } private void initComponent(Object component) { Class<?> componentClass = component.getClass(); injectComponents(component, componentClass); List<Method> candidateMethods = findCandidateMethods(componentClass); processPostConstruct(component, candidateMethods); processPreDestroyMetaData(component, candidateMethods); } private void instantiateComponents() { List<String> componentNames = listAllComponentNames(); Logger.info(componentNames.toString()); componentNames.forEach(name -> componentsMap.put(name, lookupComponent(name))); } private void registerShutdownHook() { Runtime.getRuntime().addShutdownHook(new Thread(this::processPreDestroy)); } private <C> C lookupComponent(String componentName) { return executeInContext(context -> (C) context.lookup(componentName)); } /** * 通过名称进行依赖查找 * * @param name * @param <C> * @return */ public <C> C getComponent(String name) { C component = null; try { component = (C) envContext.lookup(name); } catch (NamingException e) { throw new NoSuchElementException(name); } return component; } @Override public List<String> getComponentNames() { return null; } @Override public void destroy() throws RuntimeException { processPreDestroy(); clearCache(); close(envContext); } private void clearCache() { componentsMap.clear(); preDestroyMethodCache.clear(); } private List<String> listAllComponentNames() { return listComponentNames("/"); } protected List<String> listComponentNames(String path) { return executeInContext(context -> { NamingEnumeration<NameClassPair> e = executeInContext(context, ctx -> ctx.list(path), true); if (e == null) { return Collections.emptyList(); } List<String> fullNames = new LinkedList<>(); while (e.hasMoreElements()) { NameClassPair pair = e.nextElement(); String className = pair.getClassName(); Class<?> loadClass = this.classLoader.loadClass(className); if (Context.class.isAssignableFrom(loadClass)) { // "bean"这样的目录的属于 Context.class,递归查找 fullNames.addAll(listComponentNames(pair.getName())); } else { String fullName = path.startsWith("/") ? path : path + "/" + pair.getName(); fullNames.add(fullName); } } return fullNames; }); } /** * 在 Context 中执行 {@link ThrowableFunction} 并返回其结果 * * @param function * @param <R> 返回结果的类型 * @return * @see ThrowableFunction#apply(Object) */ protected <R> R executeInContext(ThrowableFunction<Context, R> function) { return executeInContext(function, false); } /** * 在 Context 中执行 {@link ThrowableFunction} 并返回其结果 * * @param function * @param ignoreException 是否忽略异常,false 时可能抛出 {@link RuntimeException} * @param <R> 返回结果的类型 * @return * @see ThrowableFunction#apply(Object) */ protected <R> R executeInContext(ThrowableFunction<Context, R> function, boolean ignoreException) { return executeInContext(this.envContext, function, ignoreException); } private <R> R executeInContext(Context context, ThrowableFunction<Context, R> function, boolean ignoreException) { R result = null; try { result = function.apply(context); } catch (Throwable throwable) { if (ignoreException) { Logger.warning(throwable.getMessage()); } else { throw new RuntimeException(throwable); } } return result; } private void close(Context context) { if (context != null) { ThrowableAction.execute(context::close); } } /** * Inject component class's fields annotated by {@link Resource} * * @param component the object * @param componentClass the Class of the object */ private void injectComponents(final Object component, Class<?> componentClass) { Stream.of(componentClass.getDeclaredFields()) .filter(field -> { int mods = field.getModifiers(); return !Modifier.isStatic(mods) && field.isAnnotationPresent(Resource.class); }).forEach(field -> { String resourceName = field.getAnnotation(Resource.class).name(); Object injectedComponent = componentsMap.get(resourceName); field.setAccessible(true); try { field.set(component, injectedComponent); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } ); } /** * Invoke methods annotated by {@link PostConstruct } of component * , after fields annotated by {@link Resource} are injected. * * @param component the Class instance * @param candidateMethods list of candidate methods * @see #injectComponents(Object, Class) */ private void processPostConstruct(final Object component, List<Method> candidateMethods) { candidateMethods.stream() .filter(m -> m.isAnnotationPresent(PostConstruct.class)) .forEach(method -> ThrowableAction.execute(() -> method.invoke(component))); } /** * Find candidate methods for {@link PreDestroy} and {@link PostConstruct} * * @param componentClass the Class instance * @return list of candidate methods */ private List<Method> findCandidateMethods(Class<?> componentClass) { return Stream.of(componentClass.getDeclaredMethods()) .filter(method -> !Modifier.isStatic(method.getModifiers()) && // not static method.getParameterCount() == 0 // no argument ).collect(Collectors.toList()); } /** * Cache methods annotated by {@link PostConstruct} of component instance * * @param component * @param candidateMethods */ private void processPreDestroyMetaData(final Object component, List<Method> candidateMethods) { candidateMethods.stream() .filter(m -> m.isAnnotationPresent(PreDestroy.class)) .forEach(method -> preDestroyMethodCache.put(method, component)); } /** * Invoke methods annotated by {@link PreDestroy } before JVM destroy */ private void processPreDestroy() { // return once invoked if (!enteredDestroy.compareAndSet(false, true)) { return; } Method[] methods = preDestroyMethodCache.keySet().toArray(new Method[0]); for (Method method : methods) { Object component = preDestroyMethodCache.remove(methods); ThrowableAction.execute(() -> method.invoke(component)); } } }
[ "xiangaoole@outlook.com" ]
xiangaoole@outlook.com
c7198f72666ccdb44cf0b7b89b921dbd374b21e0
3fe2b29e76408f7044437802076adaeeaeb4c231
/app/src/main/java/com/example/helloworld/PopupWindowActivity.java
4f888ea013fa5fc473bd59e097377afe6a356862
[]
no_license
morestydy/Android-base
f786b05aff853bf6a6565969194685370ab4def9
b99917ae2c0ba592a896e0e11feb27e4d0943e9b
refs/heads/master
2021-05-24T08:19:46.521916
2020-08-22T02:02:19
2020-08-22T02:02:19
253,467,567
0
0
null
null
null
null
UTF-8
Java
false
false
1,706
java
package com.example.helloworld; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.PopupWindow; import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.example.helloworld.util.ToastUtil; /** * com.example.helloworld * HelloWorld * * @author:Tom 2020/7/26 * 描述: **/ public class PopupWindowActivity extends AppCompatActivity { private Button mBtnPop; private PopupWindow mPop; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_popup_window); mBtnPop = findViewById(R.id.btn_pop); mBtnPop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { View view = getLayoutInflater().inflate(R.layout.layout_pop,null); TextView textView = view.findViewById(R.id.tv_good); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPop.dismiss(); //do sth ToastUtil.showMsg(PopupWindowActivity.this,"good"); } }); mPop = new PopupWindow(view,mBtnPop.getWidth(), ViewGroup.LayoutParams.WRAP_CONTENT); mPop.setOutsideTouchable(true); mPop.setFocusable(true); mPop.showAsDropDown(mBtnPop); // mPop.show } }); } }
[ "1692125978@qq.com" ]
1692125978@qq.com
49a2ec4158f54d647347bfe22bb3ac3bcd68d695
56aa3d28d5233833972b71afb92e1355fd992e97
/com.quui.litp/src/com/quui/Util.java
106d1d8c6df3a71be8c5bd1e5812a1c8c53a6458
[]
no_license
fsteeg/litp
71534d7db7abe0cb65c972d46036966d7a48adac
0e7b4ebc61c45dcb79bc7a5d16b0132612efb2d6
refs/heads/master
2021-01-23T11:03:47.374201
2010-03-07T22:27:29
2010-03-07T22:27:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package com.quui; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; /** * Class for loading and saving strings to and from files. * * @author Fabian Steeg (fsteeg) */ public class Util { /** * Reads a file to a string, eliminating newline-characters * * @param file * The file to read * @return Returns the content of the file read, as a string */ public static String getText(File file) { StringBuilder text = new StringBuilder(); try { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = ""; while ((line = reader.readLine()) != null) { text.append(line).append("\n"); } } catch (Exception e) { e.printStackTrace(); } return text.toString(); } /** * Saves a string to a file * * @param location * The location to save the file to * @param content * The content to be saved */ public static void saveString(String location, String content) { File f = new File(location); try { BufferedWriter writer = new BufferedWriter(new FileWriter(f)); writer.write(content.toCharArray()); writer.close(); System.out.println("Wrote output " // + content + " " + "to: " + f.getAbsolutePath() + "\n"); } catch (IOException e) { e.printStackTrace(); } } }
[ "fsteeg@gmail.com" ]
fsteeg@gmail.com
29042ca3348dc31997bb4282fc4ed642be18a3f7
d11b3642cd324b5a7924ea20cf01558c9e5f4265
/src/main/java/com/romellpineda/songr/SongRepository.java
89791d9c7ca81904d9d05393b1991f001c2e9bfe
[]
no_license
RomellPineda/songr
2e804bd032bcd46ddaa4ae5967d591011083afea
f8514a0b64fc3ca3223fbbe51dd43ac4b2e5f5ec
refs/heads/master
2020-12-15T22:05:55.893630
2020-02-02T08:06:40
2020-02-02T08:06:40
235,267,854
0
0
null
2020-02-02T08:06:41
2020-01-21T06:05:14
Java
UTF-8
Java
false
false
166
java
package com.romellpineda.songr; import org.springframework.data.jpa.repository.JpaRepository; public interface SongRepository extends JpaRepository<Song, Long> { }
[ "romell.pineda@gmail.com" ]
romell.pineda@gmail.com
cc2c5484a13d272b96743af1f6b246b32226268f
36a80ecec12da8bf43980768a920c28842d2763b
/src/main/java/com/tools20022/repository/entity/Transport.java
9645a7dd0e849ada98b794123d75634b478aaf02
[]
no_license
bukodi/test02
e9045f6f88d44a5833b1cf32b15a3d7b9a64aa83
30990a093e1239b4244c2a64191b6fe1eacf3b00
refs/heads/master
2021-05-08T03:22:32.792980
2017-10-24T23:00:52
2017-10-24T23:00:52
108,186,993
0
0
null
null
null
null
UTF-8
Java
false
false
13,000
java
package com.tools20022.repository.entity; import com.tools20022.metamodel.MMBusinessAssociationEnd; import com.tools20022.metamodel.MMBusinessAttribute; import com.tools20022.metamodel.MMBusinessComponent; import com.tools20022.repository.codeset.FreightChargesCode; import com.tools20022.repository.datatype.ISODateTime; import com.tools20022.repository.datatype.Max35Text; import com.tools20022.repository.datatype.YesNoIndicator; import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; /** * Moving of goods or people from one place to another by vehicle. */ public class Transport { final static private AtomicReference<MMBusinessComponent> mmObject_lazy = new AtomicReference<>(); /** * Specifies the applicable Incoterm and associated location. */ public static final MMBusinessAssociationEnd Incoterms = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "Incoterms"; definition = "Specifies the applicable Incoterm and associated location."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Incoterms.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> com.tools20022.repository.entity.Incoterms.mmObject(); } }; /** * Unique identification of the means of transport, such as the * International Maritime Organization number of a vessel. */ public static final MMBusinessAttribute Identification = new MMBusinessAttribute() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "Identification"; definition = "Unique identification of the means of transport, such as the International Maritime Organization number of a vessel."; maxOccurs = 1; minOccurs = 1; simpleType_lazy = () -> Max35Text.mmObject(); } }; /** * Physical packaging of goods for transport. */ public static final MMBusinessAssociationEnd Packaging = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "Packaging"; definition = "Physical packaging of goods for transport."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Packaging.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> com.tools20022.repository.entity.Packaging.mmObject(); } }; /** * Date and time when the goods reach their destination.. */ public static final MMBusinessAttribute ArrivalDateTime = new MMBusinessAttribute() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "ArrivalDateTime"; definition = "Date and time when the goods reach their destination.."; maxOccurs = 1; minOccurs = 1; simpleType_lazy = () -> ISODateTime.mmObject(); } }; /** * Indicates whether or not partial shipments are allowed. */ public static final MMBusinessAttribute PartialShipment = new MMBusinessAttribute() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "PartialShipment"; definition = "Indicates whether or not partial shipments are allowed."; maxOccurs = 1; minOccurs = 1; simpleType_lazy = () -> YesNoIndicator.mmObject(); } }; /** * Indicates whether or not transshipment of goods is allowed. */ public static final MMBusinessAttribute TransShipment = new MMBusinessAttribute() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "TransShipment"; definition = "Indicates whether or not transshipment of goods is allowed."; maxOccurs = 1; minOccurs = 1; simpleType_lazy = () -> YesNoIndicator.mmObject(); } }; /** * Specifies the delivery parameters of a trade. */ public static final MMBusinessAssociationEnd ProductDelivery = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "ProductDelivery"; definition = "Specifies the delivery parameters of a trade."; maxOccurs = 1; minOccurs = 0; opposite_lazy = () -> com.tools20022.repository.entity.ProductDelivery.Routing; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> com.tools20022.repository.entity.ProductDelivery.mmObject(); } }; /** * Place from where the goods must leave. */ public static final MMBusinessAssociationEnd PlaceOfDeparture = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "PlaceOfDeparture"; definition = "Place from where the goods must leave."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Location.DepartureTransportParameters; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Location.mmObject(); } }; /** * Place where the goods must arrive. */ public static final MMBusinessAssociationEnd PlaceOfDestination = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "PlaceOfDestination"; definition = "Place where the goods must arrive."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Location.DestinationTransportParameters; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Location.mmObject(); } }; /** * Charges related to the conveyance of goods. */ public static final MMBusinessAssociationEnd TransportCharges = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "TransportCharges"; definition = "Charges related to the conveyance of goods."; minOccurs = 0; opposite_lazy = () -> com.tools20022.repository.entity.Charges.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Charges.mmObject(); } }; /** * Identifies whether the freight charges associated with the items are * "prepaid" or "collect". */ public static final MMBusinessAttribute FreightChargesPrepaidOrCollect = new MMBusinessAttribute() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "FreightChargesPrepaidOrCollect"; definition = "Identifies whether the freight charges associated with the items are \"prepaid\" or \"collect\"."; maxOccurs = 1; minOccurs = 1; simpleType_lazy = () -> FreightChargesCode.mmObject(); } }; /** * Specifies the shipment date, the earliest shipment date and the latest * shipment date. */ public static final MMBusinessAssociationEnd ShipmentDates = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "ShipmentDates"; definition = "Specifies the shipment date, the earliest shipment date and the latest shipment date."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.ShipmentDateRange.RelatedTransport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> ShipmentDateRange.mmObject(); } }; /** * Goods that are transported. */ public static final MMBusinessAssociationEnd TransportedGoods = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "TransportedGoods"; definition = "Goods that are transported."; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Goods.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Goods.mmObject(); } }; /** * Specifies each role linked to the transport of goods. */ public static final MMBusinessAssociationEnd PartyRole = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "PartyRole"; definition = "Specifies each role linked to the transport of goods."; maxOccurs = 1; minOccurs = 0; opposite_lazy = () -> com.tools20022.repository.entity.TransportPartyRole.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> TransportPartyRole.mmObject(); } }; /** * Place through which the goods are transiting. */ public static final MMBusinessAssociationEnd TransitLocation = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "TransitLocation"; definition = "Place through which the goods are transiting."; minOccurs = 0; opposite_lazy = () -> com.tools20022.repository.entity.Location.RelatedTransport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Location.mmObject(); } }; /** * Documents which may be required in relation with the transportation of * goods. */ public static final MMBusinessAssociationEnd TransportDocuments = new MMBusinessAssociationEnd() { { isDerived = false; elementContext_lazy = () -> Transport.mmObject(); registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "TransportDocuments"; definition = "Documents which may be required in relation with the transportation of goods."; maxOccurs = 1; minOccurs = 1; opposite_lazy = () -> com.tools20022.repository.entity.Document.Transport; aggregation = com.tools20022.metamodel.MMAggregation.NONE; type_lazy = () -> Document.mmObject(); } }; static public MMBusinessComponent mmObject() { mmObject_lazy.compareAndSet(null, new MMBusinessComponent() { { dataDictionary_lazy = () -> com.tools20022.repository.GeneratedRepository.dataDict; registrationStatus = com.tools20022.metamodel.MMRegistrationStatus.REGISTERED; name = "Transport"; definition = "Moving of goods or people from one place to another by vehicle."; associationDomain_lazy = () -> Arrays.asList(com.tools20022.repository.entity.Location.DepartureTransportParameters, com.tools20022.repository.entity.Location.DestinationTransportParameters, com.tools20022.repository.entity.Location.RelatedTransport, com.tools20022.repository.entity.Document.Transport, com.tools20022.repository.entity.Charges.Transport, com.tools20022.repository.entity.Incoterms.Transport, com.tools20022.repository.entity.Goods.Transport, com.tools20022.repository.entity.ProductDelivery.Routing, com.tools20022.repository.entity.Packaging.Transport, com.tools20022.repository.entity.TransportPartyRole.Transport, com.tools20022.repository.entity.ShipmentDateRange.RelatedTransport); element_lazy = () -> Arrays.asList(com.tools20022.repository.entity.Transport.Incoterms, com.tools20022.repository.entity.Transport.Identification, com.tools20022.repository.entity.Transport.Packaging, com.tools20022.repository.entity.Transport.ArrivalDateTime, com.tools20022.repository.entity.Transport.PartialShipment, com.tools20022.repository.entity.Transport.TransShipment, com.tools20022.repository.entity.Transport.ProductDelivery, com.tools20022.repository.entity.Transport.PlaceOfDeparture, com.tools20022.repository.entity.Transport.PlaceOfDestination, com.tools20022.repository.entity.Transport.TransportCharges, com.tools20022.repository.entity.Transport.FreightChargesPrepaidOrCollect, com.tools20022.repository.entity.Transport.ShipmentDates, com.tools20022.repository.entity.Transport.TransportedGoods, com.tools20022.repository.entity.Transport.PartyRole, com.tools20022.repository.entity.Transport.TransitLocation, com.tools20022.repository.entity.Transport.TransportDocuments); } }); return mmObject_lazy.get(); } }
[ "bukodi@gmail.com" ]
bukodi@gmail.com
0119441b1736d100249895a4e98cbf5c4535565a
7f30d460f8069ab5dd2000547295ba0e0b89dc01
/Final Project/src/main/java/com/kltn/entities/SpecialDayOfUser.java
be079bb7f13fb84ce83359cde4293945498442e2
[]
no_license
TinNguyen331/FinalProject
48703260c0ae51b616bdeef3894ea98dc6c9f56e
8d245f984d16cbc9270909c821abee83cab30a86
refs/heads/master
2020-12-30T15:54:53.711329
2017-07-23T16:23:11
2017-07-23T16:23:11
91,184,052
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package com.kltn.entities; import java.util.Date; /** * Created by TinNguyen on 5/12/17. */ public class SpecialDayOfUser { private Date date; private String description; public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "tinnguyen331@gmail.com" ]
tinnguyen331@gmail.com
7db7b479bb385b294bdec97801d74aba71eca3ff
1ae60085fd221d5389f23d36fb04494accbf4e14
/app/src/main/java/com/mvproomarchiticture/ui/common/widgets/recycler/decoration/GridSpacesItemDecoration.java
bbc965ba425cd40f560e3c11950d31153a1bac37
[]
no_license
dadhaniyapratik/MVP_Room_Architicture
268eee023d1fff408f62c8807c8b4c1a8b012c2e
832839321cb57a358e15892f3c81fa06f1e5f51e
refs/heads/master
2020-06-27T14:51:17.706384
2019-08-01T05:04:43
2019-08-01T05:04:43
199,980,300
0
0
null
null
null
null
UTF-8
Java
false
false
1,735
java
package com.mvproomarchiticture.ui.common.widgets.recycler.decoration; import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.view.View; public class GridSpacesItemDecoration extends RecyclerView.ItemDecoration { private int mSpanCount; private int mSpacing; private boolean mIncludeEdge; public GridSpacesItemDecoration(int spanCount, int spacing, boolean includeEdge) { this.mSpanCount = spanCount; this.mSpacing = spacing; this.mIncludeEdge = includeEdge; } @SuppressWarnings("unused") public void setSpanCount(int spanCount) { mSpanCount = spanCount; } @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { int position = parent.getChildAdapterPosition(view); // item position int column = position % mSpanCount; // item column if (mIncludeEdge) { outRect.left = mSpacing - column * mSpacing / mSpanCount; // mSpacing - column * ((1f / mSpanCount) * mSpacing) outRect.right = (column + 1) * mSpacing / mSpanCount; // (column + 1) * ((1f / mSpanCount) * mSpacing) if (position < mSpanCount) { // top edge outRect.top = mSpacing; } outRect.bottom = mSpacing; // item bottom } else { outRect.left = column * mSpacing / mSpanCount; // column * ((1f / mSpanCount) * mSpacing) outRect.right = mSpacing - (column + 1) * mSpacing / mSpanCount; // mSpacing - (column + 1) * ((1f / mSpanCount) * mSpacing) if (position >= mSpanCount) { outRect.top = mSpacing; // item top } } } }
[ "pkdadhaniya@cygnet.com" ]
pkdadhaniya@cygnet.com
127c5a9ff23a66410570703c616d572a256395f0
d9df48207e020367a2195bc3381db61c4eee4d9a
/Java/ch20/src/B3_AutoBoxingUnboxing2.java
4647fa2f74f3e1eb92ee039825c095c51bd47772
[]
no_license
surkjin/kosmo41_surkjin
d1872c39784b9c34f3016bf9cc1f347414b61816
2a262c4ae44415690034e8ce04e858732aa12c70
refs/heads/master
2020-03-21T04:42:09.070599
2018-12-12T06:52:33
2018-12-12T06:52:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
public class B3_AutoBoxingUnboxing2 { public static void main(String[] args) { Integer num = 10; num++; //오토 박싱과 오토 언박싱이 동시 진행 System.out.println(num); num += 3; System.out.println(num); int r = num + 5; //오토 언박싱 Integer rObj = num -5; //오토 언박싱 System.out.println(r); System.out.println(rObj); } }
[ "surkjin@gmail.com" ]
surkjin@gmail.com
fde732ed023f08598022963d9c8ac0407d2ca301
f099c81a0163af330175eb5165b0282aacc58e1f
/src/strategy_pattern_策略模式/new_code/VerticalFlyImp.java
e824e8a7f6de9df365e754487fb8883186ca0e06
[]
no_license
Kumar-Mr/pattern
10d4a72825ce39ca26bd347d1dc0cbcd3e3c2cd0
650c36362f3703c6b67bf24e286aafdfe0ce1ae0
refs/heads/master
2020-06-01T23:12:20.168858
2019-06-09T10:13:30
2019-06-09T10:13:30
190,961,977
0
0
null
null
null
null
UTF-8
Java
false
false
275
java
package strategy_pattern_策略模式.new_code; import strategy_pattern_策略模式.new_code.base.FlyInterface; public class VerticalFlyImp implements FlyInterface { @Override public void fly(String name) { System.out.println(name + "竖着飞"); } }
[ "kumar_mr@163.com" ]
kumar_mr@163.com
1f53c79ffb0215eba6ee79d5cee55a3410def557
5b925d0e0a11e873dbec1d2a7f5ee1a106823bd5
/CoreJava/src/com/testyantra/javaapp/abstraction/Person.java
335f36e6b5b4e9c3b9c36a18b6b309cc751c050f
[]
no_license
MohibHello/ELF-06June19-Testyantra-Mohib.k
a3a07048df9c45ccd2b7936326842851654ef968
b7a7594e7431987254aa08287269cf115a26ca11
refs/heads/master
2022-12-29T12:05:44.336518
2019-09-13T16:52:08
2019-09-13T16:52:08
192,527,313
0
0
null
2020-10-13T15:17:14
2019-06-18T11:32:01
Rich Text Format
UTF-8
Java
false
false
228
java
package com.testyantra.javaapp.abstraction; import lombok.extern.java.Log; @Log public class Person implements Animal, Human { public void walk() { log.info("walking"); } public void eat() { log.info("eating"); } }
[ "www.muhibkhan@gmail.com" ]
www.muhibkhan@gmail.com
3005fb39dfa98da8e32e78b80f4143cd2326bbbe
443ff9c2b03021862fbd184015c10519a3d99c91
/src/main/java/com/agence/voiture/entities/Voiture.java
cc26d2147e4558bdac41957db7666e847c2134e2
[]
no_license
khalilTou-dev/GestionVoiture
ee57fb1ea825080cccfe0d1ed2c8a9e7dbb64e08
639a352f0cb2ef420a7883c7d2334eb24e7913bf
refs/heads/main
2023-02-05T22:13:50.074317
2020-12-30T23:45:31
2020-12-30T23:45:31
304,448,473
0
0
null
null
null
null
UTF-8
Java
false
false
1,963
java
package com.agence.voiture.entities; import java.util.Date; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.PastOrPresent; import javax.validation.constraints.Size; import org.springframework.format.annotation.DateTimeFormat; @Entity public class Voiture { @Id private String matriculeVoit; @NotNull @Size (min = 3,max = 15) private String marqueVoit; @Min(value = 5000) @Max(value = 1000000) private Double prixVoit; @Temporal(TemporalType.DATE) @DateTimeFormat(pattern = "yyyy-MM-dd") @PastOrPresent private Date dateRelease; @ManyToOne private Agence agence; public Voiture(String matriculeVoit, String marqueVoit, Double prixVoit, Date dateRelease) { super(); this.matriculeVoit = matriculeVoit; this.marqueVoit = marqueVoit; this.prixVoit = prixVoit; this.dateRelease = dateRelease; } public Voiture() { super(); // TODO Auto-generated constructor stub } public String getMatriculeVoit() { return matriculeVoit; } public void setMatriculeVoit(String matriculeVoit) { this.matriculeVoit = matriculeVoit; } public String getMarqueVoit() { return marqueVoit; } public void setMarqueVoit(String marqueVoit) { this.marqueVoit = marqueVoit; } public Double getPrixVoit() { return prixVoit; } public void setPrixVoit(Double prixVoit) { this.prixVoit = prixVoit; } public Date getDateRelease() { return dateRelease; } public void setDateRelease(Date dateRelease) { this.dateRelease = dateRelease; } @Override public String toString() { return "Voiture [matriculeVoit=" + matriculeVoit + ", marqueVoit=" + marqueVoit + ", prixVoit=" + prixVoit + ", dateRelease=" + dateRelease + "]"; } }
[ "khalil.tourabi10@gmail.com" ]
khalil.tourabi10@gmail.com
a87e5afe4728f02dde3a62f50d468fba9e32ed7d
fe7e88cfb4c0ff564d17f843d813b3a551af25ec
/src/main/java/com/projuris/testeprojuris/Response.java
acc4b05fd86c9d45ef27a49238ef181a96fe9575
[]
no_license
EderBraz/Sistema-para-controle-de-manuten-o-de-equipamentos
056fb1763784584ef93940473986c1530215fda0
761bfd224e5d5bf3f2e37bc07e08f7ed927f0572
refs/heads/main
2023-06-10T12:32:05.402621
2021-06-26T01:57:02
2021-06-26T01:57:02
380,124,421
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
package com.projuris.testeprojuris; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.List; @Getter @Setter @NoArgsConstructor public class Response<T> { private T data; private List<String> errors; }
[ "eder_braz@hotmail.com" ]
eder_braz@hotmail.com
26f39304e7964f306a2aad8aef4a1835fdedcb3f
8eed652f747d941f2ae5eb49f108dc7f90bfbf49
/android/app/src/main/java/com/vortex/MainActivity.java
97c7cdf81c4ed266e2ee337d1fe5a754f1ed4b7c
[]
no_license
SyntappZ/vortex-player
20427ca940bc3bc7694c79bcc3bdca8c741b3d8b
0fa33efdd7d619ab2c1927cdc276f34d0187d326
refs/heads/main
2023-03-29T22:51:06.207556
2021-03-25T01:22:10
2021-03-25T01:22:10
331,995,852
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package com.vortexplayer; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "vortex-player"; } }
[ "doddsanater87@gmail.com" ]
doddsanater87@gmail.com
34f2e1ef852e9c748f048345e80faa2a18198acb
bd4f21d7c11db43c94cb0287c361bea3d89930c9
/bankingproject/src/main/java/com/capegimini/bankingproject/bankingproject/dao/AdminDao.java
5702186f9e0040ac43c37a4f0ba4b28080f6fd82
[]
no_license
abinash-biki/TY_CAPGEMINI_JavaCloud_10thFEB_abinash
53dcfe65bff3161326d2d5c2b297f5953b67e06b
12abe811b6f5554b487c11faeffef6301e21aff5
refs/heads/master
2021-01-30T08:12:32.111396
2020-05-16T12:48:32
2020-05-16T12:48:32
243,495,148
0
0
null
2020-10-13T20:31:02
2020-02-27T10:43:11
Java
UTF-8
Java
false
false
90
java
package com.capegimini.bankingproject.bankingproject.dao; public interface AdminDao { }
[ "swainabinash97@gmail.com" ]
swainabinash97@gmail.com
ba65a04bf9379aac2f5a79209dd7f9f12673bf42
1024858fdbcec14111588575f8a184116941f36e
/2.JavaCore/src/com/javarush/task/task13/task1319/Solution.java
61bd16eed432b2ea7ea164cbf1ac4600a848e565
[]
no_license
EugeneShevchugov/JavaRush
0c6f423b28e5a69b691d4d6ba5bf2d16b83e542b
b4cc910ce3093cf2f7526a8b545ecb700cb17b1c
refs/heads/master
2022-11-12T20:20:14.774878
2020-07-01T18:57:51
2020-07-01T18:57:51
276,458,619
0
0
null
null
null
null
UTF-8
Java
false
false
700
java
package com.javarush.task.task13.task1319; import java.io.*; /* Писатель в файл с консоли */ public class Solution { public static void main(String[] args) throws IOException { BufferedReader console = new BufferedReader(new InputStreamReader(System.in)); String fileName = console.readLine(); BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName))); String s = ""; while (!s.equals("exit")) { s = console.readLine(); bufferedWriter.write(s); bufferedWriter.newLine(); } console.close(); bufferedWriter.close(); } }
[ "eugene.shevchugov@gmail.com" ]
eugene.shevchugov@gmail.com
7950bf8fbffd22cf5e2343bd05ae38844cfcb442
f7160c0f0526cc5afc0fe4e6f06d384394059aa1
/largegraph/lg-framework/src/main/java/com/graphscape/commons/lang/Enumeration.java
34e62987210477496052f30e3c36976089aba3d5
[]
no_license
o1711/somecode
e2461c4fb51b3d75421c4827c43be52885df3a56
a084f71786e886bac8f217255f54f5740fa786de
refs/heads/master
2021-09-14T14:51:58.704495
2018-05-15T07:51:05
2018-05-15T07:51:05
112,574,683
0
0
null
null
null
null
UTF-8
Java
false
false
585
java
/** * */ package com.graphscape.commons.lang; /** * @author wuzhen * */ public class Enumeration { protected String name; public String getName() { return name; } public Enumeration(String name) { this.name = name; } @Override public int hashCode() { return this.name.hashCode(); } @Override public boolean equals(Object obj) { if (!(obj instanceof Enumeration)) { return false; } return name.equals(((Enumeration) obj).name); } @Override public String toString() { return this.name.toString(); } }
[ "wkz808@163.com" ]
wkz808@163.com
bf56104d7b401f06e3c64ea08a9c6aa60303df90
3f5b613d1caf00814415d76c300a7a79ee5c18e1
/src/main/java/io/github/stayhungrystayfoolish/web/rest/JhiPermissionResource.java
5af211144624df29e8a53766ab77c585baa1f767
[]
no_license
StayHungryStayFoolish/security-design
79d46d86b7a77794ce39236a60b969426b2b5cf9
66bdf87d0ad9b4f4a4c72f0e7da9e54795e73010
refs/heads/master
2021-06-05T10:29:47.953929
2018-08-26T07:29:57
2018-08-26T07:29:57
145,530,536
1
1
null
2020-09-18T16:56:46
2018-08-21T08:17:31
Java
UTF-8
Java
false
false
5,537
java
package io.github.stayhungrystayfoolish.web.rest; import com.codahale.metrics.annotation.Timed; import io.github.stayhungrystayfoolish.domain.JhiPermission; import io.github.stayhungrystayfoolish.service.JhiPermissionService; import io.github.stayhungrystayfoolish.web.rest.errors.BadRequestAlertException; import io.github.stayhungrystayfoolish.web.rest.util.HeaderUtil; import io.github.stayhungrystayfoolish.web.rest.util.PaginationUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing JhiPermission. */ @RestController @RequestMapping("/api") public class JhiPermissionResource { private final Logger log = LoggerFactory.getLogger(JhiPermissionResource.class); private static final String ENTITY_NAME = "jhiPermission"; private final JhiPermissionService jhiPermissionService; public JhiPermissionResource(JhiPermissionService jhiPermissionService) { this.jhiPermissionService = jhiPermissionService; } /** * POST /jhi-permissions : Create a new jhiPermission. * * @param jhiPermission the jhiPermission to create * @return the ResponseEntity with status 201 (Created) and with body the new jhiPermission, or with status 400 (Bad Request) if the jhiPermission has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/jhi-permissions") @Timed public ResponseEntity<JhiPermission> createJhiPermission(@RequestBody JhiPermission jhiPermission) throws URISyntaxException { log.debug("REST request to save JhiPermission : {}", jhiPermission); if (jhiPermission.getId() != null) { throw new BadRequestAlertException("A new jhiPermission cannot already have an ID", ENTITY_NAME, "idexists"); } JhiPermission result = jhiPermissionService.save(jhiPermission); return ResponseEntity.created(new URI("/api/jhi-permissions/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /jhi-permissions : Updates an existing jhiPermission. * * @param jhiPermission the jhiPermission to update * @return the ResponseEntity with status 200 (OK) and with body the updated jhiPermission, * or with status 400 (Bad Request) if the jhiPermission is not valid, * or with status 500 (Internal Server Error) if the jhiPermission couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/jhi-permissions") @Timed public ResponseEntity<JhiPermission> updateJhiPermission(@RequestBody JhiPermission jhiPermission) throws URISyntaxException { log.debug("REST request to update JhiPermission : {}", jhiPermission); if (jhiPermission.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } JhiPermission result = jhiPermissionService.save(jhiPermission); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, jhiPermission.getId().toString())) .body(result); } /** * GET /jhi-permissions : get all the jhiPermissions. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of jhiPermissions in body */ @GetMapping("/jhi-permissions") @Timed public ResponseEntity<List<JhiPermission>> getAllJhiPermissions(Pageable pageable) { log.debug("REST request to get a page of JhiPermissions"); Page<JhiPermission> page = jhiPermissionService.findAll(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/jhi-permissions"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } /** * GET /jhi-permissions/:id : get the "id" jhiPermission. * * @param id the id of the jhiPermission to retrieve * @return the ResponseEntity with status 200 (OK) and with body the jhiPermission, or with status 404 (Not Found) */ @GetMapping("/jhi-permissions/{id}") @Timed public ResponseEntity<JhiPermission> getJhiPermission(@PathVariable Long id) { log.debug("REST request to get JhiPermission : {}", id); Optional<JhiPermission> jhiPermission = jhiPermissionService.findOne(id); return ResponseUtil.wrapOrNotFound(jhiPermission); } /** * DELETE /jhi-permissions/:id : delete the "id" jhiPermission. * * @param id the id of the jhiPermission to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/jhi-permissions/{id}") @Timed public ResponseEntity<Void> deleteJhiPermission(@PathVariable Long id) { log.debug("REST request to delete JhiPermission : {}", id); jhiPermissionService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "bonismo@hotmail.com" ]
bonismo@hotmail.com
0e645cefeb51dd6b449c638590349b67a7668093
a6689bfcb181f6cb5fbab367e6b6f48738f239fc
/src/main/java/com/dropbox/core/v2/team/UsersSelectorArg.java
c21d2e9974d3c5d1c07da14a44c822efa1aa837b
[ "MIT" ]
permissive
VDenis/dropbox-sdk-java
0df0fd0c3e225d26eaa7b27c52c1dc8bb38abc2e
d64515a8c6285c12dffd3d0bf0f2548d046125b6
refs/heads/master
2021-01-21T00:21:41.171499
2016-02-24T23:19:19
2016-02-24T23:19:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,985
java
/* DO NOT EDIT */ /* This file was generated from team.babel */ package com.dropbox.core.v2.team; import com.dropbox.core.json.JsonArrayReader; import com.dropbox.core.json.JsonReadException; import com.dropbox.core.json.JsonReader; import com.dropbox.core.json.JsonWriter; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import java.io.IOException; import java.util.List; /** * Argument for selecting a list of users, either by team_member_ids, * external_ids or emails. */ public final class UsersSelectorArg { // union UsersSelectorArg /** * Discriminating tag type for {@link UsersSelectorArg}. */ public enum Tag { /** * List of member IDs. */ TEAM_MEMBER_IDS, // List<String> /** * List of external user IDs. */ EXTERNAL_IDS, // List<String> /** * List of email addresses. */ EMAILS; // List<String> } private static final java.util.HashMap<String, Tag> VALUES_; static { VALUES_ = new java.util.HashMap<String, Tag>(); VALUES_.put("team_member_ids", Tag.TEAM_MEMBER_IDS); VALUES_.put("external_ids", Tag.EXTERNAL_IDS); VALUES_.put("emails", Tag.EMAILS); } private final Tag tag; private final List<String> teamMemberIdsValue; private final List<String> externalIdsValue; private final List<String> emailsValue; /** * Argument for selecting a list of users, either by team_member_ids, * external_ids or emails. * * @param tag Discriminating tag for this instance. */ private UsersSelectorArg(Tag tag, List<String> teamMemberIdsValue, List<String> externalIdsValue, List<String> emailsValue) { this.tag = tag; this.teamMemberIdsValue = teamMemberIdsValue; this.externalIdsValue = externalIdsValue; this.emailsValue = emailsValue; } /** * Returns the tag for this instance. * * <p> This class is a tagged union. Tagged unions instances are always * associated to a specific tag. Callers are recommended to use the tag * value in a {@code switch} statement to determine how to properly handle * this {@code UsersSelectorArg}. </p> * * @return the tag for this instance. */ public Tag tag() { return tag; } /** * Returns {@code true} if this instance has the tag {@link * Tag#TEAM_MEMBER_IDS}, {@code false} otherwise. * * @return {@code true} if this insta5Bnce is tagged as {@link * Tag#TEAM_MEMBER_IDS}, {@code false} otherwise. */ public boolean isTeamMemberIds() { return this.tag == Tag.TEAM_MEMBER_IDS; } /** * Returns an instance of {@code UsersSelectorArg} that has its tag set to * {@link Tag#TEAM_MEMBER_IDS}. * * <p> List of member IDs. </p> * * @param value {@link UsersSelectorArg#teamMemberIds} value to assign to * this instance. * * @return Instance of {@code UsersSelectorArg} with its tag set to {@link * Tag#TEAM_MEMBER_IDS}. * * @throws IllegalArgumentException if {@code value} contains a {@code * null} item or is {@code null}. */ public static UsersSelectorArg teamMemberIds(List<String> value) { if (value == null) { throw new IllegalArgumentException("Value is null"); } for (String x : value) { if (x == null) { throw new IllegalArgumentException("An item in list is null"); } } return new UsersSelectorArg(Tag.TEAM_MEMBER_IDS, value, null, null); } /** * List of member IDs. * * <p> This instance must be tagged as {@link Tag#TEAM_MEMBER_IDS}. </p> * * @return The {@link UsersSelectorArg#teamMemberIds} value associated with * this instance if {@link #isTeamMemberIds} is {@code true}. * * @throws IllegalStateException If {@link #isTeamMemberIds} is {@code * false}. */ public List<String> getTeamMemberIdsValue() { if (this.tag != Tag.TEAM_MEMBER_IDS) { throw new IllegalStateException("Invalid tag: required Tag.TEAM_MEMBER_IDS, but was Tag." + tag.name()); } return teamMemberIdsValue; } /** * Returns {@code true} if this instance has the tag {@link * Tag#EXTERNAL_IDS}, {@code false} otherwise. * * @return {@code true} if this insta5Bnce is tagged as {@link * Tag#EXTERNAL_IDS}, {@code false} otherwise. */ public boolean isExternalIds() { return this.tag == Tag.EXTERNAL_IDS; } /** * Returns an instance of {@code UsersSelectorArg} that has its tag set to * {@link Tag#EXTERNAL_IDS}. * * <p> List of external user IDs. </p> * * @param value {@link UsersSelectorArg#externalIds} value to assign to * this instance. * * @return Instance of {@code UsersSelectorArg} with its tag set to {@link * Tag#EXTERNAL_IDS}. * * @throws IllegalArgumentException if {@code value} contains a {@code * null} item or is {@code null}. */ public static UsersSelectorArg externalIds(List<String> value) { if (value == null) { throw new IllegalArgumentException("Value is null"); } for (String x : value) { if (x == null) { throw new IllegalArgumentException("An item in list is null"); } } return new UsersSelectorArg(Tag.EXTERNAL_IDS, null, value, null); } /** * List of external user IDs. * * <p> This instance must be tagged as {@link Tag#EXTERNAL_IDS}. </p> * * @return The {@link UsersSelectorArg#externalIds} value associated with * this instance if {@link #isExternalIds} is {@code true}. * * @throws IllegalStateException If {@link #isExternalIds} is {@code * false}. */ public List<String> getExternalIdsValue() { if (this.tag != Tag.EXTERNAL_IDS) { throw new IllegalStateException("Invalid tag: required Tag.EXTERNAL_IDS, but was Tag." + tag.name()); } return externalIdsValue; } /** * Returns {@code true} if this instance has the tag {@link Tag#EMAILS}, * {@code false} otherwise. * * @return {@code true} if this insta5Bnce is tagged as {@link Tag#EMAILS}, * {@code false} otherwise. */ public boolean isEmails() { return this.tag == Tag.EMAILS; } /** * Returns an instance of {@code UsersSelectorArg} that has its tag set to * {@link Tag#EMAILS}. * * <p> List of email addresses. </p> * * @param value {@link UsersSelectorArg#emails} value to assign to this * instance. * * @return Instance of {@code UsersSelectorArg} with its tag set to {@link * Tag#EMAILS}. * * @throws IllegalArgumentException if {@code value} contains a {@code * null} item or is {@code null}. */ public static UsersSelectorArg emails(List<String> value) { if (value == null) { throw new IllegalArgumentException("Value is null"); } for (String x : value) { if (x == null) { throw new IllegalArgumentException("An item in list is null"); } } return new UsersSelectorArg(Tag.EMAILS, null, null, value); } /** * List of email addresses. * * <p> This instance must be tagged as {@link Tag#EMAILS}. </p> * * @return The {@link UsersSelectorArg#emails} value associated with this * instance if {@link #isEmails} is {@code true}. * * @throws IllegalStateException If {@link #isEmails} is {@code false}. */ public List<String> getEmailsValue() { if (this.tag != Tag.EMAILS) { throw new IllegalStateException("Invalid tag: required Tag.EMAILS, but was Tag." + tag.name()); } return emailsValue; } @Override public int hashCode() { // objects containing lists are not hash-able. This is used as a safeguard // against adding this object to a HashSet or HashMap. Since list fields are // mutable, it is not safe to compute a hashCode here. return System.identityHashCode(this); } @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof UsersSelectorArg) { UsersSelectorArg other = (UsersSelectorArg) obj; if (this.tag != other.tag) { return false; } switch (tag) { case TEAM_MEMBER_IDS: return (this.teamMemberIdsValue == other.teamMemberIdsValue) || (this.teamMemberIdsValue.equals(other.teamMemberIdsValue)); case EXTERNAL_IDS: return (this.externalIdsValue == other.externalIdsValue) || (this.externalIdsValue.equals(other.externalIdsValue)); case EMAILS: return (this.emailsValue == other.emailsValue) || (this.emailsValue.equals(other.emailsValue)); default: return false; } } else { return false; } } @Override public String toString() { return _JSON_WRITER.writeToString(this, false); } public String toStringMultiline() { return _JSON_WRITER.writeToString(this, true); } public String toJson(Boolean longForm) { return _JSON_WRITER.writeToString(this, longForm); } public static UsersSelectorArg fromJson(String s) throws JsonReadException { return _JSON_READER.readFully(s); } public static final JsonWriter<UsersSelectorArg> _JSON_WRITER = new JsonWriter<UsersSelectorArg>() { public final void write(UsersSelectorArg x, JsonGenerator g) throws IOException { switch (x.tag) { case TEAM_MEMBER_IDS: g.writeStartObject(); g.writeFieldName(".tag"); g.writeString("team_member_ids"); g.writeFieldName("team_member_ids"); g.writeStartArray(); for (String item: x.getTeamMemberIdsValue()) { if (item != null) { g.writeString(item); } } g.writeEndArray(); g.writeEndObject(); break; case EXTERNAL_IDS: g.writeStartObject(); g.writeFieldName(".tag"); g.writeString("external_ids"); g.writeFieldName("external_ids"); g.writeStartArray(); for (String item: x.getExternalIdsValue()) { if (item != null) { g.writeString(item); } } g.writeEndArray(); g.writeEndObject(); break; case EMAILS: g.writeStartObject(); g.writeFieldName(".tag"); g.writeString("emails"); g.writeFieldName("emails"); g.writeStartArray(); for (String item: x.getEmailsValue()) { if (item != null) { g.writeString(item); } } g.writeEndArray(); g.writeEndObject(); break; } } }; public static final JsonReader<UsersSelectorArg> _JSON_READER = new JsonReader<UsersSelectorArg>() { public final UsersSelectorArg read(JsonParser parser) throws IOException, JsonReadException { if (parser.getCurrentToken() == JsonToken.VALUE_STRING) { String text = parser.getText(); parser.nextToken(); Tag tag = VALUES_.get(text); if (tag == null) { throw new JsonReadException("Unanticipated tag " + text + " without catch-all", parser.getTokenLocation()); } switch (tag) { } throw new JsonReadException("Tag " + tag + " requires a value", parser.getTokenLocation()); } JsonReader.expectObjectStart(parser); String[] tags = readTags(parser); assert tags != null && tags.length == 1; String text = tags[0]; Tag tag = VALUES_.get(text); UsersSelectorArg value = null; if (tag != null) { switch (tag) { case TEAM_MEMBER_IDS: { List<String> v = null; assert parser.getCurrentToken() == JsonToken.FIELD_NAME; text = parser.getText(); assert tags[0].equals(text); parser.nextToken(); v = JsonArrayReader.mk(JsonReader.StringReader) .readField(parser, "team_member_ids", v); value = UsersSelectorArg.teamMemberIds(v); break; } case EXTERNAL_IDS: { List<String> v = null; assert parser.getCurrentToken() == JsonToken.FIELD_NAME; text = parser.getText(); assert tags[0].equals(text); parser.nextToken(); v = JsonArrayReader.mk(JsonReader.StringReader) .readField(parser, "external_ids", v); value = UsersSelectorArg.externalIds(v); break; } case EMAILS: { List<String> v = null; assert parser.getCurrentToken() == JsonToken.FIELD_NAME; text = parser.getText(); assert tags[0].equals(text); parser.nextToken(); v = JsonArrayReader.mk(JsonReader.StringReader) .readField(parser, "emails", v); value = UsersSelectorArg.emails(v); break; } } } if (value == null) { throw new JsonReadException("Unanticipated tag " + text, parser.getTokenLocation()); } JsonReader.expectObjectEnd(parser); return value; } }; }
[ "krieb@dropbox.com" ]
krieb@dropbox.com
ad98faa5bf7d7b9bd844254fef4db654e008e53b
37f812f590a6a5bf71768bf775c4b93fe21b9d55
/src/main/java/com/java/basic/c01_datatype/StringTest.java
950873de7030a0f70150f5e205978f32c5b93512
[]
no_license
jackagoodguy/Jvm_Learn
e690dae552d6c8c9eba74649d09bc9c2513fa0b4
cace1e8594b5a232b887143f14eda571fe05ca97
refs/heads/master
2023-01-22T08:04:29.480632
2020-11-24T11:21:32
2020-11-24T11:21:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
826
java
package com.java.basic.c01_datatype; /** * String: 字符串 * 1、String属于引用数据类型中的类,不是基本数据类型 * 2、使用一对""来声明 * 3、String可以与8种基本数据类型的变量做连接(+)运算。运算的结果为:String型 * * 不能将基本数据类型直接赋值为String类型 * 不能将字符串类型强转为基本数据类型 */ public class StringTest { public static void main(String[] args) { String s1 = "Hello World中国"; String s2 = ""; String s3 = "h"; String s4 = "123"; System.out.println(s1); int i1 = 1; String s5 = s4 + i1; System.out.println(s5); boolean b1 = true; String s6 = s1 + b1; System.out.println(s6);// Hello World123中国true } }
[ "843291011@qq.com" ]
843291011@qq.com
7b0f30298b7a15f60c4466f8a239175ee1f851de
e49497f1a4c3cc142e16c68090ff232e87e306c3
/app/src/main/java/com/mc/phonelive/dialog/VideoInputDialogFragment.java
cd7f5ca1e4b7ebc8a49a8d82f56ea6e736e926fd
[]
no_license
woshihfh0123/miaocha_gz
2fb03bf1d98d9e838e72315e846825b29b9d09f4
0b427a97c4663bee4698495f88b1d58e78be05d0
refs/heads/main
2023-01-02T07:02:51.180903
2020-10-25T09:58:07
2020-10-25T09:58:07
307,067,453
2
2
null
null
null
null
UTF-8
Java
false
false
10,279
java
package com.mc.phonelive.dialog; import android.app.Dialog; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.text.Editable; import android.text.TextUtils; import android.view.Gravity; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.mc.phonelive.Constants; import com.mc.phonelive.R; import com.mc.phonelive.activity.VideoPlayActivity; import com.mc.phonelive.bean.UserBean; import com.mc.phonelive.bean.VideoBean; import com.mc.phonelive.bean.VideoCommentBean; import com.mc.phonelive.event.VideoCommentEvent; import com.mc.phonelive.http.HttpCallback; import com.mc.phonelive.http.HttpConsts; import com.mc.phonelive.http.HttpUtil; import com.mc.phonelive.utils.DpUtil; import com.mc.phonelive.utils.TextRender; import com.mc.phonelive.utils.ToastUtil; import com.mc.phonelive.utils.WordUtil; import org.greenrobot.eventbus.EventBus; /** * Created by cxf on 2018/12/3. * 视频评论输入框 */ public class VideoInputDialogFragment extends AbsDialogFragment implements View.OnClickListener, ChatFaceDialog.ActionListener { private InputMethodManager imm; private EditText mInput; private boolean mOpenFace; private int mOriginHeight; private int mFaceHeight; private CheckBox mCheckBox; private ChatFaceDialog mChatFaceDialog; private Handler mHandler; private VideoBean mVideoBean; private VideoCommentBean mVideoCommentBean; @Override protected int getLayoutId() { return R.layout.dialog_video_input; } @Override protected int getDialogStyle() { return R.style.dialog2; } @Override protected boolean canCancel() { return true; } @Override protected void setWindowAttributes(Window window) { window.setWindowAnimations(R.style.bottomToTopAnim); WindowManager.LayoutParams params = window.getAttributes(); params.width = WindowManager.LayoutParams.MATCH_PARENT; mOriginHeight = DpUtil.dp2px(48); params.height = mOriginHeight; params.gravity = Gravity.BOTTOM; window.setAttributes(params); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); imm = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); mHandler = new Handler(); mInput = (EditText) mRootView.findViewById(R.id.input); mInput.setOnClickListener(this); mCheckBox = mRootView.findViewById(R.id.btn_face); mCheckBox.setOnClickListener(this); mInput.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_SEND) { sendComment(); return true; } return false; } }); Bundle bundle = getArguments(); if (bundle != null) { mOpenFace = bundle.getBoolean(Constants.VIDEO_FACE_OPEN, false); mFaceHeight = bundle.getInt(Constants.VIDEO_FACE_HEIGHT, 0); mVideoCommentBean = bundle.getParcelable(Constants.VIDEO_COMMENT_BEAN); if (mVideoCommentBean != null) { UserBean replyUserBean = mVideoCommentBean.getUserBean();//要回复的人 if (replyUserBean != null) { mInput.setHint(WordUtil.getString(R.string.video_comment_reply) + replyUserBean.getUserNiceName()); } } } if (mOpenFace) { if (mCheckBox != null) { mCheckBox.setChecked(true); } if (mFaceHeight > 0) { changeHeight(mFaceHeight); if (mHandler != null) { mHandler.postDelayed(new Runnable() { @Override public void run() { showFace(); } }, 200); } } } else { if (mHandler != null) { mHandler.postDelayed(new Runnable() { @Override public void run() { showSoftInput(); } }, 200); } } } public void setVideoBean(VideoBean videoBean) { mVideoBean = videoBean; } private void showSoftInput() { //软键盘弹出 if (imm != null) { imm.showSoftInput(mInput, InputMethodManager.SHOW_FORCED); } if (mInput != null) { mInput.requestFocus(); } } private void hideSoftInput() { if (imm != null) { imm.hideSoftInputFromWindow(mInput.getWindowToken(), 0); } } @Override public void onDestroy() { HttpUtil.cancel(HttpConsts.SET_COMMENT); if (mHandler != null) { mHandler.removeCallbacksAndMessages(null); } mHandler = null; if (mChatFaceDialog != null) { mChatFaceDialog.dismiss(); } mChatFaceDialog = null; super.onDestroy(); } @Override public void onClick(View v) { if (!canClick()) { return; } switch (v.getId()) { case R.id.btn_face: clickFace(); break; case R.id.input: clickInput(); break; } } private void clickInput() { hideFace(); if (mCheckBox != null) { mCheckBox.setChecked(false); } } private void clickFace() { if (mCheckBox.isChecked()) { hideSoftInput(); if (mHandler != null) { mHandler.postDelayed(new Runnable() { @Override public void run() { showFace(); } }, 200); } } else { hideFace(); showSoftInput(); } } private void showFace() { if (mFaceHeight > 0) { changeHeight(mFaceHeight); View faceView = ((VideoPlayActivity) mContext).getFaceView(); if (faceView != null) { mChatFaceDialog = new ChatFaceDialog(mRootView, faceView, false, VideoInputDialogFragment.this); mChatFaceDialog.show(); } } } private void hideFace() { if (mChatFaceDialog != null) { mChatFaceDialog.dismiss(); } } /** * 改变高度 */ private void changeHeight(int deltaHeight) { Dialog dialog = getDialog(); if (dialog == null) { return; } Window window = dialog.getWindow(); if (window == null) { return; } WindowManager.LayoutParams params = window.getAttributes(); params.height = mOriginHeight + deltaHeight; window.setAttributes(params); } @Override public void onFaceDialogDismiss() { changeHeight(0); mChatFaceDialog = null; } /** * 发表评论 */ public void sendComment() { if (mVideoBean == null || mInput == null || !canClick()) { return; } String content = mInput.getText().toString().trim(); if (TextUtils.isEmpty(content)) { ToastUtil.show(R.string.content_empty); return; } String toUid = mVideoBean.getUid(); String commentId = "0"; String parentId = "0"; if (mVideoCommentBean != null) { toUid = mVideoCommentBean.getUid(); commentId = mVideoCommentBean.getCommentId(); parentId = mVideoCommentBean.getId(); } HttpUtil.setComment(toUid, mVideoBean.getId(), content, commentId, parentId, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0 && info.length > 0) { if (mInput != null) { mInput.setText(""); } JSONObject obj = JSON.parseObject(info[0]); String commentNum = obj.getString("comments"); if (mVideoBean != null) { EventBus.getDefault().post(new VideoCommentEvent(mVideoBean.getId(), commentNum)); } ToastUtil.show(msg); dismiss(); ((VideoPlayActivity) mContext).hideCommentWindow(); } } }); } /** * 点击表情上面的删除按钮 */ public void onFaceDeleteClick() { if (mInput != null) { int selection = mInput.getSelectionStart(); String text = mInput.getText().toString(); if (selection > 0) { String text2 = text.substring(selection - 1, selection); if ("]".equals(text2)) { int start = text.lastIndexOf("[", selection); if (start >= 0) { mInput.getText().delete(start, selection); } else { mInput.getText().delete(selection - 1, selection); } } else { mInput.getText().delete(selection - 1, selection); } } } } /** * 点击表情 */ public void onFaceClick(String str, int faceImageRes) { if (mInput != null) { Editable editable = mInput.getText(); editable.insert(mInput.getSelectionStart(), TextRender.getFaceImageSpan(str, faceImageRes)); } } }
[ "529395283@qq.com" ]
529395283@qq.com
1b3a61a628763b90337e087ddcbc87daa1b587ce
6f59151e6f5d8a5b67c1cc520ccef33558451981
/src/calculator/app.java
eaf0ab8143f0bbe67a11060bc1f6dd8cc951a7d2
[]
no_license
byte-exe/calculator-app
af5b6487592a19ef7e2d48a83ca493bd7e227212
a25f1a77b63ca769bafbb0aa2899cf75c5786eb1
refs/heads/master
2023-01-24T14:33:27.496176
2020-11-21T12:58:15
2020-11-21T12:58:15
314,811,253
0
0
null
null
null
null
UTF-8
Java
false
false
21,023
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package calculator; /** * * @author Quinquee */ public class app extends javax.swing.JFrame { /** * Creates new form app */ public app() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); layar = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton(); jButton9 = new javax.swing.JButton(); jButton10 = new javax.swing.JButton(); jButton11 = new javax.swing.JButton(); jButton12 = new javax.swing.JButton(); jButton13 = new javax.swing.JButton(); jButton14 = new javax.swing.JButton(); jButton15 = new javax.swing.JButton(); jButton17 = new javax.swing.JButton(); jButton18 = new javax.swing.JButton(); jButton19 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel2.setBackground(new java.awt.Color(0, 102, 102)); jPanel2.setForeground(new java.awt.Color(51, 255, 255)); jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); layar.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N layar.setHorizontalAlignment(javax.swing.JTextField.RIGHT); jPanel2.add(layar, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 350, 60)); jButton1.setBackground(new java.awt.Color(255, 153, 0)); jButton1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton1.setForeground(new java.awt.Color(0, 255, 51)); jButton1.setText("<--"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel2.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 160, 80, 50)); jButton2.setBackground(new java.awt.Color(255, 153, 0)); jButton2.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton2.setForeground(new java.awt.Color(0, 255, 51)); jButton2.setText("+"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel2.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 160, 80, 50)); jButton3.setBackground(new java.awt.Color(255, 153, 0)); jButton3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton3.setForeground(new java.awt.Color(0, 255, 51)); jButton3.setText("C"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel2.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 160, 80, 50)); jButton4.setBackground(new java.awt.Color(255, 153, 0)); jButton4.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton4.setForeground(new java.awt.Color(0, 255, 51)); jButton4.setText("-"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jPanel2.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 220, 80, 50)); jButton5.setBackground(new java.awt.Color(0, 153, 153)); jButton5.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton5.setForeground(new java.awt.Color(0, 0, 153)); jButton5.setText("9"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jPanel2.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 220, 80, 50)); jButton6.setBackground(new java.awt.Color(0, 153, 153)); jButton6.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton6.setForeground(new java.awt.Color(0, 0, 153)); jButton6.setText("7"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jPanel2.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 220, 80, 50)); jButton7.setBackground(new java.awt.Color(0, 153, 153)); jButton7.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton7.setForeground(new java.awt.Color(0, 0, 153)); jButton7.setText("8"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jPanel2.add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 220, 80, 50)); jButton8.setBackground(new java.awt.Color(255, 153, 0)); jButton8.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton8.setForeground(new java.awt.Color(0, 255, 51)); jButton8.setText("*"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jPanel2.add(jButton8, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 280, 80, 50)); jButton9.setBackground(new java.awt.Color(0, 153, 153)); jButton9.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton9.setForeground(new java.awt.Color(0, 0, 153)); jButton9.setText("6"); jButton9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jPanel2.add(jButton9, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 280, 80, 50)); jButton10.setBackground(new java.awt.Color(0, 153, 153)); jButton10.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton10.setForeground(new java.awt.Color(0, 0, 153)); jButton10.setText("5"); jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jPanel2.add(jButton10, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 280, 80, 50)); jButton11.setBackground(new java.awt.Color(0, 153, 153)); jButton11.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton11.setForeground(new java.awt.Color(0, 0, 153)); jButton11.setText("4"); jButton11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton11ActionPerformed(evt); } }); jPanel2.add(jButton11, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 280, 80, 50)); jButton12.setBackground(new java.awt.Color(255, 153, 0)); jButton12.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton12.setForeground(new java.awt.Color(0, 255, 51)); jButton12.setText("/"); jButton12.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton12ActionPerformed(evt); } }); jPanel2.add(jButton12, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 340, 80, 50)); jButton13.setBackground(new java.awt.Color(0, 153, 153)); jButton13.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton13.setForeground(new java.awt.Color(0, 0, 153)); jButton13.setText("3"); jButton13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton13ActionPerformed(evt); } }); jPanel2.add(jButton13, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 340, 80, 50)); jButton14.setBackground(new java.awt.Color(0, 153, 153)); jButton14.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton14.setForeground(new java.awt.Color(0, 0, 153)); jButton14.setText("2"); jButton14.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton14ActionPerformed(evt); } }); jPanel2.add(jButton14, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 340, 80, 50)); jButton15.setBackground(new java.awt.Color(0, 153, 153)); jButton15.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton15.setForeground(new java.awt.Color(0, 0, 153)); jButton15.setText("1"); jButton15.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton15ActionPerformed(evt); } }); jPanel2.add(jButton15, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 340, 80, 50)); jButton17.setBackground(new java.awt.Color(0, 153, 153)); jButton17.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton17.setForeground(new java.awt.Color(255, 255, 0)); jButton17.setText("="); jButton17.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton17ActionPerformed(evt); } }); jPanel2.add(jButton17, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 400, 170, 50)); jButton18.setBackground(new java.awt.Color(0, 102, 102)); jButton18.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton18.setForeground(new java.awt.Color(0, 0, 153)); jButton18.setText("."); jButton18.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton18ActionPerformed(evt); } }); jPanel2.add(jButton18, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 400, 80, 50)); jButton19.setBackground(new java.awt.Color(0, 153, 153)); jButton19.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N jButton19.setForeground(new java.awt.Color(0, 0, 153)); jButton19.setText("0"); jButton19.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton19ActionPerformed(evt); } }); jPanel2.add(jButton19, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 400, 80, 50)); jLabel2.setFont(new java.awt.Font("Showcard Gothic", 0, 48)); // NOI18N jLabel2.setForeground(new java.awt.Color(51, 255, 255)); jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel2.setText("Calculator"); jPanel2.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 20, -1, -1)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 385, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 464, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed layar.setText(layar.getText()+"0"); }//GEN-LAST:event_jButton19ActionPerformed private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed layar.setText(layar.getText()+"6"); }//GEN-LAST:event_jButton9ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed layar.setText(""); }//GEN-LAST:event_jButton3ActionPerformed private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed layar.setText(layar.getText()+"1"); }//GEN-LAST:event_jButton15ActionPerformed private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed layar.setText(layar.getText()+"2"); }//GEN-LAST:event_jButton14ActionPerformed private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed layar.setText(layar.getText()+"3"); }//GEN-LAST:event_jButton13ActionPerformed private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed layar.setText(layar.getText()+"4"); }//GEN-LAST:event_jButton11ActionPerformed private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed layar.setText(layar.getText()+"5"); }//GEN-LAST:event_jButton10ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed layar.setText(layar.getText()+"7"); }//GEN-LAST:event_jButton6ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed layar.setText(layar.getText()+"8"); }//GEN-LAST:event_jButton7ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed layar.setText(layar.getText()+"9"); }//GEN-LAST:event_jButton5ActionPerformed private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed layar.setText(layar.getText()+"."); }//GEN-LAST:event_jButton18ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed layar.setText(layar.getText()+"-"); layar.setText(""); calculate=2; }//GEN-LAST:event_jButton4ActionPerformed private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed num=Double.parseDouble(layar.getText()); layar.setText(""); calculate=3; }//GEN-LAST:event_jButton8ActionPerformed private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed num=Double.parseDouble(layar.getText()); layar.setText(""); calculate=4; }//GEN-LAST:event_jButton12ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed num=Double.parseDouble(layar.getText()); layar.setText(""); calculate=1; }//GEN-LAST:event_jButton2ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed int length = layar.getText().length(); int number = layar.getText().length()-1; String store; if (length>0){ StringBuilder back = new StringBuilder(layar.getText()); back.deleteCharAt(number); store=back.toString(); layar.setText(store); } }//GEN-LAST:event_jButton1ActionPerformed private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed result(); }//GEN-LAST:event_jButton17ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(app.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(app.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(app.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(app.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new app().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton10; private javax.swing.JButton jButton11; private javax.swing.JButton jButton12; private javax.swing.JButton jButton13; private javax.swing.JButton jButton14; private javax.swing.JButton jButton15; private javax.swing.JButton jButton17; private javax.swing.JButton jButton18; private javax.swing.JButton jButton19; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel2; private javax.swing.JTextField layar; // End of variables declaration//GEN-END:variables double num,ans; int calculate; private void result(){ switch(calculate){ case 1: ans = num+Double.parseDouble(layar.getText()); layar.setText(Double.toString(ans)); break; case 2: ans = num-Double.parseDouble(layar.getText()); layar.setText(Double.toString(ans)); break; case 3: ans = num*Double.parseDouble(layar.getText()); layar.setText(Double.toString(ans)); break; case 4: ans = num/Double.parseDouble(layar.getText()); layar.setText(Double.toString(ans)); break; } } }
[ "58006737+byte-exe@users.noreply.github.com" ]
58006737+byte-exe@users.noreply.github.com
5988d22eb7b26f3ad83df93990a62b3dbe212231
ffa16073891a43bfe69d0e0f14be33e687e341d6
/src/skillp1/array/_252_MeetingRooms.java
bd3d5150e5eba11b862ca6b92fe35f6f55e34a3e
[]
no_license
xuchengyun/cspir
1abc78ae28aa5a359e92375079a5f7e57a34dee8
547119ab3a02c6106e9118369761c42cebd6eff7
refs/heads/master
2020-07-01T19:06:53.655115
2019-08-16T16:28:33
2019-08-16T16:28:33
201,266,373
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
package skillp1.array; import java.util.Arrays; public class _252_MeetingRooms { public boolean canAttendMeeting(Interval[] intervals) { Arrays.sort(intervals, (x, y) -> x.start - y.start); for (int i = 1; i < intervals.length; i++) { if (intervals[i - 1].end > intervals[i].start) { return false; } } return true; } }
[ "454166448@qq.com" ]
454166448@qq.com
a7f82a7d45f683d3d96308fae98d1f8c89c314da
3bb9e1a187cb72e2620a40aa208bf94e5cee46f5
/mobile_catalog/src/ong/eu/soon/mobile/json/ifx/element/BidOffer.java
60102b5f5fd2da5c212de19ac2524e4157911f43
[]
no_license
eusoon/Mobile-Catalog
2e6f766864ea25f659f87548559502358ac5466c
869d7588447117b751fcd1387cd84be0bd66ef26
refs/heads/master
2021-01-22T23:49:12.717052
2013-12-10T08:22:20
2013-12-10T08:22:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
187
java
package ong.eu.soon.mobile.json.ifx.element; import ong.eu.soon.mobile.json.ifx.basetypes.IFXString; public class BidOffer extends IFXString { protected BidOffer(){ } }
[ "eusoon@gmail.com" ]
eusoon@gmail.com
2d1bc08e36e21b650886817c4fce78d4d306ec02
e64535b03b14e5869a5d7e59eb7de58a3002ab4d
/ARK/src/main/java/kr/icia/domain/CollVO.java
59638ca2227e07c8f1f7a6f59666a3d900330e3b
[]
no_license
see5456998/ark
941a5fffaec7529fa291138cde2dcf186e194a1f
3049099988fd128e091a500f1eabff5296cdbe6f
refs/heads/master
2022-12-21T11:26:38.249984
2019-11-25T02:54:01
2019-11-25T02:54:01
223,846,223
0
0
null
2022-11-16T12:37:01
2019-11-25T02:29:23
CSS
UTF-8
Java
false
false
154
java
package kr.icia.domain; import lombok.Data; @Data public class CollVO { public String id; public StatusVO status; public String coll; }
[ "see5456998@naver.com" ]
see5456998@naver.com
2d324af4b18c27aa3be895bb0de69c0d0137396d
5d000288a2dc2339fe59d94d02b493ece326882b
/crawler-common/src/test/java/com/zxsoft/crawler/util/URLFormatterTest.java
4f40bb2af69e32b4e1ccb9bb01a8258954d2b6ae
[]
no_license
wgybzbrobot/crawler
f5d4852d92185736d101532c9991dcbe4aee5875
ce011d242781e179f7ca08afeb524b12583beee9
refs/heads/develop
2022-12-27T12:47:44.596551
2015-07-26T04:56:39
2015-07-26T04:56:39
39,678,152
1
7
null
2022-12-16T01:40:58
2015-07-25T08:39:29
Java
UTF-8
Java
false
false
863
java
package com.zxsoft.crawler.util; import java.io.UnsupportedEncodingException; import org.junit.Test; public class URLFormatterTest { @Test public void test0() throws UnsupportedEncodingException { String url = "http://www.soubao.net/search/searchList.aspx" + "?startdate=%tY%tm%td&enddate=%tY%tm%td"; url = URLFormatter.format(url); System.out.println(url); } @Test public void test1() throws UnsupportedEncodingException { String url = "http://www.soubao.net/search/searchList.aspx" + "?keyword=%s&startdate=%tY%tm%td&enddate=%tY%tm%td"; url = URLFormatter.format(url, "中国"); System.out.println(url); } }
[ "xiayun@zxisl.com" ]
xiayun@zxisl.com
e176e26f214774cc348ead604806bfe6cd718e4a
30230e26a9de2da64556a3e44f7c192105478b38
/WebContent/WEB-INF/res/eg/edu/alexu/csd/datastructure/test/linkedList/SolverIntegrationTest.java
1a9cc7b8b0c5538dfae036e505642959c9ec6094
[]
no_license
shehabEl-semmany/onlinetester
671fb608ed00e2353a8df925d6e30056c7a6adcc
1cb8183ef7020b5ed3867af391b209dc724b27a1
refs/heads/master
2020-03-30T19:17:05.207454
2018-10-04T07:51:48
2018-10-04T07:51:48
151,536,118
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
package eg.edu.alexu.csd.datastructure.test.linkedList; import static org.junit.Assert.*; import eg.edu.alexu.csd.TestRunner; import eg.edu.alexu.csd.datastructure.linkedList.IPolynomialSolver; public class SolverIntegrationTest { public static Class<?> getSpecifications(){ return IPolynomialSolver.class; } @org.junit.Test(timeout = 1000) public void testCreation() { IPolynomialSolver instance = (IPolynomialSolver)TestRunner.getImplementationInstance(); assertNotNull("Failed to create Engine using '" + getSpecifications().getName() + "' !", instance); } }
[ "shehabelsemany@gmail.com" ]
shehabelsemany@gmail.com
25e54295863e2f167f06caad03ba56f69c7c4567
97524f5559a53e151719ad2099e092c09ee8d30b
/02_FONTES/core/seguranca-core/src/test/java/br/gov/to/sefaz/seg/business/general/service/validator/PapelSistemaCannotHaveEmptyOptionListValidatorTest.java
b1fc17b275bd4b7f4b6f97d86393fd2979b96d51
[]
no_license
fredsilva/sistema
46a4809e96b016f733c715da3c8f57e47996ccbd
14dad24f7be8561611d3cdf5d7a8460b1c4300f6
refs/heads/master
2021-01-12T04:40:34.493234
2016-12-20T14:44:51
2016-12-20T14:44:51
77,699,605
0
0
null
null
null
null
UTF-8
Java
false
false
2,187
java
package br.gov.to.sefaz.seg.business.general.service.validator; import br.gov.to.sefaz.business.service.validation.ValidationContext; import br.gov.to.sefaz.business.service.validation.violation.CustomViolation; import br.gov.to.sefaz.seg.business.gestao.service.validator.PapelSistemaCannotHaveEmptyOptionListValidator; import br.gov.to.sefaz.seg.persistence.entity.PapelSistema; import br.gov.to.sefaz.util.message.SourceBundle; import org.apache.commons.lang3.StringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.util.HashSet; import java.util.Set; import static org.junit.Assert.assertFalse; import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; /** * Teste da classe * {@link br.gov.to.sefaz.seg.business.gestao.service.validator.PapelSistemaCannotHaveEmptyOptionListValidator}. * * @author <a href="mailto:thiago.luz@ntconsult.com.br">thiago.luz</a> * @since 15/08/2016 11:09:00 */ @RunWith(PowerMockRunner.class) @PrepareForTest(SourceBundle.class) public class PapelSistemaCannotHaveEmptyOptionListValidatorTest { @Mock private PapelSistema papelSistema; @InjectMocks private PapelSistemaCannotHaveEmptyOptionListValidator validator; @Before public void setUp() { mockStatic(SourceBundle.class); } @Test public void shouldFailSupportWhenClassIsNotPapelSistema() { // then assertFalse(validator.support(Object.class, ValidationContext.SAVE)); } @Test public void shouldFailSupportWhenContextNotExists() { // then assertFalse(validator.support(PapelSistema.class, StringUtils.EMPTY)); } @Test public void shouldFailWhenPapelHaveEmptyOptionList() { // when when(papelSistema.getPapelOpcao()).thenReturn(new HashSet<>()); // then Set<CustomViolation> violationSet = validator.validate(papelSistema); assertFalse(violationSet.isEmpty()); } }
[ "cristiano.luis@ntconsult.com.br" ]
cristiano.luis@ntconsult.com.br
28f1ebfbccf31a21ac8b1a4851cd63758c6c600c
626cfcb49c43494fe4086f0702726d7307001e3d
/src/main/java/com/baizhi/entity/User.java
f69ad529cf45116968bd33b8f4aa013d190926e6
[]
no_license
liuhui199/cmfz_star
dd95c2bb7acd00aaf01949e059461b99521d95ab
6dd25afe75a4de28b6d3bf260cf44b8df33b8f82
refs/heads/master
2023-03-07T19:38:39.094362
2019-11-12T08:49:11
2019-11-12T08:49:11
220,000,950
0
0
null
2023-02-22T02:51:55
2019-11-06T13:16:47
JavaScript
UTF-8
Java
false
false
1,242
java
package com.baizhi.entity; import cn.afterturn.easypoi.excel.annotation.Excel; import com.alibaba.fastjson.annotation.JSONField; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.format.annotation.DateTimeFormat; import javax.persistence.Id; import java.io.Serializable; import java.util.Date; @Data @AllArgsConstructor @NoArgsConstructor public class User implements Serializable { @Id @Excel(name = "编号") private String id; @Excel(name = "电话") private String phone; //电话 @Excel(name = "用户名") private String username; //用户名 @Excel(name = "用户密码") private String password; //用户密码 private String salt; //盐 @Excel(name = "昵称") private String nickname; //昵称 @Excel(name = "省") private String province; //省 @Excel(name = "城市") private String city; //城市 private String sign; //签名 private String photo; //头像 @Excel(name = "性别") private String sex; //性别 @JSONField(format = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") private Date createDate; //上传日期 private String starId; //明星id }
[ "lh15882214810@.com" ]
lh15882214810@.com
1e4473810e3e1dbe96e944a75cb9a9ea3505a458
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/workspace/src/main/java/com/huaweicloud/sdk/workspace/v2/model/ApplyDesktopsInternetResponse.java
8fcad485781e5c3fdb21a91cf4f600711a245616
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
1,801
java
package com.huaweicloud.sdk.workspace.v2.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.huaweicloud.sdk.core.SdkResponse; import java.util.Objects; /** * Response Object */ public class ApplyDesktopsInternetResponse extends SdkResponse { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "job_id") private String jobId; public ApplyDesktopsInternetResponse withJobId(String jobId) { this.jobId = jobId; return this; } /** * 任务id。 * @return jobId */ public String getJobId() { return jobId; } public void setJobId(String jobId) { this.jobId = jobId; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ApplyDesktopsInternetResponse that = (ApplyDesktopsInternetResponse) obj; return Objects.equals(this.jobId, that.jobId); } @Override public int hashCode() { return Objects.hash(jobId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ApplyDesktopsInternetResponse {\n"); sb.append(" jobId: ").append(toIndentedString(jobId)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
49959987760d1af4d6c3a531a93d54ef44519cd0
8c44f8358b60c52a2722948a59dacb1d912ca006
/app/src/main/java/com/lori/ui/activity/LauncherActivity.java
c23b9bcadd5607d0859e5a793a9bb39133d5f29b
[ "Apache-2.0" ]
permissive
Ubhadiyap/lori-timesheets-android
48aee73c3022f20d90594ae6ce867119e62803e9
91c771c68f1263d163e2e0848bf5f026a6e6126c
refs/heads/master
2021-01-11T17:27:15.675380
2017-01-02T16:51:35
2017-01-02T16:51:35
79,770,349
1
0
null
2017-01-23T04:33:50
2017-01-23T04:33:50
null
UTF-8
Java
false
false
330
java
package com.lori.ui.activity; import com.lori.ui.base.BaseActivity; import com.lori.ui.presenter.LauncherActivityPresenter; import nucleus.factory.RequiresPresenter; /** * @author artemik */ @RequiresPresenter(LauncherActivityPresenter.class) public class LauncherActivity extends BaseActivity<LauncherActivityPresenter> { }
[ "temanovikov@gmail.com" ]
temanovikov@gmail.com
a61eb4c1fe2ffa76a95f5e9f8314c98a6605c24e
0386d34b1aed902ce5f9327a5389b871d7af0c82
/app/src/androidTest/java/com/example/rekin_biznesu/ExampleInstrumentedTest.java
3d813172b0a6ee514e0bd9b1a3b068d05a36656e
[]
no_license
trycja/RachunekZS
2be31937427be7d3b63ad6bad9f64b51bd4a9919
a08e02991755a0dd18ac5dbd6296ccf5b028aa99
refs/heads/master
2021-01-22T11:21:43.083891
2017-05-28T21:54:29
2017-05-28T21:54:29
92,688,400
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package com.example.rekin_biznesu; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.rekin_biznesu", appContext.getPackageName()); } }
[ "protoooli@gmail.com" ]
protoooli@gmail.com
2d35207b5b2931ce01057ba7716f24ef9dc29256
b020e8d8e0d65557e0b8f8b08d8e423abb1f585c
/src/test/java/lapr/project/model/OrganizadorTest.java
737656cc412939fea5569ad64c90fbb9a2ce6a5f
[]
no_license
1150650/lapr
b1a58f48eba5386703d91fa27fdd6ee94f787345
3c28807949b5c12b006da651779632cb2d8c0803
refs/heads/master
2021-01-17T00:38:44.412451
2016-06-27T19:07:06
2016-06-27T19:07:06
62,127,638
0
0
null
null
null
null
UTF-8
Java
false
false
1,442
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lapr.project.model; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; /** * * @author JOAO */ public class OrganizadorTest { public OrganizadorTest() { } @BeforeClass public static void setUpClass() { } @AfterClass public static void tearDownClass() { } /** * Test of getUtilizador method, of class Organizador. */ @Test public void testGetUtilizador() { System.out.println("getUtilizador"); Utilizador utilizador = new Utilizador(); utilizador.setNome("asdfgh"); Organizador instance = new Organizador(); instance.setUtilizador(utilizador); Utilizador expResult = utilizador; Utilizador result = instance.getUtilizador(); assertEquals(expResult, result); } /** * Test of setUtilizador method, of class Organizador. */ @Test public void testSetUtilizador() { System.out.println("setUtilizador"); Utilizador utilizador = new Utilizador(); utilizador.setNome("asdfgh"); Organizador instance = new Organizador(); instance.setUtilizador(utilizador); } }
[ "1150479@isep.ipp.pt" ]
1150479@isep.ipp.pt
7e5631ad294e2ec39f006d698fa44277a32708fb
a4a1685b691714c365e3faf30afce5fcdd99344c
/src/main/java/org/kafkahq/modules/KafkaWrapper.java
5c01d5e3cec21fd83b71a404dec5d5891ef2fcfd
[ "Apache-2.0" ]
permissive
sabinchirila/kafkahq
54d02b4661e7d04cccdc5783e59c545e06df85d9
f4b5c5efe6bdef35627da93e3779f9e69a28c8c9
refs/heads/master
2020-08-02T11:50:25.120339
2019-07-01T19:45:19
2019-07-04T19:09:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,953
java
package org.kafkahq.modules; import org.apache.kafka.clients.admin.*; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.consumer.OffsetAndMetadata; import org.apache.kafka.common.Node; import org.apache.kafka.common.TopicPartition; import org.apache.kafka.common.config.ConfigResource; import org.apache.kafka.common.requests.DescribeLogDirsResponse; import org.kafkahq.models.Partition; import org.kafkahq.utils.Lock; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import static java.util.stream.Collectors.*; public class KafkaWrapper { private KafkaModule kafkaModule; private String clusterId; public KafkaWrapper(KafkaModule kafkaModule, String clusterId) { this.kafkaModule = kafkaModule; this.clusterId = clusterId; } private DescribeClusterResult cluster; public DescribeClusterResult describeCluster() throws ExecutionException, InterruptedException { if (this.cluster == null) { this.cluster = Lock.call(() -> { DescribeClusterResult cluster = kafkaModule.getAdminClient(clusterId).describeCluster(); cluster.clusterId().get(); cluster.nodes().get(); cluster.controller().get(); return cluster; }, "Cluster", null); } return this.cluster; } private Collection<TopicListing> listTopics; public Collection<TopicListing> listTopics() throws ExecutionException, InterruptedException { if (this.listTopics == null) { this.listTopics = Lock.call( () -> kafkaModule.getAdminClient(clusterId).listTopics( new ListTopicsOptions().listInternal(true) ).listings().get(), "List topics", null ); } return this.listTopics; } private Map<String, TopicDescription> describeTopics = new ConcurrentHashMap<>(); public Map<String, TopicDescription> describeTopics(List<String> topics) throws ExecutionException, InterruptedException { List<String> list = new ArrayList<>(topics); list.removeIf(value -> this.describeTopics.containsKey(value)); if (list.size() > 0) { Map<String, TopicDescription> description = Lock.call( () -> kafkaModule.getAdminClient(clusterId) .describeTopics(list) .all() .get(), "Describe Topics {}", topics ); this.describeTopics.putAll(description); } return this.describeTopics .entrySet() .stream() .filter(e -> topics.contains(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } private Map<String, List<Partition.Offsets>> describeTopicsOffsets = new ConcurrentHashMap<>(); public Map<String, List<Partition.Offsets>> describeTopicsOffsets(List<String> topics) throws ExecutionException, InterruptedException { List<String> list = new ArrayList<>(topics); list.removeIf(value -> this.describeTopicsOffsets.containsKey(value)); if (list.size() > 0) { Map<String, List<Partition.Offsets>> finalOffsets = Lock.call( () -> { List<TopicPartition> collect = this.describeTopics(topics).entrySet() .stream() .flatMap(topicDescription -> topicDescription .getValue() .partitions() .stream() .map(topicPartitionInfo -> new TopicPartition(topicDescription.getValue().name(), topicPartitionInfo.partition()) ) ) .collect(Collectors.toList()); KafkaConsumer<byte[], byte[]> consumer = kafkaModule.getConsumer(clusterId); Map<TopicPartition, Long> begins = consumer.beginningOffsets(collect); Map<TopicPartition, Long> ends = consumer.endOffsets(collect); consumer.close(); return begins.entrySet().stream() .collect(groupingBy( o -> o.getKey().topic(), mapping( begin -> new Partition.Offsets( begin.getKey().partition(), begin.getValue(), ends.get(begin.getKey()) ), toList() ) )); }, "Describe Topics Offsets {}", topics ); this.describeTopicsOffsets.putAll(finalOffsets); } return this.describeTopicsOffsets .entrySet() .stream() .filter(e -> topics.contains(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } private Collection<ConsumerGroupListing> listConsumerGroups; public Collection<ConsumerGroupListing> listConsumerGroups() throws ExecutionException, InterruptedException { if (this.listConsumerGroups == null) { this.listConsumerGroups = Lock.call( () -> kafkaModule.getAdminClient(clusterId).listConsumerGroups().all().get(), "List ConsumerGroups", null ); } return this.listConsumerGroups; } private Map<String, ConsumerGroupDescription> describeConsumerGroups = new ConcurrentHashMap<>(); public Map<String, ConsumerGroupDescription> describeConsumerGroups(List<String> topics) throws ExecutionException, InterruptedException { List<String> list = new ArrayList<>(topics); list.removeIf(value -> this.describeConsumerGroups.containsKey(value)); if (list.size() > 0) { Map<String, ConsumerGroupDescription> description = Lock.call( () -> kafkaModule.getAdminClient(clusterId) .describeConsumerGroups(list) .all() .get(), "Describe ConsumerGroups {}", topics ); this.describeConsumerGroups.putAll(description); } return this.describeConsumerGroups .entrySet() .stream() .filter(e -> topics.contains(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } private Map<String, Map<TopicPartition, OffsetAndMetadata>> consumerGroupOffset = new ConcurrentHashMap<>(); public Map<TopicPartition, OffsetAndMetadata> consumerGroupsOffsets(String groupId) throws ExecutionException, InterruptedException { if (!this.consumerGroupOffset.containsKey(groupId)) { Map<TopicPartition, OffsetAndMetadata> description = Lock.call( () -> kafkaModule.getAdminClient(clusterId) .listConsumerGroupOffsets(groupId) .partitionsToOffsetAndMetadata() .get(), "ConsumerGroup Offsets {}", Collections.singletonList(groupId) ); this.consumerGroupOffset.put(groupId, description); } return this.consumerGroupOffset.get(groupId); } private Map<Integer, Map<String, DescribeLogDirsResponse.LogDirInfo>> logDirs; public Map<Integer, Map<String, DescribeLogDirsResponse.LogDirInfo>> describeLogDir() throws ExecutionException, InterruptedException { if (this.logDirs == null) { this.logDirs = Lock.call(() -> kafkaModule.getAdminClient(clusterId) .describeLogDirs(this.describeCluster().nodes().get() .stream() .map(Node::id) .collect(Collectors.toList()) ) .all() .get(), "List Log dir", null ); } return this.logDirs; } private Map<ConfigResource, Config> describeConfigs = new ConcurrentHashMap<>(); public void clearConfigCache() { this.describeConfigs = new ConcurrentHashMap<>(); } public Map<ConfigResource, Config> describeConfigs(ConfigResource.Type type, List<String> names) throws ExecutionException, InterruptedException { List<String> list = new ArrayList<>(names); list.removeIf((value) -> this.describeConfigs.entrySet() .stream() .filter(entry -> entry.getKey().type() == type) .anyMatch(entry -> entry.getKey().name().equals(value)) ); if (list.size() > 0) { Map<ConfigResource, Config> description = Lock.call(() -> kafkaModule.getAdminClient(clusterId) .describeConfigs(list.stream() .map(s -> new ConfigResource(type, s)) .collect(Collectors.toList()) ) .all() .get(), "Describe Topic Config {}", names ); this.describeConfigs.putAll(description); } return this.describeConfigs .entrySet() .stream() .filter(e -> e.getKey().type() == type) .filter(e -> names.contains(e.getKey().name())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); } }
[ "tchiot.ludo@gmail.com" ]
tchiot.ludo@gmail.com
391f7f78c7d19f872a2f651fcb92fda8842aa4bf
bfe555829c44521696bab62ebc5e374698f74cfe
/webapi-sponge/src/main/java/valandur/webapi/serialize/view/data/ExpOrbDataView.java
b1334807f6cfd8cca4d9f31534787a3d39686e95
[ "MIT" ]
permissive
jxsd1234a/Web-API
464b38a909d2349d7ac1a655d3f93861f3c4334c
8ec9e41e58b6655adfd1343069dccc3feb1469c4
refs/heads/master
2022-11-10T14:53:37.403195
2020-07-01T02:51:40
2020-07-01T02:51:40
267,387,574
0
0
MIT
2020-05-27T17:46:23
2020-05-27T17:46:22
null
UTF-8
Java
false
false
433
java
package valandur.webapi.serialize.view.data; import com.fasterxml.jackson.annotation.JsonValue; import org.spongepowered.api.data.manipulator.mutable.entity.ExpOrbData; import valandur.webapi.serialize.BaseView; public class ExpOrbDataView extends BaseView<ExpOrbData> { @JsonValue public int exp; public ExpOrbDataView(ExpOrbData value) { super(value); this.exp = value.experience().get(); } }
[ "inithilian@gmail.com" ]
inithilian@gmail.com
5fe2744487bfc0acf43336965a744a773884f50a
dbd2386bdd201664eeec4889adac5b96beab6449
/src/main/java/it/flowzz/ultimatetowny/commands/impl/subcommands/TownDisband.java
b1e4ab195cc7901fd34f74ff3e032b7863679c26
[]
no_license
drevrena/Ultimate-Towny
8859296bc4eb2fab5871145a99649cff81570aa7
64d4803800c341c4e4e125b148d4f1d7cb157d65
refs/heads/master
2023-08-10T19:12:31.742634
2021-10-02T12:09:09
2021-10-02T12:09:09
411,566,375
0
0
null
null
null
null
UTF-8
Java
false
false
2,184
java
package it.flowzz.ultimatetowny.commands.impl.subcommands; import it.flowzz.ultimatetowny.commands.SubCommand; import it.flowzz.ultimatetowny.enums.Role; import it.flowzz.ultimatetowny.lang.Messages; import it.flowzz.ultimatetowny.models.Town; import it.flowzz.ultimatetowny.models.TownyPlayer; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import java.util.Collections; import java.util.List; public class TownDisband extends SubCommand { public TownDisband() { super("disband", "/town disband"); } @Override public void execute(CommandSender sender, String label, String[] args) { if (sender instanceof Player player) { TownyPlayer townyPlayer = plugin.getTownHandler().getPlayers().get(player.getUniqueId()); Town town = plugin.getTownHandler().getTowns().get(townyPlayer.getTownId()); if (town == null) { sender.sendMessage(Messages.NOT_IN_TOWN.getTranslation()); return; } if (townyPlayer.getRole() != Role.LEADER) { sender.sendMessage(Messages.NOT_LEADER.getTranslation()); return; } for (TownyPlayer townPlayer : town.getPlayers()) { townPlayer.setTownId(null); townPlayer.setPlaytime(0); townPlayer.setRole(Role.MEMBER); } broadcast(Messages.TOWN_DISBANDED.getTranslation() .replace("%player%", player.getName()) .replace("%town%", town.getName()) ); plugin.getTownHandler().getTowns().remove(town.getName()); plugin.getTownHandler().getTopPlaytime().remove(town); plugin.getTownHandler().getTopTowns().remove(town); plugin.getDatabase().deleteTown(town.getName()); } else { sender.sendMessage(Messages.COMMAND_ONLY_PLAYER.getTranslation()); } } @Override public List<String> tabComplete(CommandSender sender, String[] args) { return Collections.emptyList(); } @Override public int getMinArguments() { return 0; } }
[ "lilflowz99@gmail.com" ]
lilflowz99@gmail.com
4b9327cd611a564d5df7a5a2314d2105f5db72e1
85e87053bef4e8c1668ccc797c87a57a63ecb5e7
/app/src/main/java/io/apicurio/registry/rules/compatibility/jsonschema/wrapper/BooleanSchemaWrapper.java
d658e10c63f3ee73487e9f841bc5531ac808ba8b
[ "Apache-2.0" ]
permissive
meroxa/apicurio-registry
2bc125d5cdb0b467f79a773cd1b80f3669436363
9008ff33e08ee966ad954a5fa50be12e574241cf
refs/heads/master
2022-10-10T11:25:29.646413
2022-10-03T16:09:12
2022-10-03T16:09:12
258,359,854
0
0
Apache-2.0
2022-10-03T16:09:13
2020-04-24T00:00:13
Java
UTF-8
Java
false
false
1,350
java
/* * Copyright 2019 Red Hat * * 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.apicurio.registry.rules.compatibility.jsonschema.wrapper; import io.apicurio.registry.rules.compatibility.jsonschema.JsonSchemaWrapperVisitor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; import org.everit.json.schema.BooleanSchema; /** * @author Jakub Senko <jsenko@redhat.com> */ @EqualsAndHashCode(onlyExplicitlyIncluded = true) @ToString public class BooleanSchemaWrapper implements SchemaWrapper { @Getter @EqualsAndHashCode.Include private final BooleanSchema wrapped; public BooleanSchemaWrapper(BooleanSchema wrapped) { this.wrapped = wrapped; } @Override public void accept(JsonSchemaWrapperVisitor visitor) { visitor.visitBooleanSchema(this); } }
[ "noreply@github.com" ]
noreply@github.com
59e464d68ce0ba53c9f208b4809562d98009b633
a841d3c21395168f761656293d45c71f924b98fd
/hybris/bin/custom/johndeere/johndeerecockpits/src/com/deere/cockpits/cmscockpit/browser/filters/DesktopUiExperienceBrowserFilter.java
280cb092208fa704c5ad95623388d22bcdf405e9
[]
no_license
vinayj344/johndeere
7add3c82175159d56a84538441c3f6ec49115e0e
cbf87ca7d3dd012214f01a0d5de60c69e8e508db
refs/heads/master
2020-03-26T16:29:55.733222
2018-08-22T13:43:49
2018-08-22T13:43:49
145,105,874
0
0
null
2018-08-22T13:43:50
2018-08-17T10:14:04
Java
UTF-8
Java
false
false
1,056
java
/* * [y] hybris Platform * * Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.deere.cockpits.cmscockpit.browser.filters; import de.hybris.platform.cockpit.model.search.Query; import de.hybris.platform.util.localization.Localization; public class DesktopUiExperienceBrowserFilter extends AbstractUiExperienceFilter { private static final String DESKTOP_UI_EXPERIENCE_LABEL_KEY = "desktop.ui.experience.label.key"; @Override public boolean exclude(final Object item) { return false; } @Override public void filterQuery(final Query query) { //empty because DESKTOP pages are displayed as default } @Override public String getLabel() { return Localization.getLocalizedString(DESKTOP_UI_EXPERIENCE_LABEL_KEY); } }
[ "vinay.j344@gmail.com" ]
vinay.j344@gmail.com
983a4939568dc1a38f7caf9595847597049fb24b
c3be038003db8861dd685bddbb753ba76f15085d
/src/in/sudoku/gui/GameSettingsActivity.java
23fdddb309481a54bd59e45dc0219fa30e004191
[]
no_license
hanjing5/android-game-sudoku
7eb0ddb9a89faa01ff9feee20a545f89b130f7f6
cca9da102644b6d5d1481460395a9a40cd6e3e92
refs/heads/master
2021-01-01T15:59:43.411651
2012-08-06T04:17:41
2012-08-06T04:17:41
5,310,027
1
1
null
null
null
null
UTF-8
Java
false
false
1,629
java
/* * Copyright (C) 2009 Roman Masek * * This file is part of OpenSudoku. * * OpenSudoku 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. * * OpenSudoku 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 OpenSudoku. If not, see <http://www.gnu.org/licenses/>. * */ package in.sudoku.gui; import in.sudoku.R; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.Preference.OnPreferenceChangeListener; public class GameSettingsActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.game_settings); findPreference("show_hints").setOnPreferenceChangeListener(mShowHintsChanged); } private OnPreferenceChangeListener mShowHintsChanged = new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { boolean newVal = (Boolean)newValue; HintsQueue hm = new HintsQueue(GameSettingsActivity.this); if (newVal) { hm.resetOneTimeHints(); }; return true; } }; }
[ "hjing@walmartlabs.com" ]
hjing@walmartlabs.com
19b019628b90822ccc7e8d09dcecdbcc985d1d5e
3d871e8437333d18b3a1f7782541f28c68498540
/java-projects/src/inh/Konto.java
cd28d64b9e11b960c926f36531d6e381299f7edd
[]
no_license
Kory291/Java-projects
027b273dee75f78526117b55bc6b46d3a6626f62
a0ac4cf71723c5ae64e72db0e7d666c892fcec39
refs/heads/main
2023-07-20T17:02:30.058693
2021-06-21T20:10:46
2021-06-21T20:10:46
363,902,976
0
0
null
null
null
null
UTF-8
Java
false
false
1,153
java
package inh; public class Konto { private int kontoNummer; protected double kontoStand; static int maxNr = 0; String inhaber; public double getKontoStand() { return kontoStand; } Konto(double s) { this.kontoNummer = ++Konto.maxNr; kontoStand = s; this.inhaber = "KontoInhaber"; } public double auszahlen (double betrag) { if ((betrag>0) && (this.kontoStand >=betrag)) { this.kontoStand -= betrag; return betrag; } return 0d; } public double einzahlen (double betrag) { if (betrag>0) { this.kontoStand += betrag; return betrag; } return 0d; } @Override public String toString() { // TODO Auto-generated method stub return super.toString(); } public static void main(String[] args) { Girokonto g = new Girokonto(100, 2.5f, 1d); g.verzinsen(); g.auszahlen(50); g.toString(); ((Konto)g).auszahlen(10); System.out.println("--"); } }
[ "noreply@github.com" ]
noreply@github.com
9789e83ed9aa0dee6ed4d5eaa5725d02ed916ee1
b82e24d5cc3dc33c814f13dcef0d347cd1bf059d
/src/main/java/org/sdrc/usermgmt/core/annotations/EnableUserManagementWithOauth2JPATokenStore.java
b289ec3e67564d8cb2d1da1ff9931931dae307fa
[]
no_license
SDRC-India/usermgmtmodule
08dff3c2f1f3f49cbd461346b32f3da25389fe17
e63190ed6273bec280505e0b18ec121c89e33464
refs/heads/master
2020-04-10T15:59:50.142208
2018-12-10T06:46:31
2018-12-10T06:46:31
161,129,739
0
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
package org.sdrc.usermgmt.core.annotations; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.ComponentScan; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; /** * @author Subham Ashish(subham@sdrc.co.in) * * This annotation enables spring security OAUTH2 authentication, * And USERMANAGEMENT * * Database used SQL * */ @Target(ElementType.TYPE) @Documented @Retention(RetentionPolicy.RUNTIME) @EntityScan(basePackages = "org.sdrc.usermgmt.domain") @EnableJpaRepositories(basePackages = { "org.sdrc.usermgmt.repository" }) @ComponentScan(basePackages = { "org.sdrc.usermgmt.service", "org.sdrc.JPAtokenstrore","org.sdrc.usermgmt.controller" }) public @interface EnableUserManagementWithOauth2JPATokenStore { }
[ "ratikanta@sdrc.co.in" ]
ratikanta@sdrc.co.in
53223a8f8b1d2fe720ae25db62a404aeaf4cde9d
9e6cb52ae34d5a880a33b53ff34b63d571fb9185
/src/io/tooko/vue/antd/AntLiveTemplatesProvider.java
998bb567c15b0cd62aacf7a0b9f511adb8c2e83e
[]
no_license
legalism/webstorm-ant-design-vue-plugin
59ec7f7b3e622beefa4e6a369912517e4af674ae
a589d5e850289416b2f5f7b546af24f0d1ecfe93
refs/heads/master
2021-10-27T14:02:10.916131
2019-04-17T17:13:58
2019-04-17T17:13:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
505
java
package io.tooko.vue.antd; import com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider; import org.jetbrains.annotations.Nullable; /** * 显示 API 代码模板 * * @author Sendya */ public class AntLiveTemplatesProvider implements DefaultLiveTemplatesProvider { @Override public String[] getDefaultLiveTemplateFiles() { return new String[]{ "antd" }; } @Nullable @Override public String[] getHiddenLiveTemplateFiles() { return null; } }
[ "18x@loacg.com" ]
18x@loacg.com
9c35349e587e700ecdb65c682253311257593113
6ca8e1bf31562244071cd2713ff700f78ddd7f56
/src/main/java/io/cabos/dbflute/cbean/cq/bs/AbstractBsMemberServiceCQ.java
50611c745792f4b58a221c65674452aed07fef9d
[ "Apache-2.0" ]
permissive
EgumaYuto/cabosapp
9ee6b7aab11f2eb4759486ee93182d733062fef2
9d444e1386caadd71a4a132fd823236efdea2936
refs/heads/master
2023-03-09T04:04:08.658861
2021-12-31T18:55:35
2021-12-31T18:55:35
194,944,912
0
0
Apache-2.0
2023-02-22T07:29:13
2019-07-02T22:50:21
Java
UTF-8
Java
false
false
47,903
java
/* * Copyright 2015-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.cabos.dbflute.cbean.cq.bs; import java.util.*; import org.dbflute.cbean.*; import org.dbflute.cbean.chelper.*; import org.dbflute.cbean.ckey.*; import org.dbflute.cbean.coption.*; import org.dbflute.cbean.cvalue.ConditionValue; import org.dbflute.cbean.ordering.*; import org.dbflute.cbean.scoping.*; import org.dbflute.cbean.sqlclause.SqlClause; import org.dbflute.dbmeta.DBMetaProvider; import io.cabos.dbflute.allcommon.*; import io.cabos.dbflute.cbean.*; import io.cabos.dbflute.cbean.cq.*; /** * The abstract condition-query of MEMBER_SERVICE. * @author DBFlute(AutoGenerator) */ public abstract class AbstractBsMemberServiceCQ extends AbstractConditionQuery { // =================================================================================== // Constructor // =========== public AbstractBsMemberServiceCQ(ConditionQuery referrerQuery, SqlClause sqlClause, String aliasName, int nestLevel) { super(referrerQuery, sqlClause, aliasName, nestLevel); } // =================================================================================== // DB Meta // ======= @Override protected DBMetaProvider xgetDBMetaProvider() { return DBMetaInstanceHandler.getProvider(); } public String asTableDbName() { return "MEMBER_SERVICE"; } // =================================================================================== // Query // ===== /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as equal. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_Equal(Integer memberServiceId) { doSetMemberServiceId_Equal(memberServiceId); } protected void doSetMemberServiceId_Equal(Integer memberServiceId) { regMemberServiceId(CK_EQ, memberServiceId); } /** * NotEqual(&lt;&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as notEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_NotEqual(Integer memberServiceId) { doSetMemberServiceId_NotEqual(memberServiceId); } protected void doSetMemberServiceId_NotEqual(Integer memberServiceId) { regMemberServiceId(CK_NES, memberServiceId); } /** * GreaterThan(&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as greaterThan. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_GreaterThan(Integer memberServiceId) { regMemberServiceId(CK_GT, memberServiceId); } /** * LessThan(&lt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as lessThan. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_LessThan(Integer memberServiceId) { regMemberServiceId(CK_LT, memberServiceId); } /** * GreaterEqual(&gt;=). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as greaterEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_GreaterEqual(Integer memberServiceId) { regMemberServiceId(CK_GE, memberServiceId); } /** * LessEqual(&lt;=). And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceId The value of memberServiceId as lessEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberServiceId_LessEqual(Integer memberServiceId) { regMemberServiceId(CK_LE, memberServiceId); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param minNumber The min number of memberServiceId. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of memberServiceId. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of range-of. (NotNull) */ public void setMemberServiceId_RangeOf(Integer minNumber, Integer maxNumber, ConditionOptionCall<RangeOfOption> opLambda) { setMemberServiceId_RangeOf(minNumber, maxNumber, xcROOP(opLambda)); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param minNumber The min number of memberServiceId. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of memberServiceId. (basically NotNull: if op.allowOneSide(), null allowed) * @param rangeOfOption The option of range-of. (NotNull) */ protected void setMemberServiceId_RangeOf(Integer minNumber, Integer maxNumber, RangeOfOption rangeOfOption) { regROO(minNumber, maxNumber, xgetCValueMemberServiceId(), "MEMBER_SERVICE_ID", rangeOfOption); } /** * InScope {in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceIdList The collection of memberServiceId as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setMemberServiceId_InScope(Collection<Integer> memberServiceIdList) { doSetMemberServiceId_InScope(memberServiceIdList); } protected void doSetMemberServiceId_InScope(Collection<Integer> memberServiceIdList) { regINS(CK_INS, cTL(memberServiceIdList), xgetCValueMemberServiceId(), "MEMBER_SERVICE_ID"); } /** * NotInScope {not in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} * @param memberServiceIdList The collection of memberServiceId as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setMemberServiceId_NotInScope(Collection<Integer> memberServiceIdList) { doSetMemberServiceId_NotInScope(memberServiceIdList); } protected void doSetMemberServiceId_NotInScope(Collection<Integer> memberServiceIdList) { regINS(CK_NINS, cTL(memberServiceIdList), xgetCValueMemberServiceId(), "MEMBER_SERVICE_ID"); } /** * IsNull {is null}. And OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} */ public void setMemberServiceId_IsNull() { regMemberServiceId(CK_ISN, DOBJ); } /** * IsNotNull {is not null}. And OnlyOnceRegistered. <br> * (会員サービスID)MEMBER_SERVICE_ID: {PK, ID, NotNull, INT(10)} */ public void setMemberServiceId_IsNotNull() { regMemberServiceId(CK_ISNN, DOBJ); } protected void regMemberServiceId(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueMemberServiceId(), "MEMBER_SERVICE_ID"); } protected abstract ConditionValue xgetCValueMemberServiceId(); /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as equal. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_Equal(Integer memberId) { doSetMemberId_Equal(memberId); } protected void doSetMemberId_Equal(Integer memberId) { regMemberId(CK_EQ, memberId); } /** * NotEqual(&lt;&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as notEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_NotEqual(Integer memberId) { doSetMemberId_NotEqual(memberId); } protected void doSetMemberId_NotEqual(Integer memberId) { regMemberId(CK_NES, memberId); } /** * GreaterThan(&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as greaterThan. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_GreaterThan(Integer memberId) { regMemberId(CK_GT, memberId); } /** * LessThan(&lt;). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as lessThan. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_LessThan(Integer memberId) { regMemberId(CK_LT, memberId); } /** * GreaterEqual(&gt;=). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as greaterEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_GreaterEqual(Integer memberId) { regMemberId(CK_GE, memberId); } /** * LessEqual(&lt;=). And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberId The value of memberId as lessEqual. (basically NotNull: error as default, or no condition as option) */ public void setMemberId_LessEqual(Integer memberId) { regMemberId(CK_LE, memberId); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param minNumber The min number of memberId. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of memberId. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of range-of. (NotNull) */ public void setMemberId_RangeOf(Integer minNumber, Integer maxNumber, ConditionOptionCall<RangeOfOption> opLambda) { setMemberId_RangeOf(minNumber, maxNumber, xcROOP(opLambda)); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param minNumber The min number of memberId. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of memberId. (basically NotNull: if op.allowOneSide(), null allowed) * @param rangeOfOption The option of range-of. (NotNull) */ protected void setMemberId_RangeOf(Integer minNumber, Integer maxNumber, RangeOfOption rangeOfOption) { regROO(minNumber, maxNumber, xgetCValueMemberId(), "MEMBER_ID", rangeOfOption); } /** * InScope {in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberIdList The collection of memberId as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setMemberId_InScope(Collection<Integer> memberIdList) { doSetMemberId_InScope(memberIdList); } protected void doSetMemberId_InScope(Collection<Integer> memberIdList) { regINS(CK_INS, cTL(memberIdList), xgetCValueMemberId(), "MEMBER_ID"); } /** * NotInScope {not in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (会員ID)MEMBER_ID: {UQ, NotNull, INT(10), FK to MEMBER} * @param memberIdList The collection of memberId as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setMemberId_NotInScope(Collection<Integer> memberIdList) { doSetMemberId_NotInScope(memberIdList); } protected void doSetMemberId_NotInScope(Collection<Integer> memberIdList) { regINS(CK_NINS, cTL(memberIdList), xgetCValueMemberId(), "MEMBER_ID"); } protected void regMemberId(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueMemberId(), "MEMBER_ID"); } protected abstract ConditionValue xgetCValueMemberId(); /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as equal. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_Equal(Integer servicePointCount) { doSetServicePointCount_Equal(servicePointCount); } protected void doSetServicePointCount_Equal(Integer servicePointCount) { regServicePointCount(CK_EQ, servicePointCount); } /** * NotEqual(&lt;&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as notEqual. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_NotEqual(Integer servicePointCount) { doSetServicePointCount_NotEqual(servicePointCount); } protected void doSetServicePointCount_NotEqual(Integer servicePointCount) { regServicePointCount(CK_NES, servicePointCount); } /** * GreaterThan(&gt;). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as greaterThan. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_GreaterThan(Integer servicePointCount) { regServicePointCount(CK_GT, servicePointCount); } /** * LessThan(&lt;). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as lessThan. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_LessThan(Integer servicePointCount) { regServicePointCount(CK_LT, servicePointCount); } /** * GreaterEqual(&gt;=). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as greaterEqual. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_GreaterEqual(Integer servicePointCount) { regServicePointCount(CK_GE, servicePointCount); } /** * LessEqual(&lt;=). And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCount The value of servicePointCount as lessEqual. (basically NotNull: error as default, or no condition as option) */ public void setServicePointCount_LessEqual(Integer servicePointCount) { regServicePointCount(CK_LE, servicePointCount); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param minNumber The min number of servicePointCount. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of servicePointCount. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of range-of. (NotNull) */ public void setServicePointCount_RangeOf(Integer minNumber, Integer maxNumber, ConditionOptionCall<RangeOfOption> opLambda) { setServicePointCount_RangeOf(minNumber, maxNumber, xcROOP(opLambda)); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param minNumber The min number of servicePointCount. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of servicePointCount. (basically NotNull: if op.allowOneSide(), null allowed) * @param rangeOfOption The option of range-of. (NotNull) */ protected void setServicePointCount_RangeOf(Integer minNumber, Integer maxNumber, RangeOfOption rangeOfOption) { regROO(minNumber, maxNumber, xgetCValueServicePointCount(), "SERVICE_POINT_COUNT", rangeOfOption); } /** * InScope {in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCountList The collection of servicePointCount as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServicePointCount_InScope(Collection<Integer> servicePointCountList) { doSetServicePointCount_InScope(servicePointCountList); } protected void doSetServicePointCount_InScope(Collection<Integer> servicePointCountList) { regINS(CK_INS, cTL(servicePointCountList), xgetCValueServicePointCount(), "SERVICE_POINT_COUNT"); } /** * NotInScope {not in (1, 2)}. And NullIgnored, NullElementIgnored, SeveralRegistered. <br> * (サービスポイント数)SERVICE_POINT_COUNT: {IX, NotNull, INT(10)} * @param servicePointCountList The collection of servicePointCount as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServicePointCount_NotInScope(Collection<Integer> servicePointCountList) { doSetServicePointCount_NotInScope(servicePointCountList); } protected void doSetServicePointCount_NotInScope(Collection<Integer> servicePointCountList) { regINS(CK_NINS, cTL(servicePointCountList), xgetCValueServicePointCount(), "SERVICE_POINT_COUNT"); } protected void regServicePointCount(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueServicePointCount(), "SERVICE_POINT_COUNT"); } protected abstract ConditionValue xgetCValueServicePointCount(); /** * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCode The value of serviceRankCode as equal. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServiceRankCode_Equal(String serviceRankCode) { doSetServiceRankCode_Equal(fRES(serviceRankCode)); } protected void doSetServiceRankCode_Equal(String serviceRankCode) { regServiceRankCode(CK_EQ, serviceRankCode); } /** * NotEqual(&lt;&gt;). And NullOrEmptyIgnored, OnlyOnceRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCode The value of serviceRankCode as notEqual. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServiceRankCode_NotEqual(String serviceRankCode) { doSetServiceRankCode_NotEqual(fRES(serviceRankCode)); } protected void doSetServiceRankCode_NotEqual(String serviceRankCode) { regServiceRankCode(CK_NES, serviceRankCode); } /** * InScope {in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCodeList The collection of serviceRankCode as inScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServiceRankCode_InScope(Collection<String> serviceRankCodeList) { doSetServiceRankCode_InScope(serviceRankCodeList); } protected void doSetServiceRankCode_InScope(Collection<String> serviceRankCodeList) { regINS(CK_INS, cTL(serviceRankCodeList), xgetCValueServiceRankCode(), "SERVICE_RANK_CODE"); } /** * NotInScope {not in ('a', 'b')}. And NullOrEmptyIgnored, NullOrEmptyElementIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCodeList The collection of serviceRankCode as notInScope. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setServiceRankCode_NotInScope(Collection<String> serviceRankCodeList) { doSetServiceRankCode_NotInScope(serviceRankCodeList); } protected void doSetServiceRankCode_NotInScope(Collection<String> serviceRankCodeList) { regINS(CK_NINS, cTL(serviceRankCodeList), xgetCValueServiceRankCode(), "SERVICE_RANK_CODE"); } /** * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} <br> * <pre>e.g. setServiceRankCode_LikeSearch("xxx", op <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> op.<span style="color: #CC4747">likeContain()</span>);</pre> * @param serviceRankCode The value of serviceRankCode as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option) * @param opLambda The callback for option of like-search. (NotNull) */ public void setServiceRankCode_LikeSearch(String serviceRankCode, ConditionOptionCall<LikeSearchOption> opLambda) { setServiceRankCode_LikeSearch(serviceRankCode, xcLSOP(opLambda)); } /** * LikeSearch with various options. (versatile) {like '%xxx%' escape ...}. And NullOrEmptyIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} <br> * <pre>e.g. setServiceRankCode_LikeSearch("xxx", new <span style="color: #CC4747">LikeSearchOption</span>().likeContain());</pre> * @param serviceRankCode The value of serviceRankCode as likeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option) * @param likeSearchOption The option of like-search. (NotNull) */ protected void setServiceRankCode_LikeSearch(String serviceRankCode, LikeSearchOption likeSearchOption) { regLSQ(CK_LS, fRES(serviceRankCode), xgetCValueServiceRankCode(), "SERVICE_RANK_CODE", likeSearchOption); } /** * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...} <br> * And NullOrEmptyIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCode The value of serviceRankCode as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option) * @param opLambda The callback for option of like-search. (NotNull) */ public void setServiceRankCode_NotLikeSearch(String serviceRankCode, ConditionOptionCall<LikeSearchOption> opLambda) { setServiceRankCode_NotLikeSearch(serviceRankCode, xcLSOP(opLambda)); } /** * NotLikeSearch with various options. (versatile) {not like 'xxx%' escape ...} <br> * And NullOrEmptyIgnored, SeveralRegistered. <br> * (サービスランクコード)SERVICE_RANK_CODE: {IX, NotNull, CHAR(3), FK to SERVICE_RANK} * @param serviceRankCode The value of serviceRankCode as notLikeSearch. (basically NotNull, NotEmpty: error as default, or no condition as option) * @param likeSearchOption The option of not-like-search. (NotNull) */ protected void setServiceRankCode_NotLikeSearch(String serviceRankCode, LikeSearchOption likeSearchOption) { regLSQ(CK_NLS, fRES(serviceRankCode), xgetCValueServiceRankCode(), "SERVICE_RANK_CODE", likeSearchOption); } protected void regServiceRankCode(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueServiceRankCode(), "SERVICE_RANK_CODE"); } protected abstract ConditionValue xgetCValueServiceRankCode(); /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (登録日時)REGISTER_DATETIME: {NotNull, DATETIME(19)} * @param registerDatetime The value of registerDatetime as equal. (basically NotNull: error as default, or no condition as option) */ public void setRegisterDatetime_Equal(java.time.LocalDateTime registerDatetime) { regRegisterDatetime(CK_EQ, registerDatetime); } /** * FromTo with various options. (versatile) {(default) fromDatetime &lt;= column &lt;= toDatetime} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (登録日時)REGISTER_DATETIME: {NotNull, DATETIME(19)} * <pre>e.g. setRegisterDatetime_FromTo(fromDate, toDate, op <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> op.<span style="color: #CC4747">compareAsDate()</span>);</pre> * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of registerDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of registerDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of from-to. (NotNull) */ public void setRegisterDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, ConditionOptionCall<FromToOption> opLambda) { setRegisterDatetime_FromTo(fromDatetime, toDatetime, xcFTOP(opLambda)); } /** * FromTo with various options. (versatile) {(default) fromDatetime &lt;= column &lt;= toDatetime} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (登録日時)REGISTER_DATETIME: {NotNull, DATETIME(19)} * <pre>e.g. setRegisterDatetime_FromTo(fromDate, toDate, new <span style="color: #CC4747">FromToOption</span>().compareAsDate());</pre> * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of registerDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of registerDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param fromToOption The option of from-to. (NotNull) */ protected void setRegisterDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, FromToOption fromToOption) { String nm = "REGISTER_DATETIME"; FromToOption op = fromToOption; regFTQ(xfFTHD(fromDatetime, nm, op), xfFTHD(toDatetime, nm, op), xgetCValueRegisterDatetime(), nm, op); } protected void regRegisterDatetime(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueRegisterDatetime(), "REGISTER_DATETIME"); } protected abstract ConditionValue xgetCValueRegisterDatetime(); /** * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. <br> * (登録ユーザー)REGISTER_USER: {NotNull, VARCHAR(200)} * @param registerUser The value of registerUser as equal. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setRegisterUser_Equal(String registerUser) { doSetRegisterUser_Equal(fRES(registerUser)); } protected void doSetRegisterUser_Equal(String registerUser) { regRegisterUser(CK_EQ, registerUser); } protected void regRegisterUser(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueRegisterUser(), "REGISTER_USER"); } protected abstract ConditionValue xgetCValueRegisterUser(); /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (更新日時)UPDATE_DATETIME: {NotNull, DATETIME(19)} * @param updateDatetime The value of updateDatetime as equal. (basically NotNull: error as default, or no condition as option) */ public void setUpdateDatetime_Equal(java.time.LocalDateTime updateDatetime) { regUpdateDatetime(CK_EQ, updateDatetime); } /** * FromTo with various options. (versatile) {(default) fromDatetime &lt;= column &lt;= toDatetime} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (更新日時)UPDATE_DATETIME: {NotNull, DATETIME(19)} * <pre>e.g. setUpdateDatetime_FromTo(fromDate, toDate, op <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> op.<span style="color: #CC4747">compareAsDate()</span>);</pre> * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of updateDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of updateDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of from-to. (NotNull) */ public void setUpdateDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, ConditionOptionCall<FromToOption> opLambda) { setUpdateDatetime_FromTo(fromDatetime, toDatetime, xcFTOP(opLambda)); } /** * FromTo with various options. (versatile) {(default) fromDatetime &lt;= column &lt;= toDatetime} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (更新日時)UPDATE_DATETIME: {NotNull, DATETIME(19)} * <pre>e.g. setUpdateDatetime_FromTo(fromDate, toDate, new <span style="color: #CC4747">FromToOption</span>().compareAsDate());</pre> * @param fromDatetime The from-datetime(yyyy/MM/dd HH:mm:ss.SSS) of updateDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param toDatetime The to-datetime(yyyy/MM/dd HH:mm:ss.SSS) of updateDatetime. (basically NotNull: if op.allowOneSide(), null allowed) * @param fromToOption The option of from-to. (NotNull) */ protected void setUpdateDatetime_FromTo(java.time.LocalDateTime fromDatetime, java.time.LocalDateTime toDatetime, FromToOption fromToOption) { String nm = "UPDATE_DATETIME"; FromToOption op = fromToOption; regFTQ(xfFTHD(fromDatetime, nm, op), xfFTHD(toDatetime, nm, op), xgetCValueUpdateDatetime(), nm, op); } protected void regUpdateDatetime(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueUpdateDatetime(), "UPDATE_DATETIME"); } protected abstract ConditionValue xgetCValueUpdateDatetime(); /** * Equal(=). And NullOrEmptyIgnored, OnlyOnceRegistered. <br> * (更新ユーザー)UPDATE_USER: {NotNull, VARCHAR(200)} * @param updateUser The value of updateUser as equal. (basically NotNull, NotEmpty: error as default, or no condition as option) */ public void setUpdateUser_Equal(String updateUser) { doSetUpdateUser_Equal(fRES(updateUser)); } protected void doSetUpdateUser_Equal(String updateUser) { regUpdateUser(CK_EQ, updateUser); } protected void regUpdateUser(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueUpdateUser(), "UPDATE_USER"); } protected abstract ConditionValue xgetCValueUpdateUser(); /** * Equal(=). And NullIgnored, OnlyOnceRegistered. <br> * (バージョン番号)VERSION_NO: {NotNull, BIGINT(19)} * @param versionNo The value of versionNo as equal. (basically NotNull: error as default, or no condition as option) */ public void setVersionNo_Equal(Long versionNo) { doSetVersionNo_Equal(versionNo); } protected void doSetVersionNo_Equal(Long versionNo) { regVersionNo(CK_EQ, versionNo); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (バージョン番号)VERSION_NO: {NotNull, BIGINT(19)} * @param minNumber The min number of versionNo. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of versionNo. (basically NotNull: if op.allowOneSide(), null allowed) * @param opLambda The callback for option of range-of. (NotNull) */ public void setVersionNo_RangeOf(Long minNumber, Long maxNumber, ConditionOptionCall<RangeOfOption> opLambda) { setVersionNo_RangeOf(minNumber, maxNumber, xcROOP(opLambda)); } /** * RangeOf with various options. (versatile) <br> * {(default) minNumber &lt;= column &lt;= maxNumber} <br> * And NullIgnored, OnlyOnceRegistered. <br> * (バージョン番号)VERSION_NO: {NotNull, BIGINT(19)} * @param minNumber The min number of versionNo. (basically NotNull: if op.allowOneSide(), null allowed) * @param maxNumber The max number of versionNo. (basically NotNull: if op.allowOneSide(), null allowed) * @param rangeOfOption The option of range-of. (NotNull) */ protected void setVersionNo_RangeOf(Long minNumber, Long maxNumber, RangeOfOption rangeOfOption) { regROO(minNumber, maxNumber, xgetCValueVersionNo(), "VERSION_NO", rangeOfOption); } protected void regVersionNo(ConditionKey ky, Object vl) { regQ(ky, vl, xgetCValueVersionNo(), "VERSION_NO"); } protected abstract ConditionValue xgetCValueVersionNo(); // =================================================================================== // ScalarCondition // =============== /** * Prepare ScalarCondition as equal. <br> * {where FOO = (select max(BAR) from ...)} * <pre> * cb.query().scalar_Equal().<span style="color: #CC4747">avg</span>(<span style="color: #553000">purchaseCB</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">purchaseCB</span>.specify().<span style="color: #CC4747">columnPurchasePrice</span>(); <span style="color: #3F7E5E">// *Point!</span> * <span style="color: #553000">purchaseCB</span>.query().setPaymentCompleteFlg_Equal_True(); * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_Equal() { return xcreateSLCFunction(CK_EQ, MemberServiceCB.class); } /** * Prepare ScalarCondition as equal. <br> * {where FOO &lt;&gt; (select max(BAR) from ...)} * <pre> * cb.query().scalar_Equal().<span style="color: #CC4747">avg</span>(<span style="color: #553000">purchaseCB</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">purchaseCB</span>.specify().<span style="color: #CC4747">columnPurchasePrice</span>(); <span style="color: #3F7E5E">// *Point!</span> * <span style="color: #553000">purchaseCB</span>.query().setPaymentCompleteFlg_Equal_True(); * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_NotEqual() { return xcreateSLCFunction(CK_NES, MemberServiceCB.class); } /** * Prepare ScalarCondition as greaterThan. <br> * {where FOO &gt; (select max(BAR) from ...)} * <pre> * cb.query().scalar_Equal().<span style="color: #CC4747">avg</span>(<span style="color: #553000">purchaseCB</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">purchaseCB</span>.specify().<span style="color: #CC4747">columnPurchasePrice</span>(); <span style="color: #3F7E5E">// *Point!</span> * <span style="color: #553000">purchaseCB</span>.query().setPaymentCompleteFlg_Equal_True(); * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_GreaterThan() { return xcreateSLCFunction(CK_GT, MemberServiceCB.class); } /** * Prepare ScalarCondition as lessThan. <br> * {where FOO &lt; (select max(BAR) from ...)} * <pre> * cb.query().scalar_Equal().<span style="color: #CC4747">avg</span>(<span style="color: #553000">purchaseCB</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">purchaseCB</span>.specify().<span style="color: #CC4747">columnPurchasePrice</span>(); <span style="color: #3F7E5E">// *Point!</span> * <span style="color: #553000">purchaseCB</span>.query().setPaymentCompleteFlg_Equal_True(); * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_LessThan() { return xcreateSLCFunction(CK_LT, MemberServiceCB.class); } /** * Prepare ScalarCondition as greaterEqual. <br> * {where FOO &gt;= (select max(BAR) from ...)} * <pre> * cb.query().scalar_Equal().<span style="color: #CC4747">avg</span>(<span style="color: #553000">purchaseCB</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">purchaseCB</span>.specify().<span style="color: #CC4747">columnPurchasePrice</span>(); <span style="color: #3F7E5E">// *Point!</span> * <span style="color: #553000">purchaseCB</span>.query().setPaymentCompleteFlg_Equal_True(); * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_GreaterEqual() { return xcreateSLCFunction(CK_GE, MemberServiceCB.class); } /** * Prepare ScalarCondition as lessEqual. <br> * {where FOO &lt;= (select max(BAR) from ...)} * <pre> * cb.query().<span style="color: #CC4747">scalar_LessEqual()</span>.max(new SubQuery&lt;MemberServiceCB&gt;() { * public void query(MemberServiceCB subCB) { * subCB.specify().setFoo... <span style="color: #3F7E5E">// derived column for function</span> * subCB.query().setBar... * } * }); * </pre> * @return The object to set up a function. (NotNull) */ public HpSLCFunction<MemberServiceCB> scalar_LessEqual() { return xcreateSLCFunction(CK_LE, MemberServiceCB.class); } @SuppressWarnings("unchecked") protected <CB extends ConditionBean> void xscalarCondition(String fn, SubQuery<CB> sq, String rd, HpSLCCustomized<CB> cs, ScalarConditionOption op) { assertObjectNotNull("subQuery", sq); MemberServiceCB cb = xcreateScalarConditionCB(); sq.query((CB)cb); String pp = keepScalarCondition(cb.query()); // for saving query-value cs.setPartitionByCBean((CB)xcreateScalarConditionPartitionByCB()); // for using partition-by registerScalarCondition(fn, cb.query(), pp, rd, cs, op); } public abstract String keepScalarCondition(MemberServiceCQ sq); protected MemberServiceCB xcreateScalarConditionCB() { MemberServiceCB cb = newMyCB(); cb.xsetupForScalarCondition(this); return cb; } protected MemberServiceCB xcreateScalarConditionPartitionByCB() { MemberServiceCB cb = newMyCB(); cb.xsetupForScalarConditionPartitionBy(this); return cb; } // =================================================================================== // MyselfDerived // ============= public void xsmyselfDerive(String fn, SubQuery<MemberServiceCB> sq, String al, DerivedReferrerOption op) { assertObjectNotNull("subQuery", sq); MemberServiceCB cb = new MemberServiceCB(); cb.xsetupForDerivedReferrer(this); lockCall(() -> sq.query(cb)); String pp = keepSpecifyMyselfDerived(cb.query()); String pk = "MEMBER_SERVICE_ID"; registerSpecifyMyselfDerived(fn, cb.query(), pk, pk, pp, "myselfDerived", al, op); } public abstract String keepSpecifyMyselfDerived(MemberServiceCQ sq); /** * Prepare for (Query)MyselfDerived (correlated sub-query). * @return The object to set up a function for myself table. (NotNull) */ public HpQDRFunction<MemberServiceCB> myselfDerived() { return xcreateQDRFunctionMyselfDerived(MemberServiceCB.class); } @SuppressWarnings("unchecked") protected <CB extends ConditionBean> void xqderiveMyselfDerived(String fn, SubQuery<CB> sq, String rd, Object vl, DerivedReferrerOption op) { assertObjectNotNull("subQuery", sq); MemberServiceCB cb = new MemberServiceCB(); cb.xsetupForDerivedReferrer(this); sq.query((CB)cb); String pk = "MEMBER_SERVICE_ID"; String sqpp = keepQueryMyselfDerived(cb.query()); // for saving query-value. String prpp = keepQueryMyselfDerivedParameter(vl); registerQueryMyselfDerived(fn, cb.query(), pk, pk, sqpp, "myselfDerived", rd, vl, prpp, op); } public abstract String keepQueryMyselfDerived(MemberServiceCQ sq); public abstract String keepQueryMyselfDerivedParameter(Object vl); // =================================================================================== // MyselfExists // ============ /** * Prepare for MyselfExists (correlated sub-query). * @param subCBLambda The implementation of sub-query. (NotNull) */ public void myselfExists(SubQuery<MemberServiceCB> subCBLambda) { assertObjectNotNull("subCBLambda", subCBLambda); MemberServiceCB cb = new MemberServiceCB(); cb.xsetupForMyselfExists(this); lockCall(() -> subCBLambda.query(cb)); String pp = keepMyselfExists(cb.query()); registerMyselfExists(cb.query(), pp); } public abstract String keepMyselfExists(MemberServiceCQ sq); // =================================================================================== // Manual Order // ============ /** * Order along manual ordering information. * <pre> * cb.query().addOrderBy_Birthdate_Asc().<span style="color: #CC4747">withManualOrder</span>(<span style="color: #553000">op</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">op</span>.<span style="color: #CC4747">when_GreaterEqual</span>(priorityDate); <span style="color: #3F7E5E">// e.g. 2000/01/01</span> * }); * <span style="color: #3F7E5E">// order by </span> * <span style="color: #3F7E5E">// case</span> * <span style="color: #3F7E5E">// when BIRTHDATE &gt;= '2000/01/01' then 0</span> * <span style="color: #3F7E5E">// else 1</span> * <span style="color: #3F7E5E">// end asc, ...</span> * * cb.query().addOrderBy_MemberStatusCode_Asc().<span style="color: #CC4747">withManualOrder</span>(<span style="color: #553000">op</span> <span style="color: #90226C; font-weight: bold"><span style="font-size: 120%">-</span>&gt;</span> { * <span style="color: #553000">op</span>.<span style="color: #CC4747">when_Equal</span>(CDef.MemberStatus.Withdrawal); * <span style="color: #553000">op</span>.<span style="color: #CC4747">when_Equal</span>(CDef.MemberStatus.Formalized); * <span style="color: #553000">op</span>.<span style="color: #CC4747">when_Equal</span>(CDef.MemberStatus.Provisional); * }); * <span style="color: #3F7E5E">// order by </span> * <span style="color: #3F7E5E">// case</span> * <span style="color: #3F7E5E">// when MEMBER_STATUS_CODE = 'WDL' then 0</span> * <span style="color: #3F7E5E">// when MEMBER_STATUS_CODE = 'FML' then 1</span> * <span style="color: #3F7E5E">// when MEMBER_STATUS_CODE = 'PRV' then 2</span> * <span style="color: #3F7E5E">// else 3</span> * <span style="color: #3F7E5E">// end asc, ...</span> * </pre> * <p>This function with Union is unsupported!</p> * <p>The order values are bound (treated as bind parameter).</p> * @param opLambda The callback for option of manual-order containing order values. (NotNull) */ public void withManualOrder(ManualOrderOptionCall opLambda) { // is user public! xdoWithManualOrder(cMOO(opLambda)); } // =================================================================================== // Small Adjustment // ================ // =================================================================================== // Very Internal // ============= protected MemberServiceCB newMyCB() { return new MemberServiceCB(); } // very internal (for suppressing warn about 'Not Use Import') protected String xabUDT() { return Date.class.getName(); } protected String xabCQ() { return MemberServiceCQ.class.getName(); } protected String xabLSO() { return LikeSearchOption.class.getName(); } protected String xabSLCS() { return HpSLCSetupper.class.getName(); } protected String xabSCP() { return SubQuery.class.getName(); } }
[ "yuto.eguma@gmail.com" ]
yuto.eguma@gmail.com
0bfc92a15c1768df7eef5426d76dd8001759f4ca
b704d3d2c93d5ae160900deee6e485e1af2ed9e5
/src/main/java/org/nybatis/core/reflection/serializer/customNullChecker/FloatSerializer.java
f4e902d2e7b29e3f5db62f0c7043ec6ce7c497cd
[ "Apache-2.0" ]
permissive
NyBatis/NyBatisCore
1e00e6fc38b836fcaf7da76f5e42eeaab2d097fb
99884dd170be7786c42b2431a871a3a0a89009a3
refs/heads/master
2023-08-06T04:49:06.831615
2022-06-23T09:17:05
2022-06-23T09:17:05
44,424,074
3
1
Apache-2.0
2023-07-07T21:57:58
2015-10-17T04:33:21
Java
UTF-8
Java
false
false
502
java
package org.nybatis.core.reflection.serializer.customNullChecker; import com.fasterxml.jackson.databind.JsonSerializer; import org.nybatis.core.db.constant.NullValue; import java.io.IOException; public class FloatSerializer extends AbstractJsonSerializer<Float> { public FloatSerializer( JsonSerializer defaultSerializer ) { super( defaultSerializer ); } @Override public boolean isNull( Float value ) throws IOException { return value == NullValue.FLOAT; } }
[ "nayasis@sk.com" ]
nayasis@sk.com
0a998a9dec9dc483c04944ed150b96ebfa6ebc49
fccccb3d4212d56cc3dde3c865c5a883791a5753
/src/main/java/com/ac/ems/db/mongo/UserInformationConverter.java
2125d7694fbf2dc9589e3136cba22caf9d97d12e
[]
no_license
apshaiTerp/ac-ems-system-db
f3f64a16376b305e5af3196c7df490dbc0199420
5d09452896125eaf64aa1f0dd4802e2cad68aa24
refs/heads/master
2016-08-12T04:10:08.461213
2015-11-24T22:06:38
2015-11-24T22:06:38
44,132,884
0
0
null
2015-11-24T22:06:38
2015-10-12T20:38:14
null
UTF-8
Java
false
false
3,011
java
package com.ac.ems.db.mongo; import java.util.ArrayList; import java.util.List; import com.ac.ems.data.UserInformation; import com.ac.ems.data.enums.UserRoleConverter; import com.mongodb.BasicDBList; import com.mongodb.BasicDBObject; import com.mongodb.DBObject; /** * @author ac010168 * */ public class UserInformationConverter { public static BasicDBObject convertIDToQuery(UserInformation user) { if (user == null) return null; BasicDBObject dbObject = new BasicDBObject("userID", user.getUserID()); return dbObject; } public static BasicDBObject convertIDToQuery(long userID) { if (userID < 0) return null; BasicDBObject dbObject = new BasicDBObject("userID", userID); return dbObject; } public static BasicDBObject convertUserInformationToMongo(UserInformation user) { if (user == null) return null; BasicDBObject dbObject = new BasicDBObject("userID", user.getUserID()); if (user.getPassword() != null) dbObject.append("password", user.getPassword()); if (user.getUserRole() != null) dbObject.append("userRole", UserRoleConverter.convertUserRoleToString(user.getUserRole())); if (user.getAuthorizedIDs() != null) dbObject.append("authorizedIDs", convertList(user.getAuthorizedIDs())); return dbObject; } public static UserInformation convertMongoToUserInformation(DBObject dbObject) { if (dbObject == null) return null; UserInformation user = new UserInformation(); if (dbObject.containsField("userID")) user.setUserID((Long)dbObject.get("userID")); if (dbObject.containsField("password")) user.setPassword((String)dbObject.get("password")); if (dbObject.containsField("userRole")) user.setUserRole(UserRoleConverter.convertStringToUserRole((String)dbObject.get("userRole"))); if (dbObject.containsField("authorizedIDs")) user.setAuthorizedIDs(convertDBListToLongList((BasicDBList)dbObject.get("authorizedIDs"))); return user; } /** * Helper method to parse Lists into List format for Mongo. Parameterized as <?> to * allow for generic mapping, provided those objects are simple objects. * * @param curList The List of elements (not null) to be converted into an array. * @return A new list in BasicDBList format. */ private static BasicDBList convertList(List<?> curList) { if (curList == null) return null; BasicDBList newList = new BasicDBList(); for (Object obj : curList) newList.add(obj); return newList; } /** * Helper method to parse Lists from Mongo into Java. * * @param curList The List of elements (not null) to be converted into an array. * @return A new list in List<Long> format. */ private static List<Long> convertDBListToLongList(BasicDBList curList) { if (curList == null) return null; List<Long> newList = new ArrayList<Long>(curList.size()); for (Object obj : curList) { newList.add((Long)obj); } return newList; } }
[ "apshaiTerp@yahoo.com" ]
apshaiTerp@yahoo.com
5cfc849534dcbca8d42530ed86e99902ce7118f9
aca457909ef8c4eb989ba23919de508c490b074a
/DialerJADXDecompile/defpackage/bsr.java
c68c8e1e480b0df33537fe26946c1c32165ac846
[]
no_license
KHikami/ProjectFiCallingDeciphered
bfccc1e1ba5680d32a4337746de4b525f1911969
cc92bf6d4cad16559a2ecbc592503d37a182dee3
refs/heads/master
2021-01-12T17:50:59.643861
2016-12-08T01:20:34
2016-12-08T01:23:04
71,650,754
1
0
null
null
null
null
UTF-8
Java
false
false
369
java
package defpackage; /* renamed from: bsr */ final class bsr implements bsw { private /* synthetic */ bsq a; bsr(bsq bsq) { this.a = bsq; } public final void a(bsx bsx) { this.a.e.remove(bsx); if (bsx.a() != null && null != null) { brn a = null; bsx.a().intValue(); a.a(); } } }
[ "chu.rachelh@gmail.com" ]
chu.rachelh@gmail.com
f568678330572169970bd624c58f4c4aef7ffe26
df909e180c8d83f92cc42522613562409e461c4d
/datacentre/src/main/java/core/pubsub/IpAndPort.java
1d8fe9f112d5843bcd163728b58ba05c168e96ec
[]
no_license
ste93/H2-HealthHelp
5160923141bae9d2e68c8c73bc6ee4eaa92689d6
4b8e9503560063b64268e72a4a578d0fab6fdd57
refs/heads/master
2020-03-13T12:34:06.954535
2018-07-19T15:29:59
2018-07-19T15:29:59
131,121,895
1
2
null
null
null
null
UTF-8
Java
false
false
379
java
package core.pubsub; public enum IpAndPort { HOST_IP_AND_PORT("192.168.43.120", "5672"); private String ip; private String port; IpAndPort(final String ip, final String port){ this.ip = ip; this.port = port; } public String getIp() { return ip; } public int getPort() { return Integer.parseInt(port); } }
[ "margherita.pecorelli@studio.unibo.it" ]
margherita.pecorelli@studio.unibo.it
2ed542b199385ae4afdb62785ce6c28c25cf9856
4c19b724f95682ed21a82ab09b05556b5beea63c
/XMSYGame/java2/server/game-manager/src/main/java/com/xmsy/server/zxyy/game/common/utils/MathUtil.java
f07721bc3c76bef84d01d4d928bccbf4bce973de
[]
no_license
angel-like/angel
a66f8fda992fba01b81c128dd52b97c67f1ef027
3f7d79a61dc44a9c4547a60ab8648bc390c0f01e
refs/heads/master
2023-03-11T03:14:49.059036
2022-11-17T11:35:37
2022-11-17T11:35:37
222,582,930
3
5
null
2023-02-22T05:29:45
2019-11-19T01:41:25
JavaScript
UTF-8
Java
false
false
833
java
package com.xmsy.server.zxyy.game.common.utils; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Random; import java.util.Set; public class MathUtil { public static BigDecimal getBigDecimal(Object obj) { try { return new BigDecimal(obj.toString()); } catch (Exception e) { } return BigDecimal.ZERO; } public static List<Integer> getRandomInt(int max,int len) { Random rand = new Random(); Set<Integer> rSet=new HashSet<>(); while(true){ rSet.add(rand.nextInt(max)); if(rSet.size()==len) break; } return new ArrayList<Integer>(rSet); } public static void main(String[] args) { // MathUtil.getBigDecimal(0.1).add(MathUtil.getBigDecimal(0.06)); System.out.println(MathUtil.getRandomInt(3, 3)); } }
[ "163@qq.com" ]
163@qq.com
9f6b39b2e12407df01b1b8f8e9689b22977a71e9
38cc2a1ea54e1e67889a211c67905eaa8018eafe
/src/main/java/it/esc2/earlyWarning/domain/CvssAccessComplexity.java
fddc468f36d11cc0a3adc90d8604840aebdba558
[]
no_license
arashmansour80/arisuddev
f20261970a5987960e65ec77b552844131d34af6
4b9a1ee4f2cc0b1746218298a61972651e437652
refs/heads/master
2021-06-06T07:45:40.254699
2020-01-08T16:22:06
2020-01-08T16:22:06
140,832,777
0
0
null
null
null
null
UTF-8
Java
false
false
1,347
java
package it.esc2.earlyWarning.domain; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import org.apache.commons.lang.builder.ToStringBuilder; import org.springframework.data.mongodb.core.mapping.Document; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "approximated", "content" }) @Document public class CvssAccessComplexity implements Serializable { @JsonProperty("approximated") private boolean approximated; @JsonProperty("content") private String content; private final static long serialVersionUID = 3117535443381619957L; @JsonProperty("approximated") public boolean isApproximated() { return approximated; } @JsonProperty("approximated") public void setApproximated(boolean approximated) { this.approximated = approximated; } @JsonProperty("content") public String getContent() { return content; } @JsonProperty("content") public void setContent(String content) { this.content = content; } @Override public String toString() { return new ToStringBuilder(this).append("approximated", approximated).append("content", content).toString(); } }
[ "a.mansour@iemmeconsulting.it" ]
a.mansour@iemmeconsulting.it
c245525f68961cb8d50ccad4b4109d3d43f5a073
a0a4b4d8d6eff2b369b89968bce5f34fec42243b
/OneOnOne/src/main/java/com/codingdojo/mvc/models/Person.java
18caec28cd03dd77696e3b09cbec0f11417763fe
[]
no_license
gVigueras/FullStackJava
031165793b1a75332d374440559fba5235753039
c46785555d632e44c1648c741578eaf386dfa941
refs/heads/master
2020-12-22T12:36:10.718781
2020-09-07T00:38:52
2020-09-07T00:38:52
236,783,005
0
1
null
null
null
null
UTF-8
Java
false
false
1,102
java
package com.codingdojo.mvc.models; import java.util.Date; import javax.persistence.*; import org.springframework.format.annotation.DateTimeFormat; @Entity @Table(name="persons") public class Person { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String firstName; private String lastName; @Column(updatable=false) @DateTimeFormat(pattern="yyyy-MM-dd") private Date createdAt; @DateTimeFormat(pattern="yyyy-MM-dd") private Date updatedAt; @OneToOne(mappedBy="person", cascade=CascadeType.ALL, fetch=FetchType.LAZY) private License license; public Person() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } 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 License getLicense() { return license; } public void setLicense(License license) { this.license = license; } }
[ "g.vigueras01@ufromail.cl" ]
g.vigueras01@ufromail.cl
842ed7523578be866e52559a3b56157385f44b60
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Math-6/org.apache.commons.math3.optim.nonlinear.vector.jacobian.GaussNewtonOptimizer/BBC-F0-opt-50/2/org/apache/commons/math3/optim/nonlinear/vector/jacobian/GaussNewtonOptimizer_ESTest.java
2afe513b8e0c9a90c23491cf2f1461a738af80f5
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
2,489
java
/* * This file was automatically generated by EvoSuite * Tue Oct 19 19:37:57 GMT 2021 */ package org.apache.commons.math3.optim.nonlinear.vector.jacobian; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.math3.optim.ConvergenceChecker; import org.apache.commons.math3.optim.PointVectorValuePair; import org.apache.commons.math3.optim.SimpleVectorValueChecker; import org.apache.commons.math3.optim.nonlinear.vector.jacobian.GaussNewtonOptimizer; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class GaussNewtonOptimizer_ESTest extends GaussNewtonOptimizer_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { GaussNewtonOptimizer gaussNewtonOptimizer0 = new GaussNewtonOptimizer(false, (ConvergenceChecker<PointVectorValuePair>) null); // Undeclared exception! // try { gaussNewtonOptimizer0.doOptimize(); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // null is not allowed // // // verifyException("org.apache.commons.math3.optim.nonlinear.vector.jacobian.GaussNewtonOptimizer", e); // } } @Test(timeout = 4000) public void test1() throws Throwable { SimpleVectorValueChecker simpleVectorValueChecker0 = new SimpleVectorValueChecker((-948.4), (-948.4), 221); GaussNewtonOptimizer gaussNewtonOptimizer0 = new GaussNewtonOptimizer(true, simpleVectorValueChecker0); // Undeclared exception! // try { gaussNewtonOptimizer0.doOptimize(); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("org.apache.commons.math3.optim.nonlinear.vector.MultivariateVectorOptimizer", e); // } } @Test(timeout = 4000) public void test2() throws Throwable { GaussNewtonOptimizer gaussNewtonOptimizer0 = new GaussNewtonOptimizer((ConvergenceChecker<PointVectorValuePair>) null); assertEquals(0.0, gaussNewtonOptimizer0.getChiSquare(), 0.01); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
9f9d2918fffc2814c8b14e299e134e3697f8ba2f
591b978dcfc9e108b45846e024a7b83e2b9582e0
/src/org/w3c/tidy/Report.java
d106ae66dc0f838b8f5cdf1110556243be883668
[]
no_license
dreamyphone/Html2XML
de53c1d3ed58d1846b9bed2ea9f63455072d0e58
f0d735cfac8b3615cc1b53e15b8432843b977d0d
refs/heads/master
2016-09-03T07:38:40.878574
2013-12-01T13:07:12
2013-12-01T13:07:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
53,192
java
/* * Java HTML Tidy - JTidy * HTML parser and pretty printer * * Copyright (c) 1998-2000 World Wide Web Consortium (Massachusetts * Institute of Technology, Institut National de Recherche en * Informatique et en Automatique, Keio University). All Rights * Reserved. * * Contributing Author(s): * * Dave Raggett <dsr@w3.org> * Andy Quick <ac.quick@sympatico.ca> (translation to Java) * Gary L Peskin <garyp@firstech.com> (Java development) * Sami Lempinen <sami@lempinen.net> (release management) * Fabrizio Giustina <fgiust at users.sourceforge.net> * * The contributing author(s) would like to thank all those who * helped with testing, bug fixes, and patience. This wouldn't * have been possible without all of you. * * COPYRIGHT NOTICE: * * This software and documentation is provided "as is," and * the copyright holders and contributing author(s) make no * representations or warranties, express or implied, including * but not limited to, warranties of merchantability or fitness * for any particular purpose or that the use of the software or * documentation will not infringe any third party patents, * copyrights, trademarks or other rights. * * The copyright holders and contributing author(s) will not be * liable for any direct, indirect, special or consequential damages * arising out of any use of the software or documentation, even if * advised of the possibility of such damage. * * Permission is hereby granted to use, copy, modify, and distribute * this source code, or portions hereof, documentation and executables, * for any purpose, without fee, subject to the following restrictions: * * 1. The origin of this source code must not be misrepresented. * 2. Altered versions must be plainly marked as such and must * not be misrepresented as being the original source. * 3. This Copyright notice may not be removed or altered from any * source or altered source distribution. * * The copyright holders and contributing author(s) specifically * permit, without fee, and encourage the use of this source code * as a component for supporting the Hypertext Markup Language in * commercial products. If you use this source code in a product, * acknowledgment is not required but would be appreciated. * */ package org.w3c.tidy; import java.io.PrintWriter; import java.text.MessageFormat; import java.util.MissingResourceException; import java.util.ResourceBundle; import org.w3c.tidy.TidyMessage.Level; /** * Error/informational message reporter. You should only need to edit the file TidyMessages.properties to localize HTML * tidy. * @author Dave Raggett <a href="mailto:dsr@w3.org">dsr@w3.org </a> * @author Andy Quick <a href="mailto:ac.quick@sympatico.ca">ac.quick@sympatico.ca </a> (translation to Java) * @author Fabrizio Giustina * @version $Revision: 921 $ ($Author: aditsu $) */ public final class Report { /** * used to point to Web Accessibility Guidelines. */ public static final String ACCESS_URL = "http://www.w3.org/WAI/GL"; /** * Release date String. */ public static final String RELEASE_DATE_STRING = "2009-12-1"; /** * invalid entity: missing semicolon. */ public static final short MISSING_SEMICOLON = 1; /** * invalid entity: missing semicolon. */ public static final short MISSING_SEMICOLON_NCR = 2; /** * invalid entity: unknown entity. */ public static final short UNKNOWN_ENTITY = 3; /** * invalid entity: unescaped ampersand. */ public static final short UNESCAPED_AMPERSAND = 4; /** * invalid entity: apos undefined in current definition. */ public static final short APOS_UNDEFINED = 5; /** * missing an end tag. */ public static final short MISSING_ENDTAG_FOR = 6; /** * missing end tag before. */ public static final short MISSING_ENDTAG_BEFORE = 7; /** * discarding unexpected element. */ public static final short DISCARDING_UNEXPECTED = 8; /** * nested emphasis. */ public static final short NESTED_EMPHASIS = 9; /** * non matching end tag. */ public static final short NON_MATCHING_ENDTAG = 10; /** * tag not allowed in. */ public static final short TAG_NOT_ALLOWED_IN = 11; /** * missing start tag. */ public static final short MISSING_STARTTAG = 12; /** * unexpected end tag. */ public static final short UNEXPECTED_ENDTAG = 13; /** * unsing br in place of. */ public static final short USING_BR_INPLACE_OF = 14; /** * inserting tag. */ public static final short INSERTING_TAG = 15; /** * suspected missing quote. */ public static final short SUSPECTED_MISSING_QUOTE = 16; /** * missing title element. */ public static final short MISSING_TITLE_ELEMENT = 17; /** * duplicate frameset. */ public static final short DUPLICATE_FRAMESET = 18; /** * elments can be nested. */ public static final short CANT_BE_NESTED = 19; /** * obsolete element. */ public static final short OBSOLETE_ELEMENT = 20; /** * proprietary element. */ public static final short PROPRIETARY_ELEMENT = 21; /** * unknown element. */ public static final short UNKNOWN_ELEMENT = 22; /** * trim empty element. */ public static final short TRIM_EMPTY_ELEMENT = 23; /** * coerce to end tag. */ public static final short COERCE_TO_ENDTAG = 24; /** * illegal nesting. */ public static final short ILLEGAL_NESTING = 25; /** * noframes content. */ public static final short NOFRAMES_CONTENT = 26; /** * content after body. */ public static final short CONTENT_AFTER_BODY = 27; /** * inconsistent version. */ public static final short INCONSISTENT_VERSION = 28; /** * malformed comment. */ public static final short MALFORMED_COMMENT = 29; /** * bad coment chars. */ public static final short BAD_COMMENT_CHARS = 30; /** * bad xml comment. */ public static final short BAD_XML_COMMENT = 31; /** * bad cdata comment. */ public static final short BAD_CDATA_CONTENT = 32; /** * inconsistent namespace. */ public static final short INCONSISTENT_NAMESPACE = 33; /** * doctype after tags. */ public static final short DOCTYPE_AFTER_TAGS = 34; /** * malformed doctype. */ public static final short MALFORMED_DOCTYPE = 35; /** * unexpected end of file. */ public static final short UNEXPECTED_END_OF_FILE = 36; /** * doctype not upper case. */ public static final short DTYPE_NOT_UPPER_CASE = 37; /** * too many element. */ public static final short TOO_MANY_ELEMENTS = 38; /** * unescaped element. */ public static final short UNESCAPED_ELEMENT = 39; /** * nested quotation. */ public static final short NESTED_QUOTATION = 40; /** * element not empty. */ public static final short ELEMENT_NOT_EMPTY = 41; /** * encoding IO conflict. */ public static final short ENCODING_IO_CONFLICT = 42; /** * mixed content in block. */ public static final short MIXED_CONTENT_IN_BLOCK = 43; /** * missing doctype. */ public static final short MISSING_DOCTYPE = 44; /** * space preceding xml declaration. */ public static final short SPACE_PRECEDING_XMLDECL = 45; /** * too many elements in. */ public static final short TOO_MANY_ELEMENTS_IN = 46; /** * unexpected endag in. */ public static final short UNEXPECTED_ENDTAG_IN = 47; /** * replacing element. */ public static final short REPLACING_ELEMENT = 83; /** * replacing unexcaped element. */ public static final short REPLACING_UNEX_ELEMENT = 84; /** * coerce to endtag. */ public static final short COERCE_TO_ENDTAG_WARN = 85; /** * attribute: unknown attribute. */ public static final short UNKNOWN_ATTRIBUTE = 48; /** * attribute: missing attribute. */ public static final short MISSING_ATTRIBUTE = 49; /** * attribute: missing attribute value. */ public static final short MISSING_ATTR_VALUE = 50; /** * attribute: bad attribute value. */ public static final short BAD_ATTRIBUTE_VALUE = 51; /** * attribute: unexpected gt. */ public static final short UNEXPECTED_GT = 52; /** * attribute: proprietary attribute. */ public static final short PROPRIETARY_ATTRIBUTE = 53; /** * attribute: proprietary attribute value. */ public static final short PROPRIETARY_ATTR_VALUE = 54; /** * attribute: repeated attribute. */ public static final short REPEATED_ATTRIBUTE = 55; /** * attribute: missing image map. */ public static final short MISSING_IMAGEMAP = 56; /** * attribute: xml attribute value. */ public static final short XML_ATTRIBUTE_VALUE = 57; /** * attribute: missing quotemark. */ public static final short MISSING_QUOTEMARK = 58; /** * attribute: unexpected quotemark. */ public static final short UNEXPECTED_QUOTEMARK = 59; /** * attribute: id and name mismatch. */ public static final short ID_NAME_MISMATCH = 60; /** * attribute: backslash in URI. */ public static final short BACKSLASH_IN_URI = 61; /** * attribute: fixed backslash. */ public static final short FIXED_BACKSLASH = 62; /** * attribute: illegal URI reference. */ public static final short ILLEGAL_URI_REFERENCE = 63; /** * attribute: escaped illegal URI. */ public static final short ESCAPED_ILLEGAL_URI = 64; /** * attribute: newline in URI. */ public static final short NEWLINE_IN_URI = 65; /** * attribute: anchor not unique. */ public static final short ANCHOR_NOT_UNIQUE = 66; /** * attribute: entity in id. */ public static final short ENTITY_IN_ID = 67; /** * attribute: joining attribute. */ public static final short JOINING_ATTRIBUTE = 68; /** * attribute: expected equalsign. */ public static final short UNEXPECTED_EQUALSIGN = 69; /** * attribute: attribute value not lower case. */ public static final short ATTR_VALUE_NOT_LCASE = 70; /** * attribute: id sintax. */ public static final short XML_ID_SYNTAX = 71; /** * attribute: invalid attribute. */ public static final short INVALID_ATTRIBUTE = 72; /** * attribute: bad attribute value replaced. */ public static final short BAD_ATTRIBUTE_VALUE_REPLACED = 73; /** * attribute: invalid xml id. */ public static final short INVALID_XML_ID = 74; /** * attribute: unexpected end of file. */ public static final short UNEXPECTED_END_OF_FILE_ATTR = 75; /** * character encoding: vendor specific chars. */ public static final short VENDOR_SPECIFIC_CHARS = 76; /** * character encoding: invalid sgml chars. */ public static final short INVALID_SGML_CHARS = 77; /** * character encoding: invalid utf8. */ public static final short INVALID_UTF8 = 78; /** * character encoding: invalid utf16. */ public static final short INVALID_UTF16 = 79; /** * character encoding: encoding mismatch. */ public static final short ENCODING_MISMATCH = 80; /** * character encoding: nvalid URI. */ public static final short INVALID_URI = 81; /** * character encoding: invalid NCR. */ public static final short INVALID_NCR = 82; /** * Constant used for reporting of given doctype. */ public static final short DOCTYPE_GIVEN_SUMMARY = 110; /** * Constant used for reporting of version summary. */ public static final short REPORT_VERSION_SUMMARY = 111; /** * Constant used for reporting of bad access summary. */ public static final short BADACCESS_SUMMARY = 112; /** * Constant used for reporting of bad form summary. */ public static final short BADFORM_SUMMARY = 113; /** * accessibility flaw: missing image map. */ public static final short MISSING_IMAGE_ALT = 1; /** * accessibility flaw: missing link alt. */ public static final short MISSING_LINK_ALT = 2; /** * accessibility flaw: missing summary. */ public static final short MISSING_SUMMARY = 4; /** * accessibility flaw: missing image map. */ public static final short MISSING_IMAGE_MAP = 8; /** * accessibility flaw: using frames. */ public static final short USING_FRAMES = 16; /** * accessibility flaw: using noframes. */ public static final short USING_NOFRAMES = 32; /** * presentation flaw: using spacer. */ public static final short USING_SPACER = 1; /** * presentation flaw: using layer. */ public static final short USING_LAYER = 2; /** * presentation flaw: using nobr. */ public static final short USING_NOBR = 4; /** * presentation flaw: using font. */ public static final short USING_FONT = 8; /** * presentation flaw: using body. */ public static final short USING_BODY = 16; /** * character encoding error: windows chars. */ public static final short WINDOWS_CHARS = 1; /** * character encoding error: non ascii. */ public static final short NON_ASCII = 2; /** * character encoding error: found utf16. */ public static final short FOUND_UTF16 = 4; /** * char has been replaced. */ public static final short REPLACED_CHAR = 0; /** * char has been discarder. */ public static final short DISCARDED_CHAR = 1; /** * Resource bundle with messages. */ private static ResourceBundle res; /** * Printed in GNU Emacs messages. */ private String currentFile; /** * message listener for error reporting. */ private TidyMessageListener listener; /** * Instantiated only in Tidy() constructor. */ protected Report() { super(); } /** * Generates a complete message for the warning/error. The message is composed by: * <ul> * <li>position in file</li> * <li>prefix for the error level (warning: | error:)</li> * <li>message read from ResourceBundle</li> * <li>optional parameters added to message using MessageFormat</li> * </ul> * @param errorCode tidy error code * @param lexer Lexer * @param message key for the ResourceBundle * @param params optional parameters added with MessageFormat * @param level message level. One of <code>TidyMessage.LEVEL_ERROR</code>, * <code>TidyMessage.LEVEL_WARNING</code>,<code>TidyMessage.LEVEL_INFO</code> * @return formatted message * @throws MissingResourceException if <code>message</code> key is not available in jtidy resource bundle. * @see TidyMessage */ protected String getMessage(int errorCode, Lexer lexer, String message, Object[] params, Level level) throws MissingResourceException { String resource; resource = res.getString(message); String position; if (lexer != null && level != Level.SUMMARY) { position = getPosition(lexer); } else { position = ""; } String prefix; if (level == Level.ERROR) { prefix = res.getString("error"); } else if (level == Level.WARNING) { prefix = res.getString("warning"); } else { prefix = ""; } String messageString; if (params != null) { messageString = MessageFormat.format(resource, params); } else { messageString = resource; } if (listener != null) { TidyMessage msg = new TidyMessage(errorCode, (lexer != null) ? lexer.lines : 0, (lexer != null) ? lexer.columns : 0, level, messageString); listener.messageReceived(msg); } return position + prefix + messageString; } /** * Prints a message to lexer.errout after calling getMessage(). * @param errorCode tidy error code * @param lexer Lexer * @param message key for the ResourceBundle * @param params optional parameters added with MessageFormat * @param level message level. One of <code>TidyMessage.LEVEL_ERROR</code>, * <code>TidyMessage.LEVEL_WARNING</code>,<code>TidyMessage.LEVEL_INFO</code> * @see TidyMessage */ private void printMessage(int errorCode, Lexer lexer, String message, Object[] params, Level level) { String resource; try { resource = getMessage(errorCode, lexer, message, params, level); } catch (MissingResourceException e) { lexer.errout.println(e.toString()); return; } lexer.errout.println(resource); } /** * Prints a message to errout after calling getMessage(). Used when lexer is not yet defined. * @param errout PrintWriter * @param message key for the ResourceBundle * @param params optional parameters added with MessageFormat * @param level message level. One of <code>TidyMessage.LEVEL_ERROR</code>, * <code>TidyMessage.LEVEL_WARNING</code>,<code>TidyMessage.LEVEL_INFO</code> * @see TidyMessage */ private void printMessage(PrintWriter errout, String message, Object[] params, Level level) { String resource; try { resource = getMessage(-1, null, message, params, level); } catch (MissingResourceException e) { errout.println(e.toString()); return; } errout.println(resource); } /** * print version information. * @param p printWriter */ public void showVersion(PrintWriter p) { printMessage(p, "version_summary", new Object[]{RELEASE_DATE_STRING}, Level.SUMMARY); } /** * Returns a formatted tag name handling start and ent tags, nulls, doctypes, and text. * @param tag Node * @return formatted tag name */ private String getTagName(Node tag) { if (tag != null) { if (tag.type == Node.START_TAG) { return "<" + tag.element + ">"; } else if (tag.type == Node.END_TAG) { return "</" + tag.element + ">"; } else if (tag.type == Node.DOCTYPE_TAG) { return "<!DOCTYPE>"; } else if (tag.type == Node.TEXT_NODE) { return "plain text"; } else { return tag.element; } } return ""; } /** * Prints an "unknown option" error message. Lexer is not defined when this is called. * @param option unknown option name */ public void unknownOption(String option) { try { System.err.println(MessageFormat.format(res.getString("unknown_option"), new Object[]{option})); } catch (MissingResourceException e) { System.err.println(e.toString()); } } /** * Prints a "bad argument" error message. Lexer is not defined when this is called. * @param key argument name * @param value bad argument value */ public void badArgument(String key, String value) { try { System.err.println(MessageFormat.format(res.getString("bad_argument"), new Object[]{value, key})); } catch (MissingResourceException e) { System.err.println(e.toString()); } } /** * Returns a formatted String describing the current position in file. * @param lexer Lexer * @return String position ("line:column") */ private String getPosition(Lexer lexer) { try { // Change formatting to be parsable by GNU Emacs if (lexer.configuration.emacs) { return MessageFormat.format(res.getString("emacs_format"), new Object[]{ this.currentFile, new Integer(lexer.lines), new Integer(lexer.columns)}) + " "; } // traditional format return MessageFormat.format(res.getString("line_column"), new Object[]{ new Integer(lexer.lines), new Integer(lexer.columns)}); } catch (MissingResourceException e) { lexer.errout.println(e.toString()); } return ""; } /** * Prints encoding error messages. * @param lexer Lexer * @param code error code * @param c invalid char */ public void encodingError(Lexer lexer, int code, int c) { lexer.warnings++; if (lexer.errors > lexer.configuration.showErrors) // keep quiet after <showErrors> errors { return; } if (lexer.configuration.showWarnings) { String buf = Integer.toHexString(c); // An encoding mismatch is currently treated as a non-fatal error if ((code & ~DISCARDED_CHAR) == ENCODING_MISMATCH) { // actual encoding passed in "c" lexer.badChars |= ENCODING_MISMATCH; printMessage( code, lexer, "encoding_mismatch", new Object[]{ lexer.configuration.getInCharEncodingName(), ParsePropertyImpl.CHAR_ENCODING.getFriendlyName(null, new Integer(c), lexer.configuration)}, Level.WARNING); } else if ((code & ~DISCARDED_CHAR) == VENDOR_SPECIFIC_CHARS) { lexer.badChars |= VENDOR_SPECIFIC_CHARS; printMessage( code, lexer, "invalid_char", new Object[]{new Integer(code & DISCARDED_CHAR), buf}, Level.WARNING); } else if ((code & ~DISCARDED_CHAR) == INVALID_SGML_CHARS) { lexer.badChars |= INVALID_SGML_CHARS; printMessage( code, lexer, "invalid_char", new Object[]{new Integer(code & DISCARDED_CHAR), buf}, Level.WARNING); } else if ((code & ~DISCARDED_CHAR) == INVALID_UTF8) { lexer.badChars |= INVALID_UTF8; printMessage( code, lexer, "invalid_utf8", new Object[]{new Integer(code & DISCARDED_CHAR), buf}, Level.WARNING); } else if ((code & ~DISCARDED_CHAR) == INVALID_UTF16) { lexer.badChars |= INVALID_UTF16; printMessage( code, lexer, "invalid_utf16", new Object[]{new Integer(code & DISCARDED_CHAR), buf}, Level.WARNING); } else if ((code & ~DISCARDED_CHAR) == INVALID_NCR) { lexer.badChars |= INVALID_NCR; printMessage( code, lexer, "invalid_ncr", new Object[]{new Integer(code & DISCARDED_CHAR), buf}, Level.WARNING); } } } /** * Prints entity error messages. * @param lexer Lexer * @param code error code * @param entity invalid entity String * @param c invalid char */ public void entityError(Lexer lexer, short code, String entity, int c) { lexer.warnings++; if (lexer.errors > lexer.configuration.showErrors) // keep quiet after <showErrors> errors { return; } if (lexer.configuration.showWarnings) { switch (code) { case MISSING_SEMICOLON : printMessage(code, lexer, "missing_semicolon", new Object[]{entity}, Level.WARNING); break; case MISSING_SEMICOLON_NCR : printMessage(code, lexer, "missing_semicolon_ncr", new Object[]{entity}, Level.WARNING); break; case UNKNOWN_ENTITY : printMessage(code, lexer, "unknown_entity", new Object[]{entity}, Level.WARNING); break; case UNESCAPED_AMPERSAND : printMessage(code, lexer, "unescaped_ampersand", null, Level.WARNING); break; case APOS_UNDEFINED : printMessage(code, lexer, "apos_undefined", null, Level.WARNING); break; default : // should not reach here break; } } } /** * Prints error messages for attributes. * @param lexer Lexer * @param node current tag * @param attribute attribute * @param code error code */ public void attrError(Lexer lexer, Node node, AttVal attribute, short code) { if (code == UNEXPECTED_GT) { lexer.errors++; } else { lexer.warnings++; } if (lexer.errors > lexer.configuration.showErrors) // keep quiet after <showErrors> errors { return; } if (code == UNEXPECTED_GT) // error { printMessage(code, lexer, "unexpected_gt", new Object[]{getTagName(node)}, Level.ERROR); } if (!lexer.configuration.showWarnings) // warnings { return; } switch (code) { case UNKNOWN_ATTRIBUTE : printMessage(code, lexer, "unknown_attribute", new Object[]{attribute.attribute}, Level.WARNING); break; case MISSING_ATTRIBUTE : printMessage( code, lexer, "missing_attribute", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case MISSING_ATTR_VALUE : printMessage( code, lexer, "missing_attr_value", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case MISSING_IMAGEMAP : printMessage(code, lexer, "missing_imagemap", new Object[]{getTagName(node)}, Level.WARNING); lexer.badAccess |= MISSING_IMAGE_MAP; break; case BAD_ATTRIBUTE_VALUE : printMessage(code, lexer, "bad_attribute_value", new Object[]{ getTagName(node), attribute.attribute, attribute.value}, Level.WARNING); break; case XML_ID_SYNTAX : printMessage( code, lexer, "xml_id_sintax", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case XML_ATTRIBUTE_VALUE : printMessage( code, lexer, "xml_attribute_value", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case UNEXPECTED_QUOTEMARK : printMessage(code, lexer, "unexpected_quotemark", new Object[]{getTagName(node)}, Level.WARNING); break; case MISSING_QUOTEMARK : printMessage(code, lexer, "missing_quotemark", new Object[]{getTagName(node)}, Level.WARNING); break; case REPEATED_ATTRIBUTE : printMessage(code, lexer, "repeated_attribute", new Object[]{ getTagName(node), attribute.value, attribute.attribute}, Level.WARNING); break; case PROPRIETARY_ATTR_VALUE : printMessage( code, lexer, "proprietary_attr_value", new Object[]{getTagName(node), attribute.value}, Level.WARNING); break; case PROPRIETARY_ATTRIBUTE : printMessage( code, lexer, "proprietary_attribute", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case UNEXPECTED_END_OF_FILE : // on end of file adjust reported position to end of input lexer.lines = lexer.in.getCurline(); lexer.columns = lexer.in.getCurcol(); printMessage(code, lexer, "unexpected_end_of_file", new Object[]{getTagName(node)}, Level.WARNING); break; case ID_NAME_MISMATCH : printMessage(code, lexer, "id_name_mismatch", new Object[]{getTagName(node)}, Level.WARNING); break; case BACKSLASH_IN_URI : printMessage(code, lexer, "backslash_in_uri", new Object[]{getTagName(node)}, Level.WARNING); break; case FIXED_BACKSLASH : printMessage(code, lexer, "fixed_backslash", new Object[]{getTagName(node)}, Level.WARNING); break; case ILLEGAL_URI_REFERENCE : printMessage(code, lexer, "illegal_uri_reference", new Object[]{getTagName(node)}, Level.WARNING); break; case ESCAPED_ILLEGAL_URI : printMessage(code, lexer, "escaped_illegal_uri", new Object[]{getTagName(node)}, Level.WARNING); break; case NEWLINE_IN_URI : printMessage(code, lexer, "newline_in_uri", new Object[]{getTagName(node)}, Level.WARNING); break; case ANCHOR_NOT_UNIQUE : printMessage( code, lexer, "anchor_not_unique", new Object[]{getTagName(node), attribute.value}, Level.WARNING); break; case ENTITY_IN_ID : printMessage(code, lexer, "entity_in_id", null, Level.WARNING); break; case JOINING_ATTRIBUTE : printMessage( code, lexer, "joining_attribute", new Object[]{getTagName(node), attribute.attribute}, Level.WARNING); break; case UNEXPECTED_EQUALSIGN : printMessage(code, lexer, "expected_equalsign", new Object[]{getTagName(node)}, Level.WARNING); break; case ATTR_VALUE_NOT_LCASE : printMessage(code, lexer, "attr_value_not_lcase", new Object[]{ getTagName(node), attribute.value, attribute.attribute}, Level.WARNING); break; default : break; } } /** * Prints warnings. * @param lexer Lexer * @param element parent/missing tag * @param node current tag * @param code error code */ public void warning(Lexer lexer, Node element, Node node, short code) { TagTable tt = lexer.configuration.tt; if (!((code == DISCARDING_UNEXPECTED) && lexer.badForm != 0)) // lexer->errors++; already done in BadForm() { lexer.warnings++; } // keep quiet after <showErrors> errors if (lexer.errors > lexer.configuration.showErrors) { return; } if (lexer.configuration.showWarnings) { switch (code) { case MISSING_ENDTAG_FOR : printMessage(code, lexer, "missing_endtag_for", new Object[]{element.element}, Level.WARNING); break; case MISSING_ENDTAG_BEFORE : printMessage( code, lexer, "missing_endtag_before", new Object[]{element.element, getTagName(node)}, Level.WARNING); break; case DISCARDING_UNEXPECTED : if (lexer.badForm == 0) { // the case for when this is an error not a warning, is handled later printMessage( code, lexer, "discarding_unexpected", new Object[]{getTagName(node)}, Level.WARNING); } break; case NESTED_EMPHASIS : printMessage(code, lexer, "nested_emphasis", new Object[]{getTagName(node)}, Level.INFO); break; case COERCE_TO_ENDTAG : printMessage(code, lexer, "coerce_to_endtag", new Object[]{element.element}, Level.INFO); break; case NON_MATCHING_ENDTAG : printMessage( code, lexer, "non_matching_endtag", new Object[]{getTagName(node), element.element}, Level.WARNING); break; case TAG_NOT_ALLOWED_IN : printMessage( code, lexer, "tag_not_allowed_in", new Object[]{getTagName(node), element.element}, Level.WARNING); break; case DOCTYPE_AFTER_TAGS : printMessage(code, lexer, "doctype_after_tags", null, Level.WARNING); break; case MISSING_STARTTAG : printMessage(code, lexer, "missing_starttag", new Object[]{node.element}, Level.WARNING); break; case UNEXPECTED_ENDTAG : if (element != null) { printMessage( code, lexer, "unexpected_endtag_in", new Object[]{node.element, element.element}, Level.WARNING); } else { printMessage(code, lexer, "unexpected_endtag", new Object[]{node.element}, Level.WARNING); } break; case TOO_MANY_ELEMENTS : if (element != null) { printMessage( code, lexer, "too_many_elements_in", new Object[]{node.element, element.element}, Level.WARNING); } else { printMessage(code, lexer, "too_many_elements", new Object[]{node.element}, Level.WARNING); } break; case USING_BR_INPLACE_OF : printMessage(code, lexer, "using_br_inplace_of", new Object[]{getTagName(node)}, Level.WARNING); break; case INSERTING_TAG : printMessage(code, lexer, "inserting_tag", new Object[]{node.element}, Level.WARNING); break; case CANT_BE_NESTED : printMessage(code, lexer, "cant_be_nested", new Object[]{getTagName(node)}, Level.WARNING); break; case PROPRIETARY_ELEMENT : printMessage(code, lexer, "proprietary_element", new Object[]{getTagName(node)}, Level.WARNING); if (node.tag == tt.tagLayer) { lexer.badLayout |= USING_LAYER; } else if (node.tag == tt.tagSpacer) { lexer.badLayout |= USING_SPACER; } else if (node.tag == tt.tagNobr) { lexer.badLayout |= USING_NOBR; } break; case OBSOLETE_ELEMENT : if (element.tag != null && (element.tag.model & Dict.CM_OBSOLETE) != 0) { printMessage(code, lexer, "obsolete_element", new Object[]{ getTagName(element), getTagName(node)}, Level.WARNING); } else { printMessage(code, lexer, "replacing_element", new Object[]{ getTagName(element), getTagName(node)}, Level.WARNING); } break; case UNESCAPED_ELEMENT : printMessage(code, lexer, "unescaped_element", new Object[]{getTagName(element)}, Level.WARNING); break; case TRIM_EMPTY_ELEMENT : printMessage(code, lexer, "trim_empty_element", new Object[]{getTagName(element)}, Level.WARNING); break; case MISSING_TITLE_ELEMENT : printMessage(code, lexer, "missing_title_element", null, Level.WARNING); break; case ILLEGAL_NESTING : printMessage(code, lexer, "illegal_nesting", new Object[]{getTagName(element)}, Level.WARNING); break; case NOFRAMES_CONTENT : printMessage(code, lexer, "noframes_content", new Object[]{getTagName(node)}, Level.WARNING); break; case INCONSISTENT_VERSION : printMessage(code, lexer, "inconsistent_version", null, Level.WARNING); break; case MALFORMED_DOCTYPE : printMessage(code, lexer, "malformed_doctype", null, Level.WARNING); break; case CONTENT_AFTER_BODY : printMessage(code, lexer, "content_after_body", null, Level.WARNING); break; case MALFORMED_COMMENT : printMessage(code, lexer, "malformed_comment", null, Level.WARNING); break; case BAD_COMMENT_CHARS : printMessage(code, lexer, "bad_comment_chars", null, Level.WARNING); break; case BAD_XML_COMMENT : printMessage(code, lexer, "bad_xml_comment", null, Level.WARNING); break; case BAD_CDATA_CONTENT : printMessage(code, lexer, "bad_cdata_content", null, Level.WARNING); break; case INCONSISTENT_NAMESPACE : printMessage(code, lexer, "inconsistent_namespace", null, Level.WARNING); break; case DTYPE_NOT_UPPER_CASE : printMessage(code, lexer, "dtype_not_upper_case", null, Level.WARNING); break; case UNEXPECTED_END_OF_FILE : // on end of file adjust reported position to end of input lexer.lines = lexer.in.getCurline(); lexer.columns = lexer.in.getCurcol(); printMessage( code, lexer, "unexpected_end_of_file", new Object[]{getTagName(element)}, Level.WARNING); break; case NESTED_QUOTATION : printMessage(code, lexer, "nested_quotation", null, Level.WARNING); break; case ELEMENT_NOT_EMPTY : printMessage(code, lexer, "element_not_empty", new Object[]{getTagName(element)}, Level.WARNING); break; case MISSING_DOCTYPE : printMessage(code, lexer, "missing_doctype", null, Level.WARNING); break; default : break; } } if ((code == DISCARDING_UNEXPECTED) && lexer.badForm != 0) { // the case for when this is a warning not an error, is handled earlier printMessage(code, lexer, "discarding_unexpected", new Object[]{getTagName(node)}, Level.ERROR); } } /** * Prints errors. * @param lexer Lexer * @param element parent/missing tag * @param node current tag * @param code error code */ public void error(Lexer lexer, Node element, Node node, short code) { lexer.errors++; // keep quiet after <showErrors> errors if (lexer.errors > lexer.configuration.showErrors) { return; } if (code == SUSPECTED_MISSING_QUOTE) { printMessage(code, lexer, "suspected_missing_quote", null, Level.ERROR); } else if (code == DUPLICATE_FRAMESET) { printMessage(code, lexer, "duplicate_frameset", null, Level.ERROR); } else if (code == UNKNOWN_ELEMENT) { printMessage(code, lexer, "unknown_element", new Object[]{getTagName(node)}, Level.ERROR); } else if (code == UNEXPECTED_ENDTAG) { if (element != null) { printMessage( code, lexer, "unexpected_endtag_in", new Object[]{node.element, element.element}, Level.ERROR); } else { printMessage(code, lexer, "unexpected_endtag", new Object[]{node.element}, Level.ERROR); } } } /** * Prints error summary. * @param lexer Lexer */ public void errorSummary(Lexer lexer) { // adjust badAccess to that its null if frames are ok if ((lexer.badAccess & (USING_FRAMES | USING_NOFRAMES)) != 0) { if (!(((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0))) { lexer.badAccess &= ~(USING_FRAMES | USING_NOFRAMES); } } if (lexer.badChars != 0) { if ((lexer.badChars & VENDOR_SPECIFIC_CHARS) != 0) { int encodingChoiche = 0; if ("Cp1252".equals(lexer.configuration.getInCharEncodingName())) { encodingChoiche = 1; } else if ("MacRoman".equals(lexer.configuration.getInCharEncodingName())) { encodingChoiche = 2; } printMessage(VENDOR_SPECIFIC_CHARS, lexer, "vendor_specific_chars_summary", new Object[]{new Integer( encodingChoiche)}, Level.SUMMARY); } if ((lexer.badChars & INVALID_SGML_CHARS) != 0 || (lexer.badChars & INVALID_NCR) != 0) { int encodingChoiche = 0; if ("Cp1252".equals(lexer.configuration.getInCharEncodingName())) { encodingChoiche = 1; } else if ("MacRoman".equals(lexer.configuration.getInCharEncodingName())) { encodingChoiche = 2; } printMessage(INVALID_SGML_CHARS, lexer, "invalid_sgml_chars_summary", new Object[]{new Integer( encodingChoiche)}, Level.SUMMARY); } if ((lexer.badChars & INVALID_UTF8) != 0) { printMessage(INVALID_UTF8, lexer, "invalid_utf8_summary", null, Level.SUMMARY); } if ((lexer.badChars & INVALID_UTF16) != 0) { printMessage(INVALID_UTF16, lexer, "invalid_utf16_summary", null, Level.SUMMARY); } if ((lexer.badChars & INVALID_URI) != 0) { printMessage(INVALID_URI, lexer, "invaliduri_summary", null, Level.SUMMARY); } } if (lexer.badForm != 0) { printMessage(BADFORM_SUMMARY, lexer, "badform_summary", null, Level.SUMMARY); } if (lexer.badAccess != 0) { if ((lexer.badAccess & MISSING_SUMMARY) != 0) { printMessage(MISSING_SUMMARY, lexer, "badaccess_missing_summary", null, Level.SUMMARY); } if ((lexer.badAccess & MISSING_IMAGE_ALT) != 0) { printMessage(MISSING_IMAGE_ALT, lexer, "badaccess_missing_image_alt", null, Level.SUMMARY); } if ((lexer.badAccess & MISSING_IMAGE_MAP) != 0) { printMessage(MISSING_IMAGE_MAP, lexer, "badaccess_missing_image_map", null, Level.SUMMARY); } if ((lexer.badAccess & MISSING_LINK_ALT) != 0) { printMessage(MISSING_LINK_ALT, lexer, "badaccess_missing_link_alt", null, Level.SUMMARY); } if (((lexer.badAccess & USING_FRAMES) != 0) && ((lexer.badAccess & USING_NOFRAMES) == 0)) { printMessage(USING_FRAMES, lexer, "badaccess_frames", null, Level.SUMMARY); } printMessage(BADACCESS_SUMMARY, lexer, "badaccess_summary", new Object[]{ACCESS_URL}, Level.SUMMARY); } if (lexer.badLayout != 0) { if ((lexer.badLayout & USING_LAYER) != 0) { printMessage(USING_LAYER, lexer, "badlayout_using_layer", null, Level.SUMMARY); } if ((lexer.badLayout & USING_SPACER) != 0) { printMessage(USING_SPACER, lexer, "badlayout_using_spacer", null, Level.SUMMARY); } if ((lexer.badLayout & USING_FONT) != 0) { printMessage(USING_FONT, lexer, "badlayout_using_font", null, Level.SUMMARY); } if ((lexer.badLayout & USING_NOBR) != 0) { printMessage(USING_NOBR, lexer, "badlayout_using_nobr", null, Level.SUMMARY); } if ((lexer.badLayout & USING_BODY) != 0) { printMessage(USING_BODY, lexer, "badlayout_using_body", null, Level.SUMMARY); } } } /** * Prints the "unknown option" message. * @param errout PrintWriter * @param c invalid option char */ public void unknownOption(PrintWriter errout, char c) { printMessage(errout, "unrecognized_option", new Object[]{new String(new char[]{c})}, Level.ERROR); } /** * Prints the "unknown file" message. * @param errout PrintWriter * @param file invalid file name */ public void unknownFile(PrintWriter errout, String file) { printMessage(errout, "unknown_file", new Object[]{"Tidy", file}, Level.ERROR); } /** * Prints the "needs author intervention" message. * @param errout PrintWriter */ public void needsAuthorIntervention(PrintWriter errout) { printMessage(errout, "needs_author_intervention", null, Level.SUMMARY); } /** * Prints the "missing body" message. * @param errout PrintWriter */ public void missingBody(PrintWriter errout) { printMessage(errout, "missing_body", null, Level.ERROR); } /** * Prints the number of generated slides. * @param errout PrintWriter * @param count slides count */ public void reportNumberOfSlides(PrintWriter errout, int count) { printMessage(errout, "slides_found", new Object[]{new Integer(count)}, Level.SUMMARY); } /** * Prints tidy general info. * @param errout PrintWriter */ public void generalInfo(PrintWriter errout) { printMessage(errout, "general_info", null, Level.SUMMARY); } /** * Sets the current file name. * @param filename current file. */ public void setFilename(String filename) { this.currentFile = filename; // for use with Gnu Emacs } /** * Prints information for html version in input file. * @param errout PrintWriter * @param lexer Lexer * @param filename file name * @param doctype doctype Node */ public void reportVersion(PrintWriter errout, Lexer lexer, String filename, Node doctype) { int i, c; int state = 0; String vers = lexer.htmlVersionName(); int[] cc = new int[1]; // adjust reported position to first line lexer.lines = 1; lexer.columns = 1; if (doctype != null) { StringBuffer doctypeBuffer = new StringBuffer(); for (i = doctype.start; i < doctype.end; ++i) { c = doctype.textarray[i]; // look for UTF-8 multibyte character if (c < 0) { i += PPrint.getUTF8(doctype.textarray, i, cc); c = cc[0]; } if (c == '"') { ++state; } else if (state == 1) { doctypeBuffer.append((char) c); } } printMessage( DOCTYPE_GIVEN_SUMMARY, lexer, "doctype_given", new Object[]{filename, doctypeBuffer}, Level.SUMMARY); } printMessage(REPORT_VERSION_SUMMARY, lexer, "report_version", new Object[]{ filename, (vers != null ? vers : "HTML proprietary")}, Level.SUMMARY); } /** * Prints the number of error/warnings found. * @param errout PrintWriter * @param lexer Lexer */ public void reportNumWarnings(PrintWriter errout, Lexer lexer) { if (lexer.warnings > 0 || lexer.errors > 0) { printMessage( errout, "num_warnings", new Object[]{new Integer(lexer.warnings), new Integer(lexer.errors)}, Level.SUMMARY); } else { printMessage(errout, "no_warnings", null, Level.SUMMARY); } } /** * Prints tidy help. * @param out PrintWriter */ public void helpText(PrintWriter out) { printMessage(out, "help_text", new Object[]{"Tidy", RELEASE_DATE_STRING}, Level.SUMMARY); } /** * Prints the "bad tree" message. * @param errout PrintWriter */ public void badTree(PrintWriter errout) { printMessage(errout, "bad_tree", null, Level.ERROR); } /** * Adds a message listener. * @param listener TidyMessageListener */ public void addMessageListener(TidyMessageListener listener) { this.listener = listener; } }
[ "dreamYphone@gmail.com" ]
dreamYphone@gmail.com
a859a464738b6091e01e8b9b0222576578bea744
2f2a85265d85e04d0e9acd1c36c99c13efe88a2f
/src/main/java/car/Car.java
12ad584fccaca8c7147428afdeaaaa3ce81e2402
[]
no_license
KhomchenkoAlex/DZ4.2AOP
1163e6280dd6583b81cc93140dd0ddd6c6170fd1
743de23c9836537fdee5d37d5517c78542e630a3
refs/heads/master
2021-01-22T07:35:51.025579
2017-02-16T10:09:48
2017-02-16T10:09:48
81,836,752
0
0
null
null
null
null
UTF-8
Java
false
false
1,123
java
package car; import car.autoparts.Engine; import car.autoparts.Wheel; import car.carexception.BrokenWheelException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * Created by alex on 01.02.17. */ @Component public class Car { Wheel wheel; Engine engine; @Autowired public void setEngine(Engine engine) { this.engine = engine; } @Autowired public void setWheel(Wheel wheel) { this.wheel = wheel; } public void startCar() { engine.startEngine(); System.out.println("The car moves."); try { wheel.revolveWheels(); } catch (BrokenWheelException bwe) { System.out.println("You broke the wheel."); } } public void stopCar() { engine.stopEngine(); System.out.println("The car stops."); } public String carToString() { String res = "This car has "; res = res + engine.getEngineCapacity() + "cc engine capacity and wheels with " + wheel.getTyres() + " tyres."; return res; } }
[ "brenn@ukr.net" ]
brenn@ukr.net
5b670d8c3760ae8d1952eebd5d1746859477a6a6
df2d44d1ee7a71f2bba3b7078ec742265b5cc2f4
/org.eclipse.papyrus.gsn.pattern/src/org/InstantiationoftheRiskManagement/Class14.java
fb6985ec68f96d4fc7ab9dd3f2346bd30ece8cd6
[]
no_license
yassinebj3/AssuranceCaseEditorGSN
3b9d0ba1500bb43caf89cd831a886c7c831f9abe
9cedceb2518920569da666140c50e8e88ec91034
refs/heads/master
2020-04-22T07:33:10.046742
2019-02-12T00:12:58
2019-02-12T00:12:58
170,220,149
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
/** */ package org.InstantiationoftheRiskManagement; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Class14</b></em>'. * <!-- end-user-doc --> * * * @see org.InstantiationoftheRiskManagement.InstantiationoftheRiskManagementPackage#getClass14() * @model * @generated */ public interface Class14 extends EObject { } // Class14
[ "yassinebj3@gmail.com" ]
yassinebj3@gmail.com
75c0e1e5b5bcd2c439657d54c1547d3c766b76b2
a850de9fb115ce201b53e535de9cea099d49b3f9
/core/src/com/vhelium/lotig/scene/gamescene/spells/druid/SpellEnrageSpirit.java
48159dd1576d6fc89cbf9e58e2a79488bdf2889f
[]
no_license
Vhelium/lotig
7e491e900d49013ba7d4291e796f1f8ded31b140
ec705be2893956580c53c368eac3a2ebb941a221
refs/heads/master
2021-01-05T23:20:20.071423
2014-10-24T22:28:17
2014-10-24T22:28:17
241,164,835
0
0
null
null
null
null
UTF-8
Java
false
false
3,296
java
package com.vhelium.lotig.scene.gamescene.spells.druid; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import com.vhelium.lotig.scene.connection.DataPacket; import com.vhelium.lotig.scene.connection.MessageType; import com.vhelium.lotig.scene.gamescene.SoundFile; import com.vhelium.lotig.scene.gamescene.server.EntityServerMinion; import com.vhelium.lotig.scene.gamescene.server.Realm; import com.vhelium.lotig.scene.gamescene.spells.Spell; public class SpellEnrageSpirit extends Spell { public static String name = "Enrage Spirit"; public static String effectAsset = "Rage"; public static float cooldownBase = 25000f; public static float cooldownPerLevel = 500f; public static float manaCostBase = 120; public static float manaCostPerLevel = 12; public static float dmgBase = 10; public static float dmgPerLevel = 2; public static int asBase = 200; public static int asPerLevel = 12; public static int durationBase = 6000; public static int durationPerLevel = 300; public SpellEnrageSpirit() { instantCast = true; } //>>>>>>>>>>>>>>>> CLIENT vvv >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @Override public String getName() { return name; } @Override public String getDescription() { return "Enrage your spirits and give them a temporary attack speed and damage buff.\n\nBonus attack speed: " + getAS(getLevel()) + "\nBonus damage: " + getDMG(getLevel()) + "\nDuration: " + (getDuration(getLevel()) / 1000) + " seconds"; } @Override public float getManaCost() { return getManaCostStatic(getLevel()); } @Override public float getCooldown() { return cooldownBase + cooldownPerLevel * (getLevel() - 1); } @Override public DataPacket generateRequest(float x, float y, float rotation, float dirX, float dirY) { DataPacket dp = new DataPacket(); dp.setInt(MessageType.MSG_SPELL_REQUEST); dp.setString(name); dp.setInt(getLevel()); return dp; } //>>>>>>>>>>>>>>>> SERVER vvv >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> public static void activate(int shooterId, int spellLevel, DataPacket dp, Realm realm) { if(realm.getPlayer(shooterId) == null) return; List<EntityServerMinion> minions = realm.getPlayer(shooterId).getMinions(SpellSummonSpirit.minionName); ConcurrentHashMap<String, Integer> buffs = new ConcurrentHashMap<String, Integer>(); buffs.put("AS", getAS(spellLevel)); buffs.put("DMG", getDMG(spellLevel)); for(EntityServerMinion minion : minions) { realm.requestCondition(minion.Nr, "Enraged", buffs, getDuration(spellLevel), true, effectAsset, System.currentTimeMillis()); } if(minions.size() < 1) realm.playSound(shooterId, SoundFile.spell_failed); else realm.playSound(SoundFile.spell_attack_up, realm.getPlayer(shooterId).getOriginX(), realm.getPlayer(shooterId).getOriginY()); } public static float getManaCostStatic(int level) { return manaCostBase + manaCostPerLevel * (level - 1); } public static int getAS(int level) { return asBase + asPerLevel * (level - 1); } public static int getDMG(int level) { return (int) (dmgBase + dmgPerLevel * (level - 1)); } public static int getDuration(int level) { return durationBase + durationPerLevel * (level - 1); } }
[ "vhelium@vheliumpc" ]
vhelium@vheliumpc
504ed9369848364903d92b864625fb970d363901
4cea9f2e44e8cd083f55416392a389922773cda9
/RockScissorPaper.java
4c7f8bb032f746302878bf2667ea0b17807bb980
[]
no_license
parkhoyoung/201311213
5eb0a22bbfdcf1297f9933e91dadac9c2015507c
d5e3439aa9ccdeaea2bbab2e4f1b273c870d3313
refs/heads/master
2021-01-22T15:22:15.179905
2016-12-12T05:50:00
2016-12-12T05:50:00
68,571,899
0
0
null
null
null
null
UTF-8
Java
false
false
1,124
java
class RockScissorPaper{ String p1; String p2; RockScissorPaper(String a,String b){ p1=a; p2=b; } void play(){ if(p1.equals("rock")){ if(p2.equals("rock")){ System.out.println("Draw"); } else if(p2.equals("scissor")){ System.out.println("player 1 Win"); } else if(p2.equals("paper")){ System.out.println("player 2 Win "); } } else if(p1.equals("scissor")){ if(p2.equals("rock")){ System.out.println("player 2 Win"); } else if(p2.equals("scissor")){ System.out.println("Draw"); } else if(p2.equals("paper")){ System.out.println("player 1 Win"); } } else if(p1.equals("paper")){ if(p2.equals("rock")){ System.out.println("player 1 Win"); } else if(p2.equals("scissor")){ System.out.println("player 2 Win."); } else if(p2.equals("paper")){ System.out.println("Draw"); } } else{ System.out.println("Wrong Input"); } } public static void main(String[] args) { RockScissorPaper r=new RockScissorPaper("paper", "scissor"); r.play(); } }
[ "noreply@github.com" ]
noreply@github.com
94d0892eb50143aa3572d416d2cbe1bf9fd7ba84
ef4196a140cb166684b60cc3ab975c991680be4c
/src/main/java/pl/lublin/zeto/hermesJpaHelper/ArticleRepository.java
c2acd29ad6fa7f3f15dbc7285929b439d60a7fac
[]
no_license
Dragonis/h2-database-with-jpa-library
010e025b48f4ea3b59ee3fb524d14c187f6427db
5532c03f6b537c79370ecc48ee82be26741b918d
refs/heads/master
2021-01-15T22:51:58.153532
2017-09-12T12:35:09
2017-09-12T12:35:09
99,922,173
0
0
null
null
null
null
UTF-8
Java
false
false
631
java
package pl.lublin.zeto.hermesJpaHelper; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import java.util.List; public interface ArticleRepository extends JpaRepository<Article, Long>, JpaSpecificationExecutor<Article> { @Query("SELECT a FROM Article a ") List<Article> findData(Specification<Article> test, Pageable pageable); }
[ "wojciech.sasiela@zeto.lublin.pl" ]
wojciech.sasiela@zeto.lublin.pl
d84258815df5fd3b15148aec8a6d56a6b5384d85
a5173784fd2fc27e0999896cdabf8ab32261139e
/src/main/java/com/nit/wx/util/SHA1.java
e4a28e51d555124cc3cc55a65004186d1a56a81d
[]
no_license
littlehen/wx
3ef6d9863f7c1f76ab794be0c75ba94449c6f298
2f06bf09b1836205a409db3a6aebb278471f6dc7
refs/heads/master
2020-03-11T03:45:55.585755
2018-05-11T09:34:34
2018-05-11T09:34:34
129,392,310
0
0
null
null
null
null
UTF-8
Java
false
false
1,524
java
/** * 对公众平台发送给公众账号的消息加解密示例代码. * * @copyright Copyright (c) 1998-2014 Tencent Inc. */ // ------------------------------------------------------------------------ package com.nit.wx.util; import java.security.MessageDigest; import java.util.Arrays; /** * SHA1 class * * 计算公众平台的消息签名接口. */ class SHA1 { /** * 用SHA1算法生成安全签名 * @param token 票据 * @param timestamp 时间戳 * @param nonce 随机字符串 * @param encrypt 密文 * @return 安全签名 * @throws AesException */ public static String getSHA1(String token, String timestamp, String nonce, String encrypt) throws AesException { try { String[] array = new String[] { token, timestamp, nonce, encrypt }; StringBuffer sb = new StringBuffer(); // 字符串排序 Arrays.sort(array); for (int i = 0; i < 4; i++) { sb.append(array[i]); } String str = sb.toString(); // SHA1签名生成 MessageDigest md = MessageDigest.getInstance("SHA-1"); md.update(str.getBytes()); byte[] digest = md.digest(); StringBuffer hexstr = new StringBuffer(); String shaHex = ""; for (int i = 0; i < digest.length; i++) { shaHex = Integer.toHexString(digest[i] & 0xFF); if (shaHex.length() < 2) { hexstr.append(0); } hexstr.append(shaHex); } return hexstr.toString(); } catch (Exception e) { e.printStackTrace(); throw new AesException(AesException.ComputeSignatureError); } } }
[ "1036383548@qq.com" ]
1036383548@qq.com
41c0eb8b16565a43002d42605f1b70e23ef74d92
6c7060d8cebe485d47bdc19590aa8ef3b8410a64
/app/src/main/java/com/example/lvpeiling/nodddle/network/OkHttpClientManager.java
b5645b972c63be3b07615e2675a5c40c641133fc
[]
no_license
PellingLyu/Nodddle
7ebd01fa808574aff60bce43c3e9c27f9e93c6c2
7cb9bfebad31daec69b9b63019661cfcf1286a3b
refs/heads/master
2021-01-20T15:26:28.859715
2017-06-12T16:05:09
2017-06-12T16:05:09
90,648,824
0
0
null
null
null
null
UTF-8
Java
false
false
7,398
java
package com.example.lvpeiling.nodddle.network; import android.os.Handler; import android.util.Log; import android.webkit.CookieManager; import com.alibaba.fastjson.JSONArray; import com.example.lvpeiling.nodddle.NodddleApplication; import java.io.IOException; import java.net.CookiePolicy; import java.util.Map; import java.util.concurrent.TimeUnit; import okhttp3.Call; import okhttp3.Callback; import okhttp3.FormBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; /** * Created by lvpeiling on 2017/5/3. */ public class OkHttpClientManager { private static final String TAG = "OkHttpClientManager"; private static OkHttpClientManager mOkHttpInstance; private OkHttpClient mOkHttpClient; private Handler mHandler; public static OkHttpClientManager getInstance(){ if(mOkHttpInstance == null){ synchronized (OkHttpClientManager.class) { if (mOkHttpInstance == null) { mOkHttpInstance = new OkHttpClientManager(); } } } return mOkHttpInstance; } private OkHttpClientManager(){ mOkHttpClient = new OkHttpClient(); //30秒后超时 mOkHttpClient.newBuilder().connectTimeout(10, TimeUnit.SECONDS); mHandler = new Handler(); } /** * Get同步 * @param url * @param params * @return * @throws IOException */ public Response getSyncForResponse(String url, Map<String, Object> params) throws IOException { Call call = getData(Method.GET,url,params); return call.execute(); } /** * Get同步 * @param url * @param params * @return * @throws IOException */ public String getSyncForString(String url, Map<String, Object> params) throws IOException { Call call = getData(Method.GET,url,params); return call.execute().body().string(); } public void getAsync(String url,Map<String, Object> params,ResultCallBack callBack){ Call call = getData(Method.GET,url,params); if(call != null){ resultCallBack(call,callBack); } } private void resultCallBack(Call call, final ResultCallBack callBack) { call.enqueue(new Callback() { @Override public void onFailure(final Call call,final IOException e) { mHandler.post(new Runnable() { @Override public void run() { callBack.onError(call,e); } }); } @Override public void onResponse(Call call, final Response response) throws IOException { mHandler.post(new Runnable() { @Override public void run() { callBack.onResponse(response); } }); } }); } /** * post异步 * @param url * @param params * @param callBack */ public void postAsync(String url, Map<String, Object> params, ResultCallBack callBack){ Call call = getData(Method.POST,url,params); if(call != null){ resultCallBack(call,callBack); } } public void deleteAsync(String url, Map<String, Object> params, ResultCallBack callBack){ Call call = getData(Method.DELETE,url,params); if(call != null){ resultCallBack(call,callBack); } } public void putAsync(String url, Map<String, Object> params, ResultCallBack callBack){ Call call = getData(Method.PUT,url,params); if(call != null){ resultCallBack(call,callBack); } } private Call getData(Method method, String url, Map<String, Object> params) { Request request = null; Request.Builder build = null; switch (method) { case GET: if (params != null) { url = getParamUrl(url, params); } build = new Request.Builder().url(url); if(NodddleApplication.getInstance().getTokenCode() != null){ build.addHeader("Authorization", "bearer " + NodddleApplication.getInstance().getTokenCode()); }else { return null; } request = build.build(); return mOkHttpClient.newCall(request); case POST: FormBody.Builder builder = new FormBody.Builder(); if (params != null) { for (String key : params.keySet()) { builder.add(key, (String) params.get(key)); } } build = new Request.Builder().url(url).post(builder.build()); if(NodddleApplication.getInstance().getTokenCode() != null){ build.addHeader("Authorization", "bearer " + NodddleApplication.getInstance().getTokenCode()); }else { return null; } request = build.build(); return mOkHttpClient.newCall(request); case PUT: FormBody.Builder builderPut = new FormBody.Builder(); if (params != null) { for (String key : params.keySet()) { builderPut.add(key, (String) params.get(key)); } } build = new Request.Builder().url(url).put(builderPut.build()); if(NodddleApplication.getInstance().getTokenCode() != null){ build.addHeader("Authorization", "bearer " + NodddleApplication.getInstance().getTokenCode()); }else { return null; } request = build.build(); return mOkHttpClient.newCall(request); case DELETE: FormBody.Builder builderDele = new FormBody.Builder(); if (params != null) { for (String key : params.keySet()) { builderDele.add(key, (String) params.get(key)); } } build = new Request.Builder().url(url).delete(builderDele.build()); if(NodddleApplication.getInstance().getTokenCode() != null){ build.addHeader("Authorization", "bearer " + NodddleApplication.getInstance().getTokenCode()); }else { return null; } request = build.build(); return mOkHttpClient.newCall(request); default: Log.e(TAG,"method is not correct!"); return null; } } private String getParamUrl(String url, Map<String, Object> params) { StringBuilder sb = new StringBuilder(); sb.append(url+"?"); for (String key : params.keySet()) { sb.append(key); sb.append("="); sb.append((String) params.get(key)); sb.append("&"); } sb.deleteCharAt(sb.length()-1); return sb.toString(); } }
[ "lpl7225473@gmail.com" ]
lpl7225473@gmail.com
9d0a629e6c2fb3b11ae3c89718bbbcf5ee4538ae
d6c7057af916f1c7b01877dac2e2354994bb082b
/src/BroadcastBestPractice/src/com/example/broadcastbestpractice/MainActivity.java
673fdb023eec3551a4692224020d6bec38519cbc
[]
no_license
Saeedaqlan6/Source-code-of-The-first-line-of-Android
4d1f545edcd6b917d1a0acc1b7be5b0f31290aad
8e40dc15389681ca68e28c07ada687e38e91459f
refs/heads/master
2021-01-01T18:44:58.648496
2015-02-23T12:57:09
2015-02-23T12:57:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package com.example.broadcastbestpractice; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button forceOffline = (Button) findViewById(R.id.force_offline); forceOffline.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v){ Intent intent = new Intent("com.example.broadcastbestpractice.FORCE_OFFLINE"); sendBroadcast(intent);; } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "freedomzzq@gmail.com" ]
freedomzzq@gmail.com
8934703b6d0ae82c3d26d152299c2495b52b30d2
99c03face59ec13af5da080568d793e8aad8af81
/hom_classifier/2om_classifier/scratch/SDL20CDL5/Pawn.java
734ebc31941bf0f59e7ceccf2c910d56421477fe
[]
no_license
fouticus/HOMClassifier
62e5628e4179e83e5df6ef350a907dbf69f85d4b
13b9b432e98acd32ae962cbc45d2f28be9711a68
refs/heads/master
2021-01-23T11:33:48.114621
2020-05-13T18:46:44
2020-05-13T18:46:44
93,126,040
0
0
null
null
null
null
UTF-8
Java
false
false
3,739
java
// This is a mutant program. // Author : ysma import java.util.ArrayList; public class Pawn extends ChessPiece { public Pawn( ChessBoard board, ChessPiece.Color color ) { super( board, color ); } public java.lang.String toString() { if (color == ChessPiece.Color.WHITE) { return "♙"; } else { return "♟"; } } public java.util.ArrayList<String> legalMoves() { java.util.ArrayList<String> returnList = new java.util.ArrayList<String>(); if (this.getColor().equals( ChessPiece.Color.WHITE )) { int currentCol = this.getColumn(); int nextRow = this.getRow() + 1; if (nextRow <= 7) { if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) { returnList.add( onePossibleMove( nextRow, currentCol ) ); } } if (true) { int nextNextRow = this.getRow(); if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) { returnList.add( onePossibleMove( nextNextRow, currentCol ) ); } } int leftColumn = currentCol - 1; int rightColumn = currentCol + 1; if (leftColumn >= 0) { if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) { if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) { returnList.add( onePossibleMove( nextRow, leftColumn ) ); } } } if (rightColumn <= 7) { if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) { if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) { returnList.add( onePossibleMove( nextRow, rightColumn ) ); } } } } else { int currentCol = this.getColumn(); int nextRow = this.getRow() - 1; if (nextRow >= 0) { if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) { returnList.add( onePossibleMove( nextRow, currentCol ) ); } } if (this.getRow() == 6) { int nextNextRow = this.getRow() - 2; if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) { returnList.add( onePossibleMove( nextNextRow, currentCol ) ); } } int leftColumn = currentCol - 1; int rightColumn = currentCol + 1; if (leftColumn >= 0) { if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) { if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) { returnList.add( onePossibleMove( nextRow, leftColumn ) ); } } } if (rightColumn <= 7) { if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) { if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) { returnList.add( onePossibleMove( nextRow, rightColumn ) ); } } } } return returnList; } }
[ "fout.alex@gmail.com" ]
fout.alex@gmail.com
40943217bc85860684fd55d1193fe02d84afd9af
5376380c63aabba9aa547652a8d7069fa3fe664a
/app/src/main/java/com/example/notebook/Math/MathViewModel.java
3a394b39166dd14d59f1b975ff1a0fd166716b7d
[]
no_license
BaristaCoffeeCup/NoteBook
34fdc211c5b5939b6dc855d291375a16dc75dad9
4623339f2ba35e4895ef62cb29cf6317c536211a
refs/heads/master
2023-07-05T23:47:03.226164
2020-11-30T14:39:08
2020-11-30T14:39:08
317,251,886
0
0
null
null
null
null
UTF-8
Java
false
false
123
java
package com.example.notebook.Math; import androidx.lifecycle.ViewModel; public class MathViewModel extends ViewModel { }
[ "57087009+BaristaCoffeeCup@users.noreply.github.com" ]
57087009+BaristaCoffeeCup@users.noreply.github.com
d68040e70453047c1229425edc6222c81ac000ef
e4bb6c867b62b8bf18bf789f744b82d00ce56a2f
/app/src/main/java/vmax/com/sumuhurtham/activities/WebView_Activity.java
1659d11b195e0d318358eb4edcef1f532a9da923
[]
no_license
VattipalliSridhar/Sum
5f04406cef2cb07f531cd31697a77478bc1db95b
a69c46d7ee5a7ef15bd59084b22e49010d384de8
refs/heads/master
2020-08-23T04:02:57.937758
2019-10-21T10:27:26
2019-10-21T10:27:26
216,539,558
0
0
null
null
null
null
UTF-8
Java
false
false
3,579
java
package vmax.com.sumuhurtham.activities; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.app.ProgressDialog; import android.os.Bundle; import android.util.Log; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.TextView; import vmax.com.sumuhurtham.R; public class WebView_Activity extends AppCompatActivity { private String web_data,value; private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view_); findViewById(R.id.back_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { WebView_Activity.this.finish(); } }); TextView txt_web_page = findViewById(R.id.txt_web_page); webView =findViewById(R.id.web_view_page); web_data = getIntent().getStringExtra("web_img"); value = getIntent().getStringExtra("value"); Log.e("msg",""+web_data); if(value.equals("img")) { String html = "<html><head></head><body> <img src=\""+ web_data + "\" > </body></html>"; webView.loadDataWithBaseURL("", html, "text/html", "UTF-8", ""); //This the the enabling of the zoom controls webView.getSettings().setBuiltInZoomControls(true); //This will zoom out the WebView webView.getSettings().setUseWideViewPort(true); webView.getSettings().setLoadWithOverviewMode(true); webView.setInitialScale(120); }else { startWebView(web_data); } } private void startWebView(String url) { //Create new webview Client to show progress dialog //When opening a url or click on link webView.setWebViewClient(new WebViewClient() { ProgressDialog progressDialog; //If you will not use this method url links are opeen in new brower not in webview public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } //Show loader on url load public void onLoadResource (WebView view, String url) { if (progressDialog == null) { // in standard case YourActivity.this progressDialog = new ProgressDialog(WebView_Activity.this); progressDialog.setMessage("Loading..."); progressDialog.show(); } } public void onPageFinished(WebView view, String url) { try{ //if (progressDialog.isShowing()) { progressDialog.dismiss(); //progressDialog = null; //} }catch(Exception exception){ exception.printStackTrace(); } } }); // Javascript inabled on webview webView.getSettings().setJavaScriptEnabled(true); //Load url in webview webView.loadUrl(url); } @Override // Detect when the back button is pressed public void onBackPressed() { if(webView.canGoBack()) { webView.goBack(); } else { // Let the system handle the back button super.onBackPressed(); } } }
[ "vattipallisridhar4u@gmail.com" ]
vattipallisridhar4u@gmail.com
81fb4d3d1ca89028dbc93b78d578bbadfb9da9e4
0a54d471036e17d9ac14a3245ffe9b4c3fcdf350
/BioMightWeb/src/biomight/body/organ/largeintestine/SigmoidFlexure.java
7a0faea9a26b0316963ba0d5bfb6eb205827979f
[ "Apache-2.0" ]
permissive
SurferJim/BioMight
b5914ee74b74321b22f1654aa465c6f49152a20a
3dc2c2b21bc6ece2ca9ac44f0727a433ae9f9430
refs/heads/master
2022-04-07T08:51:18.627053
2020-02-26T17:22:15
2020-02-26T17:22:15
97,385,911
3
1
null
null
null
null
UTF-8
Java
false
false
2,943
java
/* * Created on Oct 21, 2006 * * To change the template for this generated file go to * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments */ package biomight.body.organ.largeintestine; import java.util.ArrayList; import biomight.BioMightBase; import biomight.Constants; import biomight.view.BioMightMethodView; import biomight.view.BioMightPropertyView; /** * @author SurferJim * * Representation of the SigmoidFlexure * */ public class SigmoidFlexure extends BioMightBase { private ArrayList<BioMightPropertyView> properties; private ArrayList<BioMightMethodView> methods; public SigmoidFlexure() { this.setImage("images/SigmoidFlexure.jpg"); this.setImageHeight(300); this.setImageWidth(300); initProperties(); initMethods(); } public void initProperties() { properties = new ArrayList<BioMightPropertyView>(); BioMightPropertyView property = new BioMightPropertyView(); property.setPropertyName("Stapes ---"); property.setCanonicalName(Constants.LeftEar); properties.add(property); } public void initMethods() { methods = new ArrayList<BioMightMethodView>(); BioMightMethodView method = new BioMightMethodView(); method = new BioMightMethodView(); method.setMethodName("Deafness"); method.setHtmlType("checkbox"); methods.add(method); method = new BioMightMethodView(); method.setMethodName("Hear"); method.setHtmlType("checkbox"); methods.add(method); } /******************************************************************************************************************** * GET X3D * * This method will return the X3D for the Cell. It runs through each of its components and collects up their * representations and then assembles them into one unified X3D model. * ********************************************************************************************************************/ public String getX3D(boolean snipet) { // Assemble the SigmoidFlexure String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.0//EN\" \"http://www.web3d.org/specifications/x3d-3.0.dtd\">\n " + "<X3D profile='Immersive' >\n" + "<head>\n" + "<meta name='BioMightImage' content='SigmoidFlexure.jpg'/>\n" + "<meta name='ExportTime' content='7:45:30'/>\n" + "<meta name='ExportDate' content='08/15/2008'/>\n" + "<meta name='BioMight Version' content='1.0'/>\n" + "</head>\n" + "<Scene>\n" + "<WorldInfo\n" + "title='SigmoidFlexure'\n" + "info='\"BioMight Generated X3D\"'/>\n"; String body = "";//leftEar.getX3D(true) + rightEar.getX3D(true); System.out.println("SigmoidFlexure X3D: " + body); String footer = "</Scene>" + "</X3D>\n"; if (snipet) return body; else return header + body + footer; } }
[ "noreply@github.com" ]
noreply@github.com
9cfbe7ade44ed7ef1a40845b29304be615ea0da1
3cd69da4d40f2d97130b5bf15045ba09c219f1fa
/sources/com/google/firebase/firestore/FirebaseFirestore$$Lambda$4.java
777648ca357820329a2d6c8475af83aff4d86c41
[]
no_license
TheWizard91/Album_base_source_from_JADX
946ea3a407b4815ac855ce4313b97bd42e8cab41
e1d228fc2ee550ac19eeac700254af8b0f96080a
refs/heads/master
2023-01-09T08:37:22.062350
2020-11-11T09:52:40
2020-11-11T09:52:40
311,927,971
0
0
null
null
null
null
UTF-8
Java
false
false
874
java
package com.google.firebase.firestore; import com.google.firebase.firestore.core.AsyncEventListener; /* compiled from: FirebaseFirestore */ final /* synthetic */ class FirebaseFirestore$$Lambda$4 implements ListenerRegistration { private final FirebaseFirestore arg$1; private final AsyncEventListener arg$2; private FirebaseFirestore$$Lambda$4(FirebaseFirestore firebaseFirestore, AsyncEventListener asyncEventListener) { this.arg$1 = firebaseFirestore; this.arg$2 = asyncEventListener; } public static ListenerRegistration lambdaFactory$(FirebaseFirestore firebaseFirestore, AsyncEventListener asyncEventListener) { return new FirebaseFirestore$$Lambda$4(firebaseFirestore, asyncEventListener); } public void remove() { FirebaseFirestore.lambda$addSnapshotsInSyncListener$4(this.arg$1, this.arg$2); } }
[ "agiapong@gmail.com" ]
agiapong@gmail.com
1ef4a79c44a73c44c6d714c042d834db278a9c26
75609d190eebed1960e9103d6c83d840f2881022
/src/LaMenteMasRapida/Server/LaMenteMasRapidaImpl.java
b2dae965e41389b2aa5bd6667e4b56334c0119b3
[]
no_license
ekam02/La-mente-mas-rapida
37507b1a0e6c305f43e4d8714c4eaa646a949c3d
f33aa6272674427d018239ebc7e793e32f8c94c2
refs/heads/master
2020-12-01T12:00:25.422699
2016-09-09T18:25:35
2016-09-09T18:25:35
67,822,483
0
0
null
null
null
null
UTF-8
Java
false
false
5,829
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package LaMenteMasRapida.Server; import LaMenteMasRapida.Interface.InterfaceMenteRapida; import java.util.ArrayList; public class LaMenteMasRapidaImpl implements InterfaceMenteRapida{ ArrayList <Usuario> Usuarios; public ArrayList MasRapido; Integer respu; public static boolean yaHayPartida = false; String[] vectorsig; Integer[] vectornum; String[] vectorres; Tiempo tiempo; Preguntas pregunt; public int i,t,p; String masrap=""; public LaMenteMasRapidaImpl () { Usuarios = new ArrayList<Usuario>(); MasRapido = new ArrayList(); tiempo = new Tiempo(this); pregunt =new Preguntas(); i=0;t=0;p=0; } @Override public boolean IniciarSesion(String nombre) { boolean agregado; boolean encontrado = false; if(Usuarios.isEmpty()){ Usuarios.add(new Usuario(nombre)); agregado = true; }else{ for (int c = 0; c < Usuarios.size(); c++) { if(Usuarios.get(c).getNombre().equals(nombre)){ encontrado = true; break; } } if(encontrado){ agregado = false; }else{ Usuarios.add(new Usuario(nombre)); agregado = true; } } return agregado; } @Override public boolean CerrarSesion(String nombre) { boolean salir = false; for (int x = 0; x < Usuarios.size(); x++) { if(Usuarios.get(x).getNombre().equals(nombre)){ Usuarios.remove(x); salir = true; break; } } return salir; } @Override public String CargarPregunta(int i) { String pregunta=""; pregunta=pregunt.GetPregunta(i); if(tiempo.tiempo==0) i++; return pregunta; } @Override public String CargarRespuesta(int i) { String respuesta=""; respuesta=pregunt.GetRespuesta(i); return respuesta; } @Override public String EnviarRespuesta(String nombre) { for (int r = 0; r < Usuarios.size(); r++) { if(Usuarios.get(r).getNombre().equals(nombre)) Usuarios.get(r).setPuntaje(); masrap=""+Usuarios.get(r).getPuntaje(); } return nombre+"--------------------> "+masrap; /*if(nombre.equals("")){ masrap=MasRapido.get(0).toString(); if(!MasRapido.isEmpty()) MasRapido.clear(); }else{ if(MasRapido.isEmpty()){ MasRapido.add(nombre); for (int r = 0; r < Usuarios.size(); r++) { if(Usuarios.get(r).getNombre().equals(nombre)) Usuarios.get(r).setPuntaje(); break; }masrap = nombre; } }return ""+masrap;*/ } @Override public String LeerContactos() { String Conectados = ""; for (int z = 0; z < Usuarios.size(); z++){ Conectados = Conectados + Usuarios.get(z).getNombre() + ","; } return Conectados; } @Override public String SoyPrimero() { String primero=""; if(!Usuarios.isEmpty()){ primero=Usuarios.get(0).getNombre(); } return primero; } @Override public void IniciarTiempo(String nombre) { if(Usuarios.get(0).getNombre().equals(nombre)){ tiempo.EjecutarBloque(1); tiempo.start(); } } @Override public String VerPuntaje(String nombre) { String puntaje = ""; for (int w = 0; w < Usuarios.size(); w++){ if(Usuarios.get(w).getNombre().equals(nombre)){ puntaje = "" + Usuarios.get(w).Puntaje; } } return puntaje; } @Override public String ObtenerTiempo(String nombre) { return ""+tiempo.tiempo; } @Override public String Ganador () { int gaux=0; String Nombre = null; for(int y=0;y<Usuarios.size();y++){ if(gaux<Usuarios.get(y).getPuntaje()) gaux=Usuarios.get(y).getPuntaje(); Nombre=Usuarios.get(y).getNombre(); } return "El Ganador fue "+Nombre+" con "+gaux+" pts"; } @Override public void DetenerHiloTiempo (int i) { tiempo.EjecutarBloque(i); } @Override public void ReiniciarHiloTiempo () { tiempo.Reiniciar(); } @Override public void Sw(int i) { t=i; } @Override public int ObtenerSw() { return t; } @Override public void NumPreg(int i) { p++; } @Override public int ObtenerNumPreg() { return p; } //Prueba de los Metodos de esta Clase /*public static void main(String arg[]){ try{ LaMenteMasRapidaImpl Mente=new LaMenteMasRapidaImpl(); System.out.println(""+Mente.IniciarSesion("ali")); Mente.IniciarTiempo("ali"); System.out.println(""+Mente.EnviarRespuesta("ali")); System.out.println(""+Mente.EnviarRespuesta("")); System.out.println(""+Mente.tiempo.tiempo); Mente.tiempo.Reiniciar(); } catch(Exception e){ e.printStackTrace(); } }*/ }
[ "ekam02@gmail.com" ]
ekam02@gmail.com
f655b7e7c415d1f051ff84a5f4b743feee11aa0d
fb922763c1ad5a0123b46dd439834397625dc1f8
/app/src/androidTest/java/com/example/amirmaharjan/rss/ExampleInstrumentedTest.java
69e3e645ad7e68a77f1e4d28687ee6118b8b832e
[]
no_license
amirmhrzan1/Rss
986e2fc83bc82be12ca10dc4cb19121c9246e0b7
52458caaa471bb370eab6a81ff02cef9150d215d
refs/heads/master
2021-01-12T16:51:49.441549
2016-10-20T11:00:50
2016-10-20T11:00:50
71,454,427
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.example.amirmaharjan.rss; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.amirmaharjan.rss", appContext.getPackageName()); } }
[ "tst@gmail.com" ]
tst@gmail.com
f187e7c071968a01d7d6df0c615b17edc09952bd
4a4b161d14f58850a4b8299b59aedb82d614fc5d
/src/main/java/com/mrbysco/skinnedcarts/render/RenderFrogCart.java
019a7ff549d3eb50a2f9fc6090b6a23ddaf53240
[ "MIT" ]
permissive
Mrbysco/SkinnedCarts
28b27f3102ca9dbab5f7ffa067e24f85d5bcc8d4
5dc75d626c0544d4b8e7d3102631fabd92ea22b2
refs/heads/master
2023-07-08T15:37:02.569329
2022-06-29T15:26:08
2022-06-29T15:26:08
202,915,686
1
3
MIT
2019-11-04T18:27:23
2019-08-17T18:01:21
Java
UTF-8
Java
false
false
5,127
java
package com.mrbysco.skinnedcarts.render; import com.mrbysco.skinnedcarts.entity.EntityFrogCart; import com.mrbysco.skinnedcarts.entity.EntitySkinnedCart; import com.mrbysco.skinnedcarts.render.model.ModelFrog; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderFrogCart extends RenderSkinnedCart<EntityFrogCart> { private static ResourceLocation CART_TEXTURES = createLocation("minecart_frog"); /** instance of ModelMinecart for rendering */ private static ModelBase modelMinecart = new ModelFrog(); public RenderFrogCart(RenderManager renderManagerIn) { super(renderManagerIn); this.shadowSize = 0.5F; } /** * Renders the desired {@code T} type Entity. */ @Override public void doRender(EntityFrogCart entity, double x, double y, double z, float entityYaw, float partialTicks) { GlStateManager.pushMatrix(); this.bindEntityTexture(entity); long i = (long)entity.getEntityId() * 493286711L; i = i * i * 4392167121L + i * 98761L; float f = (((float)(i >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f1 = (((float)(i >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; float f2 = (((float)(i >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; GlStateManager.translate(f, f1, f2); double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks; double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks; double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks; double d3 = 0.30000001192092896D; Vec3d vec3d = entity.getPos(d0, d1, d2); float f3 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks; if (vec3d != null) { Vec3d vec3d1 = entity.getPosOffset(d0, d1, d2, 0.30000001192092896D); Vec3d vec3d2 = entity.getPosOffset(d0, d1, d2, -0.30000001192092896D); if (vec3d1 == null) { vec3d1 = vec3d; } if (vec3d2 == null) { vec3d2 = vec3d; } x += vec3d.x - d0; y += (vec3d1.y + vec3d2.y) / 2.0D - d1; z += vec3d.z - d2; Vec3d vec3d3 = vec3d2.add(-vec3d1.x, -vec3d1.y, -vec3d1.z); if (vec3d3.length() != 0.0D) { vec3d3 = vec3d3.normalize(); entityYaw = (float)(Math.atan2(vec3d3.z, vec3d3.x) / Math.PI) * 180F; f3 = (float)(Math.atan(vec3d3.y) * 73.0D); } } entityYaw %= 360; if (entityYaw < 0) entityYaw += 360; entityYaw += 360; double serverYaw = entity.rotationYaw; serverYaw += 180; serverYaw %= 360; if (serverYaw < 0) serverYaw += 360; serverYaw += 360; if (Math.abs(entityYaw - serverYaw) > 90) { entityYaw += 180; f3 = -f3; } GlStateManager.translate((float)x, (float)y + 0.375F, (float)z); GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(-f3, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180, 0, 1, 0); float f5 = (float)entity.getRollingAmplitude() - partialTicks; float f6 = entity.getDamage() - partialTicks; if (f6 < 0.0F) { f6 = 0.0F; } if (f5 > 0.0F) { float angle = (MathHelper.sin(f5) * f5 * f6) / 10F; angle = Math.min(angle, 0.8f); angle = Math.copySign(angle, ((EntitySkinnedCart)entity).getRollingDirection()); GlStateManager.rotate(angle * f5 * f6 / 10.0F * (float)entity.getRollingDirection(), 1.0F, 0.0F, 0.0F); } int j = entity.getDisplayTileOffset(); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); } GlStateManager.scale(-1.0F, -1.0F, 1.0F); this.modelMinecart.render(entity, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GlStateManager.popMatrix(); if (this.renderOutlines) { GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } super.doRender(entity, x, y, z, entityYaw, partialTicks); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ @Override protected ResourceLocation getEntityTexture(EntityFrogCart entity) { return CART_TEXTURES; } }
[ "Mrbysco@users.noreply.github.com" ]
Mrbysco@users.noreply.github.com
ba2d32181a1b1ec828a77541abecf4e449e2d1ab
0c6011931b7aa5581cd68c84fc3e16a6de9e33d4
/Pattern Monitor/src/controller/WorkPanel.java
6fc95e7aab362cfd794ebbb859c0995ea81b6691
[]
no_license
nagavineshreddy/Pattern-Monitor
d53ab73f60df18c0a5c8d0acab798191509e8874
606128a69ecfac49e5f0d3765f2e425c7c353eed
refs/heads/main
2023-07-03T15:04:46.156740
2021-08-06T06:59:33
2021-08-06T06:59:33
393,285,430
0
0
null
null
null
null
UTF-8
Java
false
false
3,552
java
package controller; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.ArrayList; import java.util.Map; import javax.swing.JButton; import javax.swing.JPanel; import model.CloseParenthesisSymbol; import model.OpenParenthesisSymbol; import model.Symbol; /** * * WorkPanel is the area where the user works on the symbols */ public class WorkPanel extends JPanel { private boolean isPanelOpened; private boolean isPanelClosed; private int panelWidth; private int panelHeight; private Map<Symbol, ArrayList<Symbol>> Lines; private WorkPanel panel; double ax1, ay1, ax2, ay2; public static final double len = 10; public static final double angle = Math.PI / 10; public WorkPanel(int width, int height) { this.isPanelOpened = false; this.isPanelClosed = false; this.panelWidth = width; this.panelHeight = height - 100; this.setName("Center Panel"); this.setLayout(null); this.setPreferredSize(new Dimension(panelWidth, panelHeight)); this.setBackground(new Color(200, 200, 200)); this.panel = this; if (!OpenFileContents.isOpened) { new OpenParenthesisSymbol(this, 0, 0, new JButton("(")); new CloseParenthesisSymbol(this, 600, 400, new JButton(")")); } new SetSymbolListener(this); } public boolean isOpenP() { return isPanelOpened; } public void setOpenP(boolean isOpenP) { this.isPanelOpened = isOpenP; } public boolean isCloseP() { return isPanelClosed; } public void setCloseP(boolean isCloseP) { this.isPanelClosed = isCloseP; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2D = (Graphics2D) g; Lines = Collector.getInstance().getSpaceLines(this.panel); if (Lines != null) { for (Symbol c1 : Lines.keySet()) { for (Symbol c2 : Lines.get(c1)) { int x1 = c1.getX() + c1.getParent().getX() + c1.getWidth() / 2; int x2 = c2.getX() + c2.getParent().getX() + c2.getWidth() / 2; int y1 = c1.getY() + c1.getParent().getY() + c1.getHeight() / 2; int y2 = c2.getY() + c2.getParent().getY() + c2.getHeight() / 2; x2 -= 90; y2 -= 40; arrowHead(x1, y1, x2, y2); g2D.drawLine(x2, y2, (int) ax1, (int) ay1); g2D.drawLine(x2, y2, (int) ax2, (int) ay2); g2D.drawLine(x1, y1, x2, y2); } } } } private void arrowHead(double x1, double y1, double x2, double y2) { double distance, resultDistance, angleOne, angleTwo, resultAngle; distance = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); if (Math.abs(x2 - x1) < 1e-6) if (y2 < y1) angleTwo = Math.PI / 2; else angleTwo = -Math.PI / 2; else { if (x2 > x1) angleTwo = Math.atan((y1 - y2) / (x2 - x1)); else angleTwo = Math.atan((y1 - y2) / (x1 - x2)); } resultDistance = Math.sqrt(len * len + distance * distance - 2 * len * distance * Math.cos(angle)); angleOne = Math.asin(len * Math.sin(angle) / resultDistance); resultAngle = angleTwo - angleOne; ay1 = y1 - resultDistance * Math.sin(resultAngle); if (x2 > x1) ax1 = x1 + resultDistance * Math.cos(resultAngle); else ax1 = x1 - resultDistance * Math.cos(resultAngle); resultAngle = angleTwo + angleOne; ay2 = y1 - resultDistance * Math.sin(resultAngle); if (x2 > x1) ax2 = x1 + resultDistance * Math.cos(resultAngle); else ax2 = x1 - resultDistance * Math.cos(resultAngle); } }
[ "noreply@github.com" ]
noreply@github.com
e0a866da082692b419f02655c35f7080c7744c62
bccaf2186b8c64bc6a7ea3352d78a1defca0f263
/app/src/main/java/com/chicsol/marrymax/fragments/matches/MyFavouriteMatches.java
45d37ec7ab60d9ff96325d02928003924ae699a8
[]
no_license
zeeshanchicsol/marrymaxnew
4c0d91897efbe44e9e1f6f3928ef711ccb56b864
07c4abf582c53e34398b323b16fe65a65f27ee7e
refs/heads/master
2023-01-02T11:55:48.774294
2020-01-30T14:45:59
2020-01-30T14:45:59
307,617,767
0
0
null
null
null
null
UTF-8
Java
false
false
25,431
java
package com.chicsol.marrymax.fragments.matches; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.AppCompatButton; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.android.volley.AuthFailureError; import com.android.volley.DefaultRetryPolicy; import com.android.volley.Request; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.VolleyLog; import com.android.volley.toolbox.JsonArrayRequest; import com.android.volley.toolbox.JsonObjectRequest; import com.chicsol.marrymax.R; import com.chicsol.marrymax.activities.DrawerActivity; import com.chicsol.marrymax.adapters.RecyclerViewAdapterMyMatches; import com.chicsol.marrymax.dialogs.dialogMatchingAttributeFragment; import com.chicsol.marrymax.dialogs.dialogProfileCompletion; import com.chicsol.marrymax.dialogs.dialogRemoveFromSearch; import com.chicsol.marrymax.dialogs.dialogRequest; import com.chicsol.marrymax.dialogs.dialogRequestPhone; import com.chicsol.marrymax.dialogs.dialogShowInterest; import com.chicsol.marrymax.fragments.DashboardMatchesMainFragment; import com.chicsol.marrymax.interfaces.MatchesRefreshCallBackInterface; import com.chicsol.marrymax.interfaces.UpdateMatchesCountCallback; import com.chicsol.marrymax.modal.Members; import com.chicsol.marrymax.other.MarryMax; import com.chicsol.marrymax.preferences.SharedPreferenceManager; import com.chicsol.marrymax.urls.Urls; import com.chicsol.marrymax.utils.ConnectCheck; import com.chicsol.marrymax.utils.Constants; import com.chicsol.marrymax.utils.MySingleton; import com.chicsol.marrymax.utils.WrapContentLinearLayoutManager; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.lang.reflect.Type; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import static com.chicsol.marrymax.utils.Constants.jsonArraySearch; /** * Created by Android on 11/3/2016. */ public class MyFavouriteMatches extends BaseMatchesFragment implements RecyclerViewAdapterMyMatches.OnLoadMoreListener, SwipeRefreshLayout.OnRefreshListener, dialogShowInterest.onCompleteListener, dialogRequestPhone.onCompleteListener, DashboardMatchesMainFragment.MatchesMainFragmentInterface, dialogRequest.onCompleteListener, dialogProfileCompletion.onCompleteListener, dialogRemoveFromSearch.onCompleteListener, UpdateMatchesCountCallback, MatchesRefreshCallBackInterface, dialogMatchingAttributeFragment.onMatchPreferenceCompleteListener { public static int result = 0; LinearLayout LinearLayoutMMMatchesNotFound; //private Button bt_loadmore; private RecyclerView recyclerView; private int lastPage = 1; private List<Members> membersDataList; private int totalPages = 0; // private int currentPage=1; private Fragment fragment; private RecyclerViewAdapterMyMatches recyclerAdapter; private ProgressBar pDialog; private SwipeRefreshLayout swipeRefresh; private String params; TextView tvMatchesCount; private long totalMatchesCount = 0; private String Tag = "MyFavouriteMatches"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); } /* @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_dashboard_mymatches, container, false); Log.e("created", "created"); initilize(rootView); setListenders(); return rootView; } */ @Override public View provideYourFragmentView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_dashboard_mymatches, container, false); initilize(rootView); setListenders(); return rootView; } @Override public Fragment getChildFragment() { return MyFavouriteMatches.this; } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); } @Override public void onResume() { super.onResume(); /* if (searchKey != -1) { // Toast.makeText(getContext(), "Searchkey not Null :"+searchKey, Toast.LENGTH_SHORT).show(); Members memberSearchObj = ListViewAdvSearchFragment.defaultSelectionsObj; if (memberSearchObj != null) { memberSearchObj.setPath(SharedPreferenceManager.getUserObject(getContext()).getPath()); memberSearchObj.setMember_status(SharedPreferenceManager.getUserObject(getContext()).getMember_status()); memberSearchObj.setPhone_verified(SharedPreferenceManager.getUserObject(getContext()).getPhone_verified()); memberSearchObj.setEmail_verified(SharedPreferenceManager.getUserObject(getContext()).getEmail_verified()); //page and type memberSearchObj.setPage_no(1); memberSearchObj.setType(""); Gson gson = new Gson(); params = gson.toJson(memberSearchObj); loadData(params, false); searchKey = -1; } }*/ /* if (searchKey != null) { // getSelectedSearchObject(SearchMainActivity.searchKey); Toast.makeText(getContext(), "Searchkey not Null", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getContext(), " Null", Toast.LENGTH_SHORT).show(); /// getRawData(); // defaultSelectionsObj = DrawerActivity.rawSearchObj; // listener.onItemSelected(dataList.get(0)); //ListViewAdvSearchFragment.defaultSelectionsObj }*/ if (result != 0) { Toast.makeText(getContext(), "val: " + result, Toast.LENGTH_SHORT).show(); } lastPage = 1; recyclerAdapter.setMoreLoading(false); if (ConnectCheck.isConnected(getActivity().findViewById(android.R.id.content))) { Members memberSearchObj = DrawerActivity.rawSearchObj; if (memberSearchObj != null) { memberSearchObj.setPath(SharedPreferenceManager.getUserObject(getContext()).getPath()); memberSearchObj.setMember_status(SharedPreferenceManager.getUserObject(getContext()).getMember_status()); memberSearchObj.setPhone_verified(SharedPreferenceManager.getUserObject(getContext()).getPhone_verified()); memberSearchObj.setEmail_verified(SharedPreferenceManager.getUserObject(getContext()).getEmail_verified()); //page and type memberSearchObj.setPage_no(1); memberSearchObj.setType("S"); Gson gson = new Gson(); String params = gson.toJson(memberSearchObj); this.params = params; recyclerAdapter.setMemResultsObj(memberSearchObj); loadData(params, false); } } DrawerActivity.rawSearchObj = new Members(); } @Override public void setMenuVisibility(final boolean visible) { super.setMenuVisibility(visible); if (visible) { // Toast.makeText(getContext(), "visible: ", Toast.LENGTH_SHORT).show(); } } @Override public void fragmentBecameVisible(Context context) { } private void initilize(View view) { tvMatchesCount = (TextView) view.findViewById(R.id.TextViewMatchesTotalCount); fragment = MyFavouriteMatches.this; membersDataList = new ArrayList<>(); pDialog = (ProgressBar) view.findViewById(R.id.ProgressbarMyMatches); swipeRefresh = (SwipeRefreshLayout) view.findViewById(R.id.SwipeRefreshDashMainMM); LinearLayoutMMMatchesNotFound = (LinearLayout) view.findViewById(R.id.LinearLayoutMMMatchesNotFound); recyclerView = (RecyclerView) view.findViewById(R.id.RecyclerViewDashMainMyMatches); LinearLayoutManager mLayoutManager = new WrapContentLinearLayoutManager(getContext()); recyclerView.setLayoutManager(mLayoutManager); recyclerAdapter = new RecyclerViewAdapterMyMatches(getContext(), getFragmentManager(), this, fragment, this, this, Tag); recyclerAdapter.setLinearLayoutManager(mLayoutManager); recyclerAdapter.setRecyclerView(recyclerView); recyclerView.setAdapter(recyclerAdapter); swipeRefresh.setOnRefreshListener(this); ((AppCompatButton) view.findViewById(R.id.ButtonOnSearchClick)).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { MarryMax max = new MarryMax(getActivity()); max.onSearchClicked(getContext(), 0); } }); } private void setListenders() { } @Override public boolean onOptionsItemSelected(MenuItem item) { /* int id = item_slider.getItemId(); if (id == R.id.action_search) { drawer.openDrawer(GravityCompat.END); return true; }*/ /* int id = item.getItemId(); if (id == R.id.action_search) { if (jsonArraySearch == null) { getData(); } else { Intent intent = new Intent(getActivity(), SearchMainActivity.class); startActivityForResult(intent, 2); // overridePendingTransition(R.anim.enter, R.anim.right_to_left); } return true; }*/ return super.onOptionsItemSelected(item); } //for getting default search data private void getData() { // String.Max pDialog.setVisibility(View.VISIBLE); // Log.e("url", Urls.getSearchLists + SharedPreferenceManager.getUserObject(getApplicationContext()).getPath()); JsonArrayRequest req = new JsonArrayRequest(Urls.getSearchLists + SharedPreferenceManager.getUserObject(getContext()).getPath(), new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { jsonArraySearch = response; pDialog.setVisibility(View.GONE); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { VolleyLog.d("Err", "Error: " + error.getMessage()); pDialog.setVisibility(View.GONE); } }); MySingleton.getInstance(getContext()).addToRequestQueue(req, Tag); } @Override public void onDestroy() { super.onDestroy(); //ImageLoader.getInstance().destroy(); pDialog.setVisibility(View.GONE); } @Override public void onLoadMore() { if (lastPage != totalPages && lastPage < totalPages) { lastPage = lastPage + 1; //Log.e("", "las p: " + lastPage + " Total Pages:" + totalPages); /* Members memberSearchObj = DrawerActivity.rawSearchObj; memberSearchObj.setPath(SharedPreferenceManager.getUserObject(getContext()).getPath()); memberSearchObj.setMember_status(SharedPreferenceManager.getUserObject(getContext()).getMember_status()); memberSearchObj.setPhone_verified(SharedPreferenceManager.getUserObject(getContext()).getPhone_verified()); memberSearchObj.setEmail_verified(SharedPreferenceManager.getUserObject(getContext()).getEmail_verified()); //page and type memberSearchObj.setPage_no(lastPage); memberSearchObj.setType(""); Gson gson = new Gson(); String params = gson.toJson(memberSearchObj);*/ Gson gsont; GsonBuilder gsonBuildert = new GsonBuilder(); gsont = gsonBuildert.create(); Type membert = new TypeToken<Members>() { }.getType(); Members memberObj = (Members) gsont.fromJson(params, membert); memberObj.setPage_no(lastPage); gsont.toString(); // Log.e("params json", gsont.toJson(memberObj)); loadMoreData(gsont.toJson(memberObj)); } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); /*if (requestCode == 2) { if (resultCode == RESULT_OK) { // String message = data.getStringExtra("MESSAGE"); Log.e("===========", "=================="); // Toast.makeText(getContext(), "" + message, Toast.LENGTH_SHORT).show(); // textView1.setText(message); ListViewAdvSearchFragment.defaultSelectionsObj.setPath(SharedPreferenceManager.getUserObject(getContext()).getPath()); ListViewAdvSearchFragment.defaultSelectionsObj.setMember_status(SharedPreferenceManager.getUserObject(getContext()).getMember_status()); ListViewAdvSearchFragment.defaultSelectionsObj.setPhone_verified(SharedPreferenceManager.getUserObject(getContext()).getPhone_verified()); ListViewAdvSearchFragment.defaultSelectionsObj.setEmail_verified(SharedPreferenceManager.getUserObject(getContext()).getEmail_verified()); //page and type ListViewAdvSearchFragment.defaultSelectionsObj.setPage_no(1); ListViewAdvSearchFragment.defaultSelectionsObj.setType(""); Gson gson = new Gson(); String memString = gson.toJson(ListViewAdvSearchFragment.defaultSelectionsObj); params = memString; loadData(memString, false); // loadSearchProfilesData(memString, true); } }*/ } @Override public void onRefresh() { lastPage = 1; recyclerAdapter.setMoreLoading(false); if (ConnectCheck.isConnected(getActivity().findViewById(android.R.id.content))) { Members memberSearchObj = DrawerActivity.rawSearchObj; if (memberSearchObj != null) { memberSearchObj.setPath(SharedPreferenceManager.getUserObject(getContext()).getPath()); memberSearchObj.setMember_status(SharedPreferenceManager.getUserObject(getContext()).getMember_status()); memberSearchObj.setPhone_verified(SharedPreferenceManager.getUserObject(getContext()).getPhone_verified()); memberSearchObj.setEmail_verified(SharedPreferenceManager.getUserObject(getContext()).getEmail_verified()); //page and type memberSearchObj.setPage_no(1); memberSearchObj.setType("S"); Gson gson = new Gson(); params = gson.toJson(memberSearchObj); recyclerAdapter.setMemResultsObj(memberSearchObj); loadData(params, false); } } } /*private void loadData() { itemList.clear(); for (int i = 1; i <= 20; i++) { itemList.add(new Item("Item " + i)); } mAdapter.addAll(itemList); }*/ @Override public void onComplete(String s) { onRefresh(); } private void loadData(String paramsString, final boolean refresh) { pDialog.setVisibility(View.VISIBLE); // RequestQueue rq = Volley.newRequestQueue(getActivity().getApplicationContext()); JSONObject params = null; try { params = new JSONObject(paramsString); } catch (JSONException e) { e.printStackTrace(); } //Log.e("Params search" + " " + Urls.searchProfiles, "" + params); //Log.e("Params search" + " " + Urls.searchProfiles, ""); final JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.PUT, Urls.searchProfiles, params, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { //Log.e("re update appearance", response + ""); try { JSONArray jsonArray = response.getJSONArray("data"); if (jsonArray.length() > 1) { //Log.e("Length", jsonArray.getJSONArray(0).length() + ""); JSONArray jsonarrayData = jsonArray.getJSONArray(0); JSONArray jsonarrayTotalPages = jsonArray.getJSONArray(1); Gson gson; GsonBuilder gsonBuilder = new GsonBuilder(); gson = gsonBuilder.create(); Type member = new TypeToken<List<Members>>() { }.getType(); membersDataList = (List<Members>) gson.fromJson(jsonarrayData.toString(), member); if (membersDataList.size() > 0) { LinearLayoutMMMatchesNotFound.setVisibility(View.GONE); recyclerAdapter.addAll(membersDataList); //Log.e("Length=================", membersDataList.size() + " "); Gson gsont; GsonBuilder gsonBuildert = new GsonBuilder(); gsont = gsonBuildert.create(); Type membert = new TypeToken<Members>() { }.getType(); Members memberTotalPages = (Members) gson.fromJson(jsonarrayTotalPages.getJSONObject(0).toString(), membert); totalPages = memberTotalPages.getTotal_pages(); lastPage = 1; //Log.e("total pages", "" + totalPages); swipeRefresh.setRefreshing(false); if (memberTotalPages.getTotal_member_count() > 0) { if (getView() != null) { /* getView().findViewById(R.id.TextViewMatchesTotalCount).setVisibility(View.VISIBLE); ((TextView) getView().findViewById(R.id.TextViewMatchesTotalCount)).setText("" + memberTotalPages.getTotal_member_count() + " Matches Found"); */ tvMatchesCount.setVisibility(View.VISIBLE); totalMatchesCount = memberTotalPages.getTotal_member_count(); setMatchesCount(); } } } else { recyclerAdapter.clear(); swipeRefresh.setRefreshing(false); LinearLayoutMMMatchesNotFound.setVisibility(View.VISIBLE); } } else { recyclerAdapter.clear(); //no data swipeRefresh.setRefreshing(false); LinearLayoutMMMatchesNotFound.setVisibility(View.VISIBLE); } } catch (JSONException e) { e.printStackTrace(); } if (!refresh) { pDialog.setVisibility(View.GONE); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { VolleyLog.e("res err", "Error: " + error); // if (!refresh) { pDialog.setVisibility(View.GONE); // } LinearLayoutMMMatchesNotFound.setVisibility(View.VISIBLE); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { return Constants.getHashMap(); } }; // Adding request to request queue /// rq.add(jsonObjReq); jsonObjReq.setRetryPolicy(new DefaultRetryPolicy( 0, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); MySingleton.getInstance(getContext()).addToRequestQueue(jsonObjReq, Tag); } private void loadMoreData(String paramsString) { recyclerAdapter.setProgressMore(true); JSONObject params = null; try { params = new JSONObject(paramsString); } catch (JSONException e) { e.printStackTrace(); } // Log.e("Params search" + " " + Urls.searchProfiles, "" + params); // Log.e("Params search" + " " + Urls.searchProfiles, ""); JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.PUT, Urls.searchProfiles, params, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { //Log.e("re update appearance", response + ""); try { JSONArray jsonArray = response.getJSONArray("data"); if (jsonArray.length() > 1) { //Log.e("Length", jsonArray.getJSONArray(0).length() + ""); JSONArray jsonarrayData = jsonArray.getJSONArray(0); JSONArray jsonarrayTotalPages = jsonArray.getJSONArray(1); Gson gson; GsonBuilder gsonBuilder = new GsonBuilder(); gson = gsonBuilder.create(); Type member = new TypeToken<List<Members>>() { }.getType(); recyclerAdapter.setProgressMore(false); // membersDataList.clear(); membersDataList = (List<Members>) gson.fromJson(jsonarrayData.toString(), member); // Log.e("Length 56", membersDataList.size() + " "); recyclerAdapter.addItemMore(membersDataList); recyclerAdapter.setMoreLoading(false); } } catch (JSONException e) { e.printStackTrace(); } recyclerAdapter.setMoreLoading(false); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { VolleyLog.e("res err", "Error: " + error); // Toast.makeText(RegistrationActivity.this, "Incorrect Email or Password !", Toast.LENGTH_SHORT).show(); recyclerAdapter.setMoreLoading(false); } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { return Constants.getHashMap(); } }; // Adding request to request queue /// rq.add(jsonObjReq); jsonObjReq.setRetryPolicy(new DefaultRetryPolicy( 0, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); MySingleton.getInstance(getContext()).addToRequestQueue(jsonObjReq, Tag); } @Override public void onComplete(int s) { } @Override public void onUpdateMatchCount(boolean count) { totalMatchesCount--; setMatchesCount(); } private void setMatchesCount() { tvMatchesCount.setText(NumberFormat.getNumberInstance(Locale.getDefault()).format(totalMatchesCount) + " Matches Found"); } @Override public void onRefreshMatch() { onRefresh(); } @Override public void onStop() { super.onStop(); MySingleton.getInstance(getContext()).cancelPendingRequests(Tag); } @Override public void onPreferenceComplete(String s) { loadData(params, false); } }
[ "zeeshan.ahmad@chicsol.com" ]
zeeshan.ahmad@chicsol.com
f1d829629650fe4217555b898888639aa13b17cd
5dcacab0c710cf28debd0e1b5b84881dde74d7f5
/src/classpackage/Phones.java
2625d1ef3b87cce1265b962ca0c0dfb7a58a3420
[]
no_license
sandeep-maddu/creditdept
a271315ecbdef798c99695028f53a721a81d2f59
aa3c490332be9674761b8c37f7717906338578de
refs/heads/master
2021-04-29T19:40:35.831244
2018-02-15T01:56:19
2018-02-15T01:56:19
121,582,345
0
0
null
null
null
null
UTF-8
Java
false
false
730
java
package classpackage; public class Phones { private int phid,aid; private String sub_name,phone; public Phones() { super(); } public Phones(int phid,String sub_name, String phone,int aid) { this.phid=phid; this.sub_name=sub_name; this.phone=phone; this.aid=aid; } public int getPhid() { return phid; } public void setPhid(int phid) { this.phid = phid; } public int getAid() { return aid; } public void setAid(int aid) { this.aid = aid; } public String getSub_name() { return sub_name; } public void setSub_name(String sub_name) { this.sub_name = sub_name; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } }
[ "sandeep.maddu@gmail.com" ]
sandeep.maddu@gmail.com
e5da88ab9061a4a245a08a2f83f1f3910b5ca9e4
3faba0c27815fa8cae807065a7162553a5d3f975
/app/src/main/java/com/saae/taskreminder/SwipeRevealLayout.java
241b6aeb876cc1463be3a5abb4e8087cee04466b
[]
no_license
venkatsaae/TaskReminder
ad6d3839d8e21636a6ec02b3c3f7accce466e5ac
0ea80bbf3602c9a2aa9436e3bd6a531c34c8c68f
refs/heads/master
2021-01-20T13:06:36.868978
2017-06-18T06:13:17
2017-06-18T06:13:17
90,449,537
0
0
null
null
null
null
UTF-8
Java
false
false
36,660
java
/** The MIT License (MIT) Copyright (c) 2016 Chau Thai Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.saae.taskreminder; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Rect; import android.support.v4.view.GestureDetectorCompat; import android.support.v4.view.ViewCompat; import android.support.v4.widget.ViewDragHelper; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; @SuppressLint("RtlHardcoded") public class SwipeRevealLayout extends ViewGroup { // These states are used only for ViewBindHelper protected static final int STATE_CLOSE = 0; protected static final int STATE_CLOSING = 1; protected static final int STATE_OPEN = 2; protected static final int STATE_OPENING = 3; protected static final int STATE_DRAGGING = 4; private static final int DEFAULT_MIN_FLING_VELOCITY = 300; // dp per second private static final int DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT = 1; // dp public static final int DRAG_EDGE_LEFT = 0x1; public static final int DRAG_EDGE_RIGHT = 0x1 << 1; public static final int DRAG_EDGE_TOP = 0x1 << 2; public static final int DRAG_EDGE_BOTTOM = 0x1 << 3; /** * The secondary view will be under the main view. */ public static final int MODE_NORMAL = 0; /** * The secondary view will stick the edge of the main view. */ public static final int MODE_SAME_LEVEL = 1; /** * Main view is the view which is shown when the layout is closed. */ private View mMainView; /** * Secondary view is the view which is shown when the layout is opened. */ private View mSecondaryView; /** * The rectangle position of the main view when the layout is closed. */ private Rect mRectMainClose = new Rect(); /** * The rectangle position of the main view when the layout is opened. */ private Rect mRectMainOpen = new Rect(); /** * The rectangle position of the secondary view when the layout is closed. */ private Rect mRectSecClose = new Rect(); /** * The rectangle position of the secondary view when the layout is opened. */ private Rect mRectSecOpen = new Rect(); /** * The minimum distance (px) to the closest drag edge that the SwipeRevealLayout * will disallow the parent to intercept touch event. */ private int mMinDistRequestDisallowParent = 0; private boolean mIsOpenBeforeInit = false; private volatile boolean mAborted = false; private volatile boolean mIsScrolling = false; private volatile boolean mLockDrag = false; private int mMinFlingVelocity = DEFAULT_MIN_FLING_VELOCITY; private int mState = STATE_CLOSE; private int mMode = MODE_NORMAL; private int mLastMainLeft = 0; private int mLastMainTop = 0; private int mDragEdge = DRAG_EDGE_LEFT; private ViewDragHelper mDragHelper; private GestureDetectorCompat mGestureDetector; private DragStateChangeListener mDragStateChangeListener; // only used for ViewBindHelper private SwipeListener mSwipeListener; private int mOnLayoutCount = 0; interface DragStateChangeListener { void onDragStateChanged(int state); } /** * Listener for monitoring events about swipe layout. */ public interface SwipeListener { /** * Called when the main view becomes completely closed. */ void onClosed(SwipeRevealLayout view); /** * Called when the main view becomes completely opened. */ void onOpened(SwipeRevealLayout view); /** * Called when the main view's position changes. * @param slideOffset The new offset of the main view within its range, from 0-1 */ void onSlide(SwipeRevealLayout view, float slideOffset); } /** * No-op stub for {@link SwipeListener}. If you only want ot implement a subset * of the listener methods, you can extend this instead of implement the full interface. */ public static class SimpleSwipeListener implements SwipeListener { @Override public void onClosed(SwipeRevealLayout view) {} @Override public void onOpened(SwipeRevealLayout view) {} @Override public void onSlide(SwipeRevealLayout view, float slideOffset) {} } public SwipeRevealLayout(Context context) { super(context); init(context, null); } public SwipeRevealLayout(Context context, AttributeSet attrs) { super(context, attrs); init(context, attrs); } public SwipeRevealLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public boolean onTouchEvent(MotionEvent event) { mGestureDetector.onTouchEvent(event); mDragHelper.processTouchEvent(event); return true; } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { mDragHelper.processTouchEvent(ev); mGestureDetector.onTouchEvent(ev); boolean settling = mDragHelper.getViewDragState() == ViewDragHelper.STATE_SETTLING; boolean idleAfterScrolled = mDragHelper.getViewDragState() == ViewDragHelper.STATE_IDLE && mIsScrolling; return settling || idleAfterScrolled; } @Override protected void onFinishInflate() { super.onFinishInflate(); // get views if (getChildCount() >= 2) { mSecondaryView = getChildAt(0); mMainView = getChildAt(1); } else if (getChildCount() == 1) { mMainView = getChildAt(0); } } /** * {@inheritDoc} */ @SuppressWarnings("ConstantConditions") @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { mAborted = false; for (int index = 0; index < getChildCount(); index++) { final View child = getChildAt(index); int left, right, top, bottom; left = right = top = bottom = 0; final int minLeft = getPaddingLeft(); final int maxRight = Math.max(r - getPaddingRight() - l, 0); final int minTop = getPaddingTop(); final int maxBottom = Math.max(b - getPaddingBottom() - t, 0); int measuredChildHeight = child.getMeasuredHeight(); int measuredChildWidth = child.getMeasuredWidth(); // need to take account if child size is match_parent final LayoutParams childParams = child.getLayoutParams(); boolean matchParentHeight = false; boolean matchParentWidth = false; if (childParams != null) { matchParentHeight = (childParams.height == LayoutParams.MATCH_PARENT) || (childParams.height == LayoutParams.FILL_PARENT); matchParentWidth = (childParams.width == LayoutParams.MATCH_PARENT) || (childParams.width == LayoutParams.FILL_PARENT); } if (matchParentHeight) { measuredChildHeight = maxBottom - minTop; childParams.height = measuredChildHeight; } if (matchParentWidth) { measuredChildWidth = maxRight - minLeft; childParams.width = measuredChildWidth; } switch (mDragEdge) { case DRAG_EDGE_RIGHT: left = Math.max(r - measuredChildWidth - getPaddingRight() - l, minLeft); top = Math.min(getPaddingTop(), maxBottom); right = Math.max(r - getPaddingRight() - l, minLeft); bottom = Math.min(measuredChildHeight + getPaddingTop(), maxBottom); break; case DRAG_EDGE_LEFT: left = Math.min(getPaddingLeft(), maxRight); top = Math.min(getPaddingTop(), maxBottom); right = Math.min(measuredChildWidth + getPaddingLeft(), maxRight); bottom = Math.min(measuredChildHeight + getPaddingTop(), maxBottom); break; case DRAG_EDGE_TOP: left = Math.min(getPaddingLeft(), maxRight); top = Math.min(getPaddingTop(), maxBottom); right = Math.min(measuredChildWidth + getPaddingLeft(), maxRight); bottom = Math.min(measuredChildHeight + getPaddingTop(), maxBottom); break; case DRAG_EDGE_BOTTOM: left = Math.min(getPaddingLeft(), maxRight); top = Math.max(b - measuredChildHeight - getPaddingBottom() - t, minTop); right = Math.min(measuredChildWidth + getPaddingLeft(), maxRight); bottom = Math.max(b - getPaddingBottom() - t, minTop); break; } child.layout(left, top, right, bottom); } // taking account offset when mode is SAME_LEVEL if (mMode == MODE_SAME_LEVEL) { switch (mDragEdge) { case DRAG_EDGE_LEFT: mSecondaryView.offsetLeftAndRight(-mSecondaryView.getWidth()); break; case DRAG_EDGE_RIGHT: mSecondaryView.offsetLeftAndRight(mSecondaryView.getWidth()); break; case DRAG_EDGE_TOP: mSecondaryView.offsetTopAndBottom(-mSecondaryView.getHeight()); break; case DRAG_EDGE_BOTTOM: mSecondaryView.offsetTopAndBottom(mSecondaryView.getHeight()); } } initRects(); if (mIsOpenBeforeInit) { open(false); } else { close(false); } mLastMainLeft = mMainView.getLeft(); mLastMainTop = mMainView.getTop(); mOnLayoutCount++; } /** * {@inheritDoc} */ @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (getChildCount() < 2) { throw new RuntimeException("Layout must have two children"); } final LayoutParams params = getLayoutParams(); final int widthMode = MeasureSpec.getMode(widthMeasureSpec); final int heightMode = MeasureSpec.getMode(heightMeasureSpec); int desiredWidth = 0; int desiredHeight = 0; // first find the largest child for (int i = 0; i < getChildCount(); i++) { final View child = getChildAt(i); measureChild(child, widthMeasureSpec, heightMeasureSpec); desiredWidth = Math.max(child.getMeasuredWidth(), desiredWidth); desiredHeight = Math.max(child.getMeasuredHeight(), desiredHeight); } // create new measure spec using the largest child width widthMeasureSpec = MeasureSpec.makeMeasureSpec(desiredWidth, widthMode); heightMeasureSpec = MeasureSpec.makeMeasureSpec(desiredHeight, heightMode); final int measuredWidth = MeasureSpec.getSize(widthMeasureSpec); final int measuredHeight = MeasureSpec.getSize(heightMeasureSpec); for (int i = 0; i < getChildCount(); i++) { final View child = getChildAt(i); final LayoutParams childParams = child.getLayoutParams(); if (childParams != null) { if (childParams.height == LayoutParams.MATCH_PARENT) { child.setMinimumHeight(measuredHeight); } if (childParams.width == LayoutParams.MATCH_PARENT) { child.setMinimumWidth(measuredWidth); } } measureChild(child, widthMeasureSpec, heightMeasureSpec); desiredWidth = Math.max(child.getMeasuredWidth(), desiredWidth); desiredHeight = Math.max(child.getMeasuredHeight(), desiredHeight); } // taking accounts of padding desiredWidth += getPaddingLeft() + getPaddingRight(); desiredHeight += getPaddingTop() + getPaddingBottom(); // adjust desired width if (widthMode == MeasureSpec.EXACTLY) { desiredWidth = measuredWidth; } else { if (params.width == LayoutParams.MATCH_PARENT) { desiredWidth = measuredWidth; } if (widthMode == MeasureSpec.AT_MOST) { desiredWidth = (desiredWidth > measuredWidth)? measuredWidth : desiredWidth; } } // adjust desired height if (heightMode == MeasureSpec.EXACTLY) { desiredHeight = measuredHeight; } else { if (params.height == LayoutParams.MATCH_PARENT) { desiredHeight = measuredHeight; } if (heightMode == MeasureSpec.AT_MOST) { desiredHeight = (desiredHeight > measuredHeight)? measuredHeight : desiredHeight; } } setMeasuredDimension(desiredWidth, desiredHeight); } @Override public void computeScroll() { if (mDragHelper.continueSettling(true)) { ViewCompat.postInvalidateOnAnimation(this); } } /** * Open the panel to show the secondary view * @param animation true to animate the open motion. {@link SwipeListener} won't be * called if is animation is false. */ public void open(boolean animation) { mIsOpenBeforeInit = true; mAborted = false; if (animation) { mState = STATE_OPENING; mDragHelper.smoothSlideViewTo(mMainView, mRectMainOpen.left, mRectMainOpen.top); if (mDragStateChangeListener != null) { mDragStateChangeListener.onDragStateChanged(mState); } } else { mState = STATE_OPEN; mDragHelper.abort(); mMainView.layout( mRectMainOpen.left, mRectMainOpen.top, mRectMainOpen.right, mRectMainOpen.bottom ); mSecondaryView.layout( mRectSecOpen.left, mRectSecOpen.top, mRectSecOpen.right, mRectSecOpen.bottom ); } ViewCompat.postInvalidateOnAnimation(SwipeRevealLayout.this); } /** * Close the panel to hide the secondary view * @param animation true to animate the close motion. {@link SwipeListener} won't be * called if is animation is false. */ public void close(boolean animation) { mIsOpenBeforeInit = false; mAborted = false; if (animation) { mState = STATE_CLOSING; mDragHelper.smoothSlideViewTo(mMainView, mRectMainClose.left, mRectMainClose.top); if (mDragStateChangeListener != null) { mDragStateChangeListener.onDragStateChanged(mState); } } else { mState = STATE_CLOSE; mDragHelper.abort(); mMainView.layout( mRectMainClose.left, mRectMainClose.top, mRectMainClose.right, mRectMainClose.bottom ); mSecondaryView.layout( mRectSecClose.left, mRectSecClose.top, mRectSecClose.right, mRectSecClose.bottom ); } ViewCompat.postInvalidateOnAnimation(SwipeRevealLayout.this); } /** * Set the minimum fling velocity to cause the layout to open/close. * @param velocity dp per second */ public void setMinFlingVelocity(int velocity) { mMinFlingVelocity = velocity; } /** * Get the minimum fling velocity to cause the layout to open/close. * @return dp per second */ public int getMinFlingVelocity() { return mMinFlingVelocity; } /** * Set the edge where the layout can be dragged from. * @param dragEdge Can be one of these * <ul> * <li>{@link #DRAG_EDGE_LEFT}</li> * <li>{@link #DRAG_EDGE_TOP}</li> * <li>{@link #DRAG_EDGE_RIGHT}</li> * <li>{@link #DRAG_EDGE_BOTTOM}</li> * </ul> */ public void setDragEdge(int dragEdge) { mDragEdge = dragEdge; } /** * Get the edge where the layout can be dragged from. * @return Can be one of these * <ul> * <li>{@link #DRAG_EDGE_LEFT}</li> * <li>{@link #DRAG_EDGE_TOP}</li> * <li>{@link #DRAG_EDGE_RIGHT}</li> * <li>{@link #DRAG_EDGE_BOTTOM}</li> * </ul> */ public int getDragEdge() { return mDragEdge; } public void setSwipeListener(SwipeListener listener) { mSwipeListener = listener; } /** * @param lock if set to true, the user cannot drag/swipe the layout. */ public void setLockDrag(boolean lock) { mLockDrag = lock; } /** * @return true if the drag/swipe motion is currently locked. */ public boolean isDragLocked() { return mLockDrag; } /** * @return true if layout is fully opened, false otherwise. */ public boolean isOpened() { return (mState == STATE_OPEN); } /** * @return true if layout is fully closed, false otherwise. */ public boolean isClosed() { return (mState == STATE_CLOSE); } void setDragStateChangeListener(DragStateChangeListener listener) { mDragStateChangeListener = listener; } protected void abort() { mAborted = true; mDragHelper.abort(); } /** * In RecyclerView/ListView, onLayout should be called 2 times to display children views correctly. * This method check if it've already called onLayout two times. * @return true if you should call {@link #requestLayout()}. */ protected boolean shouldRequestLayout() { return mOnLayoutCount < 2; } private int getMainOpenLeft() { switch (mDragEdge) { case DRAG_EDGE_LEFT: return mRectMainClose.left + mSecondaryView.getWidth(); case DRAG_EDGE_RIGHT: return mRectMainClose.left - mSecondaryView.getWidth(); case DRAG_EDGE_TOP: return mRectMainClose.left; case DRAG_EDGE_BOTTOM: return mRectMainClose.left; default: return 0; } } private int getMainOpenTop() { switch (mDragEdge) { case DRAG_EDGE_LEFT: return mRectMainClose.top; case DRAG_EDGE_RIGHT: return mRectMainClose.top; case DRAG_EDGE_TOP: return mRectMainClose.top + mSecondaryView.getHeight(); case DRAG_EDGE_BOTTOM: return mRectMainClose.top - mSecondaryView.getHeight(); default: return 0; } } private int getSecOpenLeft() { if (mMode == MODE_NORMAL || mDragEdge == DRAG_EDGE_BOTTOM || mDragEdge == DRAG_EDGE_TOP) { return mRectSecClose.left; } if (mDragEdge == DRAG_EDGE_LEFT) { return mRectSecClose.left + mSecondaryView.getWidth(); } else { return mRectSecClose.left - mSecondaryView.getWidth(); } } private int getSecOpenTop() { if (mMode == MODE_NORMAL || mDragEdge == DRAG_EDGE_LEFT || mDragEdge == DRAG_EDGE_RIGHT) { return mRectSecClose.top; } if (mDragEdge == DRAG_EDGE_TOP) { return mRectSecClose.top + mSecondaryView.getHeight(); } else { return mRectSecClose.top - mSecondaryView.getHeight(); } } private void initRects() { // close position of main view mRectMainClose.set( mMainView.getLeft(), mMainView.getTop(), mMainView.getRight(), mMainView.getBottom() ); // close position of secondary view mRectSecClose.set( mSecondaryView.getLeft(), mSecondaryView.getTop(), mSecondaryView.getRight(), mSecondaryView.getBottom() ); // open position of the main view mRectMainOpen.set( getMainOpenLeft(), getMainOpenTop(), getMainOpenLeft() + mMainView.getWidth(), getMainOpenTop() + mMainView.getHeight() ); // open position of the secondary view mRectSecOpen.set( getSecOpenLeft(), getSecOpenTop(), getSecOpenLeft() + mSecondaryView.getWidth(), getSecOpenTop() + mSecondaryView.getHeight() ); } private void init(Context context, AttributeSet attrs) { if (attrs != null && context != null) { TypedArray a = context.getTheme().obtainStyledAttributes( attrs, R.styleable.SwipeRevealLayout, 0, 0 ); mDragEdge = a.getInteger(R.styleable.SwipeRevealLayout_dragEdge, DRAG_EDGE_LEFT); mMinFlingVelocity = a.getInteger(R.styleable.SwipeRevealLayout_flingVelocity, DEFAULT_MIN_FLING_VELOCITY); mMode = a.getInteger(R.styleable.SwipeRevealLayout_mode, MODE_NORMAL); mMinDistRequestDisallowParent = a.getDimensionPixelSize( R.styleable.SwipeRevealLayout_minDistRequestDisallowParent, dpToPx(DEFAULT_MIN_DIST_REQUEST_DISALLOW_PARENT) ); } mDragHelper = ViewDragHelper.create(this, 1.0f, mDragHelperCallback); mDragHelper.setEdgeTrackingEnabled(ViewDragHelper.EDGE_ALL); mGestureDetector = new GestureDetectorCompat(context, mGestureListener); } private final GestureDetector.OnGestureListener mGestureListener = new GestureDetector.SimpleOnGestureListener() { boolean hasDisallowed = false; @Override public boolean onDown(MotionEvent e) { mIsScrolling = false; hasDisallowed = false; return true; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { mIsScrolling = true; return false; } @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { mIsScrolling = true; if (getParent() != null) { boolean shouldDisallow; if (!hasDisallowed) { shouldDisallow = getDistToClosestEdge() >= mMinDistRequestDisallowParent; if (shouldDisallow) { hasDisallowed = true; } } else { shouldDisallow = true; } // disallow parent to intercept touch event so that the layout will work // properly on RecyclerView or view that handles scroll gesture. getParent().requestDisallowInterceptTouchEvent(shouldDisallow); } return false; } }; private int getDistToClosestEdge() { switch (mDragEdge) { case DRAG_EDGE_LEFT: final int pivotRight = mRectMainClose.left + mSecondaryView.getWidth(); return Math.min( mMainView.getLeft() - mRectMainClose.left, pivotRight - mMainView.getLeft() ); case DRAG_EDGE_RIGHT: final int pivotLeft = mRectMainClose.right - mSecondaryView.getWidth(); return Math.min( mMainView.getRight() - pivotLeft, mRectMainClose.right - mMainView.getRight() ); case DRAG_EDGE_TOP: final int pivotBottom = mRectMainClose.top + mSecondaryView.getHeight(); return Math.min( mMainView.getBottom() - pivotBottom, pivotBottom - mMainView.getTop() ); case DRAG_EDGE_BOTTOM: final int pivotTop = mRectMainClose.bottom - mSecondaryView.getHeight(); return Math.min( mRectMainClose.bottom - mMainView.getBottom(), mMainView.getBottom() - pivotTop ); } return 0; } private int getHalfwayPivotHorizontal() { if (mDragEdge == DRAG_EDGE_LEFT) { return mRectMainClose.left + mSecondaryView.getWidth() / 2; } else { return mRectMainClose.right - mSecondaryView.getWidth() / 2; } } private int getHalfwayPivotVertical() { if (mDragEdge == DRAG_EDGE_TOP) { return mRectMainClose.top + mSecondaryView.getHeight() / 2; } else { return mRectMainClose.bottom - mSecondaryView.getHeight() / 2; } } private final ViewDragHelper.Callback mDragHelperCallback = new ViewDragHelper.Callback() { @Override public boolean tryCaptureView(View child, int pointerId) { mAborted = false; if (mLockDrag) return false; mDragHelper.captureChildView(mMainView, pointerId); return false; } @Override public int clampViewPositionVertical(View child, int top, int dy) { switch (mDragEdge) { case DRAG_EDGE_TOP: return Math.max( Math.min(top, mRectMainClose.top + mSecondaryView.getHeight()), mRectMainClose.top ); case DRAG_EDGE_BOTTOM: return Math.max( Math.min(top, mRectMainClose.top), mRectMainClose.top - mSecondaryView.getHeight() ); default: return child.getTop(); } } @Override public int clampViewPositionHorizontal(View child, int left, int dx) { switch (mDragEdge) { case DRAG_EDGE_RIGHT: return Math.max( Math.min(left, mRectMainClose.left), mRectMainClose.left - mSecondaryView.getWidth() ); case DRAG_EDGE_LEFT: return Math.max( Math.min(left, mRectMainClose.left + mSecondaryView.getWidth()), mRectMainClose.left ); default: return child.getLeft(); } } @Override public void onViewReleased(View releasedChild, float xvel, float yvel) { final boolean velRightExceeded = pxToDp((int) xvel) >= mMinFlingVelocity; final boolean velLeftExceeded = pxToDp((int) xvel) <= -mMinFlingVelocity; final boolean velUpExceeded = pxToDp((int) yvel) <= -mMinFlingVelocity; final boolean velDownExceeded = pxToDp((int) yvel) >= mMinFlingVelocity; final int pivotHorizontal = getHalfwayPivotHorizontal(); final int pivotVertical = getHalfwayPivotVertical(); switch (mDragEdge) { case DRAG_EDGE_RIGHT: if (velRightExceeded) { close(true); } else if (velLeftExceeded) { open(true); } else { if (mMainView.getRight() < pivotHorizontal) { open(true); } else { close(true); } } break; case DRAG_EDGE_LEFT: if (velRightExceeded) { open(true); } else if (velLeftExceeded) { close(true); } else { if (mMainView.getLeft() < pivotHorizontal) { close(true); } else { open(true); } } break; case DRAG_EDGE_TOP: if (velUpExceeded) { close(true); } else if (velDownExceeded) { open(true); } else { if (mMainView.getTop() < pivotVertical) { close(true); } else { open(true); } } break; case DRAG_EDGE_BOTTOM: if (velUpExceeded) { open(true); } else if (velDownExceeded) { close(true); } else { if (mMainView.getBottom() < pivotVertical) { open(true); } else { close(true); } } break; } } @Override public void onEdgeDragStarted(int edgeFlags, int pointerId) { super.onEdgeDragStarted(edgeFlags, pointerId); if (mLockDrag) { return; } boolean edgeStartLeft = (mDragEdge == DRAG_EDGE_RIGHT) && edgeFlags == ViewDragHelper.EDGE_LEFT; boolean edgeStartRight = (mDragEdge == DRAG_EDGE_LEFT) && edgeFlags == ViewDragHelper.EDGE_RIGHT; boolean edgeStartTop = (mDragEdge == DRAG_EDGE_BOTTOM) && edgeFlags == ViewDragHelper.EDGE_TOP; boolean edgeStartBottom = (mDragEdge == DRAG_EDGE_TOP) && edgeFlags == ViewDragHelper.EDGE_BOTTOM; if (edgeStartLeft || edgeStartRight || edgeStartTop || edgeStartBottom) { mDragHelper.captureChildView(mMainView, pointerId); } } @Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) { super.onViewPositionChanged(changedView, left, top, dx, dy); if (mMode == MODE_SAME_LEVEL) { if (mDragEdge == DRAG_EDGE_LEFT || mDragEdge == DRAG_EDGE_RIGHT) { mSecondaryView.offsetLeftAndRight(dx); } else { mSecondaryView.offsetTopAndBottom(dy); } } boolean isMoved = (mMainView.getLeft() != mLastMainLeft) || (mMainView.getTop() != mLastMainTop); if (mSwipeListener != null && isMoved) { if (mMainView.getLeft() == mRectMainClose.left && mMainView.getTop() == mRectMainClose.top) { mSwipeListener.onClosed(SwipeRevealLayout.this); } else if (mMainView.getLeft() == mRectMainOpen.left && mMainView.getTop() == mRectMainOpen.top) { mSwipeListener.onOpened(SwipeRevealLayout.this); } else { mSwipeListener.onSlide(SwipeRevealLayout.this, getSlideOffset()); } } mLastMainLeft = mMainView.getLeft(); mLastMainTop = mMainView.getTop(); ViewCompat.postInvalidateOnAnimation(SwipeRevealLayout.this); } private float getSlideOffset() { switch (mDragEdge) { case DRAG_EDGE_LEFT: return (float) (mMainView.getLeft() - mRectMainClose.left) / mSecondaryView.getWidth(); case DRAG_EDGE_RIGHT: return (float) (mRectMainClose.left - mMainView.getLeft()) / mSecondaryView.getWidth(); case DRAG_EDGE_TOP: return (float) (mMainView.getTop() - mRectMainClose.top) / mSecondaryView.getHeight(); case DRAG_EDGE_BOTTOM: return (float) (mRectMainClose.top - mMainView.getTop()) / mSecondaryView.getHeight(); default: return 0; } } @Override public void onViewDragStateChanged(int state) { super.onViewDragStateChanged(state); final int prevState = mState; switch (state) { case ViewDragHelper.STATE_DRAGGING: mState = STATE_DRAGGING; break; case ViewDragHelper.STATE_IDLE: // drag edge is left or right if (mDragEdge == DRAG_EDGE_LEFT || mDragEdge == DRAG_EDGE_RIGHT) { if (mMainView.getLeft() == mRectMainClose.left) { mState = STATE_CLOSE; } else { mState = STATE_OPEN; } } // drag edge is top or bottom else { if (mMainView.getTop() == mRectMainClose.top) { mState = STATE_CLOSE; } else { mState = STATE_OPEN; } } break; } if (mDragStateChangeListener != null && !mAborted && prevState != mState) { mDragStateChangeListener.onDragStateChanged(mState); } } }; public static String getStateString(int state) { switch (state) { case STATE_CLOSE: return "state_close"; case STATE_CLOSING: return "state_closing"; case STATE_OPEN: return "state_open"; case STATE_OPENING: return "state_opening"; case STATE_DRAGGING: return "state_dragging"; default: return "undefined"; } } private int pxToDp(int px) { Resources resources = getContext().getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); return (int) (px / ((float)metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT)); } private int dpToPx(int dp) { Resources resources = getContext().getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); return (int) (dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT)); } }
[ "sai.brahmabatla@gmail.com" ]
sai.brahmabatla@gmail.com
dc4c7c52eacf55a768de0eebf3bf64bba6e7bc30
1e2a3700115a42ce0bd71f56680d9ad550862b7f
/java/com/l2jmobius/gameserver/model/actor/instance/L2ChestInstance.java
7d009aa12d6f7c94e956fc4d6dfa4da69152d975
[]
no_license
toudakos/HighFive
5a75313d43209193ad7bec89ce0f177bd7dddb6f
e76b6a497277f5e88093204b86f004101d0dca52
refs/heads/master
2021-04-23T00:34:59.390728
2020-03-25T04:17:38
2020-03-25T04:17:38
249,884,195
0
0
null
2020-03-25T04:08:31
2020-03-25T04:08:30
null
UTF-8
Java
false
false
2,458
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jmobius.gameserver.model.actor.instance; import com.l2jmobius.gameserver.data.xml.impl.NpcData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; /** * This class manages all chest. * @author Julian */ public final class L2ChestInstance extends L2MonsterInstance { private volatile boolean _specialDrop; /** * Creates a chest. * @param template the chest NPC template */ public L2ChestInstance(L2NpcTemplate template) { super(template); setInstanceType(InstanceType.L2ChestInstance); setRandomWalking(false); _specialDrop = false; } @Override public void onSpawn() { super.onSpawn(); _specialDrop = false; setMustRewardExpSp(true); } public synchronized void setSpecialDrop() { _specialDrop = true; } @Override public void doItemDrop(L2NpcTemplate npcTemplate, L2Character lastAttacker) { int id = getTemplate().getId(); if (!_specialDrop) { if ((id >= 18265) && (id <= 18286)) { id += 3536; } else if ((id == 18287) || (id == 18288)) { id = 21671; } else if ((id == 18289) || (id == 18290)) { id = 21694; } else if ((id == 18291) || (id == 18292)) { id = 21717; } else if ((id == 18293) || (id == 18294)) { id = 21740; } else if ((id == 18295) || (id == 18296)) { id = 21763; } else if ((id == 18297) || (id == 18298)) { id = 21786; } } super.doItemDrop(NpcData.getInstance().getTemplate(id), lastAttacker); } @Override public boolean isMovementDisabled() { return true; } @Override public boolean hasRandomAnimation() { return false; } }
[ "danielbarionn@gmail.com" ]
danielbarionn@gmail.com
71bbf96d8b6067c91e10ecf35688291c50a4c86b
9c6755241eafce525184949f8c5dd11d2e6cefd1
/src/leetcode/algorithms/IsRobotBounded.java
d8f7906e0043aa64e8438c743d8bd9745fbc362d
[]
no_license
Baltan/leetcode
782491c3281ad04efbe01dd0dcba2d9a71637a31
0951d7371ab93800e04429fa48ce99c51284d4c4
refs/heads/master
2023-08-17T00:47:41.880502
2023-08-16T16:04:32
2023-08-16T16:04:32
172,838,932
13
3
null
null
null
null
UTF-8
Java
false
false
1,392
java
package leetcode.algorithms; /** * Description: 1041. Robot Bounded In Circle * * @author Baltan * @date 2019-05-13 13:58 */ public class IsRobotBounded { public static void main(String[] args) { System.out.println(isRobotBounded("GGLLGG")); System.out.println(isRobotBounded("GG")); System.out.println(isRobotBounded("GL")); } public static boolean isRobotBounded(String instructions) { /** * 0-N,1-E,2-S,3-W */ int[] directions = {0, 1, 2, 3}; int direction = directions[0]; int[] moves = new int[4]; int length = instructions.length(); for (int i = 0; i < length; i++) { char instruction = instructions.charAt(i); if (instruction == 'G') { moves[direction]++; } else if (instruction == 'L') { /** * direction = (direction + 3) % 4 */ direction = (direction + 3) & 3; } else { /** * direction = (direction + 1) % 4 */ direction = (direction + 1) & 3; } } if (moves[0] == moves[2] && moves[1] == moves[3]) { return true; } else if (direction != 0) { return true; } else { return false; } } }
[ "617640006@qq.com" ]
617640006@qq.com
9516dafdb2cf3170ad4730986064ccd65c3a60b7
fceb1d4412cc725b6ba494f837289ea6112eeba7
/app/src/main/java/com/semicolon/tadlaly/Adapters/FollowAdapter.java
b6a9f17544db03b3bbb6fb607564ef240d67e041
[]
no_license
freelanceapp/Tadlaly
8a4249dfd3440664c8e7992e87a42e6fcb550e67
5a1010bb64e5962848d66abc9f82d4b81e3a7f42
refs/heads/master
2020-05-16T23:42:30.007958
2019-03-29T21:34:20
2019-03-29T21:34:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,452
java
package com.semicolon.tadlaly.Adapters; import android.content.Context; import android.graphics.PorterDuff; import android.net.Uri; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; import com.github.siyamed.shapeimageview.RoundedImageView; import com.semicolon.tadlaly.Activities.MyFollowActivity; import com.semicolon.tadlaly.Models.MyAdsModel; import com.semicolon.tadlaly.R; import com.semicolon.tadlaly.Services.Tags; import com.squareup.picasso.Picasso; import java.util.List; public class FollowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private final int item_row = 1; private final int progress_row = 0; private Context context; private List<MyAdsModel> myAdsModelList; private MyFollowActivity myFollowActivity; private int totalItemCount, lastVisibleItem; private int Threshold = 5; private OnLoadListener onLoadListener; private boolean loading; private LinearLayoutManager mLinearLayoutManager; public FollowAdapter(RecyclerView recView, Context context, List<MyAdsModel> myAdsModelList) { this.context = context; this.myAdsModelList = myAdsModelList; myFollowActivity = (MyFollowActivity) context; if (recView.getLayoutManager() instanceof LinearLayoutManager) { mLinearLayoutManager = (LinearLayoutManager) recView.getLayoutManager(); recView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (dy > 0) { totalItemCount = mLinearLayoutManager.getItemCount(); lastVisibleItem = mLinearLayoutManager.findLastVisibleItemPosition(); if (!loading && totalItemCount <= (lastVisibleItem + Threshold)) { if (onLoadListener != null) { onLoadListener.onLoadMore(); } loading = true; } } } }); } } @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { if (viewType == item_row) { View view = LayoutInflater.from(context).inflate(R.layout.follow_item_row, parent, false); return new myItemHolder(view); } else { View view = LayoutInflater.from(context).inflate(R.layout.load_more_item, parent, false); return new myProgressHolder(view); } } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { if (holder instanceof myItemHolder) { myItemHolder itemHolder = (myItemHolder) holder; MyAdsModel myAdsModel = myAdsModelList.get(position); itemHolder.BindData(myAdsModel); itemHolder.itemView.setOnClickListener(view -> { MyAdsModel myAdsModel2 = myAdsModelList.get(holder.getAdapterPosition()); myFollowActivity.setItemData(myAdsModel2,holder.getAdapterPosition()); } ); } else if (holder instanceof myProgressHolder) { myProgressHolder progressHolder = (myProgressHolder) holder; progressHolder.progressBar.setIndeterminate(true); } } @Override public int getItemViewType(int position) { return myAdsModelList.get(position) == null ? progress_row : item_row; } @Override public int getItemCount() { return myAdsModelList.size(); } public class myItemHolder extends RecyclerView.ViewHolder { private TextView tv_date, tv_state_new, tv_state_old, tv_state_service, tv_name,tv_dept_name, tv_distance, tv_read_state; private RoundedImageView img; public myItemHolder(View itemView) { super(itemView); tv_distance = itemView.findViewById(R.id.tv_distance); img = itemView.findViewById(R.id.img); tv_date = itemView.findViewById(R.id.tv_date); tv_state_new = itemView.findViewById(R.id.tv_state_new); tv_state_old = itemView.findViewById(R.id.tv_state_old); tv_state_service = itemView.findViewById(R.id.tv_state_service); tv_read_state = itemView.findViewById(R.id.tv_read_state); tv_name = itemView.findViewById(R.id.tv_name); tv_dept_name = itemView.findViewById(R.id.tv_dept_name); } public void BindData(MyAdsModel myAdsModel) { double dist = myAdsModel.getDistance(); tv_distance.setText(String.format("%.2f",dist)+" "+ context.getString(R.string.km)); if (myAdsModel.getAdvertisement_image().size() > 0) { Picasso.with(context).load(Uri.parse(Tags.Image_Url + myAdsModel.getAdvertisement_image().get(0).getPhoto_name())).into(img); } tv_date.setText(myAdsModel.getAdvertisement_date()); if (myAdsModel.isRead_status()) { tv_read_state.setVisibility(View.GONE); } else { tv_read_state.setVisibility(View.VISIBLE); } if (myAdsModel.getAdvertisement_type().equals(Tags.ad_new)) { tv_state_new.setVisibility(View.VISIBLE); tv_state_old.setVisibility(View.GONE); tv_state_service.setVisibility(View.GONE); } else if (myAdsModel.getAdvertisement_type().equals(Tags.ad_old)) { tv_state_new.setVisibility(View.GONE); tv_state_old.setVisibility(View.VISIBLE); tv_state_service.setVisibility(View.GONE); } else if (myAdsModel.getAdvertisement_type().equals(Tags.service)) { tv_state_new.setVisibility(View.GONE); tv_state_old.setVisibility(View.GONE); tv_state_service.setVisibility(View.VISIBLE); } tv_name.setText(myAdsModel.getAdvertisement_title()); tv_dept_name.setText(myAdsModel.getDepartment_name()); } } public class myProgressHolder extends RecyclerView.ViewHolder { ProgressBar progressBar; public myProgressHolder(View itemView) { super(itemView); progressBar = itemView.findViewById(R.id.progBar); progressBar.getIndeterminateDrawable().setColorFilter(ContextCompat.getColor(context, R.color.colorPrimary), PorterDuff.Mode.SRC_IN); } } public interface OnLoadListener { void onLoadMore(); } public void setLoadListener(OnLoadListener loadListener) { this.onLoadListener = loadListener; } public void setLoaded() { loading = false; } @Override public void onViewDetachedFromWindow(@NonNull RecyclerView.ViewHolder holder) { super.onViewDetachedFromWindow(holder); holder.itemView.clearAnimation(); } }
[ "emadmagdi.151995@gmai.com" ]
emadmagdi.151995@gmai.com
a3b5b789835ce0a30b19f43bee006d30163c2f1a
51fd89bdeb4e16d2092d4a0b353e5db4a7823327
/comment_service/src/main/java/ba/unsa/etf/nwt/comment_service/service/MainRoleService.java
ef9ac7e8b8b08ad96c5c0632e5e67596e8ec1946
[]
no_license
SamraMujcinovic/PetCare
d5366c149e37019feb000df1bc545d7ad05b43c6
95b29ad509e76891081bac33fead2ceef0f318c3
refs/heads/master
2023-07-02T18:00:24.322271
2021-07-13T16:32:51
2021-07-13T16:32:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
947
java
package ba.unsa.etf.nwt.comment_service.service; import ba.unsa.etf.nwt.comment_service.model.sectionRole.MainRole; import ba.unsa.etf.nwt.comment_service.model.sectionRole.SectionRoleName; import ba.unsa.etf.nwt.comment_service.repository.MainRoleRepository; import org.springframework.stereotype.Service; import java.util.stream.Collectors; @Service public class MainRoleService { private final MainRoleRepository mainRoleRepository; public MainRoleService(MainRoleRepository mainRoleRepository) { this.mainRoleRepository = mainRoleRepository; } public MainRole addRole(MainRole mainRole) { return mainRoleRepository.save(mainRole); } public MainRole getRoleByName(SectionRoleName sectionRoleName) { return mainRoleRepository.findAll() .stream() .filter(r -> r.getName().equals(sectionRoleName)) .collect(Collectors.toList()).get(0); } }
[ "ahrustic2@etf.unsa.ba" ]
ahrustic2@etf.unsa.ba
78f9935c6601ebcc99980c2b72cc848bd2710074
135b0dac62c3766420595f4dbb95da9e878ff4b8
/chapter5/src/Ex09.java
f99923babc7dadc14d5a8e0e0440c186860c1612
[]
no_license
Tulu-Kim/JAVA-Training
e89873b47a6ec6d9fd2bb2ce9b646cfa1a73094f
5382fe7558c2788f736af00482727d52b5aa87b5
refs/heads/master
2023-07-28T08:03:07.771971
2021-09-16T10:27:19
2021-09-16T10:27:19
402,721,077
0
0
null
null
null
null
UHC
Java
false
false
273
java
//오버라이딩의 접근에 대한 규정 //접근제한자 우선순위 private>package>protected>public class UU{ void aaa() { System.out.println("aaa"); } } class VV extends UU{ void aaa() { System.out.println("UU"); } } public class Ex09 { }
[ "aaa@DESKTOP-G20913L" ]
aaa@DESKTOP-G20913L
e92359267481e719184a09deb5d3ecb2e560cdbc
53e7e496cb5ae73586cddb0827786451570e00ac
/src/com/nuaa/supermarket/pojo/SmbmsUser.java
c912e3c5db7e485c307d56ae04a2be1b6d410520
[]
no_license
liu764550814/supermarket
0b827177c8be32efa4a0f84ccdc53441908e1e8d
df328c155012044ecf3cf30ef22fd12b1df0dace
refs/heads/master
2020-12-01T21:36:07.697428
2019-12-29T16:57:20
2019-12-29T16:57:20
230,778,425
0
0
null
null
null
null
UTF-8
Java
false
false
3,032
java
package com.nuaa.supermarket.pojo; import java.util.Date; public class SmbmsUser { private Long id; private String usercode; private String username; private String userpassword; private Integer gender; private Date birthday; private String phone; private String address; private Integer userrole; private Long createdby; private Date creationdate; private Long modifyby; private Date modifydate; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsercode() { return usercode; } public void setUsercode(String usercode) { this.usercode = usercode == null ? null : usercode.trim(); } public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getUserpassword() { return userpassword; } public void setUserpassword(String userpassword) { this.userpassword = userpassword == null ? null : userpassword.trim(); } public Integer getGender() { return gender; } public void setGender(Integer gender) { this.gender = gender; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone == null ? null : phone.trim(); } public String getAddress() { return address; } public void setAddress(String address) { this.address = address == null ? null : address.trim(); } public Integer getUserrole() { return userrole; } public void setUserrole(Integer userrole) { this.userrole = userrole; } public Long getCreatedby() { return createdby; } public void setCreatedby(Long createdby) { this.createdby = createdby; } public Date getCreationdate() { return creationdate; } public void setCreationdate(Date creationdate) { this.creationdate = creationdate; } public Long getModifyby() { return modifyby; } public void setModifyby(Long modifyby) { this.modifyby = modifyby; } public Date getModifydate() { return modifydate; } public void setModifydate(Date modifydate) { this.modifydate = modifydate; } @Override public String toString() { return "SmbmsUser [id=" + id + ", usercode=" + usercode + ", username=" + username + ", userpassword=" + userpassword + ", gender=" + gender + ", birthday=" + birthday + ", phone=" + phone + ", address=" + address + ", userrole=" + userrole + ", createdby=" + createdby + ", creationdate=" + creationdate + ", modifyby=" + modifyby + ", modifydate=" + modifydate + "]"; } }
[ "764550814@qq.com" ]
764550814@qq.com
9e1bbeadc5ba182eb03bb023a0a3683b660092d1
8565bffb6cb99da16cdf3130760082487a1c2c6a
/Benchmark/src/business/bibleBusinessService.java
08fd91b783004210c2fa12d5e914b67319b4c056
[]
no_license
Lincoln-hub/CST235-Assignments
cfa680475bf33c5bb1c17c16932dcf8de73c5412
c81e785a071c9c7cffc6fd8b03cb42f8fac92300
refs/heads/main
2023-02-08T09:00:50.096637
2020-12-21T02:23:33
2020-12-21T02:23:33
302,755,449
0
0
null
null
null
null
UTF-8
Java
false
false
3,116
java
package business; import java.util.HashMap; import java.util.Map; import javax.ejb.EJB; import javax.ejb.Local; import javax.ejb.LocalBean; import javax.ejb.Stateless; import javax.enterprise.inject.Alternative; import javax.faces.bean.ViewScoped; import beans.Scripture; import data.dataAccessInterface; /** * Session Bean implementation class bibleBusinessService */ @Stateless @Local(bibleBusinessInterface.class) @LocalBean @Alternative @ViewScoped public class bibleBusinessService implements bibleBusinessInterface { @EJB dataAccessInterface service; public bibleBusinessService() { // TODO Auto-generated constructor stub } public String returnVerse(Scripture scripture) { int bookNumber = returnBook(scripture); int chpt = scripture.getChpt(); int verse = scripture.getVerse(); return service.returnVerse(bookNumber, chpt, verse); } public int returnBook(Scripture script) { // TODO Auto-generated method stub String book = script.getBook(); Map<String, Integer> myMap = new HashMap<String, Integer>(); myMap.put("Genesis", 1); myMap.put("Exodus", 2); myMap.put("Leviticus", 3); myMap.put("Numbers", 4); myMap.put("Deuteronomy", 5); myMap.put("Joshua", 6); myMap.put("Judges", 7); myMap.put("Ruth", 8); myMap.put("1 Samuel", 9); myMap.put("2 Samuel", 10); myMap.put("1 King", 11); myMap.put("2 King", 12); myMap.put("1 Chronicles", 13); myMap.put("2 Chronicles", 14); myMap.put("Ezra", 15); myMap.put("Nehemiah", 16); myMap.put("Esther", 17); myMap.put("Job", 18); myMap.put("Psalm", 19); myMap.put("Proverbs", 20); myMap.put("Ecclesiastes", 21); myMap.put("Song of Solomon", 22); myMap.put("Isaiah", 23); myMap.put("Jeremiah", 24); myMap.put("Lamentations", 25); myMap.put("Ezekiel", 26); myMap.put("Daniel", 27); myMap.put("Hosea", 28); myMap.put("Joel", 29); myMap.put("Amos", 30); myMap.put("Obadiah", 31); myMap.put("Jonah", 32); myMap.put("Micah", 33); myMap.put("Nahum", 34); myMap.put("Habakkuk", 35); myMap.put("Zephaniah", 36); myMap.put("Haggai", 37); myMap.put("Zechariah", 38); myMap.put("Malachi", 39); myMap.put("Matthew", 40); myMap.put("Mark", 41); myMap.put("Luke", 42); myMap.put("John", 43); myMap.put("Acts", 44); myMap.put("Romans", 45); myMap.put("1 Corinthians", 46); myMap.put("2 Corinthians", 47); myMap.put("Galatians", 48); myMap.put("Ephesians", 49); myMap.put("Philippians", 50); myMap.put("Colossians", 51); myMap.put("1 Thessalonians", 52); myMap.put("2 Thessalonians", 53); myMap.put("1 Timothy", 54); myMap.put("2 Timothy", 55); myMap.put("Titus", 56); myMap.put("Philemon", 57); myMap.put("Hebrews", 58); myMap.put("James", 59); myMap.put("1 Peter", 60); myMap.put("2 Peter", 61); myMap.put("1 John", 62); myMap.put("2 John", 63); myMap.put("3 John", 64); myMap.put("Jude", 65); myMap.put("Revelation", 66); return myMap.get(book); } }
[ "noreply@github.com" ]
noreply@github.com
bfd4d0e2dfdca29fc77c07bae15fee34cb5d0445
ddbb66d7cc7d2ca6a60e3252227de799b51c2c7b
/src/main/java/com/speedment/codegen/java/views/EnumConstantView.java
852637c8a95a4e386ba9c581f6ecc0115d069a17
[ "Apache-2.0" ]
permissive
gitter-badger/speedment
3c4420df4d1facc99be8ca60380fadae13731e6b
d0989fe34470926b66da577b439c1c57111ff942
refs/heads/master
2021-01-15T20:57:33.240476
2015-04-07T22:31:53
2015-04-07T22:31:53
36,503,406
0
0
null
2015-05-29T12:36:04
2015-05-29T12:36:04
null
UTF-8
Java
false
false
1,359
java
/** * * Copyright (c) 2006-2015, Speedment, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); You may not * use this file except in compliance with the License. You may obtain a copy of * the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.speedment.codegen.java.views; import com.speedment.codegen.base.CodeView; import static com.speedment.codegen.Formatting.*; import com.speedment.codegen.base.CodeGenerator; import com.speedment.codegen.lang.models.EnumConstant; import java.util.Optional; import com.speedment.codegen.util.CodeCombiner; /** * * @author Emil Forslund */ public class EnumConstantView implements CodeView<EnumConstant> { @Override public Optional<String> render(CodeGenerator cg, EnumConstant model) { return Optional.of( model.getName() + (model.getValues().isEmpty() ? EMPTY : SPACE) + cg.onEach(model.getValues()).collect( CodeCombiner.joinIfNotEmpty( COMMA_SPACE, PS, PE ) ) ); } }
[ "minborg@speedment.com" ]
minborg@speedment.com
0f66e80558366afd48ee26e688ac39238e11312a
6f93405d2bcb515c3de2501c463ad9742f2936ef
/src/main/java/com/donnie/SpringBootJWTAngular/models/User.java
856de037cf8a90c910fb32634fb516877355e651
[]
no_license
donniegrubat2005/SpringBootJWTAngular
ca07f768c933717aa0ff83c1c54a4f0b43009c87
30cafbb2c67e85dd76646eab633d6fb16c7474f0
refs/heads/master
2021-01-05T06:07:17.206492
2020-02-23T10:19:04
2020-02-23T10:19:04
240,909,194
0
0
null
null
null
null
UTF-8
Java
false
false
1,693
java
package com.donnie.SpringBootJWTAngular.models; import java.util.HashSet; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; @Entity @Table( name = "users", uniqueConstraints = { @UniqueConstraint(columnNames = "username"), @UniqueConstraint(columnNames = "email") }) public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotBlank @Size(max = 20) private String username; @NotBlank @Size(max = 50) @Email private String email; @NotBlank @Size(max = 120) private String password; @ManyToMany(fetch = FetchType.LAZY) @JoinTable( name = "user_roles", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id")) private Set<Role> roles = new HashSet<>(); public User() { super(); } public User(String username, String email, String password) { super(); this.username = username; this.email = email; this.password = password; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } }
[ "donniegrubat2005@gmail.com" ]
donniegrubat2005@gmail.com
7589bea76000b3741ac68ba8e79490b4cf06a355
db27b7836d5949c8e77d50d36fb66815e52e0af4
/src/main/java/validators/IsTrue.java
c037460ff997c288f8c05d6a8848bed87f97c1be
[]
no_license
lecter69/jsf_nowe
c614e50e8f3fe12916effb595039311c39e68b46
3a6497f27151d449668eda6e8bb25d976b825a0d
refs/heads/master
2021-01-19T11:02:16.309907
2012-01-12T15:30:26
2012-01-12T15:30:26
3,161,664
0
0
null
null
null
null
UTF-8
Java
false
false
588
java
package validators; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; /** * * @author Jakub Martin */ public class IsTrue implements Validator { @Override public void validate(FacesContext context, UIComponent component, Object value) { if (value instanceof Boolean && ((Boolean) value).equals(Boolean.FALSE)) { throw new ValidatorException(new FacesMessage("error")); } } }
[ "jakub.martin@hotmail.com" ]
jakub.martin@hotmail.com
18f0782758041ad28790b0ce87f7ed0a0947825a
8688e2139e13e46a55517e7a87753eb4fca19c05
/src/main/java/UsingDoubleCheck.java
f7f9c707dc27acef611cafde4656f0104441f94b
[]
no_license
irnd04/lazy-singleton
6229096a703a8b27b5078645a23adf0e05d16341
16f5e3006203a67c5173f04b2140085275223c3a
refs/heads/master
2023-07-14T00:17:54.607883
2021-08-19T15:02:14
2021-08-19T15:02:14
397,980,307
0
0
null
null
null
null
UTF-8
Java
false
false
522
java
import lombok.SneakyThrows; public class UsingDoubleCheck { private static volatile Resource resource; @SneakyThrows public static Resource getInstance() { if (resource == null) { synchronized (UsingDoubleCheck.class) { if (resource == null) { resource = new Resource(); } } } return resource; } public static void main(String[] args) { Tester.test(UsingDoubleCheck::getInstance); } }
[ "irnd04@gmail.com" ]
irnd04@gmail.com
58d2e92666f11d115ebf3195595839cad255efd8
447520f40e82a060368a0802a391697bc00be96f
/apks/banking_set2/com.advantage.RaiffeisenBank/source/com/bumptech/glide/load/resource/bitmap/GlideBitmapDrawable.java
a16dfcc8f4755ba84e614b0f128638f99ee88b01
[ "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
4,419
java
package com.bumptech.glide.load.resource.bitmap; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable.ConstantState; import android.util.DisplayMetrics; import android.view.Gravity; import com.bumptech.glide.load.resource.drawable.GlideDrawable; public class GlideBitmapDrawable extends GlideDrawable { private boolean applyGravity; private final Rect destRect = new Rect(); private int height; private boolean mutated; private BitmapState state; private int width; public GlideBitmapDrawable(Resources paramResources, Bitmap paramBitmap) { this(paramResources, new BitmapState(paramBitmap)); } GlideBitmapDrawable(Resources paramResources, BitmapState paramBitmapState) { if (paramBitmapState == null) { throw new NullPointerException("BitmapState must not be null"); } this.state = paramBitmapState; int i; if (paramResources != null) { i = paramResources.getDisplayMetrics().densityDpi; if (i == 0) { i = 160; paramBitmapState.targetDensity = i; } } for (;;) { this.width = paramBitmapState.bitmap.getScaledWidth(i); this.height = paramBitmapState.bitmap.getScaledHeight(i); return; break; i = paramBitmapState.targetDensity; } } public void draw(Canvas paramCanvas) { if (this.applyGravity) { Gravity.apply(119, this.width, this.height, getBounds(), this.destRect); this.applyGravity = false; } paramCanvas.drawBitmap(this.state.bitmap, null, this.destRect, this.state.paint); } public Bitmap getBitmap() { return this.state.bitmap; } public Drawable.ConstantState getConstantState() { return this.state; } public int getIntrinsicHeight() { return this.height; } public int getIntrinsicWidth() { return this.width; } public int getOpacity() { Bitmap localBitmap = this.state.bitmap; if ((localBitmap == null) || (localBitmap.hasAlpha()) || (this.state.paint.getAlpha() < 255)) { return -3; } return -1; } public boolean isAnimated() { return false; } public boolean isRunning() { return false; } public Drawable mutate() { if ((!this.mutated) && (super.mutate() == this)) { this.state = new BitmapState(this.state); this.mutated = true; } return this; } protected void onBoundsChange(Rect paramRect) { super.onBoundsChange(paramRect); this.applyGravity = true; } public void setAlpha(int paramInt) { if (this.state.paint.getAlpha() != paramInt) { this.state.setAlpha(paramInt); invalidateSelf(); } } public void setColorFilter(ColorFilter paramColorFilter) { this.state.setColorFilter(paramColorFilter); invalidateSelf(); } public void setLoopCount(int paramInt) {} public void start() {} public void stop() {} static class BitmapState extends Drawable.ConstantState { private static final Paint DEFAULT_PAINT = new Paint(6); private static final int DEFAULT_PAINT_FLAGS = 6; private static final int GRAVITY = 119; final Bitmap bitmap; Paint paint = DEFAULT_PAINT; int targetDensity; public BitmapState(Bitmap paramBitmap) { this.bitmap = paramBitmap; } BitmapState(BitmapState paramBitmapState) { this(paramBitmapState.bitmap); this.targetDensity = paramBitmapState.targetDensity; } public int getChangingConfigurations() { return 0; } void mutatePaint() { if (DEFAULT_PAINT == this.paint) { this.paint = new Paint(6); } } public Drawable newDrawable() { return new GlideBitmapDrawable(null, this); } public Drawable newDrawable(Resources paramResources) { return new GlideBitmapDrawable(paramResources, this); } void setAlpha(int paramInt) { mutatePaint(); this.paint.setAlpha(paramInt); } void setColorFilter(ColorFilter paramColorFilter) { mutatePaint(); this.paint.setColorFilter(paramColorFilter); } } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
2aac1d771837dab5ac6b58c3a6248d282e402584
3e72f9ef5bfcd90c14cc7939e332010143a52576
/src/com/github/xg/utgen/core/MockCodeGenerate.java
efaeaea7749330dd91163d17c14b30ab20dc1b96
[]
no_license
ztz2018/ut-generator
8bbd090356264392680b52080f076b5e8a458b47
766c3958fa80342faed6aa3f38ef4b6a8205d48c
refs/heads/master
2020-09-28T02:30:58.896082
2019-02-20T11:55:42
2019-02-20T11:55:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
14,804
java
package com.github.xg.utgen.core; import com.github.xg.utgen.core.util.IoUtil; import com.github.xg.utgen.core.util.StrKit; import com.github.xg.utgen.core.util.Tuple; import static com.github.xg.utgen.core.util.Formats.*; import com.google.common.base.CharMatcher; import java.io.File; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.text.SimpleDateFormat; import java.util.*; /** * Created by yuxiangshi on 2017/9/4. */ public class MockCodeGenerate extends AbstractCodeGenerate { private String className; private String packageName; private String saveFilePath; private StringBuilder sb = new StringBuilder(); private StringBuilder mockClassesSb = new StringBuilder(); private StringBuilder importSb = new StringBuilder(); private HashMap<String, Integer> methodCount = new HashMap<>(); private String oldContent; static String suffix = "AutoMock"; private boolean hasCtorCode; private boolean ctorCodeExistMap; public MockCodeGenerate(TestProject testProject, Class clazz, String className, String packageName, String saveFilePath, boolean closeFieldSetGetCode) { this.className = className; this.packageName = packageName; this.saveFilePath = saveFilePath + File.separator + className + suffix + ".java"; importClasses.add("java.util.Map"); importClasses.add("mockit.Mock"); importClasses.add("mockit.MockUp"); if (!closeFieldSetGetCode) { importClasses.add("java.lang.reflect.Field"); importClasses.add("java.lang.reflect.Modifier"); importClasses.add("mockit.Deencapsulation"); } sb.append(testProject.getHEADER()); sb.append("public class " + className + suffix + " {" + RT_2); getConstructorMockCode(clazz); if (!closeFieldSetGetCode) { sb.append(AdditionalMockCode.clause); } } private void getConstructorMockCode(Class<?> clazz) { ConstructorMockCode cmc = new ConstructorMockCode(clazz, this); String s = cmc.get(); hasCtorCode = !StrKit.blank(s); ctorCodeExistMap = cmc.existMapType; sb.append(s); } public Tuple addMethod(Method method, String methodName, Map<Class, List<Method>> map) { if (map == null || map.isEmpty()) { return null; } Map<String, List<Tuple>> classMethodsMap = new LinkedHashMap<>(); StringBuilder methodSb = new StringBuilder(); String testMethodName = StrKit.CapsFirst(methodName); if (methodCount.containsKey(testMethodName)) { methodCount.put(testMethodName, methodCount.get(testMethodName) + 1); } else { methodCount.put(testMethodName, 0); } if (methodCount.get(testMethodName) != 0) { testMethodName += methodCount.get(testMethodName); } if (testMethodName.equals(className)) { testMethodName = "$" + testMethodName; } methodSb.append(BLANK_4 + "/**" + RT_1); methodSb.append(BLANK_4 + " * Dependency mock code of test method {@link " + className + "#" + method.getName() + "}" + RT_1); methodSb.append(BLANK_4 + " */" + RT_1); methodSb.append(BLANK_4 + "static class " + testMethodName + "Mock {" + RT_1); List<String> mockedClassNames = new ArrayList<>(); for (Class c : map.keySet()) { boolean isAbstract = false; if (c.isInterface() || Modifier.isAbstract(c.getModifiers())) { isAbstract = true; } String mockClassName = getClassName(c); boolean repeatClassName = false; if (!mockedClassNames.contains(mockClassName)) { mockedClassNames.add(mockClassName); } else { repeatClassName = true; } if (repeatClassName) { mockClassName = c.getName(); } List<Tuple> argTypes = new ArrayList<>(); String mockMethodName; if (classMethodsMap.containsKey(mockMethodName = "mock" + c.getSimpleName())) { mockMethodName = "mock"; String[] strings = c.getName().split("\\."); for (int i = 0; i < strings.length; i++) { String s = StrKit.CapsFirst(strings[i]); mockMethodName += s; } } classMethodsMap.put(mockMethodName, argTypes); String genericParam = isAbstract ? " <T extends " + mockClassName + ">" : ""; methodSb.append(BLANK_8 + "static" + genericParam + " void " + mockMethodName + "("); int i = 0; Map<String, Integer> methodNameCountMap = new HashMap<>(); Map<String, Integer> methodNameCountMap1 = new HashMap<>(); List<Tuple> fields = new ArrayList<>(); String params = ""; for (Method m : map.get(c)) { String mName = m.getName(); Class mReturnType = m.getReturnType(); String returnType = getClassName(mReturnType); if (!returnType.equals("void")) { String capsMethodName = StrKit.CapsFirst(mName); if (!methodNameCountMap.containsKey(mName)) { methodNameCountMap.put(mName, 1); } else { int cnt = methodNameCountMap.get(mName); methodNameCountMap.put(mName, cnt + 1); mName = mName + cnt; } if (!methodNameCountMap1.containsKey(capsMethodName)) { methodNameCountMap1.put(capsMethodName, 1); } else { int cnt = methodNameCountMap1.get(capsMethodName); methodNameCountMap1.put(capsMethodName, cnt + 1); capsMethodName = capsMethodName + cnt; } fields.add(Tuple.of(mName + "Count", returnType + " last" + capsMethodName + "MockValue;", mName + "MockValue")); } params += returnType.equals("void") ? "" : ((i++ == 0 ? "" : ", ") + "final Map<Integer, " + (mReturnType.isPrimitive() ? getBoxedTypeName(returnType) : returnType) + "> " + mName + "MockValue"); if (!returnType.equals("void")) { argTypes.add(Tuple.of(mReturnType, mName + "MockValue")); } } methodSb.append(params + ") {" + RT_1); methodSb.append(BLANK_8 + BLANK_4 + "new MockUp<" + (isAbstract ? "T" : mockClassName) + ">() {" + RT_1); for (int j = 0; j < fields.size(); j++) { methodSb.append(BLANK_8 + BLANK_8 + "int " + fields.get(j).first() + " = 0;" + RT_1); methodSb.append(BLANK_8 + BLANK_8 + fields.get(j).second() + RT_2); } i = 0; for (Method m : map.get(c)) { methodSb.append(BLANK_8 + BLANK_8 + "@Mock" + RT_1); boolean needInvocation = false; if (isAbstract && c.isAssignableFrom(method.getDeclaringClass())) { if (MethodHelper.methodEqualsIgnoringDeclaringClass(method, m)) { needInvocation = true; if (!importClasses.contains("mockit.Invocation")) { importClasses.add("mockit.Invocation"); } } } String methodParams = ""; Class[] parameterTypes = m.getParameterTypes(); if (needInvocation) { methodParams = parameterTypes.length != 0 ? "Invocation invo, " : "Invocation invo"; } for (int j = 0; j < parameterTypes.length; j++) { String paramName = " param" + j; String typeName = getClassName(parameterTypes[j]); methodParams += (j == 0) ? typeName + paramName : ", " + typeName + paramName; } Class returnType = m.getReturnType(); String returnTypeName = getClassName(returnType); StringBuilder mockMethodBody = new StringBuilder(); String prefix = BLANK_8 + BLANK_8 + BLANK_4; if (needInvocation) { mockMethodBody.append(prefix + "if (invo.getInvokedInstance() instanceof " + getClassName(method.getDeclaringClass()) + ") {" + RT_1); mockMethodBody.append(prefix + BLANK_4 + "//execute the original method" + RT_1); mockMethodBody.append(prefix + BLANK_4 + ("void".equals(returnTypeName) ? "" : "return ") + "invo.proceed(invo.getInvokedArguments());" + RT_1); mockMethodBody.append(prefix + "}" + RT_2); } if (!"void".equals(returnTypeName)) { Tuple tuple = fields.get(i++); String lastValueVarName = tuple.second().toString().split(" ")[1]; lastValueVarName = lastValueVarName.substring(0, lastValueVarName.length() - 1); mockMethodBody.append(prefix + returnTypeName + " result = " + lastValueVarName + ";" + RT_1); mockMethodBody.append(prefix + "if (" + tuple.third() + ".containsKey(" + tuple.first() + ")) {" + RT_1); mockMethodBody.append(prefix + BLANK_4 + "result = " + tuple.third() + ".get(" + tuple.first() + ");" + RT_1); mockMethodBody.append(prefix + BLANK_4 + lastValueVarName + " = result;" + RT_1); mockMethodBody.append(prefix + "}" + RT_1); mockMethodBody.append(prefix + tuple.first() + "++;" + RT_1); mockMethodBody.append(prefix + "return result;" + RT_1); } else { mockMethodBody.append(RT_1); } String modifier = Modifier.toString(m.getModifiers()); modifier = MethodHelper.filterMethodModifier(modifier); methodSb.append(BLANK_8 + BLANK_8 + modifier + ("".equals(modifier) ? "" : " ") + returnTypeName + " " + m.getName() + "(" + methodParams + ") {" + RT_1 + mockMethodBody + BLANK_8 + BLANK_8 + "}" + RT_2); } methodSb.append(BLANK_8 + BLANK_4 + "};" + RT_1); methodSb.append(BLANK_8 + "}" + RT_2); } methodSb.append(BLANK_4 + "}" + RT_2); mockClassesSb.append(methodSb); return Tuple.of(testMethodName + "Mock", classMethodsMap); } @Override public void generate() { //delta boolean needAppend = false; int importStartIndex = -1; if (new File(saveFilePath).exists()) { oldContent = IoUtil.readFile(saveFilePath); int index = oldContent.indexOf("package"); if (index == -1) { return; } importStartIndex = oldContent.indexOf(";", index); if (importStartIndex == -1) { return; } needAppend = true; } importSb.append("package " + packageName + ";" + RT_2); List<String> effectiveImports = new ArrayList<>(); for (String importClass : importClasses) { if (importClass.contains("java.lang") && CharMatcher.is('.').countIn(importClass) == 2) { continue; } if (importClass.startsWith(packageName) && !importClass.substring(packageName.length() + 1).contains(".")) { continue; } effectiveImports.add(importClass); } String[] imports = new String[effectiveImports.size()]; imports = effectiveImports.toArray(imports); Arrays.sort(imports); for (int i = 0; i < imports.length; i++) { String s = imports[i]; importSb.append("import " + s + ";" + RT_1); } String content = ""; boolean needWrite = false; if (needAppend && !mockClassesSb.toString().isEmpty()) { needWrite = true; String packageClause = oldContent.substring(0, importStartIndex + 1); String middle = oldContent.substring(importStartIndex + 1, oldContent.lastIndexOf("}")); content = packageClause + RT_2 + ImportCodeHelper.toString(effectiveImports, oldContent) + middle + BLANK_4 + "//add new mock on " + new SimpleDateFormat("yyyy/MM/dd HH:mm").format(new Date()) + "." + RT_1 + mockClassesSb.toString() + "}"; } else if (!needAppend) { needWrite = true; sb.append(mockClassesSb); sb.append("}"); String importString = "package " + packageName + ";" + RT_2; if (!mockClassesSb.toString().isEmpty()) { importString = importSb.toString(); } else { if (hasCtorCode) { importString = importSb.toString(); if (!ctorCodeExistMap) { importString = importString.replace("import java.util.Map;" + RT_1, ""); } } else { importString += "import mockit.Deencapsulation;" + RT_1; importString += "import java.lang.reflect.Field;" + RT_1; importString += "import java.lang.reflect.Modifier;" + RT_1; } } content = importString + RT_1 + sb.toString(); } if (needWrite) { IoUtil.writeFile(saveFilePath, content); } } public static String getBoxedTypeName(String type) { Class result; switch (type) { case "int": result = Integer.class; break; case "long": result = Long.class; break; case "short": result = Short.class; break; case "char": result = Character.class; break; case "float": result = Float.class; break; case "double": result = Double.class; break; case "boolean": result = Boolean.class; break; case "byte": result = Byte.class; break; default: throw new RuntimeException("unexpected type: " + type); } return result.getSimpleName(); } }
[ "yuxiangshi@ctrip.com" ]
yuxiangshi@ctrip.com
a8693ea011822b9e07453d47e0cc37ba2a1d64a6
8758fa78384e2da47e6d6aa48d51e8d6b57782b1
/src/lib/leveldb/db/LogFormat.java
86c6697fc5ba053848ed937c7766d20ef520feb6
[]
no_license
benravago/leveldb-wip
2d5f1efa102c8fdd971cb21d0ff41ee9e8ed3f23
b3be9a0cffc7a9776e23f460c1ec68059d7a1ac1
refs/heads/master
2020-03-19T12:16:35.614091
2018-08-21T16:59:44
2018-08-21T16:59:44
136,507,413
0
0
null
null
null
null
UTF-8
Java
false
false
1,933
java
package lib.leveldb.db; import java.io.IOException; import java.util.function.Consumer; import lib.leveldb.Status; /** * Log format information shared by reader and writer. * See ../doc/log_format.md for more detail. */ class LogFormat { /* enum RecordType */ // Zero is reserved for preallocated files static final int kZeroType = 0; static final int kFullType = 1; // For fragments static final int kFirstType = 2; static final int kMiddleType = 3; static final int kLastType = 4; static final int kMaxRecordType = kLastType; static final int kBlockSize = 32768; // Header is checksum (4 bytes), length (2 bytes), type (1 byte). static final int kHeaderSize = 4 + 2 + 1; // default Exception handler for Record{Reader,Writer}'s static Consumer<Throwable> notify = (t) -> { throw (t instanceof RuntimeException) ? (RuntimeException)t : new Status(t).state(t instanceof IOException ? Status.Code.IOError : Status.Code.Fault ); }; static Status status(Status.Code code, Throwable t) { throw new Status(t).state(code); } static Status status(Status.Code code, String msg) { throw new Status(msg).state(code); } // CRC32C masking // // Motivation: it is problematic to compute the CRC of a string that // contains embedded CRCs. Therefore we recommend that CRCs stored // somewhere (e.g., in files) should be masked before being stored. final static int kMaskDelta = 0x0a282ead8; // Return a masked representation of crc. static int mask(int crc) { // Rotate right by 15 bits and add a constant. return ((crc >>> 15) | (crc << 17)) + kMaskDelta; } // Return the crc whose masked representation is masked_crc. static int unmask(int masked_crc) { var rot = masked_crc - kMaskDelta; return ((rot >>> 17) | (rot << 15)); } }
[ "ben.ravago@aol.com" ]
ben.ravago@aol.com
24b1fa17067ceed3624cd215fde436734cc8799e
37d5b6950cca1b35e80aeb88e2727766ec11717e
/MyApplication/app/src/main/java/com/example/administrator/myapplication/MainActivity.java
f2b617fbe4099d774d8c6c5d95639b8478697f55
[]
no_license
LongKee/MyApplication
73903f8a0ee3baa4b90c1915a51784bcab06a3ab
b42c7d82874bdd06147bba26f6c250937dafddff
refs/heads/master
2021-01-17T18:04:50.835576
2018-03-02T12:59:43
2018-03-02T12:59:43
65,380,708
0
0
null
null
null
null
UTF-8
Java
false
false
724
java
package com.example.administrator.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { private int test = 0; @Override protected void onCreate(Bundle savedInstanceState) { // REVIEW[龙科] lll 2017/2/15 19:47 super.onCreate(savedInstanceState); // todo int i = 0; setContentView(R.layout.activity_main); // 龙科 // TODO 测试1 System.out.print("龙科" + ""); test(1); test2(); } private void test(int i) { } private void test2() { System.out.print("lk"); String name = " "; } }
[ "18210525183@163.com" ]
18210525183@163.com
be3b692b0da5a03762cd30822fb38fb856a7f5da
1c6fe1c9ad917dc9dacaf03eade82d773ccf3c8a
/acm-module-sys/src/main/java/com/wisdom/acm/sys/service/SysOrgService.java
d5ba07e5b0b90b082b8280a787bf8c630f46c737
[ "Apache-2.0" ]
permissive
daiqingsong2021/ord_project
332056532ee0d3f7232a79a22e051744e777dc47
a8167cee2fbdc79ea8457d706ec1ccd008f2ceca
refs/heads/master
2023-09-04T12:11:51.519578
2021-10-28T01:58:43
2021-10-28T01:58:43
406,659,566
0
0
null
null
null
null
UTF-8
Java
false
false
3,292
java
package com.wisdom.acm.sys.service; import com.wisdom.acm.sys.form.SysSearchOrgForm; import com.wisdom.acm.sys.po.SysOrgPo; import com.wisdom.acm.sys.form.SysOrgAddForm; import com.wisdom.acm.sys.form.SysOrgUpdateForm; import com.wisdom.acm.sys.vo.SysOrgInfoVo; import com.wisdom.acm.sys.vo.SysOrgSelectVo; import com.wisdom.acm.sys.vo.SysOrgUserTreeVo; import com.wisdom.acm.sys.vo.SysOrgVo; import com.wisdom.base.common.service.CommService; import com.wisdom.base.common.vo.OrgVo; import com.wisdom.base.common.vo.SelectVo; import java.util.List; import java.util.Map; public interface SysOrgService extends CommService<SysOrgPo> { List<SysOrgInfoVo> queryOrgPosByProjectId(Integer projectId); boolean isUseTeamByProjectId(Integer projectId); /** * 获取用户的组织信息 * @param userId * @return */ SysOrgInfoVo getUserOrgInfo(Integer userId); /** * 获取组织信息 * * @param OrgId * @return */ SysOrgInfoVo getOrgInfo(Integer OrgId); /** * 搜索组织列表 * * @param search * @return */ List<SysOrgVo> queryOrgsBySearch(SysSearchOrgForm search); /** * 获取组织列表 * * @return */ List<SysOrgVo> queryOrgTree(); /** * 根据组织id集合获取组织对象 * * @param orgIds * @return */ Map<Integer, OrgVo> queryOrgVoByOrgIds(List<Integer> orgIds); List<SysOrgInfoVo> queryOrgInfoVoByOrgIds(List<Integer> orgIds); SysOrgPo addOrg(SysOrgAddForm org); SysOrgPo updateOrg(SysOrgUpdateForm orgUpdate); /** * 从uuv同步数据 避免TransactionConfig 中切面事务控制 * @param org * @return */ SysOrgPo xinZengOrg(SysOrgAddForm org); /** * 从uuv同步数据 避免TransactionConfig 中切面事务控制 * @param orgUpdate * @return */ SysOrgPo gengXinOrg(SysOrgUpdateForm orgUpdate); void deleteOrg(List<Integer> orgIds); /** * 获取多个组织信息 * * @param orgIds * @return */ List<SysOrgInfoVo> queryOrgsByIds(List<Integer> orgIds); /** * 根据项目获取组织 * * @param projectId * @return */ List<SelectVo> queryOrgSelectVosByProjectId(Integer projectId); /** * 问题管理 根据项目获取组织 * * @param projectId * @return */ List<SelectVo> queryQuesOrgSelectVosByProjectId(Integer projectId); /** * 查询全局组织机构 * * @return */ List<SelectVo> queryGlobalOrgSelectVos(); /** * 问题管理 查询全局组织机构 * @return */ List<SelectVo> queryQuesGlobalOrgSelectVos(); List<SysOrgPo> queryOrgsByBizIdAndBizType(Integer bizId, String bizType); /** * 获取用户组织树形列表 * * @return */ List<SysOrgUserTreeVo> queryOrgUserTree(); void deleteOrgUser(List<Integer> userIds, Integer orgId); String queryDeleteOrgUserLogger(List<Integer> userIds, Integer orgId); List<SelectVo> queryOrgNameSelectVos(); List<SysOrgSelectVo> queryOrgSelectVo(); List<SysOrgPo> getOrgPoByCode(String orgCode); SysOrgInfoVo querySysUserOrgPoByUserId(Integer userId); }
[ "homeli@126.com" ]
homeli@126.com
e205413d4472589d9fed3f4d8bf10eacf9d11510
97b0e5decbd69d27d7b7a6c946778f913ec2e7ab
/src/com/mindplex/graph/DirectedGraph.java
bd13fa025777b357c6ad106d9149f9eea2887501
[]
no_license
abelperez/graphy
5134f3464524148c7af0cae60b1814556a669de6
2ee7a626d17f1d2ecc7aadcd60f452585cf76abb
refs/heads/master
2016-09-06T14:35:30.153592
2011-04-19T04:29:26
2011-04-19T04:29:26
1,633,998
0
0
null
null
null
null
UTF-8
Java
false
false
2,248
java
package com.mindplex.graph; import java.util.Set; /** * <code>DirectedGraph</code> is a graph that only contains edges that point * in one direction. For example, a directed graph cannot have both an edge * {A -> B} and {B -> A}. In this scenario it would only allow one or the * other but not both. * * <p>You can learn more about Directed Graphs here: * <a href="http://en.wikipedia.org/wiki/Directed_graph"> * http://en.wikipedia.org/wiki/Directed_graph</a></p> * * @author Abel Perez */ public interface DirectedGraph<V> extends Graph<V> { /** * Gets the in-degree for the specified vertex. The in-degree is the * total count of edges that terminate at the specified * vertex. * * @param vertex the vertex to get the in-degree for. * * @return the in-degree for the specified vertex. The in-degree is the * total count of edges that terminate at the specified * vertex. */ public int inDegree(V vertex); /** * Gets all the incoming edges for the specified vertex. Incoming edges are * all the edges that terminate at the specified vertex. * * @param vertex the vertex to get all the incoming edges for. * * @return all the incoming edges for the specified vertex. Incoming edges are * all the edges that terminate at the specified vertex. */ public Set<Edge<V>> incomingEdges(V vertex); /** * Gets the out-degree for the specified vertex. The out-degree is the number * of edges that originate at the specified vertex. * * @param vertex the vertex to get the out-degree for. * * @return the out-degree for the specified vertex. The out-degree is the number * of edges that originate at the specified vertex. */ public int outDegree(V vertex); /** * Gets the outgoing edges for the specified vertex. The outgoing edges are * the edges that originate at the specified vertex. * * @param vertex the vertex to get the outgoing edges for. * * @return the outgoing edges for the specified vertex. The outgoing edges are * the edges that originate at the specified vertex. */ public Set<Edge<V>> outgoingEdges(V vertex); }
[ "aperez@mindplexmedia.com" ]
aperez@mindplexmedia.com
1e06c709f04bd05d47d433f94d54276e2d0d44e5
c5882608d17b3d056b94108f10a615930563e3be
/src/summary/haesung/example/chapter16/UdpClient.java
7f99d4a58c70de670a69af56c0f99977d0156683
[]
no_license
javastudy20200322/JavaStudy
91c16f6157845feb4e90e42656534b128b23d430
a7510573071969682ae2144260245260b29173a4
refs/heads/master
2021-04-13T00:49:47.706374
2020-06-28T04:46:17
2020-06-28T04:46:17
249,120,949
0
0
null
null
null
null
UTF-8
Java
false
false
980
java
package summary.haesung.example.chapter16; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; import java.net.UnknownHostException; public class UdpClient { public void start() throws IOException, UnknownHostException { DatagramSocket datagramSocket = new DatagramSocket(); InetAddress serverAddress = InetAddress.getByName("127.0.0.1"); byte[] msg = new byte[100]; DatagramPacket outPacket = new DatagramPacket(msg, 1, serverAddress, 7777); DatagramPacket inPacket = new DatagramPacket(msg, msg.length); datagramSocket.send(outPacket); datagramSocket.receive(inPacket); System.out.println("current server time : " + new String(inPacket.getData())); datagramSocket.close(); } public static void main(String[] args) { try { new UdpClient().start(); } catch (IOException e) { e.printStackTrace(); } } }
[ "pureboyz@DESKTOP-IHF2NE4" ]
pureboyz@DESKTOP-IHF2NE4
ba4beeaa925dd783cf2afe44f55cb6be8add3f68
d0ae229dc706abc8976f2877ce006f975da8dbaf
/src/rrhvella/composition/ContextSensitiveNonDeterministicLSystem.java
1b6ceb19be9822af8e9031d2b31dd21d991d6032
[ "BSD-2-Clause-Views" ]
permissive
rrhvella/l-system-music-generator
931afb8bdbe468f1b71e09971978de14e9835ec5
ea126f014572f3ea383e577dee22efd7604531c9
refs/heads/master
2016-09-06T01:59:43.556349
2013-05-26T14:46:29
2013-05-26T14:46:29
4,195,386
3
0
null
null
null
null
UTF-8
Java
false
false
9,362
java
/* Copyright (c) 2013, robert.r.h.vella@gmail.com All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ package rrhvella.composition; import java.util.HashMap; import java.util.LinkedList; import java.util.Random; import java.util.Set; /** * Specifies a context-sensitive stochastic L-system. A description of such a * system is given in the essay submitted for the first part of this coursework. */ public class ContextSensitiveNonDeterministicLSystem { /** * The productions for this grammar. */ private HashMap<ContextSensitiveNonDeterministicPredecessor, String> productions; /** * The string generated by the last iteration. */ protected String currentString; /** * The axiom for this grammar. */ private String axiom; /** * The set of predecessors for the productions of this grammar. */ private Set<ContextSensitiveNonDeterministicPredecessor> predecessors; /** * The random number generator used to simulate stochastic processes in this * system. */ private Random randomGenerator; /** * The value of the flag, 'change entire context'. * * @see ContextSensitiveNonDeterministicLSystem#ContextSensitiveNonDeterministicLSystem(String, * HashMap, boolean) */ private boolean changeEntireContext; /** * * @author Stark * * This inner class is used to map a predecessor, from this * grammar's products, to a probability index. * @see ContextSensitiveNonDeterministicLSystem#process(String) */ private class PredecessorProbabilityIndexPair { /** * The predecessor in this relationship. */ public ContextSensitiveNonDeterministicPredecessor predecessor; /** * The probability index in this relationship. */ public int probabilityIndex; /** * * @param predecessor * the predecessor in this relationship. * @param probabilityIndex * the probability index in this relationship. * @see ContextSensitiveNonDeterministicPredecessor */ public PredecessorProbabilityIndexPair( ContextSensitiveNonDeterministicPredecessor predecessor, int probabilityIndex) { this.predecessor = predecessor; this.probabilityIndex = probabilityIndex; } } /** * Returns the axiom for this grammar. * * @return the axiom for this grammar. */ public String getAxiom() { return axiom; } /** * * @param axiom * the axiom for this grammar. * @param productions * the productions for this grammar as a dictionary which maps a * predecessor to its successor. * @see ContextSensitiveNonDeterministicPredecessor */ public ContextSensitiveNonDeterministicLSystem( String axiom, HashMap<ContextSensitiveNonDeterministicPredecessor, String> productions) { this(axiom, productions, false); } /** * * @param axiom * the axiom for this grammar. * @param productions * the productions for this grammar, as a dictionary which maps a * predecessor to its successor. * @param changeEntireContext * if true, then, at each iteration, this system will replace the * predecessor, along with its entire context, with the * successor. Otherwise, if this parameter is false, this system * will only replace the predecessor. */ public ContextSensitiveNonDeterministicLSystem( String axiom, HashMap<ContextSensitiveNonDeterministicPredecessor, String> productions, boolean changeEntireContext) { this.axiom = axiom; this.currentString = axiom; this.productions = productions; this.randomGenerator = new Random(); this.changeEntireContext = changeEntireContext; // Get the predecessors from the keys of the productions set. this.predecessors = productions.keySet(); } /** * Process the given string according to the rewriting the rules of this * grammar and return the result. * * @param source * the string which will be rewritten. * @return the result of the rewriting process. */ public String process(String source) { // The buffer which will contain the result as it is being generated. StringBuffer result = new StringBuffer(); // The length of the source string. int stringLength = source.length(); // For each character in the source string. for (int charIndex = 0; charIndex < stringLength; charIndex++) { /* * Algorithm description: * * Find the vector of valid productions R. A production is valid if * and only if it fits the context starting from the current * character. * * Assign a probability index P(n) to each production, such that * P(n) = P(n - 1) + the probability of R(n), P(-1) = 0. * * To select the production for the current character, first * generate a random number x, such that 1 <= x <= the number of * productions. Then, iterate through R starting from the last * element and moving back, until R(k) is found, such that P(k) < x. * * Replace the context starting from the current character with the * successor of R(k). If the 'change entire context' flag is false, * then only replace the predecessor. */ // Initialise the probability index. int probabilityIndex = 0; // The rules which fit the context starting from the current // character. LinkedList<PredecessorProbabilityIndexPair> possibleRules = new LinkedList<PredecessorProbabilityIndexPair>(); // For each predecessor. for (ContextSensitiveNonDeterministicPredecessor predecessor : predecessors) { // Confirm that the context is valid. if (predecessor.isContextValid(source, charIndex)) { // Add this rule to the list of possible rules, and // associate a probability index with it. probabilityIndex += predecessor.getProbability(); possibleRules.add(new PredecessorProbabilityIndexPair( predecessor, probabilityIndex)); } } // If no predecessor is valid, add the same character to the // resultant string and continue to the next loop iteration. if (possibleRules.size() == 0) { result.append(source.charAt(charIndex)); continue; } // Randomly select one of the rules. int ruleSelector = randomGenerator.nextInt(probabilityIndex); PredecessorProbabilityIndexPair currentProbabilityIndexPair = possibleRules .pop(); while (currentProbabilityIndexPair.probabilityIndex < ruleSelector + 1) { currentProbabilityIndexPair = possibleRules.pop(); } // If the 'change entire context' flag is false, then append the // preceding context for this production. if (!changeEntireContext) { result.append(currentProbabilityIndexPair.predecessor .getPrecedingContext()); } // Append the successor of the production. result.append(productions .get(currentProbabilityIndexPair.predecessor)); // If the 'change entire context' flag is false, then append the // proceeding context for this production. if (!changeEntireContext) { result.append(currentProbabilityIndexPair.predecessor .getProceedingContext()); } // If the 'change entire context' flag is true, then the context in // the source string should be skipped, as it will be completely // replaced. if (changeEntireContext) { charIndex += currentProbabilityIndexPair.predecessor .getContextLength() - 1; } } /** * Return the result. */ return result.toString(); } /** * Processes the current string and returns the next one. * * @return the next string in the system. */ public String next() { currentString = process(currentString); return currentString; } /** * Reverts the current string back to the axiom. */ public void reset() { currentString = axiom; } /** * Returns the current string. * * @return the current string. */ public String getCurrentString() { return currentString; } }
[ "robert.r.h.vella@gmail.com" ]
robert.r.h.vella@gmail.com
10daf177819a987ebd0ee53d5d72049094804874
a450667f83db94de7d716d889d5b7354a2dca78b
/app/src/main/java/com/example/android/popularmoviesstage2/Models/MovieReview.java
96835045552bc62ccfc92a04a6d7637eb0ec7125
[]
no_license
mohannadismail/PopularMovieAppStage2
2fb46e416dd78b4b861252323e479dbcf0678814
fb449588dda489e310c78d1a7fb7a50c29a479fe
refs/heads/master
2020-06-27T19:56:02.747338
2019-08-01T11:12:03
2019-08-01T11:12:03
200,035,588
0
0
null
null
null
null
UTF-8
Java
false
false
1,387
java
package com.example.android.popularmoviesstage2.Models; import android.os.Parcel; import android.os.Parcelable; public class MovieReview implements Parcelable { private String reviewText; private String reviewAuthor; public MovieReview(String reviewAuthor, String reviewText) { this.reviewText = reviewText; this.reviewAuthor = reviewAuthor; } private MovieReview(Parcel in) { reviewText = in.readString(); reviewAuthor = in.readString(); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int i) { parcel.writeString(reviewText); parcel.writeString(reviewAuthor); } public static Parcelable.Creator<MovieReview> CREATOR = new Parcelable.Creator<MovieReview>() { @Override public MovieReview createFromParcel(Parcel parcel) { return new MovieReview(parcel); } @Override public MovieReview[] newArray(int i) { return new MovieReview[i]; } }; public String getReviewText() { return reviewText; } public String getReviewAuthor() { return reviewAuthor; } public void setReviewText(String reviewText) { this.reviewText = reviewText; } public void setReviewAuthor(String reviewAuthor) { this.reviewAuthor = reviewAuthor; } }
[ "mohannad.ismail.93@gmail.com" ]
mohannad.ismail.93@gmail.com
e984c8c041358f886fc7e55f1dda15c3bd055b93
9e8e1f19fd5dd0d625877a701e72069bcb146547
/apkToolexipiry/working/libs/classes-dex2jar/android/support/v4/app/NotificationCompatIceCreamSandwich.java
a212d4cf625e0a0355e088a24fbac44454b03937
[]
no_license
Franklin2412/Laminin
65908dd862779d73095a38e604e37c989462beb2
e5cd5c673e9830c0dffd28155aeb5196f534c80e
refs/heads/master
2021-01-24T10:11:29.864611
2016-10-01T05:10:35
2016-10-01T05:10:35
69,677,383
1
0
null
null
null
null
UTF-8
Java
false
false
1,927
java
package android.support.v4.app; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.graphics.Bitmap; import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; import android.widget.RemoteViews; class NotificationCompatIceCreamSandwich { public static class Builder implements NotificationBuilderWithBuilderAccessor { private android.app.Notification.Builder b; public Builder(Context context, Notification notification, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, RemoteViews remoteViews, int i, PendingIntent pendingIntent, PendingIntent pendingIntent2, Bitmap bitmap, int i2, int i3, boolean z) { this.b = new android.app.Notification.Builder(context).setWhen(notification.when).setSmallIcon(notification.icon, notification.iconLevel).setContent(notification.contentView).setTicker(notification.tickerText, remoteViews).setSound(notification.sound, notification.audioStreamType).setVibrate(notification.vibrate).setLights(notification.ledARGB, notification.ledOnMS, notification.ledOffMS).setOngoing((notification.flags & 2) != 0).setOnlyAlertOnce((notification.flags & 8) != 0).setAutoCancel((notification.flags & 16) != 0).setDefaults(notification.defaults).setContentTitle(charSequence).setContentText(charSequence2).setContentInfo(charSequence3).setContentIntent(pendingIntent).setDeleteIntent(notification.deleteIntent).setFullScreenIntent(pendingIntent2, (notification.flags & AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS) != 0).setLargeIcon(bitmap).setNumber(i).setProgress(i2, i3, z); } public Notification build() { return this.b.getNotification(); } public android.app.Notification.Builder getBuilder() { return this.b; } } NotificationCompatIceCreamSandwich() { } }
[ "franklin.michael@payu.in" ]
franklin.michael@payu.in
95986b47751c61d464ffc69cc2cb4d0095a49c99
4623898729447782ddbf9687d9a48bc92a7ed98e
/DummyProject/src/UserBean.java
be23c36ce59079c831dd94be5af4fd80566cdb32
[]
no_license
kkerekes84/Ecenta_project
851896009b7da212c07b24996d2f3e1a32ed6020
75cd85a262497d1ac4508e62e0d62818f4e60962
refs/heads/master
2020-04-08T19:54:00.825575
2018-12-06T15:42:32
2018-12-06T15:42:32
159,675,556
0
0
null
null
null
null
UTF-8
Java
false
false
784
java
public class UserBean { private int Iduser; private String FirstName; private String LastName; private String username; private String password; public int getIduser() { return Iduser; } public void setIduser(int Iduser) { this.Iduser = Iduser; } 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 getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "Kinga@Kinga-2.mshome.net" ]
Kinga@Kinga-2.mshome.net
eb75dd9c900fed350e4e7d5d65ca71aeba482e5c
e093c78d0359a6fc25cc751c010547659ab307e0
/src/ButtonRenderer.java
f0bef7d9a7ecd96128a8bb9a62f4e05f1f70ec44
[]
no_license
dan12t3/MarketPlace
d450a864acada8a4cac23f72f1a0994437095b48
b7f56695fe89abb2acb8b0b7aa9191bd6e80d0ab
refs/heads/master
2021-01-21T18:39:50.528296
2017-05-22T16:03:52
2017-05-22T16:03:52
92,071,975
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
import java.awt.Component; import javax.swing.JButton; import javax.swing.JTable; import javax.swing.UIManager; import javax.swing.table.TableCellRenderer; //http://www.java2s.com/Code/Java/Swing-Components/ButtonTableExample.htm class ButtonRenderer extends JButton implements TableCellRenderer { private boolean condition; public ButtonRenderer() { setOpaque(true); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { String[] temp = value.toString().split(","); if(temp[4].equals("0")) condition = true; else condition = false; if (isSelected) { setForeground(table.getSelectionForeground()); setBackground(table.getSelectionBackground()); } else { setForeground(table.getForeground()); setBackground(UIManager.getColor("Button.background")); } //setText((value == null) ? "" : value.toString()); if(condition) setText("Buy"); else setText("Delete"); return this; } }
[ "dan_12t3@hotmail.com" ]
dan_12t3@hotmail.com
d37a19b8b714f908732b3f6eccef5c59d39c8e2b
42bc8cfbf45632dac424f7c177c9d8148ade9a52
/IxLambdaAPIFramework/src/main/java/IxLambdaBackend/exception/InternalException.java
465db5688ff22195d3e16d76e7b1dd598041bc2a
[]
no_license
sanjay51/IxLambdaAPIFramework
3bf642ca032936ad164e472333d12f739ec15be2
72ebfed5501e532e5d0e08d86653b9059a6dccd3
refs/heads/master
2020-05-27T17:48:56.736024
2019-09-22T20:06:00
2019-09-22T20:06:00
188,729,672
1
0
null
null
null
null
UTF-8
Java
false
false
172
java
package IxLambdaBackend.exception; public class InternalException extends RuntimeException { public InternalException(String message) { super(message); } }
[ "sanjav@amazon.com" ]
sanjav@amazon.com
7e1265e89ac691b1fe08ed05a5f5c1dc008fdb52
0962d5d49385bd537d1814abd493e124eac65819
/Chapter4/src/ch01/BookTest.java
59113c26fb7083834a9b2b6509fe9d7090c88a10
[]
no_license
jtheeeeee/java_fast
d68186b9a117e7a6e27b50c4867c5acd00bc385f
3f6cd9a22446f3943979e28108ca59e216cd2665
refs/heads/main
2023-08-10T22:19:36.401235
2021-08-14T05:25:12
2021-08-14T05:25:12
395,899,784
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package ch01; class Book{ private String title; private String author; public Book(String title, String author){ this.title=title; this.author=author; } @Override public String toString() { return title +"," +author; } } public class BookTest { public static void main(String[] args) { Book book = new Book("데미안"," 헤르만헤세"); System.out.println(book); String srt = new String("test"); System.out.println(srt); //ch01.Book@7a79be86 //test ==> .toString()이 오버라이딩 됐기 때문에. //toString() 메서드를 오버라이딩 해서 자주 사용함. } }
[ "j_03_17@naver.com" ]
j_03_17@naver.com
26ed469c4b805bc3dd33155f67e9f3ffeeb259ad
12caee078c772b644bf347a6be16658dc1f3c2eb
/interlok-elastic-common/src/main/java/com/adaptris/core/elastic/actions/MappedAction.java
715e68bbcd3e9ca6b0c877ac42055ac77e731540
[ "Apache-2.0" ]
permissive
yashashrirane/interlok-elastic
f0eaed536845919c2c0c90a753c9a7458d6eb742
9d2e570eb0497dd2d99810a43e9c9fa536169a47
refs/heads/master
2023-08-24T19:43:12.899693
2020-07-08T08:22:19
2020-07-08T08:22:19
283,781,423
0
0
Apache-2.0
2020-07-30T13:20:23
2020-07-30T13:20:23
null
UTF-8
Java
false
false
2,064
java
package com.adaptris.core.elastic.actions; import javax.validation.constraints.NotNull; import org.apache.commons.lang3.ObjectUtils; import org.apache.http.util.Args; import com.adaptris.annotation.ComponentProfile; import com.adaptris.annotation.InputFieldDefault; import com.adaptris.core.AdaptrisMessage; import com.adaptris.core.ServiceException; import com.adaptris.core.elastic.DocumentWrapper; import com.adaptris.util.KeyValuePairList; import com.thoughtworks.xstream.annotations.XStreamAlias; import lombok.Getter; import lombok.NonNull; import lombok.Setter; /** * Wraps a ActionExtractor implementation which is then mapped onto a different action. * * @config elastic-mapped-action * */ @XStreamAlias("elastic-mapped-action") @ComponentProfile( summary = "Wraps a ActionExtractor implementation which is then mapped onto a different action", since = "3.9.1") public class MappedAction implements ActionExtractor { /** * The underlying action extractor. * */ @NotNull @InputFieldDefault(value = "INDEX") @Getter @Setter @NonNull private ActionExtractor action; /** * Mapping the action returned by the extractor into another action. * <p> * If the key from the list matches the action returned by the extractor, then the associated * value is used. Otherwise the extracted action is used. * </p> */ @NotNull @Getter @Setter @NonNull private KeyValuePairList mappings; public MappedAction() { setMappings(new KeyValuePairList()); setAction(new ConfiguredAction()); } @Override public String extract(AdaptrisMessage msg, DocumentWrapper document) throws ServiceException { String action = getAction().extract(msg, document); String mappedAction = mappings.getValue(action); return ObjectUtils.defaultIfNull(mappedAction, action); } public MappedAction withAction(ActionExtractor action) { setAction(action); return this; } public MappedAction withMappings(KeyValuePairList mappings) { setMappings(mappings); return this; } }
[ "lewin.chan@adaptris.com" ]
lewin.chan@adaptris.com
8473938a03219d264a3323e591ec877b008ac3c4
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_497b441cd63abcab43889313a3112bfa4f993466/Request/2_497b441cd63abcab43889313a3112bfa4f993466_Request_t.java
c40f9f91ea44e5f0f2c26f839c481d3ef9a075e3
[]
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,968
java
/* * Copyright 1998-2009 University Corporation for Atmospheric Research/Unidata * * Portions of this software were developed by the Unidata Program at the * University Corporation for Atmospheric Research. * * Access and use of this software shall impose the following obligations * and understandings on the user. The user is granted the right, without * any fee or cost, to use, copy, modify, alter, enhance and distribute * this software, and any derivative works thereof, and its supporting * documentation for any purpose whatsoever, provided that this entire * notice appears in all copies of the software, derivative works and * supporting documentation. Further, UCAR requests that the user credit * UCAR/Unidata in any publications that result from the use of this * software or in any product that includes this software. The names UCAR * and/or Unidata, however, may not be used in any advertising or publicity * to endorse or promote any products or commercial entity unless specific * written permission is obtained from UCAR/Unidata. The user also * understands that UCAR/Unidata is not obligated to provide the user with * any support, consulting, training or assistance of any kind with regard * to the use, operation and performance of this software nor to provide * the user with any updates, revisions, new versions or "bug fixes." * * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. */ package thredds.wcs; import ucar.nc2.dt.GridDataset; /** * _more_ * * @author edavis * @since 4.0 */ public interface Request { public String getVersionString(); public Operation getOperation(); public RequestEncoding getRequestEncoding(); public GridDataset getDataset(); public String getDatasetPath(); public enum Operation { GetCapabilities, DescribeCoverage, GetCoverage } public enum RequestEncoding { GET_KVP, POST_XML, POST_SOAP } public enum Format { NONE( "" ), GeoTIFF( "image/tiff" ), GeoTIFF_Float( "image/tiff" ), NetCDF3( "application/x-netcdf" ); private String mimeType; Format( String mimeType ) { this.mimeType = mimeType; } public String getMimeType() { return mimeType; } public static Format getFormat( String mimeType ) { for ( Format curSection : Format.values() ) { if ( curSection.mimeType.equals( mimeType ) ) return curSection; } throw new IllegalArgumentException( "No such instance <" + mimeType + ">." ); } } /** * Represent a bounding box in some CRS. */ public class BoundingBox { private int dimensionLength; private double[] minPoint; private double[] maxPoint; private String minPointString; private String maxPointString; public BoundingBox( double[] minPoint, double[] maxPoint) { if ( minPoint.length != maxPoint.length ) throw new IllegalArgumentException( "The dimension length of the minimum point [" + minPoint.length + "] and maximum point [" + maxPoint.length + "] must be equal."); boolean minMaxOk = true; StringBuilder minPSB = new StringBuilder("["); StringBuilder maxPSB = new StringBuilder("["); for ( int i = 0; i < minPoint.length; i++ ) { minPSB.append( minPoint[ i] ).append( ","); maxPSB.append( maxPoint[ i] ).append( "," ); if ( minPoint[ i] >= maxPoint[ i] ) minMaxOk = false; } int indx = minPSB.lastIndexOf( ","); minPSB.replace( indx, indx+1, "]" ); indx = maxPSB.lastIndexOf( ","); maxPSB.replace( indx, indx + 1, "]" ); if ( ! minMaxOk ) throw new IllegalArgumentException( "Minimum point " + minPSB.toString() + " not always smaller than maximum point " + maxPSB.toString() + "."); this.dimensionLength = minPoint.length; this.minPoint = minPoint; this.maxPoint = maxPoint; this.minPointString = minPSB.toString(); this.maxPointString = maxPSB.toString(); } public int getDimensionLength() { return this.dimensionLength; } public double getMinPointValue( int index ) { return this.minPoint[ index]; } public double getMaxPointValue( int index ) { return this.maxPoint[ index]; } public String toString() { return "Min " + this.minPointString + "; Max " + this.maxPointString;} } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1793a1150be688717feb10edaeab5a2b21feea3b
afbe1ee6b8cf95811f72d263df698b8f5b9b58eb
/src/main/java/com/example/demo/userflights/FlightSeatRepository.java
64415ff1d1202ec2448acda3ecaad0ead46409ee
[]
no_license
margareti/ryswap-service
2b150f11207485e86423cc9397039a6461faf55f
73700e983412e0634a78f0357d8c800a429b3f57
refs/heads/master
2020-03-30T02:33:29.777182
2019-03-26T19:45:15
2019-03-26T19:45:15
150,636,924
1
0
null
2019-03-26T19:45:16
2018-09-27T19:21:36
Java
UTF-8
Java
false
false
527
java
package com.example.demo.userflights; import com.example.demo.flights.Flight; import com.example.demo.flights.seats.Seat; import com.example.demo.users.User; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; public interface FlightSeatRepository extends JpaRepository <FlightSeat, Long>{ public List<FlightSeat> findByFlight(Flight flight); public List<FlightSeat> findByOwnerAndFlight(User owner, Flight flight); public FlightSeat findByFlightAndSeat(Flight flight, Seat seat); }
[ "margaret.vegan@gmail.com" ]
margaret.vegan@gmail.com