blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e0614a0fecce7db78c50f8864b1e1ed3749faefb | 8e56fe90e0cdb3b23afa82ea0895ea4bff917356 | /src/main/java/com/pokemon/go/database/exception/ConnectionNotFoundException.java | bf81f6127135f9dad5b7a3ce5288a735b9e766cd | [] | no_license | iskull/database-crawler | 836eb396e2de7ba3e97cc8dabce2d8182536e253 | 4c3ec3f98c601c396b076bd7af70841f679ea811 | refs/heads/master | 2021-01-19T19:08:30.429480 | 2017-04-16T08:57:37 | 2017-04-16T08:57:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 695 | java | package com.pokemon.go.database.exception;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import com.pokemon.go.database.resource.ErrorCode;
public class ConnectionNotFoundException extends WebApplicationException {
private static final long serialVersionUID = 4920148589861534045L;
public ConnectionNotFoundException(String message) {
super(Response.status(Status.NOT_FOUND)
.entity(new ErrorItem(
ErrorCode.CONNECTION_NOT_FOUND_EXCEPTION.getCode(),
ErrorCode.CONNECTION_NOT_FOUND_EXCEPTION.name(), message))
.type(MediaType.APPLICATION_JSON).build());
}
}
| [
"ivanlee89@hotmail.com"
] | ivanlee89@hotmail.com |
2a8f82c8bcda72fa854beb388ac223db142e8615 | 514d04b16b9596388010cfe27c882419ec7b116c | /android/app/src/debug/java/com/supmilktea/ReactNativeFlipper.java | e0958334ba4f9fd36c8ad50725998b9b42b81d68 | [] | no_license | anhquan291/milktea_app | cbf6f40a04b1bdc0202242ecdf57a35a5d745edd | 37338131ea8e44f6c6ce6ac2d8140ce8c0b9a21c | refs/heads/master | 2023-01-03T11:12:34.864803 | 2020-10-27T08:38:42 | 2020-10-27T08:38:42 | 307,628,336 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,265 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.supmilktea;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"anhquan291@gmail.com"
] | anhquan291@gmail.com |
28699aed0258c653ad12e67e6f7d74b63792b267 | cf8443b28219085267fa0fa82eb4ed639b9be6b3 | /src/core/java/basics/ForLoop.java | 3dcdb581be3e8688c10ca97d11cd8ccba3a357c8 | [] | no_license | dsreddy77/JavaProgramming | 77b6c080ed4aaf14f4a69318c62aee197621d4a5 | 0346c3ce1dac09d4b09ed85367816baec7020f08 | refs/heads/master | 2021-09-03T18:05:03.722211 | 2018-01-10T23:55:31 | 2018-01-10T23:55:31 | 109,905,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 325 | java | package core.java.basics;
public class ForLoop
{
public static void main(String[] args)
{
int i=0;
System.out.println("Even Numebers");
for (i=0; i<=20;i=i+2){
System.out.println(i);
}
System.out.println("Odd Numebers");
for(i=1;i<20;i=i+2){
System.out.println(i);
}
}
}
| [
"33469778+dsreddy77@users.noreply.github.com"
] | 33469778+dsreddy77@users.noreply.github.com |
46965296692e29a4ab01ede006971fe2d98ff7c6 | 22ae6b434806f10c8756c673174ac93df2f6bd68 | /src/com/algomized/concepts/objectoriented/CrackingTheCodingInterviewC8Q2/Employee.java | a3f8f4bf7cfb1fe48f34ca6f33dc5c0c7d40b1ef | [] | no_license | strengthandwill/algorithms | aae70815f762d1e88f6b7f16a167c6942ad584c5 | 281bf2b13be73a508ca8ebd7c37a0bba1ff940e9 | refs/heads/master | 2016-09-05T12:55:59.405797 | 2014-07-30T16:32:38 | 2014-07-30T16:32:38 | 20,804,514 | 1 | 0 | null | 2014-06-13T13:30:13 | 2014-06-13T13:12:21 | Java | UTF-8 | Java | false | false | 1,478 | java | package com.algomized.concepts.objectoriented.CrackingTheCodingInterviewC8Q2;
public abstract class Employee {
public static final int MAX_LEVEL = 2;
protected Call call;
protected String name;
public Employee(String name) {
this.name = name;
}
public void receiveCall(Call call) {
this.call = call;
}
public void completeCall() {
call = null;
}
public Call escalateCall() {
if (call == null) {
return null;
}
Call escalatedCall = call;
escalatedCall.escalate();
call = null;
return escalatedCall;
}
public boolean isFree() {
return call == null;
}
public abstract int getLevel();
@Override
public String toString() {
return "[" + name + "][" + call + "]";
}
}
class Respondent extends Employee {
public Respondent(String name) {
super(name);
}
@Override
public int getLevel() {
return 0;
}
@Override
public String toString() {
return "[Respondent]" + super.toString();
}
}
class Manager extends Employee {
public Manager(String name) {
super(name);
}
@Override
public int getLevel() {
return 1;
}
@Override
public String toString() {
return "[Manager]" + super.toString();
}
}
class Director extends Employee {
public Director(String name) {
super(name);
}
@Override
public int getLevel() {
return 2;
}
@Override
public Call escalateCall() {
call = null;
return null;
}
@Override
public String toString() {
return "[Director]" + super.toString();
}
} | [
"kahkong87mail@gmail.com"
] | kahkong87mail@gmail.com |
eb3ea34184236080319dec1448c111079b847634 | efbf472791c9efd102c30ce53c52c6d917277158 | /app/build/generated/source/r/debug/android/support/v7/cardview/R.java | 5419324a38137106f9d6d7577bffaf5c207a41e6 | [] | no_license | hajjifarouk/CellComAndroidClient | 8e7ec4940cc3a8b067b0305fa988b200d9950422 | 13510201ecd60e2f30451d75922a7817d6d9deaf | refs/heads/master | 2021-01-01T04:07:28.476376 | 2017-07-13T13:23:56 | 2017-07-13T13:23:56 | 97,121,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,974 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.v7.cardview;
public final class R {
public static final class attr {
public static final int cardBackgroundColor = 0x7f0100d2;
public static final int cardCornerRadius = 0x7f0100d3;
public static final int cardElevation = 0x7f0100d4;
public static final int cardMaxElevation = 0x7f0100d5;
public static final int cardPreventCornerOverlap = 0x7f0100d7;
public static final int cardUseCompatPadding = 0x7f0100d6;
public static final int contentPadding = 0x7f0100d8;
public static final int contentPaddingBottom = 0x7f0100dc;
public static final int contentPaddingLeft = 0x7f0100d9;
public static final int contentPaddingRight = 0x7f0100da;
public static final int contentPaddingTop = 0x7f0100db;
}
public static final class color {
public static final int cardview_dark_background = 0x7f0c0015;
public static final int cardview_light_background = 0x7f0c0016;
public static final int cardview_shadow_end_color = 0x7f0c0017;
public static final int cardview_shadow_start_color = 0x7f0c0018;
}
public static final class dimen {
public static final int cardview_compat_inset_shadow = 0x7f08005c;
public static final int cardview_default_elevation = 0x7f08005d;
public static final int cardview_default_radius = 0x7f08005e;
}
public static final class style {
public static final int Base_CardView = 0x7f0900b2;
public static final int CardView = 0x7f09009d;
public static final int CardView_Dark = 0x7f0900dc;
public static final int CardView_Light = 0x7f0900dd;
}
public static final class styleable {
public static final int[] CardView = { 0x0101013f, 0x01010140, 0x7f0100d2, 0x7f0100d3, 0x7f0100d4, 0x7f0100d5, 0x7f0100d6, 0x7f0100d7, 0x7f0100d8, 0x7f0100d9, 0x7f0100da, 0x7f0100db, 0x7f0100dc };
public static final int CardView_android_minHeight = 1;
public static final int CardView_android_minWidth = 0;
public static final int CardView_cardBackgroundColor = 2;
public static final int CardView_cardCornerRadius = 3;
public static final int CardView_cardElevation = 4;
public static final int CardView_cardMaxElevation = 5;
public static final int CardView_cardPreventCornerOverlap = 7;
public static final int CardView_cardUseCompatPadding = 6;
public static final int CardView_contentPadding = 8;
public static final int CardView_contentPaddingBottom = 12;
public static final int CardView_contentPaddingLeft = 9;
public static final int CardView_contentPaddingRight = 10;
public static final int CardView_contentPaddingTop = 11;
}
}
| [
"farouk.hajji@esprit.tn"
] | farouk.hajji@esprit.tn |
c9c27808e5275fc448eba3cc11c5109bb6792cdc | a6e36d2b81b18db7ef977c42f1f736a33db00d86 | /OpenStackDriver/src/main/java/br/ufrn/VmManager/CloudDriver/CloudDriverProperties.java | 3d94a829d7600ca69e2a6a14167c2fc9f671a69c | [] | no_license | JorgePereiraUFRN/cloudprojects | 2b00ccf2e99e8a8af03a4bcb5662a66be6ec2e18 | ce7bb75b13fe66057970db3bc82707630b68518d | refs/heads/master | 2021-01-13T09:49:44.549546 | 2017-01-28T01:35:55 | 2017-01-28T01:35:55 | 69,098,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,617 | java | package br.ufrn.VmManager.CloudDriver;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class CloudDriverProperties {
private static String tenantName;
private static String userName;
private static String credential;
private static String endpoint;
private static String imageId;
private static String flavorId;
private static CloudDriverProperties properties;
private CloudDriverProperties() {
}
public static synchronized CloudDriverProperties getInstance() {
if (properties == null) {
loadConfFile();
}
return properties;
}
private static void loadConfFile() {
Properties prop = new Properties();
InputStream input = null;
properties = new CloudDriverProperties();
try {
input = new FileInputStream("OpenstackDriver.properties");
// load a properties file
prop.load(input);
tenantName = prop.getProperty("tenantName");
userName = prop.getProperty("userName");
credential = prop.getProperty("credential");
endpoint = prop.getProperty("endpoint");
imageId = prop.getProperty("imageId");
flavorId = prop.getProperty("flavorId");
} catch (IOException ex) {
ex.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public static String getTenantName() {
return tenantName;
}
public static void setTenantName(String tenantName) {
CloudDriverProperties.tenantName = tenantName;
}
public static String getUserName() {
return userName;
}
public static void setUserName(String userName) {
CloudDriverProperties.userName = userName;
}
public static String getCredential() {
return credential;
}
public static void setCredential(String credential) {
CloudDriverProperties.credential = credential;
}
public static String getEndpoint() {
return endpoint;
}
public static void setEndpoint(String endpoint) {
CloudDriverProperties.endpoint = endpoint;
}
public static String getImageId() {
return imageId;
}
public static void setImageId(String imageId) {
CloudDriverProperties.imageId = imageId;
}
public static String getFlavorId() {
return flavorId;
}
public static void setFlavorId(String flavorId) {
CloudDriverProperties.flavorId = flavorId;
}
public static CloudDriverProperties getProperties() {
return properties;
}
public static void setProperties(CloudDriverProperties properties) {
CloudDriverProperties.properties = properties;
}
}
| [
"jorgepereirasb@gmail.com"
] | jorgepereirasb@gmail.com |
7a212057fe0bd6fbb59e67382e45033f179bcb56 | 3e470b50ca9985bac5bc69f0511509f33428bdc2 | /MultiBase/src/com/hyl/hylbase/fragment/Fragment3.java | 7f81ad112f3f4e2ebf9c5602a2da4c56094f4fb4 | [] | no_license | czqaiwsm/Template | d99981cebdcc44e465c5a6b853c2d26175a0808d | 77bba147c75c578102ab46511124a92a8146cabc | refs/heads/master | 2020-05-21T04:22:03.930089 | 2016-06-17T15:05:38 | 2016-06-17T15:05:38 | 46,535,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | package com.hyl.hylbase.fragment;
import com.hyl.hylbase.R;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class Fragment3 extends BaseFragment {
private View view;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if(view==null){
view=inflater.inflate(R.layout.fragment3, null);
}
return view;
}
} | [
"1148392049@qq.com"
] | 1148392049@qq.com |
5885c422e92197221afbbbab02b27a397e7df0e0 | 8ec379a02be629165c97f12d75551e09279e5f97 | /shop-activity/src/main/java/quick/pager/shop/mapper/ExchangeActivityRuleMapper.java | db5dacc3fe1355b9a5c843d4ff98a7a4a3179fd5 | [
"MIT"
] | permissive | donniezhanggit/spring-cloud-shop | 73c9e99c714310cb4ecbacb2f764a452b24dfefc | aeeaba1be804d7197692fa6bef8bdcaedb2302ac | refs/heads/master | 2020-06-19T14:15:02.682581 | 2019-10-14T06:25:38 | 2019-10-14T06:25:38 | 196,739,760 | 0 | 0 | MIT | 2019-10-14T06:25:40 | 2019-07-13T15:56:03 | Java | UTF-8 | Java | false | false | 582 | java | package quick.pager.shop.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import quick.pager.shop.model.activity.ExchangeActivityRule;
/**
* @author siguiyang
*/
@Mapper
public interface ExchangeActivityRuleMapper {
int insertSelective(ExchangeActivityRule record);
ExchangeActivityRule selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(ExchangeActivityRule record);
/**
* 表格查询
*/
List<ExchangeActivityRule> select(@Param("activityId") Long activityId);
}
| [
"siguiyang1992@outlook.com"
] | siguiyang1992@outlook.com |
9331966f6c8d4d28b1cbb937eb3f224f251ea08d | 7142fd980e1f079952358e02b7532d5713e556cd | /src/main/java/sk/bellak/ttapp/configuration/LegacyAppConfiguration.java | 6619db38d9718bd129011a24c1503251ca3586af | [] | no_license | mbellak/ttApp | 5080a67872f51b9941cd44bf6374fa5e7260770d | d9f63b2a467515e0ea76672237614a4637f12329 | refs/heads/master | 2020-03-25T07:59:20.520133 | 2018-08-06T07:07:56 | 2018-08-06T07:07:56 | 143,592,072 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | package sk.bellak.ttapp.configuration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "sk.bellak.ttapp")
public class LegacyAppConfiguration extends WebMvcConfigurerAdapter {
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".jsp");
registry.viewResolver(viewResolver);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("/static/");
}
} | [
"miroslav.bellak@gmail.com"
] | miroslav.bellak@gmail.com |
6b890ca4f4bddab64831be2ff41a7cc723160af3 | 1b73e8efd1ec9fbdd2c32162eaf0f8ce30666d08 | /Mosima/Projet_Calibration_M2/src/apache/commons/math3/geometry/euclidean/oned/IntervalsSet.java | 1448047521b0179d27650dac4270a0cab6b5772d | [] | no_license | dtbinh/M2_Androide | 060db9575aa10b8ab0a9707db3e34cc64f5d0e03 | a828b7ff477470c8e00c012dd36d61df2ef7d910 | refs/heads/master | 2020-06-16T05:02:29.653270 | 2016-11-29T11:54:24 | 2016-11-29T11:54:24 | 75,243,702 | 1 | 0 | null | 2016-12-01T01:38:37 | 2016-12-01T01:38:36 | null | UTF-8 | Java | false | false | 11,361 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apache.commons.math3.geometry.euclidean.oned;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import apache.commons.math3.geometry.partitioning.AbstractRegion;
import apache.commons.math3.geometry.partitioning.BSPTree;
import apache.commons.math3.geometry.partitioning.SubHyperplane;
import apache.commons.math3.util.Precision;
/** This class represents a 1D region: a set of intervals.
* @version $Id: IntervalsSet.java 1416643 2012-12-03 19:37:14Z tn $
* @since 3.0
*/
public class IntervalsSet extends AbstractRegion<Euclidean1D, Euclidean1D> {
/** Build an intervals set representing the whole real line.
*/
public IntervalsSet() {
super();
}
/** Build an intervals set corresponding to a single interval.
* @param lower lower bound of the interval, must be lesser or equal
* to {@code upper} (may be {@code Double.NEGATIVE_INFINITY})
* @param upper upper bound of the interval, must be greater or equal
* to {@code lower} (may be {@code Double.POSITIVE_INFINITY})
*/
public IntervalsSet(final double lower, final double upper) {
super(buildTree(lower, upper));
}
/** Build an intervals set from an inside/outside BSP tree.
* <p>The leaf nodes of the BSP tree <em>must</em> have a
* {@code Boolean} attribute representing the inside status of
* the corresponding cell (true for inside cells, false for outside
* cells). In order to avoid building too many small objects, it is
* recommended to use the predefined constants
* {@code Boolean.TRUE} and {@code Boolean.FALSE}</p>
* @param tree inside/outside BSP tree representing the intervals set
*/
public IntervalsSet(final BSPTree<Euclidean1D> tree) {
super(tree);
}
/** Build an intervals set from a Boundary REPresentation (B-rep).
* <p>The boundary is provided as a collection of {@link
* SubHyperplane sub-hyperplanes}. Each sub-hyperplane has the
* interior part of the region on its minus side and the exterior on
* its plus side.</p>
* <p>The boundary elements can be in any order, and can form
* several non-connected sets (like for example polygons with holes
* or a set of disjoints polyhedrons considered as a whole). In
* fact, the elements do not even need to be connected together
* (their topological connections are not used here). However, if the
* boundary does not really separate an inside open from an outside
* open (open having here its topological meaning), then subsequent
* calls to the {@link
* apache.commons.math3.geometry.partitioning.Region#checkPoint(apache.commons.math3.geometry.Vector)
* checkPoint} method will not be meaningful anymore.</p>
* <p>If the boundary is empty, the region will represent the whole
* space.</p>
* @param boundary collection of boundary elements
*/
public IntervalsSet(final Collection<SubHyperplane<Euclidean1D>> boundary) {
super(boundary);
}
/** Build an inside/outside tree representing a single interval.
* @param lower lower bound of the interval, must be lesser or equal
* to {@code upper} (may be {@code Double.NEGATIVE_INFINITY})
* @param upper upper bound of the interval, must be greater or equal
* to {@code lower} (may be {@code Double.POSITIVE_INFINITY})
* @return the built tree
*/
private static BSPTree<Euclidean1D> buildTree(final double lower, final double upper) {
if (Double.isInfinite(lower) && (lower < 0)) {
if (Double.isInfinite(upper) && (upper > 0)) {
// the tree must cover the whole real line
return new BSPTree<Euclidean1D>(Boolean.TRUE);
}
// the tree must be open on the negative infinity side
final SubHyperplane<Euclidean1D> upperCut =
new OrientedPoint(new Vector1D(upper), true).wholeHyperplane();
return new BSPTree<Euclidean1D>(upperCut,
new BSPTree<Euclidean1D>(Boolean.FALSE),
new BSPTree<Euclidean1D>(Boolean.TRUE),
null);
}
final SubHyperplane<Euclidean1D> lowerCut =
new OrientedPoint(new Vector1D(lower), false).wholeHyperplane();
if (Double.isInfinite(upper) && (upper > 0)) {
// the tree must be open on the positive infinity side
return new BSPTree<Euclidean1D>(lowerCut,
new BSPTree<Euclidean1D>(Boolean.FALSE),
new BSPTree<Euclidean1D>(Boolean.TRUE),
null);
}
// the tree must be bounded on the two sides
final SubHyperplane<Euclidean1D> upperCut =
new OrientedPoint(new Vector1D(upper), true).wholeHyperplane();
return new BSPTree<Euclidean1D>(lowerCut,
new BSPTree<Euclidean1D>(Boolean.FALSE),
new BSPTree<Euclidean1D>(upperCut,
new BSPTree<Euclidean1D>(Boolean.FALSE),
new BSPTree<Euclidean1D>(Boolean.TRUE),
null),
null);
}
/** {@inheritDoc} */
@Override
public IntervalsSet buildNew(final BSPTree<Euclidean1D> tree) {
return new IntervalsSet(tree);
}
/** {@inheritDoc} */
@Override
protected void computeGeometricalProperties() {
if (getTree(false).getCut() == null) {
setBarycenter(Vector1D.NaN);
setSize(((Boolean) getTree(false).getAttribute()) ? Double.POSITIVE_INFINITY : 0);
} else {
double size = 0.0;
double sum = 0.0;
for (final Interval interval : asList()) {
size += interval.getSize();
sum += interval.getSize() * interval.getBarycenter();
}
setSize(size);
if (Double.isInfinite(size)) {
setBarycenter(Vector1D.NaN);
} else if (size >= Precision.SAFE_MIN) {
setBarycenter(new Vector1D(sum / size));
} else {
setBarycenter(((OrientedPoint) getTree(false).getCut().getHyperplane()).getLocation());
}
}
}
/** Get the lowest value belonging to the instance.
* @return lowest value belonging to the instance
* ({@code Double.NEGATIVE_INFINITY} if the instance doesn't
* have any low bound, {@code Double.POSITIVE_INFINITY} if the
* instance is empty)
*/
public double getInf() {
BSPTree<Euclidean1D> node = getTree(false);
double inf = Double.POSITIVE_INFINITY;
while (node.getCut() != null) {
final OrientedPoint op = (OrientedPoint) node.getCut().getHyperplane();
inf = op.getLocation().getX();
node = op.isDirect() ? node.getMinus() : node.getPlus();
}
return ((Boolean) node.getAttribute()) ? Double.NEGATIVE_INFINITY : inf;
}
/** Get the highest value belonging to the instance.
* @return highest value belonging to the instance
* ({@code Double.POSITIVE_INFINITY} if the instance doesn't
* have any high bound, {@code Double.NEGATIVE_INFINITY} if the
* instance is empty)
*/
public double getSup() {
BSPTree<Euclidean1D> node = getTree(false);
double sup = Double.NEGATIVE_INFINITY;
while (node.getCut() != null) {
final OrientedPoint op = (OrientedPoint) node.getCut().getHyperplane();
sup = op.getLocation().getX();
node = op.isDirect() ? node.getPlus() : node.getMinus();
}
return ((Boolean) node.getAttribute()) ? Double.POSITIVE_INFINITY : sup;
}
/** Build an ordered list of intervals representing the instance.
* <p>This method builds this intervals set as an ordered list of
* {@link Interval Interval} elements. If the intervals set has no
* lower limit, the first interval will have its low bound equal to
* {@code Double.NEGATIVE_INFINITY}. If the intervals set has
* no upper limit, the last interval will have its upper bound equal
* to {@code Double.POSITIVE_INFINITY}. An empty tree will
* build an empty list while a tree representing the whole real line
* will build a one element list with both bounds beeing
* infinite.</p>
* @return a new ordered list containing {@link Interval Interval}
* elements
*/
public List<Interval> asList() {
final List<Interval> list = new ArrayList<Interval>();
recurseList(getTree(false), list,
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
return list;
}
/** Update an intervals list.
* @param node current node
* @param list list to update
* @param lower lower bound of the current convex cell
* @param upper upper bound of the current convex cell
*/
private void recurseList(final BSPTree<Euclidean1D> node,
final List<Interval> list,
final double lower, final double upper) {
if (node.getCut() == null) {
if ((Boolean) node.getAttribute()) {
// this leaf cell is an inside cell: an interval
list.add(new Interval(lower, upper));
}
} else {
final OrientedPoint op = (OrientedPoint) node.getCut().getHyperplane();
final Vector1D loc = op.getLocation();
double x = loc.getX();
// make sure we explore the tree in increasing order
final BSPTree<Euclidean1D> low =
op.isDirect() ? node.getMinus() : node.getPlus();
final BSPTree<Euclidean1D> high =
op.isDirect() ? node.getPlus() : node.getMinus();
recurseList(low, list, lower, x);
if ((checkPoint(low, loc) == Location.INSIDE) &&
(checkPoint(high, loc) == Location.INSIDE)) {
// merge the last interval added and the first one of the high sub-tree
x = list.remove(list.size() - 1).getInf();
}
recurseList(high, list, x, upper);
}
}
}
| [
"keithdae@gmail.com"
] | keithdae@gmail.com |
363cd9e96a023a3243aded7ca6e47acc56fb26f3 | 1690dbaa461c7539ccc199b81cbae8c03d0fee28 | /src/main/java/com/epam/ProductsReview/entity/Product.java | dfee9df57c74d0d642712cc488266f8a29faedd1 | [] | no_license | saurabhmishraepam/ProductService | 203526c64b08d0fcd2ad5b4ded8ae9f8bf8d3ff7 | b0ea037688bdae97fd3f5ddc7bccf35bd02b5d0c | refs/heads/master | 2020-04-25T11:50:55.211121 | 2019-02-28T11:52:17 | 2019-02-28T11:52:17 | 172,759,113 | 0 | 0 | null | 2019-02-28T18:00:01 | 2019-02-26T17:37:16 | Java | UTF-8 | Java | false | false | 1,512 | java | package com.epam.ProductsReview.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalTime;
/**
* Created by saurabh on 26/2/19.
*/
@Entity
@Table(name="products")
public class Product implements Serializable{
@Id
@GeneratedValue
private Long productId;
private String name;
private float price;
private String category;
// private LocalTime createTime;
// private LocalTime updateTime;
public Long getProductId() {
return productId;
}
public void setProductId(Long productId) {
this.productId = productId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public float getPrice() {
return price;
}
public void setPrice(float price) {
this.price = price;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
@Override
public String toString() {
return "Product{" +
"productId=" + productId +
", name='" + name + '\'' +
", price=" + price +
", category='" + category + '\'' +
// ", createTime=" + createTime +
// ", updateTime=" + updateTime +
'}';
}
}
| [
"mishra.saurabh19@gmail.com"
] | mishra.saurabh19@gmail.com |
cc671832dfe69ec57b742797e0d329d2724c8f5c | 37d30200508519997922041334fe8649d0709b56 | /src/main/java/com/github/matiasvergaras/finalreality/controller/phases/SelectingAttackTarget.java | 8d436c813aa41f2c1874699f4a39287e2623b9bc | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | matiasvergaras/final-reality-matiasvergaras | 5cd86e04b8c1d35205e3be8c5d41fcd24599c388 | bc99501f359a419400b4bd2cfc8e2d44e4201f0d | refs/heads/master | 2023-02-13T20:00:02.560910 | 2021-01-06T20:29:52 | 2021-01-06T20:29:52 | 298,320,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package com.github.matiasvergaras.finalreality.controller.phases;
import com.github.matiasvergaras.finalreality.controller.GameController;
/**
* A SelectingAttackTarget state of the game.
* <p> SelectingAttackTarget is a kind of Active state. </p>
* <p> It represents the state in which a Mastermind is choosing which
* character to attack. </p>
* <p> The decision is carried out via <Strong> setAttack</Strong> method.
* If the player regrets sending an attack (he wants to be able to change
* some equipment again) he can cancel his attack via the
* <Strong> cancelAttack</Strong> method.</p>
* @author Matias Vergara Silva
* @since Homework 3
*/
public class SelectingAttackTarget extends GameState {
/**
* Constructor for a new SelectingAttackTarget state.
*
* @param gameController gameController
*/
public SelectingAttackTarget(GameController gameController) {
super(gameController);
}
/**
* {@inheritDoc}
*/
@Override
public void cancelAttack(){
gc.setState(new PlayerTurn(gc));
}
/**
* {@inheritDoc}
*/
@Override
public void setAttack(){
gc.setState(new PerformingAttack(gc));
}
/**
* {@inheritDoc}
*/
@Override
public boolean isSelectingAttackTarget() {
return true;
}
/**
* In this state, the game is being played, so it is active.
* @return boolean isActive
*/
@Override
public boolean isActive(){ return true; }
}
| [
"matiasvergara@ug.uchile.cl"
] | matiasvergara@ug.uchile.cl |
4a06fefa354770c61475ee81cd0ad5045fc095f1 | 359b796a61732466a67623f54394c18e4c5faa34 | /learnjava/src/main/java/com/example/Demo4_For.java | 85f153903b826282df26da6a066a23a932864f0a | [] | no_license | ebaung/Android.HelloWorld | 2ece2dbc3fc73e8a11f85db64ea64c2c38a5b1f2 | 2901782eb054fccee84830158752877f107731e9 | refs/heads/master | 2021-01-10T12:25:17.075868 | 2016-01-30T23:20:33 | 2016-01-30T23:20:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 998 | java | package com.example;
/**
* Created by admin on 1/30/2016.
*/
public class Demo4_For {
public static void main(String[] args) {
int[] elements = {5, 7, 12, 100, -1, 8, 3};
int sumTotal = 0;
System.out.println("elements.length = " + elements.length);
for(int indexPos=0; indexPos < elements.length; indexPos++)
{
System.out.println("Processing " + indexPos + " ; Value = " + elements[indexPos]);
if(elements[indexPos] > 99){
System.out.println("Continue");
continue;
}
if(elements[indexPos] < 0){
System.out.println("Break!");
System.out.println("negative number encountered. halting loop");
break;
}
sumTotal = sumTotal + elements[indexPos];
System.out.println("Sub Sum total = " +sumTotal);
}
System.out.println("Grand Sum total = " + sumTotal);
}
} | [
"ebaung@gmail.com"
] | ebaung@gmail.com |
5662126958922bffaf073d955fbce6d52da443c8 | 7677b3fdc003b89025927f647a4912ca321375f8 | /app/src/main/java/es/ulpgc/eite/cleancode/clickcounter/detail/DetailPresenter.java | 4be5cbcad516452d1f5fc49d2f34b2d6c66118c9 | [] | no_license | Kilian09/ClickCounter-MasterDetail-Ex2 | 28c0c8e46a4f0281dd5b4eeb7e6c560d7545d962 | 67271d49b6822412ed4a673c7b1ad2bd18bf7edb | refs/heads/master | 2022-04-24T13:02:36.747010 | 2020-04-17T10:09:23 | 2020-04-17T10:09:23 | 256,439,355 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,997 | java | package es.ulpgc.eite.cleancode.clickcounter.detail;
import java.lang.ref.WeakReference;
import es.ulpgc.eite.cleancode.clickcounter.app.MasterToDetailState;
public class DetailPresenter implements DetailContract.Presenter {
public static String TAG = DetailPresenter.class.getSimpleName();
private WeakReference<DetailContract.View> view;
private DetailState state;
private DetailContract.Model model;
private DetailContract.Router router;
public DetailPresenter(DetailState state) {
this.state = state;
}
@Override
public void onStart() {
// Log.e(TAG, "onStart()");
// initialize the state if is necessary
if (state == null) {
state = new DetailState();
}
// use passed state if is necessary
MasterToDetailState savedState = router.getStateFromPreviousScreen();
if (savedState != null) {
// update the model if is necessary
model.onDataFromPreviousScreen(savedState.data);
}
}
@Override
public void onRestart() {
// Log.e(TAG, "onRestart()");
// update the model if is necessary
model.onRestartScreen(state.data);
}
@Override
public void onResume() {
// Log.e(TAG, "onResume()");
// call the model and update the state
state.currentCounter = model.getStoredData();
// update the view
view.get().onDataUpdated(state);
}
@Override
public void onBackPressed() {
// Log.e(TAG, "onBackPressed()");
}
@Override
public void onPause() {
// Log.e(TAG, "onPause()");
}
@Override
public void onDestroy() {
// Log.e(TAG, "onDestroy()");
}
@Override
public void onButtonPressed() {
// Log.e(TAG, "onButtonPressed()");
}
@Override
public void injectView(WeakReference<DetailContract.View> view) {
this.view = view;
}
@Override
public void injectModel(DetailContract.Model model) {
this.model = model;
}
@Override
public void injectRouter(DetailContract.Router router) {
this.router = router;
}
}
| [
"kilian.garcia106@alu.ulpgc.es"
] | kilian.garcia106@alu.ulpgc.es |
e9b1e2699f62628c4ae407a331fbe5773d0aec42 | bf0fc13badc23259025922af1e79fc4f1621fb5c | /sshd-core/src/main/java/org/apache/sshd/common/TcpipForwarder.java | 559445649d81b7465a5831a6c2e2a1cf305ae8da | [
"Apache-2.0"
] | permissive | Connecty/mina-sshd | f02b6ff71ee073713ff0f1af46d61ffae41740a4 | b032ba05c74c834494acf602741f2c49c382bd74 | refs/heads/master | 2021-01-17T22:40:10.863241 | 2013-04-30T06:53:52 | 2013-04-30T06:53:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,053 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sshd.common;
public interface TcpipForwarder {
/**
* Start forwarding the given local address on the client to the given address on the server.
*/
SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws Exception;
/**
* Stop forwarding the given local address.
*/
void stopLocalPortForwarding(SshdSocketAddress local) throws Exception;
/**
* Start forwarding tcpip from the given remote address to the
* given local address.
*
* The remote host name is the address to bind to on the server:
* <ul>
* <li>"" means that connections are to be accepted on all protocol families
* supported by the SSH implementation</li>
* <li>"0.0.0.0" means to listen on all IPv4 addresses</li>
* <li>"::" means to listen on all IPv6 addresses</li>
* <li>"localhost" means to listen on all protocol families supported by the SSH
* implementation on loopback addresses only, [RFC3330] and RFC3513]</li>
* <li>"127.0.0.1" and "::1" indicate listening on the loopback interfaces for
* IPv4 and IPv6 respectively</li>
* </ul>
*
*/
SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws Exception;
/**
* Stop forwarding of the given remote address.
*/
void stopRemotePortForwarding(SshdSocketAddress remote) throws Exception;
/**
* Retrieve the local address that the remote port is forwarded to
* @param remotePort
* @return
*/
SshdSocketAddress getForwardedPort(int remotePort);
/**
* Called when the other side requested a remote port forward.
* @param local
* @return the list of bound local addresses
* @throws Exception
*/
SshdSocketAddress localPortForwardingRequested(SshdSocketAddress local) throws Exception;
/**
* Called when the other side cancelled a remote port forward.
* @param local
* @throws Exception
*/
void localPortForwardingCancelled(SshdSocketAddress local) throws Exception;
/**
* Close the forwarder
*/
void close();
}
| [
"gnodet@apache.org"
] | gnodet@apache.org |
52f9572fea93fe4d7b869b0373e16d9fb3fdd257 | f0900e13737e4822222f3e50e139566b79f7c804 | /src/main/java/com/puneeth/recipedemo/model/Difficulty.java | 8585153318ada07c2080f2b1f5d387afb2c0f4b7 | [] | no_license | Puneethreddy147/Recipe-App | eb2fb5f4e8a86d344f52fb6e51f842dc4dcb6261 | 540e41b46373d39930d04ce0272715b7e1b7bb4a | refs/heads/master | 2022-07-19T04:03:43.250541 | 2020-05-26T05:18:35 | 2020-05-26T05:18:35 | 266,942,491 | 0 | 0 | null | 2020-05-26T05:18:37 | 2020-05-26T04:15:29 | Java | UTF-8 | Java | false | false | 96 | java | package com.puneeth.recipedemo.model;
public enum Difficulty {
EASY,MODERATE,HARD
}
| [
"puneethreddy.147@gmail.com"
] | puneethreddy.147@gmail.com |
5dadd03ae2d96a429bb628cd958db7f0d00fa9d2 | 9ddf24460ca40f6e0723f733938534dce15b149d | /src/main/java/com/zxd/learning/designpattern/servicelocator/InitialContext.java | 24363d7fd0ff182871508bb280954e6d8fb70c8f | [] | no_license | CoderZxd/Design-pattern | 7d5200dd820ed42fe7a7f73d4d109b80cebe61d6 | 72e89396551493348d4122d39ed96b2fd5c6071c | refs/heads/master | 2021-09-06T23:12:54.889259 | 2018-02-13T09:44:59 | 2018-02-13T09:44:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package com.zxd.learning.designpattern.servicelocator;
/**
* @Project Design-pattern
* @Package com.zxd.learning.designpattern.servicelocator
* @Author:zouxiaodong
* @Description:
* @Date:Created in 17:28 2018/2/13.
*/
public class InitialContext {
public Object lookup(String jndiName){
if(jndiName.equalsIgnoreCase("SERVICE1")){
System.out.println("Looking up and creating a new Service1 object");
return new Service1();
}else if (jndiName.equalsIgnoreCase("SERVICE2")){
System.out.println("Looking up and creating a new Service2 object");
return new Service2();
}
return null;
}
}
| [
"zouxiaodong@mobanker.com"
] | zouxiaodong@mobanker.com |
89ee603dd5dd2c8a0ebe03ca61df493a7d5d0c5a | 9afa5a20728b9bf8c078c0ec656e6858dccac0a8 | /compiler/frontend/src/org/jetbrains/jet/lang/resolve/constants/FloatValue.java | 5f8442cca26859b017968606edecfdb8da58bd6b | [] | no_license | avshabanov/kotlin | 2de6b981f895c42fab0ea52620e08163e0abcaf4 | 7332476427d392d42ff84d653c9df27ca26bd431 | refs/heads/master | 2021-01-17T13:26:22.632965 | 2012-02-14T10:32:59 | 2012-02-14T10:32:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 940 | java | package org.jetbrains.jet.lang.resolve.constants;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationArgumentVisitor;
import org.jetbrains.jet.lang.types.JetStandardLibrary;
import org.jetbrains.jet.lang.types.JetType;
/**
* @author alex.tkachman
*/
public class FloatValue implements CompileTimeConstant<Float> {
private final float value;
public FloatValue(float value) {
this.value = value;
}
@Override
public Float getValue() {
return value;
}
@NotNull
@Override
public JetType getType(@NotNull JetStandardLibrary standardLibrary) {
return standardLibrary.getFloatType();
}
@Override
public <R, D> R accept(AnnotationArgumentVisitor<R, D> visitor, D data) {
return visitor.visitFloatValue(this, data);
}
@Override
public String toString() {
return value + ".flt";
}
}
| [
"alex.tkachman@gmail.com"
] | alex.tkachman@gmail.com |
d0b7b0db972c01bcf22657459613e8297b51c9ab | a32c46f831311e9db88fe2a1eea669892a3657d1 | /ios/src/com/paulovelado/mariobros/IOSLauncher.java | bb7f09b613b931ddc9e11399b71a491430038c34 | [] | no_license | pvelado/SuperMarioBrosDemo | 7c0267854ef8b8486bef795431787a74f1db39dc | 0274a546ff811f9104a54c779eb402056423cffc | refs/heads/master | 2020-06-11T12:29:21.063929 | 2019-06-26T19:17:32 | 2019-06-26T19:17:32 | 193,964,271 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package com.paulovelado.mariobros;
import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
import com.paulovelado.mariobros.MarioBros;
public class IOSLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
return new IOSApplication(new MarioBros(), config);
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, IOSLauncher.class);
pool.close();
}
} | [
"39059558+pvelado@users.noreply.github.com"
] | 39059558+pvelado@users.noreply.github.com |
6a9867c12d2c740b15cb24c716c7b4317a5ad9b9 | 0e89eb526da3d39c709c9a01f8fc45d439c6feea | /demo/src/main/java/com/go1ove/atcrowdfunding/bean/OrderExample.java | b3bdde2921c66ea4bee1fb3ef809c3d495dd3100 | [] | no_license | go1ove/atcrowdfunding | 0598bfb079ff92886e0aabc9565d03fb0a1afee0 | d9cf6e1430d898056ac3d6ec70c988c9062b1d40 | refs/heads/master | 2020-05-18T16:04:17.351704 | 2019-05-02T03:36:52 | 2019-05-02T03:36:52 | 184,057,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,905 | java | package com.go1ove.atcrowdfunding.bean;
import java.util.ArrayList;
import java.util.List;
public class OrderExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public OrderExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andMemberidIsNull() {
addCriterion("memberid is null");
return (Criteria) this;
}
public Criteria andMemberidIsNotNull() {
addCriterion("memberid is not null");
return (Criteria) this;
}
public Criteria andMemberidEqualTo(Integer value) {
addCriterion("memberid =", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidNotEqualTo(Integer value) {
addCriterion("memberid <>", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidGreaterThan(Integer value) {
addCriterion("memberid >", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidGreaterThanOrEqualTo(Integer value) {
addCriterion("memberid >=", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidLessThan(Integer value) {
addCriterion("memberid <", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidLessThanOrEqualTo(Integer value) {
addCriterion("memberid <=", value, "memberid");
return (Criteria) this;
}
public Criteria andMemberidIn(List<Integer> values) {
addCriterion("memberid in", values, "memberid");
return (Criteria) this;
}
public Criteria andMemberidNotIn(List<Integer> values) {
addCriterion("memberid not in", values, "memberid");
return (Criteria) this;
}
public Criteria andMemberidBetween(Integer value1, Integer value2) {
addCriterion("memberid between", value1, value2, "memberid");
return (Criteria) this;
}
public Criteria andMemberidNotBetween(Integer value1, Integer value2) {
addCriterion("memberid not between", value1, value2, "memberid");
return (Criteria) this;
}
public Criteria andProjectidIsNull() {
addCriterion("projectid is null");
return (Criteria) this;
}
public Criteria andProjectidIsNotNull() {
addCriterion("projectid is not null");
return (Criteria) this;
}
public Criteria andProjectidEqualTo(Integer value) {
addCriterion("projectid =", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidNotEqualTo(Integer value) {
addCriterion("projectid <>", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidGreaterThan(Integer value) {
addCriterion("projectid >", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidGreaterThanOrEqualTo(Integer value) {
addCriterion("projectid >=", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidLessThan(Integer value) {
addCriterion("projectid <", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidLessThanOrEqualTo(Integer value) {
addCriterion("projectid <=", value, "projectid");
return (Criteria) this;
}
public Criteria andProjectidIn(List<Integer> values) {
addCriterion("projectid in", values, "projectid");
return (Criteria) this;
}
public Criteria andProjectidNotIn(List<Integer> values) {
addCriterion("projectid not in", values, "projectid");
return (Criteria) this;
}
public Criteria andProjectidBetween(Integer value1, Integer value2) {
addCriterion("projectid between", value1, value2, "projectid");
return (Criteria) this;
}
public Criteria andProjectidNotBetween(Integer value1, Integer value2) {
addCriterion("projectid not between", value1, value2, "projectid");
return (Criteria) this;
}
public Criteria andReturnidIsNull() {
addCriterion("returnid is null");
return (Criteria) this;
}
public Criteria andReturnidIsNotNull() {
addCriterion("returnid is not null");
return (Criteria) this;
}
public Criteria andReturnidEqualTo(Integer value) {
addCriterion("returnid =", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidNotEqualTo(Integer value) {
addCriterion("returnid <>", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidGreaterThan(Integer value) {
addCriterion("returnid >", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidGreaterThanOrEqualTo(Integer value) {
addCriterion("returnid >=", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidLessThan(Integer value) {
addCriterion("returnid <", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidLessThanOrEqualTo(Integer value) {
addCriterion("returnid <=", value, "returnid");
return (Criteria) this;
}
public Criteria andReturnidIn(List<Integer> values) {
addCriterion("returnid in", values, "returnid");
return (Criteria) this;
}
public Criteria andReturnidNotIn(List<Integer> values) {
addCriterion("returnid not in", values, "returnid");
return (Criteria) this;
}
public Criteria andReturnidBetween(Integer value1, Integer value2) {
addCriterion("returnid between", value1, value2, "returnid");
return (Criteria) this;
}
public Criteria andReturnidNotBetween(Integer value1, Integer value2) {
addCriterion("returnid not between", value1, value2, "returnid");
return (Criteria) this;
}
public Criteria andOrdernumIsNull() {
addCriterion("ordernum is null");
return (Criteria) this;
}
public Criteria andOrdernumIsNotNull() {
addCriterion("ordernum is not null");
return (Criteria) this;
}
public Criteria andOrdernumEqualTo(String value) {
addCriterion("ordernum =", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumNotEqualTo(String value) {
addCriterion("ordernum <>", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumGreaterThan(String value) {
addCriterion("ordernum >", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumGreaterThanOrEqualTo(String value) {
addCriterion("ordernum >=", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumLessThan(String value) {
addCriterion("ordernum <", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumLessThanOrEqualTo(String value) {
addCriterion("ordernum <=", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumLike(String value) {
addCriterion("ordernum like", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumNotLike(String value) {
addCriterion("ordernum not like", value, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumIn(List<String> values) {
addCriterion("ordernum in", values, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumNotIn(List<String> values) {
addCriterion("ordernum not in", values, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumBetween(String value1, String value2) {
addCriterion("ordernum between", value1, value2, "ordernum");
return (Criteria) this;
}
public Criteria andOrdernumNotBetween(String value1, String value2) {
addCriterion("ordernum not between", value1, value2, "ordernum");
return (Criteria) this;
}
public Criteria andCreatedateIsNull() {
addCriterion("createdate is null");
return (Criteria) this;
}
public Criteria andCreatedateIsNotNull() {
addCriterion("createdate is not null");
return (Criteria) this;
}
public Criteria andCreatedateEqualTo(String value) {
addCriterion("createdate =", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateNotEqualTo(String value) {
addCriterion("createdate <>", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateGreaterThan(String value) {
addCriterion("createdate >", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateGreaterThanOrEqualTo(String value) {
addCriterion("createdate >=", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateLessThan(String value) {
addCriterion("createdate <", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateLessThanOrEqualTo(String value) {
addCriterion("createdate <=", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateLike(String value) {
addCriterion("createdate like", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateNotLike(String value) {
addCriterion("createdate not like", value, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateIn(List<String> values) {
addCriterion("createdate in", values, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateNotIn(List<String> values) {
addCriterion("createdate not in", values, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateBetween(String value1, String value2) {
addCriterion("createdate between", value1, value2, "createdate");
return (Criteria) this;
}
public Criteria andCreatedateNotBetween(String value1, String value2) {
addCriterion("createdate not between", value1, value2, "createdate");
return (Criteria) this;
}
public Criteria andMoneyIsNull() {
addCriterion("money is null");
return (Criteria) this;
}
public Criteria andMoneyIsNotNull() {
addCriterion("money is not null");
return (Criteria) this;
}
public Criteria andMoneyEqualTo(Integer value) {
addCriterion("money =", value, "money");
return (Criteria) this;
}
public Criteria andMoneyNotEqualTo(Integer value) {
addCriterion("money <>", value, "money");
return (Criteria) this;
}
public Criteria andMoneyGreaterThan(Integer value) {
addCriterion("money >", value, "money");
return (Criteria) this;
}
public Criteria andMoneyGreaterThanOrEqualTo(Integer value) {
addCriterion("money >=", value, "money");
return (Criteria) this;
}
public Criteria andMoneyLessThan(Integer value) {
addCriterion("money <", value, "money");
return (Criteria) this;
}
public Criteria andMoneyLessThanOrEqualTo(Integer value) {
addCriterion("money <=", value, "money");
return (Criteria) this;
}
public Criteria andMoneyIn(List<Integer> values) {
addCriterion("money in", values, "money");
return (Criteria) this;
}
public Criteria andMoneyNotIn(List<Integer> values) {
addCriterion("money not in", values, "money");
return (Criteria) this;
}
public Criteria andMoneyBetween(Integer value1, Integer value2) {
addCriterion("money between", value1, value2, "money");
return (Criteria) this;
}
public Criteria andMoneyNotBetween(Integer value1, Integer value2) {
addCriterion("money not between", value1, value2, "money");
return (Criteria) this;
}
public Criteria andRtncountIsNull() {
addCriterion("rtncount is null");
return (Criteria) this;
}
public Criteria andRtncountIsNotNull() {
addCriterion("rtncount is not null");
return (Criteria) this;
}
public Criteria andRtncountEqualTo(Integer value) {
addCriterion("rtncount =", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountNotEqualTo(Integer value) {
addCriterion("rtncount <>", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountGreaterThan(Integer value) {
addCriterion("rtncount >", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountGreaterThanOrEqualTo(Integer value) {
addCriterion("rtncount >=", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountLessThan(Integer value) {
addCriterion("rtncount <", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountLessThanOrEqualTo(Integer value) {
addCriterion("rtncount <=", value, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountIn(List<Integer> values) {
addCriterion("rtncount in", values, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountNotIn(List<Integer> values) {
addCriterion("rtncount not in", values, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountBetween(Integer value1, Integer value2) {
addCriterion("rtncount between", value1, value2, "rtncount");
return (Criteria) this;
}
public Criteria andRtncountNotBetween(Integer value1, Integer value2) {
addCriterion("rtncount not between", value1, value2, "rtncount");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andAddressIsNull() {
addCriterion("address is null");
return (Criteria) this;
}
public Criteria andAddressIsNotNull() {
addCriterion("address is not null");
return (Criteria) this;
}
public Criteria andAddressEqualTo(String value) {
addCriterion("address =", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotEqualTo(String value) {
addCriterion("address <>", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThan(String value) {
addCriterion("address >", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThanOrEqualTo(String value) {
addCriterion("address >=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThan(String value) {
addCriterion("address <", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThanOrEqualTo(String value) {
addCriterion("address <=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLike(String value) {
addCriterion("address like", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotLike(String value) {
addCriterion("address not like", value, "address");
return (Criteria) this;
}
public Criteria andAddressIn(List<String> values) {
addCriterion("address in", values, "address");
return (Criteria) this;
}
public Criteria andAddressNotIn(List<String> values) {
addCriterion("address not in", values, "address");
return (Criteria) this;
}
public Criteria andAddressBetween(String value1, String value2) {
addCriterion("address between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andAddressNotBetween(String value1, String value2) {
addCriterion("address not between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andInvoiceIsNull() {
addCriterion("invoice is null");
return (Criteria) this;
}
public Criteria andInvoiceIsNotNull() {
addCriterion("invoice is not null");
return (Criteria) this;
}
public Criteria andInvoiceEqualTo(String value) {
addCriterion("invoice =", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceNotEqualTo(String value) {
addCriterion("invoice <>", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceGreaterThan(String value) {
addCriterion("invoice >", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceGreaterThanOrEqualTo(String value) {
addCriterion("invoice >=", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceLessThan(String value) {
addCriterion("invoice <", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceLessThanOrEqualTo(String value) {
addCriterion("invoice <=", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceLike(String value) {
addCriterion("invoice like", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceNotLike(String value) {
addCriterion("invoice not like", value, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceIn(List<String> values) {
addCriterion("invoice in", values, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceNotIn(List<String> values) {
addCriterion("invoice not in", values, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceBetween(String value1, String value2) {
addCriterion("invoice between", value1, value2, "invoice");
return (Criteria) this;
}
public Criteria andInvoiceNotBetween(String value1, String value2) {
addCriterion("invoice not between", value1, value2, "invoice");
return (Criteria) this;
}
public Criteria andInvoictitleIsNull() {
addCriterion("invoictitle is null");
return (Criteria) this;
}
public Criteria andInvoictitleIsNotNull() {
addCriterion("invoictitle is not null");
return (Criteria) this;
}
public Criteria andInvoictitleEqualTo(String value) {
addCriterion("invoictitle =", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleNotEqualTo(String value) {
addCriterion("invoictitle <>", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleGreaterThan(String value) {
addCriterion("invoictitle >", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleGreaterThanOrEqualTo(String value) {
addCriterion("invoictitle >=", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleLessThan(String value) {
addCriterion("invoictitle <", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleLessThanOrEqualTo(String value) {
addCriterion("invoictitle <=", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleLike(String value) {
addCriterion("invoictitle like", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleNotLike(String value) {
addCriterion("invoictitle not like", value, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleIn(List<String> values) {
addCriterion("invoictitle in", values, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleNotIn(List<String> values) {
addCriterion("invoictitle not in", values, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleBetween(String value1, String value2) {
addCriterion("invoictitle between", value1, value2, "invoictitle");
return (Criteria) this;
}
public Criteria andInvoictitleNotBetween(String value1, String value2) {
addCriterion("invoictitle not between", value1, value2, "invoictitle");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"734023411@qq.com"
] | 734023411@qq.com |
3c2d795c7e8dadd6bde6659dff573e71e0a517c0 | 94b69188fe552639c8a1934b3364ff5dc79e276f | /downloader/src/main/java/com/ck/android/downloader/DownloadException.java | f5ce2dd20ad98186ab6a17070cc2c5cf271dae7a | [] | no_license | liqk2014/Downloader | bb07cb661bbb634d13085c69bafed3e05ba1d2f3 | 62bfaee42dc58fc1b3198ffcfb4b5d708202c283 | refs/heads/master | 2021-01-10T08:13:32.340751 | 2016-02-29T12:35:33 | 2016-02-29T12:35:33 | 52,730,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,251 | java | package com.ck.android.downloader;
/**
* Created by Aspsine on 2015/7/15.
*/
public class DownloadException extends Exception {
private String errorMessage;
private int errorCode;
public DownloadException() {
}
public DownloadException(String detailMessage) {
super(detailMessage);
errorMessage = detailMessage;
}
public DownloadException(int errorCode, String detailMessage) {
this(detailMessage);
this.errorCode = errorCode;
}
public DownloadException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
errorMessage = detailMessage;
}
public DownloadException(int errorCode, String detailMessage, Throwable throwable) {
this(detailMessage, throwable);
this.errorCode = errorCode;
}
public DownloadException(Throwable throwable) {
super(throwable);
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public int getErrorCode() {
return errorCode;
}
public void setErrorCode(int errorCode) {
this.errorCode = errorCode;
}
}
| [
"liqk2015@gmail.com"
] | liqk2015@gmail.com |
5a46375e00735413c729f1d2bddb42e5673a79a0 | 9fcf05729b131e40eedb8bbc1b2e04dbf6f02c98 | /Java/samples/org/test/SpriteSheetFontTest.java | c35be2d1799a5a52df1ccfb8689964e0287c59c0 | [
"Apache-2.0"
] | permissive | choiyongwoo/LGame | 68661774ca4c913e8fae8378a2f291939430fa37 | f007cee4c017702d5dd3d7966cb99b3c69bec616 | refs/heads/master | 2020-05-29T13:39:00.447566 | 2019-05-28T01:30:53 | 2019-05-28T01:30:53 | 189,168,503 | 1 | 0 | null | 2019-05-29T06:59:15 | 2019-05-29T06:59:14 | null | UTF-8 | Java | false | false | 1,291 | java | package org.test;
import loon.LTransition;
import loon.Screen;
import loon.action.sprite.SpriteSheet;
import loon.action.sprite.SpriteSheetFont;
import loon.canvas.LColor;
import loon.event.GameTouch;
import loon.opengl.GLEx;
import loon.utils.timer.LTimerContext;
public class SpriteSheetFontTest extends Screen {
SpriteSheetFont font;
public LTransition onTransition() {
return LTransition.newEmpty();
}
@Override
public void draw(GLEx g) {
if (font != null) {
font.drawString(g, "FONT EXAMPLE \nTEST NEW LINES", 80, 25, LColor.red);
font.drawString(g, "MORE COMPLETE LINE", 80, 100);
}
}
@Override
public void onLoad() {
SpriteSheet sheet = new SpriteSheet("spriteSheetFont.png", 32, 32);
font = new SpriteSheetFont(sheet, ' ');
font.setFontScale(0.5f);
add(MultiScreenTest.getBackButton(this,0));
}
@Override
public void alter(LTimerContext timer) {
}
@Override
public void resize(int width, int height) {
}
@Override
public void touchDown(GameTouch e) {
}
@Override
public void touchUp(GameTouch e) {
}
@Override
public void touchMove(GameTouch e) {
}
@Override
public void touchDrag(GameTouch e) {
}
@Override
public void resume() {
}
@Override
public void pause() {
}
@Override
public void close() {
}
}
| [
"longwind2012@hotmail.com"
] | longwind2012@hotmail.com |
cba715d641566efbe2608a8b7a06f1c611f11066 | 8ddbbbad6ffa6e9d53e8f153ce462923f71052e4 | /CognitiveInfrastructure/src/main/java/at/pro2future/cavl/infrastructure/resources/IndexResource.java | b1a9b5a8b275254d59b229627f30f3e16fbc1150 | [] | no_license | Interactions-HSG/better-food-choices | eec9f477c30b5d24de33ce74823cc936ddf0daf9 | d79301ef1d0d07a18d7ec5bb8fca3c7e610ccd7e | refs/heads/master | 2023-04-21T00:03:29.595010 | 2020-05-02T14:37:00 | 2020-05-02T14:37:00 | 220,209,856 | 0 | 1 | null | 2021-05-12T08:47:02 | 2019-11-07T10:25:21 | JavaScript | UTF-8 | Java | false | false | 1,072 | java | package at.pro2future.cavl.infrastructure.resources;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.ResponseBuilder;
import com.siemens.wotus.commonserver.utilities.ResponsesFactory;
import at.pro2future.cavl.infrastructure.CognitiveInfrastructure;
@Path(AbstractResource.indexResourcePath)
public class IndexResource extends AbstractResource {
@GET
@Produces(MediaType.TEXT_HTML)
public static Response getIndexHuman() {
logger.log(Level.INFO, "Got a GET at the " + AbstractResource.rootResourcePath + " endpoint " + MediaType.APPLICATION_JSON);
Map<String, URI> root = new HashMap<String, URI>();
root.put("baseURI", CognitiveInfrastructure.getBaseURI());
ResponseBuilder response = ResponsesFactory.createHTMLResponseFromTemplate("index.ftl", root);
finalizeResponse(response);
return response.build();
}
}
| [
"simon.mayer@unisg.ch"
] | simon.mayer@unisg.ch |
1c4a265b03292584765ba6a37655a1c3b68faa0d | a67f880d726b9dd5c26ff576ca518ea36948c22f | /app/src/main/java/com/tct/gallery3d/polaroid/view/CropImageView.java | d3fbadcdb7fd2ddbcfd558413d22fa081a6560d1 | [] | no_license | guixiaoyuan/Gallery | ddc917d103b600ac3ec7e7bbf68721857f8bd754 | 8bf571e6cec37917cdd22b056ebf065a45e079a5 | refs/heads/master | 2021-01-11T08:14:37.381127 | 2016-11-09T02:07:47 | 2016-11-09T02:07:47 | 72,212,958 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 11,333 | java | /* ----------|----------------------|----------------------|----------------- */
/* 07/08/2015| jian.pan1 | PR1026718 |[Gallery]The interface display error.
/* ----------|----------------------|----------------------|----------------- */
/* 07/15/2015| jian.pan1 | PR1040393 |[Android 5.1][Gallery_v5.1.13.1.0212.0]The division line is not display smooth when use polariud edit
/* ----------|----------------------|----------------------|----------------- */
package com.tct.gallery3d.polaroid.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.tct.gallery3d.util.Log;
public class CropImageView extends View {
private float oldX = 0;
private float oldY = 0;
private final int STATUS_Touch_SINGLE = 1;
private final int STATUS_TOUCH_MULTI_START = 2;
private final int STATUS_TOUCH_MULTI_TOUCHING = 3;
private int mStatus = STATUS_Touch_SINGLE;
private final int defaultCropWidth = 300;
private final int defaultCropHeight = 300;
private int cropWidth = defaultCropWidth;
private int cropHeight = defaultCropHeight;
protected float oriRationWH = 0;
protected final float maxZoomOut = 5.0f;
protected final float minZoomIn = 0.333333f;
protected Drawable mDrawable;
protected FloatDrawable mFloatDrawable;
protected Rect mDrawableSrc = new Rect();
protected Rect mDrawableDst = new Rect();
protected Rect mDrawableFloat = new Rect();
protected boolean isFrist = true;
protected Context mContext;
private int srcW = 0;
private int srcH = 0;
private final static int ORIRATION_SQUARE = 0;
private final static int ORIRATION_PORTRAIT = 1;
private final static int ORIRATION_LANDSCAPE = 2;
private int currState = ORIRATION_SQUARE;
public CropImageView(Context context) {
super(context);
init(context);
}
public CropImageView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public CropImageView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
private void init(Context context) {
this.mContext = context;
try {
if (android.os.Build.VERSION.SDK_INT >= 11) {
this.setLayerType(LAYER_TYPE_SOFTWARE, null);
}
} catch (Exception e) {
e.printStackTrace();
}
mFloatDrawable = new FloatDrawable(context);
}
public void setDrawable(Drawable mDrawable, int cropWidth, int cropHeight) {
this.mDrawable = mDrawable;
this.cropWidth = cropWidth;
this.cropHeight = cropHeight;
this.isFrist = true;
invalidate();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getPointerCount() > 1) {
if (mStatus == STATUS_Touch_SINGLE) {
mStatus = STATUS_TOUCH_MULTI_START;
} else if (mStatus == STATUS_TOUCH_MULTI_START) {
mStatus = STATUS_TOUCH_MULTI_TOUCHING;
}
} else {
if (mStatus == STATUS_TOUCH_MULTI_START || mStatus == STATUS_TOUCH_MULTI_TOUCHING) {
oldX = event.getX();
oldY = event.getY();
}
mStatus = STATUS_Touch_SINGLE;
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
oldX = event.getX();
oldY = event.getY();
break;
case MotionEvent.ACTION_UP:
checkBounds();
break;
case MotionEvent.ACTION_POINTER_1_DOWN:
break;
case MotionEvent.ACTION_POINTER_UP:
break;
case MotionEvent.ACTION_MOVE:
if (mStatus == STATUS_TOUCH_MULTI_TOUCHING) {
// more than one pointer
} else if (mStatus == STATUS_Touch_SINGLE) {
int dx = (int) (event.getX() - oldX);
int dy = (int) (event.getY() - oldY);
oldX = event.getX();
oldY = event.getY();
if (currState == ORIRATION_PORTRAIT) {
dx = 0;
if (mDrawableDst.top + dy > mDrawableFloat.top
|| mDrawableDst.bottom + dy < mDrawableFloat.bottom) {
break;
}
} else if (currState == ORIRATION_LANDSCAPE) {
dy = 0;
if (mDrawableDst.left + dx > mDrawableFloat.left
|| mDrawableDst.right + dx < mDrawableFloat.right) {
break;
}
} else if (currState == ORIRATION_SQUARE) {
break;
}
if (!(dx == 0 && dy == 0)) {
mDrawableDst.offset((int) dx, (int) dy);
invalidate();
}
}
break;
}
return true;
}
@Override
protected void onDraw(Canvas canvas) {
if (mDrawable == null) {
return; // couldn't resolve the URI
}
if (mDrawable.getIntrinsicWidth() == 0 || mDrawable.getIntrinsicHeight() == 0) {
return; // nothing to draw (empty bounds)
}
configureBounds();
mDrawable.draw(canvas);
canvas.save();
canvas.clipRect(mDrawableFloat, Region.Op.DIFFERENCE);
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-08,PR1026718 begin
canvas.drawColor(Color.parseColor("#FFF7F6F5"));
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-08,PR1026718 end
canvas.restore();
mFloatDrawable.draw(canvas);
}
protected void configureBounds() {
if (isFrist) {
oriRationWH = ((float) mDrawable.getIntrinsicWidth())
/ ((float) mDrawable.getIntrinsicHeight());
if (oriRationWH < 1) {
currState = ORIRATION_PORTRAIT;
} else if (oriRationWH > 1) {
currState = ORIRATION_LANDSCAPE;
} else if (oriRationWH == 1) {
currState = ORIRATION_SQUARE;
}
int floatWidth = dipTopx(mContext, cropWidth);
int floatHeight = dipTopx(mContext, cropHeight);
if (floatWidth > getWidth()) {
floatWidth = getWidth();
floatHeight = cropHeight * floatWidth / cropWidth;
}
if (floatHeight > getHeight()) {
floatHeight = getHeight();
floatWidth = cropWidth * floatHeight / cropHeight;
}
int floatLeft = (getWidth() - floatWidth) / 2;
int floatTop = (getHeight() - floatHeight) / 2;
mDrawableFloat.set(floatLeft, floatTop, floatLeft + floatWidth, floatTop + floatHeight);
int srcLeft = 0;
int srcTop = 0;
int srcRight = 0;
int srcBottom = 0;
if (currState == ORIRATION_PORTRAIT || currState == ORIRATION_SQUARE) {
srcW = floatWidth;
srcH = (int) (srcW / oriRationWH);
srcLeft = floatLeft;
srcTop = (getHeight() - srcH) / 2;
srcRight = srcLeft + srcW;
srcBottom = srcTop + srcH;
} else if (currState == ORIRATION_LANDSCAPE) {
srcH = floatHeight;
srcW = (int) (srcH * oriRationWH);
srcLeft = (getWidth() - srcW) / 2;
srcTop = floatTop;
srcRight = srcLeft + srcW;
srcBottom = srcTop + srcH;
}
mDrawableSrc.set(srcLeft, srcTop, srcRight, srcBottom);
mDrawableDst.set(mDrawableSrc);
isFrist = false;
}
mDrawable.setBounds(mDrawableDst);
mFloatDrawable.setBounds(mDrawableFloat);
}
protected void checkBounds() {
int newLeft = mDrawableDst.left;
int newTop = mDrawableDst.top;
boolean isChange = false;
if (mDrawableDst.left < -mDrawableDst.width()) {
newLeft = -mDrawableDst.width();
isChange = true;
}
if (mDrawableDst.top < -mDrawableDst.height()) {
newTop = -mDrawableDst.height();
isChange = true;
}
if (mDrawableDst.left > getWidth()) {
newLeft = getWidth();
isChange = true;
}
if (mDrawableDst.top > getHeight()) {
newTop = getHeight();
isChange = true;
}
if (currState == ORIRATION_PORTRAIT) {
if (newTop > mDrawableFloat.top) {
newTop = mDrawableFloat.top;
isChange = true;
}
if (newTop + srcH < mDrawableFloat.bottom) {
newTop = mDrawableFloat.bottom - srcH;
isChange = true;
}
} else if (currState == ORIRATION_LANDSCAPE) {
if (newLeft > mDrawableFloat.left) {
newLeft = mDrawableFloat.left;
isChange = true;
}
if (newLeft + srcW < mDrawableFloat.right) {
newLeft = mDrawableFloat.right - srcW;
isChange = true;
}
} else if (currState == ORIRATION_SQUARE) {
Log.i(VIEW_LOG_TAG, "current can't change");
}
mDrawableDst.offsetTo(newLeft, newTop);
if (isChange) {
invalidate();
}
}
public Bitmap getCropImage() {
Bitmap tmpBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(tmpBitmap);
mDrawable.draw(canvas);
Matrix matrix = new Matrix();
float scale = (float) (mDrawableSrc.width()) / (float) (mDrawableDst.width());
matrix.postScale(scale, scale);
Bitmap ret = Bitmap.createBitmap(tmpBitmap, mDrawableFloat.left, mDrawableFloat.top,
mDrawableFloat.width(), mDrawableFloat.height(), matrix, true);
tmpBitmap.recycle();
tmpBitmap = null;
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-15,PR1040393 begin
Bitmap newRet = Bitmap.createScaledBitmap(ret, cropWidth, cropHeight, true);
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-15,PR1040393 end
ret.recycle();
ret = newRet;
return ret;
}
public int dipTopx(Context context, float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-08,PR1026718 begin
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
getParent().requestDisallowInterceptTouchEvent(true);
return super.dispatchTouchEvent(event);
}
// [BUGFIX]-Add by TCTNJ,jian.pan1, 2015-07-08,PR1026718 end
}
| [
"kui.wang3@jrdcom.com"
] | kui.wang3@jrdcom.com |
8c9499d8ba0262cb3c24750c2314150da4f00d7b | 608af7c35c5a67dfb6fc4db8e8f0a2eb63e3e15c | /playgameservices-ios/src/com/michingo/robovmbindings/other/NSNotificationCenter.java | bdefefd067a51c2c520010178b621e55bc8aa5f1 | [] | no_license | danielchow/com.michingo.robovmbindings | 33b1a0ce48de907a038158f4268ca4d7e81988d0 | 48a23f851ecb5941110b4dedadb1c546dda38fda | refs/heads/master | 2020-08-02T02:24:30.033256 | 2013-12-27T15:11:35 | 2013-12-27T15:11:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,250 | java | package com.michingo.robovmbindings.other;
import org.robovm.cocoatouch.foundation.NSObject;
import org.robovm.cocoatouch.foundation.NSString;
import org.robovm.objc.ObjCClass;
import org.robovm.objc.ObjCRuntime;
import org.robovm.objc.Selector;
import org.robovm.objc.annotation.NativeClass;
import org.robovm.rt.bro.annotation.Bridge;
import org.robovm.rt.bro.annotation.Library;
@Library("Foundation")
@NativeClass
public class NSNotificationCenter extends NSObject{
private static final ObjCClass objCClass = ObjCClass.getByType(NSNotificationCenter.class);
static {
ObjCRuntime.bind(NSNotificationCenter.class);
}
//+ (id)defaultCenter
private static final Selector defaultCenter$ = Selector.register("defaultCenter");
@Bridge private native static NSNotificationCenter objc_defaultCenter(ObjCClass __self__, Selector __cmd__);
public static NSNotificationCenter defaultCenter() {
return objc_defaultCenter(objCClass, defaultCenter$);
}
//- (void)addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString *)notificationName object:(id)notificationSender
private static final Selector addObserver$ = Selector.register("addObserver:selector:name:object:");
@Bridge private native static void objc_addObserver(NSNotificationCenter __self__, Selector __cmd__, NSObject notificationObserver, Selector notificationSelector, NSString notificationName, NSObject notificationSender);
public void addObserver(NSObject observer, Selector notificationSelector, String notificationName) {
objc_addObserver(this, addObserver$, observer, notificationSelector, new NSString(notificationName), null);
}
//- (void)postNotificationName:(NSString *)notificationName object:(id)notificationSender
private static final Selector postNotificationName$ = Selector.register("postNotificationName:object:");
@Bridge private native static void objc_postNotificationName(NSNotificationCenter __self__, Selector __cmd__, NSString name, NSObject notificationSender);
public void postNotificationName(String name, NSObject notificationSender) {
objc_postNotificationName(this, postNotificationName$, new NSString(name), notificationSender);
}
}
| [
"michaelhadash@live.nl"
] | michaelhadash@live.nl |
14669a39062147e281e274269b1d8c2a64d191f1 | 6d9075654208d18ee4fab4f825e84e0eff44a933 | /app/src/test/java/com/example/asus/jsonsample/ExampleUnitTest.java | 4e3d7f016d166ffaff407ff6b8e2dca33dca2fd9 | [] | no_license | ArashMoghadas/JSONSample | 53b849ed38f50f2a84ef8c17b9f2121bf6c7c40b | bbcf95d1a2d8f66600ba379f60d80637cdca0b72 | refs/heads/master | 2020-03-26T03:24:22.160994 | 2018-08-13T18:56:45 | 2018-08-13T18:56:45 | 144,454,409 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package com.example.asus.jsonsample;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"arashmoghaddas@outlook.com"
] | arashmoghaddas@outlook.com |
38389794b406a2b5b452d13337cadba87ca13cb8 | e207d34bce10118ea5ed950258c52d14a69f12eb | /src/main/java/com/sim/andon/web/core/jdbc/common/JdbcException.java | 40f91d6ad09781ee18ef39de2933a2baab92c3b9 | [] | no_license | yangfancoming/andon | 78a4b047534f699fd4b186b62ab43fc03a4e786f | 51810a351226533c041a0200531983340b6afdc8 | refs/heads/master | 2022-07-13T02:24:19.767818 | 2020-03-16T13:04:02 | 2020-03-16T13:04:02 | 247,703,908 | 0 | 0 | null | 2022-06-29T18:01:18 | 2020-03-16T13:03:46 | Java | UTF-8 | Java | false | false | 1,281 | java | package com.sim.andon.web.core.jdbc.common;
/**
* <br>创建日期:2015年5月18日
* <br><b>Copyright 2015 UTOUU All Rights Reserved</b>
* @author jinww
* @since 1.0
* @version 1.0
*/
public class JdbcException extends RuntimeException{
private static final long serialVersionUID = -1956089458134530038L;
private String errorCode;
/**
*
*/
public JdbcException() {
super();
// TODO Auto-generated constructor stub
}
/**
* @param errorCode 错误代码
* @param message 信息
*/
public JdbcException(String errorCode, String message){
super(message);
this.errorCode = errorCode;
}
/**
* @param message 信息
* @param cause 异常
*/
public JdbcException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
/**
* @param message 信息
*/
public JdbcException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
/**
* @param cause 异常
*/
public JdbcException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
/**
* @since 1.0
* @return
* <br><b>作者: @author jinww</b>
* <br>创建时间:2015年5月18日 下午4:09:43
*/
public String getErrorCode() {
return errorCode;
}
}
| [
"34465021+jwfl724168@users.noreply.github.com"
] | 34465021+jwfl724168@users.noreply.github.com |
7c4251ffad0748e13d4f991bf0cc8838ad390669 | b3baf07ab1820ff5c552e2b791044a26bf75d2ae | /eclipse-workspace/TiendaOnline/src/edu/es/eoi/entity/PersonaJuridica.java | b18a0a5265e95b38ec90b4009a6da37a28c1e329 | [] | no_license | pedrosg13/BecaEOI2020 | 76b41d38e5f339b388bc23a3bc8052609d23fc7b | 0f6dd45e75ffb5757cb85c501bc51720b0594a74 | refs/heads/master | 2022-11-30T17:46:39.597661 | 2020-08-07T15:12:46 | 2020-08-07T15:12:46 | 284,024,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | package edu.es.eoi.entity;
public class PersonaJuridica extends Persona {
private String cif;
public String getCif() {
return cif;
}
public void setCif(String cif) {
this.cif = cif;
}
}
| [
"pedro.sanchez.gomez132@gmail.com"
] | pedro.sanchez.gomez132@gmail.com |
edd5b630d62705568bccb685b4bfb99965c7de19 | 801b6fdbd99efc12db8cdbe20ce2f7f855813b6a | /src/test/java/br/com/sales/SalesReportApplicationTests.java | ea30dbf5518b5c9ce3ba81a08294913d7ba9a349 | [] | no_license | jpstrm/sales-report | 09a332afe77b0ad7db9d69a1594e6bd0383b8d8a | a75c9fc21e4be221755cff98bf205255ee56c690 | refs/heads/master | 2022-12-31T00:14:53.993425 | 2020-10-15T14:06:29 | 2020-10-15T14:06:29 | 303,686,208 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package br.com.sales;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SalesReportApplicationTests {
@Test
void contextLoads() {
}
}
| [
"jpstrm@gmail.com"
] | jpstrm@gmail.com |
e5c871a6e7ace9449efc50e8371f65c525674cdc | f63aa5b7f76e4de2c906d981e6d2d337e2f77c1b | /app/src/androidTest/java/com/example/emobilis/yinsplashrotate/ExampleInstrumentedTest.java | 12309abfa2bbb7f839f848246643b6eab27b163e | [] | no_license | JDamascene/SplashScreenRotatingYin.github.io | 4ba1294b835db93f2f730d45f311df51022c1876 | 15f1d277a704bc37aefa2a912f67a717a3f1291f | refs/heads/master | 2020-03-10T11:45:22.491103 | 2018-04-13T07:02:26 | 2018-04-13T07:02:26 | 129,362,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 775 | java | package com.example.emobilis.yinsplashrotate;
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.*;
/**
* Instrumented 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.emobilis.yinsplashrotate", appContext.getPackageName( ));
}
}
| [
"johdamoch@gmail.com"
] | johdamoch@gmail.com |
fda99e304a0da48dfa55b264ba97287d61a0a0d1 | 661fea55b197e91a03980c01089c9a2da1198330 | /app/src/main/java/com/aurum/everytrailer/ChangePasswordActivity.java | e136d4ac5a03b6230d8a19448528ffa5d287c7b4 | [] | no_license | sanakazi/EveryTrailer | 889d6d149330e1696e9e25eed763d2900f2157d5 | 7bbc51df83a3e364c9be242b6f36d1433a1a4551 | refs/heads/master | 2020-12-02T12:58:40.317201 | 2016-08-24T09:06:29 | 2016-08-24T09:06:29 | 66,449,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,764 | java | package com.aurum.everytrailer;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.aurum.everytrailer.utils.ConnectionDetector;
import com.aurum.everytrailer.utils.Constants;
import com.aurum.everytrailer.utils.XMLParser;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ChangePasswordActivity extends Activity {
private static final String startTag = "<?xml version='1.0' encoding='utf-8'?>";
private static final String startEveryTrailler = "<everyTrailler>";
private static final String startInputData = "<inputData>";
private static final String startUserType = "<userType>";
private static final String startUsername = "<username>";
private static final String startEmailID = "<emailID>";
private static final String startPassword = "<password>";
private static final String startDeviceID = "<deviceID>";
private static final String startProfilePic = "<profilePic>";
private static final String endEveryTrailler = "</everyTrailler>";
private static final String endInputData = "</inputData>";
private static final String endUserType = "</userType>";
private static final String endUsername = "</username>";
private static final String endEmailID = "</emailID>";
private static final String endPassword = "</password>";
private static final String endDeviceID = "</deviceID>";
private static final String endProfilePic = "</profilePic>";
EditText mUserName, mOldPassword, mNewPassword, mConfirmPassword, mEmailId;
TextView mSignIn, mTermsAndConditions;
Button mChangePassword, mCancel;
ForChangePAssword ChangepasswordUser;
ProgressDialog mProgressDialog;
String privateKey, changePasswordXML;
ConnectionDetector connectionDetector;
SharedPreferences sharedpreferences;
SharedPreferences.Editor editor;
String status, msg;
String userName;
String userId;
SharedPreferences prefs;
public static boolean isEmailValid(String email) {
boolean isValid = false;
String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
CharSequence inputStr = email;
Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.matches()) {
isValid = true;
}
return isValid;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_change_password);
// GET PRIVATE KEY
privateKey = Constants.getPrivateKey();
mUserName = (EditText) findViewById(R.id.change_password_user_name);
mEmailId = (EditText) findViewById(R.id.change_password_email);
mOldPassword = (EditText) findViewById(R.id.change_password_old_password);
mNewPassword = (EditText) findViewById(R.id.change_password_new_password);
mConfirmPassword = (EditText) findViewById(R.id.change_password_confirm_password);
mChangePassword = (Button) findViewById(R.id.change_password_change_password_btn);
mCancel = (Button) findViewById(R.id.change_password_cancel);
prefs = PreferenceManager.getDefaultSharedPreferences(ChangePasswordActivity.this);
userId = prefs.getString("User_ID", null);
mCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
mChangePassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// CONNECTION DETECTOR
AsyncTask<Void, Boolean, Boolean> connectionDetectorTask = new ConnectionDetector()
.execute();
boolean result = false;
try {
result = connectionDetectorTask.get();
} catch (Exception e) {
e.printStackTrace();
}
if (result) {
String userNameStr = mUserName.getText().toString();
String oldpasswordStr = mOldPassword.getText().toString();
String newpasswordStr = mNewPassword.getText().toString();
String emailIdStr = mEmailId.getText().toString();
String confirmPasswordStr = mConfirmPassword.getText().toString();
if (userNameStr.isEmpty() || oldpasswordStr.isEmpty() || newpasswordStr.isEmpty() || emailIdStr.isEmpty() || confirmPasswordStr.isEmpty()) {
Toast.makeText(ChangePasswordActivity.this, "Please fill all the fields", Toast.LENGTH_SHORT).show();
} else {
if (!isEmailValid(emailIdStr)) {
Toast.makeText(ChangePasswordActivity.this, "Please enter a valid email address", Toast.LENGTH_SHORT).show();
} else {
if (!newpasswordStr.matches(confirmPasswordStr)) {
Toast.makeText(ChangePasswordActivity.this, "Passwords do not match", Toast.LENGTH_SHORT).show();
} else {
changePasswordXML = startTag + startEveryTrailler + startInputData +
"<userID>" + userId + "</userID>"
+ "<oldPassword>" + oldpasswordStr + "</oldPassword>"
+ "<newPassword>" + newpasswordStr + "</newPassword>" + endInputData + endEveryTrailler;
ChangepasswordUser = new ForChangePAssword();
ChangepasswordUser.execute();
}
}
}
} else {
Toast.makeText(ChangePasswordActivity.this, "No Internet Connection", Toast.LENGTH_SHORT).show();
}
}
});
}
private void parseLoginXML(String MovieListXml) {
String profilePic = null;
String userId = null;
XMLParser parser = new XMLParser();
Document doc = parser.getDomElement(MovieListXml);
NodeList everyTrailerResponse = doc.getElementsByTagName(Constants.KEY_EVERY_TRAILER);
for (int i = 0; i < everyTrailerResponse.getLength(); i++) {
Element everyTrailerElement = (Element) everyTrailerResponse.item(i);
status = parser.getValue(everyTrailerElement, Constants.KEY_STATUS);
if (status.equalsIgnoreCase("1")) {
msg = parser.getValue(everyTrailerElement, Constants.KEY_MESSAGE);
} else {
msg = parser.getValue(everyTrailerElement, Constants.KEY_MESSAGE);
}
}
}
class ForChangePAssword extends AsyncTask<Void, Void, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
mProgressDialog = new ProgressDialog(ChangePasswordActivity.this);
mProgressDialog.setMessage("Changing Password...");
mProgressDialog.setCancelable(false);
mProgressDialog.setCanceledOnTouchOutside(false);
mProgressDialog.show();
}
@Override
protected Void doInBackground(Void... params) {
try {
URL url = new URL(Constants.URL_CHANGE_USER_PASSWORD);
HttpURLConnection con = (HttpURLConnection) url
.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.connect();
// SET PARAMS
OutputStream os = con.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
String paramsStr = "{\"pass\":\"" + privateKey
+ "\"" + ",\"ChangePassword\":\"" + changePasswordXML + "\"" + "}";
Log.d("HHHH", "HHHHH" + paramsStr);
osw.write(paramsStr);
osw.flush();
osw.close();
String resultPlain = Constants.readStream(con.getInputStream());
String resultHtml = Html.fromHtml(resultPlain).toString();
parseLoginXML(resultHtml);
} catch (Exception e) {
Log.e(Constants.TAG,
"JSON OBJECT ERROR: " + e);
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
mProgressDialog.dismiss();
if (status.equalsIgnoreCase("0")) {
Toast.makeText(ChangePasswordActivity.this, "" + msg, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(ChangePasswordActivity.this, "" + msg, Toast.LENGTH_SHORT).show();
onBackPressed();
}
}
}
}
| [
"kazisana23@gmail.com"
] | kazisana23@gmail.com |
02fdcd1a1d99bbdb71e0f51686b47cda47eaf892 | 2c9538427198a89104360cb9d9d45bf3302542e5 | /FloreantPOS/src/com/floreantpos/actions/DrawerPullAction.java | ec455b96dc3e7271676c43b4bb680f70b1a162cf | [] | no_license | vinschess/FloreantPOS | 78a5ca790e02b2e12acaa83d56fdc64f55ddf931 | 79c52f6237f19e15cd2741c2683e261826067a6b | refs/heads/master | 2020-05-21T13:49:49.404345 | 2016-08-10T05:32:25 | 2016-08-10T05:32:25 | 65,352,898 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 928 | java | package com.floreantpos.actions;
import javax.swing.JDialog;
import com.floreantpos.POSConstants;
import com.floreantpos.main.Application;
import com.floreantpos.model.UserPermission;
import com.floreantpos.ui.dialog.DrawerPullReportDialog;
import com.floreantpos.ui.dialog.POSMessageDialog;
public class DrawerPullAction extends PosAction {
public DrawerPullAction() {
super(POSConstants.DRAWER_PULL_BUTTON_TEXT, UserPermission.DRAWER_PULL); //$NON-NLS-1$
}
@Override
public void execute() {
try {
DrawerPullReportDialog dialog = new DrawerPullReportDialog();
dialog.setTitle(com.floreantpos.POSConstants.DRAWER_PULL_BUTTON_TEXT);
dialog.initialize();
dialog.setSize(470, 500);
dialog.setResizable(false);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.open();
} catch (Exception e) {
POSMessageDialog.showError(Application.getPosWindow(),e.getMessage(), e);
}
}
}
| [
"vinschess@gmail.com"
] | vinschess@gmail.com |
eac95989d634372647be0c5582250dd731eb9100 | a1d7e6df113cddc1075566768c1c152ba26c25af | /Machinetta/State/BeliefType/Probability/TableRV.java | 341f4fd9137b775d156bf66b79c4e8b5aaa0055f | [
"BSD-3-Clause"
] | permissive | seanrowens/Machinetta | 1c978247b4a4a72390e2f0d8fddcff327d4c715b | a67c0341b88f9f1159b260b250b685e760e17b81 | refs/heads/master | 2020-12-30T15:22:44.502620 | 2017-05-13T00:08:42 | 2017-05-13T00:08:42 | 91,138,166 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,968 | java | /*******************************************************************************
* Copyright (C) 2017, Paul Scerri, Sean R Owens
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
/*
* TableRV.java
*
* Created on October 14, 2002, 2:21 PM
*/
package Machinetta.State.BeliefType.Probability;
import java.util.Hashtable;
import java.util.Enumeration;
/**
*
* @author pynadath
*/
public class TableRV extends RandomVariable {
/** The table containing the distribution */
public Hashtable probTable = null;
/** The maximum domain value, stored here for convenience */
public double maxDomainValue = Double.NEGATIVE_INFINITY;
/** For auto XML */
public TableRV() {}
public Machinetta.State.BeliefID makeID() {
return new Machinetta.State.BeliefNameID("AnonymousRandomVariable");
}
/** Creates a new instance of TableRV
* NOTE: Does not support domains with negative values !!!
* @param prob A hashtable specifying the distribution of this RV where P(RV=key)=value (with both key, value being of type Double)
*/
public TableRV(Hashtable prob) {
probTable = prob;
/** Let's figure out what the maximum allowed domain value is */
for (Enumeration keyList = prob.keys(); keyList.hasMoreElements(); ) {
double domainValue = ((Double)keyList.nextElement()).doubleValue();;
if (domainValue > maxDomainValue)
maxDomainValue = domainValue;
}
}
/** @return The largest possible domain value */
public double getMaxValue() { return maxDomainValue; }
/** @return An enumeration of the domain elements */
public Enumeration getDomain() { return probTable.keys(); }
/** Accesses the cumulative distribution function of this RV
* @param threshold
* @return For RV X, returns F_X(threshold)
*/
public double getProbLessThan(double threshold) {
double probability = 0.0;
for (Enumeration keyList = probTable.keys(); keyList.hasMoreElements(); ) {
Double domainValue = (Double)keyList.nextElement();
if (domainValue.doubleValue() < threshold) {
Double probValue = (Double)probTable.get(domainValue);
probability = probability + probValue.doubleValue();
}
}
return probability;
}
/** Access the probability mass function of this RV
* @param domainValue
* @return For RV X, returns f_X(domainValue)
*/
public double getProbability(double domainValue) {
Double probValue = (Double)probTable.get(new Double(domainValue));
if (probValue == null)
return 0.0;
else
return probValue.doubleValue();
}
public String toString() { return probTable.toString(); }
/** @return The expected value of this random variable */
public double getExpectation() {
double expectedValue = 0.0;
for (Enumeration domain = getDomain(); domain.hasMoreElements(); ) {
double domainValue = ((Double)domain.nextElement()).doubleValue();
double probValue = getProbability(domainValue);
expectedValue = expectedValue + probValue*domainValue;
}
return expectedValue;
}
public static final long serialVersionUID = 1L;
}
| [
"seanrowens@gmail.com"
] | seanrowens@gmail.com |
825d7aeee983ffc35288621ec28adbd04441134b | 10378c580b62125a184f74f595d2c37be90a5769 | /com/github/steveice10/netty/handler/ssl/util/ThreadLocalInsecureRandom.java | 22a2f14f90733458681a1c7962761abfa59a4fe3 | [] | no_license | ClientPlayground/Melon-Client | 4299d7f3e8f2446ae9f225c0d7fcc770d4d48ecb | afc9b11493e15745b78dec1c2b62bb9e01573c3d | refs/heads/beta-v2 | 2023-04-05T20:17:00.521159 | 2021-03-14T19:13:31 | 2021-03-14T19:13:31 | 347,509,882 | 33 | 19 | null | 2021-03-14T19:13:32 | 2021-03-14T00:27:40 | null | UTF-8 | Java | false | false | 1,402 | java | package com.github.steveice10.netty.handler.ssl.util;
import com.github.steveice10.netty.util.internal.PlatformDependent;
import java.security.SecureRandom;
import java.util.Random;
final class ThreadLocalInsecureRandom extends SecureRandom {
private static final long serialVersionUID = -8209473337192526191L;
private static final SecureRandom INSTANCE = new ThreadLocalInsecureRandom();
static SecureRandom current() {
return INSTANCE;
}
public String getAlgorithm() {
return "insecure";
}
public void setSeed(byte[] seed) {}
public void setSeed(long seed) {}
public void nextBytes(byte[] bytes) {
random().nextBytes(bytes);
}
public byte[] generateSeed(int numBytes) {
byte[] seed = new byte[numBytes];
random().nextBytes(seed);
return seed;
}
public int nextInt() {
return random().nextInt();
}
public int nextInt(int n) {
return random().nextInt(n);
}
public boolean nextBoolean() {
return random().nextBoolean();
}
public long nextLong() {
return random().nextLong();
}
public float nextFloat() {
return random().nextFloat();
}
public double nextDouble() {
return random().nextDouble();
}
public double nextGaussian() {
return random().nextGaussian();
}
private static Random random() {
return PlatformDependent.threadLocalRandom();
}
}
| [
"Hot-Tutorials@users.noreply.github.com"
] | Hot-Tutorials@users.noreply.github.com |
93c25d6576588436fc447e8c2edad274371a6c9c | 417b0c66a4722b428e933c986d6b1074dcca7b28 | /src/main/java/cloud/liso/jyts/ui/Extensions.java | 1dbebd41a2f0df768621aaca30a34f1553c853e2 | [] | no_license | lisomartinez/jyts | c9b1aaa77a8d9b4f0ed3a95adbafa1f7e734c5cc | b11ce48177a888f9f3a4deed47054731d2976335 | refs/heads/develop | 2022-05-25T06:38:07.604086 | 2019-11-19T21:40:19 | 2019-11-19T21:40:19 | 222,795,055 | 0 | 0 | null | 2022-05-20T21:15:08 | 2019-11-19T21:40:45 | Java | UTF-8 | Java | false | false | 153 | java | package cloud.liso.jyts.ui;
public class Extensions {
public static String urlify(String movie) {
return movie.replace(" ", "%20");
}
}
| [
"lisandromartinez@gmail.com"
] | lisandromartinez@gmail.com |
1ee11c895e9460dda6b2bd8ac12bc0ca0f5aabd5 | d3171b6e5c3ac88981c30081e1e830c7655d6ab4 | /custom-base/src/main/java/com/sx/common_base/listScreen/adapter/MultiItemTypeSupport.java | e99dd0605cd023db09fd24245187517ea77b2d83 | [] | no_license | runningrabbit1007/WiseWorksite2 | eae79ec3b85dac42edfdc594191a3abb12de57ca | 084de8d20bfc71e1bb23dfcac0e20c9d65175c68 | refs/heads/master | 2020-03-18T11:52:20.462189 | 2018-05-24T09:35:48 | 2018-05-24T09:36:14 | 134,695,284 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | package com.sx.common_base.listScreen.adapter;
/**
* 支持多布局接口
*/
public interface MultiItemTypeSupport<T> {
int getLayoutId(int position, T item);
}
| [
"774655506@qq.com"
] | 774655506@qq.com |
8f1188d577ab5b7c685d9558c62f89b20f27774f | 7ff6f352f26b262ec553fbbf0e59812f110bd24d | /src/main/java/com/punyabagus/generalOnlineStore/logic/CouponLogic.java | 8e4d9b21b2f3107c29a7afc60a3a59b30cf19ae5 | [] | no_license | mbagusprasojo/generalonlinestore | a51cc84ff3becb8b53a56647d8b7916edc2e01d5 | 9cd14413574e8b01d2910f5d3217993714b48233 | refs/heads/master | 2022-10-12T08:33:09.006059 | 2017-09-17T11:45:28 | 2017-09-17T11:45:28 | 103,533,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package com.punyabagus.generalOnlineStore.logic;
import com.punyabagus.generalOnlineStore.dao.CouponDAO;
import com.punyabagus.generalOnlineStore.pojo.CouponData.Coupon;
import com.punyabagus.generalOnlineStore.pojo.CouponData.CouponList;
import javax.inject.Inject;
/**
* Created by prasojo on 9/16/17.
*/
public class CouponLogic {
private CouponDAO couponDAO;
@Inject
public CouponLogic(CouponDAO couponDAO) {
this.couponDAO = couponDAO;
}
public Coupon createCoupon(Coupon coupon) {
return (Coupon) couponDAO.insert(coupon);
}
public CouponList getAll() {
return CouponList.newBuilder().addAllCoupon(couponDAO.getAll()).build();
}
}
| [
"muhammadbagusprasojo@gmail.com"
] | muhammadbagusprasojo@gmail.com |
3571bb4e0a3a65b730880f0700eec9e1f640899a | 5720cfa6c45a54d8d7abf2e3544a8f2d6e194c26 | /Car_Rental/src/UserInterface/CarRentalFrame.java | 88514f1b6ee0e3af5115c3145e9259863d77ca82 | [] | no_license | maaz98/350-Project | a1c5c8a670946d5981466853d64996184fabd47d | 5e3650156f6d21d57152e0a7c2fc7b5201c25e87 | refs/heads/daniels_copy | 2021-01-01T06:02:39.672230 | 2017-07-25T04:42:34 | 2017-07-25T04:42:34 | 97,340,329 | 0 | 0 | null | 2017-07-15T20:22:07 | 2017-07-15T20:22:06 | null | UTF-8 | Java | false | false | 13,574 | 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 UserInterface;
/**
*
* @author Shazam
*/
public class CarRentalFrame extends javax.swing.JFrame {
/**
* Creates new form CarRentalFrame
*/
public CarRentalFrame() {
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() {
RentalStatusTab = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
FindCarSearch = new javax.swing.JTextField();
SearchCar = new javax.swing.JButton();
RentCarButton = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
FindCarTable = new javax.swing.JTable();
jPanel2 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
RentedCarTable = new javax.swing.JTable();
ReturnCarButton = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jPanel5 = new javax.swing.JPanel();
jScrollPane3 = new javax.swing.JScrollPane();
ReturnedCarTable = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
SearchCar.setText("Search");
SearchCar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SearchCarActionPerformed(evt);
}
});
RentCarButton.setText("Rent Car");
FindCarTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null}
},
new String [] {
"Select", "ID", "Make", "Model", "Year", "Size"
}
));
jScrollPane1.setViewportView(FindCarTable);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(FindCarSearch)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(SearchCar)
.addGap(22, 22, 22))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(RentCarButton)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 454, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 12, Short.MAX_VALUE))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(16, 16, 16)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(FindCarSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(SearchCar))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(RentCarButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(13, Short.MAX_VALUE))
);
RentalStatusTab.addTab("Find Car", jPanel1);
RentedCarTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null}
},
new String [] {
"Select", "Make", "Model", "Year", "Rented"
}
));
jScrollPane2.setViewportView(RentedCarTable);
ReturnCarButton.setText("Return Selected");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 454, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(ReturnCarButton)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(ReturnCarButton)
.addGap(18, 18, 18)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(107, 107, 107))
);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
RentalStatusTab.addTab("Rented Cars", jPanel2);
ReturnedCarTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null},
{null, null, null, null, null, null}
},
new String [] {
"ID", "Make", "Model", "Year", "Rented", "Returned"
}
));
jScrollPane3.setViewportView(ReturnedCarTable);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
RentalStatusTab.addTab("Returned Cars", jPanel3);
jLabel1.setText("jLabel1");
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()
.addContainerGap()
.addComponent(RentalStatusTab)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(RentalStatusTab, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(19, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void SearchCarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SearchCarActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_SearchCarActionPerformed
/**
* @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(CarRentalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(CarRentalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(CarRentalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(CarRentalFrame.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 CarRentalFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField FindCarSearch;
private javax.swing.JTable FindCarTable;
private javax.swing.JButton RentCarButton;
private javax.swing.JTabbedPane RentalStatusTab;
private javax.swing.JTable RentedCarTable;
private javax.swing.JButton ReturnCarButton;
private javax.swing.JTable ReturnedCarTable;
private javax.swing.JButton SearchCar;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
// End of variables declaration//GEN-END:variables
}
| [
"danieln816@yahoo.com"
] | danieln816@yahoo.com |
b64481c26e4412e498daf77b608dd3a7643be96c | c7a295e37abd30d30ee9b1d0c3ca9c3c91e53acf | /KeystrokeHarden/src/edu/gatech/cs6238/project1/InstTable.java | 5b736ede1a49d02d1a96935f6de1036f3626188e | [] | no_license | rock44422/CS6238Project | 5dba2fe1820b1c87c6db37e2ca065a32443b9493 | 1ad5a4a7bcdb6d101b342b01c6dd7136ee98df8c | refs/heads/master | 2021-01-14T12:25:39.179448 | 2015-02-18T04:44:25 | 2015-02-18T04:44:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,707 | java | package edu.gatech.cs6238.project1;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
public class InstTable {
private static int num_Row;
private static char[] password;
private static BigInteger[][] table;
private static Polynomial poly;
InstTable() throws InvalidKeyException, SignatureException, NoSuchAlgorithmException {
num_Row = Initialization.getNumFeature();
password = Initialization.getPwd();
poly = Initialization.getPoly();
table = new BigInteger[num_Row][2];
setTable();
}
//calculate and store values of alfa & beta, using y value of points and HMACSHA1 of Permutation(2i OR 2i+1)
private static void setTable() throws InvalidKeyException, SignatureException, NoSuchAlgorithmException {
for(int i = 0; i < num_Row; i++) {
table[i][0] = (poly.getPointsY(i, 0).add(HMACSHA1_FunctionG.HMAC(Integer.valueOf(2 * (i + 1)).toString(), new String(password))).mod(Initialization.getPrime()));
//System.out.print(poly.valueOfPoly(BigInteger.valueOf(2 * (i + 1))).toString(16) + " ");
table[i][1] = (poly.getPointsY(i, 1).add(HMACSHA1_FunctionG.HMAC(Integer.valueOf(2 * (i + 1) + 1).toString(), new String(password))).mod(Initialization.getPrime()));
//System.out.print(poly.valueOfPoly(BigInteger.valueOf(2 * (i + 1) + 1)).toString(16) + "\n");
}
}
//print for test
public void printTable() {
System.out.println("\nInstruction Table:");
for(int i = 0; i < num_Row; i++) {
System.out.println(table[i][0].toString(16) + " " + table[i][1].toString(16));
}
}
public static BigInteger getElement(int i, int j) {
return table[i][j];
}
} | [
"rqu@lawn-128-61-18-84.lawn.gatech.edu"
] | rqu@lawn-128-61-18-84.lawn.gatech.edu |
b3ec19b9da56d3904e4bda42720001d2d5ab978b | c9f91d964b585a4a91d21c8225d8f177b77a797c | /app/src/main/java/com/marville001/firebase/MainActivity.java | d528e1b32adfe0622c8987aa6ebc4f40bed125a9 | [] | no_license | marville001/firebase | 42f6ca09754e05934b0a69b234ea86eb507bd72e | bf984bd2e7e5bc7008a4fb3abcd93cfde6ded163 | refs/heads/master | 2021-03-26T06:50:08.613055 | 2021-02-15T09:09:13 | 2021-02-15T09:09:13 | 247,681,408 | 1 | 0 | null | 2020-09-12T16:52:57 | 2020-03-16T11:09:05 | HTML | UTF-8 | Java | false | false | 3,493 | java | package com.marville001.firebase;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
public class MainActivity extends AppCompatActivity {
private FirebaseAuth auth;
Button btn_login,btn_register;
EditText et_email, et_password;
ProgressBar progressbar_login;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
auth = FirebaseAuth.getInstance();
btn_register = findViewById(R.id.btn_register);
btn_login = findViewById(R.id.btn_login);
et_email = findViewById(R.id.et_email);
et_password = findViewById(R.id.et_password);
progressbar_login = findViewById(R.id.progressbar_login);
btn_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//validate
String email= et_email.getText().toString().trim();
String password= et_password.getText().toString().trim();
if(email.isEmpty()){
et_email.setError("Email is required");
et_email.requestFocus();
return;
}
if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()){
et_email.setError("Please enter a valid email");
et_email.requestFocus();
return;
}
if(password.isEmpty()){
et_password.setError("Password is required");
et_password.requestFocus();
return;
}
if(password.length()<6){
et_password.setError("Minimum password length is 6 characters");
et_password.requestFocus();
return;
}
progressbar_login.setVisibility(View.VISIBLE);
auth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
progressbar_login.setVisibility(View.GONE);
if(task.isSuccessful()){
Intent intent = new Intent(MainActivity.this, Profile.class);
startActivity(intent);
finish();
}else{
Toast.makeText(MainActivity.this,task.getException().getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
});
btn_register.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this, Register.class);
startActivity(intent);
}
});
}
} | [
"mwangimartin1904@gmail.com"
] | mwangimartin1904@gmail.com |
9533962e59f2a6a74d5c9387fda2b4fa308fc4b6 | 8ce9911c4fefcdbff5adf974243d08e09c2be261 | /src/br/com/empresa/Funcionario.java | 35fbbbaf1973a07192bf32ab7c3c5ea37f83e928 | [] | no_license | LinkDani/Heranca | 1dedbb15000a899dabaa28d75b4ec221db7d0c12 | 9dc6d8e118bda2081dfdb4ba5b4a5224e6687db8 | refs/heads/master | 2021-07-08T13:18:09.044711 | 2017-10-04T00:18:29 | 2017-10-04T00:18:29 | 104,945,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package br.com.empresa;
public class Funcionario {
protected String nome;
protected String cpf;
protected double salario;
public Funcionario(String nome, String cpf, double salario) {
this.nome = nome;
this.cpf = cpf;
this.salario = salario;
}
}
| [
"danielwalterpand@gmail.com"
] | danielwalterpand@gmail.com |
3e281ba38d45bdde4e689861276e2b97f43c565e | 92e5686dc7eb1defd0ca3bf820c2d40b286151e8 | /android/app/src/main/java/com/boidzgame/gameplay/boidz/level/BacteriaLevel.java | 7d7268673c56fdf02512701a0a365ce8509f56bc | [] | no_license | arnaudjbernard/boidzgame-proto | 3206c279d17cb50dbf615460fb692e8bb6375fb5 | bfa4ad9087ed5ca9855223f07d2bb94821d8dbb2 | refs/heads/master | 2021-01-21T11:10:55.846903 | 2014-04-28T02:10:53 | 2014-04-28T02:10:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,951 | java | package com.boidzgame.gameplay.boidz.level;
import android.annotation.SuppressLint;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.boidzgame.R;
import com.boidzgame.activity.level.LevelActivity;
import com.boidzgame.gameplay.boidz.component.container.BacteriaContainer;
import com.boidzgame.gameplay.boidz.component.container.FoodContainer;
import com.boidzgame.gameplay.boidz.entity.Bacteria;
import com.boidzgame.gameplay.rendering.LevelView;
import com.boidzgame.util.SoundManager;
public class BacteriaLevel extends Level {
private static final String TAG = "BacteriaLevel";
private static final int GOOD_BACTERIA_FINAL_COUNT = 50;
private static final int BAD_BACTERIA_FINAL_COUNT = 5;
private static final int GOOD_BACTERIA_INITIAL_COUNT = 10;
private static final int BAD_BACTERIA_INITIAL_COUNT = 10;
public BacteriaContainer bacteriaContainer;
public FoodContainer foodContainer;
@Override
public void setup(LevelActivity levelActivity) {
super.setup(levelActivity);
handler = new BacteriaLevelHandler();
LevelView view = (LevelView) levelActivity.findViewById(R.id.scene);
view.color = 0xff000000;
bacteriaContainer = new BacteriaContainer();
foodContainer = new FoodContainer();
bacteriaContainer.setup(this);
foodContainer.setup(this);
for (int i = 0; i < GOOD_BACTERIA_INITIAL_COUNT + BAD_BACTERIA_INITIAL_COUNT; i++) {
bacteriaContainer.add(new Bacteria());
}
bacteriaContainer.setupBacterias(GOOD_BACTERIA_INITIAL_COUNT, BAD_BACTERIA_INITIAL_COUNT,
foodContainer, bacteriaContainer);
}
@Override
public void clean() {
pause();
foodContainer.cleanFood();
foodContainer.clean();
foodContainer = null;
bacteriaContainer.cleanBacterias();
bacteriaContainer.clean();
bacteriaContainer = null;
handler = null;
super.clean();
}
@Override
public void play() {
super.play();
SoundManager.playMusic(R.raw.shark_background_music);
}
@Override
public void pause() {
super.pause();
SoundManager.stopMusic();
}
private void checkVictoryContdition() {
if (!gameOver && bacteriaContainer.getGoodBacteriasCount() >= GOOD_BACTERIA_FINAL_COUNT
&& bacteriaContainer.getBadBacteriasCount() <= BAD_BACTERIA_FINAL_COUNT) {
Log.d(TAG, "Game Won");
gameOver = true;
levelActivity.onWin();
}
}
// no delayed message
@SuppressLint("HandlerLeak")
public class BacteriaLevelHandler extends Handler {
@Override
public void handleMessage(Message msg) {
if (msg.what == BacteriaContainer.MESSAGE_BACTERIA_COUNT_UPDATE) {
checkVictoryContdition();
}
}
}
}
| [
"arnaudjbernard@gmail.com"
] | arnaudjbernard@gmail.com |
824d2d55cc624d4bebe7211543ffc142bc77d0ef | dc7c55cc0ab15ba406f4f13d7e849acc145fdfc8 | /app/src/main/java/ke/co/eaglesafari/Transactions.java | 03b158e8cceb6201c8cab216e6cba2b1be2c0e3d | [] | no_license | Mirieri/users1 | c3066fe282b5c41cb32667a067529cf4eb15bf4a | df79d180a2f8b59cea2a0852a498ca2d0599a4fb | refs/heads/master | 2021-01-11T16:17:04.888797 | 2017-01-18T18:54:44 | 2017-01-18T18:54:44 | 80,054,678 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 713 | java | package ke.co.eaglesafari;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
public class Transactions extends AppCompatActivity
{
@Override
protected void onCreate(Bundle b)
{
super.onCreate(b);
setContentView(R.layout.activity_transactions);
getSupportActionBar().show();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Select a request");
// TransactionModel tmodel = new TransactionModel(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
if(itemId == android.R.id.home){
finish();
}
return true;
}
}
| [
"mirierich@gmail.com"
] | mirierich@gmail.com |
2ceaefd59dda9ebeeac86ba7697a2331c3f8a09d | 4e966d744116b7ede81574573f795ad1f3d089ae | /smart_ad_api/src/main/java/com/kobaco/smartad/controller/PmcReserveController.java | 3abc6610f966ec09ada596f2a4823afc01d34801 | [] | no_license | marchwind/eeze-project-eeze | 354bd8f876ecac3dc23e991c4bee0c57e0f420f7 | de7ec8a26d09cf17a88e172a57328857b2d0aa34 | refs/heads/master | 2021-01-10T19:33:45.831588 | 2015-04-13T09:04:25 | 2015-04-13T09:04:25 | 34,297,100 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,923 | java | package com.kobaco.smartad.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;
import com.kobaco.smartad.model.service.CommonListResult;
import com.kobaco.smartad.model.service.CommonPage;
import com.kobaco.smartad.model.service.CommonSingleResult;
import com.kobaco.smartad.model.service.PmcMnagerInfo;
import com.kobaco.smartad.model.service.PmcSessionInfo;
import com.kobaco.smartad.model.service.ReserveInfo;
import com.kobaco.smartad.model.service.UserInfo;
import com.kobaco.smartad.service.PmcReserveService;
@Controller
@SessionAttributes("sessionManagerInfo")
@RequestMapping(value="/pmc/reserve")
public class PmcReserveController {
private static final Logger logger = LoggerFactory.getLogger(PmcReserveController.class);
@Autowired
public PmcReserveService reserveService;
@RequestMapping(value = "/form", method = RequestMethod.GET)
public String form(@RequestParam (value="id",defaultValue="" )String id){
return "pmcreserve/"+id+"Form";
}
@ModelAttribute("sessionManagerInfo")
public PmcSessionInfo setSessionManagerinfo() {
return new PmcSessionInfo(){{
setLogin(false);
}};
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> add(@ModelAttribute UserInfo user,
@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev,
@RequestParam(value="reserveArray[]",defaultValue="")List<String> k){
CommonSingleResult<ReserveInfo> is = reserveService.getPmcReserveAdd(info, new PmcMnagerInfo(sessUser), user, rev, k);
return is;
}
@RequestMapping(value = "/list", method = RequestMethod.POST)
public @ResponseBody CommonListResult<ReserveInfo> list(@ModelAttribute CommonPage cp,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev,
@ModelAttribute PmcMnagerInfo info ){
CommonListResult<ReserveInfo> is = reserveService.getPmcReserveList(info,cp,new PmcMnagerInfo(sessUser),rev);
return is;
}
@RequestMapping(value = "/get", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> get(@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev){
CommonSingleResult<ReserveInfo> is = reserveService.getPmcReserveGet(info, new PmcMnagerInfo(sessUser), rev);
return is;
}
@RequestMapping(value = "/getCheckIn", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> getCheckIn(@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev){
CommonSingleResult<ReserveInfo> is = reserveService.getPmcReserveGetCheckIn(info, new PmcMnagerInfo(sessUser), rev);
return is;
}
@RequestMapping(value = "/checkIn", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> checkIn(@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev){
CommonSingleResult<ReserveInfo> is = reserveService.setPmcReserveCheckIn(info, new PmcMnagerInfo(sessUser), rev);
return is;
}
@RequestMapping(value = "/cancle", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> cancle(@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev){
CommonSingleResult<ReserveInfo> is = reserveService.pmcReserveCancle(info, new PmcMnagerInfo(sessUser), rev);
return is;
}
@RequestMapping(value = "/checkOut", method = RequestMethod.POST)
public @ResponseBody CommonSingleResult<ReserveInfo> checkOut(@ModelAttribute PmcMnagerInfo info,
@ModelAttribute("sessionManagerInfo") PmcSessionInfo sessUser,
@ModelAttribute ReserveInfo rev){
CommonSingleResult<ReserveInfo> is = reserveService.pmcReserveCheckOut(info, new PmcMnagerInfo(sessUser), rev);
return is;
}
}
| [
"marchwind75@gmail.com@a4a1ce3e-603b-a52d-a956-b3cd869ab90a"
] | marchwind75@gmail.com@a4a1ce3e-603b-a52d-a956-b3cd869ab90a |
67052145b968c6c7706b140d51b2f6a7672906e1 | 68bdc094c3eb9ddd1b05a0f2ea1bc672f0b1c7cc | /app/src/main/java/com/example/coloridentifierapplication/ColorIdentity/DatabaseHelper.java | 18c320a1abc0e305113505f8f3bf9bd3744e94a8 | [] | no_license | yanxun95/Year4-Color-Identify | baff7e5fa10a609b786eabcee8610676fd0d5d78 | 3b5cfefd91fb8038cba0be143b3a0daa75bbe41e | refs/heads/main | 2023-04-10T14:04:58.376677 | 2021-04-28T13:54:41 | 2021-04-28T13:54:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,811 | java | package com.example.coloridentifierapplication.ColorIdentity;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
import com.example.coloridentifierapplication.Color.Color;
import java.util.ArrayList;
import java.util.List;
public class DatabaseHelper extends SQLiteOpenHelper {
public static final String TAG = "DatabaseHelper";
public static final String TABLE_COLOR = "ColorTable";
public static final String COLUMN_ID = "ID";
public static final String COLUMN_NAME = "Color";
public static final String COLUMN_RGB = "RGB";
public static final String COLUMN_HEX = "HEX";
private static final String DATABASE_NAME = "color.db";
private static final int DATABASE_VERSION = 1;
List<Color> colorList = new ArrayList<>();
// Database creation sql statement
private static final String DATABASE_CREATE = "CREATE TABLE " + TABLE_COLOR + " (" +
COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
COLUMN_NAME + " TEXT, " +
COLUMN_RGB + " TEXT, " +
COLUMN_HEX + " TEXT );";
public DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(DATABASE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w(DatabaseHelper.class.getName(),
"Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_COLOR);
onCreate(db);
}
public void addColor(Color color) {
ContentValues values = new ContentValues();
values.put(COLUMN_NAME, color.getName());
values.put(COLUMN_RGB, color.getRgb());
values.put(COLUMN_HEX, color.getHex());
SQLiteDatabase db = this.getWritableDatabase();
db.insert(TABLE_COLOR, null, values);
db.close();
}
public void deleteColor(Color color) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete(TABLE_COLOR, COLUMN_ID + " = ?", new String[] {color.getId()});
db.close();
}
private Color cursorToColor(Cursor cursor)
{
Color color = new Color();
color.setId(cursor.getString(0));
color.setName(cursor.getString(1));
color.setRgb(cursor.getString(2));
color.setHex(cursor.getString(3));
return color;
}
public boolean findColor(String hex) {
String query = "Select * FROM " + TABLE_COLOR + " WHERE " + COLUMN_HEX + " = \"" + hex + "\"";
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(query, null);
Color color=null;
if (cursor.moveToFirst()) {
cursor.moveToFirst();
color = cursorToColor(cursor);
cursor.close();
return false;
}
db.close();
return true;
}
public ArrayList<Color> findAllColors() {
ArrayList<Color> colors = new ArrayList<Color>();
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.query(DatabaseHelper.TABLE_COLOR,
new String[]{COLUMN_ID,COLUMN_NAME,COLUMN_RGB,COLUMN_HEX}, null, null, null, null, null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
Color color = cursorToColor(cursor);
colors.add(color);
cursor.moveToNext();
}
// make sure to close the cursor
cursor.close();
db.close();
return colors;
}
public List<Color> getAllData(){
SQLiteDatabase db = this.getWritableDatabase();
String columns[] = {COLUMN_ID,COLUMN_NAME,COLUMN_RGB,COLUMN_HEX};
Cursor cursor = db.query(TABLE_COLOR,columns,null,null,null, null, null);
while(cursor.moveToNext()){
int index = cursor.getColumnIndex(DatabaseHelper.COLUMN_ID);
String id = cursor.getString(index);
int index1 = cursor.getColumnIndex(DatabaseHelper.COLUMN_NAME);
String name = cursor.getString(index1);
int index2 = cursor.getColumnIndex(DatabaseHelper.COLUMN_RGB);
String rgb = cursor.getString(index2);
int index3 = cursor.getColumnIndex(DatabaseHelper.COLUMN_HEX);
String hex = cursor.getString(index3);
Color color = new Color(id, name, rgb, hex);
colorList.add(color);
}
cursor.close();
db.close();
return colorList;
}
}
| [
"yanxun951224@gmail.com"
] | yanxun951224@gmail.com |
57ba516a62913714ed7894713b12d649976ba369 | 4679aca76352a53683af7f0d253c9baa6b9ebce1 | /src/test/java/manager/DriverConfiguration.java | bde3fb2df59bb1bf65f8b5492ceb0ca7c0edf569 | [] | no_license | Anastasia0reshnikova/test_architecture | d11756ba80d7a2895d13101ad57161de6b95fed1 | 283351b08f65edd266c6e557d2e4986694967099 | refs/heads/master | 2021-09-05T22:08:39.139075 | 2018-01-31T08:44:56 | 2018-01-31T08:44:56 | 119,550,524 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,089 | java | package manager;
import com.codeborne.selenide.Configuration;
import com.codeborne.selenide.WebDriverRunner;
import io.qameta.allure.Step;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.BrowserType;
import static com.codeborne.selenide.Selenide.open;
import static manager.ApplicationManager.getProperties;
/**
* Created by a.oreshnikova on 30.01.2018.
*/
public class DriverConfiguration {
private ApplicationManager app;
DriverConfiguration(ApplicationManager app) {
this.app = app;
setAllDriverPath();
setDriver();
setDriverProperties();
}
public WebDriver getDriver() {
return WebDriverRunner.getWebDriver();
}
public void stopDriver() {
WebDriverRunner.closeWebDriver();
}
private String getBrowser() {
return getProperties("web.browser");
}
private void setAllDriverPath(){
String osName = System.getProperty("os.name").toLowerCase();
String browser = getBrowser();
if (osName.equals("windows")) {
if (browser.equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "src\\test\\resources\\drivers\\chromedriver.exe");
}
if (browser.equals("marionette")) {
System.setProperty("webdriver.gecko.driver", "src\\test\\resources\\drivers\\geckodriver.exe");
}
}
if (osName.equals("mac")){
if (browser.equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver");
}
if (browser.equals("marionette")) {
System.setProperty("webdriver.gecko.driver", "src/test/resources/drivers/geckodriver");
}
}
if (osName.equals("linux")){
if (browser.equals("chrome")) {
System.setProperty("webdriver.chrome.driver", "src/test/resources/drivers/chromedriver_lin");
}
}
}
private void setDriver() {
switch (getBrowser()) {
case BrowserType.FIREFOX: {
Configuration.browser = "marionette";
//setWebsoketsForFirefox();
break;
}
case BrowserType.CHROME:
Configuration.browser = "chrome";
//setWebsoketsForChrome();
break;
default:
throw new ExceptionInInitializerError("Браузер " + getBrowser() + "в текущей конфигурации отсутствует");
}
}
private void setDriverProperties() {
Configuration.fastSetValue = true;
Configuration.reopenBrowserOnFail = false;
Configuration.savePageSource = false;
Configuration.screenshots = true;
Configuration.startMaximized = true;
//Configuration.browserSize = "1280x1024";
}
@Step("Открывается Главная страница Кабинета")
public void goToUrl() {
open(getProperties("web.url"));
}
}
| [
"piter_ao12@mail.ru"
] | piter_ao12@mail.ru |
b5af0e93948c180c3bdd01b13eb010d2c574a494 | 1e3114350d37f69cb64c45901180867be940deab | /app/src/main/java/com/gmail/nitadewis/tugasinhalnita/MenuList.java | 202573433b16bb2895f1fad8c80de4bda4474f30 | [] | no_license | nitadewi/inhal-pertemuan-5 | a0166f5bfb095f243988141c1cd850539081b077 | 5acde6cf5406a556fdc0e1a5b6198eef53b13fa6 | refs/heads/master | 2020-05-14T04:47:01.511449 | 2019-04-16T13:58:54 | 2019-04-16T13:58:54 | 181,698,544 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,407 | java | package com.gmail.nitadewis.tugasinhalnita;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MenuList extends ArrayAdapter<String> {
private final Activity context;
private final String[] maintitle;
private final String[] subtitle;
private final Integer[] imgid;
public MenuList(Activity context, String[] maintitle,String[] subtitle, Integer[] imgid) {
super(context, R.layout.mylist, maintitle);
// TODO Auto-generated constructor stub
this.context=context;
this.maintitle=maintitle;
this.subtitle=subtitle;
this.imgid=imgid;
}
public View getView(int position,View view,ViewGroup parent) {
LayoutInflater inflater=context.getLayoutInflater();
View rowView=inflater.inflate(R.layout.mylist, null,true);
TextView titleText = (TextView) rowView.findViewById(R.id.title);
ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
TextView subtitleText = (TextView) rowView.findViewById(R.id.subtitle);
titleText.setText(maintitle[position]);
imageView.setImageResource(imgid[position]);
subtitleText.setText(subtitle[position]);
return rowView;
};
} | [
"nitadewis@gmail.com"
] | nitadewis@gmail.com |
04d77a1468b5dfaff876b23ae4b48cf3ec5e52a2 | 0a8bbc5c88f7a362304d5a1547f9999249aec1ff | /BRM/src/com/fc/brms/common/domain/EmployeeContrack.java | 97960e621fcea99d373e04649dd466105a4b7139 | [] | no_license | yangjiugang/teamway | 697ea4296f92d7982166f5607b42b4ece6374a91 | 425cf8b1d0bc759a5f79c40cde700adbef39ba12 | refs/heads/master | 2021-10-20T21:46:13.327612 | 2018-07-30T08:10:01 | 2018-07-30T08:10:01 | 108,513,918 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,050 | java | package com.fc.brms.common.domain;
import java.io.Serializable;
public class EmployeeContrack implements Serializable {
private static final long serialVersionUID = 1L;
private int contrackId;
private int employeeId;
private int contractType;
private String contractNum;
private String contractDoc;
public void setContrackId(int contrackId) {
this.contrackId = contrackId;
}
public int getContrackId() {
return this.contrackId;
}
public void setEmployeeId(int employeeId) {
this.employeeId = employeeId;
}
public int getEmployeeId() {
return this.employeeId;
}
public void setContractType(int contractType) {
this.contractType = contractType;
}
public int getContractType() {
return this.contractType;
}
public void setContractNum(String contractNum) {
this.contractNum = contractNum;
}
public String getContractNum() {
return this.contractNum;
}
public void setContractDoc(String contractDoc) {
this.contractDoc = contractDoc;
}
public String getContractDoc() {
return this.contractDoc;
}
} | [
"250197480@qq.com"
] | 250197480@qq.com |
fb5cb8c3cbeeea3cb9caac5802c31fb8f47eb05a | a502ffe3e324e3900c5efa6f289116c60f17a2e5 | /android/RtcSolutionSuperClassRoom/RTCSuperClassRoom/RTCSuperClassRoom_Demo/src/main/java/com/aliyun/rtc/superclassroom/api/BaseRTCSuperClassApi.java | b9531494c97aada74ec47506bd0caefe98a0c542 | [
"MIT"
] | permissive | aliyun/alibabacloud-AliRtcSuperClass-demo | 172491241a4a0a8acc2e1985e169ddf6b4fee7bd | dc2089cdf1a71e7422a68c7b4804aab9d8f657af | refs/heads/master | 2023-02-11T08:52:19.301825 | 2021-01-06T06:28:56 | 2021-01-06T06:28:56 | 327,001,975 | 11 | 2 | null | null | null | null | UTF-8 | Java | false | false | 540 | java | package com.aliyun.rtc.superclassroom.api;
import com.aliyun.rtc.superclassroom.api.net.OkhttpClient;
import com.aliyun.rtc.superclassroom.bean.IResponse;
/**
* 网络请求的方法
*/
public abstract class BaseRTCSuperClassApi {
/**
* 获取鉴权信息 get请求
*
* @param channelId 房间编号
* @param userId 用户id
* @param <T> 返回值泛型
*/
public abstract <T> void getRtcAuth(String channelId, String userId, OkhttpClient.BaseHttpCallBack<IResponse<T>> callBack);
}
| [
"burui.br@alibaba-inc.com"
] | burui.br@alibaba-inc.com |
271c2f1d2f128fb9eb59e3af4c5d936842d3cc09 | 5314fcf27d865b282ab6cb3ab7fb5f0956eedb23 | /src/collegeproject/Dept.java | 0c3bac0e9347e227455d14422e341a7ceae9b85a | [] | no_license | CodehubX/College-MS3 | 0cf3cdd44c757a5ed9abf8fed910ab389c730bdf | 8d4cf528075e5c8c7dc2e5bddbeda37e99226899 | refs/heads/master | 2020-04-08T16:45:36.991766 | 2018-09-10T17:40:28 | 2018-09-10T17:40:28 | 159,533,705 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,229 | 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 collegeproject;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javax.swing.JOptionPane;
/**
*
* @author a
*/
public class Dept extends Application {
FunStudent current = null;
static Connection con = null;
static PreparedStatement pst = null;
ObservableList<FunStudent> list = FXCollections.observableArrayList();
TableView<FunStudent> tabel = new TableView<FunStudent>(list);
String namedept;
Button btnAdd = new Button("Add");
Button btnUpdate = new Button("Update");
Button btnDelet = new Button("Delete");
Button btnSearch = new Button("Search");
Button btnRefresh = new Button("Refresh");
Button btnRetrun = new Button("Retrun");
Label labelId = new Label("id doctor : ");
Label labelFName = new Label("Name department : ");
Label labelEmail = new Label("Email : ");
// Label labelAddress=new Label("Address : ");
Label labelPhone = new Label("Phone : ");
Label labelSearch = new Label("Search : ");
Text error1 = new Text(" ");
Text error2 = new Text(" ");
Text error3 = new Text(" ");
Text error4 = new Text(" ");
Text error5 = new Text(" ");
Text error6 = new Text(" ");
Text error7 = new Text(" ");
Text error8 = new Text(" ");
Text error9 = new Text(" ");
TextField tfId = new TextField();
TextField tfName = new TextField();
TextField tfEmail = new TextField();
// TextField tfAdderess=new TextField();
TextField tfPhone = new TextField();
TextField tfSearch = new TextField();
@Override
public void start(Stage primaryStage) throws Exception {
try {
con = DriverManager.getConnection("jdbc:derby://localhost:1527/college", "mano", "mano");
System.out.println("done");
} catch (Exception e) {
System.out.println(e);
}
tfSearch.setPromptText("Name dept");
TableColumn columId = new TableColumn("id Doctor");
TableColumn columFName = new TableColumn("Name");
TableColumn columEmail = new TableColumn("Email");
// TableColumn columAddress=new TableColumn("Address");
TableColumn columPhone = new TableColumn("Phone number");
TableColumn columNameDoc = new TableColumn("name Doctor");
columId.setCellValueFactory(new PropertyValueFactory("IdDoctor2"));
columFName.setCellValueFactory(new PropertyValueFactory("NameDept"));
columEmail.setCellValueFactory(new PropertyValueFactory("EmailDept"));
// columAddress.setCellValueFactory(new PropertyValueFactory("AddressDoc"));
columPhone.setCellValueFactory(new PropertyValueFactory("PhoneDept"));
columNameDoc.setCellValueFactory(new PropertyValueFactory("NameDoc2"));
tabel.getColumns().addAll(columId, columFName, columEmail, columPhone, columNameDoc);
HBox hb0 = new HBox();
HBox hb1 = new HBox();
HBox hb2 = new HBox();
VBox vb1 = new VBox();
VBox vb2 = new VBox();
VBox vb3 = new VBox();
BorderPane bp1 = new BorderPane();
BorderPane bp2 = new BorderPane();
//design
//search
hb1.getChildren().addAll(labelSearch, tfSearch, btnSearch);
hb0.getChildren().addAll(btnRetrun, hb1);
hb1.setSpacing(12);
hb0.setSpacing(250);
bp1.setTop(hb0);
hb1.setAlignment(Pos.CENTER);
bp1.setMargin(hb1, new Insets(12, 12, 12, 12));
//link between label and textfield of all
HBox hbox1 = new HBox(labelFName, tfName, error1);
// HBox hbox4=new HBox(labelAddress,tfAdderess,error4);
HBox hbox7 = new HBox(labelEmail, tfEmail, error6);
HBox hbox8 = new HBox(labelPhone, tfPhone, error7);
HBox hboxId = new HBox(labelId, tfId, error8);
//add,delet,update,textfield in center of bp1
vb1.getChildren().addAll(btnAdd, btnUpdate, btnDelet, btnRefresh);
vb2.getChildren().addAll(hboxId, hbox1, hbox7, hbox8);
vb3.getChildren().addAll(hbox7, hbox8);
hb2.getChildren().addAll(vb1, vb2, vb3);
bp1.setCenter(hb2);
//main of design
bp2.setTop(bp1);
bp2.setCenter(tabel);
//setspacing
hb2.setSpacing(44);
vb1.setSpacing(12);
vb2.setSpacing(12);
vb3.setSpacing(12);
//select the mouse in table
TableView.TableViewSelectionModel<FunStudent> selected = tabel.getSelectionModel();
ReadOnlyObjectProperty<FunStudent> item = selected.selectedItemProperty();
item.addListener(new ChangeListener<FunStudent>() {
@Override
public void changed(ObservableValue<? extends FunStudent> observable, FunStudent oldValue, FunStudent newValue) {
current = newValue;
try {
String namedept = newValue.getNameDept();
tfName.setText(namedept);
tfEmail.setText(newValue.getEmailDept());
// tfAdderess.setText(newValue.getAddressDoc());
tfId.setText(String.valueOf(newValue.getIdDoctor2()));
tfPhone.setText(String.valueOf(newValue.getPhoneDept()));
} catch (Exception e) {
}
}
});
//actions
btnAdd.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if (check(1)) {
try {
int id = Integer.valueOf(tfId.getText());
String fname = tfName.getText();
String email = tfEmail.getText();
// String address=tfAdderess.getText();
int phone = Integer.valueOf(tfPhone.getText());
pst = con.prepareStatement("insert into department values(?,?,?,?)");
pst.setString(1, fname);
pst.setInt(2, id);
// pst.setString(3, address);
pst.setInt(3, phone);
pst.setString(4, email);
pst.execute();
JOptionPane.showMessageDialog(null, "done");
refreshTable();
} catch (SQLIntegrityConstraintViolationException e) {
error1.setText("name found before");
error1.setFill(Color.RED);
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null, "error");
}
}
}
});
btnUpdate.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent e) {
if (check(0)) {
try {
int id = Integer.valueOf(tfId.getText());
String fname = tfName.getText();
String email = tfEmail.getText();
// String address=tfAdderess.getText();
int phone = Integer.valueOf(tfPhone.getText());
pst = con.prepareStatement("update department set ID_DOCTOR=?,phone=?,email=? where NAMEDEPT=? ");
pst.setString(4, fname);
pst.setInt(1, id);
pst.setInt(2, phone);
pst.setString(3, email);
// pst.setString(3, address);
pst.execute();
refreshTable();
} catch (SQLIntegrityConstraintViolationException ex) {
error8.setText("id is not found");
error8.setFill(Color.RED);
} catch (SQLException ex) {
Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
});
btnDelet.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
if (check(0)) {
try {
if (checkdept(tfName.getText())) {
pst = con.prepareStatement("delete from department where NAMEDEPT=?");
pst.setString(1, tfName.getText());
pst.execute();
refreshTable();
} else {
error1.setText("name is not found");
error1.setFill(Color.RED);
}
} catch (SQLException ex) {
System.out.println("error in delet ");
Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
});
btnSearch.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
try {
System.out.println("search");
String query = "select namedept,department.id_doctor,department.phone,department.email,name_doctor from department left outer join doctor on(department.id_doctor=doctor.id_doctor) where lower(NAMEDEPT)=lower(?) ";
pst = con.prepareStatement(query);
pst.setString(1, tfSearch.getText());
ResultSet rs = pst.executeQuery();
list.clear();
downloadToTable(rs);
} catch (SQLException ex) {
System.out.println("heoooooo");
}
}
});
btnRefresh.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
refreshTable();
}
});
btnRetrun.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
try {
con.close();
Stage l = new Stage();
new MainProject().start(l);
primaryStage.hide();
} catch (SQLException ex) {
Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
} catch (Exception ex) {
Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
refreshTable();
Scene value = new Scene(bp2, 966, 666);
bp2.setId("id1");
bp2.getStylesheets().add(this.getClass().getResource("style.css").toExternalForm());
primaryStage.setScene(value);
primaryStage.setTitle("Department");
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
public boolean check(int i) {
int x = 0;
try {
int ee = Integer.valueOf(tfId.getText());
} catch (NumberFormatException e) {
error8.setText("enter number ");
error8.setFill(Color.RED);
return false;
}
if (tfId.getText().equals("") || Integer.valueOf(tfId.getText()) <= 0) {
error8.setText("error");
error8.setFill(Color.RED);
x = 2;
} else {
error8.setText(" ");
}
if (tfName.getText().equals("")) {
error1.setText("error");
error1.setFill(Color.RED);
x = 2;
} else {
error1.setText(" ");
}
// if(tfAdderess.getText().equals("")){error4.setText("error");
// error4.setFill(Color.RED);x=2;}else{error4.setText(" ");
// }
if (tfEmail.getText().equals("")) {
error6.setText("error");
error6.setFill(Color.RED);
x = 2;
} else {
error6.setText(" ");
}
if (tfPhone.getText().equals("")) {
error7.setText("error");
error7.setFill(Color.RED);
x = 2;
} else {
error7.setText(" ");
}
if (x == 2) {
return false;
}
if (i == 1) {
// try {
// pst=con.prepareStatement("select nameDep from doctor where id_doctor=?");
// pst.setInt(1, Integer.valueOf(tfId.getText()));
//
// ResultSet rs=pst.executeQuery();
// if(rs.next()){
// error8.setText("id is found");
// error8.setFill(Color.RED);
// return false;
// }
// } catch (SQLException ex) {
// Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
// }
}
try {
int ee = Integer.valueOf(tfPhone.getText());
} catch (NumberFormatException e) {
error7.setText("enter number ");
error7.setFill(Color.RED);
return false;
}
if (tfEmail.getText().contains(".com") && tfEmail.getText().contains("@")) {
} else {
error6.setText("example@exa.com ");
error6.setFill(Color.RED);
return false;
}
System.out.println(x);
if (x == 2) {
return false;
} else {
return true;
}
}
public void refreshTable() {
list.clear();
try {
String query = "select namedept,department.id_doctor,department.phone,department.email,name_doctor from department left outer join doctor on(department.id_doctor=doctor.id_doctor)";
pst = con.prepareStatement(query);
ResultSet rs = pst.executeQuery();
downloadToTable(rs);
} catch (SQLException ex) {
System.out.println(ex + "2");
}
error1.setText(" ");
error2.setText(" ");
error3.setText(" ");
error4.setText(" ");
error5.setText(" ");
error6.setText(" ");
error7.setText(" ");
error8.setText(" ");
error9.setText(" ");
}
public void downloadToTable(ResultSet rs) {
try {
while (rs.next()) {
System.out.println("1");
int id;
try{
id = Integer.valueOf(rs.getString("id_doctor"));
}catch(NumberFormatException es){
id=0;
}
System.out.println("2");
String name_doctor = rs.getString("name_doctor");
String name_dept = rs.getString("namedept");
String email = rs.getString("email");
// String address=rs.getString("address");
int phone = Integer.valueOf(rs.getString("phone"));
list.add(new FunStudent(name_dept, id, phone, email, name_doctor));
}
}
catch (Exception e) {
System.out.println(e);
System.out.println("sdk");
}
}
public boolean checkdept(String l) {
try {
pst = con.prepareStatement("select nameDept from department where namedept=?");
pst.setString(1, l);
ResultSet rs = pst.executeQuery();
if (rs.next()) {
return true;
}
} catch (SQLException ex) {
Logger.getLogger(Student.class.getName()).log(Level.SEVERE, null, ex);
}
return false;
}
}
| [
"manosaaf@gmail.com"
] | manosaaf@gmail.com |
4c22d6afcb2a6560fd4cfe8f979309b7c75be489 | a3478539fa1c2fcfd179f23ebe08b036f55c4df3 | /src/com/bochy/util/DbUtil.java | a14175f868c4392746518128fdf8cd9e7f9d4a5a | [
"MIT"
] | permissive | Green8948/moon_Girl | c1a6f61affad8495f68ce5ce225b9443076c2280 | 195a0b199bd53fbb801b5fe2a585fab20594178f | refs/heads/master | 2020-03-26T01:12:16.570495 | 2018-08-11T05:17:12 | 2018-08-11T05:17:12 | 144,356,911 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 9,176 | java | package com.bochy.util;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.bochy.entity.Admin;
import com.bochy.entity.Category;
import com.bochy.entity.Customer;
import com.bochy.entity.Image;
import com.bochy.entity.Order;
import com.bochy.entity.Product;
//util包里放工具类:封装了工具的类 列如:数据库连接与操作
public class DbUtil {
public Connection getConnection()throws ClassNotFoundException, SQLException{
Connection conn=null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn=DriverManager.getConnection
("jdbc:mysql://localhost:3306/database119", "root", "3119");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public int executeUpdate(String sql,Object... obj){
int num=0;
Connection conn=null;
PreparedStatement pstat=null;
try {
conn=getConnection();
pstat=conn.prepareStatement(sql);
// String sql="insert into tb_new (title,author,content) values(?,?,?)";
for (int i = 0; i < obj.length; i++) {
pstat.setObject((i+1), obj[i]);
}
num=pstat.executeUpdate();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}finally{
close(null,pstat,conn);
}
return num;
}
public List<Product> executeQuery(String sql,Object...obj){
List<Product> list=new ArrayList<Product>();
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn=getConnection();
ps=conn.prepareStatement(sql);
for (int i = 0; i < obj.length; i++) {
ps.setObject(i+1,obj[i]);
}
rs=ps.executeQuery();
while(rs.next()){
Integer id=(Integer)rs.getObject("id");
String name=(String) rs.getObject("name");
String filename=(String) rs.getObject("filename");
String sellprice=(String) rs.getObject("sellprice");
String description=(String) rs.getObject("description");
String baseprice=(String)rs.getObject("baseprice");
String marketprice=(String)rs.getObject("marketprice") ;
String comment=(String)rs.getObject("comment") ;
String categoryid=(String)rs.getObject("categoryid") ;
String sexrequest=(String)rs.getObject("sexrequest");
Product product=new Product();
product.setId(id);
product.setName(name);
product.setFilename(filename);
product.setSellprice(sellprice);
product.setDescription(description);
product.setBaseprice(baseprice);
product.setMarketprice(marketprice);
product.setComment(comment);
product.setCategoryid(categoryid);
product.setSexrequest(sexrequest);
list.add(product);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
close(rs,ps,conn);
}
return list;
}
public List<Image> executeQueryImage(String sql,Object...object ){
List<Image> list=new ArrayList<Image>();
Connection conn=null;
PreparedStatement pstat=null;
ResultSet re=null;
try {
conn=getConnection();
pstat=conn.prepareStatement(sql);
for (int i = 0; i < object.length; i++) {
pstat.setObject((i+1), object[i]);
}
re=pstat.executeQuery();
while(re.next()){
String fileName=(String)re.getObject("fileName");
Image image=new Image();
image.setFileName(fileName);
list.add(image);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} finally{
close(re, pstat, conn);
}
return list;
}
public List<Category> executeQueryCategory(String sql, Object...obj) {
List<Category> list=new ArrayList<Category>();
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn=getConnection();
ps=conn.prepareStatement(sql);
for (int i=0; i <obj.length; i++) {
ps.setObject(i+1,obj[i]);
}
rs=ps.executeQuery();
while(rs.next()){
Integer id=(Integer)rs.getObject("id");
String name=(String) rs.getObject("name");
Integer level=(Integer) rs.getObject("level");
Integer pid=(Integer) rs.getObject("pid");
Timestamp categoryTime=(Timestamp) rs.getObject("categoryTime");
Category category=new Category();
category.setId(id);
category.setName(name);
category.setCategoryTime(categoryTime);
category.setLevel(level);
category.setPid(pid);
list.add(category);
}
}catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
close(rs,ps,conn);
}
return list;
}
public void close (ResultSet rs,PreparedStatement ps,Connection conn){
try {
if(rs!=null){
rs.close();
}
if(ps!=null){
ps.close();
}
if(conn!=null){
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
public List<Admin> executeQueryAdmin(String sql,Object...obj ) {
List<Admin> list=new ArrayList<Admin>();
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn=getConnection();
ps=conn.prepareStatement(sql);
for (int i = 0; i < obj.length; i++) {
ps.setObject(i+1,obj[i]);
}
rs=ps.executeQuery();
while(rs.next()){
Integer id=(Integer)rs.getObject("id");
String username=(String) rs.getObject("username");
String password=(String)rs.getObject("password");
Admin admin=new Admin();
admin.setId(id);
admin.setUsername(username);
admin.setPassword(password);
list.add(admin);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (SQLException e) {
e.printStackTrace();
}finally{
close(rs,ps,conn);
}
return list;
}
public List<Order> executeQueryOrder(String sql, Object...obj) {
List<Order> list=new ArrayList<Order>();
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn=getConnection();
ps=conn.prepareStatement(sql);
for (int i = 0; i < obj.length; i++) {
ps.setObject(i+1,obj[i]);
}
rs=ps.executeQuery();
while(rs.next()){
Integer id=(Integer)rs.getObject("id");
Integer totalMoney=(Integer)rs.getObject("totalMoney");
String receiver=(String) rs.getObject("receiver");
String address=(String) rs.getObject("address");
String payMethod=(String) rs.getObject("payMethod");
String orderState=(String) rs.getObject("orderState");
Timestamp orderTime=(Timestamp) rs.getObject("orderTime");
Order order=new Order();
order.setId(id);
order.setTotalMoney(totalMoney);
order.setReceiver(receiver);
order.setAddress(address);
order.setPayMethod(payMethod);
order.setOrderState(orderState);
order.setOrderTime(orderTime);
list.add(order);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (SQLException e) {
e.printStackTrace();
}finally{
close(rs,ps,conn);
}
return list;
}
public List<Customer> executeQueryCustomer(String sql, Object...obj) {
List<Customer> list = new ArrayList<Customer>();
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn=getConnection();
ps=conn.prepareStatement(sql);
for (int i = 0; i < obj.length; i++) {
ps.setObject(i+1, obj[i]);
}
rs = ps.executeQuery();
while(rs.next()){
Integer id=(Integer) rs.getObject("id");
String name=(String) rs.getObject("name");
String password=(String) rs.getObject("password");
String realname=(String) rs.getObject("realname");
String address=(String) rs.getObject("address");
String email=(String) rs.getObject("email");
String tel=(String) rs.getObject("tel");
Customer customer=new Customer();
customer.setId(id);
customer.setName(name);
customer.setPassword(password);
customer.setRealname(realname);
customer.setAddress(address);
customer.setEmail(email);
customer.setTel(tel);
list.add(customer);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}catch (SQLException e) {
e.printStackTrace();
}finally{
close(rs,ps,conn);
}
return list;
}
} | [
"894814595@qq.com"
] | 894814595@qq.com |
98022e09b240b04bc4ced3daf212d96669c6f8ba | 61715b57842d1e9625c43bcd25b22d06307a0d43 | /src/main/java/br/com/unika/interfaces/IServico.java | 469235301e8011b4cbd51c733f7cf6c3de3209ce | [] | no_license | bordori/Banco | 26674c3056bd06d49c64cba3ba71e8804c29bda9 | ed8028aa603786aa78c921c3eaaccd7e0f36b6ab | refs/heads/master | 2020-04-09T19:27:07.182810 | 2019-01-23T12:42:50 | 2019-01-23T12:42:50 | 160,521,548 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 523 | java | package br.com.unika.interfaces;
import java.io.Serializable;
import java.util.List;
import com.googlecode.genericdao.search.Search;
import br.com.unika.util.Retorno;
public interface IServico<Entidade,id extends Serializable> {
public Retorno incluir(Entidade ent);
public Retorno alterar(Entidade ent);
public Entidade procurar(Entidade ent);
public List<Entidade> listar();
public Retorno remover(Entidade ent);
public List<Entidade> search(Search search);
public int count(Search search);
}
| [
"jeanbordori@gmail.com"
] | jeanbordori@gmail.com |
ad847e85b508c56ca58196028521fb101e1b1ed3 | 1ab1012a4ecc1cae51c787749b3f7c17d168a629 | /app/src/main/java/com/example/firebasetest/CreateSnapsActivity.java | 087d23750d15e2cfe5e75c27548d3bddbc44a9c5 | [] | no_license | sharmasidharth1910/FirebaseTest | 6c78884c6fa31847e87f7c40aa2fd525e30dc2aa | cddfc6824390528466dcd7cf3589259bd5524974 | refs/heads/master | 2020-12-04T10:45:38.920931 | 2020-01-04T08:46:44 | 2020-01-04T08:46:44 | 231,734,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,620 | java | package com.example.firebasetest;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayOutputStream;
import java.util.UUID;
public class CreateSnapsActivity extends AppCompatActivity {
Button btnChoose, btnNext;
EditText etMessage;
ImageView ivUpload;
String imageName = UUID.randomUUID().toString() + ".jpg";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_snaps);
btnChoose = findViewById(R.id.btnChoose);
btnNext = findViewById(R.id.btnNext);
etMessage = findViewById(R.id.etMessage);
ivUpload = findViewById(R.id.ivUpload);
btnChoose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)
{
requestPermissions(new String[] {Manifest.permission.READ_EXTERNAL_STORAGE}, 1);
}else
{
getPhoto();
}
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Get the data from an ImageView as bytes
ivUpload.setDrawingCacheEnabled(true);
ivUpload.buildDrawingCache();
Bitmap bitmap = ((BitmapDrawable) ivUpload.getDrawable()).getBitmap();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray();
UploadTask uploadTask = FirebaseStorage.getInstance().getReference().child("images").child(imageName).putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Toast.makeText(CreateSnapsActivity.this, "Upload Failed. " + exception.getMessage() , Toast.LENGTH_SHORT).show();
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Intent intent = new Intent(CreateSnapsActivity.this, ChooseUserActivity.class);
startActivity(intent);
}
});
}
});
}
public void getPhoto()
{
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 1);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Uri imageSelected = data.getData();
if (requestCode == 1 && resultCode == RESULT_OK && data != null)
{
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageSelected);
ivUpload.setImageBitmap(bitmap);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if(requestCode == 1)
{
if (grantResults.length>0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
{
getPhoto();
}
}
}
}
| [
"sharmasidharth1910@gmail.com"
] | sharmasidharth1910@gmail.com |
381adb94336c6b8f028071e51e669655d674433a | d2cb1f4f186238ed3075c2748552e9325763a1cb | /methods_all/static_methods/java_lang_String_valueOf_boolean.java | d899ade2426e985dd9d5830a9cf0e357bc03cd7e | [] | no_license | Adabot1/data | 9e5c64021261bf181b51b4141aab2e2877b9054a | 352b77eaebd8efdb4d343b642c71cdbfec35054e | refs/heads/master | 2020-05-16T14:22:19.491115 | 2019-05-25T04:35:00 | 2019-05-25T04:35:00 | 183,001,929 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 104 | java | class java_lang_String_valueOf_boolean{ public static void function() {java.lang.String.valueOf(true);}} | [
"peter2008.ok@163.com"
] | peter2008.ok@163.com |
eef4f5ecc3f4476495665959148054f15571cfd8 | b336307902d9d74b19ec22c91a99f4d65a1c434f | /flink/src/main/java/state/CountWindowAverage.java | 42a5dd94e039830e8cae11c255ac44eaa16c06e4 | [] | no_license | shejiewei/sjw-all | f529159a87defda6373b3322a89788565c16e302 | 25e03eacc268dded130476d0492ed4990101f256 | refs/heads/master | 2022-09-22T16:28:45.539089 | 2021-03-14T09:35:43 | 2021-03-14T09:35:43 | 166,673,906 | 4 | 0 | null | 2022-09-17T00:05:57 | 2019-01-20T15:00:25 | Java | UTF-8 | Java | false | false | 2,189 | java | package state;
import org.apache.flink.api.common.functions.RichFlatMapFunction;
import org.apache.flink.api.common.state.ValueState;
import org.apache.flink.api.common.state.ValueStateDescriptor;
import org.apache.flink.api.common.typeinfo.TypeHint;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.Collector;
public class CountWindowAverage extends RichFlatMapFunction<Tuple2<Long, Long>, Tuple2<Long, Long>> {
/**
* The ValueState handle. The first field is the count, the second field a running sum.
*/
private ValueState<Tuple2<Long, Long>> sum;
@Override
public void flatMap(Tuple2<Long, Long> input, Collector<Tuple2<Long, Long>> out) throws Exception {
// access the state value
Tuple2<Long, Long> currentSum = sum.value();
if (currentSum == null){
currentSum = new Tuple2<>(0L, 0L);
}
// update the count
currentSum.f0 += 1;
// add the second field of the input value
currentSum.f1 += input.f1;
// update the state
sum.update(currentSum);
// if the count reaches 2, emit the average and clear the state
if (currentSum.f0 >= 2) {
out.collect(new Tuple2<>(input.f0, currentSum.f1 / currentSum.f0));
sum.clear();
}
}
@Override
public void open(Configuration config) {
ValueStateDescriptor<Tuple2<Long, Long>> descriptor =
new ValueStateDescriptor<>(
"average", // the state name
TypeInformation.of(new TypeHint<Tuple2<Long, Long>>() {
}));
sum = getRuntimeContext().getState(descriptor);
// ListStateDescriptor<Tuple2<Long, Long>> listDescriptor =
// new ListStateDescriptor<>(
// "list", // the state name
// TypeInformation.of(new TypeHint<Tuple2<Long, Long>>() {
// }));
//listState = getRuntimeContext().getListState(listDescriptor);
}
}
| [
"2284872818@qq.com"
] | 2284872818@qq.com |
49ce1255de39ed93aaad9b85bb86cc3a40d1e3e5 | 157154dcf5685e7897a4caf38f7de1a797dfda5f | /between.java | 491cca20a88cdbf494ecff30b959ae8196e0f37e | [] | no_license | Pockets567/-Go-hear--for-homeowrk-100--no-virus- | a5570d24148fd4b163686562ac8b88c3e0265e6b | c0b3836b674afb7a308554c6f2bc3c0864cf3dc6 | refs/heads/master | 2020-08-01T07:13:09.223713 | 2019-09-25T18:16:54 | 2019-09-25T18:16:54 | 210,910,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | import java.util.Scanner;
public class between
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int a;
System.out.println("type in a number between 15 and 23");
a=keyboard.nextInt();
if(a>=15 && a<=23)
{
System.out.println("you got it");
}
else
{
System.out.println("no");
}
}
} | [
"54328137+Pockets567@users.noreply.github.com"
] | 54328137+Pockets567@users.noreply.github.com |
fadfedff035925ccdc0df249a5788f9df46b6ac5 | eb67f13cac083233c8374b646a9510572cc2e14f | /src/main/java/com/apihome/spider/ued/task/impl/ChinaUINewsTaskImpl.java | 231d9e45ff9e1d11b35e1255eb1e270be8d49a24 | [] | no_license | jrjr200411/apihome | 9e71864b57db8542b8f3ce6117fb99190030b4ae | 6826b6dbf98d8c3eb949d186c410a1062745bad8 | refs/heads/master | 2021-01-15T18:31:57.750446 | 2013-06-22T06:09:23 | 2013-06-22T06:09:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,276 | java | package com.apihome.spider.ued.task.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.apihome.dao.ued.UcdDAO;
import com.apihome.spider.ued.commons.HttpClientFactory;
import com.apihome.spider.ued.task.DiscardSpiderTask;
/**
* @ClassName: ChinaUINewsTaskImpl
* @Description: TODO(这里用一句话描述这个类的作用)
* @author david.wang
* @date 2013-1-3 上午1:08:36
* @version 1.0
*/
@Component("chinaUINewsTaskImpl")
public class ChinaUINewsTaskImpl implements DiscardSpiderTask
{
protected static Log logger = LogFactory.getLog(ChinaUINewsTaskImpl.class);
private static final String APPLICATION_JSON = "application/json";
@Autowired
private UcdDAO ucdDAO;
/**
* 1、针对chinaUI中文章的特点进行穷举
* 2、解析网页结构,存储必要的字段t_ued_topic
*/
@Override
public void spiderHtml(String url)
{
try
{
HttpClient client = HttpClientFactory.getHttpClient();
HttpPost post = new HttpPost(url);
post.addHeader(org.apache.http.protocol.HTTP.CONTENT_TYPE,
APPLICATION_JSON);
String encoderJson = "{\"dataListInfo\":{\"ID\":\"DataList\",\"ParentID\":\"DataListParent\",\"TypeName\":\"Vxun.BM.NES.NewsInfo\",\"Properties\":[\"PageUrl\",\"Title\",\"ReleaseDate\",\"BrowseNumber\",\"CommentNumber\",\"Text\",\"CategoryName\",\"Tags\",\"CategoryID\"],\"Sortable\":null,\"Titles\":null,\"Display\":[0,0,6,0,0,0,0,0],\"TextAligns\":null,\"MaxLenth\":[0,50,0,0,0,0,0,0],\"PaginalNumber\":10,\"RecordCount\":8758,\"TotalPageNumber\":876,\"PageNumber\":2,\"Constraint\":\"[Used]=@V0 AND [IsFinish]=@V1\",\"Compositor\":\"[IsTop] DESC, [ReleaseDate] DESC,[ID] DESC\",\"Values\":[true,true],\"Content\":null,\"Entities\":null,\"ActionID\":\"ID\",\"ActionNames\":null,\"CanSelect\":false,\"CanDbClick\":false,\"BottomDisplay\":true,\"CellNumber\":0,\"SpareImg\":null,\"AccID\":\"0\",\"ListType\":2,\"CategoryID\":null,\"MethodID\":null,\"ColorID\":null,\"IsDeep\":false,\"IsLight\":false,"
+ "\"BrowseID\":null,\"Step\":0}}";
Map<String, Object> map = readJson2Map(encoderJson);
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
// 增加其他的参数
Set<String> set = map.keySet();
for (String string : set)
{
nvps.add(new BasicNameValuePair(string, (String) map.get(string)));
}
//http://www.iteye.com/problems/9067
post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
HttpResponse response = client.execute(post);
HttpEntity entity = response.getEntity();
String content = EntityUtils.toString(entity, "UTF-8");
post.abort();// 释放链接
} catch (Exception e) {
logger.error("解析" + url + "出错:", e);
}
}
@Override
public String queryLastEndNode() {
return ucdDAO.queryLastEndNode(this.getClass().getName());
}
public static void main(String[] agrs)
{
String url = "http://www.chinaui.com/ajaxpro/Vxun.BL.DataList,Vxun.BL.ashx";
new ChinaUINewsTaskImpl().spiderHtml(url);
}
public Map<String, Object> readJson2Map(String json)
{
ObjectMapper objectMapper = new ObjectMapper();
try {
return objectMapper.readValue(json, Map.class);
// System.out.println(maps.size());
// Set<String> key = maps.keySet();
// Iterator<String> iter = key.iterator();
// while (iter.hasNext()) {
// String field = iter.next();
// System.out.println(field + ":" + maps.get(field));
// }
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}
| [
"123363975@qq.com"
] | 123363975@qq.com |
80b8ed7e191102fafd09c0c1dd681f804af6feae | e6b6d53ccb98f813c0901ddd50e053024541948c | /src/core/java/net/dbaeye/dao/support/sql/Select.java | 6513445f9df43ac80c2545b1257f1ae6b36db487 | [] | no_license | oscar810429/spring-jdbc-framework | 7d7876282568a7c256d3a75829d29ace286a3b7c | 2ecb689383b2cca8e2021c69aed1945b7896bf47 | refs/heads/master | 2020-05-22T17:31:41.963873 | 2018-12-12T08:34:37 | 2018-12-12T08:34:37 | 24,257,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,236 | java | /**
* @(#)SQLSelect.java Apr 05, 2012
*
* Copyright 2012 Net365. All rights reserved.
*/
package net.dbaeye.dao.support.sql;
/**
* <p>
* <a href="SQLSelect.java.html"><i>View Source</i></a>
* </p>
*
* @author Zhang Songfu
* @version $Id: Select.java 29 2012-04-06 10:18:35Z zhangsongfu $
*/
public class Select {
//~ Static fields/initializers =============================================
//~ Instance fields ========================================================
private Column[] columns;
private From from;
private Condition condition;
private OrderBy orderBy;
private Limit limit;
//~ Constructors ===========================================================
public Select(Column[] columns) {
this.columns = columns;
}
//~ Methods ================================================================
public Select from(From from) {
this.from = from;
return this;
}
public Select where(String condition) {
this.condition = new Condition(condition);
return this;
}
public Select orderBy(OrderBy orderBy) {
this.orderBy = orderBy;
return this;
}
public Select limit(int offset, int limit) {
if (offset != -1 && limit != -1) {
this.limit = new Limit(offset, limit);
}
return this;
}
public String toSQL() {
StringBuilder sb = new StringBuilder();
sb.append("SELECT ");
for (int i = 0; i < columns.length; i++) {
Column column = columns[i];
sb.append(column.toSQL());
if (column.getAlias() != null) {
sb.append(" AS ").append(column.getAlias());
}
if (i < columns.length - 1) {
sb.append(", ");
}
}
sb.append(" FROM ").append(from.toSQL());
sb.append(" WHERE ").append(condition.toSQL());
if (orderBy != null) {
sb.append(" ORDER BY ").append(orderBy.toSQL());
}
if (limit != null) {
sb.append(" LIMIT ?, ?");
}
return sb.toString();
}
public String toCountSQL() {
StringBuilder sb = new StringBuilder();
sb.append("SELECT COUNT(*) FROM ");
sb.append(from.toSQL());
sb.append(" WHERE ").append(condition.toSQL());
return sb.toString();
}
//~ Accessors ==============================================================
/**
* @return the limit
*/
public Limit getLimit() {
return limit;
}
}
| [
"zhangsongfu@192.168.41.121"
] | zhangsongfu@192.168.41.121 |
03c6ea16e9930e79e6929f6909c26f12aee59645 | 4f43480c8c9f3dd3d1a6faeab78df946abbff124 | /apu-robot/src/br/ibm/bsope/main/java/model/IProvince.java | 5d17e644a3ec027eec0779d1fa129578637f61d7 | [
"Apache-2.0"
] | permissive | sidneydemoraes/APU-Robot | 3fec1264022b57d51024952c9e8ba03fc22205dd | ba05d356c237be672957ce9dd334ddaa544054d2 | refs/heads/master | 2021-01-10T03:51:31.509480 | 2015-12-16T21:59:11 | 2015-12-16T21:59:11 | 44,198,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 198 | java | package br.ibm.bsope.main.java.model;
public interface IProvince {
public String getProvinceAcronym();
public String getCanadaTaxOption();
public String getApplicableTaxRegistration();
}
| [
"smcoelhobr@gmail.com"
] | smcoelhobr@gmail.com |
6f370e6bc21124b3f2b5fb7fe321af377a2d50fa | d593ad37a82a6396effceaf11679e70fddcabc06 | /winapi/src/andexam/ver4_1/c13_advwidget/RatingBarTest.java | 0189499cdad8420d00f1a278cae321baf4350255 | [] | no_license | psh667/android | 8a18ea22c8c977852ba2cd9361a8489586e06f05 | 8f7394de8e26ce5106d9828cf95eb1617afca757 | refs/heads/master | 2018-12-27T23:30:46.988404 | 2013-09-09T13:16:46 | 2013-09-09T13:16:46 | 12,700,292 | 3 | 5 | null | null | null | null | UTF-8 | Java | false | false | 726 | java | package andexam.ver4_1.c13_advwidget;
import andexam.ver4_1.*;
import android.app.*;
import android.os.*;
import android.widget.*;
public class RatingBarTest extends Activity {
RatingBar mRating;
TextView mRateText;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ratingbartest);
mRating = (RatingBar)findViewById(R.id.ratingbar);
mRateText = (TextView)findViewById(R.id.ratetext);
mRating.setOnRatingBarChangeListener(new
RatingBar.OnRatingBarChangeListener() {
public void onRatingChanged(RatingBar ratingBar, float rating,
boolean fromUser) {
mRateText.setText("Now Rate : " + rating);
}
});
}
} | [
"paksan@daum.net"
] | paksan@daum.net |
75d81dd7a95279e1fe6f7948ac72a5216592c3fb | cd6ecd30989f4177761ad9908b976f816a377218 | /src/main/java/UniqueSlidingWindow.java | debbd27c55659607fc95b1745486f2a9b0944769 | [] | no_license | ajayroopal/mysoln | 5ba7eb395598f4f643ff8a2c09ce7d52c388c596 | 72561e71a361eb00508efe45ec6393e6f8631b67 | refs/heads/master | 2020-06-09T08:26:00.099698 | 2019-06-24T01:04:25 | 2019-06-24T01:04:25 | 193,408,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,077 | java | import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
public class UniqueSlidingWindow {
public int returnMaxUnique(int[] arr, int k) {
int unique = 0;
Queue<Integer> q = new LinkedList<Integer>();
for (int i = 0; i < arr.length; i++) {
if (q.size() < k) {
if (!q.contains(arr[i])) {
unique++;
}
q.offer(arr[i]);
} else {
int remove = q.poll();
if (!q.contains(remove)) {
unique--;
}
if (!q.contains(arr[i])) {
unique++;
}
q.offer(arr[i]);
}
if (q.size() == k) {
if (unique == k) {
return unique;
}
}
}
return unique;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = in.nextInt();
}
UniqueSlidingWindow usw = new UniqueSlidingWindow();
int num = usw.returnMaxUnique(arr, m);
System.out.println (num);
}
}
| [
"ajayara11@yahoo.com"
] | ajayara11@yahoo.com |
a7416767b197cf800fbcc037d6992a70e5abadef | 72f3f199aea7e5acacda92b43bc9d91ab000f9ef | /Suit.java | 3129ef16f7d9f04e4149c563b074eb614dab78ba | [] | no_license | krla241/BridgeGame-Lab | dc6cf8ea071f7897a7dee25ba7b278f0ae032678 | 60d930bde1e4a7478a804e5db70a7f7d6104dd72 | refs/heads/master | 2020-06-17T09:20:13.604474 | 2019-07-08T22:58:26 | 2019-07-08T22:58:26 | 195,878,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,300 | java | import java.util.ArrayList;
public class Suit
{
private ArrayList<Card>cards;
private String suitStr;
private final int MIN_LONG=1;
private final int VOID_POINTS=3;
private final int SINGLETON_POINTS=2;
private final int DOUBLETON_POINTS=1;
public Suit(String suitStr) //name of suite
{
this.cards=new ArrayList<Card>(); //instantiates with default array list constructor
this.suitStr=suitStr; //sets to value
}
public void addCard(char face)
{
//creates appropriate card object (card with number or card with figure)and adds it to the list
if(face<=57 && face >=50)
{
CardWithNumber number=new CardWithNumber(face);
this.cards.add(number);
}
else
{
CardWithFigure figure=new CardWithFigure(face);
this.cards.add(figure);
}
}
public void printSuit()
{
System.out.print(this.suitStr + ": ");
for( Card c: this.cards){
System.out.print(c.toString());
}
System.out.println();
}
public int suitPoints()
{
int points=0;
for(Card c: this.cards)
{
if(c instanceof CardWithFigure){
points += c.getPoints();}
else if(c instanceof CardWithNumber){
points +=c.getPoints();
}
}
return points;
}
}
| [
"karla.sosa241@myci.csuci.edu"
] | karla.sosa241@myci.csuci.edu |
f4b153ed0de251f5f105159dc5d5d5f6b219240f | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13544-62-27-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/ActionFilter_ESTest_scaffolding.java | 94b125983b778eb15a34ca9fa0e499d569e86233 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Jan 20 01:42:38 UTC 2020
*/
package com.xpn.xwiki.web;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class ActionFilter_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
3d7c0761cdd90b89678d62dd20bd8b7175a74848 | 5e0b56df883f87bcb78059c5a86f3a4409c65893 | /src/main/java/com/agendapersonal/demomiagendapersonal/model/Contacto.java | aa897246a3ea37a47bce667ec0cd122581515885 | [] | no_license | MarielozCL/pruebaAgendapersonal | a792ee80200c4c8b74aecfa5d50e133945c0b9b3 | 6a62ac2bfe4c4816da7151ecb914f962609d0a17 | refs/heads/main | 2023-09-02T13:20:56.468485 | 2021-11-05T00:50:07 | 2021-11-05T00:50:07 | 424,785,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package com.agendapersonal.demomiagendapersonal.model;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data
@Entity
public class Contacto {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer idcontacto;
@NotBlank
private String nombrecontacto;
@NotBlank
private String telefono;
@NotBlank
private String celular;
@NotNull
@Email
private String email;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
@NotNull
private LocalDateTime citas;
@NotBlank
private String tipocontacto;
@NotBlank
private String direccion;
}
| [
"marycalonalopez@gmail.com"
] | marycalonalopez@gmail.com |
d020c1f36b099b2f1113b3671e50b322de8cd93e | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project81/src/test/java/org/gradle/test/performance81_3/Test81_286.java | faac3a504bc8d943eab67afad2d0e96cf9591715 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance81_3;
import static org.junit.Assert.*;
public class Test81_286 {
private final Production81_286 production = new Production81_286("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
3aab733b47bf3272db48f635c7047d7e41d5d584 | e97533176509041785486302c97a4722fae61441 | /src/TryingHomework/HW166MethodsWithString1MergeThem.java | b19d27aa95d4ce1311d14367736a0f8c4c3e9170 | [] | no_license | ejalilova/Java-Practice | ce05fa36db4ff15964ad591386a479ef6023d010 | 17492b2ab3ae9c31e8a1d52f8e2488d32c96bc91 | refs/heads/master | 2020-05-18T10:18:16.058544 | 2019-06-11T18:37:23 | 2019-06-11T18:37:23 | 184,348,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package TryingHomework;
public class HW166MethodsWithString1MergeThem {
public static void main(String[] args) {
// String ymp = "13579";
// System.out.println(ymp.substring(3));
System.out.println(mergeStrings("1357","246"));
}
public static String mergeStrings(String one, String two) {
String str = "";
int len = 0;
if (one.length() >= two.length()) {
len = one.length();
} else
len = two.length();
for (int i = 0; i < len; i++) {
if (i < one.length()) {
str += one.charAt(i);
}
if (i < two.length()) {
str += two.charAt(i);
}
}
return str;
}
} | [
"ejalilova@gmail.com"
] | ejalilova@gmail.com |
6076f328d7c16222c809fd447cc4e0af9fdba4ca | c93e909cfa8a5a0b1a4f5b82956a51e4f06c6303 | /Jabref_Beta_2_7_Docear/src/java/net/sf/jabref/imports/ImportInspector.java | 00e637a9ea4286a5189f5476fe81135061409e9f | [] | no_license | gaobrian/Desktop | 71088da71994660a536c2c29d6e1686dfd7f11a1 | 41fdbb021497eeb3bbfb963a9e388a50ee9777ef | refs/heads/master | 2023-01-13T05:13:46.814353 | 2014-10-29T05:54:50 | 2014-10-29T05:54:50 | 25,906,710 | 2 | 0 | null | 2022-12-26T18:11:07 | 2014-10-29T05:56:26 | Java | UTF-8 | Java | false | false | 1,110 | java | package net.sf.jabref.imports;
import net.sf.jabref.BibtexEntry;
/**
* An ImportInspector can be passed to a EntryFetcher and will receive entries
* as they are fetched from somewhere.
*
* Currently there are two implementations: ImportInspectionDialog and
* ImportInspectionCommandLine
*
*/
public interface ImportInspector {
/**
* Notify the ImportInspector about the progress of the operation.
*
* The Inspector for instance could display a progress bar with the given
* values.
*
* @param current
* A number that is related to the work already done.
*
* @param max
* A current estimate for the total amount of work to be done.
*/
void setProgress(int current, int max);
/**
* Add the given entry to the list of entries managed by the inspector.
*
* @param entry
* The entry to add.
*/
void addEntry(BibtexEntry entry);
/**
* If this is a graphical dialog, bring it to the front.
*/
void toFront();
} | [
"mueller@docear.org"
] | mueller@docear.org |
a6a7a65b158cf32e74a0165a3b8fe8b56a4c4546 | 1ba579387b06bfd01b42d9f8b43169e9cbea9a0e | /src/main/java/com/liuyq/jvm/proxy/Generator.java | 485506e93fe231146e41c84f4d7d351dffc71786 | [] | no_license | liuyq913/liuyq-java | 734ef0cf9276d4cc604f923215822354e6b2cd45 | 02cc96657ac615ad5d957254b670c7b804081e45 | refs/heads/master | 2022-12-01T14:35:54.725549 | 2022-11-08T11:53:02 | 2022-11-08T11:53:02 | 123,222,989 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,073 | java | package com.liuyq.jvm.proxy;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;
import java.io.File;
import java.io.FileOutputStream;
/**
* @author liuyuqing
* @className Generator
* @description
* @date 2022/6/30 3:13 下午
*/
public class Generator {
public static void main(String[] args) throws Exception {
//读取
ClassReader classReader = new ClassReader("com.liuyq.jvm.proxy/Base");
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);
//处理
ClassVisitor classVisitor = new MyClassVisitor(classWriter);
classReader.accept(classVisitor, ClassReader.SKIP_DEBUG);
byte[] data = classWriter.toByteArray();
//输出
File f = new File("/Users/sright/Documents/workspace/liuyq-java/target/classes/com/liuyq/jvm/asm/Base.class");
FileOutputStream fout = new FileOutputStream(f);
fout.write(data);
fout.close();
System.out.println("now generator cc success!!!!!");
}
}
| [
"liuyuqing@sright.com"
] | liuyuqing@sright.com |
93944e2b68a8f5ec252bbd17afcf430369a01a04 | 36df8bc36e49afe076a6ec83b7351f2624e30372 | /dactiv-orm/src/main/java/com/github/dactiv/orm/core/spring/data/jpa/restriction/support/LLikeRestriction.java | c00f423c591402ab878f1b407cb515766800d014 | [
"Apache-2.0"
] | permissive | makegoodsecret/base-framework | 61a69f2d162cab09bb376d86bc71690ebaa13d7d | 604b85ffde724d9bb0e97baab6c79724cf364a20 | refs/heads/master | 2021-01-18T08:14:31.121544 | 2017-04-01T06:46:41 | 2017-04-01T06:46:41 | 25,120,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | /*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.dactiv.orm.core.spring.data.jpa.restriction.support;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Path;
import javax.persistence.criteria.Predicate;
import com.github.dactiv.orm.core.RestrictionNames;
import com.github.dactiv.orm.core.spring.data.jpa.restriction.PredicateSingleValueSupport;
/**
* 左模糊约束 ( from object o where o.value like '%?') RestrictionName:LLIKE
* <p>
* 表达式:LLIKE属性类型_属性名称[_OR_属性名称...]
* </p>
*
* @author maurice
*
*/
public class LLikeRestriction extends PredicateSingleValueSupport{
/*
* (non-Javadoc)
* @see com.github.dactiv.orm.core.spring.data.jpa.PredicateBuilder#getRestrictionName()
*/
public String getRestrictionName() {
return RestrictionNames.LLIKE;
}
/*
* (non-Javadoc)
* @see com.github.dactiv.orm.core.spring.data.jpa.PredicateBuilder#build(javax.persistence.criteria.Path, java.lang.Object, javax.persistence.criteria.CriteriaBuilder)
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public Predicate build(Path expression, Object value,CriteriaBuilder builder) {
return builder.like(expression, "%" + value);
}
}
| [
"es.chenxiaobo@gmail.com"
] | es.chenxiaobo@gmail.com |
423b038dd7fa708dfa1800b4f4725865777fa983 | ecdcac7b28276516494706d763599e2bbaabf325 | /src/com/yth/JDBC上/jdbc4/preparedstatement/PreparedStatementQueryTest.java | 6520651487190f99097ed7b4b75960de52ba1f93 | [] | no_license | deleave/JDBC | 4f68b605b6f02dbad507965eb80a028992e855eb | f3b96e32f0808cc3b76b696e84e10f9da98de8b2 | refs/heads/master | 2023-04-22T12:44:36.990272 | 2021-05-13T15:34:02 | 2021-05-13T15:34:02 | 366,621,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,256 | java | package com.yth.JDBC上.jdbc4.preparedstatement;
import com.yth.JDBC上.jdbc2.bean.Customer;
import com.yth.JDBC上.jdbc2.bean.Order;
import com.yth.util.JDBCUtils;
import org.junit.Test;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName PreparedStatementQueryTest
* @Description 使用PreparedStatement实现对于不同表的通用查询操作
* @Author deleave
* @Date 2021/5/7 15:52
* @Version 1.0
**/
public class PreparedStatementQueryTest {
@Test
public void testgetForList(){
String sql="select id,name,email,birth from test.customers where id<?";
List<Customer> list = getForList(Customer.class, sql, 5);
list.forEach(System.out::println);
String sql1="select order_id orderId,order_name orderName,order_date orderDate from test.order where order_id>? ";
List<Order> list1 = getForList(Order.class, sql1, 1);
// 语义 list1.stream().forEach(order -> System.out.println(order));
list1.forEach(System.out::println);
}
public <T>List<T> getForList(Class<T> clazz,String sql,Object...args){
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn = JDBCUtils.getConnection();
ps = conn.prepareStatement(sql);
for (int i = 0; i < args.length; i++) {
ps.setObject(i + 1, args[i]);
}
rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
//获取列数
int columnCount = rsmd.getColumnCount();
//创建集合对象
ArrayList<T> list=new ArrayList<T>();
while (rs.next()) {
//通过反射获取泛型对象
T t = clazz.newInstance();
//给t对象属性赋值
for (int i = 0; i < columnCount; i++) {
//获取每个列的列值
Object columnValue = rs.getObject(i + 1);
//获取每个列的列名 getColumnName()
//获取列的别名 getColumnLabel() 无别名则取表名
String columnName = rsmd.getColumnLabel(i + 1);
//通过反射将对象指定名columnName的属性赋值为指定的值columnValue
Field field = clazz.getDeclaredField(columnName);
field.setAccessible(true);
field.set(t, columnValue);//确定赋值对象为order
}
list.add(t);
}
return list;
}catch (Exception e){
e.printStackTrace();
}finally {
JDBCUtils.closeResource(conn,ps,rs);
}
return null;
}
@Test
public void testGetInstance(){
//查询customers表中的数据
String sql="select id,name,email from test.customers where id=?";
Customer customer = getInstance(Customer.class, sql, 19);
System.out.println(customer);
//查询order表中的数据
String sql1="select order_id orderId,order_name orderName,order_date orderDate from test.order where order_id=? ";
Order order = getInstance(Order.class, sql1, 4);
System.out.println(order);
}
/*
*@ClassName PreparedStatementQueryTest
*@Description 使用PreparedStatement实现针对于不同表的通用查询操作,返回一条数据
*@Author deleave
*@Date 2021/5/7 16:13
*@Param [clazz, sql, args]
**/
public <T>T getInstance(Class<T> clazz,String sql,Object...args){
Connection conn=null;
PreparedStatement ps=null;
ResultSet rs=null;
try {
conn = JDBCUtils.getConnection();
ps = conn.prepareStatement(sql);
for (int i = 0; i < args.length; i++) {
ps.setObject(i + 1, args[i]);
}
rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
//获取列数
int columnCount = rsmd.getColumnCount();
if (rs.next()) {
//通过反射获取泛型对象
T t = clazz.newInstance();
for (int i = 0; i < columnCount; i++) {
//获取每个列的列值
Object columnValue = rs.getObject(i + 1);
//获取每个列的列名 getColumnName()
//获取列的别名 getColumnLabel() 无别名则取表名
String columnName = rsmd.getColumnLabel(i + 1);
//通过反射将对象指定名columnName的属性赋值为指定的值columnValue
Field field = clazz.getDeclaredField(columnName);
field.setAccessible(true);
field.set(t, columnValue);//确定赋值对象为order
}
return t;
}
}catch (Exception e){
e.printStackTrace();
}finally {
JDBCUtils.closeResource(conn,ps,rs);
}
return null;
}
}
| [
"echo@gmail.com"
] | echo@gmail.com |
fec002df08ded3c0af1ae8ec4f0b22ac80ec6b48 | 51934a954934c21cae6a8482a6f5e6c3b3bd5c5a | /output/9026729d15f1410a9065c8c7092f8295.java | 357f8aa6f6b397021b39b550d553cc7a7dade7d7 | [
"MIT",
"Apache-2.0"
] | permissive | comprakt/comprakt-fuzz-tests | e8c954d94b4f4615c856fd3108010011610a5f73 | c0082d105d7c54ad31ab4ea461c3b8319358eaaa | refs/heads/master | 2021-09-25T15:29:58.589346 | 2018-10-23T17:33:46 | 2018-10-23T17:33:46 | 154,370,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 44 | java | class HdFii73 {
}
class tgzwd1XxIvcV {
}
| [
"hello@philkrones.com"
] | hello@philkrones.com |
fa91bde037748b0c5acd57392185cc680f6daec3 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/com/huawei/hilink/framework/aidl/IHilinkService.java | 54fa2bf86e1154d2048003be496e60dc817d2a3e | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,114 | java | package com.huawei.hilink.framework.aidl;
import android.app.PendingIntent;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import com.huawei.hilink.framework.aidl.IConnectResultCallback;
import com.huawei.hilink.framework.aidl.IConnectionStateCallback;
import com.huawei.hilink.framework.aidl.IRequestHandler;
import com.huawei.hilink.framework.aidl.IResponseCallback;
import com.huawei.hilink.framework.aidl.IServiceFoundCallback;
public interface IHilinkService extends IInterface {
int call(CallRequest callRequest, IResponseCallback iResponseCallback) throws RemoteException;
int connect(ConnectRequest connectRequest, IConnectResultCallback iConnectResultCallback) throws RemoteException;
int discover(DiscoverRequest discoverRequest, IServiceFoundCallback iServiceFoundCallback) throws RemoteException;
int publishCanbeOffline(String str, String str2, PendingIntent pendingIntent) throws RemoteException;
int publishKeepOnline(String str, String str2, IRequestHandler iRequestHandler) throws RemoteException;
void registerConnectionStateCallback(IConnectionStateCallback iConnectionStateCallback) throws RemoteException;
int sendResponse(int i, String str, CallRequest callRequest) throws RemoteException;
void unpublish(String str) throws RemoteException;
void unregisterConnectionStateCallback(IConnectionStateCallback iConnectionStateCallback) throws RemoteException;
public static abstract class Stub extends Binder implements IHilinkService {
private static final String DESCRIPTOR = "com.huawei.hilink.framework.aidl.IHilinkService";
static final int TRANSACTION_call = 2;
static final int TRANSACTION_connect = 9;
static final int TRANSACTION_discover = 1;
static final int TRANSACTION_publishCanbeOffline = 4;
static final int TRANSACTION_publishKeepOnline = 3;
static final int TRANSACTION_registerConnectionStateCallback = 7;
static final int TRANSACTION_sendResponse = 6;
static final int TRANSACTION_unpublish = 5;
static final int TRANSACTION_unregisterConnectionStateCallback = 8;
public Stub() {
attachInterface(this, DESCRIPTOR);
}
public static IHilinkService asInterface(IBinder obj) {
if (obj == null) {
return null;
}
IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (iin == null || !(iin instanceof IHilinkService)) {
return new Proxy(obj);
}
return (IHilinkService) iin;
}
@Override // android.os.IInterface
public IBinder asBinder() {
return this;
}
@Override // android.os.Binder
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
DiscoverRequest _arg0;
CallRequest _arg02;
PendingIntent _arg2;
CallRequest _arg22;
ConnectRequest _arg03;
if (code != 1598968902) {
switch (code) {
case 1:
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg0 = DiscoverRequest.CREATOR.createFromParcel(data);
} else {
_arg0 = null;
}
int _result = discover(_arg0, IServiceFoundCallback.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
reply.writeInt(_result);
return true;
case 2:
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg02 = CallRequest.CREATOR.createFromParcel(data);
} else {
_arg02 = null;
}
int _result2 = call(_arg02, IResponseCallback.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
reply.writeInt(_result2);
return true;
case 3:
data.enforceInterface(DESCRIPTOR);
int _result3 = publishKeepOnline(data.readString(), data.readString(), IRequestHandler.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
reply.writeInt(_result3);
return true;
case 4:
data.enforceInterface(DESCRIPTOR);
String _arg04 = data.readString();
String _arg1 = data.readString();
if (data.readInt() != 0) {
_arg2 = (PendingIntent) PendingIntent.CREATOR.createFromParcel(data);
} else {
_arg2 = null;
}
int _result4 = publishCanbeOffline(_arg04, _arg1, _arg2);
reply.writeNoException();
reply.writeInt(_result4);
return true;
case 5:
data.enforceInterface(DESCRIPTOR);
unpublish(data.readString());
reply.writeNoException();
return true;
case 6:
data.enforceInterface(DESCRIPTOR);
int _arg05 = data.readInt();
String _arg12 = data.readString();
if (data.readInt() != 0) {
_arg22 = CallRequest.CREATOR.createFromParcel(data);
} else {
_arg22 = null;
}
int _result5 = sendResponse(_arg05, _arg12, _arg22);
reply.writeNoException();
reply.writeInt(_result5);
return true;
case 7:
data.enforceInterface(DESCRIPTOR);
registerConnectionStateCallback(IConnectionStateCallback.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
return true;
case 8:
data.enforceInterface(DESCRIPTOR);
unregisterConnectionStateCallback(IConnectionStateCallback.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
return true;
case 9:
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg03 = ConnectRequest.CREATOR.createFromParcel(data);
} else {
_arg03 = null;
}
int _result6 = connect(_arg03, IConnectResultCallback.Stub.asInterface(data.readStrongBinder()));
reply.writeNoException();
reply.writeInt(_result6);
return true;
default:
return super.onTransact(code, data, reply, flags);
}
} else {
reply.writeString(DESCRIPTOR);
return true;
}
}
/* access modifiers changed from: private */
public static class Proxy implements IHilinkService {
private IBinder mRemote;
Proxy(IBinder remote) {
this.mRemote = remote;
}
@Override // android.os.IInterface
public IBinder asBinder() {
return this.mRemote;
}
public String getInterfaceDescriptor() {
return Stub.DESCRIPTOR;
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int discover(DiscoverRequest request, IServiceFoundCallback callback) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (request != null) {
_data.writeInt(1);
request.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
this.mRemote.transact(1, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int call(CallRequest request, IResponseCallback callback) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (request != null) {
_data.writeInt(1);
request.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
this.mRemote.transact(2, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int publishKeepOnline(String serviceType, String serviceID, IRequestHandler requestHandler) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(serviceType);
_data.writeString(serviceID);
_data.writeStrongBinder(requestHandler != null ? requestHandler.asBinder() : null);
this.mRemote.transact(3, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int publishCanbeOffline(String serviceType, String serviceID, PendingIntent pendingIntent) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(serviceType);
_data.writeString(serviceID);
if (pendingIntent != null) {
_data.writeInt(1);
pendingIntent.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(4, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public void unpublish(String serviceID) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeString(serviceID);
this.mRemote.transact(5, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int sendResponse(int errorCode, String payload, CallRequest callRequest) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeInt(errorCode);
_data.writeString(payload);
if (callRequest != null) {
_data.writeInt(1);
callRequest.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(6, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public void registerConnectionStateCallback(IConnectionStateCallback callback) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
this.mRemote.transact(7, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public void unregisterConnectionStateCallback(IConnectionStateCallback callback) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
this.mRemote.transact(8, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override // com.huawei.hilink.framework.aidl.IHilinkService
public int connect(ConnectRequest request, IConnectResultCallback callback) throws RemoteException {
Parcel _data = Parcel.obtain();
Parcel _reply = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
if (request != null) {
_data.writeInt(1);
request.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
_data.writeStrongBinder(callback != null ? callback.asBinder() : null);
this.mRemote.transact(9, _data, _reply, 0);
_reply.readException();
return _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
}
}
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
c1049788b41a33dd731029498847fc9064081118 | f4b442e2e8ae44f58795dba793cba43c5944d97b | /app/src/main/java/protego/com/protegomaximus/KDDConnection.java | cea3fd0fb16d162a1547b5eb92a20841108606df | [] | no_license | liahos/ProtegoMaximus | 257f37eb7174141cbe692ce3d9d2ff83bca10ca6 | 1900a1e6ef0c3aa597bf21e2dbf924721a122e95 | refs/heads/master | 2021-01-18T00:43:32.244384 | 2015-01-28T20:04:04 | 2015-01-28T20:04:04 | 29,983,407 | 0 | 0 | null | 2015-01-28T19:09:16 | 2015-01-28T19:09:16 | null | UTF-8 | Java | false | false | 10,145 | java | package protego.com.protegomaximus;
/*
* Creates an object for the connection record with the KDD Cup '99 data set features.
* Of the 41 features in the KDD Cup '99 data set, features 10 to 22 have been removed as they
* are not related to smartphones. Hence, this object will contain 28 features.
*/
import java.io.File;
import java.io.FileWriter;
import java.util.Set;
public class KDDConnection {
// Features as described in the KDD Cup '99 Documentation
// List of features and descriptions at: http://www.sc.ehu.es/acwaldap/gureKddcup/README.pdf
// Intrinsic features
int duration = 0;
String protocol = null;
String service = null;
String flag = null;
int src_bytes = 0;
int dst_bytes = 0;
byte land = 0;
int wrong_fragment = 0;
int urgent = 0;
// Time traffic features
int count = 0;
int srv_count = 0;
double serror_rate = 0.00;
double srv_serror_rate = 0.00;
double rerror_rate = 0.00;
double srv_error_rate = 0.00;
double same_srv_rate = 0.00;
double diff_srv_rate = 0.00;
double srv_diff_host_rate = 0.00;
// Machine traffic features
int dst_host_count = 0;
int dst_host_srv_count = 0;
double dst_host_same_srv_rate = 0.00;
double dst_host_diff_srv_rate = 0.00;
double dst_host_same_src_port_rate = 0.00;
double dst_host_srv_diff_host_rate = 0.00;
double dst_host_serror_rate = 0.00;
double dst_host_srv_serror_rate = 0.00;
double dst_host_rerror_rate = 0.00;
double dst_host_srv_error_rate = 0.00;
private String convertRecord() {
return (this.duration
+ "," + this.protocol
+ ',' + this.service
+ ',' + this.flag
+ ',' + this.src_bytes
+ ',' + this.dst_bytes
+ ',' + this.land
+ ',' + this.wrong_fragment
+ ',' + this.urgent
+ ',' + this.count
+ ',' + this.srv_count
+ ',' + String.format("%.2f", this.serror_rate)
+ ',' + String.format("%.2f", this.srv_serror_rate)
+ ',' + String.format("%.2f", this.rerror_rate)
+ ',' + String.format("%.2f", this.srv_error_rate)
+ ',' + String.format("%.2f", this.same_srv_rate)
+ ',' + String.format("%.2f", this.diff_srv_rate)
+ ',' + String.format("%.2f", this.srv_diff_host_rate)
+ ',' + this.dst_host_count
+ ',' + this.dst_host_srv_count
+ ',' + String.format("%.2f", this.dst_host_same_srv_rate)
+ ',' + String.format("%.2f", this.dst_host_diff_srv_rate)
+ ',' + String.format("%.2f", this.dst_host_same_src_port_rate)
+ ',' + String.format("%.2f", this.dst_host_srv_diff_host_rate)
+ ',' + String.format("%.2f", this.dst_host_serror_rate)
+ ',' + String.format("%.2f", this.dst_host_srv_serror_rate)
+ ',' + String.format("%.2f", this.dst_host_rerror_rate)
+ ',' + String.format("%.2f", this.dst_host_srv_error_rate));
}
public static void writeToARFF(String filename, KDDConnection object) {
// Filename is the name of the ARFF file to which the connection record is to be appended.
try {
File file = new File(filename);
FileWriter writer = new FileWriter(file, true);
writer.write(object.convertRecord()+"\n");
writer.flush();
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
// Creates a connection
public static void createConnectionRecord(Set<DataFromLog> logData) {
KDDConnection newConn = new KDDConnection();
// TIMESTAMP is in milliseconds
newConn.duration = (int) ((GlobalVariables.endTime - GlobalVariables.startTime)/1000);
newConn.protocol = GlobalVariables.connProtocol;
newConn.service = GlobalVariables.connService;
newConn.flag = getFlag(newConn.protocol);
if (GlobalVariables.connSourceIP.equals(GlobalVariables.connDestIP) && GlobalVariables.connSourcePort == GlobalVariables.connDestPort) {
newConn.land = 1;
} else {
newConn.land = 0;
}
for (DataFromLog temp1: logData) {
newConn.src_bytes += (temp1.SRC_IP.equals(GlobalVariables.connSourceIP)) ? temp1.LENGTH : 0;
newConn.dst_bytes += (temp1.DEST_IP.equals(GlobalVariables.connSourceIP)) ? temp1.LENGTH : 0;
newConn.wrong_fragment += (temp1.CHECKSUM_DESC != null && temp1.CHECKSUM_DESC.equals("correct")) ? 0 : 1;
newConn.urgent += (temp1.FLAGS.URG) ? 1 : 0;
}
// Create ReducedKDDConnection object and pass & add to last100Conn and lastTwoSec
ReducedKDDConnection tempConn = new ReducedKDDConnection();
tempConn.TIMESTAMP = GlobalVariables.endTime;
tempConn.PROTOCOL = newConn.protocol;
tempConn.SERVICE = newConn.service;
tempConn.FLAG = newConn.flag;
tempConn.DEST_IP = GlobalVariables.connDestIP;
tempConn.SRC_PORT = GlobalVariables.connSourcePort;
tempConn.DEST_PORT = GlobalVariables.connDestPort;
newConn = PastConnQueue.calculateTrafficFeatures(tempConn, newConn, GlobalVariables.last100Conn);
newConn = LastTwoSecQueue.calculateTrafficFeatures(tempConn, newConn, GlobalVariables.lastTwoSec);
writeToARFF(ReadFile1.csvFile, newConn);
GlobalVariables.last100Conn.addConn(tempConn);
GlobalVariables.lastTwoSec.addConn(tempConn);
}
private static String getFlag (String protocol) {
// The flag is the state of the flag when the summary was written, ie when the connection terminated
// 1. http://www.takakura.com/Kyoto_data/BenchmarkData-Description-v3.pdf
// 2. https://www.bro.org/sphinx/_downloads/main20.bro
// {OTH,REJ,RSTO,RSTOS0,RSTR,S0,S1,S2,S3,SF,SH}
if (protocol.equals("tcp")) {
if (GlobalVariables.stateHistory.contains("r")) {
// Responder = TCP_RESET
if (GlobalVariables.stateHistory.length() != 1) {
// Has more than one character
String temp = GlobalVariables.stateHistory.split("r", 2)[0];
if (temp != null && temp.contains("S") // Originator = TCP_SYN_SENT
|| temp.contains("H") // Originator = TCP_SYN_ACK_SENT
|| temp.contains("R")) { // Originator = TCP_RESET
return "REJ";
}
}
else return "RSTR";
}
else if (GlobalVariables.stateHistory.contains("R")) {
if (GlobalVariables.stateHistory.length() != 1) {
String temp = GlobalVariables.stateHistory.split("R", 2)[1];
if (temp != null && !temp.contains("S") && !temp.contains("H") && !temp.contains("I")
&& !temp.contains("A") && !temp.contains("F") && !temp.contains("R")) {
// Originator sent a SYN followed by a RST, we never saw a SYN-ACK from the responder
return "RSTOS0";
}
}
else return "RSTO";
}
else if (GlobalVariables.stateHistory.contains("F") && GlobalVariables.stateHistory.contains("f")) {
// Originator = TCP_CLOSED and Responder = TCP_CLOSED
return "SF";
}
else if (GlobalVariables.stateHistory.contains("F")) {
// Originator = TCP_CLOSED (with finish bit)
if (GlobalVariables.stateHistory.length() != 1) {
String temp = GlobalVariables.stateHistory.split("F", 2)[1];
if (temp != null && !temp.contains("s") && !temp.contains("h") && !temp.contains("i")
&& !temp.contains("a") && !temp.contains("f") && !temp.contains("r")) {
// Responder didn't send reply after Originator sends FIN (half open connection)
return "SH";
}
}
else return "S2";
}
else if (GlobalVariables.stateHistory.contains("f")) {
// Responder = TCP_CLOSED
if (GlobalVariables.stateHistory.length() != 1) {
String temp = GlobalVariables.stateHistory.split("f", 2)[1];
if (temp != null && !temp.contains("S") && !temp.contains("H") && !temp.contains("I")
&& !temp.contains("A") && !temp.contains("F") && !temp.contains("R")) {
// Originator doesn't respond
return "S3";
}
}
else return "S3";
}
else if (GlobalVariables.stateHistory.contains("S")) {
if (GlobalVariables.stateHistory.length() != 1) {
String temp = GlobalVariables.stateHistory.split("S", 2)[1];
if (temp != null && !temp.contains("s") && !temp.contains("h") && !temp.contains("i")
&& !temp.contains("a") && !temp.contains("f") && !temp.contains("r")) {
// Originator = SYN_SENT and responder = TCP_INACTIVE
return "S0";
}
}
return "S0";
}
else if (GlobalVariables.stateHistory.contains("H") || GlobalVariables.stateHistory.contains("h")) {
// Originator = TCP_ESTABLISHED and responder = TCP_ESTABLISHED
return "S1";
}
else return "OTH";
}
else if (protocol.equals("udp") || protocol.equals("icmp")) {
// As these do not have flags, etc set, and every connection is considered established and terminated,
return "SF";
}
return "OTH";
}
} | [
"mukti.827@gmail.com"
] | mukti.827@gmail.com |
d95ec65802b5904f0897c916caa99a415d0f9d0d | 5148293c98b0a27aa223ea157441ac7fa9b5e7a3 | /Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd828.java | fbd8cad91d4d5fe29b431530b2dfd646c5143c28 | [] | no_license | ryosuke-ku/TestCodeSeacherPlus | cfd03a2858b67a05ecf17194213b7c02c5f2caff | d002a52251f5461598c7af73925b85a05cea85c6 | refs/heads/master | 2020-05-24T01:25:27.000821 | 2019-08-17T06:23:42 | 2019-08-17T06:23:42 | 187,005,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | // clone pairs:4472:70%
// 5598:beam/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/AfterProcessingTimeStateMachine.java
public class Nicad_t1_beam_2nd828
{
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AfterProcessingTimeStateMachine)) {
return false;
}
AfterProcessingTimeStateMachine that = (AfterProcessingTimeStateMachine) obj;
return Objects.equals(this.timestampMappers, that.timestampMappers);
}
} | [
"naist1020@gmail.com"
] | naist1020@gmail.com |
4a2545d3802f18679db5d0f15b9340c0c9f78e1e | 0bc2e5c44aa61207290d9d5a86105225399915c5 | /Assessment/src/com/ibm/Assessment/Application.java | dfbc9b36906860b24c6977099d0a65fe1cde0cff | [] | no_license | IBMRupak/day1 | 1920c496d1c56b4448f1dd2b841373b242b4d8f7 | 7f8bf6600a7904f3d1629fc353a48bae1da0207b | refs/heads/main | 2023-04-03T02:57:38.831428 | 2021-03-30T15:45:19 | 2021-03-30T15:45:19 | 345,996,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 202 | java | package com.ibm.Assessment;
public class Application {
public static void main(String[] args) {
Bug bug = new Bug(111,"Rohan","Compiler","error",BugStatus.Open,Priority.Urgent);
}
}
| [
"ibmjavanh20@iiht.tech"
] | ibmjavanh20@iiht.tech |
1979c3cdcb8b9aba8609143bf0154527915d2e26 | 8ffe119fece9c2f630ba912717071f6fb45aea1e | /app/src/main/java/com/ybj/myapplication/java/genericity/Banana.java | 87ed4535b50fb7652c7992d12ebd3e062c3015a3 | [] | no_license | AndGirl/Kotlin | fb8ebd0a4f48a6285fe813f6c69db85f36c2de35 | 00927776cd16a7dfaf7bbe6e5da14fdee61126ed | refs/heads/master | 2022-11-25T19:39:24.859213 | 2020-08-04T13:35:39 | 2020-08-04T13:35:39 | 274,060,819 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 201 | java | package com.ybj.myapplication.java.genericity;
/**
* Created by 杨阳洋 on 2020/6/23.
*/
public class Banana implements Fruit {
@Override
public float weight() {
return 1;
}
}
| [
"15390264297@163.com"
] | 15390264297@163.com |
a9ec5919577184f3d2a02d86237813bf5932648a | 6bfee90cc5225a225043bd1b59b5334495c70b11 | /src/main/java/com/test/campaingapi/controller/CampaignController.java | 9c6ede296c0cb93674688895fb913199a758fa76 | [] | no_license | renanpallin/spring-campaign-teams | ddd78f7fa145c2a508bd72aa3d2e68d429916141 | d96ec2ba8ce191fb923b3d03f323004b09a976bf | refs/heads/master | 2021-01-22T18:38:24.597492 | 2017-08-21T05:58:45 | 2017-08-21T05:58:45 | 100,760,141 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,298 | java | package com.test.campaingapi.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.test.campaingapi.model.Campaign;
import com.test.campaingapi.repository.CampaignRepository;
@RestController
@RequestMapping("/campaign")
public class CampaignController {
@Autowired
private CampaignRepository campaignRepository;
/**
* Show all the on going Campaigns
*/
@GetMapping
Iterable<Campaign> index() {
return campaignRepository.findOnGoingCampaigns();
}
/**
* Show a campaign by ID
* @param campaign
* @return
*/
@GetMapping("{campaign}")
ResponseEntity<Campaign> show(@PathVariable Campaign campaign) {
if (campaign == null)
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
return new ResponseEntity<>(campaign, HttpStatus.OK);
}
@PostMapping
Campaign save(@RequestBody Campaign campaign) {
List<Campaign> onGoingCampaignsByDate = campaignRepository.findOnGoingCampaignsByDate(campaign.getStart(),
campaign.getEnd());
int max = onGoingCampaignsByDate.size();
for (Campaign c : onGoingCampaignsByDate) {
c.addDayInTheEnd();
int i = 0;
while(i < max) {
Campaign anotherCampaign = onGoingCampaignsByDate.get(i);
if (anotherCampaign == c) {
i++;
continue;
}
if (c.getEnd().equals(campaign.getEnd()) || c.getEnd().equals(anotherCampaign.getEnd())) {
c.addDayInTheEnd();
i = 0;
} else {
i++;
}
}
}
campaignRepository.save(onGoingCampaignsByDate);
return campaignRepository.save(campaign);
}
/**
* Test method, use in develop only
*/
// @PostMapping("just-save")
// Campaign justSave(@RequestBody Campaign campaign) {
// return campaignRepository.save(campaign);
// }
/**
* Update a campaign.
* Obs: You can't update the start or end date
*
* @param campaign
* @param newCampaign
* @return
*/
@PutMapping("{campaign}")
ResponseEntity<Campaign> update(@PathVariable Campaign campaign, @RequestBody Campaign newCampaign) {
if (campaign == null)
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
if (newCampaign.getTeam() != null)
campaign.setTeam(newCampaign.getTeam());
if (newCampaign.getName() != null)
campaign.setName(newCampaign.getName());
return new ResponseEntity<Campaign>(campaignRepository.save(campaign), HttpStatus.OK);
}
/**
* Delete an campaign by ID
*
* @param campaign
* @return
*/
@DeleteMapping("{campaign}")
ResponseEntity<Campaign> destroy(@PathVariable Campaign campaign) {
if (campaign == null)
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
campaignRepository.delete(campaign);
return new ResponseEntity<>(campaign, HttpStatus.OK);
}
}
| [
"renanpallin@gmail.com"
] | renanpallin@gmail.com |
79951dae7972e4f191b2a9e287b22e1ad0cd87fa | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-12584-1-16-MOEAD-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/store/XWikiHibernateStore_ESTest_scaffolding.java | 8b257fa73eb795411005de8299250341d7eddf9b | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Apr 07 20:37:34 UTC 2020
*/
package com.xpn.xwiki.store;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class XWikiHibernateStore_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
cbe2bae0566a82d33d6edf6586ce43d24a4f85d2 | 2a45fd01e2e9dc7e9c5b9e509eb0815a5acf3e71 | /MediaMonitoringApp/app/src/main/java/com/academy/ndvalkov/mediamonitoringapp/common/events/main/UpdateSummaryEvent.java | 8a1e9393b237f92b633aad0c9de9aeebd1e35126 | [
"MIT"
] | permissive | ndvalkov/Android-Course-Project | 8ff0471c420fad563b84392be74c8c59c76fff95 | 96cce329ada1e0cee80bd5cf1457141d01275c28 | refs/heads/master | 2021-07-11T04:56:09.505488 | 2017-10-13T13:44:16 | 2017-10-13T13:44:16 | 104,304,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 342 | java | package com.academy.ndvalkov.mediamonitoringapp.common.events.main;
/**
* An event object that will be passed as a result to
* the subscribed methods from other classes and threads.
*/
public class UpdateSummaryEvent {
public final boolean update;
public UpdateSummaryEvent(boolean update) {
this.update = update;
}
} | [
"ndvalkov@abv.bg"
] | ndvalkov@abv.bg |
2750fc1b8dd8f15b6476aa419f501e2a3869b264 | 8810972d0375c0a853e3a66bd015993932be9fad | /modelicaml/kepler/org.openmodelica.modelicaml.validation/src/org/openmodelica/modelicaml/validation/rules/classes/C45_FinalStateHaveNoOutgoingTransitionsConstrainst.java | 8c966638a3d152991cac155735cd6a7e4a6b476e | [] | no_license | OpenModelica/MDT | 275ffe4c61162a5292d614cd65eb6c88dc58b9d3 | 9ffbe27b99e729114ea9a4b4dac4816375c23794 | refs/heads/master | 2020-09-14T03:35:05.384414 | 2019-11-27T22:35:04 | 2019-11-27T23:08:29 | 222,999,464 | 3 | 2 | null | 2019-11-27T23:08:31 | 2019-11-20T18:15:27 | Java | WINDOWS-1252 | Java | false | false | 2,947 | java | /*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
* c/o Linköpings universitet, Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
* THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR
* THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
* OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE.
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from OSMC, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
*
* This program is distributed WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH
* IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.
*
* See the full OSMC Public License conditions for more details.
*
* Main author: Wladimir Schamai, EADS Innovation Works / Linköping University, 2009-2013
*
* Contributors:
* Uwe Pohlmann, University of Paderborn 2009-2010, contribution to the Modelica code generation for state machine behavior, contribution to Papyrus GUI adaptations
*/
package org.openmodelica.modelicaml.validation.rules.classes;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.validation.AbstractModelConstraint;
import org.eclipse.emf.validation.EMFEventType;
import org.eclipse.emf.validation.IValidationContext;
import org.eclipse.uml2.uml.FinalState;
import org.openmodelica.modelicaml.common.constants.Constants;
/**
* State Machines
*
* C45:
* Rule : Final State may not have outgoing transitions..
*
* Severity : ERROR
*
* Mode : Batch
*/
public class C45_FinalStateHaveNoOutgoingTransitionsConstrainst extends AbstractModelConstraint {
public C45_FinalStateHaveNoOutgoingTransitionsConstrainst() {
}
/* (non-Javadoc)
* @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
*/
@Override
public IStatus validate(IValidationContext ctx) {
EObject eObj = ctx.getTarget();
EMFEventType eType = ctx.getEventType();
// In Batch Mode
if(eType == EMFEventType.NULL) {
if(eObj instanceof FinalState){
FinalState finalState = (FinalState) eObj;
if(finalState.getOutgoings().size() > 0){
return ctx.createFailureStatus(new Object[] {Constants.validationKeyWord_NOT_VALID
+ ": Final state may not have outgoing transitions"});
}
}
}
return ctx.createSuccessStatus();
}
}
| [
"wschamai"
] | wschamai |
268651bcd3662d911e53f752e30dbbc5dbb46e53 | 024265faf2e58312f45ead4c26ff537811a00a81 | /app/src/main/java/com/example/yazhai1226/androidtest/Observer/ObserverTest.java | cdf78840bcd3cc69864be394bd2fbcfc20a6f395 | [] | no_license | VincentLoveAndroid/AndroidTest | 28beccdb3b4d93320fffaa23ccda91350545336b | 36987dea257d4c646d9adab0ceab0891aff9bbc2 | refs/heads/master | 2021-01-13T08:40:17.943978 | 2016-11-18T04:19:12 | 2016-11-18T04:19:12 | 72,271,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 611 | java | package com.example.yazhai1226.androidtest.Observer;
/**
* Created by MingRen on 2016/8/30.
*/
public class ObserverTest {
public static void main(String args[]) {
MySubject subject = new MySubject();
Observer1 observer1 = new Observer1();
Observer2 observer2 = new Observer2();
subject.addObserver(observer1);
subject.addObserver(observer2);
subject.addObserver(observer2);//此时vector中有三个元素1,2,2
subject.update();
subject.removeObserver(observer2);//移除第一个2,集合中还有1,2
subject.update();
}
}
| [
"674928145@qq.com"
] | 674928145@qq.com |
55caac1145b87cbd8aa7ef590211b4135950b4a8 | fa4ca2265cba6a5c626e11c0134939cc85b26e71 | /notification-sending-system/src/main/java/com/example/javamvnspringbtblank/dao/NotificationDao.java | bf5cac310a5e4e6a71f7506de2bcfa7424d2de7e | [] | no_license | atkuzmanov/notification-system-kafka-evo | df9a5607b1f3652297e9109b659ed0e484530a54 | cb7c4ab650ccbdc729f3f9941b21c5cc74099e54 | refs/heads/main | 2023-02-02T10:44:08.799360 | 2020-12-22T08:37:21 | 2020-12-22T08:37:21 | 321,991,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 415 | java | package com.example.javamvnspringbtblank.dao;
import com.example.javamvnspringbtblank.model.BasicNotification;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
/**
* MySQL Database Data Access Object (DAO) CRUD (Create Read Update Delete) repository.
*/
@Repository
public interface NotificationDao extends CrudRepository<BasicNotification, Long> {
}
| [
"atkuzmanov@gmail.com"
] | atkuzmanov@gmail.com |
df15781c391d8444391ff7a1da67fe923b5e9848 | 0fb0fa04615616f50261a9b157b4c1a3eb81adee | /gmall-oms/src/main/java/com/atguigu/gmall/oms/entity/OrderItemEntity.java | 0d10e7bce3b54aa3c1e74d8dc94806012b14d1d7 | [
"Apache-2.0"
] | permissive | youaremyhoney/gmall | 56848394ecaef119496e3cbbccc04cb70ef24ede | fd6f86acbe266df89ff2b523acea0579454cda0f | refs/heads/master | 2022-12-14T11:09:33.526900 | 2019-11-15T00:45:45 | 2019-11-15T00:45:45 | 218,020,994 | 0 | 0 | Apache-2.0 | 2019-10-29T15:28:16 | 2019-10-28T10:25:39 | JavaScript | UTF-8 | Java | false | false | 3,091 | java | package com.atguigu.gmall.oms.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 订单项信息
*
* @author liuziqiang
* @email 525409941@qq.com
* @date 2019-10-28 20:26:14
*/
@ApiModel
@Data
@TableName("oms_order_item")
public class OrderItemEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
@ApiModelProperty(name = "id",value = "id")
private Long id;
/**
* order_id
*/
@ApiModelProperty(name = "orderId",value = "order_id")
private Long orderId;
/**
* order_sn
*/
@ApiModelProperty(name = "orderSn",value = "order_sn")
private String orderSn;
/**
* spu_id
*/
@ApiModelProperty(name = "spuId",value = "spu_id")
private Long spuId;
/**
* spu_name
*/
@ApiModelProperty(name = "spuName",value = "spu_name")
private String spuName;
/**
* spu_pic
*/
@ApiModelProperty(name = "spuPic",value = "spu_pic")
private String spuPic;
/**
* 品牌
*/
@ApiModelProperty(name = "spuBrand",value = "品牌")
private String spuBrand;
/**
* 商品分类id
*/
@ApiModelProperty(name = "categoryId",value = "商品分类id")
private Long categoryId;
/**
* 商品sku编号
*/
@ApiModelProperty(name = "skuId",value = "商品sku编号")
private Long skuId;
/**
* 商品sku名字
*/
@ApiModelProperty(name = "skuName",value = "商品sku名字")
private String skuName;
/**
* 商品sku图片
*/
@ApiModelProperty(name = "skuPic",value = "商品sku图片")
private String skuPic;
/**
* 商品sku价格
*/
@ApiModelProperty(name = "skuPrice",value = "商品sku价格")
private BigDecimal skuPrice;
/**
* 商品购买的数量
*/
@ApiModelProperty(name = "skuQuantity",value = "商品购买的数量")
private Integer skuQuantity;
/**
* 商品销售属性组合(JSON)
*/
@ApiModelProperty(name = "skuAttrsVals",value = "商品销售属性组合(JSON)")
private String skuAttrsVals;
/**
* 商品促销分解金额
*/
@ApiModelProperty(name = "promotionAmount",value = "商品促销分解金额")
private BigDecimal promotionAmount;
/**
* 优惠券优惠分解金额
*/
@ApiModelProperty(name = "couponAmount",value = "优惠券优惠分解金额")
private BigDecimal couponAmount;
/**
* 积分优惠分解金额
*/
@ApiModelProperty(name = "integrationAmount",value = "积分优惠分解金额")
private BigDecimal integrationAmount;
/**
* 该商品经过优惠后的分解金额
*/
@ApiModelProperty(name = "realAmount",value = "该商品经过优惠后的分解金额")
private BigDecimal realAmount;
/**
* 赠送积分
*/
@ApiModelProperty(name = "giftIntegration",value = "赠送积分")
private Integer giftIntegration;
/**
* 赠送成长值
*/
@ApiModelProperty(name = "giftGrowth",value = "赠送成长值")
private Integer giftGrowth;
}
| [
"525409941@qq.com"
] | 525409941@qq.com |
6452e7463d05961cb3f840388b7d63673455c12e | 52ab979d0f05be96d58803c328df4e67d6768c4d | /app/src/androidTest/java/adnandanny/paknews/ExampleInstrumentedTest.java | 43c11800a3f8c3675eecfcb643e9dc11c41edde5 | [] | no_license | Adnan7k/PakNews | c08e24f177628000f18485b706e7c91c035cc679 | 7c086f40ea1f1be7a9cd8ca9f94ab83143bd577e | refs/heads/master | 2021-07-19T12:43:46.026122 | 2017-10-27T09:08:37 | 2017-10-27T09:08:37 | 108,524,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | package adnandanny.paknews;
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("adnandanny.paknews", appContext.getPackageName());
}
}
| [
"adnandani7k@gmal.com"
] | adnandani7k@gmal.com |
aa43581c04482566f99e336c2e200538546b8f1e | 0f68807a666e283e63216235d0b0f4222cf66f69 | /eyetouch-seentao-be/iuap-pcomments-api/src/main/java/com/yonyou/pcomments/api/PcommentsQueryService.java | b12ea9193ff8d12be76a491a8cc382cb7d035c10 | [] | no_license | HiHaker/eyeTouch | 709e1a88fbe5d6f539c1d9bb8d926f9a945d33c5 | 752fd12221ce1c035e8ddc6a3514d2a8ee83289b | refs/heads/master | 2022-07-10T15:00:54.724060 | 2019-11-11T07:04:00 | 2019-11-11T07:04:00 | 207,545,728 | 1 | 0 | null | 2022-06-21T01:51:39 | 2019-09-10T11:52:02 | Java | UTF-8 | Java | false | false | 486 | java | package com.yonyou.pcomments.api;
import com.yonyou.pcomments.dto.PcommentsDTO;
import com.yonyou.iuap.ucf.common.rest.SearchParams;
import com.yonyou.cloud.middleware.rpc.RemoteCall;
import java.util.List;
/**
* RPC 调用接口声明
* @author
* @date 2019-10-2 20:07:08
*/
@RemoteCall("iuap-eyetouch-seentao-server")
public interface PcommentsQueryService {
/**
* 查询帖子评论列表
*/
List<PcommentsDTO> listPcomments(SearchParams searchParams);
}
| [
"hujianlongynu@163.com"
] | hujianlongynu@163.com |
2e56b0c80b419309ae6222bbe2b9f9809ef77b7b | 932480a6fa3d2e04d6fa0901c51ad14b9704430b | /jonix-onix3/src/main/java/com/tectonica/jonix/onix3/BibleTextOrganization.java | 03eed3f35bc20f49dc3bec67bc2986c26de0ae05 | [
"Apache-2.0"
] | permissive | hobbut/jonix | 952abda58a3e9817a57ae8232a4a62ab6b3cd50f | 0544feb4b1ac8fd7dfd52e34e3f84d46eae5749e | refs/heads/master | 2021-01-12T08:22:58.679531 | 2016-05-22T15:13:53 | 2016-05-22T15:13:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,111 | java | /*
* Copyright (C) 2012 Zach Melamed
*
* Latest version available online at https://github.com/zach-m/jonix
* Contact me at zach@tectonica.co.il
*
* 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.tectonica.jonix.onix3;
import java.io.Serializable;
import com.tectonica.jonix.JPU;
import com.tectonica.jonix.OnixElement;
import com.tectonica.jonix.codelist.BibleTextOrganizations;
import com.tectonica.jonix.codelist.RecordSourceTypes;
/*
* NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY
*/
/**
* <h1>Bible text organization</h1>
* <p>
* An ONIX code indicating the way in which the content of a Bible or selected Biblical text is organized, for example
* ‘Chronological’, ‘Chain reference’. Optional and non-repeating.
* </p>
* <table border='1' cellpadding='3'>
* <tr>
* <td>Format</td>
* <td>Fixed-length, three letters</td>
* </tr>
* <tr>
* <td>Codelist</td>
* <td>List 86</td>
* </tr>
* <tr>
* <td>Reference name</td>
* <td><BibleTextOrganization></td>
* </tr>
* <tr>
* <td>Short tag</td>
* <td><b355></td>
* </tr>
* <tr>
* <td>Cardinality</td>
* <td>0…1</td>
* </tr>
* <tr>
* <td>Example</td>
* <td><b355>CHA</b355> (Chain reference)</td>
* </tr>
* </table>
*/
public class BibleTextOrganization implements OnixElement, Serializable
{
private static final long serialVersionUID = 1L;
public static final String refname = "BibleTextOrganization";
public static final String shortname = "b355";
// ///////////////////////////////////////////////////////////////////////////////
// ATTRIBUTES
// ///////////////////////////////////////////////////////////////////////////////
/**
* (type: dt.DateOrDateTime)
*/
public String datestamp;
public RecordSourceTypes sourcetype;
public String sourcename;
// ///////////////////////////////////////////////////////////////////////////////
// VALUE MEMBER
// ///////////////////////////////////////////////////////////////////////////////
public BibleTextOrganizations value;
// ///////////////////////////////////////////////////////////////////////////////
// SERVICES
// ///////////////////////////////////////////////////////////////////////////////
public BibleTextOrganization()
{}
public BibleTextOrganization(org.w3c.dom.Element element)
{
datestamp = JPU.getAttribute(element, "datestamp");
sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype"));
sourcename = JPU.getAttribute(element, "sourcename");
value = BibleTextOrganizations.byCode(JPU.getContentAsString(element));
}
}
| [
"zach@tectonica.co.il"
] | zach@tectonica.co.il |
3fef685a01e7defa4e3e3a50325dd13a4ef442b1 | fe2633b35a882f094fd4dd77e680127096821a62 | /src/main/java/com/audio/DAO/PayDAO.java | 315a72913d8a917695b0e6f3a87546f99b5d208c | [] | no_license | jun1101/Test | 84e89bc1804e419d2d5c7b9789dd62839b30e342 | 3d96e6ec7c894f27d5ec171e040533a712ac5949 | refs/heads/master | 2022-02-07T06:17:23.293633 | 2022-01-05T06:36:56 | 2022-01-05T06:36:56 | 253,834,629 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.audio.DAO;
import com.audio.VO.PayVO;
import com.audio.VO.userVO;
public interface PayDAO {
public void insertPay(PayVO vo) throws Exception;
public int firstPayUpdate(userVO vo) throws Exception;
public int payUpdate(userVO vo) throws Exception;
}
| [
"ojh1489@gmail.com"
] | ojh1489@gmail.com |
6256209f9fc3c3dd38e2916f3e434e4d21800b76 | 9d271e07c8499a95845c0ba4a41820ec49afcfa9 | /colorpicker/src/main/java/com/konstantinidis/harry/colorpicker/slider/AlphaSlider.java | 95c849d25de330195ecd90fdd57e6650aa2ce4ee | [] | no_license | Harry1994/Solace | bda6b1f00acb65bee81da2942d2b3aa62441da78 | 360d8bc148f5673628a6e52e6d61a325f0dfedeb | refs/heads/master | 2020-04-08T13:24:15.471435 | 2018-11-27T19:32:30 | 2018-11-27T19:32:30 | 159,389,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,414 | java | package com.konstantinidis.harry.colorpicker.slider;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.util.AttributeSet;
import com.konstantinidis.harry.colorpicker.ColorPickerView;
import com.konstantinidis.harry.colorpicker.Utils;
import com.konstantinidis.harry.colorpicker.builder.PaintBuilder;
public class AlphaSlider extends AbsCustomSlider {
public int color;
private Paint alphaPatternPaint = PaintBuilder.newPaint().build();
private Paint barPaint = PaintBuilder.newPaint().build();
private Paint solid = PaintBuilder.newPaint().build();
private Paint clearingStroke = PaintBuilder.newPaint().color(0xffffffff).xPerMode(PorterDuff.Mode.CLEAR).build();
private ColorPickerView colorPicker;
public AlphaSlider(Context context) {
super(context);
}
public AlphaSlider(Context context, AttributeSet attrs) {
super(context, attrs);
}
public AlphaSlider(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void createBitmaps() {
super.createBitmaps();
alphaPatternPaint.setShader(PaintBuilder.createAlphaPatternShader(barHeight / 2));
}
@Override
protected void drawBar(Canvas barCanvas) {
int width = barCanvas.getWidth();
int height = barCanvas.getHeight();
barCanvas.drawRect(0, 0, width, height, alphaPatternPaint);
int l = Math.max(2, width / 256);
for (int x = 0; x <= width; x += l) {
float alpha = (float) x / (width - 1);
barPaint.setColor(color);
barPaint.setAlpha(Math.round(alpha * 255));
barCanvas.drawRect(x, 0, x + l, height, barPaint);
}
}
@Override
protected void onValueChanged(float value) {
if (colorPicker != null)
colorPicker.setAlphaValue(value);
}
@Override
protected void drawHandle(Canvas canvas, float x, float y) {
solid.setColor(color);
solid.setAlpha(Math.round(value * 255));
canvas.drawCircle(x, y, handleRadius, clearingStroke);
if (value < 1)
canvas.drawCircle(x, y, handleRadius * 0.75f, alphaPatternPaint);
canvas.drawCircle(x, y, handleRadius * 0.75f, solid);
}
public void setColorPicker(ColorPickerView colorPicker) {
this.colorPicker = colorPicker;
}
public void setColor(int color) {
this.color = color;
this.value = Utils.getAlphaPercent(color);
if (bar != null) {
updateBar();
invalidate();
}
}
} | [
"xkonstantinidis94@gmail.com"
] | xkonstantinidis94@gmail.com |
b88bdd4e5d94685839fa674241ca7cc04afbcde5 | aaf329ca081f14c512fdc44c4491b90e9955a68f | /app/src/main/java/com/android/mvp2/inject/scope/PerActivity.java | 7efbdd0933c625b11ef9391c67b3a2eb718d8c0e | [] | no_license | cacarun/MyMVPDemo2 | d253f46627c54d1425583386582581a412d9fb25 | 1cac0e655eeb9aefba66f30b1cb51a6eac2ca02e | refs/heads/master | 2023-04-16T03:19:44.859952 | 2016-06-28T13:06:52 | 2016-06-28T13:06:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 640 | java | package com.android.mvp2.inject.scope;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;
/**
* In Dagger, an unscoped component cannot depend on a scoped component. As
* {@link edu.com.app.injection.component.ApplicationComponent} is a scoped component ({@code @Singleton}, we create a custom
* scope to be used by all fragment components. Additionally, a component with a specific scope
* cannot have a sub component with the same scope.
*/
@Documented
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface PerActivity {
}
| [
"caijiawei@ebangshou.me"
] | caijiawei@ebangshou.me |
65c6df3dd18f583046f684238e7578f62efc7de3 | 6b82417de7921a176c21175fab70cf0ab6a73a16 | /src/main/java/com/moviestore/domain/Credit.java | 3c4db5b436ad9664a436bbe6ff37378dc844e527 | [
"MIT"
] | permissive | tanbinh123/movie-store-springboot-tutorial | 5239dd46be5ea761e5d042e6df58443648983ee8 | 49e89ad59dd0d52f92e5da480d7c0fff6260ac5f | refs/heads/master | 2023-03-18T08:09:27.660209 | 2017-12-20T22:41:24 | 2017-12-20T22:41:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package com.moviestore.domain;
public class Credit {
private String name;
private String role;
private boolean star;
public Credit(String name, String role, boolean star) {
super();
this.name = name;
this.role = role;
this.star = star;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public boolean isStar() {
return star;
}
public void setStar(boolean star) {
this.star = star;
}
}
| [
"igliop@gmail.com"
] | igliop@gmail.com |
65a091eb0ca2fe6811f56987f0ce9c2c12a6e3ac | 6e3ddabdb1c177c120e9d66dbdc7b9bb3f583b40 | /build/project/src/com/safeDelivery/service/UserService.java | 6ab9e5409a30591e9c0f67fc0859c3e2d268dbde | [] | no_license | MoiseGui/safeDelivery | 778f764e462294a7921ee79afad9e0db3d43862a | 530e3287e29aff0367f4a5ed3c4a4bb6a2b1fab9 | refs/heads/master | 2021-05-23T14:01:06.271465 | 2020-04-27T19:43:51 | 2020-04-27T19:43:51 | 253,325,665 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package com.safeDelivery.service;
import com.safeDelivery.model.User;
public interface UserService {
public long existByEmailAndPass(String email, String pass);
public User getUserByEmail(String email);
public User getUserById(long id);
public long addUser(User user);
public int disableUserByEmail(String email);
public int deleteUserByEmail(String email);
}
| [
"besto@Moïse-Gui"
] | besto@Moïse-Gui |
cbddf2f3c93cc72657e33692525fb25947ca0b1d | e9770dd1289d90ff19486f7b7de879a2cd4c5490 | /AnalizadorLexico/src/analizadorlexico/AnalizadorLexico.java | b4c54be1f3decdbf83350b04ddb89ef481a91f85 | [
"MIT"
] | permissive | Skullcachi/compiladores2-analizadorlexico | a2224d40518e9d99c472cbee25e63a33e1f284d2 | 9ff90d5af0c3622cf22bf1290037028aab440a96 | refs/heads/master | 2020-07-11T14:08:31.769154 | 2019-09-28T00:36:57 | 2019-09-28T00:36:57 | 204,562,990 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | 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 analizadorlexico;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author cachi
*/
public class AnalizadorLexico {
static String PATH = "C:/Users/cachi/OneDrive/Documents/NetBeansProjects/AnalizadorLexico/src/analizadorlexico/Yylex.flex";
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
GenerarLexer(PATH);
}
public static void GenerarLexer(String path){
File output = new File(path);
jflex.Main.generate(output);
}
public static boolean moveFile(String fileName)
{
boolean fileMoved = false;
File file = new File(fileName);
if (file.exists())
{
System.out.println("moving cup generated files to the correct path");
Path currentRelativePath = Paths.get("");
String newDir = currentRelativePath.toAbsolutePath().toString()
+ File.separator + "src" + File.separator
+ "analizadorlexico" + File.separator + file.getName();
if (file.renameTo(new File(newDir)))
{
System.out.println("the cup generated file has been moved successfully.");
fileMoved = true;
}
else
{
System.out.println("ERROR, the file could not be moved.");
}
}
else
{
System.out.println("File could not be found!");
}
return fileMoved;
}
}
| [
"molinasergio.delta@gmail.com"
] | molinasergio.delta@gmail.com |
f5091b42baa476399e5addbd96b85b3959f289f4 | 6acce890ffff72ffc56de6910274c506ddf77503 | /src/main/java/cliente/Empresa.java | d14731fff08eb87738db2ad6ace9096c5d2b8924 | [] | no_license | ProgramacionAvanzadaUJI/FactoryPatternEnumeraciones | f4d012df4c7b73447f9375954725972ebb57ce6d | d86c911a0a9d93d9e6373878aeac97b3ce777067 | refs/heads/master | 2023-04-03T06:09:02.137098 | 2023-03-29T08:42:16 | 2023-03-29T08:42:16 | 55,400,489 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package cliente;
import cliente.Cliente;
/**
* Created by oscar on 4/4/16.
*/
public class Empresa extends Cliente {
public Empresa(String nif, String nombre) {
super(nif, nombre);
}
}
| [
"oscar.belmonte@uji.es"
] | oscar.belmonte@uji.es |
e3be0cb550650b39489f0457538487008c773c32 | 47119d527d55e9adcb08a3a5834afe9a82dd2254 | /tools/apidocs/src/main/test/com/emc/difftests/ApiClassDiffTests.java | 1f1dd277feb564b6729b51c7827248d5fba8e385 | [] | no_license | chrisdail/coprhd-controller | 1c3ddf91bb840c66e4ece3d4b336a6df421b43e4 | 38a063c5620135a49013aae5e078aeb6534a5480 | refs/heads/master | 2020-12-03T10:42:22.520837 | 2015-06-08T15:24:36 | 2015-06-08T15:24:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,473 | java | package com.emc.difftests;
import com.emc.apidocs.differencing.DifferenceEngine;
import com.emc.apidocs.model.ApiClass;
import com.emc.apidocs.model.ApiField;
import com.emc.apidocs.model.ApiMethod;
import com.emc.apidocs.model.ChangeState;
import com.google.common.collect.Lists;
import java.util.Collections;
import java.util.List;
public class ApiClassDiffTests {
public static void main(String[] args) throws Exception {
List<ApiField> sequenceA = Lists.newArrayList(newField("A"),newField("B"),newField("P"),newField("C"));
List<ApiField> sequenceB = Lists.newArrayList(newField("A"),newField("B"),newField("E"),newField("D"),newField("C"));
List<ApiField> diffList = generateMergedList(sequenceA, sequenceB);
System.out.println("OUTPUT : ");
for (ApiField s : diffList) {
switch(s.changeState) {
case NOT_CHANGED:
System.out.print("- ");
break;
case REMOVED:
System.out.print("< ");
break;
case ADDED:
System.out.print("> ");
break;
}
System.out.println(s.name);
}
ApiClass apiClass = new ApiClass();
apiClass.fields = diffList;
System.out.println("CONTAINS CHANGES :"+containsChanges(apiClass));
}
/**
* For more information on the LCS algorithm, see http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
*/
private static int[][] computeLcs(List<ApiField> sequenceA, List<ApiField> sequenceB) {
int[][] lcs = new int[sequenceA.size()+1][sequenceB.size()+1];
for (int i = 0; i < sequenceA.size(); i++) {
for (int j = 0; j < sequenceB.size(); j++) {
if (sequenceA.get(i).compareTo(sequenceB.get(j)) == 0) {
lcs[i+1][j+1] = lcs[i][j] + 1;
} else {
lcs[i+1][j+1] = Math.max(lcs[i][j+1], lcs[i+1][j]);
}
}
}
return lcs;
}
/**
* Generates a merged list with changes
*/
public static List<ApiField> generateMergedList(List<ApiField> sequenceA, List<ApiField> sequenceB)
{
int[][] lcs = computeLcs(sequenceA, sequenceB);
List<ApiField> mergedFields = Lists.newArrayList();
int aPos = sequenceA.size();
int bPos = sequenceB.size();
while (aPos > 0 || bPos > 0) {
if (aPos > 0 && bPos > 0 && sequenceA.get(aPos-1).compareTo(sequenceB.get(bPos-1)) == 0) {
ApiField field = sequenceA.get(aPos - 1);
field.changeState = ChangeState.NOT_CHANGED;
mergedFields.add(field);
aPos--;
bPos--;
} else if (bPos > 0 && (aPos == 0 || lcs[aPos][bPos-1] >= lcs[aPos-1][bPos])) {
ApiField field = sequenceB.get(bPos - 1);
field.changeState = ChangeState.ADDED;
mergedFields.add(field);
bPos--;
} else {
ApiField field =sequenceA.get(aPos - 1);
field.changeState = ChangeState.REMOVED;
mergedFields.add(field);
aPos--;
}
}
// Backtracking generates the list from back to front,
// so reverse it to get front-to-back.
Collections.reverse(mergedFields);
return mergedFields;
}
/**
* @return Indicates if this class contains ANY changes (directly or within a fields type)
*/
public static boolean containsChanges(ApiClass apiClass) {
for (ApiField field : apiClass.fields) {
if (field.changeState != ChangeState.NOT_CHANGED) {
return true;
}
}
for (ApiField field : apiClass.fields) {
if (!field.isPrimitive()) {
boolean containsChanges = containsChanges(field.type);
if (containsChanges) {
return true;
}
}
}
return false;
}
private static ApiField newField(String name) {
ApiField field = new ApiField();
field.name = name;
field.primitiveType = "String";
return field;
}
}
| [
"review-coprhd@coprhd.org"
] | review-coprhd@coprhd.org |
afe8238a04995c7b70521396d2ac7629a9660446 | 2125628fcb7239534f5f30f88fe2641fd7e256c8 | /app/src/androidTest/java/top/isense/demo/testsensor/ApplicationTest.java | 489e49318781cafb0b38fea06dd2ee4bc3fa0fee | [] | no_license | rickf91/TestSensor | 49fee9feeb98572b00fce9b59b25c319f79b0ce8 | 060b12e0b3d75a21b40883d47f90a431e48632a1 | refs/heads/master | 2020-12-26T03:21:44.095185 | 2016-10-05T05:33:42 | 2016-10-05T05:33:42 | 68,783,852 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package top.isense.demo.testsensor;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"rickf91@sohu.com"
] | rickf91@sohu.com |
96639800d0fab7a5561de65f2c0a6d2bcff1cf8b | 70203300d489c97da1a444c18de6235bdb4a83ff | /src/DAOImpl/DAOBookImpl.java | 5c3a4db592dffe37d116385cf6a3e985a2e631c5 | [] | no_license | Pasha7520/LibrarySql | a0672483961d188cf79a1c9cb942977daff1c814 | 4f41d19ac5524033f7193d69e0e651374c441109 | refs/heads/master | 2020-03-15T18:38:12.791532 | 2018-05-05T22:15:05 | 2018-05-05T22:15:05 | 132,288,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,835 | java | package DAOImpl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import com.mysql.jdbc.PreparedStatement;
import entity.Author;
import entity.Book;
import entity.Customer;
import service.OrderService;
import serviceImpl.AuthorServiceImpl;
import serviceImpl.OrderServiceImpl;
import serviceImpl.RackServiceImpl;
import util.DataBaseUtil2;
import util.HibernateUtil;
import util.MathUtil;
import DAO.BaseDAO;
import DAO.BookDAO;
public class DAOBookImpl implements BaseDAO<Book>,BookDAO {
@Override
public Book getById(int Id) throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
List<Book> list = null;
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT b.* "+
" FROM book_author left join book b ON b.id = "
+ "book_author.book_id left join author a on book_author.author_id = a.id left join rack ON b.rack_id = rack.id left join department ON"
+ " rack.department_id = department.id where b.id =?;");
query.setParameter(0 , Id);
query.addEntity("b", Book.class);
list = query.list();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return list.get(0);
}
@Override
public boolean add(Book b) throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("INSERT INTO book (book_name,book_page,rack_id,availeble,price) VALUE (?,?,?,?,?);");
query.setParameter(0,b.getName());
query.setParameter(1,b.getPages());
RackServiceImpl rackService = new RackServiceImpl();
query.setParameter(2,rackService.findfreeRac());
query.setParameter(3,true);
query.setParameter(4,b.getPrice());
query.executeUpdate();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
AuthorServiceImpl authorServiceImpl = new AuthorServiceImpl();
authorServiceImpl.checkingOrWritingNewAuthor(b.getListAuthor());
bookAuthorWrite(b.getListAuthor());
return true;
}
@Override
public boolean delete(Book t) throws SQLException {
if(deleteBookAuthor(t.getId())){
Session session = HibernateUtil.getSessionFactory().openSession();
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("DELETE FROM book WHERE id =?");
query.setParameter(0,t.getId());
query.executeUpdate();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return true;
}
return false;
}
@Override
public List<Book> getAll() throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
List<Book> list = null;
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT DISTINCT b.* from book_author left join book b ON b.id = "
+ "book_author.book_id left join author a ON book_author.author_id = a.id left join rack ON b.rack_id = "
+ "rack.id left join department ON rack.department_id = department.id order by b.id;");
query.addEntity("b",Book.class);
list = query.list();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return list;
/*DataBaseUtil2.init();
List<Book> listbook = new ArrayList<Book>();
String query = "SELECT book.id,book.book_name,book.book_page,book.price,book.availeble,author.id author_id,author.author_name,rack.id rack_id from book_author left join book ON book.id = "
+ "book_author.book_id left join author on book_author.author_id = author.id left join rack ON book.rack_id = rack.id order by book.id";
PreparedStatement prepStat = (PreparedStatement) DataBaseUtil2.getConnection().prepareStatement(query);
ResultSet resultSetBook = prepStat.executeQuery();
int id = 0;
while(resultSetBook.next()){
if(id == resultSetBook.getInt("id")){
Author author = new Author();
author.setId(resultSetBook.getInt("author_id"));
author.setAuthorName(resultSetBook.getString("author_name"));
listbook.get(listbook.size()-1).addAuthor(author);
}
else{
Book book = new Book();
book.setId(resultSetBook.getInt("id"));
book.setName(resultSetBook.getString("book_name"));
book.setPages(resultSetBook.getInt("book_page"));
if(resultSetBook.getByte("availeble")==0){
book.setAvaileble(false);
}else{
book.setAvaileble(true);
}
book.setNumberRack(resultSetBook.getInt("rack_id"));
book.setPrice(resultSetBook.getDouble("price"));
Author author = new Author();
author.setId(resultSetBook.getInt("author_id"));
author.setAuthorName(resultSetBook.getString("author_name"));
book.addAuthor(author);
listbook.add(book);
}
id = resultSetBook.getInt("id");
}
resultSetBook.close();
prepStat.close();
return listbook;
*/
}
@Override
public void bookAuthorWrite(List<Author> listAuthor) throws SQLException {
int BookId = getMaxBookId();
Session session = HibernateUtil.getSessionFactory().openSession();
AuthorServiceImpl authorService = new AuthorServiceImpl();
listAuthor = authorService.findAuthorsId(listAuthor);
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("INSERT INTO book_author (book_id,author_id) VALUE (?,?);");
for(Author a:listAuthor){
query.setParameter(0,BookId);
query.setParameter(1,a.getId());
query.executeUpdate();
}
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
/////////
/* String query = "INSERT INTO book_author (book_id,author_id) VALUE (?,?);";
PreparedStatement prepStat = (PreparedStatement)DataBaseUtil2.getConnection().prepareStatement(query);
String maxId = "SELECT MAX(id) FROM book;";
PreparedStatement prepStatMax = (PreparedStatement)DataBaseUtil2.getConnection().prepareStatement(maxId);
ResultSet res = prepStatMax.executeQuery();
res.next();
int max = res.getInt(1);
AuthorServiceImpl authorService = new AuthorServiceImpl();
listAuthor = authorService.findAuthorsId(listAuthor);
for(Author a : listAuthor){
prepStat.setInt(1,max);
prepStat.setInt(2, a.getId());
prepStat.executeUpdate();
}
res.close();
prepStatMax.close();
prepStat.close();*/
}
public int getMaxBookId(){
Session session = HibernateUtil.getSessionFactory().openSession();
List<Integer> list = null;
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT MAX(id) FROM book;");
list = query.list();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return (int)list.get(0);
}
@Override
public void changeAvailebleBook(int id,boolean b) throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("UPDATE book SET availeble = ? WHERE id = ?;");
if(b){
byte br = 1;
query.setParameter(0,br);
}
else {
byte rr =0;
query.setParameter(0, rr);
}
query.setParameter(1,id);
query.executeUpdate();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
///////
/*DataBaseUtil2.init();
String queryBook = "UPDATE book SET availeble = ? WHERE id = ?;";
PreparedStatement prepStatBook = (PreparedStatement) DataBaseUtil2.getConnection().prepareStatement(queryBook);
if(b){
byte br = 1;
prepStatBook.setByte(1,br);
}
else {
byte rr =0;
prepStatBook.setByte(1, rr);
}
prepStatBook.setInt(2, id);
prepStatBook.executeUpdate();
prepStatBook.close();
*/
}
@Override
public int bookBelongDepartment(int bookId) throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
List<Integer> list = null;
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT department.id FROM book LEFT JOIN rack ON book.rack_id = rack.id LEFT JOIN "
+ "department ON rack.department_id = department.id where book.id =?;");
query.setParameter(0,bookId);
list = query.list();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
/*DataBaseUtil2.init();
String query = "SELECT department.id FROM book LEFT JOIN rack ON book.rack_id = rack.id LEFT JOIN "
+ "department ON rack.department_id = department.id where book.id = "+bookId+";";
PreparedStatement prepStatBook = (PreparedStatement) DataBaseUtil2.getConnection().prepareStatement(query);
ResultSet resultSet = prepStatBook.executeQuery();
resultSet.next();
int number = resultSet.getInt(1);
resultSet.close();
prepStatBook.close();*/
return (int)list.get(0);
}
@Override
public List<Book> getByName(String name)throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
List<Book> list = null;
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT b.*"+
" FROM book_author left join book b ON b.id = "
+ "book_author.book_id left join author a on book_author.author_id = a.id left join rack ON b.rack_id = rack.id left join department ON"
+ " rack.department_id = department.id where b.book_name =?;");
query.setParameter(0 , name);
query.addEntity("b",Book.class);
list = query.list();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return list;
////
/*DataBaseUtil2.init();
List<Book> listbook = new ArrayList<Book>();
String queryBook = "SELECT book.id,book.book_name,book.book_page,book.price,book.availeble,author.id author_id,author.author_name,rack.id rack_id from book_author left join book ON book.id = "
+ "book_author.book_id left join author on book_author.author_id = author.id left join rack ON book.rack_id = rack.id left join department ON"
+ " rack.department_id = department.id where book.book_name =?";
PreparedStatement prepStatBook = (PreparedStatement) DataBaseUtil2.getConnection().prepareStatement(queryBook);
prepStatBook.setString(1, name);
//DAOAuthorImpl daoAuthorImpl = new DAOAuthorImpl();
ResultSet resultSetBook = prepStatBook.executeQuery();
int id = 0;
while(resultSetBook.next()){
if(id == resultSetBook.getInt("id")){
Author author = new Author();
author.setId(resultSetBook.getInt("author_id"));
author.setAuthorName(resultSetBook.getString("author_name"));
listbook.get(listbook.size()-1).addAuthor(author);
}
else{
Book book = new Book();
book.setId(resultSetBook.getInt("id"));
book.setName(resultSetBook.getString("book_name"));
book.setPages(resultSetBook.getInt("book_page"));
if(resultSetBook.getByte("availeble")==0){
book.setAvaileble(false);
}else{
book.setAvaileble(true);
}
book.setNumberRack(resultSetBook.getInt("rack_id"));
book.setPrice(resultSetBook.getDouble("price"));
Author author = new Author();
author.setId(resultSetBook.getInt("author_id"));
author.setAuthorName(resultSetBook.getString("author_name"));
book.addAuthor(author);
listbook.add(book);
}
id = resultSetBook.getInt("id");
}
prepStatBook.close();
resultSetBook.close();
return listbook;*/
}
@Override
public boolean deleteBookAuthor(int id) throws SQLException {
Session session = HibernateUtil.getSessionFactory().openSession();
try{
session.beginTransaction();
SQLQuery query = session.createSQLQuery("DELETE FROM book_author WHERE book_id =?");
query.setParameter(0,id);
query.executeUpdate();
session.getTransaction().commit();
}catch(Exception e){
session.getTransaction().rollback();
e.printStackTrace();
}
finally{
session.close();
}
return true;
}
}
| [
"pasha.ganuliak@mail.ru"
] | pasha.ganuliak@mail.ru |
103ce98e25b9ec43f1098b939888d0ad8a2326d0 | 93dd4c645cc9da8be21157dccd47952779c234c7 | /JAVA_SE/20200109_Scanner类Random类ArrayList类/src/Scanner类/ScannnerDemo2_Max.java | d06f9fe96c9bc67cc58f061aac64057430a304f6 | [] | no_license | Shanshan-Shan/JavaPractice | 620fbaa878fe0574090cb7fea3868a547dbf6106 | a48a57065d9eb460d2d58d7249038619016db88c | refs/heads/master | 2020-08-27T23:14:50.197482 | 2020-05-12T14:16:31 | 2020-05-12T14:16:31 | 217,516,783 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 862 | java | package Scanner类;
import java.util.Scanner;
//键盘输入三个int数字,然后求出其中的最大值。
public class ScannnerDemo2_Max {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入第一个数字a:");
int a = sc.nextInt();
System.out.println("请输入第二个数字b:");
int b = sc.nextInt();
System.out.println("请输入第三个数字c:");
int c = sc.nextInt();
// int re = 0;
// if(a > b)
// re = a;
// else
// re = b;
//
// int max = 0;
// if(re > c)
// max = re;
// else
// max = c;
int temp = a > b ? a : b;
int max = temp > c ? temp : c;
System.out.println("三个数字中的最大值为:" + max);
}
}
| [
"2651351234@qq.com"
] | 2651351234@qq.com |
c0afb691f39a168ebce7611e9242f4f25e8acc07 | 4f3d59101c8ff8c1295bba6236820c0b30deb1ea | /core/src/main/java/org/springframework/security/saml/SAMLAuthenticationToken.java | 03e8db9ae79b454004ae9e1ec0952fd644964455 | [] | no_license | chubbard/spring-security-saml | 57d97a528f84210afa820ba7279a1b685f69364e | 34580782adc87974287c9d063db582c5b6ce8a63 | refs/heads/master | 2021-07-31T20:12:49.460740 | 2021-07-17T22:10:33 | 2021-07-17T22:10:33 | 218,110,976 | 1 | 0 | null | 2019-10-28T17:52:39 | 2019-10-28T17:52:38 | null | UTF-8 | Java | false | false | 2,521 | java | /* Copyright 2009 Vladimir Schäfer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.saml;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.saml.context.SAMLMessageContext;
import org.springframework.util.Assert;
/**
* SAML Token is used to pass SAMLContext object through to the SAML Authentication provider.
*
* @author Vladimir Schäfer
*/
public class SAMLAuthenticationToken extends AbstractAuthenticationToken {
private static final long serialVersionUID = 1L;
/**
* SAML context with content to verify
*/
private transient SAMLMessageContext credentials;
/**
* Default constructor initializing the context
*
* @param credentials SAML context object created after decoding
*/
public SAMLAuthenticationToken(SAMLMessageContext credentials) {
super(null);
Assert.notNull(credentials, "SAMLAuthenticationToken requires the credentials parameter to be set");
this.credentials = credentials;
setAuthenticated(false);
}
/**
* Returns the stored SAML context
*
* @return context
*/
public SAMLMessageContext getCredentials() {
return this.credentials;
}
/**
* Always null
*
* @return null
*/
public Object getPrincipal() {
return null;
}
/**
* This object can never be authenticated, call with true result in exception.
*
* @param isAuthenticated only false value allowed
*
* @throws IllegalArgumentException if isAuthenticated is true
*/
public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
if (isAuthenticated) {
throw new IllegalArgumentException(
"Cannot set this token to trusted - use constructor containing GrantedAuthority[]s instead");
}
super.setAuthenticated(false);
}
}
| [
"fhanik@pivotal.io"
] | fhanik@pivotal.io |
3f28bc8c0e6406b89ee123f6d649f67ede91baa2 | 80118fa300bb0ae9f136e4cb68ff44f28381d104 | /src/com/tz/user/service/impl/UserServiceImpl.java | 5ac8c9f691bb110dbe68d2c6936321566f7876a3 | [] | no_license | xhj224/crm01 | 24c3dcd5cae64d2e06a641749769c5d1ad8ba5af | 080015d13882fc48497c6179c16d9b4c24af8627 | refs/heads/master | 2021-01-12T01:05:03.132841 | 2017-01-09T05:36:38 | 2017-01-09T05:36:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package com.tz.user.service.impl;
import com.tz.entity.User;
import com.tz.user.dao.IUserDao;
import com.tz.user.service.IUserService;
import com.tz.util.BeanFactory;
public class UserServiceImpl implements IUserService {
IUserDao userDao = (IUserDao) BeanFactory.getBean("userDao");
@Override
public User login(String username, String password) {
return userDao.selectUser(username, password);
}
}
| [
"xhjxhj224@163.com"
] | xhjxhj224@163.com |
17813675a5aec20e31eda9fea34d09ca9bc67e4d | 28c9dbc1f8d9c4083534dbb2eb623781107619ef | /src/pubhub/dao/BookDAO.java | e5a471439c3ee641bed7a8075168257547b369ef | [] | no_license | haydenhw/PubHub | 29164ec3201a7108b91aae85c3b05f4257e46651 | b6a1b8a8a480aefd650c468b1c18da09cd94eabf | refs/heads/master | 2023-01-09T17:55:36.112619 | 2020-11-07T23:59:58 | 2020-11-07T23:59:58 | 309,244,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package pubhub.dao;
import java.util.List;
import pubhub.model.Book;
/**
* Interface for our Data Access Object to handle database queries related to Books.
*/
public interface BookDAO {
public List<Book> getAllBooks();
public List<Book> getBooksByTitle(String title);
public List<Book> getBooksByAuthor(String author);
public List<Book> getBooksLessThanPrice(double price);
public List<Book> getBooksByTag(String tagName);
public Book getBookByISBN(String isbn);
public boolean addBook(Book book);
public boolean updateBook(Book book);
public boolean deleteBookByISBN(String isbn);
}
| [
"hayden321@gmail.com"
] | hayden321@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.