blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
36860b9edef7cfab6852ec3d52f46578c187a791
7ace26ee93627a9b1c7915febafcd12079a74549
/src/jio/System/Windows/Forms/UserControl.java
c0dac00fcbb9097d8a09f514bc06b9f77a41a00a
[]
no_license
Javonet-io-user/77de0417-10e4-47a5-86bd-abaef99c7026
f802f870613a8ccc0ee2afbd6c9ff12d4d1df838
fdfe808234e3e303bbbb124d7af37354967cfe3a
refs/heads/master
2020-04-07T17:32:10.040655
2018-11-21T16:00:28
2018-11-21T16:00:28
158,573,214
0
0
null
null
null
null
UTF-8
Java
false
false
1,669
java
package jio.System.Windows.Forms;import Common.Activation;import static Common.Helper.Convert;import static Common.Helper.getGetObjectName;import static Common.Helper.getReturnObjectName;import static Common.Helper.ConvertToConcreteInterfaceImplementation;import Common.Helper;import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer;import java.util.concurrent.atomic.AtomicReference;import java.lang.*; import jio.System.Windows.Forms.*;public class UserControl extends NControlContainer {public NObject javonetHandle; public UserControl (){ super((NObject) null); try { javonetHandle = Javonet.New("UserControl"); super.construct(javonetHandle); } catch (JavonetException _javonetException) { _javonetException.printStackTrace(); } }public UserControl(NObject handle) {super(handle);this.javonetHandle=handle;}public void setJavonetHandle(NObject handle) { this.javonetHandle = handle; try { super.construct(handle); } catch (JavonetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } static { try { Activation.initializeJavonet(); } catch (java.lang.Exception e) { e.printStackTrace(); } }}
[ "support@javonet.com" ]
support@javonet.com
aa81817a4c69299a411f534e2e3431776345f389
7e569541c1418ebb079820b6744d0d10fa7ac1d6
/app/src/main/java/com/villezone/gautam/rest/ApiInterface.java
637e28f4bb0293ca9993b9b917b1bca62711d33f
[]
no_license
gautamsurani/Villezone
bda08611e9db8c562adc86de17879bdf98c60179
6871aaf1db23a1dc42eda248b14dae8325fed0c9
refs/heads/master
2022-11-27T03:50:29.180150
2020-07-17T06:46:57
2020-07-17T06:46:57
278,281,252
0
0
null
null
null
null
UTF-8
Java
false
false
6,832
java
package com.villezone.gautam.rest; import com.villezone.gautam.model.AllProductsResponse; import com.villezone.gautam.model.AreaByIdResponse; import com.villezone.gautam.model.AreaResponse; import com.villezone.gautam.model.BaseModel; import com.villezone.gautam.model.CartResponse; import com.villezone.gautam.model.CategoryData; import com.villezone.gautam.model.CategoryResponse; import com.villezone.gautam.model.CustomerDetailResponse; import com.villezone.gautam.model.DashboardResponse; import com.villezone.gautam.model.LoginResponse; import com.villezone.gautam.model.NotificationResponse; import com.villezone.gautam.model.OrderDetailResponse; import com.villezone.gautam.model.OrderResponse; import com.villezone.gautam.model.ProductDetailResponse; import com.villezone.gautam.model.ProductResponse; import com.villezone.gautam.model.SearchResponse; import com.villezone.gautam.model.SubCategoryResponse; import com.villezone.gautam.model.UpdateProfileResponse; import com.villezone.gautam.model.User; import okhttp3.ResponseBody; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Path; import retrofit2.http.Query; public interface ApiInterface { String CATEGORY_ID = "category_id"; String PRODUCT_ID = "product_id"; String AREA_ID = "area_id"; String CART_PRODUCT_ID = "cartProductId"; String ORDER_ID = "order_id"; @POST(ApiURLs.VILLE_LOGIN_URL) Call<LoginResponse> login(@Query("mobile_number") String mobile_number , @Query("password") String password); @GET(ApiURLs.VILLE_AREA) Call<AreaResponse> getArea(); @GET(ApiURLs.VILLE_AREA + "/{" + AREA_ID + "}") Call<AreaByIdResponse> getAreaById(@Path(AREA_ID) String area_id); @POST(ApiURLs.VILLE_SEND_OTP) Call<BaseModel> sendOTP(@Query("mobile_number") String mobile_number); @POST(ApiURLs.VILLE_FORGOT_SEND_OTP) Call<BaseModel> sendForgotOTP(@Query("mobile_number") String mobile_number); @POST(ApiURLs.VILLE_LOGIN_SEND_OTP) Call<BaseModel> sendLoginViaOTP(@Query("mobile_number") String mobile_number); @POST(ApiURLs.VILLE_SUBMIT_OTP) Call<BaseModel> submitOTP(@Query("mobile_number") String mobile_number , @Query("code") String code); @POST(ApiURLs.VILLE_FORGOT_SUBMIT_OTP) Call<BaseModel> submitForgotOTP(@Query("mobile_number") String mobile_number , @Query("code") String code); @POST(ApiURLs.VILLE_SUBMIT_LOGIN_OTP) Call<LoginResponse> submitLoginOTP(@Query("mobile_number") String mobile_number , @Query("code") String code); @POST(ApiURLs.VILLE_SIGNUP_URL) Call<LoginResponse> signup(@Query("name") String name , @Query("mobile_number") String mobile_number , @Query("address") String address , @Query("email") String email , @Query("password") String password , @Query("area_id") String area_id , @Query("pin_code") String pin_code); @POST(ApiURLs.VILLE_FORGOT_SUBMIT) Call<BaseModel> forgotSubmit(@Query("mobile_number") String mobile_number , @Query("password") String password , @Query("password_confirmation") String password_confirmation); @POST(ApiURLs.VILLE_UPDATE_PASSWORD) Call<BaseModel> updatePassword(@Query("old_password") String old_password , @Query("password") String password , @Query("password_confirmation") String password_confirmation); @POST(ApiURLs.VILLE_UPDATE_PROFILE) Call<UpdateProfileResponse> updateProfile(@Query("name") String name , @Query("address") String address , @Query("email") String email , @Query("area_id") String area_id , @Query("pin_code") String pin_code); @POST(ApiURLs.VILLE_LOGOUT) Call<Void> logout(); @GET(ApiURLs.VILLE_CATEGORY) Call<CategoryResponse> getAllCategory(); @GET(ApiURLs.VILLE_PRODUCTS) Call<AllProductsResponse> getAllProducts(); @GET(ApiURLs.VILLE_PRODUCTS) Call<AllProductsResponse> getProductsByCatId(@Query("sub_category_id") String category_id , @Query("page") int page , @Query("sort_by") String sort_by); @GET(ApiURLs.VILLE_DASHBOARD_PRODUCTS) Call<DashboardResponse> getDashboardProducts(); @GET(ApiURLs.VILLE_PRODUCTS + "/{" + PRODUCT_ID + "}") Call<ProductDetailResponse> getProductById(@Path(PRODUCT_ID) String product_id); @GET(ApiURLs.VILLE_CATEGORY + "/{" + CATEGORY_ID + "}") Call<SubCategoryResponse> getCategoryById(@Path(CATEGORY_ID) String category_id); @GET(ApiURLs.VILLE_SUB_CATEGORY + "/{" + CATEGORY_ID + "}") Call<SubCategoryResponse> getSubCategory(@Path(CATEGORY_ID) String category_id, @Query("sort_by") String sort_by); @GET(ApiURLs.VILLE_SUB_CATEGORY) Call<CategoryResponse> getSubCategoryById(@Query(CATEGORY_ID) String category_id, @Query("sort_by") String sort_by); @POST(ApiURLs.VILLE_ADD_TO_CART) Call<BaseModel> addToCart(@Query("product_id") String product_id , @Query("weight") String weight); @GET(ApiURLs.VILLE_GET_CART) Call<CartResponse> getCart(); @GET(ApiURLs.VILLE_LOCK_CART) Call<BaseModel> lockCart(); @GET(ApiURLs.VILLE_UNLOCK_CART) Call<BaseModel> unlockCart(); @POST(ApiURLs.VILLE_UPDATE_CART_ITEM + "/{" + CART_PRODUCT_ID + "}") Call<BaseModel> updateCartItem(@Path(CART_PRODUCT_ID) String cartProductId, @Query("increment") String increment); @GET(ApiURLs.VILLE_DELETE_CART_ITEM + "/{" + CART_PRODUCT_ID + "}") Call<BaseModel> deleteCartItem(@Path(CART_PRODUCT_ID) String cartProductId); @POST(ApiURLs.VILLE_PLACE_ORDER) Call<BaseModel> placeOrder(@Query("payment_method") String payment_method , @Query("time_slot") String time_slot); @GET(ApiURLs.VILLE_SEARCH) Call<SearchResponse> search(@Query("keyword") String keyword); @GET(ApiURLs.VILLE_ORDERS) Call<OrderResponse> getAllOrders(); @GET(ApiURLs.VILLE_NOTIFICATION) Call<NotificationResponse> getAllNotifications(); @GET(ApiURLs.VILLE_ORDER_DETAIL + "/{" + ORDER_ID + "}" + "/details") Call<OrderDetailResponse> getOrderDetail(@Path(ORDER_ID) String order_id); @GET(ApiURLs.VILLE_CANCEL_ORDER + "/{" + ORDER_ID + "}") Call<BaseModel> cancelOrder(@Path(ORDER_ID) String order_id); @POST(ApiURLs.VILLE_SEND_FEEDBACK) Call<BaseModel> sendFeedback(@Query(ORDER_ID) String order_id, @Query("feedback") String feedback); @GET(ApiURLs.VILLE_DOWNLOAD_INVOICE + "/{" + ORDER_ID + "}") Call<ResponseBody> downloadInvoice(@Path(ORDER_ID) String order_id); @GET(ApiURLs.VILLE_SEND_FCM_TOKEN) Call<LoginResponse> sendToken(@Query("device_id") String device_id); }
[ "suranigautam98@gmail.com" ]
suranigautam98@gmail.com
2db8a1052377e61e7255fa1ea47e8becc223cd71
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Lang/40/org/apache/commons/lang/time/DateUtils_getFragmentInMilliseconds_1202.java
7ef904dac2f5571ccfce213d38e3948cf0e39a6b
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
3,204
java
org apach common lang time suit util surround link java util calendar link java util date object date util dateutil lot common method manipul date calendar method requir extra explan truncat ceil round method consid math floor math ceil math round version date date field bottom order complement method introduc fragment method method date field top order date year valid date decid kind date field result instanc millisecond dai author href mailto sergek lokitech serg knystauta author stephen colebourn author janek bogucki author href mailto ggregori seagullsw gari gregori author phil steitz author robert scholt version date util dateutil return number millisecond fragment datefield greater fragment millisecond date number millisecond current result number method retriev number millisecond fragment calcul number millisecond past todai fragment calendar date calendar dai year result millisecond past hour minut valid fragment calendar year calendar month calendar dai year calendar date calendar hour dai calendar minut calendar calendar millisecond fragment equal field januari calendar fragment januari calendar fragment januari calendar minut fragment januari calendar millisecond fragment millisecond split millisecond param date date work param fragment calendar field part date calcul number millisecond fragment date illeg argument except illegalargumentexcept date code code fragment support fragment millisecond getfragmentinmillisecond date date fragment fragment getfrag date fragment calendar millisecond
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
9ce87ed99b4b77393591663ffdd0d84cd797f47e
38d8f5a661c11e8a321fe87aee35c5fc643a85b3
/app/src/main/java/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java
21ddc0271eb768575e7c39105088fe9066cbd655
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
qixinmin/365browser
0b867042afeae239c9989df9d88a9e4c13fb17b8
23af01e3dfa6f324ee93651ee3ef7f3d4f1668fa
refs/heads/master
2021-05-01T23:48:18.766955
2020-01-01T10:45:39
2020-01-01T10:45:39
77,889,150
1
0
Apache-2.0
2020-01-01T10:45:42
2017-01-03T06:12:53
Java
UTF-8
Java
false
false
5,046
java
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.contextualsearch; import org.chromium.base.Log; import java.net.URL; /** * Implements the UMA logging for Ranker that's used for Contextual Search Tap Suppression. */ public class ContextualSearchRankerLoggerImpl implements ContextualSearchRankerLogger { private static final String TAG = "ContextualSearch"; // Pointer to the native instance of this class. private long mNativePointer; // Whether logging for the current URL is currently setup. private boolean mIsLoggingSetup; // Whether the service is ready to actually record log data. private boolean mCanServiceActuallyRecord; // Whether any data has been written to the log since calling setupLoggingForPage(). private boolean mDidLog; /** * Constructs a Ranker Logger and associated native implementation to write Contextual Search * ML data to Ranker. */ public ContextualSearchRankerLoggerImpl() { if (isEnabled()) mNativePointer = nativeInit(); } /** * This method should be called to clean up storage when an instance of this class is * no longer in use. The nativeDestroy will call the destructor on the native instance. */ void destroy() { if (isEnabled()) { assert mNativePointer != 0; writeLogAndReset(); nativeDestroy(mNativePointer); mNativePointer = 0; mCanServiceActuallyRecord = false; mDidLog = false; } mIsLoggingSetup = false; } @Override public void setupLoggingForPage(URL basePageUrl) { mIsLoggingSetup = true; if (isEnabled()) { // The URL may be null for custom Chrome URIs like chrome://flags. if (basePageUrl != null) { nativeSetupLoggingAndRanker(mNativePointer, basePageUrl.toString()); mCanServiceActuallyRecord = true; } } } @Override public void log(Feature feature, Object value) { assert mIsLoggingSetup; if (!isEnabled()) return; // TODO(donnd): Add some enforcement that log() calls are done before inference time. logInternal(feature, value); } @Override public void logOutcome(Feature feature, Object value) { assert mIsLoggingSetup; if (!isEnabled()) return; logInternal(feature, value); } @Override public void writeLogAndReset() { if (isEnabled()) { if (mDidLog) nativeWriteLogAndReset(mNativePointer); mCanServiceActuallyRecord = false; mDidLog = false; } mIsLoggingSetup = false; } /** Whether actually writing data is enabled. If not, we may do nothing or print. */ private boolean isEnabled() { return ContextualSearchFieldTrial.isRankerLoggingEnabled(); } /** * Logs the given feature/value after checking that logging has been set up. * @param feature The feature to log. * @param value The value to log. */ private void logInternal(Feature feature, Object value) { if (value instanceof Boolean) { logToNative(feature.toString(), ((boolean) value ? 1 : 0)); } else if (value instanceof Integer) { logToNative(feature.toString(), Long.valueOf((int) value)); } else if (value instanceof Long) { logToNative(feature.toString(), (long) value); } else if (value instanceof Character) { logToNative(feature.toString(), Character.getNumericValue((char) value)); } else { Log.w(TAG, "Could not log feature to Ranker: " + feature.toString() + " of class " + value.getClass()); } } /** * Logs to the native instance. All native logging must go through this bottleneck. * @param feature The feature to log. * @param value The value to log. */ private void logToNative(String feature, long value) { if (mCanServiceActuallyRecord) { nativeLogLong(mNativePointer, feature, value); mDidLog = true; } } // ============================================================================================ // Native methods. // ============================================================================================ private native long nativeInit(); private native void nativeDestroy(long nativeContextualSearchRankerLoggerImpl); private native void nativeLogLong( long nativeContextualSearchRankerLoggerImpl, String featureString, long value); private native void nativeSetupLoggingAndRanker( long nativeContextualSearchRankerLoggerImpl, String basePageUrl); private native void nativeWriteLogAndReset(long nativeContextualSearchRankerLoggerImpl); }
[ "alexzchen@china-liantong.com" ]
alexzchen@china-liantong.com
9ab1a96374829d2312f93f94ea21d94f4f051bbf
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3.3/modules/scripting/src/main/java/org/mule/components/script/jsr223/ScriptMessageBuilder.java
12bc5b3af931902230f20aff1c5260c4a2a7188b
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
4,343
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the MuleSource MPL * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.components.script.jsr223; import javax.script.Compilable; import javax.script.CompiledScript; import javax.script.Namespace; import javax.script.ScriptEngine; import javax.script.ScriptException; import org.mule.components.builder.AbstractMessageBuilder; import org.mule.components.builder.MessageBuilderException; import org.mule.umo.UMOEventContext; import org.mule.umo.UMOMessage; import org.mule.umo.lifecycle.Initialisable; import org.mule.umo.lifecycle.InitialisationException; import org.mule.umo.lifecycle.RecoverableException; /** * A message builder component that can execute message building as a script. */ public class ScriptMessageBuilder extends AbstractMessageBuilder implements Initialisable { /** Delegating script component that actually does the work */ protected Scriptable scriptable; public ScriptMessageBuilder() { this.scriptable = new Scriptable(); } public Object buildMessage(UMOMessage request, UMOMessage response) throws MessageBuilderException { Namespace namespace = scriptable.getScriptEngine().createNamespace(); populateNamespace(namespace, request, response); Object result = null; try { result = runScript(namespace); } catch (ScriptException e) { throw new MessageBuilderException(response, e); } if (result == null) { throw new NullPointerException("A result payload must be returned from the groovy script"); } return result; } public void initialise() throws InitialisationException, RecoverableException { scriptable.initialise(); } protected void populateNamespace(Namespace namespace, UMOMessage request, UMOMessage response) { namespace.put("request", request); namespace.put("response", response); namespace.put("descriptor", descriptor); namespace.put("componentNamespace", namespace); namespace.put("log", logger); } public ScriptEngine getScriptEngine() { return scriptable.getScriptEngine(); } public void setScriptEngine(ScriptEngine scriptEngine) { scriptable.setScriptEngine(scriptEngine); } public CompiledScript getCompiledScript() { return scriptable.getCompiledScript(); } public void setCompiledScript(CompiledScript compiledScript) { scriptable.setCompiledScript(compiledScript); } public String getScriptText() { return scriptable.getScriptText(); } public void setScriptText(String scriptText) { scriptable.setScriptText(scriptText); } public String getScriptFile() { return scriptable.getScriptFile(); } public void setScriptFile(String scriptFile) { scriptable.setScriptFile(scriptFile); } public void setScriptEngineName(String scriptEngineName) { scriptable.setScriptEngineName(scriptEngineName); } protected void populateNamespace(Namespace namespace, UMOEventContext context) { namespace.put("context", context); namespace.put("message", context.getMessage()); namespace.put("descriptor", context.getComponentDescriptor()); namespace.put("componentNamespace", namespace); namespace.put("log", logger); namespace.put("result", new Object()); } protected void compileScript(Compilable compilable) throws ScriptException { scriptable.compileScript(compilable); } protected Object evaluteScript(Namespace namespace) throws ScriptException { return scriptable.evaluteScript(namespace); } protected Object runScript(Namespace namespace) throws ScriptException { return scriptable.runScript(namespace); } protected ScriptEngine createScriptEngine() { return scriptable.createScriptEngine(); } }
[ "lajos@bf997673-6b11-0410-b953-e057580c5b09" ]
lajos@bf997673-6b11-0410-b953-e057580c5b09
4ecd09d6c3a8dec24b153907ed8dbe7413ac20b2
ddf0d861a600e9271198ed43be705debae15bafd
/src/DynamicProgramming/LongestPalindromicSubsequence.java
57198b0a170700c54ce04fa8f0b45b00631f7eca
[]
no_license
bibhuty-did-this/MyCodes
79feea385b055edc776d4a9d5aedbb79a9eb55f4
2b8c1d4bd3088fc28820145e3953af79417c387f
refs/heads/master
2023-02-28T09:20:36.500579
2021-02-07T17:17:54
2021-02-07T17:17:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,154
java
package DynamicProgramming; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import static java.lang.Math.max; public class LongestPalindromicSubsequence{ public static int longestPalindromicSubsequence(String s){ int n=s.length(); int[][] dp=new int[n][n]; for(int i=0;i<n;++i) dp[i][i]=1; for(int c=2;c<=n;++c){ for(int i=0;i<n-c+1;++i){ int j=i+c-1; if(s.charAt(i)==s.charAt(j) && c==2) dp[i][j]=2; else if(s.charAt(i)==s.charAt(j)) dp[i][j]=2+dp[i+1][j-1]; else dp[i][j]=max(dp[i][j-1],dp[i+1][j]); } } return dp[0][n-1]; } public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(System.out); StringTokenizer in=new StringTokenizer(br.readLine()); int testCases=Integer.parseInt(in.nextToken()); while(testCases-->0){ in=new StringTokenizer(br.readLine()); String s=in.nextToken().trim(); //out.println(s); //out.println(_longestPalindromicSubsequence_(s,0,s.length()-1)); out.println(longestPalindromicSubsequence(s)); } out.close(); } public static int _longestPalindromicSubsequence_(String s,int start,int end){ // If the start and end points are at the same character it is a palindrome if(start==end) return 1; // If the starting character is just the previous one of the end and they // match then we have a palindrome of length 2 if(s.charAt(start)==s.charAt(end) && start+1==end) return 2; // If both the start and the end characters match then we need to find the // maximum palindrome by including the start and the end character if(s.charAt(start)==s.charAt(end)) return 2+_longestPalindromicSubsequence_(s,start+1,end-1); // If none of the character match then it is better to find all the possible // subsequence. return max(_longestPalindromicSubsequence_(s,start+1,end), _longestPalindromicSubsequence_(s,start,end-1)); } }
[ "bibhuty.nit@gmail.com" ]
bibhuty.nit@gmail.com
c22138aaed1e460ca47d414dcfa136b9189281da
6205d374e8fbdd846b0be74c03d647aca749862b
/src/main/java/com/isoft/gtw/web/rest/ClientForwardController.java
66f6933b338468802f730acc2ee3a4963d2dc6bc
[]
no_license
Ibrahim5560/gtw
05b61fa0176c44241c8cb2a86c8d5e0694effd0e
b2f79f35a0d527edd7d021fdbeeb6b25a3922db2
refs/heads/master
2022-12-25T08:40:00.224034
2020-03-03T13:03:07
2020-03-03T13:03:07
244,637,524
0
0
null
2022-12-16T05:13:18
2020-03-03T13:02:51
Java
UTF-8
Java
false
false
480
java
package com.isoft.gtw.web.rest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class ClientForwardController { /** * Forwards any unmapped paths (except those containing a period) to the client {@code index.html}. * @return forward to client {@code index.html}. */ @GetMapping(value = "/**/{path:[^\\.]*}") public String forward() { return "forward:/"; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
67f4ccd199506db39db126c7376f4a8ab91ef986
985980cd69949832cfb7a7102417c813dd4f94e5
/baselibrary/src/main/java/com/haozi/baselibrary/net/retrofit/ReqCallbackEx.java
4af273351a2bbfbd4b457bfcff5235a813935739
[]
no_license
jackyflame/ArcgisApp
cacef026f961230bee7ca05cdaf26afc6d91202b
77846c830a9f4c479634d4981f4195418bf73c4f
refs/heads/master
2021-06-24T19:16:36.638949
2017-09-14T07:11:08
2017-09-14T07:11:08
103,422,848
1
0
null
null
null
null
UTF-8
Java
false
false
278
java
package com.haozi.baselibrary.net.retrofit; /** * Created by Android Studio. * ProjectName: shenbian_android_cloud_speaker * Author: haozi * Date: 2017/5/15 * Time: 18:13 */ public interface ReqCallbackEx<T> extends ReqCallback<T> { void onReqUpdate(Object obj); }
[ "263667227@qq.com" ]
263667227@qq.com
097cc2234dd0815fab49eaedae234d81d5e53546
9b5bc5fb2260bbebaf498ca75b97ec34894d7035
/mall-search/src/main/java/com/macro/mall/search/config/Swagger2Config.java
5d28f12b15474e2d80f9bd4fcfc52052a6409973
[ "Apache-2.0" ]
permissive
XiuyeXYE/mall-swarm
fc1fc9b248416875d695d66b4edff53c01cc3d0c
09265cd147d607830512854e4e3ed74663ad1d42
refs/heads/master
2022-12-13T07:43:35.493199
2020-08-16T07:22:07
2020-08-16T07:22:07
286,952,765
0
0
Apache-2.0
2020-08-12T07:57:04
2020-08-12T07:57:03
null
UTF-8
Java
false
false
1,322
java
package com.macro.mall.search.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * Swagger2API文档的配置 * Created by macro on 2018/4/26. */ @Configuration @EnableSwagger2 public class Swagger2Config { @Bean public Docket createRestApi(){ return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage("com.macro.mall.search.controller")) .paths(PathSelectors.any()) .build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("mall搜索系统") .description("mall搜索模块") .contact("macro") .version("1.0") .build(); } }
[ "xiuye_engineer@outlook.com" ]
xiuye_engineer@outlook.com
7864e6250242cb1bfc0385b2b1f81c3eac13d962
29b6a856a81a47ebab7bfdba7fe8a7b845123c9e
/dingtalk/java/src/main/java/com/aliyun/dingtalkbizfinance_1_0/models/QuerySupplierByPageResponseBody.java
05473bbd3edcbd813abbc1a44b6ecd625d762bd4
[ "Apache-2.0" ]
permissive
aliyun/dingtalk-sdk
f2362b6963c4dbacd82a83eeebc223c21f143beb
586874df48466d968adf0441b3086a2841892935
refs/heads/master
2023-08-31T08:21:14.042410
2023-08-30T08:18:22
2023-08-30T08:18:22
290,671,707
22
9
null
2021-08-12T09:55:44
2020-08-27T04:05:39
PHP
UTF-8
Java
false
false
3,228
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.dingtalkbizfinance_1_0.models; import com.aliyun.tea.*; public class QuerySupplierByPageResponseBody extends TeaModel { @NameInMap("hasMore") public Boolean hasMore; @NameInMap("list") public java.util.List<QuerySupplierByPageResponseBodyList> list; public static QuerySupplierByPageResponseBody build(java.util.Map<String, ?> map) throws Exception { QuerySupplierByPageResponseBody self = new QuerySupplierByPageResponseBody(); return TeaModel.build(map, self); } public QuerySupplierByPageResponseBody setHasMore(Boolean hasMore) { this.hasMore = hasMore; return this; } public Boolean getHasMore() { return this.hasMore; } public QuerySupplierByPageResponseBody setList(java.util.List<QuerySupplierByPageResponseBodyList> list) { this.list = list; return this; } public java.util.List<QuerySupplierByPageResponseBodyList> getList() { return this.list; } public static class QuerySupplierByPageResponseBodyList extends TeaModel { @NameInMap("code") public String code; @NameInMap("createTime") public Long createTime; @NameInMap("description") public String description; @NameInMap("name") public String name; @NameInMap("status") public String status; @NameInMap("userDefineCode") public String userDefineCode; public static QuerySupplierByPageResponseBodyList build(java.util.Map<String, ?> map) throws Exception { QuerySupplierByPageResponseBodyList self = new QuerySupplierByPageResponseBodyList(); return TeaModel.build(map, self); } public QuerySupplierByPageResponseBodyList setCode(String code) { this.code = code; return this; } public String getCode() { return this.code; } public QuerySupplierByPageResponseBodyList setCreateTime(Long createTime) { this.createTime = createTime; return this; } public Long getCreateTime() { return this.createTime; } public QuerySupplierByPageResponseBodyList setDescription(String description) { this.description = description; return this; } public String getDescription() { return this.description; } public QuerySupplierByPageResponseBodyList setName(String name) { this.name = name; return this; } public String getName() { return this.name; } public QuerySupplierByPageResponseBodyList setStatus(String status) { this.status = status; return this; } public String getStatus() { return this.status; } public QuerySupplierByPageResponseBodyList setUserDefineCode(String userDefineCode) { this.userDefineCode = userDefineCode; return this; } public String getUserDefineCode() { return this.userDefineCode; } } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
ea26f2c80f66d511ee02609e363586200dfdedf5
3efc2074ee6f64c92c2e0c272153f8d602b65945
/Muse_Valerio/Muse/srcJMFnoRTP/com/sun/media/StateTransistor.java
2317f3b7f8f91442df10e8d6b33dc96a4f61ebcf
[]
no_license
marconanni/muse3
80ea97e2357d42a8426ca565f179ed62ea421dfe
98004320df6eef09a97915c0c02b1e3146ea2bd1
refs/heads/master
2021-01-10T18:44:32.171711
2010-03-03T14:44:18
2010-03-03T14:44:18
34,604,347
0
0
null
null
null
null
UTF-8
Java
false
false
2,178
java
/* * @(#)StateTransistor.java 1.3 02/08/21 * * Copyright (c) 1996-2002 Sun Microsystems, Inc. All rights reserved. */ package com.sun.media; import javax.media.Time; /** * StateTransistor is an interface with the functionality of performing * the actual state transitions: DoPrefetch, DoRealize, etc. */ public interface StateTransistor { /** * This function performs the steps of realizing a module or a Player. * @return true if successful. */ public boolean doRealize(); /** * Called when realize fails. */ public void doFailedRealize(); /** * Called when the realize() is aborted, i.e. deallocate() was called * while realizing. Release all resources claimed previously by the * realize() call. */ public void abortRealize(); /** * This function performs the steps to prefetch a module or Player. * @return true if successful. */ public boolean doPrefetch(); /** * Called when prefetch fails. */ public void doFailedPrefetch(); /** * Called when the prefetch() is aborted, i.e. deallocate() was called * while prefetching. Release all resources claimed previously by the * prefetch call. */ public void abortPrefetch(); /** * This function performs the steps to start a module or Player. */ public void doStart(); /** * This function performs the steps to stop a module or Player, * and return to the prefetched state. */ public void doStop(); /** * This function performs the steps to deallocate a module or Player, * and return to the realized state. */ public void doDealloc(); /** * This function performs the steps to close a module or Player. */ public void doClose(); /** * This function notifies the module that the media time has changed. */ public void doSetMediaTime(Time t); /** * This function notifies the module that the playback rate has changed. */ public float doSetRate(float r); }
[ "pire.dejaco@0b1e5f34-49f6-11de-a65c-33beeba39556" ]
pire.dejaco@0b1e5f34-49f6-11de-a65c-33beeba39556
40f46c7a59a10b2572747e8edf63d94905e87a42
e5f9de773b00f5f02925d146feff7ec8e1217038
/src/main/javadoc/org/eel/kitchen/jsonschema/examples/package-info.java
873c0040f3f5125855b5b76ff82db39f855f59c7
[]
no_license
kedar031/json-schema-validator
49a70ced60f4d926d0847387af9d29199134958b
980f3985ee40e4b596b2824d6bb37171a88a45e1
refs/heads/master
2021-01-17T22:27:08.266828
2013-01-03T22:24:15
2013-01-03T22:24:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,069
java
/* * Copyright (c) 2012, Francis Galiegue <fgaliegue@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the Lesser GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Lesser GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * API usage examples * * <p>This package contains examples on how to use all features of this API * (including augmenting schemas, URI redirections etc).</p> * * <p>All examples have a {@code main()} program, so you may run them and see * the output. Suggestions welcome.</p> */ package org.eel.kitchen.jsonschema.examples;
[ "fgaliegue@gmail.com" ]
fgaliegue@gmail.com
9d305b410d40fd2b5a544ee6e6478f0360f2f76d
77e6dce28c0adc0ad847ece9b5e67cbe659f5d89
/credit-risk-api/src/main/java/com/ccx/credit/risk/api/RoleApi.java
9e6adae9edd2ac6d177bb9cd9d999600d5bd02b8
[]
no_license
526dong/credit-risk
5372792de30a5b35b0c5d8e4c0b859e8d7deaae7
c0be4407e6ff606a3a29c482268870226ccda1f3
refs/heads/master
2021-05-09T20:45:40.985370
2018-01-24T03:24:07
2018-01-24T03:24:07
118,705,411
0
0
null
null
null
null
UTF-8
Java
false
false
1,437
java
package com.ccx.credit.risk.api; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.service.IService; import com.ccx.credit.risk.model.Role; import com.ccx.credit.risk.model.RoleResource; import com.github.pagehelper.PageInfo; /** * * @description Role 表数据服务层接口 * @author zxr * @date 2017 上午11:56:04 */ public interface RoleApi extends IService<Role>{ /** * 根据用户ID查询资源集合 * @param id * @return */ Map<String, Set<String>> selectResourceMapByUserId(Long userId); //获取角色列表模型 PageInfo<Role> findAll(Map<String, Object> params); int selectUserByRoleId(long roleId); //逻辑删除角色 String deleteByRoleId(long id); Role selectRoleById(Long id); //修改角色 void updateTO(Role uRole); //创建角色 void doAddRole(Role role); //校验角色是否唯一 Role getRoleByName(Map<String, Object> map); //给角色分配权限 void addRes2Role(Long roleId, String resIds); //获取所有角色集合 List<Role> findAllRole(); //返回树数据 JSONArray treeData(HttpServletRequest request, List<RoleResource> roleRes); //分配权限时显示列表 JSONArray showTree(List<RoleResource> roleRes,long insId); Object selectTree(); List<Map<String, Object>> findRoleByInstitutionId(long id); }
[ "1476719022@qq.com" ]
1476719022@qq.com
fd02d53d0776c4a5b8733c0dd435c1aa9f79cd04
0ecc3f1b9199f398368b1126966c8f3a04351b0c
/clients-business-capability-services/src/main/java/com/lulobank/clients/services/outboundadapters/model/AdditionalPersonalInformation.java
e6aad3ca4e0bb71c347d1c87aebeb2c918ab2c56
[]
no_license
zhenyuncai/client
30c990af3fe97f8e63d7440f53a73819fcef572b
a352c3cc1d563e5ffa9886988bf831630a915d65
refs/heads/main
2023-06-04T12:59:02.973045
2021-06-29T23:16:07
2021-06-29T23:16:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package com.lulobank.clients.services.outboundadapters.model; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBDocument; import lombok.Getter; import lombok.Setter; import static com.lulobank.clients.services.utils.StringUtils.getStringWithOutSpaces; @Getter @Setter @DynamoDBDocument public class AdditionalPersonalInformation { private String firstName; private String secondName; private String firstSurname; private String secondSurname; private String street; private String spouse; private String dateOfIdentification; private String dateOfDeath; private String marriageDate; private String instruction; private String home; private String maritalStatus; private String placeBirth; private String nationality; private String profession; public void setFirstName(String firstName) { this.firstName = getStringWithOutSpaces(firstName); } public void setSecondName(String secondName) { this.secondName = getStringWithOutSpaces(secondName); } public void setFirstSurname(String firstSurname) { this.firstSurname = getStringWithOutSpaces(firstSurname); } public void setSecondSurname(String secondSurname) { this.secondSurname = getStringWithOutSpaces(secondSurname); } }
[ "juan.toledo@globant.com" ]
juan.toledo@globant.com
dd42f5edf16a8dc1a16aba223140fc7275ac4239
5cff03e307007c78b57a924df6e1b6fdf1fc3562
/SocialNetworking-master/src/main/java/com/advik/model/User.java
ffd2392b08bd8c492e7d06ed0d17a284c45358e9
[]
no_license
VikramVerma12/collaboration_portal
a26c0471bbe1c2b61ba4144990b938b74ddd3a41
1d2b036b54111d8cd0d0718334185fb7bde224ef
refs/heads/master
2020-06-17T03:34:29.555252
2016-11-29T05:05:12
2016-11-29T05:05:12
75,044,375
0
0
null
null
null
null
UTF-8
Java
false
false
2,467
java
package com.advik.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Transient; import javax.validation.constraints.Size; import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotEmpty; import org.springframework.format.annotation.NumberFormat; import org.springframework.format.annotation.NumberFormat.Style; import org.springframework.web.multipart.MultipartFile; @Entity public class User implements Serializable{ private static final long serialVersionUID = -1472066795342727103L; @Id @Column @GeneratedValue(strategy=GenerationType.IDENTITY) private int userid; //@NotEmpty(message="Name field is mandatory.") private String username; @Column //@NotEmpty(message="Password should not be empty.") //@Size(min=6,max=10,message="size must be six to 10 characters") @NotEmpty private String password; @Column private boolean isActive=true; @Email private String email; // @Length(max=10,min=10,message="Phone number is not valid. Should be of length 10.") //@NotEmpty(message="Phone field is mendatory.") @NumberFormat(style= Style.NUMBER) @NotEmpty private String mobile; @NotEmpty private String address; @Transient private MultipartFile image; public MultipartFile getImage() { return image; } public void setImage(MultipartFile image) { this.image = image; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public boolean isActive() { return isActive; } public void setActive(boolean isActive) { this.isActive = isActive; } public int getUserid() { return userid; } public void setUserid(int userid) { this.userid = userid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "=" ]
=
138fd464547f2f16095e1475e4dd50ec460e3142
e6ac4214fc792408fee286c177a779bcdec8fda5
/HammerCore/src/main/java/uk/co/drnaylor/minecraft/hammer/core/HammerDatabaseProviderFactory.java
a40b0b81ea46df3f2db086a317c7c47ce62bab6c
[ "MIT" ]
permissive
dualspiral/Hammer
e835b9a872fe448bb8a61f4aec1a3a104afd4da6
e165da6092f32c3afb9ed436a31aacfbd1c4c903
refs/heads/master
2022-11-11T19:16:20.616680
2019-07-09T12:06:05
2019-07-09T12:06:05
31,501,271
4
2
MIT
2019-07-14T11:17:16
2015-03-01T15:52:14
Java
UTF-8
Java
false
false
3,668
java
/* * This file is part of Hammer, licensed under the MIT License (MIT). * * Copyright (c) 2015 Daniel Naylor * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package uk.co.drnaylor.minecraft.hammer.core; import ninja.leaping.configurate.ConfigurationNode; import uk.co.drnaylor.minecraft.hammer.core.database.IDatabaseProvider; import uk.co.drnaylor.minecraft.hammer.core.database.h2.H2FlatFileDatabaseProvider; import uk.co.drnaylor.minecraft.hammer.core.database.mysql.MySqlDatabaseProvider; import uk.co.drnaylor.minecraft.hammer.core.database.sqlite.SQLiteDatabaseProvider; import uk.co.drnaylor.minecraft.hammer.core.exceptions.HammerException; import uk.co.drnaylor.minecraft.hammer.core.wrappers.WrappedServer; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; final class HammerDatabaseProviderFactory { private HammerDatabaseProviderFactory() {} private final static Map<String, Factory> providerFactory = new HashMap<>(); static { providerFactory.put("sqlite", (s, c) -> new SQLiteDatabaseProvider(String.format("%1$s%2$sdata%2$ssqlite.db", s.getDataFolder(), File.separator))); providerFactory.put("h2", (s, c) -> new H2FlatFileDatabaseProvider(String.format("%1$s%2$sdata%2$sh2.db", s.getDataFolder(), File.separator))); providerFactory.put("mysql", (s, c) -> { ConfigurationNode mysql = c.getConfig().getNode("mysql"); return new MySqlDatabaseProvider( mysql.getNode("host").getString(), mysql.getNode("port").getInt(3306), mysql.getNode("database").getString(), mysql.getNode("username").getString(), mysql.getNode("password").getString()); }); } static IDatabaseProvider createDatabaseProvider(WrappedServer server, HammerConfiguration config) throws HammerException { ConfigurationNode root = config.getConfig(); String type = root.getNode("database-engine").getString("sqlite"); Factory f = providerFactory.get(type.toLowerCase()); if (f == null) { throw new HammerException("No database provider for type " + type); } try { return f.create(server, config); } catch (Exception e) { throw new HammerException("Unable to connect to the database.", e); } } @FunctionalInterface private interface Factory { IDatabaseProvider create(WrappedServer server, HammerConfiguration configuration) throws ClassNotFoundException, IOException; } }
[ "git@drnaylor.co.uk" ]
git@drnaylor.co.uk
e102debe9c41d4e66b5c495dedda34d7573e276c
79e4da87d5cd334d449d6819bbfe10e24fe9f14c
/kontroll-api/kontroll-context/src/main/java/com/tmt/kontroll/context/exceptions/RequestHandlingException.java
df3d110820b5bc6fd6caef61b2d3f32e31545e95
[]
no_license
SergDerbst/Kontroll
0a1a9563dfc83cba361a6999ff978b0996f9e484
6b07b8a511ba4b0b4bd7522efdce08cc9dd5c0dd
refs/heads/master
2021-01-11T00:11:13.768181
2015-04-19T11:28:42
2015-04-19T11:28:42
15,509,212
0
0
null
null
null
null
UTF-8
Java
false
false
339
java
package com.tmt.kontroll.context.exceptions; import org.apache.commons.lang3.exception.ContextedRuntimeException; public class RequestHandlingException extends ContextedRuntimeException { private static final long serialVersionUID = 3225635493934931146L; public RequestHandlingException(final Throwable cause) { super(cause); } }
[ "sergio.weigel@gmail.com" ]
sergio.weigel@gmail.com
cb5cf72f40191e00fcf7f7e504eb274ee3af4758
73c929986b9744ca7ddb7c957a59b14c85001b5e
/src/lesson3/Console.java
faec2ee0494a4b14a2ad62a826f25e26b218f7fc
[]
no_license
OKrylov/Java1_2020_12_21
5f92570d0b506df16f3301a03d72f709a706678e
d8360b4e463a758d703100f0b3799aeeb1332b40
refs/heads/master
2023-02-12T01:33:03.191191
2021-01-18T20:34:09
2021-01-18T20:34:09
323,431,855
0
0
null
2021-01-18T20:35:04
2020-12-21T19:41:02
Java
UTF-8
Java
false
false
1,344
java
package lesson3; import java.io.IOException; import java.util.Scanner; public class Console { public static void main(String[] args) throws IOException { // BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // String line = reader.readLine(); // System.out.println("Line from console: " + line); Scanner scanner = new Scanner(System.in); while (true) { System.out.println("Введите число от 0 до 10: "); if (!scanner.hasNextInt()) { System.out.println("Было введено нечисловое значение!"); scanner.nextLine(); continue; } int digit = scanner.nextInt(); if (digit >= 0 && digit <= 10) { System.out.println("Пользователь ввёл корректное значение: " + digit); break; } else { System.out.println("Пользователь ввёл НЕКОРРЕКТНОЕ значение: " + digit); } } // String str = scanner.nextLine(); // while (!str.equals("exit")) { // System.out.println("From scanner: " + str); // str = scanner.nextLine(); // } } }
[ "krylov92oa@gmail.com" ]
krylov92oa@gmail.com
a8826e2484e8e332ec8886a3548470b09a2adb63
8ee2f29a9c71f1e86c104c2d7f99e203562d77f3
/modules/aspects/src/main/java/config/SpringBootBeanInfoFactory.java
5fc206c9f859fafcf45cf6a6e48f78fd3bebf33b
[ "Apache-2.0" ]
permissive
sdeleuze/spring-init
f7b26a53906a6a2f616b74bb8b00ea965986e922
557ff02eb2315f3cec3d5befacd9dd0ea6440222
refs/heads/master
2022-11-17T10:11:23.611936
2020-06-26T13:56:24
2020-06-26T13:56:24
275,185,683
0
0
Apache-2.0
2020-06-26T15:16:41
2020-06-26T15:16:41
null
UTF-8
Java
false
false
1,063
java
package config; import java.beans.BeanInfo; import java.beans.IntrospectionException; import org.springframework.beans.BeanInfoFactory; /* * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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. */ /** * @author Dave Syer * */ public class SpringBootBeanInfoFactory implements BeanInfoFactory { @Override public BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException { System.err.println("BeanInfo: " + beanClass.getName()); return new SpringBootBeanInfo(beanClass); } }
[ "dsyer@pivotal.io" ]
dsyer@pivotal.io
7544a4b4643693011613804b2f795543837a8668
9f43271bb462e2da0e9afac724b4df9127a36dc4
/gdx-mod/src/main/java/com/badlogic/gdx/utils/DataInput.java
4029959be607f3877e3055f63d9d50c8c1c74a60
[]
no_license
HoldYourWaffle/Geem
cd111a03a3157b16a86eb007fb1055f05e8a9923
3395346fbe9e224ded016a31fc7f72222646ec50
refs/heads/master
2018-10-30T02:52:13.876075
2018-08-23T11:20:33
2018-08-23T11:20:33
145,842,225
0
0
null
null
null
null
UTF-8
Java
false
false
2,971
java
/******************************************************************************* * Copyright 2011 See AUTHORS file. * * 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.badlogic.gdx.utils; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; /** * Extends {@link DataInputStream} with additional convenience methods. * * @author Nathan Sweet */ public class DataInput extends DataInputStream { private char[] chars = new char[32]; public DataInput(InputStream in) { super(in); } /** Reads a 1-5 byte int. */ public int readInt(boolean optimizePositive) throws IOException { int b = read(); int result = b & 0x7F; if ((b & 0x80) != 0) { b = read(); result |= (b & 0x7F) << 7; if ((b & 0x80) != 0) { b = read(); result |= (b & 0x7F) << 14; if ((b & 0x80) != 0) { b = read(); result |= (b & 0x7F) << 21; if ((b & 0x80) != 0) { b = read(); result |= (b & 0x7F) << 28; } } } } return optimizePositive ? result : ((result >>> 1) ^ -(result & 1)); } /** * Reads the length and string of UTF8 characters, or null. * * @return May be null. */ public String readString() throws IOException { int charCount = readInt(true); switch (charCount) { case 0: return null; case 1: return ""; } charCount--; if (chars.length < charCount) chars = new char[charCount]; char[] chars = this.chars; // Try to read 7 bit ASCII chars. int charIndex = 0; int b = 0; while (charIndex < charCount) { b = read(); if (b > 127) break; chars[charIndex++] = (char) b; } // If a char was not ASCII, finish with slow path. if (charIndex < charCount) readUtf8_slow(charCount, charIndex, b); return new String(chars, 0, charCount); } private void readUtf8_slow(int charCount, int charIndex, int b) throws IOException { char[] chars = this.chars; while (true) { switch (b >> 4) { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: chars[charIndex] = (char) b; break; case 12: case 13: chars[charIndex] = (char) ((b & 0x1F) << 6 | read() & 0x3F); break; case 14: chars[charIndex] = (char) ((b & 0x0F) << 12 | (read() & 0x3F) << 6 | read() & 0x3F); break; } if (++charIndex >= charCount) break; b = read() & 0xFF; } } }
[ "ravivanrooijen@live.nl" ]
ravivanrooijen@live.nl
85ced7be797c04028b0f47080935a7c51700ceb5
ccace7925cbc81d3911296ffdc3a096ba3647e64
/modules/lib/base/impl/src/main/java/org/incode/module/base/dom/types/ReferenceType.java
bdb4c6579d4f9b832eb6b794a332933427826d93
[ "Apache-2.0" ]
permissive
alexdcarl/incode-platform
27dd7f9e427a847f49d6db4eb80d1b7de1777e40
b0e9bc8dc0aa7c3d277bb320a90198a72937fd31
refs/heads/master
2020-05-04T05:09:15.428035
2019-03-05T18:27:43
2019-03-05T18:27:43
178,980,570
2
0
null
2019-04-02T02:09:27
2019-04-02T02:09:26
null
UTF-8
Java
false
false
426
java
package org.incode.module.base.dom.types; public class ReferenceType { private ReferenceType() {} public static class Meta { public final static int MAX_LEN = 24; public static final String REGEX = "[ -/_A-Z0-9]+"; public static final String REGEX_DESCRIPTION = "Only capital letters, numbers and 3 symbols being: \"_\" , \"-\" and \"/\" are allowed"; private Meta() {} } }
[ "dan@haywood-associates.co.uk" ]
dan@haywood-associates.co.uk
139061f660c3be7f9b9635b57555b7fd66fb0904
9ce31055cc5467c2655f60030103beb502db125b
/Rest_Soap/rest/content-handlers/src/main/java/com/ch/boot/CHApplication.java
cfef55d7df04c35db77a852bf0d318a455dc5c55
[]
no_license
manishfullDev/All-Project
969cfadbb608a76054c675fd854fb2c05f5f8ee2
888f852aea6f4271d8a2737bf6ab1eec7525bad2
refs/heads/master
2023-08-03T10:55:45.437393
2020-04-07T06:44:08
2020-04-07T06:44:08
253,693,976
1
0
null
2023-07-23T11:10:07
2020-04-07T05:17:53
Java
UTF-8
Java
false
false
173
java
package com.ch.boot; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; @ApplicationPath("/api") public class CHApplication extends Application { }
[ "manish.vishwakarma@s-force.org" ]
manish.vishwakarma@s-force.org
1469b5bf4a59e68ad530222c4a4148a5c732dd10
3ffa4e9c9063e40ca21e8b1b563f11015efc4e7e
/jhipster-conference/blog/src/main/java/com/alvieira/blog/domain/Blog.java
28209907794a2214a5fb15541ea5f434eff5dd1c
[ "Apache-2.0" ]
permissive
alvieira/jhipster-course
b0872b1bfbc8bb55acb656df0b34d51ae8b20a31
f5f701b2d5708d4c378b193cc581bc30bf9165db
refs/heads/master
2022-12-24T19:30:28.120790
2020-09-25T01:48:49
2020-09-25T01:48:49
295,572,966
0
0
Apache-2.0
2020-09-15T00:39:11
2020-09-15T00:39:11
null
UTF-8
Java
false
false
2,659
java
package com.alvieira.blog.domain; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Field; import javax.validation.constraints.*; import java.io.Serializable; /** * A Blog. */ @Document(collection = "blog") public class Blog implements Serializable { private static final long serialVersionUID = 1L; @Id private String id; @NotNull @Field("title") private String title; @NotNull @Field("author") private String author; @Field("post") private byte[] post; @Field("post_content_type") private String postContentType; // jhipster-needle-entity-add-field - JHipster will add fields here public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTitle() { return title; } public Blog title(String title) { this.title = title; return this; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public Blog author(String author) { this.author = author; return this; } public void setAuthor(String author) { this.author = author; } public byte[] getPost() { return post; } public Blog post(byte[] post) { this.post = post; return this; } public void setPost(byte[] post) { this.post = post; } public String getPostContentType() { return postContentType; } public Blog postContentType(String postContentType) { this.postContentType = postContentType; return this; } public void setPostContentType(String postContentType) { this.postContentType = postContentType; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof Blog)) { return false; } return id != null && id.equals(((Blog) o).id); } @Override public int hashCode() { return 31; } // prettier-ignore @Override public String toString() { return "Blog{" + "id=" + getId() + ", title='" + getTitle() + "'" + ", author='" + getAuthor() + "'" + ", post='" + getPost() + "'" + ", postContentType='" + getPostContentType() + "'" + "}"; } }
[ "aloisio.vieira@gmail.com" ]
aloisio.vieira@gmail.com
ab3479dbd537dd5f002e70cda6674051aa87a1cc
26da0aea2ab0a2266bbee962d94a96d98a770e5f
/aries/templates/template1/template1-war/src/main/java/template1_package/util/Helper.java
baf47eb843bdc35dc2740b6b5a2f79251ef6716b
[ "Apache-2.0" ]
permissive
tfisher1226/ARIES
1de2bc076cf83488703cf18f7e3f6e3c5ef1b40b
814e3a4b4b48396bcd6d082e78f6519679ccaa01
refs/heads/master
2021-01-10T02:28:07.807313
2015-12-10T20:30:00
2015-12-10T20:30:00
44,076,313
2
0
null
null
null
null
UTF-8
Java
false
false
2,773
java
package template1_package.util; import java.io.Serializable; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.AutoCreate; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import template1.model.Organization; import template1.model.util.OrganizationUtil; @AutoCreate @Name("helper") @Scope(ScopeType.SESSION) @SuppressWarnings("serial") public class Helper implements Serializable { public static String toTimeString(Date dateTime) { DateFormat dateFormat = DateFormat.getDateTimeInstance(); return dateTime != null ? dateFormat.format(dateTime) : ""; } // public String toTimeString(DateTime dateTime) { // return dateTime != null ? dateTime.toString("yyyy-MM-dd [HH:mm:ss]") : ""; // } public static String toSimpleDate(Date dateTime) { DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); return dateTime != null ? formatter.format(dateTime) : ""; } public static String toDateString(Date dateTime) { SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy"); return dateTime != null ? formatter.format(dateTime) : ""; } // public static String toDateString(DateTime dateTime) { // return dateTime != null ? dateTime.toString("yyyy-MM-dd") : ""; // } public static String toActiveString(Boolean active) { return active ? "Active" : "Inactive"; } public static Boolean toActiveInactiveBoolean(String active) { return active.equals("Inactive") ? Boolean.FALSE : Boolean.TRUE; } public static String toOrganizationName(Organization organization) { if (organization != null) return OrganizationUtil.getLabel(organization); return null; } // public String getActivityGroupsText() { // String text = ""; // if (member != null) { // List<ActivityGroup> activityGroups = member.getActivityGroups(); // if (activityGroups != null) { // Iterator<ActivityGroup> iterator = activityGroups.iterator(); // while (iterator.hasNext()) { // ActivityGroup activityGroup = iterator.next(); // text += activityGroup.getLabel(); // text += "\n"; // } // } // } // return text; // } // // public String getLeadershipRolesText() { // String text = ""; // if (member != null) { // LeadershipInfo leadershipInfo = member.getLeadershipInfo(); // if (leadershipInfo != null) { // List<LeadershipRole> leadershipRoles = leadershipInfo.getLeadershipRoles(); // Iterator<LeadershipRole> iterator = leadershipRoles.iterator(); // while (iterator.hasNext()) { // LeadershipRole leadershipRole = iterator.next(); // text += LeadershipRoleUtil.toString(leadershipRole); // text += "\n"; // } // } // } // return text; // } }
[ "tfisher@kattare.com" ]
tfisher@kattare.com
7efdda9cbd1796b489914351a3fa81ce12dcdb10
157766b704093ec0e526b4bc998c9ca903f21794
/1.JavaSyntax/src/com/javarush/task/task01/task0131/Solution.java
d6d254c2cb43e6ac4afcbf313931d51654fd08ba
[]
no_license
zenonwch/JavaRushEducation_2.0
58d6990e4bf2fe22aa60b7e4d1da35ec1c16bfab
10950e74f53c268cfbbdbf72e26e1b32ecd78db8
refs/heads/master
2020-05-26T14:33:32.197795
2017-05-14T10:43:38
2017-05-14T10:43:38
82,482,269
3
1
null
null
null
null
UTF-8
Java
false
false
344
java
package com.javarush.task.task01.task0131; /* Полнометражная картина */ public class Solution { public static void main(final String[] args) { System.out.println(getMetreFromCentimetre(243)); } public static int getMetreFromCentimetre(final int centimetre) { return centimetre / 100; } }
[ "andrey.veshtard@ctco.lv" ]
andrey.veshtard@ctco.lv
2981fce1dac2b6b153c6d3282a13d13c32e6b26b
d3de6f58687038ad7854f2472dd8a71c7d16933d
/service/src/main/java/io/mifos/customer/service/internal/repository/CommandEntity.java
567c2e89fa0ebe56027f8aec7ab303144c0bb78b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
84086978/customer
9380bfa4c908a23c5c04dd8d6d91b129ef461de6
3ce1c5386dd99d186a79db1d19d6778c2cae5b2d
HEAD
2019-07-11T22:11:47.761269
2017-05-19T15:51:18
2017-05-19T15:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,660
java
/* * Copyright 2017 The Mifos Initiative * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.mifos.customer.service.internal.repository; import io.mifos.core.mariadb.util.LocalDateTimeConverter; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; import java.time.LocalDateTime; @Entity @Table(name = "maat_commands") public class CommandEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, optional = false) @JoinColumn(name = "customer_id") private CustomerEntity customer; @Column(name = "a_type") private String type; @Column(name = "a_comment") private String comment; @Column(name = "created_by") private String createdBy; @Column(name = "created_on") @Convert(converter = LocalDateTimeConverter.class) private LocalDateTime createdOn; public CommandEntity() { super(); } public Long getId() { return this.id; } public void setId(final Long id) { this.id = id; } public CustomerEntity getCustomer() { return this.customer; } public void setCustomer(final CustomerEntity customer) { this.customer = customer; } public String getType() { return this.type; } public void setType(final String type) { this.type = type; } public String getComment() { return this.comment; } public void setComment(final String comment) { this.comment = comment; } public String getCreatedBy() { return this.createdBy; } public void setCreatedBy(final String createdBy) { this.createdBy = createdBy; } public LocalDateTime getCreatedOn() { return this.createdOn; } public void setCreatedOn(final LocalDateTime createdOn) { this.createdOn = createdOn; } }
[ "mgeiss@mifos.org" ]
mgeiss@mifos.org
91c747af210fe1d54e144f6423bf83f27aaa4045
183e4126b2fdb9c4276a504ff3ace42f4fbcdb16
/V семестр/Паралельне програмування/Редько/labs/mylabs/Lab3/src/RunnableF3.java
a8dd83e5524129cbccc6472feef75b0e39b17bf9
[]
no_license
Computer-engineering-FICT/Computer-engineering-FICT
ab625e2ca421af8bcaff74f0d37ac1f7d363f203
80b64b43d2254e15338060aa4a6d946e8bd43424
refs/heads/master
2023-08-10T08:02:34.873229
2019-06-22T22:06:19
2019-06-22T22:06:19
193,206,403
3
0
null
2023-07-22T09:01:05
2019-06-22T07:41:22
HTML
UTF-8
Java
false
false
1,230
java
import java.io.File; import java.util.Arrays; /** * * Task F3 * */ public class RunnableF3 extends Data implements Runnable { public RunnableF3(int n, int value) { super(n, value); } @Override public void run() { System.out.println("Task F3 started"); Vector va, vb, ve; Matrix ma, mb, mm; va = inputVector(); vb = inputVector(); ma = inputMatrix(); mb = inputMatrix(); mm = inputMatrix(); ve = f3(va, vb, ma, mb, mm); outputVector(ve, new File("f3.txt")); System.out.println("Task F3 ended"); } /** * F3: E = (MA * MM) * B + MB * SORT(A) * @param va * @param vb * @param ma * @param mb * @param mm * @return Vector E */ private Vector f3(final Vector va, final Vector vb, final Matrix ma, final Matrix mb, final Matrix mm) { return add(mult(vb, mult(ma, mm)), mult(sort(va), mb)); } private Vector sort(final Vector va) { int[] res = new int[va.size()]; for(int i = 0; i < res.length; i++) { res[i] = va.get(i); } Arrays.sort(res); Vector sortedVector = new Vector(res.length); for(int j = 0; j < sortedVector.size(); j++) { sortedVector.set(j, res[j]); } return sortedVector; } }
[ "mazanyan027@gmail.com" ]
mazanyan027@gmail.com
ddcb58b75b8d194e420f4f02afe99d6c336fee5d
c694f5f088a508b15f76ca8d16dec7b59d30ee6f
/src/main/java/com/nwkyom/youcode/web/rest/errors/EmailAlreadyUsedException.java
a9ac2ed9d11a6130b7daf3fdd2bd407ea72039bc
[]
no_license
nwkyom/you-code
c5e66d1a5086d3c37d2aee8dae69f61194b32103
d27cdc4794dd2e64cf45bb10a0409bb2d3b68a47
refs/heads/main
2023-01-28T20:12:42.914860
2020-12-01T06:26:14
2020-12-01T06:26:14
317,445,674
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.nwkyom.youcode.web.rest.errors; public class EmailAlreadyUsedException extends BadRequestAlertException { private static final long serialVersionUID = 1L; public EmailAlreadyUsedException() { super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
1c3794cc9280e63b10283beff8ec03d3b28e8a24
f9abeb8599279abc91ab473ea9fb9ed8c5d5ff4e
/src/com/tankers/smile/services/apis/users/Users.java
828bcf1d1a6577062bcaa0dbfb6801a9b4264e06
[]
no_license
jaydi/Flag-android
a73d6cd230fb4b4711e7de98e3240ec1ab2c860f
2b083b22ede82c9427b975eb5c5f0cfb0858587f
refs/heads/master
2016-09-05T18:11:03.767553
2015-07-21T19:51:54
2015-07-21T19:51:54
39,466,042
0
0
null
null
null
null
UTF-8
Java
false
false
1,103
java
package com.tankers.smile.services.apis.users; import java.io.IOException; import com.tankers.smile.models.RetainForm; import com.tankers.smile.models.UserForm; import com.tankers.smile.services.apis.FlagClient; public class Users { private FlagClient client; public Users(FlagClient client) { super(); this.client = client; } public Guest guest() throws IOException { Guest guest = new Guest(client); client.initialize(guest); return guest; } public Insert insert(UserForm userForm) throws IOException { Insert insert = new Insert(client, userForm); client.initialize(insert); return insert; } public Get get(UserForm userForm) throws IOException { Get get = new Get(client, userForm); client.initialize(get); return get; } public Retain retain(RetainForm retainForm) throws IOException { Retain retain = new Retain(client, retainForm); client.initialize(retain); return retain; } public Delete delete(long userId) throws IOException { Delete delete = new Delete(client); delete.setUserId(userId); client.initialize(delete); return delete; } }
[ "jaydi727@gmail.com" ]
jaydi727@gmail.com
75212d9a439fada673a788a20d9495d724bb6fb0
80c45f185a2acbb11c698d9422884c1cdecf5429
/app/src/main/java/com/example/jinhui/androiddemo/day6/frameanim/FrameAnimationActivity.java
27e573d452258a41002455c3e65f2e7cd68215f5
[]
no_license
yyclang/AndroidDemo
ecf5798f7b6f7a89d99a9b443e0a5d845b360358
d3b271be4fdf1401668da73747590521c9a10fba
refs/heads/master
2020-05-27T19:13:21.857314
2018-12-08T04:58:12
2018-12-08T04:58:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,932
java
package com.example.jinhui.androiddemo.day6.frameanim; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.ImageView; import com.example.jinhui.androiddemo.R; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; /** * Created by jinhui on 2018/1/29. * Email:1004260403@qq.com */ public class FrameAnimationActivity extends AppCompatActivity implements View.OnClickListener { Button bt_play; @BindView(R.id.bt_java) Button btJava; @BindView(R.id.bt_play) Button btPlay; @BindView(R.id.imageView) ImageView imageView; AnimationDrawable aniDrawable; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_frameanim); ButterKnife.bind(this); //设置帧动画,解析帧动画文件,生成AnimationDrawable对象 imageView = findViewById(R.id.imageView); bt_play = findViewById(R.id.bt_play); bt_play.setOnClickListener(this); imageView.setImageResource(R.drawable.ani_dragon_down); //创建动画对象, 这里需要注意一点,关于为什么不能像上面控制动画的播放与暂停?原因在于每次都new AnimationDrawable(),将此方法写在前面只生成一次对象就好! aniDrawable = new AnimationDrawable(); } // 参数 v 指向用户点击的控件对象 @Override public void onClick(View v) { //获取帧动画对象 AnimationDrawable aniFrame = (AnimationDrawable) imageView.getDrawable(); Button btn = (Button) v;//父类型指向子类型,强转类型 //设置帧动画属性 //播放一次 //aniFrame.setOneShot(true); //如果正在播放,停止 if (aniFrame.isRunning()) { aniFrame.stop(); btn.setText("播放"); } else { aniFrame.start(); btn.setText("停止"); } } /** * //创建动画对象 * AnimationDrawable aniDrawable = new AnimationDrawable(); * //设置每一帧的帧图片,每一帧播放时间 * aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.inc_btn_emphasize_normal), 100); * aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.inc_btn_emphasize_pressed), 100); * aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.inc_btn_normal), 100); * aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.inc_btn_pressed), 100); * <p> * imageView.setImageDrawable(aniDrawable); * <p> * */ @OnClick(R.id.bt_java) public void onViewClicked() { } @OnClick({R.id.bt_java}) public void onViewClicked(View view) { switch (view.getId()) { case R.id.bt_java: //设置每一帧的帧图片,每一帧播放时间 aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.dest_0_0), 100); aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.dest_0_1), 100); aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.dest_0_2), 100); aniDrawable.addFrame(this.getResources().getDrawable(R.drawable.dest_0_3), 100); imageView.setImageDrawable(aniDrawable); aniDrawable.setOneShot(false); if (aniDrawable.isRunning()){ aniDrawable.stop(); btJava.setText("java代码构建-播放"); }else { aniDrawable.start(); btJava.setText("停止"); } break; } } }
[ "1004260403@qq.com" ]
1004260403@qq.com
31aedd1c916f5842afc741a5ef927533f94a70ad
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/23/23_ec36e2314faf0779c6ecfbcecb28b7e8f32562c6/LZ4BlockStreamingTest/23_ec36e2314faf0779c6ecfbcecb28b7e8f32562c6_LZ4BlockStreamingTest_s.java
962e16bd841643d7f84187c110f9eeca4800972c
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,940
java
package net.jpountz.lz4; /* * 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. */ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FilterInputStream; import java.io.FilterOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.util.zip.Adler32; import java.util.zip.CRC32; import java.util.zip.Checksum; import net.jpountz.xxhash.XXHashFactory; import org.junit.Test; import org.junit.runner.RunWith; import com.carrotsearch.randomizedtesting.RandomizedRunner; import com.carrotsearch.randomizedtesting.annotations.Repeat; @RunWith(RandomizedRunner.class) public class LZ4BlockStreamingTest extends AbstractLZ4Test { // An input stream that might read less data than it is able to class MockInputStream extends FilterInputStream { MockInputStream(InputStream in) { super(in); } @Override public int read(byte[] b, int off, int len) throws IOException { return super.read(b, off, randomIntBetween(0, len)); } @Override public long skip(long n) throws IOException { return super.skip(randomInt((int) Math.min(n, Integer.MAX_VALUE))); } } // an output stream that delays the actual writes class MockOutputStream extends FilterOutputStream { private final byte[] buffer; private int delayedBytes; MockOutputStream(OutputStream out) { super(out); buffer = new byte[randomIntBetween(10, 1000)]; delayedBytes = 0; } private void flushIfNecessary() throws IOException { if (delayedBytes == buffer.length) { flushPendingData(); } } private void flushPendingData() throws IOException { out.write(buffer, 0, delayedBytes); delayedBytes = 0; } @Override public void write(int b) throws IOException { if (rarely()) { flushPendingData(); } else { flushIfNecessary(); } buffer[delayedBytes++] = (byte) b; } @Override public void write(byte[] b, int off, int len) throws IOException { if (rarely()) { flushPendingData(); } if (len + delayedBytes > buffer.length) { flushPendingData(); delayedBytes = randomInt(Math.min(len, buffer.length)); out.write(b, off, len - delayedBytes); System.arraycopy(b, off + len - delayedBytes, buffer, 0, delayedBytes); } else { System.arraycopy(b, off, buffer, delayedBytes, len); delayedBytes += len; } } @Override public void write(byte[] b) throws IOException { write(b, 0, b.length); } @Override public void flush() throws IOException { // no-op } @Override public void close() throws IOException { flushPendingData(); out.close(); } } private InputStream open(byte[] data) { return new MockInputStream(new ByteArrayInputStream(data)); } private OutputStream wrap(OutputStream other) { return new MockOutputStream(other); } @Test @Repeat(iterations=5) public void testRoundtripGeo() throws IOException { testRoundTrip("/calgary/geo"); } @Test @Repeat(iterations=5) public void testRoundtripBook1() throws IOException { testRoundTrip("/calgary/book1"); } @Test @Repeat(iterations=5) public void testRoundtripPic() throws IOException { testRoundTrip("/calgary/pic"); } public void testRoundTrip(String resource) throws IOException { testRoundTrip(readResource(resource)); } public void testRoundTrip(byte[] data) throws IOException { final ByteArrayOutputStream compressed = new ByteArrayOutputStream(); final int blockSize; switch (randomInt(2)) { case 0: blockSize = LZ4BlockOutputStream.MIN_BLOCK_SIZE; break; case 1: blockSize = LZ4BlockOutputStream.MAX_BLOCK_SIZE; break; default: blockSize = randomIntBetween(LZ4BlockOutputStream.MIN_BLOCK_SIZE, LZ4BlockOutputStream.MAX_BLOCK_SIZE); break; } final LZ4Compressor compressor = randomBoolean() ? LZ4Factory.fastestInstance().fastCompressor() : LZ4Factory.fastestInstance().highCompressor(); final Checksum checksum; switch (randomInt(2)) { case 0: checksum = new Adler32(); break; case 1: checksum = new CRC32(); break; default: checksum = XXHashFactory.fastestInstance().newStreamingHash32(randomInt()).asChecksum(); break; } final boolean syncFlush = randomBoolean(); final LZ4BlockOutputStream os = new LZ4BlockOutputStream(wrap(compressed), blockSize, compressor, checksum, syncFlush); final int half = data.length / 2; switch (randomInt(2)) { case 0: os.write(data, 0, half); for (int i = half; i < data.length; ++i) { os.write(data[i]); } break; case 1: for (int i = 0; i < half; ++i) { os.write(data[i]); } os.write(data, half, data.length - half); break; case 2: os.write(data, 0, data.length); break; } os.close(); final LZ4Decompressor decompressor = LZ4Factory.fastestInstance().decompressor(); InputStream is = new LZ4BlockInputStream(open(compressed.toByteArray()), decompressor, checksum); assertFalse(is.markSupported()); try { is.mark(1); is.reset(); assertFalse(true); } catch (IOException e) { // OK } byte[] restored = new byte[data.length + 1000]; int read = 0; while (true) { if (randomFloat() < 0.01f) { final int r = is.read(restored, read, restored.length - read); if (r == -1) { break; } else { read += r; } } else { final int b = is.read(); if (b == -1) { break; } else { restored[read++] = (byte) b; } } } is.close(); assertEquals(data.length, read); assertArrayEquals(data, Arrays.copyOf(restored, read)); // test skip final int offset = data.length <= 1 ? 0 : randomInt(data.length - 1); final int length = randomInt(data.length - offset); is = new LZ4BlockInputStream(open(compressed.toByteArray()), decompressor, checksum); restored = new byte[length + 1000]; read = 0; while (read < offset) { final long skipped = is.skip(offset - read); assertTrue(skipped >= 0); read += skipped; } read = 0; while (read < length) { final int r = is.read(restored, read, length - read); assertTrue(r >= 0); read += r; } is.close(); assertArrayEquals(Arrays.copyOfRange(data, offset, offset + length), Arrays.copyOfRange(restored, 0, length)); } @Test @Repeat(iterations=20) public void testRoundtripRandom() throws IOException { final int size = randomFloat() < 0.1f ? randomInt(5) : randomInt(1 << 20); final byte[] data = randomArray(size, randomBoolean() ? randomIntBetween(1, 5) : randomIntBetween(6, 100)); testRoundTrip(data); } @Test public void testRoundtripEmpty() throws IOException { testRoundTrip(new byte[0]); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
246d2198d83bbfb197da96b89cf1eba477553de8
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/platform/core-api/src/com/intellij/model/psi/UrlReferenceHost.java
402293fba39f135c1b5693d77cf8b8b6a70ee7ef
[ "Apache-2.0" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Java
false
false
443
java
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.model.psi; /** * Implement this interface in PsiElement to inject {@link com.intellij.openapi.paths.UrlReference URL reference} * into the element if its text contains a URL or a predefined URL pattern. */ public interface UrlReferenceHost extends PsiExternalReferenceHost { }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
a386e91926f0fc8ded74fa7cff8dc6db5cf8010a
d7cb1aa81d87c8ae98599be7e60591acc02e7432
/src/main/java/ltd/scau/entity/Grade.java
bc9552ad2ffe8c2a87876a58bcbb25878b243472
[]
no_license
TeslaCN/Hollow
c110f35700461c6b9e66e86e486884db90bf448a
31a83347d777ee0f9cf0f1e4af8ac08ff5360590
refs/heads/master
2021-03-30T18:27:41.390955
2017-10-13T08:03:58
2017-10-13T08:03:58
100,712,481
0
0
null
null
null
null
UTF-8
Java
false
false
6,519
java
package ltd.scau.entity; import javax.persistence.*; @Entity @Table(name = "grades") public class Grade { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(name = "stu_id", nullable = false) private String stuId; private String year = ""; private String semester = ""; @Column(nullable = false) private String code = ""; @Column(nullable = false) private String title = ""; private String property = ""; private String attribution = ""; private Double credit = 0.0; @Column(name = "GPA") private Double gpa = 0.0; private Double usual = 0.0; @Column(name = "mid_term") private Double midTerm = 0.0; @Column(name = "final_exam") private Double finalExam = 0.0; private Double experiment = 0.0; private Double total = 0.0; private String minor = ""; private Double resit = 0.0; private Double retake = 0.0; private String college = ""; private String remarks = ""; @Column(name = "mark_retake") private String markRetake = ""; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getStuId() { return stuId; } public void setStuId(String stuId) { this.stuId = stuId; } public String getYear() { return year; } public void setYear(String year) { this.year = year; } public String getSemester() { return semester; } public void setSemester(String semester) { this.semester = semester; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getProperty() { return property; } public void setProperty(String property) { this.property = property; } public String getAttribution() { return attribution; } public void setAttribution(String attribution) { this.attribution = attribution; } public Double getCredit() { return credit; } public void setCredit(Double credit) { this.credit = credit; } public Double getGpa() { return gpa; } public void setGpa(Double gpa) { this.gpa = gpa; } public Double getUsual() { return usual; } public void setUsual(Double usual) { this.usual = usual; } public Double getMidTerm() { return midTerm; } public void setMidTerm(Double midTerm) { this.midTerm = midTerm; } public Double getFinalExam() { return finalExam; } public void setFinalExam(Double finalExam) { this.finalExam = finalExam; } public Double getExperiment() { return experiment; } public void setExperiment(Double experiment) { this.experiment = experiment; } public Double getTotal() { return total; } public void setTotal(Double total) { this.total = total; } public String getMinor() { return minor; } public void setMinor(String minor) { this.minor = minor; } public Double getResit() { return resit; } public void setResit(Double resit) { this.resit = resit; } public Double getRetake() { return retake; } public void setRetake(Double retake) { this.retake = retake; } public String getCollege() { return college; } public void setCollege(String college) { this.college = college; } public String getRemarks() { return remarks; } public void setRemarks(String remarks) { this.remarks = remarks; } public String getMarkRetake() { return markRetake; } public void setMarkRetake(String markRetake) { this.markRetake = markRetake; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Grade grade = (Grade) o; if (!stuId.equals(grade.stuId)) return false; if (!year.equals(grade.year)) return false; if (!semester.equals(grade.semester)) return false; if (!code.equals(grade.code)) return false; if (!title.equals(grade.title)) return false; if (property != null ? !property.equals(grade.property) : grade.property != null) return false; return attribution != null ? attribution.equals(grade.attribution) : grade.attribution == null; } public boolean detailEquals(Object o) { if (!equals(o)) return false; Grade grade = (Grade) o; if (!retake.equals(grade.retake)) return false; if (!gpa.equals(grade.gpa)) return false; if (!total.equals(grade.total)) return false; if (!finalExam.equals(grade.finalExam)) return false; if (!usual.equals(grade.usual)) return false; if (!markRetake.equals(grade.markRetake)) return false; if (!midTerm.equals(grade.midTerm)) return false; if (!credit.equals(grade.credit)) return false; if (!experiment.equals(grade.experiment)) return false; if (!resit.equals(grade.resit)) return false; return true; } @Override public int hashCode() { int result = stuId.hashCode(); result = 31 * result + year.hashCode(); result = 31 * result + semester.hashCode(); result = 31 * result + code.hashCode(); result = 31 * result + title.hashCode(); result = 31 * result + (property != null ? property.hashCode() : 0); result = 31 * result + (attribution != null ? attribution.hashCode() : 0); return result; } @Override public String toString() { return "Grade{" + "id=" + id + ", stuId='" + stuId + '\'' + ", year='" + year + '\'' + ", semester='" + semester + '\'' + ", title='" + title + '\'' + ", credit=" + credit + ", gpa=" + gpa + ", usual=" + usual + ", finalExam=" + finalExam + ", total=" + total + ", retake=" + retake + '}'; } }
[ "root496879118@me.com" ]
root496879118@me.com
20642235bf4b6906ac3a707dfb31e8e7547b8fc7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_00ce0ae88c12e51abc7d07a32d1df21cc8a66d66/ArchetypeCatalogsWriter/3_00ce0ae88c12e51abc7d07a32d1df21cc8a66d66_ArchetypeCatalogsWriter_s.java
55236022aa90897603680fb61ae9d7ae24255da7
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,482
java
/******************************************************************************* * Copyright (c) 2008 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.maven.ide.eclipse.archetype; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamResult; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.XMLFilterImpl; import org.maven.ide.eclipse.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; import org.maven.ide.eclipse.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; import org.maven.ide.eclipse.core.MavenLogger; /** * Archetype catalogs writer * * @author Eugene Kuleshov */ public class ArchetypeCatalogsWriter { private static final String ELEMENT_CATALOGS = "archetypeCatalogs"; private static final String ELEMENT_CATALOG = "catalog"; private static final String ATT_CATALOG_TYPE = "type"; private static final String ATT_CATALOG_LOCATION = "location"; public static final String ATT_CATALOG_DESCRIPTION = "description"; private static final String TYPE_LOCAL = "local"; private static final String TYPE_REMOTE = "remote"; public Collection<ArchetypeCatalogFactory> readArchetypeCatalogs(InputStream is) throws IOException { Collection<ArchetypeCatalogFactory> catalogs = new ArrayList<ArchetypeCatalogFactory>(); try { SAXParserFactory parserFactory = SAXParserFactory.newInstance(); SAXParser parser = parserFactory.newSAXParser(); parser.parse(is, new ArchetypeCatalogsContentHandler(catalogs)); } catch(SAXException ex) { String msg = "Unable to parse Archetype catalogs list"; MavenLogger.log(msg, ex); throw new IOException(msg + "; " + ex.getMessage()); } catch(ParserConfigurationException ex) { String msg = "Unable to parse Archetype catalogs list"; MavenLogger.log(msg, ex); throw new IOException(msg + "; " + ex.getMessage()); } return catalogs; } public void writeArchetypeCatalogs(final Collection<ArchetypeCatalogFactory> catalogs, OutputStream os) throws IOException { try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform(new SAXSource(new XMLArchetypeCatalogsWriter(catalogs), new InputSource()), new StreamResult(os)); } catch(TransformerFactoryConfigurationError ex) { throw new IOException("Unable to write Archetype catalogs; " + ex.getMessage()); } catch(TransformerException ex) { throw new IOException("Unable to write Archetype catalogs; " + ex.getMessage()); } } static class XMLArchetypeCatalogsWriter extends XMLFilterImpl { private final Collection<ArchetypeCatalogFactory> catalogs; public XMLArchetypeCatalogsWriter(Collection<ArchetypeCatalogFactory> catalogs) { this.catalogs = catalogs; } public void parse(InputSource input) throws SAXException { ContentHandler handler = getContentHandler(); handler.startDocument(); handler.startElement(null, ELEMENT_CATALOGS, ELEMENT_CATALOGS, new AttributesImpl()); for(ArchetypeCatalogFactory factory : this.catalogs) { if(factory.isEditable()) { if(factory instanceof LocalCatalogFactory) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_LOCAL); attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs); handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG); } else if(factory instanceof RemoteCatalogFactory) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_REMOTE); attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs); handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG); } } } handler.endElement(null, ELEMENT_CATALOGS, ELEMENT_CATALOGS); handler.endDocument(); } } static class ArchetypeCatalogsContentHandler extends DefaultHandler { private Collection<ArchetypeCatalogFactory> catalogs; public ArchetypeCatalogsContentHandler(Collection<ArchetypeCatalogFactory> catalogs) { this.catalogs = catalogs; } public void startElement(String uri, String localName, String qName, Attributes attributes) { if(ELEMENT_CATALOG.equals(qName) && attributes != null) { String type = attributes.getValue(ATT_CATALOG_TYPE); if(TYPE_LOCAL.equals(type)) { String path = attributes.getValue(ATT_CATALOG_LOCATION); if(path!=null) { String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); catalogs.add(new LocalCatalogFactory(path, description, true)); } } else if(TYPE_REMOTE.equals(type)) { String url = attributes.getValue(ATT_CATALOG_LOCATION); if(url!=null) { String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); catalogs.add(new RemoteCatalogFactory(url, description, true)); } } } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
cf07b23f19911248f2992ded321522f30d8e15b6
92fd88c5f3fd36a483f793023f0c885678b5d6a4
/PI/src/http/websocket/exceptions/InvalidDataException.java
d278678352aa2b04e69fe9bd97ea8bc4e4a3d0c3
[]
no_license
mziernik/light-driver
1e75c224cd474bc19d4e7ad2d6e2a55f95b23299
aba777319fa92ab1f6bf2ef1625f411acb6fc3ad
refs/heads/master
2021-01-20T17:29:04.677485
2017-12-12T14:08:09
2017-12-12T14:08:09
90,877,460
0
0
null
null
null
null
UTF-8
Java
false
false
765
java
package http.websocket.exceptions; public class InvalidDataException extends Exception { /** * Serializable */ private static final long serialVersionUID = 3731842424390998726L; private int closecode; public InvalidDataException(int closecode) { this.closecode = closecode; } public InvalidDataException(int closecode, String s) { super(s); this.closecode = closecode; } public InvalidDataException(int closecode, Throwable t) { super(t); this.closecode = closecode; } public InvalidDataException(int closecode, String s, Throwable t) { super(s, t); this.closecode = closecode; } public int getCloseCode() { return closecode; } }
[ "mziernik@gmail.com" ]
mziernik@gmail.com
7bad966864bfb7bff23ef7e9ae761442bb454800
185a0fbb3bba2647542bbc50be1414e03005d4fe
/src/_08_ObjectsAndClasses/exercises/_03_opinion_poll/PersonMain.java
0a45927d5b2fa53b8f7383f1ef05d170248d47ae
[]
no_license
CordonaCodeCraft/softuni-java-fundamentals
a46301e907ef368fd11d1508019bc838f168ae95
d06fd23cb59a5caceb12959ba1b51a5a4984c484
refs/heads/master
2023-03-28T07:35:49.622677
2021-04-01T14:14:22
2021-04-01T14:14:22
353,722,256
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
// Judge ready package _08_ObjectsAndClasses.exercises._03_opinion_poll; import java.util.*; public class PersonMain { public static void main(String[] args) { Scanner s = new Scanner(System.in); // System.out.print("Enter number of inputs: "); int count = Integer.parseInt(s.nextLine()); List<Person> personsList = new ArrayList<>(); List<String> product = new ArrayList<>(); for (int i = 0; i < count; i++) { populatePersonsList(personsList, s.nextLine()); } generateProduct(personsList, product); Collections.sort(product); System.out.println(String.join(System.lineSeparator(),product)); } private static void generateProduct(List<Person> personsList, List<String> product) { for (Person current : personsList) { if (current.getAge() > 30) { product.add(current.personInfo()); } } } private static void populatePersonsList(List<Person> personsList, String nextLine) { String[] personTokens = nextLine.split("\\s+"); String firstName = personTokens[0]; int age = Integer.parseInt(personTokens[1]); personsList.add(new Person(firstName, age)); } }
[ "67237998+VentsislavStoevski@users.noreply.github.com" ]
67237998+VentsislavStoevski@users.noreply.github.com
fc9a2aa4fd2abedac202d9658e8668f95566179a
8e471d934c2c6c85301fd8520ab0a46b220105ce
/src/main/java/com/hq/management/common/log/LogObjectHolder.java
b37d9564659fc8298d21ca888476ad5d8a60610f
[]
no_license
sdisk/management
f3799b95830116502cfb6996ccda9aba12fb1b50
6fb7b48befe6e2f332f6d5926f84c4bdd684012e
refs/heads/master
2020-04-03T10:02:25.628974
2018-11-01T09:09:23
2018-11-01T09:09:23
155,182,322
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.hq.management.common.log; import com.hq.management.util.SpringContextHolder; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import org.springframework.web.context.WebApplicationContext; import java.io.Serializable; /** * 被修改的bean临时存放的地方 * */ @Component @Scope(scopeName = WebApplicationContext.SCOPE_SESSION) public class LogObjectHolder implements Serializable{ private Object object = null; public void set(Object obj) { this.object = obj; } public Object get() { return object; } public static LogObjectHolder me(){ LogObjectHolder bean = SpringContextHolder.getBean(LogObjectHolder.class); return bean; } }
[ "huang50179@163.com" ]
huang50179@163.com
788817a0c0addd328a0a932a8f9376d0a682e36b
670b97df5f736c09e0f680f911225321630bac0f
/src/main/java/com/electronicarmory/armory/service/dto/RegionDTO.java
fde0b1437e8a3b63f82aa2ac66fa2ff559e24478
[]
no_license
WasimAhmad/armory
b00e35cd7ddbc259616b3052affbb50883f1cdf8
1cbfd01b687d6d40808096c5000a41451c94d51d
refs/heads/master
2021-05-10T11:21:04.018670
2018-01-22T05:07:51
2018-01-22T05:07:51
118,408,532
0
0
null
2018-01-22T05:07:52
2018-01-22T05:00:24
Java
UTF-8
Java
false
false
1,217
java
package com.electronicarmory.armory.service.dto; import java.io.Serializable; import java.util.Objects; /** * A DTO for the Region entity. */ public class RegionDTO implements Serializable { private Long id; private String regionName; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getRegionName() { return regionName; } public void setRegionName(String regionName) { this.regionName = regionName; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RegionDTO regionDTO = (RegionDTO) o; if(regionDTO.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), regionDTO.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "RegionDTO{" + "id=" + getId() + ", regionName='" + getRegionName() + "'" + "}"; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
bc28d78c9063a40f817186e40b7591b24316be3a
f8341045cc20812924ba3d9ef09366ff581b035f
/plugins/less/src/main/java/juzu/plugin/less/impl/CompilerLessContext.java
bfe302e8e2d004beb93c4fad6501a0ec14ea6c34
[]
no_license
gvernile/juzu
98b9b2e5d43dccb3f1c47139e280735ae68f5b44
626eed3ee8f948f6e7d21101eb56bc1823ad508c
refs/heads/master
2020-12-25T10:50:10.060739
2012-12-20T09:45:27
2012-12-20T09:45:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,100
java
/* * Copyright (C) 2012 eXo Platform SAS. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package juzu.plugin.less.impl; import juzu.impl.common.FileKey; import juzu.impl.common.Name; import juzu.impl.compiler.ElementHandle; import juzu.impl.compiler.ProcessingContext; import juzu.impl.common.Path; import juzu.plugin.less.impl.lesser.LessContext; import javax.tools.FileObject; import java.io.IOException; /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */ class CompilerLessContext implements LessContext { /** . */ final ProcessingContext processingContext; /** . */ final ElementHandle.Package context; /** . */ final Name pkg; CompilerLessContext( ProcessingContext processingContext, ElementHandle.Package context, Name pkg ) { this.processingContext = processingContext; this.context = context; this.pkg = pkg; } public String load(String ref) { try { FileKey key = pkg.resolve(ref); FileObject c = processingContext.resolveResource(context, key); if (c != null) { try { return c.getCharContent(true).toString(); } catch (IOException e) { processingContext.log("Could not get content of " + key, e); } } } catch (IllegalArgumentException e) { // Log ? } // return null; } }
[ "julien@julienviet.com" ]
julien@julienviet.com
2ef795fcf1bcc990543b1405b9821bfb2c6fb9b9
c6c1a124eb1ff2fc561213d43d093f84d1ab2c43
/games/common-game-core/src/org/javaplus/clickscreen/script/ScriptExcutor.java
fa5e02d07838f06d4132ba89c0496caf810badd8
[]
no_license
fantasylincen/javaplus
69201dba21af0973dfb224c53b749a3c0440317e
36fc370b03afe952a96776927452b6d430b55efd
refs/heads/master
2016-09-06T01:55:33.244591
2015-08-15T12:15:51
2015-08-15T12:15:51
15,601,930
3
1
null
null
null
null
UTF-8
Java
false
false
531
java
package org.javaplus.clickscreen.script; public interface ScriptExcutor { /** * 执行Java脚本中的指定方法 * @param script 脚本内容 * @param functionName 方法名 * @param args 参数列表 * @return */ Object call(String script, String functionName, Object... args); Integer callInt(String script, String functionName, Object... args); Double callDouble(String script, String functionName, Object... args); String callString(String script, String functionName, Object... args); }
[ "12-2" ]
12-2
cb41a0c828cc15e6c2b8da4e8d5a7b4b5578c573
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/chatting/BasePrivateMsgConvListFragment$$ExternalSyntheticLambda0.java
d159c4ac71060b6bda3680e3544067370fb153ce
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
402
java
package com.tencent.mm.chatting; public final class BasePrivateMsgConvListFragment$$ExternalSyntheticLambda0 implements Runnable { public final void run() {} } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes8.jar * Qualified Name: com.tencent.mm.chatting.BasePrivateMsgConvListFragment..ExternalSyntheticLambda0 * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
891e5b8ab94f0f4f39fb46c7be83f0dd11779b07
d3be5e614b8bf31972b9fcb535b79376b1dedb2c
/src/replit/ArrayList/CombineArrays.java
bbcafde315aac4bf8d9a97dd6ff18cd87c549472
[]
no_license
Gennadiy81/IdeaProjects
6388e29160d3c4cb138c88c75dfaf3098aac0116
498793fd43dc15297f0581f195dfcb44c81c8f40
refs/heads/master
2023-06-24T17:44:34.194982
2021-07-18T14:15:03
2021-07-18T14:15:03
372,008,218
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
package replit.ArrayList; import java.util.ArrayList; public class CombineArrays { public static void main(String[] args) { String[] one = {"f","o","o"}; String[] two = {" b","a","r"}; System.out.println(combineRs(one, two)); } public static ArrayList<String> combineRs (String[] r1,String[] r2){ ArrayList<String> arr = new ArrayList<>(); for (String each : r1){ arr.add(each); } for (String each : r2){ arr.add(each); } return arr; } }
[ "ghena187@gmail.com" ]
ghena187@gmail.com
c8d1e4ed16be8453c53a1e0e9cbe2a5b74919ae0
78991fbbe463c1601a5d91fcd7ea05a5e493d2c9
/panasonic-image-app_1.10.14/source/com/google/android/gms/p036e/C1218eg.java
dcd124352c9dfc6c7436d66caca34f99430d5ccd
[]
no_license
maiermic/panasonic-image-app
480dc4f0500a2e14bd7d4138f6fb9c7dc7871b61
ef9bd7c2a8390204894c53b49d1e01a230141e2d
refs/heads/master
2020-07-10T06:02:42.687761
2019-08-22T12:07:42
2019-08-22T12:07:42
204,177,648
0
0
null
null
null
null
UTF-8
Java
false
false
5,757
java
package com.google.android.gms.p036e; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; import android.os.Build.VERSION; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.List; import java.util.Locale; /* renamed from: com.google.android.gms.e.eg */ final class C1218eg implements C1107aj { /* renamed from: a */ private final String f3418a; /* renamed from: b */ private final Context f3419b; /* renamed from: c */ private final C1221ej f3420c; /* renamed from: d */ private final C1220ei f3421d; C1218eg(Context context, C1220ei eiVar) { this(new C1219eh(), context, eiVar); } private C1218eg(C1221ej ejVar, Context context, C1220ei eiVar) { String str = null; this.f3420c = ejVar; this.f3419b = context.getApplicationContext(); this.f3421d = eiVar; String str2 = "GoogleTagManager"; String str3 = "4.00"; String str4 = VERSION.RELEASE; Locale locale = Locale.getDefault(); if (!(locale == null || locale.getLanguage() == null || locale.getLanguage().length() == 0)) { StringBuilder sb = new StringBuilder(); sb.append(locale.getLanguage().toLowerCase()); if (!(locale.getCountry() == null || locale.getCountry().length() == 0)) { sb.append("-").append(locale.getCountry().toLowerCase()); } str = sb.toString(); } this.f3418a = String.format("%s/%s (Linux; U; Android %s; %s; %s Build/%s)", new Object[]{str2, str3, str4, str, Build.MODEL, Build.ID}); } /* renamed from: a */ private static URL m4894a(C1121ax axVar) { try { return new URL(axVar.mo2885c()); } catch (MalformedURLException e) { C1145bt.m4658a("Error trying to parse the GTM url."); return null; } } /* renamed from: a */ public final void mo2871a(List<C1121ax> list) { IOException iOException; boolean z; boolean z2; boolean z3; InputStream inputStream; Throwable th; int min = Math.min(list.size(), 40); boolean z4 = true; int i = 0; while (i < min) { C1121ax axVar = (C1121ax) list.get(i); URL a = m4894a(axVar); if (a == null) { C1145bt.m4660b("No destination: discarding hit."); this.f3421d.mo2938b(axVar); z2 = z4; } else { try { HttpURLConnection a2 = this.f3420c.mo3006a(a); if (z4) { try { C1150by.m4679a(this.f3419b); z4 = false; } catch (Throwable th2) { Throwable th3 = th2; inputStream = null; z3 = z4; th = th3; if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { z = z3; iOException = e; String str = "Exception sending hit: "; String valueOf = String.valueOf(iOException.getClass().getSimpleName()); C1145bt.m4660b(valueOf.length() != 0 ? str.concat(valueOf) : new String(str)); C1145bt.m4660b(iOException.getMessage()); this.f3421d.mo2939c(axVar); z2 = z; i++; z4 = z2; } } a2.disconnect(); throw th; } } a2.setRequestProperty("User-Agent", this.f3418a); int responseCode = a2.getResponseCode(); InputStream inputStream2 = a2.getInputStream(); if (responseCode != 200) { try { C1145bt.m4660b("Bad response: " + responseCode); this.f3421d.mo2939c(axVar); } catch (Throwable th4) { Throwable th5 = th4; inputStream = inputStream2; z3 = z4; th = th5; } } else { this.f3421d.mo2937a(axVar); } if (inputStream2 != null) { inputStream2.close(); } a2.disconnect(); z2 = z4; } catch (IOException e2) { iOException = e2; z = z4; } } i++; z4 = z2; } } /* renamed from: a */ public final boolean mo2872a() { NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.f3419b.getSystemService("connectivity")).getActiveNetworkInfo(); if (activeNetworkInfo != null && activeNetworkInfo.isConnected()) { return true; } C1145bt.m4664e("...no network connectivity"); return false; } }
[ "maier1michael@gmail.com" ]
maier1michael@gmail.com
98afd40aa55c578be6812dde088a7afd4a8c52c2
924329e96e53bff6e47da520bd7f763e7d62e888
/src/main/java/jb/model/TlvPartnerCondition.java
aa0bfe03cfc08854284bbbe9939c5ae77076e7ba
[]
no_license
huanganrang/mylove
e86a4c9f010d97749d4e9fe1e62b0de4404c80e3
1ababc285989ccf958d0a8a20f2a69a5612654c5
refs/heads/master
2021-01-18T21:52:48.978970
2016-05-18T01:34:42
2016-05-18T01:34:42
38,518,289
0
2
null
null
null
null
UTF-8
Java
false
false
4,646
java
/* * @author John * @date - 2015-07-06 */ package jb.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; @Entity @Table(name = "lv_partner_condition") @DynamicInsert(true) @DynamicUpdate(true) public class TlvPartnerCondition implements java.io.Serializable{ private static final long serialVersionUID = 5454155825314635342L; //alias public static final String TABLE_ALIAS = "LvPartnerCondition"; public static final String ALIAS_ID = "主键"; public static final String ALIAS_OPEN_ID = "用户openId"; public static final String ALIAS_AGE = "年龄"; public static final String ALIAS_ADDRESS = "居住地"; public static final String ALIAS_HEIGHT = "身高"; public static final String ALIAS_WEIGHT = "体重"; public static final String ALIAS_EDUCATION = "学历"; public static final String ALIAS_MONTH_INCOME = "月收入"; //date formats //可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息 //columns START //@Length(max=36) private java.lang.String id; //@NotNull private java.lang.Integer openId; //@Length(max=50) private java.lang.String age; //@Length(max=50) private java.lang.String address; //@Length(max=50) private java.lang.String height; //@Length(max=50) private java.lang.String weight; //@Length(max=50) private java.lang.String education; //@Length(max=50) private java.lang.String monthIncome; //columns END public TlvPartnerCondition(){ } public TlvPartnerCondition(String id) { this.id = id; } public void setId(java.lang.String id) { this.id = id; } @Id @Column(name = "id", unique = true, nullable = false, length = 36) public java.lang.String getId() { return this.id; } @Column(name = "openId", unique = false, nullable = false, insertable = true, updatable = true, length = 10) public java.lang.Integer getOpenId() { return this.openId; } public void setOpenId(java.lang.Integer openId) { this.openId = openId; } @Column(name = "age", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getAge() { return this.age; } public void setAge(java.lang.String age) { this.age = age; } @Column(name = "address", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getAddress() { return this.address; } public void setAddress(java.lang.String address) { this.address = address; } @Column(name = "height", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getHeight() { return this.height; } public void setHeight(java.lang.String height) { this.height = height; } @Column(name = "weight", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getWeight() { return this.weight; } public void setWeight(java.lang.String weight) { this.weight = weight; } @Column(name = "education", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getEducation() { return this.education; } public void setEducation(java.lang.String education) { this.education = education; } @Column(name = "monthIncome", unique = false, nullable = true, insertable = true, updatable = true, length = 50) public java.lang.String getMonthIncome() { return this.monthIncome; } public void setMonthIncome(java.lang.String monthIncome) { this.monthIncome = monthIncome; } /* public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("Id",getId()) .append("OpenId",getOpenId()) .append("Age",getAge()) .append("Address",getAddress()) .append("Height",getHeight()) .append("Weight",getWeight()) .append("Education",getEducation()) .append("MonthIncome",getMonthIncome()) .toString(); } public int hashCode() { return new HashCodeBuilder() .append(getId()) .toHashCode(); } public boolean equals(Object obj) { if(obj instanceof LvPartnerCondition == false) return false; if(this == obj) return true; LvPartnerCondition other = (LvPartnerCondition)obj; return new EqualsBuilder() .append(getId(),other.getId()) .isEquals(); }*/ }
[ "252429711@qq.com" ]
252429711@qq.com
9ee6f85c0675edaa75faf6592f9bea981750b853
56d1c5242e970ca0d257801d4e627e2ea14c8aeb
/src/com/csms/leetcode/number/n900/n960/Leetcode965.java
239d6b015cb3639dfb7d12795a866449cf3a54a0
[]
no_license
dai-zi/leetcode
e002b41f51f1dbd5c960e79624e8ce14ac765802
37747c2272f0fb7184b0e83f052c3943c066abb7
refs/heads/master
2022-12-14T11:20:07.816922
2020-07-24T03:37:51
2020-07-24T03:37:51
282,111,073
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package com.csms.leetcode.number.n900.n960; import com.csms.leetcode.common.TreeNode; import java.util.ArrayList; import java.util.List; //单值二叉树 //简单 public class Leetcode965 { List<Integer> vals; public boolean isUnivalTree(TreeNode root) { vals = new ArrayList(); dfs(root); for (int v: vals) if (v != vals.get(0)) return false; return true; } public void dfs(TreeNode node) { if (node != null) { vals.add(node.val); dfs(node.left); dfs(node.right); } } public static void main(String[] args) { } }
[ "liuxiaotongdaizi@sina.com" ]
liuxiaotongdaizi@sina.com
2be6c1450b64c0d8e9b623fe6c27814336528839
71b1300d51ac6dcde1089287ece9adc61c148aa5
/webfx-kit/webfx-kit-javafxgraphics-peers/src/main/java/dev/webfx/kit/mapper/peers/javafxgraphics/markers/HasPrefWrapLengthProperty.java
f4b305872968981d60f18004b8f09ca2a9fd265a
[ "Apache-2.0" ]
permissive
webfx-project/webfx
0ab7631a69501eced95bc3c65fb9caea76965d8e
a104df9917bb0e4571f726cd28494b099d0f017a
refs/heads/main
2023-08-24T17:55:59.102296
2023-08-13T10:55:08
2023-08-21T13:27:17
44,308,813
249
20
Apache-2.0
2023-08-06T18:05:58
2015-10-15T09:52:32
Java
UTF-8
Java
false
false
432
java
package dev.webfx.kit.mapper.peers.javafxgraphics.markers; import javafx.beans.property.DoubleProperty; /** * @author Bruno Salmon */ public interface HasPrefWrapLengthProperty { DoubleProperty prefWrapLengthProperty(); default void setPrefWrapLength(Number prefWrapLength) { prefWrapLengthProperty().setValue(prefWrapLength); } default Double getPrefWrapLength() { return prefWrapLengthProperty().getValue(); } }
[ "dev.salmonb@gmail.com" ]
dev.salmonb@gmail.com
d382f2e8a96a88a1cc21a20b6c0f5368ef247b82
10378c580b62125a184f74f595d2c37be90a5769
/com/replaymod/lib/de/johni0702/minecraft/gui/utils/lwjgl/glu/Project.java
15c250de5cf489d53be19fe7d116943381daefe9
[]
no_license
ClientPlayground/Melon-Client
4299d7f3e8f2446ae9f225c0d7fcc770d4d48ecb
afc9b11493e15745b78dec1c2b62bb9e01573c3d
refs/heads/beta-v2
2023-04-05T20:17:00.521159
2021-03-14T19:13:31
2021-03-14T19:13:31
347,509,882
33
19
null
2021-03-14T19:13:32
2021-03-14T00:27:40
null
UTF-8
Java
false
false
7,171
java
package com.replaymod.lib.de.johni0702.minecraft.gui.utils.lwjgl.glu; import java.nio.FloatBuffer; import java.nio.IntBuffer; import org.lwjgl.BufferUtils; import org.lwjgl.opengl.GL11; public class Project extends Util { private static final float[] IDENTITY_MATRIX = new float[] { 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F }; private static final FloatBuffer matrix = BufferUtils.createFloatBuffer(16); private static final FloatBuffer finalMatrix = BufferUtils.createFloatBuffer(16); private static final FloatBuffer tempMatrix = BufferUtils.createFloatBuffer(16); private static final float[] in = new float[4]; private static final float[] out = new float[4]; private static final float[] forward = new float[3]; private static final float[] side = new float[3]; private static final float[] up = new float[3]; private static void __gluMakeIdentityf(FloatBuffer m) { int oldPos = m.position(); m.put(IDENTITY_MATRIX); m.position(oldPos); } private static void __gluMultMatrixVecf(FloatBuffer m, float[] in, float[] out) { for (int i = 0; i < 4; i++) out[i] = in[0] * m.get(m.position() + 0 + i) + in[1] * m.get(m.position() + 4 + i) + in[2] * m.get(m.position() + 8 + i) + in[3] * m.get(m.position() + 12 + i); } private static boolean __gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) { FloatBuffer temp = tempMatrix; int i; for (i = 0; i < 16; i++) temp.put(i, src.get(i + src.position())); __gluMakeIdentityf(inverse); for (i = 0; i < 4; i++) { int swap = i; int j; for (j = i + 1; j < 4; j++) { if (Math.abs(temp.get(j * 4 + i)) > Math.abs(temp.get(i * 4 + i))) swap = j; } if (swap != i) for (int m = 0; m < 4; m++) { float f = temp.get(i * 4 + m); temp.put(i * 4 + m, temp.get(swap * 4 + m)); temp.put(swap * 4 + m, f); f = inverse.get(i * 4 + m); inverse.put(i * 4 + m, inverse.get(swap * 4 + m)); inverse.put(swap * 4 + m, f); } if (temp.get(i * 4 + i) == 0.0F) return false; float t = temp.get(i * 4 + i); int k; for (k = 0; k < 4; k++) { temp.put(i * 4 + k, temp.get(i * 4 + k) / t); inverse.put(i * 4 + k, inverse.get(i * 4 + k) / t); } for (j = 0; j < 4; j++) { if (j != i) { t = temp.get(j * 4 + i); for (k = 0; k < 4; k++) { temp.put(j * 4 + k, temp.get(j * 4 + k) - temp.get(i * 4 + k) * t); inverse.put(j * 4 + k, inverse.get(j * 4 + k) - inverse.get(i * 4 + k) * t); } } } } return true; } private static void __gluMultMatricesf(FloatBuffer a, FloatBuffer b, FloatBuffer r) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) r.put(r.position() + i * 4 + j, a.get(a.position() + i * 4 + 0) * b.get(b.position() + 0 + j) + a.get(a.position() + i * 4 + 1) * b.get(b.position() + 4 + j) + a.get(a.position() + i * 4 + 2) * b.get(b.position() + 8 + j) + a.get(a.position() + i * 4 + 3) * b.get(b.position() + 12 + j)); } } public static void gluPerspective(float fovy, float aspect, float zNear, float zFar) { float radians = fovy / 2.0F * 3.1415927F / 180.0F; float deltaZ = zFar - zNear; float sine = (float)Math.sin(radians); if (deltaZ == 0.0F || sine == 0.0F || aspect == 0.0F) return; float cotangent = (float)Math.cos(radians) / sine; __gluMakeIdentityf(matrix); matrix.put(0, cotangent / aspect); matrix.put(5, cotangent); matrix.put(10, -(zFar + zNear) / deltaZ); matrix.put(11, -1.0F); matrix.put(14, -2.0F * zNear * zFar / deltaZ); matrix.put(15, 0.0F); GL11.glMultMatrix(matrix); } public static void gluLookAt(float eyex, float eyey, float eyez, float centerx, float centery, float centerz, float upx, float upy, float upz) { float[] forward = Project.forward; float[] side = Project.side; float[] up = Project.up; forward[0] = centerx - eyex; forward[1] = centery - eyey; forward[2] = centerz - eyez; up[0] = upx; up[1] = upy; up[2] = upz; normalize(forward); cross(forward, up, side); normalize(side); cross(side, forward, up); __gluMakeIdentityf(matrix); matrix.put(0, side[0]); matrix.put(4, side[1]); matrix.put(8, side[2]); matrix.put(1, up[0]); matrix.put(5, up[1]); matrix.put(9, up[2]); matrix.put(2, -forward[0]); matrix.put(6, -forward[1]); matrix.put(10, -forward[2]); GL11.glMultMatrix(matrix); GL11.glTranslatef(-eyex, -eyey, -eyez); } public static boolean gluProject(float objx, float objy, float objz, FloatBuffer modelMatrix, FloatBuffer projMatrix, IntBuffer viewport, FloatBuffer win_pos) { float[] in = Project.in; float[] out = Project.out; in[0] = objx; in[1] = objy; in[2] = objz; in[3] = 1.0F; __gluMultMatrixVecf(modelMatrix, in, out); __gluMultMatrixVecf(projMatrix, out, in); if (in[3] == 0.0D) return false; in[3] = 1.0F / in[3] * 0.5F; in[0] = in[0] * in[3] + 0.5F; in[1] = in[1] * in[3] + 0.5F; in[2] = in[2] * in[3] + 0.5F; win_pos.put(0, in[0] * viewport.get(viewport.position() + 2) + viewport.get(viewport.position() + 0)); win_pos.put(1, in[1] * viewport.get(viewport.position() + 3) + viewport.get(viewport.position() + 1)); win_pos.put(2, in[2]); return true; } public static boolean gluUnProject(float winx, float winy, float winz, FloatBuffer modelMatrix, FloatBuffer projMatrix, IntBuffer viewport, FloatBuffer obj_pos) { float[] in = Project.in; float[] out = Project.out; __gluMultMatricesf(modelMatrix, projMatrix, finalMatrix); if (!__gluInvertMatrixf(finalMatrix, finalMatrix)) return false; in[0] = winx; in[1] = winy; in[2] = winz; in[3] = 1.0F; in[0] = (in[0] - viewport.get(viewport.position() + 0)) / viewport.get(viewport.position() + 2); in[1] = (in[1] - viewport.get(viewport.position() + 1)) / viewport.get(viewport.position() + 3); in[0] = in[0] * 2.0F - 1.0F; in[1] = in[1] * 2.0F - 1.0F; in[2] = in[2] * 2.0F - 1.0F; __gluMultMatrixVecf(finalMatrix, in, out); if (out[3] == 0.0D) return false; out[3] = 1.0F / out[3]; obj_pos.put(obj_pos.position() + 0, out[0] * out[3]); obj_pos.put(obj_pos.position() + 1, out[1] * out[3]); obj_pos.put(obj_pos.position() + 2, out[2] * out[3]); return true; } public static void gluPickMatrix(float x, float y, float deltaX, float deltaY, IntBuffer viewport) { if (deltaX <= 0.0F || deltaY <= 0.0F) return; GL11.glTranslatef((viewport.get(viewport.position() + 2) - 2.0F * (x - viewport.get(viewport.position() + 0))) / deltaX, (viewport.get(viewport.position() + 3) - 2.0F * (y - viewport.get(viewport.position() + 1))) / deltaY, 0.0F); GL11.glScalef(viewport.get(viewport.position() + 2) / deltaX, viewport.get(viewport.position() + 3) / deltaY, 1.0F); } }
[ "Hot-Tutorials@users.noreply.github.com" ]
Hot-Tutorials@users.noreply.github.com
308190dc72830862f9fedd60a6029739aee57236
afdaf9ffd4136f58c3678da406993bce3b952e20
/app/src/main/java/com/skyvn/ten/view/main/recommend/RecommendFragment.java
eebac754158a6b5044e82a7b0d5bddd4c9c6e41f
[]
no_license
wuliang6661/skyvn_ten
167cd7206c6ff6c09c647a703433c2495cc69e9c
05e59064f3cb1add7e4a44109e82aaaf9b27e78e
refs/heads/master
2021-01-02T17:37:30.135433
2020-03-29T10:59:37
2020-03-29T10:59:37
250,260,355
0
1
null
null
null
null
UTF-8
Java
false
false
3,480
java
package com.skyvn.ten.view.main.recommend; import android.graphics.Color; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.blankj.utilcode.util.StringUtils; import com.bumptech.glide.Glide; import com.makeramen.roundedimageview.RoundedImageView; import com.skyvn.ten.R; import com.skyvn.ten.bean.BannerBO; import com.skyvn.ten.mvp.MVPBaseFragment; import com.skyvn.ten.view.WebActivity; import com.zhy.view.flowlayout.FlowLayout; import com.zhy.view.flowlayout.TagAdapter; import com.zhy.view.flowlayout.TagFlowLayout; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.Unbinder; /** * MVPPlugin * 邮箱 784787081@qq.com */ public class RecommendFragment extends MVPBaseFragment<RecommendContract.View, RecommendPresenter> implements RecommendContract.View { @BindView(R.id.id_flowlayout) TagFlowLayout idFlowlayout; Unbinder unbinder; @BindView(R.id.home_banner_img) RoundedImageView homeBannerImg; private BannerBO bannerBO; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fra_recommend, null); unbinder = ButterKnife.bind(this, view); return view; } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); setFlow(); mPresenter.getHomeBanner(); } private void setFlow() { List<String> list = new ArrayList<>(); list.add(getResources().getString(R.string.tuijian_hint1)); list.add(getResources().getString(R.string.tuijian_hint2)); list.add(getResources().getString(R.string.tuijian_hint3)); idFlowlayout.setAdapter(new TagAdapter<String>(list) { @Override public View getView(FlowLayout parent, int position, String s) { TextView tv = (TextView) getLayoutInflater().inflate(R.layout.text_xieyi, idFlowlayout, false); tv.setText(s); if (position == 1) { tv.setTextColor(Color.parseColor("#FF601C")); } else { tv.setTextColor(Color.parseColor("#666666")); } return tv; } }); } @Override public void onDestroyView() { super.onDestroyView(); unbinder.unbind(); } @OnClick(R.id.home_banner_img) public void clickBanner() { if (bannerBO == null || StringUtils.isEmpty(bannerBO.getForwardUrl())) { return; } Bundle bundle = new Bundle(); bundle.putString("url", bannerBO.getForwardUrl()); gotoActivity(WebActivity.class, bundle, false); } @Override public void getBanner(BannerBO bannerBO) { this.bannerBO = bannerBO; Glide.with(getActivity()).load(bannerBO.getImageUrl()).placeholder(R.drawable.home_banner_img1).error(R.drawable.home_banner_img1) .into(homeBannerImg); } @Override public void onRequestError(String msg) { } }
[ "wy19941007" ]
wy19941007
526b15c0a5340aa395f80894f0d54cb962e85683
e4b45ef336874596a98d225169fe15748724f22a
/Offer51数组中逆序对.java
fec9eb0f84b2afb8e1beaf8ef5501a932c456b62
[]
no_license
Jamofl/myLeetCode
1459be44655a54d246dca6a4875fc77a190b1f95
572216f676499b305415bf0acc6afed6bcfaf59d
refs/heads/main
2023-06-29T20:24:53.054332
2021-07-13T07:44:29
2021-07-13T07:44:29
382,751,469
0
1
null
null
null
null
UTF-8
Java
false
false
1,670
java
/** * 剑指 Offer 51. 数组中的逆序对 * 在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数。 * * * * 示例 1: * * 输入: [7,5,6,4] * 输出: 5S */ public class Offer51数组中逆序对 { int[] temp; int count; public int reversePairs(int[] nums) { if(nums.length == 0) return 0; temp = new int[nums.length]; count = 0; mergeSort(nums, 0, nums.length - 1); return count; } private void mergeSort(int[] nums, int start, int end){ if(end == start) return ; // 1.merge sort right and left part int middle = start + (end - start) / 2; mergeSort(nums, start, middle); mergeSort(nums, middle + 1, end); // 2.merge right and left parts together int i = start; int j = middle + 1; int index = start; while (i <= middle && j <= end){ if(nums[i] <= nums[j]){ // 如果指针的元素小于右指针的元素,说明存在 r - (middle + 1) 个逆序对 count += j - (middle + 1); temp[index ++] = nums[i ++]; } else{ temp[index ++] = nums[j ++]; } } while(i <= middle) { count += j - (middle + 1); temp[index++] = nums[i++]; } while(j <= end) temp[index ++] = nums[j ++]; // 3.copy sorted array to nums for(int k = start; k <= end; k ++) nums[k] = temp[k]; } }
[ "568920979@qq.com" ]
568920979@qq.com
4a424f95ee7be5cce4ab5b17e65a41d1b2c5bc8a
bfcce2270be74b70f75c2ad25ebeed67a445220d
/bin/platform/bootstrap/gensrc/de/hybris/platform/core/model/type/MapTypeModel.java
f50d49e1495dad3e1df8495ea08a7a9dbb611098
[ "Unlicense" ]
permissive
hasanakgoz/Hybris
018c1673e8328bd5763d29c5ef72fd35536cd11a
2a9d0ea1e24d6dee5bfc20a8541ede903eedc064
refs/heads/master
2020-03-27T12:46:57.199555
2018-03-26T10:47:21
2018-03-26T10:47:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,381
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at Mar 15, 2018 5:02:29 PM --- * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. * */ package de.hybris.platform.core.model.type; import de.hybris.bootstrap.annotations.Accessor; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.core.model.type.TypeModel; import de.hybris.platform.servicelayer.model.ItemModelContext; /** * Generated model class for type MapType first defined at extension core. */ @SuppressWarnings("all") public class MapTypeModel extends TypeModel { /**<i>Generated model type code constant.</i>*/ public static final String _TYPECODE = "MapType"; /** <i>Generated constant</i> - Attribute key of <code>MapType.argumentType</code> attribute defined at extension <code>core</code>. */ public static final String ARGUMENTTYPE = "argumentType"; /** <i>Generated constant</i> - Attribute key of <code>MapType.returntype</code> attribute defined at extension <code>core</code>. */ public static final String RETURNTYPE = "returntype"; /** * <i>Generated constructor</i> - Default constructor for generic creation. */ public MapTypeModel() { super(); } /** * <i>Generated constructor</i> - Default constructor for creation with existing context * @param ctx the model context to be injected, must not be null */ public MapTypeModel(final ItemModelContext ctx) { super(ctx); } /** * <i>Generated constructor</i> - Constructor with all mandatory attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _argumentType initial attribute declared by type <code>MapType</code> at extension <code>core</code> * @param _code initial attribute declared by type <code>Type</code> at extension <code>core</code> * @param _generate initial attribute declared by type <code>TypeManagerManaged</code> at extension <code>core</code> * @param _returntype initial attribute declared by type <code>MapType</code> at extension <code>core</code> */ @Deprecated public MapTypeModel(final TypeModel _argumentType, final String _code, final Boolean _generate, final TypeModel _returntype) { super(); setArgumentType(_argumentType); setCode(_code); setGenerate(_generate); setReturntype(_returntype); } /** * <i>Generated constructor</i> - for all mandatory and initial attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _argumentType initial attribute declared by type <code>MapType</code> at extension <code>core</code> * @param _code initial attribute declared by type <code>Type</code> at extension <code>core</code> * @param _generate initial attribute declared by type <code>TypeManagerManaged</code> at extension <code>core</code> * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code> * @param _returntype initial attribute declared by type <code>MapType</code> at extension <code>core</code> */ @Deprecated public MapTypeModel(final TypeModel _argumentType, final String _code, final Boolean _generate, final ItemModel _owner, final TypeModel _returntype) { super(); setArgumentType(_argumentType); setCode(_code); setGenerate(_generate); setOwner(_owner); setReturntype(_returntype); } /** * <i>Generated method</i> - Getter of the <code>MapType.argumentType</code> attribute defined at extension <code>core</code>. * @return the argumentType */ @Accessor(qualifier = "argumentType", type = Accessor.Type.GETTER) public TypeModel getArgumentType() { return getPersistenceContext().getPropertyValue(ARGUMENTTYPE); } /** * <i>Generated method</i> - Getter of the <code>MapType.returntype</code> attribute defined at extension <code>core</code>. * @return the returntype */ @Accessor(qualifier = "returntype", type = Accessor.Type.GETTER) public TypeModel getReturntype() { return getPersistenceContext().getPropertyValue(RETURNTYPE); } /** * <i>Generated method</i> - Initial setter of <code>MapType.argumentType</code> attribute defined at extension <code>core</code>. Can only be used at creation of model - before first save. * * @param value the argumentType */ @Accessor(qualifier = "argumentType", type = Accessor.Type.SETTER) public void setArgumentType(final TypeModel value) { getPersistenceContext().setPropertyValue(ARGUMENTTYPE, value); } /** * <i>Generated method</i> - Initial setter of <code>MapType.returntype</code> attribute defined at extension <code>core</code>. Can only be used at creation of model - before first save. * * @param value the returntype */ @Accessor(qualifier = "returntype", type = Accessor.Type.SETTER) public void setReturntype(final TypeModel value) { getPersistenceContext().setPropertyValue(RETURNTYPE, value); } }
[ "sandeepvalapi@gmail.com" ]
sandeepvalapi@gmail.com
ef68d9d6673916d1511fb5257873ad2b519db453
1c2be46dd404c7846445e853c655554091e128ec
/src/test/java/com/viveksoft/esigsampleapp/web/rest/errors/ExceptionTranslatorIntTest.java
3784ab302b0d8cd423baf8168fba37a6de7e0a6b
[]
no_license
vivekvb/jhipsterSampleApplication
10a6bc661c3626ee8952b381101895d9d2c0dd12
ade59bfa9a26c8ca6b5025615dde6a3d8843e5d9
refs/heads/master
2021-08-16T07:46:37.939787
2017-11-19T08:42:22
2017-11-19T08:42:22
111,278,414
0
0
null
null
null
null
UTF-8
Java
false
false
6,549
java
package com.viveksoft.esigsampleapp.web.rest.errors; import com.viveksoft.esigsampleapp.JhipsterSampleApplicationApp; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.zalando.problem.spring.web.advice.MediaTypes; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the ExceptionTranslator controller advice. * * @see ExceptionTranslator */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterSampleApplicationApp.class) public class ExceptionTranslatorIntTest { @Autowired private ExceptionTranslatorTestController controller; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; private MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } @Test public void testConcurrencyFailure() throws Exception { mockMvc.perform(get("/test/concurrency-failure")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); } @Test public void testMethodArgumentNotValid() throws Exception { mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); } @Test public void testParameterizedError() throws Exception { mockMvc.perform(get("/test/parameterized-error")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.param0").value("param0_value")) .andExpect(jsonPath("$.params.param1").value("param1_value")); } @Test public void testParameterizedError2() throws Exception { mockMvc.perform(get("/test/parameterized-error2")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.foo").value("foo_value")) .andExpect(jsonPath("$.params.bar").value("bar_value")); } @Test public void testMissingServletRequestPartException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-part")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testMissingServletRequestParameterException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-parameter")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testAccessDenied() throws Exception { mockMvc.perform(get("/test/access-denied")) .andExpect(status().isForbidden()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.403")) .andExpect(jsonPath("$.detail").value("test access denied!")); } @Test public void testUnauthorized() throws Exception { mockMvc.perform(get("/test/unauthorized")) .andExpect(status().isUnauthorized()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.401")) .andExpect(jsonPath("$.path").value("/test/unauthorized")) .andExpect(jsonPath("$.detail").value("test authentication failed!")); } @Test public void testMethodNotSupported() throws Exception { mockMvc.perform(post("/test/access-denied")) .andExpect(status().isMethodNotAllowed()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.405")) .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); } @Test public void testExceptionWithResponseStatus() throws Exception { mockMvc.perform(get("/test/response-status")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")) .andExpect(jsonPath("$.title").value("test response status")); } @Test public void testInternalServerError() throws Exception { mockMvc.perform(get("/test/internal-server-error")) .andExpect(status().isInternalServerError()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.500")) .andExpect(jsonPath("$.title").value("Internal Server Error")); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
eadc4af66b381823d304fb3fb9623e8fcfd1c850
47e128c03741c6137bc4305f23f87755f46d1399
/java-basic/src/main/java/ch26/d/Test04.java
054db5b709369f661a6498fe0304850982ae882e
[]
no_license
jeajoong/bitcamp-java-2018-12
cda916ca6ec02336bf39c374178a3c158faa1a15
f10ccbcb498de0d11d02d78b7204fde6ed8e296d
refs/heads/master
2021-07-25T09:41:30.978244
2020-05-07T08:32:54
2020-05-07T08:32:54
163,650,670
0
0
null
2020-04-30T11:56:40
2018-12-31T08:00:40
Java
UTF-8
Java
false
false
1,143
java
// select 결과 값을 자바 인스턴스에 온전히 담는 방법 II package ch26.d; import java.io.InputStream; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; public class Test04 { public static void main(String[] args) throws Exception { InputStream inputStream = Resources.getResourceAsStream("ch26/d/mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); SqlSession sqlSession = sqlSessionFactory.openSession(); // select 문에서 컬럼 값을 자바 인스턴스의 프로퍼티와 맞추기 위해 // 별명을 부여하는 방식은 번거롭다. // 특히 컬럼 개수가 많은 경우 더더욱 번거롭다. // 이를 해결하기 위해 mybatis는 컬럼의 이름과 프로퍼티 이름을 연결해주는 문법을 제공한다. // <resultMap></resultMap> // Board2 board = sqlSession.selectOne("board.select5"); System.out.println(board); } }
[ "jeajoong605@gmail.com" ]
jeajoong605@gmail.com
b446be96e79460ada9b5022169acc0b2489fb0dd
86b1a2b0dc96119df5a527edcdd2f8d485f9d9e1
/src/main/java/it/itzware/nomitz/company/config/ApplicationProperties.java
60b27c73a86dad738615d592eb43985f1c553296
[]
no_license
isgaot/NomitzCompany
4bd70c4af722e0e2a9fe82738f792a4731b339a3
7b5574d9b9ddb80efe5c12a0bbbee6745e40c6c8
refs/heads/master
2021-08-24T03:13:49.633935
2017-12-07T20:39:45
2017-12-07T20:39:45
113,496,270
0
0
null
null
null
null
UTF-8
Java
false
false
433
java
package it.itzware.nomitz.company.config; import org.springframework.boot.context.properties.ConfigurationProperties; /** * Properties specific to Nomitz Company. * <p> * Properties are configured in the application.yml file. * See {@link io.github.jhipster.config.JHipsterProperties} for a good example. */ @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) public class ApplicationProperties { }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
f340791ced78eb7ce60c0537ea1c58ae2f49e82a
9f3ee1e8ef205c0e2d4f2b12bf43d36e229f2ddf
/urule-core/src/main/java/com/wenba/urule/parse/decisiontree/VariableTreeNodeParser.java
fe8ac2fc85fa6e45980afa3680fbc112de8b604c
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
WeiGaung/drools
0622223d9fded09a16b4922a4ea6f77c59b556de
390d4947785a923421df473074bb0220c55ec66c
refs/heads/master
2020-04-10T11:57:13.608789
2018-11-29T01:31:36
2018-11-29T01:31:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,450
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.wenba.urule.parse.decisiontree; import java.util.ArrayList; import java.util.List; import com.wenba.urule.parse.LeftParser; import org.dom4j.Element; import com.wenba.urule.model.decisiontree.ConditionTreeNode; import com.wenba.urule.model.decisiontree.TreeNodeType; import com.wenba.urule.model.decisiontree.VariableTreeNode; import com.wenba.urule.parse.Parser; /** * @author Jacky.gao * @since 2016年2月26日 */ public class VariableTreeNodeParser implements Parser<VariableTreeNode> { private LeftParser leftParser; private ConditionTreeNodeParser conditionTreeNodeParser; @Override public VariableTreeNode parse(Element element) { VariableTreeNode node=new VariableTreeNode(); node.setNodeType(TreeNodeType.variable); List<ConditionTreeNode> conditionTreeNodes=new ArrayList<ConditionTreeNode>(); for(Object obj:element.elements()){ if(obj==null || !(obj instanceof Element)){ continue; } Element ele=(Element)obj; String name=ele.getName(); if(name.equals("left")){ node.setLeft(leftParser.parse(ele)); }else if(conditionTreeNodeParser.support(name)){ ConditionTreeNode cn=conditionTreeNodeParser.parse(ele); cn.setParentNode(node); conditionTreeNodes.add(cn); } } if(conditionTreeNodes.size()>0){ node.setConditionTreeNodes(conditionTreeNodes); } return node; } public void setConditionTreeNodeParser( ConditionTreeNodeParser conditionTreeNodeParser) { this.conditionTreeNodeParser = conditionTreeNodeParser; } public void setLeftParser(LeftParser leftParser) { this.leftParser = leftParser; } @Override public boolean support(String name) { return name.equals("variable-tree-node"); } }
[ "1" ]
1
1df096cc8be1149912fa4710d5250d46c9a7892a
e56870ece3b7b99c95778166226572ee2711de05
/net/minecraft/network/protocol/game/PacketPlayOutAdvancements.java
36e345c2797420ae2de180a8e07a7a50cdc01369
[]
no_license
Black-Hole/mc-dev
e5e499fd11d4cab0f33ac2812404a5ca2a76dc8e
9fdd00a0a6f440445632f65920c075e23be7fa92
refs/heads/master
2023-06-21T13:28:09.851862
2023-06-12T23:39:23
2023-06-13T01:45:16
141,016,166
4
1
null
2018-07-15T09:56:12
2018-07-15T09:56:11
null
UTF-8
Java
false
false
3,378
java
package net.minecraft.network.protocol.game; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.AdvancementProgress; import net.minecraft.network.PacketDataSerializer; import net.minecraft.network.protocol.Packet; import net.minecraft.resources.MinecraftKey; public class PacketPlayOutAdvancements implements Packet<PacketListenerPlayOut> { private final boolean reset; private final Map<MinecraftKey, Advancement.SerializedAdvancement> added; private final Set<MinecraftKey> removed; private final Map<MinecraftKey, AdvancementProgress> progress; public PacketPlayOutAdvancements(boolean flag, Collection<Advancement> collection, Set<MinecraftKey> set, Map<MinecraftKey, AdvancementProgress> map) { this.reset = flag; Builder<MinecraftKey, Advancement.SerializedAdvancement> builder = ImmutableMap.builder(); Iterator iterator = collection.iterator(); while (iterator.hasNext()) { Advancement advancement = (Advancement) iterator.next(); builder.put(advancement.getId(), advancement.deconstruct()); } this.added = builder.build(); this.removed = ImmutableSet.copyOf(set); this.progress = ImmutableMap.copyOf(map); } public PacketPlayOutAdvancements(PacketDataSerializer packetdataserializer) { this.reset = packetdataserializer.readBoolean(); this.added = packetdataserializer.readMap(PacketDataSerializer::readResourceLocation, Advancement.SerializedAdvancement::fromNetwork); this.removed = (Set) packetdataserializer.readCollection(Sets::newLinkedHashSetWithExpectedSize, PacketDataSerializer::readResourceLocation); this.progress = packetdataserializer.readMap(PacketDataSerializer::readResourceLocation, AdvancementProgress::fromNetwork); } @Override public void write(PacketDataSerializer packetdataserializer) { packetdataserializer.writeBoolean(this.reset); packetdataserializer.writeMap(this.added, PacketDataSerializer::writeResourceLocation, (packetdataserializer1, advancement_serializedadvancement) -> { advancement_serializedadvancement.serializeToNetwork(packetdataserializer1); }); packetdataserializer.writeCollection(this.removed, PacketDataSerializer::writeResourceLocation); packetdataserializer.writeMap(this.progress, PacketDataSerializer::writeResourceLocation, (packetdataserializer1, advancementprogress) -> { advancementprogress.serializeToNetwork(packetdataserializer1); }); } public void handle(PacketListenerPlayOut packetlistenerplayout) { packetlistenerplayout.handleUpdateAdvancementsPacket(this); } public Map<MinecraftKey, Advancement.SerializedAdvancement> getAdded() { return this.added; } public Set<MinecraftKey> getRemoved() { return this.removed; } public Map<MinecraftKey, AdvancementProgress> getProgress() { return this.progress; } public boolean shouldReset() { return this.reset; } }
[ "black-hole@live.com" ]
black-hole@live.com
9f3761b1c6b565b907534bdf3fdc87e233b8f425
e89d45f9e6831afc054468cc7a6ec675867cd3d7
/src/main/java/com/microsoft/graph/requests/extensions/IProgramCollectionRequestBuilder.java
6db5d3b7c022a81504777a12da6d58fa456f9f46
[ "MIT" ]
permissive
isabella232/msgraph-beta-sdk-java
67d3b9251317f04a465042d273fe533ef1ace13e
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
refs/heads/dev
2023-03-12T05:44:24.349020
2020-11-19T15:51:17
2020-11-19T15:51:17
318,158,544
0
0
MIT
2021-02-23T20:48:09
2020-12-03T10:37:46
null
UTF-8
Java
false
false
1,635
java
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.requests.extensions; import com.microsoft.graph.http.IRequestBuilder; import com.microsoft.graph.core.ClientException; import com.microsoft.graph.concurrency.ICallback; import com.microsoft.graph.models.extensions.Program; import java.util.Arrays; import java.util.EnumSet; import com.microsoft.graph.requests.extensions.IProgramRequestBuilder; import com.microsoft.graph.requests.extensions.IProgramCollectionRequest; import com.microsoft.graph.http.IBaseCollectionPage; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The interface for the Program Collection Request Builder. */ public interface IProgramCollectionRequestBuilder extends IRequestBuilder { /** * Creates the request * * @param requestOptions the options for this request * @return the IUserRequest instance */ IProgramCollectionRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions); /** * Creates the request * * @param requestOptions the options for this request * @return the IUserRequest instance */ IProgramCollectionRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions); IProgramRequestBuilder byId(final String id); }
[ "GraphTooling@service.microsoft.com" ]
GraphTooling@service.microsoft.com
8cfeee3f2efc9b1fbef4857b0e3897e22b722d0c
1b8de4feb0bddc44683cb80195f8cd59eb55aa5a
/janus-sdk/src/main/java/org/xujin/janus/damon/utils/ThreadPoolUtil.java
7135f730e2b7e15223546e3c20d3844fc0f3e0f2
[]
no_license
hetaoo/Janus
465bb506f30cee0b2df93c1299d98b1669bcb7fa
6c409d8944016c537c3c24848717e92926e2cea5
refs/heads/master
2023-02-05T09:10:19.210416
2020-12-31T03:27:44
2020-12-31T03:27:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,036
java
package org.xujin.janus.damon.utils; import org.xujin.janus.damon.exception.JanusCmdException; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * @author tbkk 2019-02-18 */ public class ThreadPoolUtil { /** * make server thread pool * * @param serverType * @return */ public static ThreadPoolExecutor makeServerThreadPool(final String serverType){ ThreadPoolExecutor serverHandlerPool = new ThreadPoolExecutor( 60, 300, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(1000), r -> new Thread(r, "janus-cmd, "+serverType+"-serverHandlerPool-" + r.hashCode()), (r, executor) -> { throw new JanusCmdException("janus-cmd "+serverType+" Thread pool is EXHAUSTED!"); }); // default maxThreads 300, minThreads 60 return serverHandlerPool; } }
[ "Software_King@qq.com" ]
Software_King@qq.com
d9c204adbbd4b4995f6fcb096c32aab10323b0d0
83e7feacfbc0276f0dd2081b2ab810697a6e817e
/net/futureclient/client/EC.java
a79c25be5fcaeff6f5c1b4568651cfb89dd9ff34
[ "MIT" ]
permissive
BriceRoles/future
0546e4569f2f2b5a689f77a856b6ff5c8b9eb039
0b21d02f7952e5d87c40264c9df7a2d16d1dd945
refs/heads/main
2023-06-18T22:56:09.730199
2021-07-19T01:23:34
2021-07-19T01:23:34
387,303,718
0
0
MIT
2021-07-19T01:17:42
2021-07-19T01:17:41
null
UTF-8
Java
false
false
533
java
package net.futureclient.client; import net.minecraft.network.play.server.SPacketPlayerPosLook; public class EC extends Ha<jf> { // $FF: synthetic field public final jc f$d; // $FF: synthetic method public EC(jc var1) { this.f$d = var1; } // $FF: synthetic method public void f$E(jf var1) { if (var1.f$E() instanceof SPacketPlayerPosLook) { jc.f$E(this.f$d).clear(); if (((LB)jc.f$a(this.f$d).f$E()).equals(LB.f$M)) { this.f$d.f$E(false); } } } }
[ "66845682+chrispycreme420@users.noreply.github.com" ]
66845682+chrispycreme420@users.noreply.github.com
0e81a48caa2a2a569b96666310a90bd1f94ffe6f
4370971acf1f422557e3f7de83d47f7705fd3719
/ph-oton-html/src/main/java/com/helger/html/hc/special/InlineCSSList.java
eca0652aaca7dc90bf728c6bde72c1df1204f1e9
[ "Apache-2.0" ]
permissive
phax/ph-oton
848676b328507b5ea96877d0b8ba80d286fd9fb7
6d28dcb7de123f4deb77de1bc022faf77ac37e49
refs/heads/master
2023-08-27T20:41:11.706035
2023-08-20T15:30:44
2023-08-20T15:30:44
35,175,824
5
5
Apache-2.0
2023-02-23T20:20:41
2015-05-06T18:27:20
JavaScript
UTF-8
Java
false
false
4,822
java
/* * Copyright (C) 2014-2023 Philip Helger (www.helger.com) * philip[at]helger[dot]com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.helger.html.hc.special; import java.io.Serializable; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.helger.commons.ValueEnforcer; import com.helger.commons.annotation.ReturnsMutableCopy; import com.helger.commons.collection.impl.CommonsArrayList; import com.helger.commons.collection.impl.ICommonsList; import com.helger.commons.hashcode.HashCodeGenerator; import com.helger.commons.string.ToStringGenerator; import com.helger.css.media.CSSMediaList; import com.helger.css.media.ICSSMediaList; import com.helger.html.resource.css.ConstantCSSCodeProvider; import com.helger.html.resource.css.ICSSCodeProvider; /** * This is a very special list used only to group inline CSS code for correct * merging. It maintains the original order and combines only those with the * same media lists. * * @author Philip Helger */ public class InlineCSSList { @Nonnull public static ICSSMediaList getSafeCSSMediaList (@Nullable final ICSSMediaList aMediaList) { if (aMediaList != null && !aMediaList.hasNoMediaOrAll ()) { // A special media list is present that is neither null nor empty nor does // it contain the "all" keyword return aMediaList; } // Create a new one without any media return new CSSMediaList (); } private static final class Key implements Serializable { private final ICSSMediaList m_aMediaList; public Key (@Nullable final ICSSMediaList aMediaList) { m_aMediaList = getSafeCSSMediaList (aMediaList); } @Nonnull public ICSSMediaList getMediaList () { return m_aMediaList; } @Override public boolean equals (final Object o) { if (o == this) return true; if (o == null || !getClass ().equals (o.getClass ())) return false; final Key rhs = (Key) o; return m_aMediaList.equals (rhs.m_aMediaList); } @Override public int hashCode () { return new HashCodeGenerator (this).append (m_aMediaList).getHashCode (); } @Override public String toString () { return new ToStringGenerator (null).append ("MediaList", m_aMediaList).getToString (); } } private static final class Item implements Serializable { private final Key m_aKey; private final StringBuilder m_aCSS = new StringBuilder (); public Item (@Nonnull final Key aKey) { m_aKey = ValueEnforcer.notNull (aKey, "Key"); } void appendCSS (@Nonnull final CharSequence aInlineCSS) { m_aCSS.append (aInlineCSS); } @Nonnull Key getKey () { return m_aKey; } @Nonnull public ICSSMediaList getMediaList () { return m_aKey.getMediaList (); } @Nonnull public String getCSS () { return m_aCSS.toString (); } @Override public String toString () { return new ToStringGenerator (this).append ("Key", m_aKey).append ("CSS", m_aCSS).getToString (); } } private final ICommonsList <Item> m_aItems = new CommonsArrayList <> (); public InlineCSSList () {} public void addInlineCSS (@Nullable final ICSSMediaList aMediaList, @Nonnull final CharSequence aInlineCSS) { final Key aKey = new Key (aMediaList); final Item aLastItem = m_aItems.getLast (); final Key aLastKey = aLastItem == null ? null : aLastItem.getKey (); Item aItemToUse; if (aLastKey != null && aLastKey.equals (aKey)) { aItemToUse = aLastItem; } else { aItemToUse = new Item (aKey); m_aItems.add (aItemToUse); } aItemToUse.appendCSS (aInlineCSS); } void clear () { m_aItems.clear (); } public boolean isEmpty () { return m_aItems.isEmpty (); } public boolean isNotEmpty () { return m_aItems.isNotEmpty (); } @Nonnull @ReturnsMutableCopy public ICommonsList <ICSSCodeProvider> getAll () { return m_aItems.getAllMapped (aItem -> new ConstantCSSCodeProvider (aItem.getCSS (), null, aItem.getMediaList (), true)); } @Override public String toString () { return new ToStringGenerator (this).append ("Items", m_aItems).getToString (); } }
[ "philip@helger.com" ]
philip@helger.com
3a31614436db9f3860aa74161b9134ccc999fe6e
d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb
/PROMISE/archives/synapse/1.2/org/apache/synapse/core/axis2/ResourceMap.java
e43c797d749fbfa138ac0dc0a329f390ca0b5f7a
[]
no_license
hvdthong/DEFECT_PREDICTION
78b8e98c0be3db86ffaed432722b0b8c61523ab2
76a61c69be0e2082faa3f19efd76a99f56a32858
refs/heads/master
2021-01-20T05:19:00.927723
2018-07-10T03:38:14
2018-07-10T03:38:14
89,766,606
5
1
null
null
null
null
UTF-8
Java
false
false
3,538
java
package org.apache.synapse.core.axis2; import org.apache.axiom.om.OMElement; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.synapse.SynapseException; import org.apache.synapse.config.SynapseConfiguration; import org.xml.sax.InputSource; import javax.xml.stream.XMLStreamException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; /** * A resource map. * * Instances of this class are used to resolve resources using registry entries. * This is useful for XML documents that can reference other documents (e.g. WSDL documents * importing XSD or other WSDL documents). A <code>ResourceMap</code> object contains a set of * (location, registry key) mappings. The <code>resolve</code> method can be used to * get retrieve the registry entry registered for a given location as an {@link InputSource} * object. */ public class ResourceMap { private static final Log log = LogFactory.getLog(ResourceMap.class); private final Map<String,String> resources = new LinkedHashMap<String,String>(); /** * Add a resource. * * @param location the location as it appears in referencing documents * @param key the registry key that points to the referenced document */ public void addResource(String location, String key) { resources.put(location, key); } /** * Get the (location, registry key) mappings. * * @return a map containing the (location, registry key) pairs */ public Map<String,String> getResources() { return Collections.unmodifiableMap(resources); } /** * Resolve a resource for a given location. * * @param synCfg the Synapse configuration (used to access the registry) * @param location the location of of the resource at is appears in the referencing document * @return an <code>InputSource</code> object for the referenced resource */ public InputSource resolve(SynapseConfiguration synCfg, String location) { String key = (String)resources.get(location); if (key == null) { if (log.isDebugEnabled()) { log.debug("No resource mapping is defined for location '" + location + "'"); } return null; } else { if (log.isDebugEnabled()) { log.debug("Resolving location '" + location + "' to registry item '" + key + "'"); } synCfg.getEntryDefinition(key); Object keyObject = synCfg.getEntry(key); if (keyObject instanceof OMElement) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ((OMElement)keyObject).serialize(baos); } catch (XMLStreamException ex) { String msg = "Unable to serialize registry item '" + key + "' for location '" + location + "'"; log.error(msg); throw new SynapseException(msg, ex); } return new InputSource(new ByteArrayInputStream(baos.toByteArray())); } else { String msg = "Registry item '" + key + "' for location '" + location + "' is not an OMElement"; log.error(msg); throw new SynapseException(msg); } } } }
[ "hvdthong@github.com" ]
hvdthong@github.com
0459fe0e32b73ad7411d187e4c3088314700149e
41691da748cac60a6b37234a22a8502356f196eb
/src/main/java/com/jiyasoft/jewelplus/service/manufacturing/masters/IDesignCostLabourService.java
bb34deec354eaed741385612210e8ee4328a1d89
[]
no_license
abhijeet-yahoo/jewels
b9897bd75a48d99157f4760b047ef596438088db
1f164e5844a6417ac69dd5eb268b33ed5e3fe734
refs/heads/master
2023-07-17T08:16:28.466307
2021-08-16T06:37:48
2021-08-16T06:37:48
396,004,048
0
0
null
null
null
null
UTF-8
Java
false
false
509
java
package com.jiyasoft.jewelplus.service.manufacturing.masters; import java.util.List; import com.jiyasoft.jewelplus.domain.manufacturing.masters.Design; import com.jiyasoft.jewelplus.domain.manufacturing.masters.DesignCostLabour; public interface IDesignCostLabourService { public List<DesignCostLabour> findByDesignAndDeactive(Design design,Boolean deactive); public void save(DesignCostLabour designCostLabour); public void deleteAll(List<DesignCostLabour> designCostLabours); }
[ "comp2@comp2-pc" ]
comp2@comp2-pc
f1bf79baa1db18b5cca5f3ce0eb204e71dc9eb93
2092ca58e1a897c431be7f224307c8a7bd22c085
/com/sinch/android/rtc/internal/natives/SessionEventListener.java
36c7c25216575729a00094f391f0f963c1985312
[]
no_license
atresumes/Tele-1
33f4bc7445a136fc666d9c581d6b9395c1d8ec44
96aeb6b34e41d553ec79deaca332e974dea29c24
refs/heads/master
2020-03-21T11:24:53.093233
2018-06-24T18:19:24
2018-06-24T18:19:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
895
java
package com.sinch.android.rtc.internal.natives; import com.sinch.android.rtc.PushPair; import com.sinch.android.rtc.SinchError; import com.sinch.android.rtc.internal.natives.jni.Session; import java.util.List; public interface SessionEventListener { void onConnectionInfo(Session session, ConnectionInfo connectionInfo); void onEstablished(Session session); void onProgressing(Session session); void onPushData(Session session, List<PushPair> list); void onSignalStrength(Session session, int i, int i2, int i3, int i4); void onTerminated(Session session); void onTransferCompleted(Session session, boolean z, SinchError sinchError, AccessNumber accessNumber); void onTransferring(Session session); void onVideoTrackAdded(Session session, Object obj); void onVideoTrackPaused(Session session); void onVideoTrackResumed(Session session); }
[ "40494744+atresumes@users.noreply.github.com" ]
40494744+atresumes@users.noreply.github.com
0d87eee3ca2c58a7c92730c5e749f5dd9f71a875
a6b811e455671c77d4ce2ced70f19a58eced55f4
/module/fluance-cockpit-core/src/test/java/net/fluance/cockpit/core/test/repository/jdbc/visit/VisitPolicyDetailRepositoryTest.java
7d403ad9781ed72e3d9414ff3daab05cee8c9c7a
[]
no_license
Fluance/fec-mw-app
a553887b776cac4d5917be6570e28286fe91a19c
be6aca050b374d7979af6b05ef66e32599f0d226
refs/heads/master
2022-10-16T17:20:33.458986
2020-03-10T10:20:13
2020-03-10T10:20:13
246,269,124
2
0
null
2022-09-22T19:06:43
2020-03-10T10:17:13
Java
UTF-8
Java
false
false
3,737
java
package net.fluance.cockpit.core.test.repository.jdbc.visit; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.ComponentScan; import org.springframework.test.context.TestPropertySource; import net.fluance.app.test.AbstractTest; import net.fluance.cockpit.core.model.jdbc.visit.VisitPolicyDetail; import net.fluance.cockpit.core.repository.jdbc.visit.VisitPolicyDetailRepository; import net.fluance.cockpit.core.test.Application; @ComponentScan("net.fluance.cockpit.core") @SpringBootTest(classes = Application.class) @TestPropertySource(locations = "classpath:test.properties") public class VisitPolicyDetailRepositoryTest extends AbstractTest { @Autowired private VisitPolicyDetailRepository visitPolicyDetailRepository; // INPUTS PARAMS @Value("${net.fluance.cockpit.core.model.repository.policyList.visitNbAssociatedWithSomePolicies}") private Integer visitNb; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.guarantorId}") private Integer guarantorId; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.priority}") private Integer priority; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.subPriority}") private Integer subPriority; //EXPECTED_VALUES @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedName}") private String expectedName; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedCode}") private String expectedCode; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedPriority}") private Integer expectedPriority; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedSubPriority}") private Integer expectedSubPriority; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedHospclass}") private String expectedHospclass; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedInactive}") private boolean expectedInactive; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedPolicyNb}") private String expectedPolicyNb; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedCoverCardNb}") private double expectedCoverCardNb; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedAccidentNb}") private String expectedAccidentNb; @Value("${net.fluance.cockpit.core.model.repository.policyDetail.expectedaccidentDate}") private String expectedaccidentDate; @Test @Ignore("Test does not compile") public void testFindByNbVisit() { VisitPolicyDetail visitPolicy = visitPolicyDetailRepository.findByVisitNbAndGuarantorIdAndPriorityAndSubPriority(visitNb, guarantorId, priority, subPriority); assertNotNull(visitPolicy); assertTrue("".equals(visitPolicy.getId())); assertEquals(expectedName, visitPolicy.getName()); assertEquals(expectedCode, visitPolicy.getCode()); assertEquals(expectedPriority, visitPolicy.getPriority()); assertEquals(expectedSubPriority, visitPolicy.getSubpriority()); assertEquals(expectedHospclass, visitPolicy.getHospclass()); assertEquals(expectedInactive, visitPolicy.getInactive()); assertEquals(expectedPolicyNb, visitPolicy.getPolicynb()); assertTrue(expectedCoverCardNb == visitPolicy.getCovercardnb()); assertEquals(expectedAccidentNb, visitPolicy.getAccidentnb()); assertEquals(expectedaccidentDate, visitPolicy.getAccidentDate()); } }
[ "zroncevic@flunace.ch" ]
zroncevic@flunace.ch
c854992d812114c62d3953e6c3511cbc972bb67c
dc266ee299801939cea8518fc66a976305c4ec89
/src/main/java/decorator/impl/Truck.java
68393a7320c7f92fd603e041a7b75ed356a6f298
[]
no_license
981724480/design-patterns
1b68541ce37c6ed6c1a01915d8004b82ec976c2c
cf78fc6e9776e338f018e6e00f00f1eab66ca8ac
refs/heads/master
2021-01-19T04:44:02.166464
2015-12-07T06:40:02
2015-12-07T06:40:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
199
java
package decorator.impl; import utility.MyUtility; import decorator.interfaces.Car; public class Truck implements Car { public void drawColor(){ MyUtility.myPrint("Drawing basic color..."); } }
[ "nobodyiam@gmail.com" ]
nobodyiam@gmail.com
afb62f8e8d0a042e763163cb9c6b6f3ee49f63d9
13c1c732cb858fddacf0e3e0243b357056d5249d
/automation-core/src/main/java/org/openmaji/implementation/automation/loopback/LoopbackVariableListMeem.java
7648aa6314efb5aeefa8f20425e536c88da37d65
[]
no_license
ekoliving/Meemplex
2d0636f1ce1613de0edf435258203a2291925744
a38c2c85b10ec5f483cc35ad18083f63fb6ae179
refs/heads/master
2020-06-07T20:36:42.504730
2013-11-26T08:35:30
2013-11-26T08:35:30
3,151,783
1
0
null
null
null
null
UTF-8
Java
false
false
2,519
java
/* * Copyright 2004 by EkoLiving Pty Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.openmaji.implementation.automation.loopback; import org.openmaji.implementation.common.VariableListWedge; import org.openmaji.meem.definition.MeemDefinition; import org.openmaji.meem.definition.MeemDefinitionFactory; import org.openmaji.meem.definition.MeemDefinitionProvider; import org.openmaji.meem.definition.MeemDefinitionUtility; /** * A Meem that represents a variable loopback device. * This class implements <code>MeemDefinitionProvider</code> so that * <code>the MeemkitInstaller</code> can obtain a <code>MeemDefinition</code> * from which to create a <code>LoopbackVariableMeem</code> * * @author Warren Bloomer */ public class LoopbackVariableListMeem implements MeemDefinitionProvider { private MeemDefinition meemDefinition = null; /** * Return the MeemDefinition for this Meem. This MeemDefinition lists all of the * Wedges required to assemble a <code>LoopbackVariableMeem</code>. * * @return The MeemDefinition for this Meem * */ public MeemDefinition getMeemDefinition() { if ( meemDefinition == null ) { Class[] wedges = new Class[2]; wedges[0] = VariableListWedge.class; wedges[1] = LoopbackVariableListWedge.class; meemDefinition = MeemDefinitionFactory.spi.create().createMeemDefinition(wedges); meemDefinition.getMeemAttribute().setIdentifier("LoopbackVariableList"); MeemDefinitionUtility.renameFacetIdentifier( meemDefinition, "VariableListWedge", "variableList", "variableListInput" ); MeemDefinitionUtility.renameFacetIdentifier( meemDefinition, "VariableListWedge", "variableListClient", "variableListOutput" ); } return meemDefinition; } }
[ "stormboy@stormboy.com" ]
stormboy@stormboy.com
b6ee6d5f40fbf1ece2088c00f9a39c7fc799f537
9e1e266a223480f18430c4734a143cd6ebbd53da
/marylib/src/main/java/mf/org/apache/xerces/impl/xs/XSMessageFormatter.java
7d32769af88d6a5af758489a1de1f23fb7b420ac
[]
no_license
farizaghayev/AndroidMaryTTS
5e7bc3e9a2a4db9ff1e93877804b515fb197d880
9ffd7b831c4298e0c60644fb6e3f819651711330
refs/heads/master
2021-01-12T03:18:10.898257
2019-05-24T07:08:32
2019-05-24T07:08:32
78,184,107
0
0
null
2017-01-06T07:20:01
2017-01-06T07:20:01
null
UTF-8
Java
false
false
3,355
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package mf.org.apache.xerces.impl.xs; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; import mf.org.apache.xerces.util.MessageFormatter; /** * SchemaMessageProvider implements an XMLMessageProvider that * provides localizable error messages for the W3C XML Schema Language * * @author Elena Litani, IBM * @version $Id: XSMessageFormatter.java 813087 2009-09-09 19:35:27Z mrglavas $ * @xerces.internal */ public class XSMessageFormatter implements MessageFormatter { /** * The domain of messages concerning the XML Schema: Structures specification. */ public static final String SCHEMA_DOMAIN = "http://www.w3.org/TR/xml-schema-1"; // private objects to cache the locale and resource bundle private Locale fLocale = null; private ResourceBundle fResourceBundle = null; /** * Formats a message with the specified arguments using the given * locale information. * * @param locale The locale of the message. * @param key The message key. * @param arguments The message replacement text arguments. The order * of the arguments must match that of the placeholders * in the actual message. * @return Returns the formatted message. * @throws MissingResourceException Thrown if the message with the * specified key cannot be found. */ @Override public String formatMessage(Locale locale, String key, Object[] arguments) throws MissingResourceException { if (locale == null) { locale = Locale.getDefault(); } if (locale != fLocale) { //MF fResourceBundle = ResourceBundle.getBundle("mf.org.apache.xerces.impl.msg.XMLSchemaMessages", locale); // memorize the most-recent locale fLocale = locale; } String msg = fResourceBundle.getString(key); if (arguments != null) { try { msg = java.text.MessageFormat.format(msg, arguments); } catch (Exception e) { msg = fResourceBundle.getString("FormatFailed"); msg += " " + fResourceBundle.getString(key); } } if (msg == null) { msg = fResourceBundle.getString("BadMessageKey"); //MF throw new MissingResourceException(msg, "mf.org.apache.xerces.impl.msg.SchemaMessages", key); } return msg; } }
[ "fariz.aghayev@gmail.com" ]
fariz.aghayev@gmail.com
afd4d15bf0d454f41dd5e4759674ceede8a372f6
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project27/src/main/java/org/gradle/test/performance27_5/Production27_463.java
8a32a736bb3f587ad6d417a7194f60e0464a4559
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance27_5; public class Production27_463 extends org.gradle.test.performance11_5.Production11_463 { private final String property; public Production27_463() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3bbed76c85d14978d89730a9db36383ed47d7e4e
c1b23a03926012ccee280b3895f100cec61d2407
/topdeep_web_common/server/common-core/src/main/java/topdeep/commonfund/entity/hundsun/E006OutputDetail.java
6421d209a027132a9ea74e156cb847d16ca42c57
[]
no_license
zhuangxiaotian/project
a0e548c88f01339993097d99ac68adcba9d11171
d0c96854b3678209c9a25d07c9729c613fe66d38
refs/heads/master
2020-12-05T23:14:27.354448
2016-09-01T07:19:22
2016-09-01T07:19:22
67,108,931
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package topdeep.commonfund.entity.hundsun; import java.io.Serializable; import java.util.*; import common.util.param.PropertyAttribute; /** * 查询专户剩余额度(E006)功能输出明细参数 */ public class E006OutputDetail extends Object implements Serializable { /** * 基金代码, */ private String fundcode = ""; /** * 剩余额度, */ private Double remaintotalshare; /** * 总额度, */ private Double totaldegree; /** * 基金代码, */ public String getFundcode() { return this.fundcode; } /** * 基金代码, */ public void setFundcode(String value) { this.fundcode = value; } /** * 剩余额度, */ public Double getRemaintotalshare() { return this.remaintotalshare; } /** * 剩余额度, */ public void setRemaintotalshare(Double value) { this.remaintotalshare = value; } /** * 总额度, */ public Double getTotaldegree() { return this.totaldegree; } /** * 总额度, */ public void setTotaldegree(Double value) { this.totaldegree = value; } }
[ "xtian.zhuang@topdeep.com" ]
xtian.zhuang@topdeep.com
2773540ef3787cfd9df0fcb80dfacecaa73b762b
723fd77bbb8c532c16e467f0689cf579ff730b9b
/Module2_CaseStudy/FuramaResort/src/Models/House.java
ad51a5070c66a1638d5f1a4799a83b9fdd367dab
[]
no_license
nhkhanh6398/A2010I1_NguyenHuuKhanh
a4d23e0e9e00eb14186077c629d0af91d22b0336
0220559c19467533534c73997af2531cc52ef045
refs/heads/main
2023-08-14T08:02:13.722516
2021-09-15T15:24:39
2021-09-15T15:24:39
309,373,995
0
0
null
null
null
null
UTF-8
Java
false
false
2,078
java
package Models; public class House extends Services { private String typeRoom; private String otherService; private int numberFloor; public House(String id, String nameServices, double areaUse, int cost, int amount, int rentType, String typeRoom, String other, int numberFloor) { super(id, nameServices, areaUse, cost, amount, rentType); this.typeRoom = typeRoom; this.otherService = other; this.numberFloor = numberFloor; } public House() { } public String getTypeRoom() { return typeRoom; } public void setTypeRoom(String typeRoom) { this.typeRoom = typeRoom; } public String getOtherService() { return otherService; } public void setOtherService(String otherService) { this.otherService = otherService; } public int getNumberFloor() { return numberFloor; } public void setNumberFloor(int numberFloor) { this.numberFloor = numberFloor; } @Override public String showInfor() { return "House{" +"ID: "+ this.getId()+ ", Name: "+ this.getNameServices()+ ", AreaUse: "+this.getAreaUse()+ ", Cost: "+this.getCost()+ ", Amount: "+this.getAmount()+ ", RentType: "+this.getRentType()+ ", TypeRoom: " + this.getTypeRoom() + ", Other: " + this.getOtherService() + ", numberFloor: " + this.getNumberFloor() + '}'; } @Override public String toString() { return "House{" + "ID: "+ this.getId()+ ", Name: "+ this.getNameServices()+ ", AreaUse: "+this.getAreaUse()+ ", Cost: "+this.getCost()+ ", Amount: "+this.getAmount()+ ", RentType: "+this.getRentType()+ "typeRoom='" + typeRoom + '\'' + ", otherService='" + otherService + '\'' + ", numberFloor=" + numberFloor + '}'; } }
[ "nhkhanh6398@gmail.com" ]
nhkhanh6398@gmail.com
b6ef3452be88248f2c3a73cac505a18d3fdc4d7c
4f0daec2907b6b7e095d4528afb95ddb8b97ec7c
/dom/src/main/java/au/com/scds/chats/dom/volunteer/VolunteeredTime.java
2f2a7babcc3f2f7270d5c1598a1668701e2a6399
[]
no_license
alebaptista/isis-chats
2b950778b6668635bfe8a1dc43dca84f4fd83ebd
60ab6af0f1f5dab6e527ab19b419e9fec54e4659
refs/heads/master
2023-03-21T23:59:43.898473
2018-07-08T13:25:39
2018-07-08T13:25:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,712
java
/* * * Copyright 2015 Stephen Cameron Data Services * * * 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 au.com.scds.chats.dom.volunteer; import java.sql.Timestamp; import java.text.DecimalFormat; import javax.jdo.annotations.Column; import javax.jdo.annotations.Discriminator; import javax.jdo.annotations.DiscriminatorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.Inheritance; import javax.jdo.annotations.InheritanceStrategy; import javax.jdo.annotations.NotPersistent; import javax.jdo.annotations.PersistenceCapable; import org.apache.isis.applib.annotation.Action; import org.apache.isis.applib.annotation.BookmarkPolicy; import org.apache.isis.applib.annotation.DomainObject; import org.apache.isis.applib.annotation.DomainObjectLayout; import org.apache.isis.applib.annotation.Editing; import org.apache.isis.applib.annotation.InvokeOn; import org.apache.isis.applib.annotation.MemberGroupLayout; import org.apache.isis.applib.annotation.MemberOrder; import org.apache.isis.applib.annotation.ParameterLayout; import org.apache.isis.applib.annotation.Programmatic; import org.apache.isis.applib.annotation.Property; import org.apache.isis.applib.annotation.PropertyLayout; import org.apache.isis.applib.annotation.Where; import org.apache.isis.applib.util.ObjectContracts; import org.joda.time.DateTime; import org.joda.time.Period; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import au.com.scds.chats.dom.AbstractChatsDomainEntity; import au.com.scds.chats.dom.StartAndFinishDateTime; import au.com.scds.chats.dom.attendance.Attend; @DomainObject(objectType = "VOLUNTEERED_TIME") @PersistenceCapable(identityType = IdentityType.DATASTORE) @Inheritance(strategy = InheritanceStrategy.NEW_TABLE) @Discriminator(strategy = DiscriminatorStrategy.VALUE_MAP, column = "role", value = "GENERAL") public class VolunteeredTime extends StartAndFinishDateTime implements Comparable<VolunteeredTime> { private Volunteer volunteer; private String description; private Boolean includeAsParticipation; private static DecimalFormat hoursFormat = new DecimalFormat("#,##0.00"); private static DateTimeFormatter titleFormatter = DateTimeFormat.forPattern("dd-MMM-yyyy"); public String title() { return getVolunteer().getFullName() + " on " + titleFormatter.print(getStartDateTime()); } @Property(editing=Editing.DISABLED) @Column(allowsNull = "false") public Volunteer getVolunteer() { return volunteer; } public void setVolunteer(Volunteer volunteer) { this.volunteer = volunteer; } @Column(allowsNull = "true") public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @Column(allowsNull = "false") public Boolean getIncludeAsParticipation() { return includeAsParticipation; } public void setIncludeAsParticipation(Boolean includeAsParticipation) { this.includeAsParticipation = includeAsParticipation; } @Override public int compareTo(VolunteeredTime other) { return ObjectContracts.compare(this, other, "volunteer", "startDateTime", "endDateTime"); } }
[ "steve.cameron.62@gmail.com" ]
steve.cameron.62@gmail.com
194ad77199ad4186ddd8fc6a228ef627465c7be3
eb69f189cf7916c33e5738a4a8961971244c9848
/Java8/ex47/src/main/java/ex47.java
608755306c06d434d93a60ef50916a9a6c230f11
[]
no_license
douglascraigschmidt/LiveLessons
59e06ade1d0786eac665d3fe369426cde36ff199
b685afc62b469b17e3e9323a814e220d5315df55
refs/heads/master
2023-08-18T01:21:04.022903
2023-08-02T00:52:16
2023-08-02T00:52:16
21,949,817
587
712
null
2023-02-18T04:18:02
2014-07-17T16:46:47
Java
UTF-8
Java
false
false
8,002
java
import jdk.incubator.concurrent.StructuredTaskScope; import utils.*; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.StampedLock; import java.util.function.Function; import static java.util.Map.Entry.comparingByValue; import static utils.MapUtils.sortMap; import static utils.PrimeUtils.*; import static utils.RandomUtils.generateRandomData; /** * This example showcases and benchmarks the use of Java * object-oriented and functional programming features in the context * of a {@link Memoizer} configured with either a Java {@link * ConcurrentHashMap}, a Java {@link Collections} {@code * SynchronizedMap}, and a {@link HashMap} protected by a Java {@link * StampedLock}. This {@link Memoizer} is used to compute, cache, and * retrieve large prime numbers concurrently via Java structured * concurrency and virtual Thread objects. This example also * demonstrates the Java {@code record} data type and several advanced * features of {@link StampedLock}. */ public class ex47 { /** * Count the number of pending items. */ private final AtomicInteger mPendingItemCount = new AtomicInteger(0); /** * A list of randomly-generated large {@link Integer} objects. */ private final List<Integer> mRandomIntegers; /** * Main entry point into the test program. */ static public void main(String[] argv) { // Create and run the tests. new ex47(argv).run(); } /** * Constructor initializes the fields. */ ex47(String[] argv) { // Parse the command-line arguments. Options.instance().parseArgs(argv); // Generate random data for use by the various hashmaps. mRandomIntegers = generateRandomData (Options.instance().count(), Options.instance().maxValue()); } /** * Run all the tests and print the results. */ private void run() { // Create and time the use of a Memoizer configured with a // SynchronizedHashMap, which uses a single lock. timeTest(new Memoizer<> (PrimeUtils::isPrime, Collections.synchronizedMap(new HashMap<>())), "synchronizedHashMapMemoizer"); // Create and time the use of a Memoizer configured with a // ConcurrentHashMap, which uses a lock per hash table // "bucket". timeTest(new Memoizer<> (PrimeUtils::isPrime, new ConcurrentHashMap<>()), "concurrentHashMapMemoizer"); // Create a StampedLockHashMap, which uses various features of // a StampedLock. Map<Integer, Integer> stampedLockHashMap = new StampedLockHashMap<>(); // Create and time the use of a Memoizer configured with a // StampedLockHashMap. timeTest(new Memoizer<> (PrimeUtils::isPrime, stampedLockHashMap), "stampedLockHashMapMemoizer"); // Print the timing results. System.out.println(RunTimer.getTimingResults()); // Print the results the StampedLockHashMap object. printResults(stampedLockHashMap); } /** * Time {@code testName} using the given {@code memoizer}. * * @param memoizer The memoizer used to cache the prime candidates * @param testName The name of the test */ private void timeTest (Function<Integer, Integer> memoizer, String testName) { // Return the memoizer updated during the test. RunTimer // Time how long this test takes to run. .timeRun(() -> // Run the test using the given memoizer. runTest(memoizer, testName), testName); } /** * Run the prime number test using Java structured concurrency. * * @param memoizer A cache that maps candidate primes to their * smallest factor (if they aren't prime) or 0 if * they are prime * @param testName Name of the test * @return The memoizer updated during the test */ private Function<Integer, Integer> runTest (Function<Integer, Integer> memoizer, String testName) { Options.print("Starting " + testName + " with count = " + Options.instance().count()); // Reset the counter. Options.instance().primeCheckCounter().set(0); // Create a List of Future<PrimeResult> objects of the given // size. List<Future<PrimeResult>> results = new ArrayList<>(mRandomIntegers.size()); // Create a new scope to execute virtual Thread objects. try (var scope = new StructuredTaskScope.ShutdownOnFailure()) { // Iterate through all the random Integer objects. for (Integer randomInteger : mRandomIntegers) { Options .debug("processed item: " + randomInteger + ", publisher pending items: " + mPendingItemCount.incrementAndGet()); results // Add the Future<PrimeResult> to the List. .add(scope. // Create a virtual Thread to run the computation. fork(() -> // Check each number to see if it's prime. checkIfPrime(randomInteger, memoizer))); } // This barrier synchronizer waits for all Thread objects // to finish or throw any exception that occurred. scope.join().throwIfFailed(); } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); } results // Handle each result. .forEach(resultFuture -> handleResult(resultFuture.resultNow())); Options.print("Leaving " + testName + " with " + Options.instance().primeCheckCounter().get() + " prime checks (" + (Options.instance().count() - Options.instance().primeCheckCounter().get()) + " duplicates)"); // Return the memoizer updated during the test. return memoizer; } /** * Handle the result by printing it if debugging is enabled. * * @param result The result of checking if a number is prime */ private void handleResult(PrimeUtils.PrimeResult result) { // Print the results. if (result.smallestFactor() != 0) Options.debug(result.primeCandidate() + " is not prime with smallest factor " + result.smallestFactor()); else Options.debug(result.primeCandidate() + " is prime"); Options.debug("consumer pending items: " + mPendingItemCount.decrementAndGet()); } /** * Print the results in the given {@link Map} object. */ private void printResults(Map<Integer, Integer> map) { // Sort the map by its values. var sortedMap = sortMap(map, comparingByValue()); // Print out the entire contents of the sorted map. Options.print("Map sorted by value = \n" + sortedMap); // Print out the prime numbers using takeWhile(). printPrimes(sortedMap); // Print out the non-prime numbers using dropWhile(). printNonPrimes(sortedMap); } }
[ "d.schmidt@vanderbilt.edu" ]
d.schmidt@vanderbilt.edu
bb34f54a7b01c49854e5d190ec767f2287e9b558
dfe6c29915e5c54734c99d89d82ed86348568cc9
/src/main/java/competitiveProgramming/leetcode/phase1/DeleteNodeBST.java
1461fe10a9d39e05962ad930eab8144a1b9f1e47
[]
no_license
tans105/JavaProgramming
dffaf38f0dbe4ca269827d07a0240605993cf265
f508a5d217c8d21532df6b98125d28fd574666c6
refs/heads/master
2022-06-19T10:29:57.685980
2022-06-09T06:01:57
2022-06-09T06:01:57
70,312,438
3
0
null
2022-05-20T22:15:22
2016-10-08T07:21:03
Java
UTF-8
Java
false
false
3,914
java
package competitiveProgramming.leetcode.phase1; import utils.ArrayUtils; import utils.TreeUtils; import utils.pojo.TreeNode; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.List; /* https://leetcode.com/problems/delete-node-in-a-bst/ 450. Delete Node in a BST Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be divided into two stages: Search for a node to remove. If the node is found, delete the node. Note: Time complexity should be O(height of tree). Example: root = [5,3,6,2,4,null,7] key = 3 5 / \ 3 6 / \ \ 2 4 7 Given key to delete is 3. So we find the node with value 3 and delete it. One valid answer is [5,4,6,2,null,null,7], shown in the following BST. 5 / \ 4 6 / \ 2 7 Another valid answer is [5,2,6,null,4,null,7]. 5 / \ 2 6 \ \ 4 7 */ public class DeleteNodeBST { public static void main(String[] args) { TreeNode node = TreeUtils.generateBinaryTreeFromArray(new Integer[]{5, 3, 6, 2, 4, null, 7}); TreeUtils.inorderTraversal(deleteNode(node, 5)); } public static TreeNode deleteNode(TreeNode root, int key) { TreeNode prev = null; TreeNode[] nodes = findNode(root, prev, key); /* Leaf Node: Delete the leaf node just like that. */ if (nodes[1].left == null && nodes[1].right == null) { deleteLeafNode(nodes); return root; } /* Single child: Delete the node and swap it with the child */ if (nodes[1].left != null && nodes[1].right == null) { //one child if (nodes[0].left != null && nodes[0].left.val == nodes[1].val) { nodes[0].left = nodes[1].left; } else { nodes[0].right = nodes[1].left; } return root; } else if (nodes[1].left == null) { if (nodes[0].left != null && nodes[0].left.val == nodes[1].val) { nodes[0].left = nodes[1].right; } else { nodes[0].right = nodes[1].right; } return root; } //two child: Swap it with immediate inorder successor or inorder predecessor List<Integer> inorderList = new ArrayList<>(); getInorderList(inorderList, root); int index = 0; while (index < inorderList.size()) { if (inorderList.get(index) == key) { break; } index++; } TreeNode[] nodes1 = findNode(root, null, inorderList.get(index - 1)); nodes[1].val = inorderList.get(index - 1); deleteLeafNode(nodes1); return root; } private static void deleteLeafNode(TreeNode[] nodes) { if (nodes[0].left != null && nodes[0].left.val == nodes[1].val) { nodes[0].left = null; } else { nodes[0].right = null; } } private static void getInorderList(List<Integer> list, TreeNode root) { if (root == null) { return; } getInorderList(list, root.left); list.add(root.val); getInorderList(list, root.right); } private static TreeNode[] findNode(TreeNode current, TreeNode prev, int key) { if (current == null) { return null; } TreeNode[] arr; if (current.val == key) { arr = new TreeNode[2]; arr[0] = prev; arr[1] = current; return arr; } if (key < current.val && current.left != null) { return findNode(current.left, current, key); } else if (key > current.val && current.right != null) { return findNode(current.right, current, key); } return null; } }
[ "tanmayawasthi105@gmail.com" ]
tanmayawasthi105@gmail.com
f6f5fd56eeda7d68d5bd3529d4e6ccc7062f2c7f
a96a706b8eda53966f341e99aef48cad18a0fa16
/service/src/main/java/com/stk123/service/task/TaskResult.java
e4250b43b628c22ff0e6a9c4cbca2e5c229b9b80
[]
no_license
ifankai/stk123
cbf72333672a8000b10b4762bcae7c911d761940
e0c22669df60bfad91980c7ddfd82c9ea72208a4
refs/heads/master
2022-10-19T04:36:38.829793
2022-01-14T10:22:32
2022-01-14T10:22:32
131,610,811
1
3
null
2022-10-05T18:22:48
2018-04-30T15:09:53
JavaScript
UTF-8
Java
false
false
779
java
package com.stk123.service.task; import com.fasterxml.jackson.annotation.JsonInclude; import com.stk123.model.RequestResult; import lombok.Getter; import lombok.Setter; @Getter @Setter @JsonInclude(JsonInclude.Include.NON_NULL) public class TaskResult<T> extends RequestResult<T> { private Task task; public TaskResult(boolean success, T data, Task task){ super(success, data); this.task = task; } public static TaskResult success(Task task) { return new TaskResult(true, null, task); } public static <R> TaskResult success(R data, Task task) { return new TaskResult(true, data, task); } public static TaskResult<String> failure(String e, Task task) { return new TaskResult(false, e, task); } }
[ "ifankai@aliyun.com" ]
ifankai@aliyun.com
34f2a9f22e725a634bef30fb0b8ed5a0073e42a0
3fb897bef2fa372d7fce40351d571f4ea7cfea80
/src/main/java/com/mvc/service/StudentServiceImpl.java
e42f0d460231299cab95d87c9c3a89cd2ed504f3
[]
no_license
yusufsevinc/spring-mvc-crud
5cff9eea47b7e7185282c30589453886265269b2
007cb646774c2a746cd47cb10d7431f42b118b7a
refs/heads/master
2023-08-04T23:24:00.161197
2021-09-25T09:01:54
2021-09-25T09:01:54
410,219,064
0
0
null
null
null
null
UTF-8
Java
false
false
854
java
package com.mvc.service; import java.util.List; import com.mvc.repository.StudentDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import com.mvc.model.Student; @Component @Service public class StudentServiceImpl implements StudentService { @Autowired private StudentDao studentDao; @Override public void saveStudent(Student std) { studentDao.saveStudent(std); } @Override public List<Student> getAllStudent() { return studentDao.getAllStudent(); } @Override public Student getById(Long id) { return studentDao.getById(id); } @Override public void updateStudent(Student std) { studentDao.updateStudent(std); } @Override public void deleteStudent(Long id) { studentDao.deleteStudent(id); } }
[ "1yusufsevinc@gmail.com" ]
1yusufsevinc@gmail.com
336e47c1c4ce007497fa45447d2e01413a5ad697
ea87e7258602e16675cec3e29dd8bb102d7f90f8
/fest-swing/src/test/java/org/fest/swing/driver/JTextComponentEditableQuery_isEditable_Test.java
8d78729243009b4d02f4c03cca56a03da80dff77
[ "Apache-2.0" ]
permissive
codehaus/fest
501714cb0e6f44aa1b567df57e4f9f6586311862
a91c0c0585c2928e255913f1825d65fa03399bc6
refs/heads/master
2023-07-20T01:30:54.762720
2010-09-02T00:56:33
2010-09-02T00:56:33
36,525,844
1
0
null
null
null
null
UTF-8
Java
false
false
3,405
java
/* * Created on Aug 11, 2008 * * 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. * * Copyright @2008-2010 the original author or authors. */ package org.fest.swing.driver; import static org.fest.assertions.Assertions.assertThat; import static org.fest.swing.driver.JTextComponentSetEditableTask.setTextFieldEditable; import static org.fest.swing.edt.GuiActionRunner.execute; import static org.fest.util.Collections.list; import java.util.Collection; import javax.swing.JTextField; import org.fest.swing.annotation.RunsInEDT; import org.fest.swing.edt.GuiQuery; import org.fest.swing.test.core.*; import org.fest.swing.test.data.BooleanProvider; import org.fest.swing.test.swing.TestWindow; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.*; import org.junit.runners.Parameterized.Parameters; /** * Tests for <code>{@link JTextComponentEditableQuery#isEditable(javax.swing.text.JTextComponent)}</code>. * * @author Alex Ruiz */ @RunWith(Parameterized.class) public class JTextComponentEditableQuery_isEditable_Test extends RobotBasedTestCase { private MyTextField textField; private final boolean editable; @Parameters public static Collection<Object[]> booleans() { return list(BooleanProvider.booleans()); } public JTextComponentEditableQuery_isEditable_Test(boolean editable) { this.editable = editable; } @Override protected void onSetUp() { MyWindow window = MyWindow.createNew(); textField = window.textField; } @Test public void should_indicate_if_JTextComponent_is_editable() { setTextFieldEditable(textField, editable); robot.waitForIdle(); textField.startRecording(); assertThat(JTextComponentEditableQuery.isEditable(textField)).isEqualTo(editable); textField.requireInvoked("isEditable"); } private static class MyWindow extends TestWindow { private static final long serialVersionUID = 1L; @RunsInEDT static MyWindow createNew() { return execute(new GuiQuery<MyWindow>() { @Override protected MyWindow executeInEDT() { return new MyWindow(); } }); } final MyTextField textField = new MyTextField(); private MyWindow() { super(JTextComponentEditableQuery_isEditable_Test.class); addComponents(textField); } } private static class MyTextField extends JTextField { private static final long serialVersionUID = 1L; private boolean recording; private final MethodInvocations methodInvocations = new MethodInvocations(); MyTextField() { super(20); } @Override public boolean isEditable() { if (recording) methodInvocations.invoked("isEditable"); return super.isEditable(); } void startRecording() { recording = true; } MethodInvocations requireInvoked(String methodName) { return methodInvocations.requireInvoked(methodName); } } }
[ "alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc" ]
alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc
4acafb64307c68dc2924a44354913e3f8c6fbe8a
7ee411400bf1012771da62d748a3d41931289bae
/springboot-javafx-integrity/src/test/java/ru/javafx/jfxtest/ButtonsController.java
3eb081562c9ad8c653a8b579f3ac6422aa045fc3
[]
no_license
algerd/javafx-archive
2185e56bca6acea06671219da65f17677769365d
6ef72c3117b94563d8757dbe1cb4cf9b9a4c2003
refs/heads/master
2021-01-13T12:45:16.380349
2016-11-14T18:16:44
2016-11-14T18:16:44
72,547,897
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package ru.javafx.jfxtest; import ru.javafx.jfxintegrity.FXMLController; @FXMLController public class ButtonsController { public void topButtonClicked() { System.out.println("Du hast den topButton geklickt!"); } public void clickMiddleButton() { System.out.println("MiddleButton!"); } }
[ "algerd75@mail.ru" ]
algerd75@mail.ru
5d36a6d329df9ad09ec622a1884cce74ba572123
2d840a44ecc779999afddd972ae5b0b72cdb98ae
/HolyMe/src/com/walter/holyme/SearchPage.java
5e882fc412120fb055cc6a6c5b5121c7f0f6c8c8
[]
no_license
walteranyika/android_apps
fcca883ef6c979da0f16f7ad990ca8e5273b0bc6
84d87c25021e54e4324b27f3b2112f99fced5853
refs/heads/master
2021-01-10T01:35:09.129241
2015-11-11T12:08:25
2015-11-11T12:08:25
45,979,414
0
0
null
null
null
null
UTF-8
Java
false
false
2,056
java
package com.walter.holyme; import java.util.ArrayList; import android.app.ActionBar; import android.app.Activity; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Bundle; import android.widget.ListView; public class SearchPage extends Activity { ListView msgList; ArrayList<MessageDetails> details; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Bundle extras=getIntent().getExtras(); String search_term=extras.getString("data"); msgList=(ListView) findViewById(R.id.MessageList); new FetchData().execute(search_term); ActionBar actionBar = getActionBar(); actionBar.setTitle("Results"); // Enabling Up / Back navigation actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#31b573"))); } private class FetchData extends AsyncTask<String, Void, ArrayList<MessageDetails>> { @Override protected ArrayList<MessageDetails> doInBackground(String... arg0) { // MessageDetails Detail; ArrayList<MyQuotes> s=new ArrayList<MyQuotes>(); details = new ArrayList<MessageDetails>(); // ArrayList<String> f=new ArrayList<String>(); SQLiteHandler h=new SQLiteHandler(getApplicationContext()); s=h.search(arg0[0]); if(s.size()>0) { int x=s.size(); for (int i = 0; i < x; i++) { MessageDetails d=new MessageDetails(); d.setSub(s.get(i)._preacher); d.setDesc(s.get(i)._quote); //Log.d("data", s.get(i)._preacher); details.add(d); } } return details; } @Override protected void onPostExecute(ArrayList<MessageDetails> result) { msgList.setAdapter(new CustomAdapter(result ,SearchPage.this)); } } }
[ "walteranyika@gmail.com" ]
walteranyika@gmail.com
b69ccca646424044578791b109b06b460d2a0c99
47f036d410a6a42a0752f9fd998305af1f577acf
/Project_185_Jan/src/interactions/Mouse/Context_click.java
cf49d5b2798f6b6960fde5b4ca35b46b54f59168
[]
no_license
sunilreddyg/05th_Jan_2021_5-30PM_v2
40dee9b41a2eff135c26b6ff6e30d77c88dbe7f7
36f795a71c3b8a4cd9562a57a5e515e1f8dbd74f
refs/heads/master
2023-03-07T09:44:41.014570
2021-02-20T14:03:53
2021-02-20T14:03:53
339,741,214
0
0
null
null
null
null
UTF-8
Java
false
false
1,039
java
package interactions.Mouse; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; public class Context_click { public static void main(String[] args) throws Exception { System.setProperty("webdriver.chrome.driver", "Drivers\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("https://swisnl.github.io/jQuery-contextMenu/demo.html"); driver.manage().window().maximize(); WebElement Context_Element=driver.findElement(By.xpath("//span[.='right click me']")); //Perform right click action on selected element new Actions(driver).contextClick(Context_Element).perform(); Thread.sleep(4000); WebElement Delete_btn=driver.findElement(By.xpath("//span[.='Delete']")); Delete_btn.click(); Thread.sleep(4000); driver.switchTo().alert().accept(); //This command close alert window } }
[ "Administrator@AA-PC" ]
Administrator@AA-PC
7cb359cad634fcb24b1e02c424e0b88958be16cc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/28/28_ce4501b3282c8bd17f67bef9ae3db2e50ccf3ffb/WSSConfig/28_ce4501b3282c8bd17f67bef9ae3db2e50ccf3ffb_WSSConfig_s.java
00623ba204442ba069120f5032e335142208e6f9
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,175
java
/* * Copyright 2003-2004 The Apache Software Foundation. * * 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.apache.ws.security; /** * WSSConfig * <p/> * Carries configuration data so the WSS4J spec compliance can be modified in * runtime. Configure an instance of this object only if you need WSS4J to * emulate certain industry clients or previous OASIS specifications for * WS-Security interoperability testing purposes. * <p/> * The default settings follow the latest OASIS and changing anything might * violate the OASIS specs. * <p/> * <b>WARNING: changing the default settings will break the compliance with the * latest specs. Do this only if you know what you are doing.</b> * <p/> * @author Rami Jaamour (rjaamour@parasoft.com) */ public class WSSConfig { protected static WSSConfig defaultConfig = getNewInstance(); protected String wsse_ns = WSConstants.WSSE_NS_OASIS_1_0; protected String wsu_ns = WSConstants.WSU_NS_OASIS_1_0; protected boolean qualifyBSTAttributes = false; protected boolean prefixBSTValues = false; protected boolean bodyIdQualified = true; protected boolean processNonCompliantMessages = true; public static final int TIMESTAMP_IN_SECURITY_ELEMENT = 1; public static final int TIMESTAMP_IN_HEADER_ELEMENT = 2; protected int timestampLocation = TIMESTAMP_IN_SECURITY_ELEMENT; protected WSSConfig() { } /** * * @return a new WSSConfig instance configured with the default values * (values identical to {@link #getDefaultWSConfig getDefaultWSConfig()}) */ public static WSSConfig getNewInstance() { WSSConfig config = new WSSConfig(); return config; } /** * returns a static WSConfig instance that is configured with the latest * OASIS WS-Seurity settings. */ public static WSSConfig getDefaultWSConfig() { return defaultConfig; } /** * default value is {@link WSConstants.WSSE_NS_OASIS_1_0} * <p/> * The WS-Security namespace */ public String getWsseNS() { return wsse_ns; } /** * Valid values: * <ul> * <li> {@link WSConstants#WSSE_NS_OASIS_2002_07} </li> * <li> {@link WSConstants#WSSE_NS_OASIS_2002_12} </li> * <li> {@link WSConstants#WSSE_NS_OASIS_2003_06} </li> * <li> {@link WSConstants#WSSE_NS_OASIS_1_0} OASIS WS-Security v1.0 (March 2004). This is the default and recommended setting</li> * </ul> */ public void setWsseNS(String wsseNamespace) { wsse_ns = wsseNamespace; } /** * default value is {@link WSConstants.WSU_NS_OASIS_1_0} * <p/> * The WS-Security utility namespace */ public String getWsuNS() { return wsu_ns; } /** * Valid values: * <ul> * <li> {@link WSConstants#WSU_NS_OASIS_2002_07} </li> * <li> {@link WSConstants#WSU_NS_OASIS_2002_12} </li> * <li> {@link WSConstants#WSU_NS_OASIS_2003_06} </li> * <li> {@link WSConstants#WSU_NS_OASIS_1_0} OASIS WS-Security v1.0 (March 2004). This is the default and recommended setting</li> * </ul> */ public void setWsuNS(String wsuNamespace) { wsu_ns = wsuNamespace; } /** * default value is false. * <p/> * returns true if the BinarySecurityToken EncodingType and ValueType * attributes should be namespace qualified. */ public boolean isBSTAttributesQualified() { return qualifyBSTAttributes; } /** * specify if the BinarySecurityToken EncodingType and ValueType * attributes should be namespace qualified. The default value is false. */ public void setBSTAttributesQualified(boolean qualifyBSTAttributes) { this.qualifyBSTAttributes = qualifyBSTAttributes; } /** * default value is false. * <p/> * returns true if the BinarySecurityToken EncodingType and ValueType * attribute values should be prefixed with "wsse" or otherwise qualified * with the wsse namespace (false). */ public boolean isBSTValuesPrefixed() { return prefixBSTValues; } /** * sets and option whether the BinarySecurityToken EncodingType and ValueType * attribute values should be prefixed with "wsse" or otherwise qualified * with the wsse namespace (false). */ public void setBSTValuesPrefixed(boolean prefixBSTAttributeValues) { prefixBSTValues = prefixBSTAttributeValues; } /** * default value is true. * <p/> * returns true if the Id attribute placed in the SOAP Body is * qualified with the wsu namespace. */ public boolean isBodyIdQualified() { return bodyIdQualified; } /** * Sets an option whether the Id attribute placed in the SOAP Body should be * qualified with the wsu namespace. */ public void setBodyIdQualified(boolean qualifyBodyIdAttribute) { bodyIdQualified = qualifyBodyIdAttribute; } /** * default value is TIMESTAMP_IN_SECURITY_ELEMENT (following OASIS 2003 and 2004 specs). * <p/> * returns TIMESTAMP_IN_SECURITY_ELEMENT if the wsu:Timestamp element is placed inside * the wsse:Secutriy element. TIMESTAMP_IN_HEADER_ELEMENT if it is placed under the Header directly, outside * the wsse:Secutriy element. */ public int getTimestampLocation() { return timestampLocation; } /** * Sets an option whether the Iwsu:Timestamp element is placed inside * the wsse:Secutriy element. set it to false foe placement in the Header, * outside the wsse:Secutriy element. */ public void setTimestampLocation(int timestampElementLocation) { timestampLocation = timestampElementLocation; } /** * default value is true. * <p/> * returns true if WSS4J attempts to process non-compliant WS-Security * messages, such as WS-Security headers with older OASIS spec namespaces. */ public boolean getProcessNonCompliantMessages() { return processNonCompliantMessages; } /** * Sets an option whether WSS4J should attempt to process non-compliant * WS-Security messages, such as WS-Security headers with older OASIS spec * namespaces. */ public void setProcessNonCompliantMessages(boolean attemptProcess) { processNonCompliantMessages = attemptProcess; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
90bc9b7334ab187a0126ed7995f1071c083b19d3
2d2a219d875bcc4180b41aa5d9048037d3f70224
/common/src/main/java/com/leoman/utils/InitialUtils.java
0fc006dcecb2b519ee747b625727e9a3e26b1153
[]
no_license
Daisyjl/VRRoom-console
88c29e0f83cac9c4f9aac72b150e312fa6ca44b0
3135c04f2e589e32d9c8f03449b86af527b0b832
refs/heads/master
2021-01-11T00:11:16.507582
2017-01-10T06:19:02
2017-01-10T06:19:02
70,563,412
0
1
null
null
null
null
UTF-8
Java
false
false
3,515
java
package com.leoman.utils; /** * Created by IntelliJ IDEA. * User: 蔡琦 * Date: 2016-8-4 * Time: 17:14:59 * ClassDescription:取出汉字字符串的拼音首字母 */ import java.lang.*; public class InitialUtils { //字母Z使用了两个标签,这里有27个值 //i, u, v都不做声母, 跟随前面的字母 private static char[] chartable = { '啊', '芭', '擦', '搭', '蛾', '发', '噶', '哈', '哈', '击', '喀', '垃', '妈', '拿', '哦', '啪', '期', '然', '撒', '塌', '塌', '塌', '挖', '昔', '压', '匝', '座' }; private static char[] alphatable = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; private static int[] table = new int[27]; //初始化 { for (int i = 0; i < 27; ++i) { table[i] = gbValue(chartable[i]); } } public InitialUtils() { } //主函数,输入字符,得到他的声母, //英文字母返回对应的大写字母 //其他非简体汉字返回 '0' public static char Char2Alpha(char ch) { if (ch >= 'a' && ch <= 'z') return (char) (ch - 'a' + 'A'); if (ch >= 'A' && ch <= 'Z') return ch; int gb = gbValue(ch); if (gb < table[0]) return '0'; int i; for (i = 0; i < 26; ++i) { if (match(i, gb)) break; } if (i >= 26) return '0'; else return alphatable[i]; } //根据一个包含汉字的字符串返回一个汉字拼音首字母的字符串 public static String String2Alpha(String SourceStr) { String Result = ""; int StrLength = SourceStr.length(); int i; try { for (i = 0; i < StrLength; i++) { Result += Char2Alpha(SourceStr.charAt(i)); } } catch (Exception e) { Result = ""; } return Result; } private static boolean match(int i, int gb) { if (gb < table[i]) return false; int j = i + 1; //字母Z使用了两个标签 while (j < 26 && (table[j] == table[i])) ++j; if (j == 26) return gb <= table[j]; else return gb < table[j]; } //取出汉字的编码 private static int gbValue(char ch) { String str = new String(); str += ch; try { byte[] bytes = str.getBytes("GB2312"); if (bytes.length < 2) return 0; return (bytes[0] << 8 & 0xff00) + (bytes[1] & 0xff); } catch (Exception e) { return 0; } } // 返回一串汉字中第一个汉字的首字母 public static String getInitial(String words) { //获得首字母 InitialUtils initialUtils = new InitialUtils(); String code = initialUtils.String2Alpha(words).substring(0,1); return code; } public static void main(String[] args) { InitialUtils obj1 = new InitialUtils(); System.out.println(obj1.String2Alpha("测试:程序员之家,程序员每天必上的网站!")); System.out.println(obj1.String2Alpha("程序员之家")); return; } }
[ "13517192891@163.com" ]
13517192891@163.com
9e6a97ff9be002faa9ce0fccc180b048b577664a
1b6cc19683b2e4512a6aa611b6c7bd1fa314136a
/[INC202]_Programacion_II/Certamen_1/2017/1erSem/P2/NavarroA-C1-P2/Principal.java
c82809d4fde552ea608ea01863b467e75608f300
[]
no_license
EdGoll/clases-uv
9f37f43b8410896e62df5b806ee04e045cfffb5f
7a86c563d5e73bba490b64dbc8f49d35c2370ccd
refs/heads/master
2021-06-21T20:42:48.444142
2019-08-18T20:04:14
2019-08-18T20:04:14
104,955,406
0
1
null
null
null
null
UTF-8
Java
false
false
848
java
/*En la clase Principal se ejecuta el codigo y se imprime el total de alumnos y el resultado de la separacion, mostrando la id de cada alumno en su respectivo grupo*/ public class Principal{ public static void main(String [] args){ Lista nueva = new Lista(); System.out.println("total alumnos: "+nueva.totalalumnos); System.out.println(); nueva.generarid(); nueva.separar(); System.out.println("GrupoA: "); for(int i=0;i<nueva.grupoA.size();i++){ nueva.grupoA.get(i).mostrarId(); if (i==nueva.grupoA.size()-1){ System.out.println("Cantidad total de GrupoA: "+(i+1)); System.out.println(); } } System.out.println("GrupoB: "); for(int i=0;i<nueva.grupoB.size();i++){ nueva.grupoB.get(i).mostrarId(); if (i==nueva.grupoB.size()-1){ System.out.println("Cantidad total de GrupoB: "+(i+1)); } } } }
[ "eduardo.gl@gmail.com" ]
eduardo.gl@gmail.com
86ef68193a6b472e67f490d9d872df70e447e0f1
374af48da0033b847b6f73fbbfccab52888e1667
/rio-tools/rio-ui/src/main/java/org/rioproject/tools/ui/serviceui/AdminFrame.java
d48f8b7b8a8ef1b37123c4459f6e8532456d7851
[ "Apache-2.0" ]
permissive
pfirmstone/Rio
7883fc7e40da7e4e54c78ed784530ee3cf659e6f
66dba3be4ad79326508c7a0e9c8d0990609fba2e
refs/heads/master
2023-06-21T19:00:39.479548
2019-09-18T22:11:46
2019-09-18T22:11:46
164,203,730
0
0
Apache-2.0
2023-04-20T04:21:35
2019-01-05T10:14:28
Java
UTF-8
Java
false
false
2,949
java
/* * Copyright 2008 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.rioproject.tools.ui.serviceui; import net.jini.core.entry.Entry; import net.jini.core.lookup.ServiceItem; import net.jini.lookup.entry.ServiceType; import org.rioproject.tools.ui.Constants; import javax.swing.*; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.lang.reflect.Method; /** * The AdminFrame class creates a ServiceUIPanel in a JFrame * * @author Dennis Reedy */ @SuppressWarnings("PMD.ConstructorCallsOverridableMethod") public class AdminFrame extends JFrame { ServiceUIPanel serviceUIPanel; public AdminFrame(ServiceItem item, Component component) throws Exception { this(item, Constants.DEFAULT_DELAY, component); } public AdminFrame(ServiceItem item, long startupDelay, Component component) throws Exception { super(); serviceUIPanel = new ServiceUIPanel(item, startupDelay, this); ServiceType sType = getServiceType(item.attributeSets); if(sType!=null && sType.getDisplayName()!=null) setTitle("Service UI for "+sType.getDisplayName()); Container container = getContentPane(); if(container!=null) container.add(serviceUIPanel); display(component); } private void display(Component component) { WindowListener l = new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); } }; addWindowListener(l); // Set dimensions and show setSize(565, 588); setLocationRelativeTo(component); setVisible(true); } private ServiceType getServiceType(Entry[] attrs) { for (Entry attr : attrs) { if (attr instanceof ServiceType) { return (ServiceType) attr; } } return(null); } @Override public void dispose() { //System.out.println(getSize()); for (Object comp : serviceUIPanel.getUIComponents()) { try { Method terminate = comp.getClass().getMethod("terminate", (Class[]) null); terminate.invoke(comp, (Object[]) null); } catch (Exception e) { /* ignore */ } } super.dispose(); } }
[ "dennis.reedy@gmail.com" ]
dennis.reedy@gmail.com
53c818c7b9f891731168ced98b675bdfe0fce17d
964db73c663c9dbe1f7d7ab2614f7a4f1c8aa304
/thrift/compiler/test/fixtures/exceptions/gen-java/Serious.java
b9c59b2d52680b336cab3c8872b112eaacd8c139
[ "Apache-2.0" ]
permissive
andywei/fbthrift
9c725e109476390b34f7dbd06b50e836716096fe
59330df4969ecde98c09a5e2ae6e78a31735418f
refs/heads/master
2020-07-21T11:23:54.225078
2019-09-06T15:16:53
2019-09-06T15:19:44
206,846,335
0
0
Apache-2.0
2019-09-06T17:48:58
2019-09-06T17:48:58
null
UTF-8
Java
false
false
6,346
java
/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.Set; import java.util.HashSet; import java.util.Collections; import java.util.BitSet; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.facebook.thrift.*; import com.facebook.thrift.async.*; import com.facebook.thrift.meta_data.*; import com.facebook.thrift.server.*; import com.facebook.thrift.transport.*; import com.facebook.thrift.protocol.*; @SuppressWarnings({ "unused", "serial" }) public class Serious extends Exception implements TBase, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("Serious"); private static final TField SONNET_FIELD_DESC = new TField("sonnet", TType.STRING, (short)1); public String sonnet; public static final int SONNET = 1; public static boolean DEFAULT_PRETTY_PRINT = true; // isset id assignments public static final Map<Integer, FieldMetaData> metaDataMap; static { Map<Integer, FieldMetaData> tmpMetaDataMap = new HashMap<Integer, FieldMetaData>(); tmpMetaDataMap.put(SONNET, new FieldMetaData("sonnet", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap); } static { FieldMetaData.addStructMetaDataMap(Serious.class, metaDataMap); } public Serious() { } public Serious( String sonnet) { this(); this.sonnet = sonnet; } /** * Performs a deep copy on <i>other</i>. */ public Serious(Serious other) { if (other.isSetSonnet()) { this.sonnet = TBaseHelper.deepCopy(other.sonnet); } } public Serious deepCopy() { return new Serious(this); } @Deprecated public Serious clone() { return new Serious(this); } public String getSonnet() { return this.sonnet; } public Serious setSonnet(String sonnet) { this.sonnet = sonnet; return this; } public void unsetSonnet() { this.sonnet = null; } // Returns true if field sonnet is set (has been assigned a value) and false otherwise public boolean isSetSonnet() { return this.sonnet != null; } public void setSonnetIsSet(boolean __value) { if (!__value) { this.sonnet = null; } } public void setFieldValue(int fieldID, Object __value) { switch (fieldID) { case SONNET: if (__value == null) { unsetSonnet(); } else { setSonnet((String)__value); } break; default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } public Object getFieldValue(int fieldID) { switch (fieldID) { case SONNET: return getSonnet(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } // Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise public boolean isSet(int fieldID) { switch (fieldID) { case SONNET: return isSetSonnet(); default: throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!"); } } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Serious) return this.equals((Serious)that); return false; } public boolean equals(Serious that) { if (that == null) return false; if (this == that) return true; boolean this_present_sonnet = true && this.isSetSonnet(); boolean that_present_sonnet = true && that.isSetSonnet(); if (this_present_sonnet || that_present_sonnet) { if (!(this_present_sonnet && that_present_sonnet)) return false; if (!TBaseHelper.equalsNobinary(this.sonnet, that.sonnet)) return false; } return true; } @Override public int hashCode() { return Arrays.deepHashCode(new Object[] {sonnet}); } public void read(TProtocol iprot) throws TException { TField __field; iprot.readStructBegin(metaDataMap); while (true) { __field = iprot.readFieldBegin(); if (__field.type == TType.STOP) { break; } switch (__field.id) { case SONNET: if (__field.type == TType.STRING) { this.sonnet = iprot.readString(); } else { TProtocolUtil.skip(iprot, __field.type); } break; default: TProtocolUtil.skip(iprot, __field.type); break; } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.sonnet != null) { if (isSetSonnet()) { oprot.writeFieldBegin(SONNET_FIELD_DESC); oprot.writeString(this.sonnet); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { return toString(DEFAULT_PRETTY_PRINT); } @Override public String toString(boolean prettyPrint) { return toString(1, prettyPrint); } @Override public String toString(int indent, boolean prettyPrint) { String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : ""; String newLine = prettyPrint ? "\n" : ""; String space = prettyPrint ? " " : ""; StringBuilder sb = new StringBuilder("Serious"); sb.append(space); sb.append("("); sb.append(newLine); boolean first = true; if (isSetSonnet()) { sb.append(indentStr); sb.append("sonnet"); sb.append(space); sb.append(":").append(space); if (this.getSonnet() == null) { sb.append("null"); } else { sb.append(TBaseHelper.toString(this.getSonnet(), indent + 1, prettyPrint)); } first = false; } sb.append(newLine + TBaseHelper.reduceIndent(indentStr)); sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } }
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
111a8e570a14e8be459f5cfd1871b5c1c02d2ce0
45736204805554b2d13f1805e47eb369a8e16ec3
/net/optifine/entity/model/ModelAdapterSlime.java
4e01fa18a9cd0cef1e5b6bceb7196d52916941db
[]
no_license
KrOySi/ArchWare-Source
9afc6bfcb1d642d2da97604ddfed8048667e81fd
46cdf10af07341b26bfa704886299d80296320c2
refs/heads/main
2022-07-30T02:54:33.192997
2021-08-08T23:36:39
2021-08-08T23:36:39
394,089,144
2
0
null
null
null
null
UTF-8
Java
false
false
2,016
java
/* * Decompiled with CFR 0.150. */ package net.optifine.entity.model; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelSlime; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderSlime; import net.minecraft.entity.monster.EntitySlime; import net.optifine.entity.model.IEntityRenderer; import net.optifine.entity.model.ModelAdapter; import optifine.Reflector; public class ModelAdapterSlime extends ModelAdapter { public ModelAdapterSlime() { super(EntitySlime.class, "slime", 0.25f); } @Override public ModelBase makeModel() { return new ModelSlime(16); } @Override public ModelRenderer getModelRenderer(ModelBase model, String modelPart) { if (!(model instanceof ModelSlime)) { return null; } ModelSlime modelslime = (ModelSlime)model; if (modelPart.equals("body")) { return (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 0); } if (modelPart.equals("left_eye")) { return (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 1); } if (modelPart.equals("right_eye")) { return (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 2); } return modelPart.equals("mouth") ? (ModelRenderer)Reflector.getFieldValue(modelslime, Reflector.ModelSlime_ModelRenderers, 3) : null; } @Override public IEntityRenderer makeEntityRender(ModelBase modelBase, float shadowSize) { RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); RenderSlime renderslime = new RenderSlime(rendermanager); renderslime.mainModel = modelBase; renderslime.shadowSize = shadowSize; return renderslime; } }
[ "67242784+KrOySi@users.noreply.github.com" ]
67242784+KrOySi@users.noreply.github.com
463f87f1c64103da2bfb51c75b62870452f0be72
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/shaded/com/google/inject/internal/DeferredLookups.java
4b05b0748f1fc9677b8e03db96a124479c56f35f
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500050
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
1,660
java
package com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.internal; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.Key; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.MembersInjector; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.Provider; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.TypeLiteral; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.internal.util..Lists; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.spi.Element; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.spi.MembersInjectorLookup; import com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.spi.ProviderLookup; import java.util.List; final class DeferredLookups implements Lookups { private final InjectorImpl injector; private final List<Element> lookups = .Lists.newArrayList(); DeferredLookups(InjectorImpl injector) { this.injector = injector; } void initialize(Errors errors) { injector.lookups = injector; new LookupProcessor(errors).process(injector, lookups); } public <T> Provider<T> getProvider(Key<T> key) { ProviderLookup<T> lookup = new ProviderLookup(key, key); lookups.add(lookup); return lookup.getProvider(); } public <T> MembersInjector<T> getMembersInjector(TypeLiteral<T> type) { MembersInjectorLookup<T> lookup = new MembersInjectorLookup(type, type); lookups.add(lookup); return lookup.getMembersInjector(); } } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.internal.DeferredLookups * Java Class Version: 5 (49.0) * JD-Core Version: 0.7.1 */
[ "Arwin.tio@adroll.com" ]
Arwin.tio@adroll.com
4f218015197586277efc72828992cff3717477e9
c3101515ddde8a6e6ddc4294a4739256d1600df0
/GeneralApp__2.20_1.0(1)_source_from_JADX/sources/kotlin/text/FlagEnum.java
205e0592d0caf23a68620da6b44b542f463b2eb7
[]
no_license
Aelshazly/Carty
b56fdb1be58a6d12f26d51b46f435ea4a73c8168
d13f3a4ad80e8a7d0ed1c6a5720efb4d1ca721ee
refs/heads/master
2022-11-14T23:29:53.547694
2020-07-08T19:23:39
2020-07-08T19:23:39
278,175,183
0
0
null
null
null
null
UTF-8
Java
false
false
658
java
package kotlin.text; import kotlin.Metadata; @Metadata(mo24950bv = {1, 0, 3}, mo24951d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\bb\u0018\u00002\u00020\u0001R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005R\u0012\u0010\u0006\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0007\u0010\u0005¨\u0006\b"}, mo24952d2 = {"Lkotlin/text/FlagEnum;", "", "mask", "", "getMask", "()I", "value", "getValue", "kotlin-stdlib"}, mo24953k = 1, mo24954mv = {1, 1, 15}) /* compiled from: Regex.kt */ interface FlagEnum { int getMask(); int getValue(); }
[ "aelshazly@engineer.com" ]
aelshazly@engineer.com
88993d1190f6f4d22bd6087b0b66408622f6d54c
c107cd9881ffd8059bd6a1948b2465f31ad6f3cd
/src/main/java/com/bergerkiller/bukkit/nolagg/saving/NoLaggSaving.java
ae10f2e9936e8efcdae119b04f35d43b7c361656
[]
no_license
Ketchup1234/NoLagg
60e08d54a0fba3be34c74ffcab99c26a3a8a3736
e5fd06471f7ca6509d61d91a9c26c8dffc3f8768
refs/heads/master
2020-11-30T13:36:03.182319
2013-02-16T14:58:13
2013-02-16T14:58:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,919
java
package com.bergerkiller.bukkit.nolagg.saving; import java.util.logging.Level; import com.bergerkiller.bukkit.common.config.ConfigurationNode; import com.bergerkiller.bukkit.nolagg.NoLaggComponent; public class NoLaggSaving extends NoLaggComponent { public static NoLaggSaving plugin; public static int autoSaveInterval; public static int autoSaveBatch; public static int writeDataInterval; public static boolean writeDataEnabled; @Override public void onDisable(ConfigurationNode config) { AutoSaveChanger.deinit(); RegionFileFlusher.deinit(); } @Override public void onEnable(ConfigurationNode config) { plugin = this; this.loadConfig(config); AutoSaveChanger.init(); RegionFileFlusher.reload(); } public void loadConfig(ConfigurationNode config) { config.setHeader("autoSaveInterval", "The tick interval at which the server saves automatically (20 ticks = 1 second)"); autoSaveInterval = config.get("autoSaveInterval", 400); if (autoSaveInterval < 400) { autoSaveInterval = 400; config.set("autoSaveInterval", 400); NoLaggSaving.plugin.log(Level.WARNING, "Save interval is set too low and has been limited to a 400 tick (20 second) interval"); } config.setHeader("autoSaveBatchSize", "The amount of chunks saved every tick when autosaving"); config.addHeader("autoSaveBatchSize", "If saving causes severe tick lag, lower it, if it takes too long, increase it"); autoSaveBatch = config.get("autoSaveBatchSize", 20); config.setHeader("writeDataEnabled", "Whether NoLagg will attempt to write all world data to the region files at a set interval"); config.addHeader("writeDataEnabled", "This is done on another thread, so don't worry about the main thread lagging while this happens"); writeDataEnabled = config.get("writeDataEnabled", true); config.setHeader("writeDataInterval", "The tick interval at which the server actually writes the chunk data to file (20 ticks = 1 second)"); writeDataInterval = config.get("writeDataInterval", 12000); if (writeDataInterval < 600) { writeDataInterval = 600; config.set("writeDataInterval", 600); log(Level.WARNING, "The configuration asked me to use a data write interval lower than 600 ticks (30 seconds)"); log(Level.WARNING, "Such an interval is far too low to be beneficial, so I changed it to 600 ticks for you"); } if (writeDataEnabled) { double time = writeDataInterval / 20; String timetext;// = time + " seconds"; if (time < 60) { timetext = time + " seconds"; } else if (time < 3600) { timetext = (time / 60) + " minutes"; } else { timetext = (time / 3600) + " hours"; } log(Level.INFO, "will write world data to all region files every " + writeDataInterval + " ticks (" + timetext + ")"); } } @Override public void onReload(ConfigurationNode config) { this.loadConfig(config); AutoSaveChanger.reload(); RegionFileFlusher.reload(); } }
[ "0p1q9o2w@hotmail.nl" ]
0p1q9o2w@hotmail.nl
0bf85cbcbb9b5b8faf47477d7b2ad9840510d197
e15874d3959a8aef6fef4352e26d34543f2c152f
/app/src/main/java/com/activities/TermsAndConditionActivity.java
b2806c240b8c2bca569ade6158940abadd876f93
[]
no_license
ankitmehtag/AnkitRahejaSales
c726d0a93403ce9368ec95f53447d05addb76ae4
7b9909a15975c1a8c508acfae6fe1fc0097575af
refs/heads/master
2022-12-17T13:02:54.058088
2020-09-22T07:31:02
2020-09-22T07:31:02
297,567,881
0
0
null
null
null
null
UTF-8
Java
false
false
2,722
java
package com.activities; import android.os.Bundle; import androidx.appcompat.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import com.AppEnums.APIType; import com.appnetwork.AsyncThread; import com.appnetwork.VolleyRequestApi; import com.appnetwork.WEBAPI; import com.sp.BMHApplication; import com.sp.BaseFragmentActivity; import com.sp.R; public class TermsAndConditionActivity extends BaseFragmentActivity { private View rootView; private BMHApplication app; private WebView web; public static final String TAG = TermsAndConditionActivity.class.getSimpleName(); private Toolbar toolbar; private AsyncThread mAsyncThread = null; @Override protected String setActionBarTitle() { return ""; } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_terms_and_condition); app = (BMHApplication) getApplication(); updateReadStatus(); toolbar = setToolBar(); toolbar.setTitle("Terms And Conditions"); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); web = (WebView) findViewById(R.id.webViewAboutUs); String type = getIntent().getStringExtra("target_info"); if (type != null) { web.loadUrl(type); web.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView viewx, String urlx) { viewx.loadUrl(urlx); return false; } }); } else { return; } } private void updateReadStatus() { String notificationId = getIntent().getStringExtra("notification_id"); VolleyRequestApi requestApi = new VolleyRequestApi(notificationId, WEBAPI.getWEBAPI(APIType.READ_STATUS), TermsAndConditionActivity.this); requestApi.updateNotificationReadStatus(); } @Override public boolean onPrepareOptionsMenu(Menu menu) { //MenuItem item = menu.findItem(R.id.action_filter); //item.setIcon(R.drawable.ic_more_vert_white_24dp); return true; //item.setVisible(false); } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_filter: return true; case android.R.id.home: finish(); return true; default: return super.onOptionsItemSelected(item); } } }
[ "sanjay01feb@gmail.com" ]
sanjay01feb@gmail.com
c536dd5354261ec7dd8db5e986ff302b5dc06603
ca26d7880ccaefc725cb0eb0df57c76748cc788d
/jiabian-parent/jiabian-dao/src/main/java/com/jiabian/beans/basic/SaleReceive.java
aec4f7a7509675931161041f6e1cbca5a3aa734c
[]
no_license
LuQinghua/hanbaoge
81dda1a3637f51d40481ab0db29e758c0827447b
a2163d6fa2700e21bb1635a01a64220bb492ec08
refs/heads/master
2020-03-22T17:10:39.467439
2018-07-10T05:03:14
2018-07-10T05:03:14
140,378,577
0
0
null
2018-07-10T04:49:49
2018-07-10T04:49:49
null
UTF-8
Java
false
false
4,768
java
/* * SaleReceive.java * Copyright(C) 20xx-2015 xxxxxx公司 * All rights reserved. * ----------------------------------------------- * 2017-02-10 Created */ package com.jiabian.beans.basic; import java.io.Serializable; import java.util.Date; /** * * * @author 菠萝大象 * @version 1.0 2017-02-10 */ public class SaleReceive implements Serializable { private static final long serialVersionUID = 1L; /** * 主键id */ private Long id; /** * 用户关联id */ private Long suserId; /** * 收货人姓名 */ private String userName; /** * 收货人联系电话 */ private String userTel; /** * 收货地址 */ private String address; /** * 是否默认收货地址(1:否 ,2:是) */ private Byte isDefault; /** * 创建时间 */ private Date createTime; /** * 修改时间 */ private Date updateTime; /** * 是否删除 */ private Byte isDel; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getSuserId() { return suserId; } public void setSuserId(Long suserId) { this.suserId = suserId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName == null ? null : userName.trim(); } public String getUserTel() { return userTel; } public void setUserTel(String userTel) { this.userTel = userTel == null ? null : userTel.trim(); } public String getAddress() { return address; } public void setAddress(String address) { this.address = address == null ? null : address.trim(); } public Byte getIsDefault() { return isDefault; } public void setIsDefault(Byte isDefault) { this.isDefault = isDefault; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public Byte getIsDel() { return isDel; } public void setIsDel(Byte isDel) { this.isDel = isDel; } @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } SaleReceive other = (SaleReceive) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getSuserId() == null ? other.getSuserId() == null : this.getSuserId().equals(other.getSuserId())) && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) && (this.getUserTel() == null ? other.getUserTel() == null : this.getUserTel().equals(other.getUserTel())) && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress())) && (this.getIsDefault() == null ? other.getIsDefault() == null : this.getIsDefault().equals(other.getIsDefault())) && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) && (this.getIsDel() == null ? other.getIsDel() == null : this.getIsDel().equals(other.getIsDel())); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getSuserId() == null) ? 0 : getSuserId().hashCode()); result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); result = prime * result + ((getUserTel() == null) ? 0 : getUserTel().hashCode()); result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode()); result = prime * result + ((getIsDefault() == null) ? 0 : getIsDefault().hashCode()); result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); result = prime * result + ((getIsDel() == null) ? 0 : getIsDel().hashCode()); return result; } }
[ "2463663579@qq.com" ]
2463663579@qq.com
9c15aba80ee5f6ea7c2f8ff5901ec1a093fd7641
dae0d65652fdc751ffc53130b83ffb0e883306f1
/qqqq/src/b_operator/Test.java
29a1a6eee2c7d233798ecd0c5a854588ed609d46
[]
no_license
ohsewhang/hi
573f6cd808d791ab0fb3a53f1ce151582510d97d
5d32d21464397373cf8e681d6c4d76d055421bba
refs/heads/master
2020-09-28T09:44:59.264019
2019-12-24T08:26:45
2019-12-24T08:26:45
226,751,065
0
0
null
2019-12-09T00:33:06
2019-12-09T00:10:17
null
UHC
Java
false
false
1,321
java
/*논리식을 사용한 응용 *국 영 수 점수를 정수로 변수 저장 후, 총점과 평균을 계산해 적당한 변수에 저장. *세개의 점수 중 하나라도,40미만이 있으면 불합격 처리 *평균이 60미만이어도 불합격 처리를 하여 점수와 총점 평균 합격여부를 출력하시오 *출력예시 *----------- *합격여부통지 *----------- *국어 : 50 *영어 : 50 *수학 : 50 *결과 : 불합격 *----------- */ package b_operator; public class Test { Test(){ int kor=50, eng=50, ma=50; int tot= kor+eng+ma; double ava= (double) tot/3; boolean a = (kor>=40)&(eng>40)&(ma>40) & (tot>=60); //조건1과 조건2 동시충족 //boolean a = (kor<40)|(eng<40)|(ma<40) 40미만이면 불합 ,or String str=null; System.out.println("합격 여부 통지"); System.out.println("------------"); System.out.println("국어:"+kor); System.out.println("영어:"+eng); System.out.println("수학:"+ma); System.out.println("총점:"+tot); System.out.println("평균:"+ava); str = (a)?"합격":"불합격" ;//()안은 논리식. System.out.println( str + "==>" + a); System.out.println("------------"); } public static void main(String[] args) { new Test(); } }
[ "JHTA@JHTA-PC" ]
JHTA@JHTA-PC
a15511eb9dcd84aba546f170e9347b44befcdb6d
a94d20a6346d219c84cc97c9f7913f1ce6aba0f8
/saksbehandling/behandlingslager/domene/src/main/java/no/nav/foreldrepenger/behandlingslager/geografisk/SpråkKodeverkRepository.java
c7637fcfb2c1a551e2ee983e2623d5bd92419fa5
[ "MIT" ]
permissive
junnae/spsak
3c8a155a1bf24c30aec1f2a3470289538c9de086
ede4770de33bd896d62225a9617b713878d1efa5
refs/heads/master
2020-09-11T01:56:53.748986
2019-02-06T08:14:42
2019-02-06T08:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
package no.nav.foreldrepenger.behandlingslager.geografisk; import no.nav.foreldrepenger.behandlingslager.BehandlingslagerRepository; import java.util.Optional; public interface SpråkKodeverkRepository extends BehandlingslagerRepository { Optional<Språkkode> finnSpråkMedKodeverkEiersKode(String språkkode); }
[ "roy.andre.gundersen@nav.no" ]
roy.andre.gundersen@nav.no
caadbecdb66110e26048cb0bccef966aff9cf12d
dc2a2725ded8d3bca4afbd6af9d902d76e78630e
/core/src/main/java/la/xiong/androidquick/tool/immersion/StatusBarUtil.java
6169426ce32563204aabf8e86758bd991c713d28
[ "MIT", "Apache-2.0" ]
permissive
mxhp/AndroidQuick
664a56f118d879655d67e7f1cc4c0b22a58915bd
53cef28c2b0ecf2b67d79653afa18075987a5b48
refs/heads/master
2020-05-30T04:51:22.683511
2019-05-30T09:09:49
2019-05-30T09:09:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,068
java
package la.xiong.androidquick.tool.immersion; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Build; import android.support.annotation.IntDef; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.reflect.Field; import java.lang.reflect.Method; public class StatusBarUtil { public final static int TYPE_MIUI = 0; public final static int TYPE_FLYME = 1; public final static int TYPE_M = 3;//6.0 @IntDef({TYPE_MIUI, TYPE_FLYME, TYPE_M}) @Retention(RetentionPolicy.SOURCE) @interface ViewType { } /** * 修改状态栏颜色,支持4.4以上版本 * * @param colorId 颜色 */ public static void setStatusBarColor(Activity activity, int colorId) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { Window window = activity.getWindow(); window.setStatusBarColor(colorId); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { //使用SystemBarTintManager,需要先将状态栏设置为透明 setTranslucentStatus(activity); SystemBarTintManager systemBarTintManager = new SystemBarTintManager(activity); systemBarTintManager.setStatusBarTintEnabled(true);//显示状态栏 systemBarTintManager.setStatusBarTintColor(colorId);//设置状态栏颜色 } } /** * 设置状态栏透明 */ @TargetApi(19) public static void setTranslucentStatus(Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //5.x开始需要把颜色设置透明,否则导航栏会呈现系统默认的浅灰色 Window window = activity.getWindow(); View decorView = window.getDecorView(); //两个 flag 要结合使用,表示让应用的主体内容占用系统状态栏的空间 int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; decorView.setSystemUiVisibility(option); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setStatusBarColor(Color.TRANSPARENT); //导航栏颜色也可以正常设置 //window.setNavigationBarColor(Color.TRANSPARENT); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window window = activity.getWindow(); WindowManager.LayoutParams attributes = window.getAttributes(); int flagTranslucentStatus = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; attributes.flags |= flagTranslucentStatus; //int flagTranslucentNavigation = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; //attributes.flags |= flagTranslucentNavigation; window.setAttributes(attributes); } } /** * 代码实现android:fitsSystemWindows * * @param activity */ public static void setRootViewFitsSystemWindows(Activity activity, boolean fitSystemWindows) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { ViewGroup winContent = (ViewGroup) activity.findViewById(android.R.id.content); if (winContent.getChildCount() > 0) { ViewGroup rootView = (ViewGroup) winContent.getChildAt(0); if (rootView != null) { rootView.setFitsSystemWindows(fitSystemWindows); } } } } /** * 设置状态栏深色浅色切换 */ public static boolean setStatusBarDarkTheme(Activity activity, boolean dark) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { setStatusBarFontIconDark(activity, TYPE_M, dark); } else if (OSUtils.isMiui()) { setStatusBarFontIconDark(activity, TYPE_MIUI, dark); } else if (OSUtils.isFlyme()) { setStatusBarFontIconDark(activity, TYPE_FLYME, dark); } else {//其他情况 return false; } return true; } return false; } /** * 设置 状态栏深色浅色切换 */ public static boolean setStatusBarFontIconDark(Activity activity, @ViewType int type, boolean dark) { switch (type) { case TYPE_MIUI: return setMiuiUI(activity, dark); case TYPE_FLYME: return setFlymeUI(activity, dark); case TYPE_M: default: return setCommonUI(activity, dark); } } //设置6.0 状态栏深色浅色切换 public static boolean setCommonUI(Activity activity, boolean dark) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { View decorView = activity.getWindow().getDecorView(); if (decorView != null) { int vis = decorView.getSystemUiVisibility(); if (dark) { vis |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } else { vis &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; } if (decorView.getSystemUiVisibility() != vis) { decorView.setSystemUiVisibility(vis); } return true; } } return false; } //设置Flyme 状态栏深色浅色切换 public static boolean setFlymeUI(Activity activity, boolean dark) { try { Window window = activity.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); Field darkFlag = WindowManager.LayoutParams.class.getDeclaredField("MEIZU_FLAG_DARK_STATUS_BAR_ICON"); Field meizuFlags = WindowManager.LayoutParams.class.getDeclaredField("meizuFlags"); darkFlag.setAccessible(true); meizuFlags.setAccessible(true); int bit = darkFlag.getInt(null); int value = meizuFlags.getInt(lp); if (dark) { value |= bit; } else { value &= ~bit; } meizuFlags.setInt(lp, value); window.setAttributes(lp); return true; } catch (Exception e) { e.printStackTrace(); return false; } } //设置MIUI 状态栏深色浅色切换 public static boolean setMiuiUI(Activity activity, boolean dark) { try { Window window = activity.getWindow(); Class<?> clazz = activity.getWindow().getClass(); @SuppressLint("PrivateApi") Class<?> layoutParams = Class.forName("android.view.MiuiWindowManager$LayoutParams"); Field field = layoutParams.getField("EXTRA_FLAG_STATUS_BAR_DARK_MODE"); int darkModeFlag = field.getInt(layoutParams); Method extraFlagField = clazz.getDeclaredMethod("setExtraFlags", int.class, int.class); extraFlagField.setAccessible(true); if (dark) { //状态栏亮色且黑色字体. extraFlagField.invoke(window, darkModeFlag, darkModeFlag); } else { extraFlagField.invoke(window, 0, darkModeFlag); } return true; } catch (Exception e) { e.printStackTrace(); return false; } } //获取状态栏高度 public static int getStatusBarHeight(Context context) { int result = 0; int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = context.getResources().getDimensionPixelSize(resourceId); } return result; } }
[ "cage.hung@gmail.com" ]
cage.hung@gmail.com
69bcb34dfe84a0a75feaac08095c897686aa484e
6e1df840385c9e06a3d5b857f130b64dcf044a08
/app/src/main/java/com/alex/crazyalex/bookmarks/BookmarksPresenter.java
e2fa71a0e8785b175682848de81e1752f0392ae5
[]
no_license
a83071115/CrazyAlex
5495827f43dca95043abf08d07ba1316c68e427a
8ab67eb74750fe77e408eb763a6a7e563709cb37
refs/heads/master
2021-01-22T19:32:21.997839
2017-03-24T06:36:48
2017-03-24T06:36:48
85,215,223
0
0
null
null
null
null
UTF-8
Java
false
false
6,572
java
package com.alex.crazyalex.bookmarks; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.alex.crazyalex.adapter.BookmarsAdapter; import com.alex.crazyalex.bean.BeanType; import com.alex.crazyalex.bean.DoubanMomentNews; import com.alex.crazyalex.bean.GuokrHandpickNews; import com.alex.crazyalex.bean.ZhihuDailyNews; import com.alex.crazyalex.db.DatabaseHelper; import com.alex.crazyalex.detail.DetailActivity; import com.google.gson.Gson; import java.util.ArrayList; import java.util.Random; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_DOUBAN_NORMAL; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_DOUBAN_WITH_HEADER; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_GUOKR_NORMAL; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_GUOKR_WITH_HEADER; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_ZHIHU_NORMAL; import static com.alex.crazyalex.adapter.BookmarsAdapter.TYPE_ZHIHU_WITH_HEADER; /** * Created by Administrator on 2017/3/16. */ public class BookmarksPresenter implements BookmarksContract.Presenter { private Context mContext; private BookmarksContract.View mView; private Gson gson; private ArrayList<ZhihuDailyNews.Question> zhihuList; private ArrayList<GuokrHandpickNews.result> guokrList; private ArrayList<DoubanMomentNews.posts> doubanList; //给RecyclerView显示的数据 private ArrayList<Integer> type ; private DatabaseHelper dbHelper; private SQLiteDatabase db; public BookmarksPresenter(Context context, BookmarksContract.View view) { this.mContext = context; this.mView = view; gson = new Gson(); dbHelper = new DatabaseHelper(mContext,"History.db",null,5); db = dbHelper.getWritableDatabase(); this.mView.setPresenter(this); zhihuList = new ArrayList<>(); guokrList = new ArrayList<>(); doubanList = new ArrayList<>(); type = new ArrayList<>(); } @Override public void loadResults(boolean refresh) { if(!refresh){ mView.showLoading(); }else{ zhihuList.clear(); guokrList.clear(); doubanList.clear(); type.clear(); } checkForFreshData(); //将得到的list总长度 传递给adapter mView.showResults(zhihuList,guokrList,doubanList,type); mView.stopLoading(); } @Override public void startReading(BeanType type, int position) { Intent intent = new Intent(mContext, DetailActivity.class); switch (type){ case TYPE_ZHIHU: ZhihuDailyNews.Question q = zhihuList.get(position - 1); intent.putExtra("type",BeanType.TYPE_ZHIHU); intent.putExtra("id",q.getId()); intent.putExtra("title",q.getTitle()); intent.putExtra("coverUrl",q.getImages().get(0)); break; case TYPE_GUOKR: GuokrHandpickNews.result result = guokrList.get(position - 2 - zhihuList.size()); intent.putExtra("type",BeanType.TYPE_GUOKR); intent.putExtra("id",result.getId()); intent.putExtra("title",result.getTitle()); intent.putExtra("coverUrl",result.getHeadline_img()); break; case TYPE_DOUBAN: DoubanMomentNews.posts posts = doubanList.get(position - zhihuList.size() - guokrList.size() - 3); intent.putExtra("type",BeanType.TYPE_DOUBAN); intent.putExtra("id",posts.getId()); intent.putExtra("title",posts.getTitle()); if(posts.getThumbs().size() == 0){ intent.putExtra("coverUrl",""); }else{ intent.putExtra("coverUrl",posts.getThumbs().get(0).getMedium().getUrl()); } break; default: break; } mContext.startActivity(intent); } /** * 检查数据库是否有数据 * 然后将数据加载 * 将类型传给type显示的Adapter上 */ @Override public void checkForFreshData() { type.add(TYPE_ZHIHU_WITH_HEADER); //select * from Zhihu where bookmark = 1 ; Cursor cursor = db.rawQuery("select * from Zhihu where bookmark = ? ",new String[]{"1"} ); if(cursor.moveToFirst()){ do { ZhihuDailyNews.Question question = gson.fromJson(cursor.getString(cursor.getColumnIndex("zhihu_news")),ZhihuDailyNews.Question.class); zhihuList.add(question); type.add(TYPE_ZHIHU_NORMAL); }while (cursor.moveToNext()); } type.add(TYPE_GUOKR_WITH_HEADER); cursor = db.rawQuery("select * from Guokr where bookmark = ?" ,new String[]{"1"}); if(cursor.moveToFirst()){ do { GuokrHandpickNews.result result = gson.fromJson(cursor.getString(cursor.getColumnIndex("guokr_news")),GuokrHandpickNews.result.class); guokrList.add(result); type.add(TYPE_GUOKR_NORMAL); }while (cursor.moveToNext()); } type.add(TYPE_DOUBAN_WITH_HEADER); cursor = db.rawQuery("select * from Douban where bookmark = ? ", new String[]{"1"}); if(cursor.moveToFirst()){ do { DoubanMomentNews.posts posts = gson.fromJson(cursor.getString(cursor.getColumnIndex("douban_news")),DoubanMomentNews.posts.class); doubanList.add(posts); type.add(TYPE_DOUBAN_NORMAL); }while (cursor.moveToNext()); } cursor.close(); } @Override public void feelLucky() { Random random = new Random(); int p = random.nextInt(type.size()); while (true){ if(type.get(p)== BookmarsAdapter.TYPE_ZHIHU_NORMAL){ startReading(BeanType.TYPE_ZHIHU,p); break; } else if(type.get(p) == BookmarsAdapter.TYPE_GUOKR_NORMAL){ startReading(BeanType.TYPE_GUOKR,p); break; } else if (type.get(p) == BookmarsAdapter.TYPE_DOUBAN_NORMAL){ startReading(BeanType.TYPE_DOUBAN,p); break; } else { p = random.nextInt(type.size()); } } } @Override public void start() { } }
[ "you@example.com" ]
you@example.com
36f5b48c2201b705a89bcc7d967082661c02ef17
af96c6474835be2cc34ef21b0c2a45e950bb9148
/tests/FrameworkTest/tests/src/com/android/frameworktest/view/LongpressTest.java
37106f6327178d17b7e05bf0f2dc938f75e529a3
[ "Apache-2.0", "LicenseRef-scancode-unicode" ]
permissive
zsol/android_frameworks_base
86abe37fcd4136923cab2d6677e558826f087cf9
8d18426076382edaaea68392a0298d2c32cfa52e
refs/heads/donut
2021-07-04T17:24:05.847586
2010-01-13T19:24:55
2010-01-13T19:24:55
469,422
14
12
NOASSERTION
2020-10-01T18:05:31
2010-01-12T21:20:20
Java
UTF-8
Java
false
false
2,603
java
/* * Copyright (C) 2007 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.frameworktest.view; import com.android.frameworktest.view.Longpress; import com.android.frameworktest.R; import com.android.frameworktest.util.KeyUtils; import android.test.TouchUtils; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.MediumTest; import android.test.ActivityInstrumentationTestCase; import android.view.View; import android.view.View.OnLongClickListener; /** * Exercises {@link android.view.View}'s longpress plumbing. */ public class LongpressTest extends ActivityInstrumentationTestCase<Longpress> { private View mSimpleView; private boolean mLongClicked; public LongpressTest() { super("com.android.frameworktest", Longpress.class); } @Override public void setUp() throws Exception { super.setUp(); final Longpress a = getActivity(); mSimpleView = a.findViewById(R.id.simple_view); mSimpleView.setOnLongClickListener(new OnLongClickListener() { public boolean onLongClick(View v) { mLongClicked = true; return true; } }); } @Override protected void tearDown() throws Exception { super.tearDown(); mLongClicked = false; } @MediumTest public void testSetUpConditions() throws Exception { assertNotNull(mSimpleView); assertTrue(mSimpleView.hasFocus()); assertFalse(mLongClicked); } @LargeTest public void testKeypadLongClick() throws Exception { mSimpleView.requestFocus(); getInstrumentation().waitForIdleSync(); KeyUtils.longClick(this); getInstrumentation().waitForIdleSync(); assertTrue(mLongClicked); } @LargeTest public void testTouchLongClick() throws Exception { TouchUtils.longClickView(this, mSimpleView); getInstrumentation().waitForIdleSync(); assertTrue(mLongClicked); } }
[ "initial-contribution@android.com" ]
initial-contribution@android.com
7e99e94f49461362a1f55e2604d4949a1e7f6422
0ad5458bf9edd95d4c03d4b10d7f644022a59cd7
/src/main/java/ch/ethz/idsc/owl/bot/rice/Rice2GoalManager.java
31e68d7bea9b19585b3a3148adf11a72d455f8b0
[]
no_license
yangshuo11/owl
596e2e15ab7463944df0daecf34f1c74cb2806cc
9e8a917ab34d7283dc0cc3514689a6e7683d5e98
refs/heads/master
2020-04-05T08:44:51.622349
2018-10-29T05:56:00
2018-10-29T05:56:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,655
java
// code by jph package ch.ethz.idsc.owl.bot.rice; import java.util.List; import ch.ethz.idsc.owl.glc.adapter.StateTimeTrajectories; import ch.ethz.idsc.owl.glc.core.GlcNode; import ch.ethz.idsc.owl.glc.core.GoalInterface; import ch.ethz.idsc.owl.math.RadiusXY; import ch.ethz.idsc.owl.math.flow.Flow; import ch.ethz.idsc.owl.math.region.EllipsoidRegion; import ch.ethz.idsc.owl.math.state.SimpleTrajectoryRegionQuery; import ch.ethz.idsc.owl.math.state.StateTime; import ch.ethz.idsc.owl.math.state.TimeInvariantRegion; import ch.ethz.idsc.tensor.Scalar; import ch.ethz.idsc.tensor.Tensor; import ch.ethz.idsc.tensor.red.Norm; import ch.ethz.idsc.tensor.sca.Ramp; /* package */ class Rice2GoalManager extends SimpleTrajectoryRegionQuery implements GoalInterface { private final Tensor center; private final Scalar radius; // TODO implementation assumes max speed == 1 public Rice2GoalManager(EllipsoidRegion ellipsoidRegion) { super(new TimeInvariantRegion(ellipsoidRegion)); center = ellipsoidRegion.center(); this.radius = RadiusXY.requireSame(ellipsoidRegion.radius()); // x-y radius have to be equal } @Override // from CostIncrementFunction public Scalar costIncrement(GlcNode glcNode, List<StateTime> trajectory, Flow flow) { return StateTimeTrajectories.timeIncrement(glcNode, trajectory); } @Override // from HeuristicFunction public Scalar minCostToGoal(Tensor x) { Tensor pc = x.extract(0, 2); Tensor pd = center.extract(0, 2); Scalar mindist = Ramp.of(Norm._2.between(pc, pd).subtract(radius)); return mindist; // .divide(1 [m/s]), since max velocity == 1 => division is obsolete } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
e5e6d2a887fd02fb8225abd5a7c05525224f325a
d5fd8caccab2cc1bf9ffd70a8736a2d917f5f789
/app/src/main/java/megvii/testfacepass/pa/beans/WifiMsgBean.java
b00e2f8dedc81c042265331d5f148ecaf26fd1ca
[]
no_license
yoyo89757001/mianbanji_kuangshi_Standard
e8a6e0736608d46fa873e969f710947ad6a98a13
33c1af6a1856352a48410d4fec4acfbbc77654e1
refs/heads/master
2021-04-19T12:54:06.127684
2020-12-29T00:26:08
2020-12-29T00:26:08
249,605,549
0
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
package megvii.testfacepass.pa.beans; public class WifiMsgBean { private String ssId; //Wi-Fi名称,必传 private String pwd; //Wi-Fi密码,只允许数字、英文和英文字符;若Wi-Fi无密码,则传入空或者任意字符都可 private Boolean isDHCPMod; //是否设置为动态IP,必传。若传入false,则ip, // gateway,dns必传且不可为空;若传入true,则ip,gateway,dns无需传入,传入也不会生效 private String ip; //IP地址 private String gateway; //网关 private String dns; //DNS服务器 8 public String getSsId() { return ssId; } public void setSsId(String ssId) { this.ssId = ssId; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } public Boolean getDHCPMod() { return isDHCPMod; } public void setDHCPMod(Boolean DHCPMod) { isDHCPMod = DHCPMod; } public String getIp() { return ip; } public void setIp(String ip) { this.ip = ip; } public String getGateway() { return gateway; } public void setGateway(String gateway) { this.gateway = gateway; } public String getDns() { return dns; } public void setDns(String dns) { this.dns = dns; } }
[ "332663557@qq.com" ]
332663557@qq.com
4226dda5423faef9dbb1382e0d1c4285a4f45d78
e682fa3667adce9277ecdedb40d4d01a785b3912
/internal/fischer/mangf/A362153.java
af0d0893ea9450a920279bbfad9f32ca0b5c512a
[ "Apache-2.0" ]
permissive
gfis/joeis-lite
859158cb8fc3608febf39ba71ab5e72360b32cb4
7185a0b62d54735dc3d43d8fb5be677734f99101
refs/heads/master
2023-08-31T00:23:51.216295
2023-08-29T21:11:31
2023-08-29T21:11:31
179,938,034
4
1
Apache-2.0
2022-06-25T22:47:19
2019-04-07T08:35:01
Roff
UTF-8
Java
false
false
453
java
package irvine.oeis.a362; // Generated by gen_seq4.pl greprec3/holos at 2023-05-08 15:06 import irvine.oeis.recur.HolonomicRecurrence; /** * A362153 Number of skew shapes in a 3 X n rectangle with no empty rows or columns. * @author Georg Fischer */ public class A362153 extends HolonomicRecurrence { /** Construct the sequence. */ public A362153() { super(1, "[[0],[-12,20,-11,-8,-1],[36,-22,-7,4,1]]", "1,8,29,73,151,276,463", 0); } }
[ "dr.Georg.Fischer@gmail.com" ]
dr.Georg.Fischer@gmail.com
69611adf146be3617623c6f797c0ca29750cd75c
3799d4727c4f55fa727e56ece65f93ea60bd1854
/app/src/main/java/com/example/geek/myapplication/DialogDemoActivity.java
69559feb18517adc9761583e8c384e0edd467367
[]
no_license
wuguitong/MyApplication
5f17bd7b97e2bf3d23217d15d671e196eb925566
acfd955642a28b076e933746b2c217db77328d08
refs/heads/master
2020-06-19T01:40:52.886176
2018-08-10T07:02:49
2018-08-10T07:02:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package com.example.geek.myapplication; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import com.mingle.widget.ShapeLoadingDialog; public class DialogDemoActivity extends Activity { private ShapeLoadingDialog shapeLoadingDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dialog_demo); shapeLoadingDialog=new ShapeLoadingDialog(this); shapeLoadingDialog.setLoadingText("加载中..."); findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { shapeLoadingDialog.show(); } }); } @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_dialog_demo, 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); } }
[ "liangxiao6@live.com" ]
liangxiao6@live.com
b82c8a41e3190fef620886ded6b32817fb77f487
b6cb55c0dc6dd775805ff393b18daefa70c88c0f
/Express/src/kyle/leis/fs/cachecontainer/da/WorkbillkindColumns.java
0f78f84db8ea1974d1ef038f3203322ea7e61b9b
[]
no_license
haha541514/Express
d12ec127df2c6137792ef2724ac2239a27f0dd86
72e59fdea51fdba395f52575918ef1972e357cec
refs/heads/master
2021-04-03T06:50:28.984407
2018-03-08T09:04:09
2018-03-08T09:06:50
124,365,014
2
1
null
null
null
null
UTF-8
Java
false
false
1,117
java
package kyle.leis.fs.cachecontainer.da; import java.io.Serializable; import kyle.common.dbaccess.query.GeneralColumns; public class WorkbillkindColumns extends GeneralColumns implements Serializable { /** * */ private static final long serialVersionUID = -8265284628323765505L; public WorkbillkindColumns() { m_astrColumns = new String[3]; } public WorkbillkindColumns(String wbkWbkcode, String wbkWbkname, String wbkWbkename){ m_astrColumns = new String[3]; setWbkwbkcode(wbkWbkcode); setWbkwbkname(wbkWbkname); setWbkwbkename(wbkWbkename); } public void setWbkwbkcode(String wbkWbkcode) { this.setField(0, wbkWbkcode); } public String getWbkwbkcode() { return this.getField(0); } public void setWbkwbkname(String wbkWbkname) { this.setField(1, wbkWbkname); } public String getWbkwbkname() { return this.getField(1); } public void setWbkwbkename(String wbkWbkename) { this.setField(2, wbkWbkename); } public String getWbkwbkename() { return this.getField(2); } public String toString() { return "Code Generate By Kyle"; } }
[ "541514716@qq.com" ]
541514716@qq.com
25c4ccc0d246f97e36909576cbde4718043944ee
81f439118235d01d95bab022b3f9532531c3c696
/yycgutil/src/main/java/yycg/util/ValidateCodeServlet.java
b14cc6dd31a67f7482c958627300eb6d806e40be
[]
no_license
wtJavaer88/yycg
061a2288d5338dddddf49cb3e36a33216b74b3ab
b8db49fc636c3d9b048daf61717a852f1afd05fd
refs/heads/master
2021-01-19T01:00:47.982810
2016-07-01T03:14:11
2016-07-01T03:14:11
62,295,552
2
4
null
null
null
null
UTF-8
Java
false
false
4,568
java
package yycg.util; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.Random; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGImageEncoder; /** * 生成随机验证码 * */ public class ValidateCodeServlet extends HttpServlet { public static String VALIDATE_CODE = "validateCode"; private static final long serialVersionUID = 1L; // 验证码图片的宽度。 private int width = 60; // 验证码图片的高度。 private int height = 20; // 验证码字符个数 private int codeCount = 4; private int x = 0; // 字体高度 private int fontHeight; private int codeY; char[] codeSequence = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; // char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', // 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', // 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; /** * 初始化验证图片属性 */ public void init() throws ServletException { // 从web.xml中获取初始信息 // 宽度 String strWidth = this.getInitParameter("width"); // 高度 String strHeight = this.getInitParameter("height"); // 字符个数 String strCodeCount = this.getInitParameter("codeCount"); // 将配置的信息转换成数值 try { if (strWidth != null && strWidth.length() != 0) { width = Integer.parseInt(strWidth); } if (strHeight != null && strHeight.length() != 0) { height = Integer.parseInt(strHeight); } if (strCodeCount != null && strCodeCount.length() != 0) { codeCount = Integer.parseInt(strCodeCount); } } catch (NumberFormatException e) { } x = width / (codeCount + 1); fontHeight = height - 2; codeY = height - 4; } protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { // 定义图像buffer BufferedImage buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D g = buffImg.createGraphics(); // 创建一个随机数生成器类 Random random = new Random(); // 将图像填充为白色 g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); // 创建字体,字体的大小应该根据图片的高度来定。 Font font = new Font("Fixedsys", Font.PLAIN, fontHeight); // 设置字体。 g.setFont(font); // 画边框。 g.setColor(Color.BLACK); g.drawRect(0, 0, width - 1, height - 1); // 随机产生160条干扰线,使图象中的认证码不易被其它程序探测到。 g.setColor(Color.BLACK); // for (int i = 0; i < 3; i++) { // int x = random.nextInt(width); // int y = random.nextInt(height); // int xl = random.nextInt(12); // int yl = random.nextInt(12); // g.drawLine(x, y, x + xl, y + yl); // } // randomCode用于保存随机产生的验证码,以便用户登录后进行验证。 StringBuffer randomCode = new StringBuffer(); int red = 0, green = 0, blue = 0; // 随机产生codeCount数字的验证码。 for (int i = 0; i < codeCount; i++) { // 得到随机产生的验证码数字。 String strRand = String.valueOf(codeSequence[random.nextInt(codeSequence.length)]); // 产生随机的颜色分量来构造颜色值,这样输出的每位数字的颜色值都将不同。 //red = random.nextInt(255); //green = random.nextInt(255); //blue = random.nextInt(255); // 用随机产生的颜色将验证码绘制到图像中。 g.setColor(Color.BLACK); g.drawString(strRand, (i + 1) * x, codeY); // 将产生的四个随机数组合在一起。 randomCode.append(strRand); } // 将四位数字的验证码保存到Session中。 HttpSession session = req.getSession(); session.setAttribute(VALIDATE_CODE, randomCode.toString()); // 禁止图像缓存。 resp.setHeader("Pragma", "no-cache"); resp.setHeader("Cache-Control", "no-cache"); resp.setDateHeader("Expires", 0); resp.setContentType("image/jpeg"); // 将图像输出到Servlet输出流中。 // ServletOutputStream sos = resp.getOutputStream(); // ImageIO.write(buffImg, "jpeg", sos); // sos.close(); JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(resp.getOutputStream()); encoder.encode(buffImg); } }
[ "529801034@qq.com" ]
529801034@qq.com