blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
92a0362d1a12cd44dc37f8fa034f923bf11a16db
54f49b4b529b6de9ae07791cd57cec1e41c199b2
/unit-testing/src/test/java/ro/victor/unittest/bdd/search/entity/WatchlistFilter.java
dfa13c4669e8340a5cd3b926d304ec7ac4fd851c
[ "MIT" ]
permissive
awanishsingh/training
beada905cea6f2317f6f4fcfbd1c895f49f85e31
451775c545ef9e7bdf26f3c4824411f528e5c433
refs/heads/master
2020-06-18T09:03:37.881901
2019-07-01T15:51:26
2019-07-01T15:51:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,016
java
package ro.victor.unittest.bdd.search.entity; import static org.apache.commons.collections.CollectionUtils.containsAny; import java.util.HashSet; import java.util.Set; public class WatchlistFilter { private String filterName; public String getFilterName() { return filterName; } public void setFilterName(String filterName) { this.filterName = filterName; } private Set<RecordCategory> recordCategories = new HashSet<>(); private Set<SanctionType> sanctionTypes = new HashSet<>(); private Set<Description3> descriptions3 = new HashSet<>(); private Set<PEPOccupationCategory> pepOccupationCategories = new HashSet<>(); public WatchlistFilter() { } public WatchlistFilter(WatchlistFilter other) { this.filterName = other.filterName; this.recordCategories = new HashSet<>(other.recordCategories); this.sanctionTypes = new HashSet<>(other.sanctionTypes); this.descriptions3 = new HashSet<>(other.descriptions3); this.pepOccupationCategories = new HashSet<>(other.pepOccupationCategories); } public boolean matches(Record record) { if (isEmpty()) { return true; } Set<Description> recordDescLeaves = computeDescriptionLeaves(record.getCategories(), record.getSanctionTypes(), descriptions3); Set<Description> filterDescLeaves = computeDescriptionLeaves(recordCategories, sanctionTypes, descriptions3); for (Description recordDescription : recordDescLeaves) { if (recordDescription.isOnPEPSubtree() && !pepOccupationCategories.isEmpty() && !containsAny(pepOccupationCategories, record.getPepOccupationCategories())) { continue; } if (containsAny(filterDescLeaves, recordDescription.getMeAndAllAncestors())) { return true; } } return false; } private boolean isEmpty() { return recordCategories.isEmpty() && sanctionTypes.isEmpty() && descriptions3.isEmpty() && pepOccupationCategories.isEmpty(); } private static Set<Description> computeDescriptionLeaves( Set<RecordCategory> categories, Set<SanctionType> sanctionTypes, Set<Description3> descriptions3) { categories = new HashSet<>(categories); sanctionTypes = new HashSet<>(sanctionTypes); Set<Description> leaves = new HashSet<>(); for (Description3 description3 : descriptions3) { leaves.add(description3); sanctionTypes.remove(description3.getSanctionType()); categories.remove(description3.getSanctionType().getRecordCategory()); } for (SanctionType sanctionType : sanctionTypes) { leaves.add(sanctionType); categories.remove(sanctionType.getRecordCategory()); } for (RecordCategory recordCategory : categories) { leaves.add(recordCategory); } return leaves; } public Set<RecordCategory> getRecordCategories() { return recordCategories; } public Set<SanctionType> getSanctionTypes() { return sanctionTypes; } public Set<Description3> getDescriptions3() { return descriptions3; } public Set<PEPOccupationCategory> getPepOccupationCategories() { return pepOccupationCategories; } }
[ "victorrentea@gmail.com" ]
victorrentea@gmail.com
d2e1478970ecb4ba96e539617582e9fa134680f0
6253283b67c01a0d7395e38aeeea65e06f62504b
/decompile/app/HwSystemManager/src/main/java/com/huawei/systemmanager/optimize/process/Predicate/CheckProtectedAppPredicate.java
84400d72a285c85cbb26c639f0b14aa70f2c660f
[]
no_license
sufadi/decompile-hw
2e0457a0a7ade103908a6a41757923a791248215
4c3efd95f3e997b44dd4ceec506de6164192eca3
refs/heads/master
2023-03-15T15:56:03.968086
2017-11-08T03:29:10
2017-11-08T03:29:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,641
java
package com.huawei.systemmanager.optimize.process.Predicate; import android.content.Context; import com.huawei.systemmanager.optimize.process.ProcessAppItem; import com.huawei.systemmanager.optimize.process.SmcsDbHelper; import com.huawei.systemmanager.util.HwLog; import java.util.Collections; import java.util.Map; public class CheckProtectedAppPredicate extends FutureTaskPredicate<Map<String, Boolean>, ProcessAppItem> { private static final String TAG = "CheckProtectedAppPredicate"; private final Context mContext; private final boolean mProtected; public CheckProtectedAppPredicate(Context ctx, boolean checkProtect) { this.mContext = ctx; this.mProtected = checkProtect; } public boolean apply(ProcessAppItem input) { if (input == null) { return false; } Boolean valueOf; Map<String, Boolean> protectMap = (Map) getResult(); if (protectMap == null) { HwLog.e(TAG, getClass().getSimpleName() + " protectMap is null, must be something wrong!"); protectMap = Collections.emptyMap(); } Boolean protect = (Boolean) protectMap.get(input.getPackageName()); if (this.mProtected) { valueOf = Boolean.valueOf(checkProteced(protect, input)); } else { valueOf = checkUnProtected(protect, input); } return valueOf.booleanValue(); } private Object checkUnProtected(Boolean protect, ProcessAppItem input) { if (protect == null) { HwLog.e(TAG, "input.getPackageName() = " + input.getPackageName() + "; should not be killed; protect == null"); return Boolean.valueOf(false); } else if (!protect.booleanValue()) { return Boolean.valueOf(true); } else { HwLog.e(TAG, "input.getPackageName() = " + input.getPackageName() + "; should not be killed; protect"); return Boolean.valueOf(false); } } private boolean checkProteced(Boolean protect, ProcessAppItem input) { if (protect == null) { input.setKeyTask(true); } else { input.setProtect(protect.booleanValue()); input.setKeyTask(false); } return true; } protected Map<String, Boolean> doInbackground() { return SmcsDbHelper.getRecordProtectAppFromDb(this.mContext, null); } public static CheckProtectedAppPredicate create(Context ctx, boolean checkProtect) { CheckProtectedAppPredicate pre = new CheckProtectedAppPredicate(ctx, checkProtect); pre.executeTask(); return pre; } }
[ "liming@droi.com" ]
liming@droi.com
805e53b36c27eccfe4af1eaf3e64192cdf8f8f8f
311f1237e7498e7d1d195af5f4bcd49165afa63a
/sourcedata/camel-camel-1.4.0/components/camel-testng/src/test/java/org/apache/camel/testng/SpringParameterTest.java
e3b3ad7685af1e980dd58c0b526f2a04a56687c4
[ "Apache-2.0", "LicenseRef-scancode-unknown", "LicenseRef-scancode-unknown-license-reference" ]
permissive
DXYyang/SDP
86ee0e9fb7032a0638b8bd825bcf7585bccc8021
6ad0daf242d4062888ceca6d4a1bd4c41fd99b63
refs/heads/master
2023-01-11T02:29:36.328694
2019-11-02T09:38:34
2019-11-02T09:38:34
219,128,146
10
1
Apache-2.0
2023-01-02T21:53:42
2019-11-02T08:54:26
Java
UTF-8
Java
false
false
1,587
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.camel.testng; import java.util.Properties; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; /** * @version $Revision$ */ public class SpringParameterTest extends SpringRunner { @DataProvider(name = "appContextAndProperties") public Object[][] createData() { return new Object[][]{{ "spring.xml", createProperties("foo", "param1") }, { "spring.xml", createProperties("foo", "param2") }}; } @Test(dataProvider = "appContextAndProperties") public void assertApplicationContextStarts(String applicationContextLocations, Properties properties) throws Exception { super.assertApplicationContextStarts(applicationContextLocations, properties); } }
[ "512463514@qq.com" ]
512463514@qq.com
11896dca508cecae7f11497bd2e6963dd5acd313
57edb737df8e9de3822d4f08d0de81f028403209
/spring-core/src/test/java/org/springframework/core/io/support/ResourceArrayPropertyEditorTests.java
e5e58cd28744ad8ba26c7e7e4511b0ee770578d2
[ "Apache-2.0" ]
permissive
haoxianrui/spring-framework
20d904fffe7ddddcd7d78445537f66e0b4cf65f5
e5163351c47feb69483e79fa782eec3e4d8613e8
refs/heads/master
2023-05-25T14:27:18.935575
2020-10-23T01:04:05
2020-10-23T01:04:05
260,652,424
1
1
null
null
null
null
UTF-8
Java
false
false
2,885
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.core.io.support; import java.beans.PropertyEditor; import org.junit.jupiter.api.Test; import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.Resource; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; /** * @author Dave Syer * @author Juergen Hoeller */ class ResourceArrayPropertyEditorTests { @Test void vanillaResource() { PropertyEditor editor = new ResourceArrayPropertyEditor(); editor.setAsText("classpath:org/springframework/core/io/support/ResourceArrayPropertyEditor.class"); Resource[] resources = (Resource[]) editor.getValue(); assertThat(resources).isNotNull(); assertThat(resources[0].exists()).isTrue(); } @Test void patternResource() { // N.B. this will sometimes fail if you use classpath: instead of classpath*:. // The result depends on the classpath - if test-classes are segregated from classes // and they come first on the classpath (like in Maven) then it breaks, if classes // comes first (like in Spring Build) then it is OK. PropertyEditor editor = new ResourceArrayPropertyEditor(); editor.setAsText("classpath*:org/springframework/core/io/support/Resource*Editor.class"); Resource[] resources = (Resource[]) editor.getValue(); assertThat(resources).isNotNull(); assertThat(resources[0].exists()).isTrue(); } @Test void systemPropertyReplacement() { PropertyEditor editor = new ResourceArrayPropertyEditor(); System.setProperty("test.prop", "foo"); try { editor.setAsText("${test.prop}"); Resource[] resources = (Resource[]) editor.getValue(); assertThat(resources[0].getFilename()).isEqualTo("foo"); } finally { System.getProperties().remove("test.prop"); } } @Test void strictSystemPropertyReplacementWithUnresolvablePlaceholder() { PropertyEditor editor = new ResourceArrayPropertyEditor( new PathMatchingResourcePatternResolver(), new StandardEnvironment(), false); System.setProperty("test.prop", "foo"); try { assertThatIllegalArgumentException().isThrownBy(() -> editor.setAsText("${test.prop}-${bar}")); } finally { System.getProperties().remove("test.prop"); } } }
[ "1490493387@qq.com" ]
1490493387@qq.com
27c6b4a9ecac74e53c3c10c581fbf5a85661ce29
864300bb02f4788684d9d7410cc2ba39bb0d1440
/gmall-item/src/main/java/com/atguigu/gmall/item/config/ThreadPoolConfig.java
8be124cdd0dc30469b0f227e6c5a216126496043
[ "Apache-2.0" ]
permissive
joedyli/gmall-0821
ab34b59399aa6b48c3b61510d651a7fc35615ad9
a24eddefa6c4b44df7655c82ecf28cf83a3e1388
refs/heads/main
2023-03-10T06:53:47.807337
2021-03-01T08:13:15
2021-03-01T08:13:15
330,543,115
11
2
null
null
null
null
UTF-8
Java
false
false
876
java
package com.atguigu.gmall.item.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @Configuration public class ThreadPoolConfig { @Bean public ThreadPoolExecutor threadPoolExecutor( @Value("${thread.pool.coreSize}") Integer coreSize, @Value("${thread.pool.maxSize}") Integer maxSize, @Value("${thread.pool.keepAlive}") Integer keepAlive, @Value("${thread.pool.blockingQueueSize}") Integer blockingQueueSize ){ return new ThreadPoolExecutor(coreSize, maxSize, keepAlive, TimeUnit.SECONDS, new ArrayBlockingQueue<>(blockingQueueSize)); } }
[ "joedy23@aliyun.com" ]
joedy23@aliyun.com
050e5e7e9e41c9c15ee8b1cee61d8747b8b58269
b5c4bcf54aeb2bcb4f6d8b389eb5894a35d34e97
/org/glassfish/ha/store/spi/MutableStoreEntry.java
e49908e9f8abfd9ae9ca50fa65c41316941040a1
[]
no_license
mulderbaba/webservices-osgi
d233daf266c12e102a6e7a2b795d8f43c0dbddfb
7090b58bd4cdf5fab4af14d54cb20bb45c074de2
refs/heads/master
2021-06-02T00:34:49.408686
2017-07-27T12:39:42
2017-07-27T12:39:42
98,534,028
2
2
null
2021-02-03T19:27:23
2017-07-27T12:37:43
Java
UTF-8
Java
false
false
3,053
java
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common Development * and Distribution License("CDDL") (collectively, the "License"). You * may not use this file except in compliance with the License. You can * obtain a copy of the License at * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html * or packager/legal/LICENSE.txt. See the License for the specific * language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file at packager/legal/LICENSE.txt. * * GPL Classpath Exception: * Oracle designates this particular file as subject to the "Classpath" * exception as provided by Oracle in the GPL Version 2 section of the License * file that accompanied this code. * * Modifications: * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * "Portions Copyright [year] [name of copyright owner]" * * Contributor(s): * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding "[Contributor] * elects to include this software in this distribution under the [CDDL or GPL * Version 2] license." If you don't indicate a single choice of license, a * recipient has the option to distribute your version of this file under * either the CDDL, the GPL Version 2 or to extend the choice of license to * its licensees as provided above. However, if you add GPL Version 2 code * and therefore, elected the GPL Version 2 license, then the option applies * only if the new code is made subject to such option by the copyright * holder. */ package org.glassfish.ha.store.spi; import java.util.Set; /** * A Storeable is an interface that must be implemented by objects that * are to be presisted in the store. * * @author Mahesh.Kannan@Sun.Com */ public interface MutableStoreEntry extends Storable { /** * Mark the entire store entry as dirty * */ public void _markStoreEntryAsDirty(); /** * The store name for which this Storable was created * * @return The store name */ public void _markAsDirty(int attrIndex); /** * The String that can be used by the store implementation to hash the StoreEntry * * @return A (possibly null) key to be used for hashing purpose */ public void _markAsClean(int attrIndex); /** * Get the version of this entry. A null value means that this entry * * @return The version or null if this entry has no version */ public void _markStoreEntryAsClean(); /** * Set the replicating ownerid */ public void _setOwnerId(String ownerName); }
[ "mert@t2.com.tr" ]
mert@t2.com.tr
c2091f51eecfdbcab699d5b9cd8fff6c9e71c8e3
2aa2fbadfed9264a1ded6f2b30ec96c46a16dcc3
/library/src/main/java/com/kingja/pdfsir/MyViewPager.java
297504d8fc8f3a59f681e709be72423d446f9335
[]
no_license
KingJA/PdfSir
58332676a1990b2c0d99c1eb4dc7b9b7524db0c2
6af9772653da9f40365dd93f611bca41930b9cf8
refs/heads/master
2020-06-21T03:09:06.977683
2019-07-29T09:28:08
2019-07-29T09:28:08
197,326,493
0
0
null
null
null
null
UTF-8
Java
false
false
1,506
java
package com.kingja.pdfsir; import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.view.ViewPager; import android.util.AttributeSet; import android.util.Log; import android.view.GestureDetector; import android.view.MotionEvent; /** * Description:TODO * Create Time:2019/7/29 0029 上午 9:12 * Author:KingJA * Email:kingjavip@gmail.com */ public class MyViewPager extends ViewPager{ private static final String TAG = "MyViewPager"; private GestureDetector mGestureDetector; public MyViewPager(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); mGestureDetector = new GestureDetector(getContext(), new YScrollDetector()); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (mGestureDetector.onTouchEvent(ev)) { Log.e(TAG, "拦截水平滑动: " ); return true; } return super.onInterceptTouchEvent(ev); } class YScrollDetector extends GestureDetector.SimpleOnGestureListener { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { if (Math.abs(distanceY) < Math.abs(distanceX)) { Log.e(TAG, "水平滑动: "); } else { Log.e(TAG, "垂直滑动: "); } return Math.abs(distanceY) < Math.abs(distanceX); } } }
[ "kingjavip@gmail.com" ]
kingjavip@gmail.com
13496c511f179533ef791a2662447c5c57447048
72cbc860070a3b4e323779385f045f63b97d79af
/AndroidStudioProjects/Carbon/samples/src/main/java/tk/zielony/carbonsamples/feature/AnchorActivity.java
a5f65c1ccf28c88ae337fc02ea860b1a96c156e6
[ "Apache-2.0" ]
permissive
clintonyeb/Android-Programs
2a1430ea4d72d56b6bba11e83f9a52073637ff55
3fe0d93470b725d0fc9481ec3839eef0122ed142
refs/heads/master
2021-09-24T09:22:04.718304
2018-06-30T11:42:36
2018-06-30T11:42:36
139,242,808
1
0
null
null
null
null
UTF-8
Java
false
false
400
java
package tk.zielony.carbonsamples.feature; import android.app.Activity; import android.os.Bundle; import tk.zielony.carbonsamples.R; /** * Created by Marcin on 2014-12-15. */ public class AnchorActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_anchor); } }
[ "clintonyeb@gmail.com" ]
clintonyeb@gmail.com
3edd9f8ef2278bb115331f3ddc4fd123fd436292
f0b6271d3c0da2395470f82a5d200f2358cb9fe1
/ActomaV2/ActomaV2/source_mainframe/presenter_mainframe/src/main/java/com/xdja/presenter_mainframe/cmd/VerifyPhoneNumberCommand.java
edd7c56ecbcab55cd2a90b5bfbd7ee1a8d9a346a
[]
no_license
changmu175/myfile
edc3873ec42141169d06160659babf9bcb19ef1e
f35e327d5f210d0c0f1beffb42feeb198f2af6c4
refs/heads/master
2021-01-22T18:33:14.706328
2017-08-19T02:41:43
2017-08-19T02:41:43
100,764,518
1
0
null
null
null
null
UTF-8
Java
false
false
213
java
package com.xdja.presenter_mainframe.cmd; /** * Created by xdja-fanjiandong on 2016/3/23. */ public interface VerifyPhoneNumberCommand extends FillMessageCommand { void getVerifyCode(String phoneNumber); }
[ "569293437@qq.com" ]
569293437@qq.com
1885551a33bf85cac4deccc008e6c0679245e251
243eaf02e124f89a21c5d5afa707db40feda5144
/src/unk/com/tencent/mm/ui/tools/cn.java
246dfa333b0f44f345530401b2560e36f4847329
[]
no_license
laohanmsa/WeChatRE
e6671221ac6237c6565bd1aae02f847718e4ac9d
4b249bce4062e1f338f3e4bbee273b2a88814bf3
refs/heads/master
2020-05-03T08:43:38.647468
2013-05-18T14:04:23
2013-05-18T14:04:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package unk.com.tencent.mm.ui.tools; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import com.tencent.mm.k.y; import com.tencent.mm.model.bd; import com.tencent.mm.z.h; final class cn implements DialogInterface.OnCancelListener { cn(NewTaskUI paramNewTaskUI, h paramh) { } public final void onCancel(DialogInterface paramDialogInterface) { bd.hM().c(this.cVu); } } /* Location: /home/danghvu/0day/WeChat/WeChat_4.5_dex2jar.jar * Qualified Name: com.tencent.mm.ui.tools.cn * JD-Core Version: 0.6.2 */
[ "danghvu@gmail.com" ]
danghvu@gmail.com
8726b38d0b9a57640a69e986055fae15455c9ab8
801ea23bf1e788dee7047584c5c26d99a4d0b2e3
/com/planet_ink/coffee_mud/Items/Basic/DwarfStar.java
0a9d0f1501cc7a67ffec0e0f1f8325b9bf9bb995
[ "Apache-2.0" ]
permissive
Tearstar/CoffeeMud
61136965ccda651ff50d416b6c6af7e9a89f5784
bb1687575f7166fb8418684c45f431411497cef9
refs/heads/master
2021-01-17T20:23:57.161495
2014-10-18T08:03:37
2014-10-18T08:03:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,217
java
package com.planet_ink.coffee_mud.Items.Basic; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2014 Bo Zimmerman 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. */ public class DwarfStar extends GenSpaceBody { @Override public String ID(){ return "DwarfStar";} public DwarfStar() { super(); setName("unknown dwarf star"); setDisplayText("an unknown dwarf star is shining here"); setDescription("it`s somewhat bright"); coordinates=new long[]{Math.round(Long.MAX_VALUE*Math.random()),Math.round(Long.MAX_VALUE*Math.random()),Math.round(Long.MAX_VALUE*Math.random())}; Random random=new Random(System.currentTimeMillis()); radius=SpaceObject.Distance.StarDRadius.dm + (random.nextLong() % Math.round(CMath.mul(SpaceObject.Distance.StarDRadius.dm,0.30))); basePhyStats().setDisposition(PhyStats.IS_LIGHTSOURCE|PhyStats.IS_GLOWING); this.setMaterial(RawMaterial.RESOURCE_HYDROGEN); recoverPhyStats(); } }
[ "bo@zimmers.net" ]
bo@zimmers.net
4807382569ff07ee63091547eb79df015145365f
e26b552cbdae26e099f9f011eb8ed08cfba41315
/bootstrapProject/saludcoop/commons/src/main/java/com/conexia/saludcoop/common/repository/custom/ExtendedUbicacionSedeIpsProveedorInsumoRepository.java
dd5f0dfc72d98908cb72de575f8dc3b08334325a
[]
no_license
maes0186/ABBAPrototipo1
3c9575b66360b1960eec0b63e8c549dbbf6c14a5
2d0de9a18b54ee8a17a2ba10a25a4357a6708cd5
refs/heads/master
2021-01-10T07:44:58.067830
2015-11-08T00:38:39
2015-11-08T00:38:39
45,358,707
0
0
null
null
null
null
UTF-8
Java
false
false
3,801
java
package com.conexia.saludcoop.common.repository.custom; import java.util.List; import com.conexia.saludcoop.common.entity.view.UbicacionSedeIpsProveedorInsumo; /** * Interfaz para lógica personalizada de repositorio de ubicacionSedeIpsProveedorInsumo. * * @author Leoanrdo Cruz */ public interface ExtendedUbicacionSedeIpsProveedorInsumoRepository { /** * Obtiene las sedes de IPS existentes en un municipio, que proveen el insumo. * * @param epsId Identificador de la EPS correspondiente. * @param insumoId Identificador del insumo. * @param sedeIpsExcluidaId Identificador de la sede de IPS a excluir de los resultados (o null si debe evaluar todas). * @param municipioId Identificador del municipio en el cual deben estar las IPS. * @param numeroPagina Número de página de resultados (pagina de a 10 registros automáticamente). Primera página = 0. * @return Lista de sedes de IPS efectoras, con el detalle del contrato correspondiente. */ public List<UbicacionSedeIpsProveedorInsumo> getSedesIpsPorMunicipio(final Long epsId, final Long insumoId, final Long sedeIpsExcluidaId, final Long municipioId, final int numeroPagina); /** * Obtiene las sedes de IPS existentes en una división seccional, que proveen el insumo. * * @param epsId Identificador de la EPS correspondiente. * @param insumoId Identificador del insumo. * @param sedeIpsExcluidaId Identificador de la sede de IPS a excluir de los resultados (o null si debe evaluar todas). * @param divisionesSeccionalesId Lista de ids de divisiones de seccional en las cuales deben estar las IPS. * @param numeroPagina Número de página de resultados (pagina de a 10 registros automáticamente). Primera página = 0. * @return Lista de sedes de IPS efectoras, con el detalle del contrato correspondiente. */ public List<UbicacionSedeIpsProveedorInsumo> getSedesIpsPorDivisionSeccional(final Long epsId, final Long insumoId, final Long sedeIpsExcluidaId, final List<Long> divisionesSeccionalesId, final int numeroPagina); /** * Obtiene las sedes de IPS existentes en una región, que proveen el insumo. * * @param epsId Identificador de la EPS correspondiente. * @param insumoId Identificador del insumo. * @param sedeIpsExcluidaId Identificador de la sede de IPS a excluir de los resultados (o null si debe evaluar todas). * @param regionalesId Lista de ids de regionales en las cuales deben estar las IPS. * @param numeroPagina Número de página de resultados (pagina de a 10 registros automáticamente). Primera página = 0. * @return Lista de sedes de IPS efectoras, con el detalle del contrato correspondiente. */ public List<UbicacionSedeIpsProveedorInsumo> getSedesIpsPorRegional(final Long epsId, final Long insumoId, final Long sedeIpsExcluidaId, final List<Long> regionalesId, final int numeroPagina); /** * Obtiene las sedes de IPS existentes en todo el país, que proveen el insumo. * * @param epsId Identificador de la EPS correspondiente. * @param insumoId Identificador del insumo. * @param sedeIpsExcluidaId Identificador de la sede de IPS a excluir de los resultados (o null si debe evaluar todas). * @param numeroPagina Número de página de resultados (pagina de a 10 registros automáticamente). Primera página = 0. * @return Lista de sedes de IPS efectoras, con el detalle del contrato correspondiente. */ public List<UbicacionSedeIpsProveedorInsumo> getSedesIpsNivelNacional(final Long epsId, final Long insumoId, final Long sedeIpsExcluidaId, final int numeroPagina); }
[ "maes0186@aa3da725-fa38-4a37-849c-0e1cb1b97359" ]
maes0186@aa3da725-fa38-4a37-849c-0e1cb1b97359
00d4ad10b6dea6e7a1a4e7a429021c37c8c32ae8
3fb34330130df319f32c2f74773284a90248dcb9
/src/main/java/com/luckeedv/myapp/security/SecurityUtils.java
8a2c9f4d51a3c87100828b859d11b25d29353eb1
[]
no_license
Artalion/jhipster-sample-application
0329131bfee5ceef4cb3cead08106e9fc829c040
533e1b0a02bcd62dd37e6483f4cf4c20e570a60c
refs/heads/main
2023-03-28T10:49:35.927147
2021-03-24T11:27:04
2021-03-24T11:27:04
350,685,135
0
0
null
2021-03-24T11:27:05
2021-03-23T11:23:15
Java
UTF-8
Java
false
false
3,082
java
package com.luckeedv.myapp.security; import java.util.Optional; import java.util.stream.Stream; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; /** * Utility class for Spring Security. */ public final class SecurityUtils { private SecurityUtils() {} /** * Get the login of the current user. * * @return the login of the current user. */ public static Optional<String> getCurrentUserLogin() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(extractPrincipal(securityContext.getAuthentication())); } private static String extractPrincipal(Authentication authentication) { if (authentication == null) { return null; } else if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } else if (authentication.getPrincipal() instanceof String) { return (String) authentication.getPrincipal(); } return null; } /** * Get the JWT of the current user. * * @return the JWT of the current user. */ public static Optional<String> getCurrentUserJWT() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional .ofNullable(securityContext.getAuthentication()) .filter(authentication -> authentication.getCredentials() instanceof String) .map(authentication -> (String) authentication.getCredentials()); } /** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise. */ public static boolean isAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && getAuthorities(authentication).noneMatch(AuthoritiesConstants.ANONYMOUS::equals); } /** * If the current user has a specific authority (security role). * <p> * The name of this method comes from the {@code isUserInRole()} method in the Servlet API. * * @param authority the authority to check. * @return true if the current user has the authority, false otherwise. */ public static boolean isCurrentUserInRole(String authority) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && getAuthorities(authentication).anyMatch(authority::equals); } private static Stream<String> getAuthorities(Authentication authentication) { return authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
688154a251e2b707c2962a7c5040dd43f5eac237
afbf1b8b95986f0b853bd75b99443b78d2f2ad37
/common/rebelkeithy/mods/metallurgy/machines/crusher/BlockCrusherItem.java
86786d4eb0fa0c9f2f2ed90829bf1599e4a21ab8
[]
no_license
Vexatos/Metallurgy
257c8df0319a908aa82fb5a81694607dd0c5b96a
8f1e4c67749f6d574bad23d4b9792d78e42f287a
refs/heads/master
2021-01-15T21:44:11.689719
2013-09-20T13:05:16
2013-09-20T13:05:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,205
java
package rebelkeithy.mods.metallurgy.machines.crusher; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class BlockCrusherItem extends ItemBlock { public BlockCrusherItem(int i) { super(i); setHasSubtypes(true); } @Override public int getMetadata(int i) { return i; } @Override public String getUnlocalizedName(ItemStack itemstack) { String name = ""; switch(itemstack.getItemDamage()) { case 0: { name = "StoneCrusher"; break; } case 1: { name = "CopperCrusher"; break; } case 2: { name = "BronzeCrusher"; break; } case 3: { name = "IronCrusher"; break; } case 4: { name = "SteelCrusher"; break; } default: name = "brick"; } return getUnlocalizedName() + "." + name; } }
[ "RebelKeithy@gmail.com" ]
RebelKeithy@gmail.com
d080576a00e5beffbc5da01a1bca2b1754dcdc8e
bf67492b496849fa42bb7119dd263211b75584ad
/CN1MLDemos/src/ca/weblite/codename1/cn1ml/demos/MainMenu.java
848352b8bfa8d1f7193546df48bc0612603bc0f9
[ "Apache-2.0" ]
permissive
worlanyo/CN1ML-NetbeansModule
46e9695cec67bb5efe18ac98ae8c9c01be1ec8c4
8c4adc1d4b4894e886d208767eabd003c92d6df3
refs/heads/master
2020-05-04T23:09:58.027685
2014-11-17T20:56:41
2014-11-17T20:56:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,894
java
/* THIS FILE IS AUTOMATICALLY GENERATED-- DO NOT MODIFY IT*/ package ca.weblite.codename1.cn1ml.demos; import com.codename1.ui.*; import com.codename1.ui.layouts.*; import com.codename1.ui.table.*; import com.codename1.ui.util.*; class MainMenu { private Container rootContainer; private Resources resources; public Container getRoot() { if (rootContainer == null) { try { rootContainer = buildUI(); } catch (Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex.getMessage()); } } return rootContainer; } private java.util.Map<String, Component> _nameIndex = new java.util.HashMap<String, Component>(); public Component get(String name) { getRoot(); return _nameIndex.get(name); } private String[] menuItems; public MainMenu(java.util.Map context) { menuItems = (String[]) context.get("menuItems"); for (Object o : context.values()) { if (o instanceof Resources) { resources = (Resources) o; } } } private Container buildUI() throws Exception { Container root = new Container(); BorderLayout rootLayout = new BorderLayout(); root.setLayout(rootLayout); List node1 = new List(); node1.setName("menuList"); _nameIndex.put("menuList", node1); init1_node1(node1, root); if (node1.getClientProperty("__CN1ML_NO_ADD__") == null && root != node1.getParent()) { root.addComponent(BorderLayout.CENTER, node1); } return root; } public List getMenuList() { return (List) get("menuList"); } private void init1_node1(List self, Container parent) { self.setModel(new com.codename1.ui.list.DefaultListModel(menuItems)); } }
[ "steve@weblite.ca" ]
steve@weblite.ca
9503224ce6e52892b61a90b82a1baa788f447879
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-8281-4-29-SPEA2-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/EditAction_ESTest_scaffolding.java
e939ccf5fcc05b76c418b0806da6b0009b0758cb
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
432
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Jan 19 10:12:48 UTC 2020 */ package com.xpn.xwiki.web; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class EditAction_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
c13e0570209fc0e6a28f4223e8c32ad36e55bac0
932480a6fa3d2e04d6fa0901c51ad14b9704430b
/jonix-onix3/src/main/java/com/tectonica/jonix/onix3/CurrencyZone.java
d31a2b15179b517af20462b8ee3a8108ea2841ba
[ "Apache-2.0" ]
permissive
hobbut/jonix
952abda58a3e9817a57ae8232a4a62ab6b3cd50f
0544feb4b1ac8fd7dfd52e34e3f84d46eae5749e
refs/heads/master
2021-01-12T08:22:58.679531
2016-05-22T15:13:53
2016-05-22T15:13:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,045
java
/* * Copyright (C) 2012 Zach Melamed * * Latest version available online at https://github.com/zach-m/jonix * Contact me at zach@tectonica.co.il * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tectonica.jonix.onix3; import java.io.Serializable; import com.tectonica.jonix.JPU; import com.tectonica.jonix.OnixElement; import com.tectonica.jonix.codelist.CurrencyZones; import com.tectonica.jonix.codelist.RecordSourceTypes; /* * NOTE: THIS IS AN AUTO-GENERATED FILE, DON'T EDIT MANUALLY */ /** * <h1>Currency zone</h1> * <p> * An ONIX code identifying a currency zone in which the price stated in an occurrence of the &lt;Price&gt; composite is * applicable. Optional and non-repeating. Deprecated – use Country or Region codes instead. * </p> * <table border='1' cellpadding='3'> * <tr> * <td>Format</td> * <td>Fixed-length, three letters</td> * </tr> * <tr> * <td>Codelist</td> * <td>List 172</td> * </tr> * <tr> * <td>Reference name</td> * <td>&lt;CurrencyZone&gt;</td> * </tr> * <tr> * <td>Short tag</td> * <td>&lt;x475&gt;</td> * </tr> * <tr> * <td>Cardinality</td> * <td>0&#8230;1</td> * </tr> * <tr> * <td>Example</td> * <td>&lt;x475&gt;EUR&lt;/x475&gt; (Eurozone)</td> * </tr> * </table> */ public class CurrencyZone implements OnixElement, Serializable { private static final long serialVersionUID = 1L; public static final String refname = "CurrencyZone"; public static final String shortname = "x475"; // /////////////////////////////////////////////////////////////////////////////// // ATTRIBUTES // /////////////////////////////////////////////////////////////////////////////// /** * (type: dt.DateOrDateTime) */ public String datestamp; public RecordSourceTypes sourcetype; public String sourcename; // /////////////////////////////////////////////////////////////////////////////// // VALUE MEMBER // /////////////////////////////////////////////////////////////////////////////// public CurrencyZones value; // /////////////////////////////////////////////////////////////////////////////// // SERVICES // /////////////////////////////////////////////////////////////////////////////// public CurrencyZone() {} public CurrencyZone(org.w3c.dom.Element element) { datestamp = JPU.getAttribute(element, "datestamp"); sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype")); sourcename = JPU.getAttribute(element, "sourcename"); value = CurrencyZones.byCode(JPU.getContentAsString(element)); } }
[ "zach@tectonica.co.il" ]
zach@tectonica.co.il
9f8d444b82b65ce7f3bb16bcd5ce5cdf5054f232
17a0a0934f604119d0e2267bee263b4a6ff80244
/app/src/main/java/com/innoviussoftwaresolution/tjss/view/activity/CreateGroupChatActivity.java
e314cf85a06db37a143d64d45fba229c3d660db9
[]
no_license
iamRAJASHEKAR/TJSS_fixed
b9473c266fab341917716167e6661b1800f4e28b
e0ae291f8e760c3b549cd8df870a0d98d5db2dae
refs/heads/master
2020-03-24T20:42:19.219014
2018-07-31T09:32:18
2018-07-31T09:32:18
142,992,676
0
0
null
null
null
null
UTF-8
Java
false
false
1,013
java
package com.innoviussoftwaresolution.tjss.view.activity; import android.os.Bundle; import android.support.v4.app.Fragment; import com.bugsnag.android.Bugsnag; import com.innoviussoftwaresolution.tjss.R; import com.innoviussoftwaresolution.tjss.view.fragment.message.FragmentCreateGroupChat; /** * @author Sony Raj on 02-10-17. */ public class CreateGroupChatActivity extends BaseActivityWithToolbar { @Override void onBaseCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_layout); Bugsnag.init(this); // Bugsnag.notify(new RuntimeException("Test error")); Fragment fragment = getSupportFragmentManager() .findFragmentByTag(FragmentCreateGroupChat.TAG); if (fragment == null) fragment = new FragmentCreateGroupChat(); getSupportFragmentManager() .beginTransaction() .replace(R.id.mainContainer, fragment, FragmentCreateGroupChat.TAG) .commit(); } }
[ "rajashekar.reddy1995@gmail.com" ]
rajashekar.reddy1995@gmail.com
410db09ae484463bc15d26f7b19c2b005022e4f2
8efe3abe5ed747a0d2d9e136c11ce42fa8d536f3
/src/org/pentaho/di/cachefile/storage/pageWriter/DataPage.java
f79df97e6e40efb5cda4db2a49008a18599b1635
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jianjunchu/etl_designer_2.0
e07dfb6e630da765fb8198adb875cf850a2c87b1
5ceea8ce7d457fd207f40730aa178cc02db681a8
refs/heads/master
2021-04-03T07:56:15.132047
2018-04-12T08:52:34
2018-04-12T08:52:34
125,075,004
1
1
null
null
null
null
UTF-8
Java
false
false
5,228
java
package org.pentaho.di.cachefile.storage.pageWriter; import org.pentaho.di.cachefile.meta.Meta; import org.pentaho.di.cachefile.meta.RecordMeta; import org.pentaho.di.cachefile.storage.buffer.BufferedPageHeader; import org.pentaho.di.cachefile.util.ByteUtil; /** * Data page. * * * <br>Page layout sketch: * <br> * <br> ------------------------------------------------------------- * <br>|Page header|Record offset|Record offset|.....................| * <br>|.............................................................| * <br>|.............................................................| * <br>|...............................................|Record|Record| * <br> ------------------------------------------------------------- * * * */ public class DataPage implements PageWriterReader { static DataPage dataPage = new DataPage() ; public static DataPage getInstance() { return dataPage ; } /** * Whether the page can keep the new data. * * */ public boolean isFull(BufferedPageHeader bph, Meta valueMeta, Object value) throws Exception { int actualSize = ((RecordMeta)valueMeta).getStoreSize((Object[])value) ; assert(actualSize + BufferedPageHeader.offsetSize <= (bph.pageSize-BufferedPageHeader.pageHeaderSize)) ; if (actualSize + BufferedPageHeader.offsetSize > (bph.pageSize - BufferedPageHeader.pageHeaderSize)) throw new Exception("Too large record!") ; return actualSize + BufferedPageHeader.offsetSize > bph.getByteLeft() ; } @Override public int writeData(BufferedPageHeader bph, Meta valueMeta, Object value) throws Exception { RecordMeta tm = (RecordMeta)valueMeta ; Object[] val = (Object[]) value ; int actualSize = tm.getStoreSize(val) ; int dataOffset = getDataOffset(bph,actualSize) ; int offset = dataOffset ; /* Write data pointer */ writeDataOffset(bph,dataOffset) ; /* Write field value */ for (int i = 0 ; i < tm.num_filed ; i ++) { dataOffset += tm.field_formats[i].writeValue(bph.pageContext, bph.pageStartPosition+dataOffset, val[i]) ; } /* update page header */ bph.updatePhysicalPageHeader(1, actualSize+BufferedPageHeader.offsetSize) ; bph.setDirty() ; return offset; } /** * Get offset, from where the data been written start. * * * */ private int getDataOffset(BufferedPageHeader bph, int dataSize) { int offset = 0 ; int byteLeft = bph.getByteLeft() ; int recordCount = bph.getItemCount() ; offset = BufferedPageHeader.pageHeaderSize + recordCount*BufferedPageHeader.offsetSize+ byteLeft - dataSize ; return offset ; } /** * Get offset of the i'th record, distance from the page start position. * @param bph buffered page header * @param i index of record * * */ public int getRecordOffset(BufferedPageHeader bph, int i) { return ByteUtil.readInt(bph.pageContext, bph.pageStartPosition + BufferedPageHeader.pageHeaderSize + i*BufferedPageHeader.offsetSize) ; } /** * Get filed offset of the i'th field, distance from the record start position. * @param bph buffered page header * @param recordOffset record start position, distance from the page start position * @param fieldIndex field index * * */ public int getFieldOffset(BufferedPageHeader bph, int recordOffset, RecordMeta rm ,int fieldIndex) { int fieldOffset = 0 ; for (int i = 0 ; i < fieldIndex ; i++) { fieldOffset += rm.field_formats[i].getLength(bph.pageContext, recordOffset+fieldOffset); } return fieldOffset ; } private void writeDataOffset(BufferedPageHeader bph, int startPosition) { int recordCount = bph.getItemCount() ; int pointerPosition = bph.pageStartPosition + BufferedPageHeader.pageHeaderSize + recordCount*BufferedPageHeader.offsetSize ; ByteUtil.writeInt(bph.pageContext, pointerPosition, startPosition) ; } /** * Read record from page's byte content. * Return the offset where the reading ends, distance from the page beginning. * @param bph buffer page header * @param offset offset from where the record starts, distance from the page beginning * @param rm record meta * @param value result value objects * * @return offset at where the record ends, distance from the page beginning * * */ public int readData(BufferedPageHeader bph, int offset, RecordMeta rm, Object[] value) throws Exception { for (int i = 0 ; i < rm.num_filed ; i ++) { offset += rm.field_formats[i].readValue(bph.pageContext, bph.pageStartPosition+offset, value, i) ; } return offset ; } }
[ "jianjunchu@gmail.com" ]
jianjunchu@gmail.com
2cf4edd842eb5d231f4127e4801577936fdb97ae
8e2420b451743fc98e8e30abc0819c58574ec123
/gdx-vfx/core/src/com/crashinvaders/vfx/effects/MultipassEffectWrapper.java
619e8e0c68fd57a28d7e2c90c95e269b9cc80471
[ "Apache-2.0" ]
permissive
crashinvaders/gdx-vfx
e1b84ed5f1dbecf882f8a15919e3ce96d3984a7d
4eb33ce00db1701da828c2d70ceb912da9d3f0ea
refs/heads/master
2023-01-08T19:57:07.911083
2022-12-22T23:00:44
2022-12-22T23:00:44
168,205,009
191
26
Apache-2.0
2022-03-08T15:49:53
2019-01-29T18:21:18
Java
UTF-8
Java
false
false
2,238
java
/******************************************************************************* * Copyright 2019 metaphore * * 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.crashinvaders.vfx.effects; import com.crashinvaders.vfx.VfxRenderContext; import com.crashinvaders.vfx.framebuffer.VfxPingPongWrapper; public class MultipassEffectWrapper extends AbstractVfxEffect implements ChainVfxEffect { private final ChainVfxEffect effect; private int passes = 1; public MultipassEffectWrapper(ChainVfxEffect effect) { this.effect = effect; } @Override public void resize(int width, int height) { effect.resize(width, height); } @Override public void update(float delta) { effect.update(delta); } @Override public void rebind() { effect.rebind(); } @Override public void dispose() { effect.dispose(); } @Override public void render(VfxRenderContext context, VfxPingPongWrapper buffers) { // Simply swap buffers to simulate render skip. if (passes == 0) { buffers.swap(); return; } final int finalPasses = this.passes; for (int i = 0; i < finalPasses; i++) { effect.render(context, buffers); if (i < finalPasses - 1) { buffers.swap(); } } } public int getPasses() { return passes; } public void setPasses(int passes) { if (passes < 0) { throw new IllegalArgumentException("Passes value cannot be a negative number."); } this.passes = passes; } }
[ "metaphore@bk.ru" ]
metaphore@bk.ru
f19a0d6da2f4cf66cedf3420d3b497f0956f2752
b111b77f2729c030ce78096ea2273691b9b63749
/db-example-large-multi-project/project54/src/main/java/org/gradle/test/performance/mediumjavamultiproject/project54/p273/Production5477.java
17306f6c00bb5eb51032c7247a60540bc3255712
[]
no_license
WeilerWebServices/Gradle
a1a55bdb0dd39240787adf9241289e52f593ccc1
6ab6192439f891256a10d9b60f3073cab110b2be
refs/heads/master
2023-01-19T16:48:09.415529
2020-11-28T13:28:40
2020-11-28T13:28:40
256,249,773
1
0
null
null
null
null
UTF-8
Java
false
false
1,968
java
package org.gradle.test.performance.mediumjavamultiproject.project54.p273; public class Production5477 { private Production5474 property0; public Production5474 getProperty0() { return property0; } public void setProperty0(Production5474 value) { property0 = value; } private Production5475 property1; public Production5475 getProperty1() { return property1; } public void setProperty1(Production5475 value) { property1 = value; } private Production5476 property2; public Production5476 getProperty2() { return property2; } public void setProperty2(Production5476 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "nateweiler84@gmail.com" ]
nateweiler84@gmail.com
db0fdd9cd9d7994d215bae61f5a1120f28d9c49a
0ad5458bf9edd95d4c03d4b10d7f644022a59cd7
/src/test/java/ch/ethz/idsc/owl/subdiv/curve/BezierCurveTest.java
44f87b9c113bd1ac3d2b601bbb778fb5edb3dd3c
[]
no_license
yangshuo11/owl
596e2e15ab7463944df0daecf34f1c74cb2806cc
9e8a917ab34d7283dc0cc3514689a6e7683d5e98
refs/heads/master
2020-04-05T08:44:51.622349
2018-10-29T05:56:00
2018-10-29T05:56:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
766
java
// code by jph package ch.ethz.idsc.owl.subdiv.curve; import ch.ethz.idsc.owl.math.group.RnGeodesic; import ch.ethz.idsc.tensor.ExactScalarQ; import ch.ethz.idsc.tensor.RationalScalar; import ch.ethz.idsc.tensor.Tensor; import ch.ethz.idsc.tensor.Tensors; import ch.ethz.idsc.tensor.opt.ScalarTensorFunction; import junit.framework.TestCase; public class BezierCurveTest extends TestCase { public void testSimple() { BezierCurve bezierCurve = new BezierCurve(RnGeodesic.INSTANCE); ScalarTensorFunction function = bezierCurve.evaluation(Tensors.fromString("{{0, 1}, {1, 0}, {2, 1}}")); Tensor tensor = function.apply(RationalScalar.of(1, 4)); assertEquals(tensor, Tensors.fromString("{1/2, 5/8}")); assertTrue(ExactScalarQ.all(tensor)); } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
48092f0dddfa9c8f4a1d43b9a6804bb6867e0896
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/drjava_cluster/15600/tar_0.java
c3c9b8f42360597eb7942ed749517b179f94e75d
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,651
java
/*BEGIN_COPYRIGHT_BLOCK * * This file is part of DrJava. Download the current version of this project: * http://sourceforge.net/projects/drjava/ or http://www.drjava.org/ * * DrJava Open Source License * * Copyright (C) 2001-2004 JavaPLT group at Rice University (javaplt@rice.edu) * All rights reserved. * * Developed by: Java Programming Languages Team * Rice University * http://www.cs.rice.edu/~javaplt/ * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal with the Software without restriction, including without * limitation the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to permit persons to * whom the Software is furnished to do so, subject to the following * conditions: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimers. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * - Neither the names of DrJava, the JavaPLT, Rice University, nor the * names of its contributors may be used to endorse or promote products * derived from this Software without specific prior written permission. * - Products derived from this software may not be called "DrJava" nor * use the term "DrJava" as part of their names without prior written * permission from the JavaPLT group. For permission, write to * javaplt@rice.edu. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS WITH THE SOFTWARE. * END_COPYRIGHT_BLOCK*/ package edu.rice.cs.drjava.model.definitions.indent; import junit.framework.*; import edu.rice.cs.drjava.model.AbstractDJDocument; import javax.swing.text.BadLocationException; /** * Tests ActionStartPrevLinePlusMultilinePreserve(String,int,int,int,int). * It specifically tests the behavior of the auto-closing comments feature. * This means it tests cases where the user has just hit ENTER somewhere * on the opening line of a block comment. * * @version $Id$ */ public class ActionStartPrevLinePlusMultilinePreserveTest extends IndentRulesTestCase { /** * This is a clever (IMHO) factory trick to reuse these methods in TestCases * for logically similar IndentActions. * @see ActionStartPrevLinePlusMultilinePreserve#ActionStartPrevLinePlusMultilinePreserve(String[], int, int, int, int) */ private IndentRuleAction makeAction(String[] suffices, int cursorLine, int cursorPos, int psrvLine, int psrvPos) { return new ActionStartPrevLinePlusMultilinePreserve(suffices, cursorLine, cursorPos, psrvLine, psrvPos); } /** * This method abstracts the common processes of the tests so that the tests * themselves may only contain information about original conditions and * expected results. * @param start The text that should be in the document at time rule is called * @param loc the location of the cursor when rule is called * @param endLoc the expected final size of the document * @param finish the text string that remaining after the rule is called */ public void helperCommentTest(String start, int loc, int endLoc, String finish) throws BadLocationException { _setDocText(start); _doc.setCurrentLocation(loc); makeAction(new String[]{" * \n", " */"},0,3,0,3).indentLine(_doc, Indenter.ENTER_KEY_PRESS); assertEquals(endLoc, _doc.getCurrentLocation()); //assertEquals(finish.length(), _doc.getLength()); assertEquals(finish, _doc.getText()); } public void test1() throws BadLocationException { helperCommentTest("/**\n", 4, 7, "/**\n * \n */"); } public void test2() throws BadLocationException { helperCommentTest(" /**\n", 7, 13, " /**\n * \n */"); } public void test3() throws BadLocationException { helperCommentTest("/* abc\ndefg\n hijklmnop", 7, 10, "/* abc\n * defg\n */\n hijklmnop"); } public void test4() throws BadLocationException { helperCommentTest("/* \nThis is a comment */", 4, 7, "/* \n * This is a comment */\n */"); } public void test5() throws BadLocationException { helperCommentTest("/* This is code\n and more */", 16, 19, "/* This is code\n * and more */\n */"); } public void test6() throws BadLocationException { ///* This |is a comment block // That is already closed */ //--------------------------------- ///* This // * |is a comment block // */ // That is already closed */ //--------------------------------- //// (After undo command) // ///* This // * |is a comment block // That is already closed */ helperCommentTest("/* This \nis a comment block\n That is already closed */", 9, 12, "/* This \n * is a comment block\n */\n That is already closed */"); } public void test7() throws BadLocationException { ///* This |is a comment block // * That is already closed // */ // //--------------------------------- ///* This // * |is a comment block // */ // * That is already closed // */ //--------------------------------- //(after undo command) ///* This // * |is a comment block // * That is already closed // */ helperCommentTest("/* This \nis a comment block\n * That is already closed \n */", 9, 12, "/* This \n * is a comment block\n */\n * That is already closed \n */"); } public void xtest8() throws BadLocationException { ///* ABC | */ // //--------------------------------- ///* ABC // * | // */ helperCommentTest("/* ABC \n */", 8, 11, "/* ABC \n * */\n */"); } public void xtest9() throws BadLocationException { ///**| // * Text // */ //--------------------------------- ///** // * | // * Text // */ helperCommentTest("/**\n * Text\n */", 4, 7, "/**\n * \n * Text\n */"); } public void test10() throws BadLocationException { ///** This is |bad */ **/ // //--------------------------------- ///** This is // * bad */ **/ // */ helperCommentTest("/** This is \nbad */ **/", 13, 16, "/** This is \n * bad */ **/\n */"); } public void xtest11() throws BadLocationException { ///** ABC **/ | /** ABC **/ // //--------------------------------- ///** ABC **/ //|/** ABC **/ helperCommentTest("/** ABC **/ \n /** ABC **/", 13, 13, "/** ABC **/ \n/** ABC **/"); } }
[ "375833274@qq.com" ]
375833274@qq.com
539220af85f9aea9a0cd6694a229f3c3e8bd39e6
4ef431684e518b07288e8b8bdebbcfbe35f364e4
/fld/tas-tests/test-core/src/main/java/com/ca/apm/systemtest/fld/testbed/loads/FLDEntityAlertLoadProvider.java
1c47c46f3f327db872ecece3d313b0839edcdaa9
[]
no_license
Sarojkswain/APMAutomation
a37c59aade283b079284cb0a8d3cbbf79f3480e3
15659ce9a0030c2e9e5b992040e05311fff713be
refs/heads/master
2020-03-30T00:43:23.925740
2018-09-27T23:42:04
2018-09-27T23:42:04
150,540,177
0
0
null
null
null
null
UTF-8
Java
false
false
1,321
java
/** * */ package com.ca.apm.systemtest.fld.testbed.loads; import java.util.Arrays; import java.util.Collection; import com.ca.apm.systemtest.fld.role.EntityAlertLoadRole; import com.ca.apm.systemtest.fld.testbed.FLDConstants; import com.ca.apm.systemtest.fld.testbed.FLDLoadConstants; import com.ca.apm.systemtest.fld.testbed.FldTestbedProvider; import com.ca.tas.resolver.ITasResolver; import com.ca.tas.testbed.ITestbed; import com.ca.tas.testbed.ITestbedMachine; import com.ca.tas.testbed.TestBedUtils; public class FLDEntityAlertLoadProvider implements FLDConstants, FLDLoadConstants, FldTestbedProvider { private ITestbedMachine entityAlertMachine; @Override public Collection<ITestbedMachine> initMachines() { entityAlertMachine = TestBedUtils.createWindowsMachine(ENTITY_ALERT_MACHINE_ID, "w64"); return Arrays.asList(entityAlertMachine); } @Override public void initTestbed(ITestbed testbed, ITasResolver tasResolver) { String emHost = tasResolver.getHostnameById(EM_MOM_ROLE_ID); // Pass MOM EM host. Install Directory is optional EntityAlertLoadRole entityAlertRole = new EntityAlertLoadRole.Builder( ENTITY_ALERT_ROLE_ID, tasResolver) .emHost(emHost) .build(); entityAlertMachine.addRole(entityAlertRole); } }
[ "sarojkswain@gmail.com" ]
sarojkswain@gmail.com
55bbf53a2939a80192d4d711dce8596d37419c3f
3e58503aa6e2191864f4ce94ee5966751da81a9d
/jdkCodeAnalysis/java8/util/concurrent/locks/Lock.java
2f586cd40ac9954103b345dbc56fe543cd34446f
[]
no_license
caoyang4/Java
394cb4f6f6a8f9326b809903d9fba3507e13a887
cbddf0f7767f8a5debb1a5275f56509c376928a0
refs/heads/master
2023-07-28T00:22:44.306694
2023-07-06T08:27:01
2023-07-06T08:27:01
99,577,228
2
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package java.util.concurrent.locks; import java.util.concurrent.TimeUnit; /** * 互斥锁(mutex)的本质就是一个内存标志,这个标志可以是一个flag(占用标志), * 也可以是一个指针,指向一个持有者的线程ID,也可以是两个都有, * 以及一个等待(阻塞)队列,以及若干其它信息等。 * 当这个flag被标记成被占用的时候,或者持有者指针不为空的时候,那么它就不能被被别的任务(线程)访问。 * 只有等到这个mutex变得空闲的时候,操作系统会把等待队列里的第一任务(线程)取出来,然后调度执行, * 如果当前CPU很忙,那么就把取出的这个任务(线程)标记为就绪(READY)状态,后续如果CPU空闲了,就会被调度。 */ public interface Lock { void lock(); void lockInterruptibly() throws InterruptedException; boolean tryLock(); boolean tryLock(long time, TimeUnit unit) throws InterruptedException; void unlock(); Condition newCondition(); }
[ "caoyang42@meituan.com" ]
caoyang42@meituan.com
f65af6167c1bad7f4e88138a7c42a9e75f3e922a
6dbae30c806f661bcdcbc5f5f6a366ad702b1eea
/Corpus/ecf/1696.java
c062aad59ea9c2a10e8c3032b1d359935a3c105c
[ "MIT" ]
permissive
SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018
d3fd21745dfddb2979e8ac262588cfdfe471899f
0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0
refs/heads/master
2020-03-31T15:52:01.005505
2018-10-01T23:38:50
2018-10-01T23:38:50
152,354,327
1
0
MIT
2018-10-10T02:57:02
2018-10-10T02:57:02
null
UTF-8
Java
false
false
2,250
java
/**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Composent, Inc. - initial API and implementation *****************************************************************************/ package org.eclipse.ecf.presence.roster; import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.ecf.internal.presence.PresencePlugin; /** * Base class implmentation of {@link IRosterItem} super interface. This class * is a superclass for the {@link RosterEntry} and {@link RosterGroup} classes. */ public class RosterItem implements IRosterItem { protected String name; protected IRosterItem parent; protected RosterItem() { // protected root constructor } public RosterItem(IRosterItem parent, String name) { Assert.isNotNull(name); this.parent = parent; this.name = name; } /* * (non-Javadoc) * * @see org.eclipse.ecf.presence.roster.IRosterItem#getName() */ public String getName() { return name; } /* * (non-Javadoc) * * @see org.eclipse.ecf.presence.roster.IRosterItem#getParent() */ public IRosterItem getParent() { return parent; } /* * (non-Javadoc) * * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { if (adapter.isInstance(this)) { return this; } IAdapterManager adapterManager = PresencePlugin.getDefault().getAdapterManager(); if (adapterManager == null) return null; return adapterManager.loadAdapter(this, adapter.getName()); } public IRoster getRoster() { if (this instanceof IRoster) return (IRoster) this; IRosterItem p = getParent(); while (p != null && !(p instanceof IRoster)) p = p.getParent(); return (IRoster) p; } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
abe0148351794a405ae9150a7d7dbaf829573193
f21e2990547a37e087bf866c2659f8ed4f70ca84
/apphub-integration/src/main/java/com/github/saphyra/apphub/integration/action/frontend/notebook/new_list_item/NewCategoryActions.java
fdf2feb32783e0e63c6cb36bbd628924995d8ffe
[]
no_license
Saphyra/apphub
207b8e049ca3d8f88c15213656cf596663e2850b
13d01c18ff4568edc693da102b7822781de83fa3
refs/heads/master
2023-09-04T05:31:41.969358
2023-09-02T19:29:17
2023-09-02T19:29:17
250,788,236
0
2
null
2023-09-09T20:23:43
2020-03-28T12:22:39
Java
UTF-8
Java
false
false
593
java
package com.github.saphyra.apphub.integration.action.frontend.notebook.new_list_item; import com.github.saphyra.apphub.integration.framework.WebElementUtils; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class NewCategoryActions { public static void fillTitle(WebDriver driver, String title) { WebElementUtils.clearAndFill(driver.findElement(By.id("notebook-new-category-title")), title); } public static void submit(WebDriver driver) { driver.findElement(By.id("notebook-new-category-create-button")) .click(); } }
[ "Saphy371321" ]
Saphy371321
d6102a619f15fd4e929e9ecca11792c0de890633
3e24cc42539db6cfaa51586c55854e0bf14a4a65
/src/org/jonix/codelist/SalesRestrictionTypes.java
246457542573c7521f37ed4bc9f6891bce2db4fa
[]
no_license
MiladRamsys/jonix
08dc77edff0f0addc49a5d20f45534c818b3a0e2
fc493bb2e354686488ad63c2c051e73039c468a7
refs/heads/master
2021-01-10T21:23:41.811111
2013-04-04T14:39:26
2013-04-04T14:39:26
32,104,199
0
0
null
null
null
null
UTF-8
Java
false
false
2,366
java
package org.jonix.codelist; /** * Enum that corresponds to Onix's CodeList 71 * * @author Zach Melamed * */ public enum SalesRestrictionTypes { /** * Restriction must be described in <SalesRestrictionDetail> (ONIX 2.1) or <SalesRestrictionNote> (ONIX 3.0). */ Unspecified___see_text("00"), /** * For sale only through designated retailer. Retailer must be identified or named in an instance of the <SalesOutlet> composite. Use only when it is not possible to assign the more explicit code 04 or 05. */ Retailer_exclusive___own_brand("01"), /** * For editions sold only though office supplies wholesalers. Retailer(s) and/or distributor(s) may be identified or named in an instance of the <SalesOutlet> composite. */ Office_supplies_edition("02"), /** * For an ISBN that is assigned for a publisher’s internal purposes. */ Internal_publisher_use_only__do_not_list("03"), /** * For sale only through designated retailer, though not under retailer’s own brand/imprint. Retailer must be identified or named in an instance of the <SalesOutlet> composite. */ Retailer_exclusive("04"), /** * For sale only through designated retailer under retailer’s own brand/imprint. Retailer must be identified or named in an instance of the <SalesOutlet> composite. */ Retailer_own_brand("05"), /** * For sale to libraries only; not for sale through retail trade. */ Library_edition("06"), /** * For sale directly to schools only; not for sale through retail trade. */ Schools_only_edition("07"), /** * Indexed for the German market – in Deutschland indiziert. */ Indiziert("08"), /** * Expected to apply in particular to digital products for consumer sale where the publisher does not permit the product to be supplied to libraries who provide an ebook loan service. */ Not_for_sale_to_libraries("09"), /** * For editions sold only through newsstands/newsagents. */ News_outlet_edition("10"); public final String code; private SalesRestrictionTypes(String code) { this.code = code; } private static SalesRestrictionTypes[] values = SalesRestrictionTypes.values(); public static SalesRestrictionTypes fromCode(String code) { if (code != null && !code.isEmpty()) for (SalesRestrictionTypes item : values) if (item.code.equals(code)) return item; return null; } }
[ "tsahim@gmail.com@d7478ce8-731c-9f3f-b499-ac6574b89192" ]
tsahim@gmail.com@d7478ce8-731c-9f3f-b499-ac6574b89192
2d8b293cb78f32e7f195c30015982a1d72b4238b
0e023d12cbe098e4b44ee2a2505634c3899a1e1f
/CORE JAVA CODE/CoreJava_02/ApplicationOfCoreJava2/src/Input_Output_Operation_IO/fileReaderUsingInputStreams.java
d569c0fb0655abc6b9c0d240a965048f3a603d72
[]
no_license
imrangthub/CORE-JAVA-CODE
634abf2e65c73bc1500adefdedf40ec2f8827d8f
1f0f6034e55f3aa47fe65ac01686a4b0d1454b02
refs/heads/master
2021-08-06T14:55:55.955044
2017-11-06T09:05:55
2017-11-06T09:05:55
109,671,427
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package Input_Output_Operation_IO; import java.io.BufferedInputStream; import java.io.FileInputStream; public class fileReaderUsingInputStreams { public static void main(String[] args){ try{ FileInputStream fInput = new FileInputStream("D:\\JAVA\\CORE JAVAcod\\CoreJava_02\\ApplicationOfCoreJava2\\src\\Input_Output_Operation_IO\\simpleTextOutputStream.txt"); BufferedInputStream bInput = new BufferedInputStream(fInput); int i; while((i = bInput.read()) != -1){ System.out.print((char) i); } fInput.close(); }catch(Exception e){ System.out.println(e); } System.out.println(); } }
[ "imranmadbar@gmail.com" ]
imranmadbar@gmail.com
7703731578483d930d7269af3657b5b413854d47
13485d5c2ed540269dfb31de181943f333155cbb
/algo/src/main/java/me/ederign/FileReader.java
0c43b415c5f76f9e8dfd6848e696aeb32cecd8e9
[ "Apache-2.0" ]
permissive
ederign/jff
9a64dba658f22fdbca871c259b4c9a6c05927ca3
c732d8623e893741f3193b408fef1562e37e0d33
refs/heads/master
2021-01-20T10:06:39.094331
2015-08-06T21:29:56
2015-08-06T21:29:56
17,462,307
1
1
null
null
null
null
UTF-8
Java
false
false
626
java
package me.ederign; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; public class FileReader { public static int[] readToIntArray(String fileName) throws IOException { File file = new File(FileReader.class.getClassLoader().getResource(fileName).getFile()); List<String> lines = Files.readAllLines(Paths.get(file.toURI())); int[] intLines = new int[lines.size()]; for (int i = 0; i < lines.size(); i++) { intLines[i] = Integer.parseInt(lines.get(i)); } return intLines; } }
[ "ignatowicz@gmail.com" ]
ignatowicz@gmail.com
3424f4d01feafd81bae8cea0be27defe8a2b6d27
33844124d95e2c3c4f2d88146244fc5e7e7ebb77
/src/main/java/org/springframework/test/web/support/XpathExpectationsHelper.java
0fd0d707c167f4891f06f2ed2b7e11aa809677f6
[ "Apache-2.0" ]
permissive
Keanu/spring-test-mvc
02c10ef43851b1f9041d1a8e818cf38dc75ad810
3153030758b3bd24070e69946cb307ff9d0a08b0
refs/heads/master
2020-12-25T10:50:45.334950
2012-09-15T20:36:58
2012-09-15T20:36:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,711
java
/* * Copyright 2011-2012 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.test.web.support; import static org.springframework.test.web.AssertionErrors.assertEquals; import java.io.StringReader; import java.util.Collections; import java.util.Map; import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.hamcrest.Matcher; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.springframework.util.xml.SimpleNamespaceContext; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; /** * A helper class for applying assertions using XPath expressions. * * @author Rossen Stoyanchev */ public class XpathExpectationsHelper { private final String expression; private final XPathExpression xpathExpression; /** * Class constructor. * * @param expression the XPath expression * @param namespaces XML namespaces referenced in the XPath expression, or {@code null} * @param args arguments to parameterize the XPath expression with using the * formatting specifiers defined in {@link String#format(String, Object...)} * @throws XPathExpressionException */ public XpathExpectationsHelper(String expression, Map<String, String> namespaces, Object... args) throws XPathExpressionException { this.expression = String.format(expression, args); this.xpathExpression = compileXpathExpression(this.expression, namespaces); } private XPathExpression compileXpathExpression(String expression, Map<String, String> namespaces) throws XPathExpressionException { SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext(); namespaceContext.setBindings((namespaces != null) ? namespaces : Collections.<String, String> emptyMap()); XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(namespaceContext); return xpath.compile(expression); } /** * Parse the content, evaluate the XPath expression as a {@link Node}, and * assert it with the given {@code Matcher<Node>}. */ public void assertNode(String content, final Matcher<? super Node> matcher) throws Exception { Document document = parseXmlString(content); Node node = evaluateXpath(document, XPathConstants.NODE, Node.class); MatcherAssert.assertThat("Xpath: " + XpathExpectationsHelper.this.expression, node, matcher); } /** * TODO * @param xml * @return * @throws Exception */ protected Document parseXmlString(String xml) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); InputSource inputSource = new InputSource(new StringReader(xml)); Document document = documentBuilder.parse(inputSource); return document; } /** * TODO * @throws XPathExpressionException */ @SuppressWarnings("unchecked") protected <T> T evaluateXpath(Document document, QName evaluationType, Class<T> expectedClass) throws XPathExpressionException { return (T) this.xpathExpression.evaluate(document, evaluationType); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void exists(String content) throws Exception { assertNode(content, Matchers.notNullValue()); } /** * TODO */ public void doesNotExist(String content) throws Exception { assertNode(content, Matchers.nullValue()); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertNodeCount(String content, Matcher<Integer> matcher) throws Exception { Document document = parseXmlString(content); NodeList nodeList = evaluateXpath(document, XPathConstants.NODESET, NodeList.class); String reason = "nodeCount Xpath: " + XpathExpectationsHelper.this.expression; MatcherAssert.assertThat(reason, nodeList.getLength(), matcher); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertNodeCount(String content, int expectedCount) throws Exception { assertNodeCount(content, Matchers.equalTo(expectedCount)); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertString(String content, Matcher<? super String> matcher) throws Exception { Document document = parseXmlString(content); String result = evaluateXpath(document, XPathConstants.STRING, String.class); MatcherAssert.assertThat("Xpath: " + XpathExpectationsHelper.this.expression, result, matcher); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertString(String content, String expectedValue) throws Exception { assertString(content, Matchers.equalTo(expectedValue)); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertNumber(String content, Matcher<? super Double> matcher) throws Exception { Document document = parseXmlString(content); Double result = evaluateXpath(document, XPathConstants.NUMBER, Double.class); MatcherAssert.assertThat("Xpath: " + XpathExpectationsHelper.this.expression, result, matcher); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertNumber(String content, Double expectedValue) throws Exception { assertNumber(content, Matchers.equalTo(expectedValue)); } /** * TODO * @throws Exception if content parsing or XPath expression evaluation fails */ public void assertBoolean(String content, Boolean expectedValue) throws Exception { Document document = parseXmlString(content); String result = evaluateXpath(document, XPathConstants.STRING, String.class); assertEquals("Xpath:", expectedValue, Boolean.parseBoolean(result)); } }
[ "rstoyanchev@vmware.com" ]
rstoyanchev@vmware.com
983134d92ac1dfe5e6aeb48265a101739f40e6c8
90efad8bf93fb9f39ad43238b971b612be1fd12f
/spring-boot-concurrency/src/main/java/com/andy/concurrency/example/commonUnsafe/DateFormatExample1.java
8bb7d387e1cf9ff70a2efeab97c1e37686a3aff6
[ "Apache-2.0" ]
permissive
SharingTourism/spring-boot-examples
eaa3e8e765464e1e5a6ae89f8d0e6dcfa382b8b5
dc6882afd62db46bc29fefb06184e9e303392804
refs/heads/master
2020-09-24T13:06:08.508217
2019-03-28T07:24:10
2019-03-28T07:24:10
225,764,962
0
0
null
2019-12-04T02:51:10
2019-12-04T02:51:09
null
UTF-8
Java
false
false
1,505
java
package com.andy.concurrency.example.commonUnsafe; import lombok.extern.slf4j.Slf4j; import java.text.SimpleDateFormat; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Semaphore; /** * @author Leone * @since 2018-05-06 **/ @Slf4j public class DateFormatExample1 { private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); public static int clientTotal = 5000; public static int threadTotal = 200; public static void main(String[] args) throws Exception { ExecutorService executorService = Executors.newCachedThreadPool(); final Semaphore semaphore = new Semaphore(threadTotal); final CountDownLatch countDownLatch = new CountDownLatch(clientTotal); for (int i = 0; i < clientTotal; i++) { executorService.execute(() -> { try { semaphore.acquire(); update(); semaphore.release(); } catch (InterruptedException e) { log.error("exception", e); } countDownLatch.countDown(); }); } countDownLatch.await(); executorService.shutdown(); } private static void update() { try { simpleDateFormat.parse("20180203"); } catch (Exception e) { log.error("{}", e); } } }
[ "exklin@gmail.com" ]
exklin@gmail.com
68c2b498e490a1a423a40b7497a48938e547dc58
430b26d19c1531c3ca736679872faefb669192bb
/app/src/main/java/com/laoxu/myviewdemo/view/widget/entity/DotEntity.java
e9bb4f3c6a960fabe766aae1f6232c986f19655c
[]
no_license
KsonCode/MyViewDemo
cff8f17d53af9fd9ad333b249bbc0c73c70ae708
f21cd1384dd10c0b00be6167f06c8fddcee69790
refs/heads/master
2020-09-28T17:22:39.698414
2019-12-11T05:00:17
2019-12-11T05:00:17
226,823,632
0
1
null
null
null
null
UTF-8
Java
false
false
179
java
package com.laoxu.myviewdemo.view.widget.entity; public class DotEntity { public int circleX; public int circleY; public boolean isSelected;//是否被矩形选中 }
[ "19655910@qq.com" ]
19655910@qq.com
d9d13d7bf2e2f7a6136c0531930b2d3dacf1109a
ef44d044ff58ebc6c0052962b04b0130025a102b
/com.freevisiontech.fvmobile_source_from_JADX/sources/com/bumptech/glide/load/engine/bitmap_recycle/BaseKeyPool.java
dc76d699dd777867806cb54a329ac16d3604b16c
[]
no_license
thedemoncat/FVShare
e610bac0f2dc394534ac0ccec86941ff523e2dfd
bd1e52defaec868f0d1f9b4f2039625c8ff3ee4a
refs/heads/master
2023-08-06T04:11:16.403943
2021-09-25T10:11:13
2021-09-25T10:11:13
410,232,121
2
0
null
null
null
null
UTF-8
Java
false
false
793
java
package com.bumptech.glide.load.engine.bitmap_recycle; import com.bumptech.glide.load.engine.bitmap_recycle.Poolable; import com.bumptech.glide.util.Util; import java.util.Queue; abstract class BaseKeyPool<T extends Poolable> { private static final int MAX_SIZE = 20; private final Queue<T> keyPool = Util.createQueue(20); /* access modifiers changed from: protected */ public abstract T create(); BaseKeyPool() { } /* access modifiers changed from: protected */ public T get() { T result = (Poolable) this.keyPool.poll(); if (result == null) { return create(); } return result; } public void offer(T key) { if (this.keyPool.size() < 20) { this.keyPool.offer(key); } } }
[ "nl.ruslan@yandex.ru" ]
nl.ruslan@yandex.ru
43407134422d71b88d32163a6e8bb02b15dd06a4
6ed05610a0fc7a86afe52267fc2570abc272dd4a
/openapi-spring-webmvc-core/src/test/java/test/org/springdoc/api/app74/HelloController.java
ce85bc1edbeb6dcf1a3a77eeb82d5589a7905e20
[ "Apache-2.0" ]
permissive
Zjd12138/wapadoc
f2226fc93bbcac98d59812c3a404121c31dcb0d9
ae258cd5d719ce3d5e0a45210bfae7182c229940
refs/heads/master
2023-03-01T13:57:51.909077
2021-02-07T04:05:03
2021-02-07T04:05:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,287
java
/* * * * Copyright 2019-2020 the original author or authors. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * https://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * */ package test.org.springdoc.api.app74; import org.wapache.openapi.v3.annotations.media.Content; import org.wapache.openapi.v3.annotations.media.ExampleObject; import org.wapache.openapi.v3.annotations.parameters.ApiRequestBody; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @PostMapping("/test") @ApiRequestBody( content = @Content( examples = @ExampleObject( value = "sample" ) ) ) public String postMyRequestBody( String myRequestBody) { return null; } }
[ "ykuang@wapache.org" ]
ykuang@wapache.org
2e40f5ebb88e3c96135a7e6c3f7c2d2efad84ecc
ebac8f18af20853d6ca8efa2038146ef8d9a1cae
/utility/elasticsearch_compatibility_1.0/src/org/elasticsearch/client/action/search/SearchRequestBuilder.java
0703ff3aa2a301c5c0076a6e94b47cee6b31c64f
[]
no_license
Alex-At-Home/Infinit.e
ad4a5ca33045c2356d09dd58233c8af227d5b91b
49b4600139bfdd2c371f79d7257f286ccdcdc4b5
refs/heads/master
2021-01-24T02:39:01.280698
2016-02-09T19:06:16
2016-02-09T19:06:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,312
java
package org.elasticsearch.client.action.search; import java.util.Map; import org.elasticsearch.action.ListenableActionFuture; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchType; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.query.FilterBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.Scroll; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.facets.CrossVersionFacetBuilder; import org.elasticsearch.search.sort.SortBuilder; import org.elasticsearch.search.sort.SortOrder; public class SearchRequestBuilder { protected org.elasticsearch.action.search.SearchRequestBuilder _delegate; // 1.x: public SearchRequestBuilder addAggregation(AbstractAggregationBuilder agg) { _delegate.addAggregation(agg); return this; } // 0.19- public SearchRequestBuilder(org.elasticsearch.action.search.SearchRequestBuilder delegate) { _delegate = delegate; } public SearchRequestBuilder setIndices(String... arg0) { _delegate.setIndices(arg0); return this; } public SearchRequestBuilder setTypes(String... arg0) { _delegate.setTypes(arg0); return this; } public SearchRequestBuilder setSize(int size) { _delegate.setSize(size); return this; } public SearchRequestBuilder setFrom(int from) { _delegate.setFrom(from); return this; } public SearchRequestBuilder addScriptField(String name, String lang, String script, Map<String, Object> params) { _delegate.addScriptField(name, lang, script, params); return this; } public SearchRequestBuilder setExplain(boolean explain) { _delegate.setExplain(explain); return this; } public SearchRequestBuilder setFilter(FilterBuilder filter) { _delegate.setPostFilter(filter); return this; } public SearchRequestBuilder addSort(String field, SortOrder order) { _delegate.addSort(field, order); return this; } public SearchRequestBuilder addSort(SortBuilder sort) { _delegate.addSort(sort); return this; } public SearchRequestBuilder setFacets(byte[] facets) { _delegate.setFacets(facets); return this; } public SearchRequestBuilder addFacet(CrossVersionFacetBuilder facet) { _delegate.addFacet(facet.getVersionedInterface()); return this; } public SearchRequestBuilder setQuery(QueryBuilder query) { _delegate.setQuery(query); return this; } public SearchRequestBuilder setQuery(String query) { _delegate.setQuery(query); return this; } public SearchRequestBuilder setSearchType(SearchType type) { _delegate.setSearchType(type); return this; } public SearchRequestBuilder setScroll(String keepAlive) { _delegate.setScroll(keepAlive); return this; } public SearchRequestBuilder setScroll(Scroll scrollId) { _delegate.setScroll(scrollId); return this; } public SearchRequestBuilder setScroll(TimeValue keepAlive) { _delegate.setScroll(keepAlive); return this; } public SearchRequestBuilder addFields(String... fields) { _delegate.addFields(fields); return this; } public SearchRequestBuilder addField(String field) { _delegate.addField(field); return this; } public ListenableActionFuture<SearchResponse> execute() { return _delegate.execute(); } }
[ "apiggott@ikanow.com" ]
apiggott@ikanow.com
e44c047f86ff7c26c8522ba7d2bd5ce6b154bdd9
01d6046f52c5e58c4ba648350778d13418f72f54
/src/main/java/com/ybg/rbac/user/domain/UserDO.java
bd4d2604059561d3f76b87b5cc2ad6e5873e7b81
[]
no_license
MingHub0313/zmm_ybg_plus
05f03c5587de685d7f4df451d4c12ca8d1d3eed1
54f439870c93d382a3a71065f872823b24112d10
refs/heads/master
2022-07-02T13:15:57.271195
2020-01-16T03:46:56
2020-01-16T03:46:56
234,228,750
0
0
null
2022-06-17T02:48:56
2020-01-16T03:40:01
JavaScript
UTF-8
Java
false
false
7,395
java
package com.ybg.rbac.user.domain; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import org.hibernate.validator.constraints.NotBlank; import com.ybg.base.util.excel.ExcelVOAttribute; /*** * @author https://gitee.com/YYDeament/88ybg * * @date 2016/10/1 */ @ApiModel(value = "用戶实体类(数据库)",description = "") /** @author yy 2016-06-21 用戶实体类(数据库) */ public class UserDO implements Serializable { private static final long serialVersionUID = 8884558988237838150L; @ApiModelProperty(name = "id",dataType = "java.lang.String",value = "用户编码") @ExcelVOAttribute(name = "编码",column = "A") private String id; @ApiModelProperty(name = "username",dataType = "java.lang.String",value = "账号") @ExcelVOAttribute(name = "账号",column = "B",isExport = true) @NotBlank(message = "账号不能为空") private String username; @ApiModelProperty(name = "email",dataType = "java.lang.String",value = "电子邮箱") @ExcelVOAttribute(name = "电子邮箱",column = "D",isExport = true) @NotBlank(message = "电子邮箱不能为空") private String email; @ApiModelProperty(name = "phone",dataType = "java.lang.String",value = "手机") @ExcelVOAttribute(name = "手机",column = "E",isExport = true) private String phone; @ApiModelProperty(name = "password",dataType = "java.lang.String",value = "密码") @ExcelVOAttribute(name = "密码",column = "C",prompt = "密码保密哦!",isExport = false) @NotBlank(message = "密码不能为空") private String password; @ApiModelProperty(name = "state",dataType = "java.lang.String",value = "状态") @ExcelVOAttribute(name = "状态",column = "F",isExport = true) private String state; @ApiModelProperty(name = "createtime",dataType = "java.lang.String",value = "创建时间") @ExcelVOAttribute(name = "创建时间",column = "G",isExport = true) private String createtime; @ApiModelProperty(name = "isdelete",dataType = "java.lang.Integer",value = "是否删除") private Integer isdelete; // @ApiModelProperty(name = "roleid", dataType = "java.lang.String", value = "角色编码") // @ExcelVOAttribute(name = "角色编码", column = "H", isExport = true) // @NotBlank(message = "角色编码不能为空") // private String roleid; @ApiModelProperty(name = "credentialssalt",dataType = "java.lang.String",value = "加密盐",hidden = true) private String credentialssalt; public String getCredentialssalt(){ return credentialssalt; } public void setCredentialssalt(String credentialssalt){ this.credentialssalt = credentialssalt; } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String getUsername(){ return username; } public void setUsername(String username){ this.username = username; } public String getEmail(){ return email; } public void setEmail(String email){ this.email = email; } public String getPhone(){ return phone; } public void setPhone(String phone){ this.phone = phone; } public String getPassword(){ return password; } public void setPassword(String password){ this.password = password; } public String getState(){ return state; } public void setState(String state){ this.state = state; } public String getCreatetime(){ return createtime; } public void setCreatetime(String createtime){ this.createtime = createtime; } public Integer getIsdelete(){ return isdelete; } public void setIsdelete(Integer isdelete){ this.isdelete = isdelete; } @Override public String toString(){ return "UserDO [id=" + id + ", username=" + username + ", email=" + email + ", phone=" + phone + ", password=" + password + ", state=" + state + ", createtime=" + createtime + ", isdelete=" + isdelete + ", credentialssalt=" + credentialssalt + "]"; } @Override public int hashCode(){ final int prime = 31; int result = 1; result = prime * result + ((createtime == null) ? 0 : createtime.hashCode()); result = prime * result + ((credentialssalt == null) ? 0 : credentialssalt.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((isdelete == null) ? 0 : isdelete.hashCode()); result = prime * result + ((password == null) ? 0 : password.hashCode()); result = prime * result + ((phone == null) ? 0 : phone.hashCode()); result = prime * result + ((state == null) ? 0 : state.hashCode()); result = prime * result + ((username == null) ? 0 : username.hashCode()); return result; } @Override public boolean equals(Object obj){ if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } UserDO other = (UserDO) obj; if (createtime == null) { if (other.createtime != null) { return false; } } else if (!createtime.equals(other.createtime)) { return false; } if (credentialssalt == null) { if (other.credentialssalt != null) { return false; } } else if (!credentialssalt.equals(other.credentialssalt)) { return false; } if (email == null) { if (other.email != null) { return false; } } else if (!email.equals(other.email)) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (isdelete == null) { if (other.isdelete != null) { return false; } } else if (!isdelete.equals(other.isdelete)) { return false; } if (password == null) { if (other.password != null) { return false; } } else if (!password.equals(other.password)) { return false; } if (phone == null) { if (other.phone != null) { return false; } } else if (!phone.equals(other.phone)) { return false; } if (state == null) { if (other.state != null) { return false; } } else if (!state.equals(other.state)) { return false; } if (username == null) { if (other.username != null) { return false; } } else if (!username.equals(other.username)) { return false; } return true; } }
[ "zhangmingmig@adpanshi.com" ]
zhangmingmig@adpanshi.com
d475f4e65c75969828e6126a086c9a34f4420d89
328bb970a709a9d83b213f9e424248fc9076a046
/src/entuware/mostmissedtest/Test7.java
3924086c04fd2efd367e5782b38d46b060734e59
[]
no_license
Arasefe/OCAPreperation
0c74430b421328d41a4d4644b4033a621b7ac672
e1d693521540e9ba45f78c5b47ceb7f23e26a6b9
refs/heads/master
2023-01-06T16:17:18.662190
2020-11-07T00:14:56
2020-11-07T00:14:56
301,600,658
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package entuware.mostmissedtest; import java.util.Arrays; public class Test7 { public static void main(String[] args) { String shirts[][] = new String[2][2]; shirts[0][0] = "red"; shirts[0][1] = "blue"; shirts[1][0] = "small"; shirts[1][1] = "medium"; // red:blue:small:medium for (String[] each : shirts) { for (String s : each) { System.out.print(s + ":"); } for (int index = 0; index < 2; index++) { for (int idx = 0; idx < 2; idx++) { System.out.print(shirts[index][idx] + ":"); } } } } }
[ "ismail_yildirim69@yahoo.com" ]
ismail_yildirim69@yahoo.com
bbbfc4167e9bbc8b8e769f62ab9cbe9a1cda64de
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_22516.java
ea13040cc5c833c769fb9c6bcd83214832f92972
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,123
java
/** * Updates the colors of all library panels that are visible. */ protected void updateColors(){ int count=0; for ( Entry<Contribution,DetailPanel> entry : panelByContribution.entrySet()) { DetailPanel panel=entry.getValue(); Border border=BorderFactory.createEmptyBorder(1,1,1,1); if (panel.isVisible()) { boolean oddRow=count % 2 == 1; Color bgColor=null; Color fgColor=UIManager.getColor("List.foreground"); if (panel.isSelected()) { bgColor=UIManager.getColor("List.selectionBackground"); fgColor=UIManager.getColor("List.selectionForeground"); border=UIManager.getBorder("List.focusCellHighlightBorder"); } else if (Platform.isMacOS()) { border=oddRow ? UIManager.getBorder("List.oddRowBackgroundPainter") : UIManager.getBorder("List.evenRowBackgroundPainter"); } else { bgColor=oddRow ? new Color(219,224,229) : new Color(241,241,241); } panel.setForeground(fgColor); if (bgColor != null) { panel.setBackground(bgColor); } count++; } panel.setBorder(border); } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
a5f5fabe441469de532a23a511db4752848070eb
2ebf1700f2c4fabb8024871952faa241d6d80de7
/src/main/java/vg/civcraft/mc/citadel/playerstate/AbstractPlayerState.java
4bf0e50c981a99bb0d84c8647920ba8053bb9a5b
[ "BSD-3-Clause" ]
permissive
Scuwr/Citadel
99ee071ef8a903210f6a95108aa727430902a573
9337adf3c6f40afa4811db07239869050c2d0555
refs/heads/master
2021-01-17T21:42:12.331429
2020-10-03T16:32:59
2020-10-03T16:32:59
50,679,643
0
0
null
2016-01-29T17:45:10
2016-01-29T17:45:10
null
UTF-8
Java
false
false
4,042
java
package vg.civcraft.mc.citadel.playerstate; import java.util.HashMap; import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; import vg.civcraft.mc.citadel.CitadelPermissionHandler; import vg.civcraft.mc.citadel.CitadelUtility; import vg.civcraft.mc.citadel.ReinforcementLogic; import vg.civcraft.mc.citadel.events.ReinforcedBlockBreak; import vg.civcraft.mc.citadel.events.ReinforcementBypassEvent; import vg.civcraft.mc.citadel.events.ReinforcementDamageEvent; import vg.civcraft.mc.citadel.model.Reinforcement; import vg.civcraft.mc.citadel.reinforcementtypes.ReinforcementType; import vg.civcraft.mc.civmodcore.playersettings.PlayerSettingAPI; import vg.civcraft.mc.civmodcore.playersettings.impl.BooleanSetting; import vg.civcraft.mc.civmodcore.util.DelayedItemDrop; public abstract class AbstractPlayerState { protected UUID uuid; public AbstractPlayerState(Player p) { if (p == null) { throw new IllegalArgumentException("Player for player state can not be null"); } this.uuid = p.getUniqueId(); } public abstract String getName(); public abstract void handleBlockPlace(BlockPlaceEvent e); public void handleBreakBlock(BlockBreakEvent e) { Reinforcement rein = ReinforcementLogic.getReinforcementProtecting(e.getBlock()); if (rein == null) { // no reinforcement, normal break which we dont care about return; } if (CitadelUtility.isPlant(e.getBlock())) { if (rein.hasPermission(e.getPlayer(), CitadelPermissionHandler.getCrops()) && !e.getBlock().getLocation().equals(rein.getLocation())) { // allow, because player has crop permission and the only reinforcement // protecting is in the soil return; } } boolean hasAccess = rein.hasPermission(e.getPlayer(), CitadelPermissionHandler.getBypass()); BooleanSetting setting = (BooleanSetting) PlayerSettingAPI.getSetting("citadelBypass"); boolean hasByPass = setting.getValue(e.getPlayer()); if (hasAccess && hasByPass) { ReinforcementBypassEvent bypassEvent = new ReinforcementBypassEvent(e.getPlayer(), rein); Bukkit.getPluginManager().callEvent(bypassEvent); if (bypassEvent.isCancelled()) { e.setCancelled(true); return; } if (rein.rollForItemReturn()) { giveReinforcement(e.getBlock().getLocation().clone().add(0.5, 0.5, 0.5), e.getPlayer(), rein.getType()); } rein.setHealth(-1); return; } if (hasAccess) { CitadelUtility.sendAndLog(e.getPlayer(), ChatColor.GREEN, "You could bypass this reinforcement " + "if you turn bypass mode on with '/ctb'"); } e.setCancelled(true); float damage = ReinforcementLogic.getDamageApplied(rein); ReinforcementDamageEvent dre = new ReinforcementDamageEvent(e.getPlayer(), rein, damage); Bukkit.getPluginManager().callEvent(dre); if (dre.isCancelled()) { return; } damage = dre.getDamageDone(); ReinforcementLogic.damageReinforcement(rein, damage, e.getPlayer()); if (rein.getHealth() <= 0) { // in the case of double chests or similar there might now be another rein // protecting this block Reinforcement backupRein = ReinforcementLogic.getReinforcementProtecting(e.getBlock()); if (backupRein == null) { e.setCancelled(false); ReinforcedBlockBreak rbbe = new ReinforcedBlockBreak(e.getPlayer(), rein, e); Bukkit.getPluginManager().callEvent(rbbe); } } } public abstract void handleInteractBlock(PlayerInteractEvent e); protected static void giveReinforcement(Location location, Player p, ReinforcementType type) { HashMap<Integer, ItemStack> notAdded = p.getInventory().addItem(type.getItem().clone()); if (!notAdded.isEmpty()) { DelayedItemDrop.dropAt(location, type.getItem().clone()); } } public abstract String getOverlayText(); @Override public abstract boolean equals(Object o); }
[ "maxopoly3@gmail.com" ]
maxopoly3@gmail.com
b3b9f94efd459bb7d8391a7b905b6bdb45984c54
9c05b703a7f3d00d70b77d3815ff087b3f244c06
/JavaSE/Day_2/Early_Binding/Demo7.java
22f8ed98cb2504d0fe4cb8a2c1d1b97b4515c6bd
[]
no_license
ramdafale/Notes1
641ef32d34bf66fc4097b71402bf9e046f11351e
20bcf6e9440308f87db7ce435d68ca26bad17e9b
refs/heads/master
2020-03-17T04:16:12.660683
2018-12-19T10:40:23
2018-12-19T10:40:23
133,268,772
0
1
null
null
null
null
UTF-8
Java
false
false
319
java
class base { private void disp() { System.out.println("base disp"); } } class sub extends base { void disp() { System.out.println("sub disp"); } } public class Demo7 { public static void main(String args[]) { base ref=new sub(); ref.disp(); // error disp() has private access in base } }
[ "ramdafale@gmail.com" ]
ramdafale@gmail.com
faf349a2aea67001e72cb8e862b7648f5b34cb69
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/gocd--gocd/27fd7a6b6d58e7bfdb922f1bb17e8f34cb3dc74e/after/CanonicalFilter.java
63c8ce7497a33dfb33ec3897e3069593b36eb0e1
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package nokogiri.internals.c14n; import nokogiri.XmlNode; import nokogiri.internals.NokogiriHelpers; import org.jruby.runtime.Block; import org.jruby.runtime.ThreadContext; import org.jruby.runtime.builtin.IRubyObject; import org.w3c.dom.Node; public class CanonicalFilter { private final Block block; private final ThreadContext context; public CanonicalFilter(ThreadContext context, Block block) { this.context = context; this.block = block; } public boolean includeNodes(Node currentNode, Node parentNode) { if (block == null || !block.isGiven()) return true; IRubyObject current = NokogiriHelpers.getCachedNodeOrCreate(context.getRuntime(), currentNode); IRubyObject parent = NokogiriHelpers.getCachedNodeOrCreate(context.getRuntime(), parentNode); if (parent.isNil()) { IRubyObject doc = ((XmlNode) current).document(context); boolean returnValue = block.call(context, current, doc).isTrue(); block.call(context, doc, context.nil); return returnValue; } return block.call(context, current, parent).isTrue(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
8614130af3e86134053cdafdcf404545f9b1259e
ddb5055fc4f14e6982ebc2f5cb47fb61b6f862b0
/src/main/java/org/snomed/snowstorm/core/data/services/mapper/DescriptionToConceptIdMapper.java
c4ef4ff933edaa9ea5abba636b823514c8a90f6c
[ "Apache-2.0" ]
permissive
metaruslan/snowstorm
0f3845593455f0f60acdc634fd28dc7f521faeb1
7cfd817fbf5939ed9d154761d0e0f56d796e5b7d
refs/heads/master
2020-09-06T17:33:57.547767
2019-11-16T16:02:53
2019-11-16T16:02:53
220,495,826
0
0
Apache-2.0
2019-11-08T15:33:14
2019-11-08T15:33:13
null
UTF-8
Java
false
false
1,454
java
package org.snomed.snowstorm.core.data.services.mapper; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.search.SearchHit; import org.snomed.snowstorm.core.data.domain.Description; import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.core.SearchResultMapper; import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage; import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl; import java.util.ArrayList; import java.util.Collection; import java.util.List; import static java.lang.Long.parseLong; public class DescriptionToConceptIdMapper implements SearchResultMapper { private final Collection<Long> conceptIds; public DescriptionToConceptIdMapper(Collection<Long> conceptIds) { this.conceptIds = conceptIds; } @Override public <T> AggregatedPage<T> mapResults(SearchResponse response, Class<T> clazz, Pageable pageable) { List<T> results = new ArrayList<>(); Description d = new Description(); SearchHit lastHit = null; for (SearchHit hit : response.getHits().getHits()) { conceptIds.add(parseLong(hit.getFields().get(Description.Fields.CONCEPT_ID).getValue())); results.add((T) d); lastHit = hit; } return new AggregatedPageImpl<>(results, pageable, response.getHits().getTotalHits(), response.getAggregations(), response.getScrollId(), lastHit != null ? lastHit.getSortValues() : null); } }
[ "kaikewley@gmail.com" ]
kaikewley@gmail.com
058e4cdcc01de6c3c56f0ddd085fb58e58b143df
b280a34244a58fddd7e76bddb13bc25c83215010
/scmv6/center-task1/src/main/java/com/smate/sie/center/task/dao/SiePatFullTextRefreshDao.java
445eb898c2541f830a2e75732db034c5797ea0cc
[]
no_license
hzr958/myProjects
910d7b7473c33ef2754d79e67ced0245e987f522
d2e8f61b7b99a92ffe19209fcda3c2db37315422
refs/heads/master
2022-12-24T16:43:21.527071
2019-08-16T01:46:18
2019-08-16T01:46:18
202,512,072
2
3
null
2022-12-16T05:31:05
2019-08-15T09:21:04
Java
UTF-8
Java
false
false
747
java
package com.smate.sie.center.task.dao; import java.util.List; import org.hibernate.Query; import org.springframework.stereotype.Repository; import com.smate.core.base.utils.data.SieHibernateDao; import com.smate.sie.center.task.model.SiePatFullTextRefresh; @Repository public class SiePatFullTextRefreshDao extends SieHibernateDao<SiePatFullTextRefresh, Long> { /** * 获取需要统计的记录 * * @param maxSize * @return */ @SuppressWarnings("unchecked") public List<SiePatFullTextRefresh> loadNeedCountUnitId(int maxSize) { String hql = "from SiePatFullTextRefresh t where t.status=0"; Query queryResult = super.createQuery(hql); queryResult.setMaxResults(maxSize); return queryResult.list(); } }
[ "zhiranhe@irissz.com" ]
zhiranhe@irissz.com
bfc78725e40bc89db31a353e5b118e8bc4759d85
0bfd357a0291b3f243e99bf6aaf56e257caad80f
/app/src/main/java/org/yczbj/ycrefreshview/collapsing/EightCollapsingActivity.java
d916d260e1591d115b118139cc2306e1a7e01c96
[ "Apache-2.0" ]
permissive
BravedBoy/YCRefreshView
b9ff1e70ea7e9351bccee229ec14c592a9161326
f604d11d19ab1c242707c37f4f71ff65d0581544
refs/heads/master
2023-04-13T23:41:43.818515
2022-02-12T12:54:08
2022-02-12T12:54:08
224,948,917
3
1
null
null
null
null
UTF-8
Java
false
false
3,396
java
package org.yczbj.ycrefreshview.collapsing; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.appcompat.widget.Toolbar; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.yc.cn.ycbannerlib.banner.BannerView; import com.yc.cn.ycbannerlib.banner.adapter.AbsStaticPagerAdapter; import com.yc.cn.ycbannerlib.banner.hintview.ColorPointHintView; import org.yczbj.ycrefreshview.data.DataProvider; import org.yczbj.ycrefreshview.R; import org.yczbj.ycrefreshview.data.AdData; import org.yczbj.ycrefreshview.refresh.PersonAdapter; import org.yczbj.ycrefreshviewlib.view.YCRefreshView; import org.yczbj.ycrefreshviewlib.inter.OnLoadMoreListener; import java.util.List; public class EightCollapsingActivity extends AppCompatActivity { YCRefreshView recyclerView; PersonAdapter adapter; private Handler handler = new Handler(); @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_collapsing); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); recyclerView = findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter = new PersonAdapter(this)); adapter.setMore(R.layout.view_more, new OnLoadMoreListener() { @Override public void onLoadMore() { handler.postDelayed(new Runnable() { @Override public void run() { adapter.addAll(DataProvider.getPersonList(0)); } }, 1000); } }); adapter.addAll(DataProvider.getPersonList(0)); BannerView rollPagerView = findViewById(R.id.rollPagerView); rollPagerView.setHintView(new ColorPointHintView(this, Color.YELLOW,Color.GRAY)); rollPagerView.setAdapter(new BannerAdapter()); } private class BannerAdapter extends AbsStaticPagerAdapter { private List<AdData> list; public BannerAdapter(){ list = DataProvider.getAdList(); } @Override public View getView(ViewGroup container, final int position) { ImageView imageView = new ImageView(EightCollapsingActivity.this); imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); //加载图片 Glide.with(EightCollapsingActivity.this) .load(list.get(position).getDrawable()) .placeholder(R.drawable.default_image) .into(imageView); //点击事件 imageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); return imageView; } @Override public int getCount() { return list.size(); } } }
[ "yangchong211@163.com" ]
yangchong211@163.com
9cb4948d1381d35137c635ac312c3e70c37b9f59
36a830de443917448c6779315c921ed6a2be2ba2
/src/main/java/lk/suwasewana/asset/userManagement/service/UserDetailsServiceImpl.java
0d977edd898028496dc390ed64f647a2458787ee
[]
no_license
LalithK90/suwasewana
c7c01160f0b1003fda917e65a7cb89c61049dff2
f845439854626ab84ad48d772e8ba31720f28c4d
refs/heads/master
2023-03-28T23:38:04.707493
2020-12-26T14:43:12
2020-12-26T14:43:12
262,740,163
0
2
null
2021-03-26T08:43:42
2020-05-10T08:08:09
HTML
UTF-8
Java
false
false
1,322
java
package lk.suwasewana.asset.userManagement.service; import lk.suwasewana.asset.userManagement.CustomerUserDetails; import lk.suwasewana.asset.userManagement.dao.UserDao; import lk.suwasewana.asset.userManagement.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service public class UserDetailsServiceImpl implements UserDetailsService { @Autowired private UserDao userDao; public UserDetailsServiceImpl() { } @Transactional( readOnly = true ) @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { User user = userDao.findByUsername(username.toLowerCase()); CustomerUserDetails userDetails; if ( user != null ) { userDetails = new CustomerUserDetails(); userDetails.setUser(user); } else { throw new UsernameNotFoundException("User not exist with name : " + username); } return userDetails; } }
[ "asakahatapitiya@gmail.com" ]
asakahatapitiya@gmail.com
eeafd29d1016562736d2488f89ca080a3895dc41
4b6368d31e71caa342b581e9ea7aacb6642ef7a7
/trunk/src/main/java/drjava/util/WrappedDisplay.java
2146c8cf5a0df64cabbc3af2c4a5aeea6f5a1f0c
[]
no_license
BGCX067/eye-ocr-svn-to-git
b1982c595fdbd0f7b2c6c04d251c6a4ed1700e2a
1f8cff851930b29aeef4be309585bdba7219cfea
refs/heads/master
2021-01-13T12:55:17.115523
2015-12-28T14:11:54
2015-12-28T14:11:54
48,699,481
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
/* (C) 2007 Stefan Reich (jazz@drjava.de) This source file is part of Project Prophecy. For up-to-date information, see http://www.drjava.de/prophecy This source file is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 2.1. */ package drjava.util; /** a Display implementation producing a line-wrapped string * with a (more or less) fixed line width */ public class WrappedDisplay implements Display { private int lineWidth = 80; private int col = 0; private StringBuilder stringBuilder = new StringBuilder(); public WrappedDisplay() { } public Display put(Object o) { if (o == null) printWord("null"); else if (o instanceof Displayable) ((Displayable) o).display(this); else printWord(ObjectUtil.toNiceStringU(o)); return this; } private void printWord(String word) { if (col + word.length() > lineWidth && col != 0) { realNewLine(); } stringBuilder.append(word); col += word.length(); } private void realNewLine() { stringBuilder.append("\r\n"); col = 0; } public Display nl() { printWord(" "); return this; } /** ignore the nl */ public Display putnl(Object o) { return put(o).put(" "); } public void beginSection(String section) { throw new RuntimeException("unimplemented"); } public void endSection() { throw new RuntimeException("unimplemented"); } public void indent() { } public void unindent() { } public void vspace() { } public void beginSubsection(String section) { throw new RuntimeException("unimplemented"); } public void endSubsection() { throw new RuntimeException("unimplemented"); } public String toString() { return stringBuilder.toString(); } }
[ "you@example.com" ]
you@example.com
9d2d9e68a84d0c260ac2f49ce00453f0e29f8fc0
7bf936a136e8b8aab712304143ab975a2003bbe3
/testng-core/src/test/java/test/dataprovider/issue2565/Data.java
e165ed4e7a81abefcc826eaf74f27e37fb5f7d54
[ "Apache-2.0" ]
permissive
kdevendraraju/testng
342045b373a25ec22e8f835fda81be66d9e1c63e
38279c6deae78cbfe0c616540b869bf69e9c896d
refs/heads/master
2023-06-08T15:34:40.539124
2023-05-30T02:59:47
2023-05-30T02:59:47
214,407,171
0
0
Apache-2.0
2019-10-21T17:08:19
2019-10-11T10:21:50
Java
UTF-8
Java
false
false
347
java
package test.dataprovider.issue2565; import java.util.ArrayList; import java.util.List; public enum Data { INSTANCE; private final List<String> data = new ArrayList<>(); public void addDatum(String datum) { data.add(datum); } public List<String> getData() { return data; } public void clear() { data.clear(); } }
[ "krishnan.mahadevan1978@gmail.com" ]
krishnan.mahadevan1978@gmail.com
39439505b13451a3fa69efaa6ea85e8a4f1cfa0e
2af7c41ced13c9b0b97a5a60e53d5fa792f89984
/game-server/src/main/java/net/dodian/old/world/entity/combat/method/impl/specials/MagicShortbowCombatMethod.java
80c78b40b979903188aaa971f81de316f4a0b843
[]
no_license
chollandcloud/317-game-server
b9dccb1ce8ff3a06931e8f9024fe530caff2bdd1
0977fbf2e0c9bff89974ceaff0324695e6cc014d
refs/heads/master
2023-08-09T23:48:49.586300
2021-03-11T21:28:41
2021-03-11T21:28:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,742
java
package net.dodian.old.world.entity.combat.method.impl.specials; import net.dodian.old.world.entity.combat.CombatFactory; import net.dodian.old.world.entity.combat.CombatSpecial; import net.dodian.old.world.entity.combat.CombatType; import net.dodian.old.world.entity.combat.hit.PendingHit; import net.dodian.old.world.entity.combat.method.CombatMethod; import net.dodian.old.world.entity.combat.ranged.RangedData.RangedWeaponData; import net.dodian.old.world.entity.impl.Character; import net.dodian.old.world.entity.impl.player.Player; import net.dodian.old.world.model.Animation; import net.dodian.old.world.model.Graphic; import net.dodian.old.world.model.GraphicHeight; import net.dodian.old.world.model.Priority; import net.dodian.old.world.model.Projectile; public class MagicShortbowCombatMethod implements CombatMethod { private static final Animation ANIMATION = new Animation(1074, Priority.HIGH); private static final Graphic GRAPHIC = new Graphic(250, GraphicHeight.HIGH, Priority.HIGH); @Override public CombatType getCombatType() { return CombatType.RANGED; } @Override public PendingHit[] getHits(Character character, Character target) { return new PendingHit[]{new PendingHit(character, target, this, true, 3), new PendingHit(character, target, this, true, 2)}; } @Override public boolean canAttack(Character character, Character target) { Player player = character.getAsPlayer(); //Check if current player's ranged weapon data is magic shortbow. if(!(player.getCombat().getRangedWeaponData() != null && player.getCombat().getRangedWeaponData() == RangedWeaponData.MAGIC_SHORTBOW)) { return false; } //Check if player has enough ammunition to fire. if(!CombatFactory.checkAmmo(player, 2)) { return false; } return true; } @Override public void preQueueAdd(Character character, Character target) { final Player player = character.getAsPlayer(); CombatSpecial.drain(player, CombatSpecial.MAGIC_SHORTBOW.getDrainAmount()); //Send 2 arrow projectiles new Projectile(player, target, 249, 40, 70, 43, 31, 0).sendProjectile(); new Projectile(character, target, 249, 33, 74, 48, 31, 0).sendProjectile(); //Remove 2 arrows from ammo CombatFactory.decrementAmmo(player, target.getPosition(), 2); } @Override public int getAttackSpeed(Character character) { return character.getBaseAttackSpeed() + 1; } @Override public int getAttackDistance(Character character) { return 6; } @Override public void startAnimation(Character character) { character.performAnimation(ANIMATION); character.performGraphic(GRAPHIC); } @Override public void finished(Character character) { } @Override public void handleAfterHitEffects(PendingHit hit) { } }
[ "nozemi95@gmail.com" ]
nozemi95@gmail.com
2bb4b5a83cbda55f173e3f0166c47bd04f8eae1f
c0c7adb8103b00a86909afaac23bd83b928419aa
/examples/DashFilter.java
06a5704a54f063b7c598ae349fe4b0bad8114678
[ "MIT" ]
permissive
fiveruns/dash-java
6d2cca0e32d4a0b5493eefe284dd1f60418a1def
bf13533bd217bb6634f6450c3894ec679b980ac6
refs/heads/master
2021-01-22T06:54:33.572842
2009-02-17T22:13:21
2009-02-18T22:52:26
122,569
1
0
null
2020-10-13T09:59:27
2009-02-05T19:40:44
Java
UTF-8
Java
false
false
4,071
java
package com.fiveruns.dash.examples; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import com.fiveruns.dash.*; /** * Integrates basic web server metrics into Dash: * response_time - the total wall time spent inside this filter * requests - the total number of requests served by this filter * * Then add this entry to your WEB-INF/web.xml: <filter> <filter-name>DashFilter</filter-name> <filter-class>com.fiveruns.dash.examples.DashFilter</filter-class> </filter> <filter-mapping> <filter-name>DashFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> * */ public class DashFilter implements Filter { public DashFilter() { } private static Map<Thread, Long> requests = null; private static Map<Thread, Long> times = null; public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { long a = System.currentTimeMillis(); try { chain.doFilter(request, response); } finally { long b = System.currentTimeMillis(); addTime(b - a); incrRequests(); } } private void incrRequests() { synchronized (requests) { Long count = requests.get(Thread.currentThread()); if (count == null) count = new Long(0); requests.put(Thread.currentThread(), new Long(count.longValue() + 1)); } } private void addTime(long time) { synchronized (times) { Long total = times.get(Thread.currentThread()); if (total == null) total = new Long(0); times.put(Thread.currentThread(), new Long(total.longValue() + time)); } } public void destroy() { Plugin.stop(); times = null; requests = null; } public static long getRequestsAndReset() { Map<Thread, Long> localRef = null; synchronized (requests) { localRef = requests; requests = new HashMap<Thread, Long>(); } long reqs = 0; for (long i : localRef.values()) { reqs += i; } System.out.println("Requests: " + reqs); return reqs; } public static double getResponseTimesAndReset() { Map<Thread, Long> localRef = null; synchronized (times) { localRef = times; times = new HashMap<Thread, Long>(); } double times = 0; for (double i : localRef.values()) { times += i; } double rc = ((double) times) / 1000; // return seconds, not milliseconds System.out.println("Response Time: " + rc); return rc; } public static class Requests extends BaseMetric { public String getName() { return "requests"; } public IMetricCallback getCallback() { return new IMetricCallback() { public NamespaceValue[] getCurrentValue() { return basicValue(getRequestsAndReset()); } }; } } public static class ResponseTime extends BaseMetric { public String getName() { return "response_time"; } public String getDataType() { return "time"; } public String getUnit() { return "sec"; } public IMetricCallback getCallback() { return new IMetricCallback() { public NamespaceValue[] getCurrentValue() { return basicValue(getResponseTimesAndReset()); } }; } } public void init(FilterConfig filterConfig) { requests = new HashMap<Thread, Long>(); times = new HashMap<Thread, Long>(); IMetric[] metrics = { new Requests(), new ResponseTime(), }; Plugin.start("d1e1316c26f6de0ba277b4feb9c336254628fd3e", new Recipe[] { new Recipe("Web Server", "http://dash.fiveruns.com", metrics) }); } }
[ "mperham@gmail.com" ]
mperham@gmail.com
208e687b849e979816172a377f13c0f8c3dc5728
355a3e703dc13e8212df3baff4c87460939b4a24
/src/main/java/com/hss/inspiration/pojo/OperationLog.java
163374656689b7a47e5f9c0c50c5ba7cb8bb1cae
[]
no_license
HssInspiration/family-server
657ae4816d6fdf63c88b55a71fd706467a79507a
ea881405c5ee1b007edf1552fc29ff1b2661763e
refs/heads/master
2023-06-23T09:49:45.515030
2021-07-18T10:40:26
2021-07-18T10:40:26
387,145,880
0
0
null
null
null
null
UTF-8
Java
false
false
1,298
java
package com.hss.inspiration.pojo; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.Date; /** * <p> * * </p> * * @author hss * @since 2021-06-06 */ @Data @EqualsAndHashCode(callSuper = false) @TableName("t_operation_log") public class OperationLog implements Serializable { private static final long serialVersionUID = 1L; /** * id-主键 */ @TableId("logId") private Long logId; /** * 操作类型 */ @TableField("operationType") private String operationType; /** * 创建时间(精确到秒) */ @TableField("createTime") private Date createTime; /** * 创建人名称 */ @TableField("createBy") private String createBy; /** * 更新时间(精确到秒) */ @TableField("updateTime") private Date updateTime; /** * 更新人名称 */ @TableField("updateBy") private String updateBy; /** * 操作内容 */ @TableField("operationContent") private String operationContent; private String remarks; }
[ "HssInspiration@aliyun.com" ]
HssInspiration@aliyun.com
c4abb1d68d33001add6bf182ff5261c6afb7ef88
85cfc652459ca2f015aa8c8dc55240721632cee0
/bin/custom/cartridge/cartridgefacades/src/com/hybris/cartridge/facades/process/email/context/OrderRefundEmailContext.java
d2aa2bb024411b89390c2a810d7ffacc0a1f7e50
[]
no_license
varshadhamal/Hybris-test
43e5479b9909e41e6276dfde6b4f4ff1cdae9b0e
a29c6090680110ab733e2077772c9c477d497df6
refs/heads/master
2020-03-18T06:31:01.940494
2018-05-22T11:58:12
2018-05-22T11:58:12
134,400,503
0
1
null
null
null
null
UTF-8
Java
false
false
3,745
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.hybris.cartridge.facades.process.email.context; import de.hybris.platform.acceleratorservices.model.cms2.pages.EmailPageModel; import de.hybris.platform.acceleratorservices.process.email.context.AbstractEmailContext; import de.hybris.platform.basecommerce.model.site.BaseSiteModel; import de.hybris.platform.commercefacades.order.data.OrderData; import de.hybris.platform.commercefacades.product.data.PriceData; import de.hybris.platform.commerceservices.enums.CustomerType; import de.hybris.platform.core.model.c2l.LanguageModel; import de.hybris.platform.core.model.order.OrderModel; import de.hybris.platform.core.model.user.CustomerModel; import de.hybris.platform.orderprocessing.model.OrderProcessModel; import de.hybris.platform.servicelayer.dto.converter.Converter; import org.springframework.beans.factory.annotation.Required; /** * Velocity context for a order refund email. */ public class OrderRefundEmailContext extends AbstractEmailContext<OrderProcessModel> { private Converter<OrderModel, OrderData> orderConverter; private OrderData orderData; private String orderCode; private String orderGuid; private boolean guest; private String storeName; private PriceData refundAmount; @Override public void init(final OrderProcessModel orderProcessModel, final EmailPageModel emailPageModel) { super.init(orderProcessModel, emailPageModel); orderData = getOrderConverter().convert(orderProcessModel.getOrder()); orderCode = orderProcessModel.getOrder().getCode(); orderGuid = orderProcessModel.getOrder().getGuid(); guest = CustomerType.GUEST.equals(getCustomer(orderProcessModel).getType()); storeName = orderProcessModel.getOrder().getStore().getName(); orderData = getOrderConverter().convert(orderProcessModel.getOrder()); refundAmount = orderData.getTotalPrice(); } @Override protected BaseSiteModel getSite(final OrderProcessModel orderProcessModel) { return orderProcessModel.getOrder().getSite(); } @Override protected CustomerModel getCustomer(final OrderProcessModel orderProcessModel) { return (CustomerModel) orderProcessModel.getOrder().getUser(); } protected Converter<OrderModel, OrderData> getOrderConverter() { return orderConverter; } @Required public void setOrderConverter(final Converter<OrderModel, OrderData> orderConverter) { this.orderConverter = orderConverter; } public OrderData getOrder() { return orderData; } @Override protected LanguageModel getEmailLanguage(final OrderProcessModel orderProcessModel) { return orderProcessModel.getOrder().getLanguage(); } public OrderData getOrderData() { return orderData; } public void setOrderData(final OrderData orderData) { this.orderData = orderData; } public String getOrderCode() { return orderCode; } public void setOrderCode(final String orderCode) { this.orderCode = orderCode; } public String getOrderGuid() { return orderGuid; } public void setOrderGuid(final String orderGuid) { this.orderGuid = orderGuid; } public boolean isGuest() { return guest; } public void setGuest(final boolean guest) { this.guest = guest; } public String getStoreName() { return storeName; } public void setStoreName(final String storeName) { this.storeName = storeName; } public PriceData getRefundAmount() { return refundAmount; } }
[ "varsha.d.saste@accenture.com" ]
varsha.d.saste@accenture.com
8e2e05972e1dec9584dd4af4bb8445899cd605f5
61a10a03959a1d4f94b244373f8a37565c555a7d
/luajpp2-core/src/main/java/nl/weeaboo/lua2/luajava/CoerceLuaToJava.java
33a03b1e979a2fd4bae21db51708ae634ca1a699
[ "MIT" ]
permissive
anonl/luajpp2
beaf479b7494bcf876e83d7be12fd0ed65e3c707
5128c8143e80302d38f6245f72baa53110efdd54
refs/heads/master
2021-07-23T20:39:43.941457
2021-07-22T18:51:12
2021-07-22T18:51:12
53,208,592
7
3
NOASSERTION
2021-03-31T19:03:19
2016-03-05T15:38:33
Java
UTF-8
Java
false
false
3,172
java
package nl.weeaboo.lua2.luajava; import static nl.weeaboo.lua2.vm.LuaNil.NIL; import java.lang.reflect.Array; import java.util.List; import javax.annotation.Nullable; import nl.weeaboo.lua2.vm.LuaValue; import nl.weeaboo.lua2.vm.Varargs; /** * Converts Lua objects to their equivalent Java objects. */ public final class CoerceLuaToJava { private CoerceLuaToJava() { } static void coerceArgs(Object[] out, Varargs luaArgs, List<Class<?>> javaParams) { final int jlen = javaParams.size(); if (jlen == 0) { return; } final int llen = luaArgs.narg(); final int minlen = Math.min(llen, jlen); final int jlast = jlen - 1; // Treat java functions ending in an array param as varargs for (int n = 0; n < jlast; n++) { out[n] = coerceArg(luaArgs.arg(1 + n), javaParams.get(n)); } final int vaCount = llen - jlast; if (llen > jlen && javaParams.get(jlast) .isArray()) { final Class<?> vaType = javaParams.get(jlast) .getComponentType(); Object temp = Array.newInstance(vaType, vaCount); for (int n = 0; n < vaCount; n++) { Array.set(temp, n, coerceArg(luaArgs.arg(1 + jlast + n), vaType)); } out[jlast] = temp; } else if (llen > jlen && javaParams.get(jlast) == Varargs.class) { out[jlast] = luaArgs.subargs(1 + jlast); } else { if (jlast >= 0) { out[jlast] = coerceArg(luaArgs.arg(1 + jlast), javaParams.get(jlast)); } for (int n = minlen; n < jlen; n++) { out[n] = CoerceLuaToJava.coerceArg(NIL, javaParams.get(n)); } } } /** * Casts or converts the given Lua value to the given Java type. * * @see ITypeCoercions#toJava(LuaValue, Class) */ public static @Nullable <T> T coerceArg(LuaValue lv, Class<T> c) { return ITypeCoercions.getCurrent().toJava(lv, c); } /** * Judges how well the given Lua and Java parameters match. The algorithm looks at the number of * parameters as well as their types. The output of this method is a score, where lower scores indicate a * better match. * * @return The score, lower scores are better matches */ public static int scoreParamTypes(Varargs luaArgs, List<Class<?>> javaParams) { // Init score & minimum length int score; final int llen = luaArgs.narg(); final int jlen = javaParams.size(); final int len; if (jlen == llen) { // Same length or possible vararg score = 0; len = jlen; } else if (jlen > llen) { score = 0x4000; len = llen; } else { score = 0x8000; len = jlen; } // Compare args ITypeCoercions typeCoercions = ITypeCoercions.getCurrent(); for (int n = 0; n < len; n++) { score += typeCoercions.scoreParam(luaArgs.arg(1 + n), javaParams.get(n)); } return score; } }
[ "mail@weeaboo.nl" ]
mail@weeaboo.nl
58d83b17b890c961ef5c940576a63c7484e3fe92
8bf8659254983f5a2ed0d61a9e5eda2ef5e51760
/slider-core/src/main/java/org/apache/hoya/yarn/HoyaActions.java
fd5992abd98cb0805933045d580d71cf1079b313
[ "Apache-2.0" ]
permissive
xgong/slider
e8ef4945b4282d52e18a8fe515dc005601fa2fa7
d5a582f70393e249dbc0babbd01b50673ea5e357
refs/heads/master
2021-01-21T09:23:59.469461
2014-04-29T19:15:36
2014-04-29T19:15:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,113
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.hoya.yarn; /** * Actions. * Only some of these are supported by specific Hoya Services; they * are listed here to ensure the names are consistent */ public interface HoyaActions { String ACTION_AM_SUICIDE = "am-suicide"; String ACTION_BUILD = "build"; String ACTION_CREATE = "create"; String ACTION_DESTROY = "destroy"; String ACTION_ECHO = "echo"; String ACTION_EXISTS = "exists"; String ACTION_FLEX = "flex"; String ACTION_FREEZE = "freeze"; String ACTION_GETCONF = "getconf"; String ACTION_HELP = "help"; String ACTION_KILL_CONTAINER = "kill-container"; String ACTION_LIST = "list"; String ACTION_PREFLIGHT = "preflight"; String ACTION_RECONFIGURE = "reconfigure"; String ACTION_REGISTRY = "registry"; String ACTION_STATUS = "status"; String ACTION_THAW = "thaw"; String ACTION_USAGE = "usage"; String ACTION_VERSION = "version"; String DESCRIBE_ACTION_AM_SUICIDE = "Tell the Slider Application Master to simulate a process failure by terminating itself"; String DESCRIBE_ACTION_BUILD = "Build a Slider cluster specification -but do not start it"; String DESCRIBE_ACTION_CREATE = "Create a live Slider application"; String DESCRIBE_ACTION_DESTROY = "Destroy a frozen Slider application)"; String DESCRIBE_ACTION_EXISTS = "Probe for an application running"; String DESCRIBE_ACTION_FLEX = "Flex a Slider application"; String DESCRIBE_ACTION_FREEZE = "Freeze/suspend a running application"; String DESCRIBE_ACTION_GETCONF = "Get the configuration of an application"; String DESCRIBE_ACTION_KILL_CONTAINER = "Kill a container in the application"; String DESCRIBE_ACTION_HELP = "Print help information"; String DESCRIBE_ACTION_LIST = "List running Slider applications"; String DESCRIBE_ACTION_MONITOR = "Monitor a running application"; String DESCRIBE_ACTION_REGISTRY = "Query the registry of a YARN application"; String DESCRIBE_ACTION_STATUS = "Get the status of an application"; String DESCRIBE_ACTION_THAW = "Thaw a frozen application"; String DESCRIBE_ACTION_VERSION = "Print the Slider version information"; }
[ "stevel@hortonworks.com" ]
stevel@hortonworks.com
3205ce440ccc9f9ae63edf714df54b170fad30c1
f77d04f1e0f64a6a5e720ce24b65b1ccb3c546d2
/zyj-hec-master/zyj-hec/src/main/java/com/hand/hec/expm/mapper/ExpReportLineMapper.java
b21e2a47dd062100b3ff092300606dd0219ef523
[]
no_license
floodboad/zyj-hssp
3139a4e73ec599730a67360cd04aa34bc9eaf611
dc0ef445935fa48b7a6e86522ec64da0042dc0f3
refs/heads/master
2023-05-27T21:28:01.290266
2020-01-03T06:21:59
2020-01-03T06:29:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,616
java
package com.hand.hec.expm.mapper; import com.hand.hap.mybatis.common.Mapper; import com.hand.hec.exp.dto.ExpMoExpenseItem; import com.hand.hec.exp.dto.ExpMoExpenseType; import com.hand.hec.expm.dto.ExpReportLine; import org.apache.ibatis.annotations.Param; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.Date; import java.util.List; /** * <p> * ExpReportLineMapper * </p> * * @author yang.duan 2019/01/10 15:02 */ public interface ExpReportLineMapper extends Mapper<ExpReportLine> { /** * 查询默认报销类型 * * @author yang.cai 2019-3-6 9:54 * @return 默认报销类型 */ List<ExpMoExpenseType> queryExpenseTypeDefault(@Param("moExpReportTypeId") Long moExpReportTypeId, @Param("pageElementCode") String pageElementCode, @Param("companyId") Long companyId); /** * 查询报销类型 * * @param moExpReportTypeId * @param pageElementCode * @param companyId * @author yang.cai 2019-3-6 9:54 * @return 报销类型 */ List<ExpMoExpenseType> queryExpenseType(@Param("moExpReportTypeId") Long moExpReportTypeId, @Param("pageElementCode") String pageElementCode, @Param("companyId") Long companyId); /** * <p>查询费用项目</p> * * @param moExpReportTypeId * @param moExpenseTypeId * @param pageElementCode * @param companyId * @return List<ExpMoExpenseItem> * @author yang.duan 2019/4/26 17:01 **/ List<ExpMoExpenseItem> queryExpenseItem(@Param("moExpReportTypeId") Long moExpReportTypeId, @Param("moExpenseTypeId") Long moExpenseTypeId, @Param("pageElementCode") String pageElementCode, @Param("companyId") Long companyId); // /** // * 查询税种代码 // * // * @param expReportLine // * @author yang.cai 2019-3-6 9:54 // * @return 税种代码 // */ // List<ExpReportLine> queryTaxTypeCode(ExpReportLine expReportLine); Long getMaxLineNUmber(@Param("expReportHeaderId") Long expReportHeaderId); /** * 单据审核批量更新行数据 * * @Author hui.zhao01@hand-china.com * @Date 2019/3/7 14:36 * @param expReportHeaderId 报销单头Id * @param auditDate 审核日期 * @param auditDateTime 带时区审核日期 * @param auditFlag 审核标志 * @return * @Version 1.0 **/ void batchUpdate(@Param("expReportHeaderId") Long expReportHeaderId, @Param("auditDate") Date auditDate, @Param("auditDateTime") Timestamp auditDateTime, @Param("auditFlag") String auditFlag); /** * 单据审核拒绝批量更新行数据 * * @Author hui.zhao01@hand-china.com * @Date 2019/3/7 14:36 * @param expReportHeaderId 报销单头Id * @param reportStatus 单据状态 * @param auditFlag 审核标志 * @return * @Version 1.0 **/ void auditRejectBatchUpdate(@Param("expReportHeaderId") Long expReportHeaderId, @Param("reportStatus") String reportStatus, @Param("auditFlag") String auditFlag); /** * <p> * 获取报销单页面属性类型 * <p/> * * @param expReportHeaderId 报销单头ID * @return 页面属性类型 * @author yang.duan 2019/3/14 11:22 */ String getReportPageElementCode(@Param("expReportHeaderId") Long expReportHeaderId); /** * <p> * 校验分配行金额与行金额是否相等 * <p/> * * @param expReportHeaderId 报销单头ID * @return * @author yang.duan 2019/4/2 19:49 */ Long checkDisAmount(@Param("expReportHeaderId") Long expReportHeaderId); /** * <p> * 查询报销单行主数据 * <p/> * * @param expReportHeaderId 报销单头ID * @param reportPageElementCode 页面元素类型code * @return 报销单行list * @author yang.duan 2019/4/3 13:22 */ List<ExpReportLine> reportLineQuery(@Param("expReportHeaderId") Long expReportHeaderId, @Param("reportPageElementCode") String reportPageElementCode); void updateStatus(@Param("reportStatus") String reportStatus, @Param("userId") Long userId, @Param("expReportHeaderId") Long expReportHeaderId); /** *获取报销单付款总金额 * *@Author hui.zhao01@hand-china.com *@Date 2019/6/2 15:36 *@param reportHeaderId *@return BigDecimal *@Version 1.0 **/ BigDecimal getTotalPaymentAmount(@Param("reportHeaderId") Long reportHeaderId); }
[ "1961187382@qq.com" ]
1961187382@qq.com
bdfe7603ee0577d288544e15caf1b146fa46b898
0cc3358e3e8f81b854f9409d703724f0f5ea2ff7
/src/za/co/mmagon/jwebswing/plugins/angularbootstrapdatetimedropdown/BSDateTimePickerConfigOptions.java
6dac1f888cd1f4f0cf8404c3f498c21abf6c2464
[]
no_license
jsdelivrbot/JWebMP-CompleteFree
c229dd405fe44d6c29ab06eedaecb7a733cbb183
d5f020a19165418eb21507204743e596bee2c011
refs/heads/master
2020-04-10T15:12:35.635284
2018-12-10T01:03:58
2018-12-10T01:03:58
161,101,028
0
0
null
2018-12-10T01:45:25
2018-12-10T01:45:25
null
UTF-8
Java
false
false
5,092
java
/* * Copyright (C) 2017 Marc Magon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package za.co.mmagon.jwebswing.plugins.angularbootstrapdatetimedropdown; import za.co.mmagon.jwebswing.base.ComponentHierarchyBase; import za.co.mmagon.jwebswing.htmlbuilder.javascript.JavaScriptPart; /** * * @author GedMarc * @since 07 Feb 2017 * */ public class BSDateTimePickerConfigOptions extends JavaScriptPart { private static final long serialVersionUID = 1L; /** * The actual drop down selector */ private String dropdownSelector; /** * startView * <p> * String. Default: 'day' * <p> * The view that the datetimepicker should show when it is opened. Accepts values of : * <p> * 'minute' for the minute view 'hour' for the hour view 'day' for the day view (the default) 'month' for the 12-month view 'year' for the 10-year overview. Useful for date-of-birth * datetimepickers. * <p> */ private String startView; /** * minView * <p> * String. 'minute' * <p> * The lowest view that the datetimepicker should show. * <p> * Accepts the same values as startView. */ private String minView; /** * minuteStep * <p> * Number. Default: 5 * <p> * The increment used to build the hour view. A button is created for each minuteStep minutes. */ private Integer minuteStep; public BSDateTimePickerConfigOptions() { } /** * The id the selector (with #) * * @return */ public String getDropdownSelector() { return dropdownSelector; } /** * Sets the drop down selector directly (for class assignment etc) * * @param dropdownSelector * * @return */ public BSDateTimePickerConfigOptions setDropdownSelector(String dropdownSelector) { this.dropdownSelector = dropdownSelector; return this; } /** * Sets the drop down selector to a component * * @param dropdownSelector * * @return */ public BSDateTimePickerConfigOptions setDropdownSelector(ComponentHierarchyBase dropdownSelector) { this.dropdownSelector = dropdownSelector.getID(true); return this; } /** * startView * <p> * String. Default: 'day' * <p> * The view that the datetimepicker should show when it is opened. Accepts values of : * <p> * 'minute' for the minute view 'hour' for the hour view 'day' for the day view (the default) 'month' for the 12-month view 'year' for the 10-year overview. Useful for date-of-birth * datetimepickers. * * @return */ public String getStartView() { return startView; } /** * startView * <p> * String. Default: 'day' * <p> * The view that the datetimepicker should show when it is opened. Accepts values of : * <p> * 'minute' for the minute view 'hour' for the hour view 'day' for the day view (the default) 'month' for the 12-month view 'year' for the 10-year overview. Useful for date-of-birth * datetimepickers. * * @param startView */ public void setStartView(String startView) { this.startView = startView; } /** * minView * <p> * String. 'minute' * <p> * The lowest view that the datetimepicker should show. * <p> * Accepts the same values as startView. * * @return */ public String getMinView() { return minView; } /** * minView * <p> * String. 'minute' * <p> * The lowest view that the datetimepicker should show. * <p> * Accepts the same values as startView. * * @param minView */ public void setMinView(String minView) { this.minView = minView; } /** * minuteStep * <p> * Number. Default: 5 * <p> * The increment used to build the hour view. A button is created for each minuteStep minutes. * * @return */ public Integer getMinuteStep() { return minuteStep; } /** * minuteStep * <p> * Number. Default: 5 * <p> * The increment used to build the hour view. A button is created for each minuteStep minutes. * * @param minuteStep */ public void setMinuteStep(Integer minuteStep) { this.minuteStep = minuteStep; } }
[ "ged_marc@hotmail.com" ]
ged_marc@hotmail.com
7e7203f52c684531d95bc36a6446d7d6b722a599
4a7cb14aa934df8f362cf96770e3e724657938d8
/MFES/ATS/Project/analysis/projects/2/.evosuite/tmp_2021_01_25_20_49_42/tests/Voluntario_ESTest.java
c987c883653f522002912d42fbbb58d1f15dffac
[]
no_license
pCosta99/Masters
7091a5186f581a7d73fd91a3eb31880fa82bff19
f835220de45a3330ac7a8b627e5e4bf0d01d9f1f
refs/heads/master
2023-08-11T01:01:53.554782
2021-09-22T07:51:51
2021-09-22T07:51:51
334,012,667
1
1
null
null
null
null
UTF-8
Java
false
false
3,040
java
/* * This file was automatically generated by EvoSuite * Mon Jan 25 20:55:18 GMT 2021 */ import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class Voluntario_ESTest extends Voluntario_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { Voluntario voluntario0 = new Voluntario(); assertFalse(voluntario0.estaDisponivel()); voluntario0.setDisponivel(true); boolean boolean0 = voluntario0.estaDisponivel(); assertTrue(boolean0); } @Test(timeout = 4000) public void test1() throws Throwable { Voluntario voluntario0 = new Voluntario(); voluntario0.setRaio((-2215.3286615859683)); Voluntario voluntario1 = voluntario0.clone(); assertFalse(voluntario1.estaDisponivel()); } @Test(timeout = 4000) public void test2() throws Throwable { Voluntario voluntario0 = new Voluntario(); Voluntario voluntario1 = voluntario0.clone(); assertFalse(voluntario1.estaDisponivel()); } @Test(timeout = 4000) public void test3() throws Throwable { Voluntario voluntario0 = new Voluntario("", "1", "", (Ponto2D) null, 822.50960729417, 1091, 1091, true); Voluntario voluntario1 = voluntario0.clone(); assertTrue(voluntario1.estaDisponivel()); } @Test(timeout = 4000) public void test4() throws Throwable { Voluntario voluntario0 = null; try { voluntario0 = new Voluntario((Voluntario) null); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("Perfil", e); } } @Test(timeout = 4000) public void test5() throws Throwable { Voluntario voluntario0 = new Voluntario(); Voluntario voluntario1 = new Voluntario(voluntario0); assertFalse(voluntario1.estaDisponivel()); } @Test(timeout = 4000) public void test6() throws Throwable { Voluntario voluntario0 = new Voluntario(); boolean boolean0 = voluntario0.estaDisponivel(); assertFalse(boolean0); } @Test(timeout = 4000) public void test7() throws Throwable { Ponto2D ponto2D0 = mock(Ponto2D.class, new ViolatedAssumptionAnswer()); doReturn("^Xc").when(ponto2D0).toString(); Voluntario voluntario0 = new Voluntario("^Xc", "^Xc", "^Xc", ponto2D0, 0.6037720658009351, (-1749), (-1749), false); Voluntario voluntario1 = voluntario0.clone(); assertFalse(voluntario1.estaDisponivel()); } }
[ "costapedro.a1999@gmail.com" ]
costapedro.a1999@gmail.com
2c976a7430c7e6953a091de0a687214ae9e4c238
7ced4b8259a5d171413847e3e072226c7a5ee3d2
/Workspace/Demux/Binary Search/aggressive-cows.java
3cc1efac10e8998c5934ee6093b15ed07bca2211
[]
no_license
tanishq9/Data-Structures-and-Algorithms
8d4df6c8a964066988bcf5af68f21387a132cd4d
f6f5dec38d5e2d207fb29ad4716a83553924077a
refs/heads/master
2022-12-13T03:57:39.447650
2020-09-05T13:16:55
2020-09-05T13:16:55
119,425,479
1
1
null
null
null
null
UTF-8
Java
false
false
1,175
java
boolean isPossible(ArrayList<Integer> A,int dist,int B){ int bullsPlaced=1; int lastBullLocation=A.get(0); for(int i=1;i<A.size();i++){ int currentBullLocation=A.get(i); if((currentBullLocation-lastBullLocation)>=dist){ bullsPlaced+=1; lastBullLocation=currentBullLocation; if(bullsPlaced==B){ return true; } } } return false; } public int solve(ArrayList<Integer> A, int B) { // Search Space : [0,Max(A)-Min(A)] Collections.sort(A); int lo=Integer.MAX_VALUE,hi=Integer.MIN_VALUE,mid; for(int i:A){ lo=Math.min(lo,i); hi=Math.max(hi,i); } hi=hi-lo; lo=0; // T*F* framework : last True // pred(x) : isPossible(x) while(lo<hi){ mid=lo+(hi-lo+1)/2; if(isPossible(A,mid,B)){ lo=mid; }else{ hi=mid-1; } } if(isPossible(A,lo,B)){ return lo; }else{ return -1; } }
[ "tanishqsaluja18@gmail.com" ]
tanishqsaluja18@gmail.com
695dfe45c07e637e07b01ceb0bf3a0ba83cf45bf
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/baike/sources/qsbk/app/live/ui/family/MessageAdapter.java
8c22cfc343231b92b057bef205c0b51c7026b860
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
4,671
java
package qsbk.app.live.ui.family; import android.content.Context; import android.graphics.Color; import android.support.v7.widget.RecyclerView.Adapter; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.facebook.drawee.view.SimpleDraweeView; import java.util.List; import qsbk.app.core.net.NetRequest; import qsbk.app.core.net.UrlConstants; import qsbk.app.core.utils.AppUtils; import qsbk.app.core.utils.DateUtil; import qsbk.app.live.R; import qsbk.app.live.ui.helper.LevelHelper; import qsbk.app.live.widget.FamilyLevelView; public class MessageAdapter extends Adapter<ViewHolder> { private List<Message> a; private Context b; public static class ViewHolder extends android.support.v7.widget.RecyclerView.ViewHolder { public FamilyLevelView fl_level; public SimpleDraweeView ivImage; public TextView tvAction; public TextView tvLevel; public TextView tvMessageType; public TextView tvName; public TextView tvTime; public ViewHolder(View view) { super(view); this.ivImage = (SimpleDraweeView) view.findViewById(R.id.iv_image); this.tvName = (TextView) view.findViewById(R.id.tv_name); this.tvLevel = (TextView) view.findViewById(R.id.tv_user_lv); this.tvMessageType = (TextView) view.findViewById(R.id.tv_message_type); this.tvTime = (TextView) view.findViewById(R.id.tv_time); this.tvAction = (TextView) view.findViewById(R.id.tv_action); this.fl_level = (FamilyLevelView) view.findViewById(R.id.fl_level); } } public MessageAdapter(Context context, List<Message> list) { this.a = list; this.b = context; } public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { return new ViewHolder(LayoutInflater.from(this.b).inflate(R.layout.item_family_message, viewGroup, false)); } public void onBindViewHolder(ViewHolder viewHolder, int i) { Message message = (Message) this.a.get(i); viewHolder.tvName.setText(message.getUserName()); LevelHelper.setLevelText(viewHolder.tvLevel, message.getUserLevel()); int userFamilyLevel = message.getUserFamilyLevel(); if (TextUtils.isEmpty(message.getUserBadge())) { viewHolder.fl_level.setVisibility(8); } else { viewHolder.fl_level.setVisibility(0); viewHolder.fl_level.setLevelAndName(userFamilyLevel, message.getUserBadge()); } AppUtils.getInstance().getImageProvider().loadAvatar(viewHolder.ivImage, message.getUserAvatar()); viewHolder.tvMessageType.setText(message.cont); viewHolder.tvTime.setText(DateUtil.getAccuracyTimePostStr(message.time)); viewHolder.tvAction.setVisibility(0); viewHolder.tvAction.setBackgroundResource(0); viewHolder.tvAction.setTextColor(Color.parseColor("#C0BFC0")); switch (message.getStatus()) { case 0: viewHolder.tvAction.setText(this.b.getString(R.string.family_agree)); viewHolder.tvAction.setBackgroundResource(R.drawable.btn_yellow_selector); viewHolder.tvAction.setTextColor(Color.parseColor("#7B4600")); viewHolder.tvAction.setOnClickListener(new bk(this, message)); break; case 1: viewHolder.tvAction.setText(this.b.getString(R.string.family_agreed)); break; case 2: viewHolder.tvAction.setText(this.b.getString(R.string.family_denied)); break; case 3: viewHolder.tvAction.setText(this.b.getString(R.string.family_ignored)); break; case 6: viewHolder.tvAction.setText(this.b.getString(R.string.family_applied)); break; default: viewHolder.tvAction.setVisibility(8); break; } viewHolder.ivImage.setOnClickListener(new bl(this, message)); viewHolder.itemView.setOnClickListener(new bm(this, message)); } public int getItemCount() { return this.a != null ? this.a.size() : 0; } private void a(Message message) { a(message, 1); } private void b(Message message) { a(message, 2); } private void c(Message message) { a(message, 3); } private void a(Message message, int i) { NetRequest.getInstance().post(UrlConstants.FAMILY_PROCESS, new bo(this, message, i)); } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
38489ce6f94dbc82954153ba06ada8715262d8ee
783756ca6232c3ee6a040683dee90e11c7727030
/src/main/java/edu/emory/cs/sort/comparison/ShellSortKnuth.java
04e01ea1d80d6fbb6a57f3c6e849a8da0e5e50f9
[]
no_license
0127Aaron/dsa-java-sample
a118a21d152245f4626a2a7925fa515e61940290
c92b236aca94bbb4f346231f62aeb3d300380811
refs/heads/master
2022-12-06T15:18:13.591117
2020-08-24T19:38:43
2020-08-24T19:38:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,619
java
/* * Copyright 2020 Emory University * * 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 edu.emory.cs.sort.comparison; import java.util.Collections; import java.util.Comparator; /** * @author Jinho D. Choi ({@code jinho.choi@emory.edu}) */ public class ShellSortKnuth<T extends Comparable<T>> extends ShellSort<T> { public ShellSortKnuth() { this(Comparator.naturalOrder()); } public ShellSortKnuth(Comparator<T> comparator) { this(comparator, 1000); } public ShellSortKnuth(Comparator<T> comparator, int n) { super(comparator, n); } @Override protected void populateSequence(int n) { n /= 3; for (int t = sequence.size() + 1; ; t++) { int h = (int) ((Math.pow(3, t) - 1) / 2); if (h <= n) sequence.add(h); else break; } } @Override protected int getSequenceStartIndex(int n) { int index = Collections.binarySearch(sequence, n / 3); if (index < 0) index = -(index + 1); if (index == sequence.size()) index--; return index; } }
[ "jinho.choi@emory.edu" ]
jinho.choi@emory.edu
f0c2bf19782ffd5ff2b08291487dd3675aef8d4f
a7784a56425284ba53e7bc93a79aa0946cc87e6c
/microservices-kafka/microservice-kafka-order/src/main/java/pe/joedayz/microservice/order/item/ItemRepository.java
6b2ad486fd3ff90fe6e21572d8a729573d7c6021
[ "Apache-2.0" ]
permissive
joedayz/microservices-with-kafka
5f752e96099db3bee57a1630887b62faff11ed0a
24865c51ae56b951900c9660ce2b5990e77cf398
refs/heads/master
2020-08-28T22:05:16.526135
2019-10-27T19:14:22
2019-10-27T19:14:22
217,834,972
4
0
null
null
null
null
UTF-8
Java
false
false
666
java
package pe.joedayz.microservice.order.item; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import java.util.List; @RepositoryRestResource(exported = false) public interface ItemRepository extends PagingAndSortingRepository<Item, Long> { List<Item> findByName(@Param("name") String name); List<Item> findByNameContaining(@Param("name") String name); @Query("SELECT price FROM Item i WHERE i.itemId=?1") double price(long itemId); }
[ "jadiaz@farmaciasperuanas.pe" ]
jadiaz@farmaciasperuanas.pe
432db3efab1a86b55c75af9e4365ee958ead80d5
893fd55d55e65354c563c69d3c3f3d28a72b3a6b
/OpenADRModel20a/src/main/java/com/avob/openadr/model/oadr20a/builders/Oadr20aBuilders.java
c739ab280a115f6ab58b836b99d22e66999234db
[ "Apache-2.0" ]
permissive
avob/OpenADR
62a63e08d13e792d8c7ff0b186641b74b49d5b6f
7608f780509e5669bbf5bd311c8cb3206cebf7ac
refs/heads/master
2022-09-18T21:56:32.315131
2021-09-06T06:22:02
2021-09-06T06:22:02
169,761,438
45
18
Apache-2.0
2022-02-16T01:15:15
2019-02-08T16:07:39
Java
UTF-8
Java
false
false
4,165
java
package com.avob.openadr.model.oadr20a.builders; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aCreatedEventBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aCreatedEventEventResponseBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aDistributeEventBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aDistributeEventOadrEventBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aEiActivePeriodTypeBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aEiEventSignalTypeBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aEiTargetTypeBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aEventDescriptorTypeBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aIntervalTypeBuilder; import com.avob.openadr.model.oadr20a.builders.eievent.Oadr20aRequestEventBuilder; import com.avob.openadr.model.oadr20a.builders.response.Oadr20aEiResponseBuilder; import com.avob.openadr.model.oadr20a.builders.response.Oadr20aResponseBuilder; import com.avob.openadr.model.oadr20a.ei.EiResponse; import com.avob.openadr.model.oadr20a.ei.EventStatusEnumeratedType; import com.avob.openadr.model.oadr20a.ei.OptTypeType; import com.avob.openadr.model.oadr20a.ei.SignalTypeEnumeratedType; public class Oadr20aBuilders { private Oadr20aBuilders() { } public static Oadr20aCreatedEventBuilder newCreatedEventBuilder(String venId, String requestId, int responseCode) { return new Oadr20aCreatedEventBuilder(venId, requestId, responseCode); } public static Oadr20aRequestEventBuilder newOadrRequestEventBuilder(String venId, String requestId) { return new Oadr20aRequestEventBuilder(venId, requestId); } public static Oadr20aDistributeEventBuilder newOadr20aDistributeEventBuilder(String vtnId, String requestId) { return new Oadr20aDistributeEventBuilder(vtnId, requestId); } public static Oadr20aDistributeEventOadrEventBuilder newOadr20aDistributeEventOadrEventBuilder() { return new Oadr20aDistributeEventOadrEventBuilder(); } public static Oadr20aEventDescriptorTypeBuilder newOadr20aEventDescriptorTypeBuilder(Long createdTimespamp, String eventId, long modificationNumber, String marketContext, EventStatusEnumeratedType status) { return new Oadr20aEventDescriptorTypeBuilder(createdTimespamp, eventId, modificationNumber, marketContext, status); } public static Oadr20aEiTargetTypeBuilder newOadr20aEiTargetTypeBuilder() { return new Oadr20aEiTargetTypeBuilder(); } public static Oadr20aEiEventSignalTypeBuilder newOadr20aEiEventSignalTypeBuilder(String signalId, String signalName, SignalTypeEnumeratedType signalType, float currentValue) { return new Oadr20aEiEventSignalTypeBuilder(signalId, signalName, signalType, currentValue); } public static Oadr20aEiActivePeriodTypeBuilder newOadr20aEiActivePeriodTypeBuilder(long timestampStart, String eventXmlDuration, String toleranceXmlDuration, String notificationXmlDuration) { return new Oadr20aEiActivePeriodTypeBuilder(timestampStart, eventXmlDuration, toleranceXmlDuration, notificationXmlDuration); } public static Oadr20aResponseBuilder newOadr20aResponseBuilder(String requestId, int responseCode) { return new Oadr20aResponseBuilder(requestId, responseCode); } public static Oadr20aResponseBuilder newOadr20aResponseBuilder(EiResponse response) { return new Oadr20aResponseBuilder(response); } public static Oadr20aIntervalTypeBuilder newOadr20aIntervalTypeBuilder(String intervalId, String xmlDuration, float value) { return new Oadr20aIntervalTypeBuilder(intervalId, xmlDuration, value); } public static Oadr20aEiResponseBuilder newOadr20aEiResponseBuilder(String requestId, int responseCode) { return new Oadr20aEiResponseBuilder(requestId, responseCode); } public static Oadr20aCreatedEventEventResponseBuilder newOadr20aCreatedEventEventResponseBuilder(String eventId, long modificationNumber, String requestId, int responseCode, OptTypeType opt) { return new Oadr20aCreatedEventEventResponseBuilder(eventId, modificationNumber, requestId, responseCode, opt); } }
[ "zanni.bertrand@gmail.com" ]
zanni.bertrand@gmail.com
4dc29ff81295692bd76312204a876c36aa8ea80a
cd2796fba85c4bacf5d27bf00fad7a2dd8bc459d
/app/src/main/java/com/example/myapplication/getContacts/GetContactsActivity.java
ce3382f4e04eca0e78ca0d8b7b377cde532fc064
[]
no_license
suryakishore/MyNewCar
e9f7772645d4d0f19244355cebcaf99fba86d303
50f9b9df0463e0efff3e06602b02e3a7453057b3
refs/heads/master
2021-05-19T12:34:16.812483
2020-03-31T18:54:09
2020-03-31T18:54:09
251,701,073
0
0
null
null
null
null
UTF-8
Java
false
false
4,166
java
package com.example.myapplication.getContacts; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.databinding.DataBindingUtil; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import com.example.myapplication.R; import com.example.myapplication.databinding.ActivityGetContactsBinding; import com.example.myapplication.showContacts.ContactsSelectedData; import java.util.ArrayList; import java.util.function.Predicate; /** * used for get contacts from device. */ public class GetContactsActivity extends AppCompatActivity { public static final int REQUEST_READ_CONTACTS = 10; private ActivityGetContactsBinding mBinding; private GetContactsAdapter mGetContactsAdapter; private ArrayList<ContactsSelectedData> mContactsSelectedData = new ArrayList<>(); private GetContactsViewModel mGetContactsViewModel; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initializeView(); initializeViewModel(); contactsFromDevice(); subscribeSubmitData(); } /** * initialize view */ private void initializeView() { mBinding = DataBindingUtil.setContentView(this, R.layout.activity_get_contacts); } /** * this method is used to initialize for viewModel */ private void initializeViewModel() { mGetContactsViewModel = ViewModelProviders.of(this).get(GetContactsViewModel.class); mBinding.setViewModel(mGetContactsViewModel); mGetContactsAdapter = new GetContactsAdapter(mContactsSelectedData); mBinding.rvContactsList.setAdapter(mGetContactsAdapter); } /** * get contact from device after permission accepted. */ private void contactsFromDevice() { if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) { mContactsSelectedData.addAll(getAllContacts()); mGetContactsAdapter.notifyDataSetChanged(); } else { requestPermission(); } } private void subscribeSubmitData() { mGetContactsViewModel.submitData().observe(this, new Observer<Boolean>() { @Override public void onChanged(Boolean aBoolean) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { Predicate<ContactsSelectedData> condition = new Predicate<ContactsSelectedData>() { @Override public boolean test(ContactsSelectedData contactsSelectedData) { return contactsSelectedData.isChecked() == false; } }; mContactsSelectedData.removeIf(condition); Intent intent = new Intent(); intent.putExtra("Data", mContactsSelectedData); setResult(Activity.RESULT_OK, intent); finish(); } } }); } private ArrayList<ContactsSelectedData> getAllContacts() { return mGetContactsViewModel.getContactsData(this); } private void requestPermission() { if (ActivityCompat.shouldShowRequestPermissionRationale(this, android.Manifest.permission.READ_CONTACTS)) { // show UI part if you want here to show some rationale !!! } else { ActivityCompat.requestPermissions(this, new String[]{android.Manifest.permission.READ_CONTACTS}, REQUEST_READ_CONTACTS); } } @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case REQUEST_READ_CONTACTS: { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { mContactsSelectedData.addAll(getAllContacts()); mGetContactsAdapter.notifyDataSetChanged(); } else { Toast.makeText(this, getResources().getString(R.string.permissionError), Toast.LENGTH_LONG); } return; } } } }
[ "surya@mobifyi.com" ]
surya@mobifyi.com
db37ff0ef30d00d0d706ebb90b7e6004df57960a
745b525c360a2b15b8d73841b36c1e8d6cdc9b03
/jun_java_plugins/jun_javase/src/main/java/com/jun/plugin/javase/object/test2/ThreadTest.java
06552dee2e0057fe03eb57c0f5d724722c7f2d2c
[]
no_license
wujun728/jun_java_plugin
1f3025204ef5da5ad74f8892adead7ee03f3fe4c
e031bc451c817c6d665707852308fc3b31f47cb2
refs/heads/master
2023-09-04T08:23:52.095971
2023-08-18T06:54:29
2023-08-18T06:54:29
62,047,478
117
42
null
2023-08-21T16:02:15
2016-06-27T10:23:58
Java
UTF-8
Java
false
false
806
java
package com.jun.plugin.javase.object.test2; public class ThreadTest{ public static void main(String[] args) { ThreadDemo t1=new ThreadDemo(); ThreadDemo t2=new ThreadDemo(); t1.start(); // t2.start(); for(int i=0;i<10;i++){ int[] arr=new int[3]; //System.out.println(arr[9]); System.out.println(i+Thread.currentThread().getName()); } } } class ThreadDemo extends Thread{ // private String name="������"; // ThreadDemo(String name){ // this.name=name; // super(name); // } public void run(){ int[] arr=new int[3]; //System.out.println(arr[3]);ִ���쳣���̲߳���Ӱ�쵽�����̣߳��統ǰ�̺߳�main�߳� for(int i=0;i<10;i++){ System.out.println(getName()+"-------"+i+"-------"+Thread.currentThread().getName()); } } }
[ "wujun728@163.com" ]
wujun728@163.com
adb5e967ca601e14752ed71d091648dbfa1621e9
f32e9d3769998903466e44e53c734f3aaa85bc7e
/src/test/java/ch/ralscha/extdirectspring/store/BookSubAopService.java
a3db83a156cdd6a11e4ac531d07c9d81b1f4ee84
[ "Apache-2.0" ]
permissive
kailIII/extdirectspring
f18cecb7c4f7531ef1e725e510d7b0fdf9ea5d29
37c6a84887abc65790a5a229d84f2a0211c8ecdf
refs/heads/master
2021-01-18T13:09:42.326359
2015-10-19T06:04:15
2015-10-19T06:04:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,680
java
/** * Copyright 2010-2014 Ralph Schaer <ralphschaer@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ch.ralscha.extdirectspring.store; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Service; import ch.ralscha.extdirectspring.annotation.ExtDirectMethod; import ch.ralscha.extdirectspring.annotation.ExtDirectMethodType; import ch.ralscha.extdirectspring.bean.ExtDirectStoreReadRequest; import ch.ralscha.extdirectspring.bean.ExtDirectStoreResult; @Service public class BookSubAopService extends BaseService<Book> { @ExtDirectMethod(value = ExtDirectMethodType.STORE_READ, group = "store") public List<Book> read() { List<Book> books = new ArrayList<Book>(); books.add(new Book(1, "Ext JS in Action", "1935182110")); books.add(new Book(2, "Learning Ext JS 3.2", "1849511209")); return books; } @ExtDirectMethod(value = ExtDirectMethodType.STORE_READ, group = "store") public ExtDirectStoreResult<Book> readWithPaging(ExtDirectStoreReadRequest request) { int total = request.getPage() + request.getLimit() + request.getStart(); return new ExtDirectStoreResult<Book>(total, read()); } }
[ "ralphschaer@gmail.com" ]
ralphschaer@gmail.com
da5ec078243884725c6572e5e68bd0a4238c48e8
732bd2ab16d6b2fb570c46a3a0c312a5a40bce23
/Apache-Fop/src/test/java/org/apache/fop/pdf/PDFNumberTestCase.java
23adab03f92b769e62cd8a2627baf7b46ae8a11b
[ "Apache-2.0" ]
permissive
Guronzan/GenPDF
ddedaff22350c387fd7cf04db3c76c0b2c7ba636
b1e2d36fda01fbccd7edce5165a388470396e1dd
refs/heads/master
2016-09-06T08:51:50.479904
2014-05-25T11:35:10
2014-05-25T11:35:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,298
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. */ /* $Id: PDFNumberTestCase.java 1233854 2012-01-20 10:39:42Z cbowditch $ */ package org.apache.fop.pdf; import java.io.IOException; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; /** * This test tests PDFNumber's doubleOut() methods. */ public class PDFNumberTestCase extends PDFObjectTestCase { /** * Sets up the local variables, most of these are inherited from * PDFObjectTestCase */ @Override @Before public void setUp() { this.pdfObjectUnderTest = new PDFNumber(); this.pdfObjectUnderTest.setParent(this.parent); this.pdfObjectUnderTest.setDocument(this.doc); } /** * Tests PDFNumber.doubleOut(). * * @throws Exception * if the test fails */ @Test public void testDoubleOut1() throws Exception { // Default is 6 decimal digits assertEquals("0", PDFNumber.doubleOut(0.0f)); assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f)); assertEquals("0.1", PDFNumber.doubleOut(0.1f)); assertEquals("100", PDFNumber.doubleOut(100.0f)); assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f)); // You'd expect 100.123456 here but DecimalFormat uses the // BigDecimal.ROUND_HALF_EVEN // strategy. I don't know if that's a problem. The strange thing // testDoubleOut2 // seems to return the normally expected value. Weird. assertEquals("100.123459", PDFNumber.doubleOut(100.12345611111111f)); assertEquals("-100.123459", PDFNumber.doubleOut(-100.12345611111111f)); } /** * Tests PDFNumber.doubleOut(). * * @throws Exception * if the test fails */ public void testDoubleOut2() throws Exception { // 4 decimal digits in this case assertEquals("0", PDFNumber.doubleOut(0.0f, 4)); assertEquals("0", PDFNumber.doubleOut(0.0000000000000000000123f, 4)); assertEquals("0.1", PDFNumber.doubleOut(0.1f, 4)); assertEquals("100", PDFNumber.doubleOut(100.0f, 4)); assertEquals("100", PDFNumber.doubleOut(99.99999999999999999999999f, 4)); assertEquals("100.1234", PDFNumber.doubleOut(100.12341111111111f, 4)); assertEquals("-100.1234", PDFNumber.doubleOut(-100.12341111111111f, 4)); } /** * Tests PDFNumber.doubleOut(). * * @throws Exception * if the test fails */ public void testDoubleOut3() throws Exception { // 0 decimal digits in this case assertEquals("0", PDFNumber.doubleOut(0.0f, 0)); assertEquals("0", PDFNumber.doubleOut(0.1f, 0)); assertEquals("1", PDFNumber.doubleOut(0.6f, 0)); assertEquals("100", PDFNumber.doubleOut(100.1234f, 0)); assertEquals("-100", PDFNumber.doubleOut(-100.1234f, 0)); } /** * Tests PDFNumber.doubleOut(). Special cases (former bugs). * * @throws Exception * if the test fails */ public void testDoubleOut4() throws Exception { final double d = Double.parseDouble("5.7220458984375E-6"); assertEquals("0.000006", PDFNumber.doubleOut(d)); assertEquals("0", PDFNumber.doubleOut(d, 4)); assertEquals("0.00000572", PDFNumber.doubleOut(d, 8)); } /** * Tests PDFNumber.doubleOut(). Tests for wrong parameters. * * @throws Exception * if the test fails */ public void testDoubleOutWrongParameters() throws Exception { try { PDFNumber.doubleOut(0.1f, -1); fail("IllegalArgument expected!"); } catch (final IllegalArgumentException iae) { // we want that } try { PDFNumber.doubleOut(0.1f, 17); // We support max 16 decimal digits fail("IllegalArgument expected!"); } catch (final IllegalArgumentException iae) { // we want that } try { PDFNumber.doubleOut(0.1f, 98274659); fail("IllegalArgument expected!"); } catch (final IllegalArgumentException iae) { // we want that } try { PDFNumber.doubleOut(null); fail("NullPointer expected!"); } catch (final NullPointerException e) { // PASS } } /** * Tests both getNumber() and setNumber() - basic getter/setter methods... * Why there isn't a constructor is beyond me... */ public void testGetSetNumber() { final PDFNumber pdfNum = new PDFNumber(); // Check with a floating point number pdfNum.setNumber(1.111f); assertEquals(1.111f, pdfNum.getNumber()); // try with an int pdfNum.setNumber(2); assertEquals(2, pdfNum.getNumber()); // See what happens with a null... make sure it doesn't explode pdfNum.setNumber(null); assertEquals(null, pdfNum.getNumber()); } /** * Tests toPDFString() - this serializes PDFNumber to PDF format. * * @throws IOException * error caused by I/O */ public void testToPDFString() throws IOException { final PDFNumber testSubject = new PDFNumber(); testSubject.setNumber(1.0001); testOutputStreams("1.0001", testSubject); testSubject.setNumber(999); testOutputStreams("999", testSubject); } }
[ "guillaume.rodrigues@gmail.com" ]
guillaume.rodrigues@gmail.com
d66ace8b29335cf6cd8a375f8f38787619633c45
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/13/org/apache/commons/lang3/time/FastDateFormat_format_429.java
25e189bb8d536c822a80db73123fb0802731b27a
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,733
java
org apach common lang3 time fast date format fastdateformat fast thread safe version link java text simpl date format simpledateformat direct replac code simpl date format simpledateformat format pars situat multi thread server environ code simpl date format simpledateformat thread safe jdk version sun close bug rfe pattern compat simpl date format simpledateformat time zone year pattern fast date format fastdateformat support pars print java introduc pattern letter code 'z' repres time zone rfc822 format code code pattern letter jdk version addit pattern code zz' 'zz' made repres iso8601 full format time zone code code introduc minor incompat java gain function javadoc cite year pattern format number pattern letter year truncat digit interpret number start java pattern 'y' yyy' 'yyy' format '2003' '03' java version fast date format fastdateformat behavior java version fast date format fastdateformat format date parser datepars date printer dateprint format milliseond code suppli code string buffer stringbuff param milli millisecond format param buf buffer format string buffer string buffer stringbuff format milli string buffer stringbuff buf printer format milli buf
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
de2bf5f55335c301ca0ff56914b9916f833823a3
6567f7ac7eed8d213b4b8aa82622b8ddb2cc37eb
/core/testj/tip.java
ce1a062ce77f9eb8bbdc5ef0c9fe2880e8244fcc
[]
no_license
ttgiang/central
2a9e64244eb7341aab77ad5162fb8ba0b4888eb0
39785a654c739a1b20c87b91cc36a437241495a9
refs/heads/main
2023-02-13T08:28:33.333957
2021-01-08T04:39:52
2021-01-08T04:39:52
313,086,967
0
0
null
null
null
null
UTF-8
Java
false
false
2,056
java
try { //create a ZipOutputStream to zip the data to ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(".\\curDir.zip")); //assuming that there is a directory named inFolder (If there //isn't create one) in the same directory as the one the code runs from, //call the zipDir method zipDir(".\\inFolder", zos); //close the stream zos.close(); } catch(Exception e) { //handle exception } //here is the code for the method public void zipDir(String dir2zip, ZipOutputStream zos) { try { //create a new File object based on the directory we have to zip File zipDir = new File(dir2zip); //get a listing of the directory content String[] dirList = zipDir.list(); byte[] readBuffer = new byte[2156]; int bytesIn = 0; //loop through dirList, and zip the files for(int i=0; i<dirList.length; i++) { File f = new File(zipDir, dirList[i]); if(f.isDirectory()) { //if the File object is a directory, call this //function again to add its content recursively String filePath = f.getPath(); zipDir(filePath, zos); //loop again continue; } //if we reached here, the File object f was not a directory //create a FileInputStream on top of f FileInputStream fis = new FileInputStream(f); create a new zip entry ZipEntry anEntry = new ZipEntry(f.getPath()); //place the zip entry in the ZipOutputStream object zos.putNextEntry(anEntry); //now write the content of the file to the ZipOutputStream while((bytesIn = fis.read(readBuffer)) != -1) { zos.write(readBuffer, 0, bytesIn); } //close the Stream fis.close(); } } catch(Exception e) { //handle exception }
[ "ttgiang@gmail.com" ]
ttgiang@gmail.com
d75dea8a52775d34e64e1513767e984bf0f41f17
04f00b16a59397e7a2e0529a07df4c71c96baaaf
/src/co/mcel/mz/reservedcharging/model/ChargingReservation.java
67d97989222d6a153ab8d99d1c67ffb9edac38f6
[]
no_license
fatihalgan/CSV2
84fed95fb22ff99d26c4f83325990048f88ab2ce
f6dce800ed5dacf8b9f276444bee2ef03a5cd098
refs/heads/master
2020-12-31T04:28:26.961178
2016-04-21T14:55:48
2016-04-21T14:55:48
56,343,667
0
0
null
null
null
null
UTF-8
Java
false
false
3,288
java
package co.mcel.mz.reservedcharging.model; import java.io.Serializable; import java.util.Date; import co.mcel.mz.reservedcharging.service.exception.InvalidReservationStatusException; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.EqualsBuilder; public class ChargingReservation implements Serializable { private static final long serialVersionUID = 8703302272912946708L; private ChargingReservationPK id; private String msisdn; private Date reservationDate; private Date processedDate; private float amount; private String description; private ReservationStatus status; public ChargingReservation() { super(); } public ChargingReservation(String id, String requesterService, String msisdn, float amount, String description) { this.id = new ChargingReservationPK(id, requesterService); this.msisdn = msisdn; this.amount = amount; this.reservationDate = new Date(); this.description = description; this.status = ReservationStatus.RESERVED; } public ChargingReservationPK getId() { return id; } public void setId(ChargingReservationPK id) { this.id = id; } public String getMsisdn() { return msisdn; } public void setMsisdn(String msisdn) { this.msisdn = msisdn; } public Date getReservationDate() { return reservationDate; } public void setReservationDate(Date reservationDate) { this.reservationDate = reservationDate; } public Date getProcessedDate() { return processedDate; } public void setProcessedDate(Date processedDate) { this.processedDate = processedDate; } public float getAmount() { return amount; } public void setAmount(float amount) { this.amount = amount; } public ReservationStatus getStatus() { return status; } public void setStatus(ReservationStatus status) { this.status = status; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public void cancel() throws InvalidReservationStatusException { if(getStatus().equals(ReservationStatus.RESERVED)) { setStatus(ReservationStatus.CANCELLED); setProcessedDate(new Date()); } else throw new InvalidReservationStatusException(status); } public void refund() throws InvalidReservationStatusException { if(getStatus().equals(ReservationStatus.RESERVED)) { setStatus(ReservationStatus.REFUNDED); setProcessedDate(new Date()); } else throw new InvalidReservationStatusException(status); } public void debit() throws InvalidReservationStatusException { if(getStatus().equals(ReservationStatus.RESERVED)) { setStatus(ReservationStatus.DEBITTED); setProcessedDate(new Date()); } else throw new InvalidReservationStatusException(status); } @Override public boolean equals(final Object other) { if (!(other instanceof ChargingReservation)) return false; ChargingReservation castOther = (ChargingReservation) other; return new EqualsBuilder().append(id, castOther.id).isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(-934768951, -1344616567).append(id) .toHashCode(); } }
[ "fatih.algan@gmail.com" ]
fatih.algan@gmail.com
d4bbbae9aa2f53a8d449bc2ef878ebc5728a33bf
ea94b6decd92e1c2a919b2b2288cda495551e314
/Spring/Spring-Core-Annotations/src/main/java/com/Department.java
98199916238e908a8e11b743b91b1421659fe70b
[]
no_license
crussaders/Cognizant-JAVA-FSD-HYD
5a9d01e09d30b1b10c5665e9106b5e565085c46b
ba16b03a5dfd65e9169c87dc2e094e9781e2062a
refs/heads/master
2022-01-16T06:24:44.588286
2018-06-28T07:58:50
2018-06-28T07:58:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com; import org.springframework.stereotype.Component; @Component("dept") public class Department { private int deptId=1; private String deptName="HR"; public int getDeptId() { return deptId; } public void setDeptId(int deptId) { this.deptId = deptId; } public String getDeptName() { return deptName; } public void setDeptName(String deptName) { this.deptName = deptName; } }
[ "praveen.somireddy@gmail.com" ]
praveen.somireddy@gmail.com
ab9f15264d43d26dae508336f08918c7f939143a
52c36ce3a9d25073bdbe002757f08a267abb91c6
/src/main/java/com/alipay/api/domain/InsClaimReport.java
af01e54ab6c5809fd6c1ac52fc3ad2a895032778
[ "Apache-2.0" ]
permissive
itc7/alipay-sdk-java-all
d2f2f2403f3c9c7122baa9e438ebd2932935afec
c220e02cbcdda5180b76d9da129147e5b38dcf17
refs/heads/master
2022-08-28T08:03:08.497774
2020-05-27T10:16:10
2020-05-27T10:16:10
267,271,062
0
0
Apache-2.0
2020-05-27T09:02:04
2020-05-27T09:02:04
null
UTF-8
Java
false
false
3,954
java
package com.alipay.api.domain; import java.util.Date; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 保险报案信息实体 * * @author auto create * @since 1.0, 2020-05-12 14:14:37 */ public class InsClaimReport extends AlipayObject { private static final long serialVersionUID = 4869997593992748414L; /** * 出险地点 */ @ApiField("accident_address") private String accidentAddress; /** * 出险事故描述 */ @ApiField("accident_desc") private String accidentDesc; /** * 出险时间 */ @ApiField("accident_time") private Date accidentTime; /** * 案件附件列表 */ @ApiListField("attachments") @ApiField("ins_claim_attachment") private List<InsClaimAttachment> attachments; /** * 业务字段 */ @ApiField("biz_data") private String bizData; /** * 报案号 */ @ApiField("claim_report_no") private String claimReportNo; /** * 报案类型 */ @ApiField("claim_report_type") private String claimReportType; /** * 赔案信息 */ @ApiListField("claims") @ApiField("ins_claim") private List<InsClaim> claims; /** * 案件进度列表 */ @ApiListField("progress") @ApiField("ins_claim_report_progress") private List<InsClaimReportProgress> progress; /** * 当status 值为不予受理:REJECTED时候返回 */ @ApiField("report_reject_reason") private String reportRejectReason; /** * 报案人 */ @ApiField("reporter") private InsPerson reporter; /** * 报案来源 */ @ApiField("source") private String source; /** * 案件状态 */ @ApiField("status") private String status; public String getAccidentAddress() { return this.accidentAddress; } public void setAccidentAddress(String accidentAddress) { this.accidentAddress = accidentAddress; } public String getAccidentDesc() { return this.accidentDesc; } public void setAccidentDesc(String accidentDesc) { this.accidentDesc = accidentDesc; } public Date getAccidentTime() { return this.accidentTime; } public void setAccidentTime(Date accidentTime) { this.accidentTime = accidentTime; } public List<InsClaimAttachment> getAttachments() { return this.attachments; } public void setAttachments(List<InsClaimAttachment> attachments) { this.attachments = attachments; } public String getBizData() { return this.bizData; } public void setBizData(String bizData) { this.bizData = bizData; } public String getClaimReportNo() { return this.claimReportNo; } public void setClaimReportNo(String claimReportNo) { this.claimReportNo = claimReportNo; } public String getClaimReportType() { return this.claimReportType; } public void setClaimReportType(String claimReportType) { this.claimReportType = claimReportType; } public List<InsClaim> getClaims() { return this.claims; } public void setClaims(List<InsClaim> claims) { this.claims = claims; } public List<InsClaimReportProgress> getProgress() { return this.progress; } public void setProgress(List<InsClaimReportProgress> progress) { this.progress = progress; } public String getReportRejectReason() { return this.reportRejectReason; } public void setReportRejectReason(String reportRejectReason) { this.reportRejectReason = reportRejectReason; } public InsPerson getReporter() { return this.reporter; } public void setReporter(InsPerson reporter) { this.reporter = reporter; } public String getSource() { return this.source; } public void setSource(String source) { this.source = source; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
d6c40072ae637789c5d5c89023f8f7633822ae89
d6c041879c662f4882892648fd02e0673a57261c
/com/planet_ink/coffee_mud/Abilities/Druid/Chant_AcidWard.java
4b583362165661a847c5401f4ceec19198f51664
[ "Apache-2.0" ]
permissive
linuxshout/CoffeeMud
15a2c09c1635f8b19b0d4e82c9ef8cd59e1233f6
a418aa8685046b08c6d970083e778efb76fd3716
refs/heads/master
2020-04-14T04:17:39.858690
2018-12-29T20:50:15
2018-12-29T20:50:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,745
java
package com.planet_ink.coffee_mud.Abilities.Druid; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2003-2018 Bo Zimmerman 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. */ public class Chant_AcidWard extends Chant { @Override public String ID() { return "Chant_AcidWard"; } private final static String localizedName = CMLib.lang().L("Acid Ward"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Acid Ward)"); @Override public String displayText() { return localizedStaticDisplay; } @Override public int abstractQuality() { return Ability.QUALITY_BENEFICIAL_SELF; } @Override public int classificationCode() { return Ability.ACODE_CHANT|Ability.DOMAIN_PRESERVING; } @Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; if(canBeUninvoked()) mob.tell(L("Your oily protection warms up.")); super.unInvoke(); } @Override public void affectCharStats(final MOB affectedMOB, final CharStats affectedStats) { super.affectCharStats(affectedMOB,affectedStats); affectedStats.setStat(CharStats.STAT_SAVE_ACID,affectedStats.getStat(CharStats.STAT_SAVE_ACID)+100); } @Override public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel) { MOB target=mob; if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB)) target=(MOB)givenTarget; if(target.fetchEffect(this.ID())!=null) { mob.tell(target,null,null,L("<S-NAME> <S-IS-ARE> already warding acid.")); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?L("An oily field of protection appears around <T-NAME>."):L("^S<S-NAME> chant(s) for an oily field of protection around <T-NAMESELF>.^?")); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); beneficialAffect(mob,target,asLevel,0); } } else beneficialWordsFizzle(mob,target,L("<S-NAME> chant(s) for oily protection, but fail(s).")); return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
3248cd7f4ea7c964e6cd39ffd9f22c313cf6c3e1
6c6cb24d68a394528232b527a75fe8fb5d040d49
/src/main/java/net/ravendb/client/documents/session/operations/lazy/LazyLoadOperation.java
a224226fab133615df6e580eeacd46b10af742ab
[ "MIT" ]
permissive
JohannesRudolph/ravendb-jvm-client
e3036ebe5ce9d8fdc4d4041cb4b748f9d1972f2c
88bf621a97bf561b491f3829ee865cfa04c5c4a5
refs/heads/v4.0
2020-04-23T10:31:30.788473
2019-01-30T10:10:33
2019-01-30T10:10:33
171,107,322
0
0
MIT
2019-02-17T10:11:07
2019-02-17T10:11:06
null
UTF-8
Java
false
false
3,979
java
package net.ravendb.client.documents.session.operations.lazy; import net.ravendb.client.documents.commands.GetDocumentsResult; import net.ravendb.client.documents.commands.multiGet.GetRequest; import net.ravendb.client.documents.commands.multiGet.GetResponse; import net.ravendb.client.documents.queries.QueryResult; import net.ravendb.client.documents.session.InMemoryDocumentSessionOperations; import net.ravendb.client.documents.session.operations.LoadOperation; import net.ravendb.client.extensions.JsonExtensions; import net.ravendb.client.util.UrlUtils; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class LazyLoadOperation<T> implements ILazyOperation { private final Class<T> _clazz; private final InMemoryDocumentSessionOperations _session; private final LoadOperation _loadOperation; private String[] _ids; private String[] _includes; public LazyLoadOperation(Class<T> clazz, InMemoryDocumentSessionOperations session, LoadOperation loadOperation) { _clazz = clazz; _session = session; _loadOperation = loadOperation; } @Override public GetRequest createRequest() { List<String> idsToCheckOnServer = Arrays.stream(_ids).filter(id -> !_session.isLoadedOrDeleted(id)).collect(Collectors.toList()); StringBuilder queryBuilder = new StringBuilder("?"); if (_includes != null) { for (String include : _includes) { queryBuilder.append("&include=").append(include); } } idsToCheckOnServer.forEach(id -> queryBuilder.append("&id=").append(UrlUtils.escapeDataString(id))); boolean hasItems = !idsToCheckOnServer.isEmpty(); if (!hasItems) { // no need to hit the server result = _loadOperation.getDocuments(_clazz); return null; } GetRequest getRequest = new GetRequest(); getRequest.setUrl("/docs"); getRequest.setQuery(queryBuilder.toString()); return getRequest; } public LazyLoadOperation<T> byId(String id) { if (id == null) { return this; } if (_ids == null) { _ids = new String[] { id }; } return this; } public LazyLoadOperation<T> byIds(String[] ids) { _ids = ids; return this; } public LazyLoadOperation<T> withIncludes(String[] includes) { _includes = includes; return this; } private Object result; private QueryResult queryResult; private boolean requiresRetry; @Override public Object getResult() { return result; } public void setResult(Object result) { this.result = result; } @Override public QueryResult getQueryResult() { return queryResult; } public void setQueryResult(QueryResult queryResult) { this.queryResult = queryResult; } @Override public boolean isRequiresRetry() { return requiresRetry; } public void setRequiresRetry(boolean requiresRetry) { this.requiresRetry = requiresRetry; } @Override public void handleResponse(GetResponse response) { if (response.isForceRetry()) { result = null; requiresRetry = true; return; } try { GetDocumentsResult multiLoadResult = response.getResult() != null ? JsonExtensions.getDefaultMapper().readValue(response.getResult(), GetDocumentsResult.class) : null; handleResponse(multiLoadResult); } catch (IOException e) { throw new RuntimeException(e); } } private void handleResponse(GetDocumentsResult loadResult) { _loadOperation.setResult(loadResult); if (!requiresRetry) { result = _loadOperation.getDocuments(_clazz); } } }
[ "marcin@ravendb.net" ]
marcin@ravendb.net
6a9449ddd5701a7670b49ee493af44bcbfed306f
3e82f61a9f41e6b989dbb16647f10ff76d50df7f
/src/java/com/my/study/netty/server/DiscardServer.java
82f2af562ef9c07557a0f8a727b684f0b272f51e
[]
no_license
yongbiaoshi/study-netty
6bdc32f0d6979b0403f0fbd37b7c686e715699a1
9a0dd40437ee0ff34a09a41edcc243dcda49b4ca
refs/heads/master
2020-03-31T17:11:53.945328
2018-10-10T11:27:03
2018-10-10T11:27:03
152,411,679
0
0
null
null
null
null
UTF-8
Java
false
false
1,699
java
package com.my.study.netty.server; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; public class DiscardServer { private int port; public DiscardServer(int port) { this.port = port; } public void run() throws InterruptedException { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); try { ServerBootstrap b = new ServerBootstrap(); b.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .childHandler(new ChannelInitializer<SocketChannel>() { protected void initChannel(SocketChannel socketChannel) throws Exception { socketChannel.pipeline().addLast(new DiscardServerHandler()); } }) .option(ChannelOption.SO_BACKLOG, 128) .childOption(ChannelOption.SO_KEEPALIVE, true); ChannelFuture f = b.bind(port).sync(); System.out.println("启动完成"); f.channel().closeFuture().sync(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } } public static void main(String[] args) throws InterruptedException { new DiscardServer(8080).run(); } }
[ "root@localhost.localdomain" ]
root@localhost.localdomain
ab26320e2e8d408be5670e92909d4740356d1ce8
c8a7974ebdf8c2f2e7cdc34436d667e3f1d29609
/src/main/java/com/tencentcloudapi/batch/v20170312/models/TerminateTaskInstanceRequest.java
0162dced2c80caf20852035bb8ccaabec0c18e97
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java-en
d6f099a0de82ffd3e30d40bf7465b9469f88ffa6
ba403db7ce36255356aeeb4279d939a113352990
refs/heads/master
2023-08-23T08:54:04.686421
2022-06-28T08:03:02
2022-06-28T08:03:02
193,018,202
0
3
Apache-2.0
2022-06-28T08:03:04
2019-06-21T02:40:54
Java
UTF-8
Java
false
false
2,649
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.batch.v20170312.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class TerminateTaskInstanceRequest extends AbstractModel{ /** * Instance ID */ @SerializedName("JobId") @Expose private String JobId; /** * Task name */ @SerializedName("TaskName") @Expose private String TaskName; /** * Task instance index */ @SerializedName("TaskInstanceIndex") @Expose private Long TaskInstanceIndex; /** * Get Instance ID * @return JobId Instance ID */ public String getJobId() { return this.JobId; } /** * Set Instance ID * @param JobId Instance ID */ public void setJobId(String JobId) { this.JobId = JobId; } /** * Get Task name * @return TaskName Task name */ public String getTaskName() { return this.TaskName; } /** * Set Task name * @param TaskName Task name */ public void setTaskName(String TaskName) { this.TaskName = TaskName; } /** * Get Task instance index * @return TaskInstanceIndex Task instance index */ public Long getTaskInstanceIndex() { return this.TaskInstanceIndex; } /** * Set Task instance index * @param TaskInstanceIndex Task instance index */ public void setTaskInstanceIndex(Long TaskInstanceIndex) { this.TaskInstanceIndex = TaskInstanceIndex; } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "JobId", this.JobId); this.setParamSimple(map, prefix + "TaskName", this.TaskName); this.setParamSimple(map, prefix + "TaskInstanceIndex", this.TaskInstanceIndex); } }
[ "zhiqiangfan@tencent.com" ]
zhiqiangfan@tencent.com
43878a7b14756c7cac8493e42b9d52513798445c
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/ni.java
83fdcee89521d28ccbfbf1eb1b81f9f6680ea41c
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
2,067
java
import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.common.internal.safeparcel.a; import com.google.android.gms.common.internal.safeparcel.a.a; import com.google.android.gms.common.internal.safeparcel.b; import com.google.android.gms.maps.model.TileOverlayOptions; public class ni implements Parcelable.Creator<TileOverlayOptions> { public static void a(TileOverlayOptions paramTileOverlayOptions, Parcel paramParcel, int paramInt) { int i = b.H(paramParcel); b.c(paramParcel, 1, paramTileOverlayOptions.a()); b.a(paramParcel, 2, paramTileOverlayOptions.b(), false); b.a(paramParcel, 3, paramTileOverlayOptions.d()); b.a(paramParcel, 4, paramTileOverlayOptions.c()); b.a(paramParcel, 5, paramTileOverlayOptions.e()); b.H(paramParcel, i); } public TileOverlayOptions a(Parcel paramParcel) { boolean bool1 = false; int i = a.G(paramParcel); IBinder localIBinder = null; float f = 0.0F; boolean bool2 = true; int j = 0; while (paramParcel.dataPosition() < i) { int k = a.F(paramParcel); switch (a.aH(k)) { default: a.b(paramParcel, k); break; case 1: j = a.g(paramParcel, k); break; case 2: localIBinder = a.p(paramParcel, k); break; case 3: bool1 = a.c(paramParcel, k); break; case 4: f = a.l(paramParcel, k); break; case 5: bool2 = a.c(paramParcel, k); } } if (paramParcel.dataPosition() != i) { throw new a.a("Overread allowed size end=" + i, paramParcel); } return new TileOverlayOptions(j, localIBinder, bool1, f, bool2); } public TileOverlayOptions[] a(int paramInt) { return new TileOverlayOptions[paramInt]; } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: ni * JD-Core Version: 0.7.0.1 */
[ "paras@protrafsolutions.com" ]
paras@protrafsolutions.com
87af7e32e49c97310526e40a3e37dcfaa9e7c332
6617a7091490a0f600de9a21a7748d0d2de3e2d3
/loader/src/main/java/org/cucina/loader/concurrent/CompletionServiceFactory.java
f0d4e4f164282296287248adad5c0c840fc7fa73
[ "Apache-2.0" ]
permissive
cucina/opencucina
f80ee908eb9d7138493b9f720aefe9270ad1a3c4
ac683668bf7b2fa6c31491c6eafbfb5c95b651eb
refs/heads/master
2021-05-15T02:00:45.714499
2018-03-09T06:37:41
2018-03-09T06:37:43
30,875,325
1
0
null
null
null
null
UTF-8
Java
false
false
437
java
package org.cucina.loader.concurrent; import java.util.concurrent.CompletionService; import java.util.concurrent.Executor; /** * JAVADOC Interface Level * * @author $Author: $ * @version $Revision: $ */ public interface CompletionServiceFactory { /** * JAVADOC Method Level Comments * * @param <T> JAVADOC. * @param executor JAVADOC. * @return JAVADOC. */ <T> CompletionService<T> create(Executor executor); }
[ "viktor.levine@gmail.com" ]
viktor.levine@gmail.com
5e2258d6271dd37ea55ee42eb3d0477e44e9f6af
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/60/org/apache/commons/lang/builder/ReflectionToStringBuilder_ReflectionToStringBuilder_581.java
c4468a5f83a37cd026ccda3690565f0d78576703
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,694
java
org apach common lang builder assist implement link object string tostr method reflect reflect determin field append field link java lang reflect access object accessibleobject set access setaccess java lang reflect access object accessibleobject chang visibl field fail secur manag permiss set correctli typic invoc method pre string string tostr reflect string builder reflectiontostringbuild string tostr pre builder debug 3rd parti object pre system println object reflect string builder reflectiontostringbuild string tostr object anobject pre subclass control field output overrid method link accept java lang reflect field link getvalu java lang reflect field method includ code password code field return code string code pre string string tostr reflect string builder reflectiontostringbuild accept field accept getnam equal password string tostr pre exact format code string tostr code determin link string style tostringstyl pass constructor author gari gregori author stephen colebourn author pete gieser version reflect string builder reflectiontostringbuild string builder tostringbuild constructor deprec link reflect string builder reflectiontostringbuild object string style tostringstyl string buffer stringbuff class param object object build code string tostr code param style style code string tostr code creat code code param buffer code string buffer stringbuff code popul code code param reflect class reflectuptoclass superclass reflect inclus code code param output transient outputtransi includ field reflect string builder reflectiontostringbuild object object string style tostringstyl style string buffer stringbuff buffer class reflect class reflectuptoclass output transient outputtransi object style buffer set class setuptoclass reflect class reflectuptoclass set append transient setappendtransi output transient outputtransi
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
ba76200254d3da899d10fd00b87fff9a687521d7
8f87065bc3cb6d96ea2e398a98aacda4fc4bbe43
/src/Class00000314Worse.java
d04928f31156099a2aa568defd649edba90b65e8
[]
no_license
fracz/code-quality-benchmark
a243d345441582473532f9b013993f77d59e19ae
c23e76fe315f43bea899beabb856e61348c34e09
refs/heads/master
2020-04-08T23:40:36.408828
2019-07-31T17:54:53
2019-07-31T17:54:53
159,835,188
0
0
null
null
null
null
UTF-8
Java
false
false
317
java
// original filename: 00034121.txt // before public class Class00000314Worse { @Override public void onEvent(Event message) { UserUpdatedEvent userUpdatedEvent = (UserUpdatedEvent) message; System.out.printf("User with %s has been Updated!", userUpdatedEvent.getUser().getUsername()); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
aeb94276f1fc65f081986ab5ce4f6fed87406e78
f59f9a03eaf296faa8fad67380e5c90958dbe3cf
/src/main/java/com/whg/ijvm/ch09/instruction/math/Inc.java
32b2036411d8e42e1c4bde183d45195dc408076c
[]
no_license
whg333/ijvm
479b1ee2328c6b8c663e668b2c38c8423dbb8596
28c4b60beaa7412cec59e210e40c366b74aaa939
refs/heads/master
2022-06-26T07:47:10.357161
2022-05-16T12:25:32
2022-05-16T12:25:32
208,620,194
3
2
null
2022-06-17T03:37:40
2019-09-15T16:09:24
Java
UTF-8
Java
false
false
964
java
package com.whg.ijvm.ch09.instruction.math; import com.whg.ijvm.ch09.classfile.uint.Uint8; import com.whg.ijvm.ch09.instruction.Instruction; import com.whg.ijvm.ch09.instruction.base.BytecodeReader; import com.whg.ijvm.ch09.runtime.LocalVars; import com.whg.ijvm.ch09.runtime.RFrame; public class Inc { public static class IINC implements Instruction{ short index; int iConst; @Override public void fetchOperands(BytecodeReader reader) { index = reader.readUint8().value(); iConst = reader.readInt8(); } @Override public void execute(RFrame frame) { LocalVars localVars = frame.getLocalVars(); int val = localVars.getInt(index); val += iConst; localVars.setInt(index, val); } @Override public String toString() { return Instruction.string(this)+" "+index+" by "+iConst; } } }
[ "wanghonggang@hulai.com" ]
wanghonggang@hulai.com
40a51f0f4466971ccfedb29707647ba9ae78c784
19f7e40c448029530d191a262e5215571382bf9f
/decompiled/instagram/sources/p000X/C16580op.java
06e64cc1d42c3295d642adfa028305e89cd9506a
[]
no_license
stanvanrooy/decompiled-instagram
c1fb553c52e98fd82784a3a8a17abab43b0f52eb
3091a40af7accf6c0a80b9dda608471d503c4d78
refs/heads/master
2022-12-07T22:31:43.155086
2020-08-26T03:42:04
2020-08-26T03:42:04
283,347,288
18
1
null
null
null
null
UTF-8
Java
false
false
5,652
java
package p000X; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.media.AudioManager; import android.os.Handler; import android.os.Looper; import android.os.SystemClock; import android.util.LruCache; import com.facebook.common.dextricks.DexStore; import com.instagram.model.videocall.VideoCallAudience; import com.instagram.model.videocall.VideoCallInfo; import com.instagram.model.videocall.VideoCallSource; import com.instagram.realtimeclient.RealtimeClientManager; import com.instagram.video.videocall.activity.VideoCallActivity; import com.instagram.video.videocall.analytics.VideoCallWaterfall$LeaveReason; import java.util.List; import org.webrtc.MediaStreamTrack; /* renamed from: X.0op reason: invalid class name and case insensitive filesystem */ public abstract class C16580op extends C16590oq { public final LruCache A00 = new LruCache(100); public final C16610os A01; public final C16650ow A02; public C1891786f A02() { return null; } public final boolean A0D(AnonymousClass0C1 r2, Context context, String str, String str2, List list) { return true; } public final C16610os A03() { return this.A01; } public final void A07(AnonymousClass0C1 r3, Context context, String str) { C12810hQ.A02(AnonymousClass75A.A00(new C24166AjG(r3).A00, str, "RINGING")); } public final void A08(String str) { C16650ow r0 = this.A02; C23937Adw.A02(r0.A02, str, C23938Adx.EVENT_TYPE_INCOMING_CALL); } public final void A09(String str) { C16650ow r0 = this.A02; C23937Adw.A02(r0.A02, str, C23938Adx.EVENT_TYPE_MISSED_CALL); } public final void A0A(String str) { this.A00.put(str, Long.valueOf(SystemClock.elapsedRealtime())); } public final void A0B(String str, String str2) { A09(C23937Adw.A00(str, C23938Adx.EVENT_TYPE_MISSED_CALL, Constants.ONE, str2)); } public C16580op(Context context, boolean z) { C16600or r2; Context context2 = context; if (C06080Nr.A09(context)) { r2 = C16600or.THREADS_APP_PUSH_NOTIFICATION; } else { r2 = C16600or.PUSH_NOTIFICATION; } this.A01 = new C16610os(r2, C05860Mt.A02.A05(context)); this.A02 = new C16650ow(context2, C16620ot.A01(), new C16640ov(C05680Ln.Abs), this, A03(), C11130eT.A01, z); Context applicationContext = context.getApplicationContext(); C16650ow r1 = this.A02; C16670oy.A04("video_call_incoming", r1); C16670oy.A04("video_call_ended", r1); C16620ot.A01().A03("video_call_incoming", new C16680oz(applicationContext, new C16700p1((AudioManager) applicationContext.getSystemService(MediaStreamTrack.AUDIO_TRACK_KIND)), new Handler(Looper.getMainLooper()))); RealtimeClientManager.addOtherRealtimeEventHandlerProvider(C16770p8.A00); RealtimeClientManager.addOtherRealtimeEventHandlerProvider(C16780p9.A00); RealtimeClientManager.addOtherRealtimeEventHandlerProvider(C16790pA.A00); C16810pC.A00 = new C16800pB(this); } public final PendingIntent A00(Context context, String str, String str2, VideoCallInfo videoCallInfo, VideoCallAudience videoCallAudience, VideoCallSource videoCallSource, int i) { Intent A002 = VideoCallActivity.A00(context, str, videoCallSource, videoCallAudience, videoCallInfo); A002.putExtra("VideoCallActivity.VIDEO_CALL_ACTIVITY_ARGUMENT_RING", true); A002.putExtra("VideoCallActivity.VIDEO_CALL_NOTIFICATION_ID", str2); AnonymousClass0XS A003 = AnonymousClass0XU.A00(); A003.A04(A002, context.getClassLoader()); return A003.A01(context, i, 134217728); } public final PendingIntent A01(Context context, String str, String str2, VideoCallInfo videoCallInfo, VideoCallAudience videoCallAudience, VideoCallSource videoCallSource, boolean z, int i) { Intent A002 = VideoCallActivity.A00(context, str, videoCallSource, videoCallAudience, videoCallInfo); A002.putExtra("VideoCallActivity.VIDEO_CALL_NOTIFICATION_ID", str2); A002.putExtra("VideoCallActivity.VIDEO_CALL_NOTIFICATION_CALL_BACK_ACTION", z); AnonymousClass0XS A003 = AnonymousClass0XU.A00(); A003.A04(A002, context.getClassLoader()); return A003.A01(context, i, 134217728); } public final void A04(Context context, AnonymousClass0C1 r4, VideoCallInfo videoCallInfo, VideoCallAudience videoCallAudience, VideoCallSource videoCallSource) { Intent A002 = VideoCallActivity.A00(context, r4.A04(), videoCallSource, videoCallAudience, videoCallInfo); if (!C16590oq.A00.A0C(r4, context) && !AnonymousClass70S.A00().booleanValue()) { A002.addFlags(DexStore.LOAD_RESULT_PGO); } AnonymousClass1BH.A03(A002, context); } public final void A05(AnonymousClass0C1 r3, Context context) { C54312Wu A012 = C54312Wu.A01(r3); if (A012 != null) { A012.A09(VideoCallWaterfall$LeaveReason.USER_INITIATED); } else { AnonymousClass0QD.A01("VideoCallPlugin", "Calling leave() with no VideoCallManager present in user session"); } } public final void A06(AnonymousClass0C1 r3, Context context, String str) { C12810hQ.A02(AnonymousClass75A.A00(C54312Wu.A02(r3, context).A0J.A00, str, "REJECTED")); } public final boolean A0C(AnonymousClass0C1 r3, Context context) { C54312Wu A012 = C54312Wu.A01(r3); if (A012 == null || !A012.A0A()) { return false; } return true; } }
[ "stan@rooy.works" ]
stan@rooy.works
bfe7da33fc2c53aa3aacd1be96b3f8d7ca564287
6dd240858d413bcaff8ea544677525d70ba6c774
/src/org/unclesniper/puppeteer/config/SSHAuthorityCopyToStringSource.java
6743b49a780d6e7f2352711bc82f74148301ae74
[]
no_license
UncleSniper/puppeteer
31829e5c7a94f44befd7a5fa9efd896e7b0ae1dd
9379ace198c1292eddf2b2b9ec680cee498a916b
refs/heads/master
2022-11-14T16:06:43.691015
2020-07-07T22:32:26
2020-07-07T22:32:26
264,326,276
0
0
null
null
null
null
UTF-8
Java
false
false
868
java
package org.unclesniper.puppeteer.config; import org.unclesniper.puppeteer.CopySlave; import org.unclesniper.puppeteer.PuppetException; import org.unclesniper.puppeteer.util.ShorthandName; import org.unclesniper.puppeteer.AbstractCopyToStringSource; @ShorthandName("sshAuthorityCopyToString") public class SSHAuthorityCopyToStringSource extends AbstractCopyToStringSource { private SSHConfig config; public SSHAuthorityCopyToStringSource() {} public SSHAuthorityCopyToStringSource(SSHConfig config) { this.config = config; } public SSHConfig getConfig() { return config; } public void setConfig(SSHConfig config) { this.config = config; } @Override protected void buildStringImpl(CopySlave.CopyToInfo info, StringBuilder sink) throws PuppetException { sink.append(AbstractSSHConfig.buildAuthority(config, info.machine, info.execHost)); } }
[ "simon@bausch-alfdorf.de" ]
simon@bausch-alfdorf.de
cf0084ef967fbbbfd64e43ecf8a89c57f260521f
710b72b0cb71f3c05eeda99cb4bb421311d447f6
/subutil/src/test/java/com/blankj/subutil/util/TestUtils.java
b5dcb748010082ebd01eda214e8749d08a99c238
[ "Apache-2.0" ]
permissive
Sususuperman/AndroidUtilCode
78146809ea8a8a6e44942b53c7360af17bf11c94
0d7e20771bb4ac8ad0ffa66af2cb73ac7c7176dd
refs/heads/master
2021-08-23T15:02:05.776973
2017-12-05T09:55:47
2017-12-05T09:55:47
113,143,411
2
0
null
null
null
null
UTF-8
Java
false
false
614
java
package com.blankj.subutil.util; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2016/08/21 * desc : 单元测试工具类 * </pre> */ @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class TestUtils { public static void init() { Utils.init(RuntimeEnvironment.application); } @Test public void test() throws Exception { } }
[ "chaoisgoodman@163.com" ]
chaoisgoodman@163.com
0dfd3128e8c3997c72de6b9c52f2ff2fb7298cc9
abee3a4de8b376f0f08a2a599a81c24eeb23d8bc
/src/generator/spring-boot/project/crud/crud/src/main/java/com/jasmine/crud/service/impl/TableInfoServiceImpl.java
be8e4dbc678332844188e778067780314f6c9111
[]
no_license
anlei-fu/code-generator
bf261246b26f5edca9aedf653c1b863f43636925
4fc092b0c24964df8e0a08fa920bffaaaf245d2a
refs/heads/master
2021-08-03T09:17:50.409263
2021-07-18T00:18:12
2021-07-18T00:18:12
210,876,449
1
0
null
2020-01-22T01:31:20
2019-09-25T15:16:33
PLSQL
UTF-8
Java
false
false
2,093
java
/*---------------------------------------------------------------------------- * Jasmine code generator, a tool to build web crud application,with spring- * boot, mybatis, mysql,swagger,spring-security. * Generated at 6/9/2021, 6:11:52 PM * All rights reserved by fal(email:767550758@qq.com) since 2019 *---------------------------------------------------------------------------*/ package com.jasmine.crud.service.impl; import com.jasmine.crud.mapper.TableInfoMapper; import com.jasmine.crud.pojo.entity.TableInfo; import com.jasmine.crud.pojo.req.*; import com.jasmine.crud.pojo.req.AddTableInfoReq; import com.jasmine.crud.pojo.req.GetTableInfoPageReq; import com.jasmine.crud.pojo.req.UpdateTableInfoReq; import com.jasmine.crud.pojo.resp.*; import com.jasmine.crud.pojo.resp.PageResult; import com.jasmine.crud.service.TableInfoService; import com.jasmine.crud.utils.PageHelperUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import tk.mybatis.mapper.common.Mapper; @Service public class TableInfoServiceImpl extends AbstractCrudService<TableInfo> implements TableInfoService { @Autowired private TableInfoMapper tableInfoMapper; @Override public boolean add(AddTableInfoReq req) { return super.add(req); } @Override public boolean deleteById(Integer id) { return super.delete(id); } @Override public boolean update(UpdateTableInfoReq req) { return super.update(req); } @Override public TableInfo getById(Integer id) { return super.getById(id); } @Override public PageResult<TableInfoDetailResp> getDetailPage(GetTableInfoPageReq req) { return PageHelperUtils.paging(req, () -> tableInfoMapper.getDetailPage(req)); } @Override protected Class<TableInfo> getEntityClass(){ return TableInfo.class; } @Override protected Mapper<TableInfo> getMapper() { return tableInfoMapper; } }
[ "767550758@qq.com" ]
767550758@qq.com
66e8dcdba653ddd23026241cb5293657f53756d2
3aaf87d2ccc54b08770edf0141d19dab30a7e79f
/simpleWebCam/src/main/java/com/camera/simplewebcam/dialog/QueRenDialog.java
c868133f0ba6791b3348a7befc64cbe52427a303
[]
no_license
yoyo89757001/uvcCamera
688b833ed249913a2c0bed0b225176aaed444393
95caf7f6f17265c99bf2d986aff5e93238d053af
refs/heads/master
2021-01-19T00:58:57.815443
2018-07-09T12:12:03
2018-07-09T12:12:03
100,570,956
0
0
null
null
null
null
UTF-8
Java
false
false
1,836
java
package com.camera.simplewebcam.dialog; import android.app.Dialog; import android.content.Context; import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.TextView; import com.camera.simplewebcam.R; /** * @Function: 自定义对话框 * @Date: 2013-10-28 * @Time: 下午12:37:43 * @author Tom.Cai */ public class QueRenDialog extends Dialog { private Button positiveButton,quxiao; private TextView shuoming; private View quxiao_v; public QueRenDialog(Context context, String ss) { super(context, R.style.dialog_style); setCustomDialog(ss); } private void setCustomDialog(String ss) { View mView = LayoutInflater.from(getContext()).inflate(R.layout.queren_ll, null); shuoming= (TextView) mView.findViewById(R.id.a3); positiveButton= (Button) mView.findViewById(R.id.a5); super.setContentView(mView); shuoming.setText(ss); } public void setTestColo(){ shuoming.setTextColor(Color.parseColor("#ffe70707")); } public void setCountText(String ss){ shuoming.setText(ss); } @Override public void setContentView(int layoutResID) { } @Override public void setContentView(View view, LayoutParams params) { } @Override public void setContentView(View view) { } /** * 确定键监听器 * @param listener */ public void setOnPositiveListener(View.OnClickListener listener){ positiveButton.setOnClickListener(listener); } /** * 取消键监听器 * @param listener */ public void setOnQuXiaoListener(View.OnClickListener listener){ quxiao.setOnClickListener(listener); } }
[ "332663557@qq.com" ]
332663557@qq.com
ae47565f51d99e22d4feed4eb555192f3c772215
68a7acc92e7312b4db75a4adc79469473d8dcc52
/src/patterns/creational/builder/pizzaDemo/concreteBuilders/PestoPizzaBuilder.java
b1797d1183016faa83d8289687bf92533ba18a45
[]
no_license
vasanthsubram/JavaCookBook
e83f95a9a08d6227455ebd213d216837ec1c97b5
3fb2dfc38a4bb56f21f329b0dbc8283609412840
refs/heads/master
2022-12-16T00:13:31.515018
2019-06-24T03:12:11
2019-06-24T03:12:11
30,102,351
0
0
null
2022-12-13T19:13:55
2015-01-31T04:39:51
Java
UTF-8
Java
false
false
373
java
package patterns.creational.builder.pizzaDemo.concreteBuilders; import patterns.creational.builder.pizzaDemo.PizzaBuilder; public class PestoPizzaBuilder extends PizzaBuilder { public void buildDough() { pizza.setDough("cross"); } public void buildSauce() { pizza.setSauce("pesto"); } public void buildTopping() { pizza.setTopping("ham"); } }
[ "v-vsubramanian@expedia.com" ]
v-vsubramanian@expedia.com
a1e46988917bcead317abbe7a17939959164775e
beb5d09e8065bd2e127535baf75f3a60a68a95a0
/game-context/src/main/java/com/sky/game/context/ice/IceProxyManager.java
dde548ce4c813d1d76541b60f8cdd1b8ca10d58a
[]
no_license
autumnsparrow/fish-game
94c145cb3a98c61a8ed470d7e5026dfdae48e7f2
3178a63c455d39c51d35b33147f5b8071a94b0dd
refs/heads/master
2021-04-06T20:17:52.280900
2018-03-14T14:55:50
2018-03-14T14:55:50
125,228,209
0
0
null
null
null
null
UTF-8
Java
false
false
3,692
java
/** * @company Palm Lottery Information&Technology Co.,Ltd. * * @author sparrow * * @date Sep 7, 2013-6:14:52 PM * */ package com.sky.game.context.ice; import java.util.HashMap; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.sky.game.context.MessageAsyncHandlerPrx; import com.sky.game.context.MessageAsyncHandlerPrxHelper; import com.sky.game.context.MessageHandlerPrx; import com.sky.game.context.MessageHandlerPrxHelper; import com.sky.game.context.MessageInternalHandlerHolder; import com.sky.game.context.MessageInternalHandlerPrx; import com.sky.game.context.MessageInternalHandlerPrxHelper; import com.sky.game.context.configuration.ice.IceServiceConfig; import com.sky.game.context.configuration.ice.IceServiceConfigRegstry; import com.sky.game.context.util.GameUtil; import Ice.InitializationData; import Ice.ObjectPrx; /** * * Ice Proxy manager. * * @author sparrow * */ public class IceProxyManager { private static final Log logger=LogFactory.getLog(IceProxyManager.class); Ice.Communicator communictor; String serviceName; /** * */ public IceProxyManager() { // TODO Auto-generated constructor stub } public void init(){ IceServiceConfig iceServiceConfig=IceServiceConfigRegstry.getServiceConfigByServiceName(serviceName); if(iceServiceConfig==null) throw new RuntimeException("Can't load ice config service :"+serviceName); InitializationData config= iceServiceConfig.getIceServerConfig(true); communictor=Ice.Util.initialize(config); // i should ping each client. //iceServiceConfig.ping(); } HashMap<String,String> handlerProxies=new HashMap<String,String>(); public synchronized Set<String> getProxyNames(){ return handlerProxies.keySet(); } public synchronized MessageInternalHandlerPrx getMessageInternalHandlerPrx(String name){ MessageInternalHandlerPrx handlerPrx=null; try { ObjectPrx prx=communictor.propertyToProxy(name);//communictor.stringToProxy(ProtocolStoragePrx); if(prx!=null){ handlerPrx=MessageInternalHandlerPrxHelper.uncheckedCast (prx); } } catch (Exception e) { // TODO Auto-generated catch block //e.printStackTrace(); } return handlerPrx; } //private static final String ProtocolStoragePrx="ProtocolStorage.Proxy"; public synchronized MessageHandlerPrx getMessageHandlerProxy(String name){ MessageHandlerPrx handlerPrx=null; try { String k=String.format("%s.MessageHandlerPrx", name); ObjectPrx prx=communictor.propertyToProxy(k);//communictor.stringToProxy(ProtocolStoragePrx); if(prx!=null){ handlerPrx=MessageHandlerPrxHelper.checkedCast(prx); //handlerPrx.ice_ping(); } } catch (Exception e) { // TODO Auto-generated catch block //e.printStackTrace(); } return handlerPrx; } public synchronized MessageAsyncHandlerPrx getMessageAsyncHandlerProxy(String k){ //String k=String.format("%s.MessageAsyncHandlerPrx", name); ObjectPrx prx=communictor.propertyToProxy(k); MessageAsyncHandlerPrx handlerPrx=null; if(prx==null){ throw new RuntimeException("Can't cast the property :"+k+" into ObjectPrx"); } if(prx!=null){ try { handlerPrx=MessageAsyncHandlerPrxHelper.uncheckedCast(prx); } catch (Exception e) { //logger.error("get.async.proxy:"+e.getMessage()+" k:"+k); } } return handlerPrx; } public void cleanup(){ if(communictor!=null) communictor.destroy(); } public String getServiceName() { return serviceName; } public void setServiceName(String serviceName) { this.serviceName = serviceName; } }
[ "ruiqiuzhang@gmail.com" ]
ruiqiuzhang@gmail.com
10dde6123649705e977c72b4bd0f397ffc256e67
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/CHART-13b-4-9-Single_Objective_GGA-WeightedSum/org/jfree/chart/block/BorderArrangement_ESTest_scaffolding.java
162c3a5f55999112da7e59cf319c028933d61b88
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
443
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Jan 17 20:50:02 UTC 2020 */ package org.jfree.chart.block; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class BorderArrangement_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
f537f40cf4c6ec6629d894bd83f624842107de4b
ebe04f0663730740a42b36fe4a455dfc1dcc44aa
/aliyun-java-sdk-ons/src/main/java/com/aliyuncs/ons/transform/v20180516/OnsTopicGetResponseUnmarshaller.java
e9fbc19fb3b5994891e0f59c382e988978d08212
[ "Apache-2.0" ]
permissive
linfuwei/aliyun-openapi-java-sdk
9a5477d40d91ee1a7f27cce554ff713e049b3e6f
b98c05774fce0ca1462835b9d397f0697ee8be31
refs/heads/master
2020-04-18T11:45:22.563412
2019-01-25T07:34:40
2019-01-25T07:34:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,881
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.aliyuncs.ons.transform.v20180516; import java.util.ArrayList; import java.util.List; import com.aliyuncs.ons.model.v20180516.OnsTopicGetResponse; import com.aliyuncs.ons.model.v20180516.OnsTopicGetResponse.PublishInfoDo; import com.aliyuncs.transform.UnmarshallerContext; public class OnsTopicGetResponseUnmarshaller { public static OnsTopicGetResponse unmarshall(OnsTopicGetResponse onsTopicGetResponse, UnmarshallerContext context) { onsTopicGetResponse.setRequestId(context.stringValue("OnsTopicGetResponse.RequestId")); onsTopicGetResponse.setHelpUrl(context.stringValue("OnsTopicGetResponse.HelpUrl")); List<PublishInfoDo> data = new ArrayList<PublishInfoDo>(); for (int i = 0; i < context.lengthValue("OnsTopicGetResponse.Data.Length"); i++) { PublishInfoDo publishInfoDo = new PublishInfoDo(); publishInfoDo.setId(context.longValue("OnsTopicGetResponse.Data["+ i +"].Id")); publishInfoDo.setChannelId(context.integerValue("OnsTopicGetResponse.Data["+ i +"].ChannelId")); publishInfoDo.setChannelName(context.stringValue("OnsTopicGetResponse.Data["+ i +"].ChannelName")); publishInfoDo.setTopic(context.stringValue("OnsTopicGetResponse.Data["+ i +"].Topic")); publishInfoDo.setOwner(context.stringValue("OnsTopicGetResponse.Data["+ i +"].Owner")); publishInfoDo.setRelation(context.integerValue("OnsTopicGetResponse.Data["+ i +"].Relation")); publishInfoDo.setRelationName(context.stringValue("OnsTopicGetResponse.Data["+ i +"].RelationName")); publishInfoDo.setStatus(context.integerValue("OnsTopicGetResponse.Data["+ i +"].Status")); publishInfoDo.setStatusName(context.stringValue("OnsTopicGetResponse.Data["+ i +"].StatusName")); publishInfoDo.setAppkey(context.stringValue("OnsTopicGetResponse.Data["+ i +"].Appkey")); publishInfoDo.setCreateTime(context.longValue("OnsTopicGetResponse.Data["+ i +"].CreateTime")); publishInfoDo.setUpdateTime(context.longValue("OnsTopicGetResponse.Data["+ i +"].UpdateTime")); publishInfoDo.setRemark(context.stringValue("OnsTopicGetResponse.Data["+ i +"].Remark")); publishInfoDo.setInstanceId(context.stringValue("OnsTopicGetResponse.Data["+ i +"].InstanceId")); data.add(publishInfoDo); } onsTopicGetResponse.setData(data); return onsTopicGetResponse; } }
[ "haowei.yao@alibaba-inc.com" ]
haowei.yao@alibaba-inc.com
a7ed53ca5bcfca36e1e0be629d1c62931de0ed4d
c7c300fc76f4c810ebd024c54b1602ef680fc013
/src/com/atguigu/M12模板方法模式template/Client.java
b11574b30441e3e8973e4f10e09abf09351e4547
[]
no_license
yiitree/DesignPattern
701ee73f041346e0eaf8d66287497ac13ba4aef4
3610a4887a162f491cec92699e9aa6aa56361610
refs/heads/master
2022-12-18T14:48:24.770921
2020-09-25T09:53:52
2020-09-25T09:53:52
295,628,550
0
0
null
null
null
null
GB18030
Java
false
false
422
java
package com.atguigu.M12模板方法模式template; public class Client { public static void main(String[] args) { //制作红豆豆浆 System.out.println("----制作红豆豆浆----"); SoyaMilk redBeanSoyaMilk = new RedBeanSoyaMilk(); redBeanSoyaMilk.make(); System.out.println("----制作花生豆浆----"); SoyaMilk peanutSoyaMilk = new PeanutSoyaMilk(); peanutSoyaMilk.make(); } }
[ "772701414@qq.com" ]
772701414@qq.com
2bf206ada0a26268a07578209b5e68b37a9bbc0d
ceba2d5f52c5d8c7bda6346f45b4c25f1bbbc312
/src/test/java/com/jb/jhipster/web/rest/errors/ExceptionTranslatorTestController.java
7116be18cb96f27f0304c480f68da59d5664c421
[]
no_license
nebnhoj/jhipster
0087b61b88d83276696435aa9ec4b76c03b6ffec
9fe11f3834f9ffee86330345e201925008b656fd
refs/heads/master
2021-06-20T09:48:07.818944
2017-07-25T08:09:05
2017-07-25T08:09:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,115
java
package com.jb.jhipster.web.rest.errors; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; import java.util.HashMap; import java.util.Map; @RestController public class ExceptionTranslatorTestController { @GetMapping("/test/concurrency-failure") public void concurrencyFailure() { throw new ConcurrencyFailureException("test concurrency failure"); } @PostMapping("/test/method-argument") public void methodArgument(@Valid @RequestBody TestDTO testDTO) { } @GetMapping("/test/parameterized-error") public void parameterizedError() { throw new CustomParameterizedException("test parameterized error", "param0_value", "param1_value"); } @GetMapping("/test/parameterized-error2") public void parameterizedError2() { Map<String, String> params = new HashMap<>(); params.put("foo", "foo_value"); params.put("bar", "bar_value"); throw new CustomParameterizedException("test parameterized error", params); } @GetMapping("/test/access-denied") public void accessdenied() { throw new AccessDeniedException("test access denied!"); } @GetMapping("/test/response-status") public void exceptionWithReponseStatus() { throw new TestResponseStatusException(); } @GetMapping("/test/internal-server-error") public void internalServerError() { throw new RuntimeException(); } public static class TestDTO { @NotNull private String test; public String getTest() { return test; } public void setTest(String test) { this.test = test; } } @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status") @SuppressWarnings("serial") public static class TestResponseStatusException extends RuntimeException { } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
bfe3fcf487017fcf95a3d3facbe1688e2039961c
8df7616e45968bf46f764913fd89bc14f020e15c
/data/itrust/origin/code/java/EditApptTest.java
10141299b1e5f80ecdad5996b7567cb09853c347
[]
no_license
qynnine/traceability_ir
a629f2c7f85771e42017efafaf66e42470b23f51
2784188fba3ab026e96db89fbf6d9d00f8e74ec2
refs/heads/master
2016-09-06T19:56:42.462246
2014-09-18T01:47:39
2014-09-18T01:47:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,638
java
package edu.ncsu.csc.itrust.http; import com.meterware.httpunit.SubmitButton; import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebForm; import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.WebTable; import edu.ncsu.csc.itrust.enums.TransactionType; public class EditApptTest extends iTrustHTTPTest { @Override protected void setUp() throws Exception { super.setUp(); gen.clearAllTables(); gen.standardData(); } public void testEditAppt() throws Exception { // login hcp WebConversation wc = login("9000000000", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - HCP Home", wr.getTitle()); assertLogged(TransactionType.HOME_VIEW, 9000000000L, 0L, ""); wr = wr.getLinkWith("View My Appointments").click(); assertLogged(TransactionType.APPOINTMENT_ALL_VIEW, 9000000000L, 0L, ""); WebTable table = wr.getTables()[0]; wr = table.getTableCell(table.getRowCount()-1, 5).getLinkWith("Edit/Remove").click(); assertTrue(wr.getText().contains("Andy Programmer")); WebForm wf = wr.getFormWithID("mainForm"); wf.setParameter("comment", "New comment!"); SubmitButton[] buttons = wf.getSubmitButtons(); wr = wf.submit(buttons[0]); // Submit as "Change" assertTrue(wr.getText().contains("Success: Appointment changed")); assertLogged(TransactionType.APPOINTMENT_EDIT, 9000000000L, 2L, ""); } public void testSetPassedDate() throws Exception { // login hcp WebConversation wc = login("9000000000", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - HCP Home", wr.getTitle()); assertLogged(TransactionType.HOME_VIEW, 9000000000L, 0L, ""); wr = wr.getLinkWith("View My Appointments").click(); assertLogged(TransactionType.APPOINTMENT_ALL_VIEW, 9000000000L, 0L, ""); WebTable table = wr.getTables()[0]; int row = 0; for (int i = 0; i < table.getRowCount(); i++) { if (table.getCellAsText(i,0).equals("Bad Horse")) { row = i; break; } } wr = table.getTableCell(row, 5).getLinkWith("Edit/Remove").click(); assertTrue(wr.getText().contains("Bad Horse")); WebForm wf = wr.getFormWithID("mainForm"); wf.setParameter("schedDate", "10/10/2009"); SubmitButton[] buttons = wf.getSubmitButtons(); wr = wf.submit(buttons[0]); // Submit as "Change" assertTrue(wr.getText().contains("The scheduled date of this appointment (2009-10-10 15:00:00.0) has already passed.")); assertNotLogged(TransactionType.APPOINTMENT_EDIT, 9000000000L, 42L, ""); } public void testRemoveAppt() throws Exception { // login hcp WebConversation wc = login("9000000000", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - HCP Home", wr.getTitle()); assertLogged(TransactionType.HOME_VIEW, 9000000000L, 0L, ""); wr = wr.getLinkWith("View My Appointments").click(); assertLogged(TransactionType.APPOINTMENT_ALL_VIEW, 9000000000L, 0L, ""); WebTable table = wr.getTables()[0]; int row = 0; for (int i = 0; i < table.getRowCount(); i++) { if (table.getCellAsText(i,0).equals("Bad Horse")) { row = i; break; } } wr = table.getTableCell(row, 5).getLinkWith("Edit/Remove").click(); assertTrue(wr.getText().contains("Bad Horse")); WebForm wf = wr.getFormWithID("mainForm"); SubmitButton[] buttons = wf.getSubmitButtons(); wr = wf.submit(buttons[1]); // Submit as "Remove" assertTrue(wr.getText().contains("Success: Appointment removed")); assertLogged(TransactionType.APPOINTMENT_REMOVE, 9000000000L, 42L, ""); } }
[ "qynnine@gmail.com" ]
qynnine@gmail.com
2a6658d133cb584bbb949c40f96f48811c49975f
261eb44d855d5d3d6dfd6f0419163f78dd16bda2
/src/com/syntax/review14/HomemadeExceptionDemo.java
0e6d1f9c0a8276b5641c6c98f9b8361f777c09d0
[]
no_license
ZaraD-Hu-b/JavaClasses
f8490555568e18f7505c52ce4b10f7a3ea150840
9b631a8c76799ec47a3a62b0677e4d3d2437e08c
refs/heads/master
2022-04-06T12:57:00.262735
2020-02-29T03:10:18
2020-02-29T03:10:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,815
java
package com.syntax.review14; public class HomemadeExceptionDemo { public static void main(String[] args) { int age1 = 19; try { checkInformation(age1); System.out.println("First user is logged in"); } catch (AccessDeniedException e) { e.printStackTrace(); } int age2 = 16; // try { // checkInformation(age2); // System.out.println("Second user is logged in"); // } catch (AccessDeniedException e) { // System.out.println("Message -> " + e.getMessage()); // System.out.println("Class -> " + e.getClass()); // System.out.println("e -> " + e); //// e.printStackTrace(); // } String password1 = "12345"; // try { // checkInformation(age1, password1); // } catch (AccessDeniedException e) { // e.printStackTrace(); // } catch (WrongPasswordException e) { // e.printStackTrace(); // } try { checkInformation(age2, password1); } catch (Exception e) { e.printStackTrace(); } System.out.println("Happy Ending"); } public static void checkInformation(int age) throws AccessDeniedException { if (age < 18) { AccessDeniedException ade = new AccessDeniedException("You are under 18!"); throw ade; } } public static void checkInformation(int age, String password) throws AccessDeniedException, WrongPasswordException { if (age < 18) { throw new AccessDeniedException("You are under 18."); } if (password.equals("123456")) { System.out.println("You are OK"); } else { throw new WrongPasswordException("The password should be 123456"); } } } class AccessDeniedException extends Exception { public AccessDeniedException() { super(); } public AccessDeniedException(String msg) { super(msg); } } class WrongPasswordException extends Exception { public WrongPasswordException(String message) { super(message); } }
[ "56832812+Zamira1974@users.noreply.github.com" ]
56832812+Zamira1974@users.noreply.github.com
a0cc270e813f9ad1f47bc3c1ea118e85de545614
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/coolapk/market/event/ActivityResumeEvent.java
44381e5942124131c1f2cf85315023fc41ddc72f
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
473
java
package com.coolapk.market.event; import android.app.Activity; import java.lang.ref.WeakReference; public class ActivityResumeEvent { private WeakReference<Activity> activity; public ActivityResumeEvent(Activity activity2) { this.activity = new WeakReference<>(activity2); } public boolean isSameActivity(Activity activity2) { Activity activity3 = this.activity.get(); return activity3 != null && activity3 == activity2; } }
[ "test@gmail.com" ]
test@gmail.com
56b714ac939ce9fef579edf752578b805e314cb8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/13/13_1e82bc558776d7fe8c6a0a15d39343ecc3b34a6a/EmployeeLookupView/13_1e82bc558776d7fe8c6a0a15d39343ecc3b34a6a_EmployeeLookupView_s.java
7b252a6f286376aba3f32891ef0b7657b9b909fa
[]
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
7,462
java
/* * Copyright (c) 2009-2010 Lockheed Martin Corporation * * 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.eurekastreams.web.client.ui.common.dialog.lookup; import java.util.List; import org.eurekastreams.commons.client.ui.WidgetCommand; import org.eurekastreams.server.domain.Person; import org.eurekastreams.web.client.ui.Bindable; import org.eurekastreams.web.client.ui.ModelChangeListener; import org.eurekastreams.web.client.ui.common.PersonPanel; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.TextBox; /** * The controller for a LoginContentFacade. */ public class EmployeeLookupView implements Bindable { /** * The controller. */ private EmployeeLookupController controller; /** * The model. */ private EmployeeLookupModel model; /** * The close command. */ private WidgetCommand closeCommand = null; /** * The last name text box. */ TextBox lastName; /** * The results of the search. */ ListBox results; /** * Search button. */ Hyperlink search; /** * Search button. */ Hyperlink select; /** * Search button. */ Hyperlink cancel; /** * Results description. */ Label resultsDesc; /** * The person container. */ FlowPanel personContainer; /** * The save command. */ private Command saveCommand; /** * The widget. */ private EmployeeLookupContent widget; /** * Default constructor. * * @param inWidget * the widget. * @param inModel * the model to use. * * @param inController * the controller. * @param inSaveCommand * command object that saves the lookup results * */ public EmployeeLookupView(final EmployeeLookupContent inWidget, final EmployeeLookupModel inModel, final EmployeeLookupController inController, final Command inSaveCommand) { widget = inWidget; model = inModel; controller = inController; saveCommand = inSaveCommand; } /** * Initialize the view. */ public void init() { model.addChangeListener(EmployeeLookupModel.PropertyChangeEvent.RESULTS_CHANGED, new ModelChangeListener() { public void onChange() { onPeopleResultsUpdated(); } }); model.addChangeListener(EmployeeLookupModel.PropertyChangeEvent.SELECTION_CHANGED, new ModelChangeListener() { public void onChange() { onSelectedPersonChanged(); } }); model.addChangeListener(EmployeeLookupModel.PropertyChangeEvent.SEARCH_BUTTON_STATUS_CHANGED, new ModelChangeListener() { public void onChange() { onSearchActiveChanged(); } }); model.addChangeListener(EmployeeLookupModel.PropertyChangeEvent.SELECT_BUTTON_STATUS_CHANGED, new ModelChangeListener() { public void onChange() { onSelectActiveChanged(); } }); controller.registerResults(results); controller.registerSearchButton(search); controller.registerLastNameTextBox(lastName); } /** * Called when the last name changes. */ public void onSearchActiveChanged() { if (model.getSearchButtonStatus()) { search.removeStyleName("lookup-search-button-inactive"); search.addStyleName("lookup-search-button-active"); } else { search.removeStyleName("lookup-search-button-active"); search.addStyleName("lookup-search-button-inactive"); } } /** * Called when select active status is changed. */ void onSelectActiveChanged() { if (model.isSelectButtonActive()) { select.removeStyleName("lookup-select-button-inactive"); select.addStyleName("lookup-select-button-active"); } else { select.removeStyleName("lookup-select-button-active"); select.addStyleName("lookup-select-button-inactive"); } } /** * Get the text box with the value to search for. * * @return the text box. */ public TextBox getSearchBox() { return lastName; } /** * Updates due to selected person changed. */ public void onSelectedPersonChanged() { Person selected = model.getSelectedPerson(); final PersonPanel personPanel = widget.getPerson(selected.toPersonModelView()); personContainer.clear(); personContainer.add(personPanel); } /** * Response to updated model results. */ public void onPeopleResultsUpdated() { results.clear(); List<Person> resultsItems = model.getPeopleResults(); for (Person person : resultsItems) { results.addItem(person.getLastName() + ", " + person.getFirstName() + " " + ((person.getMiddleName() == null || person.getMiddleName().isEmpty()) ? "" : person .getMiddleName()), person.getAccountId()); } String message = ""; if (model.getMoreResultsExist()) { message = "Greater than " + model.getResultLimit() + " results."; } else { message = "Displaying " + model.getPeopleResults().size() + " matches"; } resultsDesc.setText(message); if (resultsItems.size() == 1) { results.setItemSelected(0, true); model.setSelectedPersonByAccountId(results.getValue(0)); } } /** * The command to call to close the dialog. * * @param command * the close command. */ public void setCloseCommand(final WidgetCommand command) { closeCommand = command; controller.registerCancelButton(cancel, closeCommand); controller.registerSelectButton(select, closeCommand, saveCommand); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
51cc0b25698846a4bbce75e8739ea5bc1db866b6
90e4378104d5151a91510986a717a05bdbf5949d
/Net/src/com/gqz/udp/UdpClient.java
46d264b67fdadbdb754dac5a45d6c980e6ad231a
[]
no_license
JackLin-Yao/java-start
70ea38ee28957cc66215cb19b1a7258b587f826e
ae687540c4c1261215fb04a2410b33e9237cf1b7
refs/heads/master
2022-07-04T18:38:34.317252
2020-05-16T13:54:31
2020-05-16T13:54:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,375
java
package com.gqz.udp; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetSocketAddress; /** * 基本流程:发送端 * 1、使用DatagramSocket 指定端口 创建接受端 * 2、准备数据,一定要转成字节数组 * 3、封装成DatagramPacket包裹,需要指定目的地 * 4、发送包裹send (DatagramPacket p) * byte[] getData() * getLength() * 5、释放资源 * @ClassName: UdpClient * @Description: TODO(这里用一句话描述这个类的作用) * @author ganquanzhong * @date 2019年7月12日 下午5:29:02 */ public class UdpClient { public static void main(String[] args) throws Exception { System.out.println("client 发送方启动中......"); // 1、使用DatagramSocket 指定端口 创建接受端 DatagramSocket client = new DatagramSocket(8888); // 2、准备数据,一定要转成字节数组 String data = "模拟UPD发送数据,请求登录(username ,password)"; byte[] datas = data.getBytes(); //字符串转成字节数组 // 3、封装成DatagramPacket包裹,需要指定目的地本机 DatagramPacket packet = new DatagramPacket(datas, datas.length, new InetSocketAddress("localhost", 9999)); // 4、发送包裹send (DatagramPacket p) client.send(packet); // byte[] getData() // getLength() // 5、释放资源 client.close(); } }
[ "gqzdev@gmail.com" ]
gqzdev@gmail.com
da18d5cce13ce49e58dea58631ec9247077fb8fc
324fea83bc8135ab591f222f4cefa19b43d30944
/src/main/java/ru/lanbilling/webservice/wsdl/GetAccountsAddonsSetResponse.java
6348ac404c4477db0f3ca36979bf02b0b88a3c69
[ "MIT" ]
permissive
kanonirov/lanb-client
2c14fac4d583c1c9f524634fa15e0f7279b8542d
bfe333cf41998e806f9c74ad257c6f2d7e013ba1
refs/heads/master
2021-01-10T08:47:46.996645
2015-10-26T07:51:35
2015-10-26T07:51:35
44,953,384
0
0
null
null
null
null
UTF-8
Java
false
false
2,350
java
package ru.lanbilling.webservice.wsdl; import java.util.ArrayList; import java.util.List; import javax.annotation.Generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="ret" type="{urn:api3}soapAccountsAddonsSetFull" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "ret" }) @XmlRootElement(name = "getAccountsAddonsSetResponse") @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public class GetAccountsAddonsSetResponse { @XmlElement(required = true) @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") protected List<SoapAccountsAddonsSetFull> ret; /** * Gets the value of the ret property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the ret property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRet().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link SoapAccountsAddonsSetFull } * * */ @Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public List<SoapAccountsAddonsSetFull> getRet() { if (ret == null) { ret = new ArrayList<SoapAccountsAddonsSetFull>(); } return this.ret; } }
[ "kio@iteratia.com" ]
kio@iteratia.com
2b9c23717a16e36e320b75502b632c61aaf1a752
c8757aa578e53b2ff0d94bc97b7cc2c0bd515e0d
/components/camel-opentracing/src/test/java/org/apache/camel/opentracing/decorators/CqlSpanDecoratorTest.java
bfe904fce179f4669340956739b8c7cb0cfcc5d1
[ "Apache-2.0", "LicenseRef-scancode-unknown", "LicenseRef-scancode-unknown-license-reference" ]
permissive
kaiserahmed-isu/camel
3971b9ea03b289f0be8e9d8fa4534ff2e1440118
7b2a3ae36cb42184604c01195ed5499dc92ea1ff
refs/heads/master
2021-04-03T01:05:16.526119
2018-03-08T12:05:27
2018-03-08T12:05:47
124,423,290
1
0
Apache-2.0
2018-03-08T17:09:29
2018-03-08T17:09:29
null
UTF-8
Java
false
false
3,295
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.camel.opentracing.decorators; import io.opentracing.mock.MockSpan; import io.opentracing.mock.MockTracer; import io.opentracing.tag.Tags; import org.apache.camel.Endpoint; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.opentracing.SpanDecorator; import org.junit.Test; import org.mockito.Mockito; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; public class CqlSpanDecoratorTest { @Test public void testPreCqlFromUri() { String cql = "select%20*%20from%20users"; String keyspace = "test"; Endpoint endpoint = Mockito.mock(Endpoint.class); Exchange exchange = Mockito.mock(Exchange.class); Message message = Mockito.mock(Message.class); Mockito.when(endpoint.getEndpointUri()).thenReturn("cql://host1,host2:8080/" + keyspace + "?cql=" + cql + "&consistencyLevel=quorum"); Mockito.when(exchange.getIn()).thenReturn(message); SpanDecorator decorator = new CqlSpanDecorator(); MockTracer tracer = new MockTracer(); MockSpan span = (MockSpan)tracer.buildSpan("TestSpan").start(); decorator.pre(span, exchange, endpoint); assertEquals(CqlSpanDecorator.CASSANDRA_DB_TYPE, span.tags().get(Tags.DB_TYPE.getKey())); assertEquals(cql, span.tags().get(Tags.DB_STATEMENT.getKey())); assertEquals(keyspace, span.tags().get(Tags.DB_INSTANCE.getKey())); } @Test public void testPreCqlFromHeader() { String cql = "select * from users"; Endpoint endpoint = Mockito.mock(Endpoint.class); Exchange exchange = Mockito.mock(Exchange.class); Message message = Mockito.mock(Message.class); Mockito.when(endpoint.getEndpointUri()).thenReturn("cql://host1,host2?consistencyLevel=quorum"); Mockito.when(exchange.getIn()).thenReturn(message); Mockito.when(message.getHeader(CqlSpanDecorator.CAMEL_CQL_QUERY)).thenReturn(cql); SpanDecorator decorator = new CqlSpanDecorator(); MockTracer tracer = new MockTracer(); MockSpan span = (MockSpan)tracer.buildSpan("TestSpan").start(); decorator.pre(span, exchange, endpoint); assertEquals(CqlSpanDecorator.CASSANDRA_DB_TYPE, span.tags().get(Tags.DB_TYPE.getKey())); assertEquals(cql, span.tags().get(Tags.DB_STATEMENT.getKey())); assertNull(span.tags().get(Tags.DB_INSTANCE.getKey())); } }
[ "davsclaus@apache.org" ]
davsclaus@apache.org
212df9ddb811891b9b5039479e4fd034f8fc4b77
761a37d6d23030785a97d7e7a479c85c54b1bc75
/src/mojang/dt.java
b733955dc42ca01f0a077a78b3dc05fa54da470d
[]
no_license
Lyx52/minecraft-1-2-5-decompiled
35ae210920d92dd6087facf90ef32edb70bda1fd
091efe0c238eaec6c7ab626dc2e98da0776837fb
refs/heads/master
2023-04-04T23:04:18.475541
2021-04-02T17:29:45
2021-04-02T17:29:45
354,087,923
0
0
null
null
null
null
UTF-8
Java
false
false
389
java
package mojang; public class dt { public Class a; public final int b; public int c; public int d; public dt(Class var1, int var2, int var3) { this.a = var1; this.b = var2; this.d = var3; } public boolean a(int var1) { return this.d == 0 || this.c < this.d; } public boolean a() { return this.d == 0 || this.c < this.d; } }
[ "lyxikars123@gmail.com" ]
lyxikars123@gmail.com
51a86f347a4fe5895000d88a2d6facc4f2392037
e0cc677c44a4e70e2e73c787844ba4fad07df1f8
/DPMS/src/test/java/com/jun/dpms/sys/TestComplain.java
eabf100d222098aeb7c7e1fa817ce27e15d01e62
[]
no_license
coldJune/graduationProject
06d05b33b0e753231f6f29224ddb078f39b91696
983617f4b9ee9a8e32ecb767236163c54f0bf1db
refs/heads/master
2021-01-11T20:22:26.977565
2017-05-14T15:12:13
2017-05-14T15:12:13
79,103,495
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,979
java
package com.jun.dpms.sys; import static org.junit.Assert.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.junit.After; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.jun.dpms.complain.bean.DpmsComplain; import com.jun.dpms.complain.service.IDpmsComplainService; import com.jun.dpms.household.bean.DpmsHousehold; public class TestComplain { @After public void tearDown() throws Exception { } @Test public void test() { ApplicationContext context =new ClassPathXmlApplicationContext("applicationContext.xml"); IDpmsComplainService dpmsComplainService=(IDpmsComplainService)context.getBean("dpmsComplainService"); //²âÊÔÌí¼Ó DpmsComplain dpmsComplain = new DpmsComplain(); dpmsComplain.setDetails("ÕâÊÇÏêÇéÍô˼Ѵ°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡ °¡°¡°¡°¡°¡ °¡°¡°¡°¡°¡ °¡°¡°¡"); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String date=df.format(new Date()); dpmsComplain.setComplainDate(date); DpmsHousehold dpmsHousehold = new DpmsHousehold(); dpmsHousehold.setId(9); dpmsComplain.setDpmsHousehold(dpmsHousehold); dpmsComplainService.addComplain(dpmsComplain); /*//²âÊÔ²éѯ List<DpmsComplain> dpmsComplains = dpmsComplainService.findAll(3, 1); Object[] object = (Object[]) dpmsComplains.get(0); System.out.println(((DpmsHousehold)object[0]).getHoldName()); System.out.println(dpmsComplains); for(int i=0;i<dpmsComplains.size();i++){ System.out.println(((DpmsComplain)dpmsComplains.get(i)).getDetails()); } for (DpmsComplain dpmsComplain : dpmsComplains) { System.out.println(dpmsComplain.getDpmsHousehold().getHoldName()); }*/ } }
[ "785691557@qq.com" ]
785691557@qq.com