blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 7 5.41M | extension stringclasses 11
values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4646e61e0b7c0891f4d92823d0f898587190af6c | c5679ee59de14eedc61c5dcd565eda44a996feb1 | /presto-hive/src/test/java/io/prestosql/plugin/hive/AbstractTestHiveLocal.java | 75cab76e1a0d328df4ef4849bf7e500ec77a072f | [
"Apache-2.0"
] | permissive | chengpeng2015/hetu-core | 58e02e087e82ed008de011f9e4e5ff96c396d180 | 5ddf288154909ddb505ca4a4ce5ba19d64fd94d3 | refs/heads/master | 2023-01-28T14:56:45.973460 | 2020-12-05T07:01:20 | 2020-12-05T07:01:20 | 319,274,123 | 1 | 0 | Apache-2.0 | 2020-12-07T09:52:21 | 2020-12-07T09:52:21 | null | UTF-8 | Java | false | false | 3,321 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.prestosql.plugin.hive;
import com.google.common.io.Files;
import io.prestosql.plugin.hive.metastore.Database;
import io.prestosql.plugin.hive.metastore.HiveMetastore;
import io.prestosql.spi.connector.ConnectorMetadata;
import io.prestosql.spi.connector.ConnectorTableHandle;
import io.prestosql.spi.connector.SchemaTableName;
import io.prestosql.spi.security.PrincipalType;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import java.io.File;
import java.io.IOException;
import static com.google.common.io.MoreFiles.deleteRecursively;
import static com.google.common.io.RecursiveDeleteOption.ALLOW_INSECURE;
import static java.util.Objects.requireNonNull;
public abstract class AbstractTestHiveLocal
extends AbstractTestHive
{
private static final String DEFAULT_TEST_DB_NAME = "test";
private File tempDir;
private String testDbName;
protected AbstractTestHiveLocal()
{
this(DEFAULT_TEST_DB_NAME);
}
protected AbstractTestHiveLocal(String testDbName)
{
this.testDbName = requireNonNull(testDbName, "testDbName is null");
}
protected abstract HiveMetastore createMetastore(File tempDir);
@BeforeClass
public void initialize()
{
tempDir = Files.createTempDir();
HiveMetastore metastore = createMetastore(tempDir);
metastore.createDatabase(Database.builder()
.setDatabaseName(testDbName)
.setOwnerName("public")
.setOwnerType(PrincipalType.ROLE)
.build());
HiveConfig hiveConfig = new HiveConfig()
.setTimeZone("America/Los_Angeles");
setup(testDbName, hiveConfig, metastore);
}
@AfterClass(alwaysRun = true)
public void cleanup()
throws IOException
{
try {
getMetastoreClient().dropDatabase(testDbName);
}
finally {
deleteRecursively(tempDir.toPath(), ALLOW_INSECURE);
}
}
@Override
protected ConnectorTableHandle getTableHandle(ConnectorMetadata metadata, SchemaTableName tableName)
{
if (tableName.getTableName().startsWith(TEMPORARY_TABLE_PREFIX)) {
return super.getTableHandle(metadata, tableName);
}
throw new SkipException("tests using existing tables are not supported");
}
@Override
public void testGetAllTableNames()
{
}
@Override
public void testGetAllTableColumns()
{
}
@Override
public void testGetAllTableColumnsInSchema()
{
}
@Override
public void testGetTableNames()
{
}
@Override
public void testGetTableSchemaOffline()
{
}
}
| [
"7676181+fbird2020@user.noreply.gitee.com"
] | 7676181+fbird2020@user.noreply.gitee.com |
2348177f89a8d20b47244cd2f24b864d8e9c0b5c | 834e3146af664942777e9a64ef90d3436b77ae12 | /src/main/java/com/zking/test/biz/impl/ApplyBizImpl.java | af4397635ac219b39e33dae4e30bacaf190fae59 | [] | no_license | ZengShao/Java-Backstage-Supporter | 57359b246ed3c7deab4b775c89a5c932e93b82fb | 842ec18e7833064db59f658f9614c37aab46c4ec | refs/heads/master | 2022-03-14T05:38:34.581476 | 2019-11-09T09:46:58 | 2019-11-09T09:46:58 | 218,992,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,614 | java | package com.zking.test.biz.impl;
import com.zking.test.biz.IApplyBiz;
import com.zking.test.mapper.ApplyMapper;
import com.zking.test.model.Apply;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("applyBiz")
public class ApplyBizImpl implements IApplyBiz {
@Autowired
@SuppressWarnings("all")
private ApplyMapper applyMapper;
@Override
public int update(Apply apply) {
Apply applys = new Apply();
apply.setApplyId(apply.getApplyId());
if(apply.getState()==1){
apply.setState(2);
}
else if(apply.getState()==2){
apply.setState(3);
}
else if(apply.getState()==5){
apply.setState(2);
}
else if(apply.getState()==3){
apply.setState(4);
}
return applyMapper.update(apply);
}
@Override
public int updateById(Apply apply){
Apply applys = new Apply();
applys.setApplyId(apply.getApplyId());
applys.setAdmId(apply.getAdmId());
apply.setState(apply.getState());
return applyMapper.updateByPrimaryKeySelective(apply);
};
@Override
public int update1(Apply apply) {
Apply applys = new Apply();
apply.setApplyId(apply.getApplyId());
if(apply.getState()==1){
apply.setState(5);
}
else if(apply.getState()==2){
apply.setState(5);
}
else if(apply.getState()==3){
apply.setState(5);
}
return applyMapper.update(apply);
}
}
| [
"1540811359@qq.com"
] | 1540811359@qq.com |
80d2f54e1abe691496cc04f1e93bb301a4fcc0de | 89bedf3e111cdfd7b80f39b2eca3791a0dda276f | /argouml-app-v0.26/src/org/argouml/uml/cognitive/critics/WizAssocComposite.java | 255b7ed2e37503cdd8347d5de4348fcaa013289c | [
"LicenseRef-scancode-other-permissive",
"BSD-3-Clause"
] | permissive | TheProjecter/plea-spl | b80b622fcf4dee6a73ae72db4fc7f4826bef0549 | c28b308160c6ef8e68440d90a7710bff270f22c3 | refs/heads/master | 2020-05-28T14:14:30.727459 | 2014-10-03T18:43:35 | 2014-10-03T18:43:35 | 42,946,066 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,565 | java | //#if defined(COGNITIVE)
//@#$LPS-COGNITIVE:GranularityType:Package
// $Id: WizAssocComposite.java 13842 2007-11-26 00:31:27Z tfmorris $
// Copyright (c) 1996-2007 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
// agreement is hereby granted, provided that the above copyright notice
// and this paragraph appear in all copies. This software program and
// documentation are copyrighted by The Regents of the University of
// California. The software program and documentation are supplied "AS
// IS", without any accompanying services from The Regents. The Regents
// does not warrant that the operation of the program will be
// uninterrupted or error-free. The end-user understands that the program
// was developed for research purposes and is advised not to rely
// exclusively on the program for any reason. IN NO EVENT SHALL THE
// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
package org.argouml.uml.cognitive.critics;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.JPanel;
import org.apache.log4j.Logger;
import org.argouml.cognitive.ui.WizStepChoice;
import org.argouml.i18n.Translator;
import org.argouml.model.Model;
/**
* A non-modal wizard to assist the user in changing aggregation of an
* association.
* <p>
*
* Earlier version always imposed composite aggregation. This version allows the
* user to choose.
* <p>
*
* <em>Note</em>. This only applies to binary associations. A separate wizard
* is needed for 3-way (or more) associations.
* <p>
*
* @see "ArgoUML User Manual: Two Aggregate ends (roles) in binary Association"
* @author jrobbins@ics.uci.edu
*/
public class WizAssocComposite extends UMLWizard {
/**
* Logger.
*/
private static final Logger LOG = Logger.getLogger(WizAssocComposite.class);
/**
* The initial instructions on the Step 1 screen. May be set to a different
* string through {@link #setInstructions(String)}.
* <p>
*/
private String instructions = Translator
.localize("critics.WizAssocComposite-ins");
/**
* Contains the {@link WizStepChoice} that is used to get the user's desired
* options. Not created until we get to that step.
* <p>
*/
private WizStepChoice step1Choice = null;
/**
* The Association {@link WizStepChoice} that triggered the critic. Null
* until set when it is first needed.
* <p>
*/
private Object triggerAssociation = null;
/**
* Constructor for the wizard. Currently does nothing.
* <p>
*/
public WizAssocComposite() {
}
/**
* Tries to identify the Association that triggered the critic.
* <p>
*
* The first time it is called, it will initialise the trigger from the
* ToDoItem. If there, it is assumed to be the first trigger of the ToDoItem
* and to be an association. If found, the value is stored in the private
* field {@link #triggerAssociation}.
* <p>
*
* On all subsequent calls, if a non-null value is found in {@link
* #triggerAssociation} that is returned.
* <p>
*
* @return the Association that triggered the critic, or <code>null</code>
* if there was none.
*/
private Object getTriggerAssociation() {
// If we don't have it, find the trigger. If this fails it will keep
// its default value of null
if ((triggerAssociation == null) && (getToDoItem() != null)) {
triggerAssociation = getModelElement();
}
return triggerAssociation;
}
/**
* Returns a list of options to be used in creating a {@link
* WizStepChoice} that will exercise the options.
* <p>
*
* We provide five options, shared aggregation in each direction, composite
* aggregation in each direction and no aggregation at all.
* <p>
*
* It is possible that a very malicious user could delete the triggering
* association just before we get to this point. For now we don't bother to
* trap this. It will raise an exception, and then everything will carry on
* happily.
* <p>
*
* @return A {@link List} of the options or <code>null</code> if the
* association that triggered the critic is no longer there.
*/
private List<String> buildOptions() {
// The association that triggered the critic. Its just possible the
// association is no longer there, in which case we return null
Object asc = getTriggerAssociation();
if (asc == null) {
return null;
}
List<String> result = new ArrayList<String>();
// Get the ends from the association (we know there are two), and the
// types associated with them.
Iterator iter = Model.getFacade().getConnections(asc).iterator();
Object ae0 = iter.next();
Object ae1 = iter.next();
Object cls0 = Model.getFacade().getType(ae0);
Object cls1 = Model.getFacade().getType(ae1);
// Get the names of the two ends. If there are none (i.e they are
// currently anonymous), use the ArgoUML convention of "(anon)" for the
// names
String start = Translator.localize("misc.name.anon");
String end = Translator.localize("misc.name.anon");
if ((cls0 != null) && (Model.getFacade().getName(cls0) != null)
&& (!(Model.getFacade().getName(cls0).equals("")))) {
start = Model.getFacade().getName(cls0);
}
if ((cls1 != null) && (Model.getFacade().getName(cls1) != null)
&& (!(Model.getFacade().getName(cls1).equals("")))) {
end = Model.getFacade().getName(cls1);
}
// Now create the five options
result.add(start
+ Translator.localize("critics.WizAssocComposite-option1")
+ end);
result.add(start
+ Translator.localize("critics.WizAssocComposite-option2")
+ end);
result.add(end
+ Translator.localize("critics.WizAssocComposite-option1")
+ start);
result.add(end
+ Translator.localize("critics.WizAssocComposite-option2")
+ start);
result.add(Translator.localize("critics.WizAssocComposite-option3"));
return result;
}
/**
* Set the initial instruction string for the choice. May be called by the
* creator of the wizard to override the default.
* <p>
*
* @param s
* The new instructions.
*/
public void setInstructions(String s) {
instructions = s;
}
/**
* Create a {@link JPanel} for the given step.
* <p>
* We use a {@link WizStepChoice} to handle the choice selection for the
* user. We only create the panel once, saving it in a private field
* (<code>_step1Choice</code>) for subsequent use.
* <p>
* <em>Note</em>. If the association has been deleted, then we may not be
* able to create a list of options. Under these circumstances we also
* return null.
* <p>
*
* @param newStep The index of the step for which a panel is needed.
* @return The created {@link JPanel} or <code>null</code> if no options
* were available.
* @see org.argouml.cognitive.critics.Wizard
*/
public JPanel makePanel(int newStep) {
switch (newStep) {
case 1:
// First step. Create the panel if not already done and options are
// available. Otherwise it retains its default value of null.
if (step1Choice == null) {
List<String> opts = buildOptions();
if (opts != null) {
step1Choice = new WizStepChoice(this, instructions, opts);
step1Choice.setTarget(getToDoItem());
}
}
return step1Choice;
default:
}
// Default (any other step) is to return nothing
return null;
}
/**
* Take action at the completion of a step.
* <p>
*
* The guideline for ArgoUML non-modal wizards is to act immediately, not
* wait for the finish. This method may also be invoked when finish is
* triggered for any steps whose panels didn't get created.
* <p>
*
* The observation is that this seems to be trigged when there is any change
* on the panel (e.g choosing an option), not just when "next" is pressed.
* Coded accordingly
* <p>
*
* We allow for the association that caused the problem having by now been
* deleted, and hence an exception may be raised. We catch this politely.
* <p>
*
* @param oldStep
* The index of the step just completed (0 for the first
* information panel)
*
* @see org.argouml.cognitive.critics.Wizard
*/
public void doAction(int oldStep) {
switch (oldStep) {
case 1:
// Just completed the first step where we make our choices. First
// see if we have a choice. We always should, so print a rude
// message if we don't
int choice = -1;
if (step1Choice != null) {
choice = step1Choice.getSelectedIndex();
}
if (choice == -1) {
LOG.warn("WizAssocComposite: nothing selected, "
+ "should not get here");
return;
}
// It is quite possible that the cause of the problem has by now
// been deleted, in which case we will throw an exception if we try
// to change things. Catch this tidily.
try {
// Set the appropriate aggregation on each end
Iterator iter = Model.getFacade().getConnections(
getTriggerAssociation()).iterator();
Object ae0 = iter.next();
Object ae1 = iter.next();
switch (choice) {
case 0:
// Start is a composite aggregation of end
Model.getCoreHelper().setAggregation(ae0,
Model.getAggregationKind().getComposite());
Model.getCoreHelper().setAggregation(ae1,
Model.getAggregationKind().getNone());
break;
case 1:
// Start is a shared aggregation of end
Model.getCoreHelper().setAggregation(ae0,
Model.getAggregationKind().getAggregate());
Model.getCoreHelper().setAggregation(ae1,
Model.getAggregationKind().getNone());
break;
case 2:
// End is a composite aggregation of start
Model.getCoreHelper().setAggregation(ae0,
Model.getAggregationKind().getNone());
Model.getCoreHelper().setAggregation(ae1,
Model.getAggregationKind().getComposite());
break;
case 3:
// End is a shared aggregation of start
Model.getCoreHelper().setAggregation(ae0,
Model.getAggregationKind().getNone());
Model.getCoreHelper().setAggregation(ae1,
Model.getAggregationKind().getAggregate());
break;
case 4:
// No aggregation
Model.getCoreHelper().setAggregation(ae0,
Model.getAggregationKind().getNone());
Model.getCoreHelper().setAggregation(ae1,
Model.getAggregationKind().getNone());
break;
default:
}
} catch (Exception pve) {
// Someone took our association away.
LOG.error("WizAssocComposite: could not set " + "aggregation.",
pve);
}
default:
}
}
/**
* Determine if we have sufficient information to finish.
* <p>
* We can't finish if our parent
* {@link org.argouml.cognitive.critics.Wizard} can't finish.
* <p>
* We can finish if we're on step 0.
* <p>
* We can finish if we're on step 1 and have made a choice.
* <p>
*
* @return <code>true</code> if we can finish, otherwise
* <code>false</code>.
* @see org.argouml.cognitive.critics.Wizard
*/
@Override
public boolean canFinish() {
// Can't finish if our parent can't
if (!super.canFinish()) {
return false;
}
// Can finish if it's step 0
if (getStep() == 0) {
return true;
}
// Can finish if we're on step1 and have actually made a choice
if ((getStep() == 1) && (step1Choice != null)
&& (step1Choice.getSelectedIndex() != -1)) {
return true;
}
// Otherwise we can't finish
return false;
}
}
//#endif | [
"demost@gmail.com"
] | demost@gmail.com |
f0b7213da931143e1624e1a52792bb94284f9a61 | e5c9e9174038adf68723a22faf9543597b8b98c7 | /app/src/main/java/com/mo/kumengshar/MainActivity.java | 892bf5ceaf647091c8218c6e8932b8f35cb713d1 | [] | no_license | moshangpiaoxue/kUmengShar | a3d65cbaeb25d779653047f136ceb060c31a539c | d903511cac85fe76f89369553d2c5d1ebea6a8ba | refs/heads/master | 2020-11-26T18:24:14.049738 | 2019-12-20T02:17:10 | 2019-12-20T02:17:10 | 229,171,939 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.mo.kumengshar;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"130681li"
] | 130681li |
d91c2628e6f517a0677b2409c9c96a7a048ad1d4 | 2df96e49d4d9e5bf9c65fb2ed0d12c5f26ed70c2 | /src/lol/cicco/leetcode/Problem56.java | 6758b55b81b36a93b945580646b18593fe08e04f | [] | no_license | CodingZx/DateStructure | 98614368e027f2c7841d49188ccb57f93fbca8a1 | cc402127b44dacf0cc6f0fbf60b97c2d601a075e | refs/heads/master | 2021-01-04T10:40:23.070926 | 2020-03-10T06:40:29 | 2020-03-10T06:40:29 | 240,510,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,312 | java | package lol.cicco.leetcode;
import java.util.Arrays;
public class Problem56 {
public int[][] merge(int[][] intervals) {
if(intervals == null || intervals.length == 0) return intervals;
Arrays.sort(intervals, (o1,o2) -> {
if(o1[0] == o2[0]) {
return o1[1] - o2[1];
}
return o1[0] - o2[0];
});
int[][] arr = new int[intervals.length][2];
arr[0] = intervals[0];
int arrIdx = 0;
for (int i = 1; i < intervals.length; i++) {
int[] pre = arr[arrIdx];
int[] now = intervals[i];
if(now[0] > pre[1]) {
arr[arrIdx+1] = now;
arrIdx ++;
continue;
}
// [1,3] [0,4]
if(now[0] <= pre[0]) {
pre[0] = now[0];
if(now[1] >= pre[1]) {
pre[1] = now[1]; // 合并
}
continue;
}
if(now[1] < pre[1]) {
// 包含关系
continue;
}
if(now[1] > pre[1]) {
pre[1] = now[1];
}
}
int[][] res = new int[arrIdx+1][2];
System.arraycopy(arr, 0, res, 0, arrIdx+1);
return res;
}
}
| [
"zhaoxu@2019"
] | zhaoxu@2019 |
878b943e34edc38421ec922535139e3ecd2aa55d | bc5e86f60bbcf7495b897b507a96c0033fd6f385 | /app/src/main/java/com/example/natthaparkc/googleio/di/FragmentScoped.java | c4433113273cf99177a31ead87db9251ffa22bc9 | [] | no_license | natthapark-c/sample-google-io | a94b263c0cdad6b7b52f6c4d4e0d6a267cfa4ac8 | 4ea0704a938d1d3bbdba280252da0c5f9a911dec | refs/heads/master | 2020-03-28T14:04:22.918843 | 2018-10-09T10:37:11 | 2018-10-09T10:37:11 | 148,456,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | /*
* Copyright 2018 Google LLC
*
* 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 com.example.natthaparkc.googleio.di;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.inject.Scope;
/**
* The FragmentScoped custom scoping annotation specifies that the lifespan of a dependency be
* the same as that of a Fragment. This is used to annotate dependencies that behave like a
* singleton within the lifespan of a Fragment
*/
@Scope
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface FragmentScoped {
}
| [
"natthapark.c@kbtg.tech"
] | natthapark.c@kbtg.tech |
6097f2a876c3ee4a3d0e8cbec0bcae1735c1ffa2 | 3412f59ded4f5bab58ea1e2de49e020fc9bcb8ed | /src/org/cast/leetcode/problems/assignCookies/AssignCookies.java | 5e8598c201c83124b9d001000af2373b272da310 | [] | no_license | lifetime520/leetcode | aa9adb86632d2a82abc89429270f70b88bd92889 | 1738571b1cefcb56a023be064a4f9c09aa5d44fe | refs/heads/master | 2021-01-02T08:16:31.259552 | 2018-04-24T15:00:51 | 2018-04-24T15:00:51 | 98,982,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 757 | java | package org.cast.leetcode.problems.assignCookies;
public class AssignCookies {
public static int[][] PATTERN_1 = {{1, 2, 3}, {1, 1}};
public static int[][] PATTERN_2 = {{1, 2}, {1, 2, 3}};
public static int[][] PATTERN_3 = {{1, 2, 1, 2, 2}, {1, 1, 1, 3, 3}};
public static int[][] PATTERN_4 = {{1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 3, 2, 1}};
public static void main(String[] args) {
System.out.println(new Solution().findContentChildren(PATTERN_1[0], PATTERN_1[1])); // 1
System.out.println(new Solution().findContentChildren(PATTERN_2[0], PATTERN_2[1])); // 2
System.out.println(new Solution().findContentChildren(PATTERN_3[0], PATTERN_3[1])); // 4
System.out.println(new Solution().findContentChildren(PATTERN_4[0], PATTERN_4[1])); // 4
}
} | [
"lifetime520@gmail.com"
] | lifetime520@gmail.com |
72b9d37689614aabe9524929fa4dd523fd5eb18b | 8bc41e1a19b37a19d5cf9e1c06c5a7ce206ff70e | /sslvpn/franken-sslvpn/src/main/java/kr/co/future/sslvpn/core/log/LogCapacityLog.java | a97276bf1eddc5fc9887e3b237b6bfa5a3fd974c | [] | no_license | pkseop/franken | 5121449f406da7ad30764f8e77f01bd23ac53664 | bbb4c736c35a0c5e6ba04d0845a3e4926848e1dd | refs/heads/master | 2021-01-22T01:11:21.956563 | 2017-09-02T15:48:45 | 2017-09-02T15:48:45 | 102,206,586 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,591 | java | package kr.co.future.sslvpn.core.log;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import kr.co.future.logstorage.Log;
public class LogCapacityLog {
private Date date;
private String tableName;
private long beforeCapacity;
private long incrementCapacity;
private long total;
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getTableName() {
return tableName;
}
public void setTableName(String table_name) {
this.tableName = table_name;
}
public long getBeforeCapacity() {
return beforeCapacity;
}
public void setBeforeCapacity(long before_capacity) {
this.beforeCapacity = before_capacity;
}
public long getIncrementCapacity() {
return incrementCapacity;
}
public void setIncrementCapacity(long increment_capacity) {
this.incrementCapacity = increment_capacity;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public Log toLog() {
Map<String, Object> m = new HashMap<String, Object>();
m.put("table_name", tableName);
m.put("before_capacity", beforeCapacity);
m.put("increment_capacity", incrementCapacity);
m.put("total", total);
return new Log("log-capacity", date, m);
}
@Override
public String toString() {
return "CapacityLog [date=" + date + ", tableName=" + tableName + ", beforeCapacity=" + beforeCapacity
+ ", incrementCapacity=" + incrementCapacity + ", total=" + total + "]";
}
}
| [
"patchboys@MacBook-Pro.local"
] | patchboys@MacBook-Pro.local |
93c288f04738b3435a290e55fd203233be422638 | b72074327a3c57294122d23f169a6597ba7417c9 | /src/ConcurrentTotalFileSizeWLatch.java | 3f74ff5261504b1befac50c0eba1f442196d3ed5 | [] | no_license | poyger/concurrency-tests | d6b455480224fe981d76cdee97ad6048db19e1a9 | 4802d271f9f2eacca4671baf48d79532d402a3fd | refs/heads/master | 2021-01-10T04:38:13.299601 | 2017-11-27T18:46:20 | 2017-11-27T18:46:20 | 52,589,588 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,599 | java | /***
* Excerpted from "Programming Concurrency on the JVM",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any purpose.
* Visit http://www.pragmaticprogrammer.com/titles/vspcon for more book information.
***/
import java.io.File;
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.CountDownLatch;
public class ConcurrentTotalFileSizeWLatch {
private ExecutorService service;
final private AtomicLong pendingFileVisits = new AtomicLong();
final private AtomicLong totalSize = new AtomicLong();
final private CountDownLatch latch = new CountDownLatch(1);
private void updateTotalSizeOfFilesInDir(final File file) {
long fileSize = 0;
if (file.isFile())
fileSize = file.length();
else {
final File[] children = file.listFiles();
if (children != null) {
for(final File child : children) {
if (child.isFile())
fileSize += child.length();
else {
pendingFileVisits.incrementAndGet();
service.execute(new Runnable() {
public void run() { updateTotalSizeOfFilesInDir(child); }
});
}
}
}
}
totalSize.addAndGet(fileSize);
if(pendingFileVisits.decrementAndGet() == 0)
latch.countDown();
}
private long getTotalSizeOfFile(final String fileName)
throws InterruptedException {
service = Executors.newFixedThreadPool(100);
pendingFileVisits.incrementAndGet();
try {
updateTotalSizeOfFilesInDir(new File(fileName));
latch.await(100, TimeUnit.SECONDS);
return totalSize.longValue();
} finally {
service.shutdown();
}
}
public static void main(final String[] args) throws InterruptedException {
final long start = System.nanoTime();
final long total = new ConcurrentTotalFileSizeWLatch()
.getTotalSizeOfFile(args[0]);
final long end = System.nanoTime();
System.out.println("Total Size: " + total);
System.out.println("Time taken: " + (end - start)/1.0e9);
}
}
| [
"poyan.gerami@eniro.com"
] | poyan.gerami@eniro.com |
f84a792315abfa0593339521c3ce288650c46e2a | efe6c8150a222c3cbe6a4161594b8f548e71a7c0 | /NFComm/NFPluginModule/src/main/java/com/noahframe/nfcore/iface/NFFrame.java | 233d4e3a8fb36fdd36ac23dbdc35a2b2111d6cae | [] | no_license | mediapastor/NFrame-java | 6e8a6c5cdc300cb517d6ef915f6fcc7e50d823ec | 16762f73cfeb140777805dbfaf8bdfd7f9be513c | refs/heads/master | 2020-03-30T08:43:39.818194 | 2018-09-15T14:02:27 | 2018-09-15T14:02:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 91,881 | java | /**
* @Title: NFFrame
* @Package ${package_name}
* @Description: 基础XML属性设置
* @author zoecee yideal_formula@126.com
* @date 2017.7.6
* @version V1.0
*/
package com.noahframe.nfcore.iface;
public class NFFrame {
public static class IObject{
//Class name
public static String ThisName(){ String xIObject = "IObject"; return xIObject; }
// IObject
// Property
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Record
};
public static class BB_Build{
//Class name
public static String ThisName(){ String xBB_Build = "BB_Build"; return xBB_Build; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Type(){ String xType = "Type"; return xType; } // int
public static String SubType(){ String xSubType = "SubType"; return xSubType; } // int
public static String Prefab(){ String xPrefab = "Prefab"; return xPrefab; } // string
public static String NormalStateFunc(){ String xNormalStateFunc = "NormalStateFunc"; return xNormalStateFunc; } // string
public static String UpStateFunc(){ String xUpStateFunc = "UpStateFunc"; return xUpStateFunc; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String Desc(){ String xDesc = "Desc"; return xDesc; } // string
// Record
};
public static class Block{
//Class name
public static String ThisName(){ String xBlock = "Block"; return xBlock; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Tag(){ String xTag = "Tag"; return xTag; } // int
public static String SpriteList(){ String xSpriteList = "SpriteList"; return xSpriteList; } // string
public static String SpritePath(){ String xSpritePath = "SpritePath"; return xSpritePath; } // string
public static String LeftSide(){ String xLeftSide = "LeftSide"; return xLeftSide; } // string
public static String RightSide(){ String xRightSide = "RightSide"; return xRightSide; } // string
public static String TopSide(){ String xTopSide = "TopSide"; return xTopSide; } // string
public static String DownSide(){ String xDownSide = "DownSide"; return xDownSide; } // string
public static String LeftTopSide(){ String xLeftTopSide = "LeftTopSide"; return xLeftTopSide; } // string
public static String LeftDownSide(){ String xLeftDownSide = "LeftDownSide"; return xLeftDownSide; } // string
public static String RightTopSide(){ String xRightTopSide = "RightTopSide"; return xRightTopSide; } // string
public static String RightDownSide(){ String xRightDownSide = "RightDownSide"; return xRightDownSide; } // string
public static String LeftTopOutSide(){ String xLeftTopOutSide = "LeftTopOutSide"; return xLeftTopOutSide; } // string
public static String LeftDownOutSide(){ String xLeftDownOutSide = "LeftDownOutSide"; return xLeftDownOutSide; } // string
public static String RightTopOutSide(){ String xRightTopOutSide = "RightTopOutSide"; return xRightTopOutSide; } // string
public static String RightDownOutSide(){ String xRightDownOutSide = "RightDownOutSide"; return xRightDownOutSide; } // string
public static String GrassList(){ String xGrassList = "GrassList"; return xGrassList; } // string
public static String JoinList(){ String xJoinList = "JoinList"; return xJoinList; } // string
public static String CrackList(){ String xCrackList = "CrackList"; return xCrackList; } // string
public static String TreasureList(){ String xTreasureList = "TreasureList"; return xTreasureList; } // string
public static String TreeRootList(){ String xTreeRootList = "TreeRootList"; return xTreeRootList; } // string
// Record
};
public static class Buff{
//Class name
public static String ThisName(){ String xBuff = "Buff"; return xBuff; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String EffectType(){ String xEffectType = "EffectType"; return xEffectType; } // int
public static String EffectValueType(){ String xEffectValueType = "EffectValueType"; return xEffectValueType; } // int
public static String EffectValueReferType(){ String xEffectValueReferType = "EffectValueReferType"; return xEffectValueReferType; } // int
public static String EffectTimeValue(){ String xEffectTimeValue = "EffectTimeValue"; return xEffectTimeValue; } // int
public static String EffectTimeInterval(){ String xEffectTimeInterval = "EffectTimeInterval"; return xEffectTimeInterval; } // float
public static String WashGroupID(){ String xWashGroupID = "WashGroupID"; return xWashGroupID; } // int
public static String ReverseReferType(){ String xReverseReferType = "ReverseReferType"; return xReverseReferType; } // int
public static String EffectClearOnDead(){ String xEffectClearOnDead = "EffectClearOnDead"; return xEffectClearOnDead; } // int
public static String DownSaveType(){ String xDownSaveType = "DownSaveType"; return xDownSaveType; } // int
// Record
};
public static class ChatGroup{
//Class name
public static String ThisName(){ String xChatGroup = "ChatGroup"; return xChatGroup; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Name(){ String xName = "Name"; return xName; } // string
public static String CreateObject(){ String xCreateObject = "CreateObject"; return xCreateObject; } // object
// Record
public static String R_GroupMemberList(){ String xGroupMemberList = "GroupMemberList"; return xGroupMemberList;}
public static String R_ChatList(){ String xChatList = "ChatList"; return xChatList;}
public static enum GroupMemberList
{
GroupMemberList_GUID(0), // GUID -- object
GroupMemberList_Online(1), // Online -- int
GroupMemberList_GameID(2); // GameID -- int
private int _value;
private GroupMemberList(int value) {
_value = value;
}
public int value() {
return _value;
}
public GroupMemberList get(int ntype)
{
for (int i = 0; i < GroupMemberList.values().length; i++) {
GroupMemberList val=GroupMemberList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum ChatList
{
ChatList_GUID(0), // GUID -- object
ChatList_msg(1) , // msg -- string
ChatList_time(2); // time -- int
private int _value;
private ChatList(int value) {
_value = value;
}
public int value() {
return _value;
}
public ChatList get(int ntype)
{
for (int i = 0; i < ChatList.values().length; i++) {
ChatList val=ChatList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
};
public static class ConsumeData{
//Class name
public static String ThisName(){ String xConsumeData = "ConsumeData"; return xConsumeData; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String VIPEXP(){ String xVIPEXP = "VIPEXP"; return xVIPEXP; } // int
public static String EXP(){ String xEXP = "EXP"; return xEXP; } // int
public static String HP(){ String xHP = "HP"; return xHP; } // int
public static String SP(){ String xSP = "SP"; return xSP; } // int
public static String MP(){ String xMP = "MP"; return xMP; } // int
public static String Gold(){ String xGold = "Gold"; return xGold; } // int
public static String Money(){ String xMoney = "Money"; return xMoney; } // int
// Record
};
public static class Cost{
//Class name
public static String ThisName(){ String xCost = "Cost"; return xCost; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String CostMoney(){ String xCostMoney = "CostMoney"; return xCostMoney; } // int
public static String CostDiamond(){ String xCostDiamond = "CostDiamond"; return xCostDiamond; } // int
public static String CostVP(){ String xCostVP = "CostVP"; return xCostVP; } // int
public static String CostHonour(){ String xCostHonour = "CostHonour"; return xCostHonour; } // int
// Record
};
public static class DescData{
//Class name
public static String ThisName(){ String xDescData = "DescData"; return xDescData; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String Atlas(){ String xAtlas = "Atlas"; return xAtlas; } // string
public static String PrefabPath(){ String xPrefabPath = "PrefabPath"; return xPrefabPath; } // string
public static String PerformanceEffect(){ String xPerformanceEffect = "PerformanceEffect"; return xPerformanceEffect; } // string
public static String PerformanceSound(){ String xPerformanceSound = "PerformanceSound"; return xPerformanceSound; } // string
public static String DescText(){ String xDescText = "DescText"; return xDescText; } // string
// Record
};
public static class EffectData{
//Class name
public static String ThisName(){ String xEffectData = "EffectData"; return xEffectData; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String SUCKBLOOD(){ String xSUCKBLOOD = "SUCKBLOOD"; return xSUCKBLOOD; } // int
public static String REFLECTDAMAGE(){ String xREFLECTDAMAGE = "REFLECTDAMAGE"; return xREFLECTDAMAGE; } // int
public static String CRITICAL(){ String xCRITICAL = "CRITICAL"; return xCRITICAL; } // int
public static String MAXHP(){ String xMAXHP = "MAXHP"; return xMAXHP; } // int
public static String MAXMP(){ String xMAXMP = "MAXMP"; return xMAXMP; } // int
public static String MAXSP(){ String xMAXSP = "MAXSP"; return xMAXSP; } // int
public static String HP(){ String xHP = "HP"; return xHP; } // int
public static String MP(){ String xMP = "MP"; return xMP; } // int
public static String SP(){ String xSP = "SP"; return xSP; } // int
public static String HPREGEN(){ String xHPREGEN = "HPREGEN"; return xHPREGEN; } // int
public static String SPREGEN(){ String xSPREGEN = "SPREGEN"; return xSPREGEN; } // int
public static String MPREGEN(){ String xMPREGEN = "MPREGEN"; return xMPREGEN; } // int
public static String ATK_VALUE(){ String xATK_VALUE = "ATK_VALUE"; return xATK_VALUE; } // int
public static String DEF_VALUE(){ String xDEF_VALUE = "DEF_VALUE"; return xDEF_VALUE; } // int
public static String MOVE_SPEED(){ String xMOVE_SPEED = "MOVE_SPEED"; return xMOVE_SPEED; } // int
public static String ATK_SPEED(){ String xATK_SPEED = "ATK_SPEED"; return xATK_SPEED; } // int
public static String ATK_FIRE(){ String xATK_FIRE = "ATK_FIRE"; return xATK_FIRE; } // int
public static String ATK_LIGHT(){ String xATK_LIGHT = "ATK_LIGHT"; return xATK_LIGHT; } // int
public static String ATK_WIND(){ String xATK_WIND = "ATK_WIND"; return xATK_WIND; } // int
public static String ATK_ICE(){ String xATK_ICE = "ATK_ICE"; return xATK_ICE; } // int
public static String ATK_POISON(){ String xATK_POISON = "ATK_POISON"; return xATK_POISON; } // int
public static String DEF_FIRE(){ String xDEF_FIRE = "DEF_FIRE"; return xDEF_FIRE; } // int
public static String DEF_LIGHT(){ String xDEF_LIGHT = "DEF_LIGHT"; return xDEF_LIGHT; } // int
public static String DEF_WIND(){ String xDEF_WIND = "DEF_WIND"; return xDEF_WIND; } // int
public static String DEF_ICE(){ String xDEF_ICE = "DEF_ICE"; return xDEF_ICE; } // int
public static String DEF_POISON(){ String xDEF_POISON = "DEF_POISON"; return xDEF_POISON; } // int
public static String DIZZY_GATE(){ String xDIZZY_GATE = "DIZZY_GATE"; return xDIZZY_GATE; } // int
public static String MOVE_GATE(){ String xMOVE_GATE = "MOVE_GATE"; return xMOVE_GATE; } // int
public static String SKILL_GATE(){ String xSKILL_GATE = "SKILL_GATE"; return xSKILL_GATE; } // int
public static String PHYSICAL_GATE(){ String xPHYSICAL_GATE = "PHYSICAL_GATE"; return xPHYSICAL_GATE; } // int
public static String MAGIC_GATE(){ String xMAGIC_GATE = "MAGIC_GATE"; return xMAGIC_GATE; } // int
public static String BUFF_GATE(){ String xBUFF_GATE = "BUFF_GATE"; return xBUFF_GATE; } // int
// Record
};
public static class Equip{
//Class name
public static String ThisName(){ String xEquip = "Equip"; return xEquip; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Sex(){ String xSex = "Sex"; return xSex; } // int
public static String IntensiveBuffList(){ String xIntensiveBuffList = "IntensiveBuffList"; return xIntensiveBuffList; } // string
public static String EnchantmentBuffList(){ String xEnchantmentBuffList = "EnchantmentBuffList"; return xEnchantmentBuffList; } // string
public static String SuitID(){ String xSuitID = "SuitID"; return xSuitID; } // int
public static String SuitBuffID(){ String xSuitBuffID = "SuitBuffID"; return xSuitBuffID; } // string
public static String ItemType(){ String xItemType = "ItemType"; return xItemType; } // int
public static String ItemSubType(){ String xItemSubType = "ItemSubType"; return xItemSubType; } // int
public static String Level(){ String xLevel = "Level"; return xLevel; } // int
public static String Job(){ String xJob = "Job"; return xJob; } // string
public static String Quality(){ String xQuality = "Quality"; return xQuality; } // int
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String Desc(){ String xDesc = "Desc"; return xDesc; } // string
public static String EffectData(){ String xEffectData = "EffectData"; return xEffectData; } // string
public static String PrefabPath(){ String xPrefabPath = "PrefabPath"; return xPrefabPath; } // string
public static String DropPrePath(){ String xDropPrePath = "DropPrePath"; return xDropPrePath; } // string
public static String BuyPrice(){ String xBuyPrice = "BuyPrice"; return xBuyPrice; } // int
public static String SalePrice(){ String xSalePrice = "SalePrice"; return xSalePrice; } // int
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
// Record
};
public static class Guild{
//Class name
public static String ThisName(){ String xGuild = "Guild"; return xGuild; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Name(){ String xName = "Name"; return xName; } // string
public static String PresidentID(){ String xPresidentID = "PresidentID"; return xPresidentID; } // object
public static String PresidentName(){ String xPresidentName = "PresidentName"; return xPresidentName; } // string
public static String Rank(){ String xRank = "Rank"; return xRank; } // int
public static String GuildAD(){ String xGuildAD = "GuildAD"; return xGuildAD; } // string
public static String GuildDesc(){ String xGuildDesc = "GuildDesc"; return xGuildDesc; } // string
public static String GuildMoney(){ String xGuildMoney = "GuildMoney"; return xGuildMoney; } // int
public static String GuildLevel(){ String xGuildLevel = "GuildLevel"; return xGuildLevel; } // int
public static String GuildContinueDay(){ String xGuildContinueDay = "GuildContinueDay"; return xGuildContinueDay; } // int
public static String GuildID(){ String xGuildID = "GuildID"; return xGuildID; } // object
public static String GuildIcon(){ String xGuildIcon = "GuildIcon"; return xGuildIcon; } // int
public static String GuildMemeberCount(){ String xGuildMemeberCount = "GuildMemeberCount"; return xGuildMemeberCount; } // int
public static String GuildMemeberMaxCount(){ String xGuildMemeberMaxCount = "GuildMemeberMaxCount"; return xGuildMemeberMaxCount; } // int
public static String GuildHonor(){ String xGuildHonor = "GuildHonor"; return xGuildHonor; } // int
public static String GuildCreateTime(){ String xGuildCreateTime = "GuildCreateTime"; return xGuildCreateTime; } // int
public static String GuildCreateter(){ String xGuildCreateter = "GuildCreateter"; return xGuildCreateter; } // int
public static String GuildExp(){ String xGuildExp = "GuildExp"; return xGuildExp; } // int
public static String GuildStatus(){ String xGuildStatus = "GuildStatus"; return xGuildStatus; } // int
public static String DismissTime(){ String xDismissTime = "DismissTime"; return xDismissTime; } // int
public static String RecruitAD(){ String xRecruitAD = "RecruitAD"; return xRecruitAD; } // string
public static String RecruitLevel(){ String xRecruitLevel = "RecruitLevel"; return xRecruitLevel; } // int
public static String KingWarResource(){ String xKingWarResource = "KingWarResource"; return xKingWarResource; } // int
public static String AutoRecruit(){ String xAutoRecruit = "AutoRecruit"; return xAutoRecruit; } // string
public static String EctypServer(){ String xEctypServer = "EctypServer"; return xEctypServer; } // int
public static String EctypID(){ String xEctypID = "EctypID"; return xEctypID; } // int
public static String EctypIDGroup(){ String xEctypIDGroup = "EctypIDGroup"; return xEctypIDGroup; } // int
// Record
public static String R_GuildBoss(){ String xGuildBoss = "GuildBoss"; return xGuildBoss;}
public static String R_GuildMemberList(){ String xGuildMemberList = "GuildMemberList"; return xGuildMemberList;}
public static String R_GuildAppyList(){ String xGuildAppyList = "GuildAppyList"; return xGuildAppyList;}
public static String R_GuildEvent(){ String xGuildEvent = "GuildEvent"; return xGuildEvent;}
public static String R_GuildHouse(){ String xGuildHouse = "GuildHouse"; return xGuildHouse;}
public static String R_GuildSkill(){ String xGuildSkill = "GuildSkill"; return xGuildSkill;}
public static enum GuildBoss
{
GuildBoss_GUID(0), // GUID -- object
GuildBoss_Name(1), // Name -- string
GuildBoss_Level(2), // Level -- int
GuildBoss_Job(3), // Job -- int
GuildBoss_Donation(4), // Donation -- int
GuildBoss_VIP(5), // VIP -- int
GuildBoss_Offline(6), // Offline -- int
GuildBoss_Power(7); // Power -- int
private int _value;
private GuildBoss(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildBoss get(int ntype)
{
for (int i = 0; i < GuildBoss.values().length; i++) {
GuildBoss val=GuildBoss.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum GuildMemberList
{
GuildMemberList_GUID(0), // GUID -- object
GuildMemberList_Name(1), // Name -- string
GuildMemberList_Level(2), // Level -- int
GuildMemberList_Job(3), // Job -- int
GuildMemberList_Donation(4), // Donation -- int
GuildMemberList_Receive(5), // Receive -- int
GuildMemberList_VIP(6), // VIP -- int
GuildMemberList_Online(7), // Online -- int
GuildMemberList_Power(8), // Power -- int
GuildMemberList_Title(9), // Title -- int
GuildMemberList_GameID(10), // GameID -- int
GuildMemberList_JoinTime(11), // JoinTime -- int
GuildMemberList_Contribution(12), // Contribution -- int
GuildMemberList_AllContribution(13); // AllContribution -- int
private int _value;
private GuildMemberList(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildMemberList get(int ntype)
{
for (int i = 0; i < GuildMemberList.values().length; i++) {
GuildMemberList val=GuildMemberList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum GuildAppyList
{
GuildAppyList_GUID(0), // GUID -- object
GuildAppyList_Name(1), // Name -- string
GuildAppyList_Level(2), // Level -- int
GuildAppyList_Job(3), // Job -- int
GuildAppyList_Donation(4), // Donation -- int
GuildAppyList_VIP(5), // VIP -- int
GuildAppyList_Power(6); // Power -- int
private int _value;
private GuildAppyList(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildAppyList get(int ntype)
{
for (int i = 0; i < GuildAppyList.values().length; i++) {
GuildAppyList val=GuildAppyList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum GuildEvent
{
GuildEvent_GUID(0), // GUID -- object
GuildEvent_Name(1), // Name -- string
GuildEvent_Level(2), // Level -- int
GuildEvent_Job(3), // Job -- int
GuildEvent_Donation(4), // Donation -- int
GuildEvent_VIP(5), // VIP -- int
GuildEvent_Offline(6), // Offline -- int
GuildEvent_Power(7), // Power -- int
GuildEvent_EventID(8), // EventID -- int
GuildEvent_EventTime(9), // EventTime -- int
GuildEvent_Context(10); // Context -- string
private int _value;
private GuildEvent(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildEvent get(int ntype)
{
for (int i = 0; i < GuildEvent.values().length; i++) {
GuildEvent val=GuildEvent.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum GuildHouse
{
GuildHouse_GUID(0), // GUID -- object
GuildHouse_Name(1), // Name -- string
GuildHouse_Level(2), // Level -- int
GuildHouse_Job(3), // Job -- int
GuildHouse_Donation(4), // Donation -- int
GuildHouse_VIP(5), // VIP -- int
GuildHouse_Offline(6), // Offline -- int
GuildHouse_Power(7); // Power -- int
private int _value;
private GuildHouse(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildHouse get(int ntype)
{
for (int i = 0; i < GuildHouse.values().length; i++) {
GuildHouse val=GuildHouse.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum GuildSkill
{
GuildSkill_GUID(0), // GUID -- object
GuildSkill_Name(1), // Name -- string
GuildSkill_Level(2), // Level -- int
GuildSkill_Job(3), // Job -- int
GuildSkill_Donation(4), // Donation -- int
GuildSkill_VIP(5), // VIP -- int
GuildSkill_Offline(6), // Offline -- int
GuildSkill_Power(7); // Power -- int
private int _value;
private GuildSkill(int value) {
_value = value;
}
public int value() {
return _value;
}
public GuildSkill get(int ntype)
{
for (int i = 0; i < GuildSkill.values().length; i++) {
GuildSkill val=GuildSkill.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
};
public static class GuildConfig{
//Class name
public static String ThisName(){ String xGuildConfig = "GuildConfig"; return xGuildConfig; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ConditionPlayerLevel(){ String xConditionPlayerLevel = "ConditionPlayerLevel"; return xConditionPlayerLevel; } // int
public static String ConditionPlayerVIP(){ String xConditionPlayerVIP = "ConditionPlayerVIP"; return xConditionPlayerVIP; } // int
public static String CostMoney(){ String xCostMoney = "CostMoney"; return xCostMoney; } // int
public static String DismissTime(){ String xDismissTime = "DismissTime"; return xDismissTime; } // int
public static String GuildLevel(){ String xGuildLevel = "GuildLevel"; return xGuildLevel; } // int
public static String MaxMember(){ String xMaxMember = "MaxMember"; return xMaxMember; } // int
// Record
};
public static class GuildJob{
//Class name
public static String ThisName(){ String xGuildJob = "GuildJob"; return xGuildJob; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Job(){ String xJob = "Job"; return xJob; } // int
public static String JobCount(){ String xJobCount = "JobCount"; return xJobCount; } // object
public static String Appoint(){ String xAppoint = "Appoint"; return xAppoint; } // object
public static String Fire(){ String xFire = "Fire"; return xFire; } // object
public static String Demise(){ String xDemise = "Demise"; return xDemise; } // object
public static String ApplyDismiss(){ String xApplyDismiss = "ApplyDismiss"; return xApplyDismiss; } // object
public static String StopDismiss(){ String xStopDismiss = "StopDismiss"; return xStopDismiss; } // object
public static String AcceptApply(){ String xAcceptApply = "AcceptApply"; return xAcceptApply; } // object
public static String DenyApply(){ String xDenyApply = "DenyApply"; return xDenyApply; } // object
public static String Kickout(){ String xKickout = "Kickout"; return xKickout; } // object
public static String SetRecruit(){ String xSetRecruit = "SetRecruit"; return xSetRecruit; } // object
public static String PublishRecruit(){ String xPublishRecruit = "PublishRecruit"; return xPublishRecruit; } // object
public static String EditAD(){ String xEditAD = "EditAD"; return xEditAD; } // object
public static String Leave(){ String xLeave = "Leave"; return xLeave; } // object
public static String LevelUp(){ String xLevelUp = "LevelUp"; return xLevelUp; } // object
// Record
};
public static class GuildName{
//Class name
public static String ThisName(){ String xGuildName = "GuildName"; return xGuildName; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String GuildID(){ String xGuildID = "GuildID"; return xGuildID; } // object
// Record
};
public static class HttpServer{
//Class name
public static String ThisName(){ String xHttpServer = "HttpServer"; return xHttpServer; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ServerID(){ String xServerID = "ServerID"; return xServerID; } // int
public static String WebPort(){ String xWebPort = "WebPort"; return xWebPort; } // int
public static String WebRootPath(){ String xWebRootPath = "WebRootPath"; return xWebRootPath; } // string
// Record
};
public static class InitProperty{
//Class name
public static String ThisName(){ String xInitProperty = "InitProperty"; return xInitProperty; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Job(){ String xJob = "Job"; return xJob; } // int
public static String Level(){ String xLevel = "Level"; return xLevel; } // int
public static String EffectData(){ String xEffectData = "EffectData"; return xEffectData; } // string
public static String SkillIDRef(){ String xSkillIDRef = "SkillIDRef"; return xSkillIDRef; } // string
public static String ModelPtah(){ String xModelPtah = "ModelPtah"; return xModelPtah; } // string
// Record
};
public static class Item{
//Class name
public static String ThisName(){ String xItem = "Item"; return xItem; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ItemType(){ String xItemType = "ItemType"; return xItemType; } // int
public static String ItemSubType(){ String xItemSubType = "ItemSubType"; return xItemSubType; } // int
public static String Level(){ String xLevel = "Level"; return xLevel; } // int
public static String Job(){ String xJob = "Job"; return xJob; } // string
public static String Quality(){ String xQuality = "Quality"; return xQuality; } // int
public static String DescID(){ String xDescID = "DescID"; return xDescID; } // string
public static String EffectData(){ String xEffectData = "EffectData"; return xEffectData; } // string
public static String ConsumeData(){ String xConsumeData = "ConsumeData"; return xConsumeData; } // string
public static String AwardData(){ String xAwardData = "AwardData"; return xAwardData; } // string
public static String AwardProperty(){ String xAwardProperty = "AwardProperty"; return xAwardProperty; } // int
public static String CoolDownTime(){ String xCoolDownTime = "CoolDownTime"; return xCoolDownTime; } // float
public static String OverlayCount(){ String xOverlayCount = "OverlayCount"; return xOverlayCount; } // int
public static String ExpiredType(){ String xExpiredType = "ExpiredType"; return xExpiredType; } // int
public static String BuyPrice(){ String xBuyPrice = "BuyPrice"; return xBuyPrice; } // int
public static String SalePrice(){ String xSalePrice = "SalePrice"; return xSalePrice; } // int
public static String Script(){ String xScript = "Script"; return xScript; } // string
public static String Extend(){ String xExtend = "Extend"; return xExtend; } // string
public static String SpriteFile(){ String xSpriteFile = "SpriteFile"; return xSpriteFile; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String HeroTye(){ String xHeroTye = "HeroTye"; return xHeroTye; } // int
// Record
};
public static class Language{
//Class name
public static String ThisName(){ String xLanguage = "Language"; return xLanguage; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String English(){ String xEnglish = "English"; return xEnglish; } // string
public static String Chinese(){ String xChinese = "Chinese"; return xChinese; } // string
// Record
};
public static class Map{
//Class name
public static String ThisName(){ String xMap = "Map"; return xMap; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String MaxCount(){ String xMaxCount = "MaxCount"; return xMaxCount; } // int
public static String InComeGold(){ String xInComeGold = "InComeGold"; return xInComeGold; } // int
public static String InComeDiamond(){ String xInComeDiamond = "InComeDiamond"; return xInComeDiamond; } // int
public static String InComeOil(){ String xInComeOil = "InComeOil"; return xInComeOil; } // int
public static String MapLevel(){ String xMapLevel = "MapLevel"; return xMapLevel; } // int
// Record
public static String R_Station(){ String xStation = "Station"; return xStation;}
public static enum Station
{
Station_GUID(0), // GUID -- object
Station_GuildID(1), // GuildID -- object
Station_GuildName(2), // GuildName -- string
Station_Level(3), // Level -- int
Station_Title(4), // Title -- string
Station_Slogan(5), // Slogan -- string
Station_State(6), // State -- int
Station_CurMemberCount(7), // CurMemberCount -- int
Station_WinCount(8); // WinCount -- int
private int _value;
private Station(int value) {
_value = value;
}
public int value() {
return _value;
}
public Station get(int ntype)
{
for (int i = 0; i < Station.values().length; i++) {
Station val=Station.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
};
public static class NoSqlServer{
//Class name
public static String ThisName(){ String xNoSqlServer = "NoSqlServer"; return xNoSqlServer; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ServerID(){ String xServerID = "ServerID"; return xServerID; } // int
public static String IP(){ String xIP = "IP"; return xIP; } // string
public static String Port(){ String xPort = "Port"; return xPort; } // int
public static String Auth(){ String xAuth = "Auth"; return xAuth; } // string
// Record
};
public static class NPC{
//Class name
public static String ThisName(){ String xNPC = "NPC"; return xNPC; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String SeedID(){ String xSeedID = "SeedID"; return xSeedID; } // string
public static String VIPEXP(){ String xVIPEXP = "VIPEXP"; return xVIPEXP; } // int
public static String EXP(){ String xEXP = "EXP"; return xEXP; } // int
public static String HP(){ String xHP = "HP"; return xHP; } // int
public static String SP(){ String xSP = "SP"; return xSP; } // int
public static String MP(){ String xMP = "MP"; return xMP; } // int
public static String Gold(){ String xGold = "Gold"; return xGold; } // int
public static String Money(){ String xMoney = "Money"; return xMoney; } // int
public static String TargetX(){ String xTargetX = "TargetX"; return xTargetX; } // float
public static String TargetY(){ String xTargetY = "TargetY"; return xTargetY; } // float
public static String Prefab(){ String xPrefab = "Prefab"; return xPrefab; } // string
public static String MoveType(){ String xMoveType = "MoveType"; return xMoveType; } // int
public static String AtkDis(){ String xAtkDis = "AtkDis"; return xAtkDis; } // float
public static String DropPackList(){ String xDropPackList = "DropPackList"; return xDropPackList; } // string
public static String SkillIDRef(){ String xSkillIDRef = "SkillIDRef"; return xSkillIDRef; } // string
public static String Height(){ String xHeight = "Height"; return xHeight; } // float
public static String EffectData(){ String xEffectData = "EffectData"; return xEffectData; } // string
public static String ConsumeData(){ String xConsumeData = "ConsumeData"; return xConsumeData; } // string
public static String LastAttacker(){ String xLastAttacker = "LastAttacker"; return xLastAttacker; } // object
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String EquipIDRef(){ String xEquipIDRef = "EquipIDRef"; return xEquipIDRef; } // string
public static String SpriteFile(){ String xSpriteFile = "SpriteFile"; return xSpriteFile; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String ShowCard(){ String xShowCard = "ShowCard"; return xShowCard; } // string
public static String HeroType(){ String xHeroType = "HeroType"; return xHeroType; } // int
public static String Camp(){ String xCamp = "Camp"; return xCamp; } // int
public static String MasterID(){ String xMasterID = "MasterID"; return xMasterID; } // object
public static String NPCType(){ String xNPCType = "NPCType"; return xNPCType; } // int
public static String SUCKBLOOD(){ String xSUCKBLOOD = "SUCKBLOOD"; return xSUCKBLOOD; } // int
public static String REFLECTDAMAGE(){ String xREFLECTDAMAGE = "REFLECTDAMAGE"; return xREFLECTDAMAGE; } // int
public static String CRITICAL(){ String xCRITICAL = "CRITICAL"; return xCRITICAL; } // int
public static String MAXHP(){ String xMAXHP = "MAXHP"; return xMAXHP; } // int
public static String MAXMP(){ String xMAXMP = "MAXMP"; return xMAXMP; } // int
public static String MAXSP(){ String xMAXSP = "MAXSP"; return xMAXSP; } // int
public static String HPREGEN(){ String xHPREGEN = "HPREGEN"; return xHPREGEN; } // int
public static String SPREGEN(){ String xSPREGEN = "SPREGEN"; return xSPREGEN; } // int
public static String MPREGEN(){ String xMPREGEN = "MPREGEN"; return xMPREGEN; } // int
public static String ATK_VALUE(){ String xATK_VALUE = "ATK_VALUE"; return xATK_VALUE; } // int
public static String DEF_VALUE(){ String xDEF_VALUE = "DEF_VALUE"; return xDEF_VALUE; } // int
public static String MOVE_SPEED(){ String xMOVE_SPEED = "MOVE_SPEED"; return xMOVE_SPEED; } // int
public static String ATK_SPEED(){ String xATK_SPEED = "ATK_SPEED"; return xATK_SPEED; } // int
public static String ATK_FIRE(){ String xATK_FIRE = "ATK_FIRE"; return xATK_FIRE; } // int
public static String ATK_LIGHT(){ String xATK_LIGHT = "ATK_LIGHT"; return xATK_LIGHT; } // int
public static String ATK_WIND(){ String xATK_WIND = "ATK_WIND"; return xATK_WIND; } // int
public static String ATK_ICE(){ String xATK_ICE = "ATK_ICE"; return xATK_ICE; } // int
public static String ATK_POISON(){ String xATK_POISON = "ATK_POISON"; return xATK_POISON; } // int
public static String DEF_FIRE(){ String xDEF_FIRE = "DEF_FIRE"; return xDEF_FIRE; } // int
public static String DEF_LIGHT(){ String xDEF_LIGHT = "DEF_LIGHT"; return xDEF_LIGHT; } // int
public static String DEF_WIND(){ String xDEF_WIND = "DEF_WIND"; return xDEF_WIND; } // int
public static String DEF_ICE(){ String xDEF_ICE = "DEF_ICE"; return xDEF_ICE; } // int
public static String DEF_POISON(){ String xDEF_POISON = "DEF_POISON"; return xDEF_POISON; } // int
public static String DIZZY_GATE(){ String xDIZZY_GATE = "DIZZY_GATE"; return xDIZZY_GATE; } // int
public static String MOVE_GATE(){ String xMOVE_GATE = "MOVE_GATE"; return xMOVE_GATE; } // int
public static String SKILL_GATE(){ String xSKILL_GATE = "SKILL_GATE"; return xSKILL_GATE; } // int
public static String PHYSICAL_GATE(){ String xPHYSICAL_GATE = "PHYSICAL_GATE"; return xPHYSICAL_GATE; } // int
public static String MAGIC_GATE(){ String xMAGIC_GATE = "MAGIC_GATE"; return xMAGIC_GATE; } // int
public static String BUFF_GATE(){ String xBUFF_GATE = "BUFF_GATE"; return xBUFF_GATE; } // int
// Record
};
public static class Player{
//Class name
public static String ThisName(){ String xPlayer = "Player"; return xPlayer; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Name(){ String xName = "Name"; return xName; } // string
public static String Sex(){ String xSex = "Sex"; return xSex; } // int
public static String Race(){ String xRace = "Race"; return xRace; } // int
public static String Camp(){ String xCamp = "Camp"; return xCamp; } // int
public static String HomeSceneID(){ String xHomeSceneID = "HomeSceneID"; return xHomeSceneID; } // int
public static String Level(){ String xLevel = "Level"; return xLevel; } // int
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String PrefabPath(){ String xPrefabPath = "PrefabPath"; return xPrefabPath; } // string
public static String FirstTarget(){ String xFirstTarget = "FirstTarget"; return xFirstTarget; } // object
public static String CharType(){ String xCharType = "CharType"; return xCharType; } // int
public static String Job(){ String xJob = "Job"; return xJob; } // int
public static String VIPLevel(){ String xVIPLevel = "VIPLevel"; return xVIPLevel; } // int
public static String VIPEXP(){ String xVIPEXP = "VIPEXP"; return xVIPEXP; } // int
public static String EXP(){ String xEXP = "EXP"; return xEXP; } // int
public static String HP(){ String xHP = "HP"; return xHP; } // int
public static String SP(){ String xSP = "SP"; return xSP; } // int
public static String MP(){ String xMP = "MP"; return xMP; } // int
public static String Gold(){ String xGold = "Gold"; return xGold; } // int
public static String Money(){ String xMoney = "Money"; return xMoney; } // int
public static String Account(){ String xAccount = "Account"; return xAccount; } // string
public static String ConnectKey(){ String xConnectKey = "ConnectKey"; return xConnectKey; } // string
public static String MAXEXP(){ String xMAXEXP = "MAXEXP"; return xMAXEXP; } // int
public static String RELIVE_SOUL(){ String xRELIVE_SOUL = "RELIVE_SOUL"; return xRELIVE_SOUL; } // int
public static String ATK_PVP(){ String xATK_PVP = "ATK_PVP"; return xATK_PVP; } // int
public static String DEF_PVP(){ String xDEF_PVP = "DEF_PVP"; return xDEF_PVP; } // int
public static String OnlineCount(){ String xOnlineCount = "OnlineCount"; return xOnlineCount; } // int
public static String TotalTime(){ String xTotalTime = "TotalTime"; return xTotalTime; } // int
public static String LastOfflineTime(){ String xLastOfflineTime = "LastOfflineTime"; return xLastOfflineTime; } // object
public static String OnlineTime(){ String xOnlineTime = "OnlineTime"; return xOnlineTime; } // object
public static String TotalLineTime(){ String xTotalLineTime = "TotalLineTime"; return xTotalLineTime; } // object
public static String GMLevel(){ String xGMLevel = "GMLevel"; return xGMLevel; } // int
public static String GameID(){ String xGameID = "GameID"; return xGameID; } // int
public static String GateID(){ String xGateID = "GateID"; return xGateID; } // int
public static String GuildID(){ String xGuildID = "GuildID"; return xGuildID; } // object
public static String TeamID(){ String xTeamID = "TeamID"; return xTeamID; } // object
public static String ViewOppnent(){ String xViewOppnent = "ViewOppnent"; return xViewOppnent; } // object
public static String FightOppnent(){ String xFightOppnent = "FightOppnent"; return xFightOppnent; } // object
public static String GambleGold(){ String xGambleGold = "GambleGold"; return xGambleGold; } // int
public static String GambleDiamond(){ String xGambleDiamond = "GambleDiamond"; return xGambleDiamond; } // int
public static String SUCKBLOOD(){ String xSUCKBLOOD = "SUCKBLOOD"; return xSUCKBLOOD; } // int
public static String REFLECTDAMAGE(){ String xREFLECTDAMAGE = "REFLECTDAMAGE"; return xREFLECTDAMAGE; } // int
public static String CRITICAL(){ String xCRITICAL = "CRITICAL"; return xCRITICAL; } // int
public static String MAXHP(){ String xMAXHP = "MAXHP"; return xMAXHP; } // int
public static String MAXMP(){ String xMAXMP = "MAXMP"; return xMAXMP; } // int
public static String MAXSP(){ String xMAXSP = "MAXSP"; return xMAXSP; } // int
public static String HPREGEN(){ String xHPREGEN = "HPREGEN"; return xHPREGEN; } // int
public static String SPREGEN(){ String xSPREGEN = "SPREGEN"; return xSPREGEN; } // int
public static String MPREGEN(){ String xMPREGEN = "MPREGEN"; return xMPREGEN; } // int
public static String ATK_VALUE(){ String xATK_VALUE = "ATK_VALUE"; return xATK_VALUE; } // int
public static String DEF_VALUE(){ String xDEF_VALUE = "DEF_VALUE"; return xDEF_VALUE; } // int
public static String MOVE_SPEED(){ String xMOVE_SPEED = "MOVE_SPEED"; return xMOVE_SPEED; } // int
public static String ATK_SPEED(){ String xATK_SPEED = "ATK_SPEED"; return xATK_SPEED; } // int
public static String ATK_FIRE(){ String xATK_FIRE = "ATK_FIRE"; return xATK_FIRE; } // int
public static String ATK_LIGHT(){ String xATK_LIGHT = "ATK_LIGHT"; return xATK_LIGHT; } // int
public static String ATK_WIND(){ String xATK_WIND = "ATK_WIND"; return xATK_WIND; } // int
public static String ATK_ICE(){ String xATK_ICE = "ATK_ICE"; return xATK_ICE; } // int
public static String ATK_POISON(){ String xATK_POISON = "ATK_POISON"; return xATK_POISON; } // int
public static String DEF_FIRE(){ String xDEF_FIRE = "DEF_FIRE"; return xDEF_FIRE; } // int
public static String DEF_LIGHT(){ String xDEF_LIGHT = "DEF_LIGHT"; return xDEF_LIGHT; } // int
public static String DEF_WIND(){ String xDEF_WIND = "DEF_WIND"; return xDEF_WIND; } // int
public static String DEF_ICE(){ String xDEF_ICE = "DEF_ICE"; return xDEF_ICE; } // int
public static String DEF_POISON(){ String xDEF_POISON = "DEF_POISON"; return xDEF_POISON; } // int
public static String DIZZY_GATE(){ String xDIZZY_GATE = "DIZZY_GATE"; return xDIZZY_GATE; } // int
public static String MOVE_GATE(){ String xMOVE_GATE = "MOVE_GATE"; return xMOVE_GATE; } // int
public static String SKILL_GATE(){ String xSKILL_GATE = "SKILL_GATE"; return xSKILL_GATE; } // int
public static String PHYSICAL_GATE(){ String xPHYSICAL_GATE = "PHYSICAL_GATE"; return xPHYSICAL_GATE; } // int
public static String MAGIC_GATE(){ String xMAGIC_GATE = "MAGIC_GATE"; return xMAGIC_GATE; } // int
public static String BUFF_GATE(){ String xBUFF_GATE = "BUFF_GATE"; return xBUFF_GATE; } // int
// Record
public static String R_PlayerHero(){ String xPlayerHero = "PlayerHero"; return xPlayerHero;}
public static String R_PlayerFightHero(){ String xPlayerFightHero = "PlayerFightHero"; return xPlayerFightHero;}
public static String R_HeroPropertyValue(){ String xHeroPropertyValue = "HeroPropertyValue"; return xHeroPropertyValue;}
public static String R_BagEquipList(){ String xBagEquipList = "BagEquipList"; return xBagEquipList;}
public static String R_BagItemList(){ String xBagItemList = "BagItemList"; return xBagItemList;}
public static String R_CommPropertyValue(){ String xCommPropertyValue = "CommPropertyValue"; return xCommPropertyValue;}
public static String R_TaskMonsterList(){ String xTaskMonsterList = "TaskMonsterList"; return xTaskMonsterList;}
public static String R_TaskList(){ String xTaskList = "TaskList"; return xTaskList;}
public static String R_BuildingList(){ String xBuildingList = "BuildingList"; return xBuildingList;}
public static String R_BuildingListProduce(){ String xBuildingListProduce = "BuildingListProduce"; return xBuildingListProduce;}
public static enum PlayerHero
{
PlayerHero_GUID(0), // GUID -- object
PlayerHero_ConfigID(1), // ConfigID -- string
PlayerHero_Level(2), // Level -- int
PlayerHero_Exp(3), // Exp -- int
PlayerHero_Star(4), // Star -- int
PlayerHero_Equip1(5), // Equip1 -- object
PlayerHero_Equip2(6), // Equip2 -- object
PlayerHero_Equip3(7), // Equip3 -- object
PlayerHero_Equip4(8), // Equip4 -- object
PlayerHero_Equip5(9), // Equip5 -- object
PlayerHero_Equip6(10), // Equip6 -- object
PlayerHero_Talent1(11), // Talent1 -- string
PlayerHero_Talent2(12), // Talent2 -- string
PlayerHero_Talent3(13), // Talent3 -- string
PlayerHero_Talent4(14), // Talent4 -- string
PlayerHero_Talent5(15), // Talent5 -- string
PlayerHero_Skill1(16), // Skill1 -- string
PlayerHero_Skill2(17), // Skill2 -- string
PlayerHero_Skill3(18), // Skill3 -- string
PlayerHero_Skill4(19), // Skill4 -- string
PlayerHero_Skill5(20), // Skill5 -- string
PlayerHero_FightSkill(21); // FightSkill -- string
private int _value;
private PlayerHero(int value) {
_value = value;
}
public int value() {
return _value;
}
public PlayerHero get(int ntype)
{
for (int i = 0; i < PlayerHero.values().length; i++) {
PlayerHero val=PlayerHero.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum PlayerFightHero
{
PlayerFightHero_GUID(0), // GUID -- object
PlayerFightHero_FightPos(1); // FightPos -- int
private int _value;
private PlayerFightHero(int value) {
_value = value;
}
public int value() {
return _value;
}
public PlayerFightHero get(int ntype)
{
for (int i = 0; i < PlayerFightHero.values().length; i++) {
PlayerFightHero val=PlayerFightHero.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum HeroPropertyValue
{
HeroPropertyValue_SUCKBLOOD ( 0), // SUCKBLOOD -- int
HeroPropertyValue_REFLECTDAMAGE ( 1), // REFLECTDAMAGE -- int
HeroPropertyValue_CRITICAL ( 2), // CRITICAL -- int
HeroPropertyValue_MAXHP ( 3), // MAXHP -- int
HeroPropertyValue_MAXMP ( 4), // MAXMP -- int
HeroPropertyValue_MAXSP ( 5), // MAXSP -- int
HeroPropertyValue_HPREGEN ( 6), // HPREGEN -- int
HeroPropertyValue_SPREGEN ( 7), // SPREGEN -- int
HeroPropertyValue_MPREGEN ( 8), // MPREGEN -- int
HeroPropertyValue_ATK_VALUE ( 9), // ATK_VALUE -- int
HeroPropertyValue_DEF_VALUE ( 10), // DEF_VALUE -- int
HeroPropertyValue_MOVE_SPEED ( 11), // MOVE_SPEED -- int
HeroPropertyValue_ATK_SPEED ( 12), // ATK_SPEED -- int
HeroPropertyValue_ATK_FIRE ( 13), // ATK_FIRE -- int
HeroPropertyValue_ATK_LIGHT ( 14), // ATK_LIGHT -- int
HeroPropertyValue_ATK_WIND ( 15), // ATK_WIND -- int
HeroPropertyValue_ATK_ICE ( 16), // ATK_ICE -- int
HeroPropertyValue_ATK_POISON ( 17), // ATK_POISON -- int
HeroPropertyValue_DEF_FIRE ( 18), // DEF_FIRE -- int
HeroPropertyValue_DEF_LIGHT ( 19), // DEF_LIGHT -- int
HeroPropertyValue_DEF_WIND ( 20), // DEF_WIND -- int
HeroPropertyValue_DEF_ICE ( 21), // DEF_ICE -- int
HeroPropertyValue_DEF_POISON ( 22), // DEF_POISON -- int
HeroPropertyValue_DIZZY_GATE ( 23), // DIZZY_GATE -- int
HeroPropertyValue_MOVE_GATE ( 24), // MOVE_GATE -- int
HeroPropertyValue_SKILL_GATE ( 25), // SKILL_GATE -- int
HeroPropertyValue_PHYSICAL_GATE ( 26), // PHYSICAL_GATE -- int
HeroPropertyValue_MAGIC_GATE ( 27), // MAGIC_GATE -- int
HeroPropertyValue_BUFF_GATE ( 28); // BUFF_GATE -- int
private int _value;
private HeroPropertyValue(int value) {
_value = value;
}
public int value() {
return _value;
}
public HeroPropertyValue get(int ntype)
{
for (int i = 0; i < HeroPropertyValue.values().length; i++) {
HeroPropertyValue val=HeroPropertyValue.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum BagEquipList
{
BagEquipList_GUID ( 0), // GUID -- object
BagEquipList_WearGUID ( 1), // WearGUID -- object
BagEquipList_ConfigID ( 2), // ConfigID -- string
BagEquipList_ExpiredType ( 3), // ExpiredType -- int
BagEquipList_Date ( 4), // Date -- int
BagEquipList_RandPropertyID ( 5), // RandPropertyID -- string
BagEquipList_SlotCount ( 6), // SlotCount -- int
BagEquipList_InlayStone1 ( 7), // InlayStone1 -- string
BagEquipList_InlayStone2 ( 8), // InlayStone2 -- string
BagEquipList_InlayStone3 ( 9), // InlayStone3 -- string
BagEquipList_InlayStone4 ( 10), // InlayStone4 -- string
BagEquipList_InlayStone5 ( 11), // InlayStone5 -- string
BagEquipList_InlayStone6 ( 12), // InlayStone6 -- string
BagEquipList_InlayStone7 ( 13), // InlayStone7 -- string
BagEquipList_InlayStone8 ( 14), // InlayStone8 -- string
BagEquipList_InlayStone9 ( 15), // InlayStone9 -- string
BagEquipList_InlayStone10 ( 16), // InlayStone10 -- string
BagEquipList_IntensifyLevel ( 17), // IntensifyLevel -- string
BagEquipList_ElementLevel1_FIRE ( 18), // ElementLevel1_FIRE -- int
BagEquipList_ElementLevel2_LIGHT ( 19), // ElementLevel2_LIGHT -- int
BagEquipList_ElementLevel3_Wind ( 20), // ElementLevel3_Wind -- int
BagEquipList_ElementLevel4_ICE ( 21), // ElementLevel4_ICE -- int
BagEquipList_ElementLevel5_POISON ( 22); // ElementLevel5_POISON -- int
private int _value;
private BagEquipList(int value) {
_value = value;
}
public int value() {
return _value;
}
public BagEquipList get(int ntype)
{
for (int i = 0; i < BagEquipList.values().length; i++) {
BagEquipList val=BagEquipList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum BagItemList
{
BagItemList_ConfigID ( 0), // ConfigID -- string
BagItemList_ItemCount ( 1), // ItemCount -- int
BagItemList_Bound ( 2), // Bound -- int
BagItemList_ExpiredType ( 3), // ExpiredType -- int
BagItemList_Date ( 4); // Date -- int
private int _value;
private BagItemList(int value) {
_value = value;
}
public int value() {
return _value;
}
public BagItemList get(int ntype)
{
for (int i = 0; i < BagItemList.values().length; i++) {
BagItemList val=BagItemList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum CommPropertyValue
{
CommPropertyValue_SUCKBLOOD ( 0), // SUCKBLOOD -- int
CommPropertyValue_REFLECTDAMAGE ( 1), // REFLECTDAMAGE -- int
CommPropertyValue_CRITICAL ( 2), // CRITICAL -- int
CommPropertyValue_MAXHP ( 3), // MAXHP -- int
CommPropertyValue_MAXMP ( 4), // MAXMP -- int
CommPropertyValue_MAXSP ( 5), // MAXSP -- int
CommPropertyValue_HPREGEN ( 6), // HPREGEN -- int
CommPropertyValue_SPREGEN ( 7), // SPREGEN -- int
CommPropertyValue_MPREGEN ( 8), // MPREGEN -- int
CommPropertyValue_ATK_VALUE ( 9), // ATK_VALUE -- int
CommPropertyValue_DEF_VALUE ( 10), // DEF_VALUE -- int
CommPropertyValue_MOVE_SPEED ( 11), // MOVE_SPEED -- int
CommPropertyValue_ATK_SPEED ( 12), // ATK_SPEED -- int
CommPropertyValue_ATK_FIRE ( 13), // ATK_FIRE -- int
CommPropertyValue_ATK_LIGHT ( 14), // ATK_LIGHT -- int
CommPropertyValue_ATK_WIND ( 15), // ATK_WIND -- int
CommPropertyValue_ATK_ICE ( 16), // ATK_ICE -- int
CommPropertyValue_ATK_POISON ( 17), // ATK_POISON -- int
CommPropertyValue_DEF_FIRE ( 18), // DEF_FIRE -- int
CommPropertyValue_DEF_LIGHT ( 19), // DEF_LIGHT -- int
CommPropertyValue_DEF_WIND ( 20), // DEF_WIND -- int
CommPropertyValue_DEF_ICE ( 21), // DEF_ICE -- int
CommPropertyValue_DEF_POISON ( 22), // DEF_POISON -- int
CommPropertyValue_DIZZY_GATE ( 23), // DIZZY_GATE -- int
CommPropertyValue_MOVE_GATE ( 24), // MOVE_GATE -- int
CommPropertyValue_SKILL_GATE ( 25), // SKILL_GATE -- int
CommPropertyValue_PHYSICAL_GATE ( 26), // PHYSICAL_GATE -- int
CommPropertyValue_MAGIC_GATE ( 27), // MAGIC_GATE -- int
CommPropertyValue_BUFF_GATE ( 28); // BUFF_GATE -- int
private int _value;
private CommPropertyValue(int value) {
_value = value;
}
public int value() {
return _value;
}
public CommPropertyValue get(int ntype)
{
for (int i = 0; i < CommPropertyValue.values().length; i++) {
CommPropertyValue val=CommPropertyValue.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum TaskMonsterList
{
TaskMonsterList_MonsterID ( 0), // MonsterID -- string
TaskMonsterList_CurrentKillCount ( 1), // CurrentKillCount -- int
TaskMonsterList_RequireKillCount ( 2), // RequireKillCount -- int
TaskMonsterList_TaskID ( 3); // TaskID -- string
private int _value;
private TaskMonsterList(int value) {
_value = value;
}
public int value() {
return _value;
}
public TaskMonsterList get(int ntype)
{
for (int i = 0; i < TaskMonsterList.values().length; i++) {
TaskMonsterList val=TaskMonsterList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum TaskList
{
TaskList_TaskID ( 0), // TaskID -- string
TaskList_TaskStatus ( 1), // TaskStatus -- int
TaskList_Process ( 2); // Process -- int
private int _value;
private TaskList(int value) {
_value = value;
}
public int value() {
return _value;
}
public TaskList get(int ntype)
{
for (int i = 0; i < TaskList.values().length; i++) {
TaskList val=TaskList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum BuildingList
{
BuildingList_BuildingID ( 0), // BuildingID -- string
BuildingList_BuildingGUID ( 1), // BuildingGUID -- object
BuildingList_State ( 2), // State -- int
BuildingList_PosX ( 3), // PosX -- int
BuildingList_PosY ( 4), // PosY -- int
BuildingList_PosZ ( 5), // PosZ -- int
BuildingList_StateStartTime ( 6), // StateStartTime -- int
BuildingList_StateEndTime ( 7); // StateEndTime -- int
private int _value;
private BuildingList(int value) {
_value = value;
}
public int value() {
return _value;
}
public BuildingList get(int ntype)
{
for (int i = 0; i < BuildingList.values().length; i++) {
BuildingList val=BuildingList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum BuildingListProduce
{
BuildingListProduce_BuildingID ( 0), // BuildingID -- string
BuildingListProduce_BuildingGUID ( 1), // BuildingGUID -- object
BuildingListProduce_State ( 2), // State -- int
BuildingListProduce_PosX ( 3), // PosX -- int
BuildingListProduce_PosY ( 4), // PosY -- int
BuildingListProduce_PosZ ( 5), // PosZ -- int
BuildingListProduce_StateStartTime ( 6), // StateStartTime -- int
BuildingListProduce_StateEndTime ( 7); // StateEndTime -- int
private int _value;
private BuildingListProduce(int value) {
_value = value;
}
public int value() {
return _value;
}
public BuildingListProduce get(int ntype)
{
for (int i = 0; i < BuildingListProduce.values().length; i++) {
BuildingListProduce val=BuildingListProduce.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
};
public static class Scene{
//Class name
public static String ThisName(){ String xScene = "Scene"; return xScene; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String SceneName(){ String xSceneName = "SceneName"; return xSceneName; } // string
public static String SceneShowName(){ String xSceneShowName = "SceneShowName"; return xSceneShowName; } // string
public static String MaxGroup(){ String xMaxGroup = "MaxGroup"; return xMaxGroup; } // int
public static String MaxGroupPlayers(){ String xMaxGroupPlayers = "MaxGroupPlayers"; return xMaxGroupPlayers; } // int
public static String FilePath(){ String xFilePath = "FilePath"; return xFilePath; } // string
public static String RelivePos(){ String xRelivePos = "RelivePos"; return xRelivePos; } // string
public static String Width(){ String xWidth = "Width"; return xWidth; } // int
public static String SoundList(){ String xSoundList = "SoundList"; return xSoundList; } // string
public static String Tile(){ String xTile = "Tile"; return xTile; } // int
public static String Share(){ String xShare = "Share"; return xShare; } // int
public static String CanClone(){ String xCanClone = "CanClone"; return xCanClone; } // int
public static String ActorID(){ String xActorID = "ActorID"; return xActorID; } // int
public static String LoadingUI(){ String xLoadingUI = "LoadingUI"; return xLoadingUI; } // string
public static String CamOffestPos(){ String xCamOffestPos = "CamOffestPos"; return xCamOffestPos; } // string
public static String CamOffestRot(){ String xCamOffestRot = "CamOffestRot"; return xCamOffestRot; } // string
public static String SyncObject(){ String xSyncObject = "SyncObject"; return xSyncObject; } // int
// Record
};
public static class Server{
//Class name
public static String ThisName(){ String xServer = "Server"; return xServer; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ServerID(){ String xServerID = "ServerID"; return xServerID; } // int
public static String Name(){ String xName = "Name"; return xName; } // string
public static String MaxOnline(){ String xMaxOnline = "MaxOnline"; return xMaxOnline; } // int
public static String CpuCount(){ String xCpuCount = "CpuCount"; return xCpuCount; } // int
public static String IP(){ String xIP = "IP"; return xIP; } // string
public static String Port(){ String xPort = "Port"; return xPort; } // int
public static String Type(){ String xType = "Type"; return xType; } // int
public static String Area(){ String xArea = "Area"; return xArea; } // int
// Record
};
public static class Shop{
//Class name
public static String ThisName(){ String xShop = "Shop"; return xShop; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Type(){ String xType = "Type"; return xType; } // int
public static String ItemID(){ String xItemID = "ItemID"; return xItemID; } // string
public static String Gold(){ String xGold = "Gold"; return xGold; } // int
public static String Steel(){ String xSteel = "Steel"; return xSteel; } // int
public static String Stone(){ String xStone = "Stone"; return xStone; } // int
public static String Diamond(){ String xDiamond = "Diamond"; return xDiamond; } // int
public static String Level(){ String xLevel = "Level"; return xLevel; } // int
public static String Count(){ String xCount = "Count"; return xCount; } // int
// Record
};
public static class Skill{
//Class name
public static String ThisName(){ String xSkill = "Skill"; return xSkill; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String SkillType(){ String xSkillType = "SkillType"; return xSkillType; } // int
public static String AnimaState(){ String xAnimaState = "AnimaState"; return xAnimaState; } // int
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String Desc(){ String xDesc = "Desc"; return xDesc; } // string
public static String ConsumeProperty(){ String xConsumeProperty = "ConsumeProperty"; return xConsumeProperty; } // string
public static String ConsumeValue(){ String xConsumeValue = "ConsumeValue"; return xConsumeValue; } // string
public static String ConsumeType(){ String xConsumeType = "ConsumeType"; return xConsumeType; } // int
public static String DamageProperty(){ String xDamageProperty = "DamageProperty"; return xDamageProperty; } // string
public static String DamageValue(){ String xDamageValue = "DamageValue"; return xDamageValue; } // string
public static String DamageType(){ String xDamageType = "DamageType"; return xDamageType; } // int
public static String GetBuffList(){ String xGetBuffList = "GetBuffList"; return xGetBuffList; } // string
public static String SendBuffList(){ String xSendBuffList = "SendBuffList"; return xSendBuffList; } // string
public static String CoolDownTime(){ String xCoolDownTime = "CoolDownTime"; return xCoolDownTime; } // float
public static String RequireDistance(){ String xRequireDistance = "RequireDistance"; return xRequireDistance; } // float
public static String DamageDistance(){ String xDamageDistance = "DamageDistance"; return xDamageDistance; } // float
public static String TargetType(){ String xTargetType = "TargetType"; return xTargetType; } // int
public static String NewObject(){ String xNewObject = "NewObject"; return xNewObject; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String Atlas(){ String xAtlas = "Atlas"; return xAtlas; } // string
public static String UpLevel(){ String xUpLevel = "UpLevel"; return xUpLevel; } // int
public static String AfterUpID(){ String xAfterUpID = "AfterUpID"; return xAfterUpID; } // string
public static String PlayerSkill(){ String xPlayerSkill = "PlayerSkill"; return xPlayerSkill; } // int
public static String AtkDis(){ String xAtkDis = "AtkDis"; return xAtkDis; } // float
public static String NeedTar(){ String xNeedTar = "NeedTar"; return xNeedTar; } // int
public static String DefaultHitTime(){ String xDefaultHitTime = "DefaultHitTime"; return xDefaultHitTime; } // float
// Record
};
public static class SkillRef{
//Class name
public static String ThisName(){ String xSkillRef = "SkillRef"; return xSkillRef; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String NORMALATTACK1(){ String xNORMALATTACK1 = "NORMALATTACK1"; return xNORMALATTACK1; } // string
public static String NORMALATTACK2(){ String xNORMALATTACK2 = "NORMALATTACK2"; return xNORMALATTACK2; } // string
public static String NORMALATTACK3(){ String xNORMALATTACK3 = "NORMALATTACK3"; return xNORMALATTACK3; } // string
public static String NORMALTHUMP(){ String xNORMALTHUMP = "NORMALTHUMP"; return xNORMALTHUMP; } // string
public static String SKILL1(){ String xSKILL1 = "SKILL1"; return xSKILL1; } // string
public static String SKILL2(){ String xSKILL2 = "SKILL2"; return xSKILL2; } // string
public static String SKILL3(){ String xSKILL3 = "SKILL3"; return xSKILL3; } // string
public static String SKILL4(){ String xSKILL4 = "SKILL4"; return xSKILL4; } // string
public static String SKILL5(){ String xSKILL5 = "SKILL5"; return xSKILL5; } // string
public static String SKILL6(){ String xSKILL6 = "SKILL6"; return xSKILL6; } // string
public static String SKILL7(){ String xSKILL7 = "SKILL7"; return xSKILL7; } // string
public static String SKILL8(){ String xSKILL8 = "SKILL8"; return xSKILL8; } // string
public static String SKILL9(){ String xSKILL9 = "SKILL9"; return xSKILL9; } // string
public static String SKILL10(){ String xSKILL10 = "SKILL10"; return xSKILL10; } // string
// Record
};
public static class SqlServer{
//Class name
public static String ThisName(){ String xSqlServer = "SqlServer"; return xSqlServer; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ServerID(){ String xServerID = "ServerID"; return xServerID; } // int
public static String IP(){ String xIP = "IP"; return xIP; } // string
public static String Port(){ String xPort = "Port"; return xPort; } // int
public static String SqlIP(){ String xSqlIP = "SqlIP"; return xSqlIP; } // string
public static String SqlPort(){ String xSqlPort = "SqlPort"; return xSqlPort; } // int
public static String SqlUser(){ String xSqlUser = "SqlUser"; return xSqlUser; } // string
public static String SqlPwd(){ String xSqlPwd = "SqlPwd"; return xSqlPwd; } // string
public static String SqlName(){ String xSqlName = "SqlName"; return xSqlName; } // string
// Record
};
public static class StateFuncResources{
//Class name
public static String ThisName(){ String xStateFuncResources = "StateFuncResources"; return xStateFuncResources; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Atlas_ResID(){ String xAtlas_ResID = "Atlas_ResID"; return xAtlas_ResID; } // string
// Record
};
public static class StateFunction{
//Class name
public static String ThisName(){ String xStateFunction = "StateFunction"; return xStateFunction; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String EFT_INFO(){ String xEFT_INFO = "EFT_INFO"; return xEFT_INFO; } // int
public static String EFT_BOOOST(){ String xEFT_BOOOST = "EFT_BOOOST"; return xEFT_BOOOST; } // int
public static String EFT_LVLUP(){ String xEFT_LVLUP = "EFT_LVLUP"; return xEFT_LVLUP; } // int
public static String EFT_CREATE_SOLDER(){ String xEFT_CREATE_SOLDER = "EFT_CREATE_SOLDER"; return xEFT_CREATE_SOLDER; } // int
public static String EFT_CREATE_SPEEL(){ String xEFT_CREATE_SPEEL = "EFT_CREATE_SPEEL"; return xEFT_CREATE_SPEEL; } // int
public static String EFT_RESEARCH(){ String xEFT_RESEARCH = "EFT_RESEARCH"; return xEFT_RESEARCH; } // int
public static String EFT_COLLECT_GOLD(){ String xEFT_COLLECT_GOLD = "EFT_COLLECT_GOLD"; return xEFT_COLLECT_GOLD; } // int
public static String EFT_COLLECT_STONE(){ String xEFT_COLLECT_STONE = "EFT_COLLECT_STONE"; return xEFT_COLLECT_STONE; } // int
public static String EFT_COLLECT_STEEL(){ String xEFT_COLLECT_STEEL = "EFT_COLLECT_STEEL"; return xEFT_COLLECT_STEEL; } // int
public static String EFT_COLLECT_DIAMOND(){ String xEFT_COLLECT_DIAMOND = "EFT_COLLECT_DIAMOND"; return xEFT_COLLECT_DIAMOND; } // int
public static String EFT_SELL(){ String xEFT_SELL = "EFT_SELL"; return xEFT_SELL; } // int
public static String EFT_REPAIR(){ String xEFT_REPAIR = "EFT_REPAIR"; return xEFT_REPAIR; } // int
public static String EFT_CANCEL(){ String xEFT_CANCEL = "EFT_CANCEL"; return xEFT_CANCEL; } // int
public static String EFT_FINISH(){ String xEFT_FINISH = "EFT_FINISH"; return xEFT_FINISH; } // int
// Record
};
public static class Talent{
//Class name
public static String ThisName(){ String xTalent = "Talent"; return xTalent; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String ShowName(){ String xShowName = "ShowName"; return xShowName; } // string
public static String Desc(){ String xDesc = "Desc"; return xDesc; } // string
public static String EffectData(){ String xEffectData = "EffectData"; return xEffectData; } // string
public static String Icon(){ String xIcon = "Icon"; return xIcon; } // string
public static String Atlas(){ String xAtlas = "Atlas"; return xAtlas; } // string
public static String UpLevel(){ String xUpLevel = "UpLevel"; return xUpLevel; } // int
public static String AfterUpID(){ String xAfterUpID = "AfterUpID"; return xAfterUpID; } // string
// Record
};
public static class Task{
//Class name
public static String ThisName(){ String xTask = "Task"; return xTask; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Type(){ String xType = "Type"; return xType; } // int
public static String NextTaskID(){ String xNextTaskID = "NextTaskID"; return xNextTaskID; } // string
public static String KillMonsterName(){ String xKillMonsterName = "KillMonsterName"; return xKillMonsterName; } // string
public static String KillCount(){ String xKillCount = "KillCount"; return xKillCount; } // string
public static String LevelReq(){ String xLevelReq = "LevelReq"; return xLevelReq; } // string
public static String AwardExp(){ String xAwardExp = "AwardExp"; return xAwardExp; } // int
public static String AwardGold(){ String xAwardGold = "AwardGold"; return xAwardGold; } // int
public static String AwardPack(){ String xAwardPack = "AwardPack"; return xAwardPack; } // string
public static String Desc(){ String xDesc = "Desc"; return xDesc; } // string
// Record
};
public static class Team{
//Class name
public static String ThisName(){ String xTeam = "Team"; return xTeam; }
// IObject
public static String ID(){ String xID = "ID"; return xID; } // string
public static String ClassName(){ String xClassName = "ClassName"; return xClassName; } // string
public static String SceneID(){ String xSceneID = "SceneID"; return xSceneID; } // int
public static String GroupID(){ String xGroupID = "GroupID"; return xGroupID; } // int
public static String ConfigID(){ String xConfigID = "ConfigID"; return xConfigID; } // string
public static String X(){ String xX = "X"; return xX; } // float
public static String Y(){ String xY = "Y"; return xY; } // float
public static String Z(){ String xZ = "Z"; return xZ; } // float
// Property
public static String Captain(){ String xCaptain = "Captain"; return xCaptain; } // object
public static String PresidentName(){ String xPresidentName = "PresidentName"; return xPresidentName; } // string
// Record
public static String R_MemberList(){ String xMemberList = "MemberList"; return xMemberList;}
public static String R_ApplyList(){ String xApplyList = "ApplyList"; return xApplyList;}
public static enum MemberList
{
MemberList_GUID ( 0), // GUID -- object
MemberList_Name ( 1), // Name -- string
MemberList_Level ( 2), // Level -- int
MemberList_Job ( 3), // Job -- int
MemberList_Donation ( 4), // Donation -- int
MemberList_Receive ( 5), // Receive -- int
MemberList_VIP ( 6), // VIP -- int
MemberList_Online ( 7), // Online -- int
MemberList_Title ( 8), // Title -- int
MemberList_GameID ( 9); // GameID -- int
private int _value;
private MemberList(int value) {
_value = value;
}
public int value() {
return _value;
}
public MemberList get(int ntype)
{
for (int i = 0; i < MemberList.values().length; i++) {
MemberList val=MemberList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
public static enum ApplyList
{
ApplyList_GUID ( 0), // GUID -- object
ApplyList_Name ( 1), // Name -- string
ApplyList_Level ( 2), // Level -- int
ApplyList_Job ( 3), // Job -- int
ApplyList_Donation ( 4), // Donation -- int
ApplyList_VIP ( 5), // VIP -- int
ApplyList_Power ( 6); // Power -- int
private int _value;
private ApplyList(int value) {
_value = value;
}
public int value() {
return _value;
}
public ApplyList get(int ntype)
{
for (int i = 0; i < ApplyList.values().length; i++) {
ApplyList val=ApplyList.values()[i];
if (val.value()==ntype) {
return val;
}
}
return null;
}
};
};
}
| [
"yideal_formula@126.com"
] | yideal_formula@126.com |
8bc7e34adcd767d1c186509380b1023171cd11cc | e4eeca227793998682d2657d7692c0ad86439260 | /spring5_cxf_hello/src/main/java/com/fred/spring/hello/HelloController.java | 1b19d9219af3c2fd3848c1386172bbaef155d86f | [] | no_license | fred-yu-2013/spring5_demo | 0dd243744c6a4f5cd48111248f2c9eb0f70fa5c2 | 6236a530be4f3b004717d9487837ed1b8be8a5dd | refs/heads/master | 2020-04-02T10:49:38.950045 | 2019-02-18T14:09:56 | 2019-02-18T14:09:56 | 154,357,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 407 | java | package com.fred.spring.hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* HelloController用于演示Hello工程,需要手动添加该类
*
* @author Fred
*/
@RestController
public class HelloController {
@RequestMapping("/hello")
public String hello() {
return "Hello Spring Boot!";
}
}
| [
"chentj070921@yeah.net"
] | chentj070921@yeah.net |
1cd28003a9eee1c6016866d60b50e986defd9082 | 7e37a09a1a46a719a73aa0dd6ac05ff8c4828653 | /youran-generate-core/src/main/java/com/youran/generate/pojo/mapper/FeatureMapper.java | 97f54a56e87efdb5b72cd33b4ff36d99b02f2b20 | [
"Apache-2.0"
] | permissive | fuxuzhi/youran | 3ee95db66cdae5a600ceb7ba5b70bc93ac92873f | 208a3541bd4ed69e94cd369e96a4e49d7fe25a2e | refs/heads/master | 2020-11-28T14:41:13.181759 | 2020-01-14T01:22:58 | 2020-01-14T01:22:58 | 229,848,854 | 0 | 0 | Apache-2.0 | 2020-01-14T01:23:00 | 2019-12-24T01:35:12 | null | UTF-8 | Java | false | false | 1,192 | java | package com.youran.generate.pojo.mapper;
import com.youran.common.util.JsonUtil;
import com.youran.generate.pojo.dto.MetaEntityFeatureDTO;
import com.youran.generate.pojo.dto.MetaMtmFeatureDTO;
import com.youran.generate.pojo.dto.MetaProjectFeatureDTO;
/**
* 特性DTO转json
*
* @author cbb
* @date 2018/11/28
*/
public class FeatureMapper {
public static String asString(MetaProjectFeatureDTO dto) {
return dto != null ? JsonUtil.toJSONString(dto) : null;
}
public static String asString(MetaEntityFeatureDTO dto) {
return dto != null ? JsonUtil.toJSONString(dto) : null;
}
public static String asString(MetaMtmFeatureDTO dto) {
return dto != null ? JsonUtil.toJSONString(dto) : null;
}
public static MetaProjectFeatureDTO asProjectFeatureDTO(String str) {
return JsonUtil.parseObject(str, MetaProjectFeatureDTO.class);
}
public static MetaEntityFeatureDTO asEntityFeatureDTO(String str) {
return JsonUtil.parseObject(str, MetaEntityFeatureDTO.class);
}
public static MetaMtmFeatureDTO asMtmFeatureDTO(String str) {
return JsonUtil.parseObject(str, MetaMtmFeatureDTO.class);
}
}
| [
"caibinbing@foxmail.com"
] | caibinbing@foxmail.com |
8471755e602cc0cad80c848d54f319245c8e29a3 | 8c36a4ce9cad4d7784e300f45f6bd2eb500900e0 | /web/src/main/java/org/kaaproject/kaa/sandbox/web/client/mvp/activity/HeaderActivityMapper.java | a117a8f085c7d9b46c3d0370eb45fa98f0c31349 | [
"Apache-2.0"
] | permissive | lonycell/sandbox-frame | ab0e888a052ac42e621cf5100cfe7699e38ba5f0 | e2c1ab5d1aa3004446ff6e7309a663fb5cece7d2 | refs/heads/master | 2021-01-15T20:42:51.829063 | 2016-01-25T17:04:06 | 2016-01-25T17:04:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,421 | java | /*
* Copyright 2014-2015 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kaaproject.kaa.sandbox.web.client.mvp.activity;
import org.kaaproject.kaa.sandbox.web.client.mvp.ClientFactory;
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
public class HeaderActivityMapper implements ActivityMapper {
private final ClientFactory clientFactory;
private HeaderActivity headerActivity;
public HeaderActivityMapper(ClientFactory clientFactory) {
super();
this.clientFactory = clientFactory;
}
@Override
public Activity getActivity(Place place) {
if (headerActivity == null) {
headerActivity = new HeaderActivity(place, clientFactory);
} else {
headerActivity.setPlace(place);
}
return headerActivity;
}
}
| [
"ikulikov@cybervisiontech.com"
] | ikulikov@cybervisiontech.com |
50c0b142e1af6a3f375a06cd7073032c4beac3ab | 4812c55b4209407db908c1d5493acafc1bcb83ca | /src/main/java/am/inowise/activitytracker/model/UserMapper.java | d4546b81644f045f6d7872cb67b7f28afa4dfd35 | [] | no_license | SevakMart/activity-tracker | 89eaac15a175e56517dfca7fa8ccd142e7a63fd4 | c18c2f08c288a59f7479651bcad7a97732dc1014 | refs/heads/master | 2021-02-05T19:30:00.874501 | 2020-02-28T18:16:44 | 2020-02-28T18:16:44 | 243,823,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | package am.inowise.activitytracker.model;
import am.inowise.activitytracker.model.domain.User;
import am.inowise.activitytracker.model.dto.UserDto;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;
@Component
public class UserMapper {
private final PasswordEncoder passwordEncoder;
public UserMapper(PasswordEncoder passwordEncoder) {
this.passwordEncoder = passwordEncoder;
}
public UserDto toDto(User user) {
UserDto userDto = new UserDto();
userDto.setEmail(user.getEmail());
userDto.setName(user.getName());
userDto.setLastName(user.getLastName());
userDto.setId(user.getId());
userDto.setActive(user.getActive());
return userDto;
}
public User toEntity(UserDto userDto) {
User user = new User();
user.setId(userDto.getId());
user.setActive(1);
user.setEmail(userDto.getEmail());
user.setPassword(passwordEncoder.encode(userDto.getPassword()));
user.setName(userDto.getName());
user.setLastName(userDto.getLastName());
return user;
}
}
| [
"sevak_martirosyan@epam.com"
] | sevak_martirosyan@epam.com |
dc71f660e50670144a6db8e98542d94c30e3895d | 46ef04782c58b3ed1d5565f8ac0007732cddacde | /app/editors/src/org/modelio/editors/texteditors/rt/partitions/KeywordRule.java | 4c6643365d0a6f4183e7677cd16a51d06773b586 | [] | no_license | daravi/modelio | 844917412abc21e567ff1e9dd8b50250515d6f4b | 1787c8a836f7e708a5734d8bb5b8a4f1a6008691 | refs/heads/master | 2020-05-26T17:14:03.996764 | 2019-05-23T21:30:10 | 2019-05-23T21:30:45 | 188,309,762 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,325 | java | /*
* Copyright 2013-2018 Modeliosoft
*
* This file is part of Modelio.
*
* Modelio is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Modelio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Modelio. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.modelio.editors.texteditors.rt.partitions;
import java.util.HashMap;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IPredicateRule;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
@objid ("7b6423e3-2a77-11e2-9fb9-bc305ba4815c")
public class KeywordRule implements IPredicateRule {
@objid ("7b6423e4-2a77-11e2-9fb9-bc305ba4815c")
IToken keywordToken;
@objid ("7b6423e5-2a77-11e2-9fb9-bc305ba4815c")
HashMap<String, IToken> keywords;
@objid ("7b6423e9-2a77-11e2-9fb9-bc305ba4815c")
private StringBuffer buffer;
@objid ("7b6423ea-2a77-11e2-9fb9-bc305ba4815c")
public KeywordRule(IToken keywordToken) {
this.keywordToken = keywordToken;
this.buffer = new StringBuffer();
this.keywords = new HashMap<>();
}
@objid ("7b6423ed-2a77-11e2-9fb9-bc305ba4815c")
public void addKeyword(String keyword, IToken token) {
this.keywords.put(keyword, token);
}
@objid ("7b6423f1-2a77-11e2-9fb9-bc305ba4815c")
@Override
public IToken evaluate(ICharacterScanner cscanner, boolean resume) {
return evaluate(cscanner);
}
@objid ("7b6423f8-2a77-11e2-9fb9-bc305ba4815c")
@Override
public IToken getSuccessToken() {
return this.keywordToken;
}
@objid ("7b6423fd-2a77-11e2-9fb9-bc305ba4815c")
@Override
public IToken evaluate(ICharacterScanner cscanner) {
this.buffer.setLength(0);
if (cscanner.getColumn() != 0) {
cscanner.unread();
int previousChar = cscanner.read();
if (Character.isLetter(previousChar)) {
return Token.UNDEFINED;
}
}
int c = cscanner.read();
if (c != ICharacterScanner.EOF && Character.isLetter(c)) {
do {
this.buffer.append((char) c);
c = cscanner.read();
} while (c != ICharacterScanner.EOF && Character.isLetter(c));
}
cscanner.unread();
// Look up in the keyword table
String word = this.buffer.toString();
IToken token = this.keywords.get(word);
if (token == null) {
// the word we swallowed was not a keyword => unread chars
for (int i = this.buffer.length() - 1; i >= 0; i--) {
cscanner.unread();
}
return Token.UNDEFINED;
} else
return this.keywordToken;
}
}
| [
"puya@motionmetrics.com"
] | puya@motionmetrics.com |
5ceabf1ec82de5a995227287146edbc85beb6426 | de7189da1f24691d7d102b7903de9767c20469b6 | /src/main/java/ru/geekbrains/pocket/backend/domain/db/User.java | 20414d45b6ad0c806d2414a0fc3b92440a6c50b0 | [
"Apache-2.0"
] | permissive | siblis/pocket-java-backend | b76ac4c6f63acd15461d21b582b0629b568a9dee | afb48ba29cc50c4e2c3d8b86e332bf38eab9bea7 | refs/heads/develop | 2022-10-28T04:02:42.591542 | 2020-06-11T09:28:01 | 2020-06-11T09:28:01 | 151,971,582 | 1 | 17 | Apache-2.0 | 2022-08-09T03:25:46 | 2018-10-07T18:19:53 | Java | UTF-8 | Java | false | false | 4,066 | java | package ru.geekbrains.pocket.backend.domain.db;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.TypeAlias;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import ru.geekbrains.pocket.backend.util.validation.ValidEmail;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
@Getter
@Setter
@NoArgsConstructor
@Document(collection = "users")
@TypeAlias("users")
public class User {
@Id
private ObjectId id;
@NotNull
@NotEmpty
@ValidEmail
@Size(min = 6, max = 32)
@Indexed(unique = true)
private String email;
@NotEmpty
@JsonIgnore
@Size(min = 8, max = 32)
private String password;
@NotNull
@Valid
private UserProfile profile;
//@DBRef
// @Transient
// @NotNull
// //@Valid
// @JsonIgnore
// private Collection<Role> roles = Role.getRoleUser();
@Field("created_at")
private Date createdAt = new Date();
//private boolean enabled = false;
//private boolean isUsing2FA = false;
//private String secret = ""; //Base32.random();
public User(String email, String password, UserProfile userProfile) {
if (userProfile == null) userProfile = new UserProfile(email);
if (userProfile.getUsername() == null || userProfile.getUsername().equals(""))
userProfile.setUsername(email);
this.email = email;
this.password = password;
this.profile = userProfile;
}
public User(String email, String password, String username) {
this.email = email;
this.password = password;
this.profile = new UserProfile(username);
}
// public User(String email, String password, String username, Collection<Role> roles) {
// this.email = email;
// this.password = password;
// this.profile = new UserProfile(username);
// this.roles = roles;
// }
@Override
public String toString() {
return "User{" +
"'id':'" + id + "'" +
", 'email':'" + email + "'" +
", 'username':'" + profile.getUsername() + "'" +
'}';
}
}
/* http://qaru.site/questions/224920/regex-for-password-php
regexp = "^\\S*(?=\\S{6,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])\\S*$"
^: привязано к началу строки
\S*: любой набор символов
(?=\S{8,}): не менее длины 6
(?=\S*[a-z]): содержит хотя бы одну строчную букву
(?=\S*[a-z]): и по крайней мере одно прописное письмо
(?=\S*[\d]): и по крайней мере одно число
$: привязано к концу строки
*/
/* http://j4web.ru/java-regex/validatsiya-parolya-s-pomoshhyu-regulyarnogo-vyrazheniya.html
((?=.*d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})
( # Начало группы
(?=.*d) # Должен содержать цифру от 0 до 9
(?=.*[a-z]) # Должен содержать символ латинницы в нижем регистре
(?=.*[A-Z]) # Должен содержать символ латинницы в верхнем регистре
(?=.*[@#$%]) # Должен содержать специальный символ из списка "@#$%"
. # Совпадает с предыдущими условиями
{6,20} # Длина - от 6 до 20 символов
) # Конец группы*/
| [
"zundarik@gmail.com"
] | zundarik@gmail.com |
11b99af8fa473f47f1d49c7588ac2aa5cb17bfc9 | 5765c87fd41493dff2fde2a68f9dccc04c1ad2bd | /Variant Programs/3-5/38/Sodbuster.java | 730ee381b274b84ccac3cfe35c38c01f4b930648 | [
"MIT"
] | permissive | hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism | 42e4c2061c3f8da0dfce760e168bb9715063645f | a42ced1d5a92963207e3565860cac0946312e1b3 | refs/heads/master | 2020-08-09T08:10:08.888384 | 2019-11-25T01:14:23 | 2019-11-25T01:14:23 | 214,041,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,307 | java | import java.util.concurrent.Semaphore;
public class Sodbuster implements Runnable {
public static int glimmering = 0;
public static Semaphore fh = new Semaphore(1);
private String picture = null;
static final double trammel = 0.6443057082284851;
private synchronized void chooseThings() {
double dept;
dept = (0.841601595405903);
try {
wait(1000);
} catch (InterruptedException admittedly) {
System.out.println(admittedly.toString());
}
}
public synchronized void run() {
int contrGoods;
contrGoods = (1866043365);
while (true) {
System.out.println(picture + ": Waiting for bridge.");
try {
fh.acquire();
chooseThings();
System.out.println(picture + ": Crossing bridge step 5.");
chooseThings();
System.out.println(picture + ": Crossing bridge step 10.");
chooseThings();
System.out.println(picture + ": Crossing bridge step 15.");
chooseThings();
System.out.println(picture + ": Across the bridge.");
glimmering++;
System.out.println("NEON = " + glimmering);
fh.release();
} catch (InterruptedException con) {
con.toString();
}
}
}
public Sodbuster(String security) {
this.picture = (security);
}
}
| [
"hayden.cheers@me.com"
] | hayden.cheers@me.com |
47c327751f3c5f714c764c5eb4ad7d5b345c9f62 | 24af6061823aa28ee14f382ff8eb042608776349 | /src/main/java/com/wondering/websocket/SpringWebSocketHandlerInterceptor.java | d686cf6b25f71233173cdc9e1d1f4596cb774c41 | [] | no_license | nrszc/WonderingNotes | 694ae9fca5e2062ade9b5f99c4377cd6d0f21d9e | b5a9c3c02ed41f7054d3b6c6e55dd9998ba6b702 | refs/heads/master | 2020-05-17T22:19:53.397511 | 2019-04-29T03:43:41 | 2019-04-29T03:43:41 | 183,995,496 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package com.wondering.websocket;
import java.util.Map;
import javax.servlet.http.HttpSession;
import com.wondering.common.Const;
import com.wondering.vo.UserInfo;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;
/**
* WebSocket拦截器
* @author WANG
*
*/
public class SpringWebSocketHandlerInterceptor extends HttpSessionHandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
Map<String, Object> attributes) throws Exception {
// TODO Auto-generated method stub
System.out.println("Before Handshake");
if (request instanceof ServletServerHttpRequest) {
ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request;
HttpSession session = servletRequest.getServletRequest().getSession(false);
if (session != null) {
//使用userName区分WebSocketHandler,以便定向发送消息
UserInfo user = (UserInfo) session.getAttribute(Const.CURRENT_USER);
// if (user==null) {
// user="default-system";
// }
attributes.put(Const.CURRENT_USER,user);
}
}
return super.beforeHandshake(request, response, wsHandler, attributes);
}
@Override
public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler,
Exception ex) {
// TODO Auto-generated method stub
super.afterHandshake(request, response, wsHandler, ex);
}
} | [
"wsgzjh@sina.cn"
] | wsgzjh@sina.cn |
d1cefe4ea422ad4852bc8dc0c387211f70345cf5 | ea35def0042a9b97bd1ef6a143ba15da5eaa09f2 | /src/com/example/moneytracker/BugetListActivity.java | 3084e8b247008f4efeedf54a7b08c0945b583708 | [] | no_license | randomize/MoneyTracker | f8553f2aab32c07125e4ed9a8b8acb8b2261d22e | b633611f362ce7bf559e8f504df4377d3e7e3fcd | refs/heads/master | 2020-05-29T19:46:06.715080 | 2017-02-01T12:20:03 | 2017-02-01T12:20:03 | 22,019,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,702 | java | package com.example.moneytracker;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Stack;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.provider.ContactsContract.Data;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.Log;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.ExtractedTextRequest;
import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
public class BugetListActivity extends Activity {
private DatabaseFacade db;
private int ids[];
private float amounts[];
private String names[];
private float rates[];
ListView lv ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
db = new DatabaseFacade(this);
setContentView(R.layout.activity_bugets);
lv = (ListView) findViewById(R.id.bugets_view);
registerForContextMenu(lv);
lv.setEmptyView(findViewById(R.id.bugets_empter));
}
@Override
protected void onResume() {
LoadData();
super.onResume();
}
private void LoadData() {
db.open();
ArrayList<Buget> bug = db.GetBugetsList();
db.close();
ids = new int[bug.size()];
names = new String[bug.size()];
amounts = new float[bug.size()];
rates = new float[bug.size()];
for (int i = 0; i < bug.size(); i++) {
Buget b = bug.get(i);
ids[i] = b.id;
names[i] = b.name;
amounts[i] = b.amount;
rates[i] = b.currencyRate;
}
ArrayAdapter<Buget> adapter = new BugetListAdapter(this, bug);
lv.setAdapter(adapter);
}
/*
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
dlgAlert.setMessage(desc[position]);
dlgAlert.setTitle(list[position]);
dlgAlert.setPositiveButton(getString(R.string.ok), null);
dlgAlert.setCancelable(false);
dlgAlert.create().show();
}*/
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
AdapterView.AdapterContextMenuInfo info;
try {
info = (AdapterView.AdapterContextMenuInfo) menuInfo;
} catch (ClassCastException e) {
return;
}
menu.setHeaderTitle(names[info.position]);
menu.add(0, 142, 0, getString(R.string.delete_buget));
menu.add(0, 143, 0, getString(R.string.edit_amount));
};
private void DeleteBuget(final int id)
{
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
switch (which){
case DialogInterface.BUTTON_POSITIVE:
db.open();
db.RemoveBuget(id);
db.close();
LoadData();
break;
case DialogInterface.BUTTON_NEGATIVE:
//No button clicked
break;
}
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(getString(R.string.sure)).setPositiveButton(getString(R.string.yes), dialogClickListener)
.setNegativeButton(getString(R.string.no), dialogClickListener).show();
}
@Override
public boolean onContextItemSelected(MenuItem item) {
if(item.getItemId() == 142)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
DeleteBuget(ids[info.position]);
return true;
}
else if (item.getItemId() == 143)
{
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
EditBuget(info.position);
return true;
}
return false;
}
private void EditBuget(final int pos) {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(getString(R.string.enter_new_amount));
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
float cur_val = amounts[pos] / rates[pos];
input.setText(String.valueOf(cur_val));
//input.setText(String.format("%.2f", amounts[pos] ));
builder.setView(input);
// Set up the buttons
builder.setPositiveButton(getString(R.string.save), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String m_Text = input.getText().toString();
if (m_Text.isEmpty() == false) {
float amount= Float.parseFloat(m_Text);
db.open();
db.UpdateBugetAmount(ids[pos], amount * rates[pos]);
db.close();
LoadData();
}
}
});
builder.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
final AlertDialog dialog = builder.create();
input.addTextChangedListener(new TextWatcher() {
@Override public void beforeTextChanged(CharSequence c, int i, int i2, int i3) {}
@Override public void onTextChanged(CharSequence c, int i, int i2, int i3) {}
@Override
public void afterTextChanged(Editable editable) {
// Will be called AFTER text has been changed.
if (editable.toString().length() == 0){
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
} else {
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
}
}
});
dialog.show();
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.buget_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_add_buget:
AddBuget();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void AddBuget() {
Intent intent = new Intent(this, BugetAddActivity.class);
startActivity(intent);
}
}
| [
"randomize46@gmail.com"
] | randomize46@gmail.com |
540f693205e2586073bf651455755d1207375fd0 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_c32cf03575d56e952b1b42d42bd05903ac596bc6/Matcher/11_c32cf03575d56e952b1b42d42bd05903ac596bc6_Matcher_t.java | f692a6de229e81772d940829a6f090a599be0f3b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 15,150 | java | package ch.ethz.inf.vs.californium.network;
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import ch.ethz.inf.vs.californium.CalifonriumLogger;
import ch.ethz.inf.vs.californium.coap.CoAP.Type;
import ch.ethz.inf.vs.californium.coap.EmptyMessage;
import ch.ethz.inf.vs.californium.coap.Message;
import ch.ethz.inf.vs.californium.coap.Request;
import ch.ethz.inf.vs.californium.coap.Response;
import ch.ethz.inf.vs.californium.network.Exchange.KeyMID;
import ch.ethz.inf.vs.californium.network.Exchange.KeyToken;
import ch.ethz.inf.vs.californium.network.Exchange.KeyUri;
import ch.ethz.inf.vs.californium.network.Exchange.Origin;
import ch.ethz.inf.vs.californium.network.config.NetworkConfig;
import ch.ethz.inf.vs.californium.network.config.NetworkConfigDefaults;
import ch.ethz.inf.vs.californium.network.dedupl.Deduplicator;
import ch.ethz.inf.vs.californium.network.dedupl.DeduplicatorFactory;
import ch.ethz.inf.vs.californium.network.layer.ExchangeForwarder;
public class Matcher {
private final static Logger LOGGER = CalifonriumLogger.getLogger(Matcher.class);
private boolean started;
private ExchangeObserver exchangeObserver = new ExchangeObserverImpl();
private ExchangeForwarder forwarder; // TODO: still necessary?
/** The executor. */
private ScheduledExecutorService executor;
// TODO: Make per endpoint
private AtomicInteger currendMID;
private ConcurrentHashMap<KeyMID, Exchange> exchangesByMID; // Outgoing
private ConcurrentHashMap<KeyToken, Exchange> exchangesByToken;
private ConcurrentHashMap<KeyUri, Exchange> ongoingExchanges; // for blockwise
// TODO: Multicast Exchanges: should not be removed from deduplicator
private Deduplicator deduplicator;
// Idea: Only store acks/rsts and not the whole exchange. Responses should be sent CON.
public Matcher(ExchangeForwarder forwarder, NetworkConfig config) {
this.forwarder = forwarder;
this.started = false;
this.exchangesByMID = new ConcurrentHashMap<KeyMID, Exchange>();
this.exchangesByToken = new ConcurrentHashMap<KeyToken, Exchange>();
this.ongoingExchanges = new ConcurrentHashMap<KeyUri, Exchange>();
DeduplicatorFactory factory = DeduplicatorFactory.getDeduplicatorFactory();
this.deduplicator = factory.createDeduplicator(config);
if (config.getBoolean(NetworkConfigDefaults.USE_RANDOM_MID_START))
currendMID = new AtomicInteger(new Random().nextInt(1<<16));
else currendMID = new AtomicInteger(0);
}
public synchronized void start() {
if (started) return;
else started = true;
if (executor == null)
throw new IllegalStateException("Matcher has no executor to schedule exchnage removal");
deduplicator.start();
}
public synchronized void stop() {
if (!started) return;
else started = false;
deduplicator.stop();
clear();
}
public synchronized void setExecutor(ScheduledExecutorService executor) {
deduplicator.setExecutor(executor);
this.executor = executor;
}
public void sendRequest(Exchange exchange, Request request) {
if (request.getMID() == Message.NONE)
request.setMID(currendMID.getAndIncrement()%(1<<16));
/*
* The request is a CON or NCON and must be prepared for these responses
* - CON => ACK/RST/ACK+response/CON+response/NCON+response
* - NCON => RST/CON+response/NCON+response
* If this request goes lost, we do not get anything back.
*/
KeyMID idByMID = new KeyMID(request.getMID(),
request.getDestination().getAddress(), request.getDestinationPort());
KeyToken idByTok = new KeyToken(request.getToken(),
request.getDestination().getAddress(), request.getDestinationPort());
exchange.setObserver(exchangeObserver);
// TODO: remove this statement to save computation?
LOGGER.fine("Remember by MID "+idByMID+" and by Token "+idByTok);
exchangesByMID.put(idByMID, exchange);
exchangesByToken.put(idByTok, exchange);
}
public void sendResponse(Exchange exchange, Response response) {
if (response.getMID() == Message.NONE)
response.setMID(currendMID.getAndIncrement()%(1<<16));
/*
* The response is a CON or NON or ACK and must be prepared for these
* - CON => ACK/RST // we only care to stop retransmission
* - NCON => RST // we don't care
* - ACK => nothing!
* If this response goes lost, we must be prepared to get the same
* CON/NCON request with same MID again. We then find the corresponding
* exchange and the retransmissionlayer resends this response.
*/
if (response.getDestination() == null)
throw new NullPointerException("Response has no destination address set");
if (response.getDestinationPort() == 0)
throw new NullPointerException("Response hsa no destination port set");
// Insert CON and NON to match ACKs and RSTs to the exchange
KeyMID idByMID = new KeyMID(response.getMID(),
response.getDestination().getAddress(), response.getDestinationPort());
exchangesByMID.put(idByMID, exchange);
if (/*exchange.getCurrentRequest().getCode() == Code.GET
&&*/ response.getOptions().hasBlock2()) {
// Remember ongoing blockwise GET requests
Request request = exchange.getRequest();
// KeyToken idByTok = new KeyToken(request.getToken(),
// request.getSource().getAddress(), request.getSourcePort());
KeyUri keyUri = new KeyUri(request.getURI(),
response.getDestination().getAddress(), response.getDestinationPort());
LOGGER.fine("Add request to ongoing exchanges with key "+keyUri);
ongoingExchanges.put(keyUri, exchange);
}
if (response.getType() == Type.ACK || response.getType() == Type.NON) {
// Since this is an ACK or NON, the exchange is over with sending this response.
if (response.isLast()) {
exchange.setComplete(true);
exchangeObserver.completed(exchange);
}
} // else this is a CON and we need to wait for the ACK or RST
}
public void sendEmptyMessage(Exchange exchange, EmptyMessage message) {
if (message.getType() == Type.RST && exchange != null) {
// We have rejected the request or response
exchange.setComplete(true);
exchangeObserver.completed(exchange);
}
/*
* We do not expect any response for an empty message
*/
if (message.getMID() == Message.NONE)
LOGGER.warning("Empy message "+ message+" has MID NONE // debugging");
}
public Exchange receiveRequest(Request request) {
/*
* This request could be
* - Complete origin request => deliver with new exchange
* - One origin block => deliver with ongoing exchange
* - Complete duplicate request or one duplicate block (because client got no ACK)
* =>
* if ACK got lost => resend ACK
* if ACK+response got lost => resend ACK+response
* if nothing has been sent yet => do nothing
* (Retransmission is supposed to be done by the retransm. layer)
*/
KeyMID idByMID = new KeyMID(request.getMID(),
request.getSource().getAddress(), request.getSourcePort());
// KeyToken idByTok = new KeyToken(request.getToken(),
// request.getSource().getAddress(), request.getSourcePort());
/*
* The differentiation between the case where there is a Block1 or
* Block2 option and the case where there is none has the advantage that
* all exchanges that do not need blockwise transfer have simpler and
* faster code than exchanges with blockwise transfer.
*/
if (!request.getOptions().hasBlock1() && !request.getOptions().hasBlock2()) {
LOGGER.fine("Create new exchange for remote request");
Exchange exchange = new Exchange(request, Origin.REMOTE);
Exchange previous = deduplicator.findPrevious(idByMID, exchange);
if (previous == null) {
return exchange;
} else {
LOGGER.info("Message is a duplicate, ignore: "+request);
request.setDuplicate(true);
return previous;
}
} else {
KeyUri idByUri = new KeyUri(request.getURI(),
request.getSource().getAddress(), request.getSourcePort());
LOGGER.fine("Lookup ongoing exchange for "+idByUri);
Exchange ongoing = ongoingExchanges.get(idByUri);
if (ongoing != null) {
LOGGER.fine("Found exchange"); // TODO: remove this line
// This is a block of an ongoing request
Exchange prev = deduplicator.findPrevious(idByMID, ongoing);
if (prev != null) {
LOGGER.info("Message is a duplicate: "+request);
request.setDuplicate(true);
}
return ongoing;
} else {
// We have no ongoing exchange for that block.
/*
* Note the difficulty of the following code: The first message
* of a blockwise transfer might arrive twice due to a
* retransmission. The new Exchange must be inserted in both the
* hash map 'ongoing' and the deduplicator. They must agree on
* which exchange they store!
*/
LOGGER.fine("Create new exchange for remote request with blockwise transfer");
Exchange exchange = new Exchange(request, Origin.REMOTE);
Exchange previous = deduplicator.findPrevious(idByMID, exchange);
if (previous == null) {
ongoingExchanges.put(idByUri, exchange);
return exchange;
} else {
LOGGER.info("Message is a duplicate: "+request);
request.setDuplicate(true);
return previous;
}
} // if ongoing
} // if blockwise
}
public Exchange receiveResponse(Response response) {
/*
* This response could be
* - The first CON/NCON/ACK+response => deliver
* - Retransmitted CON (because client got no ACK)
* => resend ACK
*/
KeyMID idByMID = new KeyMID(response.getMID(),
response.getSource().getAddress(), response.getSourcePort());
KeyToken idByTok = new KeyToken(response.getToken(),
response.getSource().getAddress(), response.getSourcePort());
Exchange exchange = exchangesByToken.get(idByTok);
if (exchange != null) {
// There is an exchange with the given token
if (response.getType() != Type.ACK) {
// Need deduplication for CON and NON but not for ACK (because MID defined by server)
Exchange prev = deduplicator.findPrevious(idByMID, exchange);
if (prev != null) { // (and thus it holds: prev == exchange)
LOGGER.fine("Message is a duplicate, ignore: "+response);
response.setDuplicate(true);
}
} else {
/*
* In the draft coap-18, section 4.5, there is nothing written
* about deduplication of ACKs. Deduplicating ACKs might lead to
* a problem, when a server sends requests to itself:
* [5683] CON [MID=1234] GET ---> [5683] // => remember MID=1234
* [5683] <--- ACK [MID=1234] 2.00 [5683] // => MID=1234 is a duplicate
*/
}
if (response.getType() == Type.ACK) {
// this is a piggy-backed response and the MID must match
if (exchange.getCurrentRequest().getMID() == response.getMID()) {
// The token and MID match. This is a response for this exchange
return exchange;
} else {
// The token matches but not the MID. This is a response for an older exchange
LOGGER.info("Token matches but not MID: wants "+exchange.getCurrentRequest().getMID()+" but gets "+response.getMID());
EmptyMessage rst = EmptyMessage.newRST(response);
sendEmptyMessage(exchange, rst);
// ignore response
return null;
}
} else {
// this is a separate response that we can deliver
return exchange;
}
} else {
// There is no exchange with the given token.
// This might be a duplicate response to an exchanges that is already completed
if (response.getType() != Type.ACK) {
// Need deduplication for CON and NON but not for ACK (because MID defined by server)
Exchange prev = deduplicator.find(idByMID);
if (prev != null) { // (and thus it holds: prev == exchange)
LOGGER.info("Message is a duplicate, ignore: "+response);
response.setDuplicate(true);
return prev;
}
}
LOGGER.info("Received response with unknown token "+idByTok+" and MID "+idByMID+". Reject "+response);
// This is a totally unexpected response.
EmptyMessage rst = EmptyMessage.newRST(response);
sendEmptyMessage(exchange, rst);
// ignore response
return null;
}
}
public Exchange receiveEmptyMessage(EmptyMessage message) {
KeyMID idByMID = new KeyMID(message.getMID(),
message.getSource().getAddress(), message.getSourcePort());
Exchange exchange = exchangesByMID.get(idByMID);
if (exchange != null) {
return exchange;
} else {
LOGGER.info("Matcher received empty message that does not match any exchange: "+message);
// ignore message;
return null;
} // else, this is an ACK for an unknown exchange and we ignore it
}
public void clear() {
this.exchangesByMID.clear();
this.exchangesByToken.clear();
this.ongoingExchanges.clear();
deduplicator.clear();
}
private class ExchangeObserverImpl implements ExchangeObserver {
@Override
public void completed(Exchange exchange) {
if (exchange.getOrigin() == Origin.LOCAL) {
Request request = exchange.getRequest();
KeyToken tokKey = new KeyToken(exchange.getToken(),
request.getDestination().getAddress(), request.getDestinationPort());
LOGGER.fine("Exchange completed, forget token "+tokKey);
exchangesByToken.remove(tokKey);
// TODO: What if the request is only a block?
KeyMID midKey = new KeyMID(request.getMID(),
request.getDestination().getAddress(), request.getDestinationPort());
exchangesByMID.remove(midKey);
}
if (exchange.getOrigin() == Origin.REMOTE) {
Request request = exchange.getCurrentRequest();
if (request != null) {
KeyUri uriKey = new KeyUri(request.getURI(),
request.getSource().getAddress(), request.getSourcePort());
LOGGER.fine("Exchange completed, forget blockwise transfer to URI "+uriKey);
ongoingExchanges.remove(uriKey);
}
// TODO: What if the request is only a block?
// TODO: This should only happen if the transfer was blockwise
Response response = exchange.getResponse();
if (response != null) {
KeyMID midKey = new KeyMID(response.getMID(),
response.getDestination().getAddress(), response.getDestinationPort());
exchangesByMID.remove(midKey);
}
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
4f03445d46597c1efe8b89ef340058eb05bcb6c8 | 11323f87ca99cd1b32fa9814c488c33b49c65b35 | /wk-app/wk-model/src/main/java/cn/wizzer/app/sys/modules/models/Sys_log.java | 8fb98625b43390a0b79b32ca13323c5aaa3578ee | [
"Apache-2.0"
] | permissive | xu116/-test2 | d682594ff2289f7fd68d0a0fa707973413af3383 | dcd89280c0c08c49239475a4ac47c629ec32680c | refs/heads/bak-delete-nb-nc | 2022-09-19T16:15:05.947849 | 2018-04-12T10:37:26 | 2018-04-12T10:37:26 | 229,925,085 | 0 | 0 | Apache-2.0 | 2022-09-01T23:18:06 | 2019-12-24T10:55:15 | JavaScript | UTF-8 | Java | false | false | 2,789 | java | package cn.wizzer.app.sys.modules.models;
import cn.wizzer.framework.base.model.BaseModel;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
/**
* Created by wizzer on 2016/6/21.
*/
@Table("sys_log_${month}")
public class Sys_log extends BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
@Column
@Id
// @Prev({
// //仅做演示,实际使用oracle时,请使用触发器+序列的方式实现自增长ID,否则高并发下此种写法性能是个瓶颈
// //实际上不推荐在主键上使用自定义sql来生成
// @SQL(db = DB.ORACLE, value = "SELECT SYS_LOG_S.nextval FROM dual")
// })
private long id;
@Column
@Comment("创建昵称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String username;
@Column
@Comment("日志类型")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String type;
@Column
@Comment("日志标识")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String tag;
@Column
@Comment("执行类")
@ColDefine(type = ColType.VARCHAR, width = 255)
private String src;
@Column
@Comment("来源IP")
@ColDefine(type = ColType.VARCHAR, width = 255)
private String ip;
@Column
@Comment("日志内容")
@ColDefine(type = ColType.TEXT)
private String msg;
@Column
@Comment("请求结果")
@ColDefine(type = ColType.TEXT)
private String param;
@Column
@Comment("执行结果")
@ColDefine(type = ColType.TEXT)
private String result;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getSrc() {
return src;
}
public void setSrc(String src) {
this.src = src;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
| [
"wizzer@qq.com"
] | wizzer@qq.com |
3f79a1e4cd80eacb0db042b05a745fe38f583e50 | f7351a48f7cfb6f909d3c8d339d035b4e2adf97d | /src/circle_object/Rectangle.java | 7bc10d98ea1f508dbf0b7ab2e21e25fcb8d2346e | [] | no_license | alexcatanet/Array_Object | 33264e903d268f0e36d091f708538b1038ab2bfa | dde32e71ae83750fa65a6625f8d3f68a90979808 | refs/heads/master | 2020-03-31T21:40:40.363827 | 2018-10-11T12:40:58 | 2018-10-11T12:40:58 | 152,589,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package circle_object;
class Rectangle {
int length;
int width;
public void calculateAre() {
int area = width * length;
System.out.println("Area of the triangle is: " + area);
}
public void calculatePerimter() {
int perimeter = (int) (Math.pow(length, 2) + Math.pow(width, 2));
System.out.println("The perimeter is: " + perimeter);
}
}
| [
"alexandrucatanet@gmail.com"
] | alexandrucatanet@gmail.com |
c9bcdc1cb9092849f5d5f6eec3b995d995792a55 | 5f1d46d2bd1c47b381e5c9e85eb2f9412a75264d | /BAEKJOON_Algo/Step_01/Hello_world.java | 1d07219ecab6faf5567fa47bcca7a44873af784a | [
"MIT"
] | permissive | oilsok87/Study | 78d9235798e61d6776fb0e4735c0829bd03a0992 | ce3b8e8f5cbfb1a4ffd9ee53bd3a7fbe0d46b1db | refs/heads/master | 2023-06-14T19:21:24.141054 | 2021-07-03T02:53:16 | 2021-07-03T02:53:16 | 382,031,744 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 142 | java | package BAEKJOON_Algo.Step_01;
class Main {
public static void main(String [ ] args){
System.out.println("Hello World!");
}
} | [
"cfd.magician@gmail.com"
] | cfd.magician@gmail.com |
890ca415d377e752ab857035b6b4453aea4f99fb | 7d21322621d217f6e2f05e970e1c15d85376c8de | /src/passnote/app/src/main/java/codepig/passnote/Utils/dataCenter.java | 9578b107c69817367a5f5fb4924ab0a4e9ca730f | [
"MIT"
] | permissive | codeqian/password-note | e1b7ea17b522d156f307403704ea092824e166e1 | 0a2811af7e9ef4e1a10790e8bce40e966a5ef111 | refs/heads/master | 2020-04-09T01:50:14.043693 | 2018-10-09T08:28:26 | 2018-10-09T08:28:26 | 42,232,134 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,259 | java | package codepig.passnote.Utils;
import android.util.Log;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 数据的公共类
* Created by QZD on 2015/10/14.
*/
public class dataCenter {
public static List<AccountData> dataList;//数据列表
public static String theWords;//口令
/**
* 遍历dataList
*/
public static void logAllData(){
for (int i=0;i<dataList.size();i++){
AccountData _data=dataList.get(i);
Log.d("LOGCAT","dataList "+i+":"+_data.paperId+"-"+_data.paperName+"-"+_data.account+"-"+_data.password+"-"+_data.info);
}
}
/**
* 根据名称查询
*/
public static int searchByName(String _nameKey,int _index){
Pattern pattern = Pattern.compile(_nameKey);
Matcher matcher;
int startIndex=_index;
if(startIndex!=0){
startIndex++;
}
Log.d("LOGCAT","start at:"+startIndex);
for (int i=startIndex;i<dataList.size();i++){
matcher = pattern.matcher(dataList.get(i).paperName);
if(matcher.find()) {
Log.d("LOGCAT","find at:"+i);
return i;
}
}
return -1;
}
}
| [
"qian.wolf@gmail.com"
] | qian.wolf@gmail.com |
a8e6b991c50e498d2d8f0a26837d2ffe32c6f703 | 97f60c04f636ecbcc9c41e556c83d1f75952de02 | /source/src/main/java/io/jitstatic/hosted/UserExtractor.java | 3c5e7cbc6ae7f43ac41afa509769800f3e609ed2 | [
"Apache-2.0"
] | permissive | evabrannstrom/jitstatic | e864ba5f5c07a453335f85c2c8b7381653583d7b | 47e2e0ca2b4d48a9df835df7be42f315292424c9 | refs/heads/master | 2020-08-16T15:09:09.745447 | 2019-10-04T05:58:13 | 2019-10-04T05:58:13 | 215,515,180 | 0 | 0 | null | 2019-10-16T09:58:07 | 2019-10-16T09:58:07 | null | UTF-8 | Java | false | false | 14,869 | java | package io.jitstatic.hosted;
/*-
* #%L
* jitstatic
* %%
* Copyright (C) 2017 - 2018 H.Hegardt
* %%
* 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.
* #L%
*/
import static io.jitstatic.JitStaticConstants.GIT_REALM;
import static io.jitstatic.JitStaticConstants.JITSTATIC_KEYADMIN_REALM;
import static io.jitstatic.JitStaticConstants.JITSTATIC_KEYUSER_REALM;
import static io.jitstatic.JitStaticConstants.USERS;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.PathFilter;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.spencerwi.either.Either;
import io.jitstatic.JitStaticConstants;
import io.jitstatic.Role;
import io.jitstatic.StorageParseException;
import io.jitstatic.auth.UserData;
import io.jitstatic.check.FileObjectIdStore;
import io.jitstatic.check.RepositoryDataError;
import io.jitstatic.utils.Functions;
import io.jitstatic.utils.Pair;
public class UserExtractor {
private static final Set<Role> ROLES = JitStaticConstants.ROLES.stream().map(Role::new).collect(Collectors.toSet());
private static final Set<String> REALMS = Set.of(GIT_REALM, JITSTATIC_KEYUSER_REALM, JITSTATIC_KEYADMIN_REALM);
private static final Logger LOG = LoggerFactory.getLogger(UserExtractor.class);
private static final ObjectMapper MAPPER = new ObjectMapper();
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private final Repository repository;
UserExtractor(final Repository repository) {
this.repository = repository;
}
public Pair<String, UserData> extractUserFromRef(final String userKey, final String ref) throws IOException, RefNotFoundException {
if (!Objects.requireNonNull(userKey).startsWith(JitStaticConstants.USERS)) {
throw new IllegalArgumentException("Trying to get users through illegal key " + userKey + " in ref " + ref);
}
final Ref findBranch = findBranch(Objects.requireNonNull(ref));
final AnyObjectId reference = findBranch.getObjectId();
try (final RevWalk rev = new RevWalk(repository)) {
final RevCommit parsedCommit = rev.parseCommit(reference);
final RevTree currentTree = rev.parseTree(parsedCommit.getTree());
try (final TreeWalk treeWalker = new TreeWalk(repository)) {
treeWalker.addTree(currentTree);
treeWalker.setFilter(PathFilterGroup.createFromStrings(userKey));
treeWalker.setRecursive(true);
while (treeWalker.next()) {
final FileMode mode = treeWalker.getFileMode();
if (mode == FileMode.REGULAR_FILE || mode == FileMode.EXECUTABLE_FILE) {
final ObjectId objectId = treeWalker.getObjectId(0);
try (InputStream is = repository.open(objectId).openStream()) {
return Pair.of(objectId.getName(), MAPPER.readValue(is, UserData.class));
}
}
}
} finally {
rev.dispose();
}
}
return Pair.ofNothing();
}
public List<Pair<Set<Ref>, List<Pair<FileObjectIdStore, Exception>>>> checkOnTestBranch(final String ref, final String alias)
throws RefNotFoundException, IOException {
Ref branch = findBranch(ref);
if (alias != null) {
branch = new WrappingRef(branch, alias);
}
return validate(Map.of(branch.getObjectId(), Set.of(branch))).stream()
.map(p -> Pair.of(p.getLeft(), p.getRight().stream()
.map(Pair::getRight)
.flatMap(List::stream)
.collect(Collectors.toList())))
.collect(Collectors.toList());
}
public List<Pair<Set<Ref>, List<Pair<String, List<Pair<FileObjectIdStore, Exception>>>>>> validate(final Map<AnyObjectId, Set<Ref>> mappedRefs) {
return mappedRefs.entrySet().stream().map(e -> Pair.of(e.getKey(), e.getValue().stream()
.filter(ref -> !ref.isSymbolic()).collect(Collectors.toSet())))
.map(this::extracted)
.map(this::splitIntoRealms)
.map(list -> Pair.of(list.getLeft(), list.getRight().entrySet().stream()
.map(e -> Pair.of(e.getKey(), e.getValue().parallelStream()
.map(p -> {
final InputStreamHolder inputStream = p.getRight();
if (inputStream.isPresent()) {
try (InputStream is = inputStream.inputStream()) {
final UserData readValue = MAPPER.readValue(is, UserData.class);
final Set<ConstraintViolation<UserData>> validationErrors = validator.validate(readValue);
if (!validationErrors.isEmpty()) {
return Pair.of(p.getLeft(), Either.<UserData, Exception>right(new StorageParseException(validationErrors)));
}
return Pair.of(p.getLeft(), Either.<UserData, Exception>left(readValue));
} catch (IOException e1) {
return Pair.of(p.getLeft(), Either.<UserData, Exception>right(e1));
}
}
return Pair.of(p.getLeft(), Either.<UserData, Exception>right(inputStream.exception()));
}).collect(Collectors.toList())))
.map(this::getUserDataIOErrors)
.filter(this::hasErrors)
.collect(Collectors.toList())))
.filter(p -> !p.getRight().isEmpty())
.collect(Collectors.toList());
}
public List<Pair<Set<Ref>, List<Pair<String, List<Pair<FileObjectIdStore, Exception>>>>>> validateAll() {
return validate(repository.getAllRefsByPeeledObjectId());
}
private Pair<Set<Ref>, Map<String, List<Pair<FileObjectIdStore, InputStreamHolder>>>> splitIntoRealms(
final Pair<Set<Ref>, Pair<List<Pair<FileObjectIdStore, InputStreamHolder>>, RepositoryDataError>> iterationResult) {
final Map<String, List<Pair<FileObjectIdStore, InputStreamHolder>>> realms = new HashMap<>();
final Pair<List<Pair<FileObjectIdStore, InputStreamHolder>>, RepositoryDataError> data = iterationResult.getRight();
final RepositoryDataError rde = data.getRight();
if (rde != null) {
List<Pair<FileObjectIdStore, InputStreamHolder>> list = new ArrayList<>();
list.add(Pair.of(rde.getFileObjectIdStore(), rde.getInputStreamHolder()));
realms.put(USERS, list);
}
for (Pair<FileObjectIdStore, InputStreamHolder> p : data.getLeft()) {
final FileObjectIdStore fileObjectIdStore = p.getLeft();
final String pathName = fileObjectIdStore.getFileName().substring(USERS.length());
int firstSlash = pathName.indexOf('/');
String realm = pathName.substring(0, firstSlash);
realms.compute(realm, (k, v) -> {
Pair<FileObjectIdStore, InputStreamHolder> userData = Pair.of(fileObjectIdStore, p.getRight());
if (v == null) {
List<Pair<FileObjectIdStore, InputStreamHolder>> list = new ArrayList<>();
list.add(userData);
return list;
}
v.add(userData);
return v;
});
}
final Set<Ref> refs = iterationResult.getLeft();
realms.keySet().forEach(realm -> {
if (REALMS.contains(realm)) {
LOG.info("Found realm {} in refs {}", realm, refs);
} else {
LOG.warn("Found unmapped realm {} in refs {}", realm, refs);
}
});
return Pair.of(iterationResult.getLeft(), realms);
}
private boolean hasErrors(final Pair<String, List<Pair<FileObjectIdStore, Exception>>> p) {
return !p.getRight().isEmpty();
}
private Pair<String, List<Pair<FileObjectIdStore, Exception>>> getUserDataIOErrors(
final Pair<String, List<Pair<FileObjectIdStore, Either<UserData, Exception>>>> p) {
final String realm = p.getLeft();
final Stream<Pair<FileObjectIdStore, Either<UserData, Exception>>> stream;
if (realm.equals(JitStaticConstants.GIT_REALM)) {
stream = p.getRight().stream().map(fp -> {
final Either<UserData, Exception> value = fp.getValue();
if (value.isLeft()) {
final Set<Role> userRoles = value.getLeft().getRoles();
if (!ROLES.containsAll(userRoles)) {
userRoles.retainAll(ROLES);
return Pair.of(fp.getLeft(), Either.right(new UnknownRolesException(fp.getLeft().getFileName(), userRoles)));
}
}
return fp;
});
} else {
stream = p.getRight().stream();
}
return Pair.of(p.getLeft(),
stream.filter(l -> l.getRight().isRight())
.map(err -> Pair.of(err.getLeft(), err.getRight().getRight()))
.collect(Collectors.toList()));
}
private Pair<Set<Ref>, Pair<List<Pair<FileObjectIdStore, InputStreamHolder>>, RepositoryDataError>> extracted(final Pair<AnyObjectId, Set<Ref>> p) {
return Pair.of(p.getRight(), extractAll(p.getLeft()));
}
public Pair<List<Pair<FileObjectIdStore, InputStreamHolder>>, RepositoryDataError> extractAll(final AnyObjectId tip) {
final List<Pair<FileObjectIdStore, InputStreamHolder>> files = new ArrayList<>();
RepositoryDataError error = null;
try (final RevWalk rev = new RevWalk(repository)) {
final RevCommit parsedCommit = rev.parseCommit(tip);
final RevTree currentTree = rev.parseTree(parsedCommit.getTree());
try (final TreeWalk treeWalker = new TreeWalk(repository)) {
treeWalker.addTree(currentTree);
treeWalker.setRecursive(true);
treeWalker.setFilter(PathFilter.create(USERS));
while (treeWalker.next()) {
final FileMode mode = treeWalker.getFileMode();
if (mode == FileMode.REGULAR_FILE || mode == FileMode.EXECUTABLE_FILE) {
final ObjectId objectId = treeWalker.getObjectId(0);
final String path = new String(treeWalker.getRawPath(), UTF_8);
final InputStreamHolder inputStreamHolder = getInputStreamFor(objectId);
files.add(Pair.of(new FileObjectIdStore(path, objectId), inputStreamHolder));
}
}
}
} catch (final IOException e) {
error = new RepositoryDataError(new FileObjectIdStore(USERS, tip.toObjectId()), new InputStreamHolder(e));
}
return Pair.of(files, error);
}
private InputStreamHolder getInputStreamFor(final ObjectId objectId) {
try {
Functions.ThrowingSupplier<ObjectLoader,IOException> factory = () -> repository.open(objectId);
factory.get(); // Trigger IOException
return new InputStreamHolder(factory);
} catch (final IOException e) {
return new InputStreamHolder(e);
}
}
private Ref findBranch(final String refName) throws IOException, RefNotFoundException {
final Ref branchRef = repository.findRef(refName);
if (branchRef == null) {
throw new RefNotFoundException(refName);
}
return branchRef;
}
private static class WrappingRef implements Ref {
private final Ref wrapped;
private final String alias;
public WrappingRef(final Ref ref, final String alias) {
this.wrapped = Objects.requireNonNull(ref);
this.alias = Objects.requireNonNull(alias);
}
@Override
public String getName() {
return wrapped.getName();
}
@Override
public boolean isSymbolic() {
return wrapped.isSymbolic();
}
@Override
public Ref getLeaf() {
return wrapped.getLeaf();
}
@Override
public Ref getTarget() {
return wrapped.getTarget();
}
@Override
public ObjectId getObjectId() {
return wrapped.getObjectId();
}
@Override
public ObjectId getPeeledObjectId() {
return wrapped.getPeeledObjectId();
}
@Override
public boolean isPeeled() {
return wrapped.isPeeled();
}
@Override
public Storage getStorage() {
return wrapped.getStorage();
}
@Override
public String toString() {
return alias + "=" + wrapped.getObjectId().name();
}
}
}
| [
"henrikhegardtgithub@gmail.com"
] | henrikhegardtgithub@gmail.com |
cfa7ccf5859262578685a12b867e978fff64f0b5 | 74fad131183d6c5f8e3f95fa4590c7db31d6d03f | /src/test/java/convertors/BookParserTest.java | ea02ed5bb458383642f03c2e23e58ec3e43b2c1a | [] | no_license | max40a/HtmlCrawler | d93ec5d7dc34e6dae651392b6e5125bb382da566 | 2f6a1dcb9f79701a7481d5d99e5baf00e3ce6505 | refs/heads/master | 2021-05-15T11:21:00.565700 | 2017-12-20T18:27:06 | 2017-12-20T18:27:06 | 108,317,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,895 | java | package convertors;
import entity.Isbn;
import org.apache.commons.io.IOUtils;
import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.Is;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.Test;
import java.io.IOException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.junit.Assert.assertEquals;
public class BookParserTest extends BookParser {
private static final String TEST_DATA = "Lorem ipsum dolor sit amet";
private String getHtml(String pathToResource) throws IOException {
URL resource = getClass().getClassLoader().getResource(pathToResource);
Objects.requireNonNull(resource);
return IOUtils.toString(resource, StandardCharsets.UTF_8.name());
}
@Test
public void test_find_authors_method_v1() throws IOException {
String testableHtmlV1 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_1.html");
testableHtmlV1 = testableHtmlV1.replace("${first test author}", TEST_DATA);
testableHtmlV1 = testableHtmlV1.replace("${second test author}", TEST_DATA);
testableHtmlV1 = testableHtmlV1.replace("${third test author}", TEST_DATA);
Document docV1 = Jsoup.parse(testableHtmlV1, StandardCharsets.UTF_8.name());
List<String> expectedList = Arrays.asList(TEST_DATA, TEST_DATA, TEST_DATA);
List<String> actualList = this.findAuthors(docV1).orElseThrow(IllegalStateException::new);
assertThat(actualList, is(expectedList));
assertThat(actualList, hasSize(3));
}
@Test
public void test_find_authors_method_v2() throws IOException {
String testableHtmlV2 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_2.html");
testableHtmlV2 = testableHtmlV2.replace("${test author}", TEST_DATA);
Document docV2 = Jsoup.parse(testableHtmlV2, StandardCharsets.UTF_8.name());
List<String> expectedList = Collections.singletonList(TEST_DATA);
List<String> actualList = this.findAuthors(docV2).orElseThrow(IllegalStateException::new);
assertThat(expectedList, is(actualList));
assertThat(actualList, hasSize(1));
}
@Test
public void test_that_find_authors_V1_method_not_return_empty_list_when_really_expected_list_with_content() throws IOException {
String testableHtmlV1 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_1.html");
testableHtmlV1 = testableHtmlV1.replace("${first test author}", TEST_DATA);
testableHtmlV1 = testableHtmlV1.replace("${second test author}", TEST_DATA);
Document docV1 = Jsoup.parse(testableHtmlV1, StandardCharsets.UTF_8.name());
List<String> actualList = this.findAuthors(docV1).orElseThrow(IllegalStateException::new);
assertThat(actualList, not(IsEmptyCollection.empty()));
}
@Test
public void test_that_find_authors_V2_method_not_return_empty_list_when_really_expected_list_with_content() throws IOException {
String testableHtmlV2 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_2.html");
testableHtmlV2 = testableHtmlV2.replace("${test author}", TEST_DATA);
Document docV2 = Jsoup.parse(testableHtmlV2, StandardCharsets.UTF_8.name());
List<String> actualList = this.findAuthors(docV2).orElseThrow(IllegalStateException::new);
assertThat(actualList, not(IsEmptyCollection.empty()));
}
@Test
public void test_find_authors_method_V1_returned_reallyExpected_content() throws IOException {
String testableHtmlV1 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_1.html");
testableHtmlV1 = testableHtmlV1.replace("${first test author}", TEST_DATA);
testableHtmlV1 = testableHtmlV1.replace("${second test author}", TEST_DATA);
Document docV1 = Jsoup.parse(testableHtmlV1, StandardCharsets.UTF_8.name());
List<String> actualList = this.findAuthors(docV1).orElseThrow(IllegalStateException::new);
assertThat(actualList, hasItems(TEST_DATA, TEST_DATA));
}
@Test
public void test_find_authors_method_V2_returned_reallyExpected_content() throws IOException {
String testableHtmlV2 = getHtml("test_files/book_parser_test_files/author_finder_test_file_v_2.html");
testableHtmlV2 = testableHtmlV2.replace("${test author}", TEST_DATA);
Document docV2 = Jsoup.parse(testableHtmlV2, StandardCharsets.UTF_8.name());
List<String> actualList = this.findAuthors(docV2).orElseThrow(IllegalStateException::new);
assertThat(actualList, hasItems(TEST_DATA));
}
@Test
public void test_find_categories_method() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/category_find_test_file.html");
testableHtml = testableHtml.replace("${first test category}", TEST_DATA);
testableHtml = testableHtml.replace("${second test category}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
List<String> expectedList = Arrays.asList(TEST_DATA, TEST_DATA);
List<String> actualList = this.findCategories(doc).orElseThrow(IllegalStateException::new);
assertThat(expectedList, Is.is(actualList));
assertThat(actualList, hasSize(2));
}
@Test
public void test_that_find_categories_method_not_return_empty_list_when_really_expected_list_with_content() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/category_find_test_file.html");
testableHtml = testableHtml.replace("${first test category}", TEST_DATA);
testableHtml = testableHtml.replace("${second test category}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
List<String> actualList = this.findCategories(doc).orElseThrow(IllegalStateException::new);
assertThat(actualList, not(IsEmptyCollection.empty()));
}
@Test
public void test_find_categories_method_returned_reallyExpected_content() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/category_find_test_file.html");
testableHtml = testableHtml.replace("${first test category}", TEST_DATA);
testableHtml = testableHtml.replace("${second test category}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
List<String> actualList = this.findCategories(doc).orElseThrow(IllegalStateException::new);
assertThat(actualList, hasItems(TEST_DATA, TEST_DATA));
}
@Test
public void test_find_description_method_v1() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/description_find_test_file_v1.html");
testableHtml = testableHtml.replace("${test description data}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findDescription(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_description_method_v2() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/description_find_test_file_v2.html");
testableHtml = testableHtml.replace("${test description data}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findDescription(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_how_does_isbn_finder_find_isbn() throws IOException {
String searchLanguage = "Українська";
String searchIsbnNumber = "978-617-7388-83-7";
String testableHtml = getHtml("test_files/book_parser_test_files/isbn_find_test_file.html");
testableHtml = testableHtml.replace("${test language}", searchLanguage);
testableHtml = testableHtml.replace("${test number}", searchIsbnNumber);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
Isbn expectedIsbn = Isbn.builder().language("Українська").number("9786177388837").type("13").translation(true).build();
assertEquals(expectedIsbn, findIsbn(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_number_of_pages_method() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/number_of_pages_test_file.html");
testableHtml = testableHtml.replace("${test number of pages}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findNumberOfPages(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_year_price_method() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/price_find_test_file.html");
testableHtml = testableHtml.replace("${test price}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findPrice(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_publishing_method() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/publishing_find_test_file.html");
testableHtml = testableHtml.replace("${test publishing}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findPublishing(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_title_method() {
String testableHtml = String.format("<span data-product=20068 itemprop=name style=display: none;>«%s»<span>", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA + ".", findTitle(doc).orElseThrow(IllegalStateException::new));
}
@Test
public void test_find_year_of_publishing_method() throws IOException {
String testableHtml = getHtml("test_files/book_parser_test_files/year_of_publishing_test_file.html");
testableHtml = testableHtml.replace("${test year of publishing}", TEST_DATA);
Document doc = Jsoup.parse(testableHtml, StandardCharsets.UTF_8.name());
assertEquals(TEST_DATA, findYearOfPublishing(doc).orElseThrow(IllegalStateException::new));
}
} | [
"max40a@mail.ru"
] | max40a@mail.ru |
3cff8bc1d269ed4f39aac6f844ec3b9f5cd0e91b | 9e9610df2de50fe3bc16d1865d7d503e0b4277a0 | /common/src/main/java/cn/sohu/jack/thinking/java/chapter10innerclass/Java10_4_6.java | 39966e5c9c5003fbe07ddb22bf78c75783f8a282 | [] | no_license | JackAbel/voyage | aba80e324dce768b212bffab747cca8f7e0a46ed | e7acbb4d3645a5e5bdbf05eb741f4e53561010de | refs/heads/master | 2022-12-01T21:26:16.392513 | 2020-09-28T11:49:03 | 2020-09-28T11:49:03 | 173,219,466 | 0 | 0 | null | 2022-11-16T05:51:51 | 2019-03-01T02:14:50 | Java | UTF-8 | Java | false | false | 529 | java | package cn.sohu.jack.thinking.java.chapter10innerclass;
import cn.sohu.jack.thinking.java.chapter8polymorphism.OneMethod;
import cn.sohu.jack.thinking.java.chapter9interface.Future;
/**
* @author jinxianbao
* @date 2019/3/20 10:02 AM
*/
public class Java10_4_6 extends Future {
public OneMethod testOne() {
Future future = new Future();
// protect内部类的构造器要声明为 public 才能在外部访问
Future.Inner2 futureInner = future.new Inner2();
return futureInner;
}
}
| [
"xiangbaojin215867@sohu-inc.com"
] | xiangbaojin215867@sohu-inc.com |
5d80a5c18dd5322d3c787db4d8605ad7aeb5022a | bec686b9c0c0d95c99095097a5e604c5ef01828b | /jakarta/rdbms/src/java/org/datanucleus/samples/annotations/one_many/map/MapHolder1Value.java | 870bfcb4e13fc297f8a5ec73988ee348916e1a05 | [
"Apache-2.0"
] | permissive | datanucleus/tests | d6bcbcf2df68841c1a27625a5509b87fa9ccfc9e | b47ac565c5988aba5c16389fb2870aafe9142522 | refs/heads/master | 2023-09-02T11:24:56.386187 | 2023-08-16T12:30:38 | 2023-08-16T12:30:38 | 14,927,016 | 10 | 18 | Apache-2.0 | 2023-09-13T14:01:00 | 2013-12-04T15:10:03 | Java | UTF-8 | Java | false | false | 1,006 | java | /**********************************************************************
Copyright (c) 2017 Andy Jefferson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Contributors:
...
**********************************************************************/
package org.datanucleus.samples.annotations.one_many.map;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
/**
* Value for use in MapHolder1
*/
@Entity
public class MapHolder1Value
{
@Id
long id;
String name;
}
| [
"andy@datanucleus.org"
] | andy@datanucleus.org |
2577849781570ea9815e54dabbfbe509a27af747 | 352cb15cce9be9e4402131bb398a3c894b9c72bc | /src/main/java/chapter1/topic4/LeetCode_173.java | f50d96584e27f0e0aae5e65b999a33e97ab83bef | [
"MIT"
] | permissive | DonaldY/LeetCode-Practice | 9f67220bc6087c2c34606f81154a3e91c5ee6673 | 2b7e6525840de7ea0aed68a60cdfb1757b183fec | refs/heads/master | 2023-04-27T09:58:36.792602 | 2023-04-23T15:49:22 | 2023-04-23T15:49:22 | 179,708,097 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,002 | java | package chapter1.topic4;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* @author donald
* @date 2021/03/28
*
* LeetCode: 二叉搜索树迭代器
*
* 这个题目说的是,给你一棵二叉搜索树,你要为它实现一个迭代器。
* 迭代器中包含两个公有方法,next() 方法返回二叉搜索树中下一个最小的数字,hasNext() 方法返回是否还存在下一个数字。
*
* 注意,next() 方法和 hasNext() 方法都要求平均时间复杂度是 O(1),并且额外只能使用 O(h) 的辅助空间。
* 其中,h 是二叉搜索树的高度。另外,你可以假设对 next() 方法的调用总是有效的,即不需要考虑在 next() 方法中处理不存在下一个数字的情况。
*
*
* ```
* 比如说,给你的二叉搜索树 t 是:
*
* t:
* 1
* / \
* 0 4
* / \
* 2 8
*
* 用 t 初始化迭代器,然后就可以调用 next() 和 hasNext():
*
* BSTIterator it = new BSTIterator(t);
* it.next(); // 0
* it.next(); // 1
* it.next(); // 2
* it.hasNext(); // true
* it.next(); // 4
* it.next(); // 8
* it.hasNext(); // false
* ```
*
* 思路:
* 1. 暴力法: 先全部计算好,中序排序
* 2. 辅助栈:
*/
public class LeetCode_173 {
// Faster: 40.87%
public class BSTIterator {
private final Stack<TreeNode> stack = new Stack<>();
public BSTIterator(TreeNode root) {
pushLeft(root);
}
private void pushLeft(TreeNode node) {
while (node != null) {
stack.push(node);
node = node.left;
}
}
// T(avg): O(1), S(avg): O(h)
public int next() {
TreeNode node = stack.pop(); // 1. 把栈顶节点出栈,并把节点值返回
pushLeft(node.right); // 2. 把栈顶节点右子树的最左侧分支入栈
return node.val;
}
// T(avg): O(1), S(avg): O(h)
public boolean hasNext() {
return stack.size() != 0;
}
}
}
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode() {
}
TreeNode(int val) {
this.val = val;
}
TreeNode(int val, TreeNode left, TreeNode right) {
this.val = val;
this.left = left;
this.right = right;
}
}
class BSTIterator {
private int idx;
private List<Integer> arr;
public BSTIterator(TreeNode root) {
idx = 0;
arr = new ArrayList<>();
inorderTraversal(root, arr);
}
public int next() {
return arr.get(idx++);
}
public boolean hasNext() {
return idx < arr.size();
}
private void inorderTraversal(TreeNode root, List<Integer> arr) {
if (root == null) {
return;
}
inorderTraversal(root.left, arr);
arr.add(root.val);
inorderTraversal(root.right, arr);
}
} | [
"448641125@qq.com"
] | 448641125@qq.com |
aaa1ba93b900a5c2a1f9d58ba450d061c634abe3 | 60531d7dea3b6cc326bffc0c471a48bddab764cc | /app/src/main/java/com/melolchik/bullshitbingo/ui/views/swipe/BottomSwipeRefreshLayout.java | 1197ad1cd47fab30bc3b391678d62549ff68ee94 | [] | no_license | melolchik/bullshit_bingo | 48b5385b7bffa190d5266306d921bd893231ffb8 | a931244b4206b84f5e0cbc99f6a6e1f4cd00b1f7 | refs/heads/master | 2021-01-11T18:52:55.289162 | 2017-02-02T17:42:49 | 2017-02-02T17:42:49 | 79,647,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 48,626 | java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.melolchik.bullshitbingo.ui.views.swipe;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.NestedScrollingChild;
import android.support.v4.view.NestedScrollingChildHelper;
import android.support.v4.view.NestedScrollingParent;
import android.support.v4.view.NestedScrollingParentHelper;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Transformation;
import android.widget.AbsListView;
/**
* The SwipeRefreshLayout should be used whenever the user can refresh the
* contents of a view via a vertical swipe gesture. The activity that
* instantiates this view should add an OnRefreshListener to be notified
* whenever the swipe to refresh gesture is completed. The SwipeRefreshLayout
* will notify the listener each and every time the gesture is completed again;
* the listener is responsible for correctly determining when to actually
* initiate a refresh of its content. If the listener determines there should
* not be a refresh, it must call setRefreshing(false) to cancel any visual
* indication of a refresh. If an activity wishes to show just the progress
* animation, it should call setRefreshing(true). To disable the gesture and
* progress animation, call setEnabled(false) on the view.
* <p>
* This layout should be made the parent of the view that will be refreshed as a
* result of the gesture and can only support one direct child. This view will
* also be made the target of the gesture and will be forced to match both the
* width and the height supplied in this layout. The SwipeRefreshLayout does not
* provide accessibility events; instead, a menu item must be provided to allow
* refresh of the content wherever this gesture is used.
* </p>
*/
public class BottomSwipeRefreshLayout extends ViewGroup implements NestedScrollingParent,
NestedScrollingChild {
// Maps to ProgressBar.Large style
public static final int LARGE = MaterialProgressDrawable.LARGE;
// Maps to ProgressBar default style
public static final int DEFAULT = MaterialProgressDrawable.DEFAULT;
@VisibleForTesting
static final int CIRCLE_DIAMETER = 40;
@VisibleForTesting
static final int CIRCLE_DIAMETER_LARGE = 56;
private static final String LOG_TAG = BottomSwipeRefreshLayout.class.getSimpleName();
private static final int MAX_ALPHA = 255;
private static final int STARTING_PROGRESS_ALPHA = (int) (.3f * MAX_ALPHA);
private static final float DECELERATE_INTERPOLATION_FACTOR = 2f;
private static final int INVALID_POINTER = -1;
private static final float DRAG_RATE = .5f;
// Max amount of circle that can be filled by progress during swipe gesture,
// where 1.0 is a full circle
private static final float MAX_PROGRESS_ANGLE = .8f;
private static final int SCALE_DOWN_DURATION = 150;
private static final int ALPHA_ANIMATION_DURATION = 300;
private static final int ANIMATE_TO_TRIGGER_DURATION = 200;
private static final int ANIMATE_TO_START_DURATION = 200;
// Default background for the progress spinner
private static final int CIRCLE_BG_LIGHT = 0xFFFAFAFA;
// Default offset in dips from the top of the view to where the progress spinner should stop
private static final int DEFAULT_CIRCLE_TARGET = 64;
private View mTarget; // the target of the gesture
OnRefreshListener mListener;
boolean mRefreshing = false;
private int mTouchSlop;
private float mTotalDragDistance = -1;
// If nested scrolling is enabled, the total amount that needed to be
// consumed by this as the nested scrolling parent is used in place of the
// overscroll determined by MOVE events in the onTouch handler
private float mTotalUnconsumed;
private final NestedScrollingParentHelper mNestedScrollingParentHelper;
private final NestedScrollingChildHelper mNestedScrollingChildHelper;
private final int[] mParentScrollConsumed = new int[2];
private final int[] mParentOffsetInWindow = new int[2];
private boolean mNestedScrollInProgress;
private int mMediumAnimationDuration;
int mCurrentTargetOffsetTop;
int mTargetHeight;
private float mInitialMotionY;
private float mInitialDownY;
private boolean mIsBeingDragged;
private int mActivePointerId = INVALID_POINTER;
// Whether this item is scaled up rather than clipped
boolean mScale;
// Target is returning to its start offset because it was cancelled or a
// refresh was triggered.
private boolean mReturningToStart;
private final DecelerateInterpolator mDecelerateInterpolator;
private static final int[] LAYOUT_ATTRS = new int[] {
android.R.attr.enabled
};
CircleImageView mCircleView;
private int mCircleViewIndex = -1;
protected int mFrom;
float mStartingScale;
protected int mOriginalOffsetTop;
int mSpinnerOffsetEnd;
MaterialProgressDrawable mProgress;
private Animation mScaleAnimation;
private Animation mScaleDownAnimation;
private Animation mAlphaStartAnimation;
private Animation mAlphaMaxAnimation;
private Animation mScaleDownToStartAnimation;
boolean mNotify;
private int mCircleDiameter;
// Whether the client has set a custom starting position;
boolean mUsingCustomStart;
private OnChildScrollUpCallback mChildScrollUpCallback;
private AnimationListener mRefreshListener = new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if (mRefreshing) {
// Make sure the progress view is fully visible
mProgress.setAlpha(MAX_ALPHA);
mProgress.start();
if (mNotify) {
if (mListener != null) {
mListener.onRefresh();
}
}
mCurrentTargetOffsetTop = (int) ViewCompat.getTranslationY(mCircleView);
} else {
reset();
}
}
};
void reset() {
mCircleView.clearAnimation();
mProgress.stop();
mCircleView.setVisibility(View.GONE);
setColorViewAlpha(MAX_ALPHA);
// Return the circle to its start position
if (mScale) {
setAnimationProgress(0 /* animation complete and view is hidden */);
} else {
setTargetOffsetTopAndBottom(/*mOriginalOffsetTop - mCurrentTargetOffsetTop*/0,
true /* requires update */);
}
mCurrentTargetOffsetTop = mCircleView.getTop();
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (!enabled) {
reset();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
reset();
}
private void setColorViewAlpha(int targetAlpha) {
mCircleView.getBackground().setAlpha(targetAlpha);
mProgress.setAlpha(targetAlpha);
}
/**
* The refresh indicator starting and resting position is always positioned
* near the top of the refreshing content. This position is a consistent
* location, but can be adjusted in either direction based on whether or not
* there is a toolbar or actionbar present.
* <p>
* <strong>Note:</strong> Calling this will reset the position of the refresh indicator to
* <code>start</code>.
* </p>
*
* @param scale Set to true if there is no view at a higher z-order than where the progress
* spinner is set to appear. Setting it to true will cause indicator to be scaled
* up rather than clipped.
* @param start The offset in pixels from the top of this view at which the
* progress spinner should appear.
* @param end The offset in pixels from the top of this view at which the
* progress spinner should come to rest after a successful swipe
* gesture.
*/
public void setProgressViewOffset(boolean scale, int start, int end) {
mScale = scale;
mOriginalOffsetTop = start;
mSpinnerOffsetEnd = end;
mUsingCustomStart = true;
reset();
mRefreshing = false;
}
/**
* @return The offset in pixels from the top of this view at which the progress spinner should
* appear.
*/
public int getProgressViewStartOffset() {
return mOriginalOffsetTop;
}
/**
* @return The offset in pixels from the top of this view at which the progress spinner should
* come to rest after a successful swipe gesture.
*/
public int getProgressViewEndOffset() {
return mSpinnerOffsetEnd;
}
/**
* The refresh indicator resting position is always positioned near the top
* of the refreshing content. This position is a consistent location, but
* can be adjusted in either direction based on whether or not there is a
* toolbar or actionbar present.
*
* @param scale Set to true if there is no view at a higher z-order than where the progress
* spinner is set to appear. Setting it to true will cause indicator to be scaled
* up rather than clipped.
* @param end The offset in pixels from the top of this view at which the
* progress spinner should come to rest after a successful swipe
* gesture.
*/
public void setProgressViewEndTarget(boolean scale, int end) {
mSpinnerOffsetEnd = end;
mScale = scale;
mCircleView.invalidate();
}
/**
* One of DEFAULT, or LARGE.
*/
public void setSize(int size) {
if (size != MaterialProgressDrawable.LARGE && size != MaterialProgressDrawable.DEFAULT) {
return;
}
final DisplayMetrics metrics = getResources().getDisplayMetrics();
if (size == MaterialProgressDrawable.LARGE) {
mCircleDiameter = (int) (CIRCLE_DIAMETER_LARGE * metrics.density);
} else {
mCircleDiameter = (int) (CIRCLE_DIAMETER * metrics.density);
}
// force the bounds of the progress circle inside the circle view to
// update by setting it to null before updating its size and then
// re-setting it
mCircleView.setImageDrawable(null);
mProgress.updateSizes(size);
mCircleView.setImageDrawable(mProgress);
}
/**
* Simple constructor to use when creating a SwipeRefreshLayout from code.
*
* @param context
*/
public BottomSwipeRefreshLayout(Context context) {
this(context, null);
}
/**
* Constructor that is called when inflating SwipeRefreshLayout from XML.
*
* @param context
* @param attrs
*/
public BottomSwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = -ViewConfiguration.get(context).getScaledTouchSlop();
mMediumAnimationDuration = getResources().getInteger(
android.R.integer.config_mediumAnimTime);
setWillNotDraw(false);
mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
final DisplayMetrics metrics = getResources().getDisplayMetrics();
mCircleDiameter = (int) (CIRCLE_DIAMETER * metrics.density);
createProgressView();
ViewCompat.setChildrenDrawingOrderEnabled(this, true);
// the absolute offset has to take into account that the circle starts at an offset
mSpinnerOffsetEnd = (int) (DEFAULT_CIRCLE_TARGET * metrics.density);
mTotalDragDistance = mSpinnerOffsetEnd;
mNestedScrollingParentHelper = new NestedScrollingParentHelper(this);
mNestedScrollingChildHelper = new NestedScrollingChildHelper(this);
setNestedScrollingEnabled(true);
mOriginalOffsetTop = mCurrentTargetOffsetTop;// = - mCircleDiameter;
moveToStart(1.0f);
final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
setEnabled(a.getBoolean(0, true));
a.recycle();
}
@Override
protected int getChildDrawingOrder(int childCount, int i) {
if (mCircleViewIndex < 0) {
return i;
} else if (i == childCount - 1) {
// Draw the selected child last
return mCircleViewIndex;
} else if (i >= mCircleViewIndex) {
// Move the children after the selected child earlier one
return i + 1;
} else {
// Keep the children before the selected child the same
return i;
}
}
private void createProgressView() {
mCircleView = new CircleImageView(getContext(),CIRCLE_BG_LIGHT);
mCircleView.setBackgroundColor(CIRCLE_BG_LIGHT);
mProgress = new MaterialProgressDrawable(getContext(), this);
mProgress.setBackgroundColor(CIRCLE_BG_LIGHT);
mCircleView.setImageDrawable(mProgress);
mCircleView.setVisibility(View.GONE);
addView(mCircleView);
}
/**
* Set the listener to be notified when a refresh is triggered via the swipe
* gesture.
*/
public void setOnRefreshListener(OnRefreshListener listener) {
mListener = listener;
}
/**
* Pre API 11, alpha is used to make the progress circle appear instead of scale.
*/
private boolean isAlphaUsedForScale() {
return android.os.Build.VERSION.SDK_INT < 11;
}
/**
* Notify the widget that refresh state has changed. Do not call this when
* refresh is triggered by a swipe gesture.
*
* @param refreshing Whether or not the view should show refresh progress.
*/
public void setRefreshing(boolean refreshing) {
if (refreshing && mRefreshing != refreshing) {
// scale and show
mRefreshing = refreshing;
int endTarget = 0;
if (!mUsingCustomStart) {
endTarget = mSpinnerOffsetEnd + mOriginalOffsetTop;
} else {
endTarget = mSpinnerOffsetEnd;
}
setTargetOffsetTopAndBottom(endTarget - mCurrentTargetOffsetTop,
true /* requires update */);
mNotify = false;
startScaleUpAnimation(mRefreshListener);
} else {
setRefreshing(refreshing, false /* notify */);
}
}
private void startScaleUpAnimation(AnimationListener listener) {
mCircleView.setVisibility(View.VISIBLE);
if (android.os.Build.VERSION.SDK_INT >= 11) {
// Pre API 11, alpha is used in place of scale up to show the
// progress circle appearing.
// Don't adjust the alpha during appearance otherwise.
mProgress.setAlpha(MAX_ALPHA);
}
mScaleAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
setAnimationProgress(interpolatedTime);
}
};
mScaleAnimation.setDuration(mMediumAnimationDuration);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleAnimation);
}
/**
* Pre API 11, this does an alpha animation.
* @param progress
*/
void setAnimationProgress(float progress) {
if (isAlphaUsedForScale()) {
setColorViewAlpha((int) (progress * MAX_ALPHA));
} else {
ViewCompat.setScaleX(mCircleView, progress);
ViewCompat.setScaleY(mCircleView, progress);
}
}
private void setRefreshing(boolean refreshing, final boolean notify) {
if (mRefreshing != refreshing) {
mNotify = notify;
ensureTarget();
mRefreshing = refreshing;
if (mRefreshing) {
animateOffsetToCorrectPosition(mCurrentTargetOffsetTop, mRefreshListener);
} else {
startScaleDownAnimation(mRefreshListener);
}
}
}
void startScaleDownAnimation(AnimationListener listener) {
mScaleDownAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
setAnimationProgress(1 - interpolatedTime);
}
};
mScaleDownAnimation.setDuration(SCALE_DOWN_DURATION);
mCircleView.setAnimationListener(listener);
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleDownAnimation);
}
private void startProgressAlphaStartAnimation() {
mAlphaStartAnimation = startAlphaAnimation(mProgress.getAlpha(), STARTING_PROGRESS_ALPHA);
}
private void startProgressAlphaMaxAnimation() {
mAlphaMaxAnimation = startAlphaAnimation(mProgress.getAlpha(), MAX_ALPHA);
}
private Animation startAlphaAnimation(final int startingAlpha, final int endingAlpha) {
// Pre API 11, alpha is used in place of scale. Don't also use it to
// show the trigger point.
if (mScale && isAlphaUsedForScale()) {
return null;
}
Animation alpha = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
mProgress.setAlpha(
(int) (startingAlpha + ((endingAlpha - startingAlpha) * interpolatedTime)));
}
};
alpha.setDuration(ALPHA_ANIMATION_DURATION);
// Clear out the previous animation listeners.
mCircleView.setAnimationListener(null);
mCircleView.clearAnimation();
mCircleView.startAnimation(alpha);
return alpha;
}
/**
* @deprecated Use {@link #setProgressBackgroundColorSchemeResource(int)}
*/
@Deprecated
public void setProgressBackgroundColor(int colorRes) {
setProgressBackgroundColorSchemeResource(colorRes);
}
/**
* Set the background color of the progress spinner disc.
*
* @param colorRes Resource id of the color.
*/
public void setProgressBackgroundColorSchemeResource(@ColorRes int colorRes) {
setProgressBackgroundColorSchemeColor(ContextCompat.getColor(getContext(), colorRes));
}
/**
* Set the background color of the progress spinner disc.
*
* @param color
*/
public void setProgressBackgroundColorSchemeColor(@ColorInt int color) {
mCircleView.setBackgroundColor(color);
mProgress.setBackgroundColor(color);
}
/**
* Set the color resources used in the progress animation from color resources.
* The first color will also be the color of the bar that grows in response
* to a user swipe gesture.
*
* @param colorResIds
*/
public void setColorSchemeResources(@ColorRes int... colorResIds) {
final Context context = getContext();
int[] colorRes = new int[colorResIds.length];
for (int i = 0; i < colorResIds.length; i++) {
colorRes[i] = ContextCompat.getColor(context, colorResIds[i]);
}
setColorSchemeColors(colorRes);
}
/**
* Set the colors used in the progress animation. The first
* color will also be the color of the bar that grows in response to a user
* swipe gesture.
*
* @param colors
*/
public void setColorSchemeColors(@ColorInt int... colors) {
ensureTarget();
mProgress.setColorSchemeColors(colors);
}
/**
* @return Whether the SwipeRefreshWidget is actively showing refresh
* progress.
*/
public boolean isRefreshing() {
return mRefreshing;
}
private void ensureTarget() {
// Don't bother getting the parent height if the parent hasn't been laid
// out yet.
if (mTarget == null) {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
if (!child.equals(mCircleView)) {
mTarget = child;
break;
}
}
}
}
/**
* Set the distance to trigger a sync in dips
*
* @param distance
*/
public void setDistanceToTriggerSync(int distance) {
mTotalDragDistance = distance;
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
final int width = getMeasuredWidth();
final int height = getMeasuredHeight();
if (getChildCount() == 0) {
return;
}
if (mTarget == null) {
ensureTarget();
}
if (mTarget == null) {
return;
}
final View child = mTarget;
final int childLeft = getPaddingLeft();
final int childTop = getPaddingTop();
final int childWidth = width - getPaddingLeft() - getPaddingRight();
final int childHeight = height - getPaddingTop() - getPaddingBottom();
child.layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight);
int circleWidth = mCircleView.getMeasuredWidth();
int circleHeight = mCircleView.getMeasuredHeight();
mTargetHeight = childHeight;
//mTotalDragDistance = mSpinnerOffsetEnd;
//log("onLayout mTargetHeight = " + mTargetHeight);
// mCircleView.layout((width / 2 - circleWidth / 2), childHeight,
// (width / 2 + circleWidth / 2),childHeight + circleHeight);
//mCurrentTargetOffsetTop = childHeight;
mCircleView.layout((width / 2 - circleWidth / 2), 0,
(width / 2 + circleWidth / 2), 0 + circleHeight);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mTarget == null) {
ensureTarget();
}
if (mTarget == null) {
return;
}
mTarget.measure(MeasureSpec.makeMeasureSpec(
getMeasuredWidth() - getPaddingLeft() - getPaddingRight(),
MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(
getMeasuredHeight() - getPaddingTop() - getPaddingBottom(), MeasureSpec.EXACTLY));
mCircleView.measure(MeasureSpec.makeMeasureSpec(mCircleDiameter, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(mCircleDiameter, MeasureSpec.EXACTLY));
mCircleViewIndex = -1;
// Get the index of the circleview.
for (int index = 0; index < getChildCount(); index++) {
if (getChildAt(index) == mCircleView) {
mCircleViewIndex = index;
break;
}
}
}
/**
* Get the diameter of the progress circle that is displayed as part of the
* swipe to refresh layout.
*
* @return Diameter in pixels of the progress circle view.
*/
public int getProgressCircleDiameter() {
return mCircleDiameter;
}
/**
* @return Whether it is possible for the child view of this layout to
* scroll up. Override this if the child view is a custom view.
*/
public boolean canChildScrollDown() {
if (mChildScrollUpCallback != null) {
return mChildScrollUpCallback.canChildScrollUp(this, mTarget);
}
if (android.os.Build.VERSION.SDK_INT < 14) {
if (mTarget instanceof AbsListView) {
final AbsListView absListView = (AbsListView) mTarget;
return absListView.getChildCount() > 0
&& (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0)
.getTop() < absListView.getPaddingTop());
} else {
return ViewCompat.canScrollVertically(mTarget, 1) || mTarget.getScrollY() > 0;
}
} else {
return ViewCompat.canScrollVertically(mTarget, 1);
}
}
/**
* Set a callback to override {@link BottomSwipeRefreshLayout#canChildScrollDown()} method. Non-null
* callback will return the value provided by the callback and ignore all internal logic.
* @param callback Callback that should be called when canChildScrollUp() is called.
*/
public void setOnChildScrollUpCallback(@Nullable OnChildScrollUpCallback callback) {
mChildScrollUpCallback = callback;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
ensureTarget();
final int action = MotionEventCompat.getActionMasked(ev);
int pointerIndex;
if (mReturningToStart && action == MotionEvent.ACTION_DOWN) {
mReturningToStart = false;
}
//log("onInterceptTouchEvent mNestedScrollInProgress = " + mNestedScrollInProgress);
// log("canChildScrollDown() = " + canChildScrollDown());
if (!isEnabled() || mReturningToStart || canChildScrollDown()
|| mRefreshing || mNestedScrollInProgress) {
// Fail fast if we're not in a state where a swipe is possible
//log("onInterceptTouchEvent false action = " + action);
return false;
}
//log("onInterceptTouchEvent cant scroll down action = " + action);
switch (action) {
case MotionEvent.ACTION_DOWN:
setTargetOffsetTopAndBottom(0/*mOriginalOffsetTop + mCircleView.getTop()*/, true);
mActivePointerId = ev.getPointerId(0);
mIsBeingDragged = false;
pointerIndex = ev.findPointerIndex(mActivePointerId);
if (pointerIndex < 0) {
return false;
}
mInitialDownY = ev.getY(pointerIndex);
break;
case MotionEvent.ACTION_MOVE:
//log("ACTION_MOVE");
if (mActivePointerId == INVALID_POINTER) {
log("ACTION_MOVE Got ACTION_MOVE event but don't have an active pointer id.");
return false;
}
pointerIndex = ev.findPointerIndex(mActivePointerId);
if (pointerIndex < 0) {
log("ACTION_MOVE pointerIndex < 0");
return false;
}
final float y = ev.getY(pointerIndex);
startDragging(y);
break;
case MotionEventCompat.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mIsBeingDragged = false;
mActivePointerId = INVALID_POINTER;
break;
}
return mIsBeingDragged;
}
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
if ((android.os.Build.VERSION.SDK_INT < 21 && mTarget instanceof AbsListView)
|| (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(b);
}
}
// NestedScrollingParent
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
return isEnabled() && !mReturningToStart && !mRefreshing
&& (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
@Override
public void onNestedScrollAccepted(View child, View target, int axes) {
// Reset the counter of how much leftover scroll needs to be consumed.
mNestedScrollingParentHelper.onNestedScrollAccepted(child, target, axes);
// Dispatch up to the nested parent
startNestedScroll(axes & ViewCompat.SCROLL_AXIS_VERTICAL);
mTotalUnconsumed = 0;
//log("onNestedScrollAccepted mTotalUnconsumed = " + 0);
mNestedScrollInProgress = true;
}
@Override
public void onNestedPreScroll(View target, int dx, int dy, int[] consumed) {
// If we are in the middle of consuming, a scroll, then we want to move the spinner back up
// before allowing the list to scroll
// log("onNestedPreScroll dy = " + dy);
// log("onNestedPreScroll mTotalUnconsumed = " + mTotalUnconsumed);
if (dy < 0 && mTotalUnconsumed > 0) {
if (Math.abs(dy) > mTotalUnconsumed) {
consumed[1] = -dy - (int) mTotalUnconsumed;
mTotalUnconsumed = 0;
} else {
mTotalUnconsumed += dy;
consumed[1] = dy;
}
moveSpinner(mTotalUnconsumed);
}
// If a client layout is using a custom start position for the circle
// view, they mean to hide it again before scrolling the child view
// If we get back to mTotalUnconsumed == 0 and there is more to go, hide
// the circle so it isn't exposed if its blocking content is moved
if (mUsingCustomStart && dy > 0 && mTotalUnconsumed == 0
&& Math.abs(dy - consumed[1]) > 0) {
mCircleView.setVisibility(View.GONE);
}
// Now let our nested parent consume the leftovers
final int[] parentConsumed = mParentScrollConsumed;
if (dispatchNestedPreScroll(dx - consumed[0], dy - consumed[1], parentConsumed, null)) {
consumed[0] += parentConsumed[0];
consumed[1] += parentConsumed[1];
}
}
@Override
public int getNestedScrollAxes() {
return mNestedScrollingParentHelper.getNestedScrollAxes();
}
@Override
public void onStopNestedScroll(View target) {
mNestedScrollingParentHelper.onStopNestedScroll(target);
// log("onStopNestedScroll mNestedScrollInProgress = " + mNestedScrollInProgress);
mNestedScrollInProgress = false;
// Finish the spinner for nested scrolling if we ever consumed any
// unconsumed nested scroll
if (mTotalUnconsumed > 0) {
finishSpinner(mTotalUnconsumed);
mTotalUnconsumed = 0;
}
// Dispatch up our nested parent
stopNestedScroll();
}
@Override
public void onNestedScroll(final View target, final int dxConsumed, final int dyConsumed,
final int dxUnconsumed, final int dyUnconsumed) {
// Dispatch up to the nested parent first
dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed,
mParentOffsetInWindow);
// This is a bit of a hack. Nested scrolling works from the bottom up, and as we are
// sometimes between two nested scrolling views, we need a way to be able to know when any
// nested scrolling parent has stopped handling events. We do that by using the
// 'offset in window 'functionality to see if we have been moved from the event.
// This is a decent indication of whether we should take over the event stream or not.
final int dy = dyUnconsumed + mParentOffsetInWindow[1];
//log("onNestedScroll dy = " + dy);
//log("onNestedScroll mTotalUnconsumed = " + mTotalUnconsumed);
if (dy > 0 && !canChildScrollDown()) {
mTotalUnconsumed += Math.abs(dy);
moveSpinner(mTotalUnconsumed);
}
}
// NestedScrollingChild
@Override
public void setNestedScrollingEnabled(boolean enabled) {
mNestedScrollingChildHelper.setNestedScrollingEnabled(enabled);
}
@Override
public boolean isNestedScrollingEnabled() {
return mNestedScrollingChildHelper.isNestedScrollingEnabled();
}
@Override
public boolean startNestedScroll(int axes) {
return mNestedScrollingChildHelper.startNestedScroll(axes);
}
@Override
public void stopNestedScroll() {
mNestedScrollingChildHelper.stopNestedScroll();
}
@Override
public boolean hasNestedScrollingParent() {
return mNestedScrollingChildHelper.hasNestedScrollingParent();
}
@Override
public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed,
int dyUnconsumed, int[] offsetInWindow) {
return mNestedScrollingChildHelper.dispatchNestedScroll(dxConsumed, dyConsumed,
dxUnconsumed, dyUnconsumed, offsetInWindow);
}
@Override
public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) {
return mNestedScrollingChildHelper.dispatchNestedPreScroll(
dx, dy, consumed, offsetInWindow);
}
@Override
public boolean onNestedPreFling(View target, float velocityX,
float velocityY) {
return dispatchNestedPreFling(velocityX, velocityY);
}
@Override
public boolean onNestedFling(View target, float velocityX, float velocityY,
boolean consumed) {
return dispatchNestedFling(velocityX, velocityY, consumed);
}
@Override
public boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed) {
return mNestedScrollingChildHelper.dispatchNestedFling(velocityX, velocityY, consumed);
}
@Override
public boolean dispatchNestedPreFling(float velocityX, float velocityY) {
return mNestedScrollingChildHelper.dispatchNestedPreFling(velocityX, velocityY);
}
private boolean isAnimationRunning(Animation animation) {
return animation != null && animation.hasStarted() && !animation.hasEnded();
}
private void moveSpinner(float overscrollTop) {
log("moveSpinner overscrollTop" + overscrollTop);
mProgress.showArrow(true);
float originalDragPercent = overscrollTop / mTotalDragDistance;
float dragPercent = Math.min(1f, Math.abs(originalDragPercent));
float adjustedPercent = (float) Math.max(dragPercent - .4, 0) * 5 / 3;
float extraOS = Math.abs(overscrollTop) - mTotalDragDistance;
float slingshotDist = mUsingCustomStart ? mSpinnerOffsetEnd - mOriginalOffsetTop
: mSpinnerOffsetEnd;
float tensionSlingshotPercent = Math.max(0, Math.min(extraOS, slingshotDist * 2)
/ slingshotDist);
float tensionPercent = (float) ((tensionSlingshotPercent / 4) - Math.pow(
(tensionSlingshotPercent / 4), 2)) * 2f;
float extraMove = (slingshotDist) * tensionPercent * 2;
int targetY = mOriginalOffsetTop + (int) ((slingshotDist * dragPercent) + extraMove);
// where 1.0f is a full circle
if (mCircleView.getVisibility() != View.VISIBLE) {
mCircleView.setVisibility(View.VISIBLE);
}
if (!mScale) {
ViewCompat.setScaleX(mCircleView, 1f);
ViewCompat.setScaleY(mCircleView, 1f);
}
if (mScale) {
setAnimationProgress(Math.min(1f, overscrollTop / mTotalDragDistance));
}
if (overscrollTop < mTotalDragDistance) {
if (mProgress.getAlpha() > STARTING_PROGRESS_ALPHA
&& !isAnimationRunning(mAlphaStartAnimation)) {
// Animate the alpha
startProgressAlphaStartAnimation();
}
} else {
if (mProgress.getAlpha() < MAX_ALPHA && !isAnimationRunning(mAlphaMaxAnimation)) {
// Animate the alpha
startProgressAlphaMaxAnimation();
}
}
float strokeStart = adjustedPercent * .8f;
mProgress.setStartEndTrim(0f, Math.min(MAX_PROGRESS_ANGLE, strokeStart));
mProgress.setArrowScale(Math.min(1f, adjustedPercent));
float rotation = (-0.25f + .4f * adjustedPercent + tensionPercent * 2) * .5f;
mProgress.setProgressRotation(rotation);
//log("moveSpinner targetY" + targetY + " mCurrentTargetOffsetTop = " + mCurrentTargetOffsetTop);
setTargetOffsetTopAndBottom( - targetY, true /* requires update */);
}
private void finishSpinner(float overscrollTop) {
log("finishSpinner overscrollTop = " + overscrollTop + " mTotalDragDistance = " + mTotalDragDistance);
if (Math.abs(overscrollTop) - 100 > mTotalDragDistance) {
setRefreshing(true, true /* notify */);
} else {
// cancel refresh
mRefreshing = false;
mProgress.setStartEndTrim(0f, 0f);
AnimationListener listener = null;
if (!mScale) {
listener = new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
if (!mScale) {
startScaleDownAnimation(null);
}
}
@Override
public void onAnimationRepeat(Animation animation) {
}
};
}
animateOffsetToStartPosition(mCurrentTargetOffsetTop, listener);
mProgress.showArrow(false);
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
final int action = MotionEventCompat.getActionMasked(ev);
int pointerIndex = -1;
if (mReturningToStart && action == MotionEvent.ACTION_DOWN) {
mReturningToStart = false;
}
//log("onTouchEvent mNestedScrollInProgress = " + mNestedScrollInProgress);
if (!isEnabled() || mReturningToStart || canChildScrollDown()
|| mRefreshing || mNestedScrollInProgress) {
// Fail fast if we're not in a state where a swipe is possible
//log("onTouchEvent false");
return false;
}
switch (action) {
case MotionEvent.ACTION_DOWN:
mActivePointerId = ev.getPointerId(0);
mIsBeingDragged = false;
break;
case MotionEvent.ACTION_MOVE: {
//log("onTouchEvent cant scroll down ACTION_MOVE");
pointerIndex = ev.findPointerIndex(mActivePointerId);
if (pointerIndex < 0) {
log("Got ACTION_MOVE event but have an invalid active pointer id.");
return false;
}
final float y = ev.getY(pointerIndex);
startDragging(y);
if (mIsBeingDragged) {
final float overscrollTop = (y - mInitialMotionY) * DRAG_RATE;
//log("y = " + y + " mInitialMotionY = " + mInitialMotionY);
//log("overscrollTop = " + overscrollTop);
if (overscrollTop < 0) {
moveSpinner(-overscrollTop);
} else {
return false;
}
}
break;
}
case MotionEventCompat.ACTION_POINTER_DOWN: {
pointerIndex = MotionEventCompat.getActionIndex(ev);
if (pointerIndex < 0) {
Log.e(LOG_TAG,
"Got ACTION_POINTER_DOWN event but have an invalid action index.");
return false;
}
mActivePointerId = ev.getPointerId(pointerIndex);
break;
}
case MotionEventCompat.ACTION_POINTER_UP:
onSecondaryPointerUp(ev);
break;
case MotionEvent.ACTION_UP: {
pointerIndex = ev.findPointerIndex(mActivePointerId);
if (pointerIndex < 0) {
Log.e(LOG_TAG, "Got ACTION_UP event but don't have an active pointer id.");
return false;
}
if (mIsBeingDragged) {
final float y = ev.getY(pointerIndex);
final float overscrollTop = (y - mInitialMotionY) * DRAG_RATE;
mIsBeingDragged = false;
finishSpinner(overscrollTop);
}
mActivePointerId = INVALID_POINTER;
return false;
}
case MotionEvent.ACTION_CANCEL:
return false;
}
return true;
}
private void startDragging(float y) {
// log("startDragging y = " + y + " mInitialDownY = " + mInitialDownY);
final float yDiff = y - mInitialDownY;
//log("startDragging yDiff = " + yDiff + " mTouchSlop = " + mTouchSlop);
if (yDiff > mTouchSlop && !mIsBeingDragged) {
mInitialMotionY = mInitialDownY + mTouchSlop;
mIsBeingDragged = true;
mProgress.setAlpha(STARTING_PROGRESS_ALPHA);
}
}
private void animateOffsetToCorrectPosition(int from, AnimationListener listener) {
mFrom = from;
mAnimateToCorrectPosition.reset();
mAnimateToCorrectPosition.setDuration(ANIMATE_TO_TRIGGER_DURATION);
mAnimateToCorrectPosition.setInterpolator(mDecelerateInterpolator);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mAnimateToCorrectPosition);
}
private void animateOffsetToStartPosition(int from, AnimationListener listener) {
if (mScale) {
// Scale the item back down
startScaleDownReturnToStartAnimation(from, listener);
} else {
mFrom = from;
mAnimateToStartPosition.reset();
mAnimateToStartPosition.setDuration(ANIMATE_TO_START_DURATION);
mAnimateToStartPosition.setInterpolator(mDecelerateInterpolator);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mAnimateToStartPosition);
}
}
private final Animation mAnimateToCorrectPosition = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
int targetTop = 0;
int endTarget = 0;
if (!mUsingCustomStart) {
endTarget = mSpinnerOffsetEnd - Math.abs(mOriginalOffsetTop);
} else {
endTarget = mSpinnerOffsetEnd;
}
log("endTarget = " + endTarget);
log("mFrom = " + mFrom);
log("interpolatedTime = " + interpolatedTime);
targetTop = (mFrom + (int) ((endTarget - mFrom) * interpolatedTime));
int offset = targetTop - mCircleView.getTop();
int full_offset = - endTarget -(int)((mTargetHeight - mFrom - endTarget) * (1 - interpolatedTime));
setTargetOffsetTopAndBottom(full_offset, false /* requires update */);
mProgress.setArrowScale(1 - interpolatedTime);
}
};
void moveToStart(float interpolatedTime) {
// log("moveToStart interpolatedTime = " + interpolatedTime);
// log("moveToStart mTargetHeight = " + mTargetHeight + " mFrom = " + mFrom);
int full_offset = mTargetHeight - mFrom;
int offset = -(int)(full_offset * (1 - interpolatedTime));
setTargetOffsetTopAndBottom(offset, false /* requires update */);
}
private final Animation mAnimateToStartPosition = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
moveToStart(interpolatedTime);
}
};
private void startScaleDownReturnToStartAnimation(int from,
AnimationListener listener) {
mFrom = from;
if (isAlphaUsedForScale()) {
mStartingScale = mProgress.getAlpha();
} else {
mStartingScale = ViewCompat.getScaleX(mCircleView);
}
mScaleDownToStartAnimation = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float targetScale = (mStartingScale + (-mStartingScale * interpolatedTime));
setAnimationProgress(targetScale);
moveToStart(interpolatedTime);
}
};
mScaleDownToStartAnimation.setDuration(SCALE_DOWN_DURATION);
if (listener != null) {
mCircleView.setAnimationListener(listener);
}
mCircleView.clearAnimation();
mCircleView.startAnimation(mScaleDownToStartAnimation);
}
void setTargetOffsetTopAndBottom(int offset, boolean requiresUpdate) {
log("setTargetOffsetTopAndBottom offset = " + offset);
mCircleView.bringToFront();
ViewCompat.setTranslationY(mCircleView,mTargetHeight + offset);
mCurrentTargetOffsetTop = mTargetHeight + offset;
if (requiresUpdate && android.os.Build.VERSION.SDK_INT < 11) {
invalidate();
}
}
private void onSecondaryPointerUp(MotionEvent ev) {
final int pointerIndex = MotionEventCompat.getActionIndex(ev);
final int pointerId = ev.getPointerId(pointerIndex);
if (pointerId == mActivePointerId) {
// This was our active pointer going up. Choose a new
// active pointer and adjust accordingly.
final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
mActivePointerId = ev.getPointerId(newPointerIndex);
}
}
/**
* Classes that wish to be notified when the swipe gesture correctly
* triggers a refresh should implement this interface.
*/
public interface OnRefreshListener {
/**
* Called when a swipe gesture triggers a refresh.
*/
void onRefresh();
}
/**
* Classes that wish to override {@link BottomSwipeRefreshLayout#canChildScrollDown()} ()} method
* behavior should implement this interface.
*/
public interface OnChildScrollUpCallback {
/**
* Callback that will be called when {@link BottomSwipeRefreshLayout#canChildScrollDown()} ()} method
* is called to allow the implementer to override its behavior.
*
* @param parent SwipeRefreshLayout that this callback is overriding.
* @param child The child view of SwipeRefreshLayout.
*
* @return Whether it is possible for the child view of parent layout to scroll up.
*/
boolean canChildScrollUp(BottomSwipeRefreshLayout parent, @Nullable View child);
}
protected void log(String message) {
// AppLogger.log(this.getClass().getSimpleName() + " " + message);
}
}
| [
"om@messapps.com"
] | om@messapps.com |
112ae34b42139be027f9ec59d8d8b73b271a55d1 | c5224e4792c7d17227f0ebbfd8a8183e017946d7 | /Lava Quest/src/com/vogon101/game/lib/vogongame/platform/LifePickup.java | 2d5dfcacf313feee7cd8229357afad079c8e5225 | [] | no_license | vogon101/Lava-Quest | 97af1c3dfdca141c399ded3172d860554bdd47d3 | 5848da0a9f049deb7ca4156660b99f2bda377d99 | refs/heads/master | 2016-09-01T20:36:33.502466 | 2014-04-28T19:12:05 | 2014-04-28T19:12:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,532 | java | package com.vogon101.game.lib.vogongame.platform;
import static org.lwjgl.opengl.GL11.*;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;
import com.vogon101.game.lib.vogongame.VogonGameException;
import com.vogon101.game.lib.vogongame.util.VogonTextureLoader;
public class LifePickup extends Pickup {
protected Texture heartTex;
public LifePickup(double x, double y, double width, double height,
Level level) {
super(x, y, width, height, level);
try {
heartTex = VogonTextureLoader.loadTexture("res/textures/heart-full.png");
} catch (VogonGameException e) {
e.printStackTrace();
}
}
public void init() throws VogonGameException {
}
@Override
public void draw() {
if (there) {
glPushMatrix();
glBindTexture(GL_TEXTURE_2D, heartTex.getTextureID());
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Color.white.bind();
glTranslated(x, y, 0);
{
/*
* For a quad the coords are:
* vertex 1 = 0, 0
* vertex 2 = width, 0
* vertex 3 = width, height
* vertex 4 = 0, height
*/
glBegin(GL_QUADS);
glTexCoord2d(0, 1);
glVertex2d(0, 0);
glTexCoord2d(1, 1);
glVertex2d(width, 0);
glTexCoord2d(1, 0);
glVertex2d(width, height);
glTexCoord2d(0, 0);
glVertex2d(0, height);
glEnd();
}
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glPopMatrix();
}
}
}
| [
"freddie.poser@btinternet.com"
] | freddie.poser@btinternet.com |
11aa545973e9f8e8bcd08d9a2b56abb9e6dd99f9 | acbacd634692f79fbd3ac6f5fd99ae2fd96dc327 | /microservice-consumer-movie-feign-with-hystrix-factory/src/main/java/com/spring/cloud/feign/UserFeignClient.java | ee5d4e6155634e0a9efbe1d1acd6e05cb699b14b | [] | no_license | JesonMrLiu/SpringCloud | aeb4727c98fa8df53771fb73d20e481c2aabc9eb | c407a104b60b00a08322bff06737101831effbd0 | refs/heads/master | 2021-01-19T20:12:03.570451 | 2017-04-24T09:41:34 | 2017-04-24T09:41:34 | 88,494,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,070 | java | package com.spring.cloud.feign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.spring.cloud.entity.User;
import com.spring.cloud.hystrix.UserFeignWithFactory;
import feign.hystrix.FallbackFactory;
/**
* 这里要注意,fallback和fallbackFactory不能同时使用,不然会有冲突
* @author Administrator
*
*/
@FeignClient(name = "microservice-provider-user", /*fallback = UserFeignClient.HystrixClientFallback.class,*/ fallbackFactory = UserFeignClient.HystrixClientFallbackFactory.class)
public interface UserFeignClient {
/**
* 这里需要注意的两个地方
* <p>
* 1、在这里不支持GetMapping注解,如果用这个注解,不能启动
* <p>
* 2、@PathVariable需要设置value,如果不设置也不能成功启动
*
* @param id
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/simple/{id}")
public User findById(@PathVariable("id") Long id);
@Component
static class HystrixClientFallback implements UserFeignClient {
@Override
public User findById(Long id) {
System.out.println("----fallback----");
User user = new User();
user.setId(0L);
return user;
}
}
@Component
static class HystrixClientFallbackFactory implements FallbackFactory<UserFeignClient> {
static Logger logger = LoggerFactory.getLogger(HystrixClientFallback.class);
@Override
public UserFeignClient create(Throwable cause) {
logger.info("fallback reason was : ", cause.getMessage());
return new UserFeignWithFactory() {
@Override
public User findById(Long id) {
User user = new User();
user.setId(-1L);
return user;
}
};
}
}
}
| [
"mail.jeson0725@qq.com"
] | mail.jeson0725@qq.com |
6853d656a619a0665a6e4a42af4fedcb17bb2381 | b8726244e717387efdcf0842345d969c47a9aa3d | /src/main/java/com/sqrfactor/service/competition/EventFeedService.java | 58b3116221b26a092efab7bc35244c4d65c8b97a | [] | no_license | SqrFactor/portal-backend | a9d0ca1d31413289b0b35ec4c08c719aeea525db | 087624041b7f9da6eb6cc12c191a784194a06b9d | refs/heads/master | 2022-09-19T14:20:34.201507 | 2017-04-18T11:54:55 | 2017-04-18T11:54:55 | 53,121,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | /**
*
*/
package com.sqrfactor.service.competition;
import java.util.List;
import com.sqrfactor.model.competition.EventFeed;
/**
* @author Angad Gill
*
*/
public interface EventFeedService {
EventFeed findByEventFeedId(long eventFeedId);
List<EventFeed> findAllByEventTypeAndEventTypeId(String eventType, long eventTypeId);
void saveEventFeed(EventFeed eventFeed);
void updateEventFeed(EventFeed eventFeed);
void deleteEventFeedById(long eventFeedId);
}
| [
"angad.cec@gmail.com"
] | angad.cec@gmail.com |
d44358eb4cef31c4c7896756bcf41b6ec3beaeb2 | e76c78aa9208564b09bff5535610b470323ff876 | /OptimisY3/ServiceManifest/tags/ServiceManifest-1.0.2/service-manifest-api/src/main/java/eu/optimis/manifest/api/impl/ManifestImpl.java | f6183a3c6f2438e0cb1aeef500b2327ff4abb9a2 | [] | no_license | ldionmarcil/optimistoolkit | d9bb06e6e1e7262323cff553fc53b32d3b8bba8a | 5733efef99d523de19f6be4a819ddc6b9f755499 | refs/heads/master | 2021-01-21T21:22:20.528698 | 2013-06-07T21:52:35 | 2013-06-07T21:52:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,950 | java | /*
* Copyright (c) 2012, Fraunhofer-Gesellschaft
* 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 disclaimer at the end.
* 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.
*
* (2) Neither the name of Fraunhofer nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* DISCLAIMER
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package eu.optimis.manifest.api.impl;
import eu.optimis.manifest.api.utils.TemplateLoader;
import eu.optimis.manifest.api.utils.XmlValidator;
import eu.optimis.schemas.optimis.JaxBServiceManifest;
import eu.optimis.types.xmlbeans.servicemanifest.XmlBeanServiceManifestDocument;
import eu.optimis.types.xmlbeans.servicemanifest.XmlBeanVirtualMachineDescriptionType;
import eu.optimis.types.xmlbeans.servicemanifest.infrastructure.XmlBeanIncarnatedVirtualMachineComponentsType;
import eu.optimis.types.xmlbeans.servicemanifest.infrastructure.XmlBeanInfrastructureProviderExtensionType;
import eu.optimis.types.xmlbeans.servicemanifest.infrastructure.XmlBeanInfrastructureProviderExtensionsDocument;
import eu.optimis.types.xmlbeans.servicemanifest.service.XmlBeanServiceProviderExtensionType;
import eu.optimis.types.xmlbeans.servicemanifest.service.XmlBeanServiceProviderExtensionsDocument;
import org.apache.xmlbeans.XmlCursor;
import org.apache.xmlbeans.XmlObject;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
/**
* @author owaeld
*/
class ManifestImpl extends AbstractManifestElement<XmlBeanServiceManifestDocument>
implements eu.optimis.manifest.api.sp.Manifest, eu.optimis.manifest.api.ip.Manifest {
protected ManifestImpl(XmlBeanServiceManifestDocument base) {
super(base);
}
@Override
public String toString() {
if (!XmlValidator.validate(delegate)) {
throw new RuntimeException("Document to be exported is invalid!");
}
return getXmlObject().xmlText();
}
@Override
public XmlBeanServiceManifestDocument toXmlBeanObject() {
if (!XmlValidator.validate(delegate)) {
throw new RuntimeException("Document to be exported is invalid!");
}
return getXmlObject();
}
@Override
public JaxBServiceManifest toJaxB() {
try {
if (!XmlValidator.validate(delegate)) {
throw new RuntimeException("Document to be exported is invalid!");
}
JAXBContext jc = JAXBContext.newInstance(new Class[]{JaxBServiceManifest.class});
Unmarshaller u = jc.createUnmarshaller();
// deserialize byte array to jaxb
JaxBServiceManifest jaxbObject = (JaxBServiceManifest) u.unmarshal(this.delegate.getDomNode());
return jaxbObject;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public DataProtectionSectionImpl getDataProtectionSection() {
return new DataProtectionSectionImpl(delegate.getServiceManifest().getDataProtectionSection());
}
@Override
public ElasticityArraySectionImpl getElasticitySection() {
return new ElasticityArraySectionImpl(delegate.getServiceManifest().getElasticitySection());
}
@Override
public String getManifestId() {
return delegate.getServiceManifest().getManifestId();
}
@Override
public void setManifestId(String manifestId) {
delegate.getServiceManifest().setManifestId(manifestId);
}
@Override
public VirtualMachineDescriptionSectionImpl getVirtualMachineDescriptionSection() {
return new VirtualMachineDescriptionSectionImpl(
(XmlBeanVirtualMachineDescriptionType) delegate.getServiceManifest().getServiceDescriptionSection());
}
@Override
public String getServiceProviderId() {
return delegate.getServiceManifest().getServiceProviderId();
}
@Override
public void setServiceProviderId(String serviceProviderId) {
delegate.getServiceManifest().setServiceProviderId(serviceProviderId);
}
@Override
public TRECSectionImpl getTRECSection() {
return new TRECSectionImpl(delegate.getServiceManifest().getTRECSection());
}
@Override
public ServiceProviderExtensionImpl getServiceProviderExtensionSection() {
XmlBeanServiceProviderExtensionType ext = selectServiceProviderExtensionType();
if (ext != null) {
return new ServiceProviderExtensionImpl(ext);
} else {
return null;
}
}
@Override
public void initializeIncarnatedVirtualMachineComponents() {
//we will remove any incarnated components if they exist
if (this.getInfrastructureProviderExtensions().getIncarnatedVirtualMachineComponents() != null) {
unsetInfrastructureProviderExtensions();
}
XmlBeanIncarnatedVirtualMachineComponentsType componentsType = XmlBeanIncarnatedVirtualMachineComponentsType.Factory.newInstance();
TemplateLoader loader = new TemplateLoader();
for (VirtualMachineComponentImpl component : getVirtualMachineDescriptionSection().getVirtualMachineComponentArray()) {
componentsType.addNewIncarnatedVirtualMachineComponent().set(loader.loadIncarnatedVirtualMachineComponentType(component));
}
XmlBeanInfrastructureProviderExtensionType extensionDocument = selectInfrastructureProviderExtensionElement();
extensionDocument.addNewIncarnatedServiceComponents().set(componentsType);
}
@Override
public ManifestImpl extractComponent(String componentId) {
XmlBeanServiceManifestDocument newDoc = getXmlObject();
ManifestImpl manifest = new ManifestImpl(newDoc);
//remove the extension sections
manifest.unsetInfrastructureProviderExtensions();
manifest.unsetServiceProviderExtensions();
return manifest;
}
@Override
public InfrastructureProviderExtensionImpl getInfrastructureProviderExtensions() {
if (selectInfrastructureProviderExtensionElement() != null) {
XmlBeanInfrastructureProviderExtensionType ext = selectInfrastructureProviderExtensionElement();
return new InfrastructureProviderExtensionImpl(ext);
} else {
return null;
}
}
private void unsetInfrastructureProviderExtensions() {
if (selectInfrastructureProviderExtensionElement() != null) {
XmlCursor editCursor = selectInfrastructureProviderExtensionElement().newCursor();
editCursor.removeXml();
}
}
private XmlBeanInfrastructureProviderExtensionType selectInfrastructureProviderExtensionElement() {
XmlObject[] result = delegate.getServiceManifest().selectChildren(XmlBeanInfrastructureProviderExtensionsDocument.type.getDocumentElementName());
if (result.length > 0) {
return (XmlBeanInfrastructureProviderExtensionType) result[0];
}
return null;
}
private XmlBeanServiceProviderExtensionType selectServiceProviderExtensionType() {
XmlObject[] elements = delegate.getServiceManifest().selectChildren(XmlBeanServiceProviderExtensionsDocument.type.getDocumentElementName());
if (elements.length > 0) {
XmlBeanServiceProviderExtensionType ext = (XmlBeanServiceProviderExtensionType) elements[0];
return ext;
} else {
return null;
}
}
private void unsetServiceProviderExtensions() {
if (selectServiceProviderExtensionType() != null) {
XmlCursor editCursor = selectServiceProviderExtensionType().newCursor();
editCursor.removeXml();
}
}
}
| [
"A136603@ES-CNU2040FVS.es.int.atosorigin.com"
] | A136603@ES-CNU2040FVS.es.int.atosorigin.com |
7bca5aee7b0898db034c6c29441846056c957e94 | 6fc4e6c13a861bd2b0f89f853795f83371934914 | /src/br/com/todo/controller/EstadoCtr.java | 0a89c53243dd96349100037bae2ef04424a8b9b2 | [] | no_license | caiopiassali/To-Do-JSP | 94a0e835e37fdb0eba1a48393460a0a6e041a82d | 958ea67eb1f1f380d5456ef6a9ab5b55ff2c5a18 | refs/heads/master | 2020-04-12T04:03:44.229872 | 2019-01-16T18:24:14 | 2019-01-16T18:24:14 | 162,283,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,401 | java | package br.com.todo.controller;
import br.com.todo.dao.EstadoDAO;
import br.com.todo.model.Estado;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet(name = "EstadoCtr", urlPatterns = {"/EstadoCtr"})
public class EstadoCtr extends HttpServlet {
protected void proccessRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
try {
String action = request.getParameter("action");
switch (action) {
case "createAjaxStatus":
try {
String titulo = request.getParameter("titulo");
Estado estado = new Estado(null, titulo);
EstadoDAO dao = new EstadoDAO();
if (dao.save(estado)) {
response.setContentType("text/plain"); // Set content type of the response so that jQuery knows what it can expect.
response.setCharacterEncoding("UTF-8"); // You want world domination, huh?
Estado created = (new EstadoDAO()).lastCreated();
response.getWriter().write(
"{\"codigo\":\""+created.getCodigo()+"\",\"titulo\":\""+created.getTitulo()+"\"}"
);
} else {
response.setContentType("text/plain"); // Set content type of the response so that jQuery knows what it can expect.
response.setCharacterEncoding("UTF-8"); // You want world domination, huh?
response.getWriter().write("false");
}
} catch (Exception ex) {
System.out.println("Erro: " + ex.getMessage());
}
break;
case "saveStatus":
try {
Integer codigo = Integer.parseInt(request.getParameter("codigo") != null ? request.getParameter("codigo") : "0");
String titulo = request.getParameter("titulo");
String desc = request.getParameter("desc");
Estado estado = new Estado();
estado.setCodigo(codigo != 0 ? codigo : null);
estado.setTitulo(titulo);
EstadoDAO dao = new EstadoDAO();
if (dao.save(estado)) {
request.getRequestDispatcher("/EstadoCtr?action=listStatus").forward(request, response);
} else {
request.getRequestDispatcher("/EstadoCtr?action=listStatus").forward(request, response);
}
} catch (Exception ex) {
System.out.println("Erro: " + ex.getMessage());
}
break;
case "deleteStatus":
try {
Integer dcodigo = Integer.parseInt(request.getParameter("dcodigo"));
EstadoDAO dao = new EstadoDAO();
if (dao.delete(dcodigo)) {
request.getRequestDispatcher("/EstadoCtr?action=listStatus").forward(request, response);
} else {
throw new Exception();
//request.getRequestDispatcher("/EstadoCtr?action=listStatus").forward(request, response);
}
} catch (Exception ex) {
request.setAttribute("erro", "Erro: Este estado está relacionado com uma tarefa. Edite seu estado ou exclua a tarefa antes de excluir o estado!");
request.getRequestDispatcher("/EstadoCtr?action=listStatus").forward(request, response);
System.out.println("Erro: " + ex.getMessage());
}
break;
case "listStatus":
try {
EstadoDAO dao = new EstadoDAO();
request.setAttribute("estados", dao.select(0, false));
request.getRequestDispatcher("/dashboard/estado.jsp").forward(request, response);
} catch (Exception ex) {
System.out.println("Erro: " + ex.getMessage());
}
break;
default:
break;
}
} catch (Exception ex) {
System.out.println("Erro: " + ex.getMessage());
}
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
proccessRequest(request, response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
proccessRequest(request, response);
}
}
| [
"caiopiassali@hotmail.com"
] | caiopiassali@hotmail.com |
701c2a6404d387322eb2d725abb56b1472f871e6 | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /android_webview/test/shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java | c57cd84fb4a7341a8155a3e3e2ab7bf54d3013f0 | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | Java | false | false | 5,057 | java | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.android_webview.test;
import android.support.annotation.CallSuper;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.chromium.android_webview.AwSwitches;
import org.chromium.android_webview.test.OnlyRunIn.ProcessMode;
import org.chromium.base.CommandLine;
import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.base.test.BaseTestResult.PreTestHook;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.policy.test.annotations.Policies;
import java.util.ArrayList;
import java.util.List;
/**
* A custom runner for //android_webview instrumentation tests. Because WebView runs in
* single-process mode on L-N and multi-process (AKA sandboxed renderer) mode on O+, this test
* runner defaults to duplicating each test in both modes.
*
* <p>
* Tests can instead be run in either single or multi-process only with {@link OnlyRunIn}. This can
* be done if the test case needs this for correctness or to save infrastructure resources for tests
* which exercise code which cannot depend on single vs. multi process.
*/
public final class AwJUnit4ClassRunner extends BaseJUnit4ClassRunner {
/**
* Create an AwJUnit4ClassRunner to run {@code klass} and initialize values
*
* @param klass Test class to run
* @throws InitializationError if the test class is malformed
*/
public AwJUnit4ClassRunner(Class<?> klass) throws InitializationError {
super(klass);
}
@CallSuper
@Override
protected List<PreTestHook> getPreTestHooks() {
return addToList(super.getPreTestHooks(), Policies.getRegistrationHook());
}
private ProcessMode processModeForMethod(FrameworkMethod method) {
// Prefer per-method annotations.
//
// Note: a per-class annotation might disagree with this. This can be confusing, but there's
// no good option for us to forbid this (users won't see any exceptions we throw), and so we
// instead enforce a priority.
OnlyRunIn methodAnnotation = method.getAnnotation(OnlyRunIn.class);
if (methodAnnotation != null) {
return methodAnnotation.value();
}
// Per-class annotations have second priority.
OnlyRunIn classAnnotation = method.getDeclaringClass().getAnnotation(OnlyRunIn.class);
if (classAnnotation != null) {
return classAnnotation.value();
}
// Default: run in both modes.
return ProcessMode.SINGLE_AND_MULTI_PROCESS;
}
@Override
protected List<FrameworkMethod> getChildren() {
List<FrameworkMethod> result = new ArrayList<>();
for (FrameworkMethod method : computeTestMethods()) {
switch (processModeForMethod(method)) {
case SINGLE_PROCESS:
result.add(method);
break;
case MULTI_PROCESS:
result.add(new WebViewMultiProcessFrameworkMethod(method));
break;
case SINGLE_AND_MULTI_PROCESS:
default:
result.add(new WebViewMultiProcessFrameworkMethod(method));
result.add(method);
break;
}
}
return result;
}
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
CommandLineFlags.setUp(method.getMethod());
if (method instanceof WebViewMultiProcessFrameworkMethod) {
CommandLine.getInstance().appendSwitch(AwSwitches.WEBVIEW_SANDBOXED_RENDERER);
}
super.runChild(method, notifier);
}
/**
* Custom FrameworkMethod class indicate this test method will run in multiprocess mode.
*
* The clas also add "__multiprocess_mode" postfix to the test name.
*/
private static class WebViewMultiProcessFrameworkMethod extends FrameworkMethod {
public WebViewMultiProcessFrameworkMethod(FrameworkMethod method) {
super(method.getMethod());
}
@Override
public String getName() {
return super.getName() + "__multiprocess_mode";
}
@Override
public boolean equals(Object obj) {
if (obj instanceof WebViewMultiProcessFrameworkMethod) {
WebViewMultiProcessFrameworkMethod method =
(WebViewMultiProcessFrameworkMethod) obj;
return super.equals(obj) && method.getName().equals(getName());
}
return false;
}
@Override
public int hashCode() {
int result = 17;
result = 31 * result + super.hashCode();
result = 31 * result + getName().hashCode();
return result;
}
}
}
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
0da8fa6bb1363c5d71ace956c0d8cf2b7b5a065a | cfa7d9ef4015cbab56388835842d8e27ba9aeb45 | /modules/com/ail/core.jar/com/ail/core/product/liferay/LiferayUpdateProductService.java | fe690e611c2074588f5aa0925c4ad97e7745b64e | [] | no_license | sangnguyensoftware/openunderwriter | 678ff8cfe83f781a03b9cd62313e3d6594e74556 | 380cfa83e135084d29cd0b29d1ed4780cdb62408 | refs/heads/master | 2020-03-21T09:24:40.328042 | 2018-06-26T00:13:27 | 2018-06-26T00:13:27 | 138,398,507 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,602 | java | /* Copyright Applied Industrial Logic Limited 2016. All rights Reserved */
/*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.ail.core.product.liferay;
import com.ail.annotation.ServiceImplementation;
import com.ail.core.PostconditionException;
import com.ail.core.PreconditionException;
import com.ail.core.Service;
import com.ail.core.product.UnknownProductException;
import com.ail.core.product.UpdateProductService.UpdateProductArgument;
@ServiceImplementation
public class LiferayUpdateProductService extends Service<UpdateProductArgument> {
@Override
public void invoke() throws PreconditionException, PostconditionException, UnknownProductException {
// Do nothing. In Liferay, the list of products is dynamically defined based on the existence of
// files called "Registry.xml" in the product content store. Products are updated simply by
// modifying such a file.
}
} | [
"40519615+sangnguyensoftware@users.noreply.github.com"
] | 40519615+sangnguyensoftware@users.noreply.github.com |
b0d8e70e5c8f00170c5032064e79abc7f4473586 | b8a6a75753c770171ca88b125a7dc729723b9849 | /gysolr-product-provider/src/main/java/com/glorypty/gysolr/common/solr/SolrQueryUtil.java | 0d054f60754a85d5cd57e94342365f7c90d06179 | [] | no_license | javaBBQ/solr-master | 43e568d9802bfa81cc4a4e78424964a67474a614 | a03730d37fd9665a389476fbe235b7128184f32a | refs/heads/master | 2021-06-09T04:56:19.532341 | 2016-11-01T14:07:42 | 2016-11-01T14:07:42 | 72,511,189 | 4 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,637 | java | /*
*Project: gysolr-product-provider
*File: com.glorypty.gysolr.common.solr.SolrQueryUtil.java <2016年5月18日>
****************************************************************
* 版权所有@2016 国裕网络科技 保留所有权利.
***************************************************************/
package com.glorypty.gysolr.common.solr;
import org.apache.solr.client.solrj.SolrQuery;
/**
*
* @author liujie
* @Date 2016年5月18日 下午5:28:50
* @version 1.0
*/
public class SolrQueryUtil {
public static void setStringQuery(SolrQuery query,String key,String value){
if(value != null){
value = value.trim();
if(!"".equals(value)){
query.setQuery(key + ":" + value);
}
}
}
public static void setNumberQuery(SolrQuery query,String key,Number value){
if(value != null && value.longValue() > 0){
query.setQuery(key + ":" + value);
}
}
public static void setQueryPage(SolrQuery query, Integer page, Integer pageSize) {
if(page == null || page <= 0){
page = 1;
}
if(pageSize == null || pageSize <= 0){
pageSize = 10;
}
Integer start = (page -1 ) * pageSize;
query.setStart(start);
query.setRows(pageSize);
}
public static void setDoubleRangQuery(SolrQuery query,String key,Double start, Double end){
if(start != null){
if(end != null){
if(start > end){
query.setQuery(key + ":[" + 1 + " TO " + 0 + "]" );
}else{
query.setQuery(key + ":[" + start + " TO " + end + "]" );
}
}else{
query.setQuery(key + ":[" + start + " TO *]" );
}
}else{
if(end != null){
query.setQuery(key + ":[* TO " + end + "]" );
}
}
}
}
| [
"492588390@qq.com"
] | 492588390@qq.com |
b27b42b391fdcb039901c9b4accf3de05a886a72 | d44a252911fb1e1d2b83f7175a4ad273fb4acb08 | /graphql-dxm-provider/src/test/java/org/jahia/modules/graphql/osgi/stub/service/StubService.java | 38ea75ac7be054dc86f86177a02844ec19ea2443 | [
"Apache-2.0"
] | permissive | evertonteotonio/graphql-core | 7db9595d5be24ea764437eadf287b6a9b6ac4ab2 | 81b847ef46c4552f0a26b23d1dfbe47a63daac39 | refs/heads/master | 2023-05-28T09:00:22.964285 | 2021-06-01T16:55:52 | 2021-06-01T16:55:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | package org.jahia.modules.graphql.osgi.stub.service;
import org.mockito.invocation.InvocationOnMock;
/**
* Stub OSGI Service used to store the invocation call on BundleUtils.getOsgiService
* To be able to test and check that the invocation of BundleUtils.getOsgiService have been done using good parameters for service lookup.
*/
public class StubService {
private final InvocationOnMock invocationOnMock;
public StubService(InvocationOnMock invocationOnMock) {
this.invocationOnMock = invocationOnMock;
}
public InvocationOnMock getInvocationOnMock() {
return invocationOnMock;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
de3cdcce88f31d052b3f8b1295a4ad41760c3d06 | 289dc952f51e8b8e775840148690e3a2934e38ca | /app/src/main/java/com/example/app_book/adapter/ProductAdapter.java | 8becc8a43c73cf764532fba170effcae2fc24bf1 | [] | no_license | NguyenMinhDucIT/BookApps | 5d3ea75b40cb2a7bff99e08497dcf969e47145be | 7a224392a2cd5c5db03b0086f602404e37e72e47 | refs/heads/master | 2023-03-13T12:41:44.073577 | 2021-04-03T07:42:55 | 2021-04-03T07:42:55 | 350,964,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,728 | java | package com.example.app_book.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.app_book.R;
import com.example.app_book.activity.ProductDetail;
import com.example.app_book.interfaces.ItemClickListener;
import com.example.app_book.model.Product;
import com.squareup.picasso.Picasso;
import java.text.DecimalFormat;
import java.util.List;
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.ViewHolder>{
public Context context;
private int layout;
private List<Product> listProduct;
public ProductAdapter(Context context, int layout, List<Product> listProduct) {
this.context = context;
this.layout = layout;
this.listProduct = listProduct;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(context).inflate(layout, null);
ViewHolder viewHolder = new ViewHolder(view);
return viewHolder;
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Product p = listProduct.get(position);
Picasso.get().load(p.getAvatar())
.into(holder.imgProductAvatar);
holder.txtvProductName.setText(p.getName());
DecimalFormat decimalFormat = new DecimalFormat("###,###,###");
holder.txtvProductPrice.setText("Giá: "+decimalFormat.format(p.getPrice())+" Đ");
holder.setItemClickListener(new ItemClickListener() {
@Override
public void onClick(View view, int position, boolean isLongClick) {
if(isLongClick){
Toast.makeText(context, "Long click" + p, Toast.LENGTH_SHORT).show();
}else{
Intent intent = new Intent(context, ProductDetail.class);
//https://stackoverflow.com/questions/3918517/calling-startactivity-from-outside-of-an-activity-context
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("product", listProduct.get(position));
context.startActivity(intent);
}
}
});
}
@Override
public int getItemCount() {
return listProduct.size();
}
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener,View.OnLongClickListener{
ImageView imgProductAvatar;
TextView txtvProductName, txtvProductPrice;
private ItemClickListener itemClickListener;
public ViewHolder(@NonNull View itemView) {
super(itemView);
imgProductAvatar = itemView.findViewById(R.id.imgProductAvatar);
txtvProductName = itemView.findViewById(R.id.txtvProductName);
txtvProductPrice = itemView.findViewById(R.id.txtvProductPrice);
itemView.setOnClickListener(this);
itemView.setOnLongClickListener(this);
}
public void setItemClickListener(ItemClickListener itemClickListener)
{
this.itemClickListener = itemClickListener;
}
@Override
public void onClick(View v) {
itemClickListener.onClick(v, getAdapterPosition(), false);
}
@Override
public boolean onLongClick(View v) {
itemClickListener.onClick(v,getAdapterPosition(),true);
return true;
}
}
}
| [
"ducc.minh.ngn@gmail.com"
] | ducc.minh.ngn@gmail.com |
48c4ace6cda93cc6525bde5de95d860f5e153570 | f03226b0309be2f2253cbf9130fab80b75d72ef4 | /src/com/justtennis/domain/comparator/InviteComparatorByPoint.java | c3f16b749b1f9e42813748fb91a3c5d655554294 | [] | no_license | temmp/com-justtennis | e6b98549ef3a5aaf0d5624bd6e9ffbf5c9276036 | fc74dbe3008d304da45388f53e4c995e559aec11 | refs/heads/master | 2020-06-01T01:39:19.507113 | 2014-11-04T22:03:26 | 2014-11-04T22:03:26 | 35,202,531 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.justtennis.domain.comparator;
import java.util.Comparator;
import com.justtennis.domain.Invite;
public class InviteComparatorByPoint implements Comparator<Invite> {
private boolean inverse;
public InviteComparatorByPoint(boolean inverse) {
this.inverse = inverse;
}
@Override
public int compare(Invite lhs, Invite rhs) {
int order = (lhs.getPoint() > rhs.getPoint() ? 1 : -1);
if (inverse) {
order = -order;
}
return order;
}
}
| [
"roca.david@gmail.com@dac058d7-4120-8cb2-69ef-2c1dc36baf9d"
] | roca.david@gmail.com@dac058d7-4120-8cb2-69ef-2c1dc36baf9d |
10429c7cbf36e30b1ea461f6d21d140749a84556 | 8fbba9b3b128c120272e3995adc5cc4409f40043 | /src/main/java/edu/learning/java/training/RegexJava.java | 659569c7763feb9a1d83c96c62d72c4482e9d2bc | [] | no_license | meking86/Learning | e3a386b53885276a6882c60d93b1d0e515ce704f | a78b98fe8beecc947e5ea57fe2e81ef58eeca075 | refs/heads/master | 2021-05-15T04:54:35.749252 | 2018-01-24T18:19:35 | 2018-01-24T18:19:35 | 118,360,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,181 | java | package edu.learning.java.training;
import java.util.Scanner;
import edu.learning.java.exception.InvalidException;
public class RegexJava {
public static void main(String[] args) {
RegexJava obj = new RegexJava();
Scanner sn = new Scanner(System.in);
boolean bool = obj.validatPhone(sn.nextLine());
System.out.println(" bool " + bool);
}
public boolean validatPhone(String nextLine) {
System.out.println("nextLine.length() " + nextLine.length());
if(nextLine.length()<10){
throw new InvalidException("Please number of including area code : in total 10");
}
//validate phone numbers of format "1234567890"
if(nextLine.matches("\\d{10}"))
return true;
//=validating phone number with -, . or spaces
else if(nextLine.matches("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4}"))
return true;
//validating phone number with extension length from 3 to 5
else if(nextLine.matches("\\d{3}-\\d{3}-\\d{4}\\s(x|(ext))\\d{3,5}"))
return true;
//validating phone number where area code is in braces ()
else if(nextLine.matches("\\(\\d{3}\\)-\\d{3}-\\d{4}")||nextLine.matches("\\(\\d{3}\\)\\d{3}\\d{4}"))
return true;
return false;
}
}
| [
"keswaramoorthy@apple.com"
] | keswaramoorthy@apple.com |
3ffc02d19224a18424a3a71fd7d0638777e5a166 | 33dd7ec35a0c5762631f85a5c87bcc40adcd3a54 | /framework-parent/framework-common/framework-base/src/main/java/com/lego/framework/base/controller/NotFountController.java | a642d943c336e898d3d94f1f9828a8b06efec753 | [] | no_license | gaoleigreat/bigdata-perception | 4736c5fd5b28ef1788a3f507a5f23c6d8e7176c6 | c183d95230f59f18a3e63d1c926cfdaae8d9126c | refs/heads/master | 2022-12-11T16:21:34.946023 | 2019-11-06T06:15:38 | 2019-11-06T06:15:38 | 217,037,877 | 0 | 1 | null | 2022-12-06T00:44:09 | 2019-10-23T11:12:51 | Python | UTF-8 | Java | false | false | 450 | java | package com.lego.framework.base.controller;
/**
* @author yanglf
* @description
* @since 2019/1/16
**/
/*@Controller
public class NotFountController implements ErrorController {
@Override
public String getErrorPath() {
return "/error";
}
@RequestMapping(value = {"/error"})
@ResponseBody
public RespVO error() {
return RespVOBuilder.failure(RespConsts.ERROR_OTHER_CODE,"resource not found");
}
}*/
| [
"文字899117"
] | 文字899117 |
825cff4822d457d16f3f91c8aa54570db28732fa | a7057b4d182591cf42216be1486790c973b06b59 | /order/server/src/main/java/com/example/order/server/dataobject/OrderMaster.java | b6da93dd5de880f50785708ea71b619d4683f206 | [] | no_license | Anemone95/springcloud_study | c6e9529d5c1168b312d75c7bbbe1ee6d46e4fc14 | cb06488d1d8a51c16c9b258ac365560642d44dfb | refs/heads/master | 2020-05-31T21:41:23.842658 | 2019-06-15T12:18:39 | 2019-06-15T12:18:39 | 190,503,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package com.example.order.server.dataobject;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Entity
public class OrderMaster {
@Id
private String orderId;
private String buyerName;
private String buyerPhone;
private String buyerAdderss;
private String buyerOpenid;
private BigDecimal orderAmount;
private Integer orderStatus;
private Integer payStatus;
private Date createTime;
private Date updateTime;
}
| [
"x565178035@126.com"
] | x565178035@126.com |
f4d99a3d7a4ab9ccf312a941e45ec4c61243225b | 3483b62eb9ab0d5541174754adb927e129a720b7 | /app/src/test/java/com/zao/zou/ExampleUnitTest.java | 76dc14c9839c613962272771c05c688c7d4774dd | [] | no_license | cereuz/Zou | f0f28e0131aad9de81aaf3d402a460ae7d19c556 | 2cc2abf858a812cf23d5d6a17ac8449818ea5e15 | refs/heads/master | 2020-05-01T15:51:22.240859 | 2019-05-07T02:14:28 | 2019-05-07T02:14:28 | 177,556,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package com.zao.zou;
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);
}
} | [
"sunedo@163.com"
] | sunedo@163.com |
84aa5690e046a877b2ac1af2f3d53550739a8b50 | 9366c60587ee93199a8503b6c3507731bae099e7 | /EZFM/src/main/java/com/shareworx/ezfm/worktask/areadetails/dao/YJWYWorkTaskAreaDetailsDao.java | 0ce2550a6e3b2d388f95d09bb452fe71c948aea2 | [
"Apache-2.0"
] | permissive | xiaotian1210/frist-xiaotian | 9a02077a641b86470a3f53d507460d4f007170f4 | 58468408192c872e24341a73bc69b624439d6918 | refs/heads/master | 2020-03-20T07:55:43.081863 | 2018-06-14T05:54:01 | 2018-06-14T05:54:01 | 137,294,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,881 | java | package com.shareworx.ezfm.worktask.areadetails.dao;
import java.io.Serializable;
import java.util.List;
import com.shareworx.ezfm.worktask.areadetails.model.YJWYWorkTaskAreaDetailsModel;
import com.shareworx.platform.exception.ShareworxServiceException;
import com.shareworx.platform.metadata.MetaField;
import com.shareworx.platform.persist.Delete;
import com.shareworx.platform.persist.Query;
import com.shareworx.platform.persist.Update;
/**
* 片区详情持久化操作接口
*
* @author zhangjing.cheng
* @version since Shareworx platform 2.0
*
*/
public interface YJWYWorkTaskAreaDetailsDao {
String ID = "yJWYWorkTaskAreaDetailsDao";
/**
* 保存片区详情
* @param models
* @return
* @throws ShareworxServiceException
*/
int[] saveModels(YJWYWorkTaskAreaDetailsModel[] models) throws ShareworxServiceException;
/**
* 修改片区详情
* @param models
* @return
* @throws ShareworxServiceException
*/
int[] updateModels(YJWYWorkTaskAreaDetailsModel[] models) throws ShareworxServiceException;
/**
* 修改片区详情
* @param models
* @param include {@link MetaField#getId()} 如果为空时默认全部有效,非空时根据 notIclude 判断是否有效
* @param notIclude {@link MetaField#getId()} 优先级高,当存在时不被修改
* @return
* @throws ShareworxServiceException
*/
int[] updateModels(YJWYWorkTaskAreaDetailsModel[] models, String[] include, String[] notIclude) throws ShareworxServiceException;
/**
* 根据条件修改片区详情
* @param update
* @return
* @throws ShareworxServiceException
*/
int updateModelsByCondition(Update update) throws ShareworxServiceException;
/**
* 删除片区详情
* @param models
* @return
* @throws ShareworxServiceException
*/
int deleteModels(YJWYWorkTaskAreaDetailsModel[] models) throws ShareworxServiceException;
/**
* 根据条件删除片区详情
* @param delete
* @return
* @throws ShareworxServiceException
*/
int deleteByCondition(Delete delete) throws ShareworxServiceException;
/**
* 根据主键查询片区详情
* @param id
* @return
* @throws ShareworxServiceException
*/
YJWYWorkTaskAreaDetailsModel queryById(Serializable id) throws ShareworxServiceException;
/**
* 根据条件查询片区详情
* @param query
* @return
* @throws ShareworxServiceException
*/
List<YJWYWorkTaskAreaDetailsModel> queryListByCondition(Query query) throws ShareworxServiceException;
/**
* 查询片区详情条数
* @param query
* @return
* @throws ShareworxServiceException
*/
Long countListByCondition(Query query) throws ShareworxServiceException;
/**
* 根据条件查询片区详情
* @param query
* @return
* @throws ShareworxServiceException
*/
YJWYWorkTaskAreaDetailsModel queryOneByCondition(Query query) throws ShareworxServiceException;
}
| [
"2248210338@qq.com"
] | 2248210338@qq.com |
d69ec33dcea809cb2ce4e74e719d4ed69e73ede8 | 7398714c498444374047497fe2e9c9ad51239034 | /java/util/stream/-$$Lambda$zQ-9PoG-PFOA3MjNNbaERnRB6ik.java | 360c8a1853d7702f33157b8c406860a0f14af32c | [] | no_license | CheatBoss/InnerCore-horizon-sources | b3609694df499ccac5f133d64be03962f9f767ef | 84b72431e7cb702b7d929c61c340a8db07d6ece1 | refs/heads/main | 2023-04-07T07:30:19.725432 | 2021-04-10T01:23:04 | 2021-04-10T01:23:04 | 356,437,521 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package java.util.stream;
import java.util.function.*;
public final class -$$Lambda$zQ-9PoG-PFOA3MjNNbaERnRB6ik implements LongConsumer
{
@Override
public final void accept(final long n) {
this.f$0.accept(n);
}
@Override
public LongConsumer andThen(final LongConsumer longConsumer) {
return LongConsumer-CC.$default$andThen(this, longConsumer);
}
}
| [
"cheat.boss1@gmail.com"
] | cheat.boss1@gmail.com |
67152ad574e25aff8c59e620c2dc68a52a65c7b8 | b39ea832de527135f85825f1621913ea4e205052 | /springboot/src/main/java/com/akash/project/Application.java | e5fe7dea1a34cd7d58ffafb8e4ad2c32c212b302 | [] | no_license | akash7227/spring-boot | b62975a6a4a6a64bc2bef20f09497aea06b0bd3c | f5fa9c747d3ba6d920fc93089e0a05f1c4c8dfaf | refs/heads/master | 2021-08-11T00:13:14.097994 | 2017-11-13T03:21:08 | 2017-11-13T03:21:08 | 110,493,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 577 | java | package com.akash.project;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@SpringBootApplication
public class Application {
@RequestMapping(value = "/")
public String start() {
System.out.println("in side start");
return "index";
}
public static void main(String[] args) {
// TODO Auto-generated method stub
SpringApplication.run(Application.class, args);
}
}
| [
"akashkumarsingh57@gmail.com"
] | akashkumarsingh57@gmail.com |
c565ba3d7deda2bf2d0be71e11cc96da058a4a5c | 1aa245307d74ec544cce53e062470b8f00f48074 | /GestionPresenceA/src/java/action/ServletActionCours.java | b76d4ca896070061ed96274e06dd84cb5cad8e95 | [] | no_license | aliligator/GestionPresence | 1e3c46c5bb99c581d3091da362a1ffd5420f52c1 | 28f83505a85fc0c8a49c5cc87881bbea0bbd0f98 | refs/heads/master | 2022-11-20T12:31:23.595453 | 2020-07-22T15:07:25 | 2020-07-22T15:07:25 | 279,850,632 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,535 | 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 action;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author Arsla
*/
public class ServletActionCours extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@SuppressWarnings("empty-statement")
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, ClassNotFoundException, SQLException {
response.setCharacterEncoding("UTF-8");
String nomC=request.getParameter("nomC");
String formation=request.getParameter("formation");
String action=request.getParameter("action");
if("ajouter".equals(action)){
System.out.println(action);
bd.bd.ajouterMatiere(nomC,formation);
};
if("supprimer".equals(action)){
bd.bd.supprimerMatiere(nomC);
};
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(request, response);
} catch (ClassNotFoundException ex) {
Logger.getLogger(ServletActionCours.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(ServletActionCours.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(request, response);
} catch (ClassNotFoundException ex) {
Logger.getLogger(ServletActionCours.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(ServletActionCours.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"akhi1311@hotmail.com"
] | akhi1311@hotmail.com |
3c9dc1e56aff80261f1f03a8550419e4a1bcabc5 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.systemux-SystemUX/sources/com/oculus/tablet/utils/ViewBindingUtil.java | ac61122f1295c2322d52ce3f59a66d0fb8aa0fb1 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 1,813 | java | package com.oculus.tablet.utils;
import android.view.View;
import java.util.function.Predicate;
public final class ViewBindingUtil {
public static final Predicate<Integer> NEGATIVE = $$Lambda$ViewBindingUtil$6NHgdfDecs87CNv5P0rNgjlb5Y.INSTANCE;
public static final Predicate<Integer> NON_NEGATIVE = NEGATIVE.negate();
public static final Predicate<String> NOT_NULL_OR_EMPTY = NULL_OR_EMPTY.negate();
public static final Predicate<String> NULL_OR_EMPTY = $$Lambda$ViewBindingUtil$xDUL6eLoCVQQBisNQvjGHsjIVw.INSTANCE;
static /* synthetic */ boolean lambda$static$8(String str) {
return str == null || "".equals(str);
}
static /* synthetic */ boolean lambda$static$9(Integer num) {
return num == null || num.intValue() < 0;
}
public static void toggleViewInvisible(View view, boolean z) {
setViewVisibility(view, 4, z);
}
public static void toggleViewGone(View view, boolean z) {
setViewVisibility(view, 8, z);
}
private static void setViewVisibility(View view, int i, boolean z) {
if (z) {
i = 0;
}
if (i != view.getVisibility()) {
view.setVisibility(i);
}
}
@SafeVarargs
public static <T> boolean all(Predicate<T> predicate, T... tArr) {
for (T t : tArr) {
if (!predicate.test(t)) {
return false;
}
}
return true;
}
@SafeVarargs
public static <T> boolean any(Predicate<T> predicate, T... tArr) {
for (T t : tArr) {
if (predicate.test(t)) {
return true;
}
}
return false;
}
@SafeVarargs
public static <T> boolean none(Predicate<T> predicate, T... tArr) {
return !any(predicate, tArr);
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
c0530b5e7ad30b0934dfe1c1a3976fa4dd987836 | 265a3fcf1bac313226ebe37015f172de980965ec | /app/src/androidTest/java/com/example/ja010/silsemp330/ExampleInstrumentedTest.java | 06eb0d4aed2d7aea456bbed39a87e68d3e2641b1 | [] | no_license | ja01001/test3.30 | 67a5a1dd83366fe22c3701aa7fa28369dcc2fadb | 211f45781d4dcb954603f2c9a83513c9c0ea5cfb | refs/heads/master | 2021-01-18T15:38:47.985242 | 2017-03-30T06:23:39 | 2017-03-30T06:23:39 | 86,666,610 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.example.ja010.silsemp330;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.ja010.silsemp330", appContext.getPackageName());
}
}
| [
"ja01001@naver.com"
] | ja01001@naver.com |
b0d538558cbacce7d90ae7c418a2098a85d9bf70 | ebb06a9fe6e9762f5046be42b2d602b239b29b9a | /src/cofh/api/transport/IEnderAttuned.java | aef7286474cd46dcee0337c9d099882ad36f654b | [] | no_license | ShadowWolf666/Technomancy-Origin | 6bc7fb55300b1dde030786a3865f92d67f646b60 | 61bff75534f4e9b99f481f3c881280e38a4a3e24 | refs/heads/master | 2020-12-31T07:11:52.960098 | 2014-06-07T18:38:42 | 2014-06-07T18:38:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,066 | java | package cofh.api.transport;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public interface IEnderAttuned {
public enum EnderTypes {
ITEM, FLUID, REDSTONE_FLUX
}
String getOwnerString();
int getFrequency();
public boolean setFrequency(int frequency);
public boolean clearFrequency();
boolean canSendItems();
boolean canSendFluid();
boolean canSendEnergy();
boolean canReceiveItems();
boolean canReceiveFluid();
boolean canReceiveEnergy();
boolean currentlyValidToReceiveItems(IEnderAttuned asker);
boolean currentlyValidToReceiveFluid(IEnderAttuned asker);
boolean currentlyValidToReceiveEnergy(IEnderAttuned asker);
boolean currentlyValidToSendItems(IEnderAttuned asker);
boolean currentlyValidToSendFluid(IEnderAttuned asker);
boolean currentlyValidToSendEnergy(IEnderAttuned asker);
ItemStack receiveItem(ItemStack item);
FluidStack receiveFluid(FluidStack fluid, boolean doFill);
int receiveEnergy(int energy, boolean simulate);
}
| [
"brettviegert@yahoo.com"
] | brettviegert@yahoo.com |
aeee6ce9961090346b2eb45d183807e55cca6709 | 3109640c4dfb571737c3189a4bbee8fe9f12ee6a | /src/main/java/org/say/valuation/bean/init/InitBean.java | 7ecf2de4bb2540197c04e44090baac8033eaac21 | [] | no_license | 120011676/valuation | 6e09e1ae20dc35cb8da21c6bd19362d11bd12bfc | e2f54c36b472de06423a2766f2ce37ededd36531 | refs/heads/master | 2020-07-10T14:57:28.187671 | 2016-12-30T10:00:37 | 2016-12-30T10:00:37 | 74,013,023 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,160 | java | package org.say.valuation.bean.init;
import org.apache.shiro.authc.credential.DefaultPasswordService;
import org.say.valuation.entity.User;
import org.say.valuation.service.UserService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Date;
/**
* Created by say on 16/12/2016.
*/
@Configuration
public class InitBean {
@Bean
public CommandLineRunner init(UserService userService) {
return new CommandLineRunner() {
public void run(String... args) throws Exception {
long c = userService.count();
if (c == 0) {
User user = new User();
user.setId(1);
user.setName("admin");
user.setUsername("admin");
user.setPassword(new DefaultPasswordService().encryptPassword("admin"));
user.setStatus(true);
user.setCreateDate(new Date());
userService.save(user);
}
}
};
}
}
| [
"120011676@qq.com"
] | 120011676@qq.com |
c96eb916718b8b3fc1fe713fa4474e97f4ee53f6 | 8725b16191289d6208a6cd70840d7cc8eda9e0b2 | /src/main/java/edu/eci/arsw/blindway/BlindWay.java | 4021d6b630f607ae8a055231c2b3cf5b153c367a | [] | no_license | ProyectoBLINDWAYARSW/BlindWay | cf67491666e2046aadef6708bdc8636b49b2fc43 | 8701f0d3a8214bf269cfa5303f60da560b7c03eb | refs/heads/master | 2021-01-11T03:02:41.128998 | 2016-12-13T22:15:30 | 2016-12-13T22:15:30 | 70,862,700 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | 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 edu.eci.arsw.blindway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
*
* @author Hugo Alvarez
*/
@SpringBootApplication
public class BlindWay {
public static void main(String[] args) {
SpringApplication.run(BlindWay.class, args);
}
}
| [
"hugoferneya@hotmail.com"
] | hugoferneya@hotmail.com |
540368a029793e35f45513924b2acd9d61c14691 | 765ada32e8ec7011d3e608735cb34a1742bcdbba | /Ch6_Command/src/main/java/glm/design_patterns/head_first/ch6_command/Light.java | f5cb9ab29bdb5fab2ee48519a4d57171249deee0 | [] | no_license | GreatLandmark/DesignPatterns_HeadFirst | 932e7250c2338ed0434c3592c2202507bdd2e41b | a055f60d6161bed1b6d3976451f5f430d8325c55 | refs/heads/master | 2022-12-27T16:20:28.476235 | 2020-05-23T04:56:24 | 2020-05-23T04:56:24 | 266,266,855 | 0 | 0 | null | 2020-10-13T22:13:52 | 2020-05-23T05:05:55 | Java | UTF-8 | Java | false | false | 308 | java | package glm.design_patterns.head_first.ch6_command;
public class Light {
String name;
public Light(String s) {
name = s;
}
public void on() {
System.out.println(name+" light ~~ON~~");
}
public void off() {
System.out.println(name+" light ~~OFF~~");
}
} | [
"greatlandmark@outlook.com"
] | greatlandmark@outlook.com |
3ff5118df08fa114e3dbf4c0189bc21f2f83ed2a | 7fdf031a38d4ca1b6372a65834fb550c6983e05d | /MyApplication/master/src/main/java/com/ds/master/activity/SdCleanActivity.java | 9552bc697abe90947ba54f4b738210c13695d4b4 | [
"Apache-2.0"
] | permissive | snmlm/MyObject | 502625de2cafc7da97526b06f5fce97cfc75a4df | e547757ea14b5a31a1c7fead96598798967c7519 | refs/heads/master | 2020-12-24T11:33:32.083041 | 2016-11-22T02:28:03 | 2016-11-22T02:28:03 | 73,029,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,938 | java | package com.ds.master.activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Toast;
import com.ds.master.R;
import com.ds.master.view.TitleBarView;
/**
* sd清理
* Created by xxxxx on 2016/9/28.
*/
public class SdCleanActivity extends BaseActivity{
/** 标记哪里来的 */
private String from;
private TitleBarView mTbvAboutTitle;
private void assignViews() {
mTbvAboutTitle = (TitleBarView) findViewById(R.id.tbv_setting_title);
}
@Override
protected void initView() {
setContentView(R.layout.activity_aboutus);
assignViews();
}
@Override
protected void initData() {
Intent intent = getIntent();
from = intent.getStringExtra("from");
mTbvAboutTitle.setTopTitleText(intent.getStringExtra("title"));
}
@Override
protected void setListener() {
mTbvAboutTitle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(SdCleanActivity.this, "手机管理", Toast.LENGTH_SHORT).show();
finish();
if(from.contains("home")){
overridePendingTransition(R.anim.translate_t2b_enter,
R.anim.translate_t2b_exit);
}
}
});
}
/**
* 监听按键
* @param keyCode
* @param event
* @return
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
finish();
if(from.contains("home")){
overridePendingTransition(R.anim.translate_t2b_enter,
R.anim.translate_t2b_exit);
}
return true;
}
return super.onKeyDown(keyCode, event);
}
}
| [
"913813112@qq.com"
] | 913813112@qq.com |
744e50f7855c93cd842916dd1704360dc4288d8b | baecac3e033bff86a8a228f4a65156f6c319b586 | /idea-gosu-plugin/src/main/java/gw/plugin/ij/compiler/parser/GosuClassCompilerParser.java | ccb9ccf6f307bfa582055496e3ddc1f0f9098e26 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | ikornienko/gosu-lang | 8f1683a52b64e6e959ad24f8428c3c6c9dc80640 | 9f5cecfa813889dbf72754cc6b1d63fc0e7e41ed | refs/heads/master | 2021-01-21T04:11:31.229243 | 2015-04-03T22:54:19 | 2015-04-03T22:54:19 | 34,691,254 | 0 | 1 | null | 2015-04-27T21:06:52 | 2015-04-27T21:06:52 | null | UTF-8 | Java | false | false | 9,265 | java | /*
* Copyright 2014 Guidewire Software, Inc.
*/
package gw.plugin.ij.compiler.parser;
import com.intellij.compiler.impl.javaCompiler.OutputItemImpl;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompilerMessageCategory;
import com.intellij.openapi.compiler.TranslatingCompiler;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import gw.lang.parser.IParsedElement;
import gw.lang.parser.exceptions.ParseResultsException;
import gw.lang.reflect.IAnnotationInfo;
import gw.lang.reflect.IType;
import gw.lang.reflect.TypeSystem;
import gw.lang.reflect.gs.GosuClassTypeLoader;
import gw.lang.reflect.gs.IGosuClass;
import gw.lang.reflect.gs.IGosuClassTypeInfo;
import gw.lang.reflect.module.IModule;
import gw.compiler.ij.processors.DependencyCollector;
import gw.compiler.ij.processors.DependencySink;
import gw.plugin.ij.lang.psi.impl.expressions.GosuIdentifierExpressionImpl;
import gw.plugin.ij.util.ExecutionUtil;
import gw.plugin.ij.util.GosuModuleUtil;
import gw.plugin.ij.util.SafeRunnable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
import java.util.StringTokenizer;
import static gw.plugin.ij.util.ExecutionUtil.*;
public class GosuClassCompilerParser implements ICompilerParser {
protected boolean generateByteCode(VirtualFile file, CompileContext context, IGosuClass gsClass) {
return true;
}
@Override
public boolean accepts(@NotNull VirtualFile file) {
final String name = file.getName();
return
name.endsWith(GosuClassTypeLoader.GOSU_CLASS_FILE_EXT) ||
name.endsWith(GosuClassTypeLoader.GOSU_ENHANCEMENT_FILE_EXT) ||
name.endsWith(GosuClassTypeLoader.GOSU_TEMPLATE_FILE_EXT) ||
name.endsWith(GosuClassTypeLoader.GOSU_PROGRAM_FILE_EXT);
}
// ICompilerParser
public boolean parse(@NotNull CompileContext context, VirtualFile file, @NotNull List<TranslatingCompiler.OutputItem> outputItems, DependencySink sink) {
final Module ijModule = context.getModuleByFile(file);
final String qualifiedName = gw.plugin.ij.util.FileUtil.getSourceQualifiedName(file, GosuModuleUtil.getModule(ijModule));
// Parse
ParseResult parseResult = parseImpl(context, ijModule, file, qualifiedName, outputItems);
if (parseResult != null) {
final ParseResultsException parseException = parseResult.parseException;
if (parseException != null && CompilerIssues.reportIssues(context, file, parseException)) {
return false;
}
// Compile to bytecode (.class files)
try {
VirtualFile bytecodeOutputFile = makeClassFileForOut(context, ijModule, (IGosuClass) parseResult.type, file);
if (bytecodeOutputFile != null) {
outputItems.add(new OutputItemImpl(FileUtil.toSystemIndependentName(bytecodeOutputFile.getPath()), file));
}
} catch (Exception e) {
final String url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, file.getPath());
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
context.addMessage(CompilerMessageCategory.ERROR, "Failed to generate bytecode\n" + e + "\n" + sw.toString(), url, 0, 0);
}
// Copy Source
final File outputFile = CompilerUtils.getOutputFile(context, file);
CompilerUtils.copySourceToOut(file, outputFile);
// Result
DependencyCollector.collect(parseResult.parsedElement.getLocation(), sink);
outputItems.add(new OutputItemImpl(FileUtil.toSystemIndependentName(outputFile.getPath()), file));
return true;
} else {
//final String url = VirtualFileManager.constructUrl(LocalFileSystem.PROTOCOL, file.getPath());
//context.addMessage(CompilerMessageCategory.ERROR, "Could not resolve type for file " + file.getPresentableUrl(), url, 0, 0);
return false;
}
}
private VirtualFile makeClassFileForOut(@NotNull final CompileContext context, final Module ijModule, @NotNull final IGosuClass gsClass, final VirtualFile file) {
final VirtualFile[] classFile = new VirtualFile[1];
final Throwable[] throwable = new Throwable[1];
ExecutionUtil.execute(WRITE | DISPATCH | BLOCKING, new SafeRunnable(GosuModuleUtil.getModule(ijModule)) {
public void execute() {
VirtualFile moduleOutputDirectory = context.getModuleOutputDirectory(ijModule);
if (moduleOutputDirectory == null) {
return;
}
try {
final String outRelativePath = gsClass.getName().replace('.', File.separatorChar) + ".class";
VirtualFile child = moduleOutputDirectory;
child = createFile(outRelativePath, child);
if (createClassFile(child, gsClass, file, context)) {
classFile[0] = child;
} else {
child.delete(null);
}
} catch (Exception e) {
throwable[0] = e;
}
}
private VirtualFile createFile(String outRelativePath, VirtualFile child) throws IOException {
for (StringTokenizer tokenizer = new StringTokenizer(outRelativePath, File.separator + "/"); tokenizer.hasMoreTokens(); ) {
String token = tokenizer.nextToken();
VirtualFile existingChild = child.findChild(token);
if (existingChild == null) {
if (token.endsWith(".class")) {
child = child.createChildData(this, token);
} else {
child = child.createChildDirectory(this, token);
}
} else {
child = existingChild;
}
}
return child;
}
});
if (throwable[0] != null) {
throw new RuntimeException(throwable[0]);
} else {
return classFile[0];
}
}
private boolean createClassFile(@NotNull final VirtualFile outputFile, @NotNull final IGosuClass gosuClass, VirtualFile file, CompileContext context) throws IOException {
if (hasDoNotVerifyAnnotation(gosuClass)) {
return false;
}
if (generateByteCode(file, context, gosuClass)) {
final byte[] bytes = TypeSystem.getGosuClassLoader().getBytes(gosuClass);
OutputStream out = outputFile.getOutputStream(this);
try {
out.write(bytes);
} finally {
out.close();
}
for (IGosuClass innerClass : gosuClass.getInnerClasses()) {
final String innerClassName = String.format("%s$%s.class", outputFile.getNameWithoutExtension(), innerClass.getRelativeName());
VirtualFile innerClassFile = outputFile.getParent().findChild(innerClassName);
if (innerClassFile == null) {
innerClassFile = outputFile.getParent().createChildData(this, innerClassName);
}
createClassFile(innerClassFile, innerClass, file, context);
}
return true;
}
return false;
}
private boolean hasDoNotVerifyAnnotation(IGosuClass gsClass) {
for (IAnnotationInfo ai : gsClass.getTypeInfo().getAnnotations()) {
if (ai.getType().getRelativeName().equals("DoNotVerifyResource")) {
return true;
}
}
return false;
}
protected IType getType(Module ijModule, String qualifiedName) {
final IModule gsModule = GosuModuleUtil.getModule(ijModule);
TypeSystem.pushModule(gsModule);
try {
final IType type = TypeSystem.getByFullNameIfValid(qualifiedName);
return GosuIdentifierExpressionImpl.maybeUnwrapProxy(type);
} finally {
TypeSystem.popModule(gsModule);
}
}
// Parsing
protected static class ParseResult {
public final IType type;
public final ParseResultsException parseException;
public final IParsedElement parsedElement;
public ParseResult(IType type, IParsedElement parsedElement, ParseResultsException parseException) {
this.type = type;
this.parseException = parseException;
this.parsedElement = parsedElement;
}
}
@Nullable
protected ParseResult parseImpl(CompileContext context, Module ijModule, VirtualFile file, String qualifiedName, List<TranslatingCompiler.OutputItem> result) {
TypeSystem.lock();
IGosuClass klass = null;
try {
klass = (IGosuClass) getType(ijModule, qualifiedName);
if (klass != null) {
klass.setCreateEditorParser(false);
klass.isValid(); // force compilation
}
} finally {
TypeSystem.unlock();
}
if (klass != null) {
final boolean report = reportParseIssues(klass);
return new ParseResult(klass, klass.getClassStatement().getClassFileStatement(), report ? klass.getParseResultsException() : null);
}
return null;
}
protected boolean reportParseIssues(@NotNull IGosuClass klass) {
final IType dnvr = TypeSystem.getByFullNameIfValid("gw.testharness.DoNotVerifyResource");
final IGosuClassTypeInfo typeInfo = klass.getTypeInfo();
return dnvr == null || !typeInfo.hasAnnotation(dnvr);
}
}
| [
"lboasso@guidewire.com"
] | lboasso@guidewire.com |
be7b26135ffa36c09320fbb843fa77ca3586a620 | 849fd6d5f26234f202ebd918e30210517a8e6a21 | /src/main/java/control/wrappers/JobWrapper.java | a22afae70ac5d944589673a3f1b791da5bab7071 | [] | no_license | gibocx/projectInfo | 022bd1f2cbf2ea2d354682d16a48107c549f7f28 | 73efd990165aa7c4247e441bcb9659e066deea16 | refs/heads/master | 2023-05-06T06:03:27.272605 | 2021-05-15T21:08:24 | 2021-05-15T21:08:24 | 345,216,075 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package control.wrappers;
import control.Job;
import download.DownloadActions;
import download.methods.DownloadMethodFactory;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
public class JobWrapper {
private final Map<String, String> download = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
private String name, description;
private Set<String> categories;
private Set<ActionWrapper> actions;
private List<PreActionWrapper> preActions;
Job toJob() {
return new Job(name, description, DownloadMethodFactory.newMethod(download),
getDownloadActions(), categories);
}
private DownloadActions getDownloadActions() {
return new DownloadActions(ActionWrapper.getActions(actions), PreActionWrapper.getPreActions(preActions));
}
private void setActions(Set<ActionWrapper> actions) {
this.actions = actions;
}
public void setDownload(Map<String, String> download) {
this.download.putAll(download);
}
public void setName(String name) {
this.name = name;
}
public void setDescription(String description) {
this.description = description;
}
public void setCategories(Set<String> categories) {
this.categories = categories;
}
public void setPreAction(List<PreActionWrapper> preActions) {
this.preActions = preActions;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JobWrapper that = (JobWrapper) o;
return Objects.equals(download, that.download) && Objects.equals(categories, that.categories) && Objects.equals(actions, that.actions) && Objects.equals(preActions, that.preActions);
}
@Override
public int hashCode() {
return Objects.hash(download, categories, actions, preActions);
}
}
| [
"jogi8230@gmail.com"
] | jogi8230@gmail.com |
e2bd02dd07f66c0511533c175668eb036c891f2d | 6c89cdedd4e2d34fe8368531fa4f53a53b87b7b5 | /src/test/java/testScripts/login/LoginTest.java | 3ad8297cfe02d375704b105fbd2aa8bd83cf3520 | [] | no_license | RohanKambuj/PracticeDDTFramework | 9f0e466ff959ce80a1968a0b89e6d73bb724d015 | 1e0dc17fcba67905b5d85802166df200ff5561ac | refs/heads/master | 2020-05-05T07:21:14.545898 | 2019-04-06T10:59:36 | 2019-04-06T10:59:36 | 179,821,924 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,077 | java | package testScripts.login;
import org.testng.SkipException;
//import org.testng.TestNGException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import pageObjects.home.Home;
import pageObjects.login.Login;
import testBase.DataSource;
import testBase.TestBase;
public class LoginTest extends TestBase{
Login login;
Home home;
@DataProvider(name="testData")
public Object[][] testData(){
String[][] data = getExcelData("demo.xlsx", "loginData");
return data;
}
@BeforeClass
public void beforeClass(){
getApplicationURL(DataSource.OR.getProperty("url"));
login = new Login(driver);
}
@Test(dataProvider="testData")
public void loginTest(String userName, String password, String runMode){
if(runMode.equalsIgnoreCase("n")){
throw new SkipException("Run mode for this set of data is marked N");
}
Home homePage = login.loginToApplication(userName, password);
homePage.logout();
System.out.println("implicite wait is: "+System.getProperty("implicitWait"));
}
}
| [
"rohankambuj1987@gmail.com"
] | rohankambuj1987@gmail.com |
0d85443eecea298b9bbb23464b26781625b9b355 | f5fde49be3612aaa040ff596fb8fbe2ee1b7a2ec | /multiplication/multiplication/src/main/java/com/multiplication/service/package-info.java | 23fd5927948705a94186d5b365e3b03bd5e7c78d | [] | no_license | lexican/springboot-microservices | ef7c3af65d2c892fcce228cb9b9279f9f8d9b482 | d54bae4a1072144688721ca3e565517e3dbc3dff | refs/heads/main | 2023-05-29T06:30:29.393427 | 2021-06-14T01:53:30 | 2021-06-14T01:53:30 | 376,674,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 35 | java | package com.multiplication.service; | [
"miamilexican@gmail.com"
] | miamilexican@gmail.com |
983566526a8816b4e2bfd0a31c68f15a95d72d59 | 4ae0f956f1b3d33de0d31147ba876f4eebfad249 | /ylzhy-admin/src/main/java/com/zhy/modules/sys/entity/SysConfigEntity.java | 23fda9eff6fbb960ba15123038540bf35d40cc89 | [
"Apache-2.0"
] | permissive | dongdong-2009/ylxny-zhy | cc0a18637940c3126f317ad15f06f69db06e2648 | 812be51bac99266bd444d0d3cac71c2d5ff382a5 | refs/heads/master | 2021-09-23T03:32:49.737554 | 2018-09-20T10:38:40 | 2018-09-20T10:38:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,631 | java | /**
* Copyright 2018 智慧云
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.zhy.modules.sys.entity;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import javax.validation.constraints.NotBlank;
/**
* 系统配置信息
*
* @author chenshun
* @email
* @date 2016年12月4日 下午6:43:36
*/
@TableName("sys_config")
public class SysConfigEntity {
@TableId
private Long id;
@NotBlank(message="参数名不能为空")
private String paramKey;
@NotBlank(message="参数值不能为空")
private String paramValue;
private String remark;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getParamKey() {
return paramKey;
}
public void setParamKey(String paramKey) {
this.paramKey = paramKey;
}
public String getParamValue() {
return paramValue;
}
public void setParamValue(String paramValue) {
this.paramValue = paramValue;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
| [
"zengqiang724@163.com"
] | zengqiang724@163.com |
26b495f164cd288efca1b70764de5a117ff5c0a6 | c1cf6b31c8f97c59c2fa1a4b1bcbe5ac794c74d3 | /BaumkatasterWien/app/src/main/java/at/rueckgr/android/baumkatasterwien/NetworkTask.java | ed32d6c7358aef1f85f437f82d876373b23f8cd8 | [] | no_license | paulchen/baumkataster | 14a8e84e5090e10eca5c3c71b55d9afe773b47e6 | 310966a045b38e123c18bab4c758a3279009e423 | refs/heads/master | 2023-02-08T22:02:34.747229 | 2023-02-05T22:31:50 | 2023-02-05T22:31:50 | 191,247,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,570 | java | package at.rueckgr.android.baumkatasterwien;
import android.os.AsyncTask;
import android.util.Xml;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.net.ssl.HttpsURLConnection;
public class NetworkTask extends AsyncTask<String, Void, List<Tree>> implements Serializable {
private MainActivity mainActivity;
public NetworkTask(MainActivity mainActivity) {
this.mainActivity = mainActivity;
}
@Override
protected List<Tree> doInBackground(String... urlStrings) {
URL url;
try {
url = new URL(urlStrings[0]);
}
catch (MalformedURLException e) {
// TODO
return Collections.emptyList();
}
HttpsURLConnection urlConnection = null;
InputStream inputStream = null;
try {
urlConnection = (HttpsURLConnection) url.openConnection();
inputStream = urlConnection.getInputStream();
return processStream(inputStream);
}
catch (Exception e) {
// TODO
return Collections.emptyList();
}
finally {
if(inputStream != null) {
try {
inputStream.close();
}
catch (Exception e) {
// ignore silently
}
}
if(urlConnection != null) {
try {
urlConnection.disconnect();
}
catch (Exception e) {
// ignore silently
}
}
}
}
private List<Tree> processStream(InputStream inputStream) throws IOException, XmlPullParserException {
XmlPullParser parser = Xml.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(inputStream, null);
parser.nextTag();
List<Tree> trees = new ArrayList<>();
parser.require(XmlPullParser.START_TAG, null, "trees");
while (parser.nextTag() != XmlPullParser.END_TAG) {
if(parser.getEventType() != XmlPullParser.START_TAG) {
continue;
}
String tag = parser.getName();
if(tag.equals("tree")) {
Tree tree = readTree(parser);
if(tree != null) {
trees.add(tree);
}
}
else {
skip(parser);
}
}
return trees;
}
private Tree readTree(XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(XmlPullParser.START_TAG, null, "tree");
String title = null;
String pflanzjahr = null;
String baumhoehe = null;
String kronendurchmesser = null;
Integer baumhoeheInt = null;
Double lat = null;
Double lon = null;
while(parser.next() != XmlPullParser.END_TAG) {
if(parser.getEventType() != XmlPullParser.START_TAG) {
continue;
}
String tag = parser.getName();
switch(tag) {
case "GATTUNG_ART":
title = readStringTag(tag, parser);
break;
case "PFLANZJAHR_TXT":
pflanzjahr = readStringTag(tag, parser);
break;
case "BAUMHOEHE":
baumhoeheInt = readIntTag(tag, parser);
break;
case "BAUMHOEHE_TXT":
baumhoehe = readStringTag(tag, parser);
break;
case "KRONENDURCHMESSER_TXT":
kronendurchmesser = readStringTag(tag, parser);
break;
case "lat":
lat = readDoubleTag(tag, parser);
break;
case "lon":
lon = readDoubleTag(tag, parser);
break;
default:
skip(parser);
}
}
if(title != null && lat != null && lon != null && pflanzjahr != null && baumhoehe != null && baumhoeheInt != null && kronendurchmesser != null) {
return new Tree(lat, lon, title, pflanzjahr, baumhoehe, baumhoeheInt, kronendurchmesser);
}
return null;
}
private String readStringTag(String tag, XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(XmlPullParser.START_TAG, null, tag);
String title = readText(parser);
parser.require(XmlPullParser.END_TAG, null, tag);
return title;
}
private Integer readIntTag(String tag, XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(XmlPullParser.START_TAG, null, tag);
String title = readText(parser);
parser.require(XmlPullParser.END_TAG, null, tag);
return Integer.valueOf(title);
}
private Double readDoubleTag(String tag, XmlPullParser parser) throws IOException, XmlPullParserException {
parser.require(XmlPullParser.START_TAG, null, tag);
String title = readText(parser);
parser.require(XmlPullParser.END_TAG, null, tag);
return Double.valueOf(title);
}
// For the tags title and summary, extracts their text values.
private String readText(XmlPullParser parser) throws IOException, XmlPullParserException {
String result = "";
if (parser.next() == XmlPullParser.TEXT) {
result = parser.getText();
parser.nextTag();
}
return result;
}
private void skip(XmlPullParser parser) throws XmlPullParserException,
IOException {
if (parser.getEventType() != XmlPullParser.START_TAG) {
throw new IllegalStateException();
}
int depth = 1;
while (depth != 0) {
switch (parser.next()) {
case XmlPullParser.END_TAG:
depth--;
break;
case XmlPullParser.START_TAG:
depth++;
break;
}
}
}
@Override
protected void onPostExecute(List<Tree> trees) {
mainActivity.onSuccess(trees);
}
}
| [
"paulchen@rueckgr.at"
] | paulchen@rueckgr.at |
2d29b096842e2ddaf3dba163167525009f660a3a | 9b94b279f5e57ca908bdbc9aeda3a7b5011544f0 | /src/main/java/lv/initex/todo/services/AddUserService.java | 143254475a164aaf92c690129b622d02aad71cc3 | [] | no_license | initex1/initex | 2f1dddb2858cf2c16bd3f22f28ff82a3b74b1dd7 | d403359e91d856c71307d81515bb4ec7d2aaae0f | refs/heads/master | 2020-04-05T07:00:43.926049 | 2018-11-11T20:15:40 | 2018-11-11T20:15:40 | 156,660,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package lv.initex.todo.services;
import lv.initex.todo.database.UserTaskRepository;
import lv.initex.todo.domain.User;
public class AddUserService {
private UserTaskRepository database;
public AddUserService(UserTaskRepository database) {
this.database = database;
}
public void add(String userName) {
User user = new User();
user.setUserName(userName);
database.addUser(user);
database.setActiveUser(user);
}
}
| [
"initex@inbox.lv"
] | initex@inbox.lv |
33151177337c1629294f512c930c1608bcf04d48 | 1395406fda76d9db5e4de65fd2b8c86a407a17eb | /src/test/java/org/culturegraph/mf/util/StreamValidatorTest.java | f90069e58071bdd84a5c56f04d14962543d85ceb | [] | no_license | lobid/metafacture-core | f7905b7e70dfeeb4ac38f08f7677548ae7236904 | a84bdc515cd78809783b964176d301ca0290fde3 | refs/heads/master | 2021-01-22T00:29:37.570462 | 2013-12-04T17:29:17 | 2013-12-04T17:29:17 | 16,209,245 | 0 | 0 | null | 2014-05-26T10:09:30 | 2014-01-24T16:02:09 | Java | UTF-8 | Java | false | false | 1,354 | java | /*
* Copyright 2013 Deutsche Nationalbibliothek
*
* Licensed under the Apache License, Version 2.0 the "License";
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.culturegraph.mf.util;
import org.culturegraph.mf.exceptions.WellformednessException;
import org.culturegraph.mf.stream.sink.EventList;
import org.culturegraph.mf.stream.sink.StreamValidator;
import org.junit.Test;
/**
* Tests for {@link StreamValidator}.
*
* @author Christoph Böhme
*
*/
public final class StreamValidatorTest {
private static final String ID = "1";
@Test(expected=WellformednessException.class)
public void testEndRecord() {
final EventList stream = new EventList();
stream.startRecord(ID);
stream.endRecord();
stream.closeStream();
final StreamValidator validator = new StreamValidator(stream.getEvents());
validator.startRecord(ID);
validator.closeStream();
}
}
| [
"c.boehme@dnb.de"
] | c.boehme@dnb.de |
316661acbfe3fc78ffb19abc3d1b6da9efb8312c | 64122d295c5b3b12f92a6e55a1f37f6b3f317603 | /src/main/java/com/rdas/config/HazelcastConfiguration.java | 597ea14e6305aaba45a5d9a3a7c08def50bb26ec | [] | no_license | ranadas/hazespring | e0e3dfac4b0fb06eaf99e9248764e24cecab39a6 | 5950a7bb04f5e66fe5ebb85569d767a31b09719f | refs/heads/master | 2021-01-10T05:39:04.042283 | 2020-01-13T19:32:00 | 2020-01-13T19:32:00 | 54,184,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,927 | java | package com.rdas.config;
import com.hazelcast.config.Config;
import com.hazelcast.config.EvictionPolicy;
import com.hazelcast.config.MapConfig;
import com.hazelcast.config.NetworkConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class HazelcastConfiguration {
private static final int RECEICED_MESSAGES_TRACK_TTL_SECS = 60 * 60;
@Bean(destroyMethod = "shutdown")
public HazelcastInstance hazelcast(Config config) {
return Hazelcast.newHazelcastInstance(config);
}
@Bean
Config config(ApplicationContext applicationContext, NetworkConfig networkConfig) {
final Config config = new Config()
.addMapConfig(
new MapConfig()
.setName("accepted-messages")
.setEvictionPolicy(EvictionPolicy.LRU)
.setTimeToLiveSeconds(RECEICED_MESSAGES_TRACK_TTL_SECS)
);
config.setNetworkConfig(networkConfig);
config.getGroupConfig().setName(applicationContext.getId());
return config;
}
@Bean
NetworkConfig networkConfig(@Value("${hazelcast.port:5701}") int port
//, JoinConfig joinConfig
) {
final NetworkConfig networkConfig = new NetworkConfig();
//networkConfig.setJoin(joinConfig);
networkConfig.setPort(port);
return networkConfig;
}
//TODO - https://github.com/jloisel/spring-boot-hazelcast/tree/master/cluster-hazelcast/src/main/java/com/octoperf/cluster/hazelcast
//https://github.com/jloisel/spring-boot-hazelcast
//https://github.com/dineshgpillai/innovation/tree/cca13cbc4f361f579c6320717d343259513a3e7b/trade-imdg/src/main/java/com/trade/imdg/hazelcast
//https://github.com/dineshgpillai/innovation/blob/cca13cbc4f361f579c6320717d343259513a3e7b/trade-imdg/src/main/java/com/trade/imdg/hazelcast/MainNoSpringBoot.java
// @Bean
// JoinConfig joinConfig(TcpIpConfig tcpIpConfig) {
// final JoinConfig joinConfig = disabledMulticast();
// joinConfig.setTcpIpConfig(tcpIpConfig);
// return joinConfig;
// }
// private JoinConfig disabledMulticast() {
// JoinConfig join = new JoinConfig();
// final MulticastConfig multicastConfig = new MulticastConfig();
// multicastConfig.setEnabled(false);
// join.setMulticastConfig(multicastConfig);
// return join;
// }
// @Bean
// TcpIpConfig tcpIpConfig(ApplicationContext applicationContext,
// ServiceDiscovery<Void> serviceDiscovery) throws Exception {
// final TcpIpConfig tcpIpConfig = new TcpIpConfig();
// final List<String> instances = queryOtherInstancesInZk(applicationContext.getId(), serviceDiscovery);
// tcpIpConfig.setMembers(instances);
// tcpIpConfig.setEnabled(true);
// return tcpIpConfig;
// }
//
// private List<String> queryOtherInstancesInZk(String name, ServiceDiscovery<Void> serviceDiscovery) throws Exception {
// return serviceDiscovery
// .queryForInstances(name)
// .stream()
// .map(ServiceInstance::buildUriSpec)
// .collect(Collectors.toList());
// }
// @Bean
// public Config config() {
// return new Config().addMapConfig(
// // Set up TTL for the Map tracking received Messages IDs
// new MapConfig()
// .setName(ChatServiceHazelcastImpl.ACCEPTED_MESSAGES_TRACKING_MAP_NAME)
// .setEvictionPolicy(EvictionPolicy.LRU)
// .setTimeToLiveSeconds(RECEICED_MESSAGES_TRACK_TTL_SECS));
// }
/*
private static final int RECEICED_MESSAGES_TRACK_TTL_SECS = 60 * 60;
// When Spring Boot find a com.hazelcast.config.Config automatically instantiate a HazelcastInstance
@Bean
public Config config() {
return new Config().addMapConfig(
// Set up TTL for the Map tracking received Messages IDs
new MapConfig()
.setName(ChatServiceHazelcastImpl.ACCEPTED_MESSAGES_TRACKING_MAP_NAME)
.setEvictionPolicy(EvictionPolicy.LRU)
.setTimeToLiveSeconds(RECEICED_MESSAGES_TRACK_TTL_SECS));
}
return new Config().addMapConfig(
new MapConfig()
.setName("accepted-messages")
.setEvictionPolicy(EvictionPolicy.LRU)
.setTimeToLiveSeconds(2400))
.setProperty("hazelcast.logging.type","slf4j");
*/
}
| [
"rana.pratap.das@gmail.com"
] | rana.pratap.das@gmail.com |
6f8f8f0c2a43ec1224c885ed50ddea3b1cc99c1d | 3d79e08d823ed134a9ace5bc72b2ef32719f0934 | /service-elasticsearch/src/main/java/com/bigfong/cloud/serviceelasticsearch/mapper/basic/ArticleMapper.java | 89b90d0e8bf8f39235bf46a7250f6948a091bcee | [] | no_license | bigfongcom/bigfong-cloud | 5236ece6c2d40a9e47634690041d98d0c0d1c979 | fb875dd9e59b3c7babac260f0eb35691091935c8 | refs/heads/master | 2022-11-29T16:31:14.736232 | 2019-06-16T08:26:24 | 2019-06-16T08:26:24 | 191,956,550 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 367 | java | package com.bigfong.cloud.serviceelasticsearch.mapper.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bigfong.cloud.serviceelasticsearch.entity.basic.Article;
import org.apache.ibatis.annotations.Param;
public interface ArticleMapper extends BaseMapper<Article> {
public Article getArticleById(@Param("_article") Article article);
}
| [
"708803597@qq.com"
] | 708803597@qq.com |
93e802f42469da464f0f507772abdc544eb40df6 | 343f57fe81c13bd5c2f90e9bf5ea919073cf9355 | /Chocks/src/main/java/cn/tchock/TChockApplication.java | 47dbb441c3a4263cfd90cc723c28788f8487c090 | [] | no_license | timpkins/TChock | e5a853fcd70262300e4de7af864da4d0df3efa3d | 1d5a2e43beb6ce07996c7bbb1357bfb3dad5b5eb | refs/heads/master | 2020-03-23T04:16:27.359783 | 2018-08-03T14:44:46 | 2018-08-03T14:44:46 | 141,073,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 164 | java | package cn.tchock;
import cn.chock.BaseChockApplication;
/**
* @author timpkins
*/
public class TChockApplication extends BaseChockApplication {
}
| [
"timpkins@163.com"
] | timpkins@163.com |
33a15ca11b2748fca00d9575145cf19936078cc0 | 3cf870ec335aa1b95e8776ea9b2a9d6495377628 | /admin-sponge/build/tmp/recompileMc/sources/net/minecraft/block/BlockStoneSlab.java | 073d59e120390b575fa831f84d0900a32631b34b | [] | no_license | yk133/MyMc | d6498607e7f1f932813178e7d0911ffce6e64c83 | e1ae6d97415583b1271ee57ac96083c1350ac048 | refs/heads/master | 2020-04-03T16:23:09.774937 | 2018-11-05T12:17:39 | 2018-11-05T12:17:39 | 155,402,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,205 | java | package net.minecraft.block;
import java.util.Random;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public abstract class BlockStoneSlab extends BlockSlab
{
public static final PropertyBool field_176555_b = PropertyBool.create("seamless");
public static final PropertyEnum<BlockStoneSlab.EnumType> field_176556_M = PropertyEnum.<BlockStoneSlab.EnumType>create("variant", BlockStoneSlab.EnumType.class);
public BlockStoneSlab()
{
super(Material.ROCK);
IBlockState iblockstate = this.stateContainer.getBaseState();
if (this.func_176552_j())
{
iblockstate = iblockstate.func_177226_a(field_176555_b, Boolean.valueOf(false));
}
else
{
iblockstate = iblockstate.func_177226_a(field_176554_a, BlockSlab.EnumBlockHalf.BOTTOM);
}
this.setDefaultState(iblockstate.func_177226_a(field_176556_M, BlockStoneSlab.EnumType.STONE));
this.func_149647_a(CreativeTabs.BUILDING_BLOCKS);
}
public Item func_180660_a(IBlockState p_180660_1_, Random p_180660_2_, int p_180660_3_)
{
return Item.getItemFromBlock(Blocks.STONE_SLAB);
}
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state)
{
return new ItemStack(Blocks.STONE_SLAB, 1, ((BlockStoneSlab.EnumType)state.get(field_176556_M)).func_176624_a());
}
public String func_150002_b(int p_150002_1_)
{
return super.getTranslationKey() + "." + BlockStoneSlab.EnumType.func_176625_a(p_150002_1_).func_176627_c();
}
public IProperty<?> func_176551_l()
{
return field_176556_M;
}
public Comparable<?> func_185674_a(ItemStack p_185674_1_)
{
return BlockStoneSlab.EnumType.func_176625_a(p_185674_1_.func_77960_j() & 7);
}
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
public void fillItemGroup(CreativeTabs group, NonNullList<ItemStack> items)
{
for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values())
{
if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD)
{
items.add(new ItemStack(this, 1, blockstoneslab$enumtype.func_176624_a()));
}
}
}
public IBlockState func_176203_a(int p_176203_1_)
{
IBlockState iblockstate = this.getDefaultState().func_177226_a(field_176556_M, BlockStoneSlab.EnumType.func_176625_a(p_176203_1_ & 7));
if (this.func_176552_j())
{
iblockstate = iblockstate.func_177226_a(field_176555_b, Boolean.valueOf((p_176203_1_ & 8) != 0));
}
else
{
iblockstate = iblockstate.func_177226_a(field_176554_a, (p_176203_1_ & 8) == 0 ? BlockSlab.EnumBlockHalf.BOTTOM : BlockSlab.EnumBlockHalf.TOP);
}
return iblockstate;
}
public int func_176201_c(IBlockState p_176201_1_)
{
int i = 0;
i = i | ((BlockStoneSlab.EnumType)p_176201_1_.get(field_176556_M)).func_176624_a();
if (this.func_176552_j())
{
if (((Boolean)p_176201_1_.get(field_176555_b)).booleanValue())
{
i |= 8;
}
}
else if (p_176201_1_.get(field_176554_a) == BlockSlab.EnumBlockHalf.TOP)
{
i |= 8;
}
return i;
}
protected BlockStateContainer func_180661_e()
{
return this.func_176552_j() ? new BlockStateContainer(this, new IProperty[] {field_176555_b, field_176556_M}) : new BlockStateContainer(this, new IProperty[] {field_176554_a, field_176556_M});
}
public int func_180651_a(IBlockState p_180651_1_)
{
return ((BlockStoneSlab.EnumType)p_180651_1_.get(field_176556_M)).func_176624_a();
}
/**
* Get the MapColor for this Block and the given BlockState
* @deprecated call via {@link IBlockState#getMapColor(IBlockAccess,BlockPos)} whenever possible.
* Implementing/overriding is fine.
*/
public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
return ((BlockStoneSlab.EnumType)state.get(field_176556_M)).func_181074_c();
}
public static enum EnumType implements IStringSerializable
{
STONE(0, MapColor.STONE, "stone"),
SAND(1, MapColor.SAND, "sandstone", "sand"),
WOOD(2, MapColor.WOOD, "wood_old", "wood"),
COBBLESTONE(3, MapColor.STONE, "cobblestone", "cobble"),
BRICK(4, MapColor.RED, "brick"),
SMOOTHBRICK(5, MapColor.STONE, "stone_brick", "smoothStoneBrick"),
NETHERBRICK(6, MapColor.NETHERRACK, "nether_brick", "netherBrick"),
QUARTZ(7, MapColor.QUARTZ, "quartz");
private static final BlockStoneSlab.EnumType[] field_176640_i = new BlockStoneSlab.EnumType[values().length];
private final int field_176637_j;
private final MapColor field_181075_k;
private final String field_176638_k;
private final String field_176635_l;
private EnumType(int p_i46381_3_, MapColor p_i46381_4_, String p_i46381_5_)
{
this(p_i46381_3_, p_i46381_4_, p_i46381_5_, p_i46381_5_);
}
private EnumType(int p_i46382_3_, MapColor p_i46382_4_, String p_i46382_5_, String p_i46382_6_)
{
this.field_176637_j = p_i46382_3_;
this.field_181075_k = p_i46382_4_;
this.field_176638_k = p_i46382_5_;
this.field_176635_l = p_i46382_6_;
}
public int func_176624_a()
{
return this.field_176637_j;
}
public MapColor func_181074_c()
{
return this.field_181075_k;
}
public String toString()
{
return this.field_176638_k;
}
public static BlockStoneSlab.EnumType func_176625_a(int p_176625_0_)
{
if (p_176625_0_ < 0 || p_176625_0_ >= field_176640_i.length)
{
p_176625_0_ = 0;
}
return field_176640_i[p_176625_0_];
}
public String getName()
{
return this.field_176638_k;
}
public String func_176627_c()
{
return this.field_176635_l;
}
static
{
for (BlockStoneSlab.EnumType blockstoneslab$enumtype : values())
{
field_176640_i[blockstoneslab$enumtype.func_176624_a()] = blockstoneslab$enumtype;
}
}
}
} | [
"1060682109@qq.com"
] | 1060682109@qq.com |
e1a3a3f0ee6f781c03a55634842871997ca9d438 | d814fb349184bd7e31ee0666d844fc719cdbdf21 | /MVP_Retrofit_Rxjava-master/app/src/main/java/com/cui/mrr/http/ApiService.java | 0c2b979f021fc73542b507f51bc9ecbfb6709370 | [
"Apache-2.0"
] | permissive | wlxth/SelectPicture | 3917f903f0fa8ccae61ffeb5b2b4bdc19d4f2d60 | 7815817477daa8c5c8a908eb149628626152555a | refs/heads/master | 2021-09-01T18:07:05.708721 | 2017-12-28T04:43:45 | 2017-12-28T04:43:45 | 115,580,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package com.cui.mrr.http;
import com.cui.mrr.entity.ListEntity;
import java.util.List;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Streaming;
import retrofit2.http.Url;
import rx.Observable;
/**
* Created by cuiyang on 16/6/1.
*/
public interface ApiService {
@GET("selectlubotuNews")
Observable<List<ListEntity>> getMainList();
@Streaming //使用Streaming将不把文件读进内存
@GET
Observable<ResponseBody> downloadFile(@Url String url);
}
| [
"643070371@qq.com"
] | 643070371@qq.com |
1edf3c195e3ee7484b5f0c9f26e4a903a2bc7e26 | be4addfdb0898adf23df1887ade66987820e551c | /EducingTechStoreApp/app/src/main/java/educing/tech/store/mysql/db/send/ChangeStoreStatus.java | fb80856445020e4b65f94ab1a391e1e6ecbea937 | [] | no_license | CHIRANJIT1988/txtbravo-android-app-all | df7f31b5eb4138a1e8f103318b06fdaf54c465fa | 84063e3e95a1f820cd179355e5fa447f7f980a02 | refs/heads/master | 2022-10-31T10:47:17.135347 | 2020-06-20T14:16:16 | 2020-06-20T14:16:16 | 273,721,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,819 | java | package educing.tech.store.mysql.db.send;
import educing.tech.store.app.MyApplication;
import educing.tech.store.model.Store;
import educing.tech.store.helper.OnTaskCompleted;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.util.Log;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import static educing.tech.store.configuration.Configuration.API_URL;
public class ChangeStoreStatus
{
private OnTaskCompleted listener;
private String URL = "";
private Context context;
private Store store;
private static final int MAX_ATTEMPTS = 10;
private int ATTEMPTS_COUNT;
public ChangeStoreStatus(Context context, OnTaskCompleted listener)
{
this.listener = listener;
this.context = context;
this.URL = API_URL + "store-online-status.php";
}
public void save(Store store)
{
this.store = store;
execute();
}
public void execute()
{
StringRequest postRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener<String>() {
@Override
public void onResponse(String response)
{
try
{
JSONObject jsonObj = new JSONObject(response);
int error_code = jsonObj.getInt("error_code");
String message = jsonObj.getString("message");
Log.v("Response: ", "" + response);
if (error_code == 200) // checking for error node in json
{
listener.onTaskCompleted(true, error_code, message); // Successful
}
else
{
if(ATTEMPTS_COUNT != MAX_ATTEMPTS)
{
execute();
ATTEMPTS_COUNT ++;
Log.v("#Attempt No: ", "" + ATTEMPTS_COUNT);
return;
}
listener.onTaskCompleted(false, error_code, message); // Invalid User
}
}
catch (JSONException e)
{
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error)
{
listener.onTaskCompleted(false, 500, "Internet connection fail. Try Again");
}
})
{
@Override
protected Map<String, String> getParams()
{
Map<String, String> params = new HashMap<>();
params.put("store_id", String.valueOf(store.getStoreId()));
if(store.getIsOnline())
{
params.put("is_online", "1");
}
else
{
params.put("is_online", "0");
}
Log.v("param: ", String.valueOf(params));
return params;
}
};
// Adding request to request queue
MyApplication.getInstance().addToRequestQueue(postRequest);
}
} | [
"chiranjit@bchiranjit-lp.local"
] | chiranjit@bchiranjit-lp.local |
2f6c077e32c94302544b3158af07c02d5d7d6515 | 8a648eccdef421f80cb44b89589dfeb18c4418b0 | /src/main/java/org/sai/java/messenger/resources/database/DatabaseClass.java | e066547b8a2097f0acd35d85c4df9401bf1ab94d | [] | no_license | krish0902/JAX-RS | 832b6f8e6d09b834449fbc7919cb975a906d283d | d79550efc95db4cbd60180325dcf91b7ac2057e2 | refs/heads/master | 2022-11-13T04:24:07.695777 | 2020-07-08T16:52:17 | 2020-07-08T16:52:17 | 271,128,495 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package org.sai.java.messenger.resources.database;
import java.util.HashMap;
import java.util.Map;
import org.sai.java.messenger.resources.model.Message;
import org.sai.java.messenger.resources.model.Profile;
public class DatabaseClass {
private static Map<Long,Message> messages =new HashMap<>();
private static Map<String,Profile> profiles =new HashMap<>();
public static Map<Long,Message> getMessages() {
return messages;
}
public static Map<String,Profile> getProfiles(){
return profiles;
}
}
| [
"saikrishnakattari@gmail.com"
] | saikrishnakattari@gmail.com |
13cd3b2c7ddad330fc236a56ba54aabdca79f808 | 53c3ca27f20145c07a56d8bf32e14a76c7947075 | /Schema/b2mml/batchinformation/NoteType.java | b20d09cd9abc5049d4f5327f19a1c011c54dbcbd | [] | no_license | PierreREN/B2MML-BatchML | 93648b4a57fe11e11476e93bc5664fbff083dd50 | fbcd2cd9bd4151a77dab99b569ad3edb0b524198 | refs/heads/master | 2020-07-08T23:53:20.023257 | 2020-03-29T07:40:41 | 2020-03-29T07:40:41 | 203,813,515 | 0 | 0 | null | 2019-08-22T14:37:14 | 2019-08-22T14:37:14 | null | UTF-8 | Java | false | false | 1,041 | java | //
// 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的
// 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 在重新编译源模式时, 对此文件的所有修改都将丢失。
// 生成时间: 2020.01.08 时间 10:35:35 PM CST
//
package isa95.aps.interfaces.b2mml.batchinformation;
import isa95.aps.interfaces.b2mml.common.TextType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>NoteType complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType name="NoteType">
* <simpleContent>
* <restriction base="<http://www.mesa.org/xml/B2MML>TextType">
* </restriction>
* </simpleContent>
* </complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NoteType")
public class NoteType
extends TextType {
}
| [
"30284938+PierreREN@users.noreply.github.com"
] | 30284938+PierreREN@users.noreply.github.com |
c6b4e9349fdd761ff2871927937cce29e46fe29b | 9287392d0e3c70b881a7fb4a8953defbb20fe70e | /app/src/main/java/com/defenders/campingco/bookingActivity.java | f05d912cc35d0ccab9ea9d8748b9f547a74d6df6 | [] | no_license | defendersdevelopers/CampingCo | de1a26f77b0be0399c5e514527e65ed5aaabc74f | 1397e7bb04d4f308c971ce4c949ab2e2047cd75b | refs/heads/master | 2020-07-26T06:33:59.840386 | 2019-09-15T10:03:33 | 2019-09-15T10:03:33 | 208,563,079 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.defenders.campingco;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
public class bookingActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.booking_layout);
}
}
| [
"defendersdevelopers@gmail.com"
] | defendersdevelopers@gmail.com |
49aaf7f039009fe94316a60e5084b4706029de07 | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/TestNetworkClient.java | 6f8747b6544aa4a2e7ca843d35ae676f10c4cf1b | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | Java | false | false | 6,858 | java | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.feed;
import android.util.Base64;
import com.google.android.libraries.feed.api.host.config.Configuration;
import com.google.android.libraries.feed.api.host.network.HttpRequest;
import com.google.android.libraries.feed.api.host.network.HttpRequest.HttpMethod;
import com.google.android.libraries.feed.api.host.network.HttpResponse;
import com.google.android.libraries.feed.api.host.network.NetworkClient;
import com.google.android.libraries.feed.common.functional.Consumer;
import com.google.android.libraries.feed.common.logging.Logger;
import com.google.android.libraries.feed.feedrequestmanager.RequestHelper;
import com.google.protobuf.ByteString;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistryLite;
import com.google.search.now.wire.feed.FeedRequestProto.FeedRequest;
import com.google.search.now.wire.feed.RequestProto.Request;
import com.google.search.now.wire.feed.ResponseProto.Response;
import com.google.search.now.wire.feed.mockserver.MockServerProto.ConditionalResponse;
import com.google.search.now.wire.feed.mockserver.MockServerProto.MockServer;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.task.PostTask;
import org.chromium.content_public.browser.UiThreadTaskTraits;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicBoolean;
/** A network client that returns configurable responses
* modified from com.google.android.libraries.feed.mocknetworkclient.MockServerNetworkClient
*/
public class TestNetworkClient implements NetworkClient {
private static final String TAG = "TestNetworkClient";
private final ExtensionRegistryLite mExtensionRegistry;
private final long mResponseDelay;
private final AtomicBoolean mAlreadyClosed = new AtomicBoolean(false);
private MockServer mMockServer;
public TestNetworkClient() {
Configuration config = new Configuration.Builder().build();
mExtensionRegistry = ExtensionRegistryLite.newInstance();
mExtensionRegistry.add(FeedRequest.feedRequest);
// TODO(aluo): Add ability to delay responses.
mResponseDelay = 0L;
mMockServer = MockServer.getDefaultInstance();
}
/**
* Set stored protobuf responses from the filePath
*
* @param filePath The file path of the compiled MockServer proto, pass in null to use the
* default response.
*/
@VisibleForTesting
public void setNetworkResponseFile(String filePath) throws IOException {
if (filePath == null) {
setResponseData(null);
} else {
FileInputStream fs = new FileInputStream(filePath);
setResponseData(fs);
fs.close();
}
}
/** Set stored protobuf responses from the InputStream
*
* @param fs A {@link InputStream} with response pb data.
* Pass in null to clear.
*/
public void setResponseData(InputStream fs) throws IOException {
if (fs == null) {
mMockServer = MockServer.getDefaultInstance();
} else {
mMockServer = MockServer.parseFrom(fs);
}
}
@Override
public void send(HttpRequest httpRequest, Consumer<HttpResponse> responseConsumer) {
// TODO(aluo): Add ability to respond with HTTP Errors.
try {
Request request = getRequest(httpRequest);
ByteString requestToken =
(request.getExtension(FeedRequest.feedRequest).getFeedQuery().hasPageToken())
? request.getExtension(FeedRequest.feedRequest).getFeedQuery().getPageToken()
: null;
if (requestToken != null) {
for (ConditionalResponse response : mMockServer.getConditionalResponsesList()) {
if (!response.hasContinuationToken()) {
Logger.w(TAG, "Conditional response without a token");
continue;
}
if (requestToken.equals(response.getContinuationToken())) {
delayedAccept(createHttpResponse(response.getResponse()), responseConsumer);
return;
}
}
delayedAccept(createHttpResponse(Response.getDefaultInstance()),
responseConsumer);
} else {
delayedAccept(createHttpResponse(mMockServer.getInitialResponse()),
responseConsumer);
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private void delayedAccept(HttpResponse httpResponse, Consumer<HttpResponse> responseConsumer) {
if (mResponseDelay <= 0) {
maybeAccept(httpResponse, responseConsumer);
} else {
PostTask.postDelayedTask(UiThreadTaskTraits.DEFAULT,
() -> maybeAccept(httpResponse, responseConsumer), mResponseDelay);
}
}
private Request getRequest(HttpRequest httpRequest) throws IOException {
byte[] rawRequest = new byte[0];
if (httpRequest.getMethod().equals(HttpMethod.GET)) {
if (httpRequest.getUri().getQueryParameter(RequestHelper.MOTHERSHIP_PARAM_PAYLOAD)
!= null) {
rawRequest = Base64.decode(httpRequest.getUri().getQueryParameter(
RequestHelper.MOTHERSHIP_PARAM_PAYLOAD),
Base64.URL_SAFE);
}
} else {
rawRequest = httpRequest.getBody();
}
return Request.parseFrom(rawRequest, mExtensionRegistry);
}
@Override
public void close() {
mAlreadyClosed.set(true);
}
private HttpResponse createHttpResponse(Response response) {
try {
byte[] rawResponse = response.toByteArray();
byte[] newResponse = new byte[rawResponse.length + (Integer.SIZE / 8)];
CodedOutputStream codedOutputStream = CodedOutputStream.newInstance(newResponse);
codedOutputStream.writeUInt32NoTag(rawResponse.length);
codedOutputStream.writeRawBytes(rawResponse);
codedOutputStream.flush();
return new HttpResponse(200, newResponse);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
private void maybeAccept(HttpResponse httpResponse, Consumer<HttpResponse> responseConsumer) {
if (!mAlreadyClosed.get()) {
responseConsumer.accept(httpResponse);
}
}
}
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
7d69f6bf7fe9be79b5e7a9aba2ea8a4923118251 | 882e77219bce59ae57cbad7e9606507b34eebfcf | /mi2s_securitycenter_miui12/src/main/java/androidx/appcompat/widget/C0089b.java | e0b63dcb78e087d2bf2ff702f49954b3e443d8de | [] | no_license | CrackerCat/XiaomiFramework | 17a12c1752296fa1a52f61b83ecf165f328f4523 | 0b7952df317dac02ebd1feea7507afb789cef2e3 | refs/heads/master | 2022-06-12T03:30:33.285593 | 2020-05-06T11:30:54 | 2020-05-06T11:30:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,944 | java | package androidx.appcompat.widget;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
/* renamed from: androidx.appcompat.widget.b reason: case insensitive filesystem */
class C0089b extends Drawable {
/* renamed from: a reason: collision with root package name */
final ActionBarContainer f585a;
public C0089b(ActionBarContainer actionBarContainer) {
this.f585a = actionBarContainer;
}
public void draw(Canvas canvas) {
ActionBarContainer actionBarContainer = this.f585a;
if (actionBarContainer.h) {
Drawable drawable = actionBarContainer.g;
if (drawable != null) {
drawable.draw(canvas);
return;
}
return;
}
Drawable drawable2 = actionBarContainer.e;
if (drawable2 != null) {
drawable2.draw(canvas);
}
ActionBarContainer actionBarContainer2 = this.f585a;
Drawable drawable3 = actionBarContainer2.f;
if (drawable3 != null && actionBarContainer2.i) {
drawable3.draw(canvas);
}
}
public int getOpacity() {
return 0;
}
@RequiresApi(21)
public void getOutline(@NonNull Outline outline) {
Drawable drawable;
ActionBarContainer actionBarContainer = this.f585a;
if (actionBarContainer.h) {
drawable = actionBarContainer.g;
if (drawable == null) {
return;
}
} else {
drawable = actionBarContainer.e;
if (drawable == null) {
return;
}
}
drawable.getOutline(outline);
}
public void setAlpha(int i) {
}
public void setColorFilter(ColorFilter colorFilter) {
}
}
| [
"sanbo.xyz@gmail.com"
] | sanbo.xyz@gmail.com |
1637e2e82e8bafa684830eb185f2e6776889fec9 | 6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386 | /google/cloud/securitycenter/v1p1beta1/google-cloud-securitycenter-v1p1beta1-java/proto-google-cloud-securitycenter-v1p1beta1-java/src/main/java/com/google/cloud/securitycenter/v1p1beta1/RunAssetDiscoveryRequestOrBuilder.java | 8d9b673f25800b86d1818edd60fe8f5fc2c1aa5c | [
"Apache-2.0"
] | permissive | oltoco/googleapis-gen | bf40cfad61b4217aca07068bd4922a86e3bbd2d5 | 00ca50bdde80906d6f62314ef4f7630b8cdb6e15 | refs/heads/master | 2023-07-17T22:11:47.848185 | 2021-08-29T20:39:47 | 2021-08-29T20:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 1,125 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/securitycenter/v1p1beta1/securitycenter_service.proto
package com.google.cloud.securitycenter.v1p1beta1;
public interface RunAssetDiscoveryRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.cloud.securitycenter.v1p1beta1.RunAssetDiscoveryRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Required. Name of the organization to run asset discovery for. Its format is
* "organizations/[organization_id]".
* </pre>
*
* <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The parent.
*/
java.lang.String getParent();
/**
* <pre>
* Required. Name of the organization to run asset discovery for. Its format is
* "organizations/[organization_id]".
* </pre>
*
* <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for parent.
*/
com.google.protobuf.ByteString
getParentBytes();
}
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
845cc976354bca0c46bb25ee28e7a4da6a5390d4 | d77964aa24cfdca837fc13bf424c1d0dce9c70b9 | /spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteExportConfiguration.java | 81c521da080d4aa208c49052df65e26da37ed0f1 | [] | no_license | Suryakanta97/Springboot-Project | 005b230c7ebcd2278125c7b731a01edf4354da07 | 50f29dcd6cea0c2bc6501a5d9b2c56edc6932d62 | refs/heads/master | 2023-01-09T16:38:01.679446 | 2018-02-04T01:22:03 | 2018-02-04T01:22:03 | 119,914,501 | 0 | 1 | null | 2022-12-27T14:52:20 | 2018-02-02T01:21:45 | Java | UTF-8 | Java | false | false | 2,361 | java | /*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.metrics.export.graphite;
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.util.HierarchicalNameMapper;
import io.micrometer.graphite.GraphiteConfig;
import io.micrometer.graphite.GraphiteMeterRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Configuration for exporting metrics to Graphite.
*
* @author Jon Schneider
* @since 2.0.0
*/
@Configuration
@ConditionalOnClass(GraphiteMeterRegistry.class)
@EnableConfigurationProperties(GraphiteProperties.class)
public class GraphiteExportConfiguration {
@Bean
@ConditionalOnMissingBean
public GraphiteConfig graphiteConfig(GraphiteProperties graphiteProperties) {
return new GraphitePropertiesConfigAdapter(graphiteProperties);
}
@Bean
@ConditionalOnProperty(value = "management.metrics.export.graphite.enabled", matchIfMissing = true)
public GraphiteMeterRegistry graphiteMeterRegistry(GraphiteConfig graphiteConfig,
HierarchicalNameMapper nameMapper, Clock clock) {
return new GraphiteMeterRegistry(graphiteConfig, clock, nameMapper);
}
@Bean
@ConditionalOnMissingBean
public HierarchicalNameMapper hierarchicalNameMapper() {
return HierarchicalNameMapper.DEFAULT;
}
}
| [
"suryakanta97@github.com"
] | suryakanta97@github.com |
800c3db48245c4d285bb67713a3273efa062f356 | a20c68564d240b25db27676d676e43cc5124607d | /actions/commons/PageFactoryManager.java | 225b04b4661a74e563f064320898fa88efbd6cd7 | [] | no_license | TranPhuocHai/POM_BANKGURU_09_HAITP | 3f0f0db7c9838580aa72ce81dc65392b61ed2836 | 563e35ae89d668985eed4bffc497cd4f99e21381 | refs/heads/master | 2020-05-16T15:45:48.561479 | 2019-07-30T07:59:54 | 2019-07-30T07:59:54 | 183,140,412 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,081 | java | package commons;
import org.openqa.selenium.WebDriver;
import PageObjects.BackEndAdminPageObject;
import PageObjects.BackEndLoginPageObject;
import PageObjects.BalanceEnquiryPageObject;
import PageObjects.CatalogSearchPageObject;
import PageObjects.ChangePasswordPageObject;
import PageObjects.CheckOutPageObject;
import PageObjects.CompareProductPageObject;
import PageObjects.CustomisedStatementPageObject;
import PageObjects.DeleteAccountPageObject;
import PageObjects.DeleteCustomerPageObject;
import PageObjects.DepositPageObject;
import PageObjects.EditAccountPageObject;
import PageObjects.EditCustomerPageObject;
import PageObjects.FundTransferPageObject;
import PageObjects.HomePageObject;
import PageObjects.LiveGuruHomePageObject;
import PageObjects.LiveGuruRegisterPageObject;
import PageObjects.LoginPageObject;
import PageObjects.MiniStatementPageObject;
import PageObjects.MobilePageObject;
import PageObjects.MyAccountPageObject;
import PageObjects.NewAccountPageObject;
import PageObjects.NewCustomerPageObject;
import PageObjects.ProductReviewPageObject;
import PageObjects.RegisterPageObject;
import PageObjects.ShoppingCartPageObject;
import PageObjects.TVPageObject;
import PageObjects.UploadPageObject;
import PageObjects.WithdrawalPageObject;
public class PageFactoryManager {
public static HomePageObject getHomePage(WebDriver driver) {
return new HomePageObject(driver);
}
public static RegisterPageObject getRegisterPage(WebDriver driver) {
return new RegisterPageObject(driver);
}
public static LoginPageObject getLoginPage(WebDriver driver) {
return new LoginPageObject(driver);
}
public static NewCustomerPageObject getNewCustomerPage(WebDriver driver) {
return new NewCustomerPageObject(driver);
}
public static EditCustomerPageObject getEditCustomerPage(WebDriver driver) {
return new EditCustomerPageObject(driver);
}
public static DeleteCustomerPageObject getDeleteCustomerPage(WebDriver driver) {
return new DeleteCustomerPageObject(driver);
}
public static NewAccountPageObject getNewAccountPage(WebDriver driver) {
return new NewAccountPageObject(driver);
}
public static EditAccountPageObject getEditAccountPage(WebDriver driver) {
return new EditAccountPageObject(driver);
}
public static DeleteAccountPageObject getDeleteAccountPage(WebDriver driver) {
return new DeleteAccountPageObject(driver);
}
public static DepositPageObject getDepositPage(WebDriver driver) {
return new DepositPageObject(driver);
}
public static WithdrawalPageObject getWithdrawalPage(WebDriver driver) {
return new WithdrawalPageObject(driver);
}
public static FundTransferPageObject getFundTransferPage(WebDriver driver) {
return new FundTransferPageObject(driver);
}
public static ChangePasswordPageObject getChangePasswordPage(WebDriver driver) {
return new ChangePasswordPageObject(driver);
}
public static BalanceEnquiryPageObject getBalanceEnquiryPage(WebDriver driver) {
return new BalanceEnquiryPageObject(driver);
}
public static MiniStatementPageObject getMiniStatementPage(WebDriver driver) {
return new MiniStatementPageObject(driver);
}
public static CustomisedStatementPageObject getCustomisedStatementPage(WebDriver driver) {
return new CustomisedStatementPageObject(driver);
}
public static LiveGuruHomePageObject getLiveGuruHomePage(WebDriver driver) {
return new LiveGuruHomePageObject(driver);
}
public static LiveGuruRegisterPageObject getLiveGuruRegisterPage(WebDriver driver) {
return new LiveGuruRegisterPageObject(driver);
}
public static MyAccountPageObject getMyAccountPage(WebDriver driver) {
return new MyAccountPageObject(driver);
}
public static MobilePageObject getMobilePage(WebDriver driver) {
return new MobilePageObject(driver);
}
public static TVPageObject getTVPage(WebDriver driver) {
return new TVPageObject(driver);
}
public static ShoppingCartPageObject getShoppingCartPage(WebDriver driver) {
return new ShoppingCartPageObject(driver);
}
public static CompareProductPageObject getCompareProductPage(WebDriver driver) {
return new CompareProductPageObject(driver);
}
public static CheckOutPageObject getCheckOutPage(WebDriver driver) {
return new CheckOutPageObject(driver);
}
public static CatalogSearchPageObject getCatalogSearchPage(WebDriver driver) {
return new CatalogSearchPageObject(driver);
}
public static BackEndLoginPageObject getBackEndLoginPage(WebDriver driver) {
return new BackEndLoginPageObject(driver);
}
public static BackEndAdminPageObject getBackEndAdminPage(WebDriver driver) {
return new BackEndAdminPageObject(driver);
}
public static ProductReviewPageObject getProductReviewPage(WebDriver driver) {
return new ProductReviewPageObject(driver);
}
public static UploadPageObject getUploadPage(WebDriver driver) {
return new UploadPageObject(driver);
}
}
| [
"hai.gsd@gmail.com"
] | hai.gsd@gmail.com |
6238130bed63dff6d00e816fc75478a3f21bc416 | 46acf4fd1fa0a40da839b6f59c02c00b80d942ed | /app/src/main/java/edu/ou/cs/moccad_new/SettingsActivity.java | d382695499aa6e5728eec4c2fb745875ce063ad4 | [] | no_license | gaurakshay/Moccad_new | 21fcd9761c4f2608f188c8a812a299d516ad0ba0 | 86ebe0dabd9bd9e74a080da766bbda2db9617842 | refs/heads/master | 2021-01-10T11:17:56.746292 | 2016-05-05T18:56:48 | 2016-05-05T18:56:48 | 53,246,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,156 | java | package edu.ou.cs.moccad_new;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.media.Ringtone;
import android.media.RingtoneManager;
import android.media.audiofx.BassBoost;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
import android.support.v7.app.ActionBar;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.preference.RingtonePreference;
import android.text.TextUtils;
import android.view.MenuItem;
import android.widget.EditText;
import java.util.List;
import java.util.Set;
import edu.ou.cs.cacheprototypelibrary.connection.DataAccessProvider;
public class SettingsActivity extends Activity
{
/**
* A preference value change listener that updates the preference's summary
* to reflect its new value.
*/
//public static final String PREFERENCES_FILE_NAME = "preferences.xml";
public static final String KEY_PREF_MAX_QUERY_CACHE_SIZE = "pref_max_query_cache_size";
public static final String KEY_PREF_IMPORTANT_PARAMETER = "pref_important_parameter";
public static final String KEY_PREF_TIME_CONSTRAINT = "pref_time_contraint";
public static final String KEY_PREF_MONEY_CONSTRAINT = "pref_money_contraint";
public static final String KEY_PREF_ENERGY_CONSTRAINT = "pref_energy_contraint";
public static final String KEY_PREF_MAX_MOBILE_ESTIMATION_CACHE_SIZE = "pref_max_mobile_estimation_cache_size";
public static final String KEY_PREF_MAX_CLOUD_ESTIMATION_CACHE_SIZE = "pref_max_cloud_estimation_cache_size";
public static final String KEY_PREF_MAX_QUERY_CACHE_NUMBER_SEGMENT = "pref_max_query_cache_number_segment";
public static final String KEY_PREF_MAX_MOBILE_ESTIMATION_CACHE_NUMBER_SEGMENT = "pref_max_mobile_estimation_cache_number_segment";
public static final String KEY_PREF_MAX_CLOUD_ESTIMATION_CACHE_NUMBER_SEGMENT = "pref_max_cloud_estimation_cache_number_segment";
public static final String KEY_PREF_DATA_ACCESS_PROVIDER = "pref_data_access_provider";
public static final String KEY_PREF_CACHE_TYPE = "pref_cache_type";
public static final String KEY_PREF_IP_ADDRESS = "pref_ip_address";
public static final String KEY_PREF_PORT = "pref_port";
public static final String KEY_PREF_NB_QUERIES_TO_PROCESS = "pref_nb_queries_to_process";
public static final String KEY_PREF_USE_REPLACEMENT = "pref_use_replacement";
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingsFragment())
.commit();
}
} | [
"Ryan Kiel"
] | Ryan Kiel |
73395fc5170a7ed9688023bb25e8bbd75423b0a1 | 634365ff72a12dfe6ad400f58ec91b842cb1b876 | /src/test/java/com/example/tronalddump/TronalddumpApplicationTests.java | 4b5bdaeb10bebde1bb9c3e304b319f8424df0c40 | [] | no_license | tobiasbaechle/tronalddump | 662d4455bae7b4d3dfaf79f01bc0d8c3f7b32eac | d925b0bd4f85980093955da21f3b536a06986e09 | refs/heads/master | 2023-03-22T01:07:57.296700 | 2021-03-15T09:28:36 | 2021-03-15T09:28:36 | 347,908,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package com.example.tronalddump;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class TronalddumpApplicationTests {
@Test
void contextLoads() {
}
}
| [
"tobiasbachle@gmail.com"
] | tobiasbachle@gmail.com |
c957e3c8d85ed4a5f70b01e2ef8666c481ec54c1 | 2a3adbd1a8cba3434263381997206fa86593cca4 | /spring-rediscache/src/main/java/org/springframework/rediscache/util/DevUtils.java | 073bf9a9333eb12c63e21c59c7ee126b6102298f | [] | no_license | narci2010/toceansoft-base | e4590bd190e281d785bc01f5c40840f40f58fdc0 | 1b5e439e788a13d7a097a0aae92f78c194d9fc46 | refs/heads/master | 2022-09-11T15:03:29.800126 | 2019-06-04T09:54:40 | 2019-06-04T09:54:40 | 183,211,461 | 0 | 0 | null | 2022-09-01T23:05:50 | 2019-04-24T11:04:36 | JavaScript | UTF-8 | Java | false | false | 6,158 | java | package org.springframework.rediscache.util;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.rediscache.vo.Lisence;
import org.springframework.rediscache.vo.Permission;
import com.toceansoft.common.CommonUtils;
import com.toceansoft.common.PropertiesUtils;
import com.toceansoft.common.json.JsonUtil;
import com.toceansoft.common.utils.HttpClientTool;
import com.toceansoft.common.validator.Judge;
public final class DevUtils {
private DevUtils() {
}
// dev
public static void autoRegister() {
// Map<String, String> m = YamlUtils.load();
// String url = m.get("spring.dev.validate.server");
String url = PropertiesUtils.getProperty("validate.server", null);
if (StringUtils.isEmpty(url)) {
url = "http://devos.toceansoft.com";
}
Permission permission = LisenceUtils.getPermission();
Map<String, String> params = new HashMap<String, String>();
params.put("privatekey", permission.getPrivateKey());
params.put("privatekey2", permission.getPrivateKey2());
params.put("publickey", permission.getPublicKey());
params.put("publickey2", permission.getPublicKey2());
params.put("systemuid", permission.getSystemUid());
if (permission.getTimes() >= 1) {
url += "/sys/syslisence/registerAgain";
} else {
url += "/sys/syslisence/register";
}
// System.out.println("url:" + url);
try {
String signKey = HttpClientTool.doPostForRestEntity(url, params);
// System.out.println("signKey:" + signKey);
Map map = JsonUtil.json2Bean(signKey, Map.class);
String granted = null;
int dueDays = 0;
if (map != null) {
signKey = (String) map.get("msg");
granted = (String) map.get("granted");
if (permission.getTimes() > 0) {
if (!Judge.isNull(map.get("dueDays"))) {
dueDays = (int) map.get("dueDays");
}
}
// System.out.println("signKey:" + signKey);
}
// 完成自动注册
if (permission.getTimes() == 0 || "true".equals(granted)) {
// 开发环境,第一次可以自动注册成功,有效期1个月,其后需要授权
LisenceUtils.writeSignKey(signKey);
if (dueDays > 0) {
Lisence lisence = ObjectUtils.readLisence();
lisence.setDays(dueDays);
ObjectUtils.writeLisence(lisence);
}
}
} catch (IOException e) {
// System.out.println("auto register fail...");
// e.printStackTrace();
}
}
// prod
public static void applyRegister() {
// Map<String, String> m = YamlUtils.load();
// String url = m.get("spring.prod.validate.server");
String url = "http://devos.toceansoft.com";
if (!StringUtils.isEmpty(url)) {
url += "/sys/syslisence/apply";
// System.out.println("url:" + url);
Permission permission = LisenceUtils.getPermission();
Map<String, String> params = new HashMap<String, String>();
params.put("privatekey", permission.getPrivateKey());
params.put("privatekey2", permission.getPrivateKey2());
params.put("publickey", permission.getPublicKey());
params.put("publickey2", permission.getPublicKey2());
params.put("systemuid", permission.getSystemUid());
try {
String signKey = HttpClientTool.doPostForRestEntity(url, params);
Map map = JsonUtil.json2Bean(signKey, Map.class);
String granted = null;
int dueDays = 0;
if (map != null) {
signKey = (String) map.get("msg");
granted = (String) map.get("granted");
if (permission.getTimes() > 0) {
if (!Judge.isNull(map.get("dueDays"))) {
dueDays = (int) map.get("dueDays");
}
}
// System.out.println("signKey:" + signKey + " granted:" + granted);
}
// 完成自动注册
if ("true".equals(granted)) {
// 拓胜已经授权了
LisenceUtils.writeSignKey(signKey);
if (dueDays > 0) {
Lisence lisence = ObjectUtils.readLisence();
lisence.setDays(dueDays);
ObjectUtils.writeLisence(lisence);
}
}
} catch (IOException e) {
// System.out.println("apply register fail...");
}
}
}
public static void fillAppNameAndUrls(String appName, String serverUrl) {
// System.out.println("good000000000000000...");
String url = PropertiesUtils.getProperty("validate.server", null);
if (Judge.isBlank(url) || !CommonUtils.isWindowsOrMac()) {
// 没设置配置,或者非开发环境
url = "http://devos.toceansoft.com";
}
try {
String appServerUrl = URLEncoder.encode(serverUrl, "UTF-8");
// System.out.println("appServerUrl:" + appServerUrl);
Lisence lisence = ObjectUtils.readLisence();
if (lisence != null && !lisence.isFill()) {
// System.out.println("good...");
Map<String, String> params = new HashMap<String, String>();
params.put("none", "none");
String appNameMsg = "";
String appServerUrlMsg = "";
if (!Judge.isBlank(appName)) {
lisence.setAppName(appName);
String targetUrl = url + "/sys/syslisence/systemname/" + appName;
// System.out.println("targetUrl:" + targetUrl);
String result = HttpClientTool.doPutForRestEntity(targetUrl, params);
Map map = JsonUtil.json2Bean(result, Map.class);
if (map != null) {
appNameMsg = (String) map.get("msg");
}
// System.out.println("result:" + result);
}
if (!Judge.isBlank(appServerUrl)) {
lisence.setAppServerUrl(Base64.encodeBase64String((appServerUrl.getBytes("UTF-8"))));
String targetUrl = url + "/sys/syslisence/systemurl/" + lisence.getAppServerUrl();
// System.out.println("targetUrl:" + targetUrl);
String result = HttpClientTool.doPutForRestEntity(targetUrl, params);
Map map = JsonUtil.json2Bean(result, Map.class);
if (map != null) {
appServerUrlMsg = (String) map.get("msg");
}
// System.out.println("result:" + result);
}
if ("success".equals(appNameMsg) && "success".equals(appServerUrlMsg)) {
lisence.setFill(true);
}
ObjectUtils.writeLisence(lisence);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
autoRegister();
}
}
| [
"narci.ltc@toceansoft.com"
] | narci.ltc@toceansoft.com |
989fcb1f0ea6b3db6f7ef69554cc22bcee06174f | dc48fe7ec53a80256bbe2d5e56af4b9d6f2e521c | /src/main/java/commentSystem/AddComment.java | bb79157b0b774c98317c651878478f66001ac8f1 | [] | no_license | jcjolley/Karbon | 389e553e09eb99bdb49c5c8f8a6b4bfc064ddee8 | 73195ba2688f1301850efb5691384a5292f3214f | refs/heads/master | 2021-01-23T13:59:45.961866 | 2015-04-06T21:04:27 | 2015-04-06T21:04:27 | 31,485,327 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,820 | 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 commentSystem;
import java.io.IOException;
import java.time.LocalDateTime;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author jolley
*/
@WebServlet(name = "AddComment", urlPatterns = {"/AddComment"})
public class AddComment extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String username = (String)request.getSession().getAttribute("username");
String commentContent = request.getParameter("newComment");
int postId = Integer.parseInt(request.getParameter("postId"));
Comment comment = new Comment(commentContent, username, LocalDateTime.now());
DB.insertComment(postId, comment);
request.getRequestDispatcher("Forum").forward(request, response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"jolleyboy@gmail.com"
] | jolleyboy@gmail.com |
c841fb89974ec5bd95c86be7745617d5bd89d9ea | f1cb02057956e12c352a8df4ad935d56cb2426d5 | /LeetCode/186. Reverse Words in a String II/Solution.java | 2693e79e35d8d26ce2ec72c683738ae2c82750a9 | [] | no_license | nhatsmrt/AlgorithmPractice | 191a6d816d98342d723e2ab740e9a7ac7beac4ac | f27ba208b97ed2d92b4c059848cc60f6b90ce75e | refs/heads/master | 2023-06-10T18:28:45.876046 | 2023-05-26T07:46:42 | 2023-05-26T07:47:10 | 147,932,664 | 15 | 2 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | class Solution {
public void reverseWords(char[] s) {
if (s.length > 0) {
// Reverse the entire string
reverse(s, 0, s.length - 1);
int start = 0;
int end = 0;
// Find and reverse each word
while (start < s.length) {
while(end < s.length && s[end] != ' ')
end += 1;
reverse(s, start, end - 1);
start = end + 1;
end = start;
}
}
}
private void reverse(char[] s, int start, int end) {
int mid = (start + end) / 2;
for (int i = start; i <= mid; i++) {
char tmp = s[i];
s[i] = s[end - i + start];
s[end - i + start] = tmp;
}
}
}
| [
"nhatsmrt@uw.edu"
] | nhatsmrt@uw.edu |
3fd6fc376b790ce20072740d96c56332c7e70d8f | 92b5914f4b06707969ff89d871ff487bccf4d4d7 | /Helloworld.java | ed0a2218474ca4d2a77b2517709f3fdab9ef05f6 | [] | no_license | sharadpaudel220/30hrs-java-bootcamp | d6759aed284f4fd3f8ad3b6783a0197b89a84341 | bdce9f84790a76e5fe1834c0c168936eb9726f06 | refs/heads/master | 2020-11-25T17:46:11.021988 | 2019-12-20T06:06:52 | 2019-12-20T06:06:52 | 228,777,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | public class Helloworld
{
public static void main (String[] args)
{
String x = "Hello, World";
System.out.println(x.charAt(0));
System.out.println(x.charAt(1));
System.out.println(x.charAt(2));
System.out.println(x.charAt(3));
System.out.println(x.charAt(4));
System.out.println(x.charAt(5));
System.out.println(x.charAt(6));
System.out.println(x.charAt(7));
System.out.println(x.charAt(8));
System.out.println(x.charAt(9));
System.out.println(x.charAt(10));
System.out.println(x.charAt(11));
}
} | [
"sharadpaudel220@gmail.com"
] | sharadpaudel220@gmail.com |
8bbfb532cd267c25cc82eed579d1778ad7633483 | 3fa987ab79523ac6fe83d36a4c7bb249261a4744 | /src/main/java/com/fun/common/utils/app/gen/FreemarkerTool.java | de3e800abd7a4a1813db860ec25f6ff294410426 | [
"MIT"
] | permissive | mrdjun/funboot-redis | 5cab95094908feae60fb06e78325316b75c4bd36 | 88c86b09f8d6874e5658bcca562c4b94c247a690 | refs/heads/master | 2022-12-29T22:43:48.875337 | 2020-10-21T02:01:24 | 2020-10-21T02:01:24 | 305,880,950 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,137 | java | package com.fun.common.utils.app.gen;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Map;
/**
*
* @author DJun
* @date 2019/8/10 23:32
*/
@Component
public class FreemarkerTool {
@Autowired
private Configuration configuration;
/**
* process Template Into String
*
*/
public String processTemplateIntoString(Template template, Object model)
throws IOException, TemplateException {
StringWriter result = new StringWriter();
template.process(model, result);
return result.toString();
}
/**
* process String
*/
public String processString(String templateName, Map<String, Object> params)
throws IOException, TemplateException {
Template template = configuration.getTemplate(templateName);
return processTemplateIntoString(template, params);
}
}
| [
"mr.djun@qq.com"
] | mr.djun@qq.com |
2492f68c9b688b740c8b92a71b52bd501d914424 | 17bfe5bf23d259b93359a1aad48cb064f34bf670 | /engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/util/DefaultJBIHeaderFilterStrategy.java | 39b8eb604193cf8656d1ede7dc6fb301da4a0128 | [
"Apache-2.0"
] | permissive | apache/servicemix-components | 732fff76977a3f026ea85cc99e70fa5b1a0889f1 | 6bf1e46e7e173275a17571ab28c6174ff26f0651 | refs/heads/trunk | 2023-08-28T17:39:33.860650 | 2014-04-09T17:51:21 | 2014-04-09T17:51:21 | 1,167,439 | 4 | 17 | null | 2023-09-12T13:54:34 | 2010-12-14T08:00:08 | Java | UTF-8 | Java | false | false | 1,542 | 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.servicemix.camel.util;
import org.apache.camel.Exchange;
import org.apache.camel.spi.HeaderFilterStrategy;
public class DefaultJBIHeaderFilterStrategy implements HeaderFilterStrategy {
public boolean applyFilterToCamelHeaders(String s, Object o, Exchange exchange) {
return doApplyFilter(s);
}
public boolean applyFilterToExternalHeaders(String s, Object o, Exchange exchange) {
return doApplyFilter(s);
}
// Here we should filter the jbi message headers which should be not be exposed to Camel
private boolean doApplyFilter(String header) {
if (header.startsWith("javax.jbi.")) {
return true;
} else {
return false;
}
}
}
| [
"ningjiang@apache.org"
] | ningjiang@apache.org |
3ad755c7362f8f62444c3bc6bf337d67d665b38f | 80fbf34fda464fecb8191a10ba012fd6bc948d63 | /src/main/io/loupas/dailyprogrammer/easy/n340/RecurringCharacter.java | ceec68c609a10dce33f473139dfdd0ff414d7925 | [] | no_license | MattLoupas/dailyprogrammer | 97285f4bc088903f642b752667655dcc593a3eef | 6bf11783f01406a033f31171e5bd131bd5b30d93 | refs/heads/master | 2021-08-19T06:43:15.022740 | 2017-11-25T01:33:21 | 2017-11-25T01:33:21 | 111,885,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 709 | java | package io.loupas.dailyprogrammer.easy.n340;
import java.util.HashMap;
public class RecurringCharacter {
public Character character;
public int index;
public static RecurringCharacter getRecurringCharacter(String input){
return new RecurringCharacter(input);
}
public RecurringCharacter(String input){
this.findRecurringCharacter(input);
}
private void findRecurringCharacter(String input){
HashMap<Character, Integer> map = new HashMap<Character, Integer>();
int index = 0;
for(char c:input.toCharArray()){
if(map.containsKey(c)){
this.character = c;
this.index = map.get(c);
return;
} else {
map.put(c, index++);
}
}
}
}
| [
"Matt Loupas"
] | Matt Loupas |
f1d5caeab6f772119bf2b30d8fec91b0d72bd2c6 | 313ee9fa75c70d2850ada92d0f1e9820cf538e40 | /src/main/java/me/nuymakstone/plugin/PlayerRecord.java | bec94c72d0ddbb88da4ea96f65857abbba963fc3 | [] | no_license | NuymakStone/ReachFix | 853a1d1adedcba3fd8d90f79f53a23328253e4ba | 072a82650b34a6af5a976eae4713b7d56a269ced | refs/heads/main | 2023-07-26T04:49:42.236892 | 2021-09-12T01:52:22 | 2021-09-12T01:52:22 | 405,521,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | package me.nuymakstone.plugin;
public class PlayerRecord {
// Default reach for a player record
public float playerReach = 1.5f;
// Reach below configured max?
public boolean isReachNormal() {
return playerReach < Main.Config.maxReach;
}
// Offense counter for plugin
public float offenses = 0;
// All offenses that ever happened
public int allOffenses = 0;
// Called by event handler, records the reach of a hit
public void recordReach(float reach) {
// Not a small-distance hit
if(reach > 1) {
playerReach += reach; // Add reach
playerReach /= 2; // Average between this reach and the reach recorded before
if(!isReachNormal()) {
offenses++; // Add offense if reach is too much
allOffenses++;
return;
}
}
offenses -= 0.2;
// If reach is normal and achievable,
// remove one fifth of a offense, so after 5 normal hits,
// a strange hit is normalized again.
// No negative offenses
if(offenses < 0)
offenses = 0;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
b4ab588b9f7364b6898468948d3b6ca1733c90e1 | 82580b4cad202baff028c2a746528c37c7ee479d | /rest-api/spring-rest/src/main/java/uk/gov/gchq/gaffer/rest/controller/IOperationController.java | 11eac6be6f1afbc95c9a520828926d80360a922a | [
"Apache-2.0",
"LicenseRef-scancode-proprietary-license"
] | permissive | tornado12345/Gaffer | c03c94584958da2cb954d6a927a51e3cd2a0e320 | 7203c46b54938d8323c853828058fb958d7f8832 | refs/heads/master | 2022-03-16T03:32:35.538139 | 2021-12-08T19:04:48 | 2021-12-08T19:04:48 | 73,566,253 | 0 | 0 | Apache-2.0 | 2020-11-29T23:22:49 | 2016-11-12T17:03:53 | Java | UTF-8 | Java | false | false | 3,875 | java | /*
* Copyright 2020 Crown Copyright
*
* 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 uk.gov.gchq.gaffer.rest.controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
import uk.gov.gchq.gaffer.operation.Operation;
import uk.gov.gchq.gaffer.rest.model.OperationDetail;
import java.util.Set;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.MediaType.TEXT_PLAIN_VALUE;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
@RequestMapping("/graph/operations")
public interface IOperationController {
@RequestMapping(
method = GET,
path = "",
produces = APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Retrieves a list of supported operations",
response = Class.class,
responseContainer = "Set"
)
Set<Class<? extends Operation>> getOperations();
@RequestMapping(
method = GET,
path = "/details",
produces = APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Returns the details of every operation supported by the store",
response = OperationDetail.class,
responseContainer = "Set"
)
Set<OperationDetail> getAllOperationDetails();
@RequestMapping(
method = GET,
value = "{className}",
produces = APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Gets details about the specified operation class",
response = OperationDetail.class
)
OperationDetail getOperationDetails(final String className);
@RequestMapping(
method = GET,
value = "{className}/next",
produces = APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Gets the operations that can be chained after a given operation",
response = Operation.class,
responseContainer = "Set"
)
Set<Class<? extends Operation>> getNextOperations(final String className);
@RequestMapping(
method = GET,
value = "{className}/example",
produces = APPLICATION_JSON_VALUE
)
@ApiOperation(
value = "Gets an example of an operation class",
response = Operation.class
)
Operation getOperationExample(final String className);
@RequestMapping(
method = POST,
path = "/execute",
consumes = APPLICATION_JSON_VALUE,
produces = { TEXT_PLAIN_VALUE, APPLICATION_JSON_VALUE }
)
@ApiOperation("Executes an operation against a Store")
ResponseEntity<Object> execute(final Operation operation);
@RequestMapping(
method = POST,
path = "/execute/chunked",
consumes = APPLICATION_JSON_VALUE,
produces = { TEXT_PLAIN_VALUE, APPLICATION_JSON_VALUE }
)
@ApiOperation("Executes an operation against a Store, returning a chunked output")
ResponseEntity<StreamingResponseBody> executeChunked(final Operation operation);
}
| [
"noreply@github.com"
] | noreply@github.com |
db4a5574be7b4067c5f3161ed5733f361493ce25 | 3ad5adc8f1b8263ee4cbd49a7eb65032b8cf93d7 | /src/syms/Type.java | d66ce852b331409b70e3804a25df3b67aff4290d | [] | no_license | kirstenwinterau/PL0_TLA_Parser | ad83c600a8acefe127e9582c0a52b3e712a6d425 | aadb37e2ddb3367e43d341c8d297433f6e374953 | refs/heads/master | 2021-01-22T22:13:16.518509 | 2017-03-20T01:00:32 | 2017-03-20T01:00:32 | 85,519,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 33,516 | java | package syms;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import source.ErrorHandler;
import source.Errors;
import source.Position;
import tree.ConstExp;
import tree.DeclNode;
import tree.ExpNode;
/** This class provides the type structures defining the types
* available in the language.
* @version $Revision: 22 $ $Date: 2014-05-20 15:14:36 +1000 (Tue, 20 May 2014) $
* It provides subclasses for each of the different kinds of "type",
* e.g., scalar types, subranges, products of types, function types,
* intersections of types, reference types, and the procedure types.
* IdRefType is provided to allow type names to be used as types.
*
* As well as the constructors for the types it provides a number of
* access methods.
* Each type provides a method for coercing an expression to the type.
* Type also provides the special type ERROR_TYPE,
* which is used for handling type errors.
*/
public abstract class Type
{
/** Track whether type has been resolved */
protected boolean resolved;
/** Error handler */
protected Errors errors = ErrorHandler.getErrorHandler();
/** Only subclasses provide public constructors. */
private Type( boolean resolved ) {
this.resolved = resolved;
}
private Type( int n ) {
this( false );
}
/** If something is of type ErrorType an error message for it will already
* have been issued and hence to avoid generating spurious error messages
* ERROR_TYPE is compatible with everything.
*/
public static final Type ERROR_TYPE = new Type( true ) {
@Override
protected ExpNode coerce( ExpNode exp ) {
return exp;
}
@Override
public String toString() {
return "ERROR_TYPE";
}
};
@Override
public String toString() {
return " resolved " + resolved;
}
/** Resolve identifier references anywhere within type.
* Default just sets resolved true; it needs to be overridden
* when appropriate.
* @param pos - position for error messages (in overriding methods)
*/
public Type resolveType( Position pos ) {
resolved = true;
return this;
}
/** The coercion procedures will throw an IncompatibleTypes exception
* if the expression being coerced can't be coerced to the given type.
*/
public static class IncompatibleTypes extends Exception {
private static final long serialVersionUID = 1L;
Position pos;
/** Constructor.
* @param msg error message to be reported
* @param pos position of the expression for error reporting
*/
public IncompatibleTypes( String msg, Position pos ) {
super( msg );
this.pos = pos;
}
public Position getPosition() {
return pos;
}
}
/** Coerce an expression to this type and report error if incompatible
* @param exp is the expression to be coerced
* @returns the coerced expression or ErrorNode on failure
*/
public ExpNode coerceExp( ExpNode exp ) {
/** Try coercing the expression. */
try {
return this.coerceToType( exp );
} catch( IncompatibleTypes e ) {
/** At this point the coercion has failed. */
errors.error( e.getMessage(), e.getPosition() );
return new ExpNode.ErrorNode( e.getPosition() );
}
}
/** Coerce exp to this type or throw IncompatibleTypes exception if can't
* @param exp expression to be coerced
* @return coerced expression
* @throws IncompatibleTypes if cannot coerce
*/
public ExpNode coerceToType( ExpNode exp )
throws IncompatibleTypes {
ExpNode newExp = exp;
if(exp.getType() instanceof Type.NullType) {
exp.setType(this);
return exp;
}else if (exp.getType() instanceof Type.ReferenceType) {
Type.ReferenceType ref = (Type.ReferenceType) exp.getType();
if (ref.getBaseType() instanceof Type.NullType) {
exp.setType(this);
return exp;
}
}
/** Unless this type is a reference type, optionally dereference
* the expression to get its base type.
*/
if( !(this instanceof ReferenceType) ) {
newExp = optDereference( newExp );
}
/** If the type of the expression is this type or ERROR_TYPE,
* we are done.
*/
Type fromType = newExp.getType();
if( this.equals( fromType ) || fromType == ERROR_TYPE ) {
return newExp;
}
/** Try coercing the expression. Dynamic dispatch on the desired
* type is used to control the coercion process.
*/
return this.coerce( newExp );
}
/** Coerce an expression node passed as a parameter to be of this type.
* This default version is just checking they are the same type.
* Subclasses of Type override this method.
* @param exp expression to be coerced
* @return resulting coerced expression node.
* @throws IncompatibleTypes exception if it can't coerce.
*/
protected ExpNode coerce( ExpNode exp ) throws IncompatibleTypes {
Type fromType = exp.getType();
if( this.equals( fromType ) ) {
return exp;
}
throw new IncompatibleTypes(
"cannot treat " + fromType + " as " + this,
exp.getPosition() );
}
/** Type equality. Overridden for most subclasses.
* @param other - type to be compared with this. */
public boolean equals( Type other ) {
return this == other;
}
/** If ScalarType then cast to ScalarType and return
* else return null. Overridden in ScalarType. */
public ScalarType getScalarType() {
return null;
}
/** Scalar types are simple unstructured types that just have a range of
* possible values. int and boolean are scalar types */
public static class ScalarType extends Type {
/** lower and upper bounds of scalar type */
protected int lower, upper;
public ScalarType( int lower, int upper ) {
super( true );
this.lower = lower;
this.upper = upper;
}
/** Constructor when bounds evaluated later */
public ScalarType( int size ) {
super( size );
}
/** The least element of the type */
public int getLower() {
return lower;
}
protected void setLower( int lower ) {
this.lower = lower;
}
/** The greatest element of the type */
public int getUpper() {
return upper;
}
protected void setUpper( int upper ) {
this.upper = upper;
}
@Override
public ScalarType getScalarType() {
return this;
}
/** Coerce expression to this Scalar type.
* The objective is to create an expression of the this scalar type
* from exp.
* @param exp expression to be coerced
* @throws IncompatibleTypes exception if it is not possible to coerce
* exp to this scalar type
*/
@Override
protected ExpNode coerce( ExpNode exp ) throws IncompatibleTypes {
Type fromType = exp.getType();
if( fromType instanceof SubrangeType ) {
/** This code implements Rule Widen subrange.
* If the types don't match, the only other possible type
* for the expression which can be coerced to this scalar type
* is a subrange type, provided its base type matches
* this type. If that is the case we insert a WidenSubrangeNode
* of this type with the expression as a subtree.
*/
Type baseType = ((SubrangeType)fromType).getBaseType();
if( this.equals( baseType ) ) {
return new ExpNode.WidenSubrangeNode( exp.getPosition(),
this, exp );
}
} else if (fromType instanceof GenericType) {
/**
* Allow all operations on generic types
*/
return exp;
}
/** Otherwise we report the failure to coerce the expression via
* an IncompatibleTypes exception.
*/
throw new IncompatibleTypes( "can't coerce " + exp.getType() +
" to " + this, exp.getPosition() );
}
}
/** If SubrangeType then cast to SubrangeType and return
* else return null. Overridden in SubrangeType. */
public SubrangeType getSubrangeType() {
return null;
}
/** If this is a subrange type widen it to its base type.
* Overridden in SubrangeType. */
public Type optWidenSubrange() {
return this;
}
/** Types defined as a subrange of a scalar type. */
public static class SubrangeType extends ScalarType {
/** The base type of the subrange type */
private Type baseType;
/** Constant expression trees for lower and upper bounds
* before evaluation */
private ConstExp lowerExp, upperExp;
public SubrangeType( ConstExp lowerExp, ConstExp upperExp ) {
/** On a byte addressed machine, the size could be scaled to
* just fit the subrange, e.g., a subrange of 0..255
* might only require 1 byte.
*/
super( 0 );
this.lowerExp = lowerExp;
this.upperExp = upperExp;
}
public Type getBaseType() {
return baseType;
}
@Override
public SubrangeType getSubrangeType() {
return this;
}
@Override
public Type optWidenSubrange() {
return baseType;
}
/** Coerce expression to this subrange type
* The objective is to create an expression of the this subrange type
* from exp.
* @param exp expression to be coerced
* @throws IncompatibleTypes exception if it is not possible to coerce
* exp to this subrange type
*/
@Override
protected ExpNode coerce( ExpNode exp ) throws IncompatibleTypes {
/** This implements Rule Narrow subrange in the static semantics.
* If the types don't match, we can try coercing the expression
* to the base type of this subrange, and then narrow that
* to this type. If the coercion to the base type fails it will
* generate an exception, which is allowed to pass up to the caller.
*/
ExpNode coerceExp = getBaseType().coerceToType( exp );
/** If we get here, coerceExp is of the same type as the base
* type of this subrange type. We just need to narrow it
* down to this subrange.
*/
return new ExpNode.NarrowSubrangeNode( coerceExp.getPosition(),
this, coerceExp );
}
/** Resolving a subrange type requires the lower and upper bound
* expressions to be evaluated.
*/
@Override
public Type resolveType( Position pos ) {
if( !resolved ) {
lower = lowerExp.getValue();
upper = upperExp.getValue();
if( upper < lower ) {
errors.error( "Upper bound of subrange less than lower bound", pos );
}
baseType = upperExp.getType();
if( !upperExp.getType().equals(lowerExp.getType())) {
errors.error( "Types of bounds of subrange should match", pos );
baseType = ERROR_TYPE;
}
resolved = true;
}
return this;
}
/** A subrange type is equal to another subrange type only if they have
* the same base type and lower and upper bounds.
*/
@Override
public boolean equals( Type other ) {
if( other instanceof SubrangeType ) {
SubrangeType otherSubrange = (SubrangeType)other;
return baseType.equals( otherSubrange.getBaseType() ) &&
lower == otherSubrange.getLower() &&
upper == otherSubrange.getUpper();
} else {
return false;
}
}
@Override
public String toString() {
return (baseType == null ? "<undefined>" : baseType.toString()) +
"[" + lower + ".." + upper + "]";
}
}
/** Product types represent the product of a sequence of types */
public static class ProductType extends Type {
/** List of types in the product */
private List<Type> types;
private ProductType() {
super( 0 );
types = new LinkedList<Type>();
}
/** Constructor when list of types available */
public ProductType( List<Type> types ) {
super( 0 );
this.types = types;
}
/** Constructor allowing individual types to be specified */
public ProductType( Type... typeArray ) {
this( Arrays.asList( typeArray ) );
}
public List<Type> getTypes() {
return types;
}
/** Resolve identifier references anywhere within type */
@Override
public ProductType resolveType( Position pos ) {
if( ! resolved ) {
/* Build a list of resolved types */
List<Type> resolvedTypes = new LinkedList<Type>();
for( Type t : types ) {
resolvedTypes.add( t.resolveType( pos ) );
}
types = resolvedTypes;
resolved = true;
}
return this;
}
/** Two product types are equal only if each element of the list
* of types for one is equal to the corresponding element of the
* list of types for the other.
*/
@Override
public boolean equals( Type other ) {
if( other instanceof ProductType ) {
List<Type> otherTypes = ((ProductType)other).getTypes();
if( types.size() == otherTypes.size() ) {
Iterator<Type> iterateOther = otherTypes.iterator();
for( Type t : types ) {
Type otherType = iterateOther.next();
if( ! t.equals( otherType ) ) {
return false;
}
}
/* If we reach here then every type in the product has
* matched the corresponding type in the other product
*/
return true;
}
}
return false;
}
/** Coerce expression to this product type.
* @param exp should be an ArgumentsNode with a list of
* expressions of the same length as this product type
* @throws IncompatibleTypes exception if it is not possible to coerce
* exp to this product type
*/
@Override
protected ExpNode.ArgumentsNode coerce( ExpNode exp )
throws IncompatibleTypes {
/** If exp is not an ArgumentsNode consisting of a list of
* expressions of the same length as this product type,
* then exp can't be coerced to this product type and
* we raise an exception.
*/
if( exp instanceof ExpNode.ArgumentsNode) {
ExpNode.ArgumentsNode args = (ExpNode.ArgumentsNode)exp;
if( this.getTypes().size() == args.getArgs().size() ) {
/** If exp is an ArgumentNode of the same size as this
* product type, we coerce each expression in the list
* of arguments, to the corresponding type in the product,
* accumulating a new (coerced) list of expressions as we
* go. If any of the argument expressions can't be
* coerced, an exception will be raised, which we allow
* the caller to handle because the failure to coerce any
* expression in the list of arguments, corresponds to a
* failure to coerce the whole arguments node.
*/
ListIterator<ExpNode> iterateArgs =
args.getArgs().listIterator();
List<ExpNode> newArgs = new LinkedList<ExpNode>();
for( Type t : this.getTypes() ) {
ExpNode subExp = iterateArgs.next();
/** Type incompatibilities detected in the
* coercion will generate an exception,
* which we allow to pass back up to the next level
*/
newArgs.add( t.coerceToType( subExp ) );
}
/** If we get here, all expressions in the list have been
* successfully coerced to the corresponding type in the
* product, and the coerced list of expressions newArgs
* will be of type toProductType. We return an
* ArgumentsNode of this product type, with newArgs as
* its list of expressions.
*/
return new ExpNode.ArgumentsNode( this, newArgs );
} else {
throw new IncompatibleTypes(
"length mismatch in coercion to ProductType",
exp.getPosition() );
}
} else {
throw new IncompatibleTypes(
"Arguments node expected for coercion to ProductType",
exp.getPosition() );
}
}
@Override
public String toString() {
String result = "(";
String sep = "";
for( Type t: types ) {
result += sep + t;
sep = "*";
}
return result + ")";
}
}
/** Function types represent a function from an argument type
* to a result type.
*/
public static class FunctionType extends Type {
/** Type of the argument to the function */
private Type argType;
/** Type of the result of the function */
private Type resultType;
public FunctionType( Type arg, Type result ) {
super( 0 );
this.argType = arg;
this.resultType = result;
}
public Type getArgType() {
return argType;
}
public Type getResultType() {
return resultType;
}
/** Resolve identifier references anywhere within type */
@Override
public FunctionType resolveType( Position pos ) {
if( ! resolved ) {
argType = argType.resolveType( pos );
resultType = resultType.resolveType( pos );
resolved = true;
}
return this;
}
/** Two function types are equal only if their argument and result
* types are equal.
*/
@Override
public boolean equals( Type other ) {
if( other instanceof FunctionType ) {
FunctionType otherFunction = (FunctionType)other;
return getArgType().equals(otherFunction.getArgType()) &&
getResultType().equals(otherFunction.getResultType());
}
return false;
}
@Override
public String toString() {
return "(" + argType + "->" + resultType + ")";
}
}
/** Intersection types represent the intersection of a set of types.
* They can be used as the types of overloaded operators.
* For example "=" has two types to allow two integers to be compared
* and two booleans to be compared. */
public static class IntersectionType extends Type {
/** List of possible types */
private List<Type> types;
/** @param typeArray - list of types in the intersection
* @requires the types in typeArray are distinct */
public IntersectionType( Type... typeArray ) {
super( 0 );
types = new ArrayList<Type>();
for( Type t : typeArray ) {
types.add( t );
}
}
public List<Type> getTypes() {
return types;
}
/** Add a type to the list of types, but if it is a IntersectionType
* flatten it and add each type in the intersection.
*/
public void addType( Type t ) {
if( t instanceof IntersectionType ) {
types.addAll( ((IntersectionType)t).getTypes() );
} else {
types.add( t );
}
}
/** Resolve identifier references anywhere within type */
@Override
public IntersectionType resolveType( Position pos ) {
if( !resolved ) {
/* Build a list of resolved types */
List<Type> resolvedTypes = new LinkedList<Type>();
for( Type t : types ) {
resolvedTypes.add( t.resolveType( pos ) );
}
types = resolvedTypes;
resolved = true;
}
return this;
}
/* Two intersection types are equal if they contain the same sets of
* types.
* @param other - type to be compared with this
* @requires the lists in each intersection type have distinct elements
*/
@Override
public boolean equals( Type other ) {
if( other instanceof IntersectionType ) {
List<Type> otherTypes = ((IntersectionType)other).getTypes();
if( types.size() == otherTypes.size() ) {
for( Type t : types ) {
if( ! otherTypes.contains( t ) ) {
return false;
}
}
/** If we reach here then all types in this intersection
* are also contained in the other intersection, and hence
* the two intersections are equivalent.
*/
return true;
}
}
return false;
}
/** An ExpNode can be coerced to a IntersectionType if it can be
* coerced to one of the types of the intersection.
* @throws IncompatibleTypes exception if it is not possible to
* coerce exp to any type within the intersection
*/
@Override
protected ExpNode coerce( ExpNode exp ) throws IncompatibleTypes {
/** We iterate through all the types in the intersection, trying
* to coerce the exp to each, until one succeeds and we return
* that coerced expression. If a coercion to a type in the
* intersection fails it will throw an exception, which is caught.
* Once caught we ignore the exception, and allow the for loop to
* try the next type in the intersection.
*/
for( Type toType : this.getTypes() ) {
try {
return toType.coerceToType( exp );
} catch( IncompatibleTypes ex ) {
// allow "for" loop to try the next alternative
}
}
/** If we get here, we were unable to to coerce exp to any one of
* the types in the intersection, and hence we can't coerce exp to
* the intersection type.
*/
throw new IncompatibleTypes( "none of types match",
exp.getPosition() );
}
@Override
public String toString() {
String s = "(";
String sep = "";
for( Type t : types ) {
s += sep + t;
sep = " & ";
}
return s + ")";
}
}
/** Type for a procedure. */
public static class ProcedureType extends Type {
public ProcedureType() {
// size of type allows for the procedure to be a parameter
super(0);
}
@Override
public ProcedureType resolveType( Position pos ) {
return this;
}
@Override
public String toString() {
String s = "PROCEDURE";
return s;
}
}
/** Type for a type identifier. Used until the type identifier can
* be resolved.
*/
public static class IdRefType extends Type {
/** Name of the referenced type */
private String name;
/** Symbol table scope at the point of definition of the type
* reference. Used when resolving the reference. */
private Scope scope;
/** Position of use of type identifier */
Position pos;
/** Resolved real type, or ERROR_TYPE if can't be resolved. */
private Type realType;
/** Status of resolution of reference. */
private enum Status{ Unresolved, Resolving, Resolved }
private Status status;
public IdRefType( String name, Scope scope, Position pos ) {
super( 0 );
this.name = name;
this.scope = scope;
this.pos = pos;
this.status = Status.Unresolved;
}
public String getName() {
return name;
}
/** Resolve the type identifier and return the real type. */
@Override
public Type resolveType( Position pos ) {
// System.out.println( "Resolving " + name );
switch( status ) {
case Unresolved:
status = Status.Resolving;
realType = ERROR_TYPE;
SymEntry entry = scope.lookup( name );
if( entry != null && entry instanceof SymEntry.TypeEntry ) {
/* resolve identifiers in the referenced type */
entry.resolve();
/* if status of this entry has resolved then there was a
* circular reference and we leave the realType as
* ERROR_TYPE to avoid other parts of the compiler getting
* into infinite loops chasing types.
*/
if( status == Status.Resolving ) {
realType = entry.getType();
}
assert realType != null;
} else {
errors.error( "Undefined type: " + name, pos );
}
status = Status.Resolved;
break;
case Resolving:
errors.error( name + " is circularly defined", pos );
/* Will resolve to ERROR_TYPE */
status = Status.Resolved;
break;
case Resolved:
/* Already resolved */
break;
}
return realType;
}
@Override
public String toString() {
return name;
}
}
/** AddressType is the common part of ReferenceType (and PointerType) */
public static class AddressType extends Type {
/** Type of addressed object */
protected Type baseType;
public AddressType( Type baseType ) {
super( false );
this.baseType = baseType;
}
public Type getBaseType() {
return baseType;
}
@Override
public AddressType resolveType( Position pos ) {
if( !resolved ) {
baseType = baseType.resolveType( pos );
resolved = true;
}
return this;
}
@Override
public String toString() {
return super.toString();
}
}
/** This method implements Rule Dereference in the static semantics if
* applicable, otherwise it leaves the expression unchanged.
* Optionally dereference a Reference type expression to get its base type
* If exp is type ReferenceType(T) for some base type T,
* a new DereferenceNode of type T is created with exp as a subtree
* and returned, otherwise exp is returned unchanged.
*/
public static ExpNode optDereference( ExpNode exp ) {
Type fromType = exp.getType();
if( fromType instanceof ReferenceType ) {
/* Dereference is not optional here */
return
new ExpNode.DereferenceNode( fromType.optDereference(), exp );
} else {
return exp;
}
}
/** If this type is a reference type return its base type
* otherwise just return this.
* Default return this - overridden in ReferenceType.
*/
public Type optDereference() {
return this;
}
/** Type used for variables in order to distinguish a variable
* of type ref(int), say, from its value which is of type int.
*/
public static class ReferenceType extends AddressType {
public ReferenceType( Type baseType ) {
super( baseType );
}
/** If this type is a reference type return its base type
* otherwise just return this.
* As this subclass is ReferenceType, must return its base type.
*/
@Override
public Type optDereference() {
return getBaseType();
}
/** Two reference types are equal only if their base types are equal */
@Override
public boolean equals( Type other ) {
return other instanceof ReferenceType &&
((ReferenceType)other).getBaseType().equals(
this.getBaseType() );
}
@Override
public String toString() {
return "ref(" + baseType + ")";
}
}
public static class ObjectType extends Type {
private String name;
//private List<String> variables;
//private List<Type> types;
private DeclNode.VarListNode variables;
public ObjectType( String name, DeclNode.VarListNode variables ) {
super(0);
this.name = name;
this.variables = variables;
}
public String getName() {
return name;
}
public DeclNode.VarListNode getVariables() {
return variables;
}
@Override
public boolean equals( Type other ) {
return other instanceof ObjectType &&
((ObjectType)other).getName().equals(
this.getName() );
}
@Override
public String toString() {
return name;
}
}
public static class GenericType extends Type {
String name;
public GenericType(String name) {
super(0);
this.name = name;
}
public String getName() {
return name;
}
@Override
public String toString() {
return name;
}
@Override
public boolean equals(Object o) {
if(!(o instanceof GenericType)) return false;
GenericType g = (GenericType) o;
return g.getName().equals(name);
}
public ExpNode coerceToType( ExpNode exp ) {
return exp;
}
}
public static class VoidType extends Type {
public VoidType() {
super(0);
}
@Override
public String toString() {
return "VOID";
}
}
public static class NullType extends Type {
public NullType() {
super(0);
}
@Override
public String toString() {
return "NULL";
}
}
public static class LockType extends Type {
public LockType() {
super(0);
}
@Override
public String toString() {
return "LOCK TYPE";
}
}
public static class ListType extends Type {
List<Type> types;
public ListType(List<Type> types) {
super(0);
this.types = types;
}
public List<Type> getTypes() {
return types;
}
@Override
public String toString() {
String result = "";
for(int i=0; i < types.size(); i ++) {
result += types.get(i).toString();
result += " \\X ";
}
if(result.length() > 0) {
result = result.substring(0, result.length() - 4);
}
return result;
}
}
}
| [
"kirsten@itee.uq.edu.au"
] | kirsten@itee.uq.edu.au |
3d5916b4fd703caffaf3ff3c3ffb1a248dcec61e | cc27fa3ddfdf7cc2ed44b7bb6ecb9dc533a971bc | /src/pr1_uebung1/ArithmetischeOperationen.java | 55a20d39d4b190c9b2c3b221cfb0217f45fbd72a | [] | no_license | xpla/pr1_uebung1 | 62d434738069d4b3480f50e8500c55bf89c8daa7 | f7630130364a861f796ec2b06f4ca1301dc19472 | refs/heads/master | 2021-01-13T09:50:30.077513 | 2016-10-05T16:29:29 | 2016-10-05T16:29:29 | 69,898,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package pr1_uebung1;
public class ArithmetischeOperationen {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"chris.k@gmx.at"
] | chris.k@gmx.at |
94ae332dafd2481e89e4dbf94f82142bcb310334 | 2e4f2e09b6600330a1b6f9eece373f7d6279b38f | /JcDay3/src/com/OrderServiceUtil.java | 130f9aa71ae89f4d9399bf950601eb1ea03888df | [] | no_license | saniya052/Java | 1f2142851ba07d57b731deb373e90777c7889832 | ccc2f881460d1e8482fa9fe691ab8c2923c5eabd | refs/heads/master | 2023-07-09T13:35:34.180445 | 2021-08-06T17:13:48 | 2021-08-06T17:13:48 | 393,428,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package com;
public class OrderServiceUtil {
static Order[] order = new Order[3];
static int count = 0;
public static void addOrder(Order o1) {
if(!o1.getCustomerName().equals("Invalid")) {
order[count] = o1;
count++;
}
}
public static Order searchOrder(int orderId) {
for(int i=0 ; i<count ; i++) {
if(order[i].getOrderId() == orderId) {
return order[i];
}
}
return null;
}
public static float findTotal() {
return count;
}
}
| [
"saniyashaikh@host.docker.internal"
] | saniyashaikh@host.docker.internal |
960fe7b54d4ad8ef6f994905c30000bd04ae00c1 | 3cc358e1dbc77e02e08f1b22de52e4812ac00db3 | /Examples/WizTurnBeaconSample/gen/com/wizturn/sample/R.java | 8b0649bd75970a1357ff5acd321f1674d41f3dc0 | [] | no_license | wizTurn/Android-SDK | c67f9e843c499f2aca4f2a73d59dcbbfd179f534 | 255027e8ff5664ab92e45e1d790d25721b8a9c40 | refs/heads/master | 2020-05-27T21:37:26.903256 | 2015-04-07T08:56:44 | 2015-04-07T08:56:44 | 18,165,602 | 10 | 18 | null | null | null | null | UTF-8 | Java | false | false | 12,403 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.wizturn.sample;
public final class R {
public static final class array {
/** for LB2030 or lower
*/
public static final int advertisement_time_interval=0x7f070000;
/** for LB3000 or compatible
*/
public static final int advertisement_time_interval_for_nordic_based=0x7f070001;
public static final int properties=0x7f070004;
/** for LB2030 or lower
*/
public static final int txpower=0x7f070002;
/** for LB3000 or compatible
*/
public static final int txpower_for_nordic_based=0x7f070003;
}
public static final class attr {
}
public static final class color {
public static final int activity_connect_group_delimiter=0x7f040001;
public static final int activity_connect_item_row_delimiter=0x7f040000;
}
public static final class dimen {
public static final int activity_connect_group_delimiter_height=0x7f050003;
public static final int activity_connect_item_row_margin=0x7f050002;
/** Default screen margins, per the Android Design guidelines.
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
*/
public static final int activity_horizontal_margin=0x7f050000;
public static final int activity_vertical_margin=0x7f050001;
}
public static final class drawable {
public static final int arrow=0x7f020000;
public static final int connect_activity_row_background=0x7f020001;
public static final int ibeacon_icon=0x7f020002;
public static final int ic_launcher=0x7f020003;
public static final int main=0x7f020004;
}
public static final class id {
public static final int button_change=0x7f0a0030;
public static final int button_commit=0x7f0a0031;
public static final int button_connect=0x7f0a0047;
public static final int clear=0x7f0a004b;
public static final int connect=0x7f0a0049;
public static final int container=0x7f0a0038;
public static final int delimeter_line1=0x7f0a001b;
public static final int delimeter_line2=0x7f0a001f;
public static final int delimeter_line3=0x7f0a0029;
public static final int delimeter_line4=0x7f0a002c;
public static final int delimeter_line5=0x7f0a0023;
public static final int edittext=0x7f0a0035;
public static final int edittext_uuid1=0x7f0a003c;
public static final int edittext_uuid2=0x7f0a003d;
public static final int edittext_uuid3=0x7f0a003e;
public static final int edittext_uuid4=0x7f0a003f;
public static final int edittext_uuid5=0x7f0a0040;
public static final int image_ibeacon=0x7f0a0048;
public static final int image_next1=0x7f0a0001;
public static final int image_next10=0x7f0a001a;
public static final int image_next2=0x7f0a0006;
public static final int image_next3=0x7f0a0009;
public static final int image_next4=0x7f0a0010;
public static final int image_next5=0x7f0a0013;
public static final int image_next6=0x7f0a001d;
public static final int image_next7=0x7f0a0021;
public static final int image_next8=0x7f0a0025;
public static final int layout_advertisement_time_interval=0x7f0a0012;
public static final int layout_bdname=0x7f0a0019;
public static final int layout_current_time=0x7f0a001c;
public static final int layout_led_mode=0x7f0a0024;
public static final int layout_major=0x7f0a0005;
public static final int layout_manufacturer_name=0x7f0a002a;
public static final int layout_minor=0x7f0a0008;
public static final int layout_model_number=0x7f0a0027;
public static final int layout_password=0x7f0a0018;
public static final int layout_sleep_time=0x7f0a0020;
public static final int layout_txpower=0x7f0a000f;
public static final int layout_uuid=0x7f0a0000;
public static final int listview=0x7f0a002d;
public static final int number_picker=0x7f0a0036;
public static final int password=0x7f0a0034;
public static final int scan=0x7f0a004a;
public static final int spinner=0x7f0a002f;
public static final int swipe_refresh_layout=0x7f0a002e;
public static final int text_battery_level_value=0x7f0a0015;
public static final int text_bd_address=0x7f0a0043;
public static final int text_bd_name=0x7f0a0042;
public static final int text_bdaddress_value=0x7f0a0004;
public static final int text_bdname_value=0x7f0a0003;
public static final int text_current_time_value=0x7f0a001e;
public static final int text_distance_value=0x7f0a000d;
public static final int text_firmware_version_value=0x7f0a0017;
public static final int text_hardware_version_value=0x7f0a0016;
public static final int text_interval_value=0x7f0a0014;
public static final int text_led_mode_value=0x7f0a0026;
public static final int text_major=0x7f0a0044;
public static final int text_major_value=0x7f0a0007;
public static final int text_manufacturer_name_value=0x7f0a002b;
public static final int text_measured_power_value=0x7f0a000c;
public static final int text_minor=0x7f0a0045;
public static final int text_minor_value=0x7f0a000a;
public static final int text_model_number_value=0x7f0a0028;
public static final int text_proximity_value=0x7f0a000e;
public static final int text_rssi=0x7f0a0046;
public static final int text_rssi_value=0x7f0a000b;
public static final int text_sleep_time_value=0x7f0a0022;
public static final int text_txpower_value=0x7f0a0011;
public static final int text_uuid=0x7f0a0041;
public static final int text_uuid_value=0x7f0a0002;
public static final int textview_peripheral_change_list=0x7f0a0032;
public static final int textview_peripheral_info=0x7f0a0033;
public static final int timer_picker=0x7f0a0037;
public static final int timer_picker_endtime=0x7f0a003b;
public static final int timer_picker_starttime=0x7f0a003a;
public static final int toggle_button=0x7f0a0039;
}
public static final class layout {
public static final int activity_connect=0x7f030000;
public static final int activity_connect_nordic=0x7f030001;
public static final int activity_list=0x7f030002;
public static final int activity_main=0x7f030003;
public static final int activity_multiple_change=0x7f030004;
public static final int dialog_authentication=0x7f030005;
public static final int dialog_one_edittext=0x7f030006;
public static final int dialog_one_numberpicker=0x7f030007;
public static final int dialog_one_timepicker=0x7f030008;
public static final int dialog_radio_buttons=0x7f030009;
public static final int dialog_setting_sleeptime=0x7f03000a;
public static final int dialog_setting_uuid=0x7f03000b;
public static final int peripheral_list_row=0x7f03000c;
}
public static final class menu {
public static final int connect_activity_actionbar=0x7f090000;
public static final int main_activity_actionbar=0x7f090001;
}
public static final class string {
public static final int actionbar_clear=0x7f060033;
public static final int actionbar_connected=0x7f060034;
public static final int actionbar_connecting=0x7f060036;
public static final int actionbar_disconnected=0x7f060035;
/** ActionBar Titles
*/
public static final int actionbar_scan=0x7f060031;
public static final int actionbar_stop=0x7f060032;
public static final int app_name=0x7f060000;
public static final int app_version=0x7f060001;
public static final int authentication=0x7f060007;
public static final int battery_level=0x7f060016;
public static final int bd_address=0x7f06000a;
public static final int bd_name=0x7f060009;
public static final int cancel=0x7f060006;
/** Change of multiple properties
*/
public static final int change=0x7f060037;
public static final int commit=0x7f060038;
public static final int connect=0x7f06000e;
public static final int connected=0x7f060013;
public static final int copyright=0x7f060002;
public static final int current_time=0x7f060017;
public static final int disabled=0x7f060028;
public static final int distance=0x7f060010;
public static final int enabled=0x7f060027;
public static final int end_time=0x7f06002a;
public static final int error_ble_not_support=0x7f06002c;
public static final int error_cannot_add_change_action=0x7f060030;
public static final int error_connection_wrong=0x7f06002e;
public static final int error_disconneted=0x7f06002d;
public static final int error_is_not_connected=0x7f06002f;
/** Errors
*/
public static final int error_null_peripheral=0x7f06002b;
public static final int firmware_version=0x7f06001b;
public static final int hardware_version=0x7f06001a;
public static final int interval=0x7f060015;
public static final int led_mode=0x7f060019;
public static final int major=0x7f06000b;
public static final int manufacturer_name=0x7f06001d;
public static final int measured_power=0x7f06000f;
public static final int minor=0x7f06000c;
public static final int model_number=0x7f06001c;
public static final int ok=0x7f060005;
public static final int password=0x7f060012;
public static final int password_guide=0x7f060004;
public static final int proximity=0x7f060011;
public static final int rssi=0x7f06000d;
public static final int sleep_time=0x7f060018;
public static final int start_time=0x7f060029;
public static final int toast_authorization_failure=0x7f060022;
public static final int toast_authorization_success=0x7f060021;
public static final int toast_connected=0x7f060020;
public static final int toast_multiple_property_failure=0x7f060026;
public static final int toast_multiple_property_success=0x7f060025;
public static final int toast_password_change_failure=0x7f060024;
public static final int toast_password_change_success=0x7f060023;
public static final int tx_power=0x7f060014;
public static final int unit_dbm=0x7f06001e;
public static final int unit_distance=0x7f06001f;
public static final int unknown=0x7f060003;
public static final int uuid=0x7f060008;
}
public static final class style {
/**
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
API 11 theme customizations can go here.
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
API 14 theme customizations can go here.
*/
public static final int AppBaseTheme=0x7f080000;
/** Application theme.
All customizations that are NOT specific to a particular API-level can go here.
*/
public static final int AppTheme=0x7f080001;
}
}
| [
"jayjay@diogroup.co.kr"
] | jayjay@diogroup.co.kr |
5356a92c70e6bebea819fe1a5f6f0c2465ce66d5 | 97d534e31537a3781ee63c139d2dcef86743eb86 | /src/main/java/fr/greta/golf/dao/ContactRepository.java | 5cd44f58ff1bf7ab33d62a3aad3cea71ac7e6fdf | [] | no_license | amd1986/golfApp | 35ffedeab0d814e2664b5847c93bb205cfda9a0d | a6bbc26a7ab78c3d698b099735c7cc1a3db3cf8a | refs/heads/master | 2022-11-17T19:19:01.852648 | 2020-07-08T00:17:18 | 2020-07-08T00:17:18 | 256,542,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package fr.greta.golf.dao;
import fr.greta.golf.entities.Contact;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ContactRepository extends JpaRepository<Contact, Long> {
}
| [
"benthaier.ahmed@gmail.com"
] | benthaier.ahmed@gmail.com |
1f05d10424f4617ffdccfc75a500d450560e2a86 | 39ccebcb43bbbb8031e884771203773941840fd5 | /Day 16/FragmentsVideo/app/src/test/java/com/example/fragmentsvideo/ExampleUnitTest.java | c7664ab1873b8fab68cc904d73418d89037d233c | [] | no_license | aton4/HKP-Android-Frontend-Training | 952d412aaabfbdb87a16dfa0a9755e7803b087f1 | b9dc8cb8cca8183fa4e64e6bd87e493e73df62eb | refs/heads/main | 2023-02-10T16:13:38.117911 | 2021-01-12T03:05:19 | 2021-01-12T03:05:19 | 321,842,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.example.fragmentsvideo;
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);
}
} | [
"aton4@uci.edu"
] | aton4@uci.edu |
6b7a3f935d7caab5438e6ff95ae5b721d230dfc1 | 43c880209ca0ab416f4ee10a90adf608863836bd | /src/main/java/vn/ssdc/vnpt/erp/config/JacksonConfig.java | 54f9b7a57a78b4434f161addad50af25d0dc449c | [] | no_license | duyhung10/TheWatchTemp | 20ffa5e2f11096015bac0a01741c3183c2cc721e | 0182d1397a1a302e273666f7c5d7ed2fcd02911e | refs/heads/master | 2020-05-06T12:20:17.305663 | 2019-04-09T12:54:28 | 2019-04-09T12:54:28 | 180,117,564 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | package vn.ssdc.vnpt.erp.config;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.module.afterburner.AfterburnerModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.zalando.problem.ProblemModule;
import org.zalando.problem.validation.ConstraintViolationProblemModule;
@Configuration
public class JacksonConfig {
/*
* Support for Hibernate types in Jackson.
*/
@Bean
public Hibernate5Module hibernate5Module() {
return new Hibernate5Module();
}
/*
* Jackson Afterburner module to speed up serialization/deserialization.
*/
@Bean
public AfterburnerModule afterburnerModule() {
return new AfterburnerModule();
}
/*
* Module for serialization/deserialization of RFC7807 Problem.
*/
@Bean
ProblemModule problemModule() {
return new ProblemModule();
}
/*
* Module for serialization/deserialization of ConstraintViolationProblem.
*/
@Bean
ConstraintViolationProblemModule constraintViolationProblemModule() {
return new ConstraintViolationProblemModule();
}
}
| [
"leduyhung102@gmail.com"
] | leduyhung102@gmail.com |
0c6c377735f0b285459bde7460640621d71e1311 | b2669adde6333660487603f623c0e037adb79293 | /app/src/main/java/com/example/hw01cst438/model/UserDao.java | 4052e4c9a019a85ec4b4ed6a03ebb5734d3fb0cd | [] | no_license | christianJimenez1999/hw01cst438 | cbd38c6f5c15ba7a3ddf49439daabb9c6dc7a459 | 02ed1263aef4660873bc40c104c3539e5f810815 | refs/heads/master | 2022-12-13T20:38:03.314252 | 2020-09-05T00:52:13 | 2020-09-05T00:52:13 | 292,898,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package com.example.hw01cst438.model;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import java.util.List;
@Dao
public interface UserDao {
@Query("select * from User")
List<User> getAllUsers();
@Query("select * from User where username = :username")
List<User> getUserByUsername(String username);
@Query("select * from User where username = :username and password = :password")
List<User> getUserByUsernamePassword(String username, String password);
@Insert
long addUser(User user);
}
| [
"47259794+christianJimenez1999@users.noreply.github.com"
] | 47259794+christianJimenez1999@users.noreply.github.com |
cf42cede9e2701bf70d5dbd91e60d4ff5d33a394 | cca0a6995d267344df25c08ced0ba241f98eacfa | /microservices-platform/siques-admin/core-business/src/main/java/cn/central/service/SysLoggerService.java | 6a46d09ac0b20c72d78f5eb47b231e6a87882fb9 | [] | no_license | xiaowen1993/mango-platform-practice | 2424a20a49674b0eb5dc8f081a5521baa845f105 | f963b666acb54d6459bd82a39e14f607b344fbdb | refs/heads/master | 2023-01-20T00:47:52.622087 | 2020-11-24T16:03:23 | 2020-11-24T16:03:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 512 | java | package cn.central.service;
import cn.central.common.Page.PageRequest;
import cn.central.common.Page.PageResult;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.central.entity.SysLogger;
/**
* <p>
*
* </p>
*
* @package: cn.siques.mangosound.service
* @description:
* @author: Shenghao.He
* @date: Created in 2020-11-18 22:12:02
* @copyright: Copyright (c) 2020
* @version: V1.0
* @modified: Shenghao.He
*/
public interface SysLoggerService extends IService<SysLogger> {
}
| [
"943452349@qq.com"
] | 943452349@qq.com |
f773dc14906edf508081e63ab80dba1522d75190 | db7a4a0419fe485c2cfb12867fb4ff71e816fe1c | /src/main/java/cn/edu/ustb/sem/order/dao/OrderMaterialDao.java | 7793722d74c3264e872a022088672176406ff3aa | [] | no_license | Zjie/704station | 428a3b4a4433db8368fc826993da94cc441c0786 | ff4d9857b47ca52abedd4f4d0cd0d3cba6776e46 | refs/heads/master | 2021-01-25T05:35:13.876412 | 2015-03-14T07:17:26 | 2015-03-14T07:17:26 | 29,426,091 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 263 | java | package cn.edu.ustb.sem.order.dao;
import cn.edu.ustb.sem.core.dao.BaseDao;
import cn.edu.ustb.sem.order.entity.OrderMaterial;
public interface OrderMaterialDao extends BaseDao<OrderMaterial, Long> {
public void deleteOrderMaterial(Integer orderId);
}
| [
"zhoujie_0101@qq.com"
] | zhoujie_0101@qq.com |
b4c554ee6849f7b7b67d8954b0f0da1733509da3 | e1e425d561a8847bc36a0a977cd69f022ec67123 | /app/src/test/java/com/samer/bootcamplocator/ExampleUnitTest.java | bb97c27b664d581963db515cee29ba7236dc3aa4 | [] | no_license | SamerPTUK/BootcampLocatorAndroidApp | 60fe1fe53447f833210d7899b73309cc34556593 | 00ff9c874b4d37eff9be1309d490c9d54d55439d | refs/heads/master | 2021-04-24T19:42:16.736921 | 2018-01-15T11:09:30 | 2018-01-15T11:09:30 | 117,532,912 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.samer.bootcamplocator;
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() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"Administrator@sharepoint.com"
] | Administrator@sharepoint.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.