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
0ab64c273ddbb270f5cdfe0f4dc6634a30392268
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_14872.java
6f975f43581609eba70a6f2f010892f4bc702e1b
[]
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
158
java
@Override public void onDragBottom(boolean rightToLeft){ if (rightToLeft) { SettingUtil.restoreDefault(); initData(); return; } finish(); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
01bc287711b77bb25c50a5654ef2b9860baf6d64
4881186576e35e46f03182ec91d60c4078c84471
/src/main/java/com/fayayo/study/juc/cache/CacheV4.java
298f8cffb57d0b254ee6881e377f655fb861e624
[]
no_license
lizu18xz/study
6adc45cbb0e9f4e694e4ae6865ba675a8231c364
dc680f1f781bc9cc2acf6ee717d7dea51161007e
refs/heads/master
2022-07-04T13:36:39.936825
2020-03-01T07:18:50
2020-03-01T07:18:50
150,547,064
0
1
null
2022-06-20T22:54:03
2018-09-27T07:30:39
Java
UTF-8
Java
false
false
2,467
java
package com.fayayo.study.juc.cache; import com.fayayo.study.juc.cache.compute.Computable; import com.fayayo.study.juc.cache.compute.ExpensiveFunction; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Future; import java.util.concurrent.FutureTask; /** * @author dalizu on 2020/3/1. * @version v1.0 * @desc 利用Future,避免重复计算 */ public class CacheV4<A,V> implements Computable<A,V>{ //final private final ConcurrentHashMap<A,Future<V>> cache=new ConcurrentHashMap<>(); private final Computable<A,V> c; public CacheV4(Computable<A, V> computable) { this.c = computable; } /** * 锁优化 * * synchronized (this){ cache.put(arg,result); } 这种方式也不能保证HashMap并发安全 * */ @Override public V compute(A arg) throws Exception { //如果两个线程同时调用此方法,那么此时就会有问题 Future<V>f=cache.get(arg); if(f == null){ Callable callable = new Callable<V>(){ @Override public V call() throws Exception { return c.compute(arg); } }; FutureTask ft=new FutureTask<>(callable); f=ft; //计算之前先加入缓存 cache.put(arg,ft); //执行计算 System.out.println("从FutureTask调用计算逻辑"); ft.run(); } return f.get(); } public static void main(String[] args) throws Exception { CacheV4<String,Integer> cache=new CacheV4<>(new ExpensiveFunction()); new Thread(new Runnable() { @Override public void run() { try { Integer result=cache.compute("666"); System.out.println("第一次计算结果:"+result); } catch (Exception e) { e.printStackTrace(); } } }).start(); //... new Thread(new Runnable() { @Override public void run() { try { Integer result= cache.compute("666"); System.out.println("第2次计算结果:"+result); } catch (Exception e) { e.printStackTrace(); } } }).start(); } }
[ "535733495@qq.com" ]
535733495@qq.com
95bf91dd23aba680f76bea5207faa00ff705b86b
8b35595039bb04f5545e53aead05a60e01faba0f
/src/test/java/fr/brouillard/oss/jgitver/strategy/maven/others/Scenario13GitflowWithNonQualifierAndPartialNameTest.java
5096cd7953dc08b10aaee3063685bc229d8ab105
[ "Apache-2.0" ]
permissive
djarosz/jgitver
e8c47fbd6343871be7a386d5e55aa8880c645474
af9cd4f59c1402cc67bd146d74ebf295c5b55880
refs/heads/master
2020-03-31T00:34:54.428890
2018-11-01T11:03:04
2018-11-01T11:03:04
151,746,082
0
0
Apache-2.0
2018-10-05T16:03:37
2018-10-05T16:03:48
null
UTF-8
Java
false
false
4,030
java
/** * Copyright (C) 2016 Matthieu Brouillard [http://oss.brouillard.fr/jgitver] (matthieu@brouillard.fr) * * 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 fr.brouillard.oss.jgitver.strategy.maven.others; import static fr.brouillard.oss.jgitver.Lambdas.unchecked; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.util.Arrays; import java.util.Collections; import org.junit.Test; import fr.brouillard.oss.jgitver.BranchingPolicy; import fr.brouillard.oss.jgitver.BranchingPolicy.BranchNameTransformations; import fr.brouillard.oss.jgitver.Scenarios; import fr.brouillard.oss.jgitver.Strategies; import fr.brouillard.oss.jgitver.metadata.Metadatas; import fr.brouillard.oss.jgitver.strategy.ScenarioTest; public class Scenario13GitflowWithNonQualifierAndPartialNameTest extends ScenarioTest { public Scenario13GitflowWithNonQualifierAndPartialNameTest() { super( Scenarios::s13_gitflow, calculator -> calculator .setStrategy(Strategies.MAVEN) .setQualifierBranchingPolicies( BranchingPolicy.ignoreBranchName("master"), BranchingPolicy.fixedBranchName("develop"), new BranchingPolicy("release/(.*)", Collections.singletonList(BranchNameTransformations.IGNORE.name())), new BranchingPolicy("feature/(.*)", Arrays.asList( BranchNameTransformations.REMOVE_UNEXPECTED_CHARS.name(), BranchNameTransformations.LOWERCASE_EN.name()) ) ) .setUseDefaultBranchingPolicy(false)); } @Test public void head_is_on_master_by_default() throws Exception { assertThat(repository.getBranch(), is("master")); } @Test public void version_of_master() { // checkout the commit in scenario unchecked(() -> git.checkout().setName("master").call()); assertThat(versionCalculator.getVersion(), is("3.0.0")); assertThat(versionCalculator.meta(Metadatas.NEXT_MAJOR_VERSION).get(), is("4.0.0")); assertThat(versionCalculator.meta(Metadatas.NEXT_MINOR_VERSION).get(), is("3.1.0")); assertThat(versionCalculator.meta(Metadatas.NEXT_PATCH_VERSION).get(), is("3.0.1")); } @Test public void version_of_branch_release_1x() { // checkout the commit in scenario unchecked(() -> git.checkout().setName("release/1.x").call()); assertThat(versionCalculator.getVersion(), is("1.0.1-SNAPSHOT")); } @Test public void version_of_branch_release_2x() { // checkout the commit in scenario unchecked(() -> git.checkout().setName("release/2.x").call()); assertThat(versionCalculator.getVersion(), is("2.0.0-SNAPSHOT")); } @Test public void version_of_branch_develop() { // checkout the commit in scenario unchecked(() -> git.checkout().setName("develop").call()); assertThat(versionCalculator.getVersion(), is("1.0.1-develop-SNAPSHOT")); } @Test public void version_of_a_feature_branch() { // checkout the commit in scenario unchecked(() -> git.checkout().setName("feature/add-sso").call()); assertThat(versionCalculator.getVersion(), is("1.0.1-addsso-SNAPSHOT")); } }
[ "matthieu@brouillard.fr" ]
matthieu@brouillard.fr
ae4db2fcb36a1c717651fea8e718337e479d0312
f3d48fc31d73f8e10ca0e987e77055496dc3f3c7
/src/main/java/com/ddlab/rnd/repository/one2many1/PostComment.java
ca554cbb2cab596241ed6b60c4e063a9f3f9ae8a
[]
no_license
debjava/spring-boot-postgresql-jpa-hibernate
e81c3a35a5973f58349e47a96f71940b0d1506f6
fd9a6b06817dfc5b37392b66a4d3e5eef37e7242
refs/heads/master
2023-07-14T12:26:35.164043
2021-08-18T19:04:46
2021-08-18T19:04:46
397,708,202
0
0
null
null
null
null
UTF-8
Java
false
false
544
java
package com.ddlab.rnd.repository.one2many1; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import lombok.Data; @Data @Entity(name = "PostComment") @Table(name = "post_comment") public class PostComment { @Id @GeneratedValue private Long id; private String review; // Constructors, getters and setters removed for brevity public PostComment() { } public PostComment(String review) { this.review = review; } }
[ "deba.java@gmail.com" ]
deba.java@gmail.com
f45abff8507650cb56dffba8ecf456af1b3cdbf7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_dd7aabc8e106b426744ec4d0aeab2608ae28b98a/PackageChange/33_dd7aabc8e106b426744ec4d0aeab2608ae28b98a_PackageChange_s.java
d9e67de0961bd34f4077f09d0621f9c0c32d00ba
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,664
java
package biz.bokhorst.xprivacy; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.support.v4.app.NotificationCompat; import android.util.Log; public class PackageChange extends BroadcastReceiver { @Override public void onReceive(final Context context, Intent intent) { try { // Check uri Uri inputUri = Uri.parse(intent.getDataString()); if (inputUri.getScheme().equals("package")) { // Get data int uid = intent.getIntExtra(Intent.EXTRA_UID, 0); boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false); NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); Util.log(null, Log.INFO, "Package change action=" + intent.getAction() + " replacing=" + replacing + " uid=" + uid); // Check action if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED)) { // Get data ApplicationInfoEx appInfo = new ApplicationInfoEx(context, uid); String packageName = inputUri.getSchemeSpecificPart(); // Default deny new user apps if (PrivacyService.getClient() != null) { if (!replacing) { // Delete existing restrictions PrivacyManager.deleteRestrictions(uid, true); PrivacyManager.deleteSettings(uid); PrivacyManager.deleteUsage(uid); // Restrict new non-system apps if (!appInfo.isSystem()) for (String restrictionName : PrivacyManager.getRestrictions()) { String templateName = PrivacyManager.cSettingTemplate + "." + restrictionName; if (PrivacyManager.getSettingBool(null, 0, templateName, true, false)) PrivacyManager.setRestriction(null, uid, restrictionName, null, true, true); } } // Mark as new/changed PrivacyManager.setSetting(null, uid, PrivacyManager.cSettingState, Integer.toString(ActivityMain.STATE_ATTENTION)); } // New/update notification if (!replacing || PrivacyManager.getSettingBool(null, uid, PrivacyManager.cSettingNotify, true, false)) { Intent resultIntent = new Intent(Intent.ACTION_MAIN); resultIntent.putExtra(ActivityApp.cUid, uid); resultIntent.setClass(context.getApplicationContext(), ActivityApp.class); // Build pending intent PendingIntent pendingIntent = PendingIntent.getActivity(context, uid, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); // Build result intent settings Intent resultIntentSettings = new Intent(Intent.ACTION_MAIN); resultIntentSettings.putExtra(ActivityApp.cUid, uid); resultIntentSettings.putExtra(ActivityApp.cAction, ActivityApp.cActionSettings); resultIntentSettings.setClass(context.getApplicationContext(), ActivityApp.class); // Build pending intent settings PendingIntent pendingIntentSettings = PendingIntent.getActivity(context, uid - 10000, resultIntentSettings, PendingIntent.FLAG_UPDATE_CURRENT); // Build result intent clear Intent resultIntentClear = new Intent(Intent.ACTION_MAIN); resultIntentClear.putExtra(ActivityApp.cUid, uid); resultIntentClear.putExtra(ActivityApp.cAction, ActivityApp.cActionClear); resultIntentClear.setClass(context.getApplicationContext(), ActivityApp.class); // Build pending intent clear PendingIntent pendingIntentClear = PendingIntent.getActivity(context, uid + 10000, resultIntentClear, PendingIntent.FLAG_UPDATE_CURRENT); // Title String title = String.format("%s %s %s", context.getString(replacing ? R.string.msg_update : R.string.msg_new), appInfo.getApplicationName(packageName), appInfo.getPackageVersionName(context, packageName)); if (!replacing) title = String.format("%s %s", title, context.getString(R.string.msg_applied)); // Build notification NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context); notificationBuilder.setSmallIcon(R.drawable.ic_launcher); notificationBuilder.setContentTitle(context.getString(R.string.app_name)); notificationBuilder.setContentText(title); notificationBuilder.setContentIntent(pendingIntent); notificationBuilder.setWhen(System.currentTimeMillis()); notificationBuilder.setAutoCancel(true); // Actions notificationBuilder.addAction(android.R.drawable.ic_menu_edit, context.getString(R.string.menu_app_settings), pendingIntentSettings); notificationBuilder.addAction(android.R.drawable.ic_menu_delete, context.getString(R.string.menu_clear), pendingIntentClear); // Notify Notification notification = notificationBuilder.build(); notificationManager.notify(appInfo.getUid(), notification); } } else if (intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)) { // Notify reboot required String packageName = inputUri.getSchemeSpecificPart(); if (packageName.equals(context.getPackageName())) { // Start package update Intent changeIntent = new Intent(); changeIntent.setClass(context, UpdateService.class); changeIntent.putExtra(UpdateService.cAction, UpdateService.cActionUpdated); context.startService(changeIntent); // Build notification NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context); notificationBuilder.setSmallIcon(R.drawable.ic_launcher); notificationBuilder.setContentTitle(context.getString(R.string.app_name)); notificationBuilder.setContentText(context.getString(R.string.msg_reboot)); notificationBuilder.setWhen(System.currentTimeMillis()); notificationBuilder.setAutoCancel(true); Notification notification = notificationBuilder.build(); // Notify notificationManager.notify(Util.NOTIFY_RESTART, notification); } } else if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED) && !replacing) { // Package removed notificationManager.cancel(uid); // Delete restrictions if (PrivacyService.getClient() != null) { PrivacyManager.deleteRestrictions(uid, true); PrivacyManager.deleteSettings(uid); PrivacyManager.deleteUsage(uid); } } } } catch (Throwable ex) { Util.bug(null, ex); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d58ef5471f81893ebab77bb97ae12018f0fa6ebd
76707a749c77d687d347207d4e5bd1f00f298e5a
/demo-testing-archunit/src/main/java/com/acme/example/archunit/user/service/UserService.java
9f4bb336f2fd83536ae5e044b31734b3a6ddb896
[ "MIT" ]
permissive
vjmadrid/enmilocalfunciona-archunit
6d77374fb03141e7188d3f1f11c5e114ded9577e
ad39e405db71c27e52c788c2756cbab13c91a6e3
refs/heads/master
2023-03-02T02:29:40.837842
2021-02-11T18:46:40
2021-02-11T18:46:40
319,269,273
2
3
null
null
null
null
UTF-8
Java
false
false
163
java
package com.acme.example.archunit.user.service; import com.acme.example.archunit.user.entity.User; public interface UserService { User findUser(Long id); }
[ "vjmadrid@atsistemas.com" ]
vjmadrid@atsistemas.com
46716ffd78b8112042c7fe3d769172a2a8c39f30
c5155d951792f8bb3cc3c0c8fc471b29a9c85df4
/cloud-guanli-module8003/src/main/java/com/donglan/service/UserInfoService.java
a5ca0e4b4fae417acf9c8e2ada79ea5dab932540
[]
no_license
taojian9706/springcloud-2021
23b88e514ef265ee34a6b6446618a0ef5c00a0e5
63a6619aec197b8ed89e3cd16ff64e735938bfdd
refs/heads/master
2023-02-27T06:58:13.215612
2021-02-03T03:17:48
2021-02-03T03:17:48
332,134,735
0
0
null
null
null
null
UTF-8
Java
false
false
267
java
package com.donglan.service; import com.donglan.pojo.UserInfo; /** * @author TAOJIAN * @version 1.0 * @since 2021-01-29 19:24:35 */ public interface UserInfoService { int addUser(UserInfo userInfo); UserInfo login(String username, String password); }
[ "=" ]
=
af03a6a1571730445951b903f0ea65dc99a2f30f
f44d72a15eb0d8e86f95855bdae5fb7c490b61d3
/laicode_java/src/laicode_java/Solution238.java
76dbdb87246aeb59e063cb2303408395bc1dbc6d
[]
no_license
conmillet/laicode_algorithm
94eedea0a234545a164b33d51f2e709edce32118
5e1810b45ca3f291030731e11e795bbb083ecffa
refs/heads/master
2021-01-01T08:06:30.334383
2019-03-25T06:08:39
2019-03-25T06:08:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,038
java
package laicode_java; import java.util.*; //Next Permutation //Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). //The replacement must be in-place, do not allocate extra memory. // // Example // 1,2,3 → 1,3,2 // 3,2,1 → 1,2,3 // 1,1,5 → 1,5,1 public class Solution238 { class AscComparator implements Comparator<Integer>{ @Override public int compare(Integer o1, Integer o2) { return o1 - o2; } } public void nextPermutation(int[] nums) { if(nums==null || nums.length<2) { return; } // numbers into the lexicographically next greater permutation of numbers. // 1 3 4 2 // | // | // 1 4 3 2 // 1 4 2 3 int i=nums.length-2; for(; i>=0; i--) { if(nums[i]<nums[i+1]) { //found the first less than right node, here nums[i]=3 break; } } int j=nums.length-1; for(; j>i; j--) { if(nums[j]>nums[i]) { //found the right section from right, first node bigger than nums[i], here is 4 break; } } //swap the nums[i] with nums[j] int temp=nums[i]; nums[i]=nums[j]; nums[j]=temp; //asc sort from i+1th to the end Arrays.sort(nums, i+1, nums.length); System.out.println(Arrays.toString(nums)); } public int[] productExceptSelf(int[] nums) { int n = nums.length; int[] res = new int[n]; res[0] = 1; for(int i=1; i<n; i++) { res[i] = res[i-1] * nums[i-1]; } /* * 1 2 3 4 * 1 1 2 6 *24 12 8 6 */ int right = 1; for(int i=n-1; i>=0; i--) { res[i] *= right; right *= nums[i]; } return res; } public static void main(String[] args) { Solution238 ss = new Solution238(); int[] nums = new int[]{6,8,7,4,3,2}; ss.nextPermutation(nums); } }
[ "shenfei2031@gmail.com" ]
shenfei2031@gmail.com
6fd554d1b52ab668bd4abac355c8f57cf76a2ad7
995f73d30450a6dce6bc7145d89344b4ad6e0622
/MATE-20_EMUI_11.0.0/src/main/java/com/android/server/policy/EventLogTags.java
c1c596d9bb52d9206f7e83c43eaf17343dcb04d4
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
621
java
package com.android.server.policy; import android.util.EventLog; public class EventLogTags { public static final int INTERCEPT_POWER = 70001; public static final int SCREEN_TOGGLED = 70000; private EventLogTags() { } public static void writeScreenToggled(int screenState) { EventLog.writeEvent((int) SCREEN_TOGGLED, screenState); } public static void writeInterceptPower(String action, int mpowerkeyhandled, int mpowerkeypresscounter) { EventLog.writeEvent((int) INTERCEPT_POWER, action, Integer.valueOf(mpowerkeyhandled), Integer.valueOf(mpowerkeypresscounter)); } }
[ "dstmath@163.com" ]
dstmath@163.com
101f99b65b721a6eb3fc1cef9edb4e19458e8df1
a0caa255f3dbe524437715adaee2094ac8eff9df
/src/main/java/p000/ccn.java
b98b13d76959db7f842fe67d846de1feb830c5ac
[]
no_license
AndroidTVDeveloper/com.google.android.tvlauncher
16526208b5b48fd48931b09ed702fe606fe7d694
0f959c41bbb5a93e981145f371afdec2b3e207bc
refs/heads/master
2021-01-26T07:47:23.091351
2020-02-26T20:58:19
2020-02-26T20:58:19
243,363,961
0
1
null
null
null
null
UTF-8
Java
false
false
158
java
package p000; /* renamed from: ccn */ /* compiled from: PG */ interface ccn { /* renamed from: a */ dhb mo2604a(ccm ccm, String str, String str2); }
[ "eliminater74@gmail.com" ]
eliminater74@gmail.com
6ebe20d35782e6b191ed5bcbb81b4f0142141f02
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_f1e1cf992bb1bd48ff6c3e7ec06231012e3ae29d/FlatFileItemReader/5_f1e1cf992bb1bd48ff6c3e7ec06231012e3ae29d_FlatFileItemReader_s.java
56427aec34ccd9a33812d0677d532d2ee633230a
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,861
java
package org.springframework.batch.item.file; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.ReaderNotOpenException; import org.springframework.batch.item.UnexpectedInputException; import org.springframework.batch.item.file.mapping.LineMapper; import org.springframework.batch.item.file.separator.RecordSeparatorPolicy; import org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy; import org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.io.Resource; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; /** * Restartable {@link ItemReader} that reads lines from input * {@link #setResource(Resource)}. Line is defined by the * {@link #setRecordSeparatorPolicy(RecordSeparatorPolicy)} and mapped to item * using {@link #setLineMapper(LineMapper)}. * * @author Robert Kasanicky */ public class FlatFileItemReader<T> extends AbstractItemCountingItemStreamItemReader<T> implements ResourceAwareItemReaderItemStream<T>, InitializingBean { private static final Log logger = LogFactory.getLog(FlatFileItemReader.class); // default encoding for input files public static final String DEFAULT_CHARSET = Charset.defaultCharset().name(); private RecordSeparatorPolicy recordSeparatorPolicy = new SimpleRecordSeparatorPolicy(); private Resource resource; private BufferedReader reader; private int lineCount = 0; private String[] comments = new String[] { "#" }; private boolean noInput = false; private String encoding = DEFAULT_CHARSET; private LineMapper<T> lineMapper; private int linesToSkip = 0; private LineCallbackHandler skippedLinesCallback; public FlatFileItemReader() { setName(ClassUtils.getShortName(FlatFileItemReader.class)); } /** * @param skippedLinesCallback will be called for each one of the initial skipped * lines before any items are read. */ public void setSkippedLinesCallback(LineCallbackHandler skippedLinesCallback) { this.skippedLinesCallback = skippedLinesCallback; } /** * Public setter for the number of lines to skip at the start of a file. Can * be used if the file contains a header without useful (column name) * information, and without a comment delimiter at the beginning of the * lines. * * @param linesToSkip the number of lines to skip */ public void setLinesToSkip(int linesToSkip) { this.linesToSkip = linesToSkip; } /** * Setter for line mapper. This property is required to be set. * @param lineMapper maps line to item */ public void setLineMapper(LineMapper<T> lineMapper) { this.lineMapper = lineMapper; } /** * Setter for the encoding for this input source. Default value is * {@link #DEFAULT_CHARSET}. * * @param encoding a properties object which possibly contains the encoding * for this input file; */ public void setEncoding(String encoding) { this.encoding = encoding; } /** * Setter for comment prefixes. Can be used to ignore header lines as well * by using e.g. the first couple of column names as a prefix. * * @param comments an array of comment line prefixes. */ public void setComments(String[] comments) { this.comments = new String[comments.length]; System.arraycopy(comments, 0, this.comments, 0, comments.length); } /** * Public setter for the input resource. */ public void setResource(Resource resource) { this.resource = resource; } /** * Public setter for the recordSeparatorPolicy. Used to determine where the * line endings are and do things like continue over a line ending if inside * a quoted string. * * @param recordSeparatorPolicy the recordSeparatorPolicy to set */ public void setRecordSeparatorPolicy(RecordSeparatorPolicy recordSeparatorPolicy) { this.recordSeparatorPolicy = recordSeparatorPolicy; } /** * @return string corresponding to logical record according to * {@link #setRecordSeparatorPolicy(RecordSeparatorPolicy)} (might span * multiple lines in file). */ @Override protected T doRead() throws Exception { if (noInput) { return null; } String line = readLine(); String record = line; if (line != null) { while (line != null && !recordSeparatorPolicy.isEndOfRecord(record)) { record = recordSeparatorPolicy.preProcess(record) + (line = readLine()); } } String logicalLine = recordSeparatorPolicy.postProcess(record); if (logicalLine == null) { return null; } else { return lineMapper.mapLine(logicalLine, lineCount); } } /** * @return next line (skip comments). */ private String readLine() { if (reader == null) { throw new ReaderNotOpenException("Reader must be open before it can be read."); } String line = null; try { line = this.reader.readLine(); if (line == null) { return null; } lineCount++; while (isComment(line)) { line = reader.readLine(); if (line == null) { return null; } lineCount++; } } catch (IOException e) { throw new UnexpectedInputException("Unable to read from resource '" + resource + "' at line " + lineCount, e); } return line; } private boolean isComment(String line) { for (String prefix : comments) { if (line.startsWith(prefix)) { return true; } } return false; } @Override protected void doClose() throws Exception { lineCount = 0; reader.close(); } @Override protected void doOpen() throws Exception { Assert.notNull(resource, "Input resource must be set"); Assert.notNull(recordSeparatorPolicy, "RecordSeparatorPolicy must be set"); noInput = false; if (!resource.exists()) { noInput = true; logger.warn("Input resource does not exist"); return; } reader = new BufferedReader(new InputStreamReader(resource.getInputStream(), encoding)); for (int i = 0; i < linesToSkip; i++) { String line = readLine(); if (skippedLinesCallback != null) { skippedLinesCallback.handleLine(line); } } } public void afterPropertiesSet() throws Exception { Assert.notNull(lineMapper, "LineMapper is required"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b4593ad2b422c6b36d8bd08f734d8393b7fa6453
b2f07f3e27b2162b5ee6896814f96c59c2c17405
/com/sun/jmx/remote/protocol/rmi/ServerProvider.java
5e11bb8a8cdcb6bf6546f9c3a0ae61412c913dce
[]
no_license
weiju-xi/RT-JAR-CODE
e33d4ccd9306d9e63029ddb0c145e620921d2dbd
d5b2590518ffb83596a3aa3849249cf871ab6d4e
refs/heads/master
2021-09-08T02:36:06.675911
2018-03-06T05:27:49
2018-03-06T05:27:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,258
java
/* */ package com.sun.jmx.remote.protocol.rmi; /* */ /* */ import java.io.IOException; /* */ import java.net.MalformedURLException; /* */ import java.util.Map; /* */ import javax.management.MBeanServer; /* */ import javax.management.remote.JMXConnectorServer; /* */ import javax.management.remote.JMXConnectorServerProvider; /* */ import javax.management.remote.JMXServiceURL; /* */ import javax.management.remote.rmi.RMIConnectorServer; /* */ /* */ public class ServerProvider /* */ implements JMXConnectorServerProvider /* */ { /* */ public JMXConnectorServer newJMXConnectorServer(JMXServiceURL paramJMXServiceURL, Map<String, ?> paramMap, MBeanServer paramMBeanServer) /* */ throws IOException /* */ { /* 44 */ if (!paramJMXServiceURL.getProtocol().equals("rmi")) { /* 45 */ throw new MalformedURLException("Protocol not rmi: " + paramJMXServiceURL.getProtocol()); /* */ } /* */ /* 48 */ return new RMIConnectorServer(paramJMXServiceURL, paramMap, paramMBeanServer); /* */ } /* */ } /* Location: C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar * Qualified Name: com.sun.jmx.remote.protocol.rmi.ServerProvider * JD-Core Version: 0.6.2 */
[ "yuexiahandao@gmail.com" ]
yuexiahandao@gmail.com
ccb457cb0afcaa9ca7bd1477856520a56163da3f
aae49c4e518bb8cb342044758c205a3e456f2729
/GeogebraiOS/javasources/org/geogebra/common/kernel/algos/DrawInformationAlgo.java
f3960c0161db2d5c05e15c0d1ab82e9e8bc6f149
[]
no_license
kwangkim/GeogebraiOS
00919813240555d1f2da9831de4544f8c2d9776d
ca3b9801dd79a889da6cb2fdf24b761841fd3f05
refs/heads/master
2021-01-18T05:29:52.050694
2015-10-04T02:29:03
2015-10-04T02:29:03
45,118,575
4
2
null
2015-10-28T14:36:32
2015-10-28T14:36:31
null
UTF-8
Java
false
false
341
java
package org.geogebra.common.kernel.algos; /** * Algos that contain information needed for object drawing * * @author kondr * */ public interface DrawInformationAlgo { /** * Make a placeholder for this algo containing all info necessary for * drawing * * @return algo placeholder */ public DrawInformationAlgo copy(); }
[ "kuoyichun1102@gmail.com" ]
kuoyichun1102@gmail.com
b90fa65ab2d59e5165d1d0905298d798070475c2
1d11d02630949f18654d76ed8d5142520e559b22
/TreeGrow/src/org/tolweb/treegrow/tree/undo/CollapseRestOfTreeUndoableEdit.java
bba7181402c91a772c45b38db9d3aec403b333c5
[]
no_license
tolweb/tolweb-app
ca588ff8f76377ffa2f680a3178351c46ea2e7ea
3a7b5c715f32f71d7033b18796d49a35b349db38
refs/heads/master
2021-01-02T14:46:52.512568
2012-03-31T19:22:24
2012-03-31T19:22:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,892
java
package org.tolweb.treegrow.tree.undo; import java.util.*; import org.tolweb.treegrow.tree.*; /** *Given a node, identify the most recent common ancestor (MRCA) with a page. *Collapse that node's decendants onto it (as in "CollapseSubTreeUndoableEdit", *collapsing all nodes within that node's 1-page-depth subtree), sparing *the input node...whose subtree should be allowed to retain it's structure *<p> *In other words: identify all the nodes with pages that are immediate *descendants of the given node (no intermediate node with page exists), and *collapse all nodes on the paths to those immediate-descendant nodes, so that *the result is a bush of nodes-with-pages tied directly to the given node. *<p> * If nodes * c, d, f, and g have pages, and node e is given as argument *<pre> * ,--c ,--c * --b| | * | `--d |---d * a| ---> a| * | ,--f | ,--f * `--e| `--e| * `--g `--g *</pre> */ public class CollapseRestOfTreeUndoableEdit extends ZombiedNodesUndoableEdit { /** * */ private static final long serialVersionUID = -5045723349639835610L; private Node node; private Node startNode; private ArrayList affectedNodes; private boolean oldStartNodeHasChanged; public String toString() { return "CollapseRestOfTreeUndoableEdit of " + node + " zombiedNodes = " + zombiedNodes + " oldTreeString = " + oldTreeString; } /** *param n Node whose MRCA will be collapsed on */ public CollapseRestOfTreeUndoableEdit(Node n) { node = n; //walk down tree until we've reached the parent with a page (or the root) Node root = TreePanel.getTreePanel().getTree().getRoot(); startNode = node.getParent(); while (! startNode.hasPage() && startNode != root ) { startNode = startNode.getParent(); } affectedNodes = new ArrayList(); affectedNodes.add(startNode); oldStartNodeHasChanged = startNode.getChildrenChanged(); redo(); } /** *Collapse. Lots of child removing and parent/child reordering */ public void redo() { startNode.setChildrenChanged(true); Stack childStack = new Stack(); childStack.push(startNode); Tree tree = TreePanel.getTreePanel().getTree(); while (!childStack.empty()) { Node currentNode = (Node) childStack.pop(); if (currentNode != startNode && (currentNode == node || currentNode.hasPage() || tree.isTerminalNode(currentNode) ) ) { currentNode.getParent().removeChild(currentNode); currentNode.setParent(startNode); startNode.addToChildren(currentNode); } else { //internal to the rest of the tree Stack tempStack = new Stack(); Iterator it = currentNode.getChildren().iterator(); while (it.hasNext()) { tempStack.push(it.next()); } while (!tempStack.empty()) { //loop this way to get chldren in correct order childStack.push(tempStack.pop()); } if (currentNode != startNode) { currentNode.getParent().removeChild(currentNode); NodeGraveyard.getGraveyard().addNode(currentNode); zombiedNodes.add(currentNode); } } } // The first time through we want to do the pretty X animation for // deleted nodes, so don't update the tree panel immediately if (!fromConstructor) { updateTreePanel(); } else { fromConstructor = false; } } /** *Decollapse - pull nodes out of graveyard, and rebuild from treestring */ public void undo() { startNode.setChildrenChanged(oldStartNodeHasChanged); Iterator it = zombiedNodes.iterator(); while( it.hasNext() ) { Node curNode = (Node)it.next(); NodeGraveyard.getGraveyard().getNode(curNode.getId()); } TreePanel.getTreePanel().getTree().updateTree(oldTreeString); updateTreePanel(); } /** *rebuild treepanel after structure has changed */ public void updateTreePanel() { TreePanel treePanel = TreePanel.getTreePanel(); treePanel.setActiveNode(node); TreePanelUpdateManager.getManager().rebuildTreePanels(affectedNodes); } public String getPresentationName() { return "Collapse tree below " + node.getName(); } }
[ "lenards@iplantcollaborative.org" ]
lenards@iplantcollaborative.org
a956586accbe3305b55df9a45441f55f7fa610ed
d3ada400b9221986cff2b4aa1636113f2554854a
/app/src/main/java/com/sjl/lbox/app/mobile/QRCode/MyQRCode/decode/PlanarYUVLuminanceSource.java
9abba058167fbcdd075c8945421a9d8169fef876
[]
no_license
q1113225201/LBOX
790c09370abc434feef338c722ccb1a7b10b667f
d2a65d96befc82d7c912e0a134edee4bcf3b021f
refs/heads/master
2021-05-01T09:17:57.446530
2019-03-06T13:32:21
2019-03-06T13:32:21
65,086,547
1
2
null
null
null
null
UTF-8
Java
false
false
5,283
java
/* * Copyright 2009 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sjl.lbox.app.mobile.QRCode.MyQRCode.decode; import android.graphics.Bitmap; import android.graphics.Rect; import com.sjl.lbox.app.mobile.QRCode.MyQRCode.camera.Size; /** * <p> * Android摄像机获取的图像默认采用YCbCr_420_SP(即YUV420SP或NV21)存储格式,为YUV图像的一种。 * </p> * <p> * <b>[采样比例]</b><br> * YUV图像采样比例以下几种:<br> * 444采样中,Y:U:V=4:4:4,每一个Y对应一个UV<br> * 422采样中,Y:U:V=4:2:2,每两个Y共用一个UV<br> * 411采样中,Y:U:V=4:1:1,每四个Y共用一个UV<br> * 420采样中,Y:UV=4:2或Y:U:V=4:1:1,每四个Y共用一个UV<br> * 其中420采样并不代表只有U没有V,而是在采样的时候,如果这一行用4:2:0采样,下一行就用4:0:2采样,总体比率还是Y:UV=4:2或Y:U:V=4:1:1的。 * </p> * <p> * <b>[存储格式]</b><br> * YUV图像有两大类型,Planar类型和Packed类型。<br> * Planar存储格式为:Y...U...V... 或 Y...V...U... 或 Y...(UV)... 等;<br> * Packed存储格式为: (YUV)... 或 (YUVY)... 或 (UYVY)... 等 * </p> * <p> * <b>[数据大小]</b><br> * YUV420图像为Planar类型,先是连续存储的Y(明度/灰度信息),然后是色彩信息U(Cb,蓝色色度)和V(Cr,红色色度)。<br> * YUV420图像中的比例为Y:UV=4:2,其中Y、U、V各占一个byte。 <br> * 也就是说2/3的数据为Y信息,1/3为色彩信息,所以YUV数据长度为图像长宽乘积的1.5倍。<br> * YUV420有两种,YUV420P和YUV420SP。<br> * YUV420P为Y...U...V...类型;<br> * YUV420SP为Y...(UV)...类型,其中的U、V为交错存储。<br> * </p> * <p> * <b>[二维码处理]</b><br> * 在二维码处理过程中,只需要用到Y信息(前2/3的数据),不必考虑UV数据具体存储规则。<br> * 本类兼容所有Planar格式的YUV图像。 * </p> */ public class PlanarYUVLuminanceSource extends LuminanceSource { private byte[] yuvData; private Size dataSize; private Rect previewRect; /** * @param yuvData * YUV数据,包含Y信息和UV信息 * @param dataSize * 图像大小 * @param previewRect * 要处理的图像区域 */ public PlanarYUVLuminanceSource(byte[] yuvData, Size dataSize, Rect previewRect) { super(previewRect.width(), previewRect.height()); if (previewRect.left + previewRect.width() > dataSize.width || previewRect.top + previewRect.height() > dataSize.height) { throw new IllegalArgumentException("Crop rectangle does not fit within image data."); } this.yuvData = yuvData; this.dataSize = dataSize; this.previewRect = previewRect; } @Override public byte[] getRow(int y, byte[] row) { if (y < 0 || y >= getHeight()) { throw new IllegalArgumentException("Requested row is outside the image: " + y); } int width = getWidth(); if (row == null || row.length < width) { row = new byte[width]; } int offset = (y + previewRect.top) * dataSize.width + previewRect.left; System.arraycopy(yuvData, offset, row, 0, width); return row; } @Override public byte[] getMatrix() { int width = getWidth(); int height = getHeight(); if (width == dataSize.width && height == dataSize.height) { return yuvData; } int area = width * height; byte[] matrix = new byte[area]; int inputOffset = previewRect.top * dataSize.width + previewRect.left; if (width == dataSize.width) { System.arraycopy(yuvData, inputOffset, matrix, 0, area); return matrix; } byte[] yuv = yuvData; for (int y = 0; y < height; y++) { int outputOffset = y * width; System.arraycopy(yuv, inputOffset, matrix, outputOffset, width); inputOffset += dataSize.width; } return matrix; } @Override public boolean isCropSupported() { return true; } public int getDataWidth() { return dataSize.width; } public int getDataHeight() { return dataSize.height; } /** * 根据扫描结果,生成一个灰度图像 * * @return */ public Bitmap renderCroppedGreyScaleBitmap() { int width = getWidth(); int height = getHeight(); int[] pixels = new int[width * height]; byte[] yuv = yuvData; int inputOffset = previewRect.top * dataSize.width + previewRect.left; for (int y = 0; y < height; y++) { int outputOffset = y * width; for (int x = 0; x < width; x++) { int grey = yuv[inputOffset + x] & 0xff; pixels[outputOffset + x] = 0xFF000000 | (grey * 0x00010101); } inputOffset += dataSize.width; } Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); bitmap.setPixels(pixels, 0, width, 0, 0, width, height); return bitmap; } }
[ "1113225201@qq.com" ]
1113225201@qq.com
93030b4f81bbb7b65829ca1e96b165db3a1e56be
ee18387bab172831a36965bd0695db60523d226a
/maihama-orleans/src/main/java/org/docksidestage/app/logic/DanceSongLogic.java
6aff635334b0b162233b5bcfb39085eaa6f1ad56
[ "Apache-2.0" ]
permissive
EgumaYuto/lasstaflute-micro-service
2c28854c40c8de54b38e9c47de4c0abdf52f7809
bd2e6f672e05b50c5efe7e2c23982e790e667f5f
refs/heads/master
2020-04-18T12:32:41.542483
2019-01-31T12:30:54
2019-01-31T12:30:54
167,536,812
0
0
null
null
null
null
UTF-8
Java
false
false
956
java
/* * Copyright 2015-2017 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.docksidestage.app.logic; import javax.annotation.Resource; import org.docksidestage.dbflute.exbhv.MemberBhv; /** * @author jflute */ public class DanceSongLogic { @Resource private MemberBhv memberBhv; public void letsDance() { memberBhv.selectList(cb -> {}); // nonsense select for test } }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
0e9d44e7358c62d05bf6fc36013e2d25c61327ac
383e578ec8ac3043ddece8223494f27f4a4c76dd
/legend.biz/src/main/java/com/tqmall/legend/facade/report/convert/BusinessPaidOutConvert.java
90d1a7d9be340919ba12ee45857e060d59441757
[]
no_license
xie-summer/legend
0018ee61f9e864204382cd202fe595b63d58343a
7e7bb14d209e03445a098b84cf63566702e07f15
refs/heads/master
2021-06-19T13:44:58.640870
2017-05-18T08:34:13
2017-05-18T08:34:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,800
java
package com.tqmall.legend.facade.report.convert; import com.google.common.collect.Lists; import com.tqmall.cube.shop.result.businessoverview.BusinessPaidAmount; import com.tqmall.cube.shop.result.businessoverview.PaidOutStatisticsDTO; import com.tqmall.legend.facade.report.vo.BusinessPaidOutAmountVo; import com.tqmall.legend.facade.report.vo.PaidOutStatisticsVo; import com.tqmall.wheel.lang.Objects; import org.springframework.core.convert.converter.Converter; import java.util.List; /** * Created by 辉辉大侠 on 9/5/16. */ public class BusinessPaidOutConvert implements Converter<PaidOutStatisticsDTO, PaidOutStatisticsVo> { @Override public PaidOutStatisticsVo convert(PaidOutStatisticsDTO source) { if (Objects.isNull(source)) { return null; } PaidOutStatisticsVo paidOutStatisticsVo = new PaidOutStatisticsVo(); paidOutStatisticsVo.setTotalPaidAmount(source.getTotalPaidAmount()); List<BusinessPaidOutAmountVo> businessPaidOutAmountVos = Lists.<BusinessPaidOutAmountVo>newArrayListWithCapacity(source.getBusinessPaidAmountList().size()); for (BusinessPaidAmount businessPaidAmount : source.getBusinessPaidAmountList()) { BusinessPaidOutAmountVo businessPaidOutAmountVo = new BusinessPaidOutAmountVo(); businessPaidOutAmountVo.setBussinessTagId(businessPaidAmount.getBusinessTag().getTag()); businessPaidOutAmountVo.setBusinessTagName(businessPaidAmount.getBusinessTag().getName()); businessPaidOutAmountVo.setPaidAmount(businessPaidAmount.getPaidAmount()); businessPaidOutAmountVos.add(businessPaidOutAmountVo); } paidOutStatisticsVo.setBusinessPaidOutAmountVoList(businessPaidOutAmountVos); return paidOutStatisticsVo; } }
[ "zhangting.huang@tqmall.com" ]
zhangting.huang@tqmall.com
120aca8f48d19c7c3d9bbeda5900328297dc48b0
6494431bcd79c7de8e465481c7fc0914b5ef89d5
/src/main/java/com/google/zxing/oned/EAN13Writer.java
2e8d3c8af3888ca1f4028d7777b4d1ea9bad094f
[]
no_license
maisamali/coinbase_decompile
97975a22962e7c8623bdec5c201e015d7f2c911d
8cb94962be91a7734a2182cc625efc64feae21bf
refs/heads/master
2020-06-04T07:10:24.589247
2018-07-18T05:11:02
2018-07-18T05:11:02
191,918,070
2
0
null
2019-06-14T09:45:43
2019-06-14T09:45:43
null
UTF-8
Java
false
false
2,373
java
package com.google.zxing.oned; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.FormatException; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import java.util.Map; public final class EAN13Writer extends UPCEANWriter { public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) throws WriterException { if (format == BarcodeFormat.EAN_13) { return super.encode(contents, format, width, height, hints); } throw new IllegalArgumentException("Can only encode EAN_13, but got " + format); } public boolean[] encode(String contents) { if (contents.length() != 13) { throw new IllegalArgumentException("Requested contents should be 13 digits long, but got " + contents.length()); } try { if (UPCEANReader.checkStandardUPCEANChecksum(contents)) { int i; int parities = EAN13Reader.FIRST_DIGIT_ENCODINGS[Integer.parseInt(contents.substring(0, 1))]; boolean[] result = new boolean[95]; int pos = 0 + OneDimensionalCodeWriter.appendPattern(result, 0, UPCEANReader.START_END_PATTERN, true); for (i = 1; i <= 6; i++) { int digit = Integer.parseInt(contents.substring(i, i + 1)); if (((parities >> (6 - i)) & 1) == 1) { digit += 10; } pos += OneDimensionalCodeWriter.appendPattern(result, pos, UPCEANReader.L_AND_G_PATTERNS[digit], false); } pos += OneDimensionalCodeWriter.appendPattern(result, pos, UPCEANReader.MIDDLE_PATTERN, false); for (i = 7; i <= 12; i++) { pos += OneDimensionalCodeWriter.appendPattern(result, pos, UPCEANReader.L_PATTERNS[Integer.parseInt(contents.substring(i, i + 1))], true); } pos += OneDimensionalCodeWriter.appendPattern(result, pos, UPCEANReader.START_END_PATTERN, true); return result; } throw new IllegalArgumentException("Contents do not pass checksum"); } catch (FormatException e) { throw new IllegalArgumentException("Illegal contents"); } } }
[ "gulincheng@droi.com" ]
gulincheng@droi.com
838db16411fdc4a7d11196b1942c334b84865a6f
95cd21c6bfd537886adefa1dd7e5916ca4dcf559
/net/optifine/entity/model/ModelAdapterIllager.java
cdb3205fbbd11e2597e0c9f6a0fc45648543fd0c
[]
no_license
RavenLeaks/BetterCraft-src
acd3653e9259b46571e102480164d86dc75fb93f
fca1f0f3345b6b75eef038458c990726f16c7ee8
refs/heads/master
2022-10-27T23:36:27.113266
2020-06-09T15:50:17
2020-06-09T15:50:17
271,044,072
4
2
null
null
null
null
UTF-8
Java
false
false
2,005
java
/* */ package net.optifine.entity.model; /* */ /* */ import net.minecraft.client.model.ModelBase; /* */ import net.minecraft.client.model.ModelIllager; /* */ import net.minecraft.client.model.ModelRenderer; /* */ /* */ public abstract class ModelAdapterIllager /* */ extends ModelAdapter /* */ { /* */ public ModelAdapterIllager(Class entityClass, String name, float shadowSize) { /* 11 */ super(entityClass, name, shadowSize); /* */ } /* */ /* */ /* */ public ModelRenderer getModelRenderer(ModelBase model, String modelPart) { /* 16 */ if (!(model instanceof ModelIllager)) /* */ { /* 18 */ return null; /* */ } /* */ /* */ /* 22 */ ModelIllager modelillager = (ModelIllager)model; /* */ /* 24 */ if (modelPart.equals("head")) /* */ { /* 26 */ return modelillager.field_191217_a; /* */ } /* 28 */ if (modelPart.equals("body")) /* */ { /* 30 */ return modelillager.field_191218_b; /* */ } /* 32 */ if (modelPart.equals("arms")) /* */ { /* 34 */ return modelillager.field_191219_c; /* */ } /* 36 */ if (modelPart.equals("left_leg")) /* */ { /* 38 */ return modelillager.field_191221_e; /* */ } /* 40 */ if (modelPart.equals("right_leg")) /* */ { /* 42 */ return modelillager.field_191220_d; /* */ } /* 44 */ if (modelPart.equals("nose")) /* */ { /* 46 */ return modelillager.field_191222_f; /* */ } /* 48 */ if (modelPart.equals("left_arm")) /* */ { /* 50 */ return modelillager.field_191224_h; /* */ } /* */ /* */ /* 54 */ return modelPart.equals("right_arm") ? modelillager.field_191223_g : null; /* */ } /* */ } /* Location: C:\Users\emlin\Desktop\BetterCraft.jar!\net\optifine\entity\model\ModelAdapterIllager.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "emlin2021@gmail.com" ]
emlin2021@gmail.com
f5c7810e826e84179f8abad5d7cb888c6187c6da
fa0cf934703768baac2390a0849af9c8141a94e3
/ltybd-offline/src/main/java/com/ltybd/controller/StagnationOntimeController.java
1fcd6546fb9c7d8ab3b161ccf2deddbbb9447497
[]
no_license
NONO9527/ltybd-root
44c4a8bbef3d708c82772874fb14ae654ca05229
c8a650f3f204ff1abeecdc9178869e3a47bdde93
refs/heads/master
2021-12-30T09:23:46.933731
2018-02-08T01:24:14
2018-02-08T01:24:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,968
java
package com.ltybd.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import com.ltybd.service.StagnationOntimeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; /** * StagnationOntimeController.java * * describe: * * 2017年10月16日 下午6:44:25 created By chenq version 0.1 * * 2017年10月16日 下午6:44:25 modifyed By chenq version 0.1 * * copyright 2002-2017 深圳市蓝泰源电子科技有限公司 */ @Api(value = "/stagnationOntime", description = "准点率与滞站") @RestController @RequestMapping("/stagnationOntime/") public class StagnationOntimeController { @Autowired private StagnationOntimeService stagnationOntimeService; /** * @param apikey --系统注册生成apiKey * @param line_id --线路ID * @param city_code --城市代码 * @param date_end --结束日期 * @param date_period --日期范围(30,60,90,365,all) * @param direction --方向 * @param station_id --站点id ,为空返回所有 * @param step --步长:1:小时,2:天,3:周,4:月 * @return Map<String,Object> describe:查询分时准点率与滞站客流 2017年10月16日上午11:16:19 by * Chenq version 0.1 * 应用+模块+接口 */ @ApiOperation(value = "分时准点率与滞站客流 code:002001001", produces = "application/json") @RequestMapping(value = "getPointRatePasFlow", method = { RequestMethod.POST, RequestMethod.GET }) @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "apikey", dataType = "String", required = false, value = "系统注册生成apiKey"), @ApiImplicitParam(paramType = "query", name = "line_id", dataType = "int", required = false, value = "线路ID,必填"), @ApiImplicitParam(paramType = "query", name = "city_code", dataType = "String", required = false, value = "城市代码,必填"), @ApiImplicitParam(paramType = "query", name = "date_end", dataType = "String", required = false, value = "结束日期,必填"), @ApiImplicitParam(paramType = "query", name = "date_period", dataType = "int", required = false, value = "日期范围(30,60,90,365,all),必填"), @ApiImplicitParam(paramType = "query", name = "direction", dataType = "String", required = false, value = "方向,必填"), @ApiImplicitParam(paramType = "query", name = "station_id", dataType = "int", required = false, value = "站点id ,为空返回所有,非必填"), @ApiImplicitParam(paramType = "query", name = "step", dataType = "int", required = false, value = "步长:1:小时,2:天,3:周,4:月,必填"),}) @ResponseBody public Map<String,Object> getPointRatePasFlow(String apikey,Integer line_id,String city_code,String date_end,Integer date_period,String direction,Integer station_id,Integer step){ //1. 定义全局变量:返回结果 Map<String,Object> doResult=new HashMap<String,Object>(); doResult.put("result", 0); doResult.put("resultMsg", "获取数据成功!"); if(StringUtils.isEmpty(apikey)){ doResult.put("result", 1); doResult.put("resultMsg", "参数异常:apikey为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(line_id)){ doResult.put("result", 2); doResult.put("resultMsg", "参数异常:line_id为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(city_code)){ doResult.put("result", 3); doResult.put("resultMsg", "参数异常:city_code为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(date_end)){ doResult.put("result", 4); doResult.put("resultMsg", "参数异常:date_end为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(date_period)){ doResult.put("result", 5); doResult.put("resultMsg", "参数异常:date_period为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(direction)){ doResult.put("result", 6); doResult.put("resultMsg", "参数异常:direction为空!"); doResult.put("response", ""); return doResult; } if(StringUtils.isEmpty(step)){ doResult.put("result", 7); doResult.put("resultMsg", "参数异常:step为空!"); doResult.put("response", ""); return doResult; } Map<String, Object> param=new HashMap<String,Object>(); param.put("city_code", city_code);//设置城市编号 param.put("line_id", line_id);//设置线路编号 param.put("date_end", date_end);//结束日期 param.put("date_period", date_period);//日期范围 param.put("direction", direction);//行车方向 param.put("station_id", station_id);//站点id param.put("step", step);//步长 //获取准点数据 List<Map<String,Object>> ontimeData=new ArrayList<Map<String,Object>>(); ontimeData.addAll(stagnationOntimeService.getOntime(param)); //获取滞站数据 List<Map<String,Object>> stagnationData=new ArrayList<Map<String,Object>>(); stagnationData.addAll(stagnationOntimeService.getStagnation(param)); Map<String, Object> response=new HashMap<String,Object>(); response.put("line_id", line_id); response.put("city_code", city_code); response.put("date", date_end); response.put("date_period", date_period); response.put("direction", direction); response.put("line_ontime_rate", ontimeData); response.put("line_holdup_people", stagnationData); doResult.put("response", response); return doResult; } }
[ "shuai.hong@lantaiyuan.com" ]
shuai.hong@lantaiyuan.com
054bf45245a39d218a9e774e91c359756a66a2b0
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/glassfish/jersey/tests/cdi/resources/StutterEchoTest.java
3d9a0cf7ec59a2a8bc32d5eb2b2c379081c4f8c4
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,850
java
/** * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2013-2017 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://oss.oracle.com/licenses/CDDL+GPL-1.1 * or 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 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.jersey.tests.cdi.resources; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; /** * Test for qualified injection. * * @author Jakub Podlesak (jakub.podlesak at oracle.com) */ @RunWith(Parameterized.class) public class StutterEchoTest extends CdiTest { final String in; final String out; /** * Construct instance with the above test data injected. * * @param in * query parameter. * @param out * expected output. */ public StutterEchoTest(String in, String out) { this.in = in; this.out = out; } @Test public void testGet() { String s = target().path("stutter").queryParam("s", in).request().get(String.class); Assert.assertThat(s, CoreMatchers.equalTo(out)); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
8c048434b3dbe1006ea9c6e8a1b21a4c2a2edf6c
8cdd371c37221d3e04cdfa92dc9a31d9e9f6528c
/src/main/java/edu/utexas/libra/themis/impl/stmt/ThemisReturnStmt.java
bfae2ce0df0f2847802fde0dfac19ab0ad75a2c5
[]
no_license
fredfeng/Themis-taint
4e736dfa9d0f5590b9ceaeed39026718a057080f
203982638526fe2a49034a31c85955aef33529e2
refs/heads/master
2021-09-04T00:08:09.556676
2018-01-13T05:33:16
2018-01-13T05:33:16
105,617,517
3
2
null
null
null
null
UTF-8
Java
false
false
614
java
package edu.utexas.libra.themis.impl.stmt; import edu.utexas.libra.themis.ast.expr.Expr; import edu.utexas.libra.themis.ast.stmt.ReturnStmt; import edu.utexas.libra.themis.visitor.StmtVisitor; class ThemisReturnStmt extends ThemisStmt implements ReturnStmt { private Expr expr; ThemisReturnStmt(Expr expr) { if (expr == null) throw new IllegalArgumentException(); this.expr = expr; } @Override public <T> T accept(StmtVisitor<T> visitor) { return visitor.visit(this); } @Override public Expr getReturnValue() { return expr; } }
[ "fengyu8299@gmail.com" ]
fengyu8299@gmail.com
048d76a24a3268ce3d12b42cb239545917f966c1
d2696bed743c2e501839a1d3d75b9ad589da92b2
/spring-boot-examples/spring-boot-cloud-sso/spring-boot-user-center2/src/main/java/com/yin/springboot/user/center/server/service/ClientdetailsServiceImpl.java
90609891a2b6d7a6dafc88b58411b4245bd9b33b
[ "Apache-2.0" ]
permissive
yinfuquan/spring-boot-examples
168fa76e15f04e3c234894072a8e4c8b37c415a7
702cbf46ce894f499f2b4727c85c5e99c27f5690
refs/heads/master
2022-06-21T22:03:45.884293
2019-08-11T13:47:54
2019-08-11T13:47:54
200,501,734
0
0
Apache-2.0
2022-06-17T02:23:02
2019-08-04T14:19:05
JavaScript
UTF-8
Java
false
false
1,050
java
package com.yin.springboot.user.center.server.service; import org.springframework.stereotype.Service; import javax.annotation.Resource; import com.yin.springboot.user.center.mapper.ClientdetailsMapper; import com.yin.springboot.user.center.domain.Clientdetails; import java.util.List; import com.yin.springboot.user.center.server.ClientdetailsService; @Service public class ClientdetailsServiceImpl implements ClientdetailsService{ @Resource private ClientdetailsMapper clientdetailsMapper; @Override public int updateBatch(List<Clientdetails> list) { return clientdetailsMapper.updateBatch(list); } @Override public int batchInsert(List<Clientdetails> list) { return clientdetailsMapper.batchInsert(list); } @Override public int insertOrUpdate(Clientdetails record) { return clientdetailsMapper.insertOrUpdate(record); } @Override public int insertOrUpdateSelective(Clientdetails record) { return clientdetailsMapper.insertOrUpdateSelective(record); } }
[ "1257791382@qq.com" ]
1257791382@qq.com
fd8942317e94c5699dc5bc63c793e09d100d5cda
a83cf28d3adbc706b754a2d9a8e84162351ddc30
/PrototypeDP-Solution-ShallowCloning/src/com/nt/comp/FictionalBooksCollection.java
d2ac496370595ff7eb93d41f901d6d0250699d32
[]
no_license
nerdseeker365/NTDP912
411cbf12395202d4bf0589fc3b6ac5510181e839
9c3b7231d3738b96c4f18480a919da23c7764169
refs/heads/master
2022-03-24T06:55:33.059743
2020-01-01T05:11:40
2020-01-01T05:11:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
package com.nt.comp; public class FictionalBooksCollection extends BooksCollection { public FictionalBooksCollection() { System.out.println("FictionalBooksCollection:: 0-param constructor"); } @Override public void loadBooks() { Book b=null; // collect these books DB s/w.. setType("fictional"); for(int i=0;i<10;++i) { b=new Book(); b.setBookId(i+1); b.setBookName("FI->Book::"+i); getBooks().add(b); } } }
[ "karrasankar09@gmail.com" ]
karrasankar09@gmail.com
446ce5f46b13ef44e6be7141fbbca3121a8367a0
a3fe5db4cf9f5dc75b8331b1fe69de13e0549587
/activemq/command/DataStructure.java
7beed0149faa1a47b390a0d092109ac8cd4b42f6
[]
no_license
ShengtaoHou/software-recovery
7cd8e1a0aabadb808a0f00e5b0503a582c8d3c89
72a3dde6a0cba56f851c29008df94ae129a05d03
refs/heads/master
2020-09-26T08:25:54.952083
2019-12-11T07:32:57
2019-12-11T07:32:57
226,215,103
1
0
null
null
null
null
UTF-8
Java
false
false
184
java
// // Decompiled by Procyon v0.5.36 // package org.apache.activemq.command; public interface DataStructure { byte getDataStructureType(); boolean isMarshallAware(); }
[ "shengtao@ShengtaoHous-MacBook-Pro.local" ]
shengtao@ShengtaoHous-MacBook-Pro.local
7e3b61d96d08664e4c2620914225c3b15d77ce4c
f7160c0f0526cc5afc0fe4e6f06d384394059aa1
/fsa/fs-uicommons/src/impl/java/com/fs/uicommons/impl/gwt/client/handler/EndpointBondHandler.java
d17dad258dc3e17a77cba99fc63aa5f71faed816
[]
no_license
o1711/somecode
e2461c4fb51b3d75421c4827c43be52885df3a56
a084f71786e886bac8f217255f54f5740fa786de
refs/heads/master
2021-09-14T14:51:58.704495
2018-05-15T07:51:05
2018-05-15T07:51:05
112,574,683
0
0
null
null
null
null
UTF-8
Java
false
false
1,022
java
/** * Jan 31, 2013 */ package com.fs.uicommons.impl.gwt.client.handler; import com.fs.uicommons.api.gwt.client.event.RegisterUserLoginEvent; import com.fs.uicommons.api.gwt.client.event.UserLoginEvent; import com.fs.uicommons.api.gwt.client.mvc.support.UiHandlerSupport; import com.fs.uicore.api.gwt.client.ContainerI; import com.fs.uicore.api.gwt.client.core.Event.EventHandlerI; import com.fs.uicore.api.gwt.client.endpoint.UserInfo; import com.fs.uicore.api.gwt.client.event.EndpointBondEvent; /** * @author wuzhen * */ public class EndpointBondHandler extends UiHandlerSupport implements EventHandlerI<EndpointBondEvent> { /** * @param c */ public EndpointBondHandler(ContainerI c) { super(c); } @Override public void handle(EndpointBondEvent e) { // UserInfo ui = e.getChannel().getUserInfo(); if (ui.isAnonymous()) { new UserLoginEvent(e.getSource(), ui).dispatch(); } else { new RegisterUserLoginEvent(e.getSource(), ui).dispatch(); } } }
[ "wkz808@163.com" ]
wkz808@163.com
4329ade769d36997bab506e60090aee43a25aa1f
de12a61f864303688d2c9e748eb58e319c26e52d
/Core/SDK/org.emftext.sdk.concretesyntax.resource.cs/src/org/emftext/sdk/concretesyntax/resource/cs/postprocessing/syntax_analysis/CyclicTokenDefinitionAnalyser.java
455116378590b3336c99b05cf3d02a0086be8dc8
[]
no_license
DevBoost/EMFText
800701e60c822b9cea002f3a8ffed18d011d43b1
79d1f63411e023c2e4ee75aaba99299c60922b35
refs/heads/master
2020-05-22T01:12:40.750399
2019-06-02T17:23:44
2019-06-02T19:06:28
5,324,334
6
10
null
2016-03-21T20:05:01
2012-08-07T06:36:34
Java
UTF-8
Java
false
false
4,091
java
/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ package org.emftext.sdk.concretesyntax.resource.cs.postprocessing.syntax_analysis; import java.util.Collection; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import org.emftext.sdk.concretesyntax.AbstractTokenDefinition; import org.emftext.sdk.concretesyntax.ConcreteSyntax; import org.emftext.sdk.concretesyntax.NamedTokenDefinition; import org.emftext.sdk.concretesyntax.RegexComposite; import org.emftext.sdk.concretesyntax.RegexPart; import org.emftext.sdk.concretesyntax.RegexReference; import org.emftext.sdk.concretesyntax.TokenDirective; import org.emftext.sdk.concretesyntax.resource.cs.mopp.CsAnalysisProblemType; import org.emftext.sdk.concretesyntax.resource.cs.postprocessing.AbstractPostProcessor; /** * An analyser that detects cyclic token definitions (i.e., token definition * that transitively references itself). */ public class CyclicTokenDefinitionAnalyser extends AbstractPostProcessor { private static final String CYCLIC_TOKEN_DEFINITIONS_NOT_ALLOWED = "The regular expression for token %s is cyclic."; @Override public void analyse(ConcreteSyntax syntax) { Collection<NamedTokenDefinition> cyclicTokens = findCyclicTokens(syntax); for (NamedTokenDefinition cyclicToken : cyclicTokens) { addProblem( CsAnalysisProblemType.CYCLIC_TOKEN_DEFINITION, String.format(CYCLIC_TOKEN_DEFINITIONS_NOT_ALLOWED, cyclicToken.getName()), cyclicToken); } } @Override protected boolean doResolveProxiesBeforeAnalysis() { return true; } private Collection<NamedTokenDefinition> findCyclicTokens(ConcreteSyntax syntax) { Set<NamedTokenDefinition> cyclicTokens = new LinkedHashSet<NamedTokenDefinition>(); List<TokenDirective> tokenDirectives = syntax.getTokens(); for (TokenDirective directive : tokenDirectives) { if (directive instanceof NamedTokenDefinition) { NamedTokenDefinition tokenDefinition = (NamedTokenDefinition) directive; if (hasReferenceTo(tokenDefinition, tokenDefinition)) { cyclicTokens.add(tokenDefinition); } } } return cyclicTokens; } private boolean hasReferenceTo(AbstractTokenDefinition source, AbstractTokenDefinition target) { Set<AbstractTokenDefinition> references = collectReferences(source); return references.contains(target); } private Set<AbstractTokenDefinition> collectReferences(AbstractTokenDefinition token) { LinkedHashSet<AbstractTokenDefinition> visitedReferences = new LinkedHashSet<AbstractTokenDefinition>(); collectReferences(token, visitedReferences); return visitedReferences; } private void collectReferences(AbstractTokenDefinition token, Set<AbstractTokenDefinition> visitedReferences) { if (token instanceof RegexComposite) { RegexComposite sourceToken = (RegexComposite) token; List<RegexPart> parts = sourceToken.getRegexParts(); for (RegexPart part : parts) { if (part instanceof RegexReference) { RegexReference reference = (RegexReference) part; AbstractTokenDefinition target = reference.getTarget(); if (target != null) { if (!visitedReferences.contains(target)) { visitedReferences.add(target); collectReferences(target, visitedReferences); } visitedReferences.add(target); } } } } } }
[ "jendrik.johannes@devboost.de" ]
jendrik.johannes@devboost.de
f53992c20ba98b1445048eecec76b1573e31ebc4
a626e7393b819c2a5ac16f4ecd409552bd64f83f
/src/main/java/com/dj/mzmanagement/service/MailService.java
9014a9f7c1feb90443e9a4e622e0468d5862247f
[]
no_license
djamel2288/mz-management
a800d736e03e12bdebf6013f3686896c83c5333b
f736ceaf8b07ace72873c8433185b2c9f494ea08
refs/heads/main
2023-04-03T14:02:53.646940
2021-04-14T14:26:18
2021-04-14T14:26:18
357,933,558
0
0
null
null
null
null
UTF-8
Java
false
false
4,087
java
package com.dj.mzmanagement.service; import com.dj.mzmanagement.domain.User; import java.nio.charset.StandardCharsets; import java.util.Locale; import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.MessageSource; import org.springframework.mail.MailException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.thymeleaf.context.Context; import org.thymeleaf.spring5.SpringTemplateEngine; import tech.jhipster.config.JHipsterProperties; /** * Service for sending emails. * <p> * We use the {@link Async} annotation to send emails asynchronously. */ @Service public class MailService { private final Logger log = LoggerFactory.getLogger(MailService.class); private static final String USER = "user"; private static final String BASE_URL = "baseUrl"; private final JHipsterProperties jHipsterProperties; private final JavaMailSender javaMailSender; private final MessageSource messageSource; private final SpringTemplateEngine templateEngine; public MailService( JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender, MessageSource messageSource, SpringTemplateEngine templateEngine ) { this.jHipsterProperties = jHipsterProperties; this.javaMailSender = javaMailSender; this.messageSource = messageSource; this.templateEngine = templateEngine; } @Async public void sendEmail(String to, String subject, String content, boolean isMultipart, boolean isHtml) { log.debug( "Send email[multipart '{}' and html '{}'] to '{}' with subject '{}' and content={}", isMultipart, isHtml, to, subject, content ); // Prepare message using a Spring helper MimeMessage mimeMessage = javaMailSender.createMimeMessage(); try { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, StandardCharsets.UTF_8.name()); message.setTo(to); message.setFrom(jHipsterProperties.getMail().getFrom()); message.setSubject(subject); message.setText(content, isHtml); javaMailSender.send(mimeMessage); log.debug("Sent email to User '{}'", to); } catch (MailException | MessagingException e) { log.warn("Email could not be sent to user '{}'", to, e); } } @Async public void sendEmailFromTemplate(User user, String templateName, String titleKey) { if (user.getEmail() == null) { log.debug("Email doesn't exist for user '{}'", user.getLogin()); return; } Locale locale = Locale.forLanguageTag(user.getLangKey()); Context context = new Context(locale); context.setVariable(USER, user); context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl()); String content = templateEngine.process(templateName, context); String subject = messageSource.getMessage(titleKey, null, locale); sendEmail(user.getEmail(), subject, content, false, true); } @Async public void sendActivationEmail(User user) { log.debug("Sending activation email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title"); } @Async public void sendCreationEmail(User user) { log.debug("Sending creation email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title"); } @Async public void sendPasswordResetMail(User user) { log.debug("Sending password reset email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title"); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
39f009cd72838bc0016013aea127ba776d30eba3
b761ee9c0940728545884c7e5f46afcd06b928ff
/data-exchange-center-service-meishan-dongpo/src/main/java/data/exchange/center/service/meishan/controller/MeishanController.java
6f7cc73b1ead4acb29ed5b0f5f8b3e127c8fc513
[]
no_license
fendaq/data-exchange-center
a55b04335966905b7a26e94bac344d2a4380d301
57c112d37c75ea40ac6c2465c6a7e9c5626f1be7
refs/heads/master
2020-06-22T16:21:12.555502
2018-11-08T08:49:08
2018-11-08T08:49:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,705
java
package data.exchange.center.service.meishan.controller; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import data.exchange.center.service.meishan.service.MeishanService; /** * * Description: * <p>Company: xinya </p> * <p>Date:2017年8月31日 上午10:04:58</p> * @author Wen.Yuguang * @version 1.0 * */ @RestController public class MeishanController { private static Logger logger = LoggerFactory.getLogger(MeishanController.class); @Autowired private MeishanService meishanService; /** * * @function 获取的民商事案件列表(自16年以来所有案件) * @author wenyuguang * @creaetime 2017年9月11日 下午12:59:52 * @param date * @return * @throws Exception */ @RequestMapping(value = "/getMssAjbsList" ,method = RequestMethod.GET) public Object getMssAjbsList( @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate, @RequestParam("pageNum")String pageNum ) throws Exception{ logger.info("parameter: "+startDate+", "+endDate+", "+pageNum); return meishanService.getMssAjbsList(startDate, endDate, pageNum); } /** * * @function * @author wenyuguang * @creaetime 2017年10月10日 下午4:04:45 * @param startDate * @param endDate * @return * @throws Exception */ @RequestMapping(value = "/getMssAjbsCount" ,method = RequestMethod.GET) public Object getMssAjbsCount( @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate ) throws Exception{ logger.info("parameter: "+startDate+", "+endDate); return meishanService.getMssAjbsCount(startDate, endDate); } /** * * @function 获取的民商事案件(自16年以来所有案件)结构化数据内容 * @author wenyuguang * @creaetime 2017年9月11日 下午1:02:51 * @param ajbs * @return * @throws Exception */ @RequestMapping(value = "/getMssAjbsInfo" ,method = RequestMethod.GET) public Object getMssAjbsInfo( @RequestParam("ajbs")String ajbs) throws Exception{ logger.info("parameter: "+ ajbs); return meishanService.getMssAjbsInfo(ajbs); } /** * * @function 获取的执行案件列表(自16年以来所有案件) * @author wenyuguang * @creaetime 2017年9月11日 下午1:06:17 * @param date * @return * @throws Exception */ @RequestMapping(value = "/getZxajAjbsList" ,method = RequestMethod.GET) public Object getZxajAjbsList( @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate, @RequestParam("pageNum")String pageNum ) throws Exception{ logger.info("parameter: "+startDate+", "+endDate+", "+pageNum); return meishanService.getZxajAjbsList(startDate, endDate, pageNum); } /** * * @function * @author wenyuguang * @creaetime 2017年10月10日 下午4:05:34 * @param startDate * @param endDate * @return * @throws Exception */ @RequestMapping(value = "/getZxajAjbsCount" ,method = RequestMethod.GET) public Object getZxajAjbsCount( @RequestParam("startDate")String startDate, @RequestParam("endDate")String endDate ) throws Exception{ logger.info("parameter: "+startDate+", "+endDate); return meishanService.getZxajAjbsCount(startDate, endDate); } /** * * @function 获取的执行案件(自16年以来所有案件)结构化数据内容 * @author wenyuguang * @creaetime 2017年9月11日 下午1:06:12 * @param ajbs * @return * @throws Exception */ @RequestMapping(value = "/getZxajAjbsInfo" ,method = RequestMethod.GET) public Map<String, Object> getZxajAjbsInfo( @RequestParam("ajbs")String ajbs) throws Exception{ logger.info("parameter: "+ ajbs); return meishanService.getZxajAjbsInfo(ajbs); } /** * * @function * @author wenyuguang * @creaetime 2017年9月13日 上午11:10:09 * @param ajbs * @return * @throws Exception */ @RequestMapping(value = "/getWsInfo" ,method = RequestMethod.GET) public Map<String, Object> getWsInfo( @RequestParam("ajbs")String ajbs, @RequestParam("fydm")String fydm, @RequestParam("ajlx")String ajlx) throws Exception{ logger.info("parameter: "+ajbs+", "+fydm+", "+ajlx); return meishanService.getWsInfo(ajbs,fydm,ajlx); } }
[ "yuguang wen" ]
yuguang wen
9774cf43678012e3583c2f442cd8f1b8f50d0758
b4be6ce60105b72d01e32754d07782d141b201b1
/baymax-security/baymax-security-oauth/baymax-security-oauth-server/src/main/java/com/info/baymax/security/oauth/security/authentication/manager/NoGrantedAnyAuthorityException.java
b8c1183e7175e6a0f4dd2bc588e7166f14d35160
[]
no_license
cgb-datav/woven-dsp
62a56099987cc2e08019aceb6e914e538607ca28
b0b2ebd6af3ac42b71d6d9eedc5c6dfa9bd4e316
refs/heads/master
2023-08-28T02:55:19.375074
2021-07-05T04:02:57
2021-07-05T04:02:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
616
java
package com.info.baymax.security.oauth.security.authentication.manager; import org.springframework.security.authentication.AuthenticationServiceException; /** * 说明:没有授予任何权限. <br> * * @author jingwei.yang * @date 2017年11月14日 下午2:31:26 */ public class NoGrantedAnyAuthorityException extends AuthenticationServiceException { private static final long serialVersionUID = 5869204524357172888L; public NoGrantedAnyAuthorityException(String msg) { super(msg); } public NoGrantedAnyAuthorityException(String msg, Throwable t) { super(msg, t); } }
[ "760374564@qq.com" ]
760374564@qq.com
8b0e75bad17cf83e6d8e36461e536f8f1e9067a3
ee7e3a88c571e6a59d500035a357645c5ce69593
/DaoPattern02/src/dao/example/pgsql/EmployeeDAOImpl.java
4a09f19eeaddb6c30cf522e07ec9c1b757647f7d
[]
no_license
DiegOliveros/foo-org-ve
6c91638d31570971f543968ccfbe92bc7cdef707
fef2c796d8c22cbf236500f94055c4006a61ddd2
refs/heads/master
2021-01-10T18:00:54.701851
2013-11-06T21:06:54
2013-11-06T21:06:54
55,300,195
0
0
null
null
null
null
UTF-8
Java
false
false
3,815
java
//package dao.example.pgsql; // //import java.sql.ResultSet; // //import dao.base.api.IDTO; //import dao.base.impl.Reference; //import dao.example.base.AbstractFactoryDAO; //import dao.example.base.DeptDAO; //import dao.example.base.DeptDTO; //import dao.example.base.ProfDAO; //import dao.example.base.ProfDTO; // ///** // * @author Demián Gutierrez // */ //class ProfDAOImpl extends PgSQLBaseDAO implements ProfDAO { // // public ProfDAOImpl() { // super(ProfDTOImpl.class); // } // // // -------------------------------------------------------------------------------- // // PostgresBaseDAO // // -------------------------------------------------------------------------------- // // @Override // protected String createTableColumns() throws Exception { // StringBuffer strbuf = new StringBuffer(); // // DeptDAO deptDAO = (DeptDAO) // // AbstractFactoryDAO.getFactoryDAO().getDAO( // // DeptDAO.class, connectionBean); // // strbuf.append(ProfDTOImpl.ID); // strbuf.append(" INT PRIMARY KEY, "); // strbuf.append(ProfDTOImpl.FRST_NAME); // strbuf.append(" VARCHAR(100), "); // strbuf.append(ProfDTOImpl.LAST_NAME); // strbuf.append(" VARCHAR(100), "); // strbuf.append(ProfDTOImpl.DEPARTMENT_ID); // strbuf.append(" INT REFERENCES "); // strbuf.append(deptDAO.getTableName()); // // return strbuf.toString(); // } // // // -------------------------------------------------------------------------------- // // @Override // protected String createInsertValues(IDTO dto) // // throws Exception { // // ProfDTOImpl profDTOImpl = (ProfDTOImpl) dto; // // StringBuffer strbuf = new StringBuffer(); // // strbuf.append(profDTOImpl.getId()); // strbuf.append(", "); // strbuf.append(singleQuotes(profDTOImpl.getFrstName())); // strbuf.append(", "); // strbuf.append(singleQuotes(profDTOImpl.getLastName())); // strbuf.append(", "); // // Reference<DeptDTO> ref = profDTOImpl.getDeptRef(); // ref.checkInsert(); // strbuf.append(ref.getIdAsString()); // // return strbuf.toString(); // } // // // -------------------------------------------------------------------------------- // // protected String createUpdateValues(IDTO dto) // // throws Exception { // // ProfDTOImpl profDTOImpl = (ProfDTOImpl) dto; // // StringBuffer strbuf = new StringBuffer(); // // strbuf.append(ProfDTOImpl.FRST_NAME); // strbuf.append(" = "); // strbuf.append(singleQuotes(profDTOImpl.getFrstName())); // // strbuf.append(", "); // // strbuf.append(ProfDTOImpl.LAST_NAME); // strbuf.append(" = "); // strbuf.append(singleQuotes(profDTOImpl.getLastName())); // // strbuf.append(", "); // // strbuf.append(ProfDTOImpl.DEPARTMENT_ID); // strbuf.append(" = "); // // Reference<DeptDTO> ref = profDTOImpl.getDeptRef(); // ref.checkUpdate(); // strbuf.append(ref.getIdAsString()); // // return strbuf.toString(); // } // // // -------------------------------------------------------------------------------- // // protected ProfDTOImpl resultSetToDTO(ResultSet rs) throws Exception { // ProfDTOImpl ret = // // (ProfDTOImpl) dtaSession.getDtaByKey( // // ProfDTOImpl.class, rs.getInt(ProfDTOImpl.ID)); // // if (ret != null) { // return ret; // } // // ret = (ProfDTOImpl) AbstractFactoryDAO.getFactoryDAO(). // // getDTO(ProfDTO.class, connectionBean); // // ret.setId/* */(rs.getInt(ProfDTOImpl.ID)); // ret.setFrstName/**/(rs.getString(ProfDTOImpl.FRST_NAME)); // ret.setLastName/**/(rs.getString(ProfDTOImpl.LAST_NAME)); // // Reference<DeptDTO> ref = ret.getDeptRef(); // ref.setRefIdent(rs.getInt(ProfDTOImpl.DEPARTMENT_ID)); // ref.setRefValue(null); // // return (ProfDTOImpl) dtaSession.add(ret); // } //}
[ "piojosnos@gmail.com" ]
piojosnos@gmail.com
87bf51149d7a5360719ad016b1fe6527065db00e
23f42b163c0a58ad61c38498befa1219f53a2c10
/src/main/java/weldstartup/c/AppScopedBean2660.java
506e8ea4175ae47e27fa52e3a819e4f2be4530fd
[]
no_license
99sono/wls-jsf-2-2-12-jersey-weldstartup-bottleneck
9637d2f14a1053159c6fc3c5898a91057a65db9d
b81697634cceca79f1b9a999002a1a02c70b8648
refs/heads/master
2021-05-15T17:54:39.040635
2017-10-24T07:27:23
2017-10-24T07:27:23
107,673,776
0
0
null
null
null
null
UTF-8
Java
false
false
1,630
java
package weldstartup.c; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.spi.BeanManager; import javax.inject.Inject; import javax.transaction.TransactionSynchronizationRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import weldstartup.nondynamicclasses.AppScopedNonDynamicBean; import weldstartup.nondynamicclasses.DependentScopedNonDynamicBean; import weldstartup.nondynamicclasses.RequestScopedNonDynamicBean; /** * A dynamically created CDI bean meant to demonstrate meant to demonstrate that the WeldStartup performance on weblogic * is really under-performing. * */ @ApplicationScoped // appScopedName will be turned into a name like AppScopedBean0001 public class AppScopedBean2660 { private static final Logger LOGGER = LoggerFactory.getLogger(AppScopedBean2660.class); @Inject AppScopedNonDynamicBean appScopedNonDynamicBean; @Inject DependentScopedNonDynamicBean rependentScopedNonDynamicBean; @Inject RequestScopedNonDynamicBean requestScopedNonDynamicBean; @Inject BeanManager beanManager; @Resource TransactionSynchronizationRegistry tsr; @PostConstruct public void postConstruct() { LOGGER.info("Post construct method invoked. AppScopedBean2660"); } @PreDestroy public void preDestroy() { LOGGER.info("Pre-destroy method invoked. AppScopedBean2660"); } public void dummyLogic() { LOGGER.info("Dummy logic invoked. AppScopedBean2660"); } }
[ "99sono@users.noreply.github.com" ]
99sono@users.noreply.github.com
f68c3e36dd5d4e2f477570b650ed831d33529fae
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_2e7498e7dc16703e62ddefeaf243730945cc983f/ContextualProviderInjector/16_2e7498e7dc16703e62ddefeaf243730945cc983f_ContextualProviderInjector_t.java
45632a882f9d8ae2cfe951925d1553a0188889b3
[]
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
3,957
java
/* * Copyright 2010 JBoss, a divison Red Hat, Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.errai.ioc.rebind.ioc; import java.lang.annotation.Annotation; import java.util.List; import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JField; import com.google.gwt.core.ext.typeinfo.JParameter; import com.google.gwt.core.ext.typeinfo.JParameterizedType; import com.google.gwt.user.client.Window; import org.jboss.errai.ioc.rebind.IOCGenerator; public class ContextualProviderInjector extends TypeInjector { private final Injector providerInjector; public ContextualProviderInjector(JClassType type, JClassType providerType) { super(type); this.providerInjector = new TypeInjector(providerType); } @Override public String getType(InjectionContext injectContext, InjectionPoint injectionPoint) { injected = true; JClassType type = null; JParameterizedType pType = null; switch (injectionPoint.getTaskType()) { case PrivateField: case Field: JField field = injectionPoint.getField(); type = field.getType().isClassOrInterface(); pType = type.isParameterized(); break; case Parameter: JParameter parm = injectionPoint.getParm(); type = parm.getType().isClassOrInterface(); pType = type.isParameterized(); break; } StringBuilder sb = new StringBuilder(); if (pType == null) { sb.append(providerInjector.getType(injectContext, injectionPoint)).append(".provide(new Class[] {}"); } else { JClassType[] typeArgs = pType.getTypeArgs(); sb.append("(").append(type.getQualifiedSourceName()).append("<") .append(typeArgs[0].getQualifiedSourceName()).append(">) "); sb.append(providerInjector.getType(injectContext, injectionPoint)).append(".provide(new Class[] {"); for (int i = 0; i < typeArgs.length; i++) { sb.append(typeArgs[i].getQualifiedSourceName()).append(".class"); if ((i + 1) < typeArgs.length) { sb.append(", "); } } sb.append("}"); List<Annotation> qualifiers = InjectUtil.extractQualifiers(injectionPoint); if(!qualifiers.isEmpty()) { sb.append(", new java.lang.annotation.Annotation[] {"); for(int i=0; i<qualifiers.size(); i++) { sb.append("\nnew java.lang.annotation.Annotation() {") .append("\npublic Class<? extends java.lang.annotation.Annotation> annotationType() {\n return ") .append(qualifiers.get(i).annotationType().getName()).append(".class").append(";\n}\n}"); if ((i + 1) < qualifiers.size()) sb.append(","); } sb.append("\n}"); } else { sb.append(", null"); } } sb.append(")"); return IOCGenerator.debugOutput(sb); } @Override public String instantiateOnly(InjectionContext injectContext, InjectionPoint injectionPoint) { injected = true; return providerInjector.getType(injectContext, injectionPoint); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f10fa12f8f2d16bca52eed7de36e1d1d17804338
455c2df145dabfaa1352c5d0bbe556fcdc6c0016
/sharkapp/src/main/java/com/shark/app/business/adapter/TestRecycleAdapter.java
595bf3b09e25a1936167420dfd829e11e1f9c249
[]
no_license
srxffcc1/SingleShark
e35a3159e87c0984533ec5fced7c77fec9a8df44
09cfbd6bc319dcdb464a3b4a980c42976031042a
refs/heads/master
2021-08-18T08:11:27.707463
2018-10-31T01:25:06
2018-10-31T01:25:06
94,157,210
0
0
null
null
null
null
UTF-8
Java
false
false
1,967
java
package com.shark.app.business.adapter; import android.app.Activity; import android.app.Fragment; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.shark.app.R; import com.zhy.autolayout.utils.AutoUtils; /** * Created by King6rf on 2017/8/10. */ @Deprecated //用来测试的adapter public class TestRecycleAdapter extends RecyclerView.Adapter<TestRecycleAdapter.SingelViewHolder>{ public Activity mactivity; public Fragment mfragment; public android.support.v4.app.Fragment msupportfragment; Context mcontext; public TestRecycleAdapter(Fragment mfragment) { this.mfragment = mfragment; mcontext=mfragment.getActivity(); } public TestRecycleAdapter(android.support.v4.app.Fragment msupportfragment) { this.msupportfragment = msupportfragment; mcontext=msupportfragment.getActivity(); } public TestRecycleAdapter(Activity mactivity) { this.mactivity = mactivity; mcontext=mactivity; } @Override public SingelViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView= LayoutInflater.from(mcontext).inflate(R.layout.item_enterpriselist,parent,false); AutoUtils.autoSize(itemView); return new SingelViewHolder(itemView); } @Override public void onBindViewHolder(SingelViewHolder holder, int position) { } @Override public int getItemCount() { return 10; } public class SingelViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener,View.OnLongClickListener { public SingelViewHolder(View itemView) { super(itemView); } @Override public void onClick(View v) { } @Override public boolean onLongClick(View v) { return false; } } }
[ "3521829873@qq.com" ]
3521829873@qq.com
3f62a6e1a516ffaec25926aa5e8758aac72da1df
7364144e8fd7b0382a8dbc2a91dcefbee1b5ee10
/qiankun/pure-html/src/com/key/dwsurvey/service/imp/QuScoreManagerImpl.java
ebe23801f167f9d3c6a1ab62e1745652b67ba521
[]
no_license
libyasdf/frame-learn
2b9ba596d12cb014b7ef9f9689f19142f90b2374
322fbd21cf4389d5f453de2568d1f9b11888ec10
refs/heads/master
2023-01-12T16:36:10.205017
2020-10-11T12:48:00
2020-10-11T12:48:00
299,892,834
0
0
null
2020-10-01T14:10:32
2020-09-30T11:08:35
HTML
UTF-8
Java
false
false
3,183
java
package com.key.dwsurvey.service.imp; import java.util.ArrayList; import java.util.List; import com.key.dwsurvey.service.QuScoreManager; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.key.common.plugs.page.Page; import com.key.common.plugs.page.PropertyFilter; import com.key.common.service.BaseServiceImpl; import com.key.dwsurvey.dao.QuScoreDao; import com.key.dwsurvey.entity.QuScore; /** * 评分题 * @author keyuan(keyuan258@gmail.com) * * https://github.com/wkeyuan/DWSurvey * http://dwsurvey.net */ @Service public class QuScoreManagerImpl extends BaseServiceImpl<QuScore, String> implements QuScoreManager { @Autowired private QuScoreDao quScoreDao; @Override public void setBaseDao() { this.baseDao=quScoreDao; } public List<QuScore> findByQuId(String quId){ Page<QuScore> page=new Page<QuScore>(); page.setOrderBy("orderById"); page.setOrderDir("asc"); List<PropertyFilter> filters=new ArrayList<PropertyFilter>(); filters.add(new PropertyFilter("EQS_quId", quId)); filters.add(new PropertyFilter("EQI_visibility", "1")); return findAll(page, filters); } public int getOrderById(String quId){ Criterion criterion=Restrictions.eq("quId", quId); QuScore quRadio=quScoreDao.findFirst("orderById", false, criterion); if(quRadio!=null){ return quRadio.getOrderById(); } return 0; } /*******************************************************************8 * 更新操作 */ @Override @Transactional public QuScore upOptionName(String quId,String quItemId, String optionName) { if(quItemId!=null && !"".equals(quItemId)){ QuScore quScore = (QuScore)quScoreDao.getSession().get(QuScore.class, quItemId); quScore.setOptionName(optionName); quScoreDao.save(quScore); return quScore; }else{ //取orderById int orderById=getOrderById(quId); //新加选项 QuScore quScore=new QuScore(); quScore.setQuId(quId); quScore.setOptionName(optionName); //title quScore.setOrderById(++orderById); quScore.setOptionTitle(orderById+""); quScoreDao.save(quScore); return quScore; } } @Override @Transactional public List<QuScore> saveManyOptions(String quId,List<QuScore> quScores) { //取orderById int orderById=getOrderById(quId); for (QuScore quScore : quScores) { //新加选项 quScore.setOrderById(++orderById); quScore.setOptionTitle(orderById+""); quScoreDao.save(quScore); } return quScores; } @Override @Transactional public void ajaxDelete(String quItemId) { QuScore quScore = (QuScore)quScoreDao.getSession().get(QuScore.class, quItemId); quScore.setVisibility(0); quScoreDao.save(quScore); } @Override @Transactional public void saveAttr(String quItemId) { QuScore quScore = (QuScore)quScoreDao.getSession().get(QuScore.class, quItemId); quScoreDao.save(quScore); } }
[ "liby1994@126.com" ]
liby1994@126.com
198aad1c159611e67ab38e06fcae60fd8e82293a
a8cf13978723e486605a32f0d9ad01d3373753e1
/Algorithms/src/searches/SearchAlgorithm.java
566b07b70889844c4915898525281d03d8b5c418
[]
no_license
jiayibing1987/Algorithms
9bad397c23a0e62ef6e25bef5fa1e6040e703c96
274faf4d8bb604470d279814923298af948013dd
refs/heads/master
2020-06-26T12:51:16.395552
2019-08-05T14:04:09
2019-08-05T14:04:09
199,636,906
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
package searches; /** * The common interface of most searching algorithms *@author Ryan **/ public interface SearchAlgorithm { /** * @param key is an element which should be found * @param array is an array where the element should be found * @param <T> Comparable type * @return first found index of the element */ <T extends Comparable<T>> int find(T array[], T key); }
[ "jiayibing1987@gmail.com" ]
jiayibing1987@gmail.com
386b4fbb2fae21b1e30177d31c65227d2a38cc5c
1084fe97ca4f7ffba6584cdae0f29af7fd882bfe
/schema/core/src/main/java/net/meerkat/identifier/IdSet.java
b5c5917b638a2f35b82112039ddd3f6b03bcc6ab
[]
no_license
ollierob/meerkat
668a59d839adf01dcb04dcd35e3185ffe55888a8
5c88d567355eb4cb4fee62613b3f6be290dcc19d
refs/heads/master
2022-11-13T21:14:52.829245
2022-10-18T19:53:49
2022-10-18T19:53:49
54,719,015
1
0
null
null
null
null
UTF-8
Java
false
false
931
java
package net.meerkat.identifier; import net.coljate.set.ImmutableSet; import net.coljate.set.Set; import net.meerkat.objects.Castable; import javax.annotation.Nonnull; import java.util.function.Consumer; /** * * @author ollie */ public abstract class IdSet<T extends Castable<T>> implements Ids<T> { private final ImmutableSet<? extends T> ids; protected IdSet(final Set<? extends T> ids) { this.ids = ids.immutableCopy(); } @Override public Set<? extends T> values() { return ids; } public boolean contains(final T id) { return ids.contains(id); } @Override public boolean isEmpty() { return ids.isEmpty(); } @Override public int count() { return ids.count(); } @Nonnull public void accept(final Consumer<? super T> consumer) { ids.forEach(consumer); } }
[ "ollie.robertshaw@gmail.com" ]
ollie.robertshaw@gmail.com
8c43f0814efbbd156a21fd42935b815b0ffbbabc
1323d04fe15795263379f1f91cb65745d4a3820f
/nitrite-android-example/src/main/java/org/dizitart/no2/example/android/UserAdapter.java
700e1be02e4c2d67631100a12a7e8a6d3772924e
[]
no_license
anidotnet/nitrite-java
211963ba9d88a5ddd2bc6eb929edafb2077fcec3
3aa84ca4e3ecd24f51b148e69b361c8e040fa571
refs/heads/master
2020-09-09T07:37:01.448266
2020-06-26T06:10:52
2020-06-26T06:10:52
221,388,811
1
1
null
null
null
null
UTF-8
Java
false
false
2,228
java
/* * Copyright (c) 2017-2020. Nitrite 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.dizitart.no2.example.android; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.List; /** * @author Anindya Chatterjee. */ public class UserAdapter extends BaseAdapter { LayoutInflater mInflator; Context mContext; private List<User> users; public UserAdapter(Context context) { mContext = context; mInflator = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public void setUsers(List<User> users) { this.users = users; } @Override public int getCount() { return users != null ? users.size() : 0; } @Override public User getItem(int i) { return users.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int position, View convertView, ViewGroup container) { Viewholder holder; final User t = getItem(position); if (convertView == null) { holder = new Viewholder(); convertView = mInflator.inflate(R.layout.row_user, container, false); holder.username = convertView.findViewById(R.id.username); convertView.setTag(holder); } else { holder = (Viewholder) convertView.getTag(); } holder.username.setText(t.getUsername()); return convertView; } private class Viewholder { TextView username; } }
[ "anidotnet@gmail.com" ]
anidotnet@gmail.com
c16beaebc444e04d9bf95430e0d6cafdfe45fbb3
3ca7c0bbf92635c21bdd17f39fbcf666ba6df69e
/src/main/java/net/minecraft/world/gen/FlatLayerInfo.java
b4bc06cc6bcb90c13638d4ca73550446deb4cc81
[]
no_license
Liquirh/UprizingClient
13c4a98b66f1debeb182111674b1470bb486dd22
e456be9f938bd645a0fccd951e437479f1ad7e6e
refs/heads/master
2020-03-21T23:21:09.106317
2018-06-29T17:27:32
2018-06-29T17:27:32
139,182,386
1
0
null
2018-06-29T18:23:22
2018-06-29T18:23:22
null
UTF-8
Java
false
false
1,858
java
package net.minecraft.world.gen; import net.minecraft.block.Block; public class FlatLayerInfo { private final Block field_151537_a; /** Amount of layers for this set of layers. */ private int layerCount; /** Block metadata used on this set of laeyrs. */ private int layerFillBlockMeta; private int layerMinimumY; private static final String __OBFID = "CL_00000441"; public FlatLayerInfo(int p_i45467_1_, Block p_i45467_2_) { this.layerCount = 1; this.layerCount = p_i45467_1_; this.field_151537_a = p_i45467_2_; } public FlatLayerInfo(int p_i45468_1_, Block p_i45468_2_, int p_i45468_3_) { this(p_i45468_1_, p_i45468_2_); this.layerFillBlockMeta = p_i45468_3_; } /** * Return the amount of layers for this set of layers. */ public int getLayerCount() { return this.layerCount; } public Block func_151536_b() { return this.field_151537_a; } /** * Return the block metadata used on this set of layers. */ public int getFillBlockMeta() { return this.layerFillBlockMeta; } /** * Return the minimum Y coordinate for this layer, set during generation. */ public int getMinY() { return this.layerMinimumY; } /** * Set the minimum Y coordinate for this layer. */ public void setMinY(int p_82660_1_) { this.layerMinimumY = p_82660_1_; } public String toString() { String var1 = Integer.toString(Block.getIdFromBlock(this.field_151537_a)); if (this.layerCount > 1) { var1 = this.layerCount + "x" + var1; } if (this.layerFillBlockMeta > 0) { var1 = var1 + ":" + this.layerFillBlockMeta; } return var1; } }
[ "stawlker@hotmail.com" ]
stawlker@hotmail.com
56c7d131740f15c4a4fbe2de68223b6ac808362d
de3e295b4430a4f49edbed938dcad22f445d2911
/RotateTabRuns/src/java/example/MainPanel.java
d4fc6efb679dcbe3381e72f8de216a640dcb73fc
[ "MIT" ]
permissive
kansasSamurai/java-swing-tips
5fd5e8dfada438e730ca4f440cc2c082b32cce56
649a738acf2a2560649ad8bd3634cb7042e1fa13
refs/heads/master
2022-11-17T14:44:13.562782
2022-10-30T15:05:02
2022-10-30T15:05:02
204,076,715
0
0
null
2019-08-23T22:15:06
2019-08-23T22:15:06
null
UTF-8
Java
false
false
5,329
java
// -*- mode:java; encoding:utf-8 -*- // vim:set fileencoding=utf-8: // @homepage@ package example; import com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI; import java.awt.*; import javax.swing.*; import javax.swing.plaf.metal.MetalTabbedPaneUI; public final class MainPanel extends JPanel { private MainPanel() { super(new GridLayout(2, 1, 5, 5)); UIManager.put("TabbedPane.tabRunOverlay", 0); UIManager.put("TabbedPane.selectedLabelShift", 0); UIManager.put("TabbedPane.labelShift", 0); // TabbedPane.selectedTabPadInsets : InsetsUIResource[top=2,left=2,bottom=2,right=1] UIManager.put("TabbedPane.selectedTabPadInsets", new Insets(0, 0, 0, 0)); JTabbedPane tabbedPane = new JTabbedPane() { @Override public void updateUI() { super.updateUI(); if (getUI() instanceof WindowsTabbedPaneUI) { setUI(new WindowsTabbedPaneUI() { @Override protected boolean shouldRotateTabRuns(int tabPlacement) { return false; } }); } else { setUI(new MetalTabbedPaneUI() { @Override protected boolean shouldRotateTabRuns(int tabPlacement) { return false; } // This method with two arguments is not used at all elsewhere and may be a bug. @Override protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun) { return false; } }); } } }; add(makeTabbedPane(new JTabbedPane())); add(makeTabbedPane(tabbedPane)); JMenuBar mb = new JMenuBar(); mb.add(LookAndFeelUtil.createLookAndFeelMenu()); EventQueue.invokeLater(() -> getRootPane().setJMenuBar(mb)); setPreferredSize(new Dimension(320, 240)); } private static JTabbedPane makeTabbedPane(JTabbedPane tabbedPane) { tabbedPane.addTab("111111111111111111111111", new ColorIcon(Color.RED), new JLabel()); tabbedPane.addTab("2", new ColorIcon(Color.GREEN), new JLabel()); tabbedPane.addTab("3333333333333333333333333333", new ColorIcon(Color.BLUE), new JLabel()); tabbedPane.addTab("444444444444", new ColorIcon(Color.ORANGE), new JLabel()); return tabbedPane; } public static void main(String[] args) { EventQueue.invokeLater(MainPanel::createAndShowGui); } private static void createAndShowGui() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); Toolkit.getDefaultToolkit().beep(); } JFrame frame = new JFrame("@title@"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.getContentPane().add(new MainPanel()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } } class ColorIcon implements Icon { private final Color color; protected ColorIcon(Color color) { this.color = color; } @Override public void paintIcon(Component c, Graphics g, int x, int y) { Graphics2D g2 = (Graphics2D) g.create(); g2.translate(x, y); g2.setPaint(color); g2.fillRect(0, 0, getIconWidth(), getIconHeight()); g2.dispose(); } @Override public int getIconWidth() { return 12; } @Override public int getIconHeight() { return 12; } } // @see https://java.net/projects/swingset3/sources/svn/content/trunk/SwingSet3/src/com/sun/swingset3/SwingSet3.java final class LookAndFeelUtil { private static String lookAndFeel = UIManager.getLookAndFeel().getClass().getName(); private LookAndFeelUtil() { /* Singleton */ } public static JMenu createLookAndFeelMenu() { JMenu menu = new JMenu("LookAndFeel"); ButtonGroup lafGroup = new ButtonGroup(); for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) { menu.add(createLookAndFeelItem(lafInfo.getName(), lafInfo.getClassName(), lafGroup)); } return menu; } private static JMenuItem createLookAndFeelItem(String laf, String lafClass, ButtonGroup bg) { JMenuItem lafItem = new JRadioButtonMenuItem(laf, lafClass.equals(lookAndFeel)); lafItem.setActionCommand(lafClass); lafItem.setHideActionText(true); lafItem.addActionListener(e -> { ButtonModel m = bg.getSelection(); try { setLookAndFeel(m.getActionCommand()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { UIManager.getLookAndFeel().provideErrorFeedback((Component) e.getSource()); } }); bg.add(lafItem); return lafItem; } private static void setLookAndFeel(String lookAndFeel) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { String oldLookAndFeel = LookAndFeelUtil.lookAndFeel; if (!oldLookAndFeel.equals(lookAndFeel)) { UIManager.setLookAndFeel(lookAndFeel); LookAndFeelUtil.lookAndFeel = lookAndFeel; updateLookAndFeel(); // firePropertyChange("lookAndFeel", oldLookAndFeel, lookAndFeel); } } private static void updateLookAndFeel() { for (Window window : Window.getWindows()) { SwingUtilities.updateComponentTreeUI(window); } } }
[ "aterai@outlook.com" ]
aterai@outlook.com
0075eb1124e2f1c22f3051e629861103fcae088f
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.4.0/transports/email/src/main/java/org/mule/providers/email/SmtpConnector.java
2436356e36026f06f237885a4aaad30541a57d5b
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
4,452
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the MuleSource MPL * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.providers.email; import org.mule.umo.UMOComponent; import org.mule.umo.endpoint.UMOEndpoint; import org.mule.umo.provider.UMOMessageReceiver; import java.util.Properties; /** * <code>SmtpConnector</code> is used to connect to and send data to an SMTP mail * server */ public class SmtpConnector extends AbstractMailConnector { public static final String DEFAULT_SMTP_HOST = "localhost"; public static final int DEFAULT_SMTP_PORT = 25; public static final String DEFAULT_CONTENT_TYPE = "text/plain"; private String host = DEFAULT_SMTP_HOST; private int port = DEFAULT_SMTP_PORT; private String username; private String password; /** * Holds value of bcc addresses. */ private String bcc; /** * Holds value of cc addresses. */ private String cc; /** * Holds value of replyTo addresses. */ private String replyTo; /** * Holds value of default subject */ private String defaultSubject = "[No Subject]"; /** * Holds value of the from address. */ private String from; /** * Any custom headers to be set on messages sent using this connector */ private Properties customHeaders = new Properties(); private String contentType = DEFAULT_CONTENT_TYPE; public SmtpConnector() { this(DEFAULT_SMTP_PORT); } SmtpConnector(int defaultPort) { super(defaultPort, null); } public String getProtocol() { return "smtp"; } /* * (non-Javadoc) * * @see org.mule.providers.UMOConnector#registerListener(javax.jms.MessageListener, * java.lang.String) */ public UMOMessageReceiver createReceiver(UMOComponent component, UMOEndpoint endpoint) throws Exception { throw new UnsupportedOperationException("Listeners cannot be registered on a SMTP endpoint"); } /** * @return The default from address to use */ public String getFromAddress() { return from; } /** * @return the default comma separated list of BCC addresses to use */ public String getBccAddresses() { return bcc; } /** * @return the default comma separated list of CC addresses to use */ public String getCcAddresses() { return cc; } /** * @return the default message subject to use */ public String getSubject() { return defaultSubject; } public void setBccAddresses(String string) { bcc = string; } public void setCcAddresses(String string) { cc = string; } public void setSubject(String string) { defaultSubject = string; } public void setFromAddress(String string) { from = string; } public String getReplyToAddresses() { return replyTo; } public void setReplyToAddresses(String replyTo) { this.replyTo = replyTo; } public Properties getCustomHeaders() { return customHeaders; } public void setCustomHeaders(Properties customHeaders) { this.customHeaders = customHeaders; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public int getDefaultPort() { return DEFAULT_SMTP_PORT; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public int getPort() { return port; } public void setPort(int port) { this.port = port; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } }
[ "dirk.olmes@bf997673-6b11-0410-b953-e057580c5b09" ]
dirk.olmes@bf997673-6b11-0410-b953-e057580c5b09
b6ce72c1e5b46e072c5b2f45196566e35b7cdd63
57edb737df8e9de3822d4f08d0de81f028403209
/spring-core/src/main/java/org/springframework/core/type/StandardAnnotationMetadata.java
4ba7b40b681b67f990037573e0f2d045b8e51417
[ "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
6,674
java
/* * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.core.type; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.util.Collections; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.annotation.MergedAnnotation; import org.springframework.core.annotation.MergedAnnotations; import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; import org.springframework.core.annotation.RepeatableContainers; import org.springframework.lang.Nullable; import org.springframework.util.MultiValueMap; import org.springframework.util.ReflectionUtils; /** * {@link AnnotationMetadata} implementation that uses standard reflection * to introspect a given {@link Class}. * * @author Juergen Hoeller * @author Mark Fisher * @author Chris Beams * @author Phillip Webb * @author Sam Brannen * @since 2.5 */ public class StandardAnnotationMetadata extends StandardClassMetadata implements AnnotationMetadata { private final MergedAnnotations mergedAnnotations; private final boolean nestedAnnotationsAsMap; @Nullable private Set<String> annotationTypes; /** * Create a new {@code StandardAnnotationMetadata} wrapper for the given Class. * * @param introspectedClass the Class to introspect * @see #StandardAnnotationMetadata(Class, boolean) * @deprecated since 5.2 in favor of the factory method {@link AnnotationMetadata#introspect(Class)} */ @Deprecated public StandardAnnotationMetadata(Class<?> introspectedClass) { this(introspectedClass, false); } /** * Create a new {@link StandardAnnotationMetadata} wrapper for the given Class, * providing the option to return any nested annotations or annotation arrays in the * form of {@link org.springframework.core.annotation.AnnotationAttributes} instead * of actual {@link Annotation} instances. * * @param introspectedClass the Class to introspect * @param nestedAnnotationsAsMap return nested annotations and annotation arrays as * {@link org.springframework.core.annotation.AnnotationAttributes} for compatibility * with ASM-based {@link AnnotationMetadata} implementations * @since 3.1.1 * @deprecated since 5.2 in favor of the factory method {@link AnnotationMetadata#introspect(Class)}. * Use {@link MergedAnnotation#asMap(org.springframework.core.annotation.MergedAnnotation.Adapt...) MergedAnnotation.asMap} * from {@link #getAnnotations()} rather than {@link #getAnnotationAttributes(String)} * if {@code nestedAnnotationsAsMap} is {@code false} */ @Deprecated public StandardAnnotationMetadata(Class<?> introspectedClass, boolean nestedAnnotationsAsMap) { super(introspectedClass); this.mergedAnnotations = MergedAnnotations.from(introspectedClass, SearchStrategy.INHERITED_ANNOTATIONS, RepeatableContainers.none()); this.nestedAnnotationsAsMap = nestedAnnotationsAsMap; } @Override public MergedAnnotations getAnnotations() { return this.mergedAnnotations; } @Override public Set<String> getAnnotationTypes() { Set<String> annotationTypes = this.annotationTypes; if (annotationTypes == null) { annotationTypes = Collections.unmodifiableSet(AnnotationMetadata.super.getAnnotationTypes()); this.annotationTypes = annotationTypes; } return annotationTypes; } @Override @Nullable public Map<String, Object> getAnnotationAttributes(String annotationName, boolean classValuesAsString) { if (this.nestedAnnotationsAsMap) { return AnnotationMetadata.super.getAnnotationAttributes(annotationName, classValuesAsString); } return AnnotatedElementUtils.getMergedAnnotationAttributes( getIntrospectedClass(), annotationName, classValuesAsString, false); } @Override @Nullable public MultiValueMap<String, Object> getAllAnnotationAttributes(String annotationName, boolean classValuesAsString) { if (this.nestedAnnotationsAsMap) { return AnnotationMetadata.super.getAllAnnotationAttributes(annotationName, classValuesAsString); } return AnnotatedElementUtils.getAllAnnotationAttributes( getIntrospectedClass(), annotationName, classValuesAsString, false); } @Override public boolean hasAnnotatedMethods(String annotationName) { if (AnnotationUtils.isCandidateClass(getIntrospectedClass(), annotationName)) { try { Method[] methods = ReflectionUtils.getDeclaredMethods(getIntrospectedClass()); for (Method method : methods) { if (isAnnotatedMethod(method, annotationName)) { return true; } } } catch (Throwable ex) { throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex); } } return false; } @Override @SuppressWarnings("deprecation") public Set<MethodMetadata> getAnnotatedMethods(String annotationName) { Set<MethodMetadata> annotatedMethods = null; if (AnnotationUtils.isCandidateClass(getIntrospectedClass(), annotationName)) { try { Method[] methods = ReflectionUtils.getDeclaredMethods(getIntrospectedClass()); for (Method method : methods) { if (isAnnotatedMethod(method, annotationName)) { if (annotatedMethods == null) { annotatedMethods = new LinkedHashSet<>(4); } annotatedMethods.add(new StandardMethodMetadata(method, this.nestedAnnotationsAsMap)); } } } catch (Throwable ex) { throw new IllegalStateException("Failed to introspect annotated methods on " + getIntrospectedClass(), ex); } } return annotatedMethods != null ? annotatedMethods : Collections.emptySet(); } private boolean isAnnotatedMethod(Method method, String annotationName) { return !method.isBridge() && method.getAnnotations().length > 0 && AnnotatedElementUtils.isAnnotated(method, annotationName); } static AnnotationMetadata from(Class<?> introspectedClass) { return new StandardAnnotationMetadata(introspectedClass, true); } }
[ "1490493387@qq.com" ]
1490493387@qq.com
a337e0ae67971bea5f8eabd4e4a1a34f87059920
192ec7880ba7d82d8161f2de1f0d8adcf50874e0
/modeshape-boot/modeshape-jcr-boot/src/main/java/org/modeshape/web/jcr/WebLogger.java
af81699625f639b6e110be0ec7eb712c651c03f4
[]
no_license
FrankLi999/wcm-bpm
932a3f41f9716897bcbf1fd654910276133b109b
7b9bea30798701c99bd2096e2011cb7a7a35924a
refs/heads/master
2023-07-27T19:28:36.410402
2021-03-29T02:49:50
2021-03-29T02:49:50
136,976,607
2
1
null
2023-07-17T00:26:38
2018-06-11T20:19:08
JavaScript
UTF-8
Java
false
false
4,001
java
/* * ModeShape (http://www.modeshape.org) * * 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.modeshape.web.jcr; import org.modeshape.common.i18n.TextI18n; import org.modeshape.common.logging.Logger; /** * Implementation of the {@link org.modeshape.jcr.api.Logger} interface which delegates the logging operations to an I18n based * {@link org.modeshape.common.logging.Logger} implementation, using pass-through {@link TextI18n} objects. * * This should be used in ModeShape's server-side web modules. */ public final class WebLogger implements org.modeshape.jcr.api.Logger { private final Logger logger; private WebLogger( Logger logger ) { this.logger = logger; } public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) { return new WebLogger(Logger.getLogger(clazz)); } @Override public void debug( String message, Object... params ) { logger.debug(message, params); } @Override public void debug( Throwable t, String message, Object... params ) { logger.debug(t, message, params); } @Override public void error( String message, Object... params ) { if (logger.isErrorEnabled()) { logger.error(new TextI18n(message), params); } } @Override public void error( Throwable t, String message, Object... params ) { if (logger.isErrorEnabled()) { logger.error(t, new TextI18n(message), params); } } @Override public void info( String message, Object... params ) { if (logger.isInfoEnabled()) { logger.info(new TextI18n(message), params); } } @Override public void info( Throwable t, String message, Object... params ) { if (logger.isInfoEnabled()) { logger.info(t, new TextI18n(message), params); } } @Override public void trace( String message, Object... params ) { logger.trace(message, params); } @Override public void trace( Throwable t, String message, Object... params ) { logger.trace(t, message, params); } @Override public void warn( String message, Object... params ) { if (logger.isWarnEnabled()) { logger.warn(new TextI18n(message), params); } } @Override public void warn( Throwable t, String message, Object... params ) { if (logger.isWarnEnabled()) { logger.warn(t, new TextI18n(message), params); } } @Override public boolean isInfoEnabled() { return logger.isInfoEnabled(); } @Override public boolean isWarnEnabled() { return logger.isWarnEnabled(); } @Override public boolean isErrorEnabled() { return logger.isErrorEnabled(); } @Override public boolean isDebugEnabled() { return logger.isDebugEnabled(); } @Override public boolean isTraceEnabled() { return logger.isTraceEnabled(); } }
[ "frank.x.li@gmail.com" ]
frank.x.li@gmail.com
7421a26af41ed91538fd39e85e87744867a5ffb0
88d8fab5a8644fda6134ff23cc6d30211bfcca27
/src/main/java/org/erp/distribution/kontrolstok/lapsaldostok/LapSaldoStockView.java
c0b6d26811f8ae05c849cd5186f0077c7d607156
[]
no_license
bagus-stimata/erp-distribution
c08396c0adc3b1ce3b8045fca9d77dff44b8e96a
45861792a724d02597b78ca5cbf53bd1fbd06174
refs/heads/master
2021-01-21T12:11:43.744257
2016-04-08T07:29:20
2016-04-08T07:29:20
32,978,292
0
0
null
null
null
null
UTF-8
Java
false
false
5,099
java
package org.erp.distribution.kontrolstok.lapsaldostok; import com.vaadin.shared.ui.combobox.FilteringMode; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.ComboBox; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; public class LapSaldoStockView extends CustomComponent{ private LapSaldoStockModel model; private VerticalLayout content = new VerticalLayout(); private ComboBox comboGroup1= new ComboBox("WAREHOUSE/GUDANG"); private ComboBox comboGroup2= new ComboBox("GRUP BARANG"); private CheckBox checkBox1 = new CheckBox("HANYA YANG ADA STOK"); private CheckBox checkBox2 = new CheckBox(); private CheckBox checkBox4 = new CheckBox("Validasi/Rekalkulasi Saldo Stok"); private DateField dateField1From = new DateField("TANGGAL STOK"); private DateField dateField1To = new DateField("TANGGAL STOK"); private Button btnPreview = new Button("Preview"); private Button btnClose = new Button("Close"); private Panel panelUtama = new Panel(); private Panel panelTop = new Panel(); private Panel panelBottom = new Panel(); public LapSaldoStockView(LapSaldoStockModel model){ this.model = model; initComponent(); buildView(); setDisplay(); } public void initComponent(){ comboGroup1.setWidth("300px"); comboGroup2.setWidth("300px"); dateField1From.setDateFormat("dd/MM/yyyy"); dateField1To.setDateFormat("dd/MM/yyyy"); } public void buildView(){ //Inisialisasi Panel setSizeFull(); content.setSizeFull(); content.setMargin(true); panelTop.setSizeFull(); panelBottom.setSizeFull(); VerticalLayout layoutTop = new VerticalLayout(); layoutTop.setMargin(true); HorizontalLayout layoutBottom = new HorizontalLayout(); layoutBottom.setMargin(true); layoutTop.addComponent(comboGroup1); layoutTop.addComponent(comboGroup2); layoutTop.addComponent(dateField1From); // layoutTop.addComponent(dateField1To); layoutTop.addComponent(checkBox1); // layoutTop.addComponent(checkBox2); layoutTop.addComponent(checkBox4); layoutBottom.addComponent(btnPreview); layoutBottom.addComponent(btnClose); panelTop.setContent(layoutTop); content.addComponent(panelTop); content.addComponent(layoutBottom); setCompositionRoot(content); } public void setDisplay(){ comboGroup1.setContainerDataSource(model.getBeanItemContainerWarehouse()); comboGroup1.setNewItemsAllowed(false); comboGroup1.setFilteringMode(FilteringMode.CONTAINS); comboGroup1.setNullSelectionAllowed(true); comboGroup2.setContainerDataSource(model.getBeanItemContainerProductgroup()); comboGroup2.setNewItemsAllowed(false); comboGroup2.setFilteringMode(FilteringMode.CONTAINS); comboGroup2.setNullSelectionAllowed(true); dateField1From.setValue(model.getTransaksiHelper().getCurrentTransDate()); dateField1To.setValue(model.getTransaksiHelper().getCurrentTransDate()); checkBox4.setValue(true); } public LapSaldoStockModel getModel() { return model; } public VerticalLayout getContent() { return content; } public ComboBox getComboGroup1() { return comboGroup1; } public ComboBox getComboGroup2() { return comboGroup2; } public DateField getDateField1From() { return dateField1From; } public DateField getDateField1To() { return dateField1To; } public Button getBtnPreview() { return btnPreview; } public Button getBtnClose() { return btnClose; } public Panel getPanelUtama() { return panelUtama; } public Panel getPanelTop() { return panelTop; } public Panel getPanelBottom() { return panelBottom; } public void setModel(LapSaldoStockModel model) { this.model = model; } public void setContent(VerticalLayout content) { this.content = content; } public void setComboGroup1(ComboBox comboGroup1) { this.comboGroup1 = comboGroup1; } public void setComboGroup2(ComboBox comboGroup2) { this.comboGroup2 = comboGroup2; } public void setDateField1From(DateField dateField1From) { this.dateField1From = dateField1From; } public void setDateField1To(DateField dateField1To) { this.dateField1To = dateField1To; } public void setBtnPreview(Button btnPreview) { this.btnPreview = btnPreview; } public void setBtnClose(Button btnClose) { this.btnClose = btnClose; } public void setPanelUtama(Panel panelUtama) { this.panelUtama = panelUtama; } public void setPanelTop(Panel panelTop) { this.panelTop = panelTop; } public void setPanelBottom(Panel panelBottom) { this.panelBottom = panelBottom; } public CheckBox getCheckBox1() { return checkBox1; } public CheckBox getCheckBox2() { return checkBox2; } public void setCheckBox1(CheckBox checkBox1) { this.checkBox1 = checkBox1; } public void setCheckBox2(CheckBox checkBox2) { this.checkBox2 = checkBox2; } public CheckBox getCheckBox4() { return checkBox4; } public void setCheckBox4(CheckBox checkBox4) { this.checkBox4 = checkBox4; } }
[ "bagus.stimata@gmail.com" ]
bagus.stimata@gmail.com
4248c80c673a993aee580ea7ddb111a55e8c7ebf
0ef73cce4e325d636a260b895622084e70aefe65
/protocollibrary/src/main/java/com/ubtechinc/protocollibrary/communite/ITimeoutEngine.java
0983e98ee488b2c7f85742f06be36e41f929764d
[]
no_license
iPsych/androidMin
3d7771c59fbc66171b12f7d3cbe8ba8a1af6c746
00c3a70d2dc6ea8144118fc9666b87b288e96be4
refs/heads/master
2023-03-18T06:22:16.246557
2018-07-18T07:07:14
2018-07-18T07:07:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,827
java
package com.ubtechinc.protocollibrary.communite; import android.util.Log; import java.util.HashMap; import java.util.List; import java.util.Map; /** * IM 超时 管理类 * Created by ubt on 2017/12/2. */ public abstract class ITimeoutEngine { private static final String TAG = "ITimeoutEngine"; Map<Integer, RobotPhoneCommuniteProxy.Callback> callbackMap = new HashMap<>(); List<Integer> whileList; public void setTimeout(short cmId, int requestId, RobotPhoneCommuniteProxy.Callback dataCallback) { if (isInWhileList(cmId)) { Log.d(TAG,"setTimeout cmdId = %d requestId= %d in while list" + cmId + requestId); } else { Log.d(TAG,"setTimeout cmdId = %d requestId= %d "+ cmId+ requestId); callbackMap.put(requestId, dataCallback); onSetTimeout( cmId, requestId); } } public abstract void onSetTimeout( short cmId, int requestId); public void cancelTimeout(Long requestId) { Log.d(TAG,"cancelTimeout requestId= %d "+ requestId); onCancelTimeout(requestId); callbackMap.remove(requestId); } public abstract void onCancelTimeout(Long requestId); public void onTimeout(int requestId) { Log.d(TAG,"onTimeout requestId= %d "+ requestId); RobotPhoneCommuniteProxy.Callback callback = callbackMap.get(requestId); if (callback != null) { callback.onSendError(requestId, IMErrorUtil.ERROR.TIMEOUT_ERROR); } } public void release() { callbackMap.clear(); } private boolean isInWhileList(short cmdId) { if (whileList != null) { return whileList.contains(cmdId); } return false; } public void setWhileList(List<Integer> whileList) { this.whileList = whileList; } }
[ "jason@comicool.cn" ]
jason@comicool.cn
8abe619df705c89d923f1238ac77393657162b60
e13d5ce096f651b5fce9db1f15319c503b181ae8
/app/src/main/java/github/hotstu/tinyritrodemo/aop/DenyHandler.java
bd28aac91765c98752dae3f1812431a827fed718
[ "Apache-2.0" ]
permissive
lvxiaohai/tinyritro
3cc252cc76647ac551a513699a92feec59d944d2
8a1f8a57c8d3130f61bfffd4e046ed7166bfca28
refs/heads/master
2022-04-14T17:27:27.437605
2020-04-13T02:58:00
2020-04-13T02:58:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
179
java
package github.hotstu.tinyritrodemo.aop; /** * @author hglf * @since 2018/6/4 */ public interface DenyHandler { void onDenied(Object ac, Object permisson, String Tag); }
[ "hgleifeng@foxmail.com" ]
hgleifeng@foxmail.com
4ba4a40df0c22a3a44926f618ae4fa0ebbf1ca3a
24a3905149c370a107e08d6896b79d6d73d2593d
/branch/http_gateway/src/app/org/i4change/app/data/domain/daos/OrganisationsDiscountDaoImpl.java
94076453d0aa1851bc7720560ec23052845223b3
[]
no_license
lucyclevelromeeler/ezmodeler-svn-to-git
2060dfb81b1441d3946ac8b7332675d3755cc208
030ccbaf4f22d28b2f3c34b52500b00e53bfe08e
refs/heads/master
2023-03-18T06:39:16.243918
2015-12-28T14:38:20
2015-12-28T14:38:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
package org.i4change.app.data.domain.daos; import java.util.Date; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import org.i4change.app.hibernate.beans.user.Discount; import org.i4change.app.hibernate.utils.HibernateUtil; public class OrganisationsDiscountDaoImpl { private static final Log log = LogFactory.getLog(OrganisationsDiscountDaoImpl.class); private static OrganisationsDiscountDaoImpl instance = null; public static synchronized OrganisationsDiscountDaoImpl getInstance() { if (instance == null) { instance = new OrganisationsDiscountDaoImpl(); } return instance; } /** * @deprecated * @param organisation_id * @param numberOfUsers * @param discount * @return */ public Long addOrganisationsDiscount(long organisation_id, int numberOfUsers, double discount) { try { Discount orgDiscount = new Discount(); orgDiscount.setDiscount(discount); orgDiscount.setNumberOfUsers(numberOfUsers); orgDiscount.setOrganisation(OrganisationDaoImpl.getInstance().getOrganisationById(organisation_id)); orgDiscount.setInserted(new Date()); orgDiscount.setDeleted("false"); Object idf = HibernateUtil.createSession(); Session session = HibernateUtil.getSession(); Transaction tx = session.beginTransaction(); long id = (Long) session.save(orgDiscount); tx.commit(); HibernateUtil.closeSession(idf); return id; } catch (HibernateException ex) { log.error("[addOrganisationsDiscount]" ,ex); } catch (Exception ex2) { log.error("[addOrganisationsDiscount]" ,ex2); } return null; } public List<Discount> getOrganisationsDiscountsByOrg(Long organisation_id) { try { String hql = "select c from OrganisationsDiscount as c " + "where c.organisation.organisation_id = :organisation_id " + "AND deleted != :deleted"; Object idf = HibernateUtil.createSession(); Session session = HibernateUtil.getSession(); Transaction tx = session.beginTransaction(); Query query = session.createQuery(hql); query.setLong("organisation_id", organisation_id); query.setString("deleted", "true"); List<Discount> orgList = query.list(); tx.commit(); HibernateUtil.closeSession(idf); return orgList; } catch (HibernateException ex) { log.error("[getOrganisationsDiscountByOrg]", ex); } catch (Exception ex2) { log.error("[getOrganisationsDiscountByOrg]", ex2); } return null; } public void deleteOrganisationsDiscount (Discount orgDiscount) { try { orgDiscount.setDeleted("true"); Object idf = HibernateUtil.createSession(); Session session = HibernateUtil.getSession(); Transaction tx = session.beginTransaction(); session.update(orgDiscount); tx.commit(); HibernateUtil.closeSession(idf); } catch (HibernateException ex) { log.error("[deleteOrganisationsDiscount]" ,ex); } catch (Exception ex2) { log.error("[deleteOrganisationsDiscount]" ,ex2); } } }
[ "you@example.com" ]
you@example.com
739b8530cb0f32348da70289d71e4bbac6adf495
cbc61ffb33570a1bc55bb1e754510192b0366de2
/ole-app/olefs/src/main/java/org/kuali/ole/module/purap/batch/ExtractPdpImmediatesStep.java
d1874eea563933efcc0bd792964a2df611073154
[ "ECL-2.0" ]
permissive
VU-libtech/OLE-INST
42b3656d145a50deeb22f496f6f430f1d55283cb
9f5efae4dfaf810fa671c6ac6670a6051303b43d
refs/heads/master
2021-07-08T11:01:19.692655
2015-05-15T14:40:50
2015-05-15T14:40:50
24,459,494
1
0
ECL-2.0
2021-04-26T17:01:11
2014-09-25T13:40:33
Java
UTF-8
Java
false
false
2,277
java
/* * Copyright 2007 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.ole.module.purap.batch; import org.kuali.ole.module.purap.service.PdpExtractService; import org.kuali.ole.sys.batch.AbstractStep; import org.kuali.rice.core.api.datetime.DateTimeService; import org.springframework.transaction.annotation.Transactional; import java.util.Date; @Transactional public class ExtractPdpImmediatesStep extends AbstractStep { private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ExtractPdpImmediatesStep.class); private PdpExtractService pdpExtractService; private DateTimeService dateTimeService; public ExtractPdpImmediatesStep() { super(); } /** * @see org.kuali.ole.sys.batch.Step#execute(java.lang.String, java.util.Date) */ @Override public boolean execute(String jobName, Date jobRunDate) throws InterruptedException { LOG.debug("execute() started"); pdpExtractService.extractImmediatePaymentsOnly(); return true; } public boolean execute() throws InterruptedException { try { return execute(null, dateTimeService.getCurrentDate()); } catch (InterruptedException e) { LOG.error("Exception occured executing step", e); throw e; } catch (RuntimeException e) { LOG.error("Exception occured executing step", e); throw e; } } public void setPdpExtractService(PdpExtractService pdpExtractService) { this.pdpExtractService = pdpExtractService; } @Override public void setDateTimeService(DateTimeService dateTimeService) { this.dateTimeService = dateTimeService; } }
[ "david.lacy@villanova.edu" ]
david.lacy@villanova.edu
f76ee26cf43beff571aea8f929527e2081429875
4aa90348abcb2119011728dc067afd501f275374
/app/src/main/java/com/tencent/mm/plugin/appbrand/canvas/a/q.java
286e4bbab614db6551994d7e76cc573f5ea77c58
[]
no_license
jambestwick/HackWechat
0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6
6a34899c8bfd50d19e5a5ec36a58218598172a6b
refs/heads/master
2022-01-27T12:48:43.446804
2021-12-29T10:36:30
2021-12-29T10:36:30
249,366,791
0
0
null
2020-03-23T07:48:32
2020-03-23T07:48:32
null
UTF-8
Java
false
false
7,617
java
package com.tencent.mm.plugin.appbrand.canvas.a; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.LinearGradient; import android.graphics.RadialGradient; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Shader; import android.graphics.Shader.TileMode; import com.tencent.mm.plugin.appbrand.canvas.b.a; import com.tencent.mm.plugin.appbrand.canvas.f; import com.tencent.mm.sdk.platformtools.bh; import com.tencent.mm.sdk.platformtools.x; import org.json.JSONArray; public final class q implements d { public final String getMethod() { return "setFillStyle"; } public final boolean a(f fVar, Canvas canvas, JSONArray jSONArray) { if (jSONArray.length() < 2) { return false; } String optString = jSONArray.optString(0); a aVar = fVar.iKP; JSONArray optJSONArray; float d; float d2; float d3; JSONArray optJSONArray2; int i; if ("linear".equalsIgnoreCase(optString)) { if (jSONArray.length() < 3) { return false; } optJSONArray = jSONArray.optJSONArray(1); if (optJSONArray == null || optJSONArray.length() < 4) { return false; } d = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 0); d2 = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 1); d3 = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 2); float d4 = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 3); optJSONArray2 = jSONArray.optJSONArray(2); if (optJSONArray2 == null || optJSONArray2.length() == 0) { return false; } int[] iArr = new int[optJSONArray2.length()]; float[] fArr = new float[optJSONArray2.length()]; for (i = 0; i < optJSONArray2.length(); i++) { JSONArray optJSONArray3 = optJSONArray2.optJSONArray(i); if (optJSONArray3.length() >= 2) { fArr[i] = (float) optJSONArray3.optDouble(0); iArr[i] = com.tencent.mm.plugin.appbrand.p.f.i(optJSONArray3.optJSONArray(1)); } } aVar.setShader(new LinearGradient(d, d2, d3, d4, iArr, fArr, TileMode.CLAMP)); } else if ("radial".equalsIgnoreCase(optString)) { if (jSONArray.length() < 3) { return false; } optJSONArray = jSONArray.optJSONArray(1); if (optJSONArray == null || optJSONArray.length() < 3) { return false; } d = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 0); d2 = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 1); d3 = com.tencent.mm.plugin.appbrand.p.f.d(optJSONArray, 2); if (d3 <= 0.0f) { x.i("MicroMsg.Canvas.SetFillStyleAction", "setFillStyle(radial) failed, sr(%s) <= 0.", new Object[]{Float.valueOf(d3)}); return false; } JSONArray optJSONArray4 = jSONArray.optJSONArray(2); int[] iArr2 = new int[optJSONArray4.length()]; float[] fArr2 = new float[optJSONArray4.length()]; for (i = 0; i < optJSONArray4.length(); i++) { optJSONArray2 = optJSONArray4.optJSONArray(i); if (optJSONArray2.length() >= 2) { fArr2[i] = (float) optJSONArray2.optDouble(0); iArr2[i] = com.tencent.mm.plugin.appbrand.p.f.i(optJSONArray2.optJSONArray(1)); } } aVar.setShader(new RadialGradient(d, d2, d3, iArr2, fArr2, TileMode.CLAMP)); } else if ("normal".equalsIgnoreCase(optString)) { optJSONArray = jSONArray.optJSONArray(1); if (optJSONArray == null || optJSONArray.length() < 4) { return false; } aVar.setShader(null); aVar.setColor(com.tencent.mm.plugin.appbrand.p.f.i(optJSONArray)); } else if ("pattern".equalsIgnoreCase(optString)) { optString = jSONArray.optString(1); String optString2 = jSONArray.optString(2); if (bh.ov(optString)) { x.w("MicroMsg.Canvas.SetFillStyleAction", "setFillStyle failed, type is pattern but image path is null or nil."); return false; } Bitmap aQ = fVar.iKU.aQ(fVar.gOP, optString); if (!(aQ == null || aQ.isRecycled())) { Shader bitmapShader; int lI = com.tencent.mm.plugin.appbrand.p.f.lI(aQ.getWidth()); int lI2 = com.tencent.mm.plugin.appbrand.p.f.lI(aQ.getHeight()); Object obj = -1; switch (optString2.hashCode()) { case -934531685: if (optString2.equals("repeat")) { obj = null; break; } break; case -724648153: if (optString2.equals("no-repeat")) { obj = 3; break; } break; case -436782906: if (optString2.equals("repeat-x")) { obj = 1; break; } break; case -436782905: if (optString2.equals("repeat-y")) { obj = 2; break; } break; } Bitmap createBitmap; switch (obj) { case null: bitmapShader = new BitmapShader(Bitmap.createScaledBitmap(aQ, lI, lI2, false), TileMode.REPEAT, TileMode.REPEAT); break; case 1: createBitmap = Bitmap.createBitmap(lI, lI2 + 1, Config.ARGB_8888); new Canvas(createBitmap).drawBitmap(aQ, new Rect(0, 0, aQ.getWidth(), aQ.getHeight()), new RectF(0.0f, 0.0f, (float) lI, (float) lI2), null); bitmapShader = new BitmapShader(createBitmap, TileMode.REPEAT, TileMode.CLAMP); break; case 2: createBitmap = Bitmap.createBitmap(lI + 1, lI2, Config.ARGB_8888); new Canvas(createBitmap).drawBitmap(aQ, new Rect(0, 0, aQ.getWidth(), aQ.getHeight()), new RectF(0.0f, 0.0f, (float) lI, (float) lI2), null); bitmapShader = new BitmapShader(createBitmap, TileMode.CLAMP, TileMode.REPEAT); break; case 3: createBitmap = Bitmap.createBitmap(lI + 1, lI2 + 1, Config.ARGB_8888); new Canvas(createBitmap).drawBitmap(aQ, new Rect(0, 0, aQ.getWidth(), aQ.getHeight()), new RectF(0.0f, 0.0f, (float) lI, (float) lI2), null); bitmapShader = new BitmapShader(createBitmap, TileMode.CLAMP, TileMode.CLAMP); break; default: bitmapShader = null; break; } aVar.setShader(bitmapShader); } } return true; } }
[ "malin.myemail@163.com" ]
malin.myemail@163.com
74d7a7f90402dbdd7fa9dfe67af5ba2697db559c
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-58b-4-19-PESA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/optimization/direct/BaseAbstractVectorialOptimizer_ESTest.java
563e91b5f0a34324bfe8b41457f394077ad56d27
[]
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
610
java
/* * This file was automatically generated by EvoSuite * Fri Apr 03 08:11:15 UTC 2020 */ package org.apache.commons.math.optimization.direct; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class BaseAbstractVectorialOptimizer_ESTest extends BaseAbstractVectorialOptimizer_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
5d21e6b5399e2f19ced169616cd6b2efba4dd683
47e24981971894ec9d0a915dad70ec5b87c41ad9
/Hibernate开发框架/HibernateComponentProject/src/cn/ustb/pojo/MemberBasic.java
9e4a5fbd0c31487a70d6a41548682c29ec51f547
[]
no_license
MouseZhang/Java-Development-Framework
731dd0ee0d9e27a799dbb9775490c1bd41e4839c
e21e98e5ac3011aab694bef3191949af1e5e7b5d
refs/heads/master
2020-12-26T15:48:42.944474
2020-03-29T06:57:15
2020-03-29T06:57:15
237,552,753
2
0
null
null
null
null
UTF-8
Java
false
false
685
java
package cn.ustb.pojo; import java.util.Date; @SuppressWarnings("serial") public class MemberBasic implements java.io.Serializable { private String name; private Integer age; private Date birthday; public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Integer getAge() { return this.age; } public void setAge(Integer age) { this.age = age; } public Date getBirthday() { return this.birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } @Override public String toString() { return "MemberBasic [name=" + name + ", age=" + age + ", birthday=" + birthday + "]"; } }
[ "athope@163.com" ]
athope@163.com
3eb776453b632882898e539e34ecf269fe80a1c2
597b0daa76ba28adf45359b5aa09cef5886f0e29
/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/ArgumentAware.java
988b939d52314d3407d6127e9943d5651798ccd6
[ "Apache-2.0" ]
permissive
wjmwss-zz/spring
78e579e3ec4abc983aa80a4547fadc2b654ea959
e94eb5efb79fc4bc5336d0b571609c141d35d5cb
refs/heads/master
2023-02-21T09:26:25.768420
2021-01-23T19:04:30
2021-01-23T19:04:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.servlet.tags; import org.springframework.lang.Nullable; import javax.servlet.jsp.JspTagException; /** * Allows implementing tag to utilize nested {@code spring:argument} tags. * * @author Nicholas Williams * @since 4.0 * @see ArgumentTag */ public interface ArgumentAware { /** * Callback hook for nested spring:argument tags to pass their value * to the parent tag. * @param argument the result of the nested {@code spring:argument} tag */ void addArgument(@Nullable Object argument) throws JspTagException; }
[ "wjmcoo@outlook.com" ]
wjmcoo@outlook.com
60ce287cd25a47a5acb50fe911e7299e52498966
e0e854029229bf1ca82d475e05bea995af37ccbb
/pax-web-itest/pax-web-itest-container/pax-web-itest-container-common/src/main/java/org/ops4j/pax/web/itest/container/war/jsf/AbstractWarJSFEmbeddedIntegrationTest.java
b71b4ce89b8d709aac64baad6af8402205eff5fd
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
fykidwai/org.ops4j.pax.web
8c07ffa81b2e57933557a1f71078ec983c8efab5
338246dd859cc8a078e2063182bfbcbf92d95520
refs/heads/main
2023-06-22T00:22:16.401474
2021-07-21T14:25:01
2021-07-21T14:25:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,807
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 org.ops4j.pax.web.itest.container.war.jsf; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Before; import org.junit.Test; import org.ops4j.pax.web.itest.container.AbstractContainerTestBase; import org.ops4j.pax.web.itest.utils.client.CookieState; import org.ops4j.pax.web.itest.utils.client.HttpTestClientFactory; import org.osgi.framework.Bundle; import static org.junit.Assert.fail; /** * @author Achim Nierbeck */ public abstract class AbstractWarJSFEmbeddedIntegrationTest extends AbstractContainerTestBase { private Bundle wab; @Before public void setUp() throws Exception { wab = configureAndWaitForDeploymentUnlessInstalled("war-jsf23-embedded", () -> { installAndStartBundle(sampleWarURI("war-jsf23-embedded")); }); } @Test public void testSlash() throws Exception { HttpTestClientFactory.createDefaultTestClient() .withResponseAssertion("Response must contain 'Hello from JSF 2.3 example running on Pax Web 8'", resp -> resp.contains("Hello from JSF 2.3 example running on Pax Web 8")) .doGETandExecuteTest("http://127.0.0.1:8181/war-jsf23-embedded/"); } @Test public void testJSF() throws Exception { CookieState cookieState = new CookieState(); LOG.debug("Testing JSF workflow!"); String response = HttpTestClientFactory.createDefaultTestClient() .useCookieState(cookieState) .withResponseAssertion("Response must contain 'Hello from JSF 2.3 example running on Pax Web 8'", resp -> resp.contains("Hello from JSF 2.3 example running on Pax Web 8")) .withResponseAssertion("Response must contain JSF-ViewState-ID", resp -> { LOG.debug("Found JSF starting page: {}", resp); Pattern patternViewState = Pattern.compile("id=\"j_id_.*:javax.faces.ViewState:\\w\""); Matcher viewStateMatcher = patternViewState.matcher(resp); if (!viewStateMatcher.find()) { return false; } String viewStateID = resp.substring(viewStateMatcher.start() + 4, viewStateMatcher.end() - 1); String substring = resp.substring(viewStateMatcher.end() + 8); int indexOf = substring.indexOf("\""); String viewStateValue = substring.substring(0, indexOf); LOG.debug("Found ViewState-ID '{}' with value '{}'", viewStateID, viewStateValue); return true; }) .withResponseAssertion("Response must contain JSF-Input-ID", resp -> { Pattern pattern = Pattern.compile("(input id=\"mainForm:j_id_\\w*)"); Matcher matcher = pattern.matcher(resp); if (!matcher.find()) { return false; } String inputID = resp.substring(matcher.start(), matcher.end()); inputID = inputID.substring(inputID.indexOf('"') + 1); LOG.debug("Found ID: {}", inputID); return true; }) .doGETandExecuteTest("http://127.0.0.1:8181/war-jsf23-embedded"); Pattern patternViewState = Pattern.compile("id=\"j_id_.*:javax.faces.ViewState:\\w\""); Matcher viewStateMatcher = patternViewState.matcher(response); if (!viewStateMatcher.find()) { fail("Didn't find required ViewState ID!"); } String viewStateID = response.substring(viewStateMatcher.start() + 4, viewStateMatcher.end() - 1); String substring = response.substring(viewStateMatcher.end() + 8); int indexOf = substring.indexOf("\""); String viewStateValue = substring.substring(0, indexOf); Pattern pattern = Pattern.compile("(input id=\"mainForm:j_id_\\w*)"); Matcher matcher = pattern.matcher(response); if (!matcher.find()) { fail("Didn't find required input id!"); } String inputID = response.substring(matcher.start(), matcher.end()); inputID = inputID.substring(inputID.indexOf('"') + 1); HttpTestClientFactory.createDefaultTestClient() .useCookieState(cookieState) .withResponseAssertion("Response from POST must contain 'Hello world!'", resp -> resp.contains("Hello world!")) .doPOST("http://127.0.0.1:8181/war-jsf23-embedded/start.xhtml") .addParameter("mainForm:what", "world") .addParameter(viewStateID, viewStateValue) .addParameter(inputID, "say") .addParameter("javax.faces.ViewState", viewStateValue) .addParameter("mainForm_SUBMIT", "1") .executeTest(); } }
[ "gr.grzybek@gmail.com" ]
gr.grzybek@gmail.com
790ff7077e65e308d7031ebf13ac97188f699d7d
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_80d878f18e65026ee0a36ea787337310b692153e/CoreTMASegmentHandler/12_80d878f18e65026ee0a36ea787337310b692153e_CoreTMASegmentHandler_t.java
51d02c924f54a17c05c3e450e40b9fe706b27b9b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,908
java
package Debrief.ReaderWriter.XML.Tactical; /** * Title: Debrief 2000 * Description: Debrief 2000 Track Analysis Software * Copyright: Copyright (c) 2000 * Company: MWC * @author Ian Mayo * @version 1.0 */ import org.w3c.dom.Element; import Debrief.Wrappers.Track.CoreTMASegment; import MWC.GUI.Layers; import MWC.GenericData.WorldSpeed; import MWC.Utilities.ReaderWriter.XML.Util.WorldSpeedHandler; abstract public class CoreTMASegmentHandler extends CoreTrackSegmentHandler { public static final String COURSE_DEGS = "CourseDegs"; public static final String SPEED= "Speed"; public static final String BASE_FREQ="BaseFrequency"; protected double _courseDegs = 0d; protected WorldSpeed _speed; protected double _baseFrequency; public CoreTMASegmentHandler(Layers theLayers, String myName) { // inform our parent what type of class we are super(myName); addAttributeHandler(new HandleDoubleAttribute(COURSE_DEGS) { @Override public void setValue(String name, double val) { _courseDegs = val; } }); addAttributeHandler(new HandleDoubleAttribute(BASE_FREQ) { @Override public void setValue(String name, double val) { _baseFrequency = val; } }); addHandler(new WorldSpeedHandler(SPEED){ @Override public void setSpeed(WorldSpeed res) { _speed = res; } }); } public static void exportThisTMASegment(org.w3c.dom.Document doc, CoreTMASegment theSegment, Element theElement) { // sort out the remaining attributes theElement.setAttribute(COURSE_DEGS, writeThis(theSegment.getCourse())); theElement.setAttribute(BASE_FREQ, writeThis(theSegment.getBaseFrequency())); WorldSpeedHandler.exportSpeed(SPEED, theSegment.getSpeed(), theElement, doc); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
689e3f08484eab5806645122d453ba8cf9ab7b26
95d0d319488eb2bc84557e0c63b152f8f7fb43b5
/kaitou-ppp-manager/src/test/java/kaitou/ppp/manager/mock/manager/MockShopRTSManagerImpl.java
2e7f0540257924c20b983d7795fdf5024d6e2dec
[]
no_license
kaitouzhao/kaitou-erp
b495867048b6a98bc9ab45d2d37962f71b7113ac
27193e72a4a8455638db265c38b4293a032aa548
refs/heads/master
2020-03-29T09:55:58.480372
2015-07-06T02:06:04
2015-07-06T02:06:04
35,708,291
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package kaitou.ppp.manager.mock.manager; import kaitou.ppp.manager.shop.impl.ShopRTSManagerImpl; /** * ShopRTSManagerImpl桩. * User: 赵立伟 * Date: 2015/1/29 * Time: 21:56 */ public class MockShopRTSManagerImpl extends ShopRTSManagerImpl { }
[ "Kid.Zhao@gmail.com" ]
Kid.Zhao@gmail.com
113b0afce3d6cb231891aa05a1871935013ed0c7
db2a87d7af621679921bfdcd93a212230684793a
/src/cn/javass/dp/visitor/example6/PrintNameVisitor.java
56e9c8625510dac92d17500257c95066f19ad6b2
[]
no_license
Wilsoncyf/designpattern
fa5f8a50e0d89f644ccb7edc1971465f3d21d3e4
11f62dd0753a7848c9de0453ee021a845347ebaa
refs/heads/master
2022-12-05T02:48:24.323214
2020-08-31T15:50:02
2020-08-31T15:50:02
290,809,079
1
0
null
null
null
null
GB18030
Java
false
false
528
java
package cn.javass.dp.visitor.example6; /** * 具体的访问者,实现:输出对象的名称,在组合对象的名称前面添加"节点:", * 在叶子对象的名称前面添加"叶子:" */ public class PrintNameVisitor implements Visitor { public void visitComposite(Composite composite) { //访问到组合对象的数据 System.out.println("节点:"+composite.getName()); } public void visitLeaf(Leaf leaf) { //访问到叶子对象的数据 System.out.println("叶子:"+leaf.getName()); } }
[ "417187306@qq.com" ]
417187306@qq.com
c703a19e915a4349eade3a50e98752af3ce9324a
6bbbf5f5e84aa5a0108145e9344ccd1c147b6464
/kikaha-modules/kikaha-urouting-api/source/kikaha/urouting/api/WrappedResponse.java
d42e7e519f8ff9c31e85914491b1feab625f318f
[ "Apache-2.0" ]
permissive
miere/kikaha
054d213f5c1a6799ba361babf98591e8cc8140a9
6ea8156af2e95a3b3e349a93fbf00a14b0f32ef5
refs/heads/master
2020-03-13T17:52:33.184563
2018-03-18T23:38:00
2018-03-18T23:38:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
903
java
package kikaha.urouting.api; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.experimental.Accessors; @Setter @Accessors( fluent=true ) @RequiredArgsConstructor final public class WrappedResponse implements Response { final Response wrapped; Object entity; int statusCode; String encoding; String contentType; @Override public Iterable<Header> headers() { return wrapped.headers(); } @Override public Object entity() { if ( entity != null ) return entity; return wrapped.entity(); } @Override public int statusCode() { if ( statusCode > 0 ) return statusCode; return wrapped.statusCode(); } @Override public String encoding() { if ( encoding != null ) return encoding; return wrapped.encoding(); } @Override public String contentType() { if ( contentType != null ) return contentType; return wrapped.contentType(); } }
[ "miere00@gmail.com" ]
miere00@gmail.com
8604c5f4693ab277802d48851dd34ad0e314424f
bfdb7a4a9fc8b23b9ca8eff94ec24bcab091f31b
/datacentre/accessPermission/oauthserver/src/main/java/com/standard/server/service/impl/OAthGrantedAuthorityServiceImpl.java
16af5083f1f339b25d39ad87a5b02b0aa5d828af
[]
no_license
hzjianglf/standard
1c8514fc2a9fdb8a8c4b128475904534903e8f32
06a777d6bd2cb70433e206673b470f75f7d4515d
refs/heads/master
2020-07-27T02:08:20.298130
2019-07-07T10:47:19
2019-07-07T10:47:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.standard.server.service.impl; import com.standard.base.service.impl.BaseServiceImpl; import com.standard.server.entity.OAthGrantedAuthority; import com.standard.server.service.OAthGrantedAuthorityService; import org.springframework.stereotype.Service; @Service public class OAthGrantedAuthorityServiceImpl extends BaseServiceImpl<OAthGrantedAuthority, Long> implements OAthGrantedAuthorityService { }
[ "422375723@qq.com" ]
422375723@qq.com
c7a04d60aa1aee43d6d60e4c08947fc79d1e1320
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/alibaba--druid/99fe9112b4a51346922cf915cc36cbd6a16b6eba/after/SQLServerSchemaStatVisitor.java
e65b253abecab2e577bb34950cd1e6009373d8e5
[]
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
4,716
java
/* * Copyright 1999-2017 Alibaba Group Holding Ltd. * * 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.alibaba.druid.sql.dialect.sqlserver.visitor; import java.util.Map; import com.alibaba.druid.sql.ast.statement.SQLInsertStatement; import com.alibaba.druid.sql.ast.statement.SQLSelectQueryBlock; import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerOutput; import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerSelectQueryBlock; import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerTop; import com.alibaba.druid.sql.dialect.sqlserver.ast.expr.SQLServerObjectReferenceExpr; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerExecStatement.SQLServerParameter; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerInsertStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerRollbackStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSetStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerSetTransactionIsolationLevelStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerUpdateStatement; import com.alibaba.druid.sql.dialect.sqlserver.ast.stmt.SQLServerWaitForStatement; import com.alibaba.druid.sql.visitor.SchemaStatVisitor; import com.alibaba.druid.stat.TableStat; import com.alibaba.druid.util.JdbcConstants; import com.alibaba.druid.util.JdbcUtils; public class SQLServerSchemaStatVisitor extends SchemaStatVisitor implements SQLServerASTVisitor { public SQLServerSchemaStatVisitor() { super(JdbcConstants.SQL_SERVER); } @Override public boolean visit(SQLServerSelectQueryBlock x) { return visit((SQLSelectQueryBlock) x); } @Override public void endVisit(SQLServerSelectQueryBlock x) { endVisit((SQLSelectQueryBlock) x); } @Override public boolean visit(SQLServerTop x) { return false; } @Override public void endVisit(SQLServerTop x) { } @Override public boolean visit(SQLServerObjectReferenceExpr x) { return false; } @Override public void endVisit(SQLServerObjectReferenceExpr x) { } @Override public boolean visit(SQLServerInsertStatement x) { this.visit((SQLInsertStatement) x); return false; } @Override public void endVisit(SQLServerInsertStatement x) { this.endVisit((SQLInsertStatement) x); } @Override public boolean visit(SQLServerUpdateStatement x) { String ident = x.getTableName().toString(); TableStat stat = getTableStat(ident); stat.incrementUpdateCount(); accept(x.getItems()); accept(x.getFrom()); accept(x.getWhere()); return false; } @Override public void endVisit(SQLServerUpdateStatement x) { } @Override public boolean visit(SQLServerExecStatement x) { return false; } @Override public void endVisit(SQLServerExecStatement x) { } @Override public boolean visit(SQLServerSetTransactionIsolationLevelStatement x) { return false; } @Override public void endVisit(SQLServerSetTransactionIsolationLevelStatement x) { } @Override public boolean visit(SQLServerSetStatement x) { return false; } @Override public void endVisit(SQLServerSetStatement x) { } @Override public boolean visit(SQLServerOutput x) { return false; } @Override public void endVisit(SQLServerOutput x) { } @Override public boolean visit(SQLServerRollbackStatement x) { return true; } @Override public void endVisit(SQLServerRollbackStatement x) { } @Override public boolean visit(SQLServerWaitForStatement x) { return true; } @Override public void endVisit(SQLServerWaitForStatement x) { } @Override public boolean visit(SQLServerParameter x) { // TODO Auto-generated method stub return false; } @Override public void endVisit(SQLServerParameter x) { // TODO Auto-generated method stub } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
38349a526e30391872fa92b5d4729fd046628836
ee5e362c7628cbf15c2e1a6e2105458bcba5b0bf
/retrolambda/src/main/java/net/orfjackal/retrolambda/LambdaSavingClassFileTransformer.java
f77bf286634283c96585fd7dbce7e8c81927f131
[ "Apache-2.0" ]
permissive
yoyfook/retrolambda
a16daf219c8f782728a73c17d9152444ae09bc7d
15b7f1eb33b9b57c2da0505f8b4aa435a60bf523
refs/heads/master
2020-12-25T06:06:41.935495
2013-08-28T12:33:37
2013-08-28T12:37:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,206
java
// Copyright © 2013 Esko Luontola <www.orfjackal.net> // This software is released under the Apache License 2.0. // The license text is at http://www.apache.org/licenses/LICENSE-2.0 package net.orfjackal.retrolambda; import java.io.IOException; import java.lang.instrument.*; import java.nio.file.*; import java.security.ProtectionDomain; import java.util.*; import java.util.regex.Pattern; public class LambdaSavingClassFileTransformer implements ClassFileTransformer { private static final Pattern LAMBDA_CLASS = Pattern.compile("^.+\\$\\$Lambda\\$\\d+$"); private final Path outputDir; private final int targetVersion; private final List<ClassLoader> ignoredClassLoaders = new ArrayList<>(); public LambdaSavingClassFileTransformer(Path outputDir, int targetVersion) { this.outputDir = outputDir; this.targetVersion = targetVersion; for (ClassLoader cl = ClassLoader.getSystemClassLoader(); cl != null; cl = cl.getParent()) { ignoredClassLoaders.add(cl); } ignoredClassLoaders.add(null); } @Override public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { if (ignoredClassLoaders.contains(loader)) { // Avoid saving any classes from the JDK or Retrolambda itself. // The transformed application classes have their own class loader. return null; } if (!isLambdaClass(className)) { return null; } try { System.out.println("Saving lambda class: " + className); byte[] backportedBytecode = LambdaClassBackporter.transform(classfileBuffer, targetVersion); Path savePath = outputDir.resolve(className + ".class"); Files.createDirectories(savePath.getParent()); Files.write(savePath, backportedBytecode); } catch (IOException e) { e.printStackTrace(); } return null; } private static boolean isLambdaClass(String className) { return LAMBDA_CLASS.matcher(className).matches(); } }
[ "esko.luontola@gmail.com" ]
esko.luontola@gmail.com
95833b49bca79cc6a23816efa405f7755a933b22
13cbb329807224bd736ff0ac38fd731eb6739389
/javax/management/modelmbean/XMLParseException.java
087868ea07d84b453f22ee680297c17775c8b621
[]
no_license
ZhipingLi/rt-source
5e2537ed5f25d9ba9a0f8009ff8eeca33930564c
1a70a036a07b2c6b8a2aac6f71964192c89aae3c
refs/heads/master
2023-07-14T15:00:33.100256
2021-09-01T04:49:04
2021-09-01T04:49:04
401,933,858
0
0
null
null
null
null
UTF-8
Java
false
false
2,424
java
package javax.management.modelmbean; import com.sun.jmx.mbeanserver.GetPropertyAction; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.ObjectStreamField; import java.security.AccessController; public class XMLParseException extends Exception { private static final long oldSerialVersionUID = -7780049316655891976L; private static final long newSerialVersionUID = 3176664577895105181L; private static final ObjectStreamField[] oldSerialPersistentFields = { new ObjectStreamField("msgStr", String.class) }; private static final ObjectStreamField[] newSerialPersistentFields = new ObjectStreamField[0]; private static final long serialVersionUID; private static final ObjectStreamField[] serialPersistentFields; private static boolean compat = false; public XMLParseException() { super("XML Parse Exception."); } public XMLParseException(String paramString) { super("XML Parse Exception: " + paramString); } public XMLParseException(Exception paramException, String paramString) { super("XML Parse Exception: " + paramString + ":" + paramException.toString()); } private void readObject(ObjectInputStream paramObjectInputStream) throws IOException, ClassNotFoundException { paramObjectInputStream.defaultReadObject(); } private void writeObject(ObjectOutputStream paramObjectOutputStream) throws IOException { if (compat) { ObjectOutputStream.PutField putField = paramObjectOutputStream.putFields(); putField.put("msgStr", getMessage()); paramObjectOutputStream.writeFields(); } else { paramObjectOutputStream.defaultWriteObject(); } } static { try { GetPropertyAction getPropertyAction = new GetPropertyAction("jmx.serial.form"); String str = (String)AccessController.doPrivileged(getPropertyAction); compat = (str != null && str.equals("1.0")); } catch (Exception exception) {} if (compat) { serialPersistentFields = oldSerialPersistentFields; serialVersionUID = -7780049316655891976L; } else { serialPersistentFields = newSerialPersistentFields; serialVersionUID = 3176664577895105181L; } } } /* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\javax\management\modelmbean\XMLParseException.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.0.7 */
[ "michael__lee@yeah.net" ]
michael__lee@yeah.net
ba0f7a3cba4e1a9a784cb19dccd1bb8d17284214
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/uis-20180821/src/main/java/com/aliyun/uis20180821/models/DescribeUisNetworkInterfacesResponse.java
7f839423e141cb0a3868e44edeae673279526074
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
1,178
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.uis20180821.models; import com.aliyun.tea.*; public class DescribeUisNetworkInterfacesResponse extends TeaModel { @NameInMap("headers") @Validation(required = true) public java.util.Map<String, String> headers; @NameInMap("body") @Validation(required = true) public DescribeUisNetworkInterfacesResponseBody body; public static DescribeUisNetworkInterfacesResponse build(java.util.Map<String, ?> map) throws Exception { DescribeUisNetworkInterfacesResponse self = new DescribeUisNetworkInterfacesResponse(); return TeaModel.build(map, self); } public DescribeUisNetworkInterfacesResponse setHeaders(java.util.Map<String, String> headers) { this.headers = headers; return this; } public java.util.Map<String, String> getHeaders() { return this.headers; } public DescribeUisNetworkInterfacesResponse setBody(DescribeUisNetworkInterfacesResponseBody body) { this.body = body; return this; } public DescribeUisNetworkInterfacesResponseBody getBody() { return this.body; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
36ff7e9686c6062b7710b71db5f1d1227636eef8
ba0c6c122042ca6a5635a9e9f2eab8b3fbb7e5be
/app/src/main/java/com/saiyi/oldmanwatch/utils/BitmapUtil.java
b3de1ff1e50f86136c6d35a40cb0c952867d115c
[]
no_license
WangZhouA/OldManWatch
b890afeeb6be13b214e03e85949f989d1df6200a
74df1c14ce81f6e6e650f36f6cb73447f1b4e1ad
refs/heads/master
2020-04-29T01:52:16.756760
2019-03-15T04:20:37
2019-03-15T04:20:37
175,744,613
0
0
null
null
null
null
UTF-8
Java
false
false
1,761
java
package com.saiyi.oldmanwatch.utils; import android.content.Context; import android.content.res.Resources; import com.baidu.mapapi.map.BitmapDescriptor; import com.baidu.mapapi.map.BitmapDescriptorFactory; import com.saiyi.oldmanwatch.R; /** * Created by baidu on 17/3/8. */ public class BitmapUtil { public static BitmapDescriptor bmArrowPoint = null; public static BitmapDescriptor bmStart = null; public static BitmapDescriptor bmEnd = null; public static BitmapDescriptor bmGeo = null; public static BitmapDescriptor bmGcoding = null; /** * 创建bitmap,在MainActivity onCreate()中调用 */ public static void init() { bmArrowPoint = BitmapDescriptorFactory.fromResource(R.mipmap.icon_point); bmStart = BitmapDescriptorFactory.fromResource(R.mipmap.icon_start); bmEnd = BitmapDescriptorFactory.fromResource(R.mipmap.icon_end); bmGeo = BitmapDescriptorFactory.fromResource(R.mipmap.icon_geo); bmGcoding = BitmapDescriptorFactory.fromResource(R.mipmap.icon_gcoding); } /** * 回收bitmap,在MainActivity onDestroy()中调用 */ public static void clear() { bmArrowPoint.recycle(); bmStart.recycle(); bmEnd.recycle(); bmGeo.recycle(); } public static BitmapDescriptor getMark(Context context, int index) { Resources res = context.getResources(); int resourceId; if (index <= 10) { resourceId = res.getIdentifier("icon_mark" + index, "mipmap", context.getPackageName()); } else { resourceId = res.getIdentifier("icon_markx", "mipmap", context.getPackageName()); } return BitmapDescriptorFactory.fromResource(resourceId); } }
[ "514077686@qq.com" ]
514077686@qq.com
aa5e3135ba6ed3a9f8396a04c6d83de140fb770a
24cb00af2472df8539a9280b1e3b3a4bb476bf5f
/src/officehours07_08_03/ListOfMaps.java
91dd808c6ff8b4fc24f94ea030de69db9bdfb277
[]
no_license
AygunEldar/java-programming
da28df8d9df4dd366f3c843f3e123d10a4e216e3
125d35600f2d823c77a90e7fbe9daf28dae3e482
refs/heads/master
2023-07-13T09:43:57.014483
2021-08-21T22:55:07
2021-08-21T22:55:07
360,311,676
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
package officehours07_08_03; import java.util.*; public class ListOfMaps { public static void main(String[] args) { List<Map<String, String>> employees = new ArrayList<>(); Map<String, String> empData = new HashMap<>(); empData.put("EmpID", "5350"); empData.put("EmpName", "John"); empData.put("JobTitle", "SDET"); empData.put("Salary", "130000"); Map<String, String> emp2Data = new HashMap<>(); emp2Data.put("EmpID", "1236"); emp2Data.put("EmpName", "Ayka"); emp2Data.put("JobTitle", "Dev"); emp2Data.put("Salary", "220000"); employees.add(empData); employees.add(emp2Data); System.out.println("employees.toString() = " + employees.toString()); System.out.println(employees.get(1).get("Salary")); employees.get(0).put("Salary", "15000"); System.out.println(employees.get(0).get("Salary")); System.out.println("***************"); List<String> list = Arrays.asList("23", "a", "23", "m", "a", "t", "hh", "t"); Set<String> unique = new HashSet<String>(); } }
[ "aygunalizadael@gmail.com" ]
aygunalizadael@gmail.com
c967fd646646bcb46e93f8b252ea60c71e808ba9
bf96e832cd390b2b46558c67371f5d0927596469
/src/main/java/com/github/mkolisnyk/muto/reporter/MutoResult.java
e77203c0c04031e7f8c969912c3e5c7c69c4e68c
[ "Apache-2.0" ]
permissive
mkolisnyk/Muto
e2d3e7239baab8188ee35531857cbd8bbedd9e6e
5720c2aa71e8dc77194f73eaa32e2f55c6b65e02
refs/heads/master
2020-07-21T11:31:19.676361
2014-06-21T19:04:20
2014-06-21T19:04:20
19,355,456
1
0
null
null
null
null
UTF-8
Java
false
false
4,641
java
package com.github.mkolisnyk.muto.reporter; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.bind.JAXB; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import org.apache.commons.io.FileUtils; import com.github.mkolisnyk.muto.data.MutationLocation; import com.github.mkolisnyk.muto.reporter.result.JUnitTestSuite; /** * . * @author Myk Kolisnyk * */ @XmlRootElement(name = "mutoResult") public class MutoResult { /** * . */ public static final int PASSED = 0; /** * . */ public static final int FAILED = 1; /** * . */ public static final int ERRORRED = 2; /** * . */ public static final int UNDEFINED = 3; /** * . */ private String outputLocation; /** * . */ private String testReportsLocation; /** * . */ @XmlElement(name = "results") private List<JUnitTestSuite> results; /** * . */ private int exitCode; /** * . */ private MutationLocation location; /** * . * @param reportsLocation . */ public MutoResult(final String reportsLocation) { this.testReportsLocation = reportsLocation; } /** * . */ public MutoResult() { this(""); } /** * . * @return . */ public final String getOutputLocation() { return outputLocation; } /** * . * @param outputLocationValue . */ public final void setOutputLocation(final String outputLocationValue) { this.outputLocation = outputLocationValue; } /** * . * @return . */ public final String getTestReportsLocation() { return testReportsLocation; } /** * . * @return . */ @XmlTransient public final List<JUnitTestSuite> getResults() { return results; } /** * @param resultsValue the results to set */ public final void setResults(final List<JUnitTestSuite> resultsValue) { this.results = resultsValue; } /** * . * @return . */ public final int getExitCode() { return exitCode; } /** * . * @param exitCodeValue . */ public final void setExitCode(final int exitCodeValue) { this.exitCode = exitCodeValue; } /** * . * @return . */ public final MutationLocation getLocation() { return location; } /** * . * @param locationValue . */ public final void setLocation(final MutationLocation locationValue) { this.location = locationValue; } /** * . */ @SuppressWarnings("unchecked") public final void retrieveResults() { results = new ArrayList<JUnitTestSuite>(); Iterator<File> iter = FileUtils.iterateFiles(new File( this.testReportsLocation), new String[] {"xml"}, false); while (iter.hasNext()) { String file = iter.next().getAbsolutePath(); JUnitTestSuite suite = retrieveResult(file); if (suite.getErrors() > 0 || suite.getFailures() > 0) { results.add(suite); } } } /** * . * @param file . * @return . */ public final JUnitTestSuite retrieveResult(final String file) { return JAXB.unmarshal(file, JUnitTestSuite.class); } /** * . * @return . */ private int getStatus() { if (this.results == null || this.results.size() == 0) { if (this.getExitCode() != 0) { return FAILED; } else { return UNDEFINED; } } int errors = 0; for (JUnitTestSuite suite : results) { errors = suite.getErrors() + suite.getFailures(); } if (errors > 0) { return ERRORRED; } else { return PASSED; } } /** * . * @return . */ public final boolean isPassed() { return this.getStatus() == PASSED; } /** * . * @return . */ public final boolean isFailed() { return this.getStatus() == FAILED; } /** * . * @return . */ public final boolean isErrorred() { return this.getStatus() == ERRORRED; } /** * . * @return . */ public final boolean isUndefined() { return this.getStatus() == UNDEFINED; } }
[ "kolesnik.nickolay@gmail.com" ]
kolesnik.nickolay@gmail.com
96f39bb66904a99ec03437de05bc3d493fd36139
b345f82f22f6607a6dcff8ef86c44dce80e8f378
/subprojects/griffon-core/src/main/java/griffon/exceptions/InstanceMethodInvocationException.java
5645f121c91400332f4d91b71ae8494ae383a1fc
[ "Apache-2.0" ]
permissive
eunsebi/griffon
2296201165b0e4842e84d8764a7bde6f1f9ca56a
52a2c4bb33953438d62fffd0e4b7d7740930bb0d
refs/heads/master
2021-01-01T20:36:01.491286
2017-06-22T08:45:33
2017-06-22T08:45:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,435
java
/* * Copyright 2008-2017 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 griffon.exceptions; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.lang.reflect.Method; /** * @author Andres Almiray * @since 2.0.0 */ public class InstanceMethodInvocationException extends MethodInvocationException { private static final long serialVersionUID = -2325571968606780435L; public InstanceMethodInvocationException(@Nonnull Object instance, @Nonnull String methodName, @Nullable Object[] args) { super(formatArguments(instance, methodName, args)); } public InstanceMethodInvocationException(@Nonnull Object instance, @Nonnull String methodName, @Nullable Object[] args, @Nonnull Throwable cause) { super(formatArguments(instance, methodName, args), cause); } public InstanceMethodInvocationException(@Nonnull Object instance, @Nonnull Method method) { super(formatArguments(instance, method)); } public InstanceMethodInvocationException(@Nonnull Object instance, @Nonnull Method method, @Nonnull Throwable cause) { super(formatArguments(instance, method), cause); } @Nonnull private static String formatArguments(@Nonnull Object instance, @Nonnull String methodName, @Nullable Object[] args) { checkNonNull(instance, "instance"); checkNonBlank(methodName, "methodName"); StringBuilder b = new StringBuilder("An error occurred while invoking instance method ") .append(instance.getClass().getName()) .append(".").append(methodName).append("("); boolean first = true; for (Class<?> type : convertToTypeArray(args)) { if (first) { first = false; } else { b.append(","); } if (type == null) { // we don't know the type as the argument is null, // let's fallback to plain old Object b.append(Object.class.getName()); } else { b.append(type.getName()); } } b.append(")"); return b.toString(); } @Nonnull protected static String formatArguments(@Nonnull Object instance, @Nonnull Method method) { checkNonNull(instance, "instance"); checkNonNull(method, "method"); StringBuilder b = new StringBuilder("An error occurred while invoking instance method ") .append(instance.getClass().getName()) .append(".").append(method.getName()).append("("); boolean first = true; for (Class<?> type : method.getParameterTypes()) { if (first) { first = false; } else { b.append(","); } b.append(type.getName()); } b.append(")"); return b.toString(); } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
f3f72be3537dde65c42f0b478a98c2b805ed2312
bcdcfb873617f90c963f2a37718a1196b08a4501
/workplace/MathUtils/src/com/math/.svn/text-base/Value_scale.java.svn-base
b8d0b51b545aaf7093210788068f250ba9068c9a
[]
no_license
realjune/androidCode
13dc10be2becbdc4778ed2fb768c1acd199aee85
9437d3154ed01fa8a25ef918151e49bcd47fd9b6
refs/heads/master
2021-01-01T18:02:55.627149
2014-05-04T10:22:24
2014-05-04T10:22:24
11,117,339
0
0
null
null
null
null
GB18030
Java
false
false
1,217
package com.math; public class Value_scale { /**根据数据范围计算数据轴刻度 * <pre> * 单位刻度:一天 * 最多刻度数量:7个 * <1天:(step:1)0,1 * <=7天:(step:1)1,2,3,4,5,6,7 * 8天:(step:2)1,3,5,7,9 * 29天:(step:5)1,6,11,16,21,26,31 * >月:(月) * 3个月:(step:15)1,16,31,56,71,96,111 或者(step:月):1,2,3 * 大于年:(step:n年) * * * @param start 数据起始位置 * @param end 数据结束位置 * @param scaleBase 单位刻度 * @param isRound 边缘是否按整刻度 * @param maxScales 最多刻度数量 * @return */ public static long[] getListTime_scale(long start,long end,long scaleBase,boolean isRound,int maxScales){ long datas[]; long dataArea=end-start; long step=(dataArea)/maxScales; if(step<scaleBase){ step=scaleBase; } step=step/10*10;//getDateField(step,10); datas=new long[(int) ((dataArea+step)/(step))]; // System.out.println(" step: "+step); for(int i=0;start<end;++i,start+=step){ datas[i]=start; // System.out.println(start); } // System.out.println("date:"+formatter.format(fromCalendar.getTimeInMillis())); return datas; } }
[ "7978241a@163.com" ]
7978241a@163.com
5032de6d5c0634069461a978af5dc32fc056b99e
4fae6e6985f17c247168691f7299e009c0541f0f
/src/main/java/com/aparapi/examples/extension/HistogramIdeal.java
8e961352aa4b6dad6bfbf4a87f4c757892e2dead
[ "Apache-2.0" ]
permissive
KotaTsuboi/aparapi-examples
45f45d2031dbd1c753263694fbb003644f25671a
c5c6a75ce4de470af6ffb06ec940a40b5f65fd9e
refs/heads/master
2023-03-02T12:45:54.178207
2021-02-16T16:25:27
2021-02-16T16:25:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,219
java
/** * Copyright (c) 2016 - 2018 Syncleus, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * This product currently only contains code developed by authors * of specific components, as identified by the source code files. * * Since product implements StAX API, it has dependencies to StAX API * classes. * * For additional credits (generally to people who reported problems) * see CREDITS file. */ package com.aparapi.examples.extension; import com.aparapi.Range; import com.aparapi.device.Device; import com.aparapi.device.OpenCLDevice; import com.aparapi.internal.kernel.*; import com.aparapi.opencl.OpenCL; public class HistogramIdeal{ // @Resource("com/amd/aparapi/sample/extension/HistogramKernel.cl") interface HistogramKernel extends OpenCL<HistogramKernel>{ public HistogramKernel histogram256(// Range _range,// @GlobalReadOnly("data") byte[] data,// @Local("sharedArray") byte[] sharedArray,// @GlobalWriteOnly("binResult") int[] binResult,// @Arg("binSize") int binSize); public HistogramKernel bin256(// Range _range,// @GlobalWriteOnly("histo") int[] histo,// @GlobalReadOnly("binResult") int[] binResult,// @Arg("subHistogramSize") int subHistogramSize); } public static void main(String[] args) { final int WIDTH = 1024 * 16; final int HEIGHT = 1024 * 8; final int BIN_SIZE = 128; final int GROUP_SIZE = 128; final int SUB_HISTOGRAM_COUNT = ((WIDTH * HEIGHT) / (GROUP_SIZE * BIN_SIZE)); final byte[] data = new byte[WIDTH * HEIGHT]; for (int i = 0; i < (WIDTH * HEIGHT); i++) { data[i] = (byte) ((Math.random() * BIN_SIZE) / 2); } final byte[] sharedArray = new byte[GROUP_SIZE * BIN_SIZE]; final int[] binResult = new int[SUB_HISTOGRAM_COUNT * BIN_SIZE]; System.out.println("binResult size=" + binResult.length); final int[] histo = new int[BIN_SIZE]; final int[] refHisto = new int[BIN_SIZE]; final Device device = KernelManager.instance().bestDevice(); if (device != null) { System.out.println(((OpenCLDevice) device).getOpenCLPlatform().getName()); final Range rangeBinSize = device.createRange(BIN_SIZE); final Range range = Range.create((WIDTH * HEIGHT) / BIN_SIZE, GROUP_SIZE); if (device instanceof OpenCLDevice) { final OpenCLDevice openclDevice = (OpenCLDevice) device; final HistogramKernel histogram = openclDevice.bind(HistogramKernel.class, Histogram.class.getClassLoader() .getResourceAsStream("HistogramKernel.cl")); long start = System.nanoTime(); histogram.begin()// .put(data)// .histogram256(range, data, sharedArray, binResult, BIN_SIZE)// // by leaving binResult on the GPU we can save two 1Mb transfers .bin256(rangeBinSize, histo, binResult, SUB_HISTOGRAM_COUNT)// .get(histo)// .end(); System.out.println("opencl " + ((System.nanoTime() - start) / 1000000)); start = System.nanoTime(); for (int i = 0; i < (WIDTH * HEIGHT); i++) { refHisto[data[i]]++; } System.out.println("java " + ((System.nanoTime() - start) / 1000000)); for (int i = 0; i < 128; i++) { if (refHisto[i] != histo[i]) { System.out.println(i + " " + histo[i] + " " + refHisto[i]); } } } } else { System.out.println("no GPU device"); } } }
[ "jeffrey.freeman@syncleus.com" ]
jeffrey.freeman@syncleus.com
b1f33396e8c5a023b3c97b680e4a6976692200de
227846f62522142ae588214205025e732a7122da
/http-session/http-session-android/app/src/main/java/com/muhardin/endy/belajar/android/security/httpsession/helpers/RestClient.java
b52ca1ccd02a4443905025984f377d9c1ef495ec
[]
no_license
endymuhardin/belajar-android-security
697bb55aa9e8aab13ebd64b150a60903495282bc
2b6afec076605ab5f2358f2fa379e76d66b684d6
refs/heads/master
2021-01-01T05:25:28.082948
2016-04-20T04:50:08
2016-04-20T04:50:08
56,654,678
2
1
null
null
null
null
UTF-8
Java
false
false
377
java
package com.muhardin.endy.belajar.android.security.httpsession.helpers; import java.util.HashMap; import java.util.Map; public class RestClient { public void login(String username, String password){ } public Map<String, Object> getUserInfo(){ Map<String, Object> hasil = new HashMap<>(); return hasil; } public void logout(){ } }
[ "endy.muhardin@gmail.com" ]
endy.muhardin@gmail.com
b4cbb888e06b5d561ee161945f1829d8d6bd31f6
511909dece65ca69e44d89e7cb30013afe599b71
/struts2-test1/src/main/java/com/lxf/timerintercepter/AuthIntercepter.java
3637d8ac5efbf02c534121ecc64e9b8940bdf501
[]
no_license
liangxifeng833/java
b0b84eb7cb719ebf588e6856ab7d8441573213ae
fe9fe02a91671df789ad45664752ffa1f9da7821
refs/heads/master
2023-05-25T21:02:32.522297
2023-05-12T03:37:33
2023-05-12T03:37:33
253,181,449
0
0
null
2022-12-16T15:27:56
2020-04-05T07:44:02
JavaScript
UTF-8
Java
false
false
891
java
package com.lxf.timerintercepter; /** * 拦截器,用来验证用户登录 */ import java.util.Map; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.AbstractInterceptor; public class AuthIntercepter extends AbstractInterceptor { /** * 自动调用此方法,进行拦截操作 */ @Override public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = ActionContext.getContext(); Map<String,Object> session = context.getSession(); //用户已登录 if(session.get("loginInfo") !=null) { String result = invocation.invoke(); return result; }else //用户未登录 { return "login"; } } }
[ "liangxifeng833@163.com" ]
liangxifeng833@163.com
e43b936b7d0d3c6868c6b1ea148a91d7bb31fd27
39324b6382a128a39a5ba20344cd88524ac48ab2
/src/main/java/com/example/godcode/ui/fragment/deatailFragment/EditAssetFragment.java
4789300c51dd2792a2c67b4521e9038dd485c36f
[]
no_license
huanglonghu/GodCode_CN
804d9123844486e909e2b461a0533378e62d470b
50280476046865efb0d08c262af03fd28b625808
refs/heads/master
2021-03-17T09:01:12.841965
2020-03-13T03:20:48
2020-03-13T03:20:48
246,978,686
0
0
null
null
null
null
UTF-8
Java
false
false
3,618
java
package com.example.godcode.ui.fragment.deatailFragment; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.Nullable; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import com.example.godcode.R; import com.example.godcode.bean.EditProduct; import com.example.godcode.bean.MyAssetList; import com.example.godcode.databinding.FragmentEditAssetBinding; import com.example.godcode.http.HttpUtil; import com.example.godcode.ui.base.BaseFragment; import rx.subjects.PublishSubject; import rx.subjects.SerializedSubject; import rx.subjects.Subject; public class EditAssetFragment extends BaseFragment { private FragmentEditAssetBinding binding; private View view; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { if (binding == null) { binding = DataBindingUtil.inflate(inflater, R.layout.fragment_edit_asset, container, false); view = binding.getRoot(); binding.setPresenter(presenter); binding.setBean(bean); initView(); initListener(); } return view; } private void initListener() { binding.editAssetToolbar.option.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!TextUtils.isEmpty(binding.productName.getText())) { if (!TextUtils.isEmpty(binding.productAddress.getText())) { editAsset(binding.productName.getText().toString(), binding.productAddress.getText().toString()); } else { Toast.makeText(activity, "请输入产品地址", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(activity, "请输入产品名称", Toast.LENGTH_SHORT).show(); } } }); } private void editAsset(String productName, String adress) { EditProduct editProduct = new EditProduct(); EditProduct.ProductBean productBean = new EditProduct.ProductBean(); productBean.setId(bean.getFK_ProductID()); productBean.setFK_ProductCategoryID(bean.getProductCategoryID()); productBean.setProductName(productName); productBean.setProductNumber(bean.getProductNumber()); productBean.setMachineAddress(adress); productBean.setIsValid(true); editProduct.setProduct(productBean); HttpUtil.getInstance().editProduct(editProduct).subscribe( editProductStr -> { assetUpdate.assetUpdate(productName,adress); Toast.makeText(activity, "修改成功", Toast.LENGTH_SHORT).show(); presenter.back(); } ); } private MyAssetList.ResultBean.DataBean bean; public void initData(MyAssetList.ResultBean.DataBean bean) { this.bean = bean; } public void initView() { binding.editAssetToolbar.title.setText("修改资产信息"); binding.editAssetToolbar.tvOption.setText("保存"); } @Override protected void lazyLoad() { } public interface AssetUpdate { void assetUpdate(String productName, String adress); } private AssetUpdate assetUpdate; public void setAssetUpdate(AssetUpdate assetUpdate) { this.assetUpdate = assetUpdate; } }
[ "952204748@qq.com" ]
952204748@qq.com
d2e01ae5ae66223fd88ceadd48b01cddf7efa0fc
f80b63052b690ef6c145727c4c0a46b94ec33394
/ylc/src/com/nangua/xiaomanjflc/UmengManager.java
578c8491873cd438c5c2ad7dc194422bd95f394a
[]
no_license
dougisadog/xiaoman
dbd31ff957ec4e90606ed395c57275561d9a9b40
5dc8bb23f4680eaeded0fd6421c39aeb62ca1eee
refs/heads/master
2020-12-11T07:19:04.544002
2017-09-06T09:18:58
2017-09-06T09:18:59
68,798,640
0
0
null
null
null
null
UTF-8
Java
false
false
6,567
java
package com.nangua.xiaomanjflc; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.lang.reflect.Method; import java.util.Date; import java.util.List; import java.util.Map.Entry; import com.louding.frame.KJDB; import com.nangua.xiaomanjflc.bean.database.UPushMessage; import com.nangua.xiaomanjflc.bean.database.UserConfig; import com.nangua.xiaomanjflc.cache.CacheBean; import com.nangua.xiaomanjflc.service.MyPushIntentService; import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent.UMAnalyticsConfig; import com.umeng.message.IUmengRegisterCallback; import com.umeng.message.PushAgent; import com.umeng.message.UmengNotificationClickHandler; import com.umeng.message.entity.UMessage; import android.Manifest.permission; import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Build; import android.text.TextUtils; import android.widget.Toast; public class UmengManager { private static UmengManager instance = null; public static UmengManager getInstance() { if (null == instance) { instance = new UmengManager(); } return instance; } public void initPushInfo(Context context) { PushAgent mPushAgent = PushAgent.getInstance(context); // 注册推送服务,每次调用register方法都会回调该接口 mPushAgent.register(new IUmengRegisterCallback() { @Override public void onSuccess(String deviceToken) { // 注册成功会返回device token System.out.println("设备token:" + deviceToken); } @Override public void onFailure(String s, String s1) { System.out.println("推送消息注册失败" + s + "####" + s1); } }); // 完全自定义处理推送 mPushAgent.setPushIntentServiceClass(MyPushIntentService.class); // mPushAgent.setPushIntentServiceClass(null); // umeng 后台配置自定义信息时的处理 UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() { @Override public void dealWithCustomAction(Context context, UMessage msg) { UPushMessage m = new UPushMessage(); for (Entry<String, String> entry : msg.extra.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (key.equals("type")) { m.setType(Integer.parseInt(value)); } if (key.equals("url")) { m.setUrl(value); } if (key.equals("productId")) { m.setProductId(Integer.parseInt(value)); } m.setContent(msg.custom); m.setShowed(0); m.setReceiveTime(System.currentTimeMillis()); CacheBean.getInstance().setMsg(m); //删除所有存贮umeng推送信息只保存最新获取的 KJDB kjdb = KJDB.create(context); kjdb.deleteByWhere(UPushMessage.class, null); kjdb.save(m); } // 自动以notification消息处理 Toast.makeText(context, msg.custom, Toast.LENGTH_LONG).show(); } }; mPushAgent.setNotificationClickHandler(notificationClickHandler); } public static int AnalyticsOn = 0; public static int AnalyticsOff = -1; public static int analyticsStatus = -1; @SuppressLint("DefaultLocale") /** * 开启Umeng的数据分析 * * @param context * @param debug * true 开启debug集成测试 */ public void initAnalytics(Context context, boolean debug) { if (debug) { MobclickAgent.setDebugMode(true); } MobclickAgent.openActivityDurationTrack(false); ApplicationInfo appInfo; try { appInfo = context.getPackageManager().getApplicationInfo( context.getPackageName(), PackageManager.GET_META_DATA); String appKey = appInfo.metaData.getString("UMENG_APPKEY", ""); String channel = appInfo.metaData.getString("UMENG_CHANNEL", "") .toUpperCase(); MobclickAgent.startWithConfigure( new UMAnalyticsConfig(context, appKey, channel)); analyticsStatus = AnalyticsOn; // 关闭Umeng异常捕获 MobclickAgent.setCatchUncaughtExceptions(false); } catch (NameNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static boolean checkPermission(Context context, String permission) { boolean result = false; if (Build.VERSION.SDK_INT >= 23) { try { Class<?> clazz = Class.forName("android.content.Context"); Method method = clazz.getMethod("checkSelfPermission", String.class); int rest = (Integer) method.invoke(context, permission); if (rest == PackageManager.PERMISSION_GRANTED) { result = true; } else { result = false; } } catch (Exception e) { result = false; } } else { PackageManager pm = context.getPackageManager(); if (pm.checkPermission(permission, context .getPackageName()) == PackageManager.PERMISSION_GRANTED) { result = true; } } return result; } public static String getDeviceInfo(Context context) { try { org.json.JSONObject json = new org.json.JSONObject(); android.telephony.TelephonyManager tm = (android.telephony.TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); String device_id = null; if (checkPermission(context, permission.READ_PHONE_STATE)) { device_id = tm.getDeviceId(); } String mac = null; FileReader fstream = null; try { fstream = new FileReader("/sys/class/net/wlan0/address"); } catch (FileNotFoundException e) { fstream = new FileReader("/sys/class/net/eth0/address"); } BufferedReader in = null; if (fstream != null) { try { in = new BufferedReader(fstream, 1024); mac = in.readLine(); } catch (IOException e) { } finally { if (fstream != null) { try { fstream.close(); } catch (IOException e) { e.printStackTrace(); } } if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } } } json.put("mac", mac); if (TextUtils.isEmpty(device_id)) { device_id = mac; } if (TextUtils.isEmpty(device_id)) { device_id = android.provider.Settings.Secure.getString( context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID); } json.put("device_id", device_id); return json.toString(); } catch (Exception e) { e.printStackTrace(); } return null; } }
[ "wzc2542736@163.com" ]
wzc2542736@163.com
18fe0ebc88cdcb604f3e6b5151c64d00ddf482ee
82a0c3f367d274a2c5a791945f320fc29f971e31
/src/main/java/com/somoplay/artonexpress/fedex/Rate/B13AFilingOptionType.java
850470d0b1a412c9c0f0b64739474f772414776e
[]
no_license
zl20072008zl/arton_nov
a21e682e40a2ee4d9e1b416565942c8a62a8951f
c3571a7b31c561691a785e3d2640ea0b5ab770a7
refs/heads/master
2020-03-19T02:22:35.567584
2018-05-20T14:16:43
2018-05-20T14:16:43
135,623,385
0
0
null
null
null
null
UTF-8
Java
false
false
3,420
java
/** * B13AFilingOptionType.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.somoplay.artonexpress.fedex.Rate; public class B13AFilingOptionType implements java.io.Serializable { private java.lang.String _value_; private static java.util.HashMap _table_ = new java.util.HashMap(); // Constructor protected B13AFilingOptionType(java.lang.String value) { _value_ = value; _table_.put(_value_,this); } public static final java.lang.String _FEDEX_TO_STAMP = "FEDEX_TO_STAMP"; public static final java.lang.String _FILED_ELECTRONICALLY = "FILED_ELECTRONICALLY"; public static final java.lang.String _MANUALLY_ATTACHED = "MANUALLY_ATTACHED"; public static final java.lang.String _NOT_REQUIRED = "NOT_REQUIRED"; public static final java.lang.String _SUMMARY_REPORTING = "SUMMARY_REPORTING"; public static final B13AFilingOptionType FEDEX_TO_STAMP = new B13AFilingOptionType(_FEDEX_TO_STAMP); public static final B13AFilingOptionType FILED_ELECTRONICALLY = new B13AFilingOptionType(_FILED_ELECTRONICALLY); public static final B13AFilingOptionType MANUALLY_ATTACHED = new B13AFilingOptionType(_MANUALLY_ATTACHED); public static final B13AFilingOptionType NOT_REQUIRED = new B13AFilingOptionType(_NOT_REQUIRED); public static final B13AFilingOptionType SUMMARY_REPORTING = new B13AFilingOptionType(_SUMMARY_REPORTING); public java.lang.String getValue() { return _value_;} public static B13AFilingOptionType fromValue(java.lang.String value) throws java.lang.IllegalArgumentException { B13AFilingOptionType enumeration = (B13AFilingOptionType) _table_.get(value); if (enumeration==null) throw new java.lang.IllegalArgumentException(); return enumeration; } public static B13AFilingOptionType fromString(java.lang.String value) throws java.lang.IllegalArgumentException { return fromValue(value); } public boolean equals(java.lang.Object obj) {return (obj == this);} public int hashCode() { return toString().hashCode();} public java.lang.String toString() { return _value_;} public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumSerializer( _javaType, _xmlType); } public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.EnumDeserializer( _javaType, _xmlType); } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(B13AFilingOptionType.class); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://fedex.com/ws/rate/v22", "B13AFilingOptionType")); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } }
[ "lmywilks@hotmail.com" ]
lmywilks@hotmail.com
38cd250d865150b2ebdacd2b88c19262c39468c5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_50c501127e82245664d3837c395c40448a5bc507/InvariantLhsGivenTargetPhraseFeature/15_50c501127e82245664d3837c395c40448a5bc507_InvariantLhsGivenTargetPhraseFeature_t.java
7bb45a7f9ad9bed3e8d9c8c5bdb918ceba2e8e60
[]
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
5,527
java
package edu.jhu.thrax.hadoop.features.mapred; import java.io.IOException; import org.apache.hadoop.io.DoubleWritable; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparator; import org.apache.hadoop.mapreduce.Mapper; import org.apache.hadoop.mapreduce.Partitioner; import org.apache.hadoop.mapreduce.Reducer; import edu.jhu.thrax.hadoop.comparators.TextFieldComparator; import edu.jhu.thrax.hadoop.comparators.TextMarginalComparator; import edu.jhu.thrax.hadoop.datatypes.RuleWritable; import edu.jhu.thrax.util.FormatUtils; public class InvariantLhsGivenTargetPhraseFeature extends MapReduceFeature { public String getName() { return "lhs_given_e_inv"; } public Class<? extends WritableComparator> sortComparatorClass() { return Comparator.class; } public Class<? extends Partitioner<RuleWritable, Writable>> partitionerClass() { return RuleWritable.TargetPartitioner.class; } public Class<? extends Mapper<RuleWritable, IntWritable, RuleWritable, IntWritable>> mapperClass() { return Map.class; } public Class<? extends Reducer<RuleWritable, IntWritable, RuleWritable, NullWritable>> reducerClass() { return Reduce.class; } private static class Map extends Mapper<RuleWritable, IntWritable, RuleWritable, IntWritable> { protected void map(RuleWritable key, IntWritable value, Context context) throws IOException, InterruptedException { RuleWritable target_marginal = new RuleWritable(key); RuleWritable lhs_target_marginal = new RuleWritable(key); RuleWritable modified_key = new RuleWritable(key); String zeroed = FormatUtils.zeroNonterminalIndices(key.target.toString()); boolean monotonic = FormatUtils.isMonotonic(key.target.toString()); target_marginal.target.set(zeroed); target_marginal.source.set(TextMarginalComparator.MARGINAL); target_marginal.lhs.set(TextMarginalComparator.MARGINAL); lhs_target_marginal.target.set(zeroed); lhs_target_marginal.source.set(TextMarginalComparator.MARGINAL); modified_key.target.set(zeroed); context.write(modified_key, new IntWritable(monotonic ? 1 : 2)); context.write(lhs_target_marginal, value); context.write(target_marginal, value); } } private static class Reduce extends Reducer<RuleWritable, IntWritable, RuleWritable, NullWritable> { private int marginal; private double prob; private static final Text NAME = new Text("p(LHS|e_inv)"); protected void reduce(RuleWritable key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException { if (key.lhs.equals(TextMarginalComparator.MARGINAL)) { // We only get here if it is the very first time we saw the source. marginal = 0; for (IntWritable x : values) marginal += x.get(); return; } // Control only gets here if we are using the same marginal. if (key.source.equals(TextMarginalComparator.MARGINAL)) { // We only get in here if it's a new LHS. int count = 0; for (IntWritable x : values) { count += x.get(); } prob = -Math.log(count / (double) marginal); return; } key.featureLabel.set(NAME); key.featureScore.set(prob); for (IntWritable x : values) { int signal = x.get(); if (signal == 1 || signal == 3) { key.target.set((FormatUtils.applyIndices(key.target.toString(), true))); context.write(key, NullWritable.get()); } if (signal == 2 || signal == 3) { key.target.set((FormatUtils.applyIndices(key.target.toString(), false))); context.write(key, NullWritable.get()); } } } } public static class Comparator extends WritableComparator { private static final Text.Comparator TEXT_COMPARATOR = new Text.Comparator(); private static final TextMarginalComparator MARGINAL_COMPARATOR = new TextMarginalComparator(); private static final TextFieldComparator LHS_COMPARATOR = new TextFieldComparator(0, MARGINAL_COMPARATOR); private static final TextFieldComparator SOURCE_COMPARATOR = new TextFieldComparator(1, MARGINAL_COMPARATOR); private static final TextFieldComparator TARGET_COMPARATOR = new TextFieldComparator(2, TEXT_COMPARATOR); public Comparator() { super(RuleWritable.class); } public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { try { int cmp = TARGET_COMPARATOR.compare(b1, s1, l1, b2, s2, l2); if (cmp != 0) { return cmp; } cmp = LHS_COMPARATOR.compare(b1, s1, l1, b2, s2, l2); if (cmp != 0) { return cmp; } return SOURCE_COMPARATOR.compare(b1, s1, l1, b2, s2, l2); } catch (IOException ex) { throw new IllegalArgumentException(ex); } } } private static final DoubleWritable ZERO = new DoubleWritable(0.0); public void unaryGlueRuleScore(Text nt, java.util.Map<Text, Writable> map) { map.put(Reduce.NAME, ZERO); } public void binaryGlueRuleScore(Text nt, java.util.Map<Text, Writable> map) { map.put(Reduce.NAME, ZERO); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
980f62c2de64b9c1a3585bfa69aa3b4642e74d72
1c53d5257ea7be9450919e6b9e0491944a93ba80
/merge-scenarios/MPAndroidChart/bc7ce8d0-MPChartLib-src-com-github-mikephil-charting-data-BarDataSet/expected.java
e03e076ffe6cda491a3b83065835f93e8995bc4c
[]
no_license
anonyFVer/mastery-material
89062928807a1f859e9e8b9a113b2d2d123dc3f1
db76ee571b84be5db2d245f3b593b29ebfaaf458
refs/heads/master
2023-03-16T13:13:49.798374
2021-02-26T04:19:19
2021-02-26T04:19:19
342,556,129
0
0
null
null
null
null
UTF-8
Java
false
false
4,946
java
package com.github.mikephil.charting.data; import android.graphics.Color; import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; import java.util.ArrayList; import java.util.List; public class BarDataSet extends BarLineScatterCandleBubbleDataSet<BarEntry> implements IBarDataSet { private float mBarSpace = 0.15f; private int mStackSize = 1; private int mBarShadowColor = Color.rgb(215, 215, 215); private float mBarBorderWidth = 0.0f; private int mBarBorderColor = Color.BLACK; private int mHighLightAlpha = 120; private int mEntryCountStacks = 0; private String[] mStackLabels = new String[] { "Stack" }; public BarDataSet(List<BarEntry> yVals, String label) { super(yVals, label); mHighLightColor = Color.rgb(0, 0, 0); calcStackSize(yVals); calcEntryCountIncludingStacks(yVals); } @Override public DataSet<BarEntry> copy() { List<BarEntry> yVals = new ArrayList<BarEntry>(); for (int i = 0; i < mValues.size(); i++) { yVals.add(((BarEntry) mValues.get(i)).copy()); } BarDataSet copied = new BarDataSet(yVals, getLabel()); copied.mColors = mColors; copied.mStackSize = mStackSize; copied.mBarSpace = mBarSpace; copied.mBarShadowColor = mBarShadowColor; copied.mStackLabels = mStackLabels; copied.mHighLightColor = mHighLightColor; copied.mHighLightAlpha = mHighLightAlpha; return copied; } private void calcEntryCountIncludingStacks(List<BarEntry> yVals) { mEntryCountStacks = 0; for (int i = 0; i < yVals.size(); i++) { float[] vals = yVals.get(i).getVals(); if (vals == null) mEntryCountStacks++; else mEntryCountStacks += vals.length; } } private void calcStackSize(List<BarEntry> yVals) { for (int i = 0; i < yVals.size(); i++) { float[] vals = yVals.get(i).getVals(); if (vals != null && vals.length > mStackSize) mStackSize = vals.length; } } @Override public void calcMinMax(int start, int end) { if (mValues == null) return; final int yValCount = mValues.size(); if (yValCount == 0) return; int endValue; if (end == 0 || end >= yValCount) endValue = yValCount - 1; else endValue = end; mYMin = Float.MAX_VALUE; mYMax = -Float.MAX_VALUE; mXMin = Float.MAX_VALUE; mXMax = -Float.MAX_VALUE; for (int i = start; i <= endValue; i++) { BarEntry e = mValues.get(i); if (e != null && !Float.isNaN(e.getVal())) { if (e.getVals() == null) { if (e.getVal() < mYMin) mYMin = e.getVal(); if (e.getVal() > mYMax) mYMax = e.getVal(); } else { if (-e.getNegativeSum() < mYMin) mYMin = -e.getNegativeSum(); if (e.getPositiveSum() > mYMax) mYMax = e.getPositiveSum(); } if (e.getXIndex() < mXMin) mXMin = e.getXIndex(); if (e.getXIndex() > mXMax) mXMax = e.getXIndex(); } } if (mYMin == Float.MAX_VALUE) { mYMin = 0.f; mYMax = 0.f; } } @Override public int getStackSize() { return mStackSize; } @Override public boolean isStacked() { return mStackSize > 1 ? true : false; } public int getEntryCountStacks() { return mEntryCountStacks; } public float getBarSpacePercent() { return mBarSpace * 100f; } @Override public float getBarSpace() { return mBarSpace; } public void setBarSpacePercent(float percent) { mBarSpace = percent / 100f; } public void setBarShadowColor(int color) { mBarShadowColor = color; } @Override public int getBarShadowColor() { return mBarShadowColor; } public void setBarBorderWidth(float width) { mBarBorderWidth = width; } @Override public float getBarBorderWidth() { return mBarBorderWidth; } public void setBarBorderColor(int color) { mBarBorderColor = color; } @Override public int getBarBorderColor() { return mBarBorderColor; } public void setHighLightAlpha(int alpha) { mHighLightAlpha = alpha; } @Override public int getHighLightAlpha() { return mHighLightAlpha; } public void setStackLabels(String[] labels) { mStackLabels = labels; } @Override public String[] getStackLabels() { return mStackLabels; } }
[ "namasikanam@gmail.com" ]
namasikanam@gmail.com
879b2b54fe8c122e7f5db3e8c4e2a624f986c96b
d4a894f065c3a31746b25bcdb03fc44aba96b397
/src/com/javacore/chapter21/ex6/ShowFile.java
698ec119c3e6286a3546d160a7a682832308eb21
[]
no_license
taorusb/JavaCore
4db648b6373d037176d0cc7dfb471541947719da
769d391ebdf3e36f8e580a3aa3c0c30dd98670b0
refs/heads/main
2023-03-06T11:05:28.712215
2021-02-17T15:51:05
2021-02-17T15:51:05
331,033,933
0
0
null
null
null
null
UTF-8
Java
false
false
1,729
java
package com.javacore.chapter21.ex6; import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; /* Эта программа выводит текстовой файл, используя код потокового ввода-вывода на основе системы NIO. Требуется установка JDK, начиная с 7 версии Чтобы воспользоваться этой программой, укажите имя файла, который требуется посмотреть. Например, чтобы посмотреть файл TEST.TXT, введите в режиме командной строки следующую команду: java ShowFile TEST.TXT */ public class ShowFile { public static void main(String[] args) { int i; // сначала удостовериться, что указанно имя файла if (args.length != 1) { System.out.println("Применение: ShowFile имя_файла"); return; } // открыть файл и получить связанный с ним поток ввода-вывода try (InputStream fin = Files.newInputStream(Path.of(args[0]))){ do { i = fin.read(); if (i != -1) System.out.println((char) i); } while (i != -1); } catch (InvalidPathException e) { System.out.println("Ошибка указания пути " + e); } catch (IOException e) { System.out.println("Ошибка ввода-вывода " + e); } } }
[ "taorus@inbox.ru" ]
taorus@inbox.ru
2c0e43ede22994a7feab71298ab254725bdf7bbf
9f8bda0c1e7d1176e9600030b089d5c45e7ccafc
/src/main/java/com/zsw/demo/serializer/protostuff/ProtostuffEncoder.java
6e629c0669a694c0ad18701eeb4f9dc23abc8065
[ "Apache-2.0" ]
permissive
MasterOogwayis/java-io
60d50ccaf6152b042fe742720330f970edbbf4d1
30f42eee6ba2f59d9717f46994f97fa262e6acc2
refs/heads/master
2022-06-18T18:00:32.954437
2019-10-21T06:58:15
2019-10-21T06:58:15
191,671,242
0
0
Apache-2.0
2022-05-20T21:10:01
2019-06-13T01:48:27
Java
UTF-8
Java
false
false
508
java
package com.zsw.demo.serializer.protostuff; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToByteEncoder; /** * @author ZhangShaowei on 2019/9/26 15:14 **/ public class ProtostuffEncoder extends MessageToByteEncoder<Object> { @Override protected void encode(ChannelHandlerContext ctx, Object msg, ByteBuf out) throws Exception { byte[] data = ProtostuffSerializer.serialize(msg); out.writeBytes(data); } }
[ "499504777@qq.com" ]
499504777@qq.com
98c94451970d35b676fd20197c093b7ea10ff9fb
79595075622ded0bf43023f716389f61d8e96e94
/app/src/main/java/android/content/CursorEntityIterator.java
bad58327c7a3587e7bc02f67bb28632f94b128e1
[]
no_license
dstmath/OppoR15
96f1f7bb4d9cfad47609316debc55095edcd6b56
b9a4da845af251213d7b4c1b35db3e2415290c96
refs/heads/master
2020-03-24T16:52:14.198588
2019-05-27T02:24:53
2019-05-27T02:24:53
142,840,716
7
4
null
null
null
null
UTF-8
Java
false
false
1,785
java
package android.content; import android.database.Cursor; import android.os.RemoteException; public abstract class CursorEntityIterator implements EntityIterator { private final Cursor mCursor; private boolean mIsClosed = false; public abstract Entity getEntityAndIncrementCursor(Cursor cursor) throws RemoteException; public CursorEntityIterator(Cursor cursor) { this.mCursor = cursor; this.mCursor.moveToFirst(); } public final boolean hasNext() { if (!this.mIsClosed) { return this.mCursor.isAfterLast() ^ 1; } throw new IllegalStateException("calling hasNext() when the iterator is closed"); } public Entity next() { if (this.mIsClosed) { throw new IllegalStateException("calling next() when the iterator is closed"); } else if (hasNext()) { try { return getEntityAndIncrementCursor(this.mCursor); } catch (RemoteException e) { throw new RuntimeException("caught a remote exception, this process will die soon", e); } } else { throw new IllegalStateException("you may only call next() if hasNext() is true"); } } public void remove() { throw new UnsupportedOperationException("remove not supported by EntityIterators"); } public final void reset() { if (this.mIsClosed) { throw new IllegalStateException("calling reset() when the iterator is closed"); } this.mCursor.moveToFirst(); } public final void close() { if (this.mIsClosed) { throw new IllegalStateException("closing when already closed"); } this.mIsClosed = true; this.mCursor.close(); } }
[ "toor@debian.toor" ]
toor@debian.toor
f394602018955019e6da36bc4aa1399dd68878bb
4c9d35da30abf3ec157e6bad03637ebea626da3f
/eclipse/src/org/ripple/power/ui/RPLabel.java
a373cd0ff1747da3f722ade7851873e823ee1685
[ "Apache-2.0" ]
permissive
youweixue/RipplePower
9e6029b94a057e7109db5b0df3b9fd89c302f743
61c0422fa50c79533e9d6486386a517565cd46d2
refs/heads/master
2020-04-06T04:40:53.955070
2015-04-02T12:22:30
2015-04-02T12:22:30
33,860,735
0
0
null
2015-04-13T09:52:14
2015-04-13T09:52:11
null
UTF-8
Java
false
false
521
java
package org.ripple.power.ui; import javax.swing.ImageIcon; import javax.swing.JLabel; import org.ripple.power.ui.graphics.LColor; public class RPLabel extends JLabel{ /** * */ private static final long serialVersionUID = 1L; public RPLabel(String name){ super(name); setBackground(new LColor(70, 70, 70)); setForeground(LColor.white); } public RPLabel(ImageIcon icon){ super(icon); setBackground(new LColor(70, 70, 70)); setForeground(LColor.white); } public RPLabel(){ this(""); } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
a0c51c20b90f2875925456631b42bfee44c9669a
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.updater-OSUpdater/sources/com/fasterxml/jackson/core/base/ParserMinimalBase.java
2111eafe457bde8c333acc1733d9a68ed9418302
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
5,279
java
package com.fasterxml.jackson.core.base; import com.fasterxml.jackson.core.Base64Variant; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.core.io.NumberInput; import com.fasterxml.jackson.core.util.ByteArrayBuilder; import com.fasterxml.jackson.core.util.VersionUtil; import java.io.IOException; public abstract class ParserMinimalBase extends JsonParser { protected JsonToken _currToken; /* access modifiers changed from: protected */ public abstract void _handleEOF() throws JsonParseException; @Override // com.fasterxml.jackson.core.JsonParser public abstract String getText() throws IOException, JsonParseException; @Override // com.fasterxml.jackson.core.JsonParser public abstract JsonToken nextToken() throws IOException, JsonParseException; protected ParserMinimalBase() { } protected ParserMinimalBase(int i) { super(i); } @Override // com.fasterxml.jackson.core.Versioned public Version version() { return VersionUtil.versionFor(getClass()); } @Override // com.fasterxml.jackson.core.JsonParser public JsonToken getCurrentToken() { return this._currToken; } @Override // com.fasterxml.jackson.core.JsonParser public boolean hasCurrentToken() { return this._currToken != null; } @Override // com.fasterxml.jackson.core.JsonParser public JsonToken nextValue() throws IOException, JsonParseException { JsonToken nextToken = nextToken(); return nextToken == JsonToken.FIELD_NAME ? nextToken() : nextToken; } @Override // com.fasterxml.jackson.core.JsonParser public JsonParser skipChildren() throws IOException, JsonParseException { if (this._currToken != JsonToken.START_OBJECT && this._currToken != JsonToken.START_ARRAY) { return this; } int i = 1; while (true) { JsonToken nextToken = nextToken(); if (nextToken == null) { _handleEOF(); return this; } int i2 = AnonymousClass1.$SwitchMap$com$fasterxml$jackson$core$JsonToken[nextToken.ordinal()]; if (i2 == 1 || i2 == 2) { i++; } else if ((i2 == 3 || i2 == 4) && i - 1 == 0) { return this; } } } @Override // com.fasterxml.jackson.core.JsonParser public int getValueAsInt(int i) throws IOException, JsonParseException { if (this._currToken == null) { return i; } switch (this._currToken) { case VALUE_NUMBER_INT: case VALUE_NUMBER_FLOAT: return getIntValue(); case VALUE_TRUE: return 1; case VALUE_FALSE: case VALUE_NULL: return 0; case VALUE_EMBEDDED_OBJECT: Object embeddedObject = getEmbeddedObject(); return embeddedObject instanceof Number ? ((Number) embeddedObject).intValue() : i; case VALUE_STRING: return NumberInput.parseAsInt(getText(), i); default: return i; } } @Override // com.fasterxml.jackson.core.JsonParser public long getValueAsLong(long j) throws IOException, JsonParseException { if (this._currToken == null) { return j; } switch (this._currToken) { case VALUE_NUMBER_INT: case VALUE_NUMBER_FLOAT: return getLongValue(); case VALUE_TRUE: return 1; case VALUE_FALSE: case VALUE_NULL: return 0; case VALUE_EMBEDDED_OBJECT: Object embeddedObject = getEmbeddedObject(); return embeddedObject instanceof Number ? ((Number) embeddedObject).longValue() : j; case VALUE_STRING: return NumberInput.parseAsLong(getText(), j); default: return j; } } @Override // com.fasterxml.jackson.core.JsonParser public String getValueAsString(String str) throws IOException, JsonParseException { JsonToken jsonToken; if (this._currToken == JsonToken.VALUE_STRING || ((jsonToken = this._currToken) != null && jsonToken != JsonToken.VALUE_NULL && this._currToken.isScalarValue())) { return getText(); } return str; } /* access modifiers changed from: protected */ public void _decodeBase64(String str, ByteArrayBuilder byteArrayBuilder, Base64Variant base64Variant) throws IOException, JsonParseException { try { base64Variant.decode(str, byteArrayBuilder); } catch (IllegalArgumentException e) { _reportError(e.getMessage()); } } /* access modifiers changed from: protected */ public final void _reportError(String str) throws JsonParseException { throw _constructError(str); } /* access modifiers changed from: protected */ public final void _throwInternal() { VersionUtil.throwInternal(); } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
e24046d49ff48c6841981426eaa5aeffc322f4ce
f71a9af6f6e6c5eb0022eef9e6ef6553a82443fd
/sdk/src/main/java/com/sdf/sdk/widgets/WaitPorgressDialog.java
74acdaefa02c4cbc454fb0fbec3d0bbdb803b654
[]
no_license
Emmptee/Daily
96466440ff9639944bb1adef957d4ecc65788b5b
f213c704ed01c334608fd0adc61b995ac159c3e7
refs/heads/master
2020-03-24T16:15:11.307118
2018-08-08T09:12:43
2018-08-08T09:12:43
142,817,995
0
0
null
null
null
null
UTF-8
Java
false
false
456
java
package com.sdf.sdk.widgets; import android.app.ProgressDialog; import android.content.Context; /** * Created by Horrarndoo on 2017/4/17. * <p> * 等待提示dialog */ public class WaitPorgressDialog extends ProgressDialog { public WaitPorgressDialog(Context context) { this(context, 0); } public WaitPorgressDialog(Context context, int theme) { super(context, theme); setCanceledOnTouchOutside(false); } }
[ "dds.c@163.com" ]
dds.c@163.com
01789e1498a3ee45b638cee8032fd767d3ae9289
31f4cab278d83a755f1e434f35273223b049d172
/repositories/jackrabbit-oak/oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/ArrayUtilsTest.java
d886d2eada4fad6c627bf95adef27bf177dbbe93
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference" ]
permissive
JenniferJohnson89/bugs_dot_jar_dissection
2a017f5f77772ddb2b9a5e45423ae084fa1bd7a0
7012cccce9a3fdbfc97a0ca507420c24650f6bcf
refs/heads/main
2022-12-28T16:38:18.039203
2020-10-20T09:45:47
2020-10-20T09:45:47
305,639,612
0
1
null
null
null
null
UTF-8
Java
false
false
3,770
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.jackrabbit.oak.commons; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; /** * Tests the ArrayUtils class */ public class ArrayUtilsTest { @Test public void insertInt() { int[] x = {10, 20}; int[] y = ArrayUtils.arrayInsert(x, 1, 15); assertFalse(x == y); assertEquals(3, y.length); assertEquals(10, y[0]); assertEquals(15, y[1]); assertEquals(20, y[2]); } @Test public void insertLong() { long[] x = {10, 20}; long[] y = ArrayUtils.arrayInsert(x, 1, 15); assertFalse(x == y); assertEquals(3, y.length); assertEquals(10, y[0]); assertEquals(15, y[1]); assertEquals(20, y[2]); } @Test public void insertObject() { Long[] x = {10L, 20L}; Long[] y = ArrayUtils.arrayInsert(x, 1, 15L); assertFalse(x == y); assertEquals(3, y.length); assertEquals(Long.valueOf(10), y[0]); assertEquals(Long.valueOf(15), y[1]); assertEquals(Long.valueOf(20), y[2]); } @Test public void insertString() { String[] x = {"10", "20"}; String[] y = ArrayUtils.arrayInsert(x, 1, "15"); assertFalse(x == y); assertEquals(3, y.length); assertEquals("10", y[0]); assertEquals("15", y[1]); assertEquals("20", y[2]); } @Test public void removeInt() { int[] x = {10, 20}; int[] y = ArrayUtils.arrayRemove(x, 1); assertFalse(x == y); assertEquals(1, y.length); assertEquals(10, y[0]); y = ArrayUtils.arrayRemove(y, 0); assertEquals(0, y.length); } @Test public void removeLong() { long[] x = {10, 20}; long[] y = ArrayUtils.arrayRemove(x, 1); assertFalse(x == y); assertEquals(1, y.length); assertEquals(10, y[0]); y = ArrayUtils.arrayRemove(y, 0); assertEquals(0, y.length); } @Test public void removeObject() { Long[] x = {10L, 20L}; Long[] y = ArrayUtils.arrayRemove(x, 1); assertFalse(x == y); assertEquals(1, y.length); assertEquals(Long.valueOf(10), y[0]); y = ArrayUtils.arrayRemove(y, 0); assertEquals(0, y.length); } @Test public void removeString() { String[] x = {"10", "20"}; String[] y = ArrayUtils.arrayRemove(x, 1); assertFalse(x == y); assertEquals(1, y.length); assertEquals("10", y[0]); y = ArrayUtils.arrayRemove(y, 0); assertEquals(0, y.length); } @Test public void replaceObject() { Long[] x = {10L, 20L}; Long[] y = ArrayUtils.arrayReplace(x, 1, 11L); assertFalse(x == y); assertEquals(2, y.length); assertEquals(Long.valueOf(10), y[0]); assertEquals(Long.valueOf(11), y[1]); } }
[ "JenniferJonhnson89@163.com" ]
JenniferJonhnson89@163.com
7badd9cdfc992c0417808e45edb9e2662f7b8e4a
82b3237fb7dc5abaf282242477a0bb15ba36975e
/src/main/java/org/drip/graph/asymptote/BinomialHeapTimeComplexity.java
64877e65c89558e81bf03344c437975c53518d54
[ "Apache-2.0" ]
permissive
chengjon/DROP
6d7cbf5fa066d33203e4d9a7dc0c90c9eea1f246
0909c1da1297cc1baac6ea135946afe5b214e47a
refs/heads/master
2023-03-15T07:53:34.940497
2021-03-02T04:36:42
2021-03-02T04:36:42
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
8,062
java
package org.drip.graph.asymptote; /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! * Copyright (C) 2020 Lakshmi Krishnamurthy * * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics, * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment * analytics, and portfolio construction analytics within and across fixed income, credit, commodity, * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support, * numerical analysis, numerical optimization, spline builder, model validation, statistical learning, * and computational support. * * https://lakshmidrip.github.io/DROP/ * * DROP is composed of three modules: * * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/ * * DROP Product Core implements libraries for the following: * - Fixed Income Analytics * - Loan Analytics * - Transaction Cost Analytics * * DROP Portfolio Core implements libraries for the following: * - Asset Allocation Analytics * - Asset Liability Management Analytics * - Capital Estimation Analytics * - Exposure Analytics * - Margin Analytics * - XVA Analytics * * DROP Computational Core implements libraries for the following: * - Algorithm Support * - Computation Support * - Function Analysis * - Model Validation * - Numerical Analysis * - Numerical Optimizer * - Spline Builder * - Statistical Learning * * Documentation for DROP is Spread Over: * * - Main => https://lakshmidrip.github.io/DROP/ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki * - GitHub => https://github.com/lakshmiDRIP/DROP * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal * - Release Versions => https://lakshmidrip.github.io/DROP/version.html * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues * - JUnit => https://lakshmidrip.github.io/DROP/junit/index.html * - Jacoco => https://lakshmidrip.github.io/DROP/jacoco/index.html * * 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. */ /** * <i>BinomialHeapTimeComplexity</i> maintains the Asymptotic Behavior Specifications of a Binomial Heap's * Operations. The References are: * * <br><br> * <ul> * <li> * Brodal, G. S. (1996): Priority Queue on Parallel Machines <i>Scandinavian Workshop on Algorithm * Theory – SWAT ’96</i> 416-427 * </li> * <li> * Cormen, T., C. E. Leiserson, R. Rivest, and C. Stein (2009): <i>Introduction to Algorithms * 3<sup>rd</sup> Edition</i> <b>MIT Press</b> * </li> * <li> * Sanders, P., K. Mehlhorn, M. Dietzfelbinger, and R. Dementiev (2019): <i>Sequential and Parallel * Algorithms and Data Structures – A Basic Toolbox</i> <b>Springer</b> * </li> * <li> * Sundell, H., and P. Tsigas (2005): Fast and Lock-free Concurrent Priority Queues for * Multi-threaded Systems <i>Journal of Parallel and Distributed Computing</i> <b>65 (5)</b> * 609-627 * </li> * <li> * Wikipedia (2020): Priority Queue https://en.wikipedia.org/wiki/Priority_queue * </li> * </ul> * * <br><br> * <ul> * <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li> * <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/GraphAlgorithmLibrary.md">Graph Algorithm Library</a></li> * <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/graph/README.md">Graph Optimization and Tree Construction Algorithms</a></li> * <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/graph/asymptote/README.md">Big O Algorithm Asymptotic Analysis</a></li> * </ul> * <br><br> * * @author Lakshmi Krishnamurthy */ public class BinomialHeapTimeComplexity extends org.drip.graph.asymptote.AlgorithmTimeComplexity { /** * Build the Algorithm Time Complexity for a Binomial Heap * * @return The Algorithm Time Complexity for a Binomial Heap */ public static final BinomialHeapTimeComplexity Standard() { org.drip.graph.asymptote.BinomialHeapTimeComplexity binomialHeapTimeComplexity = new org.drip.graph.asymptote.BinomialHeapTimeComplexity(); try { if (!binomialHeapTimeComplexity.addOperationTimeComplexity ( "find-min", new org.drip.graph.asymptote.OperationTimeComplexity ( null, org.drip.graph.asymptote.BigOAsymptoteSpec.Unamortized ( org.drip.graph.asymptote.AlgorithmTimeComplexity.ConstantTime(), org.drip.graph.asymptote.BigOAsymptoteType.BIG_THETA, org.drip.graph.asymptote.BigOAsymptoteForm.CONSTANT ), null, null ) ) ) { return null; } if (!binomialHeapTimeComplexity.addOperationTimeComplexity ( "delete-min", new org.drip.graph.asymptote.OperationTimeComplexity ( null, org.drip.graph.asymptote.BigOAsymptoteSpec.Unamortized ( org.drip.graph.asymptote.AlgorithmTimeComplexity.LogarithmicTime(), org.drip.graph.asymptote.BigOAsymptoteType.BIG_THETA, org.drip.graph.asymptote.BigOAsymptoteForm.LOG_N ), null, null ) ) ) { return null; } if (!binomialHeapTimeComplexity.addOperationTimeComplexity ( "insert", new org.drip.graph.asymptote.OperationTimeComplexity ( null, org.drip.graph.asymptote.BigOAsymptoteSpec.Amortized ( org.drip.graph.asymptote.AlgorithmTimeComplexity.ConstantTime(), org.drip.graph.asymptote.BigOAsymptoteType.BIG_THETA, org.drip.graph.asymptote.BigOAsymptoteForm.CONSTANT ), null, null ) ) ) { return null; } if (!binomialHeapTimeComplexity.addOperationTimeComplexity ( "decrease-key", new org.drip.graph.asymptote.OperationTimeComplexity ( null, org.drip.graph.asymptote.BigOAsymptoteSpec.Unamortized ( org.drip.graph.asymptote.AlgorithmTimeComplexity.LogarithmicTime(), org.drip.graph.asymptote.BigOAsymptoteType.BIG_THETA, org.drip.graph.asymptote.BigOAsymptoteForm.LOG_N ), null, null ) ) ) { return null; } if (!binomialHeapTimeComplexity.addOperationTimeComplexity ( "meld", new org.drip.graph.asymptote.OperationTimeComplexity ( org.drip.graph.asymptote.BigOAsymptoteSpec.Unamortized ( org.drip.graph.asymptote.AlgorithmTimeComplexity.LogarithmicTime(), org.drip.graph.asymptote.BigOAsymptoteType.BIG_O, org.drip.graph.asymptote.BigOAsymptoteForm.LOG_N ), null, null, null ) ) ) { return null; } return binomialHeapTimeComplexity; } catch (java.lang.Exception e) { e.printStackTrace(); } return null; } }
[ "lakshmimv7977@gmail.com" ]
lakshmimv7977@gmail.com
8137e1f3491020a60963ece5454ab17d722472aa
e21d17cdcd99c5d53300a7295ebb41e0f876bbcb
/22_Chapters_Edition/src/main/resources/ExampleCodes/strings/Rudolph.java
55db08245b301f1f2261e85be59bc1001b779028
[]
no_license
lypgod/Thinking_In_Java_4th_Edition
dc42a377de28ae51de2c4000a860cd3bc93d0620
5dae477f1a44b15b9aa4944ecae2175bd5d8c10e
refs/heads/master
2020-04-05T17:39:55.720961
2018-11-11T12:07:56
2018-11-11T12:08:26
157,070,646
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package ExampleCodes.strings;//: strings/Rudolph.java public class Rudolph { public static void main(String[] args) { for(String pattern : new String[]{ "Rudolph", "[rR]udolph", "[rR][aeiou][a-z]ol.*", "R.*" }) System.out.println("Rudolph".matches(pattern)); } } /* Output: true true true true *///:~
[ "lypgod@hotmail.com" ]
lypgod@hotmail.com
de5248067d0ffb8079bcb9752a2336fce73cec5b
6635387159b685ab34f9c927b878734bd6040e7e
/src/boz.java
8f5266abfc053879f434db36f565305c97f6fecc
[]
no_license
RepoForks/com.snapchat.android
987dd3d4a72c2f43bc52f5dea9d55bfb190966e2
6e28a32ad495cf14f87e512dd0be700f5186b4c6
refs/heads/master
2021-05-05T10:36:16.396377
2015-07-16T16:46:26
2015-07-16T16:46:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
public abstract interface boz { public abstract bok a(cax paramcax, boolean paramBoolean); public abstract bol a(caw paramcaw, boolean paramBoolean); } /* Location: * Qualified Name: boz * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
fcf3b2f642bd9d0fa9369fce56ff9cf0e624c7c3
a67000deb8efbe45304c6071bba5182fff747d56
/src/f_cadenasCaracteres/a_cadenas.java
41e66c555ff99b566a3d57deb591a8c61495a8bc
[]
no_license
jorgelfant/javaCourse
c406dce78f3ce1ca4c52eb194cec04830e1ffe2f
493707bc3f3728e92ae73f264afaed8895a377a1
refs/heads/master
2022-12-06T05:59:08.671126
2020-09-07T17:48:16
2020-09-07T17:48:16
254,644,862
0
0
null
null
null
null
UTF-8
Java
false
false
761
java
package f_cadenasCaracteres; public class a_cadenas { public static void main(String[] args) { String hola = "Hola jorge"; String hola2 = " que tal"; String num = "15"; int numero = 15; System.out.println(hola.length());//da 10 System.out.println(hola.substring(0, 6));//da hola j 0<6 no abarca el 6 sino hasta el 5 System.out.println(hola.concat(hola2));//concatena una frase a otra System.out.println(hola.charAt(0));//leta del string System.out.println(Integer.parseInt(num) + 5);//convierte string a int System.out.println(String.valueOf(numero));//convierte int a string System.out.println(String.valueOf(hola.toUpperCase()));//up System.out.println(String.valueOf(hola.toLowerCase()));//low } }
[ "jorgel_fant@yahoo.com" ]
jorgel_fant@yahoo.com
1838e8f1710f668067ac28dc738b5163131fed02
df5d6a911400cbc26a990349891310f2ee118ef1
/smoothcsv-commons/src/main/java/com/smoothcsv/commons/utils/ArrayUtils.java
6be2db71764683832a2a39402d226adc00d184ee
[ "Apache-2.0" ]
permissive
k-hatano/smoothcsv
8df0eb4a9d66e24e08b547f5aa20d6cbb2b8254c
ab37ddd2c9f45d05872c8bf1d43ff49e3de2c18a
refs/heads/master
2022-05-22T17:35:16.465561
2020-06-06T01:28:18
2020-06-06T01:39:45
204,708,583
1
0
null
2019-08-27T22:24:14
2019-08-27T13:24:13
null
UTF-8
Java
false
false
5,133
java
/* * Copyright 2016 kohii * * 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.smoothcsv.commons.utils; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Function; import com.smoothcsv.commons.functions.IntRangeConsumer; public class ArrayUtils { public static String[] EMPTY_STRING_ARRAY = new String[0]; /** * [1,3,4,5,7,8,10] -> [1],[3-5],[7-8],[10] * * @param consumer * @param array */ public static void processIntArrayAsBlock(IntRangeConsumer consumer, int[] array) { processIntArrayAsBlock(consumer, array, false); } /** * [1,3,4,5,7,8,10] -> [10],[7-8],[3-5],[1] * * @param consumer * @param array * @param reverse */ public static void processIntArrayAsBlock(IntRangeConsumer consumer, int[] array, boolean reverse) { if (array.length == 0) { return; } int tmp = -100; int bef = -100; int prev = array.length; if (!reverse) { for (int i = 0; i < prev; i++) { int j = array[i]; if (tmp == -100) { tmp = j; } else if (bef + 1 != j) { consumer.accept(tmp, bef); tmp = j; } bef = j; } consumer.accept(tmp, bef); } else { for (int i = prev - 1; 0 <= i; i--) { int j = array[i]; if (tmp == -100) { tmp = j; } else if (bef - 1 != j) { consumer.accept(bef, tmp); tmp = j; } bef = j; } consumer.accept(bef, tmp); } } @SuppressWarnings("unchecked") public static <T, R> R[] map(T[] array, Function<T, R> function) { Object[] newArray = new Object[array.length]; for (int i = 0; i < array.length; i++) { newArray[i] = function.apply(array[i]); } return (R[]) newArray; } public static <T> boolean contains(T[] array, T obj) { for (T t : array) { if (obj == null) { if (t == null) { return true; } } else { if (obj.equals(t)) { return true; } } } return false; } public static boolean containsIgnoreCase(String[] array, String obj) { for (String s : array) { if (obj == null) { if (s == null) { return true; } } else { if (obj.equalsIgnoreCase(s)) { return true; } } } return false; } public static <T> boolean notContains(T[] array, T obj) { for (T t : array) { if (obj == null) { if (t == null) { return false; } } else { if (obj.equals(t)) { return false; } } } return true; } public static boolean notContainsIgnoreCase(String[] array, String obj) { for (String s : array) { if (obj == null) { if (s == null) { return false; } } else { if (obj.equalsIgnoreCase(s)) { return false; } } } return true; } public static boolean contains(char[] array, char c) { for (char c2 : array) { if (c == c2) { return true; } } return false; } public static boolean contains(int[] array, int i) { for (int i2 : array) { if (i == i2) { return true; } } return false; } @SuppressWarnings("unchecked") public static <T> T[] createAndFill(int size, T data) { Object[] array = new Object[size]; if (data != null) { Arrays.fill(array, data); } return (T[]) array; } @SuppressWarnings("unchecked") public static <T> T[] add(final T[] array, final T element) { T[] newArray; newArray = (T[]) Array.newInstance(array.getClass().getComponentType(), array.length + 1); System.arraycopy(array, 0, newArray, 0, array.length); newArray[newArray.length - 1] = element; return newArray; } public static <T> T[] remove(final T[] array, final T element) { List<T> list = new ArrayList<>(Arrays.asList(array)); list.removeAll(Arrays.asList(element)); return list.toArray(array); } public static <T> ArrayList<T> toArrayList(T[] array) { ArrayList<T> list = new ArrayList<>(array.length); list.addAll(Arrays.asList(array)); return list; } public static boolean startsWith(byte[] bytes, byte[] prefix) { if (prefix.length > bytes.length) { return false; } for (int i = 0; i < prefix.length; i++) { if (prefix[i] != bytes[i]) { return false; } } return true; } }
[ "kohii.git@gmail.com" ]
kohii.git@gmail.com
14459b009131c9b20cd3fa049e829a601210e786
a634abe28714c187057cdf9e0b469a6de1b3647e
/app/src/test/java/org/jboss/hal/processor/mbui/masterdetail/MasterDetailTest.java
54f3cf31ab59a63e475a82be527b95feb09dd5e5
[ "Apache-2.0" ]
permissive
hal/console
23328a2ee8dd640e53cff81eaf1c519e3a98f024
32cbfefaa7ca9254e439dbd787bda58d8490b6e7
refs/heads/main
2023-08-21T11:06:39.446971
2023-08-16T06:17:17
2023-08-16T06:17:17
38,317,187
31
105
Apache-2.0
2023-09-14T21:26:53
2015-06-30T15:26:19
Java
UTF-8
Java
false
false
1,252
java
/* * Copyright 2022 Red Hat * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.jboss.hal.processor.mbui.masterdetail; import org.jboss.hal.processor.mbui.MbuiViewProcessorTest; import org.junit.Test; import com.google.testing.compile.Compilation; @SuppressWarnings("DuplicateStringLiteralInspection") public class MasterDetailTest extends MbuiViewProcessorTest { @Test public void simple() { Compilation compilation = compile("SimpleView"); assertSourceEquals(compilation, "Mbui_SimpleView"); } @Test public void attributeGroups() { Compilation compilation = compile("AttributeGroupsView"); assertSourceEquals(compilation, "Mbui_AttributeGroupsView"); } }
[ "harald.pehl@gmail.com" ]
harald.pehl@gmail.com
762f41719e9c7737361dc7f8dbd5a8eea8f0b2c2
6679b6728c7669fd80feb974e720bc3af66ecb30
/client/src/main/java/com/threerings/gardens/client/ReconnectPanel.java
f55be5695f5eda6016a808665bc5e868b7d82b28
[]
no_license
threerings/game-gardens
5b4d771d073585284d1e7e804353f785113fa996
ac7d95dcafb21ba2fb5b5b8ca89b3d6662581fb3
refs/heads/master
2016-09-06T06:38:36.504000
2013-05-24T23:03:55
2013-05-24T23:35:09
1,583,758
10
2
null
null
null
null
UTF-8
Java
false
false
1,145
java
// // Game Gardens - a platform for hosting simple multiplayer Java games // Copyright (c) 2005-2013, Three Rings Design, Inc. - All rights reserved. // https://github.com/threerings/game-gardens/blob/master/LICENSE package com.threerings.gardens.client; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Label; import react.Slot; public class ReconnectPanel extends FlowPanel { public ReconnectPanel (ClientContext ctx) { Label status = new Label("Lost connection to server..."); add(status); final Button reconnect = new Button("Reconnect"); add(reconnect); final Connector conn = new Connector(ctx, status); conn.connecting.connect(new Slot<Boolean>() { public void onEmit (Boolean connecting) { reconnect.setEnabled(!connecting); }}); reconnect.addClickHandler(new ClickHandler() { public void onClick (ClickEvent event) { conn.connect(); }}); } }
[ "mdb@samskivert.com" ]
mdb@samskivert.com
73a7901279f64aa8e45d965a850e461a975f66de
6c7e279a45b37d597297f999d5ee0c5adde8a29e
/src/main/java/com/alipay/api/request/KoubeiMarketingDataSmartactivityConfigRequest.java
a0c526b422cb1e0f557a4bd3cfd7a64b6a0386ef
[]
no_license
tomowork/alipay-sdk-java
a09fffb8a48c41561b36b903c87bdf5e881451f6
387489e4a326c27a7b9fb6d38ee0b33aa1a3568f
refs/heads/master
2021-01-18T03:55:00.944718
2017-03-22T03:52:16
2017-03-22T03:59:16
85,776,800
1
2
null
2017-03-22T03:59:18
2017-03-22T02:37:45
Java
UTF-8
Java
false
false
3,082
java
package com.alipay.api.request; import com.alipay.api.domain.KoubeiMarketingDataSmartactivityConfigModel; import java.util.Map; import com.alipay.api.AlipayRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.KoubeiMarketingDataSmartactivityConfigResponse; import com.alipay.api.AlipayObject; /** * ALIPAY API: koubei.marketing.data.smartactivity.config request * * @author auto create * @since 1.0, 2017-02-22 16:41:53 */ public class KoubeiMarketingDataSmartactivityConfigRequest implements AlipayRequest<KoubeiMarketingDataSmartactivityConfigResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 商户智能活动配置方案接口 */ private String bizContent; public void setBizContent(String bizContent) { this.bizContent = bizContent; } public String getBizContent() { return this.bizContent; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getProdCode() { return this.prodCode; } public String getApiMethodName() { return "koubei.marketing.data.smartactivity.config"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("biz_content", this.bizContent); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Class<KoubeiMarketingDataSmartactivityConfigResponse> getResponseClass() { return KoubeiMarketingDataSmartactivityConfigResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "zlei.huang@tomowork.com" ]
zlei.huang@tomowork.com
7e11b42aed4fb8d3bd39161e00a0030e55f403cf
1c2fc95d66ea34fdcb4f2352c8d2d362b3b5b367
/Test/design/组合模式/example7/Component.java
e884186da1f795ea334c227e4a60bef5fdc77e63
[]
no_license
lryxxh/Study
2473647837535055af9cf3f6c048a81cc09be2bb
47c556afeff8223aba3e324407fe6af97071884a
refs/heads/master
2020-12-02T12:46:27.455563
2017-07-08T03:07:22
2017-07-08T03:07:22
96,589,823
0
0
null
null
null
null
GB18030
Java
false
false
1,806
java
package 组合模式.example7; /** * 抽象的组件对象 */ public abstract class Component { /** * 记录每个组件的路径 */ private String componentPath = ""; /** * 获取组件的路径 * * @return 组件的路径 */ public String getComponentPath() { return componentPath; } /** * 设置组件的路径 * * @param componentPath * 组件的路径 */ public void setComponentPath(String componentPath) { this.componentPath = componentPath; } /** * 获取组件的名称 * * @return 组件的名称 */ public abstract String getName(); /*-------------------以下是原有的定义----------------------*/ /** * 输出组件自身的名称 */ public abstract void printStruct(String preStr); /** * 向组合对象中加入组件对象 * * @param child * 被加入组合对象中的组件对象 */ public void addChild(Component child) { // 缺省的实现,抛出例外,因为叶子对象没有这个功能,或者子组件没有实现这个功能 throw new UnsupportedOperationException("对象不支持这个功能"); } /** * 从组合对象中移出某个组件对象 * * @param child * 被移出的组件对象 */ public void removeChild(Component child) { // 缺省的实现,抛出例外,因为叶子对象没有这个功能,或者子组件没有实现这个功能 throw new UnsupportedOperationException("对象不支持这个功能"); } /** * 返回某个索引对应的组件对象 * * @param index * 需要获取的组件对象的索引,索引从0开始 * @return 索引对应的组件对象 */ public Component getChildren(int index) { throw new UnsupportedOperationException("对象不支持这个功能"); } }
[ "lryxxh@163.com" ]
lryxxh@163.com
a6722449a0797931c32a5b7b5df93f9a0f896b02
09960b68707da3891f45ac2eda90e177a742b28d
/web/ahnew/src/main/java/com/szty/aihao/service/mvnforumvideo_service.java
88be7a14cb7861ec66cc3d38a26161168e6af7bc
[]
no_license
jiangyiman/szty
a72434d586f836f8a9039b3a5a293f614a1e4b99
9087733b2b88b6ac0e0cd7d13652f02b42cdb848
refs/heads/master
2021-05-30T22:03:01.114487
2016-03-25T06:25:18
2016-03-25T06:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,887
java
/* *@=================================================================== *@项目说明 *@作者:宋春林 *@版本信息:@Copy Right 2011-2015 *@文件: iDataMvnforumvideo.java *@项目名称:JAVA项目管理 *@创建时间:2015/10/15 *@=================================================================== */ package com.szty.aihao.service; import com.szty.aihao.dao.mvnforumvideo_Dao; import com.szty.aihao.core.mvnforumvideo_core; import com.szty.aihao.factory.classFactory; import java.util.Dictionary; import java.util.List; /** *@文件说明 *@MVNFORUMVIDEO逻辑层接口 *@作者:宋春林 */ public class mvnforumvideo_service { public mvnforumvideo_core _dal=classFactory.getmvnforumvideo(); /** * 向数据库中插入一条新记录。 * @param MVNFORUMVIDEO实体 * @return 新插入记录的编号 */ public int insert_mvnforumvideo (mvnforumvideo_Dao _MVNFORUMVIDEOModel ) throws Exception{ return _dal.insert_mvnforumvideo( _MVNFORUMVIDEOModel); } /** * 向数据库中插入一条新记录。 * @param MVNFORUMVIDEOprrameter * @return 新插入记录的编号 */ public int insert_mvnforumvideo(Object[] _para) throws Exception{ return _dal.insert_mvnforumvideo( _para); } /** * 向数据库中插入一条新记录。 * @param MVNFORUMVIDEO实体 * @return 影响的行数 */ public int update_mvnforumvideo(mvnforumvideo_Dao _MVNFORUMVIDEOModel) throws Exception{ return _dal.update_mvnforumvideo( _MVNFORUMVIDEOModel); } /** * 删除数据表MVNFORUMVIDEO中的一条记录 * @param MVNFORUMVIDEO实体 * @return 新插入记录的编号 */ public int delete_mvnforumvideo(int Videoid) throws Exception{ return _dal.delete_mvnforumvideo( Videoid); } /** * 得到 mvnforumvideo 数据实体 * @param Videoid">Videoid * @return<mvnforumvideo 数据实体 * @throws Exception */ public mvnforumvideo_Dao get_mvnforumvideoDao(int Videoid) throws Exception{ return _dal.get_mvnforumvideoDao( Videoid); } /** * 根据MVNFORUMVIDEO返回的查询DataRow创建一个MVNFORUMVIDEOEntity对象 * @param MVNFORUMVIDEO row * @returnMVNFORUMVIDEOList对象 * @throws Exception */ public List<mvnforumvideo_Dao> get_mvnforumvideo_All() throws Exception{ return _dal.get_mvnforumvideo_All(); } /** * 根据MVNFORUMVIDEO返回的查询DataRow创建一个MVNFORUMVIDEOEntity对象 * @param MVNFORUMVIDEO row * @returnMVNFORUMVIDEOList对象 * @throws Exception */ public List<mvnforumvideo_Dao> get_mvnforumvideo_All(String strWhere) throws Exception{ return _dal.get_mvnforumvideo_All(strWhere); } /* 根据SCLTEST返回 分页数据 * * @param SCLTEST * row * @returnSCLTESTList对象 * @throws Exception */ public List<mvnforumvideo_Dao> get_mvnforumvideo_Page(int pageSize, int pageIndex,String strWhere) throws Exception { return _dal.get_mvnforumvideo_Page(pageSize,pageIndex,strWhere); } /** * 根据MVNFORUMVIDEO返回的查询DataRow创建一个MVNFORUMVIDEOEntity对象 * @param MVNFORUMVIDEO row * @returnMVNFORUMVIDEODictionary对象 * @throws Exception */ public Dictionary<Integer, mvnforumvideo_Dao> get_mvnforumvideo_Dictionary(String strWhere) throws Exception{ return _dal.get_mvnforumvideo_Dictionary(strWhere); } /** * 更新MVNFORUMVIDEO字段加一 * @param FieldName * @param sid */ public int create_mvnforumvideo_UpdateIncreate(String FieldName,int sid) throws Exception{ return _dal.create_mvnforumvideo_UpdateIncreate( FieldName, sid); } /** * 更新MVNFORUMVIDEOInt型字段 * @param FieldName * @param Num * @param sid */ public int create_mvnforumvideo_UpdateInteger(String FieldName,int Num,int sid) throws Exception{ return _dal.create_mvnforumvideo_UpdateInteger( FieldName, Num, sid); } /** * 更新MVNFORUMVIDEOIString型字段 * @param FieldName * @param Value * @param sid */ public int createmvnforumvideo_UpdateString(String FieldName,String Value,int sid) throws Exception{ return _dal.create_mvnforumvideo_UpdateString( FieldName, Value, sid); } }
[ "279941737@qq.com" ]
279941737@qq.com
40d527f3a10aff12e53c505166eb48ebc22b3172
7f17c2ad530ace1ba3467c787a3cca39c2a417bc
/core/src/main/java/io/machinecode/chainlink/core/jsl/impl/task/ItemWriterImpl.java
8dd6787fab9fa2c49e7f00002ed8bbd6364ab513
[ "Apache-2.0" ]
permissive
BrentDouglas/chainlink
acc3c197a07bc199425f5458f6253c8f5a3e4c92
376e194ccdd2e6e2f1a4a4b39c7e7f0a4dd81ca3
refs/heads/master
2021-01-15T13:48:23.808562
2015-11-16T19:19:11
2015-11-16T19:19:11
17,303,791
3
0
null
null
null
null
UTF-8
Java
false
false
3,909
java
/* * Copyright 2015 Brent Douglas and other contributors * as indicated by the @author tags. 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 io.machinecode.chainlink.core.jsl.impl.task; import io.machinecode.chainlink.core.jsl.impl.PropertiesImpl; import io.machinecode.chainlink.core.jsl.impl.PropertyReferenceImpl; import io.machinecode.chainlink.spi.configuration.Configuration; import io.machinecode.chainlink.spi.context.ExecutionContext; import io.machinecode.chainlink.spi.inject.ArtifactReference; import io.machinecode.chainlink.spi.inject.InjectablesProvider; import io.machinecode.chainlink.spi.inject.InjectionContext; import io.machinecode.chainlink.spi.jsl.task.ItemWriter; import java.io.Serializable; import java.util.List; /** * @author <a href="mailto:brent.n.douglas@gmail.com">Brent Douglas</a> * @since 1.0 */ public class ItemWriterImpl extends PropertyReferenceImpl<javax.batch.api.chunk.ItemWriter> implements ItemWriter { private static final long serialVersionUID = 1L; public ItemWriterImpl(final ArtifactReference ref, final PropertiesImpl properties) { super(ref, properties); } public void open(final Configuration configuration, final ExecutionContext context, final Serializable checkpoint) throws Exception { final InjectionContext injectionContext = configuration.getInjectionContext(); final InjectablesProvider provider = injectionContext.getProvider(); try { provider.setInjectables(_injectables(configuration, context)); load(javax.batch.api.chunk.ItemWriter.class, configuration, context).open(checkpoint); } finally { provider.releaseInjectables(); } } public void close(final Configuration configuration, final ExecutionContext context) throws Exception { final InjectionContext injectionContext = configuration.getInjectionContext(); final InjectablesProvider provider = injectionContext.getProvider(); try { provider.setInjectables(_injectables(configuration, context)); load(javax.batch.api.chunk.ItemWriter.class, configuration, context).close(); } finally { provider.releaseInjectables(); } } public void writeItems(final Configuration configuration, final ExecutionContext context, final List<Object> items) throws Exception { final InjectionContext injectionContext = configuration.getInjectionContext(); final InjectablesProvider provider = injectionContext.getProvider(); try { provider.setInjectables(_injectables(configuration, context)); load(javax.batch.api.chunk.ItemWriter.class, configuration, context).writeItems(items); } finally { provider.releaseInjectables(); } } public Serializable checkpointInfo(final Configuration configuration, final ExecutionContext context) throws Exception { final InjectionContext injectionContext = configuration.getInjectionContext(); final InjectablesProvider provider = injectionContext.getProvider(); try { provider.setInjectables(_injectables(configuration, context)); return load(javax.batch.api.chunk.ItemWriter.class, configuration, context).checkpointInfo(); } finally { provider.releaseInjectables(); } } }
[ "brent.n.douglas@gmail.com" ]
brent.n.douglas@gmail.com
64a05034e5560b0ca3f4fd658318073e2f8dd67c
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3.1/mule/tests/core/src/test/java/org/mule/test/transformers/ObjectByteArrayTransformersWithStringsTestCase.java
00ef882638e93dcc8c123b33d43af37a0b6176ba
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
1,251
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the MuleSource MPL * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.test.transformers; import org.mule.tck.AbstractTransformerTestCase; import org.mule.transformers.simple.ByteArrayToObject; import org.mule.transformers.simple.ObjectToByteArray; import org.mule.umo.transformer.UMOTransformer; /** * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a> * @version $Revision$ */ public class ObjectByteArrayTransformersWithStringsTestCase extends AbstractTransformerTestCase { private String testObject = "test"; public UMOTransformer getTransformer() throws Exception { return new ObjectToByteArray(); } public UMOTransformer getRoundTripTransformer() throws Exception { return new ByteArrayToObject(); } public Object getTestData() { return testObject; } public Object getResultData() { return testObject.getBytes(); } }
[ "lajos@bf997673-6b11-0410-b953-e057580c5b09" ]
lajos@bf997673-6b11-0410-b953-e057580c5b09
6ffb7bd1e762cec5520b1e6830d2c16cca91d88a
a33aac97878b2cb15677be26e308cbc46e2862d2
/data/libgdx/btPersistentManifoldArray_push_back.java
03b39c4e06675830c0d630aa4f5002447b204be7
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
public void push_back(btPersistentManifold _Val) { CollisionJNI.btPersistentManifoldArray_push_back(swigCPtr, this, btPersistentManifold.getCPtr(_Val), _Val); }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
12e5cfe1cdde5211267231db2dda2b0f61b6d6ba
ed952f6f85093489b36fc3553f03aed0126493b3
/src/main/java/com/minea/sisas/web/rest/BannerResource.java
71279815ad07bf1cfa4f784d9090bd66d5796cbe
[]
no_license
kaduart/sisas-system
f32169c72953cfb20da3f6fefffb30db81aac02e
809fdc2e4991cdb3a3c43e884d6ff78bdc53b84b
refs/heads/master
2022-12-15T13:43:49.280832
2020-08-23T17:23:34
2020-08-23T17:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,835
java
package com.minea.sisas.web.rest; import com.codahale.metrics.annotation.Timed; import com.minea.sisas.domain.Banner; import com.minea.sisas.service.BannerService; import com.minea.sisas.web.rest.errors.BadRequestAlertException; import com.minea.sisas.web.rest.util.HeaderUtil; import com.minea.sisas.web.rest.util.PaginationUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing Banner. */ @RestController @RequestMapping("/api") public class BannerResource { private final Logger log = LoggerFactory.getLogger(BannerResource.class); private static final String ENTITY_NAME = "banner"; private final BannerService bannerService; public BannerResource(BannerService bannerService) { this.bannerService = bannerService; } /** * POST /banners : Create a new banner. * * @param banner the banner to create * @return the ResponseEntity with status 201 (Created) and with body the new banner, or with status 400 (Bad Request) if the banner has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/banners") @Timed public ResponseEntity<Banner> createBanner(@RequestBody Banner banner) throws URISyntaxException { log.debug("REST request to save Banner : {}", banner); if (banner.getId() != null) { throw new BadRequestAlertException("A new Banner cannot already have an ID", ENTITY_NAME, "idexists"); } Banner result = bannerService.save(banner); return ResponseEntity.created(new URI("/api/banners/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /banners : Updates an existing Banner. * * @param banner the Banner to update * @return the ResponseEntity with status 200 (OK) and with body the updated Banner, * or with status 400 (Bad Request) if the Banner is not valid, * or with status 500 (Internal Server Error) if the Banner couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/banners") @Timed public ResponseEntity<Banner> updateBanner(@RequestBody Banner banner) throws URISyntaxException { log.debug("REST request to update Banner : {}", banner); if (banner.getId() == null) { return createBanner(banner); } Banner result = bannerService.save(banner); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, banner.getId().toString())) .body(result); } /** * GET /banners : get all the Banners. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of Banners in body */ @GetMapping("/banners") @Timed public ResponseEntity<List<Banner>> getAllBanners(Pageable pageable) { log.debug("REST request to get a page of Banners"); Page<Banner> page = bannerService.findAll(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/banners"); return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK); } /** * GET /banners/:id : get the "id" Banner. * * @param id the id of the Banner to retrieve * @return the ResponseEntity with status 200 (OK) and with body the Banner, or with status 404 (Not Found) */ @GetMapping("/banners/{id}") @Timed public ResponseEntity<Banner> getBanner(@PathVariable Long id) { log.debug("REST request to get Banner : {}", id); Banner banner = bannerService.findOne(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(banner)); } /** * DELETE /banners/:id : delete the "id" Banner. * * @param id the id of the Banner to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/banners/{id}") @Timed public ResponseEntity<Void> deleteBanner(@PathVariable Long id) { log.debug("REST request to delete Banner : {}", id); bannerService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "unknown@example.com" ]
unknown@example.com
1d31eab398ef3dee0d7b2180a7048bcc750b8ff3
69bccb8a384c223d9c70d9530d8aab8bb738290a
/app/src/main/java/com/yuwei/utils/Ultralight.java
da43d30bbfca281d18e3ba6b6c9ea47b2bf86983
[]
no_license
xiaohualaila/ImageDoor
f0964fe10407641499e88634073891e7c9203585
4e46876ffae460fd85d22af33af6e9f0dc35588b
refs/heads/master
2021-08-28T05:32:05.442270
2017-12-11T09:29:59
2017-12-11T09:29:59
113,839,016
0
0
null
null
null
null
UTF-8
Java
false
false
3,818
java
package com.yuwei.utils; /** * Created by Administrator on 2016/12/23. */ public class Ultralight extends CardCommon { public static void end() { ICCRF.rf_rfinf_reset(id, (byte) 0);//0区清零; } public static boolean start() { ICCRF.rf_rfinf_reset(id, (byte) 1);//1区写 rf_UL_findcard(); return true; } public static byte[] rf_UL_findcard() { byte[] bytes1 = new byte[8]; byte[] len = new byte[1]; int code = ICCRF.rf_ISO14443A_findcard(id, (byte) 0x26, len, bytes1); if (bytes1 != null && bytes1[0] == 0) { bytes1 = null; } return bytes1; } /** * @return 寻卡失败返回 null */ public static byte[] getID() { ICCRF.rf_rfinf_reset(id, (byte) 1); byte[] bytes = rf_UL_findcard(); log("getID", 0, bytes); ICCRF.rf_rfinf_reset(id, (byte) 0); return bytes; } /** * @param _Adr * @param _Data * @return 0 成功 */ public static int rf_UL_write(int _Adr, byte[] _Data) { log("rf_UL_write 页数:" + _Adr); start(); int code = ICCRF.rf_UL_write(id, (byte) _Adr, _Data); log(_Data.length + " rf_UL_write", code, _Data); end(); return code; } public static boolean rf_UL_write(int _Adr, int _Nm, byte[] _Data) { log("rf_UL_writeM 页数:" + _Adr); start(); boolean b = rf_UL_write_common(_Adr, _Nm, _Data); end(); return b; } public static boolean rf_UL_write_common(int _Adr, int _Nm, byte[] _Data) { int code = -1; for (int i = 0; i < _Nm; i++) { byte[] b = new byte[4]; System.arraycopy(_Data, 4 * i, b, 0, 4); code = ICCRF.rf_UL_write(id, (byte) (_Adr + i), b); if (code != 0) { log(_Data.length + " rf_UL_writeM", code, _Data); return false; } } return true; } public static byte[] rf_UL_read(int _Adr, int _Nm) { log("rf_UL_read 页数:" + _Adr); start(); byte[] bytes = rf_UL_read_common(_Adr, _Nm); end(); return bytes; } public static byte[] rf_UL_read_common(int _Adr, int _Nm) { byte[] bytes = new byte[_Nm * 4]; int code = -1; for (int i = 0; i < _Nm; i++) { byte[] b = new byte[4]; code = ICCRF.rf_UL_read(id, (byte) (_Adr + i), b); if (code != 0) { log(" rf_UL_read", code, b); return null; } else { System.arraycopy(b, 0, bytes, i * 4, 4); } } return bytes; } public static int rf_UL_writeM(int _Adr, int _Nm, byte[] _Data) { log("rf_UL_writeM 页数:" + _Adr); start(); int code = ICCRF.rf_UL_writeM(id, (byte) _Adr, (byte) _Nm, _Data); log(_Data.length + " rf_UL_writeM", code, _Data); end(); return code; } /** * @param _Adr * @param _Data * @return 0 成功 */ public static int rf_UL_read(int _Adr, byte[] _Data) { log("rf_UL_read 页数:" + _Adr); start(); int code = ICCRF.rf_UL_read(id, (byte) _Adr, _Data); log(_Data.length + " rf_UL_read", code, _Data); end(); return code; } /** * 连续读 * * @param _Adr * @param _Data * @return 0 成功 */ public static int rf_UL_readM(int _Adr, int _Nm, byte[] _Data) { log("rf_UL_readM 页数:" + _Adr); start(); int code = ICCRF.rf_UL_readM(id, (byte) _Adr, (byte) _Nm, _Data); log(_Data.length + " rf_UL_readM", code, _Data); end(); return code; } }
[ "380129462@qq.com" ]
380129462@qq.com
21cf3b8ebd0933c45c2062ddd351dee8246f679e
b5fcd64be1a8cf669b6a5607bfe332e5e6c66b09
/src/main/java/io/manebot/plugin/audio/mixer/output/NativeMixerSink.java
5a304fabda4d55af10d87a355a37dd0525d36cbd
[ "Apache-2.0" ]
permissive
Manebot/audio
f5b500c50ed8c11ad22bf184bc6ec6ca3736f665
722924fe583c8dc23078666ea73d3f11b3373f6c
refs/heads/master
2023-02-24T08:50:02.884762
2023-02-17T23:04:15
2023-02-17T23:04:15
175,074,254
0
0
null
null
null
null
UTF-8
Java
false
false
592
java
package io.manebot.plugin.audio.mixer.output; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.LineUnavailableException; /** * Wraps the Java mixer sink. This sink uses the Java audio layer. Used by TeamSpeak (+ generic Audio plugin stuff) */ public class NativeMixerSink extends JavaMixerSink { public NativeMixerSink(AudioFormat format, int bufferSize) throws LineUnavailableException { super(AudioSystem.getSourceDataLine(format), bufferSize); } public String toString() { return "Java"; } }
[ "teamlixo@gmail.com" ]
teamlixo@gmail.com
5b609787a98035ab5c522be2a9fce17657a81c12
052977a9eb0fafd34efe5b2de8f61da50fce8fc4
/2016-04-16_lab/model-jpa/src/main/java/swt6/orm/domain/annotated/Project.java
b4168f5ae32d3458a49fb3a0acd3c8b49c944b82
[]
no_license
FH-Thomas-Herzog/SWT6
6f72cbf5d2b24bbf537cb10deca5a580b66fb041
9582073d2e9749501813b3f296cf4869c476c352
refs/heads/master
2021-01-18T22:49:38.958060
2016-06-03T17:21:47
2016-06-03T17:21:47
52,601,828
0
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package swt6.orm.domain.annotated; import java.io.Serializable; import java.util.HashSet; import java.util.Set; public class Project implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String name; // private Employee manager; private Set<Employee> members = new HashSet<>(); public Project() { } public Project(String name) { this.name = name; } public Long getId() { return id; } @SuppressWarnings("unused") private void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set<Employee> getMembers() { return members; } public void setMembers(Set<Employee> members) { this.members = members; } public void addMember(Employee empl) { if (empl == null) { throw new IllegalArgumentException("Null Employee"); } empl.getProjects().add(this); members.add(empl); } @Override public String toString() { return name; } }
[ "herzog.thomas81@gmail.com" ]
herzog.thomas81@gmail.com
23d7b1b2ea307662a714a7aef09ac8172169e729
11fa8dcb980983e49877c52ed7e5713e0dca4aad
/trunk/src/net/sourceforge/service/admin/impl/CountryManagerImpl.java
dfa5888b3809e2ede2f6223db1a7764e59bf9f66
[]
no_license
Novthirteen/oa-system
0262a6538aa023ededa1254c26c42bc19a70357c
c698a0c09bbd6b902700e9ccab7018470c538e70
refs/heads/master
2021-01-15T16:29:18.465902
2009-03-20T12:41:16
2009-03-20T12:41:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,507
java
/* ===================================================================== * * Copyright (c) Sourceforge INFORMATION TECHNOLOGY All rights reserved. * * ===================================================================== */ package net.sourceforge.service.admin.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import net.sourceforge.dao.admin.CityDAO; import net.sourceforge.dao.admin.CountryDAO; import net.sourceforge.dao.admin.ProvinceDAO; import net.sourceforge.model.admin.City; import net.sourceforge.model.admin.Country; import net.sourceforge.model.admin.Province; import net.sourceforge.model.admin.query.CountryQueryOrder; import net.sourceforge.service.BaseManager; import net.sourceforge.service.admin.CountryManager; /** * implement for CountryManager * @author shilei * @version 1.0 (Nov 15, 2005) */ public class CountryManagerImpl extends BaseManager implements CountryManager { //private Log log = LogFactory.getLog(CountryManagerImpl.class); private CountryDAO dao; private ProvinceDAO provinceDAO; private CityDAO cityDAO; /** * @param dao */ public void setCountryDAO(CountryDAO dao) { this.dao = dao; } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#getCountry(java.lang.Integer) */ public Country getCountry(Integer id) { return dao.getCountry(id); } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#updateCountry(net.sourceforge.model.admin.Country) */ public Country updateCountry(Country function) { return dao.updateCountry(function); } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#insertCountry(net.sourceforge.model.admin.Country) */ public Country insertCountry(Country function) { return dao.insertCountry(function); } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#getCountryListCount(java.util.Map) */ public int getCountryListCount(Map conditions) { return dao.getCountryListCount(conditions); } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#getCountryList(java.util.Map, int, int, net.sourceforge.model.admin.query.CountryQueryOrder, boolean) */ public List getCountryList(Map conditions, int pageNo, int pageSize, CountryQueryOrder order, boolean descend){ return dao.getCountryList(conditions, pageNo, pageSize, order, descend); } /** * @param cityDAO */ public void setCityDAO(CityDAO cityDAO) { this.cityDAO = cityDAO; } /** * @param provinceDAO */ public void setProvinceDAO(ProvinceDAO provinceDAO) { this.provinceDAO = provinceDAO; } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#listEnabledCountryProvinceCity() */ public List listEnabledCountryProvinceCity() { List countryList=dao.listEnabledCountry(); List cityList=cityDAO.getEnabledCityList(); List provinceList=provinceDAO.getEnabledProvinceList(); for (Iterator iter = countryList.iterator(); iter.hasNext();) { Country c = (Country) iter.next(); c.setEnabledProvinceList(new ArrayList()); } for (Iterator iter = provinceList.iterator(); iter.hasNext();) { Province p = (Province) iter.next(); p.setEnabledCityList(new ArrayList()); } for (Iterator iter = provinceList.iterator(); iter.hasNext();) { Province p = (Province) iter.next(); if(p.getCountry().getEnabledProvinceList()!=null) p.getCountry().getEnabledProvinceList().add(p); } for (Iterator iter = cityList.iterator(); iter.hasNext();) { City c = (City) iter.next(); if(c.getProvince().getEnabledCityList()!=null) c.getProvince().getEnabledCityList().add(c); } return countryList; } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#listEnabledCountryCity() */ public List listEnabledCountryCity() { List countryList=dao.listEnabledCountry(); List cityList=cityDAO.getEnabledCityList(); for (Iterator iter = countryList.iterator(); iter.hasNext();) { Country c = (Country) iter.next(); c.setEnabledCityList(new ArrayList()); } for (Iterator iter = cityList.iterator(); iter.hasNext();) { City c = (City) iter.next(); c.getProvince().getCountry().getEnabledCityList().add(c); } return countryList; } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#promoteCountry(net.sourceforge.model.admin.Country) */ public void promoteCountry(Country country){ country.setSite(null); this.updateCountry(country); } /* (non-Javadoc) * @see net.sourceforge.service.admin.CountryManager#getEnabledCountryList() */ public List getEnabledCountryList() { return dao.listEnabledCountry(); } public boolean deleteCountry(Country country) { dao.deleteCountry(country); return true; } public Country getCountryByChnName(String chnName) { return dao.getCountryByChnName(chnName); } public Country getCountryByEngName(String engName) { return dao.getCountryByEngName(engName); } public Country getCountryByShortName(String shortName) { return dao.getCountryByShortName(shortName); } }
[ "novthirteen@1ac4a774-0534-11de-a6e9-d320b29efae0" ]
novthirteen@1ac4a774-0534-11de-a6e9-d320b29efae0