blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
3c4005cb4af233808fbf3ecba5c1695592347949
f0879d39b436665ea9d90841deabcbd52b311634
/android/app/src/main/java/com/th/geumat/ui/home/HomeFragment.java
73e2f5c1b364b7022e26dfb67463fdb2426d83c5
[]
no_license
DevelopDestroyer/OurFoodList
44ae6ea5517475d9b6a943df0ee4c143585d1e85
3d850345addae9ec142c83568d83e8e7434fea11
refs/heads/master
2021-06-13T20:30:24.029710
2021-05-27T10:01:28
2021-05-27T10:01:28
202,145,938
3
0
null
2020-08-31T12:40:59
2019-08-13T13:02:54
JavaScript
UTF-8
Java
false
false
915
java
package com.th.geumat.ui.home; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProviders; import com.th.geumat.MainActivity; import com.th.geumat.R; //맛집지도 프레그먼트 public class HomeFragment extends Fragment { private HomeViewModel homeViewModel; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { homeViewModel = ViewModelProviders.of(this).get(HomeViewModel.class); View root = inflater.inflate(R.layout.fragment_home, container, false); ((MainActivity)getActivity()).changeWebviewURL("http://geumat.iwinv.net/#/"); ((MainActivity)getActivity()).loadAd(); return root; } }
64c5500ab54e99f353bf7c69ae216c66a2a6f6ab
a9e4ba216fc5f60471fa1c7d217b646e36cf6c79
/configuration/src/test/java/com/github/mpashka/spring/config/beans/PropsBean.java
7629ca4371d396b14dba16ef933a517be8ed2b6b
[]
no_license
p4535992/spring
cbc6cd40a9e93e1e09d3d0203394e8b18a1185ac
4dc3938af7b3647bac0685c41843505b39ecf7d2
refs/heads/master
2020-06-26T10:12:37.710201
2018-08-27T09:36:46
2018-08-27T09:36:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
package com.github.mpashka.spring.config.beans; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * PropsTest * * @author Pavel Moukhataev */ @Component public class PropsBean { @Value("${p1}") private String p1; @Value("${p2}") private String p2; @Value("${pd1}") private double pd1; @Value("${pd2}") private int pd2; @Value("${s5}") private String s5; @Value("#{${p6ref}}") private String p6ref; @Value("#{ref1.length() - ${p8i}}") private int p8spel; public String getP1() { return p1; } public String getP2() { return p2; } public double getPd1() { return pd1; } public int getPd2() { return pd2; } public String getS5() { return s5; } public String getP6ref() { return p6ref; } public int getP8spel() { return p8spel; } }
0d50ebe77568f5bb5152e5a06aa18d47a87e4dc6
25e31752bee12e21b118234cc40ce4ec38595d83
/src/main/java/com/xinrenxinshi/request/EmployeeFileUploadRequest.java
2a0fe3b28789a4e620aff5a2c1cb7e17e8f33a76
[]
no_license
zhaopc01/openapi-sdk-java
6a82413cb1e73282157976f30d16615abe7b4a8d
c77d60c6f72616a3ee3e826055cd114dfcfaa75f
refs/heads/master
2023-01-06T13:23:14.965718
2020-11-05T04:06:44
2020-11-05T04:06:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,596
java
package com.xinrenxinshi.request; import com.xinrenxinshi.common.MethodEnum; import com.xinrenxinshi.exception.ParamNotValidException; import com.xinrenxinshi.openapi.AbstractOpenapiUploadRequest; import com.xinrenxinshi.response.EmployeeFileUploadResponse; import com.xinrenxinshi.util.XRXSStrUtils; import java.util.HashMap; import java.util.Map; /** * 员工文件上传请求参数 * * @author: liuchenhui * @create: 2019-11-05 12:09 **/ public class EmployeeFileUploadRequest extends AbstractOpenapiUploadRequest<EmployeeFileUploadResponse> { /** * 员工ID */ private String employeeId; public EmployeeFileUploadRequest(String accessToken) { super(accessToken); } public String getEmployeeId() { return employeeId; } public void setEmployeeId(String employeeId) { this.employeeId = employeeId; } @Override public MethodEnum getMethod() { return MethodEnum.METHOD_POST; } @Override public Class<EmployeeFileUploadResponse> getResponseClass() { return EmployeeFileUploadResponse.class; } @Override public void check() throws ParamNotValidException { if (XRXSStrUtils.isEmpty(employeeId)) { throw new ParamNotValidException("员工id为空"); } } @Override public String getBizUrl() { return "/v3/employee/uploadFile"; } @Override protected Map<String, Object> getParamMap0() { Map<String, Object> map = new HashMap<>(10); map.put("employeeId", employeeId); return map; } }
8362f48a05468725e062e0ab7032495a0e7c7b07
2f702d6acfaf563d770409b54a59fb837d414bed
/src/com/company/Main.java
49f6f4f8936b3e847ef82ef7594280ada0f674d1
[]
no_license
angelacpd/Java_Exercises
a6e4ac0983a28ba1fddafbc7a48ef1e45a0d92b2
4c78d60e219f6e56841211a2ee8e1c577fd3a59a
refs/heads/master
2022-12-19T05:17:57.344481
2020-09-18T13:07:51
2020-09-18T13:08:35
296,614,278
1
0
null
null
null
null
UTF-8
Java
false
false
624
java
package com.company; public class Main { public static void main(String[] args) { System.out.println("Hello, world!"); // Instantiating objects Person tom = new Person("Tom", "Sawyer"); Person huck = new Person("Huck", "Finn"); System.out.println(tom.getLastName()); System.out.println(huck.getFirstName()); tom.setLastName("Jones"); huck.setFirstName("Huckleberry"); System.out.println(tom.getLastName()); System.out.println(huck.getFirstName()); tom.incrementPersonCount(); huck.incrementPersonCount(); } }
99df3b88feacbbfce9ff670493b3f92c0d8cc92e
f6ed3f377c0e6e4545d9559840f28bad6f0e48c1
/xyw/src/rj7/dao/ttcmt/IttcmtDAO.java
2a420de781d156d5b91cde5518f3c343134a124e
[]
no_license
zzzzzzf/xyw
fb72b8359aad14a86b41070fec87ebcf74992188
d7ee5ebfb1d3ef092f01b25c0585308066e46c03
refs/heads/master
2020-12-30T15:53:43.668621
2017-06-04T11:37:38
2017-06-04T11:37:38
89,077,668
2
0
null
2017-04-24T07:51:55
2017-04-22T14:57:34
Java
UTF-8
Java
false
false
460
java
package rj7.dao.ttcmt; import rj7.bean.ttcmt; import java.util.List; /** * * * */ public interface IttcmtDAO { public boolean doCreate(ttcmt t)throws Exception;//�������� public boolean doDelete(String t)throws Exception;//ɾ������ public boolean doUpdate(ttcmt t)throws Exception;//�������� public Object findByid(String tid)throws Exception; //����id���� }
d581438500bbc34585016a90759ffc07a7e943ae
f58514c662cc7b8753f3b872d9d5156896314a6e
/Intranet/src/main/java/com/intranet/service/contabilidad/GastosService.java
8f2f7277c20dc316a89ade6d8e877982df63b71d
[]
no_license
sandraPati/mensajeriaIntranet
f2543c6b7d3ba36be4c9307ba1f990489b5669d2
01562cd474f66ede32a05f0a6e3379a002fecc19
refs/heads/master
2021-01-10T04:00:29.028710
2016-03-28T02:16:23
2016-03-28T02:16:23
54,858,931
0
0
null
null
null
null
UTF-8
Java
false
false
1,401
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.intranet.service.contabilidad; import com.intranet.beans.gastos; import com.intranet.dao.GastosDAO; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service("gastosService") public class GastosService { @Autowired GastosDAO gastosDAO; public List<gastos> findAll(){ return gastosDAO.findAll(); } public List<gastos> findAllEmpleado(String nif){ return gastosDAO.findAllEmpleado(nif); } public gastos porID (int id){ return gastosDAO.porID(id); } public int ultimo (gastos g){ return gastosDAO.ultimo(g); } public List<gastos> porIDProv (int idP){ return gastosDAO.porIDProv(idP); } public String Insert (gastos cap){ return gastosDAO.Insert(cap); } public String Update (gastos cap){ return gastosDAO.Update(cap); } public String Delete (int id){ return gastosDAO.Delete(id); } public boolean EstadoDePagoT (int id){ return gastosDAO.EstadoDePagoT(id); } public boolean EstadoDePagoF (int id){ return gastosDAO.EstadoDePagoF(id); } }
[ "Sandra Marieli Pacherres Timana" ]
Sandra Marieli Pacherres Timana
1ed66c3f9ccb5ddc7df90851c6c0d98269fd32f4
df9f4d4966280c1b679e17cf409b268bb308f652
/6.3/444/Solution.java
854920de449b736663e77bb094a881b21750a858
[]
no_license
s09g/code
165abae20fe3d8b348fbc8e88fd66559b705607e
0ac63127cad3cb4e6656cd08b17ff2b51cda06e1
refs/heads/main
2023-06-23T18:03:19.865546
2021-07-27T09:29:48
2021-07-27T09:29:48
324,943,301
0
0
null
null
null
null
UTF-8
Java
false
false
1,597
java
import java.util.*; class Solution { public boolean sequenceReconstruction(int[] org, List<List<Integer>> seqs) { HashMap<Integer, List<Integer>> graph = new HashMap<>(); HashMap<Integer, Integer> indegree = new HashMap<>(); for (List<Integer> seq : seqs) { for (int n : seq) { graph.putIfAbsent(n, new ArrayList<>()); indegree.putIfAbsent(n, 0); } } if (indegree.size() != org.length) { return false; } for (List<Integer> seq : seqs) { for (int i = 0; i < seq.size() - 1; i++) { int from = seq.get(i); int to = seq.get(i + 1); graph.get(from).add(to); indegree.put(to, indegree.get(to) + 1); } } Queue<Integer> queue = new LinkedList<>(); for (int n : indegree.keySet()) { if (indegree.get(n) == 0) { queue.offer(n); } } int pos = 0; while (!queue.isEmpty()) { if (queue.size() > 1) { return false; } int curt = queue.poll(); if (curt != org[pos++]) { return false; } List<Integer> neighbors = graph.get(curt); for (int next : neighbors) { indegree.put(next, indegree.get(next) - 1); if (indegree.get(next) == 0) { queue.offer(next); } } } return pos == org.length; } }
f847c46769f7d7dd13ba94090d03d1562e32c418
82db4d2cd5b3325b40420b405d75cd0fc721eede
/life-program-institute/src/main/java/com/belphegor/lifeprograminstitute/utils/TokenUtils.java
23f3acac5e3e42f30be1938eaad70df532860778
[]
no_license
wenwuliu/kotlin-blog
bf0c85c4548611342712119410eeb75d4dd6ff29
1e277b082d1ad12bae846fb7e0d964d377251194
refs/heads/master
2023-01-07T12:36:18.290531
2019-09-24T09:46:20
2019-09-24T09:46:20
206,506,495
0
0
null
2023-01-04T10:52:48
2019-09-05T07:51:28
Java
UTF-8
Java
false
false
4,278
java
package com.belphegor.lifeprograminstitute.utils; import com.belphegor.lifeprograminstitute.entity.User; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Objects; @Component public class TokenUtils { public static final String CLAIM_KEY_USERNAME = "sub"; private static final String CLAIM_KEY_CREATED = "crt"; private static String secret; private static Long expiration; /** * 获取usercode * @param token * @return */ public static String getUsercodeFromToken(String token){ String usercode; try { final Claims claims = getClaimsFromToken(token); usercode = claims.getSubject(); }catch (Exception e){ usercode = e.toString(); } return usercode; } /** * 获取创建时间 * @param token * @return */ public static Date getCreatedDateFromToken(String token){ Date created; try { final Claims claims = getClaimsFromToken(token); created = Objects.equals(null,claims)? null:new Date(((Long)claims.get(CLAIM_KEY_CREATED))); }catch (Exception e){ created = null; } return created; } public static Date getExpirationDateFromToken(String token){ Date expiration; try { final Claims claims = getClaimsFromToken(token); expiration = claims.getExpiration(); }catch (Exception e){ expiration = null; } return expiration; } private static Claims getClaimsFromToken(String token){ Claims claims; try { claims = Jwts.parser() .setSigningKey(secret) .parseClaimsJws(token) .getBody(); }catch (Exception e){ claims = null; } return claims; } private static Date generateExpirationDate(){ return new Date(System.currentTimeMillis() + expiration * 1000); } private static Boolean isTokenExpired(String token){ final Date expiration = getExpirationDateFromToken(token); return expiration.before(new Date()); } private static Boolean isCreatedBeforeLastPasswordReset(Date created,Date lastPasswordReset){ return (lastPasswordReset != null && created.before(lastPasswordReset)); } public static String generateToken(String usercode){ Map<String,Object> claims = new HashMap<>(); claims.put(CLAIM_KEY_CREATED,new Date()); claims.put(CLAIM_KEY_USERNAME,usercode); return generateToken(claims); } public static String generateToken(Map<String,Object> claims){ return Jwts.builder() .setClaims(claims) .setExpiration(generateExpirationDate()) .signWith(SignatureAlgorithm.HS512,secret) .compact(); } public static Boolean canTokenBeRefreshed(String token,Date lastPasswordReset){ final Date created = getCreatedDateFromToken(token); return !isCreatedBeforeLastPasswordReset(created,lastPasswordReset) && !isTokenExpired(token); } public static String refreshToken(String token){ String refreshedToken; try { final Claims claims = getClaimsFromToken(token); claims.put(CLAIM_KEY_CREATED,new Date()); refreshedToken = generateToken(claims); }catch (Exception e){ refreshedToken = null; } return refreshedToken; } public static Boolean validateToken(String token, User user){ final String usercode = getUsercodeFromToken(token); return (usercode.equals(user.getUserName())) && !isTokenExpired(token); } @Value("${jwt.secret}") public void setSecret(String secret){ TokenUtils.secret = secret; } @Value("${jwt.expiration}") public void setExpiration(Long expiration){ TokenUtils.expiration = expiration; } }
93d5d93b7e2810d209061ace23ea84c71ba2c8bf
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_3889462439357fd76c0b82dfd52e1ca6e0bafd2d/Settings/25_3889462439357fd76c0b82dfd52e1ca6e0bafd2d_Settings_s.java
b8297a512ec10c64ab1c8af9cdb812cba2f6983f
[]
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
29,666
java
/* * Copyright (C) 2008 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.android.inputmethod.latin; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.Fragment; import android.app.backup.BackupManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.text.TextUtils; import android.text.method.LinkMovementMethod; import android.util.Log; import android.view.inputmethod.EditorInfo; import android.widget.TextView; import com.android.inputmethod.compat.CompatUtils; import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; import com.android.inputmethod.compat.InputMethodServiceCompatWrapper; import com.android.inputmethod.compat.InputTypeCompatUtils; import com.android.inputmethod.compat.VibratorCompatWrapper; import com.android.inputmethod.deprecated.VoiceProxy; import com.android.inputmethodcommon.InputMethodSettingsActivity; import java.util.Arrays; import java.util.Locale; public class Settings extends InputMethodSettingsActivity implements SharedPreferences.OnSharedPreferenceChangeListener, DialogInterface.OnDismissListener, OnPreferenceClickListener { private static final String TAG = "Settings"; public static final String PREF_GENERAL_SETTINGS_KEY = "general_settings"; public static final String PREF_VIBRATE_ON = "vibrate_on"; public static final String PREF_SOUND_ON = "sound_on"; public static final String PREF_KEY_PREVIEW_POPUP_ON = "popup_on"; public static final String PREF_RECORRECTION_ENABLED = "recorrection_enabled"; public static final String PREF_AUTO_CAP = "auto_cap"; public static final String PREF_SHOW_SETTINGS_KEY = "show_settings_key"; public static final String PREF_VOICE_SETTINGS_KEY = "voice_mode"; public static final String PREF_INPUT_LANGUAGE = "input_language"; public static final String PREF_SELECTED_LANGUAGES = "selected_languages"; public static final String PREF_SUBTYPES = "subtype_settings"; public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key"; public static final String PREF_CORRECTION_SETTINGS_KEY = "correction_settings"; public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting"; public static final String PREF_AUTO_CORRECTION_THRESHOLD = "auto_correction_threshold"; public static final String PREF_DEBUG_SETTINGS = "debug_settings"; public static final String PREF_NGRAM_SETTINGS_KEY = "ngram_settings"; public static final String PREF_BIGRAM_SUGGESTIONS = "bigram_suggestion"; public static final String PREF_BIGRAM_PREDICTIONS = "bigram_prediction"; public static final String PREF_MISC_SETTINGS_KEY = "misc_settings"; public static final String PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY = "pref_key_preview_popup_dismiss_delay"; public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict"; public static final String PREF_USABILITY_STUDY_MODE = "usability_study_mode"; // Dialog ids private static final int VOICE_INPUT_CONFIRM_DIALOG = 0; public static class Values { // From resources: public final int mDelayBeforeFadeoutLanguageOnSpacebar; public final int mDelayUpdateSuggestions; public final int mDelayUpdateOldSuggestions; public final int mDelayUpdateShiftState; public final int mDurationOfFadeoutLanguageOnSpacebar; public final float mFinalFadeoutFactorOfLanguageOnSpacebar; public final long mDoubleSpacesTurnIntoPeriodTimeout; public final String mWordSeparators; public final String mMagicSpaceStrippers; public final String mMagicSpaceSwappers; public final String mSuggestPuncs; public final SuggestedWords mSuggestPuncList; // From preferences: public final boolean mSoundOn; // Sound setting private to Latin IME (see mSilentModeOn) public final boolean mVibrateOn; public final boolean mKeyPreviewPopupOn; public final int mKeyPreviewPopupDismissDelay; public final boolean mAutoCap; public final boolean mAutoCorrectEnabled; public final double mAutoCorrectionThreshold; // Suggestion: use bigrams to adjust scores of suggestions obtained from unigram dictionary public final boolean mBigramSuggestionEnabled; // Prediction: use bigrams to predict the next word when there is no input for it yet public final boolean mBigramPredictionEnabled; public final boolean mUseContactsDict; private final boolean mShowSettingsKey; private final boolean mVoiceKeyEnabled; private final boolean mVoiceKeyOnMain; public Values(final SharedPreferences prefs, final Context context, final String localeStr) { final Resources res = context.getResources(); final Locale savedLocale; if (null != localeStr) { final Locale keyboardLocale = Utils.constructLocaleFromString(localeStr); savedLocale = Utils.setSystemLocale(res, keyboardLocale); } else { savedLocale = null; } // Get the resources mDelayBeforeFadeoutLanguageOnSpacebar = res.getInteger( R.integer.config_delay_before_fadeout_language_on_spacebar); mDelayUpdateSuggestions = res.getInteger(R.integer.config_delay_update_suggestions); mDelayUpdateOldSuggestions = res.getInteger( R.integer.config_delay_update_old_suggestions); mDelayUpdateShiftState = res.getInteger(R.integer.config_delay_update_shift_state); mDurationOfFadeoutLanguageOnSpacebar = res.getInteger( R.integer.config_duration_of_fadeout_language_on_spacebar); mFinalFadeoutFactorOfLanguageOnSpacebar = res.getInteger( R.integer.config_final_fadeout_percentage_of_language_on_spacebar) / 100.0f; mDoubleSpacesTurnIntoPeriodTimeout = res.getInteger( R.integer.config_double_spaces_turn_into_period_timeout); mMagicSpaceStrippers = res.getString(R.string.magic_space_stripping_symbols); mMagicSpaceSwappers = res.getString(R.string.magic_space_swapping_symbols); String wordSeparators = mMagicSpaceStrippers + mMagicSpaceSwappers + res.getString(R.string.magic_space_promoting_symbols); final String notWordSeparators = res.getString(R.string.non_word_separator_symbols); for (int i = notWordSeparators.length() - 1; i >= 0; --i) { wordSeparators = wordSeparators.replace(notWordSeparators.substring(i, i + 1), ""); } mWordSeparators = wordSeparators; mSuggestPuncs = res.getString(R.string.suggested_punctuations); // TODO: it would be nice not to recreate this each time we change the configuration mSuggestPuncList = createSuggestPuncList(mSuggestPuncs); // Get the settings preferences final boolean hasVibrator = VibratorCompatWrapper.getInstance(context).hasVibrator(); mVibrateOn = hasVibrator && prefs.getBoolean(Settings.PREF_VIBRATE_ON, false); mSoundOn = prefs.getBoolean(Settings.PREF_SOUND_ON, res.getBoolean(R.bool.config_default_sound_enabled)); mKeyPreviewPopupOn = isKeyPreviewPopupEnabled(prefs, res); mKeyPreviewPopupDismissDelay = getKeyPreviewPopupDismissDelay(prefs, res); mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true); mAutoCorrectEnabled = isAutoCorrectEnabled(prefs, res); mBigramSuggestionEnabled = mAutoCorrectEnabled && isBigramSuggestionEnabled(prefs, res, mAutoCorrectEnabled); mBigramPredictionEnabled = mBigramSuggestionEnabled && isBigramPredictionEnabled(prefs, res); mAutoCorrectionThreshold = getAutoCorrectionThreshold(prefs, res); mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true); final boolean defaultShowSettingsKey = res.getBoolean( R.bool.config_default_show_settings_key); mShowSettingsKey = prefs.getBoolean(Settings.PREF_SHOW_SETTINGS_KEY, defaultShowSettingsKey); final String voiceModeMain = res.getString(R.string.voice_mode_main); final String voiceModeOff = res.getString(R.string.voice_mode_off); final String voiceMode = prefs.getString(PREF_VOICE_SETTINGS_KEY, voiceModeMain); mVoiceKeyEnabled = voiceMode != null && !voiceMode.equals(voiceModeOff); mVoiceKeyOnMain = voiceMode != null && voiceMode.equals(voiceModeMain); Utils.setSystemLocale(res, savedLocale); } public boolean isSuggestedPunctuation(int code) { return mSuggestPuncs.contains(String.valueOf((char)code)); } public boolean isWordSeparator(int code) { return mWordSeparators.contains(String.valueOf((char)code)); } public boolean isMagicSpaceStripper(int code) { return mMagicSpaceStrippers.contains(String.valueOf((char)code)); } public boolean isMagicSpaceSwapper(int code) { return mMagicSpaceSwappers.contains(String.valueOf((char)code)); } private static boolean isAutoCorrectEnabled(SharedPreferences sp, Resources resources) { final String currentAutoCorrectionSetting = sp.getString( Settings.PREF_AUTO_CORRECTION_THRESHOLD, resources.getString(R.string.auto_correction_threshold_mode_index_modest)); final String autoCorrectionOff = resources.getString( R.string.auto_correction_threshold_mode_index_off); return !currentAutoCorrectionSetting.equals(autoCorrectionOff); } // Public to access from KeyboardSwitcher. Should it have access to some // process-global instance instead? public static boolean isKeyPreviewPopupEnabled(SharedPreferences sp, Resources resources) { final boolean showPopupOption = resources.getBoolean( R.bool.config_enable_show_popup_on_keypress_option); if (!showPopupOption) return resources.getBoolean(R.bool.config_default_popup_preview); return sp.getBoolean(Settings.PREF_KEY_PREVIEW_POPUP_ON, resources.getBoolean(R.bool.config_default_popup_preview)); } // Likewise public static int getKeyPreviewPopupDismissDelay(SharedPreferences sp, Resources resources) { return Integer.parseInt(sp.getString(Settings.PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY, Integer.toString(resources.getInteger(R.integer.config_delay_after_preview)))); } private static boolean isBigramSuggestionEnabled(SharedPreferences sp, Resources resources, boolean autoCorrectEnabled) { final boolean showBigramSuggestionsOption = resources.getBoolean( R.bool.config_enable_bigram_suggestions_option); if (!showBigramSuggestionsOption) { return autoCorrectEnabled; } return sp.getBoolean(Settings.PREF_BIGRAM_SUGGESTIONS, resources.getBoolean( R.bool.config_default_bigram_suggestions)); } private static boolean isBigramPredictionEnabled(SharedPreferences sp, Resources resources) { return sp.getBoolean(Settings.PREF_BIGRAM_PREDICTIONS, resources.getBoolean( R.bool.config_default_bigram_prediction)); } private static double getAutoCorrectionThreshold(SharedPreferences sp, Resources resources) { final String currentAutoCorrectionSetting = sp.getString( Settings.PREF_AUTO_CORRECTION_THRESHOLD, resources.getString(R.string.auto_correction_threshold_mode_index_modest)); final String[] autoCorrectionThresholdValues = resources.getStringArray( R.array.auto_correction_threshold_values); // When autoCorrectionThreshold is greater than 1.0, it's like auto correction is off. double autoCorrectionThreshold = Double.MAX_VALUE; try { final int arrayIndex = Integer.valueOf(currentAutoCorrectionSetting); if (arrayIndex >= 0 && arrayIndex < autoCorrectionThresholdValues.length) { autoCorrectionThreshold = Double.parseDouble( autoCorrectionThresholdValues[arrayIndex]); } } catch (NumberFormatException e) { // Whenever the threshold settings are correct, never come here. autoCorrectionThreshold = Double.MAX_VALUE; Log.w(TAG, "Cannot load auto correction threshold setting." + " currentAutoCorrectionSetting: " + currentAutoCorrectionSetting + ", autoCorrectionThresholdValues: " + Arrays.toString(autoCorrectionThresholdValues)); } return autoCorrectionThreshold; } private static SuggestedWords createSuggestPuncList(final String puncs) { SuggestedWords.Builder builder = new SuggestedWords.Builder(); if (puncs != null) { for (int i = 0; i < puncs.length(); i++) { builder.addWord(puncs.subSequence(i, i + 1)); } } return builder.setIsPunctuationSuggestions().build(); } public boolean isSettingsKeyEnabled(EditorInfo attribute) { return mShowSettingsKey; } public boolean isVoiceKeyEnabled(EditorInfo attribute) { final boolean shortcutImeEnabled = SubtypeSwitcher.getInstance().isShortcutImeEnabled(); final int inputType = (attribute != null) ? attribute.inputType : 0; return shortcutImeEnabled && mVoiceKeyEnabled && !InputTypeCompatUtils.isPasswordInputType(inputType); } public boolean isVoiceKeyOnMain() { return mVoiceKeyOnMain; } } private PreferenceScreen mInputLanguageSelection; private ListPreference mVoicePreference; private CheckBoxPreference mShowSettingsKeyPreference; private ListPreference mShowCorrectionSuggestionsPreference; private ListPreference mAutoCorrectionThresholdPreference; private ListPreference mKeyPreviewPopupDismissDelay; // Suggestion: use bigrams to adjust scores of suggestions obtained from unigram dictionary private CheckBoxPreference mBigramSuggestion; // Prediction: use bigrams to predict the next word when there is no input for it yet private CheckBoxPreference mBigramPrediction; private Preference mDebugSettingsPreference; private boolean mVoiceOn; private AlertDialog mDialog; private boolean mOkClicked = false; private String mVoiceModeOff; private void ensureConsistencyOfAutoCorrectionSettings() { final String autoCorrectionOff = getResources().getString( R.string.auto_correction_threshold_mode_index_off); final String currentSetting = mAutoCorrectionThresholdPreference.getValue(); mBigramSuggestion.setEnabled(!currentSetting.equals(autoCorrectionOff)); mBigramPrediction.setEnabled(!currentSetting.equals(autoCorrectionOff)); } public Activity getActivityInternal() { Object thisObject = (Object) this; if (thisObject instanceof Activity) { return (Activity) thisObject; } else if (thisObject instanceof Fragment) { return ((Fragment) thisObject).getActivity(); } else { return null; } } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setInputMethodSettingsCategoryTitle(R.string.language_selection_title); setSubtypeEnablerTitle(R.string.select_language); final Resources res = getResources(); final Context context = getActivityInternal(); addPreferencesFromResource(R.xml.prefs); mInputLanguageSelection = (PreferenceScreen) findPreference(PREF_SUBTYPES); mInputLanguageSelection.setOnPreferenceClickListener(this); mVoicePreference = (ListPreference) findPreference(PREF_VOICE_SETTINGS_KEY); mShowSettingsKeyPreference = (CheckBoxPreference) findPreference(PREF_SHOW_SETTINGS_KEY); mShowCorrectionSuggestionsPreference = (ListPreference) findPreference(PREF_SHOW_SUGGESTIONS_SETTING); SharedPreferences prefs = getPreferenceManager().getSharedPreferences(); prefs.registerOnSharedPreferenceChangeListener(this); mVoiceModeOff = getString(R.string.voice_mode_off); mVoiceOn = !(prefs.getString(PREF_VOICE_SETTINGS_KEY, mVoiceModeOff) .equals(mVoiceModeOff)); mAutoCorrectionThresholdPreference = (ListPreference) findPreference(PREF_AUTO_CORRECTION_THRESHOLD); mBigramSuggestion = (CheckBoxPreference) findPreference(PREF_BIGRAM_SUGGESTIONS); mBigramPrediction = (CheckBoxPreference) findPreference(PREF_BIGRAM_PREDICTIONS); mDebugSettingsPreference = findPreference(PREF_DEBUG_SETTINGS); if (mDebugSettingsPreference != null) { final Intent debugSettingsIntent = new Intent(Intent.ACTION_MAIN); debugSettingsIntent.setClassName( context.getPackageName(), DebugSettings.class.getName()); mDebugSettingsPreference.setIntent(debugSettingsIntent); } ensureConsistencyOfAutoCorrectionSettings(); final PreferenceGroup generalSettings = (PreferenceGroup) findPreference(PREF_GENERAL_SETTINGS_KEY); final PreferenceGroup textCorrectionGroup = (PreferenceGroup) findPreference(PREF_CORRECTION_SETTINGS_KEY); final boolean showSettingsKeyOption = res.getBoolean( R.bool.config_enable_show_settings_key_option); if (!showSettingsKeyOption) { generalSettings.removePreference(mShowSettingsKeyPreference); } final boolean showVoiceKeyOption = res.getBoolean( R.bool.config_enable_show_voice_key_option); if (!showVoiceKeyOption) { generalSettings.removePreference(mVoicePreference); } if (!VibratorCompatWrapper.getInstance(context).hasVibrator()) { generalSettings.removePreference(findPreference(PREF_VIBRATE_ON)); } if (InputMethodServiceCompatWrapper.CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED) { generalSettings.removePreference(findPreference(PREF_SUBTYPES)); } final boolean showPopupOption = res.getBoolean( R.bool.config_enable_show_popup_on_keypress_option); if (!showPopupOption) { generalSettings.removePreference(findPreference(PREF_KEY_PREVIEW_POPUP_ON)); } final boolean showRecorrectionOption = res.getBoolean( R.bool.config_enable_show_recorrection_option); if (!showRecorrectionOption) { generalSettings.removePreference(findPreference(PREF_RECORRECTION_ENABLED)); } final boolean showBigramSuggestionsOption = res.getBoolean( R.bool.config_enable_bigram_suggestions_option); if (!showBigramSuggestionsOption) { textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_SUGGESTIONS)); textCorrectionGroup.removePreference(findPreference(PREF_BIGRAM_PREDICTIONS)); } final boolean showUsabilityModeStudyOption = res.getBoolean( R.bool.config_enable_usability_study_mode_option); if (!showUsabilityModeStudyOption) { getPreferenceScreen().removePreference(findPreference(PREF_USABILITY_STUDY_MODE)); } mKeyPreviewPopupDismissDelay = (ListPreference)findPreference(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY); final String[] entries = new String[] { res.getString(R.string.key_preview_popup_dismiss_no_delay), res.getString(R.string.key_preview_popup_dismiss_default_delay), }; final String popupDismissDelayDefaultValue = Integer.toString(res.getInteger( R.integer.config_delay_after_preview)); mKeyPreviewPopupDismissDelay.setEntries(entries); mKeyPreviewPopupDismissDelay.setEntryValues( new String[] { "0", popupDismissDelayDefaultValue }); if (null == mKeyPreviewPopupDismissDelay.getValue()) { mKeyPreviewPopupDismissDelay.setValue(popupDismissDelayDefaultValue); } mKeyPreviewPopupDismissDelay.setEnabled( Settings.Values.isKeyPreviewPopupEnabled(prefs, res)); final PreferenceScreen dictionaryLink = (PreferenceScreen) findPreference(PREF_CONFIGURE_DICTIONARIES_KEY); final Intent intent = dictionaryLink.getIntent(); final int number = context.getPackageManager().queryIntentActivities(intent, 0).size(); if (0 >= number) { textCorrectionGroup.removePreference(dictionaryLink); } } @SuppressWarnings("unused") @Override public void onResume() { super.onResume(); final boolean isShortcutImeEnabled = SubtypeSwitcher.getInstance().isShortcutImeEnabled(); if (isShortcutImeEnabled || (VoiceProxy.VOICE_INSTALLED && VoiceProxy.isRecognitionAvailable(getActivityInternal()))) { updateVoiceModeSummary(); } else { getPreferenceScreen().removePreference(mVoicePreference); } updateShowCorrectionSuggestionsSummary(); updateKeyPreviewPopupDelaySummary(); } @Override public void onDestroy() { getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener( this); super.onDestroy(); } @Override public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { (new BackupManager(getActivityInternal())).dataChanged(); // If turning on voice input, show dialog if (key.equals(PREF_VOICE_SETTINGS_KEY) && !mVoiceOn) { if (!prefs.getString(PREF_VOICE_SETTINGS_KEY, mVoiceModeOff) .equals(mVoiceModeOff)) { showVoiceConfirmation(); } } else if (key.equals(PREF_KEY_PREVIEW_POPUP_ON)) { final ListPreference popupDismissDelay = (ListPreference)findPreference(PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY); if (null != popupDismissDelay) { popupDismissDelay.setEnabled(prefs.getBoolean(PREF_KEY_PREVIEW_POPUP_ON, true)); } } ensureConsistencyOfAutoCorrectionSettings(); mVoiceOn = !(prefs.getString(PREF_VOICE_SETTINGS_KEY, mVoiceModeOff) .equals(mVoiceModeOff)); updateVoiceModeSummary(); updateShowCorrectionSuggestionsSummary(); updateKeyPreviewPopupDelaySummary(); } @Override public boolean onPreferenceClick(Preference pref) { if (pref == mInputLanguageSelection) { startActivity(CompatUtils.getInputLanguageSelectionIntent( Utils.getInputMethodId( InputMethodManagerCompatWrapper.getInstance(), getActivityInternal().getApplicationInfo().packageName), 0)); return true; } return false; } private void updateShowCorrectionSuggestionsSummary() { mShowCorrectionSuggestionsPreference.setSummary( getResources().getStringArray(R.array.prefs_suggestion_visibilities) [mShowCorrectionSuggestionsPreference.findIndexOfValue( mShowCorrectionSuggestionsPreference.getValue())]); } private void updateKeyPreviewPopupDelaySummary() { final ListPreference lp = mKeyPreviewPopupDismissDelay; lp.setSummary(lp.getEntries()[lp.findIndexOfValue(lp.getValue())]); } private void showVoiceConfirmation() { mOkClicked = false; getActivityInternal().showDialog(VOICE_INPUT_CONFIRM_DIALOG); // Make URL in the dialog message clickable if (mDialog != null) { TextView textView = (TextView) mDialog.findViewById(android.R.id.message); if (textView != null) { textView.setMovementMethod(LinkMovementMethod.getInstance()); } } } private void updateVoiceModeSummary() { mVoicePreference.setSummary( getResources().getStringArray(R.array.voice_input_modes_summary) [mVoicePreference.findIndexOfValue(mVoicePreference.getValue())]); } @Override protected Dialog onCreateDialog(int id) { switch (id) { case VOICE_INPUT_CONFIRM_DIALOG: DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { if (whichButton == DialogInterface.BUTTON_NEGATIVE) { mVoicePreference.setValue(mVoiceModeOff); } else if (whichButton == DialogInterface.BUTTON_POSITIVE) { mOkClicked = true; } } }; AlertDialog.Builder builder = new AlertDialog.Builder(getActivityInternal()) .setTitle(R.string.voice_warning_title) .setPositiveButton(android.R.string.ok, listener) .setNegativeButton(android.R.string.cancel, listener); // Get the current list of supported locales and check the current locale against // that list, to decide whether to put a warning that voice input will not work in // the current language as part of the pop-up confirmation dialog. boolean localeSupported = SubtypeSwitcher.getInstance().isVoiceSupported( Locale.getDefault().toString()); final CharSequence message; if (localeSupported) { message = TextUtils.concat( getText(R.string.voice_warning_may_not_understand), "\n\n", getText(R.string.voice_hint_dialog_message)); } else { message = TextUtils.concat( getText(R.string.voice_warning_locale_not_supported), "\n\n", getText(R.string.voice_warning_may_not_understand), "\n\n", getText(R.string.voice_hint_dialog_message)); } builder.setMessage(message); AlertDialog dialog = builder.create(); mDialog = dialog; dialog.setOnDismissListener(this); return dialog; default: Log.e(TAG, "unknown dialog " + id); return null; } } @Override public void onDismiss(DialogInterface dialog) { if (!mOkClicked) { // This assumes that onPreferenceClick gets called first, and this if the user // agreed after the warning, we set the mOkClicked value to true. mVoicePreference.setValue(mVoiceModeOff); } } }
ed65ec73fde9b8c93089de9eb68646712dc5a314
43bead0476812600726ff95898e50c931a963ea7
/JavaBasic/Source/SeongJeok/SeongJeok.java
60d233237513920db3ccff36ed15e96ebcc6125d
[]
no_license
younguoon/Java
ecb5e8489d2a7efa3519d7ca98caed9bf324bac8
8283e59db93d8809b1c45ee455ecbfde98dba8ac
refs/heads/master
2021-01-18T20:50:19.972992
2017-05-17T13:31:31
2017-05-17T13:31:31
86,992,955
2
0
null
null
null
null
UHC
Java
false
false
1,519
java
package SeongJeok; import java.util.ArrayList; import java.util.Scanner; public class SeongJeok extends Person implements Personable{ String grade; int kor, eng, math, tot; double avg; static int stdCount=0, totalSeongJeok=0, totalAvg=0; Person p = new Person(); static ArrayList<Integer> gradeList = new ArrayList<Integer>(); static ArrayList<String> gradeList2 = new ArrayList<String>(); SeongJeok(){ } @Override public boolean input(){ Scanner sc = new Scanner(System.in); System.out.print("국어 입력 : "); kor = sc.nextInt(); if(kor==1) return true; System.out.print("영어 입력 : "); eng = sc.nextInt(); System.out.print("수학 입력 : "); math = sc.nextInt(); stdCount++; gradeList.add(kor); gradeList.add(eng); gradeList.add(math); return false; } @Override public void output() { System.out.printf("%3d %3d %3d %3d %5.2f %2s \n", kor, eng, math, tot, avg, grade); } void process(){ this.tot = kor+eng+math; avg = tot/3; switch((int)avg/10){ case 10: case 9 : grade = "수"; break; case 8 : grade = "우"; break; case 7 : grade = "미"; break; case 6 : grade = "양"; break; default : grade = "가"; break; } totalSeongJeok+=tot; totalAvg+=avg; gradeList.add(tot); gradeList.add((int) avg); gradeList2.add(grade); } static int getTotalAvg() { return totalSeongJeok/3/stdCount; } }
[ "Young@Young" ]
Young@Young
4f816a2a0c715d92744adaa36ddf46d6b3377812
8aafd9e0a3a75f9baefaef79e44ca7892921d660
/src/test/java/com/demo/MongoDbCrudApplicationTests.java
5f3f35d98a28457ade74b35b9b6db14151156eb9
[]
no_license
ree611/SpringMongoDBCrud
f2e7cde62fbf198a75ff53274fbfafb94dbc680d
cbc0002ed4c54c5811c892f69e01d05c407daba2
refs/heads/master
2022-11-20T08:25:27.312074
2020-07-29T18:47:28
2020-07-29T18:47:28
283,571,965
0
0
null
null
null
null
UTF-8
Java
false
false
205
java
package com.demo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class MongoDbCrudApplicationTests { @Test void contextLoads() { } }
16ef679a7ede121787e8d3945468acb43bf91702
ada3e5888fc7c23e0768d46e12da9fba85a888da
/RESTfulProject/src/dto/JsonObject.java
119c02b10a62c9045a639d4a5b54924598e05fd5
[]
no_license
anjanaas/Learn
ba6990380ca084b195f74932f1c5c2250a2a68f1
953b3e7a2a67ce9b43c076a1dfe8525367b26d27
refs/heads/master
2021-01-20T17:20:36.815869
2016-07-10T22:06:00
2016-07-10T22:06:00
62,579,641
0
0
null
2016-07-07T17:47:02
2016-07-04T17:54:24
null
UTF-8
Java
false
false
289
java
package dto; import java.util.ArrayList; public class JsonObject extends FeedObjects { ArrayList<FeedObjects> json = new ArrayList<FeedObjects>(); public ArrayList<FeedObjects> getJson() { return json; } public void setJson(ArrayList<FeedObjects> json) { this.json = json; } }
4b7c4e2f35457da9fa0b949690794021af7ab563
28552d7aeffe70c38960738da05ebea4a0ddff0c
/google-ads/src/main/java/com/google/ads/googleads/v4/services/stub/GrpcAgeRangeViewServiceCallableFactory.java
08458b4c1668fec632f148a0450dd57fb0169d34
[ "Apache-2.0" ]
permissive
PierrickVoulet/google-ads-java
6f84a3c542133b892832be8e3520fb26bfdde364
f0a9017f184cad6a979c3048397a944849228277
refs/heads/master
2021-08-22T08:13:52.146440
2020-12-09T17:10:48
2020-12-09T17:10:48
250,642,529
0
0
Apache-2.0
2020-03-27T20:41:26
2020-03-27T20:41:25
null
UTF-8
Java
false
false
808
java
/** * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.ads.googleads.v4.services.stub; import com.google.ads.googleads.lib.GrpcGoogleAdsCallableFactory; public class GrpcAgeRangeViewServiceCallableFactory extends GrpcGoogleAdsCallableFactory { }
bd1dc3e94549921a5eb65fa62d5871baed9d513f
48cc7d8d9e2329d181d7bafe845b86df0474c6b1
/src/test/java/String02Test/RepeatFrontTest.java
00da5bdcab92e3f03bd1a45ce4d639bd0c18a45a
[]
no_license
Lishkon/codingbat
ea7421b98cc766f15fb3959add6bef22945938a6
de57b1cbfd2c0ec36ad38b3b3ef35b851755dd9c
refs/heads/master
2020-04-13T06:47:56.175905
2020-02-19T23:40:26
2020-02-19T23:40:26
163,031,072
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package String02Test; import String02.RepeatFront; import org.junit.Assert; import org.junit.Test; public class RepeatFrontTest { @Test public void sampleTest_one() { RepeatFront rf = new RepeatFront(); Assert.assertEquals("ChocChoChC",rf.repeatFront("Chocolate", 4)); } @Test public void sampleTest_two() { RepeatFront rf = new RepeatFront(); Assert.assertEquals("ChoChC",rf.repeatFront("Chocolate", 3)); } @Test public void sampleTest_three() { RepeatFront rf = new RepeatFront(); Assert.assertEquals("IcI",rf.repeatFront("Ice Cream", 2)); } }
a6f3106e33774a0e592b34b7da041af9b04d669e
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-acmpca/src/main/java/com/amazonaws/services/acmpca/model/transform/CrlConfigurationMarshaller.java
2437403af3eed803d820db3a0ec915b2bb0c8448
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
3,251
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.acmpca.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.acmpca.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * CrlConfigurationMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class CrlConfigurationMarshaller { private static final MarshallingInfo<Boolean> ENABLED_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Enabled").build(); private static final MarshallingInfo<Integer> EXPIRATIONINDAYS_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("ExpirationInDays").build(); private static final MarshallingInfo<String> CUSTOMCNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("CustomCname").build(); private static final MarshallingInfo<String> S3BUCKETNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("S3BucketName").build(); private static final MarshallingInfo<String> S3OBJECTACL_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("S3ObjectAcl").build(); private static final CrlConfigurationMarshaller instance = new CrlConfigurationMarshaller(); public static CrlConfigurationMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(CrlConfiguration crlConfiguration, ProtocolMarshaller protocolMarshaller) { if (crlConfiguration == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(crlConfiguration.getEnabled(), ENABLED_BINDING); protocolMarshaller.marshall(crlConfiguration.getExpirationInDays(), EXPIRATIONINDAYS_BINDING); protocolMarshaller.marshall(crlConfiguration.getCustomCname(), CUSTOMCNAME_BINDING); protocolMarshaller.marshall(crlConfiguration.getS3BucketName(), S3BUCKETNAME_BINDING); protocolMarshaller.marshall(crlConfiguration.getS3ObjectAcl(), S3OBJECTACL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
29d8e8228832a451103a845a48295da542ea1593
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/DescribeEndpointAccessRequest.java
bda6633b047c4b234c688fda708fc05e5185d09c
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
14,871
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.redshift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeEndpointAccess" target="_top">AWS * API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DescribeEndpointAccessRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The cluster identifier associated with the described endpoint. * </p> */ private String clusterIdentifier; /** * <p> * The Amazon Web Services account ID of the owner of the cluster. * </p> */ private String resourceOwner; /** * <p> * The name of the endpoint to be described. * </p> */ private String endpointName; /** * <p> * The virtual private cloud (VPC) identifier with access to the cluster. * </p> */ private String vpcId; /** * <p> * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response so * that the remaining results can be retrieved. * </p> */ private Integer maxRecords; /** * <p> * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by the * <code>MaxRecords</code> parameter. * </p> */ private String marker; /** * <p> * The cluster identifier associated with the described endpoint. * </p> * * @param clusterIdentifier * The cluster identifier associated with the described endpoint. */ public void setClusterIdentifier(String clusterIdentifier) { this.clusterIdentifier = clusterIdentifier; } /** * <p> * The cluster identifier associated with the described endpoint. * </p> * * @return The cluster identifier associated with the described endpoint. */ public String getClusterIdentifier() { return this.clusterIdentifier; } /** * <p> * The cluster identifier associated with the described endpoint. * </p> * * @param clusterIdentifier * The cluster identifier associated with the described endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withClusterIdentifier(String clusterIdentifier) { setClusterIdentifier(clusterIdentifier); return this; } /** * <p> * The Amazon Web Services account ID of the owner of the cluster. * </p> * * @param resourceOwner * The Amazon Web Services account ID of the owner of the cluster. */ public void setResourceOwner(String resourceOwner) { this.resourceOwner = resourceOwner; } /** * <p> * The Amazon Web Services account ID of the owner of the cluster. * </p> * * @return The Amazon Web Services account ID of the owner of the cluster. */ public String getResourceOwner() { return this.resourceOwner; } /** * <p> * The Amazon Web Services account ID of the owner of the cluster. * </p> * * @param resourceOwner * The Amazon Web Services account ID of the owner of the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withResourceOwner(String resourceOwner) { setResourceOwner(resourceOwner); return this; } /** * <p> * The name of the endpoint to be described. * </p> * * @param endpointName * The name of the endpoint to be described. */ public void setEndpointName(String endpointName) { this.endpointName = endpointName; } /** * <p> * The name of the endpoint to be described. * </p> * * @return The name of the endpoint to be described. */ public String getEndpointName() { return this.endpointName; } /** * <p> * The name of the endpoint to be described. * </p> * * @param endpointName * The name of the endpoint to be described. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withEndpointName(String endpointName) { setEndpointName(endpointName); return this; } /** * <p> * The virtual private cloud (VPC) identifier with access to the cluster. * </p> * * @param vpcId * The virtual private cloud (VPC) identifier with access to the cluster. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** * <p> * The virtual private cloud (VPC) identifier with access to the cluster. * </p> * * @return The virtual private cloud (VPC) identifier with access to the cluster. */ public String getVpcId() { return this.vpcId; } /** * <p> * The virtual private cloud (VPC) identifier with access to the cluster. * </p> * * @param vpcId * The virtual private cloud (VPC) identifier with access to the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withVpcId(String vpcId) { setVpcId(vpcId); return this; } /** * <p> * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response so * that the remaining results can be retrieved. * </p> * * @param maxRecords * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response * so that the remaining results can be retrieved. */ public void setMaxRecords(Integer maxRecords) { this.maxRecords = maxRecords; } /** * <p> * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response so * that the remaining results can be retrieved. * </p> * * @return The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the * response so that the remaining results can be retrieved. */ public Integer getMaxRecords() { return this.maxRecords; } /** * <p> * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response so * that the remaining results can be retrieved. * </p> * * @param maxRecords * The maximum number of records to include in the response. If more records exist than the specified * <code>MaxRecords</code> value, a pagination token called a <code>Marker</code> is included in the response * so that the remaining results can be retrieved. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withMaxRecords(Integer maxRecords) { setMaxRecords(maxRecords); return this; } /** * <p> * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by the * <code>MaxRecords</code> parameter. * </p> * * @param marker * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by * the <code>MaxRecords</code> parameter. */ public void setMarker(String marker) { this.marker = marker; } /** * <p> * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by the * <code>MaxRecords</code> parameter. * </p> * * @return An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified * by the <code>MaxRecords</code> parameter. */ public String getMarker() { return this.marker; } /** * <p> * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by the * <code>MaxRecords</code> parameter. * </p> * * @param marker * An optional pagination token provided by a previous <code>DescribeEndpointAccess</code> request. If this * parameter is specified, the response includes only records beyond the marker, up to the value specified by * the <code>MaxRecords</code> parameter. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointAccessRequest withMarker(String marker) { setMarker(marker); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getClusterIdentifier() != null) sb.append("ClusterIdentifier: ").append(getClusterIdentifier()).append(","); if (getResourceOwner() != null) sb.append("ResourceOwner: ").append(getResourceOwner()).append(","); if (getEndpointName() != null) sb.append("EndpointName: ").append(getEndpointName()).append(","); if (getVpcId() != null) sb.append("VpcId: ").append(getVpcId()).append(","); if (getMaxRecords() != null) sb.append("MaxRecords: ").append(getMaxRecords()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointAccessRequest == false) return false; DescribeEndpointAccessRequest other = (DescribeEndpointAccessRequest) obj; if (other.getClusterIdentifier() == null ^ this.getClusterIdentifier() == null) return false; if (other.getClusterIdentifier() != null && other.getClusterIdentifier().equals(this.getClusterIdentifier()) == false) return false; if (other.getResourceOwner() == null ^ this.getResourceOwner() == null) return false; if (other.getResourceOwner() != null && other.getResourceOwner().equals(this.getResourceOwner()) == false) return false; if (other.getEndpointName() == null ^ this.getEndpointName() == null) return false; if (other.getEndpointName() != null && other.getEndpointName().equals(this.getEndpointName()) == false) return false; if (other.getVpcId() == null ^ this.getVpcId() == null) return false; if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false; if (other.getMaxRecords() == null ^ this.getMaxRecords() == null) return false; if (other.getMaxRecords() != null && other.getMaxRecords().equals(this.getMaxRecords()) == false) return false; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClusterIdentifier() == null) ? 0 : getClusterIdentifier().hashCode()); hashCode = prime * hashCode + ((getResourceOwner() == null) ? 0 : getResourceOwner().hashCode()); hashCode = prime * hashCode + ((getEndpointName() == null) ? 0 : getEndpointName().hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getMaxRecords() == null) ? 0 : getMaxRecords().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); return hashCode; } @Override public DescribeEndpointAccessRequest clone() { return (DescribeEndpointAccessRequest) super.clone(); } }
[ "" ]
f39c45317d69078522f27104aa7db1e54cde7d6c
b9746cdb8df894a8ede874f16aececfca2da2e48
/anagram.java
019b12398fca8224a4c559298720f30176e1b3f2
[]
no_license
ikp1997/Anagram-java
1d44b50b7b1a18a16bc85146c59bf161abf0ec84
2c8306433c334bd63d5e4a80107f4a28b9dfa8a3
refs/heads/master
2020-09-24T23:44:30.935117
2019-12-04T13:23:10
2019-12-04T13:23:10
225,871,929
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
static boolean isAnagram(String a, String b) { a=a.toLowerCase(); b=b.toLowerCase(); char array[]=a.toCharArray(); char array1[]=b.toCharArray(); if(a.length()!=b.length()) { return false; } for(int i=0;i<a.length();i++) { for(int j=0;j<b.length();j++) { if(a.charAt(i)==b.charAt(j)) { array[i]=array1[j]=0; //System.out.println(array[i]); } } } for(int i=0;i<a.length();i++) { if(array[i]!=0 || array1[i]!=0) { return false; } } return true; }
e9b1d154d952bbaecff3dbfdfd221a1ef0289000
24470b678b6cd3125f31c6f34dab0c8d9c6654ce
/Generative/demo.trace/languages/demo.trace.aspect/source_gen/demo/trace/aspect/behavior/BehaviorAspectDescriptor.java
6b203a203867e7a49af194c515dd4cb781e3f81c
[]
no_license
Doxxer/SPbAU-Fall-2014
4549a753d4c55c258f4c3a2d2f7f9b4be93a350a
7bb2c789ac2fe18e8e2fec569a60475916dad087
refs/heads/master
2016-09-06T03:06:06.884218
2015-01-23T13:22:33
2015-01-23T13:22:33
23,701,340
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package demo.trace.aspect.behavior; /*Generated by MPS */ import jetbrains.mps.smodel.runtime.BehaviorDescriptor; import java.util.Arrays; import jetbrains.mps.smodel.runtime.interpreted.BehaviorAspectInterpreted; public class BehaviorAspectDescriptor implements jetbrains.mps.smodel.runtime.BehaviorAspectDescriptor { public BehaviorAspectDescriptor() { } public BehaviorDescriptor getDescriptor(String fqName) { switch (Arrays.binarySearch(stringSwitchCases_846f5o_a0a0b, fqName)) { case 0: return new Tracer_BehaviorDescriptor(); default: return BehaviorAspectInterpreted.getInstance().getDescriptor(fqName); } } private static String[] stringSwitchCases_846f5o_a0a0b = new String[]{"demo.trace.aspect.structure.Tracer"}; }
faaaaeb72266042d6946fb7207fc4bdd7b8b0afc
247c1084830400beb58dd1a4e6f3692ff7e5da13
/src/main/java/controller/CartController.java
6af829598edda4368013da0426dcd731e608823e
[]
no_license
0523431/shop05-cipher-
9f004109cd332499bb4f83bee69e7d5c77c8b766
269a4f3110d75bf4a340ec7bbe0243a2aaae00f5
refs/heads/master
2022-12-22T03:13:12.695953
2020-01-02T09:39:01
2020-01-02T09:39:01
231,350,767
0
0
null
2022-12-15T23:57:56
2020-01-02T09:38:24
Java
UTF-8
Java
false
false
5,161
java
package controller; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import exception.CartEmptyException; import exception.LoginException; import logic.Cart; import logic.Item; import logic.ItemSet; import logic.Sale; import logic.ShopService; import logic.User; @Controller @RequestMapping("cart") // cart폴더의 컨트롤러가 되는거야 public class CartController { @Autowired private ShopService service; /* 매개변수는 id, 수량, 장바구니를 세션에 등록하니까 session객체 */ @RequestMapping("cartAdd") public ModelAndView add(String id, Integer quantity, HttpSession session) { ModelAndView mav = new ModelAndView("cart/cart"); // view지정 (왜? cartAdd.jsp로 가는게 아니니까) // 선택된 상품 객체 Item item = service.itemInfo(id); Cart cart = (Cart)session.getAttribute("CART"); if(cart ==null) { // 장바구니가 비었을 때, cart = new Cart(); // session에 등록된 cart session.setAttribute("CART", cart); } // itemSetList에 추가 됨 cart.push(new ItemSet(item, quantity)); mav.addObject("message", item.getName() + ":" + quantity + "개 장바구니 추가"); mav.addObject("cart", cart); return mav; } /* index 파라미터값에 해당하는 값을 Cart의 itemSetList 객체에서 제거 message에 000상품을 장바구니에서 제거했습니다 메시지를 cart.jsp에 전달하기 1. session에서 CART 객체 조회하기 2. cart 객체에서 itemSetList객체에서 index에 해당하는 값을 제거 ItemSet itemSet = cart.getItemSetList().remove(index); 3. message를 cart.jsp view에 전달하기 */ @RequestMapping("cartDelete") public ModelAndView cartDelete(int index, HttpSession session) { // Integer는 객체라서 대상을 찾아가니까 안됨, int는 정수값을 찾아주지 ModelAndView mav = new ModelAndView("cart/cart"); // view : cart.jsp Cart cart = (Cart)session.getAttribute("CART"); ItemSet itemSet = null; try { itemSet = cart.getItemSetList().remove(index); mav.addObject("message", itemSet.getItem().getName()+"상품을 장바구니에서 삭제했습니다"); } catch(Exception e) { // 이미 상품을 삭제한 상태 mav.addObject("message", "장바구니 상품이 삭제되지 않았습니다"); } mav.addObject("cart", cart); // 남은 session이 cart.jsp로 보내짐 return mav; } /* 장바구니에 상품이 없는 경우, CartEmptyException을 발생 ==> "장바구니에 상품이 없습니다" 메시지 alert창으로 출력 /item/list.shop페이지로 이동 */ @RequestMapping("cartView") public ModelAndView cartView(HttpSession session) { ModelAndView mav = new ModelAndView("cart/cart"); // session에서 CART객체 조회 Cart cart = (Cart)session.getAttribute("CART"); // cart가 없거나, 아이템리스트가 0일때 if(cart ==null || cart.getItemSetList().size() ==0) { throw new CartEmptyException("장바구니에 상품이 없습니다", "../item/list.shop"); } mav.addObject("cart", cart); return mav; } /* 주문하기 => 주문전 확인 <조건 (예외)> 1. 로그인이 반드시 필요함 2. 장바구니에 상품이 있어야함 ------------------------ 그래서 우리는 AOP aspect클래스를 만들어야해 */ // @RequestMapping("checkout") // public String checkout(HttpSession session) { // return "cart/checkout"; // } @RequestMapping("checkout") public ModelAndView checkout(HttpSession session) { ModelAndView mav = new ModelAndView("cart/checkout"); return mav; } /* 주문확정 1. 세션에서 CART, loginUser 정보 조회 2. sale, saleitem 테이블 데이터 추가 3. 장바구니에서 상품 제거 4. cart/end.jsp 페이지로 이동 이름에 check가 붙는 이유 : AOP의 대상이 되는 클래스로 만들기위함 => 카드에 상품이 있고, 로그인이 되어있어야함 */ @RequestMapping("end") public ModelAndView checkend(HttpSession session) { ModelAndView mav = new ModelAndView(); // CART 정보 가져오기 Cart cart = (Cart)session.getAttribute("CART"); // 로그인 정보 가져오기 User loginUser = (User)session.getAttribute("loginUser"); // 2번, sale객체만 가져와서 view단에 전달하면 웬만한 정보는 다 불러올 수 있음 // 즉, sale에는 주문 정보 내역이 다 들어있게 됨 Sale sale = service.checkend(loginUser, cart); // 그리고 cart로 부터 getTotal()을 호출하면 주문상품의 총 금액이 리턴 됨 long total = cart.getTotal(); // 다 사고 나면, 장바구니CART의 내용을 제거 session.removeAttribute("CART"); mav.addObject("sale", sale); mav.addObject("total", total); return mav; // end.jsp로 보내줌 } }
4af8d215ea42c31d392b3f58f3adf88cd9cdb57c
d8d23c6b0b2af190009188dd03aa036473e8b717
/urule-core/src/main/java/com/bstek/urule/parse/flow/JoinNodeParser.java
0c49da14dd026d60acb8d217c9265123c97d7efd
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference" ]
permissive
wuranjia/myRule
30b3fdb73659221c32f88c968449de0b5cc29ded
6fd0cd6c13ac23ad7f678dda9def8b553d72901e
refs/heads/master
2022-12-16T09:45:05.495146
2019-10-17T02:10:21
2019-10-17T02:10:21
215,682,587
1
0
Apache-2.0
2022-12-10T03:12:54
2019-10-17T02:05:48
JavaScript
UTF-8
Java
false
false
1,507
java
/******************************************************************************* * Copyright 2017 Bstek * * 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.bstek.urule.parse.flow; import org.dom4j.Element; import com.bstek.urule.model.flow.JoinNode; /** * @author Jacky.gao * @since 2014年12月23日 */ public class JoinNodeParser extends FlowNodeParser<JoinNode> { public JoinNode parse(Element element) { JoinNode join=new JoinNode(element.attributeValue("name")); join.setConnections(parseConnections(element)); join.setEventBean(element.attributeValue("event-bean")); join.setX(element.attributeValue("x")); join.setY(element.attributeValue("y")); join.setWidth(element.attributeValue("width")); join.setHeight(element.attributeValue("height")); return join; } public boolean support(String name) { return name.equals("join"); } }
f7a0a6955f35a997a3a95e0b9984346b34079052
d950efaf59289fce3d96d2d243a17bfbf0d5a469
/src/main/java/com/casumo/blockbuster/BlockbusterConfiguration.java
1c3f91224f1ecad79d4512aab512381b0c35ae11
[]
no_license
fwachs/blockbuster
ea1acb673669ab97ff66568770a0a80f2cfa5666
965c0d5411f33de008cb09b83906bfee68d2c80c
refs/heads/master
2021-05-15T11:43:15.778241
2017-10-27T14:25:34
2017-10-27T14:25:34
108,272,049
0
0
null
null
null
null
UTF-8
Java
false
false
615
java
package com.casumo.blockbuster; import javax.validation.Valid; import javax.validation.constraints.NotNull; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; import io.dropwizard.db.DataSourceFactory; public class BlockbusterConfiguration extends Configuration { @Valid @NotNull @JsonProperty("database") private DataSourceFactory database = new DataSourceFactory(); public DataSourceFactory getDataSourceFactory() { return database; } public void setDatabase(DataSourceFactory database) { this.database = database; } }
eacdceb7543da07d5cbe52a6f4db37e6a87fb228
d1260123cd1b3fa277026b3c9edb2a33db3ba14f
/src/test/java/pl/sda/poznan/shop/chor/BasePaymentTest.java
97b9ffb6fbfe16f8d281e66c860861231db8b703
[]
no_license
slow-sculpture/tdd
ac1a23f950fa3f25d47532b23d019ce699a2eeb8
9098c68cd6f884f7a5c226f7fa9519a4b52853e3
refs/heads/master
2020-03-07T06:32:06.475732
2018-02-06T19:13:35
2018-02-06T19:13:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
438
java
package pl.sda.poznan.shop.chor; import org.junit.Test; import static org.junit.Assert.*; public class BasePaymentTest { @Test public void pay(){ Account account = new Account(); account.setBalance(1000D); Payment paypass = new PaypassPayment(account); Payment pinpay = new PinPayment(account); paypass.setNextHandler(pinpay); boolean isSuccess = paypass.handle(1000D); } }
8ce6370da3812077d9aca805e46e56ec00094496
f1d18655ae5df263c6f3133b0c9e6970cdb91f92
/Restaurant/src/main/java/com/project/Restaurant/payload/response/MessageResponse.java
a80817f1a89accf924c17266b4042400f9f84f67
[]
no_license
thunsirikorn/restaurant-springboot
8888408046d37f3b5dedc0fb34f4593bf8409176
cbb7f0d259e30769ecdd2ac7d81ba6239f17975a
refs/heads/master
2023-06-28T02:20:41.130366
2021-07-27T07:16:23
2021-07-27T07:16:23
389,689,811
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.project.Restaurant.payload.response; public class MessageResponse { private String message; public MessageResponse(String message) { this.message = message; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
acaabc2d6b77e2bf97d7ce842ff4f0b41d1ceffb
9fd2d6acbb8313817f56717063c6ece3cef98f2c
/com/google/android/gms/internal/ei.java
8c431cc65870a38ed803b0d58e1cafaaae830c00
[]
no_license
mathysaru/realestate
2d977f1a400ec8b30bc24c3f2f49f105ef61fafd
6bc640ff4774c690407bc37121886628be822458
refs/heads/master
2023-07-26T17:06:18.588404
2021-09-04T15:24:57
2021-09-04T15:24:57
403,090,679
0
0
null
null
null
null
UTF-8
Java
false
false
2,483
java
package com.google.android.gms.internal; import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public final class ei { private static final Pattern lT = Pattern.compile("\\\\."); private static final Pattern lU = Pattern.compile("[\\\\\"/\b\f\n\r\t]"); public static String I(String paramString) { Matcher localMatcher; Object localObject1; if (!TextUtils.isEmpty(paramString)) { localMatcher = lU.matcher(paramString); localObject1 = null; while (localMatcher.find()) { Object localObject2 = localObject1; if (localObject1 == null) { localObject2 = new StringBuffer(); } switch (localMatcher.group().charAt(0)) { default: localObject1 = localObject2; break; case '\b': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\b"); localObject1 = localObject2; break; case '"': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\\\\""); localObject1 = localObject2; break; case '\\': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\\\\\"); localObject1 = localObject2; break; case '/': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\/"); localObject1 = localObject2; break; case '\f': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\f"); localObject1 = localObject2; break; case '\n': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\n"); localObject1 = localObject2; break; case '\r': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\r"); localObject1 = localObject2; break; case '\t': localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\t"); localObject1 = localObject2; } } if (localObject1 != null) {} } else { return paramString; } localMatcher.appendTail((StringBuffer)localObject1); return ((StringBuffer)localObject1).toString(); } } /* Location: C:\Users\shivane\Decompilation\dex2jar-2.0\classes-dex2jar.jar!\com\google\android\gms\internal\ei.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
cff00cc2954625f71c518187e7749f91f5383808
08cac1af3273ff7ff02fbb816cd9b2da4e7a457f
/src/main/java/com/springmvc/ketao/entity/Admin.java
811095cda1b331dddb556b5cfd903cb59b9446d7
[ "Apache-2.0" ]
permissive
chenweixin/ketao
85cb815e5e6eba4251475c4dc08054a048e8216f
9bdda25b4baa4fad1cce4d878425bc038f36a5e8
HEAD
2016-08-11T17:27:55.374270
2016-05-02T14:27:51
2016-05-02T14:27:51
52,572,196
1
0
null
null
null
null
UTF-8
Java
false
false
779
java
package com.springmvc.ketao.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class Admin { @Id @Column(length=32) private String id; @Column(length=32) private String password; @Column(length=32) private String name; @Column(length=32) private boolean sex; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isSex() { return sex; } public void setSex(boolean sex) { this.sex = sex; } }
19198844458761aacaa32d9c9ec7be93782c18e9
102967cd716ffe70bba8757a0a69af8e48c42639
/Fifth_works_hanliang_2015210862/src/Fifth_works_Level4/Philosopher.java
4ae7e698e320124b28c6f7e774d748efc3016d00
[]
no_license
mrhanliang/hooyk
bb5468c2b364f0e70007cb3d371b33e405b56389
fcf3e601420b275aab01c469aec556d4e514ab8e
refs/heads/master
2021-01-10T06:15:03.050507
2015-11-20T15:01:31
2015-11-20T15:01:31
45,541,539
0
0
null
null
null
null
UTF-8
Java
false
false
796
java
package Fifth_works_Level4; public class Philosopher extends Thread { private String name; private Fork fork; public Philosopher(String name, Fork fork) { super(name); this.name = name; this.fork = fork; } public void run() { while (true) { thinking(); fork.takeFork(); eating(); fork.putFork(); } } public void eating() { System.out.println("I am Eating:" + name); try { sleep(1000);// 模拟吃饭,占用一段时间资源 } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void thinking() { System.out.println("I am Thinking:" + name); try { sleep(1000);// 模拟思考 } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
4dcc63b01e5e80bd8d87a23be7894cd36ae80bd7
5276cfc0ce7ecb1b3dab6aba7cea1a222d49978a
/SpringBoot-amqp/amqp-commons/src/test/java/top/lrshuai/amqp/commons/ServiceApplicationTests.java
638e02384e0008430347802dc708b2f093045a2b
[ "MIT" ]
permissive
wujiezero/Springboot
29ccb8f7191413fb9ff551bcfc9f9678c1c1a426
694a9c8d1f4e7e5363e6b70e462bdba4ed24ae2f
refs/heads/master
2023-06-11T02:25:39.382867
2023-06-05T01:28:26
2023-06-05T01:28:26
220,375,244
2
1
MIT
2023-09-08T23:19:33
2019-11-08T03:01:22
Java
UTF-8
Java
false
false
351
java
package top.lrshuai.amqp.commons; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class ServiceApplicationTests { @Test public void contextLoads() { } }
fbb5eddd4c4637e79809553db3f75de25c8d8fbe
849098b8e3df53d9c93e876a51ba2e21ad4a44f3
/134_gas_station.java
9942e8009d7ebca553428bd78b3733f0a7bfac75
[]
no_license
Elsa1024/leetcode_java
ee4816a6ad5f9ac656d138cb576ffcc9e7c30184
d2bb7f25093a4b0c483bc21fe86abc19109e9198
refs/heads/master
2020-03-08T04:49:43.367068
2018-10-27T18:06:21
2018-10-27T18:06:21
127,932,147
0
0
null
null
null
null
UTF-8
Java
false
false
644
java
class Solution { public int canCompleteCircuit(int[] gas, int[] cost) { int tank, target, counter, length = gas.length; for (int head = 0; head < length; head++) { counter = 0; tank = 0; while (counter < length) { target = (head + counter) % length; tank = tank + gas[target]; tank = tank - cost[target]; if (tank < 0) break; counter++; } if (counter == length && tank >= 0) return head; } return -1; } }
9309bc3833ba2dc84e2c9991649aaa4c5f4e4b69
c1a05f4f654c3413218350305394d080ace59ae5
/Quanlisach/QLSach.java
464bfd6f56dfe0930f8a36a8f4033773f2961661
[]
no_license
khanhtrong1999/opp-java
825e79422dd17921449450a362cc75a47e2b4cd6
9b3833e13d3ccaeeb907a94f09347ef78aed9ffd
refs/heads/master
2020-03-10T13:51:08.921196
2018-04-13T14:12:09
2018-04-13T14:12:09
129,410,151
0
0
null
null
null
null
UTF-8
Java
false
false
2,284
java
package Quanlisach; import java.util.ArrayList; import java.util.Scanner; import java.util.ArrayList; import java.util.Scanner; public class QLSach { public static void main(String[] args) { ArrayList<Sach> danhsach = new ArrayList<>(); int n=0; //so luong sach int luachon; int[] Array = null; Scanner key = new Scanner(System.in); do { System.out.println("-------MENU------"); System.out.println("1. Nhap thong tin sach"); System.out.println("2. Hien thi thong tin sach"); System.out.println("3. Sach xuat ban truoc nam n"); System.out.println("4. Thoat"); System.out.println("-------END-------"); while(true) { try { System.out.println("Moi ban nhap lua chon"); luachon = Integer.parseInt(key.nextLine()); if(luachon<0) { throw new NumberFormatException(); } break; } catch (Exception e) { System.out.println("Ban can nhap so nguyen duong"); } } switch(luachon) { case 1:{ while(true) { try { System.out.println("So luong sach: "); n = Integer.parseInt(key.nextLine()); if(n<0) { throw new NumberFormatException(); } break; } catch (Exception e) { System.out.println("Ban can nhap so nguyen duong"); } } Array = new int [n]; //mang luu tru n quyen sach for(int i=0;i<Array.length;i++) { System.out.println("quyen sach thu: "+(i+1)); Sach s = new Sach(); s.NhapTT(); danhsach.add(s); //them doi tuong cao danh sach } System.out.println("\n"); break; } case 2:{ for(int i=0;i<danhsach.size();i++) { danhsach.get(i).HienThiTT(); } break; } case 3:{ int nam; int dem=0; System.out.println("Nhap nam xuat ban: "); nam = Integer.parseInt(key.nextLine()); for(int i=0;i<danhsach.size();i++) { if(nam>danhsach.get(i).getNamXB()) { danhsach.get(i).HienThiTT(); dem++; } } System.out.println("\n"); if(dem==0) { System.out.println("Khong co quyen sach nao truoc nam: "+nam); } break; } case 4:{ break; } } } while(luachon!=4); } }
ccbdc6ccf042e0ad2e47319d936fab7943d8aeea
0b1a0b985782be29037aa16c63bdadd6c35e0f60
/app/src/main/java/com/aoyj/learn/canvas_master/BaseGraphActivity.java
e7dc556bbfc834d404b7944acd510a130b83e02b
[]
no_license
aoyj/canvansMaster-master2
f4e9ee55e6aea513d0dceb34f743229f9bcf56df
1ffed583a0b506b60b6ec07995ac34041fb80e26
refs/heads/master
2020-03-28T12:26:53.834277
2018-09-11T09:39:04
2018-09-11T09:39:04
148,299,274
0
0
null
null
null
null
UTF-8
Java
false
false
696
java
package com.aoyj.learn.canvas_master; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; /** * Created by aoyuanjie on 2018/7/23. */ public class BaseGraphActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_base_graph); } public static void toBaseGraphActivity(Context mContext){ Intent intent = new Intent(mContext,BaseGraphActivity.class); mContext.startActivity(intent); } }
0f1287e9708d4668743c0c51d64e10b055f627e2
377405a1eafa3aa5252c48527158a69ee177752f
/src/org/apache/http/impl/auth/SpnegoTokenGenerator.java
e1c66b823b5e652b0ee1870f54c7050bb6349158
[]
no_license
apptology/AltFuelFinder
39c15448857b6472ee72c607649ae4de949beb0a
5851be78af47d1d6fcf07f9a4ad7f9a5c4675197
refs/heads/master
2016-08-12T04:00:46.440301
2015-10-25T18:25:16
2015-10-25T18:25:16
44,921,258
0
1
null
null
null
null
UTF-8
Java
false
false
377
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package org.apache.http.impl.auth; import java.io.IOException; public interface SpnegoTokenGenerator { public abstract byte[] generateSpnegoDERObject(byte abyte0[]) throws IOException; }
f89075b786b631cf9b7b8909c08c788966bdeb58
6e045ae1e11ccde0810a8935afea22c3d1e90870
/src/test/java/com/it/pages/LoginPage.java
587ee0cbbc4aa4dc51e74bb94d38bac4bd48cb7f
[]
no_license
KsushaGit/TestNG
2bbe88722ea16e37dcca09f653b75416d09dc15c
98780ec9665cca87246c25bddc372ac97ace7a3c
refs/heads/master
2020-12-27T02:37:59.908024
2020-02-02T07:42:47
2020-02-02T07:42:47
237,736,425
0
0
null
null
null
null
UTF-8
Java
false
false
714
java
package com.it.pages; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class LoginPage extends BasePage{ @FindBy(name="login") private WebElement inputLogin; @FindBy(name="pass") private WebElement inputPassword; @FindBy(xpath="//input[@tabindex='5']") private WebElement btnLogin; protected void login(String userName, String password) { driver.scrollDown(); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } driver.scrollUp(); inputLogin.sendKeys(userName); inputPassword.sendKeys(password); btnLogin.click(); } }
546077d8a173488430beab05b04e1a7c1f07fad8
ba7f16b1109eb3acfdf4d6d4027332bfc99ec199
/src/main/java/com/twu/biblioteca/util/BookInfoBuilder.java
4cbfc34e5cc1f406b9abf3a2ad919e3fbf754404
[ "Apache-2.0" ]
permissive
twshli/twu-biblioteca-ShihaoLi
9ef928bc0d2a8db0f50444d70d2e5d67aaff45ba
8f3ccb9988d29edba7b56442f1c25baf99f48e3c
refs/heads/master
2021-06-29T21:49:00.751407
2017-09-19T05:40:06
2017-09-19T05:40:06
103,032,777
0
0
null
null
null
null
UTF-8
Java
false
false
536
java
package com.twu.biblioteca.util; import com.twu.biblioteca.model.Book; import java.util.List; import java.util.stream.Collectors; public class BookInfoBuilder { public static String generate(List<Book> books) { return books.stream() .map(BookInfoBuilder::generate) .collect(Collectors.joining("\n")); } private static String generate(Book book) { return String.format("| %s | %s | %d |", book.getTitle(), book.getAuthor(), book.getPublishYear()); } }
4bedcdabb03962a2f3290c406251ced8e490c9f8
1fe288972eee34aa03fa6586b6ed12bc1db5bb30
/src/main/java/com/go2group/jira/webwork/HipChatShareIssue.java
b52327ff9ca2dad692b5a7865f2484f39d09843a
[ "Apache-2.0" ]
permissive
go2group/hipchat-jira
d49883c708ff576cdc2b7591521274b1dea228cd
8603f18f6742b1d628ee2ac0583110e8db86e28d
refs/heads/master
2021-07-07T06:40:08.206564
2017-10-05T07:49:26
2017-10-05T07:49:26
105,635,016
0
0
null
null
null
null
UTF-8
Java
false
false
3,321
java
package com.go2group.jira.webwork; import java.util.List; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import com.atlassian.jira.issue.Issue; import com.atlassian.jira.issue.IssueManager; import com.atlassian.jira.user.ApplicationUser; import com.atlassian.jira.web.action.JiraWebActionSupport; import com.atlassian.sal.api.ApplicationProperties; import com.atlassian.sal.api.UrlMode; import com.go2group.hipchat.HipChatProxyClient; import com.go2group.hipchat.components.ConfigurationManager; public class HipChatShareIssue extends JiraWebActionSupport { private static final long serialVersionUID = 1730424341299748179L; private String message; private String color; private String roomOption; private String notify; private String issueKey; private final HipChatProxyClient hipChatApiClient; private final ConfigurationManager configurationManager; private final IssueManager issueManager; private final ApplicationProperties applicationProperties; public HipChatShareIssue(HipChatProxyClient hipChatApiClient, ConfigurationManager configurationManager, IssueManager issueManager, ApplicationProperties applicationProperties) { this.hipChatApiClient = hipChatApiClient; this.configurationManager = configurationManager; this.issueManager = issueManager; this.applicationProperties = applicationProperties; } @Override public String doDefault() throws Exception { return super.doDefault(); } @Override public String doExecute() throws Exception { String baseUrl = applicationProperties.getBaseUrl(UrlMode.ABSOLUTE); if (!StringUtils.isEmpty(message)) { String authToken = configurationManager.getHipChatApiToken(); if (authToken != null) { Issue issue = this.issueManager.getIssueObject(issueKey); if (issue != null) { List<String> roomsToNotify = this.configurationManager.getHipChatRooms(issue.getProjectObject() .getKey()); ApplicationUser loggedInuser = getLoggedInUser(); String updatedMessage = "<a href=\"" + baseUrl + "/secure/ViewProfile.jspa?name=" + StringEscapeUtils.escapeHtml(loggedInuser.getName()) + "\">" + StringEscapeUtils.escapeHtml(loggedInuser.getDisplayName()) + "</a> Shared <a href=\"" + baseUrl + "/browse/" + issueKey + "\">" + issueKey + "</a> with the following message:<br><code>" + message + "</code>"; for (String room : roomsToNotify) { this.hipChatApiClient.notifyRoom(authToken, room, updatedMessage, color, "html", getNotify()); } } } } else { addErrorMessage("Message cannot be empty"); return SUCCESS; } return getRedirect(baseUrl + "/browse/" + issueKey); } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public String getRoomOption() { return roomOption; } public void setRoomOption(String roomOption) { this.roomOption = roomOption; } public String getNotify() { return notify; } public void setNotify(String notify) { this.notify = notify; } public String getIssueKey() { return issueKey; } public void setIssueKey(String issueKey) { this.issueKey = issueKey; } }
4218b3f8d070af21a8afe21b98c576258083d2b5
c099d4ff9a4d6b4aee02bf9b7d64c771bb62c41f
/Java/hydra/src/main/java/uk/co/shastra/hydra/messaging/messagefetchers/MessageFetcher.java
3c44f4f2458113a19e438a917e2e5c130af4e00d
[]
no_license
NorthNick/hydra
a4071132360fb79ca11d3297ccf48d0d77a77351
fa7bdb3227fa5d26bea4a1d33cefa744c0154764
refs/heads/master
2021-05-26T05:46:05.938573
2016-01-30T17:00:29
2016-01-30T17:00:29
4,812,536
3
0
null
2020-10-12T22:22:38
2012-06-27T19:26:22
C#
UTF-8
Java
false
false
548
java
package uk.co.shastra.hydra.messaging.messagefetchers; import uk.co.shastra.hydra.messaging.TransportMessage; import uk.co.shastra.hydra.messaging.messageids.MessageId; import uk.co.shastra.hydra.messaging.storage.Store; public interface MessageFetcher<TMessage extends TransportMessage> { // Messages with MessageId > startId and with SeqId <= lastSeq Iterable<TMessage> messagesAfterIdUpToSeq(Store store, MessageId startId, long lastSeq); Iterable<TMessage> messagesInSet(Store store, Iterable<MessageId> messageIds); }
b34f46ec241f6bd542b3452b0e25f58b36f1eaa2
0bdb4723f5511cfa741fa8ea459785dcb7042025
/core/src/main/java/org/broadleafcommerce/core/search/domain/SearchSynonymImpl.java
a9fb6a2d3921512e471da96191e15df29ad6471d
[]
no_license
gkopevski/webshop
31614ea46b5bb23f8e165ec81bf3b59c6477ae69
35e1ea1978af524c8cfbd7b3a51f0bc88c9c3555
refs/heads/master
2021-01-18T11:04:53.006489
2014-08-19T14:45:06
2014-08-19T14:45:06
12,617,709
0
1
null
null
null
null
UTF-8
Java
false
false
2,559
java
/* * Copyright 2008-2013 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.broadleafcommerce.core.search.domain; import org.apache.commons.lang.StringUtils; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Index; import org.hibernate.annotations.Parameter; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "BLC_SEARCH_SYNONYM") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="blStandardElements") public class SearchSynonymImpl implements SearchSynonym { @Id @GeneratedValue(generator = "SearchSynonymId") @GenericGenerator( name="SearchSynonymId", strategy="org.broadleafcommerce.common.persistence.IdOverrideTableGenerator", parameters = { @Parameter(name="segment_value", value="SearchSynonymImpl"), @Parameter(name="entity_name", value="org.broadleafcommerce.core.search.domain.SearchSynonymImpl") } ) @Column(name = "SEARCH_SYNONYM_ID") private Long id; @Column(name = "TERM") @Index(name="SEARCHSYNONYM_TERM_INDEX", columnNames={"TERM"}) private String term; @Column(name = "SYNONYMS") private String synonyms; public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Override public String getTerm() { return term; } @Override public void setTerm(String term) { this.term = term; } @Override public String[] getSynonyms() { return synonyms.split("|"); } @Override public void setSynonyms(String[] synonyms) { this.synonyms = StringUtils.join(synonyms, '|'); } }
e72918f73218870407a5d2cbeef3c49c1e8c6baf
653f24b19d64a0642b3e1b01593bbc79de9944a5
/mapReduceTest/src/mapred/exam/stock/StockDriver.java
f21e59c07a824295e36e6760abe510846321537e
[]
no_license
jaywagger/Big-Data
35a1a3b7e149fa7084b53254fb8d278d039ab2d7
e53437f72daba7f339614506947b098102788e3b
refs/heads/master
2022-12-22T10:11:37.740472
2020-05-01T10:08:58
2020-05-01T10:08:58
241,073,922
0
0
null
2022-12-16T07:17:26
2020-02-17T09:59:08
JavaScript
UTF-8
Java
false
false
1,855
java
package mapred.exam.stock; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.input.TextInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat; //맵리듀스를 실행하기 위한 일련의 작업을 처리하는 클래스 public class StockDriver { public static void main(String[] args)throws Exception { //1. 맵리듀스를 처리하기 위한 job을 생성 Configuration conf = new Configuration(); Job job = new Job(conf, "stock"); //2. 실제 job을 처리하기 위한 클래스가 어떤 클래스인지 등록 // 실제 우리가 구현한 Mapper, Reducer, Driver를 등록 job.setMapperClass(StockMapper.class); job.setReducerClass(StockReducer.class); job.setJarByClass(StockDriver.class); //3. HDFS에서 읽고 쓸 input데이터와 output데이터의 포맷을 정의 // => hdfs에 텍스트파일의 형태로 input/output을 처리 job.setInputFormatClass(TextInputFormat.class); job.setOutputFormatClass(TextOutputFormat.class); //4. 리듀스의 출력데이터에 대한 키와 value의 타입을 정의 job.setOutputKeyClass(Text.class); job.setOutputValueClass(IntWritable.class); //5. hdfs의 저장된 파일을 읽고 쓸 수 있는 Path객체를 정의 FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1])); //6. 1번~5번까지 설정한 내용을 기반으로 job이 실행되도록 명령 job.waitForCompletion(true); } }
e1775c08688538f8b00ac60e576726a984a1d22d
cb7fa2c8eaf80a2fa6c7bee09cc9bb3cad1388fc
/src/main/java/com/springboot/framework/interceptor/AccessControlInterceptor.java
497038bf3b89605f41890e64b79ed752f7b84c92
[]
no_license
huangpengfeiaq/liangying_backend
03de2f2d066217dca7f630ed21587f0f6857d4b6
e8556307f7205b7cb8bdcbed7a5fd5eb288b3603
refs/heads/master
2022-11-02T14:12:35.205427
2019-04-15T08:46:00
2019-04-15T08:46:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,795
java
package com.springboot.framework.interceptor; import com.springboot.framework.annotation.ACS; import com.springboot.framework.contants.Errors; import com.springboot.framework.dao.entity.Admin; import com.springboot.framework.dao.entity.LogAdmin; import com.springboot.framework.service.LogService; import com.springboot.framework.service.RedisTokenService; import com.springboot.framework.util.ExceptionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; /** * 权限控制拦截器. * * @author [email protected] */ @Component public class AccessControlInterceptor extends HandlerInterceptorAdapter { @Autowired protected RedisTokenService redisTokenService; @Autowired protected LogService logService; private static final List<String> noLoginResources = new ArrayList<String>() { private static final long serialVersionUID = 1L; { // swagger相关资源不需要登 add("/swagger-ui.html"); add("/configuration"); add("/swagger-resources"); add("/api-docs"); add("/v2/api-docs"); add("/webjars"); add("/devicerequest/*"); add("/admin/login"); // add("/sms/*"); add("/error"); } }; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 不需要进行访问控制的资源过滤 String uri = request.getRequestURI(); for (String resource : noLoginResources) { if (uri.startsWith(resource)) { return true; } } if (handler instanceof HandlerMethod) { ACS acs = ((HandlerMethod) handler).getMethodAnnotation(ACS.class); // 判断是否允许匿名访问 if (acs != null && acs.allowAnonymous()) { return true; } } // 缓存获取验证 Admin user = redisTokenService.getSessionUser(request); if (user == null) { ExceptionUtil.throwException(Errors.SYSTEM_NOT_LOGIN); } return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { //请求日志记录 //User user =(User)request.getSession().getAttribute(Const.CURRENT_USER); Admin record = redisTokenService.getSessionUser(request); LogAdmin sysLog = new LogAdmin(); // sysLog.setType("1"); sysLog.setRemoteAddress(redisTokenService.getRemoteIP(request)); sysLog.setRequestUri(request.getRequestURI()); sysLog.setMethod(request.getMethod()); sysLog.setException(ex != null ? ex.toString() : ""); sysLog.setCreateBy(record.getAccount()); Enumeration<String> e = request.getHeaders("Accept-Encoding"); StringBuffer userAgent = new StringBuffer(); while (e.hasMoreElements()) { userAgent.append(e.nextElement()); } sysLog.setTitle(userAgent != null ? userAgent.toString() : null); logService.insertSelective(sysLog); } }
9d8f7243ff666b8f858a4fe4f7b2889afffb770b
0429ec7192a11756b3f6b74cb49dc1ba7c548f60
/src/main/java/com/linkage/litms/netcutover/Object97orginal.java
3568c9f3f984c6791d07a6bfe0474218dc7bbbca
[]
no_license
lichao20000/WEB
5c7730779280822619782825aae58506e8ba5237
5d2964387d66b9a00a54b90c09332e2792af6dae
refs/heads/master
2023-06-26T16:43:02.294375
2021-07-29T08:04:46
2021-07-29T08:04:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,023
java
/** * @(#)Object97orginal.java 2006-1-19 * * Copyright 2005 联创科技.版权所有 */ package com.linkage.litms.netcutover; import java.util.List; /** * * @author yanhj * @version 1.00 * @since Liposs 2.1 */ public class Object97orginal { /**采集点ID*/ public List gather_id; /**工单唯一编号*/ public String work97id = ""; /**属地标识*/ public String work97areaid = ""; /**业务唯一标识*/ public String productid = ""; /**发送时间*/ public String sendtime = ""; /** * Constrator * */ public Object97orginal() { } /** * 采集点ID * @return Returns the gather_id. */ public List getGather_id() { return gather_id; } /** * 采集点ID * @param gather_id The gather_id to set. */ public void setGather_id(List gather_id) { this.gather_id = gather_id; } /** * 业务唯一标识 * @return Returns the productid. */ public String getProductid() { return productid; } /** * 业务唯一标识 * @param productid The productid to set. */ public void setProductid(String productid) { this.productid = productid; } /** * 发送时间 * @return Returns the sendtime. */ public String getSendtime() { return sendtime; } /** * 发送时间 * @param sendtime The sendtime to set. */ public void setSendtime(String sendtime) { this.sendtime = sendtime; } /** * 属地标识 * @return Returns the work97areaid. */ public String getWork97areaid() { return work97areaid; } /** * 属地标识 * @param work97areaid The work97areaid to set. */ public void setWork97areaid(String work97areaid) { this.work97areaid = work97areaid; } /** * 工单唯一编号 * @return Returns the work97id. */ public String getWork97id() { return work97id; } /** * 工单唯一编号 * @param work97id The work97id to set. */ public void setWork97id(String work97id) { this.work97id = work97id; } /** * @param args */ // public static void main(String[] args) { // // } }
[ "di4zhibiao.126.com" ]
di4zhibiao.126.com
2256986f90ad7add2ea258b8e2db1a8d1703889e
55fd8d1b797114a09f3e000f28306ec1ccbb931b
/src/com/yd/pattern/command/CommandTest.java
8fcecd86675563772d23eb15c449d37fbdbb77f3
[]
no_license
Zeb-D/JavaPattern
f62464c28329f60570395d7d4fc4a16d65a8fae0
bdbe935146324eca01a8015568615de99b83cc97
refs/heads/master
2021-06-30T02:00:20.155328
2017-08-24T13:49:55
2017-08-24T13:49:55
101,298,629
2
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.yd.pattern.command; public class CommandTest { public static void main(String[] args) { Receiver receiver = new Receiver(); Command cmd = new MyCommand(receiver); Invoker invoker = new Invoker(cmd); invoker.action(); } }
109bcbd9bcd20ec400d15ea4b77e2052bc0695be
7260adb2b3ca95713fb9c6f5ccc0d8db438c0ae1
/backend/src/main/java/com/auth0/flickr2/web/rest/errors/package-info.java
fb2c90f35c220258938821c0603747cad0d9dbd5
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
riyaz-programmer/mobile-jhipster
7550292f1411923ae00e738551a014ff8f06b3c4
005838f7f82a0dd5059e811d38f08fc7bfba70d3
refs/heads/main
2023-08-25T19:49:46.601726
2021-11-10T18:16:34
2021-11-10T18:16:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
192
java
/** * Specific errors used with Zalando's "problem-spring-web" library. * * More information on https://github.com/zalando/problem-spring-web */ package com.auth0.flickr2.web.rest.errors;
db0d39d16e0f77761faa1867338a01f8abded5d8
a424c06ad1d6eab7ef49f1a60a041b6ee36aae80
/src/main/java/org/tamacat/di/define/BeanConstructorParam.java
b8ab9f12f5a4c816fc279588904ddc5c3f028b11
[ "Apache-2.0" ]
permissive
tamacat/tamacat-core
06e783443a041b5f83d7e4268757775c079fbbbe
212274e51b89cba9de87834531fbe58af292da48
refs/heads/master
2023-08-20T23:02:49.771993
2023-08-15T15:43:46
2023-08-15T15:43:46
231,699,334
0
0
Apache-2.0
2023-04-12T17:42:07
2020-01-04T02:50:19
Java
UTF-8
Java
false
false
1,255
java
/* * Copyright (c) 2007 tamacat.org * All rights reserved. */ package org.tamacat.di.define; /** * Bean of parameter for constrctor. */ public class BeanConstructorParam implements Cloneable { private String refId; private String type; private String value; /** * Return an id of reference. * * @return */ public String getRefId() { return refId; } /** * Set a id of reference. * * @param refId */ public void setRefId(String refId) { this.refId = refId; } /** * Return whether this bean use the reference. */ public boolean isRef() { return refId != null; } /** * Return a String of class name. * * @return */ public String getType() { return type; } /** * Set the String of class name. * * @param type */ public void setType(String type) { this.type = type; } /** * Return a value. * * @return */ public String getValue() { return value; } /** * Set the value. * * @param value */ public void setValue(String value) { this.value = value; } @Override public BeanConstructorParam clone() { try { return (BeanConstructorParam) super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } } }
02f0a06f614205a1f90acc7a848c5193aa4109bb
21b3726c93519d1a5ea938931846f86f600cd243
/AWTStudy/src/ContainerExample.java
b10b908efd147723c7d7ca245821c9a31bdbec0d
[]
no_license
lcw9206/hanaTI_practice
ee06917e70eaf1616feb8a5874e635b8b4002b2b
fc49757051718e4e907ed46747f35c07a32232d9
refs/heads/master
2020-03-27T13:00:39.810346
2018-10-30T09:44:42
2018-10-30T09:44:42
146,584,466
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
import java.awt.Dialog; import java.awt.FileDialog; import java.awt.Frame; import java.awt.Window; public class ContainerExample { public static void main(String[] args) { Frame owner = new Frame(); owner.setSize(400, 200); owner.setVisible(true); // dialog의 true 옵션은 모달 활성화(뒤의 창 선택 불가능) Dialog dialog = new Dialog(owner, "안녕", false); dialog.setSize(100, 100); dialog.setVisible(true); // 최상위 객체로 Frame, Dialog 등 다양한 것들이 Window를 상속받아 사용한다. Window window = new Window(owner); window.setSize(400, 200); window.setVisible(true); FileDialog fd = new FileDialog(owner, "파일열기", FileDialog.LOAD); fd.setVisible(true); } }
cf16526647406f91ad3627b1944a4460562d64ab
6410914fc77ec4769df70c393773dc5a91c43d34
/src/main/java/org/ayahiro/practice/design_patterns/structural/facade/Facade.java
4358cd22029608360f87fb4321f3bc93c5f6f6c3
[]
no_license
AyaHiro0516/learn-practice
62aac89dd0314a456f03456a72b5edabd405f39e
abdf0851a4de9ac4a8b90238bbca888fd7763c3c
refs/heads/master
2021-07-16T09:29:43.430585
2020-08-01T02:45:12
2020-08-01T02:45:12
196,793,904
0
0
null
null
null
null
UTF-8
Java
false
false
1,409
java
package org.ayahiro.practice.design_patterns.structural.facade; /** * @Author ayahiro * @Description: 为子系统中的一组接口提供一个一致的界面, 外观模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 * @Create: 2019/7/18 */ public class Facade { public static void main(String[] args) { Fund fund = new Fund(); fund.buyFund(); fund.sellFund(); } } //Facade class Fund { private Stock stock; private NationalDebt nationalDebt; private Realty realty; public Fund() { stock = new Stock(); nationalDebt = new NationalDebt(); realty = new Realty(); } public void buyFund() { stock.buy(); nationalDebt.buy(); realty.buy(); } public void sellFund() { stock.sell(); nationalDebt.sell(); realty.sell(); } } //SubSystem class Stock { public void sell() { System.out.println("卖股票"); } public void buy() { System.out.println("买股票"); } } class NationalDebt { public void sell() { System.out.println("卖国债"); } public void buy() { System.out.println("买国债"); } } class Realty { public void sell() { System.out.println("卖房产"); } public void buy() { System.out.println("买房产"); } }
fde678602c90cf89174b89bbce66c50475bc4766
cf729a7079373dc301d83d6b15e2451c1f105a77
/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201506/cm/CampaignAdExtensionApprovalStatus.java
f112f7ddfdeaa58d4f4c0f15a3c788ec659272d4
[]
no_license
cvsogor/Google-AdWords
044a5627835b92c6535f807ea1eba60c398e5c38
fe7bfa2ff3104c77757a13b93c1a22f46e98337a
refs/heads/master
2023-03-23T05:49:33.827251
2021-03-17T14:35:13
2021-03-17T14:35:13
348,719,387
0
0
null
null
null
null
UTF-8
Java
false
false
1,235
java
package com.google.api.ads.adwords.jaxws.v201506.cm; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CampaignAdExtension.ApprovalStatus. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="CampaignAdExtension.ApprovalStatus"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="APPROVED"/> * &lt;enumeration value="UNCHECKED"/> * &lt;enumeration value="DISAPPROVED"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "CampaignAdExtension.ApprovalStatus") @XmlEnum public enum CampaignAdExtensionApprovalStatus { /** * * Approved. * * */ APPROVED, /** * * Unchecked. * * */ UNCHECKED, /** * * Disapproved. * * */ DISAPPROVED; public String value() { return name(); } public static CampaignAdExtensionApprovalStatus fromValue(String v) { return valueOf(v); } }
6f973a0ea349d1b39bbb4c4ba5a4da322bf82503
bec686b9c0c0d95c99095097a5e604c5ef01828b
/jdo/enhancer/src/test/java/org/datanucleus/enhancer/jdo/TestA20_7_1.java
0041e705363f40120ee74b8e352381ee363a8ae4
[ "Apache-2.0" ]
permissive
datanucleus/tests
d6bcbcf2df68841c1a27625a5509b87fa9ccfc9e
b47ac565c5988aba5c16389fb2870aafe9142522
refs/heads/master
2023-09-02T11:24:56.386187
2023-08-16T12:30:38
2023-08-16T12:30:38
14,927,016
10
18
Apache-2.0
2023-09-13T14:01:00
2013-12-04T15:10:03
Java
UTF-8
Java
false
false
852
java
package org.datanucleus.enhancer.jdo; /** */ public class TestA20_7_1 extends JDOTestBase { @SuppressWarnings("unchecked") public void testHasWriteObjectMethod() { try { Class classes[] = getEnhancedClassesFromFile("org/datanucleus/enhancer/samples/A20_7_1.jdo"); Class targetClass = findClass(classes, "org.datanucleus.enhancer.samples.CloneableClass"); Object o1 = targetClass.getDeclaredConstructor().newInstance(); Object o2 = targetClass.getMethod("clone", new Class[0]).invoke(o1, new Object[0]); if (o1 == o2) { fail(); } } catch (Throwable e) { e.printStackTrace(); fail(e.getClass().getName() + ": " + e.getMessage()); } } }
5cf35fca62492a1b72b096813ea14e32eba4a1f1
fdf1956b04eecb16152f93e9038afeb9a0a54c41
/src/main/java/com/capgemini/productapp/controller/ProductController.java
78152285698a081faa93eaf5d4d9e919a25c6963
[]
no_license
Srinivas-midde/ProductApp
fbf0e54f60b62eb1242c74ad54f63fe3b168798e
157520b18709cbb3c3b3d069f7148b6a58aed314
refs/heads/master
2020-03-30T20:06:25.390423
2018-10-05T12:29:06
2018-10-05T12:29:06
151,573,210
0
0
null
null
null
null
UTF-8
Java
false
false
2,623
java
package com.capgemini.productapp.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import com.capgemini.productapp.entity.Product; import com.capgemini.productapp.exception.ProductNotFoundException; import com.capgemini.productapp.service.ProductService; @RestController public class ProductController { private final Logger log = LoggerFactory.getLogger(ProductController.class); @Autowired private ProductService productService; @PostMapping("/product") public ResponseEntity<Product> addProduct(@RequestBody Product product) { ResponseEntity<Product> responseEntity = new ResponseEntity<Product>(productService.addProduct(product), HttpStatus.OK); log.info("Product added"); return responseEntity; } @PutMapping("/product") public ResponseEntity<Product> updateProduct(@RequestBody Product product) { try { productService.findProductById(product.getProductId()); return new ResponseEntity<Product>(productService.updateProduct(product), HttpStatus.OK); } catch (ProductNotFoundException exception) { // logged the exception } return new ResponseEntity<Product>(HttpStatus.NOT_FOUND); } @GetMapping("/products/{productId}") public ResponseEntity<Product> findProductById(@PathVariable int productId) { try { Product productFromDb = productService.findProductById(productId); return new ResponseEntity<Product>(productFromDb, HttpStatus.OK); } catch (ProductNotFoundException exception) { // logged the exception } return new ResponseEntity<Product>(HttpStatus.NOT_FOUND); } @DeleteMapping("/products/{productId}") public ResponseEntity<Product> deleteProduct(@PathVariable int productId) { try { Product productFromDb = productService.findProductById(productId); if (productFromDb != null) { productService.deleteProduct(productFromDb); return new ResponseEntity<Product>(HttpStatus.OK); } } catch (ProductNotFoundException exception) { // logged the exception } return new ResponseEntity<Product>(HttpStatus.NOT_FOUND); } }
23438b22cc1e9847c35626d98571b35bf3651b0e
d4627ad44a9ac9dfb444bd5d9631b25abe49c37e
/net/divinerpg/item/twilight/ItemVamacheron.java
32fb5fd31d11c326e54ac2d106900596c373a0ec
[]
no_license
Scrik/Divine-RPG
0c357acf374f0ca7fab1f662b8f305ff0e587a2f
f546f1d60a2514947209b9eacdfda36a3990d994
refs/heads/master
2021-01-15T11:14:03.426172
2014-02-19T20:27:30
2014-02-19T20:27:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,392
java
package net.divinerpg.item.twilight; import net.divinerpg.DivineRPG; import net.divinerpg.helper.base.ItemDivineRPG; import net.divinerpg.twilight.mobs.EntityVamacheron; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemVamacheron extends ItemDivineRPG { private World worldObj; public ItemVamacheron(int var1) { super(var1); this.maxStackSize = 1; setCreativeTab(DivineRPG.Spawn); } /** * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { int var4 = 0; if (!par3World.isRemote) { while (var4 < 1)//1 gets the amount of mobs to spawn at once { EntityVamacheron var5 = new EntityVamacheron(par3World); var5.setPosition(par4, par5+1, par6); par3World.spawnEntityInWorld(var5); ++var4; } } --par1ItemStack.stackSize; return true; } }
3905216e6b4b2ff5ae6a1bfe961eaf308db44eff
324576cb8528db0bdf4189b69c9b2c6009594888
/app/src/main/java/com/dafasoft/dragablegridview/MainActivity.java
cacf6f7121606ef64b59fca41079594362dcb7ce
[]
no_license
zylsdut/dragablegridview
b82a03dc79e004e7eabb3a86429729a42310b3a3
95d7b4a8878063d24b62de15b5f6edab1c13e722
refs/heads/master
2021-01-24T08:17:23.151050
2016-09-23T02:25:36
2016-09-23T02:25:36
68,909,012
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package com.dafasoft.dragablegridview; import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import java.util.ArrayList; import java.util.List; public class MainActivity extends Activity { private DragableGridView mDragableGv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mDragableGv = (DragableGridView) findViewById(R.id.drag_grid_view); MyAdapter adapter = new MyAdapter(this); List<String> list = new ArrayList<String>(); for (int i = 0 ; i < 30 ; i ++) { list.add("position" + i); } adapter.setList(list); mDragableGv.setAdapter(adapter); } }
5e630d3bc3f44a79b452971f908f711f39c05791
8a4463e2bdc52d384b8c51419138556c338216bf
/Network/src/main/java/com/mul/network/status/config/NetWorkType.java
fe6dd722244e8323685cee9de85b3ff20cfa8690
[]
no_license
zddcyf/MulNetWork
02ed792c3de4cdb9fa5f11097b5f750b4dc75db4
1dca93a3b992adabf84672e0d8a6bed3db3f4215
refs/heads/master
2023-07-20T01:00:32.710455
2021-08-23T02:06:50
2021-08-23T02:06:50
314,182,045
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package com.mul.network.status.config; import androidx.annotation.IntDef; /** * @ProjectName: MulNetWork * @Package: com.mul.network.status * @ClassName: NetWorkType * @Author: zdd * @CreateDate: 2020/11/19 14:58:28 * @Description: java类作用描述 * @UpdateUser: 更新者 * @UpdateDate: 2020/11/19 14:58:28 * @UpdateRemark: 更新说明 * @Version: 1.0.0 */ @IntDef({NetWorkType.NW_2G , NetWorkType.NW_3G , NetWorkType.NW_4G , NetWorkType.NW_5G , NetWorkType.NW_WIFI , NetWorkType.NW_ETHERNET , NetWorkType.NW_UNKNOWN}) public @interface NetWorkType { int NW_UNKNOWN = -1; // 无网络 int NW_2G = 2; // 2G网 int NW_3G = 3; // 3G网 int NW_4G = 4; // 4G网 int NW_5G = 5; // 5G网 int NW_WIFI = 6; // wifi网 int NW_ETHERNET = 7; // 以太网 }
966b97989f752c3273513993a1f1248cb4d0f031
edc022cae762a5c9b1eeede68eff12ec3cb72d91
/springboot/src/main/java/com/kit/util/map/MapUtil.java
0aea62f0cb0f66c4eae98198068f51ada9cd484a
[]
no_license
wanghengGit/tools_boot
ef81e41cef813776747fb580697528f506c38ae4
32149b16246493a8f862ea42389323db945e529a
refs/heads/master
2023-01-12T16:36:40.434803
2020-11-25T10:34:07
2020-11-25T10:34:07
289,696,946
0
1
null
null
null
null
UTF-8
Java
false
false
1,589
java
package com.kit.util.map; import com.alibaba.fastjson.JSONObject; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; /** * object->map * @author LENOVO * */ public class MapUtil { public static Map<String,Object> object2Map(Object object){ Map<String,Object> result=new HashMap<>(); //获得类的的属性名 数组 Field[] fields=object.getClass().getDeclaredFields(); try { for (Field field : fields) { field.setAccessible(true); String name = new String(field.getName()); result.put(name, field.get(object)); } }catch (Exception e){ e.printStackTrace(); } return result; } public static JSONObject mapToJson(Map<String,Object> map){ JSONObject json2=new JSONObject(); for (Entry<String,Object> entry : map.entrySet()) { json2.put(entry.getKey(),entry.getValue()); } return json2; } public static JSONObject objectToJson(Object object){ Map<String,Object> map=new HashMap<>(); //获得类的的属性名 数组 Field[] fields=object.getClass().getDeclaredFields(); try { for (Field field : fields) { field.setAccessible(true); String name = new String(field.getName()); map.put(name, field.get(object)); } }catch (Exception e){ e.printStackTrace(); } JSONObject json2=new JSONObject(); for (Entry<String,Object> entry : map.entrySet()) { json2.put(entry.getKey(),entry.getValue()); } return json2; } }
b33a9b2dfee2d2710bb74048fee48e6efc10150f
6eee97ac83e4475a1fece93c00537d66d63b7da6
/VG SCFC-financing-cis-coremgr/src/com/vg/scfc/financing/cis/entmgr/FamilyManager.java
0d1648277f184f2413689e9edd01f2ecd648f357
[]
no_license
viajero-dev/CIS
56025baf9bec25be17b89002be90d8b15163f16a
53f3f3848d0288a24e98e80a1a25e66b6aad1986
refs/heads/master
2016-09-15T09:05:32.960323
2015-10-13T00:56:54
2015-10-13T00:56:54
11,938,158
0
0
null
null
null
null
UTF-8
Java
false
false
3,720
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.vg.scfc.financing.cis.entmgr; import com.vg.commons.util.StringUtils; import com.vg.scfc.financing.cis.ent.Family; import com.vg.scfc.financing.cis.interceptor.ClientInfoInterceptor; import com.vg.scfc.financing.cis.util.ClientInfoUtil; import java.util.ArrayList; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import org.slf4j.LoggerFactory; /** * * @author raffy */ public class FamilyManager { private static FamilyManager instance; public static FamilyManager getInstance() { if (instance == null) { instance = new FamilyManager(); } return instance; } public synchronized boolean insert(Family family) { ClientInfoInterceptor interceptor = new ClientInfoInterceptor(); Session session = ClientInfoUtil.getSessionFactory().openSession(interceptor); interceptor.setSession(session); interceptor.setLocation(family.getLocation()); session.beginTransaction(); boolean isSuccessful = false; try { session.save(family); session.getTransaction().commit(); isSuccessful = true; } catch (Exception e) { session.getTransaction().rollback(); LoggerFactory.getLogger(FamilyManager.class).error(StringUtils.formatException(e)); isSuccessful = false; } finally { session.close(); return isSuccessful; } } public synchronized boolean update(Family family) { ClientInfoInterceptor interceptor = new ClientInfoInterceptor(); Session session = ClientInfoUtil.getSessionFactory().openSession(interceptor); interceptor.setSession(session); interceptor.setLocation(family.getLocation()); session.beginTransaction(); boolean isSuccessful = false; try { session.update(family); session.getTransaction().commit(); isSuccessful = true; } catch (Exception e) { session.getTransaction().rollback(); LoggerFactory.getLogger(FamilyManager.class).error(StringUtils.formatException(e)); isSuccessful = false; } finally { session.close(); return isSuccessful; } } public Family findById(String formNo, String personTypeId, String famRelation) { Session session = ClientInfoUtil.getSessionFactory().openSession(); session.beginTransaction(); Family family = new Family(); Criteria criteria = session.createCriteria(Family.class); criteria.add(Restrictions.eq("pk.txFormNo", formNo)); criteria.add(Restrictions.eq("pk.personType.typeID", personTypeId)); criteria.add(Restrictions.eq("pk.famRelation", famRelation)); family = (Family) criteria.uniqueResult(); session.getTransaction().commit(); session.close(); return family; } public List<Family> findById(String formNo, String personTypeId) { Session session = ClientInfoUtil.getSessionFactory().openSession(); session.beginTransaction(); List<Family> families = new ArrayList<Family>(); Criteria criteria = session.createCriteria(Family.class); criteria.add(Restrictions.eq("pk.txFormNo", formNo)); criteria.add(Restrictions.eq("pk.personType.typeID", personTypeId)); families = (List<Family>) criteria.list(); session.getTransaction().commit(); session.close(); return families; } }
[ "raffy@raffy-System-Product-Name.(none)" ]
raffy@raffy-System-Product-Name.(none)
c8ec8513bf60e918058a6f57ae23c0360e026864
f405015899c77fc7ffcc1fac262fbf0b6d396842
/sec2-keyserver/sec2-frontend/src/main/java/org/sec2/frontend/processors/BackendJob.java
98d9aa273c7f7b5e446de0aa38de89a89ef46c5f
[]
no_license
OniXinO/Sec2
a10ac99dd3fbd563288b8d21806afd949aea4f76
d0a4ed1ac97673239a8615a7ddac1d0fc0a1e988
refs/heads/master
2022-05-01T18:43:42.532093
2016-01-18T19:28:20
2016-01-18T19:28:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,246
java
/* * Copyright 2012 Ruhr-University Bochum, Chair for Network and Data Security * * This source code is part of the "Sec2" project and as this remains property * of the project partners. Content and concepts have to be treated as * CONFIDENTIAL. Publication or partly disclosure without explicit * written permission is prohibited. * For details on "Sec2" and its contributors visit * * http://nds.rub.de/research/projects/sec2/ */ package org.sec2.frontend.processors; import org.sec2.saml.xml.Sec2RequestMessage; /** * A container that encapsulates a Sec2RequestMessage, * the corresponding client's ID and the request's ID. * * @author Dennis Felsch - [email protected] * @version 0.1 * * March 12, 2012 */ public final class BackendJob { /** * The request of the client. */ private Sec2RequestMessage sec2Object; /** * The client's ID. */ private String clientID; /** * The request's ID. */ private String requestID; /** * Constructor. * * @param pSec2Object The request of the client * @param pClientID The client's ID * @param pRequestID The request's ID */ public BackendJob(final Sec2RequestMessage pSec2Object, final String pClientID, final String pRequestID) { if (pSec2Object == null) { throw new IllegalArgumentException( "Parameter pSec2Object must not be null"); } if (pClientID == null) { throw new IllegalArgumentException( "Parameter pClientID must not be null"); } if (pRequestID == null) { throw new IllegalArgumentException( "Parameter pRequestID must not be null"); } this.sec2Object = pSec2Object; this.clientID = pClientID; this.requestID = pRequestID; } /** * @return the sec2Object */ public Sec2RequestMessage getSec2Object() { return sec2Object; } /** * @return the clientID */ public String getClientID() { return clientID; } /** * @return the requestID */ public String getRequestID() { return requestID; } }
[ "developer@developer-VirtualBox" ]
developer@developer-VirtualBox
28083b6ea8a2441d4685cfda6c955019ca602d39
3c5a29470f94612691b77984b65c434bb7d01ca7
/New/StrategyPattern/app/src/androidTest/java/com/ethanco/strategypattern/ApplicationTest.java
cfdc1c7e57fb7b7ea8b83c9f0cc0fdf4a2c3af11
[]
no_license
EthanCo/PatternsPractice
324072bfe81665839cff5cbdabb3ba4bd5b956c4
a0cb42ea4085ad1e9d11540c52ceba58fb3999de
refs/heads/master
2021-01-10T17:11:36.736755
2020-04-30T09:01:49
2020-04-30T09:01:49
49,206,824
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.ethanco.strategypattern; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
8a4520834bd5f8fc715e8bb92d988c6da22039c5
748d7e6da560d4adba84fa86816cb9323e7a14d7
/src/main/java/com/expedia/test/configuration/AppConfiguration.java
58fae6b335cd03e1fca3de4ac00f4eb165e98a3a
[]
no_license
ihabalnaqib/Expedia
5d445b6de2b2775c84290a3f69273b98369d6147
f9a09df1d2bc4a015960c74c2209a94c900f5bc1
refs/heads/master
2021-04-09T13:27:03.133764
2018-05-08T04:57:54
2018-05-08T04:57:54
125,702,004
0
0
null
null
null
null
UTF-8
Java
false
false
1,242
java
package com.expedia.test.configuration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.JstlView; @Configuration @EnableWebMvc @ComponentScan(basePackages = "com.expedia.test") public class AppConfiguration extends WebMvcConfigurerAdapter{ @Override public void configureViewResolvers(ViewResolverRegistry registry) { InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); viewResolver.setViewClass(JstlView.class); viewResolver.setPrefix("/WEB-INF/views/"); viewResolver.setSuffix(".jsp"); registry.viewResolver(viewResolver); } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("/static/"); } }
6e327577840b621e39d5787930a25e77ea515ff5
f2eac2342348732684cc05e229636f9e8b634e33
/src/main/java/jerryofouc/github/io/ReverseWordsinaStringIII.java
a93da9733d15cafa7a7c85b59a22a04c421570e3
[]
no_license
jerryofouc/leetcode
a0bf687a30fb373ffb8e235bd36c3fd6b9a63ed8
c1cbce9a7dad24cc860df24cf20f0f81b2ad76ae
refs/heads/master
2021-01-17T04:48:08.948479
2017-10-31T01:39:38
2017-10-31T01:39:38
16,881,085
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package jerryofouc.github.io; /** * Created by xiaojiez on 4/9/17. */ public class ReverseWordsinaStringIII { public static String reverseWords(String s) { String[] a = s.split(" "); for(int i=0;i<a.length;i++){ a[i] = new StringBuilder(a[i]).reverse().toString(); } return String.join(" ",a); } public static void main(String[] args) { System.out.println(reverseWords("Let's take LeetCode contest")); } }
06841f01ea1f5cb81901ceea87a8a99a36aa79fb
c851d3f7d79fb94f663414c2d1fd0c027479ab06
/src/main/java/com/grvtech/core/model/clinical/ClinicalData.java
4cd59d4808e10820f06b1270ffef41b2d2a97f59
[]
no_license
grvtech/grvoovemr-core
17afc96111d3b72283fcc78ba6da266800790fad
137d71d75e25fed9407e010eb1ece17f6ad9d8c3
refs/heads/master
2020-03-23T22:06:00.383288
2019-03-12T17:49:47
2019-03-12T17:49:47
142,152,854
0
0
null
null
null
null
UTF-8
Java
false
false
73
java
package com.grvtech.core.model.clinical; public class ClinicalData { }
930f602a54803a074555c5298f1eae7d446a393f
a0e4f155a7b594f78a56958bca2cadedced8ffcd
/sdk/src/main/java/org/zstack/sdk/ActionType.java
97e256dcaec0811351d4bc22b0710dbed21926ba
[ "Apache-2.0" ]
permissive
zhao-qc/zstack
e67533eabbbabd5ae9118d256f560107f9331be0
b38cd2324e272d736f291c836f01966f412653fa
refs/heads/master
2020-08-14T15:03:52.102504
2019-10-14T03:51:12
2019-10-14T03:51:12
215,187,833
3
0
Apache-2.0
2019-10-15T02:27:17
2019-10-15T02:27:16
null
UTF-8
Java
false
false
77
java
package org.zstack.sdk; public enum ActionType { drop, reject, accept, }
5d27d7a056bc6e2b99b07579aac1181d91709c46
7362183994195b0c3e08dd7f8be6e3f1c81aac85
/app/src/test/java/com/example/hp_pc/sqllite_sharepref/ExampleUnitTest.java
05de88b8446479e4615d64e60141acd6cf2906d7
[]
no_license
vilas639/Tabfragment
5d30cdea436c2a22f0996b37d27b27455e17eae6
ea890d0a01a0f9afd8a52124aa985c55e0649f82
refs/heads/master
2020-03-31T04:37:56.220261
2018-10-18T07:23:21
2018-10-18T07:23:21
151,914,316
0
0
null
null
null
null
UTF-8
Java
false
false
396
java
package com.example.hp_pc.sqllite_sharepref; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
22ba95792d701efeb0b6b973698cc4befa33f5b9
130dd96cfade6e5293c2b277a81dddf4b2e3190e
/app/src/main/java/com/techease/ultimatesavings/utils/networking/BaseNetworking.java
721d4082cdead36e380b6ea445466e409a863d21
[]
no_license
KashifAhmad/ultimateSavings
def832f2446ecbcea4b51b5959edb4adf57517c0
8500cb2fb8f8d0204d3088a804fdfc4f0e4ce2b3
refs/heads/master
2022-03-05T09:28:23.038595
2019-11-04T11:48:19
2019-11-04T11:48:19
188,822,255
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.techease.ultimatesavings.utils.networking; public class BaseNetworking { public static APIServices services; public static APIServices apiServices() { services = APIClient.getClient().create(APIServices.class); return services; } public static APIServices apiServices(String token) { services = APIClient.getClient(token).create(APIServices.class); return services; } }
572fde3d6b08aac4f6c5f18058591b4755a27705
91839b84f0ccb4688503d9bb2def2014cde98e92
/src/main/java/com/mbl/farm/dto/AnimalWinsDTO.java
67db3e113017cf50221370b3398eabd10fbe8d12
[]
no_license
bonat26/granja
7e44902efe6254755d4491b151b94a6f31d1247c
ee956e424cd64bc7588ec2af25b12768f3e731ac
refs/heads/master
2021-07-08T08:49:57.536501
2017-10-01T18:04:13
2017-10-01T18:04:13
104,443,820
0
0
null
null
null
null
UTF-8
Java
false
false
139
java
package com.mbl.farm.dto; import lombok.Data; @Data public class AnimalWinsDTO extends AnimalDTO{ private Integer wins; }
d439189e95ab152a01b8933fdfc87b805396f794
6fdeae78a7994950494da513bb7fc56ca5965582
/dy-api/src/main/java/com/youzan/cloud/dy/api/package-info.java
530e7cdbe3ca5b76f4d0c837c5ffcab1c4c8aed1
[]
no_license
youzan-isv/minigame-java-isv
84949242ac384deacafeb76ee82805c1f2d2e510
83c9bbd75162acdd8d5141ba421c602cea6d05a5
refs/heads/master
2023-06-14T05:58:37.688402
2021-07-13T01:56:02
2021-07-13T01:56:02
379,516,793
0
0
null
null
null
null
UTF-8
Java
false
false
33
java
package com.youzan.cloud.dy.api;
014dad9e66baa7d577819de9c0c4ef3fd9255365
674ddec0ab38ff7f8bd952f97e43a6848cce6e09
/app/src/main/java/com/example/sudhir_project_phase/Navigation_main.java
e00cef306c4d02513d59fa5a49e56070b7f5f267
[]
no_license
SudhirDeshwal/Mind_Meet_Android-Project
bb35b7e357b7d01b718f16b5fedbe38cb59c5e82
b8f83de064ee18d7d2048775dd204d6e58da2acf
refs/heads/master
2022-04-18T18:53:21.208631
2020-04-10T22:57:44
2020-04-10T22:57:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,088
java
package com.example.sudhir_project_phase; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.drawerlayout.widget.DrawerLayout; import android.os.Bundle; import com.google.android.material.navigation.NavigationView; public class Navigation_main extends AppCompatActivity { //Varibales DrawerLayout drawerLayout; NavigationView navigationView; Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_navigation_main); //Hooks drawerLayout = findViewById(R.id.drawer_layout); navigationView = findViewById(R.id.nav_view); toolbar = findViewById(R.id.toolbar); drawerLayout = findViewById(R.id.drawer_layout); //Tool bar setSupportActionBar(toolbar); //Navigation toggle // ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this,drawerLayout,toolbar); } }
4234efadef36e7d3b796ac70bd443b089ab204d5
5b480a3402d4f73a80abe4c9165b3a00f211c728
/stopWatchApi/src/main/java/stopWatch/controller/TimeWatchView.java
61f00bf5eaddd807c55ecd07082a22f44ad93a52
[]
no_license
malitsadok/stopwatch
f9a6107d7a69e5e4a67fb05506cab3dab8ee36ba
c038a7fb86300157ae4cce1ea493796d338aa643
refs/heads/master
2023-01-12T00:48:19.624277
2020-01-16T06:53:08
2020-01-16T06:53:08
234,186,266
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package stopWatch.controller; import java.util.UUID; public class TimeWatchView { private String timeWatchLabel ; private UUID id ; public TimeWatchView(UUID id2, String timeWatch) { this.timeWatchLabel = timeWatch; this.id = id2 ; } public String getTimeWatch() { return timeWatchLabel; } public void setTimeWatch(String timeWatch) { this.timeWatchLabel = timeWatch; } public UUID getId() { return id; } public void setId(UUID id) { this.id = id; } }
04625781766accea6dec943c05ca16815366318d
90cee1b3a73805bf4665111e939069b2bd333916
/src/main/java/com/codingdojo/demo/repositories/UserRepository.java
2256995bf063a227c81f257ff5b38fb09a82354b
[]
no_license
Valeria-Romero/LoginAndRegistration
36f711c0334bcef9ba9f5c6ea027f355c7eb387f
84b0df2ec5d7dbc50de4a22437246eb3744d5896
refs/heads/main
2023-08-28T07:19:40.490557
2021-11-02T21:45:07
2021-11-02T21:45:07
424,007,805
0
0
null
null
null
null
UTF-8
Java
false
false
761
java
package com.codingdojo.demo.repositories; import java.util.List; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.transaction.annotation.Transactional; import com.codingdojo.demo.models.User; public interface UserRepository extends CrudRepository<User, Long> { @Query( "SELECT u FROM User u WHERE email = ?1" ) List<User> selectUserByEmail( String email ); @Modifying @Transactional @Query( value = "INSERT INTO users(email, firstname, lastname, password) " + "VALUES(?1, ?2, ?3, ?4)", nativeQuery = true ) void insertUser( String email, String firstname, String lastname, String password ); }
663332106a80c6e520db7698ab39e1535670cf6c
399e0c9e87c0f6a1993a477b0fef7618ddfa4d78
/src/com/java/ws/secure/container/CalculatorIfc.java
569b05668d39dbf4f3f6dcce25c140868df9d31d
[]
no_license
aakash140/WebService_Secure_Container
2ba195576d2a17912aab843a7a03f42cb233ca3c
e8572868530240dc0d066529464d3e6e8ecc0b47
refs/heads/master
2021-01-10T14:44:27.277552
2016-02-06T14:29:16
2016-02-06T14:29:16
51,205,648
0
0
null
null
null
null
UTF-8
Java
false
false
271
java
package com.java.ws.secure.container; import javax.jws.WebService; @WebService public interface CalculatorIfc { public int add(int num1,int num2); public int sub(int num1,int num2); public int multiply(int num1, int num2); public float divide(int num1,int num2); }
c51ad18f1f36a38392a9131f8138faf5923134df
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/7/7_8208cca974cd06d6500c7abd7389c419afb68bce/ListSorterUITest/7_8208cca974cd06d6500c7abd7389c419afb68bce_ListSorterUITest_t.java
df3775c5b7a1e87d924b60103266c68bda873c9c
[]
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,487
java
/* * Copyright (C) 2013 salesforce.com, 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.auraframework.components.ui.listSorter; import java.net.MalformedURLException; import java.net.URISyntaxException; import org.auraframework.test.*; import org.auraframework.test.WebDriverTestCase.TargetBrowsers; import org.auraframework.test.WebDriverUtil.BrowserType; import org.openqa.selenium.*; /** * UI automation for ui:ListSorter. * @userStory a07B0000000USVf */ @TargetBrowsers({BrowserType.GOOGLECHROME, BrowserType.FIREFOX, BrowserType.IE7}) public class ListSorterUITest extends WebDriverTestCase{ public static final String APP = "/uitest/listSorter_Test.cmp"; private final String ACTIVE_ELEMENT = "return $A.test.getActiveElement()"; public ListSorterUITest(String name) { super(name); } /** * Tab out should not close the sorter dialog * The focus should remain in the Sorter Menu * Test case for W-1985435 * @throws MalformedURLException * @throws URISyntaxException */ public void testTabOutOfListSorter() throws MalformedURLException, URISyntaxException { verifyTabOutAndEscBehaviour(Keys.TAB, true); } /** * Verify pressing ESC while listSorter is opened should close the list sorter * @throws MalformedURLException * @throws URISyntaxException */ public void testEscOfListSorter() throws MalformedURLException, URISyntaxException { verifyTabOutAndEscBehaviour(Keys.ESCAPE, false); } /** * If isOpen: true then listSorter should be open after pressing tab, * isopen: false, list sorter should be closed after pressing tab * @param key * @param isOpen * @throws URISyntaxException * @throws MalformedURLException */ private void verifyTabOutAndEscBehaviour(Keys keysToSend, boolean isOpen) throws MalformedURLException, URISyntaxException { open(APP); String trigger = "defaultListSorterTrigger"; String sorter = "defaultListSorter"; WebDriver driver = this.getDriver(); WebElement listTrigger = driver.findElement(By.className(trigger)); WebElement listSorter = driver.findElement(By.className(sorter)); //List Sorter dialog should be closed assertFalse("list Sorter Dialog should not be visible", listSorter.getAttribute("class").contains("open")); //click on Trigger listTrigger.click(); //check menu list is visible after the click assertTrue("list Sorter Dialog should be visible", listSorter.getAttribute("class").contains("open")); WebElement activeElement = (WebElement) auraUITestingUtil.getEval(ACTIVE_ELEMENT); activeElement.sendKeys(keysToSend); if(isOpen){ assertTrue("list Sorter Dialog should still be visible after pressing tab", listSorter.getAttribute("class").contains("open")); } else{ assertFalse("list Sorter Dialog should not be visible after pressing ESC", listSorter.getAttribute("class").contains("open")); } } }
4dcbbe868af6fdcb079e4abec39a9c6718430ae4
b31213ece6de237dce5865d14189cb92b35204cf
/Grasp/src/Expert/ItemVenda.java
e3ac8914c8a03831e574f4ff7f97aa77724dc07e
[]
no_license
johnsanford/Padroes_Projetos
fbd0e9337275246ed3a236f5968fe6ea34798cd8
23b3b1c3fe8e1ac2f6f0c62b5f22265de47f8380
refs/heads/master
2023-03-05T11:07:47.343731
2021-02-02T06:31:52
2021-02-02T06:31:52
313,789,670
0
0
null
null
null
null
UTF-8
Java
false
false
1,149
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Expert; /** * Padrão de projeto <b>GRASP - Information Expert</b> * * @author fabricio */ public class ItemVenda { private Integer quantidade; private Produto produto; /** * Este método calcula o valor de cada item vendido. * * Desta forma, estamos seguindo o padrão de projeto <b>Information * Expert</b> * * @return */ public Double getSubTotal() { return produto.getValor() * quantidade; } public ItemVenda() { } public ItemVenda(Integer quantidade, Produto produto) { this.quantidade = quantidade; this.produto = produto; } public Integer getQuantidade() { return quantidade; } public void setQuantidade(Integer quantidade) { this.quantidade = quantidade; } public Produto getProduto() { return produto; } public void setProduto(Produto produto) { this.produto = produto; } }
[ "John@DESKTOP-IKTHH71" ]
John@DESKTOP-IKTHH71
b693851f1f885e92316c89a3aa01d3f4bd664437
54375240423f941dd8e34bf62288ffe7a3967461
/learn/spring-concurrentcy/src/main/java/com/zhangyu/concurrency/Mlearn/process/concurrency/ConcurrencyFramework.java
b70255020d78a6db384d5e5bd906d29311384125
[]
no_license
BeeSoup/learn
713d82d683ab0d828f19da5f85f795139da6fa7e
a6aa3bd5abd682b01d97395391a80ecb6e75fa6a
refs/heads/learn
2023-05-13T16:38:38.550331
2023-04-18T13:30:10
2023-04-18T13:30:10
234,463,869
0
0
null
2023-05-07T18:54:22
2020-01-17T03:35:55
Java
UTF-8
Java
false
false
3,034
java
package com.zhangyu.concurrency.Mlearn.process.concurrency; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.StampedLock; /** * ReentrantLock 就Synchronized 的API实现 implicit monitor 隐性的 * <p> * :互斥 * :重进入 * :隐形的monitor机制 * <p> * 与synchronized 不同点 * 获得顺序(公平和非公平) * 限时锁定(tryLock) * 条件对象支持(Condition Support) * 运维方法 * <p> * <p> * 重进入读写锁:ReentrantLockReadWriteLock : 事物读,读锁共享锁,写锁:独占锁 * 包含ReentrantLock 所有特性 * 共享和独占的情况 * <p> * 共享模式 :复数,就是共享失败, 0就是共享,>0 就是重进入 * --判断写状态 * 中断Interruption * 降级: 写锁降为读锁 downgrade 关键字搜索 读写锁的Class里面 * * <p> * JAVA8 * 邮票锁:StampedLock 有版本的概念的锁 乐观锁 * 三种锁: * 写 * 读 * 优化读 * <p> * Demo Class Point关键字 */ public class ConcurrencyFramework { /** * Lock 锁机制 * 当Thread 进入 synchronized 的时候 * 1、在Thread (hold lock) ,调用Object#wait() 会释放锁 * 2、运行期异常的时候,Thread销毁的时候,也会释放 * 3、Java9 自旋 * 4、Thread Park的时候 --->LockSupport.park() unsafe.park() * 5. Condition#await() * 6. Thread.yield() * <p> * 最佳实践,除非必要,不要设置线程的优先级 */ public static void main(String[] args) { ReentrantLock lock = new ReentrantLock(); int holdCount = lock.getHoldCount(); System.out.printf("holdCount: %d\n", holdCount); //不记录历史,只是获取当前的hold的重进入数量 lock(lock, 10); holdCount = lock.getHoldCount(); System.out.printf("holdCount: %d\n", holdCount); } public static void tryLockTimeOut() { Lock lock = new ReentrantLock(); try { if (lock.tryLock(3, TimeUnit.SECONDS)) { try { // TODO some } finally { lock.unlock(); } } } catch (InterruptedException e) { //重置标志物 Thread.currentThread().interrupt(); // logger message } } public static void lock(Lock lock, int time) { try { if (time < 0) { return; } lock.lock(); lock(lock, --time); } finally { lock.unlock(); } } public static void stampLock() { StampedLock lock = new StampedLock(); long stamp = lock.tryOptimisticRead(); Lock readLock = lock.asReadLock(); try { readLock.lock(); lock.validate(stamp); } finally { readLock.unlock(); } } }
53d977efcb6c02bd697cf81c898cf5ec5b83c61d
e0282213c96a4421a40ca07444ce79f841181d6f
/src/inheritance/ShapeApp.java
00ae7b9825ffbfe747da97c7423694b1d673aecb
[]
no_license
shah-smit/JavaTutorial
59d74532f891fc219c3934611563968e6721948a
cc20a7f4bb4b25d13b6c14314f2af76692092db0
refs/heads/master
2021-01-18T16:47:36.560058
2018-10-21T04:33:02
2018-10-21T04:33:02
78,260,548
0
1
null
2018-10-01T08:43:38
2017-01-07T05:27:46
Java
UTF-8
Java
false
false
992
java
package inheritance; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.util.Random; import goo.Goo; public class ShapeApp extends Goo { private Shape shape; private Random random; private boolean fill = true; public ShapeApp(int w, int h, boolean tryFSE) { super(w, h, tryFSE); setRandom(new Random(2001)); } public void init(int n) { } public void draw(Graphics g) { if (!fill) getShape().draw(g); else getShape().fill(g); } public void mouseClicked(MouseEvent e) { init(shape.getNVertices()); repaint(); } public void keyPressed(KeyEvent e) { char key = e.getKeyChar(); if (key == 'f') fill = true; else if (key == 'd') fill = false; repaint(); } public void setRandom(Random random) { this.random = random; } public Random getRandom() { return random; } public void setShape(Shape shape) { this.shape = shape; } public Shape getShape() { return shape; } }
8ae90dcf2e0742b8de96b1d81a4e05e5cc558545
43df0aeaa5664d26eb7f852bcd1092335e2afdb0
/JPushExample/build/generated/source/r/debug/com/atguigu/beijingnews/R.java
cb853fd5d20bd1feaa898a99968c9bb55ca96a28
[]
no_license
Jackqgm/BeijingNews
d1e87b178776f80766721f15e40b9c096c472146
0b49c0745e7364a8b2079f241cdc9d6893b0bb09
refs/heads/master
2020-12-24T02:39:14.069715
2020-02-16T15:15:34
2020-02-16T15:17:48
233,406,855
0
0
null
null
null
null
UTF-8
Java
false
false
6,579
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.atguigu.beijingnews; public final class R { public static final class drawable { public static final int border_bg=0x7f010000; public static final int bottom_bg=0x7f010001; public static final int corners_bg=0x7f010002; public static final int ic_launcher=0x7f010003; public static final int jpush_ic_richpush_actionbar_back=0x7f010004; public static final int jpush_ic_richpush_actionbar_divider=0x7f010005; public static final int jpush_notification_icon=0x7f010006; public static final int richpush_btn_selector=0x7f010007; public static final int richpush_progressbar=0x7f010008; public static final int stripes=0x7f010009; public static final int tiledstripes=0x7f01000a; public static final int top_bg=0x7f01000b; } public static final class id { public static final int actionbarLayoutId=0x7f020000; public static final int bt_addtag=0x7f020001; public static final int bt_checktag=0x7f020002; public static final int bt_cleantag=0x7f020003; public static final int bt_deletealias=0x7f020004; public static final int bt_deletetag=0x7f020005; public static final int bt_getalias=0x7f020006; public static final int bt_getalltag=0x7f020007; public static final int bt_setalias=0x7f020008; public static final int bt_setmobileNumber=0x7f020009; public static final int bt_settag=0x7f02000a; public static final int bu_setTime=0x7f02000b; public static final int cb_friday=0x7f02000c; public static final int cb_monday=0x7f02000d; public static final int cb_saturday=0x7f02000e; public static final int cb_sunday=0x7f02000f; public static final int cb_thursday=0x7f020010; public static final int cb_tuesday=0x7f020011; public static final int cb_wednesday=0x7f020012; public static final int end_time=0x7f020013; public static final int et_alias=0x7f020014; public static final int et_mobilenumber=0x7f020015; public static final int et_tag=0x7f020016; public static final int fullWebView=0x7f020017; public static final int getRegistrationId=0x7f020018; public static final int icon=0x7f020019; public static final int imgRichpushBtnBack=0x7f02001a; public static final int imgView=0x7f02001b; public static final int init=0x7f02001c; public static final int layout_root=0x7f02001d; public static final int m_icon=0x7f02001e; public static final int m_text=0x7f02001f; public static final int m_title=0x7f020020; public static final int msg_rec=0x7f020021; public static final int popLayoutId=0x7f020022; public static final int pushPrograssBar=0x7f020023; public static final int push_notification_bg=0x7f020024; public static final int push_notification_big_icon=0x7f020025; public static final int push_notification_content=0x7f020026; public static final int push_notification_content_one_line=0x7f020027; public static final int push_notification_date=0x7f020028; public static final int push_notification_dot=0x7f020029; public static final int push_notification_layout_lefttop=0x7f02002a; public static final int push_notification_small_icon=0x7f02002b; public static final int push_notification_style_1=0x7f02002c; public static final int push_notification_style_1_big_icon=0x7f02002d; public static final int push_notification_style_1_content=0x7f02002e; public static final int push_notification_style_1_date=0x7f02002f; public static final int push_notification_style_1_title=0x7f020030; public static final int push_notification_style_default=0x7f020031; public static final int push_notification_sub_title=0x7f020032; public static final int push_notification_title=0x7f020033; public static final int push_root_view=0x7f020034; public static final int resumePush=0x7f020035; public static final int rlRichpushTitleBar=0x7f020036; public static final int setStyle0=0x7f020037; public static final int setStyle1=0x7f020038; public static final int setStyle2=0x7f020039; public static final int setting=0x7f02003a; public static final int start_time=0x7f02003b; public static final int stopPush=0x7f02003c; public static final int text=0x7f02003d; public static final int time=0x7f02003e; public static final int title=0x7f02003f; public static final int tvRichpushTitle=0x7f020040; public static final int tv_appkey=0x7f020041; public static final int tv_device_id=0x7f020042; public static final int tv_imei=0x7f020043; public static final int tv_package=0x7f020044; public static final int tv_regId=0x7f020045; public static final int tv_version=0x7f020046; public static final int wvPopwin=0x7f020047; } public static final class layout { public static final int customer_notitfication_layout=0x7f030000; public static final int customer_notitfication_layout_one=0x7f030001; public static final int jpush_popwin_layout=0x7f030002; public static final int jpush_webview_layout=0x7f030003; public static final int main=0x7f030004; public static final int push_notification=0x7f030005; public static final int push_set_dialog=0x7f030006; public static final int set_push_time=0x7f030007; } public static final class string { public static final int alias_hint=0x7f040000; public static final int app_name=0x7f040001; public static final int error_alias_empty=0x7f040002; public static final int error_network=0x7f040003; public static final int error_style_empty=0x7f040004; public static final int error_tag_empty=0x7f040005; public static final int error_tag_gs_empty=0x7f040006; public static final int hello=0x7f040007; public static final int logining=0x7f040008; public static final int mobilenumber_empty_guide=0x7f040009; public static final int mobilenumber_hint=0x7f04000a; public static final int setting_su=0x7f04000b; public static final int style_hint=0x7f04000c; public static final int tag_hint=0x7f04000d; } public static final class style { public static final int MyDialogStyle=0x7f050000; public static final int push_alias=0x7f050001; public static final int push_mobilenumber=0x7f050002; public static final int push_style=0x7f050003; public static final int push_tag=0x7f050004; } }
48cec258ae86a77ce33aad5deb88a33606af814c
5752dc22cb67772f370a57a41e0baa6172297a62
/gateway/src/main/java/com/containerstore/api/config/WebConfigurer.java
b5e847f241b68c17953261b78e0e3585af686927
[]
no_license
dilipkrish/jhipster-eureka
dbebb25861318cde3d18f04b5165dba219307587
94496bea14b76fe68ee2ee5ce75f8b601b56871e
refs/heads/master
2021-01-12T15:41:09.531282
2016-10-25T02:14:36
2016-10-25T02:14:36
71,850,668
0
0
null
null
null
null
UTF-8
Java
false
false
6,963
java
package com.containerstore.api.config; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.servlet.InstrumentedFilter; import com.codahale.metrics.servlets.MetricsServlet; import com.containerstore.api.web.filter.CachingHttpHeadersFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.embedded.*; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; import java.io.File; import java.nio.file.Paths; import java.util.*; import javax.inject.Inject; import javax.servlet.*; /** * Configuration of web application with Servlet 3.0 APIs. */ @Configuration public class WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { private final Logger log = LoggerFactory.getLogger(WebConfigurer.class); @Inject private Environment env; @Inject private JHipsterProperties jHipsterProperties; @Autowired(required = false) private MetricRegistry metricRegistry; @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", Arrays.toString(env.getActiveProfiles())); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC); initMetrics(servletContext, disps); if (env.acceptsProfiles(Constants.SPRING_PROFILE_PRODUCTION)) { initCachingHttpHeadersFilter(servletContext, disps); } if (env.acceptsProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)) { initH2Console(servletContext); } log.info("Web application fully configured"); } /** * Customize the Servlet engine: Mime types, the document root, the cache. */ @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); // IE issue, see https://github.com/jhipster/generator-jhipster/pull/711 mappings.add("html", "text/html;charset=utf-8"); // CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64 mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); // When running in an IDE or with ./gradlew bootRun, set location of the static web assets. setLocationForStaticAssets(container); } private void setLocationForStaticAssets(ConfigurableEmbeddedServletContainer container) { File root; String prefixPath = resolvePathPrefix(); if (env.acceptsProfiles(Constants.SPRING_PROFILE_PRODUCTION)) { root = new File(prefixPath + "build/www/"); } else { root = new File(prefixPath + "src/main/webapp/"); } if (root.exists() && root.isDirectory()) { container.setDocumentRoot(root); } } /** * Resolve path prefix to static resources. */ private String resolvePathPrefix() { String fullExecutablePath = this.getClass().getResource("").getPath(); String rootPath = Paths.get(".").toUri().normalize().getPath(); String extractedPath = fullExecutablePath.replace(rootPath, ""); int extractionEndIndex = extractedPath.indexOf("build/"); if(extractionEndIndex <= 0) { return ""; } return extractedPath.substring(0, extractionEndIndex); } /** * Initializes the caching HTTP Headers Filter. */ private void initCachingHttpHeadersFilter(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Registering Caching HTTP Headers Filter"); FilterRegistration.Dynamic cachingHttpHeadersFilter = servletContext.addFilter("cachingHttpHeadersFilter", new CachingHttpHeadersFilter(jHipsterProperties)); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/content/*"); cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/app/*"); cachingHttpHeadersFilter.setAsyncSupported(true); } /** * Initializes Metrics. */ private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) { log.debug("Initializing Metrics registries"); servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, metricRegistry); servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, metricRegistry); log.debug("Registering Metrics Filter"); FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter", new InstrumentedFilter()); metricsFilter.addMappingForUrlPatterns(disps, true, "/*"); metricsFilter.setAsyncSupported(true); log.debug("Registering Metrics Servlet"); ServletRegistration.Dynamic metricsAdminServlet = servletContext.addServlet("metricsServlet", new MetricsServlet()); metricsAdminServlet.addMapping("/management/jhipster/metrics/*"); metricsAdminServlet.setAsyncSupported(true); metricsAdminServlet.setLoadOnStartup(2); } @Bean @ConditionalOnProperty(name = "jhipster.cors.allowed-origins") public CorsFilter corsFilter() { log.debug("Registering CORS filter"); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); source.registerCorsConfiguration("/api/**", config); source.registerCorsConfiguration("/v2/api-docs", config); source.registerCorsConfiguration("/oauth/**", config); source.registerCorsConfiguration("/*/api/**", config); source.registerCorsConfiguration("/*/oauth/**", config); return new CorsFilter(source); } /** * Initializes H2 console. */ private void initH2Console(ServletContext servletContext) { log.debug("Initialize H2 console"); ServletRegistration.Dynamic h2ConsoleServlet = servletContext.addServlet("H2Console", new org.h2.server.web.WebServlet()); h2ConsoleServlet.addMapping("/h2-console/*"); h2ConsoleServlet.setInitParameter("-properties", "src/main/resources/"); h2ConsoleServlet.setLoadOnStartup(1); } }
9e8651008896428b36fe97179b123e36f2187444
823d924693d4bbc05dace2da48b9f3e222fc0483
/app/src/main/java/masterung/androidthai/in/th/learnrecycleview/utility/MyAdapter.java
ccdcf8e5e16631f9238ce515dd2519474e08e48c
[]
no_license
masterUNG/LearnRecycleView
be3801c35f5f79f46c57b13b9d45e3cd6cd2bd26
56422ae0eac9cab0507032bf606f1162656198a4
refs/heads/master
2021-05-01T16:43:00.611860
2018-02-12T14:42:30
2018-02-12T14:42:30
121,051,688
0
0
null
null
null
null
UTF-8
Java
false
false
1,584
java
package masterung.androidthai.in.th.learnrecycleview.utility; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import masterung.androidthai.in.th.learnrecycleview.R; /** * Created by masterung on 11/2/2018 AD. */ public class MyAdapter extends BaseAdapter{ private Context context; private String[] titleStrings; private int[] iconInts; public MyAdapter(Context context, String[] titleStrings, int[] iconInts) { this.context = context; this.titleStrings = titleStrings; this.iconInts = iconInts; } @Override public int getCount() { return titleStrings.length; } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = layoutInflater.inflate(R.layout.listview_layout, parent, false); TextView textView = view.findViewById(R.id.textViewFood); textView.setText(titleStrings[position]); ImageView imageView = view.findViewById(R.id.imageViewFood); imageView.setImageResource(iconInts[position]); return view; } }
c640581c3339d29453a9aef59d30a231fbfd0a80
8731610e6b494acd147cc57de1f4ef1d0516d01b
/MaterialDesign/app/src/main/java/info/androidhive/renovada/fragments/MembrosFragment.java
5ed6e7e009a92d7268c8bd4f290224c0573ab352
[]
no_license
leandro1988/Renovada
6064814fd381f7f4588e6f9c08162294d14e2573
9317b498881d46691dd449c1a698b1493284135e
refs/heads/master
2021-01-11T09:34:44.348907
2016-12-30T20:40:33
2016-12-30T20:40:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,859
java
package info.androidhive.renovada.fragments; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import info.androidhive.materialdesign.R; import info.androidhive.renovada.DAO.MembroDAO; import info.androidhive.renovada.activity.MembroActivity; import info.androidhive.renovada.model.Membro; import java.util.List; public class MembrosFragment extends Fragment { ListView lstMembros; Button btnIncluir; MembroDAO membroDAO; ArrayAdapter<Membro> arrayAdapter; public MembrosFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate( savedInstanceState ); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate( R.layout.fragment_membros, container, false ); lstMembros = (ListView) rootView.findViewById( R.id.lst_membros ); btnIncluir = (Button) rootView.findViewById( R.id.btnIncluir ); btnIncluir.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent( getContext(), MembroActivity.class ); startActivity( i ); } } ); membroDAO = new MembroDAO( getContext() ); // Inflate the layout for this fragment return rootView; } @Override public void onResume() { super.onResume(); setupListView(); } @Override public void onAttach(Activity activity) { super.onAttach( activity ); } @Override public void onDetach() { super.onDetach(); } private void setupListView() { List<Membro> membros = membroDAO.getAllMembros(); arrayAdapter = new ArrayAdapter<>( getContext(), android.R.layout.simple_list_item_1, membros ); lstMembros.setAdapter( arrayAdapter ); lstMembros.setOnItemLongClickListener( new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { // Colocar um alert dialog Membro membro = arrayAdapter.getItem( position ); membroDAO.deleteMembro( membro ); arrayAdapter.remove( membro ); // arrayAdapter.notifyDataSetChanged(); return false; } } ); } }
c3302267cfdd34b877404c0c75465a40a6ad2873
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/checkstyle_cluster/7315/tar_219.java
7fb769148df5ce9a5ba46e023a97c590f898197f
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,939
java
package com.puppycrawl.tools.checkstyle.checks.whitespace; import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport; import com.puppycrawl.tools.checkstyle.DefaultConfiguration; import org.junit.Test; public class TypecastParenPadCheckTest extends BaseCheckTestSupport { @Test public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); final String[] expected = { "89:14: '(' is followed by whitespace.", "89:21: ')' is preceded with whitespace.", }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @Test public void testSpace() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { "87:21: '(' is not followed by whitespace.", "87:27: ')' is not preceded with whitespace.", "88:14: '(' is not followed by whitespace.", "88:20: ')' is not preceded with whitespace.", "90:14: '(' is not followed by whitespace.", "90:20: ')' is not preceded with whitespace.", "241:18: '(' is not followed by whitespace.", "241:21: ')' is not preceded with whitespace.", }; verify(checkConfig, getPath("InputWhitespace.java"), expected); } @Test public void test1322879() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class); checkConfig.addAttribute("option", PadOption.SPACE.toString()); final String[] expected = { }; verify(checkConfig, getPath("whitespace/InputWhitespaceAround.java"), expected); } }
b7428ad7fea2d27719493579e74786250936d873
6847722d0479548b4069fba18c00358e3ad14676
/WCCI/src/solo/branch/TestStateDriver.java
c8b162d719fea42c7044b73826c91ffba2da6782
[]
no_license
sfbaqai/racingcar
90de325ac107f86f7ae862b77e3d132adf721814
3b72cfb5b8b49c6683358469cdd52ec073c9b156
refs/heads/master
2021-01-10T04:15:03.318224
2011-10-12T10:07:07
2011-10-12T10:07:07
48,247,283
0
0
null
null
null
null
UTF-8
Java
false
false
2,370
java
/** * */ package solo; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectList; /** * @author kokichi3000 * */ public class TestStateDriver extends BaseStateDriver<Integer,Integer> { /** * */ public TestStateDriver() { // TODO Auto-generated constructor stub super(); targetAction = null; target = null; } /** * @param name */ public TestStateDriver(String name) { super(name); // TODO Auto-generated constructor stub } /* (non-Javadoc) * @see solo.BaseStateDriver#drive(solo.State) */ @Override public ObjectList<Integer> drive(State<Integer,Integer> state) { // TODO Auto-generated method stub ObjectList<Integer> rs = new ObjectArrayList<Integer>(); rs.add(new Integer(1)); rs.add(new Integer(2)); rs.add(new Integer(3)); return rs; } @Override public void init() { // TODO Auto-generated method stub } @Override public void storeSingleAction(Integer input, Integer action, Integer output) { // TODO Auto-generated method stub } /* (non-Javadoc) * @see solo.BaseStateDriver#restart() */ @Override public Integer restart() { // TODO Auto-generated method stub System.out.println("Restart"); //current = new State<Integer, Integer>(0,new Integer(0),null,null); return new Integer(0); } /* (non-Javadoc) * @see solo.BaseStateDriver#shutdown() */ @Override public Integer shutdown() { // TODO Auto-generated method stub System.out.println("Shutdown"); return new Integer(-1); } /* (non-Javadoc) * @see solo.BaseStateDriver#stopCondition(solo.State) */ @Override public boolean stopCondition(State<Integer,Integer> state) { // TODO Auto-generated method stub return (state.num>=1); } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub TestStateDriver driver = new TestStateDriver(); Integer c = new Integer(0); Integer action = new Integer(0); while (action!=null && action!=-1){ System.out.print(c+"\t"); action = driver.wDrive(c); System.out.print(action+"\t"); c = (action==0 || action==-1) ? 0 : new Integer(c.intValue()+action.intValue()); System.out.println(c); }; System.out.println(driver); } }
2e1169428deefce02afb6a0420fcaa759cb299ba
717f6fea47f057071a08ae81bfff11bb57b1f24d
/src/com/codecool/wardrobe/clothes/TopClothing.java
3084fdb45f573525e29b8758b88b58cd11492053
[]
no_license
silviurdr/wardrobe
8f331a687274a0e80532cd3b21ab6d542fdbb860
6414428fe3b2ecf81e5dfc2e9ced726c77aacb73
refs/heads/master
2022-11-17T23:00:30.505553
2020-07-17T13:07:34
2020-07-17T13:07:34
280,426,552
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package com.codecool.wardrobe.clothes; public class TopClothing extends Clothing { public TopClothing(String brandName, Clothes clothingPiece) { super(brandName, clothingPiece); if (clothingPiece.getClothingType().equals("top")) { this.type = clothingPiece.getClothingType(); this.description = clothingPiece.getDescription(); this.brandName = brandName; this.id = counter; counter++; } else throw new IllegalArgumentException("Clothing type argument not suitable"); } }
c1f21a6105adb775ab634b54edf446141ce10f99
2373e776e22706524be8f7fea27149ffa6334ea7
/MyBatteryStatus/gen/com/almondmendoza/monBattery/R.java
1e52ee14d15b423cd463705bff54cd7eb7563690
[]
no_license
mani2naga/monmonja
fcefde1e489d59452b6fa570de898753cff9f00b
7d1786132ca68923f233a09c9c6cc62926f08ed0
refs/heads/master
2021-01-01T05:30:16.248091
2018-04-17T16:16:33
2018-04-17T16:16:33
56,220,020
0
0
null
null
null
null
UTF-8
Java
false
false
1,823
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.almondmendoza.monBattery; public final class R { public static final class array { public static final int language_entries=0x7f050000; public static final int language_values=0x7f050001; } public static final class attr { } public static final class drawable { public static final int amazon=0x7f020000; public static final int icon=0x7f020001; public static final int info=0x7f020002; public static final int info2=0x7f020003; public static final int settings=0x7f020004; } public static final class id { public static final int monospaceTxt=0x7f070000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int about_app=0x7f060001; public static final int app_name=0x7f060000; public static final int battery_status=0x7f060005; public static final int buy_battery=0x7f060002; public static final int default_language=0x7f060006; public static final int notification_enabled_summary=0x7f060008; public static final int notification_enabled_title=0x7f060007; public static final int pref_default_language=0x7f06000b; public static final int pref_key_language=0x7f06000a; public static final int pref_key_notification=0x7f060009; public static final int preferences=0x7f060003; public static final int your_battery_status=0x7f060004; } public static final class xml { public static final int prefs=0x7f040000; } }
[ "almondmendoza@b43be87c-e9eb-11dd-9ee4-63b70bd76fba" ]
almondmendoza@b43be87c-e9eb-11dd-9ee4-63b70bd76fba
272f54da444ee8246ed1a7322e5506c0a9160f07
033e88d71bb6372bbbeafa22dc8574ef7d59377b
/src/main/scala/com/utils/CollectLog.java
aa1d59847d073b7e5662fcd5cdf04ab373cf49ae
[]
no_license
SmorSmor/CMCCPay
b779f59f4628490dbb5ea4ca66db3ea9cf4a4f1d
8e58b27c0bc42d6950dc79290dce270df28d7c42
refs/heads/master
2022-07-15T15:23:30.583116
2019-09-04T14:01:24
2019-09-04T14:01:24
204,841,285
1
1
null
2022-06-21T01:45:46
2019-08-28T03:35:21
Scala
UTF-8
Java
false
false
1,766
java
package com.utils; import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.ProducerRecord; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.Properties; /** * 发送数据(生产者) */ public class CollectLog { public static void main(String[] args){ //这个是用来配置kafka的参数 Properties prop = new Properties(); //这里不是配置broker.id了,这个是配置bootstrap.servers prop.put("bootstrap.servers", "hadoop00:9092"); //下面是分别配置 key和value的序列化 prop.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); prop.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); //这个地方和1.0X之前的版本有不一样的,这个是使用kafkaproducer 类来实例化 Producer<String, String> producer = new KafkaProducer<String, String>(prop); try { BufferedReader bf = new BufferedReader( new FileReader( new File( "C:\\Users\\孙洪斌\\Desktop\\考试\\order.log")));// 路径 String line = null; while((line=bf.readLine())!=null){ Thread.sleep(2000); producer.send( new ProducerRecord<String, String>( "exam01", line)); } bf.close(); producer.close(); System.out.println("已经发送完毕"); } catch (Exception e) { e.printStackTrace(); } } }
5c4326b9dd076bbbde85ab23b055f1d28493226d
a5b7cf5ce2c1d334b4329e0257aebc5108bc3038
/dubbo-sellergoods/sellergoods-pojo/src/main/java/com/pinyg/sellergoods/entity/PageResult.java
d19dc22e168f7e43bef53954f2bd983673398b12
[]
no_license
shiyifanLenovo/shiyifan-coding
39c86f3bfc3639516c3e821a5edbd3920aa10d72
79dd38a574a60751c83c6947a8b3563bb96aefd4
refs/heads/master
2022-12-21T03:24:52.357700
2020-04-21T07:21:19
2020-04-21T07:21:19
202,485,800
1
0
null
2022-12-16T04:34:10
2019-08-15T06:24:38
JavaScript
UTF-8
Java
false
false
625
java
package com.pinyg.sellergoods.entity; import java.io.Serializable; import java.util.List; public class PageResult implements Serializable { private static final long serialVersionUID = -3246542449589249570L; /** * 总记录数 */ private long total; /** * 当前页结果 */ private List rows; public PageResult(long total, List rows) { super(); this.total = total; this.rows = rows; } public long getTotal() { return total; } public void setTotal(long total) { this.total = total; } public List getRows() { return rows; } public void setRows(List rows) { this.rows = rows; } }
81baaf120c356052f22347cea2a815940239dd02
55c277ca4bd3c1dfcb8801487093030512ee5a12
/Solution/src/main/java/org/snow/auspicious/leecode/solution/LinkedReycle.java
c8f994605451f2716c21afa11e42efb300cdbbbe
[]
no_license
auspicious-snow/lee-code
7094b5a0b5256f0aed742186aeb0371d631e9e69
ae0bd9973b39a1d37e4754e3e1cabaceffdb81dc
refs/heads/master
2023-03-19T05:15:58.332332
2021-03-14T12:26:26
2021-03-14T12:26:26
345,233,867
0
0
null
null
null
null
UTF-8
Java
false
false
1,090
java
package org.snow.auspicious.leecode.solution; import java.util.ArrayList; import java.util.List; /** * 链表环的入口节点\题目描述 * 对于一个给定的链表,返回环的入口节点,如果没有环,返回null * 拓展: * 你能给出不利用额外空间的解法么? 还需要探讨 */ public class LinkedReycle { public static void main(String[] args) { } public static class ListNode{ int val; ListNode next; ListNode() {} ListNode(int val) { this.val = val; } ListNode(int val, ListNode next) { this.val = val; this.next = next; } } public ListNode detectCycle(ListNode head) { //1.如果head 为null 直接返回 if ( head == null ){ return head; } //2. List<ListNode> list = new ArrayList<>(); while (head != null){ if(list.contains(head)){ return head; } list.add(head); head = head.next; } return null; } }
f819325b4085cd673a370e93bacf664dab0241ec
4c4da1c8d5c529982ab714e32410b422eeadf936
/Forza4/src/com/tris/Main.java
1de77b5b65918c40c8b9bcef750a1b9cf029982e
[]
no_license
stealth90/Forza4
1b700b401c138a5b8cfdad67c635416ed58e4178
e4e6159356dcc6da7ff18fa3e3195ec826cc3bc0
refs/heads/master
2020-05-18T20:49:58.127962
2019-05-03T07:19:15
2019-05-03T07:19:15
184,643,122
0
0
null
null
null
null
UTF-8
Java
false
false
100
java
package com.tris; public class Main { public static void main(String[] args) { } }
ff53f421125987fab2a9f97a0f15ab4ed39fd37a
c31d820b7c1ce16c45acf655a1b40bebe0418db0
/src/main/java/com/dental/entities/act.java
dab4033aa309218d886cc0eac5ff817fd0dc2fac
[]
no_license
Braahim/DentalClinic-Back
b52905361ac7bba1c14e7fd389ae3a46649ba44f
fb8568954ef19e9ef1fc0234765ba77c92072a7c
refs/heads/master
2023-06-02T21:27:09.892355
2021-06-25T00:25:30
2021-06-25T00:25:30
380,080,713
0
0
null
null
null
null
UTF-8
Java
false
false
1,417
java
package com.dental.entities; import java.io.Serializable; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @Table( name ="Acts") public class act implements Serializable{ @Id @GeneratedValue( strategy = GenerationType.IDENTITY) @Column (name = "Id") private int id; @Column() private String Title; @Column() private Long fee; @Column() private Long consumption; @OneToMany(cascade = CascadeType.ALL, mappedBy = "act") private Set<Appointment> appointments; public String getTitle() { return Title; } public void setTitle(String title) { Title = title; } public Long getFee() { return fee; } public void setFee(Long fee) { this.fee = fee; } public Long getConsumption() { return consumption; } public void setConsumption(Long consumption) { this.consumption = consumption; } public act(String title, Long fee, Long consumption) { super(); Title = title; this.fee = fee; this.consumption = consumption; } public act() { super(); } @Override public String toString() { return "act [id=" + id + ", Title=" + Title + ", fee=" + fee + ", consumption=" + consumption + "]"; } }
c0935caf74f7493b2a0c89e9ff6b6a5055dd42a2
4ce46f78139f4ac2234799273688c4cb26ebdacc
/u4_2/src/com/oocourse/uml2/models/elements/UmlAssociation.java
87d972d5c0dc396e72dac96d14b6b2c6a81a69b8
[]
no_license
yueyang130/BUAA_CS_2020_OO
8188ea96ea3b21575b09a426ad676594a10b2414
09e589ed0cd8461bbe65f4732df785e737b0edfc
refs/heads/main
2023-03-22T01:54:41.274116
2021-03-14T11:25:41
2021-03-14T11:25:41
347,616,768
15
1
null
null
null
null
UTF-8
Java
false
false
3,584
java
package com.oocourse.uml2.models.elements; import com.oocourse.uml2.models.common.ElementType; import com.oocourse.uml2.models.exceptions.UmlParseException; import com.oocourse.uml2.models.exceptions.UmlParseKeyNotFoundException; import com.oocourse.uml2.models.exceptions.UmlParseNotObjectException; import java.util.HashMap; import java.util.Map; import java.util.Objects; public class UmlAssociation extends UmlElement { private static final String END1_KEY = "end1"; private static final String END2_KEY = "end2"; private final String end1; private final String end2; private UmlAssociation(AbstractElementData elementData, String end1, String end2) { super(elementData); this.end1 = end1; this.end2 = end2; } public static UmlAssociation loadFromJson(Object jsonObject) throws UmlParseException { AbstractElementData elementData = loadAbstractDataFromJson(jsonObject); if (!(jsonObject instanceof Map)) { throw new UmlParseNotObjectException(jsonObject); } Map map = (Map) jsonObject; String end1; if (map.containsKey(END1_KEY)) { Object value = map.get(END1_KEY); end1 = loadElementReferenceDataFromJson(value).getReferenceId(); } else { throw new UmlParseKeyNotFoundException(jsonObject, END1_KEY); } String end2; if (map.containsKey(END2_KEY)) { Object value = map.get(END2_KEY); end2 = loadElementReferenceDataFromJson(value).getReferenceId(); } else { throw new UmlParseKeyNotFoundException(jsonObject, END2_KEY); } return new UmlAssociation(elementData, end1, end2); } public static UmlAssociation loadFromExportedJson(Object jsonObject) throws UmlParseException { AbstractElementData elementData = loadAbstractDataFromJson(jsonObject); if (!(jsonObject instanceof Map)) { throw new UmlParseNotObjectException(jsonObject); } Map map = (Map) jsonObject; String end1; if (map.containsKey(END1_KEY)) { Object value = map.get(END1_KEY); end1 = (String) value; } else { throw new UmlParseKeyNotFoundException(jsonObject, END1_KEY); } String end2; if (map.containsKey(END2_KEY)) { Object value = map.get(END2_KEY); end2 = (String) value; } else { throw new UmlParseKeyNotFoundException(jsonObject, END2_KEY); } return new UmlAssociation(elementData, end1, end2); } @Override public ElementType getElementType() { return ElementType.UML_ASSOCIATION; } public String getEnd1() { return end1; } public String getEnd2() { return end2; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; UmlAssociation that = (UmlAssociation) o; return Objects.equals(end1, that.end1) && Objects.equals(end2, that.end2); } @Override public int hashCode() { return Objects.hash(super.hashCode(), end1, end2); } @Override public Map<String, Object> toJson() { Map<String, Object> result = super.toJson(); result.putAll(new HashMap<String, Object>() {{ put(END1_KEY, end1); put(END2_KEY, end2); }}); return result; } }
612b6cd06bf815297bf19a976f538b55c69ffd00
555b52c2787ca6022553d43a1094bcd5acd1d63d
/sdk/monitor/mgmt/src/main/java/com/azure/resourcemanager/monitor/DiagnosticSetting.java
23639eec9229b5faa4d2a9577129dad9c9c522bf
[ "MIT", "LicenseRef-scancode-generic-cla", "BSD-3-Clause", "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.1-or-later", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
openapi-env-ppe/azure-sdk-for-java
c1abfe15e61bdb857dfb8c0821ea86ea2b297c6a
a4f6f4da8187c22db021421b331fe3bba019880f
refs/heads/master
2020-09-12T10:05:08.376052
2020-06-08T07:44:30
2020-06-08T07:44:30
222,384,930
0
0
MIT
2019-11-18T07:09:37
2019-11-18T07:09:36
null
UTF-8
Java
false
false
13,491
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.azure.resourcemanager.monitor; import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.monitor.implementation.MonitorManager; import com.azure.resourcemanager.monitor.models.DiagnosticSettingsResourceInner; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasId; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager; import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName; import com.azure.resourcemanager.resources.fluentcore.model.Appliable; import com.azure.resourcemanager.resources.fluentcore.model.Creatable; import com.azure.resourcemanager.resources.fluentcore.model.HasInner; import com.azure.resourcemanager.resources.fluentcore.model.Indexable; import com.azure.resourcemanager.resources.fluentcore.model.Refreshable; import com.azure.resourcemanager.resources.fluentcore.model.Updatable; import java.time.Duration; import java.util.List; /** An immutable client-side representation of an Azure diagnostic settings. */ @Fluent public interface DiagnosticSetting extends Indexable, HasId, HasName, HasManager<MonitorManager>, HasInner<DiagnosticSettingsResourceInner>, Refreshable<DiagnosticSetting>, Updatable<DiagnosticSetting.Update> { /** * Get the associated resource Id value. * * @return the associated resource Id value */ String resourceId(); /** * Get the storageAccountId value. * * @return the storageAccountId value */ String storageAccountId(); /** * Get the eventHubAuthorizationRuleId value. * * @return the eventHubAuthorizationRuleId value */ String eventHubAuthorizationRuleId(); /** * Get the eventHubName value. * * @return the eventHubName value */ String eventHubName(); /** * Get the metrics value. * * @return the metrics value */ List<MetricSettings> metrics(); /** * Get the logs value. * * @return the logs value */ List<LogSettings> logs(); /** * Get the workspaceId value. * * @return the workspaceId value */ String workspaceId(); /** The entirety of a diagnostic settings definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDiagnosticLogRecipient, DefinitionStages.WithCreate { } /** Grouping of diagnostic settings definition stages. */ interface DefinitionStages { /** The first stage of a diagnostic setting definition. */ interface Blank { /** * Sets the resource for which Diagnostic Settings will be created. * * @param resourceId of the resource. * @return the stage of selecting data recipient. */ WithDiagnosticLogRecipient withResource(String resourceId); } /** * The stage of the definition which contains minimum required properties to be specified for Diagnostic * Settings creation. */ interface WithDiagnosticLogRecipient { /** * Sets Log Analytics workspace for data transfer. * * @param workspaceId of Log Analytics that should exist in the same region as resource. * @return the stage of creating Diagnostic Settings. */ WithCreate withLogAnalytics(String workspaceId); /** * Sets Storage Account for data transfer. * * @param storageAccountId of storage account that should exist in the same region as resource. * @return the stage of creating Diagnostic Settings. */ WithCreate withStorageAccount(String storageAccountId); /** * Sets EventHub Namespace Authorization Rule for data transfer. * * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same * region as resource. * @return the stage of creating Diagnostic Settings. */ WithCreate withEventHub(String eventHubAuthorizationRuleId); /** * Sets EventHub Namespace Authorization Rule for data transfer. * * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same * region as resource. * @param eventHubName name of the EventHub. If none is specified, the default EventHub will be selected. * @return the stage of creating Diagnostic Settings. */ WithCreate withEventHub(String eventHubAuthorizationRuleId, String eventHubName); } /** * The stage of the definition which contains all the minimum required inputs for the resource to be created but * also allows for any other optional settings to be specified. */ interface WithCreate extends WithDiagnosticLogRecipient, Creatable<DiagnosticSetting> { /** * Adds a Metric Setting to the list of Metric Settings for the current Diagnostic Settings. * * @param category name of a Metric category for a resource type this setting is applied to. * @param timeGrain the timegrain of the metric in ISO8601 format. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the stage of creating Diagnostic Settings. */ WithCreate withMetric(String category, Duration timeGrain, int retentionDays); /** * Adds a Log Setting to the list of Log Settings for the current Diagnostic Settings. * * @param category name of a Log category for a resource type this setting is applied to. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the stage of creating Diagnostic Settings. */ WithCreate withLog(String category, int retentionDays); /** * Adds a Log and Metric Settings to the list Log and Metric Settings for the current Diagnostic Settings. * * @param categories a list of diagnostic settings category. * @param timeGrain the timegrain of the metric in ISO8601 format for all Metrics in the {@code categories} * list. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the stage of creating Diagnostic Settings. */ WithCreate withLogsAndMetrics( List<DiagnosticSettingsCategory> categories, Duration timeGrain, int retentionDays); } } /** Grouping of diagnostic setting update stages. */ interface UpdateStages { /** The stage of a Diagnostic Settings update allowing to modify Storage Account settings. */ interface WithStorageAccount { /** * Sets Storage Account for data transfer. * * @param storageAccountId of storage account that should exist in the same region as resource. * @return the next stage of the Diagnostic Settings update. */ Update withStorageAccount(String storageAccountId); /** * Removes the Storage Account from the Diagnostic Settings. * * @return the next stage of the Diagnostic Settings update. */ Update withoutStorageAccount(); } /** The stage of a Diagnostic Settings update allowing to modify EventHub settings. */ interface WithEventHub { /** * Sets EventHub Namespace Authorization Rule for data transfer. * * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same * region as resource. * @return the next stage of the Diagnostic Settings update. */ Update withEventHub(String eventHubAuthorizationRuleId); /** * Sets EventHub Namespace Authorization Rule for data transfer. * * @param eventHubAuthorizationRuleId of EventHub namespace authorization rule that should exist in the same * region as resource. * @param eventHubName name of the EventHub. If none is specified, the default EventHub will be selected. * @return the next stage of the Diagnostic Settings update. */ Update withEventHub(String eventHubAuthorizationRuleId, String eventHubName); /** * Removes the EventHub from the Diagnostic Settings. * * @return the next stage of the Diagnostic Settings update. */ Update withoutEventHub(); } /** The stage of a Diagnostic Settings update allowing to modify Log Analytics settings. */ interface WithLogAnalytics { /** * Sets Log Analytics workspace for data transfer. * * @param workspaceId of Log Analytics that should exist in the same region as resource. * @return the next stage of the Diagnostic Settings update. */ Update withLogAnalytics(String workspaceId); /** * Removes the Log Analytics from the Diagnostic Settings. * * @return the next stage of the Diagnostic Settings update. */ Update withoutLogAnalytics(); } interface WithMetricAndLogs { /** * Adds a Metric Setting to the list of Metric Settings for the current Diagnostic Settings. * * @param category name of a Metric category for a resource type this setting is applied to. * @param timeGrain the timegrain of the metric in ISO8601 format. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the next stage of the Diagnostic Settings update. */ Update withMetric(String category, Duration timeGrain, int retentionDays); /** * Adds a Log Setting to the list of Log Settings for the current Diagnostic Settings. * * @param category name of a Log category for a resource type this setting is applied to. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the next stage of the Diagnostic Settings update. */ Update withLog(String category, int retentionDays); /** * Adds a Log and Metric Settings to the list Log and Metric Settings for the current Diagnostic Settings. * * @param categories a list of diagnostic settings category. * @param timeGrain the timegrain of the metric in ISO8601 format for all Metrics in the {@code categories} * list. * @param retentionDays the number of days for the retention in days. A value of 0 will retain the events * indefinitely. * @return the next stage of the Diagnostic Settings update. */ Update withLogsAndMetrics( List<DiagnosticSettingsCategory> categories, Duration timeGrain, int retentionDays); /** * Removes the Metric Setting from the Diagnostic Setting. * * @param category name of a Metric category to remove. * @return the next stage of the Diagnostic Settings update. */ Update withoutMetric(String category); /** * Removes the Log Setting from the Diagnostic Setting. * * @param category name of a Log category to remove. * @return the next stage of the Diagnostic Settings update. */ Update withoutLog(String category); /** * Removes all the Log Settings from the Diagnostic Setting. * * @return the next stage of the Diagnostic Settings update. */ Update withoutLogs(); /** * Removes all the Metric Settings from the Diagnostic Setting. * * @return the next stage of the Diagnostic Settings update. */ Update withoutMetrics(); } } /** The template for an update operation, containing all the settings that can be modified. */ interface Update extends Appliable<DiagnosticSetting>, UpdateStages.WithStorageAccount, UpdateStages.WithEventHub, UpdateStages.WithLogAnalytics, UpdateStages.WithMetricAndLogs { } }
30d0302bdcc153c48eec4f508a0409be238d3f18
4178beb635d4aab17e5a1449afab87f7522de6cb
/applibs/src/main/java/com/chillingvan/lib/muxer/RTMPStreamMuxer.java
2aff6ccee0844ccee5a48c8a19063f839d79a828
[ "Apache-2.0" ]
permissive
xinfushe/AndroidInstantVideo
99cfea684d7c0d5e43e1814573217b1fe9edccf6
01933955b7ec36637c5bbdc7fab1f70c0ea36468
refs/heads/master
2021-01-25T09:26:01.329837
2017-06-05T01:02:33
2017-06-05T01:02:33
93,830,961
1
0
null
2017-06-09T07:21:57
2017-06-09T07:21:57
null
UTF-8
Java
false
false
5,562
java
/* * * * * * * Copyright (C) 2017 ChillingVan * * * * * * 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.chillingvan.lib.muxer; import android.media.MediaCodec; import com.chillingvan.canvasgl.Loggers; import net.butterflytv.rtmp_client.RTMPMuxer; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; import java.util.Locale; /** * Created by Chilling on 2017/5/29. */ public class RTMPStreamMuxer implements IMuxer { public static final int KEEP_COUNT = 30; private String filename = ""; private RTMPMuxer rtmpMuxer; private long lastVideoTime; private long lastAudioTime; private int totalVideoTime; private int totalAudioTime; private List<Frame> frameQueue = new LinkedList<>(); public RTMPStreamMuxer() { this(""); } public RTMPStreamMuxer(String filename) { this.filename = filename; rtmpMuxer = new RTMPMuxer(); } @Override public synchronized int open(String url, int videoWidth, int videoHeight) { lastVideoTime = -1; lastAudioTime = -1; totalVideoTime = 0; totalAudioTime = 0; int open = rtmpMuxer.open(url, videoWidth, videoHeight); Loggers.d("RTMPStreamMuxer", String.format(Locale.CHINA, "open: open: %d", open)); int connected = rtmpMuxer.isConnected(); Loggers.d("RTMPStreamMuxer", String.format(Locale.CHINA, "open: isConnected: %d", connected)); Loggers.d("RTMPStreamMuxer", String.format("open: %s", url)); if (!"".equals(filename)) { rtmpMuxer.file_open(filename); rtmpMuxer.write_flv_header(true, true); } return connected; } @Override public synchronized void writeVideo(byte[] buffer, int offset, int length, MediaCodec.BufferInfo bufferInfo) { Loggers.d("RTMPStreamMuxer", "writeVideo: "); if (lastVideoTime <= 0) { lastVideoTime = bufferInfo.presentationTimeUs; } int delta = (int) (bufferInfo.presentationTimeUs - lastVideoTime); lastVideoTime = bufferInfo.presentationTimeUs; totalVideoTime += Math.abs(delta/1000); addFrame(buffer, offset, length, totalVideoTime, Frame.TYPE_VIDEO); sendFrame(KEEP_COUNT); } private void addFrame(byte[] buffer, int offset, int length, int time, int type) { byte[] frameData = new byte[length]; System.arraycopy(buffer, offset, frameData, 0, length); frameQueue.add(new Frame(frameData, time, type)); Frame.sortFrame(frameQueue); } private void sendFrame(int keepCount) { while (frameQueue.size() >= keepCount) { Frame sendFrame = frameQueue.remove(0); Loggers.i("RTMPStreamMuxer", String.format(Locale.CHINA, "sendFrame: size:%d time:%d, type:%d", sendFrame.data.length, sendFrame.timeStampMs, sendFrame.type)); byte[] array = sendFrame.data; if (sendFrame.type == Frame.TYPE_VIDEO) { rtmpMuxer.writeVideo(array, 0, array.length, sendFrame.timeStampMs); } else { rtmpMuxer.writeAudio(array, 0, array.length, sendFrame.timeStampMs); } } } @Override public synchronized void writeAudio(byte[] buffer, int offset, int length, MediaCodec.BufferInfo bufferInfo) { Loggers.d("RTMPStreamMuxer", "writeAudio: "); if (lastAudioTime <= 0) { lastAudioTime = bufferInfo.presentationTimeUs; } int delta = (int) (bufferInfo.presentationTimeUs - lastAudioTime); lastAudioTime = bufferInfo.presentationTimeUs; totalAudioTime += Math.abs(delta/1000); addFrame(buffer, offset, length, totalAudioTime, Frame.TYPE_AUDIO); sendFrame(KEEP_COUNT); } @Override public synchronized int close() { sendFrame(0); if (!"".equals(filename)) { rtmpMuxer.file_close(); } return rtmpMuxer.close(); } private static class Frame { public byte[] data; public int timeStampMs; public int type; public static final int TYPE_VIDEO = 1; public static final int TYPE_AUDIO = 2; public Frame(byte[] data, int timeStampMs, int type) { this.data = data; this.timeStampMs = timeStampMs; this.type = type; } static void sortFrame(List<Frame> frameQueue) { Collections.sort(frameQueue, new Comparator<Frame>() { @Override public int compare(Frame left, Frame right) { if (left.timeStampMs < right.timeStampMs) { return -1; } else if (left.timeStampMs == right.timeStampMs) { return 0; } else { return 1; } } }); } } }
f6b14bdd214fe7a2febd4175cc807c45990d4a75
01d1afe28569bab2793faad853d638e23bdb5730
/src/containers/MapDemo2.java
4f82eb5167b91ca1f97da990841fddfe1b6c331e
[ "Apache-2.0" ]
permissive
JackyCSer/ThinkingInJava
25871694e44cff22c88e1324e0a2e6902eb76104
04f21e25bce22d01dbeaeb73ad7fb102d4f15db0
refs/heads/master
2016-08-12T20:37:35.986512
2016-04-06T10:33:27
2016-04-06T10:33:27
55,597,018
0
0
null
null
null
null
UTF-8
Java
false
false
681
java
package containers; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; public class MapDemo2 { public static void main(String[] args) { Map<String, String> map = new HashMap<String, String>(); map.put("01", "apple1"); map.put("02", "apple2"); map.put("03", "apple3"); Set<Map.Entry<String, String>> entrySet = map.entrySet(); Iterator<Map.Entry<String, String>> iterator = entrySet.iterator(); while (iterator.hasNext()) { Map.Entry<String, String> entry = iterator.next(); System.out.println(entry.getKey()); System.out.println(entry.getValue()); } } }
37bfdfbcdaec9ee387c02f1a7eccc6019ce8d864
ed466392bf568b9f36c2a476e6c98c40827bf515
/ImageAdapter.java
6176fdb1a1a6392b4681771bd9213e7653417ca6
[]
no_license
saratelmsany/MovieApp12
2233ff24b247234c4075a13006cbdd0466a112be
a6593eff19fef8ec8e1197d83095f65092d019b9
refs/heads/master
2020-06-17T13:34:08.450102
2016-11-28T18:36:57
2016-11-28T18:36:57
75,002,849
0
0
null
null
null
null
UTF-8
Java
false
false
1,636
java
package com.example.android.movieapp1; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import com.squareup.picasso.Picasso; import java.util.ArrayList; public class ImageAdapter extends BaseAdapter { private Context mContext; ImageView imageView; ArrayList<String> posterPath; // public ImageAdapter(Context c) { // mContext = c; // } public ImageAdapter (Context c ,ArrayList<String> path ){ mContext = c; posterPath = path; } public int getCount() { return posterPath.size(); } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(300, 450)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(5, 5, 5, 5); } else { imageView = (ImageView) convertView; } String baseURL="http://image.tmdb.org/t/p/w185"; // for (String path:posterPath) { Picasso.with(mContext).load(baseURL+posterPath.get(position)).into(imageView); // } // imageView.setImageResource(mThumbIds[position]); return imageView; } }
52a4fad69e657fd0397027dd1d8d94c55babe8aa
9cd45a02087dac52ea4d39a0c17e525c11a8ed97
/src/java/com/chartboost/sdk/impl/bh.java
a267da9dd2564316b73e28ef455942ea8e246037
[]
no_license
abhijeetvaidya24/INFO-NDVaidya
fffb90b8cb4478399753e3c13c4813e7e67aea19
64d69250163e2d8d165e8541aec75b818c2d21c5
refs/heads/master
2022-11-29T16:03:21.503079
2020-08-12T06:00:59
2020-08-12T06:00:59
286,928,296
0
0
null
null
null
null
UTF-8
Java
false
false
3,441
java
/* * Decompiled with CFR 0.0. * * Could not load the following classes: * java.io.File * java.io.FileInputStream * java.io.FileNotFoundException * java.io.IOException * java.io.InputStream * java.lang.Object * java.lang.String * java.lang.StringBuilder * java.lang.Throwable * java.math.BigInteger * java.nio.charset.Charset */ package com.chartboost.sdk.impl; import com.chartboost.sdk.impl.bi; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.nio.charset.Charset; public class bh { public static final BigInteger a; public static final BigInteger b; public static final BigInteger c; public static final BigInteger d; public static final BigInteger e; public static final BigInteger f; public static final BigInteger g; public static final BigInteger h; public static final File[] i; private static final Charset j; static { BigInteger bigInteger = a = BigInteger.valueOf((long)1024L); b = bigInteger.multiply(bigInteger); c = a.multiply(b); d = a.multiply(c); e = a.multiply(d); f = a.multiply(e); g = BigInteger.valueOf((long)1024L).multiply(BigInteger.valueOf((long)0x1000000000000000L)); h = a.multiply(g); i = new File[0]; j = Charset.forName((String)"UTF-8"); } public static FileInputStream a(File file) throws IOException { if (file.exists()) { if (!file.isDirectory()) { if (file.canRead()) { return new FileInputStream(file); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("File '"); stringBuilder.append((Object)file); stringBuilder.append("' cannot be read"); throw new IOException(stringBuilder.toString()); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("File '"); stringBuilder.append((Object)file); stringBuilder.append("' exists but is a directory"); throw new IOException(stringBuilder.toString()); } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("File '"); stringBuilder.append((Object)file); stringBuilder.append("' does not exist"); throw new FileNotFoundException(stringBuilder.toString()); } /* * Loose catch block * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation * Lifted jumps to return sites */ public static byte[] b(File file) throws IOException { FileInputStream fileInputStream; void var1_5; block4 : { byte[] arrby; fileInputStream = bh.a(file); try { arrby = bi.a((InputStream)fileInputStream, file.length()); } catch (Throwable throwable) { break block4; } bi.a((InputStream)fileInputStream); return arrby; catch (Throwable throwable) { fileInputStream = null; } } bi.a((InputStream)fileInputStream); throw var1_5; } }
7de40db05ce5dae9e2bc5c4ea5d01ccf10b7c8ae
7e8894159afb36bfe692c937aa53c51e94d88d7c
/movie_booking/src/com/movie/controller/action/MemberMyInfoFormAction.java
0db3bfe25f282a8aebbd74aa8255c552646e2ba5
[]
no_license
gguro/moive_booking
d0971a0d4b076a0f7644bdf95f36ae973e3a8443
2de32e72d2f84e83153df0cac63f759e55f42a0d
refs/heads/master
2021-05-15T13:26:47.549798
2017-10-24T04:53:32
2017-10-24T04:53:32
107,105,918
0
0
null
null
null
null
UTF-8
Java
false
false
639
java
package com.movie.controller.action; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class MemberMyInfoFormAction implements IAction{ @Override public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub String url = "/member/myinfo.jsp"; RequestDispatcher dispatcher = request.getRequestDispatcher(url); dispatcher.forward(request, response); } }
ccb10a4400769812a1944d60bd2c79149e950d53
937a9e3135f9662257c240c201ebc2949645a67d
/src/lapsmoothing.java
2fa4cde52c2ee309f0c60dca66adccc42b4f3661
[]
no_license
akhil0/FileIndexer
bbdb18a9fe08ec6e97545eded3580db69be14d2a
090237fc664be6221e0f87aa4dfd948df1e7eeb3
refs/heads/master
2021-01-10T14:22:46.245438
2015-10-08T04:50:50
2015-10-08T04:50:50
43,863,670
0
0
null
null
null
null
UTF-8
Java
false
false
7,232
java
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.tartarus.snowball.ext.PorterStemmer; import java.io.*; public class lapsmoothing { public static void main(String[] args) throws IOException { List<String> doclist = Files.readAllLines(Paths.get("C:\\Users\\AKI\\Downloads\\AP89_DATA\\AP_DATA\\doclist.txt")); HashMap<Integer, String> idmap = new HashMap<Integer, String>(); Iterator<String> docitr = doclist.iterator(); while(docitr.hasNext()) { String[] a1 = ((String) docitr.next()).split(" "); String id1 = a1[1]; int id = Integer.parseInt(a1[0]); idmap.put(id,id1); } System.out.println("idmap - " + idmap.size()); //Reading Doc Lengths to Hash Map List<String> a = Files.readAllLines(Paths.get("C:\\Users\\AKI\\workspace\\Ass2\\length.txt")); Iterator<String> stritr = a.iterator(); HashMap<String, Double> lengthmap = new HashMap<String, Double>(); while(stritr.hasNext()) { String line = stritr.next().toString(); String[] quearra = line.split(" "); lengthmap.put(quearra[0], Double.parseDouble(quearra[1])); } System.out.println("lengthmap - " + lengthmap.size()); List<String> catlist = Files.readAllLines(Paths.get("C:\\Users\\AKI\\workspace\\Ass2\\catalog.txt")); Iterator<String> catitr = catlist.iterator(); HashMap<String, String> catalogmap = new HashMap<String, String>(); while(catitr.hasNext()) { String aline = catitr.next(); String[] quearra = aline.split("-");; catalogmap.put(quearra[0],quearra[1]); } System.out.println("catalogmap size - " + catalogmap.size()); // Reading List of Queries into List List<String> querylist = Files.readAllLines(Paths.get("C:\\Users\\AKI\\workspace\\Elasticsearch\\setquery.txt")); //List<String> querylist = Files.readAllLines(Paths.get("C:\\Users\\AKI\\workspace\\Elasticsearch\\new.txt")); Iterator<String> queritr = querylist.iterator(); while(queritr.hasNext()) { String[] strarray = queritr.next().split(" "); System.out.println("Should be 2 = " + strarray.length); String queryno = strarray[0]; String mainstr = strarray[1]; String[] words = mainstr.split(" "); System.out.println(queryno + " - " + words.length); HashMap<String, Double> resultmap = new HashMap<String, Double>(); HashMap<String, Double> staticmap = new HashMap<String, Double>(); staticmap.putAll(lengthmap); Iterator<String> itr = staticmap.keySet().iterator(); while(itr.hasNext()) { staticmap.put(itr.next(),(double) 0); } for(int i = 0; i < words.length ; i++) { String qb = words[i]; //System.out.println("Done with = " + qb); PorterStemmer stemmer = new PorterStemmer(); stemmer.setCurrent(qb); //set string you need to stem stemmer.stem(); String local = stemmer.getCurrent(); resultmap = tfidf(local, resultmap, idmap, lengthmap, catalogmap,staticmap); } System.out.println("done with" + queryno); System.out.println("resultmap size is " + resultmap.size()); printmap(resultmap,queryno); } } private static HashMap<String, Double> tfidf(String local,HashMap<String, Double> resultmap, HashMap<Integer, String> idmap, HashMap<String, Double> lengthmap, HashMap<String, String> catalogmap, HashMap<String, Double> staticmap) throws IOException { RandomAccessFile raf = new RandomAccessFile("C:\\Users\\AKI\\workspace\\Ass2\\index.txt", "rw"); Iterator itrnext = staticmap.keySet().iterator(); while(itrnext.hasNext()) { String id = itrnext.next().toString(); double oldtf = staticmap.get(id); double v = 178081 ; double len = lengthmap.get(id); double newtf = 1/(len + v); double lap = Math.log(newtf); staticmap.put(id, oldtf+lap); } if (catalogmap.containsKey(local)) { String pos = catalogmap.get(local); String[] locs = pos.split(" "); long posint = Long.parseLong(locs[0]); int size = Integer.parseInt(locs[1]); raf.seek(posint); byte[] bnew = new byte[size]; raf.read(bnew, 0, size); String r = new String(bnew); String[] al = r.split(":"); //System.out.println(r); System.out.println(al.length - 1); for (int i = 1; i < al.length ; i++) { String[] lop = al[i].split("#"); System.out.println(Integer.parseInt(lop[0])); String doc = idmap.get(Integer.parseInt(lop[0])); System.out.println(doc); double len = lengthmap.get(doc); System.out.println(len); int tf = lop.length - 1; int df = al.length - 1; double v = 178081 ; double lap = (tf+1) / (len+v) ; double inc = 1/(len+v); lap = Math.log(lap); inc = Math.log(inc); double okapitf = (tf/(tf + 0.5 + 1.5*(len/262))); if(resultmap.containsKey(doc)) { double oldtf = staticmap.get(doc); staticmap.put(doc, oldtf + lap - inc); } else staticmap.put(doc, okapitf); } } raf.close(); return staticmap; } //Write HashMap to a File private static void printmap(HashMap<String, Double> resultmap, String string) { HashMap<String, Double> newmap = new HashMap<String, Double>(); newmap = (HashMap<String, Double>) sortByValues(resultmap); Iterator newmapitr = newmap.keySet().iterator(); int id0 = 0; File log = new File("C:\\Users\\AKI\\workspace\\Ass2\\lap.txt"); //File log = new File("C:\\Users\\AKI\\workspace\\Elasticsearch\\okapitf.txt"); try{ FileWriter fileWriter = new FileWriter(log, true); BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); while(newmapitr.hasNext()) { id0++; String nextnew = newmapitr.next().toString(); bufferedWriter.write(string + " Q0 " + nextnew + " " + id0 + " " + newmap.get(nextnew) + " Exp" + "\n"); } bufferedWriter.close(); System.out.println("Done"); System.out.println("newmap size is " + newmap.size()); } catch(IOException e) { System.out.println("COULD NOT LOG!!"); } } /*Reference : StackOverflow*/ //Sort HashMap by value and return top 1000 private static HashMap sortByValues(HashMap map) { List list = new LinkedList(map.entrySet()); // Defined Custom Comparator here Collections.sort(list, new Comparator() { public int compare(Object o1, Object o2) { return ((Comparable) ((Map.Entry) (o2)).getValue()) .compareTo(((Map.Entry) (o1)).getValue()); } }); // Here I am copying the sorted list in HashMap // using LinkedHashMap to preserve the insertion order HashMap sortedHashMap = new LinkedHashMap(); for (Iterator it = list.iterator(); it.hasNext();) { Map.Entry entry = (Map.Entry) it.next(); sortedHashMap.put(entry.getKey(), entry.getValue()); } HashMap newresult = new LinkedHashMap<>(); Iterator atr = sortedHashMap.keySet().iterator(); int id =0 ; if(sortedHashMap.size() < 1000) newresult.putAll(sortedHashMap); else { while(atr.hasNext() && id < 1000) { id++; String next = atr.next().toString(); newresult.put( next, sortedHashMap.get(next)); } } return newresult; } }
40383a16c6cc5706581af2bf6887fccb25ec8395
165103be7256703b3346bea0db2b9bb976f5e64c
/src/com/freshbin/pattern/mediator/example/CoffeeMachine.java
b54463e7051fca83e48d99286d6652522bf18ea7
[]
no_license
freshbin/designPattern
cbabe663198c7103bd60ede52422e4e775aca462
a5b0e57c750b4fb5c569cdeb28a679b316eb3d3e
refs/heads/master
2020-04-14T14:50:30.435796
2019-01-27T08:32:54
2019-01-27T08:32:54
163,908,794
2
0
null
null
null
null
UTF-8
Java
false
false
655
java
package com.freshbin.pattern.mediator.example; public class CoffeeMachine extends Colleague { public CoffeeMachine(Mediator mediator, String name) { super(mediator, name); // TODO Auto-generated constructor stub mediator.Register(name, this); } @Override public void SendMessage(int stateChange) { // TODO Auto-generated method stub this.GetMediator().GetMessage(stateChange, this.name); } public void StartCoffee() { System.out.println("It's time to startcoffee!"); } public void FinishCoffee() { System.out.println("After 5 minutes!"); System.out.println("Coffee is ok!"); SendMessage(0); } }
ef96652ba4130dd955ad5231bbec3687b26b513e
f49aac4091a024e54744c29eb3a494f9b9536e53
/Study-springboot-all/src/main/java/com/lemon/springboot/study125/util/schedul/ScheduledTasks.java
fb3a6b15bbdf2b55cf036bee5e030caffce9f84e
[]
no_license
hualongchen/lemon
9e866b00230e42c91ff085e0953619a636d5c564
dfa7f8e648ba7ffc5af1d692f39b5e6b9d3f1c47
refs/heads/master
2020-06-11T21:34:38.143719
2017-11-28T07:16:08
2017-11-28T07:16:08
75,621,237
22
7
null
null
null
null
UTF-8
Java
false
false
973
java
package com.lemon.springboot.study125.util.schedul; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; import java.util.Date; /** * Created by chenhualong on 2016/11/14. * 学习如何定时 */ @Component public class ScheduledTasks { private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); //@Scheduled(fixedRate = 5000) :上一次开始执行时间点之后5秒再执行 //@Scheduled(fixedDelay = 5000) :上一次执行完毕时间点之后5秒再执行 //@Scheduled(initialDelay=1000, fixedRate=5000) :第一次延迟1秒后执行,之后按fixedRate的规则每5秒执行一次 //@Scheduled(cron="*/5 * * * * *") :通过cron表达式定义规则 @Scheduled(fixedRate = 50000) public void reportCurrentTime() { System.out.println("现在时间:" + dateFormat.format(new Date())); } }
05fb779994e49eb82c7f397a0e7dee3a2245e256
5c970f96a59f3f4dc3e55d66549426a8654c0d5c
/src/main/java/com/trl/java_time/localDateTime/period/a3/a2/Experience.java
0c6a372384dad2ad40778a99cf9ff48214d95cd3
[]
no_license
Oracle-Exam-Preparation/OCA
c2c77d1c9405d1116ace9868af2c813aaa313750
21c1ca8683c630ef954ebd5b049ca2e6d2953539
refs/heads/master
2020-12-21T05:22:07.145470
2020-01-26T15:09:11
2020-01-26T15:09:11
236,320,752
1
0
null
null
null
null
UTF-8
Java
false
false
993
java
package com.trl.java_time.localDateTime.period.a3.a2; import java.time.LocalDateTime; import java.time.Period; /** * This class is created for educational purposes. * This class may contain sham information. * Always check the information you are learning. * * @author Tsyupryk Roman * @email [email protected] * @since 21/07/19 */ public class Experience { public static void main(String[] argv) { LocalDateTime ldt = LocalDateTime.of(2015, 5, 10, 10, 33, 44); Period p = Period.of(1, 0, 0); Period p_2 = Period.of(1, 1, 0); Period p_3 = Period.of(1, 1, 3); // Period p_4 = Period.of(1, 1, 3, 23); // Compilation Error !!! // Period p_5 = Period.of(1, 1, 3, 23, 59); // Compilation Error !!! // Period p_6 = Period.of(1, 1, 3, 23, 59); // Compilation Error !!! ldt = ldt.minus(p); System.out.println(ldt); // 2014-05-10T10:33:44 } }
61750590dcf36920fbf0958c7f329a7ef56d4c5c
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-70b-1-17-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/apache/commons/math/analysis/solvers/BisectionSolver_ESTest_scaffolding.java
cbf5527d251ec89e2b18df09dfe1f1e3694d38cc
[]
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
3,222
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Apr 05 13:26:37 UTC 2020 */ package org.apache.commons.math.analysis.solvers; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class BisectionSolver_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.analysis.solvers.BisectionSolver"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BisectionSolver_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.FunctionEvaluationException", "org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils", "org.apache.commons.math.MathException", "org.apache.commons.math.ConvergingAlgorithm", "org.apache.commons.math.ConvergenceException", "org.apache.commons.math.analysis.solvers.UnivariateRealSolver", "org.apache.commons.math.analysis.solvers.BisectionSolver", "org.apache.commons.math.ConvergingAlgorithmImpl", "org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl", "org.apache.commons.math.MathRuntimeException", "org.apache.commons.math.analysis.UnivariateRealFunction", "org.apache.commons.math.MathRuntimeException$1", "org.apache.commons.math.MathRuntimeException$2", "org.apache.commons.math.MaxIterationsExceededException", "org.apache.commons.math.MathRuntimeException$3", "org.apache.commons.math.MathRuntimeException$4", "org.apache.commons.math.MathRuntimeException$5", "org.apache.commons.math.MathRuntimeException$6", "org.apache.commons.math.MathRuntimeException$7", "org.apache.commons.math.MathRuntimeException$8", "org.apache.commons.math.MathRuntimeException$10", "org.apache.commons.math.MathRuntimeException$9" ); } }
d9b303e6483442aaf16e30039e564724a9176e4f
e2965347a5c3106f57d2c2a5eb2304e0d92e4ad6
/UsedPhone/src/vo/Free_BoardVO.java
cb7b288e0c52cbf9af48635e75683274ddfb7834
[]
no_license
hyunwoo7549/Project
6a257fc3d934698d507a92b40ee987c3c6088dec
19b21c9a458c906943088bfd5a92b2cb0dcfe38c
refs/heads/master
2020-04-23T14:16:23.808534
2019-02-18T06:27:12
2019-02-18T06:27:12
171,225,771
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
package vo; public class Free_BoardVO { private String rowNum; // 게시물 순서 private int fb_idx; // 자유게시판 번호 private String fb_title; // 자유게시판 제목 private String fb_writer; // 자유게시판 작성자 private String fb_uploadDate; // 자유게시판 작성일 private String fb_content; // 자유게시판 내용 private int fb_viewNum; // 자유게시판 조회수 private String fb_pwd; // 게시글 비밀번호 public Free_BoardVO() {} public int getFb_idx() { return fb_idx; } public void setFb_idx(int fb_idx) { this.fb_idx = fb_idx; } public String getFb_title() { return fb_title; } public void setFb_title(String fb_title) { this.fb_title = fb_title; } public String getFb_writer() { return fb_writer; } public void setFb_writer(String fb_writer) { this.fb_writer = fb_writer; } public String getFb_uploadDate() { return fb_uploadDate; } public void setFb_uploadDate(String fb_uploadDate) { this.fb_uploadDate = fb_uploadDate; } public String getFb_content() { return fb_content; } public void setFb_content(String fb_content) { this.fb_content = fb_content; } public int getFb_viewNum() { return fb_viewNum; } public void setFb_viewNum(int fb_viewNum) { this.fb_viewNum = fb_viewNum; } public String getFb_pwd() { return fb_pwd; } public void setFb_pwd(String fb_pwd) { this.fb_pwd = fb_pwd; } public String getRowNum() { return rowNum; } public void setRowNum(String rowNum) { this.rowNum = rowNum; } }
46b245422dab3b300906a70a7a0d94cba8e90959
15878f5f01d987acffe4168f344e7e8509c4fd64
/src/cn/com/thtf/egov/cms/entity/BrandEntity.java
6233455cd6f03ac847613c5aa775aad87e4db34e
[]
no_license
liveqmock/thtf_02_source-Deprecated
fb30fecfd84a966d382998c8df5125507e679c9a
746f10a5899b1dedceb6a33650f0398ddb19fd75
refs/heads/master
2020-04-01T23:40:10.823372
2014-01-25T10:30:11
2014-01-25T10:30:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
package cn.com.thtf.egov.cms.entity; import cn.com.thtf.egov.cms.application.BaseEntity; public class BrandEntity extends BaseEntity { private static final long serialVersionUID = -5093538170723507692L; private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
788e32a6758d6062a34d75fc1ba48da6d6ac9172
1e87399a6518e45cb4363b80aa1770dd88a5e730
/HelloSpinner/app/src/main/java/com/example/lenovo/hellospinner/MainActivity.java
0803e445596c66f7b58722402ecf8bfcdd2c19ba
[]
no_license
Parjisms/widget
ef0fcd3ee48d55b6120cb6371c2f977499103362
5a18844472a7c4620e7f798b00930209eed03b7d
refs/heads/master
2021-01-19T21:51:28.423023
2017-04-26T08:55:18
2017-04-26T08:55:18
88,716,817
0
0
null
null
null
null
UTF-8
Java
false
false
1,131
java
package com.example.lenovo.hellospinner; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
5e407b7cb07842379f69cbd0a31f1a7379c34057
d44223aa05a2df5b2d93e56229758b9d6ef82ac5
/src/xyz/svc/main/ConfigSvc.java
f227eabfa9290983213993c2429ed89ca394e523
[]
no_license
stefaniesun/jp
686b23a3a9559885d809c40a932cb7c105349fb4
0fc4434f27c8c978510d7121e78e001c00e86916
refs/heads/master
2021-01-10T03:25:09.644433
2016-02-28T15:34:32
2016-02-28T15:34:32
48,680,911
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
package xyz.svc.main; import java.util.Map; import org.springframework.stereotype.Service; @Service public interface ConfigSvc { Map<String, Object> queryConfigList(int offset, int pagesize); Map<String, Object> addConfig(String key, String name, String value); Map<String, Object> editConfig(String numberCode, String key, String name, String value); Map<String, Object> deleteConfig(String numberCode); Map<String, Object> getConfig(String numberCode); Map<String, Object> getPostalConfig(); }
b50e9a1622aedfa32e2aaa7c35f529091100eed0
00b85668294e2b729d4649b11309ab785e6adef6
/eclipse/1110f_TP3_TP4/src/uml/impl/GeneralizationImpl.java
b3e39a31aded50af5e75c0fc00b085b36c66ecff
[]
no_license
Doelia/M2-modeles
d61eb955ba4a48ef473f17164847db90c091261f
1030fff0775e60cc2a002d624bc07a8825d355ff
refs/heads/master
2021-01-25T05:34:08.814437
2015-12-02T09:34:39
2015-12-02T09:34:39
42,939,571
1
0
null
null
null
null
UTF-8
Java
false
false
13,300
java
/** */ package uml.impl; import java.lang.reflect.InvocationTargetException; import java.util.Collection; import java.util.Map; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.emf.ecore.util.EObjectValidator; import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.InternalEList; import uml.Classifier; import uml.Generalization; import uml.GeneralizationSet; import uml.UmlPackage; import uml.util.UmlValidator; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Generalization</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link uml.impl.GeneralizationImpl#isIsSubstitutable <em>Is Substitutable</em>}</li> * <li>{@link uml.impl.GeneralizationImpl#getGeneral <em>General</em>}</li> * <li>{@link uml.impl.GeneralizationImpl#getGeneralizationSet <em>Generalization Set</em>}</li> * <li>{@link uml.impl.GeneralizationImpl#getSpecific <em>Specific</em>}</li> * </ul> * * @generated */ public class GeneralizationImpl extends DirectedRelationshipImpl implements Generalization { /** * The default value of the '{@link #isIsSubstitutable() <em>Is Substitutable</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isIsSubstitutable() * @generated * @ordered */ protected static final boolean IS_SUBSTITUTABLE_EDEFAULT = false; /** * The cached value of the '{@link #isIsSubstitutable() <em>Is Substitutable</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isIsSubstitutable() * @generated * @ordered */ protected boolean isSubstitutable = IS_SUBSTITUTABLE_EDEFAULT; /** * This is true if the Is Substitutable attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean isSubstitutableESet; /** * The cached value of the '{@link #getGeneral() <em>General</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGeneral() * @generated * @ordered */ protected Classifier general; /** * The cached value of the '{@link #getGeneralizationSet() <em>Generalization Set</em>}' reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGeneralizationSet() * @generated * @ordered */ protected EList<GeneralizationSet> generalizationSet; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GeneralizationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return UmlPackage.eINSTANCE.getGeneralization(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isIsSubstitutable() { return isSubstitutable; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setIsSubstitutable(boolean newIsSubstitutable) { boolean oldIsSubstitutable = isSubstitutable; isSubstitutable = newIsSubstitutable; boolean oldIsSubstitutableESet = isSubstitutableESet; isSubstitutableESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE, oldIsSubstitutable, isSubstitutable, !oldIsSubstitutableESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetIsSubstitutable() { boolean oldIsSubstitutable = isSubstitutable; boolean oldIsSubstitutableESet = isSubstitutableESet; isSubstitutable = IS_SUBSTITUTABLE_EDEFAULT; isSubstitutableESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE, oldIsSubstitutable, IS_SUBSTITUTABLE_EDEFAULT, oldIsSubstitutableESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetIsSubstitutable() { return isSubstitutableESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Classifier getGeneral() { if (general != null && general.eIsProxy()) { InternalEObject oldGeneral = (InternalEObject)general; general = (Classifier)eResolveProxy(oldGeneral); if (general != oldGeneral) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, UmlPackage.GENERALIZATION__GENERAL, oldGeneral, general)); } } return general; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Classifier basicGetGeneral() { return general; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setGeneral(Classifier newGeneral) { Classifier oldGeneral = general; general = newGeneral; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmlPackage.GENERALIZATION__GENERAL, oldGeneral, general)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<GeneralizationSet> getGeneralizationSet() { if (generalizationSet == null) { generalizationSet = new EObjectWithInverseResolvingEList.ManyInverse<GeneralizationSet>(GeneralizationSet.class, this, UmlPackage.GENERALIZATION__GENERALIZATION_SET, UmlPackage.GENERALIZATION_SET__GENERALIZATION); } return generalizationSet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Classifier getSpecific() { if (eContainerFeatureID() != UmlPackage.GENERALIZATION__SPECIFIC) return null; return (Classifier)eInternalContainer(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetSpecific(Classifier newSpecific, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject)newSpecific, UmlPackage.GENERALIZATION__SPECIFIC, msgs); return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSpecific(Classifier newSpecific) { if (newSpecific != eInternalContainer() || (eContainerFeatureID() != UmlPackage.GENERALIZATION__SPECIFIC && newSpecific != null)) { if (EcoreUtil.isAncestor(this, newSpecific)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newSpecific != null) msgs = ((InternalEObject)newSpecific).eInverseAdd(this, UmlPackage.CLASSIFIER__GENERALIZATION, Classifier.class, msgs); msgs = basicSetSpecific(newSpecific, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmlPackage.GENERALIZATION__SPECIFIC, newSpecific, newSpecific)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean generalization_same_classifier(DiagnosticChain diagnostics, Map<Object, Object> context) { // TODO: implement this method // -> specify the condition that violates the invariant // -> verify the details of the diagnostic, including severity and message // Ensure that you remove @generated or mark it @generated NOT if (false) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, UmlValidator.DIAGNOSTIC_SOURCE, UmlValidator.GENERALIZATION__GENERALIZATION_SAME_CLASSIFIER, EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "generalization_same_classifier", EObjectValidator.getObjectLabel(this, context) }), new Object [] { this })); } return false; } return true; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case UmlPackage.GENERALIZATION__GENERALIZATION_SET: return ((InternalEList<InternalEObject>)(InternalEList<?>)getGeneralizationSet()).basicAdd(otherEnd, msgs); case UmlPackage.GENERALIZATION__SPECIFIC: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetSpecific((Classifier)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case UmlPackage.GENERALIZATION__GENERALIZATION_SET: return ((InternalEList<?>)getGeneralizationSet()).basicRemove(otherEnd, msgs); case UmlPackage.GENERALIZATION__SPECIFIC: return basicSetSpecific(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case UmlPackage.GENERALIZATION__SPECIFIC: return eInternalContainer().eInverseRemove(this, UmlPackage.CLASSIFIER__GENERALIZATION, Classifier.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE: return isIsSubstitutable(); case UmlPackage.GENERALIZATION__GENERAL: if (resolve) return getGeneral(); return basicGetGeneral(); case UmlPackage.GENERALIZATION__GENERALIZATION_SET: return getGeneralizationSet(); case UmlPackage.GENERALIZATION__SPECIFIC: return getSpecific(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE: setIsSubstitutable((Boolean)newValue); return; case UmlPackage.GENERALIZATION__GENERAL: setGeneral((Classifier)newValue); return; case UmlPackage.GENERALIZATION__GENERALIZATION_SET: getGeneralizationSet().clear(); getGeneralizationSet().addAll((Collection<? extends GeneralizationSet>)newValue); return; case UmlPackage.GENERALIZATION__SPECIFIC: setSpecific((Classifier)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE: unsetIsSubstitutable(); return; case UmlPackage.GENERALIZATION__GENERAL: setGeneral((Classifier)null); return; case UmlPackage.GENERALIZATION__GENERALIZATION_SET: getGeneralizationSet().clear(); return; case UmlPackage.GENERALIZATION__SPECIFIC: setSpecific((Classifier)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UmlPackage.GENERALIZATION__IS_SUBSTITUTABLE: return isSetIsSubstitutable(); case UmlPackage.GENERALIZATION__GENERAL: return general != null; case UmlPackage.GENERALIZATION__GENERALIZATION_SET: return generalizationSet != null && !generalizationSet.isEmpty(); case UmlPackage.GENERALIZATION__SPECIFIC: return getSpecific() != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override @SuppressWarnings("unchecked") public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException { switch (operationID) { case UmlPackage.GENERALIZATION___GENERALIZATION_SAME_CLASSIFIER__DIAGNOSTICCHAIN_MAP: return generalization_same_classifier((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); } return super.eInvoke(operationID, arguments); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (isSubstitutable: "); if (isSubstitutableESet) result.append(isSubstitutable); else result.append("<unset>"); result.append(')'); return result.toString(); } } //GeneralizationImpl