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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
875496d4cdd1ab06a020dd78c1ef187403a406cd | 043703eaf27a0d5e6f02bf7a9ac03c0ce4b38d04 | /subject_systems/Struts2/src/struts-2.3.32/src/xwork-core/src/main/java/com/opensymphony/xwork2/util/location/LocationAttributes.java | 082b8fc2f8920b5684e685b2f39ece5d9b67d81c | [] | no_license | MarceloLaser/arcade_console_test_resources | e4fb5ac4a7b2d873aa9d843403569d9260d380e0 | 31447aabd735514650e6b2d1a3fbaf86e78242fc | refs/heads/master | 2020-09-22T08:00:42.216653 | 2019-12-01T21:51:05 | 2019-12-01T21:51:05 | 225,093,382 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 130 | java | version https://git-lfs.github.com/spec/v1
oid sha256:2a511b57564b37bad15a64488e94625cd07d822d9758d187ea55057f27e44727
size 14054
| [
"marcelo.laser@gmail.com"
] | marcelo.laser@gmail.com |
035007bc2e273f1b249d022c3d138685c9a82609 | b06acf556b750ac1fa5b28523db7188c05ead122 | /IfcModel/src/ifc2x3tc1/IfcRelAssociatesConstraint.java | a0c27252a64f22c2dfcf9db6b060b22c62ecd44d | [] | no_license | christianharrington/MDD | 3500afbe5e1b1d1a6f680254095bb8d5f63678ba | 64beecdaed65ac22b0047276c616c269913afd7f | refs/heads/master | 2021-01-10T21:42:53.686724 | 2012-12-17T03:27:05 | 2012-12-17T03:27:05 | 6,157,471 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,382 | java | /**
*/
package ifc2x3tc1;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Ifc Rel Associates Constraint</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link ifc2x3tc1.IfcRelAssociatesConstraint#getIntent <em>Intent</em>}</li>
* <li>{@link ifc2x3tc1.IfcRelAssociatesConstraint#getRelatingConstraint <em>Relating Constraint</em>}</li>
* </ul>
* </p>
*
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcRelAssociatesConstraint()
* @model
* @generated
*/
public interface IfcRelAssociatesConstraint extends IfcRelAssociates {
/**
* Returns the value of the '<em><b>Intent</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Intent</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Intent</em>' attribute.
* @see #setIntent(String)
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcRelAssociatesConstraint_Intent()
* @model
* @generated
*/
String getIntent();
/**
* Sets the value of the '{@link ifc2x3tc1.IfcRelAssociatesConstraint#getIntent <em>Intent</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Intent</em>' attribute.
* @see #getIntent()
* @generated
*/
void setIntent(String value);
/**
* Returns the value of the '<em><b>Relating Constraint</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Relating Constraint</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Relating Constraint</em>' reference.
* @see #setRelatingConstraint(IfcConstraint)
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcRelAssociatesConstraint_RelatingConstraint()
* @model
* @generated
*/
IfcConstraint getRelatingConstraint();
/**
* Sets the value of the '{@link ifc2x3tc1.IfcRelAssociatesConstraint#getRelatingConstraint <em>Relating Constraint</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Relating Constraint</em>' reference.
* @see #getRelatingConstraint()
* @generated
*/
void setRelatingConstraint(IfcConstraint value);
} // IfcRelAssociatesConstraint
| [
"t.didriksen@gmail.com"
] | t.didriksen@gmail.com |
bdfbdae9ac14b81a156bcc750437ebbb79a10c96 | fb83241bce8d6e500ae6b58363d0cae77529d973 | /src/com/reason/psi/ReasonMLFunBody.java | 31882c16c418c193f30bbce713fa133119dd608c | [
"MIT"
] | permissive | okonet/reasonml-idea-plugin | 37b93f2c8d57116851ca401608fdec9ad8252e20 | dc95e0051e31df68b7837b85726cbd61aede713e | refs/heads/master | 2023-08-25T18:53:48.989038 | 2017-09-14T07:14:30 | 2017-09-14T07:14:30 | 103,940,022 | 0 | 0 | null | 2017-09-18T13:04:31 | 2017-09-18T13:04:31 | null | UTF-8 | Java | false | false | 248 | java | package com.reason.psi;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.lang.ASTNode;
public class ReasonMLFunBody extends ASTWrapperPsiElement {
public ReasonMLFunBody(ASTNode node) {
super(node);
}
}
| [
"giraud.contact@yahoo.fr"
] | giraud.contact@yahoo.fr |
ec43816549e0820ff6b999653b5ae286139f5bb1 | e6640144038dab496e868d28e324c3c72aaa0840 | /src/main/数组/t31/NextPermutation.java | 6f7223e8a966b4b5af925abd381065c26caac57c | [] | no_license | sotowang/leetcode | f8de0530521eb864b07509ae45c5c916341b5f12 | 83970f766c95ea8dd84b187dd583ee1ac6ee330e | refs/heads/master | 2021-12-01T01:32:50.646299 | 2021-11-15T13:25:37 | 2021-11-15T13:25:37 | 207,312,983 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,789 | java | package 数组.t31;
import java.util.Arrays;
/**
* @auther: sotowang
* @date: 2019/12/03 21:01
*/
public class NextPermutation {
public void nextPermutation(int[] nums) {
if(nums == null || nums.length <= 1){
return;
}
//找最大的索引nums[k]<nums[k+1]
int k = -1;
for(int i=nums.length-1;i> 0;i--){
if(nums[i]>nums[i-1]){
k = i-1;
break;
}
}
//原数组为逆序排序,翻转数组
if(k == -1){
reverse(nums,0,nums.length-1);
return;
}
//找最大索引 nums[m]>nums[k]
int m = -1;
for(int i=nums.length-1;i>k;i--){
if(nums[i]>nums[k]){
m = i;
break;
}
}
swap(nums,k,m);
reverse(nums,k+1,nums.length-1);
}
private void reverse(int[] nums,int start,int end){
while(start<end){
swap(nums,start++,end--);
}
}
private void swap(int[] nums,int i,int j){
int tem = nums[i];
nums[i] = nums[j];
nums[j] = tem;
}
public static void main(String[] args) {
int[] nums3 = {
1
};
new NextPermutation().nextPermutation(nums3);
Arrays.stream(nums3).forEach(System.out::print);
System.out.println();
int[] nums1 = {
1, 2, 7, 4, 3, 1
};
new NextPermutation().nextPermutation(nums1);
Arrays.stream(nums1).forEach(System.out::print);
System.out.println();
int[] nums2 = {
1,2,3
};
new NextPermutation().nextPermutation(nums2);
Arrays.stream(nums2).forEach(System.out::print);
}
}
| [
"sotowang@qq.com"
] | sotowang@qq.com |
e3fb46f3fbaeda7bfeaddd39108f65fde3ca26e1 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE191_Integer_Underflow/CWE191_Integer_Underflow__byte_rand_multiply_75b.java | 84b3e0e40123b55ba40e248502a070f2c542c785 | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 6,072 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__byte_rand_multiply_75b.java
Label Definition File: CWE191_Integer_Underflow.label.xml
Template File: sources-sinks-75b.tmpl.java
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: rand Set data to result of rand()
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: multiply
* GoodSink: Ensure there will not be an underflow before multiplying data by 2
* BadSink : If data is negative, multiply by 2, which can cause an underflow
* Flow Variant: 75 Data flow: data passed in a serialized object from one method to another in different source files in the same package
*
* */
package testcases.CWE191_Integer_Underflow;
import testcasesupport.*;
import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
public class CWE191_Integer_Underflow__byte_rand_multiply_75b
{
public void bad_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
byte data = (Byte)in.readObject();
if(data < 0) /* ensure we won't have an overflow */
{
/* POTENTIAL FLAW: if (data * 2) < Byte.MIN_VALUE, this will underflow */
byte result = (byte)(data * 2);
IO.writeLine("result: " + result);
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
/* goodG2B() - use GoodSource and BadSink */
public void goodG2B_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
byte data = (Byte)in.readObject();
if(data < 0) /* ensure we won't have an overflow */
{
/* POTENTIAL FLAW: if (data * 2) < Byte.MIN_VALUE, this will underflow */
byte result = (byte)(data * 2);
IO.writeLine("result: " + result);
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
/* goodB2G() - use BadSource and GoodSink */
public void goodB2G_sink(byte[] data_serialized ) throws Throwable
{
// unserialize data
ByteArrayInputStream bais = null;
ObjectInputStream in = null;
try {
bais = new ByteArrayInputStream(data_serialized);
in = new ObjectInputStream(bais);
byte data = (Byte)in.readObject();
if(data < 0) /* ensure we won't have an overflow */
{
/* FIX: Add a check to prevent an underflow from occurring */
if (data > (Byte.MIN_VALUE/2))
{
byte result = (byte)(data * 2);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too small to perform multiplication.");
}
}
}
catch (IOException e)
{
IO.logger.log(Level.WARNING, "IOException in deserialization", e);
}
catch (ClassNotFoundException e)
{
IO.logger.log(Level.WARNING, "ClassNotFoundException in deserialization", e);
}
finally {
// clean up stream reading objects
try {
if (in != null)
{
in.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ObjectInputStream", ioe);
}
try {
if (bais != null)
{
bais.close();
}
}
catch (IOException ioe)
{
IO.logger.log(Level.WARNING, "Error closing ByteArrayInputStream", ioe);
}
}
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
7d8ebc205e503dcf671d096456ce0f5b393a8d5a | ffbf6ca8b1809179aa03dae3e2fa1b139a05ebc5 | /app/src/main/java/jc/sky/display/SKYIDisplay.java | 677416aa32480f8743f6b5d752e7527906c16c27 | [] | no_license | menteelin/sky | 29982fea6ee2dfaa1a51f17cd03eb62a873903b1 | f4fbccd06338cb11632af260963ac77062530144 | refs/heads/master | 2021-06-12T02:07:01.832571 | 2017-01-12T10:50:14 | 2017-01-12T10:50:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,876 | java | package jc.sky.display;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.AnimRes;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import jc.sky.core.Impl;
/**
* @author sky
* @version 版本
*/
@Impl(SKYDisplay.class)
public interface SKYIDisplay {
/**
* 获取上下文
*
* @return 返回值
*/
Context context();
/**
* @param <T>
* 参数
* @return 返回值
*/
<T extends FragmentActivity> T activity();
/**
* 跳转
*
* @param clazz
* 参数
* @param fragment
* 参数
* @param requestCode
* 参数
*/
void intentFromFragment(@NotNull Class clazz, @NotNull Fragment fragment, int requestCode);
/**
* 跳转
*
* @param intent
* 参数
* @param fragment
* 参数
* @param requestCode
* 参数
*/
void intentFromFragment(@NotNull Intent intent, @NotNull Fragment fragment, int requestCode);
/**
* home键
*/
void onKeyHome();
/**
*
*/
void popBackStack();
/**
* @param clazz
* 参数
*/
void popBackStack(@NotNull Class clazz);
/**
* @param clazzName
* 参数
*/
void popBackStack(@NotNull String clazzName);
/**
*
*/
void popBackStackAll();
/**
* @param fragment
* 参数
*/
void commitAdd(@NotNull Fragment fragment);
/**
* @param layoutId
* 参数
* @param fragment
* 参数
*/
void commitAdd(@IdRes int layoutId, @NotNull Fragment fragment);
/**
* @param fragment
* 参数
*/
void commitReplace(@NotNull Fragment fragment);
/**
* @param srcFragment
* 参数
* @param layoutId
* 参数
* @param fragment
* 参数
*/
void commitChildReplace(@NotNull Fragment srcFragment, @IdRes int layoutId, @NotNull Fragment fragment);
/**
* @param layoutId
* 参数
* @param fragment
* 参数
*/
void commitReplace(@IdRes int layoutId, @NotNull Fragment fragment);
/**
* @param fragment
* 参数
*/
void commitBackStack(@NotNull Fragment fragment);
/**
* @param srcFragment
* 参数
* @param fragment
* 参数
*/
void commitHideAndBackStack(@NotNull Fragment srcFragment, @NotNull Fragment fragment);
/**
* @param srcFragment
* 参数
* @param fragment
* 参数
*/
void commitDetachAndBackStack(@NotNull Fragment srcFragment, @NotNull Fragment fragment);
/**
* @param layoutId
* 参数
* @param fragment
* 参数
*/
void commitBackStack(@IdRes int layoutId, @NotNull Fragment fragment);
/**
* @param layoutId
* 参数
* @param fragment
* 参数
* @param animation
* 参数
*/
void commitBackStack(@IdRes int layoutId, @NotNull Fragment fragment, int animation);
/**
* 跳转intent
*
* @param clazz
* 参数
**/
void intent(@NotNull Class clazz);
/**
* @param clazzName
* 参数
*/
void intent(@NotNull String clazzName);
/**
* @param clazz
* 参数
*/
void intentNotAnimation(@NotNull Class clazz);
/**
* @param clazz
* 参数
* @param bundle
* 参数
*/
void intent(@NotNull Class clazz, Bundle bundle);
/**
* @param clazz
* 参数
* @param bundle
* 参数
*/
void intentNotAnimation(@NotNull Class clazz, @NotNull Bundle bundle);
/**
* @param intent
* 参数
*/
void intent(@NotNull Intent intent);
/**
* @param intent
* 参数
* @param options
* 参数
*/
void intent(@NotNull Intent intent, @NotNull Bundle options);
/**
* @param clazz
* 参数
* @param requestCode
* 参数
*/
void intentForResult(@NotNull Class clazz, int requestCode);
/**
* @param clazz
* 参数
* @param bundle
* 参数
* @param requestCode
* 参数
* @param fragment
* 参数
*/
void intentForResultFromFragment(@NotNull Class clazz, Bundle bundle, int requestCode, @NotNull Fragment fragment);
/**
* @param clazz
* 参数
* @param bundle
* 参数
* @param requestCode
* 参数
*/
void intentForResult(@NotNull Class clazz, @NotNull Bundle bundle, int requestCode);
/**
* @param intent
* 参数
* @param requestCod
* 参数
*/
void intentForResult(@NotNull Intent intent, int requestCod);
/**
* @param intent
* 参数
* @param options
* 参数
* @param requestCode
* 参数
*/
void intentForResult(@NotNull Intent intent, @NotNull Bundle options, int requestCode);
/**
* @param clazz
* 参数
* @param view
* 参数
* @param bundle
* 参数
*/
void intentAnimation(@NotNull Class clazz, @NotNull View view, Bundle bundle);
/**
* @param clazz
* 参数
* @param in
* 参数
* @param out
* 参数
*/
void intentAnimation(@NotNull Class clazz, @AnimRes int in, @AnimRes int out);
/**
* @param clazz
* 参数
* @param in
* 参数
* @param out
* 参数
* @param bundle
* 参数
*/
void intentAnimation(@NotNull Class clazz, @AnimRes int in, @AnimRes int out, @NonNull Bundle bundle);
/**
* @param clazz
* 参数
* @param view
* 参数
* @param requestCode
* 参数
*/
void intentForResultAnimation(@NotNull Class clazz, @NotNull View view, int requestCode);
/**
* @param clazz
* 参数
* @param view
* 参数
* @param bundle
* 参数
* @param requestCode
* 参数
*/
void intentForResultAnimation(@NotNull Class clazz, @NotNull View view, @NotNull Bundle bundle, int requestCode);
/**
* @param clazz
* 参数
* @param in
* 参数
* @param out
* 参数
* @param requestCode
* 参数
*/
void intentForResultAnimation(@NotNull Class clazz, @AnimRes int in, @AnimRes int out, int requestCode);
/**
* @param clazz
* 参数
* @param in
* 参数
* @param out
* 参数
* @param bundle
* 参数
* @param requestCode
* 参数
*/
void intentForResultAnimation(@NotNull Class clazz, @AnimRes int in, @AnimRes int out, @NonNull Bundle bundle, int requestCode);
} | [
"jincan0213@hotmail.com"
] | jincan0213@hotmail.com |
0dd49cc2f22be5e6660d8c5f33a0da8171067f44 | dcb92070b51f63ac3716b0709a7207109a0aee73 | /Nanifarfalla/src/main/java/nanifarfalla/app/repository/PrivilegeRepository.java | 33c1bbb85d1d5f521aa9ef2f9368b3e6236d5838 | [] | no_license | joffrehermosilla/NanifarfallaApp | 5a3f3a5d75e7ce3a2ba20d255147c0087a276f5b | 9efae6d187cd4558ab2a3f167406eb4dd988e779 | refs/heads/master | 2023-01-07T12:40:43.139563 | 2023-01-02T00:26:18 | 2023-01-02T00:26:18 | 248,025,245 | 2 | 1 | null | 2022-12-16T15:50:04 | 2020-03-17T16:56:21 | Java | UTF-8 | Java | false | false | 372 | java | package nanifarfalla.app.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import nanifarfalla.app.model.Privilege;
@Repository
public interface PrivilegeRepository extends JpaRepository<Privilege, Integer> {
Privilege findByName(String name);
@Override
void delete(Privilege privilege);
}
| [
"joffre.hermosilla@gmail.com"
] | joffre.hermosilla@gmail.com |
7c73504e68bbe4dcc651ad63d4290fb1b47eb05e | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/branches/1.9.5-SNAPSHOT-spring/extension/other/databinding/fabric3-databinding-json/src/main/java/org/fabric3/databinding/json/transform/Object2StringJsonTransformer.java | 5fbc9fc454c41c4ae66c4be593e1816cf8aa6e83 | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,703 | java | /*
* Fabric3
* Copyright (c) 2009-2012 Metaform Systems
*
* Fabric3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version, with the
* following exception:
*
* Linking this software statically or dynamically with other
* modules is making a combined work based on this software.
* Thus, the terms and conditions of the GNU General Public
* License cover the whole combination.
*
* As a special exception, the copyright holders of this software
* give you permission to link this software with independent
* modules to produce an executable, regardless of the license
* terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided
* that you also meet, for each linked independent module, the
* terms and conditions of the license of that module. An
* independent module is a module which is not derived from or
* based on this software. If you modify this software, you may
* extend this exception to your version of the software, but
* you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* Fabric3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the
* GNU General Public License along with Fabric3.
* If not, see <http://www.gnu.org/licenses/>.
*
* --- Original Apache License ---
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.fabric3.databinding.json.transform;
import java.io.IOException;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.fabric3.spi.transform.TransformationException;
import org.fabric3.spi.transform.Transformer;
/**
* Transforms a Java object to a serialized JSON String.
*
* @version $Rev: 7714 $ $Date: 2009-09-29 10:24:45 +0200 (Tue, 29 Sep 2009) $
*/
public class Object2StringJsonTransformer implements Transformer<Object, String> {
private ObjectMapper mapper;
public Object2StringJsonTransformer(ObjectMapper mapper) {
this.mapper = mapper;
}
public String transform(Object source, ClassLoader loader) throws TransformationException {
try {
return mapper.writeValueAsString(source);
} catch (JsonMappingException e) {
throw new TransformationException(e);
} catch (JsonParseException e) {
throw new TransformationException(e);
} catch (IOException e) {
throw new TransformationException(e);
}
}
} | [
"palmalcheg@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | palmalcheg@83866bfc-822f-0410-aa35-bd5043b85eaf |
a2777944d434278f71750fb730d7abdef0a84bab | 4d38f89105f30d5aed3f6da303c4fa8c3ce9e724 | /ServerCore/src/main/java/com/db/server/transactions/MyJpaTransactionManager.java | 0724bd13409b48406814eacfac3b20e12af559d7 | [] | no_license | tymiles003/DroneServer | 9c4a6ee5418bfc36e60de73f2b311d3fba0e15f2 | b1ad3f92cedc07fedec659c4823423f60f034b40 | refs/heads/master | 2021-09-22T16:32:43.324858 | 2018-03-10T19:14:48 | 2018-03-10T19:15:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,464 | java | package com.db.server.transactions;
import org.apache.log4j.Logger;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.support.DefaultTransactionStatus;
import java.util.Map;
public class MyJpaTransactionManager extends JpaTransactionManager {
private final static Logger LOGGER = Logger.getLogger(MyJpaTransactionManager.class);
static int itr;
public MyJpaTransactionManager() {
itr++;
// LOGGER.debug("Creation " + itr);
}
@Override
public Map<String, Object> getJpaPropertyMap() {
Map<String, Object> mapper = super.getJpaPropertyMap();
for (Map.Entry<String, Object> entry : mapper.entrySet()) {
LOGGER.debug("-> " + entry.getKey() + " " + entry.getValue());
}
return mapper;
}
@Override
protected void doBegin(Object transaction, TransactionDefinition definition) {
LOGGER.error("DoBegin " + transaction + " " + definition);
super.doBegin(transaction, definition);
}
@Override
protected void doCommit(DefaultTransactionStatus status) {
LOGGER.error("DoCommit " + status);
// getJpaPropertyMap();
super.doCommit(status);
}
@Override
protected void doRollback(DefaultTransactionStatus status) {
// LOGGER.debug("DoRollback " + status);
super.doRollback(status);
}
}
| [
"taljmars@gmail.com"
] | taljmars@gmail.com |
d0dad1170641e033ec881cd2a43e16513e505471 | e8f7a323c46dd047460d9db5a899d1917f0dd332 | /jbpm-designer-vdml/jbpm-designer-vdml-backend/src/test/java/org/jbpm/designer/vdlib/VdmlLibraryDiagramGenerationTest.java | 14c07de863cae7f0d0f3029a390b790540da63e5 | [] | no_license | ifu-lobuntu/jbpm-designer-extensions | cc1e67366ea23bf4b7129730c502868a5f5e2035 | 8166cb1064b4e830d04346381f441a2e9830219d | refs/heads/master | 2020-12-21T21:02:46.439177 | 2016-08-07T07:38:16 | 2016-08-07T07:38:16 | 31,703,967 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,120 | java | package org.jbpm.designer.vdlib;
import static org.junit.Assert.*;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.Class;
import org.jbpm.designer.extensions.diagram.Diagram;
import org.jbpm.designer.ucd.AbstractClassDiagramProfileImpl;
import org.jbpm.designer.vdml.VdmlUmlHelper;
import org.junit.Test;
import org.omg.vdml.*;
public class VdmlLibraryDiagramGenerationTest extends AbstractVdmlLibraryDiagramTest {
@SuppressWarnings("unused")
@Test
public void testIt() throws Exception {
Class clss = addCarrierClass("MyBusinessItemDefinition");
BusinessItemDefinition def = VdmlUmlHelper.createBusinessDefinition(clss, vdm.getBusinessItemLibrary().get(0));
def.setIsFungible(false);
def.setIsShareable(true);
Property characteristicDef = UMLFactory.eINSTANCE.createProperty();
characteristicDef.setName(characteristic.getName());
characteristicDef.createEAnnotation(VdmlLibraryStencil.VDLIB_URI).getReferences().add(characteristic);
clss.getOwnedAttributes().add(characteristicDef);
def.getCharacteristicDefinition().add(characteristic);
characteristicDef.setType(AbstractClassDiagramProfileImpl.getCmmnTypes(resourceSet).getOwnedType("Double"));
Class clss2 = addCarrierClass("CapabilityDefinition");
CapabilityDefinition cd = VdmlUmlHelper.createCapabilityDefinition(clss2, vdm.getCapabilitylibrary().get(0));
Class clss3 = addCarrierClass("CapabilityCategory");
CapabilityCategory cc = VdmlUmlHelper.createCapabilityCategory(clss3, vdm.getCapabilitylibrary().get(0));
saveCollaborationResource();
Diagram json = super.unmarshaller.convert(inputResource);
assertNotNull( json.findChildShapeById(collaborationResource.getID(characteristicDef)));
assertNotNull( json.findChildShapeById(collaborationResource.getID(clss)));
assertNotNull( json.findChildShapeById(collaborationResource.getID(clss2)));
assertNotNull( json.findChildShapeById(collaborationResource.getID(clss3)));
}
}
| [
"ampieb@gmail.com"
] | ampieb@gmail.com |
44147507d9d4517f51fe916913d273b3e3f2a96f | dccb8ce0e4c507ae1bc396d66749b660e2ad38d5 | /net/minecraft/block/BlockEnchantmentTable.java | e8700a4c459966bb6ccd86e56b2e9c7f29c1631f | [] | no_license | Saxalinproject/Java_Mod_Effections_Set | 27cb3116a548295ff70c8585c4c802392e370f44 | 1799f11d74ecff594e1742a94df1ddc926be38a6 | refs/heads/master | 2020-04-08T22:10:29.373716 | 2013-11-04T13:33:01 | 2013-11-04T13:33:01 | 14,109,890 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,348 | java | package net.minecraft.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityEnchantmentTable;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
public class BlockEnchantmentTable extends BlockContainer
{
@SideOnly(Side.CLIENT)
private Icon field_94461_a;
@SideOnly(Side.CLIENT)
private Icon field_94460_b;
protected BlockEnchantmentTable(int par1)
{
super(par1, Material.rock);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
this.setLightOpacity(0);
this.setCreativeTab(CreativeTabs.tabDecorations);
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
@SideOnly(Side.CLIENT)
/**
* A randomly called display update to be able to add particles or other items for display
*/
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
for (int l = par2 - 2; l <= par2 + 2; ++l)
{
for (int i1 = par4 - 2; i1 <= par4 + 2; ++i1)
{
if (l > par2 - 2 && l < par2 + 2 && i1 == par4 - 1)
{
i1 = par4 + 2;
}
if (par5Random.nextInt(16) == 0)
{
for (int j1 = par3; j1 <= par3 + 1; ++j1)
{
if (par1World.getBlockId(l, j1, i1) == Block.bookShelf.blockID)
{
if (!par1World.isAirBlock((l - par2) / 2 + par2, j1, (i1 - par4) / 2 + par4))
{
break;
}
par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(l - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(j1 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(i1 - par4) + par5Random.nextFloat()) - 0.5D);
}
}
}
}
}
}
/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
@SideOnly(Side.CLIENT)
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
*/
public Icon getIcon(int par1, int par2)
{
return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon);
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity(World par1World)
{
return new TileEntityEnchantmentTable();
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par1World.isRemote)
{
return true;
}
else
{
TileEntityEnchantmentTable tileentityenchantmenttable = (TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4);
par5EntityPlayer.displayGUIEnchantment(par2, par3, par4, tileentityenchantmenttable.func_94135_b() ? tileentityenchantmenttable.func_94133_a() : null);
return true;
}
}
/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
{
super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack);
if (par6ItemStack.hasDisplayName())
{
((TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName());
}
}
@SideOnly(Side.CLIENT)
/**
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
* is the only chance you get to register icons.
*/
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon(this.func_111023_E() + "_" + "side");
this.field_94461_a = par1IconRegister.registerIcon(this.func_111023_E() + "_" + "top");
this.field_94460_b = par1IconRegister.registerIcon(this.func_111023_E() + "_" + "bottom");
}
}
| [
"pein-t-m@mail.ru"
] | pein-t-m@mail.ru |
47dcc3c41a6d781d6b75727d499d72a19d046a6a | 684300b2a57ce3418a13e3f9a4717640044b1ee4 | /app/src/main/java/com/xxzlkj/huayiyanglao/adapter/MessageAdapter.java | 0a7fc38e092f9e95b2e351c8cebf24bd1aa948c7 | [] | no_license | leifeng1991/HYYL | 524d12466dca04d72c946ec6c38f3970b998a880 | 18354d4998ed4f0c27ce7e22d6941b238cb09537 | refs/heads/master | 2020-04-25T03:12:44.782366 | 2019-02-25T08:46:08 | 2019-02-25T08:46:08 | 172,467,651 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,780 | java | package com.xxzlkj.huayiyanglao.adapter;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.xxzlkj.huayiyanglao.R;
import com.xxzlkj.huayiyanglao.config.ZLConstants;
import com.xxzlkj.huayiyanglao.util.RongYunUtils;
import com.xxzlkj.huayiyanglao.util.ZLUserUtils;
import com.xxzlkj.huayiyanglao.weight.ShapeButton;
import com.xxzlkj.zhaolinshare.base.base.BaseAdapter;
import com.xxzlkj.zhaolinshare.base.base.BaseViewHolder;
import com.xxzlkj.zhaolinshare.base.model.User;
import com.xxzlkj.zhaolinshare.base.util.PicassoUtils;
import com.xxzlkj.zhaolinshare.base.util.UserUtils;
import com.xxzlkj.zhaolinshare.chat.TimeUtils;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.MessageContent;
import io.rong.message.ImageMessage;
import io.rong.message.LocationMessage;
import io.rong.message.TextMessage;
import io.rong.message.VoiceMessage;
/**
* 描述:
*
* @author zhangrq
* 2017/9/20 11:25
*/
public class MessageAdapter extends BaseAdapter<Conversation> {
public MessageAdapter(Context context, int itemId) {
super(context, itemId);
}
@Override
public void convert(BaseViewHolder holder, int position, Conversation itemBean) {
ImageView mImage = holder.getView(R.id.id_message_image);// 头像
ShapeButton mUnreadMessageCount = holder.getView(R.id.id_unread_message);// 未读消息数量
TextView mTitle = holder.getView(R.id.id_title);// 标题
ShapeButton mRedCircle = holder.getView(R.id.id_red_circle);// 红点
TextView mTime = holder.getView(R.id.id_time);// 时间
TextView mContent = holder.getView(R.id.id_content);// 内容
// 设置头像、用户名
// 设置默认值
mImage.setImageDrawable(null);// 头像
mTitle.setText("");// 用户名
String rongYunTargetId = itemBean.getTargetId();
ZLUserUtils.getUserInfo(UserUtils.getUserID(rongYunTargetId, false), new ZLUserUtils.OnGetUserInfoListener() {
@Override
public void onSuccess(User bean) {
PicassoUtils.setImageSmall(mContext, bean.getData().getSimg(), mImage);// 头像
mTitle.setText(bean.getData().getUsername());// 用户名
}
@Override
public void onError(int errorCode, String errorMessage) {
}
});
// 设置时间
mTime.setText(TimeUtils.getMsgFormatTime(itemBean.getSentTime()));// 时间
// 设置内容
MessageContent latestMessage = itemBean.getLatestMessage();
if (latestMessage instanceof TextMessage) {
// 文本
String content = ((TextMessage) latestMessage).getContent();
mContent.setText(content);// 内容
} else if (latestMessage instanceof VoiceMessage) {
// 声音
mContent.setText("[语音]");// 内容
} else if (latestMessage instanceof ImageMessage) {
// 图片
mContent.setText("[图片]");// 内容
} else if (latestMessage instanceof LocationMessage) {
// 位置
mContent.setText("[位置]");// 内容
}
// 设置消息提示
// 设置默认值
mRedCircle.setVisibility(View.GONE);
mUnreadMessageCount.setVisibility(View.GONE);
RongYunUtils.getUnreadCount(Conversation.ConversationType.PRIVATE, rongYunTargetId, new RongIMClient.ResultCallback<Integer>() {
@Override
public void onSuccess(Integer integer) {
// 1000:系统消息;1001互动消息
if (ZLConstants.Strings.INTERACTIVE_MESSAGE_ID.equals(rongYunTargetId) || ZLConstants.Strings.SYSTEM_MESSAGE_ID.equals(rongYunTargetId)) {
// 特殊的用户
mUnreadMessageCount.setVisibility(View.GONE);
mRedCircle.setVisibility(integer > 0 ? View.VISIBLE : View.GONE);
} else {
// 普通的用户
mRedCircle.setVisibility(View.GONE);
if (integer > 0) {
mUnreadMessageCount.setVisibility(View.VISIBLE);
mUnreadMessageCount.setText(integer > 99 ? "99+" : String.valueOf(integer));
} else {
mUnreadMessageCount.setVisibility(View.GONE);
}
}
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
mRedCircle.setVisibility(View.GONE);
mUnreadMessageCount.setVisibility(View.GONE);
}
});
}
}
| [
"15036833790@163.com"
] | 15036833790@163.com |
57bfb82d71255a28a8ef554883257da3a69b7575 | abdd09b2c14eb56f8902ce264b018e1efac971f2 | /src/main/java/com/epmserver/gateway/security/UserNotActivatedException.java | 52ba6e91bf333b93135febee2d2a68ef1b79a2b6 | [] | no_license | thetlwinoo/epm-gateway | e9494594344dff8dc3bf3d26a0f3c5027962eb14 | c612ae8d7c382045b2960de259c856f16527a7fc | refs/heads/master | 2022-12-24T14:16:40.723688 | 2019-11-22T09:54:42 | 2019-11-22T09:54:42 | 217,490,624 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | package com.epmserver.gateway.security;
import org.springframework.security.core.AuthenticationException;
/**
* This exception is thrown in case of a not activated user trying to authenticate.
*/
public class UserNotActivatedException extends AuthenticationException {
private static final long serialVersionUID = 1L;
public UserNotActivatedException(String message) {
super(message);
}
public UserNotActivatedException(String message, Throwable t) {
super(message, t);
}
}
| [
"thetlwinoo85@yahoo.com"
] | thetlwinoo85@yahoo.com |
850e62217a8751f7544e950d80a4fbb1c5582f55 | f543462dbbb6d59f5cb0c8caee9e25dfbde9e3c5 | /springboot-rabbitmq/rabbitmq-producer/src/main/java/cn/lovingliu/rabbitmqproducer/service/impl/OrderServiceImpl.java | 5dfdc9b503d66453590e0dc52924b055760771ae | [] | no_license | LovingLiuMeMe/springboot-study | 5929e8e15bb99a218f3e773d9e28998b73e7f2bc | 572c9d2a105b5e1fe13208489846c53a4f359a0f | refs/heads/master | 2022-07-05T03:30:05.363237 | 2019-10-15T16:26:14 | 2019-10-15T16:26:14 | 214,101,307 | 0 | 0 | null | 2022-06-17T02:33:30 | 2019-10-10T06:12:46 | Java | UTF-8 | Java | false | false | 1,810 | java | package cn.lovingliu.rabbitmqproducer.service.impl;
import cn.lovingliu.rabbitmqproducer.constant.Constants;
import cn.lovingliu.rabbitmqproducer.dao.MessageLogMapper;
import cn.lovingliu.rabbitmqproducer.dao.OrderMapper;
import cn.lovingliu.rabbitmqproducer.domain.MessageLog;
import cn.lovingliu.rabbitmqproducer.domain.Order;
import cn.lovingliu.rabbitmqproducer.producer.RabbitOrderSender;
import cn.lovingliu.rabbitmqproducer.service.OrderService;
import cn.lovingliu.rabbitmqproducer.utils.DateUtils;
import cn.lovingliu.rabbitmqproducer.utils.FastJsonConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* @Author:LovingLiu
* @Description:
* @Date:Created in 2019-09-24
*/
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderMapper orderMapper;
@Autowired
private MessageLogMapper messageLogMapper;
@Autowired
private RabbitOrderSender rabbitOrderSender;
public void createOrder(Order order) throws Exception {
// 插入消息记录表数据
MessageLog messageLog = new MessageLog();
// 消息唯一ID
messageLog.setMessageId(order.getMessageId());
// 保存消息整体 转为JSON 格式存储入库
messageLog.setMessage(FastJsonConvertUtil.convertObjectToJSON(order));
// 设置消息状态为0 表示发送中
messageLog.setStatus("0");
// 设置消息未确认超时时间窗口为 一分钟
Date orderTime = new Date();
messageLog.setNextRetry(DateUtils.addMinutes(orderTime, Constants.ORDER_TIMEOUT));
messageLogMapper.insertSelective(messageLog);
// 发送消息
rabbitOrderSender.sendOrder(order);
}
}
| [
"cmds12345678@163.com"
] | cmds12345678@163.com |
639489565cf040baa7b5bfaa0fb417730d7af004 | addbc404a75281f8ad0d42889ffe507b72a2471e | /Day20190624/src/kr/co/bit/SeoulChina.java | 9e947b6aded02bbaf3e1e46b254b6dcdb7c0409a | [] | no_license | yongje93/bitcamp | 81df3b0d954e57752243ecc339ccb92447d71561 | 16f105c4cd6baa5b876291b2504338b6acfb2938 | refs/heads/master | 2020-06-07T17:57:26.427322 | 2019-10-05T12:27:31 | 2019-10-05T12:27:31 | 193,066,923 | 1 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 533 | java | package kr.co.bit;
public class SeoulChina extends China {
protected int jengban; // Àï¹ÝÂ¥Àå
public SeoulChina() {
super();
}
public SeoulChina(int jajang, int jampong, int tang, int jengban) {
super(jajang, jampong, tang);
this.jengban = jengban;
}
public int getJengban() {
return jengban;
}
public void setJengban(int jengban) {
this.jengban = jengban;
}
@Override
public String toString() {
return super.toString() + "SeoulChina [jengban=" + jengban + "]";
}
}
| [
"48149636+yongje93@users.noreply.github.com"
] | 48149636+yongje93@users.noreply.github.com |
877a983603a4de2e4b478a595594e8cbd7f47dfd | cd8843d24154202f92eaf7d6986d05a7266dea05 | /saaf-base-5.0/3001_saaf-equotation-model/src/main/java/com/sie/watsons/base/pon/information/model/entities/readonly/EquPonQuotationAppReleEntity_HI_RO.java | 4e1828cb72ea3f4525893828ee825155a5df21fd | [] | no_license | lingxiaoti/tta_system | fbc46c7efc4d408b08b0ebb58b55d2ad1450438f | b475293644bfabba9aeecfc5bd6353a87e8663eb | refs/heads/master | 2023-03-02T04:24:42.081665 | 2021-02-07T06:48:02 | 2021-02-07T06:48:02 | 336,717,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,654 | java | package com.sie.watsons.base.pon.information.model.entities.readonly;
import com.alibaba.fastjson.annotation.JSONField;
import java.util.Date;
/**
* EquPonQuotationAppReleEntity_HI_RO Entity Object
* Sun Oct 27 23:10:43 CST 2019 Auto Generate
*/
public class EquPonQuotationAppReleEntity_HI_RO {
private Integer approvalRele;
private Integer supplierId;
private String supplierNumber;
private Integer quotationId;
private String supplierName;
private String quotationNumber;
private String projectNumber;
private Integer createdBy;
private Integer lastUpdatedBy;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date creationDate;
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date lastUpdateDate;
private Integer lastUpdateLogin;
private String attribute1;
private String attribute2;
private String attribute3;
private String attribute4;
private String attribute5;
private String attribute6;
private String attribute7;
private String attribute8;
private String attribute9;
private String attribute10;
private Integer operatorUserId;
public void setApprovalRele(Integer approvalRele) {
this.approvalRele = approvalRele;
}
public Integer getApprovalRele() {
return approvalRele;
}
public void setSupplierId(Integer supplierId) {
this.supplierId = supplierId;
}
public Integer getSupplierId() {
return supplierId;
}
public void setSupplierNumber(String supplierNumber) {
this.supplierNumber = supplierNumber;
}
public String getSupplierNumber() {
return supplierNumber;
}
public void setQuotationId(Integer quotationId) {
this.quotationId = quotationId;
}
public Integer getQuotationId() {
return quotationId;
}
public void setQuotationNumber(String quotationNumber) {
this.quotationNumber = quotationNumber;
}
public String getProjectNumber() {
return projectNumber;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getCreationDate() {
return creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
public void setProjectNumber(String projectNumber) {
this.projectNumber = projectNumber;
}
public String getQuotationNumber() {
return quotationNumber;
}
public void setCreatedBy(Integer createdBy) {
this.createdBy = createdBy;
}
public Integer getCreatedBy() {
return createdBy;
}
public void setLastUpdatedBy(Integer lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
public Integer getLastUpdatedBy() {
return lastUpdatedBy;
}
public void setLastUpdateDate(Date lastUpdateDate) {
this.lastUpdateDate = lastUpdateDate;
}
public Date getLastUpdateDate() {
return lastUpdateDate;
}
public void setLastUpdateLogin(Integer lastUpdateLogin) {
this.lastUpdateLogin = lastUpdateLogin;
}
public Integer getLastUpdateLogin() {
return lastUpdateLogin;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute6(String attribute6) {
this.attribute6 = attribute6;
}
public String getAttribute6() {
return attribute6;
}
public void setAttribute7(String attribute7) {
this.attribute7 = attribute7;
}
public String getAttribute7() {
return attribute7;
}
public void setAttribute8(String attribute8) {
this.attribute8 = attribute8;
}
public String getAttribute8() {
return attribute8;
}
public void setAttribute9(String attribute9) {
this.attribute9 = attribute9;
}
public String getAttribute9() {
return attribute9;
}
public void setAttribute10(String attribute10) {
this.attribute10 = attribute10;
}
public String getAttribute10() {
return attribute10;
}
public void setOperatorUserId(Integer operatorUserId) {
this.operatorUserId = operatorUserId;
}
public Integer getOperatorUserId() {
return operatorUserId;
}
}
| [
"huang491591@qq.com"
] | huang491591@qq.com |
39227d281c9dc38058629c56a6e7b26273cfc49a | 1fea56d2dcb3b495f63c17ad1ebc61b81e44e7b6 | /uidemo/src/main/java/com/angcyo/uidemo/uiview3/view/DialogLoginView.java | c73b1af5f9f6edb355c61c96fb8f4f349e2a72a1 | [] | no_license | angcyo/UIView | 3ce12f69afdc636330ddd11f30dc093b370ea57d | dad0711554232380d72f326feb9c25cd05711a7f | refs/heads/master | 2022-06-30T15:27:10.313257 | 2022-06-19T12:08:09 | 2022-06-19T12:08:09 | 72,760,800 | 7 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,524 | java | package com.angcyo.uidemo.uiview3.view;
import android.support.annotation.NonNull;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.angcyo.library.utils.L;
import com.angcyo.uidemo.R;
import com.angcyo.uidemo.RApp;
import com.angcyo.uidemo.uiview3.login.Login;
import com.angcyo.uidemo.uiview3.login.LoginPresenterImpl;
import com.angcyo.uiview.base.UIIDialogImpl;
import com.angcyo.uiview.utils.T;
/**
* Copyright (C) 2016,深圳市红鸟网络科技股份有限公司 All rights reserved.
* 项目名称:
* 类的描述:
* 创建人员:Robi
* 创建时间:2016/12/02 11:05
* 修改人员:Robi
* 修改时间:2016/12/02 11:05
* 修改备注:
* Version: 1.0.0
*/
public class DialogLoginView extends UIIDialogImpl implements Login.ILoginView {
private static long index = 0;
TextView mPhoneView;
TextView mPasswordView;
private Login.ILoginPresenter mLoginPresenter;
@Override
protected View inflateDialogView(FrameLayout dialogRootLayout, LayoutInflater inflater) {
return inflate(R.layout.view_dialog_login_layout);
}
@Override
public void loadContentView(View rootView) {
super.loadContentView(rootView);
mPhoneView = v(R.id.phone_view);
mPasswordView = v(R.id.password_view);
mLoginPresenter = new LoginPresenterImpl();
mLoginPresenter.bindView(this);
click(R.id.login_button, new View.OnClickListener() {
@Override
public void onClick(View v) {
onLoginButton();
}
});
}
public void onLoginButton() {
T.show(mActivity, "登录");
mLoginPresenter.startLogin(mPhoneView.getText().toString(), mPasswordView.getText().toString(), "phone", RApp.getIMEI());
}
@Override
public void onStartLoad() {
}
@Override
public void onFinishLoad() {
}
@Override
public int getGravity() {
int i = (int) (index % 3);
index++;
if (i == 0) {
return Gravity.TOP;
}
if (i == 1) {
return Gravity.CENTER;
}
return Gravity.BOTTOM;
}
@Override
public void onSuccess() {
L.w("");
T.show(mActivity, "登录成功");
}
@Override
public void onError(int code, @NonNull String msg) {
L.w("");
T.show(mActivity, "登录失败:" + msg);
}
}
| [
"angcyo@126.com"
] | angcyo@126.com |
b1875fd722c5cbe089e04dfc7c4b53a97665547e | 4694d36492acad39b6464d153e4d3d3ad47c5c57 | /adcom/adcatal.lib/src/main/java/org/adorsys/adcatal/jpa/CatalArtFeatMapping.java | eed7062de0f09a7e4cbad87130a00ca47eb4b617 | [
"Apache-2.0"
] | permissive | francis-pouatcha/adcom | 36ac7ff33eabb351be78b5555c61498b7bc3de6f | 0e3ea1ce6c2045d31c7003fc87dbda533c09c767 | refs/heads/master | 2021-03-27T20:31:45.315016 | 2015-06-29T09:32:06 | 2015-06-29T09:32:06 | 28,821,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,330 | java | package org.adorsys.adcatal.jpa;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
import org.adorsys.javaext.description.Description;
import org.apache.commons.lang3.StringUtils;
@Entity
@Description("CatalArtFeatMapping_description")
public class CatalArtFeatMapping extends CatalAbstractFeatMapping {
private static final long serialVersionUID = -6409127372502988751L;
@Column
@Description("CatalArtFeatMapping_artIdentif_description")
@NotNull
private String artIdentif;
@Column
@Description("CatalArtFeatMapping_artName_description")
private String artName;
public String getArtIdentif() {
return this.artIdentif;
}
public void setArtIdentif(final String artIdentif) {
this.artIdentif = artIdentif;
}
public String getArtName() {
return this.artName;
}
public void setArtName(final String artName) {
this.artName = artName;
}
@Override
protected String makeIdentif() {
return toIdentif(artIdentif, getLangIso2());
}
public static String toIdentif(String artIdentif, String langIso2){
return artIdentif + "_" + langIso2;
}
public static boolean hasData(CatalArtFeatMapping obj){
return CatalAbstractFeatMapping.hasData(obj) &&
StringUtils.isBlank(obj.artName) &&
StringUtils.isBlank(obj.artIdentif);
}
} | [
"francis.pouatcha@adorsys.com"
] | francis.pouatcha@adorsys.com |
51bca85294ebaeb8d21335a43f20479aba78b0ec | a76173ed4bf17a215c84113edfdefd4005f49b90 | /src/main/java/uk/gov/legislation/namespaces/metadata/ConfersPower.java | d9f803c93d46d2e9b06f7dc1ecebbd1548a90ec0 | [
"MIT"
] | permissive | AleksiAleksiev/java-legislation-gov-uk-library | 160f4de29174ab9417e6083eea20a8d1e4bdfb8b | 9cb3eaad6a3847060ea781c74b6260f025309cc4 | refs/heads/master | 2021-05-30T04:50:40.081714 | 2016-01-13T12:36:52 | 2016-01-13T12:36:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,210 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.07 at 06:17:52 PM CEST
//
package uk.gov.legislation.namespaces.metadata;
import javax.xml.bind.annotation.*;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="IdURI" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "ConfersPower")
public class ConfersPower {
@XmlAttribute(name = "IdURI", required = true)
@XmlSchemaType(name = "anyURI")
protected String idURI;
@XmlAttribute(name = "title")
protected String title;
/**
* Gets the value of the idURI property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getIdURI() {
return idURI;
}
/**
* Sets the value of the idURI property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setIdURI(String value) {
this.idURI = value;
}
/**
* Gets the value of the title property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTitle() {
return title;
}
/**
* Sets the value of the title property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTitle(String value) {
this.title = value;
}
}
| [
"m.f.a.trompper@uva.nl"
] | m.f.a.trompper@uva.nl |
acfdd36b50bba034fedfef461cf054f7a2abcbd1 | 25baed098f88fc0fa22d051ccc8027aa1834a52b | /src/main/java/com/ljh/daoMz/MrmbaseMzDictMapper.java | 43646823e39df97eea56a2d3514eb062ad2122e7 | [] | no_license | woai555/ljh | a5015444082f2f39d58fb3e38260a6d61a89af9f | 17cf8f4415c9ae7d9fedae46cd9e9d0d3ce536f9 | refs/heads/master | 2022-07-11T06:52:07.620091 | 2022-01-05T06:51:27 | 2022-01-05T06:51:27 | 132,585,637 | 0 | 0 | null | 2022-06-17T03:29:19 | 2018-05-08T09:25:32 | Java | UTF-8 | Java | false | false | 299 | java | package com.ljh.daoMz;
import com.ljh.bean.MrmbaseMzDict;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 门急诊病历首页字典 Mapper 接口
* </p>
*
* @author ljh
* @since 2020-10-26
*/
public interface MrmbaseMzDictMapper extends BaseMapper<MrmbaseMzDict> {
}
| [
"37681193+woai555@users.noreply.github.com"
] | 37681193+woai555@users.noreply.github.com |
913ed0ec16bfde83809d461ad82f36671e5385a7 | 94f0d2df8f777071d1b6e84c4ab1f809eb801e2a | /javademospringmvc/src/main/java/com/example/javademospringmvc/JavademospringmvcApplication.java | b87c95c7287941f7188e35807c6c1882a2c94bdd | [] | no_license | quang10a10hda9x9o/sdfdsf | 13b5a4b76fb9d2007308be2c48c2a939fcfa3fca | 368b6caa2f962bffc60937baddc2fede216b2f31 | refs/heads/master | 2021-01-04T16:31:42.163474 | 2020-02-15T03:16:09 | 2020-02-15T03:16:09 | 240,637,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package com.example.javademospringmvc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class JavademospringmvcApplication {
public static void main(String[] args) {
SpringApplication.run(JavademospringmvcApplication.class, args);
}
}
| [
"="
] | = |
21873ae36bcb117ec2fd1771911a41b701d32353 | a41124812bd0e040176119f2a2d410be8e73bfab | /app/src/main/java/com/example/androidremark/ui/recycler/LineItemDecoration.java | b39a7146e71f7679a4f896dae81a707ef0e589d2 | [] | no_license | caobin821651400/Study | 3e8a548890e2841363dbe2c051046f8830d08568 | c997046aa88b435902332b76dc1ba0a3fc62d7db | refs/heads/master | 2021-04-12T04:24:26.945134 | 2020-11-29T08:13:31 | 2020-11-29T08:13:31 | 125,950,448 | 30 | 11 | null | null | null | null | UTF-8 | Java | false | false | 1,960 | java | package com.example.androidremark.ui.recycler;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.example.androidremark.utils.MyUtils;
/**
* Created by caobin on 2017/9/8.
*/
public class LineItemDecoration extends RecyclerView.ItemDecoration {
private float mDividerHeight;//分割线的高度
private Paint mPaint;
private Context mContext;
public LineItemDecoration(Context mContext) {
this.mContext = mContext;
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.RED);
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
if (parent.getChildAdapterPosition(view) != 0) {
outRect.top = MyUtils.dp2px(mContext, 10);
mDividerHeight = MyUtils.dp2px(mContext, 10);
}
}
@Override
public void onDraw(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
super.onDraw(canvas, parent, state);
//遍历所有可见的item
int itemCount = parent.getChildCount();
for (int i = 0; i < itemCount; i++) {
View view = parent.getChildAt(i);
int index = parent.getChildAdapterPosition(view);
//第一行不需要绘制
if (index == 0) {
continue;
}
float dividerLeft = view.getPaddingLeft();
float dividerTop = view.getTop() - mDividerHeight;
float dividerRight = parent.getWidth() - view.getPaddingRight();
float dividerBottom = view.getTop();
canvas.drawRect(dividerLeft, dividerTop, dividerRight, dividerBottom, mPaint);
}
}
}
| [
"12345678"
] | 12345678 |
15a2113e5754c42585a425c3555c2444195e4053 | e1dbbd1c0289059bcc7426e30ab41c88221eff11 | /modules/cae/contentbeans/src/main/java/com/coremedia/blueprint/common/util/Flatless.java | bed3de00d8b1b532bb94af7342cf69f490dc4d6c | [] | no_license | HongBitgrip/blueprint | 9ed278a8df33dbe7ec2de7489592f704e408d897 | 14c4de20defd2918817f91174bdbdcc0b9541e2d | refs/heads/master | 2020-03-25T23:15:24.580400 | 2018-08-17T14:44:43 | 2018-08-17T14:44:43 | 144,267,625 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | package com.coremedia.blueprint.common.util;
/**
* Marker interface to be applied to all {@link com.coremedia.blueprint.common.layout.Container}s
* that should not be flattened by {@link ContainerFlattener}
*/
public interface Flatless {
}
| [
"hong.nguyen@bitgrip.de"
] | hong.nguyen@bitgrip.de |
c9d5429ad5019d9e2e3a7beb82317464c852ef94 | cdc4c07cc87c88ccca9585a40a3600ce92c5e147 | /ssia-ch11-ex1-s2/src/main/java/uk/me/uohiro/ssia/authentication/providers/OtpAuthenticationProvider.java | 041e2b43084e5b3aadec08b061afd4451c53f8b3 | [] | no_license | osakanaya/Spring-Security-in-Action | ec587d617092747bb7f347161d3115bc6b14c3f3 | 968af23e16d7469216777c0924c259f6bbea716d | refs/heads/main | 2023-03-14T12:52:55.367766 | 2021-03-08T14:01:57 | 2021-03-08T14:01:57 | 345,674,746 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,309 | java | package uk.me.uohiro.ssia.authentication.providers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
import uk.me.uohiro.ssia.authentication.OtpAuthentication;
import uk.me.uohiro.ssia.authentication.proxy.AuthenticationServerProxy;
@Component
public class OtpAuthenticationProvider implements AuthenticationProvider {
@Autowired
private AuthenticationServerProxy proxy;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
String username = authentication.getName();
String code = String.valueOf(authentication.getCredentials());
boolean result = proxy.sendOTP(username, code);
if (result) {
return new OtpAuthentication(username, code);
} else {
throw new BadCredentialsException("Bad credentials");
}
}
@Override
public boolean supports(Class<?> authentication) {
return OtpAuthentication.class.isAssignableFrom(authentication);
}
}
| [
"sashida@primagest.co.jp"
] | sashida@primagest.co.jp |
dc919c6788312148bc840f432c903394494a2e37 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project86/src/test/java/org/gradle/test/performance86_2/Test86_135.java | db75360dbf93bcbbb07f490b7457c5e64428433e | [] | 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 | 292 | java | package org.gradle.test.performance86_2;
import static org.junit.Assert.*;
public class Test86_135 {
private final Production86_135 production = new Production86_135("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
29cf6ec5f26afb2769b3dcc25edc27f9d6c46fe1 | de752b1dab1d9ed20c44e30ffa1ff887b868d2b0 | /ac/auth-center-resource-starter/src/main/java/com/gapache/security/holder/InheritableThreadLocalAccessCardHolderStrategy.java | ac17d48f340e63c4558bf820d7c918782135a59f | [] | no_license | KeKeKuKi/IACAA30 | 33fc99ba3f1343240fe3fafe82bee01339273b80 | 6f3f6091b2ca6dd92f22b1697c0fbfc7b9b7d371 | refs/heads/main | 2023-04-07T21:18:49.105964 | 2021-04-08T08:41:57 | 2021-04-08T08:41:57 | 352,832,814 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.gapache.security.holder;
import com.gapache.security.interfaces.AccessCardHolderStrategy;
import com.gapache.security.model.AccessCard;
import org.springframework.util.Assert;
/**
* @author HuSen
* @since 2020/8/9 6:18 下午
*/
public class InheritableThreadLocalAccessCardHolderStrategy implements AccessCardHolderStrategy {
private static final ThreadLocal<AccessCard> CONTEXT_HOLDER = new InheritableThreadLocal<>();
@Override
public void clearContext() {
CONTEXT_HOLDER.remove();
}
@Override
public AccessCard getContext() {
AccessCard ctx = CONTEXT_HOLDER.get();
if (ctx == null) {
ctx = createEmptyContext();
CONTEXT_HOLDER.set(ctx);
}
return ctx;
}
@Override
public void setContext(AccessCard context) {
Assert.notNull(context, "Only non-null AccessCard instances are permitted");
CONTEXT_HOLDER.set(context);
}
@Override
public AccessCard createEmptyContext() {
return AccessCard.createEmpty();
}
}
| [
"2669918628@qq.com"
] | 2669918628@qq.com |
b453e7464a92e1383599f8fe44e49242e4eaff11 | e3d40e994a7d5456f470f11e8ccaeb911f7a51ed | /src/main/java/edu/swufe/nxksecdisk/server/controller/ErrorController.java | d24bb59407a3be7281db5b21c0f7a1478adfd1ec | [] | no_license | loongyowl/NxkSecDisk | 9259db6794e0f7c128a62462b3e01fa9a4750819 | ee4c68002af4d024abdcfb814cb9b5ecdc010760 | refs/heads/master | 2023-04-18T20:01:18.186586 | 2021-05-01T07:28:38 | 2021-05-01T07:28:38 | 463,920,702 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 911 | java | package edu.swufe.nxksecdisk.server.controller;
import edu.swufe.nxksecdisk.server.util.FileBlockUtil;
import edu.swufe.nxksecdisk.server.util.LogUtil;
import edu.swufe.nxksecdisk.system.AppSystem;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import javax.annotation.Resource;
/**
* @author Administrator
*/
@ControllerAdvice
public class ErrorController {
@Resource
private FileBlockUtil fileBlockUtil;
@Resource
private LogUtil logUtil;
@ExceptionHandler({Exception.class})
public void handleException(final Exception e) {
this.logUtil.writeException(e);
this.fileBlockUtil.checkFileBlocks();
e.printStackTrace();
AppSystem.out.printf("处理请求时发生错误:\n\r------信息------\n\r%s\n\r------信息------",
e.getMessage());
}
}
| [
"hlrongzun@qq.com"
] | hlrongzun@qq.com |
79616b360cecc727bb9d18f0e3ea514fee64cd02 | d476bcc063f663d06ea29e52ffe4f8c5ac0762f4 | /mavcom/src/main/java/org/mavlink/messages/MAV_SENSOR_ORIENTATION.java | d1d0c0a3999a8132874cb954593257cc2c93a7b5 | [] | no_license | Stevesies/mavcom | 1d80dd623cd1f543ef4f8dc46a8fb0c6f84783cf | b0cd1b921016658dafae2b4936b898c665784421 | refs/heads/master | 2023-01-23T05:57:10.648842 | 2020-11-30T08:53:20 | 2020-11-30T08:53:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,355 | java | /**
* Generated class : MAV_SENSOR_ORIENTATION
* DO NOT MODIFY!
**/
package org.mavlink.messages;
/**
* Interface MAV_SENSOR_ORIENTATION
* Enumeration of sensor orientation, according to its rotations
**/
public interface MAV_SENSOR_ORIENTATION {
/**
* Roll: 0, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_NONE = 0;
/**
* Roll: 0, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_YAW_45 = 1;
/**
* Roll: 0, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_YAW_90 = 2;
/**
* Roll: 0, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_YAW_135 = 3;
/**
* Roll: 0, Pitch: 0, Yaw: 180
*/
public final static int MAV_SENSOR_ROTATION_YAW_180 = 4;
/**
* Roll: 0, Pitch: 0, Yaw: 225
*/
public final static int MAV_SENSOR_ROTATION_YAW_225 = 5;
/**
* Roll: 0, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_YAW_270 = 6;
/**
* Roll: 0, Pitch: 0, Yaw: 315
*/
public final static int MAV_SENSOR_ROTATION_YAW_315 = 7;
/**
* Roll: 180, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180 = 8;
/**
* Roll: 180, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9;
/**
* Roll: 180, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10;
/**
* Roll: 180, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11;
/**
* Roll: 0, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180 = 12;
/**
* Roll: 180, Pitch: 0, Yaw: 225
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13;
/**
* Roll: 180, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14;
/**
* Roll: 180, Pitch: 0, Yaw: 315
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15;
/**
* Roll: 90, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90 = 16;
/**
* Roll: 90, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17;
/**
* Roll: 90, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18;
/**
* Roll: 90, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19;
/**
* Roll: 270, Pitch: 0, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270 = 20;
/**
* Roll: 270, Pitch: 0, Yaw: 45
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21;
/**
* Roll: 270, Pitch: 0, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22;
/**
* Roll: 270, Pitch: 0, Yaw: 135
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23;
/**
* Roll: 0, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_90 = 24;
/**
* Roll: 0, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_PITCH_270 = 25;
/**
* Roll: 0, Pitch: 180, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26;
/**
* Roll: 0, Pitch: 180, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27;
/**
* Roll: 90, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28;
/**
* Roll: 180, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29;
/**
* Roll: 270, Pitch: 90, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30;
/**
* Roll: 90, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31;
/**
* Roll: 270, Pitch: 180, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32;
/**
* Roll: 90, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33;
/**
* Roll: 180, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34;
/**
* Roll: 270, Pitch: 270, Yaw: 0
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35;
/**
* Roll: 90, Pitch: 180, Yaw: 90
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36;
/**
* Roll: 90, Pitch: 0, Yaw: 270
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37;
/**
* Roll: 90, Pitch: 68, Yaw: 293
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38;
/**
* Pitch: 315
*/
public final static int MAV_SENSOR_ROTATION_PITCH_315 = 39;
/**
* Roll: 90, Pitch: 315
*/
public final static int MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40;
/**
* Roll: 270, Yaw: 180
*/
public final static int MAV_SENSOR_ROTATION_ROLL_270_YAW_180 = 41;
/**
* Custom orientation
*/
public final static int MAV_SENSOR_ROTATION_CUSTOM = 100;
}
| [
"ecm@gmx.de"
] | ecm@gmx.de |
14a9d04a131365bbf54cc7824de33d2968b3aa75 | e51c210ccf72a8ac1414791d8af552662c3fb034 | /passerelle-core/com.isencia.passerelle.runtime.jmx/src/main/java/com/isencia/passerelle/runtime/jmx/ProcessHandleBean.java | 39b9e578e38869d064ffeccf4eb2d304f0370264 | [] | no_license | eclipselabs/passerelle | 0187efa4fba411265ab58d60b5d83e74af09b203 | e327dea8f4188e4bfe5ef4a76dd2476ad6f5664d | refs/heads/master | 2021-01-18T09:26:07.614275 | 2017-06-28T10:05:12 | 2017-06-28T10:05:12 | 36,805,342 | 5 | 3 | null | 2015-08-04T18:43:19 | 2015-06-03T13:27:15 | Java | UTF-8 | Java | false | false | 2,119 | java | /* Copyright 2013 - iSencia Belgium NV
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.isencia.passerelle.runtime.jmx;
import java.beans.ConstructorProperties;
import java.util.Arrays;
import com.isencia.passerelle.runtime.ProcessHandle;
public class ProcessHandleBean {
private String processContextId;
private String status;
private FlowHandleBean flow;
private String[] suspendedElements;
public final static ProcessHandleBean buildProcessHandleBean(ProcessHandle processHandle) {
return new ProcessHandleBean(processHandle.getProcessId(),
processHandle.getExecutionStatus().name(),
FlowHandleBean.buildCompactFlowHandleBean(processHandle.getFlowHandle()),
processHandle.getSuspendedElements());
}
@ConstructorProperties({"processContextId","status","flow","suspendedElements"})
public ProcessHandleBean(String processContextId, String status, FlowHandleBean flow, String[] suspendedElements) {
this.processContextId = processContextId;
this.status = status;
this.flow = flow;
this.suspendedElements = suspendedElements;
}
public String getProcessContextId() {
return processContextId;
}
public String getStatus() {
return status;
}
public FlowHandleBean getFlow() {
return flow;
}
public String[] getSuspendedElements() {
return suspendedElements;
}
@Override
public String toString() {
return "ProcessHandleBean [processContextId=" + processContextId + ", status=" + status + ", flow=" + flow + ", suspendedElements="
+ Arrays.toString(suspendedElements) + "]";
}
}
| [
"erwindl0@gmail.com"
] | erwindl0@gmail.com |
c1c2c63857f9adf63c0d61b65c7a871f45bdf07c | 7b12f67da8c10785efaebe313547a15543a39c77 | /jjg-common-db/src/main/java/com/jjg/member/model/enums/CustomCachePrefix.java | af4ff83991abe4f94eecc374100a6e7e7000c0d1 | [] | no_license | liujinguo1994/xdl-jjg | 071eaa5a8fb566db6b47dbe046daf85dd2b9bcd8 | 051da0a0dba18e6e5021ecb4ef3debca16b01a93 | refs/heads/master | 2023-01-06T09:11:30.487559 | 2020-11-06T14:42:45 | 2020-11-06T14:42:45 | 299,525,315 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.jjg.member.model.enums;
public enum CustomCachePrefix {
/**
* 店铺自定义分类
*/
CUSTOM_CAT;
public String getPrefix() {
return this.name() + "_";
}
}
| [
"344009799@qq.com"
] | 344009799@qq.com |
d84116d2ebb5a3259e2bc4cf3150487b3c7fc810 | 24d8cf871b092b2d60fc85d5320e1bc761a7cbe2 | /PMD/rev5929-6010/base-branch-5929/src/net/sourceforge/pmd/rules/ExcessiveImports.java | 37341c70f7229e370bb09925cf4ade0920655511 | [] | no_license | joliebig/featurehouse_fstmerge_examples | af1b963537839d13e834f829cf51f8ad5e6ffe76 | 1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad | refs/heads/master | 2016-09-05T10:24:50.974902 | 2013-03-28T16:28:47 | 2013-03-28T16:28:47 | 9,080,611 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 517 | java |
package net.sourceforge.pmd.rules;
import net.sourceforge.pmd.ast.ASTCompilationUnit;
import net.sourceforge.pmd.ast.ASTImportDeclaration;
import net.sourceforge.pmd.rules.design.ExcessiveNodeCountRule;
import net.sourceforge.pmd.util.NumericConstants;
public class ExcessiveImports extends ExcessiveNodeCountRule {
public ExcessiveImports() {
super(ASTCompilationUnit.class);
}
public Object visit(ASTImportDeclaration node, Object data) {
return NumericConstants.ONE;
}
}
| [
"joliebig@fim.uni-passau.de"
] | joliebig@fim.uni-passau.de |
7e0579926dc87307e566a96bfe4c8358fec53dbf | 935d938ff7af87884bdc99f78fb6d533c4db3958 | /src/main/java/com/redis/example/demo/file/MappedFileTest.java | 67d8db960f75de7ecfa20945e01d29656d677620 | [] | no_license | 1303110335/java-all | 52b34099e53ec1d65a976c70105494ff07a42e09 | d70ee5a362f2abdbfa06d3079022c95134d8d7ad | refs/heads/master | 2023-07-16T12:38:57.608790 | 2021-08-25T02:12:09 | 2021-08-25T02:12:09 | 298,726,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,211 | java | /**
* bianque.com
* Copyright (C) 2013-2020 All Rights Reserved.
*/
package com.redis.example.demo.file;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Scanner;
/**
*
* @author xuleyan
* @version MappedFileTest.java, v 0.1 2020-11-22 9:05 下午
*/
public class MappedFileTest {
public static void main(String[] args) {
File file = new File("target/threads/test.txt");
long len = file.length();
byte[] ds = new byte[(int) len];
try {
MappedByteBuffer mappedByteBuffer = new RandomAccessFile(file, "r")
.getChannel()
.map(FileChannel.MapMode.READ_ONLY, 0, len);
for (int offset = 0; offset < len; offset++) {
byte b = mappedByteBuffer.get();
ds[offset] = b;
}
Scanner scan = new Scanner(new ByteArrayInputStream(ds)).useDelimiter(" ");
while (scan.hasNext()) {
System.out.print(scan.next() + " ");
}
} catch (IOException e) {}
}
} | [
"1303110335@qq.com"
] | 1303110335@qq.com |
8a6e9b327c76cdb789b5b34a8bc56c26d38ec2d7 | e369d9879042675c259345e9d83c99fabb27de64 | /seckill/src/main/java/com/bansi/oauth/SalesforceExample.java | 20f5b96b8ee7b1c44fd1b0538205c8947725cd29 | [] | no_license | zbansi/intretech_netsuite | 609d59949a36e080841a5341812005df414a79d6 | 17d56760fd8b920a378e373c4ab021877ece7315 | refs/heads/master | 2021-06-26T00:31:19.500230 | 2019-06-06T01:59:49 | 2019-06-06T01:59:49 | 154,297,224 | 0 | 0 | null | 2020-10-13T10:51:34 | 2018-10-23T09:06:33 | Java | UTF-8 | Java | false | false | 4,437 | java | package com.bansi.oauth;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Scanner;
import com.github.scribejava.apis.SalesforceApi;
import com.github.scribejava.apis.salesforce.SalesforceToken;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth2AccessToken;
import com.github.scribejava.core.model.OAuthRequest;
import com.github.scribejava.core.model.Response;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth.OAuth20Service;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.ExecutionException;
public class SalesforceExample {
private static final String NETWORK_NAME = "Salesforce";
private SalesforceExample() {
}
public static void main(String... args) throws IOException, NoSuchAlgorithmException, KeyManagementException,
InterruptedException, ExecutionException {
// Replace these with your client id and secret
final String clientId = "your client id";
final String clientSecret = "your client secret";
//IT's important! Salesforce upper require TLS v1.1 or 1.2.
//They are enabled in Java 8 by default, but not in Java 7
SalesforceApi.initTLSv11orUpper();
// The below used ServiceBuilder connects to login.salesforce.com
// (production environment).
//
// When you plan to connect to a Sandbox environment you've to use SalesforceApi.sandbox() API instance
// new ServiceBuilder.....build(SalesforceApi.sandbox());
final OAuth20Service service = new ServiceBuilder(clientId)
.apiSecret(clientSecret)
.callback("https://www.example.com/callback")
.build(SalesforceApi.instance());
System.out.println("=== " + NETWORK_NAME + "'s OAuth20 Workflow ===");
System.out.println();
// Obtain the Authorization URL
System.out.println("Fetching the Authorization URL...");
final String authorizationUrl = service.getAuthorizationUrl();
System.out.println("Got the Authorization URL!");
System.out.println("Now go and authorize ScribeJava here:");
System.out.println(authorizationUrl);
System.out.println("And paste the authorization code here");
System.out.print(">>");
final String code;
try (Scanner in = new Scanner(System.in)) {
code = in.nextLine();
}
System.out.println();
// The code needs to be URL decoded
final String codeEncoded = URLDecoder.decode(code, "UTF-8");
// Trade the Request Token and Verifier for the Access Token
System.out.println("Trading the Request Token for an Access Token...");
final OAuth2AccessToken accessToken = service.getAccessToken(codeEncoded);
final SalesforceToken salesforceAccessToken;
if (accessToken instanceof SalesforceToken) {
salesforceAccessToken = (SalesforceToken) accessToken;
} else {
throw new IllegalStateException("Salesforce API didn't return SalesforceToken.");
}
System.out.println("Got the Access Token!");
System.out.println("(The raw response looks like this: " + accessToken.getRawResponse() + "')");
System.out.println();
System.out.println("instance_url is: " + salesforceAccessToken.getInstanceUrl());
// Now let's go and ask for a protected resource!
System.out.println("Now we're reading accounts from the Salesforce org (maxing them to 10).");
// Sample SOQL statement
final String queryEncoded = URLEncoder.encode("Select Id, Name from Account LIMIT 10", "UTF-8");
// Building the query URI. We've parsed the instance URL from the accessToken request.
final String url = salesforceAccessToken.getInstanceUrl() + "/services/data/v36.0/query?q=" + queryEncoded;
System.out.println();
System.out.println("Full URL: " + url);
final OAuthRequest request = new OAuthRequest(Verb.GET, url);
service.signRequest(salesforceAccessToken, request);
final Response response = service.execute(request);
System.out.println();
System.out.println(response.getCode());
System.out.println(response.getBody());
}
} | [
"alonjune@gmail.com"
] | alonjune@gmail.com |
50bb499c5177f01f8156158815be35771000d933 | 3b69b71639aad070c0134ca81bf4e9b4c3f3c272 | /codemageAPI/src/main/java/com/codemage/sql/service/AnalyserServiceImpl.java | 34edcd059f2649ec21900632aab198432bacbc30 | [
"Apache-2.0"
] | permissive | hasithalakmal/CodeAnalyser | 54a6c41f0489f3da503081409c1a3f52acb07294 | 3afa0d900d9284d7a9a5da4cff0223298cac24c8 | refs/heads/master | 2021-01-12T11:09:55.565649 | 2016-11-06T16:51:07 | 2016-11-06T16:51:07 | 72,855,724 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,765 | java | package com.codemage.sql.service;
import com.codemage.sql.analyser.CodeAnalyser;
import com.codemage.sql.analyser.ReportGen;
import com.codemage.sql.util.SonarQubeManager;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("analyserService")
@Transactional
public class AnalyserServiceImpl implements AnalyserService {
@Autowired
CodeAnalyser codeAnalyser;
@Autowired
ReportGen reportGen;
@Autowired
SonarQubeManager sonarQubeManager;
@Override
public String getAnalysereport(String javaCode) {
// sonarQubeManager.createJavaFile(javaCode);
// sonarQubeManager.AnalyseProject();
System.out.println("working 4");
String result ="";
String res1 = codeAnalyser.getCyclomaticComplexity(javaCode);
System.out.println(">>>>>>>>>>>>!!!");
String res2 = codeAnalyser.getParameeter2(javaCode);
String res3 = codeAnalyser.getParameeter3(javaCode);
System.out.println("working 5");
JSONArray list = new JSONArray();
JSONObject res1Obj = new JSONObject(res1);
JSONObject res2Obj = new JSONObject(res2);
JSONObject res3Obj = new JSONObject(res3);
list.put(res1Obj);
list.put(res2Obj);
list.put(res3Obj);
System.out.println("working 6");
JSONObject obj = new JSONObject();
obj.put("anlyse", list);
System.out.println("working 7");
result = reportGen.getReport(obj.toString());
System.out.println("working 8");
return result;
}
}
| [
"ghasithalakmal@gmail.com"
] | ghasithalakmal@gmail.com |
ae3520523d47e7f86980cb727094cf620e17adcc | e85a519fbc05ced36aa732cb197b6ee3cf27352d | /mdo-core/authentication/src/main/java/fr/mch/mdo/restaurant/services/authorization/jaas/MdoAuthorizationServiceImpl.java | 49a2bec911e7bbaeaf74159caa8e6148da6347aa | [] | no_license | mathieu-ma/montagnesdor | 1791fae256c7525e0f2a23a2cd7f03ca65ca13bb | e149fc14253b60d30a9e98f6c7b467b807ec5d65 | refs/heads/master | 2021-01-23T11:48:43.639476 | 2014-08-20T20:41:27 | 2014-08-20T20:41:27 | 3,204,171 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,824 | java | package fr.mch.mdo.restaurant.services.authorization.jaas;
import java.security.AccessControlException;
import java.security.Permission;
import java.security.PrivilegedAction;
import javax.security.auth.Subject;
import fr.mch.mdo.logs.ILogger;
import fr.mch.mdo.restaurant.authorization.IMdoAuthorizationService;
import fr.mch.mdo.restaurant.services.logs.LoggerServiceImpl;
/**
* @author Mathieu MA
*
* To change this generated comment edit the template variable
* "typecomment": Window>Preferences>Java>Templates. To enable and
* disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
*/
public class MdoAuthorizationServiceImpl implements IMdoAuthorizationService
{
private static class LazyHolder {
private static IMdoAuthorizationService instance = new MdoAuthorizationServiceImpl(
LoggerServiceImpl.getInstance().getLogger(MdoAuthorizationServiceImpl.class.getName()));
}
public static IMdoAuthorizationService getInstance() {
return LazyHolder.instance;
}
private ILogger logger;
private MdoAuthorizationServiceImpl(ILogger logger) {
this();
this.logger = logger;
}
public MdoAuthorizationServiceImpl() {
}
public Permission getPermission(String url) {
return new URLPermission(url);
}
public String permitted(final Subject subject, final String pageReq) {
final SecurityManager securityManager;
if (System.getSecurityManager() == null) {
securityManager = new SecurityManager();
} else {
securityManager = System.getSecurityManager();
}
try {
this.getLogger().debug("message.debug.permitted.action", new String[] { pageReq });
String result = (String) Subject.doAsPrivileged(subject, new PrivilegedAction<String>() {
public String run() {
String path = null;
try {
Permission permission = getPermission(pageReq);
securityManager.checkPermission(permission);
path = pageReq;
} catch (Exception e) {
getLogger().error("message.error.permitted.action", new String[] { pageReq + " " + e.getMessage() });
}
return path;
}
}, null);
if (result == null) {
this.getLogger().error("message.error.permitted.action", new String[] { pageReq });
}
return result;
} catch (AccessControlException e) {
this.getLogger().error("message.error.permitted.action", new String[] { pageReq + " " + e.getMessage() });
return null;
} catch (Exception e) {
this.getLogger().error("message.error.permitted.action", new String[] { pageReq + " " + e.getMessage() });
return null;
}
}
@Override
public ILogger getLogger() {
return logger;
}
@Override
public void setLogger(ILogger logger) {
this.logger = logger;
}
}
| [
"mathieu.ma.dev@free.fr"
] | mathieu.ma.dev@free.fr |
944d8a77cbaf3ae96b1cb646887e845f474fcbf5 | 268592c417a8f6fbcfec98a8af17d7cb9f1f6cee | /debop4k-data-mybatis/src/test/java/debop4k/data/mybatis/cache/EhCacheConfiguration.java | 0129320c46a29075336f3f069e66f6e9df1581cd | [
"Apache-2.0"
] | permissive | debop/debop4k | 8a8e29e76b590e72599fb69888c2eb2e90952c10 | 5a621998b88b4d416f510971536abf3bf82fb2f0 | refs/heads/develop | 2021-06-14T22:48:58.156606 | 2019-08-06T15:49:34 | 2019-08-06T15:49:34 | 60,844,667 | 37 | 12 | Apache-2.0 | 2021-04-22T17:45:14 | 2016-06-10T12:01:14 | Kotlin | UTF-8 | Java | false | false | 2,767 | java | /*
* Copyright (c) 2016. Sunghyouk Bae <sunghyouk.bae@gmail.com>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package debop4k.data.mybatis.cache;
import debop4k.data.mybatis.config.MyBatisConfiguration;
import lombok.extern.slf4j.Slf4j;
import net.sf.ehcache.config.CacheConfiguration;
import net.sf.ehcache.config.Configuration;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
/**
* EhCache 환경설정을 Java Config 에서 설정한 예제입니다.
*
* @author sunghyouk.bae@gmail.com
*/
@Slf4j
@EnableCaching(proxyTargetClass = true)
@ComponentScan(basePackageClasses = {EhCacheActorRepository.class})
public class EhCacheConfiguration extends MyBatisConfiguration {
/**
* EhCache 사용을 위한 환경설정 정보
*/
@Bean
public Configuration ehcacheConfiguration() {
Configuration cfg = new Configuration();
// NOTE: EhCache 는 미리 cache 를 정의해주어야 한다. ( resources 의 ehcache.xml 을 보면 자세한 속성 및 설명이 있습니다 )
// 다른 캐시 서버는 그럴 필요가 없다. (Memcached, Redis, Hazelcast, Apache Ignite)
//
cfg.addCache(new CacheConfiguration("ehcache-actors", 10000));
cfg.addCache(new CacheConfiguration("ehcache-company", 10000));
cfg.setName("mybatis-ehcache-manager-by-java-config");
return cfg;
}
/**
* EhCache 의 CacheManager
*
* @param cfg EhCache 의 환경설정
*/
@Bean
public net.sf.ehcache.CacheManager cacheManager(Configuration cfg) {
return new net.sf.ehcache.CacheManager(cfg);
}
/**
* Spring 의 CacheManager
*
* @param ehcacheManager EhCache의 CacheManager
*/
@Bean
public CacheManager ehcacheCacheManager(net.sf.ehcache.CacheManager ehcacheManager) {
EhCacheCacheManager cm = new EhCacheCacheManager(ehcacheManager);
if (cm.getCache("ehcache-actors") == null) {
throw new RuntimeException("Cache 설정이 잘못되었습니다.");
}
log.info("Create EhCache CacheManagner instance.");
return cm;
}
}
| [
"sunghyouk.bae@gmail.com"
] | sunghyouk.bae@gmail.com |
6e3d35723b3571b4646df4e1fc7c54ef05e0b4a2 | 0016005ee6a22429433a4e0e66ff1303147179ec | /src/InterviewCodingTasks/FactorialNumbers.java | 2ec8e8b2ee7562cb51c901c3521c1bbd23715d5b | [] | no_license | OrkhanMusayev/B18_JavaCourse | 7d1fee404169ec7f45b20efc42456f0173577327 | 017a6cfca170ec0c0ace15fa5d5fb319529f2921 | refs/heads/master | 2022-12-10T06:03:38.178027 | 2020-08-22T23:31:10 | 2020-08-22T23:31:10 | 286,326,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package InterviewCodingTasks;
/**
* Write a return method that returns the factorial number of any given number
*/
public class FactorialNumbers {
public static int factorialNumber(int n){
int result = 1;
for(int i = 1; i <= n; i++){
result = result * i;
}
return result;
}
public static void main(String[] args) {
System.out.println(factorialNumber(4));
}
}
| [
"mussayevorkhan@gmail.com"
] | mussayevorkhan@gmail.com |
8ffa17bc889964c0c379442840ec8f22d853077c | 82bebc06a91729b82d5e6759e966b34b659502bf | /test/src/main/java/com/toly1994/test/common/ColUtils.java | 7bfd022d6af4a4abe55768a1de9ad00c8e03c086 | [] | no_license | philip-knight/Android_Material_Design_Test | ad2e6e120ac6e8b2f26fcf9b0247f527432817b2 | 3ebe842c49201b0e59223c0611ba2ba3f4c1ed22 | refs/heads/master | 2021-10-08T22:28:04.583884 | 2018-12-18T12:24:07 | 2018-12-18T12:24:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,092 | java | package com.toly1994.test.common;
import android.content.res.ColorStateList;
import android.graphics.Color;
import java.util.Random;
/**
* 作者:张风捷特烈
* 时间:2018/5/19:17:02
* 邮箱:1981462002@qq.com
* 说明:颜色工具类
*/
public class ColUtils {
/**
* 改变一个颜色的透明度
*
* @param color
* @param alpha
*/
public static int changeColorAlpha(int color, int alpha) {
int a = (color >> 24) & 0xFF;
a = (int) (a * (alpha / 255f));
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
return (a << 24) | (r << 16) | (g << 8) | b;
}
/**
* 返回随机颜色
*
* @return 随机颜色
*/
public static int randomColor() {
Random random = new Random();
int a = 250 + random.nextInt(255);
int r = 30 + random.nextInt(200);
int g = 30 + random.nextInt(200);
int b = 30 + random.nextInt(200);
int randomColor = Color.argb(a, r, g, b);
return randomColor;
}
/**
* 返回随机颜色
*
* @return 随机颜色
*/
public static int randomRGB() {
Random random = new Random();
int r = 30 + random.nextInt(200);
int g = 30 + random.nextInt(200);
int b = 30 + random.nextInt(200);
return Color.rgb(r, g, b);
}
/**
* 颜色变换
*
* @param fraction 分度值
* @param startValue 开始色
* @param endValue 结束色
* @return 分度值处颜色
*/
public static int evaluateColor(float fraction, int startValue,
int endValue) {
int startA = (startValue >> 24) & 0xff;
int startR = (startValue >> 16) & 0xff;
int startG = (startValue >> 8) & 0xff;
int startB = startValue & 0xff;
int endA = (endValue >> 24) & 0xff;
int endR = (endValue >> 16) & 0xff;
int endG = (endValue >> 8) & 0xff;
int endB = endValue & 0xff;
return (startA + (int) (fraction * (endA - startA)) << 24)
| (startR + (int) (fraction * (endR - startR)) << 16)
| (startG + (int) (fraction * (endG - startG)) << 8)
| startB + (int) (fraction * (endB - startB));
}
private static final int ENABLE_ATTR = android.R.attr.state_enabled;
private static final int CHECKED_ATTR = android.R.attr.state_checked;
private static final int PRESSED_ATTR = android.R.attr.state_pressed;
/**
* @param tintColor
* @return
*/
public static ColorStateList generateThumbColorWithTintColor(final int tintColor) {
int[][] states = new int[][]{
{-ENABLE_ATTR, CHECKED_ATTR},
{-ENABLE_ATTR},
{PRESSED_ATTR, -CHECKED_ATTR},
{PRESSED_ATTR, CHECKED_ATTR},
{CHECKED_ATTR},
{-CHECKED_ATTR}
};
int[] colors = new int[]{
tintColor - 0xAA000000,
0xFFBABABA,
tintColor - 0x99000000,
tintColor - 0x99000000,
tintColor | 0xFF000000,
0xFFEEEEEE
};
return new ColorStateList(states, colors);
}
/**
* @param tintColor
* @return
*/
public static ColorStateList generateBackColorWithTintColor(final int tintColor) {
int[][] states = new int[][]{
{-ENABLE_ATTR, CHECKED_ATTR},
{-ENABLE_ATTR},
{CHECKED_ATTR, PRESSED_ATTR},
{-CHECKED_ATTR, PRESSED_ATTR},
{CHECKED_ATTR},
{-CHECKED_ATTR}
};
int[] colors = new int[]{
tintColor - 0xE1000000,
0x10000000,
tintColor - 0xD0000000,
0x20000000,
tintColor - 0xD0000000,
0x20000000
};
return new ColorStateList(states, colors);
}
/**
* 颜色加深处理
*
* @param RGBValues RGB的值,由alpha(透明度)、red(红)、green(绿)、blue(蓝)构成,
* Android中我们一般使用它的16进制,
* 例如:"#FFAABBCC",最左边到最右每两个字母就是代表alpha(透明度)、
* red(红)、green(绿)、blue(蓝)。每种颜色值占一个字节(8位),值域0~255
* 所以下面使用移位的方法可以得到每种颜色的值,然后每种颜色值减小一下,在合成RGB颜色,颜色就会看起来深一些了
* @return
*/
public static int colorBurn(int RGBValues) {
int red = RGBValues >> 16 & 0xFF;
int green = RGBValues >> 8 & 0xFF;
int blue = RGBValues & 0xFF;
red = (int) Math.floor(red * (1 - 0.1));
green = (int) Math.floor(green * (1 - 0.1));
blue = (int) Math.floor(blue * (1 - 0.1));
return Color.rgb(red, green, blue);
}
}
| [
"1981462002@qq.com"
] | 1981462002@qq.com |
e7cc17859dab3a25a39c1bf868b428eaa09eccb7 | 453e89334c23807a72eba5df7d000e3437dfd02b | /src/main/java/edu/kit/datamanager/notification/dao/spec/NotificationCreationDateSpec.java | ffb347955e0a640690a52b50af64a21b2ee28412 | [
"Apache-2.0"
] | permissive | kit-data-manager/notification-service | f423c662cec20b6cc806c8b0d27f63971d0fdc10 | 71daa2d15d633f19a5ecda69fc96fab235ea8b23 | refs/heads/master | 2021-07-08T18:16:50.933205 | 2020-11-23T10:54:22 | 2020-11-23T10:54:22 | 209,776,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,914 | java | /*
* Copyright 2019 Karlsruhe Institute of Technology.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.datamanager.notification.dao.spec;
import edu.kit.datamanager.notification.domain.Notification;
import java.time.Instant;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import org.springframework.data.jpa.domain.Specification;
/**
*
* @author jejkal
*/
public class NotificationCreationDateSpec{
/**
* Hidden constructor.
*/
private NotificationCreationDateSpec(){
}
public static Specification<Notification> toSpecification(Instant createdFrom, Instant createdUntil){
Specification<Notification> newSpec = Specification.where(null);
if(createdFrom == null && createdUntil == null){
return newSpec;
}
return (Root<Notification> root, CriteriaQuery<?> query, CriteriaBuilder builder) -> {
if(createdFrom != null && createdUntil != null){
return builder.and(builder.between(root.get("createdAt"), createdFrom, createdUntil));
} else if(createdFrom == null){
return builder.and(builder.lessThan(root.get("createdAt"), createdUntil));
}
//otherwise, lastUpdateUntil is null
return builder.and(builder.greaterThan(root.get("createdAt"), createdFrom), root.get("createdAt").isNotNull());
};
}
}
| [
"thomas.jejkal@kit.edu"
] | thomas.jejkal@kit.edu |
d2244ab7e27d4ac3e8758c7ef5e851ca356031a8 | ddcfaadf222bfb485ecc711dc518c07f2c420c96 | /sampleapplication14/src/main/java/com/fastcode/sampleapplication14/restcontrollers/core/RoleController.java | c752d8236b6dbe1471a690c737705d9063dbde2e | [] | no_license | fastcoderepos/u3-sampleApplication1 | 9bf50ae68a8475e6f1e08e14d66f1f8fc050412f | 90cf3678b28221666848f54ec0c5d5320a386d93 | refs/heads/master | 2023-06-27T13:55:52.251444 | 2021-07-28T14:42:22 | 2021-07-28T14:42:22 | 390,385,879 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,845 | java | package com.fastcode.sampleapplication14.restcontrollers.core;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import javax.persistence.EntityNotFoundException;
import javax.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.env.Environment;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import com.fastcode.sampleapplication14.commons.search.SearchCriteria;
import com.fastcode.sampleapplication14.commons.search.SearchUtils;
import com.fastcode.sampleapplication14.commons.search.OffsetBasedPageRequest;
import com.fastcode.sampleapplication14.application.core.authorization.role.IRoleAppService;
import com.fastcode.sampleapplication14.application.core.authorization.role.dto.*;
import com.fastcode.sampleapplication14.application.core.authorization.rolepermission.IRolepermissionAppService;
import com.fastcode.sampleapplication14.application.core.authorization.rolepermission.dto.FindRolepermissionByIdOutput;
import com.fastcode.sampleapplication14.application.core.authorization.usersrole.IUsersroleAppService;
import com.fastcode.sampleapplication14.application.core.authorization.usersrole.dto.FindUsersroleByIdOutput;
import java.util.*;
import java.time.*;
import com.fastcode.sampleapplication14.commons.logging.LoggingHelper;
@RestController
@RequestMapping("/role")
@RequiredArgsConstructor
public class RoleController {
@Qualifier("roleAppService")
@NonNull protected final IRoleAppService _roleAppService;
@Qualifier("rolepermissionAppService")
@NonNull protected final IRolepermissionAppService _rolepermissionAppService;
@Qualifier("usersroleAppService")
@NonNull protected final IUsersroleAppService _usersroleAppService;
@NonNull protected final LoggingHelper logHelper;
@NonNull protected final Environment env;
@PreAuthorize("hasAnyAuthority('ROLEENTITY_CREATE')")
@RequestMapping(method = RequestMethod.POST, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity<CreateRoleOutput> create(@RequestBody @Valid CreateRoleInput role) {
CreateRoleOutput output=_roleAppService.create(role);
return new ResponseEntity(output, HttpStatus.OK);
}
// ------------ Delete role ------------
@PreAuthorize("hasAnyAuthority('ROLEENTITY_DELETE')")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, consumes = {"application/json"})
public void delete(@PathVariable String id) {
FindRoleByIdOutput output = _roleAppService.findById(Long.valueOf(id));
Optional.ofNullable(output).orElseThrow(() -> new EntityNotFoundException(String.format("There does not exist a role with a id=%s", id)));
_roleAppService.delete(Long.valueOf(id));
}
// ------------ Update role ------------
@PreAuthorize("hasAnyAuthority('ROLEENTITY_UPDATE')")
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity<UpdateRoleOutput> update(@PathVariable String id, @RequestBody @Valid UpdateRoleInput role) {
FindRoleByIdOutput currentRole = _roleAppService.findById(Long.valueOf(id));
Optional.ofNullable(currentRole).orElseThrow(() -> new EntityNotFoundException(String.format("Unable to update. Role with id=%s not found.", id)));
role.setVersiono(currentRole.getVersiono());
UpdateRoleOutput output = _roleAppService.update(Long.valueOf(id),role);
return new ResponseEntity(output, HttpStatus.OK);
}
@PreAuthorize("hasAnyAuthority('ROLEENTITY_READ')")
@RequestMapping(value = "/{id}", method = RequestMethod.GET, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity<FindRoleByIdOutput> findById(@PathVariable String id) {
FindRoleByIdOutput output = _roleAppService.findById(Long.valueOf(id));
Optional.ofNullable(output).orElseThrow(() -> new EntityNotFoundException(String.format("Not found")));
return new ResponseEntity(output, HttpStatus.OK);
}
@PreAuthorize("hasAnyAuthority('ROLEENTITY_READ')")
@RequestMapping(method = RequestMethod.GET, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity find(@RequestParam(value="search", required=false) String search, @RequestParam(value = "offset", required=false) String offset, @RequestParam(value = "limit", required=false) String limit, Sort sort) throws Exception {
if (offset == null) { offset = env.getProperty("fastCode.offset.default"); }
if (limit == null) { limit = env.getProperty("fastCode.limit.default"); }
Pageable Pageable = new OffsetBasedPageRequest(Integer.parseInt(offset), Integer.parseInt(limit), sort);
SearchCriteria searchCriteria = SearchUtils.generateSearchCriteriaObject(search);
return ResponseEntity.ok(_roleAppService.find(searchCriteria,Pageable));
}
@PreAuthorize("hasAnyAuthority('ROLEENTITY_READ')")
@RequestMapping(value = "/{id}/rolepermissions", method = RequestMethod.GET, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity getRolepermissions(@PathVariable String id, @RequestParam(value="search", required=false) String search, @RequestParam(value = "offset", required=false) String offset, @RequestParam(value = "limit", required=false) String limit, Sort sort)throws Exception {
if (offset == null) { offset = env.getProperty("fastCode.offset.default"); }
if (limit == null) { limit = env.getProperty("fastCode.limit.default"); }
Pageable pageable = new OffsetBasedPageRequest(Integer.parseInt(offset), Integer.parseInt(limit), sort);
SearchCriteria searchCriteria = SearchUtils.generateSearchCriteriaObject(search);
Map<String,String> joinColDetails=_roleAppService.parseRolepermissionsJoinColumn(id);
Optional.ofNullable(joinColDetails).orElseThrow(() -> new EntityNotFoundException(String.format("Invalid join column")));
searchCriteria.setJoinColumns(joinColDetails);
List<FindRolepermissionByIdOutput> output = _rolepermissionAppService.find(searchCriteria,pageable);
Optional.ofNullable(output).orElseThrow(() -> new EntityNotFoundException(String.format("Not found")));
return new ResponseEntity(output, HttpStatus.OK);
}
@PreAuthorize("hasAnyAuthority('ROLEENTITY_READ')")
@RequestMapping(value = "/{id}/usersroles", method = RequestMethod.GET, consumes = {"application/json"}, produces = {"application/json"})
public ResponseEntity getUsersroles(@PathVariable String id, @RequestParam(value="search", required=false) String search, @RequestParam(value = "offset", required=false) String offset, @RequestParam(value = "limit", required=false) String limit, Sort sort)throws Exception {
if (offset == null) { offset = env.getProperty("fastCode.offset.default"); }
if (limit == null) { limit = env.getProperty("fastCode.limit.default"); }
Pageable pageable = new OffsetBasedPageRequest(Integer.parseInt(offset), Integer.parseInt(limit), sort);
SearchCriteria searchCriteria = SearchUtils.generateSearchCriteriaObject(search);
Map<String,String> joinColDetails=_roleAppService.parseUsersrolesJoinColumn(id);
Optional.ofNullable(joinColDetails).orElseThrow(() -> new EntityNotFoundException(String.format("Invalid join column")));
searchCriteria.setJoinColumns(joinColDetails);
List<FindUsersroleByIdOutput> output = _usersroleAppService.find(searchCriteria,pageable);
Optional.ofNullable(output).orElseThrow(() -> new EntityNotFoundException(String.format("Not found")));
return new ResponseEntity(output, HttpStatus.OK);
}
}
| [
"info@nfinityllc.com"
] | info@nfinityllc.com |
dcd1c74fa121b1ba946f25a32f14d31caa89d67f | 2b2fcb1902206ad0f207305b9268838504c3749b | /WakfuClientSources/srcx/class_13052_WT.java | 3a8c3ddb19a60b90c3733a3767e9a65c04564842 | [] | no_license | shelsonjava/Synx | 4fbcee964631f747efc9296477dee5a22826791a | 0cb26d5473ba1f36a3ea1d7163a5b9e6ebcb0b1d | refs/heads/master | 2021-01-15T13:51:41.816571 | 2013-11-17T10:46:22 | 2013-11-17T10:46:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | import java.util.ArrayList;
import javax.swing.JFrame;
class WT
implements Runnable
{
WT(tr paramtr)
{
}
public void run()
{
if (beV.a(this.cGH.bdH) != null)
beV.a(this.cGH.bdH).b(this.cGH.bdH.dYL, this.cGH.bdH.aUq);
StringBuilder localStringBuilder = new StringBuilder("PSys Debug ").append(" Part.: ").append(this.cGH.bdH.dYL.size()).append(" (max ").append(this.cGH.bdH.fsk).append(") Lights: ").append(this.cGH.bdH.aUq.size()).append(" (max ").append(this.cGH.bdH.fsl).append(")");
beV.b(this.cGH.bdH).setTitle(localStringBuilder.toString());
}
} | [
"music_inme@hotmail.fr"
] | music_inme@hotmail.fr |
a47dc0358544c4506b0edea5b6fedf8e8c7f4541 | cc511ceb3194cfdd51f591e50e52385ba46a91b3 | /example/source_code/jackrabbit/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java | 19dc7a21612f045ad10fdc446d3f0895e4a90767 | [] | no_license | huox-lamda/testing_hw | a86cdce8d92983e31e653dd460abf38b94a647e4 | d41642c1e3ffa298684ec6f0196f2094527793c3 | refs/heads/master | 2020-04-16T19:24:49.643149 | 2019-01-16T15:47:13 | 2019-01-16T15:47:13 | 165,858,365 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,218 | java | org apach jackrabbit core retent
org apach jackrabbit spi
org apach jackrabbit spi factori namefactori
org apach jackrabbit spi common factori impl namefactoryimpl
org apach jackrabbit spi common convers resolv nameresolv
org apach jackrabbit core node nodeid
org apach jackrabbit core properti impl propertyimpl
org apach jackrabbit core session impl sessionimpl
javax jcr retent hold
javax jcr
javax jcr repositori except repositoryexcept
javax jcr factori valuefactori
code holdimpl code
hold impl holdimpl hold
factori namefactori factori factori factori impl namefactoryimpl instanc getinst
string deep
string shallow
deep isdeep
node nodeid node nodeid
resolv nameresolv resolv
hash code hashcod
hold impl holdimpl deep isdeep node nodeid node nodeid resolv nameresolv resolv
deep isdeep deep isdeep
node nodeid node nodeid
resolv resolv
node nodeid node getnodeid
node nodeid
tovalu factori valuefactori factori valuefactori repositori except repositoryexcept
string str deep isdeep deep shallow string tostr
factori valuefactori creat createvalu str
hold impl holdimpl creat createfromvalu val node nodeid node nodeid resolv nameresolv resolv repositori except repositoryexcept
string str val string getstr
factori factori creat str substr
deep isdeep str start startswith deep
hold impl holdimpl deep isdeep node nodeid resolv
hold impl holdimpl creat properti createfromproperti properti impl propertyimpl properti node nodeid node nodeid repositori except repositoryexcept
properti valu getvalu
hold impl holdimpl hold hold impl holdimpl length
length
hold creat createfromvalu node nodeid session impl sessionimpl properti session getsess
hold
hold
javax jcr retent hold isdeep
deep isdeep repositori except repositoryexcept
deep isdeep
javax jcr retent hold getnam
string getnam repositori except repositoryexcept
resolv jcr getjcrnam
object
object hashcod
overrid
hash code hashcod
hash code hashcod
hash code hashcod
node nodeid hash code hashcod
boolean valueof deep isdeep hash code hashcod
hash code hashcod
hash code hashcod
object equal object
overrid
equal object obj
obj
obj hold impl holdimpl
hold impl holdimpl hold impl holdimpl obj
deep isdeep deep isdeep equal node nodeid equal node nodeid
| [
"huox@lamda.nju.edu.cn"
] | huox@lamda.nju.edu.cn |
3f637c34b1aa7f4ff5979d5cee4017c8dfbbd248 | bc9864fe146c85bbc86191fb2ea69525fbfbd17f | /tport/src/main/java/com/spaceman/tport/commands/tport/Sort.java | e492a5cd3c212f3dd6cf6ec540f7402a3d254dfb | [
"MIT"
] | permissive | JasperBouwman/TPort | 5f0cfb25a7237a95406cafc12d8d21ee40bf4776 | 70b0a271d9786632c478e116b65293618d22205a | refs/heads/master | 2023-08-25T18:38:20.072325 | 2023-08-14T21:26:42 | 2023-08-14T21:26:42 | 99,251,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,929 | java | package com.spaceman.tport.commands.tport;
import com.spaceman.tport.Pair;
import com.spaceman.tport.inventories.ItemFactory;
import com.spaceman.tport.inventories.TPortInventories;
import com.spaceman.tport.commandHandler.ArgumentType;
import com.spaceman.tport.commandHandler.EmptyCommand;
import com.spaceman.tport.commandHandler.SubCommand;
import com.spaceman.tport.fancyMessage.Message;
import com.spaceman.tport.fancyMessage.events.HoverEvent;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import javax.annotation.Nullable;
import java.util.*;
import static com.spaceman.tport.fancyMessage.TextComponent.textComponent;
import static com.spaceman.tport.fancyMessage.colorTheme.ColorTheme.ColorType.varInfo2Color;
import static com.spaceman.tport.fancyMessage.colorTheme.ColorTheme.ColorType.varInfoColor;
import static com.spaceman.tport.fancyMessage.colorTheme.ColorTheme.*;
import static com.spaceman.tport.fileHander.Files.tportData;
import static com.spaceman.tport.permissions.PermissionHandler.hasPermission;
public class Sort extends SubCommand {
private static final String permissionPrefix = "TPort.sort.";
public Sort() {
EmptyCommand emptySorter = new EmptyCommand();
emptySorter.setCommandName("sorter", ArgumentType.OPTIONAL);
emptySorter.setCommandDescription(formatInfoTranslation("tport.command.sort.sorter.commandDescription"));
emptySorter.setPermissions(permissionPrefix + "<sorter>");
addAction(emptySorter);
setCommandDescription(formatInfoTranslation("tport.command.sort.commandDescription"));
}
private static final HashMap<String, Pair<Sorter, Message>> sorters = new HashMap<>();
public static Set<String> getSorters() {
return sorters.keySet();
}
public static Message getDescription(String name) {
return sorters.getOrDefault(name, new Pair<>(null, null)).getRight();
}
public static Sorter getSorter(String name) {
Sorter sorter = getSorterExact(name);
if (sorter == null) {
sorter = getSorterExact("oldest");
if (sorter == null) {
sorter = getSorterExact(getSorters().iterator().next());
}
}
return sorter;
}
public static String getSorterForPlayer(Player player) {
return tportData.getConfig().getString("tport." + player.getUniqueId() + ".sorter", "oldest");
}
public static Sorter getSorter(Player player) {
return getSorter(getSorterForPlayer(player));
}
public static String getNextSorterName(Player player) { //todo test
String currentSorter = Sort.getSorterForPlayer(player);
ArrayList<String> list = new ArrayList<>(getSorters());
boolean next = false;
int indexOfCurrent = 0;
for (int i = 0; i < list.size(); i++) {
String sorter = list.get(i);
if (next) {
if (hasPermission(player, false, permissionPrefix + sorter)) {
return sorter;
}
} else if (sorter.equalsIgnoreCase(currentSorter)) {
next = true;
indexOfCurrent = i;
}
}
for (int i = 0; i < indexOfCurrent; i++) {
String sorter = list.get(i);
if (hasPermission(player, false, permissionPrefix + sorter)) {
return sorter;
}
}
return null;
}
@Nullable
public static String getPreviousSorterName(Player player) { //todo test
String currentSorter = Sort.getSorterForPlayer(player);
ArrayList<String> list = new ArrayList<>(getSorters());
boolean next = false;
int indexOfCurrent = 0;
for (int i = list.size() - 1; i >= 0; i--) {
String sorter = list.get(i);
if (next) {
if (hasPermission(player, false, permissionPrefix + sorter)) {
return sorter;
}
} else if (sorter.equalsIgnoreCase(currentSorter)) {
next = true;
indexOfCurrent = i;
}
}
for (int i = list.size() - 1; i > indexOfCurrent; i--) {
String sorter = list.get(i);
if (hasPermission(player, false, permissionPrefix + sorter)) {
return sorter;
}
}
return null;
}
public static Sorter getSorterExact(String name) {
return sorters.getOrDefault(name, new Pair<>(null, null)).getLeft();
}
public static boolean addSorter(String name, Sorter sorter, Message description) {
if (!sorters.containsKey(name) && !name.contains(" ")) {
sorters.put(name, new Pair<>(sorter, description));
return true;
}
return false;
}
@Override
public Collection<String> tabList(Player player, String[] args) {
return getSorters();
}
@Override
public void run(String[] args, Player player) {
// tport sort [sorter]
/*
* sort types:
* popularity //todo
* alphabet
* newest
* oldest (default)
* */
if (args.length == 1) {
String sorterName = tportData.getConfig().getString("tport." + player.getUniqueId() + ".sorter", "oldest");
if (getSorter(sorterName) != null) {
tportData.getConfig().set("tport." + player.getUniqueId() + ".sorter", "oldest");
tportData.saveConfig();
sorterName = "oldest";
}
Message availableSorters = new Message();
ArrayList<String> sorters = new ArrayList<>(getSorters());
int sortersSize = sorters.size();
boolean color = true;
for (int i = 0; i < sortersSize; i++) {
String sorter = sorters.get(i);
availableSorters.addText(textComponent(sorter, (color ? varInfoColor : varInfo2Color), new HoverEvent(getDescription(sorter))));
if (i + 2 == sortersSize) availableSorters.addMessage(formatInfoTranslation("tport.command.sort.lastDelimiter"));
else availableSorters.addMessage(formatInfoTranslation("tport.command.sort.delimiter"));
color = !color;
}
availableSorters.removeLast();
sendInfoTranslation(player, "tport.command.sort.succeeded",
textComponent(sorterName, varInfoColor, new HoverEvent(getDescription(sorterName))),
availableSorters);
} else if (args.length == 2) {
if (setSorter(player, args[1])) {
TPortInventories.openMainTPortGUI(player);
}
} else {
sendErrorTranslation(player, "tport.command.wrongUsage", "/tport sort [sorter]");
}
}
public static boolean setSorter(Player player, String sorterName) {
Sorter sorter = getSorterExact(sorterName);
if (sorter == null) {
sendErrorTranslation(player, "tport.command.sort.sorter.notExist", sorterName);
return false;
}
if (!hasPermission(player, true, permissionPrefix + sorterName)) {
return false;
}
tportData.getConfig().set("tport." + player.getUniqueId() + ".sorter", sorterName);
tportData.saveConfig();
sendSuccessTranslation(player, "tport.command.sort.sorter.succeeded", sorterName);
return true;
}
@FunctionalInterface
public interface Sorter {
List<ItemStack> sort(Player player, ItemFactory.HeadAttributes... attributes);
}
}
| [
"jphbouwman@gmail.com"
] | jphbouwman@gmail.com |
87814fc5e69168fc323b89c103b6908b5b92c97e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/13/13_83d60942ff6f60b2ae06d5a7188126d685018113/RemoteLineUpQueue/13_83d60942ff6f60b2ae06d5a7188126d685018113_RemoteLineUpQueue_s.java | d86d2bb5e0a37443ec170d28c2e0a2eb99e44442 | [] | 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,952 | java | /**
*
* lineup - In-Memory high-throughput queue
* Copyright (c) 2013, Sandeep Gupta
*
* http://www.sangupta/projects/lineup
*
* 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.sangupta.lineup.domain;
import java.util.List;
import javax.ws.rs.core.MediaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sangupta.jerry.http.WebInvoker;
import com.sangupta.jerry.http.WebRequestMethod;
import com.sangupta.jerry.http.WebResponse;
import com.sangupta.jerry.util.AssertUtils;
import com.sangupta.jerry.util.DateUtils;
import com.sangupta.jerry.util.UriUtils;
import com.sangupta.jerry.util.XStreamUtils;
/**
* @author sangupta
*
*/
public class RemoteLineUpQueue extends AbstractLineUpBlockingQueue {
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteLineUpQueue.class);
private static final long DEFAULT_POLL_TIME = DateUtils.ONE_SECOND;
/**
* The URL of the remote queue.
*
*/
private final String remoteQueue;
/**
* The default poll time to use for this queue
*/
private final long messagePollTime;
/**
* Create a {@link LineUpQueue} that connects to the given remote queue.
*
* @param queueURL
*/
public RemoteLineUpQueue(String queueURL) {
if(AssertUtils.isEmpty(queueURL)) {
throw new IllegalArgumentException("Remote server URL cannot be null/empty");
}
this.remoteQueue = queueURL;
this.messagePollTime = DEFAULT_POLL_TIME;
}
/**
* Create a {@link LineUpQueue} that connects to the given remote server, and connects
* to an already existing queue.
*
* @param lineUpServer
* @param queueName
*/
public RemoteLineUpQueue(String lineUpServer, String queueName) {
this(lineUpServer, queueName, QueueOptions.getOptions(QueueType.AllowDuplicates));
}
/**
* Create a {@link LineUpQueue} that connects to the given remote server, and creates
* a new queue with the given name and options.
*
* @param lineUpServer
* @param queueName
* @param queueOptions
*/
public RemoteLineUpQueue(String lineUpServer, String queueName, QueueOptions queueOptions) {
if(queueOptions == null) {
throw new IllegalArgumentException("Queue options cannot be null");
}
final String xml = XStreamUtils.getXStream(QueueOptions.class).toXML(queueOptions);
final String endPoint = UriUtils.addWebPaths(lineUpServer, "queue/" + queueName + "?queueType=" + queueOptions.getQueueType());
WebResponse response = WebInvoker.invokeUrl(endPoint, WebRequestMethod.PUT, MediaType.TEXT_XML, xml);
if(response == null) {
throw new RuntimeException("Unable to connect to create a new remote queue.");
}
if(response.getResponseCode() != 200) {
throw new RuntimeException("Unable to connect to create a new remote queue.");
}
DefaultLineUpQueue queue = (DefaultLineUpQueue) XStreamUtils.getXStream(DefaultLineUpQueue.class).fromXML(response.asStream());
if(queue == null) {
throw new RuntimeException("Unable to connect to create a new remote queue.");
}
this.remoteQueue = UriUtils.addWebPaths(lineUpServer, "messages/" + queue.getSecurityCode() + "/" + queueName);
this.messagePollTime = DEFAULT_POLL_TIME;
}
/**
* Create a {@link LineUpQueue} that connects to the given remote server, and connects
* to an already existing queue with the given name and security code.
*
* @param lineUpServer
* @param queueName
* @param securityCode
*/
public RemoteLineUpQueue(String lineUpServer, String queueName, String securityCode) {
this(lineUpServer, queueName, securityCode, DEFAULT_POLL_TIME);
}
public RemoteLineUpQueue(String lineUpServer, String queueName, String securityCode, long defaultPollTime) {
this.remoteQueue = UriUtils.addWebPaths(lineUpServer, "messages/" + securityCode + "/" + queueName);
this.messagePollTime = defaultPollTime;
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#addMessage(java.lang.String)
*/
@Override
public QueueMessage addMessage(String message) {
WebResponse response = WebInvoker.postXML(this.remoteQueue, new QueueMessage(message, 0, 1));
if(response == null) {
return null;
}
if(!response.isSuccess()) {
LOGGER.error("Error posting message to remote queue for reason: ", response);
return null;
}
return (QueueMessage) XStreamUtils.getXStream(QueueMessage.class).fromXML(response.asStream());
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#addMessage(java.lang.String, int)
*/
@Override
public QueueMessage addMessage(String message, int delaySeconds) {
WebResponse response = WebInvoker.postXML(this.remoteQueue, new QueueMessage(message, delaySeconds, 1));
if(response == null) {
return null;
}
return (QueueMessage) XStreamUtils.getXStream(QueueMessage.class).fromXML(response.asStream());
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#addMessage(com.sangupta.lineup.domain.QueueMessage)
*/
@Override
public QueueMessage addMessage(QueueMessage queueMessage) {
WebResponse response = WebInvoker.postXML(this.remoteQueue, queueMessage);
if(response == null) {
return null;
}
return (QueueMessage) XStreamUtils.getXStream(QueueMessage.class).fromXML(response.asStream());
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#getMessage()
*/
@Override
public QueueMessage getMessage() {
return getMessage(this.messagePollTime);
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#getMessage(int)
*/
@Override
public QueueMessage getMessage(long longPollTime) {
WebResponse response = WebInvoker.getResponse(this.remoteQueue + "?pollTime=" + longPollTime);
if(response == null) {
return null;
}
if(response.getResponseCode() == 200) {
return (QueueMessage) XStreamUtils.getXStream(QueueMessage.class).fromXML(response.asStream());
}
// consume the entity so that the connection can be closed
response.close();
// return null
return null;
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#getMessages(int)
*/
@SuppressWarnings("unchecked")
@Override
public List<QueueMessage> getMessages(int numMessages) {
WebResponse response = WebInvoker.getResponse(this.remoteQueue + "?numMessages=" + numMessages);
if(response == null) {
return null;
}
return (List<QueueMessage>) XStreamUtils.getXStream(QueueMessage.class).fromXML(response.asStream());
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#deleteMessage(java.lang.String)
*/
@Override
public boolean deleteMessage(String messageID) {
QueueMessage queueMessage = QueueMessage.createMessage(messageID);
String xml = XStreamUtils.getXStream(QueueMessage.class).toXML(queueMessage);
WebResponse response = WebInvoker.invokeUrl(this.remoteQueue, WebRequestMethod.DELETE, MediaType.TEXT_XML, xml);
if(response == null) {
return false;
}
if(response.isSuccess()) {
return true;
}
return false;
}
/**
* @see com.sangupta.lineup.domain.LineUpQueue#numMessages()
*/
@Override
public int numMessages() {
throw new RuntimeException("Not yet implemented");
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return this.remoteQueue;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
bb236f1d52e1798f3c65469222d356b1fc48fa8a | 2ab03c4f54dbbb057beb3a0349b9256343b648e2 | /JavaOOPAdvanced/InterfacesAndAbstractionExercises/src/collection_hierarchy/AddRemoveCollection.java | a0e6aa1d4a96a310b8772d486724691b7ec0985b | [
"MIT"
] | permissive | tabria/Java | 8ef04c0ec5d5072d4e7bf15e372e7c2b600a1cea | 9bfc733510b660bc3f46579a1cc98ff17fb955dd | refs/heads/master | 2021-05-05T11:50:05.175943 | 2018-03-07T06:53:54 | 2018-03-07T06:53:54 | 104,714,168 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,020 | java | package collection_hierarchy;
import java.util.LinkedList;
import java.util.List;
public class AddRemoveCollection implements Addable, EndRemovable {
private List<String> addRemoveCollection;
private List<Integer> addIndexes;
public AddRemoveCollection() {
this.addRemoveCollection = new LinkedList<>();
this.addIndexes = new LinkedList<>();
}
void addIndexes(int index){
this.addIndexes.add(index);
}
void remove(int cycles){
}
@Override
public int addAtStart(String element) {
this.addRemoveCollection.add(0, element);
return 0;
}
@Override
public String removeAtEnd() {
String element = this.addRemoveCollection.get(this.addRemoveCollection.size()-1);
this.addRemoveCollection.remove(this.addRemoveCollection.size()-1);
return element;
}
@Override
public String toString() {
return this.addIndexes.toString().replace("[", "").replace("]","").replace(",", "") ;
}
}
| [
"forexftg@yahoo.com"
] | forexftg@yahoo.com |
c54108d9bba241874e078abbf60fb28f451ac31f | 8922e51e7b544b069ff163496780aa8b37ad4f8a | /library/src/java/org/apache/hivemind/lib/pipeline/PipelineContribution.java | 6bdd2e28da9821485c6caacd56ef61efedea678b | [
"Apache-2.0"
] | permissive | rsassi/hivemind2 | e44cd3b7634bf15180c68c20a3a4f6fa51c21dd0 | 2ab77f62bf2ecbea4e3e03f6bde525a90e3f1a08 | refs/heads/master | 2023-06-28T09:19:39.745800 | 2021-07-25T03:45:03 | 2021-07-25T03:45:03 | 389,251,042 | 0 | 0 | null | 2021-07-25T03:45:04 | 2021-07-25T03:26:24 | Java | UTF-8 | Java | false | false | 1,055 | java | // Copyright 2004, 2005 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.hivemind.lib.pipeline;
/**
* Interface implemented by the configuration objects used to build a pipeline.
*
*
* @author Howard Lewis Ship
*/
public interface PipelineContribution
{
/**
* Invoke {@link PipelineAssembler#addFilter(String, String, String, Object, Location)}
* or {@link PipelineAssembler#setTerminator(Object, Location)}.
*/
public void informAssembler(PipelineAssembler pa);
}
| [
"ahuegen@localhost"
] | ahuegen@localhost |
27a97154388ca322f7840568b70887b0a1205c2b | 7c8d2d2791b63d49edaf464129849a585460c880 | /A生产系统(储值票)/CSFRM/src/com/goldsign/csfrm/util/CSVFileFilter.java | 0d802b6515e20a32f6df184c0bcd837218868c32 | [] | no_license | wuqq-20191129/wlmq | 5cd3ebc50945bde41d0fd615ba93ca95ab1a2235 | ae26d439af09097b65c90cad8d22954cd91fe5f5 | refs/heads/master | 2023-01-14T03:19:23.226824 | 2020-11-24T01:43:22 | 2020-11-24T02:09:41 | 315,494,185 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | /*
* 文件名:CSVFileFilter
* 版权:Copyright: goldsign (c) 2013
*/
package com.goldsign.csfrm.util;
import java.io.File;
import javax.swing.filechooser.FileFilter;
/*
* 检验是否为CSV文件
* @author lindaquan
* @version V1.0
*/
public class CSVFileFilter extends FileFilter{
//检验是否为CSV文件
public boolean accept( File f ){
if( f != null ){
if( f.isDirectory() ){
return true;
}
if( getExtension().equalsIgnoreCase( getExtensionFile( f ) ) ){
return true;
}
}
return false;
}
public String getDescription(){
return "csv format";
}
public String getExtension(){
return "csv";
}
//取文件后缀
public String getExtensionFile(File file){
String fileName = file.getName();
int index = fileName.lastIndexOf('.');
String extension = "";
if (index > 0 && index < fileName.length() - 1)
{
extension = fileName.substring(index + 1).toLowerCase();
}
return extension;
}
}
| [
"13821571040@163.com"
] | 13821571040@163.com |
bcd4f0e4292b002ae3f4c71e92f4945b81cd7c80 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Spring/Spring7916.java | daca0be534b493e010fe2d139628543d2d0578a8 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | @Test
public void testInvalidIsolation() {
tt.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE);
given(manager.isOpen()).willReturn(true);
try {
tt.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
}
});
fail("Should have thrown InvalidIsolationLevelException");
}
catch (InvalidIsolationLevelException ex) {
// expected
}
verify(manager).close();
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
f41a17fe3e94194827fcbe484f9daff2685a85e8 | 7526afd8d2a0b1954fe7f982e0fe4f188fc0fbca | /src/test/java/idv/lc/tree/LC106Test.java | bb3ef59e37d974ff7878279c656f4754ace5a411 | [] | no_license | dixentw/lcns | cfd3946614caf8ac4d60cb08ee2f38581824f365 | bd347cb790e9689243c5c6b0a8dfd520b3ba2439 | refs/heads/master | 2021-06-15T15:43:17.272261 | 2019-09-01T08:54:01 | 2019-09-01T08:54:01 | 132,464,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package idv.lc.tree;
import static org.junit.Assert.*;
import org.junit.*;
import java.util.*;
public class LC106Test {
LC106 s = new LC106();
@Test
public void test1(){
TreeNode root = s.buildTree(
new int[]{9,3,15,20,7},
new int[]{9,15,7,20,3}
);
assertEquals(3, root.val);
assertEquals(9, root.left.val);
assertEquals(20, root.right.val);
assertEquals(15, root.right.left.val);
assertEquals(7, root.right.right.val);
}
}
| [
"dixentw@gmail.com"
] | dixentw@gmail.com |
61e8b9604237f0e2da454c1793616e7c2cd7897f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_81a81dbc826958acc3fc71d33326d43c150bdb53/ExecuteCommand/15_81a81dbc826958acc3fc71d33326d43c150bdb53_ExecuteCommand_t.java | b24cb9180c430c7734601352b2d32db36fce787c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,858 | java | package net.i2cat.mantychore.queuemanager.shell;
import java.util.List;
import net.i2cat.mantychore.queuemanager.QueueManager;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
import org.apache.felix.gogo.commands.Option;
import org.opennaas.core.resources.IResource;
import org.opennaas.core.resources.IResourceIdentifier;
import org.opennaas.core.resources.IResourceManager;
import org.opennaas.core.resources.action.ActionResponse;
import org.opennaas.core.resources.capability.ICapability;
import org.opennaas.core.resources.command.Response;
import org.opennaas.core.resources.queue.QueueConstants;
import org.opennaas.core.resources.queue.QueueResponse;
import org.opennaas.core.resources.shell.GenericKarafCommand;
@Command(scope = "queue", name = "execute", description = "Execute all actions in queue")
public class ExecuteCommand extends GenericKarafCommand {
@Argument(index = 0, name = "resourceType:resourceName", description = "Name of the resource owning the queue", required = true, multiValued = false)
private String resourceId;
@Option(name = "--debug", aliases = { "-d" }, description = "Print execution data verbosely.")
private boolean debug;
@Override
protected Object doExecute() throws Exception {
printInitCommand("Execute all actions in queue");
ICapability queue;
try {
IResourceManager manager = getResourceManager();
String[] argsRouterName = new String[2];
try {
argsRouterName = splitResourceName(resourceId);
} catch (Exception e) {
printError(e.getMessage());
printEndCommand();
return -1;
}
IResourceIdentifier resourceIdentifier = null;
resourceIdentifier = manager.getIdentifierFromResourceName(argsRouterName[0], argsRouterName[1]);
/* validate resource identifier */
if (resourceIdentifier == null) {
printError("Could not get resource with name: " + argsRouterName[0] + ":" + argsRouterName[1]);
printEndCommand();
return -1;
}
IResource resource = manager.getResource(resourceIdentifier);
validateResource(resource);
queue = getCapability(resource.getCapabilities(), QueueManager.QUEUE);
if (queue == null) {
printError("Could not found capability " + QueueManager.QUEUE + " in resource " + resourceId);
return -1;
}
} catch (Exception e) {
printError("Error getting queue.");
printError(e);
printEndCommand();
return -1;
}
try{
printSymbol("Executing actions...");
QueueResponse queueResponse = (QueueResponse) queue.sendMessage(QueueConstants.EXECUTE, null);
printSymbol("Executed in " + queueResponse.getTotalTime() + " ms");
if (debug) {
printDebug(queueResponse);
} else {
printOverview(queueResponse);
}
} catch (Exception e) {
printError("Error executing queue.");
printError(e);
printEndCommand();
return -1;
}
printEndCommand();
return null;
}
private void printDebug(QueueResponse queueResponse) {
if (queueResponse.getRestoreResponse().getStatus() != ActionResponse.STATUS.PENDING) {
printSymbol("WARNING IT WAS NECESARY TO RESTORE THE CONFIGURATION!!");
printActionResponseExtended(queueResponse.restoreResponse);
}
newLine();
printActionResponseExtended(queueResponse.getPrepareResponse());
newLine();
for (ActionResponse actionResponse : queueResponse.getResponses()) {
printActionResponseExtended(actionResponse);
newLine();
}
printActionResponseExtended(queueResponse.getConfirmResponse());
printActionResponseExtended(queueResponse.getRefreshResponse());
}
private void printOverview(QueueResponse queueResponse) {
if (queueResponse.getRestoreResponse().getStatus() != ActionResponse.STATUS.PENDING) {
printSymbol("WARNING IT WAS NECESARY TO RESTORE THE CONFIGURATION!!");
printActionResponseBrief(queueResponse.restoreResponse);
}
newLine();
printActionResponseBrief(queueResponse.getPrepareResponse());
newLine();
for (ActionResponse actionResponse : queueResponse.getResponses()) {
printActionResponseBrief(actionResponse);
newLine();
}
printActionResponseBrief(queueResponse.getConfirmResponse());
printActionResponseBrief(queueResponse.getRefreshResponse());
}
private void printActionResponseBrief(ActionResponse actionResponse) {
printSymbol("--- actionid: " + actionResponse.getActionID() + ", status: " + actionResponse.getStatus() + " ---");
List<Response> responses = actionResponse.getResponses();
/* create new action */
String[] titles = { "Command Name", "Status" };
String[][] matrix = new String[responses.size()][2];
int num = 0;
for (Response response : responses) {
String commandName = response.getCommandName();
String params[] = { commandName, response.getStatus().toString() };
matrix[num] = params;
num++;
}
super.printTable(titles, matrix, -1);
}
private void printActionResponseExtended(ActionResponse actionResponse) {
printSymbol("--- actionid: " + actionResponse.getActionID() + ", status: " + actionResponse.getStatus() + " ---");
List<Response> responses = actionResponse.getResponses();
/* create new action */
for (Response response : responses) {
printSymbol("Command: " + response.getCommandName());
printSymbol("Status: " + response.getStatus().toString());
printSymbol("Message: " + response.getSentMessage());
printSymbol("Information: " + response.getInformation());
for (String error: response.getErrors()){
printSymbol("Error: " + error);
}
newSeparator();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
cf57638258d24ee854be3ec672dd595fee52e6c6 | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/ISynchronizationJobRestartRequestBuilder.java | d5542486e88d2a19bc39bc697635c43a77447ef8 | [
"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,441 | 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.requests.extensions.ISynchronizationJobRestartRequest;
import com.microsoft.graph.http.IRequestBuilder;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The interface for the Synchronization Job Restart Request Builder.
*/
public interface ISynchronizationJobRestartRequestBuilder extends IRequestBuilder {
/**
* Creates the ISynchronizationJobRestartRequest
*
* @param requestOptions the options for the request
* @return the ISynchronizationJobRestartRequest instance
*/
ISynchronizationJobRestartRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions);
/**
* Creates the ISynchronizationJobRestartRequest with specific options instead of the existing options
*
* @param requestOptions the options for the request
* @return the ISynchronizationJobRestartRequest instance
*/
ISynchronizationJobRestartRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions);
}
| [
"GraphTooling@service.microsoft.com"
] | GraphTooling@service.microsoft.com |
1a4f0cc9b6ad301a1b707f58f931f4cc285f55e5 | 33d2cb3de7eee7d47dc499a20037ae4f23d28fd0 | /packages/apps/CarSetting8317/src/com/yecon/carsetting/wifi/WifiListAdapter.java | 265d4020c5db0fc2c12a614216a49d86e0043682 | [] | no_license | lvxiaojia/yecon | 0e139c9dddac12a71d55184bb10eaa658c3b906f | 87658d255c405802d906be389353ef2b2e828d59 | refs/heads/master | 2020-05-18T05:31:19.781960 | 2018-06-07T05:11:17 | 2018-06-07T05:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,882 | java | package com.yecon.carsetting.wifi;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.yecon.carsetting.R;
public class WifiListAdapter extends ArrayAdapter<WifiItem> {
private List<WifiItem> listWifi;
private Context context;
private int resourceId;
public WifiListAdapter(Context context, int resource, List<WifiItem> objects) {
super(context, resource, objects);
this.listWifi = objects;
this.resourceId = resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
WifiItem wifiItem = getItem(position);
View view;
ViewHolder viewHolder;
if(convertView == null) {
view = LayoutInflater.from(getContext()).inflate(resourceId, null);
viewHolder = new ViewHolder();
viewHolder.wifiName = (TextView) view.findViewById(R.id.list_wifi_name);
viewHolder.describes = (TextView) view.findViewById(R.id.list_wifi_describes);
viewHolder.connectStatus = (TextView) view.findViewById(R.id.list_wifi_connect_status);
viewHolder.wifiLevel = (ImageView) view.findViewById(R.id.list_wifi_icon);
view.setTag(viewHolder);
}else {
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
viewHolder.wifiName.setText(wifiItem.getWifiName());
viewHolder.describes.setText(wifiItem.getDescribes());
viewHolder.connectStatus.setText(wifiItem.getConnected());
//viewHolder.connectStatus.setText("22222");
viewHolder.wifiLevel.setImageResource(wifiItem.getImageLevelID()); //把id读出后,再写�?
return view;
}
class ViewHolder {
TextView wifiName;
TextView describes;
TextView connectStatus;
ImageView wifiLevel;
ImageView wifiLock;
}
}
| [
"275129737@qq.com"
] | 275129737@qq.com |
4a77f4450c1fa5df40faa34b07f930cb4da0d95b | 9483067d771c8f8b148cfadb5b2247069ee03698 | /src/probs2015/prob21Equip.java | 987f83c8042ead347c8e9197a126ca92948f5f14 | [
"MIT"
] | permissive | hidny/adventofcode | 96a241bbb6c41f9613af0867f079d5e5fdd44754 | 16aa54cebb16a9d6e684d797035ecd70f013f5bd | refs/heads/master | 2023-01-04T07:13:39.857451 | 2022-12-25T19:31:17 | 2022-12-25T19:31:17 | 75,837,443 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 452 | java | package probs2015;
import java.io.File;
import java.util.ArrayList;
import java.util.Scanner;
public class prob21Equip {
private int cost;
private int damage;
private int armor;
public prob21Equip(int cost, int damage, int armor) {
this.cost = cost;
this.damage = damage;
this.armor = armor;
}
public int getCost() {
return cost;
}
public int getDamage() {
return damage;
}
public int getArmor() {
return armor;
}
}
| [
"mtardibuono@gmail.com"
] | mtardibuono@gmail.com |
7e7ffa2d643c52bde04750cf7243cda883c6840c | 377f1e6107dcf0beec544f9c662e63d990645aca | /test/src/main/java/com/ryan/test/TestApplication.java | 47e6b0854f605f2c8c9eaeefd17614d1525e8d50 | [] | no_license | Raofy/security | 3fb6010d74c162419644f8f65a5f15fa9debc223 | 68021f1a5425c754218203c17e73803bc9a94ea4 | refs/heads/master | 2022-12-18T00:54:20.989456 | 2020-09-21T05:41:14 | 2020-09-21T05:41:14 | 296,481,308 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java | package com.ryan.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TestApplication {
public static void main(String[] args) {
SpringApplication.run(TestApplication.class, args);
}
}
| [
"1312170600@qq.com"
] | 1312170600@qq.com |
ea3369fe7c12cdefe9150246f2236dc63bf968ad | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.qqlite/assets/exlibs.1.jar/classes.jar/bdw.java | 3bf29f50bc462acee016744adc69f922d80874f2 | [] | 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 | 609 | java | import android.view.View;
import android.view.View.OnClickListener;
import com.tencent.mobileqq.activity.QQMapActivity;
public class bdw
implements View.OnClickListener
{
public bdw(QQMapActivity paramQQMapActivity) {}
public void onClick(View paramView)
{
if (this.a.i)
{
this.a.o();
return;
}
this.a.setResult(-1, this.a.a());
this.a.finish();
this.a.d();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.qqlite\assets\exlibs.1.jar\classes.jar
* Qualified Name: bdw
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
e4c2278a5d9d0c89dfe2c4ac8119264a0c9b0648 | 76b790c76740fde5ecd0556319b1a0be3efa3fa5 | /app/src/main/java/qtc/project/banhangnhanh/sale/view/fragment/product/detail/FragmentProductSaleDetailView.java | f6b7d9edc5ecd999e664bd5dbbb87c1153e63bd0 | [] | no_license | dinhdeveloper/banhangnhanh | 273d052b78a99edb072e9d5cda7732f2f69cda70 | 14a1f8d56b99225ed0c4558563594ffd6ebeb9d9 | refs/heads/master | 2022-12-11T10:59:25.749856 | 2020-09-07T17:13:59 | 2020-09-07T17:13:59 | 293,586,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,238 | java | package qtc.project.banhangnhanh.sale.view.fragment.product.detail;
import android.graphics.Bitmap;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.journeyapps.barcodescanner.BarcodeEncoder;
import b.laixuantam.myaarlibrary.base.BaseUiContainer;
import b.laixuantam.myaarlibrary.base.BaseView;
import qtc.project.banhangnhanh.R;
import qtc.project.banhangnhanh.activity.SaleHomeActivity;
import qtc.project.banhangnhanh.admin.dependency.AppProvider;
import qtc.project.banhangnhanh.helper.Consts;
import qtc.project.banhangnhanh.sale.model.ProductModel;
public class FragmentProductSaleDetailView extends BaseView<FragmentProductSaleDetailView.UIContainer> implements FragmentProductSaleDetailViewInterface{
SaleHomeActivity activity;
FragmentProductSaleDetailViewCallback callback;
String BARCODE,QRCODE ;
String PRODUCT_NAME ;
@Override
public void init(SaleHomeActivity activity, FragmentProductSaleDetailViewCallback callback) {
this.activity = activity;
this.callback = callback;
ui.imageNavLeft.setOnClickListener(v -> {
if (callback!=null)
callback.onBackP();
});
onClick();
}
private void onClick() {
//BARCODE
ui.imvInBarcode.setOnClickListener(v -> {
if (callback!=null)
{
callback.inBarCode(PRODUCT_NAME,BARCODE,"0");
}
});
ui.imvInQrCode.setOnClickListener(v -> {
if (callback!=null)
{
callback.inBarCode(PRODUCT_NAME,QRCODE,"1");
}
});
}
@Override
public void initView(ProductModel model) {
if (model!=null){
PRODUCT_NAME = model.getName();
BARCODE = model.getBarcode();
QRCODE = model.getQr_code();
ui.title_header.setText(model.getName());
AppProvider.getImageHelper().displayImage(Consts.HOST_API+model.getImage(),ui.imageProduct,null,R.drawable.imageloading);
ui.nameProduct.setText(model.getName());
ui.idProduct.setText(model.getId_code());
ui.priceProduct.setText(model.getSale_price());
ui.tonKho.setText(model.getTotal_stock());
ui.tonKhoAnToan.setText(model.getQuantity_safetystock());
ui.description.setText(model.getDescription());
ui.tvBarCode.setText(model.getBarcode());
ui.tvQrcode.setText(model.getQr_code());
try {
genarateScanBarcode(model.getBarcode());
genarateScanQrcode(model.getQr_code());
}catch (Exception e){
Log.e("Ex",e.getMessage());
}
ui.btnUpdate.setOnClickListener(v -> {
ProductModel productModel = new ProductModel();
productModel.setId(model.getId());
productModel.setName(ui.nameProduct.getText().toString());
productModel.setDescription(ui.description.getText().toString());
productModel.setQuantity_safetystock(ui.tonKhoAnToan.getText().toString());
if (callback != null) {
callback.updateProductDetail(productModel);
}
});
}
}
@Override
public void showUpdateSuccess() {
LayoutInflater layoutInflater = activity.getLayoutInflater();
View popupView = layoutInflater.inflate(R.layout.alert_dialog_success, null);
TextView title_text = popupView.findViewById(R.id.title_text);
TextView content_text = popupView.findViewById(R.id.content_text);
Button custom_confirm_button = popupView.findViewById(R.id.custom_confirm_button);
title_text.setText("Xác nhận");
content_text.setText("Bạn đã cập nhật thành công!");
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
alert.setView(popupView);
AlertDialog dialog = alert.create();
dialog.setCanceledOnTouchOutside(false);
dialog.show();
custom_confirm_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
}
public void genarateScanBarcode(String resultCode){
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
try {
BitMatrix bitMatrix;
bitMatrix = multiFormatWriter.encode(resultCode, BarcodeFormat.CODE_128, 300, 150);
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
Bitmap bitmap = barcodeEncoder.createBitmap(bitMatrix);
ui.barCode.setImageBitmap(bitmap);
} catch (WriterException e) {
e.printStackTrace();
}
}
public void genarateScanQrcode(String resultCode){
MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
try {
BitMatrix bitMatrix;
bitMatrix = multiFormatWriter.encode(resultCode, BarcodeFormat.QR_CODE, 300, 300);
BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
Bitmap bitmap = barcodeEncoder.createBitmap(bitMatrix);
ui.qrCode.setImageBitmap(bitmap);
} catch (WriterException e) {
e.printStackTrace();
}
}
@Override
public BaseUiContainer getUiContainer() {
return new FragmentProductSaleDetailView.UIContainer();
}
@Override
public int getViewId() {
return R.layout.layout_fragment_product_detail_sale;
}
public class UIContainer extends BaseUiContainer {
@UiElement(R.id.imageNavLeft)
public ImageView imageNavLeft;
@UiElement(R.id.title_header)
public TextView title_header;
@UiElement(R.id.imageProduct)
public ImageView imageProduct;
@UiElement(R.id.nameProduct)
public EditText nameProduct;
@UiElement(R.id.idProduct)
public TextView idProduct;
@UiElement(R.id.priceProduct)
public TextView priceProduct;
@UiElement(R.id.tonKho)
public TextView tonKho;
@UiElement(R.id.tonKhoAnToan)
public EditText tonKhoAnToan;
@UiElement(R.id.description)
public EditText description;
@UiElement(R.id.qrCode)
public ImageView qrCode;
@UiElement(R.id.barCode)
public ImageView barCode;
@UiElement(R.id.tvBarCode)
public TextView tvBarCode;
@UiElement(R.id.tvQrcode)
public TextView tvQrcode;
@UiElement(R.id.imvInBarcode)
public ImageView imvInBarcode;
@UiElement(R.id.imvInQrCode)
public ImageView imvInQrCode;
@UiElement(R.id.btnUpdate)
public LinearLayout btnUpdate;
}
}
| [
"dinhtrancntt@gmail.com"
] | dinhtrancntt@gmail.com |
fe7aab306b690344a8ffd2ebcb653d21c0e8ad64 | 66c431d3cce76f5518145f0752276c33b83b8d32 | /src/test/java/com/maxdemarzi/users/CreateFollowsTest.java | c879430edb52c0d352b23ad4bacd4cf4dd139e75 | [
"MIT"
] | permissive | PXZ-cecilie/grittier_ext | 2e34727e450fd38a44ebb77c0992b8a19b6e5231 | 544b19d855294817d1ddc5e66c6f6a874ee326e8 | refs/heads/master | 2023-03-07T12:36:31.010744 | 2020-04-07T19:11:46 | 2020-04-07T19:11:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,316 | java | package com.maxdemarzi.users;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.harness.junit.rule.Neo4jRule;
import org.neo4j.test.server.HTTP;
import java.util.HashMap;
import static com.maxdemarzi.Properties.NAME;
import static com.maxdemarzi.Properties.USERNAME;
public class CreateFollowsTest {
@Rule
public Neo4jRule neo4j = new Neo4jRule()
.withFixture(FIXTURE)
.withUnmanagedExtension("/v1", Users.class);
@Test
public void shouldCreateFollows() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/follows/jexp").toString());
HashMap actual = response.content();
Assert.assertEquals(expected, actual);
}
@Test
public void shouldNotCreateFollowsBlocked() {
HTTP.POST(neo4j.httpURI().resolve("/v1/schema/create").toString());
HTTP.Response response = HTTP.POST(neo4j.httpURI().resolve("/v1/users/maxdemarzi/follows/laexample").toString());
HashMap actual = response.content();
Assert.assertEquals(400, response.status());
Assert.assertEquals("Cannot follow blocked User.", actual.get("error"));
Assert.assertFalse(actual.containsKey(USERNAME));
Assert.assertFalse(actual.containsKey(NAME));
}
private static final String FIXTURE =
"CREATE (max:User {username:'maxdemarzi', " +
"email: 'max@neo4j.com', " +
"name: 'Max De Marzi'," +
"password: 'swordfish'})" +
"CREATE (jexp:User {username:'jexp', " +
"email: 'michael@neo4j.com', " +
"name: 'Michael Hunger'," +
"password: 'tunafish'})" +
"CREATE (laeg:User {username:'laexample', " +
"email: 'luke@neo4j.com', " +
"hash: 'hash', " +
"name: 'Luke Gannon'," +
"password: 'cuddlefish'})" +
"CREATE (laeg)-[:BLOCKS {time:1490140299}]->(max)";
private static final HashMap<String, Object> expected = new HashMap<String, Object>() {{
put("username", "jexp");
put("name", "Michael Hunger");
}};
}
| [
"maxdemarzi@hotmail.com"
] | maxdemarzi@hotmail.com |
c99eb40b79c33ba48c7477fb1c9b5ab9f204262a | 27940e6113e54f8c66eb951af1f35e8ec4c3884c | /app/src/main/java/com/wrk/myshoppingmall/adapter/search/CommonAdapter.java | 71a5e4704835ce2c3950008c879537c7021a95c6 | [] | no_license | tsj123/ShoppingMall | bd8373ab97127104848503a11b57c8c658bed33a | dd4b99d71bb82c2af0f5d2688660dd0993fe6425 | refs/heads/master | 2021-06-08T13:45:00.837656 | 2016-11-28T10:47:09 | 2016-11-28T10:47:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,848 | java | package com.wrk.myshoppingmall.adapter.search;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.wrk.myshoppingmall.R;
import java.util.List;
/**
* Created by MrbigW on 2016/10/6.
* weChat:1024057635
* Github:MrbigW
* Usage: 热门搜索和历史记录的Adapter
* -------------------=.=------------------------
*/
public class CommonAdapter extends BaseAdapter {
private Context context;
private List<String> datas;
public CommonAdapter(Context context, List<String> datas) {
this.context = context;
this.datas = datas;
}
@Override
public int getCount() {
//最大返回40条数据
return Math.min(40, datas.size());
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = View.inflate(context, R.layout.item_search, null);
holder.tv_item_hint = (TextView) convertView.findViewById(R.id.tv_item_hint);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
String data = datas.get(position);
holder.tv_item_hint.setText(data);
holder.tv_item_hint.setMaxLines(2);
return convertView;
}
public void updateRecordList(List<String> historySearchDatas) {
this.datas = historySearchDatas;
notifyDataSetChanged();
}
static class ViewHolder {
TextView tv_item_hint;
}
}
| [
"1024057635@qq.com"
] | 1024057635@qq.com |
e8e8312616e3c4efe4455951e7bdece72cf3f82f | c90297ad68c36c5560fed61261e96363cdc12341 | /LS360ApiGatewayService/src/main/java/com/softech/ls360/api/gateway/service/model/response/LeftMenu.java | 57e49390b7377d95b01b1cedd4d4d65c568c2c09 | [] | no_license | quickstart75/gateway-final | c2bddf90ba469544e6a239ca14f5a8c555fee2db | e9ce8280f1358de8d4d16cae40826517e4f948af | refs/heads/master | 2022-12-21T22:03:44.418660 | 2020-01-28T14:41:44 | 2020-01-28T14:41:44 | 234,112,794 | 0 | 1 | null | 2022-12-16T10:32:16 | 2020-01-15T15:37:34 | Java | UTF-8 | Java | false | false | 1,832 | java | package com.softech.ls360.api.gateway.service.model.response;
import java.util.Objects;
import java.util.ArrayList;
import java.util.List;
/**
* Left panel menu
*/
public class LeftMenu {
private List<MenuItem> child = new ArrayList<MenuItem>();
private String label = "Dashboard";
/**
* Main Menu Item
**/
public LeftMenu child(List<MenuItem> child) {
this.child = child;
return this;
}
public List<MenuItem> getChild() {
return child;
}
public void setChild(List<MenuItem> child) {
this.child = child;
}
/**
* Label for Left Panel
**/
public LeftMenu label(String label) {
this.label = label;
return this;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LeftMenu leftMenu = (LeftMenu) o;
return Objects.equals(this.child, leftMenu.child) &&
Objects.equals(this.label, leftMenu.label);
}
@Override
public int hashCode() {
return Objects.hash(child, label);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class LeftMenu {\n");
sb.append(" child: ").append(toIndentedString(child)).append("\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"syed.zeeshan@360training.com"
] | syed.zeeshan@360training.com |
799499fef947035884499cf422a3b87d30f3c95b | 692a7b9325014682d72bd41ad0af2921a86cf12e | /iWiFi/src/com/tencent/weibo/sdk/android/network/HttpReqWeiBo.java | 5ddd0105a2f41282a3a61ee851a7a00d02e37599 | [] | no_license | syanle/WiFi | f76fbd9086236f8a005762c1c65001951affefb6 | d58fb3d9ae4143cbe92f6f893248e7ad788d3856 | refs/heads/master | 2021-01-20T18:39:13.181843 | 2015-10-29T12:38:57 | 2015-10-29T12:38:57 | 45,156,955 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,741 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.tencent.weibo.sdk.android.network;
import android.content.Context;
import android.util.Log;
import com.tencent.weibo.sdk.android.api.util.JsonUtil;
import com.tencent.weibo.sdk.android.model.BaseVO;
import com.tencent.weibo.sdk.android.model.ModelResult;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.json.JSONArray;
import org.json.JSONObject;
// Referenced classes of package com.tencent.weibo.sdk.android.network:
// HttpReq, ReqParam, HttpCallback
public class HttpReqWeiBo extends HttpReq
{
private Context mContext;
private Integer mResultType;
private Class mTargetClass;
private Class mTargetClass2;
public HttpReqWeiBo(Context context, String s, HttpCallback httpcallback, Class class1, String s1, Integer integer)
{
mResultType = Integer.valueOf(0);
mContext = context;
mHost = "192.168.1.100";
mPort = 8088;
mUrl = s;
mCallBack = httpcallback;
mTargetClass = class1;
mResultType = integer;
mMethod = s1;
}
protected Object processResponse(InputStream inputstream)
throws Exception
{
ModelResult modelresult = new ModelResult();
if (inputstream == null) goto _L2; else goto _L1
_L1:
BufferedReader bufferedreader;
Object obj1;
inputstream = new InputStreamReader(inputstream);
bufferedreader = new BufferedReader(inputstream);
obj1 = new StringBuffer();
_L6:
String s = bufferedreader.readLine();
if (s != null) goto _L4; else goto _L3
_L3:
bufferedreader.close();
inputstream.close();
Log.d("relst", ((StringBuffer) (obj1)).toString());
if (((StringBuffer) (obj1)).toString().indexOf("errcode") != -1 || ((StringBuffer) (obj1)).toString().indexOf("access_token") == -1)
{
break; /* Loop/switch isn't completed */
}
modelresult.setObj(((StringBuffer) (obj1)).toString());
_L2:
return modelresult;
_L4:
((StringBuffer) (obj1)).append(s);
if (true) goto _L6; else goto _L5
_L5:
Object obj = new JSONObject(((StringBuffer) (obj1)).toString());
inputstream = null;
if (mTargetClass != null)
{
inputstream = (BaseVO)mTargetClass.newInstance();
}
obj1 = ((JSONObject) (obj)).getString("errcode");
String s1 = ((JSONObject) (obj)).getString("msg");
if (obj1 != null && "0".equals(obj1))
{
modelresult.setSuccess(true);
switch (mResultType.intValue())
{
default:
return modelresult;
case 0: // '\0'
inputstream = JsonUtil.jsonToObject(mTargetClass, ((JSONObject) (obj)));
obj = new ArrayList();
((List) (obj)).add(inputstream);
modelresult.setList(((List) (obj)));
return modelresult;
case 1: // '\001'
inputstream = inputstream.analyseHead(((JSONObject) (obj)));
obj = (JSONArray)inputstream.get("array");
obj = JsonUtil.jsonToList(mTargetClass, ((JSONArray) (obj)));
int i;
int j;
int k;
boolean flag;
if (inputstream.get("total") == null)
{
i = 0;
} else
{
i = ((Integer)inputstream.get("total")).intValue();
}
if (inputstream.get("p") == null)
{
j = 1;
} else
{
j = ((Integer)inputstream.get("p")).intValue();
}
if (inputstream.get("ps") == null)
{
k = 1;
} else
{
k = ((Integer)inputstream.get("ps")).intValue();
}
flag = ((Boolean)inputstream.get("isLastPage")).booleanValue();
modelresult.setList(((List) (obj)));
modelresult.setTotal(Integer.valueOf(i).intValue());
modelresult.setP(Integer.valueOf(j).intValue());
modelresult.setPs(Integer.valueOf(k).intValue());
modelresult.setLastPage(flag);
return modelresult;
case 2: // '\002'
modelresult.setObj(JsonUtil.jsonToObject(mTargetClass, ((JSONObject) (obj))));
return modelresult;
case 3: // '\003'
inputstream = JsonUtil.jsonToObject(mTargetClass, ((JSONObject) (obj)));
obj = ((JSONObject) (obj)).getJSONArray("result_list");
obj = JsonUtil.jsonToList(mTargetClass2, ((JSONArray) (obj)));
modelresult.setObj(inputstream);
modelresult.setList(((List) (obj)));
return modelresult;
case 4: // '\004'
modelresult.setObj(obj);
return modelresult;
}
} else
{
modelresult.setSuccess(false);
modelresult.setError_message(s1);
return modelresult;
}
}
public void setReq(String s)
throws Exception
{
if ("POST".equals(mMethod))
{
s = new HttpReq.UTF8PostMethod(mUrl);
mParam.toString();
s.setRequestEntity(new ByteArrayRequestEntity(mParam.toString().getBytes("utf-8")));
}
}
protected void setReq(HttpMethod httpmethod)
throws Exception
{
if ("POST".equals(mMethod))
{
httpmethod = (PostMethod)httpmethod;
mParam.toString();
httpmethod.addParameter("Connection", "Keep-Alive");
httpmethod.addParameter("Charset", "UTF-8");
httpmethod.setRequestEntity(new ByteArrayRequestEntity(mParam.toString().getBytes("utf-8")));
}
}
public void setmResultType(Integer integer)
{
mResultType = integer;
}
public void setmTargetClass(Class class1)
{
mTargetClass = class1;
}
public void setmTargetClass2(Class class1)
{
mTargetClass2 = class1;
}
}
| [
"arehigh@gmail.com"
] | arehigh@gmail.com |
9d11cb9cac066675b4ec9bd5c03e32970609c676 | 08355fcbe5c80aedb06d1f5dbc75c9da27cd3201 | /src/main/java/com/bhuwan/spring/di/service/EmailService.java | 8826a9d684c17787252dc2f63a394654e26b7086 | [] | no_license | bhuwang/spring-demo | 7ef6e513fd0efac011c8f7128cc22f7a5c7bfbde | 094cf837328c1f05593449d4c9ba292cca1150e2 | refs/heads/master | 2021-01-10T14:15:06.578260 | 2016-03-04T04:29:49 | 2016-03-04T04:29:49 | 53,106,787 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 456 | java | /**
*
*/
package com.bhuwan.spring.di.service;
/**
* @author bhuwan
*
*/
public class EmailService implements MessageService {
/*
* (non-Javadoc)
*
* @see
* com.bhuwan.spring.di.service.MessageService#sendMessage(java.lang.String,
* java.lang.String)
*/
@Override
public boolean sendMessage(String message, String recipents) {
System.out.println("Email sent to : " + recipents + " with message: " + message);
return true;
}
}
| [
"bhuwangautam@lftechnology.com"
] | bhuwangautam@lftechnology.com |
b429ea66482b06ef41a761a07e960c2e7415dd3e | ea883297b5d038c1e8c35631a6cbcf0da7d17317 | /src/main/java/sfix/msgcodec/message/codec/MessageCodec.java | 6b5daaf5ad043d3de1f9e9d6892b32f75c8e5d62 | [
"MIT"
] | permissive | garyttierney/msgcodec | 54e235903c19cbf45816898096761594fbbe5103 | df25acd8ea67df90fb1299e15272dd34126ab0ad | refs/heads/master | 2016-09-05T20:57:37.437179 | 2015-03-25T23:19:27 | 2015-03-25T23:19:27 | 34,750,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,866 | java | package sfix.msgcodec.message.codec;
import io.netty.buffer.ByteBuf;
import java.util.Collections;
import java.util.Map;
/**
* A codec implementation which handles serialization and deserialization of messages.
*
* @param <D> The discriminator type for messages handled by this codec.
*/
public final class MessageCodec<D> {
/**
* A map of discriminators to message deserializers.
*/
private final Map<D, MessageDeserializer> deserializerMap;
/**
* A map of message object types to message serializers.
*/
private final Map<Class<?>, MessageSerializer> serializerMap;
public MessageCodec(Map<D, MessageDeserializer> deserializerMap, Map<Class<?>, MessageSerializer> serializerMap) {
this.deserializerMap = Collections.unmodifiableMap(deserializerMap);
this.serializerMap = Collections.unmodifiableMap(serializerMap);
}
/**
* Lookup the message class in the {@link #serializerMap} and call its {@link MessageSerializer#serialize} method with the message parameter.
*
* @param message The message to serialize.
* @return The serialized message as a ByteBuf.
*/
public ByteBuf serialize(Object message) {
return serializerMap.get(message.getClass()).serialize(message);
}
/**
* Lookup the message discriminator in the {@link #deserializerMap} and call its {@link MessageDeserializer#deserialize} method with the message ByteBuf parameter.
*
* @param discriminator The discriminator to lookup.
* @param buffer The input buffer.
* @param <T> The type of message to deserialize.
*
* @return The deserialized message instance.
*/
@SuppressWarnings("unchecked")
public <T> T deserialize(D discriminator, ByteBuf buffer) {
return (T) deserializerMap.get(discriminator).deserialize(buffer);
}
}
| [
"gary.tierney@gmx.com"
] | gary.tierney@gmx.com |
14f0b26ff2f3b5690809b156ca168bda2f69782a | 2ec51ec7a480bc82217ba067b055a932f3f9736a | /src/com/yale/test/springmvc/lxf/web/UserController.java | 289fb467a41746fb588f47fc7179a7a452b5170c | [] | no_license | gitking/JavaDemoStudyProject | 03eae3ced81d81330a96d4f87a29c5d11db63686 | 072b2155a2da92d59168a6b73ae4ad045d9d28c0 | refs/heads/master | 2022-05-20T14:24:57.408102 | 2022-03-27T13:45:03 | 2022-03-27T13:45:03 | 100,861,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,005 | java | package com.yale.test.springmvc.lxf.web;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.yale.test.springmvc.lxf.entity.User;
import com.yale.test.springmvc.lxf.service.UserService;
/*
* 编写Controller
* 有了Web应用程序的最基本的结构,我们的重点就可以放在如何编写Controller上。Spring MVC对Controller没有固定的要求,也不需要实现特定的接口。以UserController为例,编写Controller只需要遵循以下要点:
* 总是标记@Controller而不是@Component:
* 一个方法对应一个HTTP请求路径,用@GetMapping或@PostMapping表示GET或POST请求:
* 需要接收的HTTP参数以@RequestParam()标注,可以设置默认值。如果方法参数需要传入HttpServletRequest、HttpServletResponse或者HttpSession,直接添加这个类型的参数即可,Spring MVC会自动按类型传入。
* 返回的ModelAndView通常包含View的路径和一个Map作为Model,但也可以没有Model,例如:
* return new ModelAndView("signin.html"); // 仅View,没有Model
* 返回重定向时既可以写new ModelAndView("redirect:/signin"),也可以直接返回String:
* 如果在方法内部直接操作HttpServletResponse发送响应,返回null表示无需进一步处理:
* public ModelAndView download(HttpServletResponse response) {
byte[] data = ...
response.setContentType("application/octet-stream");
OutputStream output = response.getOutputStream();
output.write(data);
output.flush();
return null;
}
* 对URL进行分组,每组对应一个Controller是一种很好的组织形式,并可以在Controller的class定义出添加URL前缀,例如:
* @Controller
@RequestMapping("/user")
public class UserController {
// 注意实际URL映射是/user/profile
@GetMapping("/profile")
public ModelAndView profile() {
...
}
// 注意实际URL映射是/user/changePassword
@GetMapping("/changePassword")
public ModelAndView changePassword() {
...
}
}
* 实际方法的URL映射总是前缀+路径,这种形式还可以有效避免不小心导致的重复的URL映射。
* 可见,Spring MVC允许我们编写既简单又灵活的Controller实现。
* 练习
* 在注册、登录等功能的基础上增加一个修改口令的页面。
* 小结
* 使用Spring MVC时,整个Web应用程序按如下顺序启动:
* 1.启动Tomcat服务器;
* 2.Tomcat读取web.xml并初始化DispatcherServlet;
* 3.DispatcherServlet创建IoC容器并自动注册到ServletContext中。
* 启动后,浏览器发出的HTTP请求全部由DispatcherServlet接收,并根据配置转发到指定Controller的指定方法处理。
*/
@Controller
public class UserController {
public static final String KEY_USER = "__user__";
final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
UserService userService;
@GetMapping("/")
public ModelAndView index(HttpSession session) {
User user = (User)session.getAttribute(KEY_USER);
Map<String, Object> model = new HashMap<>();
if (user != null) {
model.put("user", user);
}
return new ModelAndView("index.html", model);
}
@GetMapping("/register")
public ModelAndView register() {
return new ModelAndView("register.html");// 仅View,没有Model
}
@PostMapping("/register")
public ModelAndView doRegister(@RequestParam("email")String email, @RequestParam("password")String password,
@RequestParam("name")String name) {
try {
User user = userService.register(email, password, name);
logger.info("user registered: {}", user.getEmail());
} catch (RuntimeException e) {
Map<String, String> info = new HashMap<String, String>();
info.put("eamil", email);
info.put("error", "Register failed");
return new ModelAndView("register.html", info);
}//返回重定向时既可以写new ModelAndView("redirect:/signin"),也可以直接返回String:
return new ModelAndView("redirect:/signin");
}
@GetMapping("/signin")
public ModelAndView signin(HttpSession session) {
User user = (User)session.getAttribute(KEY_USER);
if (user != null) {
return new ModelAndView("redirect:/profile");
}
return new ModelAndView("signin.html");// 仅View,没有Model
}
@PostMapping("/signin")
public ModelAndView doSignin(@RequestParam("email")String email, @RequestParam("password")String password, HttpSession session) {
try {
User user = userService.signin(email, password);
session.setAttribute(KEY_USER, user);
} catch(RuntimeException e) {
Map<String, String> info = new HashMap<String, String>();
info.put("email", email);
info.put("error", "Signin failed");
return new ModelAndView("signin.html", info);
}
return new ModelAndView("redirect:/profile");
}
@GetMapping("profile")
public ModelAndView profile(HttpSession session) {
User user = (User)session.getAttribute(KEY_USER);
if (user == null) {
return new ModelAndView("redirect:/signin");
}
Map<String, Object> info = new HashMap<String, Object>();
info.put("user", user);
return new ModelAndView("profile.html", info);
}
@GetMapping("/sigout")
public String sigout(HttpSession session) {
session.removeAttribute(KEY_USER);
//返回重定向时既可以写new ModelAndView("redirect:/signin"),也可以直接返回String:
return "redirect:/signin";
}
public ModelAndView download() {
//如果在方法内部直接操作HttpServletResponse发送响应,返回null表示无需进一步处理:
return null;
}
}
| [
"yale268sh@163.com"
] | yale268sh@163.com |
be627ec008aa81e9c56aef6fcb8ef23682ac6432 | 3e176296759f1f211f7a8bcfbba165abb1a4d3f1 | /gosu-core-api/src/main/java/gw/lang/reflect/IOptionalParamCapable.java | 31216665c9093c72fd9c527ffe3634f57b5d1fed | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | gosu-lang/old-gosu-repo | 6335ac90cd0c635fdec6360e3e208ba12ac0a39e | 48c598458abd412aa9f2d21b8088120e8aa9de00 | refs/heads/master | 2020-05-18T03:39:34.631550 | 2014-04-21T17:36:38 | 2014-04-21T17:36:38 | 1,303,622 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 582 | java | /*
* Copyright 2013 Guidewire Software, Inc.
*/
package gw.lang.reflect;
import gw.lang.parser.IExpression;
/**
*/
public interface IOptionalParamCapable
{
/**
* @return An array of objects representing the default values for a function's parameters.
* Returns an empty array if there are no default values, otherwise returns an array coresponing
* with default parameter values. If a parameter does not have a default value, it's default value
* is null in the array.
*/
IExpression[] getDefaultValueExpressions();
String[] getParameterNames();
}
| [
"smckinney@guidewire.com"
] | smckinney@guidewire.com |
1313ac60f7b7df4f20318d4b2319ea7139a4309f | 37640c7de997b22e594c0c6054bffee073a47891 | /enip-codec/src/main/java/com/digitalpetri/enip/commands/ListIdentity.java | adc95fd9839cd4f81da907c74c8820b50080af52 | [
"Apache-2.0"
] | permissive | unsun/ethernet-ip | 85a9402fd6a261f7a27e4abfb07a73aa30f3e71e | b51abec6973af82f8450a5472ea4b0695f2decb3 | refs/heads/master | 2021-04-15T09:24:21.978563 | 2017-06-15T00:02:43 | 2017-06-15T00:02:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,055 | java | package com.digitalpetri.enip.commands;
import java.util.Optional;
import com.digitalpetri.enip.cpf.CipIdentityItem;
import com.digitalpetri.enip.cpf.CpfItem;
import com.digitalpetri.enip.cpf.CpfPacket;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.DecoderException;
public final class ListIdentity extends Command {
public static final CommandCode COMMAND_CODE = CommandCode.ListIdentity;
private final Optional<CipIdentityItem> identity;
public ListIdentity() {
this(null);
}
public ListIdentity(CipIdentityItem identity) {
super(COMMAND_CODE);
this.identity = Optional.ofNullable(identity);
}
public Optional<CipIdentityItem> getIdentity() {
return identity;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ListIdentity that = (ListIdentity) o;
return identity.equals(that.identity);
}
@Override
public int hashCode() {
return identity.hashCode();
}
public static ByteBuf encode(ListIdentity command, ByteBuf buffer) {
command.getIdentity().ifPresent(identity -> CpfPacket.encode(new CpfPacket(identity), buffer));
return buffer;
}
public static ListIdentity decode(ByteBuf buffer) {
if (buffer.readableBytes() > 0) {
CpfPacket packet = CpfPacket.decode(buffer);
CpfItem[] items = packet.getItems();
if (items.length > 0) {
if (items[0] instanceof CipIdentityItem) {
return new ListIdentity((CipIdentityItem) items[0]);
} else {
throw new DecoderException(
String.format("expected CipIdentityItem; received %s instead",
items[0].getClass().getSimpleName()));
}
} else {
return new ListIdentity();
}
}
return new ListIdentity();
}
}
| [
"kevinherron@gmail.com"
] | kevinherron@gmail.com |
33633d1cfee07c95e8a77ed8ce2a3b24faacebf7 | 0a5bb71fea67b66a8639f7c6bc7aa68f71cd8214 | /ecrm-s/src/main/java/com/maven/service/ActivityRedbagService.java | a55aab3ac9f7503dada66c08f90eefc0d4737785 | [] | no_license | daxingyou/bw | 4e4e100c1428153ccc54d5ded2119840c839841d | b7a3021fe13969510fbcf35b82982617c090e57d | refs/heads/master | 2022-01-07T22:30:09.117772 | 2019-01-14T09:19:06 | 2019-01-14T09:19:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,777 | java | package com.maven.service;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.maven.base.dao.DataSource;
import com.maven.base.service.BaseServcie;
import com.maven.entity.ActivityBetRecord;
import com.maven.entity.ActivityRedbag;
import com.maven.entity.TakeDepositRecord;
@Service
public interface ActivityRedbagService extends BaseServcie<ActivityRedbag>{
/**
* 获取需要投注列表
* @return
*/
@DataSource("slave")
List<ActivityRedbag> selectBetRecord(Map<String, Object> parameter) throws Exception;
/**
* 需要投注列表总数
* @param parameter
* @return
* @throws Exception
*/
@DataSource("slave")
int selectBetRecordCount(Map<String, Object> parameter) throws Exception;
@DataSource("slave")
Map<String, Object> selectBetRecordCountMoney(Map<String, Object> parameter) throws Exception;
/**
* 增加需要打码的记录
* @param amount
* @param brandcode
* @return
* @throws Exception
*/
@DataSource("master")
void addActivityBetRecord(ActivityRedbag activityBetRecord) throws Exception;
@DataSource("master")
void updateActivityBetRecord(ActivityRedbag activityBetRecord) throws Exception;
public Map<String, Object> tc_redbag_regedit(final String __employeecode, final int __enterprisebrandactivitycode, final String loginip, final String fingerprintcode) throws Exception;
public Map<String, Object> tc_redbag(final String __employeecode, final int __enterprisebrandactivitycode, final String loginip) throws Exception;
/**
* 完善资料送红包
*/
public Map<String, Object> tc_redbag_userinfo(final String __employeecode, final int __enterprisebrandactivitycode, final String loginip, final String fingerprintcode) throws Exception;
}
| [
"sunny@gmail.com"
] | sunny@gmail.com |
bc3cd36ab877bf2ab1f630359a94a88debb57791 | bb85a06d3fff8631f5dca31a55831cd48f747f1f | /src/main/business/com/goisan/synergy/workflow/bean/SoftInstall.java | 92379352b27ace9bff0c5a6198619a805d485adb | [] | no_license | lqj12267488/Gemini | 01e2328600d0dfcb25d1880e82c30f6c36d72bc9 | e1677dc1006a146e60929f02dba0213f21c97485 | refs/heads/master | 2022-12-23T10:55:38.115096 | 2019-12-05T01:51:26 | 2019-12-05T01:51:26 | 229,698,706 | 0 | 0 | null | 2022-12-16T11:36:09 | 2019-12-23T07:20:16 | Java | UTF-8 | Java | false | false | 1,965 | java | package com.goisan.synergy.workflow.bean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.goisan.system.bean.BaseBean;
/**
* Created by Administrator on 2017/5/3 0003.
*/
public class SoftInstall extends BaseBean {
private String id;
private String softName;
private String requester;
private String requestDept;
private String requestDate;
private String reason;
private String requestFlag;
private String feedback;
private String feedbackFlag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSoftName() {
return softName;
}
public void setSoftName(String softName) {
this.softName = softName;
}
public String getRequester() {
return requester;
}
public void setRequester(String requester) {
this.requester = requester;
}
public String getRequestDept() {
return requestDept;
}
public void setRequestDept(String requestDept) {
this.requestDept = requestDept;
}
public String getRequestDate() {
return requestDate;
}
public void setRequestDate(String requestDate) {
this.requestDate = requestDate;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getRequestFlag() {
return requestFlag;
}
public void setRequestFlag(String requestFlag) {
this.requestFlag = requestFlag;
}
public String getFeedback() {
return feedback;
}
public void setFeedback(String feedback) {
this.feedback = feedback;
}
public String getFeedbackFlag() {
return feedbackFlag;
}
public void setFeedbackFlag(String feedbackFlag) {
this.feedbackFlag = feedbackFlag;
}
}
| [
"1240414272"
] | 1240414272 |
c79eb21e3d3794b6e65c42c245503c9a11a9834e | 5edf88e2ac091ef261842a1d9b594c358f2e442c | /src/UN_EDIFACT/D96A/C524.java | cd73abed1ff2446e1248ff18aac968884d884250 | [] | no_license | BohseOnkel63/EDIframe | 63700caa7f87eb20cac9e1c4445d5b7d260564b3 | 7385de5c55518fb8ea1e5946529d91de69212601 | refs/heads/master | 2021-07-06T15:33:31.692744 | 2017-10-12T06:12:56 | 2017-10-12T06:12:56 | 35,657,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | package UN_EDIFACT.D96A;
import UN_EDIFACT.CompositeElement;
public class C524 extends CompositeElement {
public E4079 e4079;
public E1131 e1131;
public E3055 e3055;
public E4078 e4078;
public C524() {
this(false, null, null, null, null);
}
public C524(Boolean Mandatory, String s4079, String s1131, String s3055, String s4078) {
super("C524", "HANDLING INSTRUCTIONS", "Instruction for the handling of goods, products or articles in shipment, storage etc.");
this.setMandatory(Mandatory);
e4079 = new E4079();
e1131 = new E1131();
e3055 = new E3055();
e4078 = new E4078();
e4079.setContent(s4079);
e1131.setContent(s1131);
e3055.setContent(s3055);
e4078.setContent(s4078);
addElement(e4079);
addElement(e1131);
addElement(e3055);
addElement(e4078);
}
}
| [
"ilkka.mannelin@iki.fi"
] | ilkka.mannelin@iki.fi |
87613f799eb59f63ac08eb0bf8664ea76be68eb6 | dda53daa18f1274d72ba7f3c11845720c8122d04 | /org.archware.sosadl/src/org/archware/sosadl/generator/Main.java | 2225000284257be9ef176805dcf6339e98f14196 | [] | no_license | gianricardo/sosadl_melange | 3e89569122c89de72885b6bcb4c363d0e6447289 | e8b80ef97132aad0b88466e97f4df637e096af7a | refs/heads/master | 2022-01-02T21:48:01.397818 | 2018-03-01T15:53:21 | 2018-03-01T15:53:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,820 | java | /*
* generated by Xtext
*/
package org.archware.sosadl.generator;
import java.io.File;
import java.util.List;
import org.archware.sosadl.sosADL.SosADL;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.generator.IGenerator;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CheckMode;
import org.eclipse.xtext.validation.IResourceValidator;
import org.eclipse.xtext.validation.Issue;
import org.eclipse.xtext.xbase.lib.IteratorExtensions;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Provider;
public class Main {
static String outputdirectory;
private static String filename;
public static void main(String[] args) {
if (args.length == 0) {
System.err.println("There are no Args");
printhelp();
return;
}
Injector injector = new org.archware.sosadl.SosADLStandaloneSetup().createInjectorAndDoEMFRegistration();
Main main = injector.getInstance(Main.class);
for (int i = 0; i < args.length; i++) {
//System.err.println("arg = '"+args[i]+"'");
File pathfolder = new File(args[i]);
if (args[i].startsWith("-")) {
if (args[i].equals("-d")) {
System.out.println("option -d :Translate all file in folder to IOSTS");
if (args.length > i + 1) {
File path = new File(args[i + 1]);
if (path.isDirectory()) {
outputdirectory = args[i + 1];
if (! outputdirectory.endsWith("/")) {
outputdirectory += "/";
}
System.out.print(outputdirectory);
i++;
} else {
System.err.println("Wrong argment: Folder to put file iosts expected after -d");
System.exit(1);
}
} else {
System.err.println("Not enough argment: Folder to put file iosts expected after -d");
System.exit(1);
}
} else if (args[i].equals("-s")) {
File directory = new File(args[i + 1]);
if (directory.exists()) {
File[] listOfFile = directory.listFiles();
for (int f = 0; f < listOfFile.length; f++) {
if (listOfFile[f].isFile()) {
filename = listOfFile[f].getName();
if (filename.endsWith("sosadl")) {
System.out.println("file" + listOfFile[f].getName());
}
} else {
System.err.print("Wrong argment : Folder expected");
System.exit(1);
}
}
System.exit(0);
} else {
System.err.println("Wrong argment: Folder doesn't exist");
System.exit(1);
}
} else if (args[i].equals("--help")) {
printhelp();
System.exit(1);
}
} else if (pathfolder.isDirectory()) {
try {
File[] listOfFile = pathfolder.listFiles();
for (int j = 0; j < listOfFile.length; j++) {
if (listOfFile[j].isFile()) {
filename = listOfFile[j].getName();
if (filename.endsWith("sosadl")) {
System.out.println("file" + listOfFile[j].getName());
main.runGenerator(listOfFile[j].getAbsoluteFile().toString());
}
} else {
System.err.print("Wrong argment : Folder include SOSADL file expected");
}
}
} catch (RuntimeException a) {
a.printStackTrace();
System.err.println("Not enough argment : Folder include SOSADL file expected ");
System.exit(1);
}
} else if (args[i].endsWith("sosadl")) {
//System.err.println("runGenerator('"+args[i]+"')");
main.runGenerator(args[i]);
} else {
System.err.println("Wrong argment");
printhelp();
System.exit(1);
}
}
}
@Inject
private Provider<ResourceSet> resourceSetProvider;
@Inject
private IResourceValidator validator;
@Inject
private IGenerator generator;
@Inject
private JavaIoFileSystemAccess fileAccess;
protected void runGenerator(String filename) {
// load the resource
ResourceSet set = resourceSetProvider.get();
Resource resource = set.getResource(URI.createURI(filename), true);
// validate the resource
List<Issue> list = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl);
if (!list.isEmpty()) {
for (Issue issue : list) {
System.err.println(issue);
}
return;
}
if (outputdirectory != null) {
fileAccess.setOutputPath(outputdirectory);
} else {
TreeIterator<EObject> _allContents = resource.getAllContents();
Iterable<EObject> _iterable = IteratorExtensions.<EObject> toIterable(_allContents);
Iterable<SosADL> _filter = Iterables.<SosADL> filter(_iterable, SosADL.class);
for (final SosADL e : _filter) {
Resource eResource = e.eResource();
URI _uRI = eResource.getURI();
//String resourceFilename = _uRI.trimFileExtension().lastSegment();
String _sourceDir = _uRI.trimSegments(1).toString();
fileAccess.setOutputPath(_sourceDir);
// }
}
}
// configure and start the generator
generator.doGenerate(resource, fileAccess);
System.out.println("Code generation finished.");
}
public static void printhelp() {
System.err.println("Utilisation : sosadlcli/sosadl2iosts.sh [OPTION]... [FILE]..OR..[FOLDER]... ");
System.err.println("Translate file SOSADL to IOSTS");
System.err.println("");
System.err.println("-d [FOLDER] Translate file SOSADL to IOSTS and put in this folder ");
System.err.println(
" with out this option all IOSTS files translated will located in the same location");
System.err.println("-s [FOLDER] Display all SOSADL file in Folder");
System.err.println("");
System.err.println(" --help Display how to use");
}
}
| [
"eduafsilva@gmail.com"
] | eduafsilva@gmail.com |
6c2e288918302b38b85b8a92f3d4eefdcd59da14 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes4.dex_source_from_JADX/com/facebook/feed/autoplay/VideoPlayerView.java | 48438bfd001aa38e24ece9bb99b96f9970d68ff4 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 331 | java | package com.facebook.feed.autoplay;
import com.facebook.video.analytics.VideoAnalytics.EventTriggerType;
/* compiled from: preliminaryProfilePicture */
public interface VideoPlayerView {
void mo359a(EventTriggerType eventTriggerType);
void mo360a(EventTriggerType eventTriggerType, int i);
int getSeekPosition();
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
232d0ea717a52105441a4a25fa313897c44f84b9 | ebdcaff90c72bf9bb7871574b25602ec22e45c35 | /modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/ProductAdwordsLabels.java | f4b839aee0fafcf9f020a647bb6bbae50a037bc7 | [
"Apache-2.0"
] | permissive | ColleenKeegan/googleads-java-lib | 3c25ea93740b3abceb52bb0534aff66388d8abd1 | 3d38daadf66e5d9c3db220559f099fd5c5b19e70 | refs/heads/master | 2023-04-06T16:16:51.690975 | 2018-11-15T20:50:26 | 2018-11-15T20:50:26 | 158,986,306 | 1 | 0 | Apache-2.0 | 2023-04-04T01:42:56 | 2018-11-25T00:56:39 | Java | UTF-8 | Java | false | false | 5,119 | java | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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.
/**
* ProductAdwordsLabels.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201809.cm;
/**
* An {@code adwords labels} string. Not supported by campaigns of
* {@link AdvertisingChannelType#SHOPPING} so is only used in {@link
* ProductScope}s.
*/
public class ProductAdwordsLabels extends com.google.api.ads.adwords.axis.v201809.cm.ProductDimension implements java.io.Serializable {
/* <span class="constraint StringLength">This string must not
* be empty.</span> */
private java.lang.String value;
public ProductAdwordsLabels() {
}
public ProductAdwordsLabels(
java.lang.String productDimensionType,
java.lang.String value) {
super(
productDimensionType);
this.value = value;
}
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
.omitNullValues()
.add("productDimensionType", getProductDimensionType())
.add("value", getValue())
.toString();
}
/**
* Gets the value value for this ProductAdwordsLabels.
*
* @return value * <span class="constraint StringLength">This string must not
* be empty.</span>
*/
public java.lang.String getValue() {
return value;
}
/**
* Sets the value value for this ProductAdwordsLabels.
*
* @param value * <span class="constraint StringLength">This string must not
* be empty.</span>
*/
public void setValue(java.lang.String value) {
this.value = value;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof ProductAdwordsLabels)) return false;
ProductAdwordsLabels other = (ProductAdwordsLabels) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.value==null && other.getValue()==null) ||
(this.value!=null &&
this.value.equals(other.getValue())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getValue() != null) {
_hashCode += getValue().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(ProductAdwordsLabels.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "ProductAdwordsLabels"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "value"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
01b9362ea30ee657b4e2b1ef94e7c4590d15017c | 1d2cee48a790b3927cc0497fd72a6368c6cfdd18 | /src/main/java/com/hankcs/hanlp/model/perceptron/feature/ImmutableFeatureHashMap.java | bf44ef8e4039458c56f4243a083482b495374617 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jiangcoder/HanLP | 4cb0df97e21ce3c9ce083cd3aefc01319be6629a | 1662ae72b1dd1641aaebdbb5dd0eab00e47f8f39 | refs/heads/master | 2021-04-06T11:40:53.310195 | 2018-03-14T04:55:56 | 2018-03-14T04:55:56 | 125,150,063 | 0 | 0 | null | 2018-03-14T03:30:54 | 2018-03-14T03:30:53 | null | UTF-8 | Java | false | false | 1,407 | java | /*
* <summary></summary>
* <author>Hankcs</author>
* <email>me@hankcs.com</email>
* <create-date>2016-09-05 PM8:39</create-date>
*
* <copyright file="ImmutableFeatureHashMap.java" company="码农场">
* Copyright (c) 2008-2016, 码农场. All Right Reserved, http://www.hankcs.com/
* This source is subject to Hankcs. Please contact Hankcs to get more information.
* </copyright>
*/
package com.hankcs.hanlp.model.perceptron.feature;
import com.hankcs.hanlp.model.perceptron.tagset.TagSet;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author hankcs
*/
public class ImmutableFeatureHashMap extends ImmutableFeatureMap
{
public Map<String, Integer> featureIdMap;
public ImmutableFeatureHashMap(Map<String, Integer> featureIdMap, TagSet tagSet)
{
super(featureIdMap.size(), tagSet);
this.featureIdMap = featureIdMap;
}
public ImmutableFeatureHashMap(Set<Map.Entry<String, Integer>> entrySet, TagSet tagSet)
{
super(entrySet.size(), tagSet);
this.featureIdMap = new HashMap<String, Integer>();
for (Map.Entry<String, Integer> entry : entrySet)
{
featureIdMap.put(entry.getKey(), entry.getValue());
}
}
@Override
public int idOf(String string)
{
Integer id = featureIdMap.get(string);
if (id == null) return -1;
return id;
}
} | [
"jfservice@126.com"
] | jfservice@126.com |
5113f0ac48d22535e6be5521aaa2fad7ee309389 | a7c85a1e89063038e17ed2fa0174edf14dc9ed56 | /spring-aop-perf-tests/src/main/java/coas/perf/ComplexCondition150/Advice116.java | b35c63b06b81bd5ea9122b9dc78a0b83d0cb8d29 | [] | no_license | pmaslankowski/java-contracts | 28b1a3878f68fdd759d88b341c8831716533d682 | 46518bb9a83050956e631faa55fcdf426589830f | refs/heads/master | 2021-03-07T13:15:28.120769 | 2020-09-07T20:06:31 | 2020-09-07T20:06:31 | 246,267,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java |
package coas.perf.ComplexCondition150;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;
import coas.perf.ComplexCondition150.Subject150;
@Aspect
@Component("Advice_150_116_cc")
public class Advice116 {
@Around("execution(* coas.perf.ComplexCondition150.Subject150.*(..)) and (execution(* *.junk0(..)) or execution(* *.junk1(..)) or execution(* *.junk2(..)) or execution(* *.junk3(..)) or execution(* *.junk4(..)) or execution(* *.junk5(..)) or execution(* *.junk6(..)) or execution(* *.junk7(..)) or execution(* *.junk8(..)) or execution(* *.junk9(..)) or execution(* *.junk10(..)) or execution(* *.junk11(..)) or execution(* *.junk12(..)) or execution(* *.junk13(..)) or execution(* *.junk14(..)) or execution(* *.junk15(..)) or execution(* *.junk16(..)) or execution(* *.junk17(..)) or execution(* *.junk18(..)) or execution(* *.junk19(..)) or execution(* *.junk20(..)) or execution(* *.junk21(..)) or execution(* *.junk22(..)) or execution(* *.junk23(..)) or execution(* *.junk24(..)) or execution(* *.junk25(..)) or execution(* *.junk26(..)) or execution(* *.junk27(..)) or execution(* *.junk28(..)) or execution(* *.junk29(..)) or execution(* *.target(..)))")
public Object onTarget(ProceedingJoinPoint joinPoint) throws Throwable {
int res = (int) joinPoint.proceed();
for (int i=0; i < 1000; i++) {
if (res % 2 == 0) {
res /= 2;
} else {
res = 2 * res + 1;
}
}
return res;
}
}
| [
"pmaslankowski@gmail.com"
] | pmaslankowski@gmail.com |
690f4c434b468305edfe0106f97542ad7359cb73 | ba883df1628d64d5b5d92f39fa19e73d6d3b1244 | /MoTE/fr.tpt.mem4csd.mtbench.aadl2aadl.mote/src-gen/fr/tpt/mem4csd/mtbench/aadl2aadl/mote/generated/subcomponent2subcomponent.java | b8e5af90a847b9ff2d939278e68bf2e2f5f79955 | [] | no_license | INCMOTRANS-Benchmark/IMTBENCH | d10f3f748095dddb952d0c7f163b5a39fdee8128 | 14728ddb1e3681c43bed87b2adfe464d1208a1bb | refs/heads/master | 2022-11-20T00:21:26.974656 | 2020-07-21T15:06:48 | 2020-07-21T15:06:48 | 281,428,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 517 | java | /**
*/
package fr.tpt.mem4csd.mtbench.aadl2aadl.mote.generated;
import de.mdelab.mltgg.mote2.operationalTGG.OperationalRuleGroup;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>subcomponent2subcomponent</b></em>'.
* <!-- end-user-doc -->
*
*
* @see fr.tpt.mem4csd.mtbench.aadl2aadl.mote.generated.GeneratedPackage#getsubcomponent2subcomponent()
* @model
* @generated
*/
public interface subcomponent2subcomponent extends OperationalRuleGroup {
} // subcomponent2subcomponent
| [
"mkaouar.hana@gmail.com"
] | mkaouar.hana@gmail.com |
1335c982663cbf38d7028f0dd70298b23cbd45b8 | 246d979f10a87a9e7269b4de4f0577a545eb6885 | /src/main/java/application/CycleActionManager.java | 7ce174492d17baf177376b645b15f1f3f8d96ca7 | [
"MIT"
] | permissive | AppLoidx/bcomp-extended | e960970325fa2a55462cdf60737cd1d4394a44ac | ad556afaefa69a87ed976b8869d0fa07b93a0c6f | refs/heads/master | 2022-12-23T01:00:18.218134 | 2020-02-04T17:44:14 | 2020-02-04T17:44:14 | 183,970,341 | 32 | 2 | MIT | 2022-12-09T12:39:38 | 2019-04-28T23:39:14 | Java | UTF-8 | Java | false | false | 825 | java | package application;
import ru.ifmo.cs.bcomp.CPU;
/**
* @author Arthur Kupriyanov
*/
public class CycleActionManager {
private static GUI gui;
public static void onInterruptCycle(){
if (gui==null){
System.err.println("gui не инициализирован [CycleActionManager]");
return;
}
CPU cpu = gui.getCPU();
gui.getComponentManager().getRegisterView(CPU.Reg.ADDR);
int addr = cpu.getRegister(CPU.Reg.IP).getValue();
if (Debugger.checkIsMarked(addr)){
if (1 == cpu.getStateValue(7)){ // если активный инвертируем
gui.getComponentManager().cmdInvertRunState();
}
}
}
public static void setGui(GUI gui){
CycleActionManager.gui = gui;
}
}
| [
"apploidyakutsk@gmail.com"
] | apploidyakutsk@gmail.com |
f2852898b49c384cdb22ee78312ae4bfe9a5d153 | 9e6175752640891f54aad0dca18fd3bca13b6c45 | /src/main/java/io/jboot/support/metric/reporter/csv/JbootMetricCVRReporterConfig.java | fb05aa9a0d6901085345a200badb1196bad55e3a | [
"Apache-2.0"
] | permissive | c2cn/jboot | 68a28b59d9ee3a413a746ac7cdfc71b51d5161b0 | 66b5b015f1024912c2f95133ae07b89ad00e07b6 | refs/heads/master | 2023-04-19T16:57:52.314575 | 2021-05-08T05:15:33 | 2021-05-08T05:15:33 | 288,644,695 | 0 | 0 | Apache-2.0 | 2021-05-08T05:15:33 | 2020-08-19T05:46:39 | null | UTF-8 | Java | false | false | 1,002 | java | /**
* Copyright (c) 2015-2021, Michael Yang 杨福海 (fuhai999@gmail.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jboot.support.metric.reporter.csv;
import io.jboot.app.config.annotation.ConfigModel;
@ConfigModel(prefix = "jboot.metric.reporter.cvr")
public class JbootMetricCVRReporterConfig {
private String path;
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
}
| [
"fuhai999@gmail.com"
] | fuhai999@gmail.com |
c12d06fab8d3b5591856bbb9f7770323dceec93a | 6a9f0a52a4983921bc6efae7f48b959623e6aab3 | /src/main/java/de/blau/android/presets/PresetField.java | 53159fcf6fdf041534e3b125490800ca10ade084 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | lonvia/osmeditor4android | 7951b3000d31ba16024615de5d130827b798d10a | 07dad33c45546032e887f97201aa9a23e467012a | refs/heads/master | 2022-12-22T13:08:41.118124 | 2020-09-14T17:26:22 | 2020-09-14T17:26:22 | 295,743,840 | 0 | 0 | NOASSERTION | 2020-09-15T13:52:21 | 2020-09-15T13:52:20 | null | UTF-8 | Java | false | false | 8,192 | java | package de.blau.android.presets;
import java.io.IOException;
import org.xmlpull.v1.XmlSerializer;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import ch.poole.poparser.Po;
public abstract class PresetField {
/**
* Key this field is for
*/
final String key;
/**
* Hint to be displayed in a suitable form
*/
private String hint;
/**
* Default value
*/
private String defaultValue;
/**
* Match properties
*/
MatchType matchType = MatchType.KEY_VALUE;
/**
* Is this field is optional
*/
private boolean optional = false;
/**
* Does this key have i18n variants
*/
private boolean i18n = false;
/**
* Translation contexts
*/
private String textContext;
private String valueContext;
/**
* Value type
*/
private ValueType valueType = null;
/**
* Use last as default
*/
private UseLastAsDefaultType useLastAsDefault = UseLastAsDefaultType.FALSE;
/**
* Construct a new PresetField
*
* @param key the key
*/
public PresetField(@NonNull String key) {
this.key = key;
}
/**
* Copy constructor
*
* @param field PresetField to copy
*/
public PresetField(PresetField field) {
this.key = field.key;
this.hint = field.hint;
this.defaultValue = field.defaultValue;
this.matchType = field.matchType;
this.optional = field.optional;
this.setI18n(field.isI18n());
this.textContext = field.textContext;
this.valueContext = field.valueContext;
this.setValueType(field.getValueType());
this.setUseLastAsDefault(field.getUseLastAsDefault());
}
/**
* @return true if optional
*/
public boolean isOptional() {
return optional;
}
/**
* @param optional make this field optional
*/
public void setOptional(boolean optional) {
this.optional = optional;
}
/**
* Return the key for this PresetField
*
* @return a String containing the key
*/
@NonNull
public String getKey() {
return key;
}
/**
* @return the hint
*/
@Nullable
public String getHint() {
return hint;
}
/**
* Set a short description for this tag/field
*
* @param hint the hint to set
*/
void setHint(@Nullable String hint) {
this.hint = hint;
}
/**
* Get the default value for this field
*
* @return the defaultValue
*/
@Nullable
public String getDefaultValue() {
return defaultValue;
}
/**
* Set teh default value for this field
*
* @param defaultValue the defaultValue to set
*/
public void setDefaultValue(@Nullable String defaultValue) {
this.defaultValue = defaultValue;
}
/**
* Set the text translation context
*
* @param textContext the translation context
*/
public void setTextContext(@Nullable String textContext) {
this.textContext = textContext;
}
/**
* Get the text translation context
*
* @return the textContext
*/
@Nullable
String getTextContext() {
return textContext;
}
/**
* Get the value translation context
*
* @return the valueContext
*/
@Nullable
String getValueContext() {
return valueContext;
}
/**
* Set the value translation context
*
* @param valueContext the valueContext to set
*/
void setValueContext(@Nullable String valueContext) {
this.valueContext = valueContext;
}
/**
* Set the match type for this field
*
* @param match the match type
*/
public void setMatchType(@NonNull String match) {
matchType = MatchType.fromString(match);
}
/**
* Set the match type for this field
*
* @param match the match type
*/
public void setMatchType(@Nullable MatchType match) {
matchType = match;
}
/**
* Get the match type for this field
*
* @return the match type
*/
@Nullable
public MatchType getMatchType() {
return matchType;
}
/**
* Set if the previous value should be used as default
*
* @param useLastAsDefault the value to set
*/
public void setUseLastAsDefault(@NonNull UseLastAsDefaultType useLastAsDefault) {
this.useLastAsDefault = useLastAsDefault;
}
/**
* Set if the previous value should be used as default
*
* @param useLastAsDefault the value to set as a String
*/
public void setUseLastAsDefault(@NonNull String useLastAsDefault) {
this.useLastAsDefault = UseLastAsDefaultType.fromString(useLastAsDefault);
}
/**
* Get the value of useLastAsDefault
*
* @return and indication if we should use the last value as default for this field
*/
public UseLastAsDefaultType getUseLastAsDefault() {
return useLastAsDefault;
}
/**
* @return the i18n
*/
boolean isI18n() {
return i18n;
}
/**
* @param i18n the i18n to set
*/
void setI18n(boolean i18n) {
this.i18n = i18n;
}
/**
* @return the valueType
*/
public ValueType getValueType() {
return valueType;
}
/**
* @param type the ValueType as string to set
*/
void setValueType(@Nullable String type) {
if (type == null) {
this.valueType = null;
return;
}
this.valueType = ValueType.fromString(type);
}
/**
* @param type the ValueType to set
*/
void setValueType(@Nullable ValueType type) {
this.valueType = type;
}
/**
* Method that creates a copy of the element
*
* @return a PresetField instance
*/
public abstract PresetField copy();
/**
* Translate a String
*
* @param text the text to translate
* @param po the translation object
* @param context a translation context of null
* @return the translated String
*/
String translate(@NonNull String text, @NonNull Po po, @Nullable String context) {
return context != null ? po.t(context, text) : po.t(text);
}
/**
* Translate the translatable parts of this PresetField
*
* Note this cannot be undone
*
* @param po the object holding the translations
*/
public void translate(@NonNull Po po) {
hint = translate(hint, po, textContext);
}
/**
* Output the field in XML format
*
* @param s an XmlSerialzer instance
* @throws IllegalArgumentException if the serializer encountered an illegal argument
* @throws IllegalStateException if the serializer detects an illegal state
* @throws IOException if writing to the serializer fails
*/
public abstract void toXml(@NonNull XmlSerializer s) throws IllegalArgumentException, IllegalStateException, IOException;
/**
* Output the hint, match, value type and default value fields as a XML attributes
*
* @param s an XmlSerialzer instance
* @throws IOException
*/
protected void standardFieldsToXml(@NonNull XmlSerializer s) throws IOException {
if (hint != null && !"".equals(hint)) {
s.attribute("", Preset.TEXT, hint);
}
if (defaultValue != null && !"".equals(defaultValue)) {
s.attribute("", Preset.DEFAULT, defaultValue);
}
if (matchType != null) {
s.attribute("", Preset.MATCH, matchType.toString());
}
if (valueType != null) {
s.attribute("", Preset.VALUE_TYPE, valueType.toString());
}
}
@Override
public String toString() {
return key + " (" + hint + ") default: " + defaultValue + " match: " + matchType + " opt: " + optional + " i18n: " + isI18n() + " textCtx: "
+ textContext + " valueCtx: " + valueContext + " valueType: " + getValueType();
}
}
| [
"simon@poole.ch"
] | simon@poole.ch |
141a0a8f0ae29359b9f0ff56b5f237ca7bda6f70 | a50d7142b61f5a3da6b58ace7b66a8dd179816fa | /src/main/java/com/dpascu/jhiazuregateway/repository/AuthorityRepository.java | 074fa972490049fc391c0d66be84c61a739a606c | [] | no_license | dumip/jhipster-azure-services-gw | 9aa4a0e17ad817465a0e6ab188d47c5af4e7630e | a8c5517fe0f28a7a8f84285e91712d5d245ea36e | refs/heads/master | 2022-12-21T21:52:55.612195 | 2019-11-21T15:26:37 | 2019-11-21T15:26:37 | 223,204,679 | 0 | 0 | null | 2022-12-16T04:41:58 | 2019-11-21T15:26:24 | Java | UTF-8 | Java | false | false | 318 | java | package com.dpascu.jhiazuregateway.repository;
import com.dpascu.jhiazuregateway.domain.Authority;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Spring Data JPA repository for the {@link Authority} entity.
*/
public interface AuthorityRepository extends JpaRepository<Authority, String> {
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
73b66f336b5544c0a61ea50d16816c3a4ec3c2ef | cc9185a396c21d0495fb96f0fc506e5945a56e69 | /libcore_tests/src/test/java/groups/JunitExtJavaSecurityAcl.java | 29076800dc71daabc8647104f054eea6449a0d0a | [] | no_license | multi-os-engine/moe-tests | 814eb25fdcd9a16f184bc3b7e0eff685356075be | 5d652553e96a932d3e682c9c5f7fe4ad5571628d | refs/heads/master | 2022-08-08T14:26:34.626021 | 2016-08-09T19:44:36 | 2016-08-09T19:44:36 | 65,322,790 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | import libcore.io.*;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
tests.security.acl.AclNotFoundException2Test.class,
tests.security.acl.AclNotFoundExceptionTest.class,
tests.security.acl.LastOwnerException2Test.class,
tests.security.acl.LastOwnerExceptionTest.class,
tests.security.acl.NotOwnerException2Test.class,
tests.security.acl.NotOwnerExceptionTest.class,
})
public class JunitExtJavaSecurityAcl {
} | [
"alexey.suhov@intel.com"
] | alexey.suhov@intel.com |
88403ae56c64bce2289870dc8f89ea98608a868d | 90983dfadc3fd52223fa0bf8631321c74bf74597 | /src/main/java/org/gwtproject/xml/client/impl/NodeListImpl.java | a064c644e6eb678ebce0990550184f63ad2027df | [
"Apache-2.0"
] | permissive | dankurka/gwt-xml | cba3864a924fd6d97f5468c17ecc9e8e68a96295 | e76cc436361bc89957b02256799362eb34d954e5 | refs/heads/master | 2021-01-21T19:35:43.374395 | 2017-10-25T20:31:06 | 2017-10-25T20:31:06 | 92,141,709 | 1 | 2 | null | 2017-10-25T20:31:07 | 2017-05-23T07:17:11 | Java | UTF-8 | Java | false | false | 1,992 | java | /*
* Copyright 2007 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.gwtproject.xml.client.impl;
import org.gwtproject.xml.client.Node;
import org.gwtproject.xml.client.NodeList;
import org.gwtproject.xml.client.impl.NodeImpl.NativeNodeImpl;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
/**
* This class implements the NodeList interface using the underlying
* JavaScriptObject's implementation.
*/
class NodeListImpl extends DOMItem implements NodeList {
@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
static class NativeNodeListImpl extends NativeDomItem {
int length;
public native NativeNodeImpl item(int index);
}
private final NativeNodeListImpl domList;
protected NodeListImpl(NativeNodeListImpl o) {
super(o);
this.domList = o;
}
@Override
public int getLength() {
return domList.length;
}
/**
* This method gets the index item.
*
* @param index - the index to be retrieved
* @return the item at this index
* @see com.google.gwt.xml.client.NodeList#item(int)
*/
@Override
public Node item(int index) {
if (index >= domList.length) {
return null;
}
return NodeImpl.build(domList.item(index));
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
for (int i = 0; i < getLength(); i++) {
b.append(item(i).toString());
}
return b.toString();
}
}
| [
"dankurka@google.com"
] | dankurka@google.com |
3c418d981b5d33ac9fd55a70d29a341b6ca1f874 | c82bfe5797f1104a6c3fa59762fd065b089489ea | /src/main/java/ch/ethz/idsc/sophus/app/io/GokartPoseDatas.java | aaa3f5aa04b16436b233648b0d73a89c82b2bb4c | [] | no_license | etarakci-hvl/owl | 208f6bf6be98717dbdd62ab369dd654bdbf4343a | 60790bdb31741b8368001e892a941bded7fcbfb9 | refs/heads/master | 2022-03-02T00:22:24.167829 | 2019-11-17T09:15:23 | 2019-11-17T09:15:23 | 279,145,425 | 1 | 0 | null | 2020-07-12T20:47:38 | 2020-07-12T20:47:37 | null | UTF-8 | Java | false | false | 285 | java | // code by jph
package ch.ethz.idsc.sophus.app.io;
import ch.ethz.idsc.tensor.Tensor;
import ch.ethz.idsc.tensor.Tensors;
public enum GokartPoseDatas {
;
public static final Tensor HANGAR_MODEL2PIXEL = //
Tensors.fromString("{{7.5, 0, 100}, {0, -7.5, 800}, {0, 0, 1}}");
}
| [
"jan.hakenberg@gmail.com"
] | jan.hakenberg@gmail.com |
464dcb64a9bd24151081a961836b66bfd2f5ba19 | d8a76a17259c35d48a55058d8f1c2584e790c5bd | /src/main/java/br/com/formento/gerenciadorDeBlocos/service/adapter/RepositorioTextoAdapterImpl.java | a02472a0f25509667fd2970755b014e52c3228e6 | [] | no_license | andreformento/gerenciadorDeBlocos | 8a9965516070c8a2c6dc4d8f8148071cdc3bb28d | 00b55b8c8b3b496a9e5a222ad6da3f9d89693485 | refs/heads/master | 2016-08-03T08:19:59.483526 | 2015-06-10T02:05:28 | 2015-06-10T02:05:28 | 37,168,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package br.com.formento.gerenciadorDeBlocos.service.adapter;
public abstract class RepositorioTextoAdapterImpl implements RepositorioTextoAdapter {
private String parametro;
public RepositorioTextoAdapterImpl(String parametro) {
this.parametro = parametro;
}
@Override
public String getParametro() {
return parametro;
}
}
| [
"andreformento.sc@gmail.com"
] | andreformento.sc@gmail.com |
e3ef5d02d90eebdafa0a84c1db813c9fe06134f4 | 8453e56375c907948d0fccee820aac8eeefaa336 | /services/fgs/src/main/java/com/huaweicloud/sdk/fgs/v2/model/CreateFunctionTriggerRequest.java | bdc81919c510b9a0aa8b3417db223ff249097bef | [
"Apache-2.0"
] | permissive | xionghao-hw/huaweicloud-sdk-java-v3 | cfc8e37302bc4e059dbd30521ab378246aa65c40 | 225f99bf54fabcd6a19c9a5c47d1f079434b46e8 | refs/heads/master | 2022-08-31T18:43:33.388382 | 2020-05-19T07:33:06 | 2020-05-19T07:33:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,149 | java | package com.huaweicloud.sdk.fgs.v2.model;
import java.util.Objects;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.huaweicloud.sdk.fgs.v2.model.CreateFunctionTriggerRequestBody;
import com.fasterxml.jackson.annotation.*;
import com.huaweicloud.sdk.core.SdkResponse;
/**
* Request Object
*/
public class CreateFunctionTriggerRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="function_urn")
private String functionUrn;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="body")
private CreateFunctionTriggerRequestBody body = null;
public CreateFunctionTriggerRequest withFunctionUrn(String functionUrn) {
this.functionUrn = functionUrn;
return this;
}
/**
* Get functionUrn
* @return functionUrn
*/
public String getFunctionUrn() {
return functionUrn;
}
public void setFunctionUrn(String functionUrn) {
this.functionUrn = functionUrn;
}
public CreateFunctionTriggerRequest withBody(CreateFunctionTriggerRequestBody body) {
this.body = body;
return this;
}
public CreateFunctionTriggerRequest withBody(Consumer<CreateFunctionTriggerRequestBody> bodySetter) {
if(this.body == null ){
this.body = new CreateFunctionTriggerRequestBody();
}
bodySetter.accept(this.body);
return this;
}
/**
* Get body
* @return body
*/
public CreateFunctionTriggerRequestBody getBody() {
return body;
}
public void setBody(CreateFunctionTriggerRequestBody body) {
this.body = body;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateFunctionTriggerRequest createFunctionTriggerRequest = (CreateFunctionTriggerRequest) o;
return Objects.equals(this.functionUrn, createFunctionTriggerRequest.functionUrn) &&
Objects.equals(this.body, createFunctionTriggerRequest.body);
}
@Override
public int hashCode() {
return Objects.hash(functionUrn, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateFunctionTriggerRequest {\n");
sb.append(" functionUrn: ").append(toIndentedString(functionUrn)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"wuchen25@huawei.com"
] | wuchen25@huawei.com |
8c1365852e8962a1d9dacba00413e3feadc4268a | 7e0364dce3cb7ec041c5824ec68adc4bcc47568a | /cartOptimization/src/com/accenture/performance/optimization/ruleengineservices/converts/populator/CartDataRaoPopulator.java | f79e2947fcaeeccbd5a7979fe8f9124403176a60 | [] | no_license | aitp2/a1 | 055abd53719aec422134b19265634cb301f9027b | 40ccbbd480cbc0893db5a04af97fc8a6dc150690 | refs/heads/master | 2021-07-23T06:23:38.889348 | 2018-10-17T01:01:45 | 2018-10-17T01:01:45 | 113,840,157 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,423 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2017 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 com.accenture.performance.optimization.ruleengineservices.converts.populator;
import de.hybris.platform.converters.Converters;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.core.model.user.UserModel;
import de.hybris.platform.ruleengineservices.rao.CartRAO;
import de.hybris.platform.ruleengineservices.rao.OrderEntryRAO;
import de.hybris.platform.ruleengineservices.rao.UserRAO;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
import de.hybris.platform.servicelayer.dto.converter.Converter;
import de.hybris.platform.servicelayer.exceptions.ModelNotFoundException;
import de.hybris.platform.servicelayer.i18n.CommonI18NService;
import de.hybris.platform.servicelayer.search.FlexibleSearchService;
import java.math.BigDecimal;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Objects;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.accenture.performance.optimization.facades.data.OptimizedCartData;
import com.accenture.performance.optimization.facades.data.OptimizedCartEntryData;
/**
*
*/
public class CartDataRaoPopulator implements Populator<OptimizedCartData, CartRAO>
{
private static final Logger LOGGER = LoggerFactory.getLogger(CartDataRaoPopulator.class);
// TODO
private Converter<OptimizedCartEntryData, OrderEntryRAO> entryConverter;
private Converter<UserModel, UserRAO> userConverter;
private FlexibleSearchService flexibleSearchService;
private CommonI18NService commonI18NService;
@Override
public void populate(final OptimizedCartData source, final CartRAO target) throws ConversionException
{
target.setCode(source.getCode());
// tailor : Currency : getCommonI18NService().getCurrentCurrency()
target.setCurrencyIsoCode(getCommonI18NService().getCurrentCurrency().getIsocode());
target.setTotal(
Objects.isNull(source.getTotalPrice()) ? BigDecimal.ZERO : BigDecimal.valueOf(source.getTotalPrice().doubleValue()));
target.setSubTotal(
Objects.isNull(source.getSubtotal()) ? BigDecimal.ZERO : BigDecimal.valueOf(source.getSubtotal().doubleValue()));
target.setDeliveryCost(Objects.isNull(source.getDeliveryCost()) ? BigDecimal.ZERO
: BigDecimal.valueOf(source.getDeliveryCost().doubleValue()));
target.setPaymentCost(Objects.isNull(source.getPaymentCost()) ? BigDecimal.ZERO
: BigDecimal.valueOf(source.getPaymentCost().doubleValue()));
if (CollectionUtils.isNotEmpty(source.getEntries()))
{
final List<OrderEntryRAO> list = Converters.convertAll(source.getEntries(), this.getEntryConverter());
list.forEach((entry) -> {
entry.setOrder(target);
});
target.setEntries(new LinkedHashSet(list));
}
else
{
LOGGER.warn("Order entry list is empty, skipping the conversion");
}
// tailor: no any discount before protmoion calculating
this.convertAndSetUser(target, source.getUserId());
// tailor: payment mode convert
// from CartRaoPopulator
target.setActions(new LinkedHashSet());
target.setOriginalTotal(target.getTotal());
}
/**
*
*/
private void convertAndSetUser(final CartRAO target, final String userId)
{
if (StringUtils.isNotEmpty(userId))
{
UserModel userModel = new UserModel();
userModel.setUid(userId);
try
{
userModel = flexibleSearchService.getModelByExample(userModel);
target.setUser(this.getUserConverter().convert(userModel));
}
catch (final ModelNotFoundException ex)
{
LOGGER.error("can't found user in cart {}", userId);
}
}
}
/**
* @return the entryConverter
*/
public Converter<OptimizedCartEntryData, OrderEntryRAO> getEntryConverter()
{
return entryConverter;
}
/**
* @param entryConverter
* the entryConverter to set
*/
public void setEntryConverter(final Converter<OptimizedCartEntryData, OrderEntryRAO> entryConverter)
{
this.entryConverter = entryConverter;
}
/**
* @return the userConverter
*/
public Converter<UserModel, UserRAO> getUserConverter()
{
return userConverter;
}
/**
* @param userConverter
* the userConverter to set
*/
public void setUserConverter(final Converter<UserModel, UserRAO> userConverter)
{
this.userConverter = userConverter;
}
/**
* @return the flexibleSearchService
*/
public FlexibleSearchService getFlexibleSearchService()
{
return flexibleSearchService;
}
/**
* @param flexibleSearchService
* the flexibleSearchService to set
*/
public void setFlexibleSearchService(final FlexibleSearchService flexibleSearchService)
{
this.flexibleSearchService = flexibleSearchService;
}
/**
* @return the commonI18NService
*/
public CommonI18NService getCommonI18NService()
{
return commonI18NService;
}
/**
* @param commonI18NService
* the commonI18NService to set
*/
public void setCommonI18NService(final CommonI18NService commonI18NService)
{
this.commonI18NService = commonI18NService;
}
}
| [
"mingming.wang@accenture.com"
] | mingming.wang@accenture.com |
eac6a0dd2f7f6b1dfb677ef2c326b344be6f5f1f | fa057b3fe67264872c5bc06297dd0100425853d4 | /fuelmis/src/com/zhiren/fuelmis/dc/dao/xitgl/MeikdqDao.java | c375dfcca602c098d5453ae0d421760fd9a09c31 | [] | no_license | paddy235/gdhyc | 5df6a6280403784e89f52649c7710e7224a18414 | 9ce5925636589a9f4f2bed5f1a2fe90cefd89119 | refs/heads/master | 2021-06-23T22:55:17.210623 | 2017-09-07T09:29:50 | 2017-09-07T09:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package com.zhiren.fuelmis.dc.dao.xitgl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.zhiren.fuelmis.dc.entity.xitgl.Meikdq;
/**
* @author 陈宝露
*/
@Repository
public interface MeikdqDao {
List<Meikdq> getAll(Map<String,Object> map);
int insertMeikdq(Map<String,Object> map);
List<Meikdq> getOne(Map<String,Object> map);
int updateMeikdq(Map<String,Object> map);
}
| [
"liu@qq.com"
] | liu@qq.com |
b8a88593f1cc7476acb41dccbe2366e3149725db | 6eb9945622c34e32a9bb4e5cd09f32e6b826f9d3 | /src/com/inponsel/android/v2/HomeNewsActivity$75.java | 1267620e8c0d4c3531251197b4bd109cbffb20ea | [] | no_license | alexivaner/GadgetX-Android-App | 6d700ba379d0159de4dddec4d8f7f9ce2318c5cc | 26c5866be12da7b89447814c05708636483bf366 | refs/heads/master | 2022-06-01T09:04:32.347786 | 2020-04-30T17:43:17 | 2020-04-30T17:43:17 | 260,275,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.inponsel.android.v2;
import com.android.volley.VolleyError;
import com.inponsel.android.utils.Log;
// Referenced classes of package com.inponsel.android.v2:
// HomeNewsActivity
class this._cls0
implements com.android.volley.er
{
final HomeNewsActivity this$0;
public void onErrorResponse(VolleyError volleyerror)
{
Log.d("response", (new StringBuilder("Errora: ")).append(volleyerror.getMessage()).toString());
}
()
{
this$0 = HomeNewsActivity.this;
super();
}
}
| [
"hutomoivan@gmail.com"
] | hutomoivan@gmail.com |
64eac57bd85a66de5ba48cdead4496202fbaecf5 | 17d1e8fe32d45cf915ec5e34fdccc0b6ec78e478 | /phoenixServer/src/main/java/com/koi/service/IAppGameService.java | 4c9705fa4cf682113210c07a0d82129a0264840b | [] | no_license | 973319261/phoenix | 9e029053a62763424cd5a075e438f78823053271 | 029f0e8aeec7a5022c2dc750716f624ba49be625 | refs/heads/main | 2023-01-10T15:46:49.269699 | 2020-11-08T00:34:04 | 2020-11-08T00:34:04 | 310,955,415 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 684 | java | package com.koi.service;
import com.koi.po.PetInfoDetail;
import com.koi.po.User;
import com.koi.vo.JsonReturn;
public interface IAppGameService {
/**
* 获取游戏相关信息
* @param userId
* @return
*/
public JsonReturn findGameInfo(Integer userId);
/**
* 修改游戏信息
* @param user
* @return
*/
public JsonReturn updateGameInfo(User user);
/**
* 修改宠物列表信息
* @param petInfoDetail
* @return
*/
public JsonReturn updatePetLevel(PetInfoDetail petInfoDetail,String goldUsable);
/**
* 修改宠物列表金币等级
* @param petInfoDetail
* @return
*/
public JsonReturn updatePetGoldLevel(PetInfoDetail petInfoDetail);
}
| [
"973319261@qq.com"
] | 973319261@qq.com |
b4e662e84518c608294bef859959e5ed998cdbb1 | bb7be5b4175efccf3edad6e89aad95a589a9dc6c | /Si-Tech/AcctMgrWeb6.1/src/com/sitech/acctmgr/atom/domains/free/FreeOutPackageEntity.java | 1357f970bcd98c77eeeb9044441400f4367c763d | [] | no_license | BarryPro/JavaEE_Eclipse | 5fde49bfcedf88d660319ab7c9da187f0eaddcea | df5bacbc094e49c693eb8b18f8b734835665b068 | refs/heads/master | 2021-06-25T04:21:16.572515 | 2017-09-13T04:10:01 | 2017-09-13T04:10:01 | 99,305,991 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | package com.sitech.acctmgr.atom.domains.free;
import com.alibaba.fastjson.annotation.JSONField;
import com.sitech.jcfx.anno.ConsType;
import com.sitech.jcfx.anno.ParamDesc;
import java.io.Serializable;
import java.util.List;
/**
* Created by wangyla on 2017/6/6.
*/
public class FreeOutPackageEntity implements Serializable {
@JSONField(name = "MealInfoUpCode")
@ParamDesc(path = "MealInfoUpCode", cons = ConsType.CT001, type = "string", len = "2", desc = "资源名称编码", memo = "04:GPRS资源;05:WLAN资源")
private String resCode;
@JSONField(name = "MealInfoUpSource")
@ParamDesc(path = "MealInfoUpSource", cons = ConsType.PLUS, type = "complex", len = "", desc = "套餐外计费资源使用信息", memo = "列表")
private List<FreeDetailLv2OutEntity> detailList;
public String getResCode() {
return resCode;
}
public void setResCode(String resCode) {
this.resCode = resCode;
}
public List<FreeDetailLv2OutEntity> getDetailList() {
return detailList;
}
public void setDetailList(List<FreeDetailLv2OutEntity> detailList) {
this.detailList = detailList;
}
}
| [
"belong.belong@outlook.com"
] | belong.belong@outlook.com |
7becdfd0d06d3697f4a7798e5a08c64f89668942 | 1a32d704493deb99d3040646afbd0f6568d2c8e7 | /BOOT-INF/lib/org/springframework/expression/spel/ast/OpOr.java | e7aaf3d3588834d4fce04c2b6cc95d47f6842824 | [] | no_license | yanrumei/bullet-zone-server-2.0 | e748ff40f601792405143ec21d3f77aa4d34ce69 | 474c4d1a8172a114986d16e00f5752dc019cdcd2 | refs/heads/master | 2020-05-19T11:16:31.172482 | 2019-03-25T17:38:31 | 2019-03-25T17:38:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,659 | java | /* */ package org.springframework.expression.spel.ast;
/* */
/* */ import org.springframework.asm.Label;
/* */ import org.springframework.asm.MethodVisitor;
/* */ import org.springframework.expression.EvaluationException;
/* */ import org.springframework.expression.spel.CodeFlow;
/* */ import org.springframework.expression.spel.ExpressionState;
/* */ import org.springframework.expression.spel.SpelEvaluationException;
/* */ import org.springframework.expression.spel.SpelMessage;
/* */ import org.springframework.expression.spel.support.BooleanTypedValue;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class OpOr
/* */ extends Operator
/* */ {
/* */ public OpOr(int pos, SpelNodeImpl... operands)
/* */ {
/* 39 */ super("or", pos, operands);
/* 40 */ this.exitTypeDescriptor = "Z";
/* */ }
/* */
/* */ public BooleanTypedValue getValueInternal(ExpressionState state)
/* */ throws EvaluationException
/* */ {
/* 46 */ if (getBooleanValue(state, getLeftOperand()))
/* */ {
/* 48 */ return BooleanTypedValue.TRUE;
/* */ }
/* 50 */ return BooleanTypedValue.forValue(getBooleanValue(state, getRightOperand()));
/* */ }
/* */
/* */ private boolean getBooleanValue(ExpressionState state, SpelNodeImpl operand) {
/* */ try {
/* 55 */ Boolean value = (Boolean)operand.getValue(state, Boolean.class);
/* 56 */ assertValueNotNull(value);
/* 57 */ return value.booleanValue();
/* */ }
/* */ catch (SpelEvaluationException ee) {
/* 60 */ ee.setPosition(operand.getStartPosition());
/* 61 */ throw ee;
/* */ }
/* */ }
/* */
/* */ private void assertValueNotNull(Boolean value) {
/* 66 */ if (value == null) {
/* 67 */ throw new SpelEvaluationException(SpelMessage.TYPE_CONVERSION_ERROR, new Object[] { "null", "boolean" });
/* */ }
/* */ }
/* */
/* */ public boolean isCompilable()
/* */ {
/* 73 */ SpelNodeImpl left = getLeftOperand();
/* 74 */ SpelNodeImpl right = getRightOperand();
/* 75 */ return (left.isCompilable()) && (right.isCompilable()) &&
/* 76 */ (CodeFlow.isBooleanCompatible(left.exitTypeDescriptor)) &&
/* 77 */ (CodeFlow.isBooleanCompatible(right.exitTypeDescriptor));
/* */ }
/* */
/* */
/* */ public void generateCode(MethodVisitor mv, CodeFlow cf)
/* */ {
/* 83 */ Label elseTarget = new Label();
/* 84 */ Label endOfIf = new Label();
/* 85 */ cf.enterCompilationScope();
/* 86 */ getLeftOperand().generateCode(mv, cf);
/* 87 */ cf.unboxBooleanIfNecessary(mv);
/* 88 */ cf.exitCompilationScope();
/* 89 */ mv.visitJumpInsn(153, elseTarget);
/* 90 */ mv.visitLdcInsn(Integer.valueOf(1));
/* 91 */ mv.visitJumpInsn(167, endOfIf);
/* 92 */ mv.visitLabel(elseTarget);
/* 93 */ cf.enterCompilationScope();
/* 94 */ getRightOperand().generateCode(mv, cf);
/* 95 */ cf.unboxBooleanIfNecessary(mv);
/* 96 */ cf.exitCompilationScope();
/* 97 */ mv.visitLabel(endOfIf);
/* 98 */ cf.pushDescriptor(this.exitTypeDescriptor);
/* */ }
/* */ }
/* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\spring-expression-4.3.14.RELEASE.jar!\org\springframework\expression\spel\ast\OpOr.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"ishankatwal@gmail.com"
] | ishankatwal@gmail.com |
d3d7498a119032a25775191ed922f5b68e6341df | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /content/public/android/java/src/org/chromium/content_public/browser/ImageDownloadCallback.java | 7638273ac93889f0595b02ab781979e928d9aa10 | [
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | Java | false | false | 1,245 | 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.content_public.browser;
import android.graphics.Bitmap;
import android.graphics.Rect;
import java.util.List;
/**
* Java counterpart of native ImageDownloadCallback.
*/
public interface ImageDownloadCallback {
/**
* Called when image downloading is completed.
* @param id The unique id for the download image request, which corresponds to the return value
* of {@link WebContents.DownloadImage}.
* @param httpStatusCode The HTTP status code for the download request.
* @param imageUrl The URL of the downloaded image.
* @param bitmaps The bitmaps from the download image. Note that the bitmaps in the image could
* be ignored or resized if they are larger than the size limit in {@link
* WebContente.DownloadImage}.
* @param originalImageSizes The original sizes of {@link bitmaps} prior to the resizing.
*/
void onFinishDownloadImage(int id, int httpStatusCode, String imageUrl, List<Bitmap> bitmaps,
List<Rect> originalImageSizes);
}
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
4de7ebca01a09a53fd36f587ea08e7e4b300182c | 55303f81012c9be02d851bbf33615fc529eb30c1 | /aliyun-java-sdk-iot/src/main/java/com/aliyuncs/iot/model/v20170420/CreateProductRequest.java | d525e39d41ef0224824fa42e7213603753e0f2d0 | [
"Apache-2.0"
] | permissive | Roc0228/aliyun-openapi-java-sdk | fea07c9191fcd7b26f4a933f1dd53e96d9d2abb9 | f6491b0301870eb5dc78031795a36ea8e433ee2a | refs/heads/master | 2021-07-06T09:51:41.003036 | 2017-09-27T09:26:14 | 2017-09-27T09:26:14 | 105,111,321 | 0 | 1 | null | 2017-09-28T06:37:48 | 2017-09-28T06:37:48 | null | UTF-8 | Java | false | false | 2,438 | 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 com.aliyuncs.iot.model.v20170420;
import com.aliyuncs.RpcAcsRequest;
/**
* @author auto create
* @version
*/
public class CreateProductRequest extends RpcAcsRequest<CreateProductResponse> {
public CreateProductRequest() {
super("Iot", "2017-04-20", "CreateProduct", "iot");
}
private Long catId;
private String name;
private String extProps;
private String securityPolicy;
private String desc;
public Long getCatId() {
return this.catId;
}
public void setCatId(Long catId) {
this.catId = catId;
if(catId != null){
putQueryParameter("CatId", catId.toString());
}
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
if(name != null){
putQueryParameter("Name", name);
}
}
public String getExtProps() {
return this.extProps;
}
public void setExtProps(String extProps) {
this.extProps = extProps;
if(extProps != null){
putQueryParameter("ExtProps", extProps);
}
}
public String getSecurityPolicy() {
return this.securityPolicy;
}
public void setSecurityPolicy(String securityPolicy) {
this.securityPolicy = securityPolicy;
if(securityPolicy != null){
putQueryParameter("SecurityPolicy", securityPolicy);
}
}
public String getDesc() {
return this.desc;
}
public void setDesc(String desc) {
this.desc = desc;
if(desc != null){
putQueryParameter("Desc", desc);
}
}
@Override
public Class<CreateProductResponse> getResponseClass() {
return CreateProductResponse.class;
}
}
| [
"haowei.yao@alibaba-inc.com"
] | haowei.yao@alibaba-inc.com |
dfdda2db07ac9c63b194a24243794eea697d3ac0 | 30057e353957920564ee07722427c3ff434d322f | /ProblemSolving/src/com/basics/array/QuickSort.java | c4daac4bcf025fc8f21993c90ff7da3d8f6a5ed7 | [] | no_license | mmanjunath998/Problem-Solving | a7f4e541b150ad3d28e545b7c990d47b020c79a9 | 32f21921f05ff351a6cdc52fe72e954633d9036a | refs/heads/master | 2020-09-09T15:06:46.232130 | 2019-12-04T08:04:58 | 2019-12-04T08:04:58 | 221,479,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 779 | java | package com.basics.array;
import java.util.Arrays;
public class QuickSort {
public static void main(String[] args){
int[] arr = {8,5,1,3,9,4,7,5,4,2,3,3,4};
System.out.println(Arrays.toString(sort(arr, 0, arr.length-1)));
}
public static int[] sort(int[] arr,int start, int end){
if(start < end){
int pivot = partition(arr, start, end);
sort(arr, start, pivot-1);
sort(arr, pivot+1, end);
}
return arr;
}
private static int partition(int[] arr, int l, int r){
int x = arr[r];
int j = l;
int i = j-1;
while(j<r){
if(arr[j] < x){
i = i+1;
swap(arr,i,j);
}
j++;
}
swap(arr, i+1, r);
return i+1;
}
private static void swap(int[] arr, int i, int j){
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
| [
"manjunath@bytemark.co"
] | manjunath@bytemark.co |
6337d246cd055cb806444237748c68f2bb81bf80 | 3b786023afab7d2c09919bc34a9bf1d18ec99a18 | /src/test/java/com/example/MybatisGenerateApplicationTests.java | e9a83882eec43d5933cb5a25a0b418bec4b60894 | [] | no_license | liukaifeng/mybatis-generate | c5948d14d5ca7cffa1dd806308ea049d082fa875 | 6b45a361a3f49eb375b5abab72d35d035e03d565 | refs/heads/master | 2021-01-19T19:23:19.347980 | 2017-07-12T00:25:48 | 2017-07-12T00:25:48 | 88,415,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.example;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class MybatisGenerateApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"kaifeng_5liu@163.com"
] | kaifeng_5liu@163.com |
b35a72d852358de5c0e711895185ddb59bbfc711 | 502ea93de54a1be3ef42edb0412a2bf4bc9ddbef | /sources/com/startapp/android/publish/ads/list3d/C5170g.java | 311c629672fc08d478b015e8daec48a0836df1aa | [] | no_license | dovanduy/MegaBoicotApk | c0852af0773be1b272ec907113e8f088addb0f0c | 56890cb9f7afac196bd1fec2d1326f2cddda37a3 | refs/heads/master | 2020-07-02T04:28:02.199907 | 2019-08-08T20:44:49 | 2019-08-08T20:44:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package com.startapp.android.publish.ads.list3d;
/* renamed from: com.startapp.android.publish.ads.list3d.g */
/* compiled from: StartAppSDK */
public interface C5170g {
/* renamed from: a */
void mo18975a(int i);
}
| [
"pablo.valle.b@gmail.com"
] | pablo.valle.b@gmail.com |
ac5bb15b1eb6b84377cdceeabd634c68ab1c490b | 4d6f449339b36b8d4c25d8772212bf6cd339f087 | /netreflected/src/Framework/System.Net.Http,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a/system/net/http/headers/TransferCodingHeaderValue.java | a26eacba6acca2b6cb04f5f48a189787fd242ed5 | [
"MIT"
] | permissive | lvyitian/JCOReflector | 299a64550394db3e663567efc6e1996754f6946e | 7e420dca504090b817c2fe208e4649804df1c3e1 | refs/heads/master | 2022-12-07T21:13:06.208025 | 2020-08-28T09:49:29 | 2020-08-28T09:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,218 | java | /*
* MIT License
*
* Copyright (c) 2020 MASES s.r.l.
*
* 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.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package system.net.http.headers;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.net.http.headers.TransferCodingHeaderValue;
/**
* The base .NET class managing System.Net.Http.Headers.TransferCodingHeaderValue, System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Extends {@link NetObject}.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Net.Http.Headers.TransferCodingHeaderValue" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Net.Http.Headers.TransferCodingHeaderValue</a>
*/
public class TransferCodingHeaderValue extends NetObject {
/**
* Fully assembly qualified name: System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
*/
public static final String assemblyFullName = "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/**
* Assembly name: System.Net.Http
*/
public static final String assemblyShortName = "System.Net.Http";
/**
* Qualified class name: System.Net.Http.Headers.TransferCodingHeaderValue
*/
public static final String className = "System.Net.Http.Headers.TransferCodingHeaderValue";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
} catch (JCException e) {
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public TransferCodingHeaderValue(Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link TransferCodingHeaderValue}, a cast assert is made to check if types are compatible.
*/
public static TransferCodingHeaderValue cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new TransferCodingHeaderValue(from.getJCOInstance());
}
// Constructors section
public TransferCodingHeaderValue() throws Throwable {
}
public TransferCodingHeaderValue(java.lang.String value) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException {
try {
// add reference to assemblyName.dll file
addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject(value));
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public static TransferCodingHeaderValue Parse(java.lang.String input) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException {
if (classType == null)
throw new UnsupportedOperationException("classType is null.");
try {
JCObject objParse = (JCObject)classType.Invoke("Parse", input);
return new TransferCodingHeaderValue(objParse);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Properties section
public java.lang.String getValue() throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (java.lang.String)classInstance.Get("Value");
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Instance Events section
} | [
"mario.mastrodicasa@masesgroup.com"
] | mario.mastrodicasa@masesgroup.com |
e784fab7cbb096c58486203a6ae9025846acf45d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/13/13_086624bf8955f9d6cff36b353036b650f44d7d21/TPCCConfig/13_086624bf8955f9d6cff36b353036b650f44d7d21_TPCCConfig_t.java | b4f4c641b7bb0976a2dd6d51354cd234310bc305 | [] | 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,966 | java | package org.voltdb.benchmark.tpcc;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.collections15.map.ListOrderedMap;
import org.voltdb.catalog.Catalog;
import edu.brown.catalog.CatalogUtil;
import edu.brown.utils.StringUtil;
public final class TPCCConfig {
public int first_warehouse = TPCCConstants.STARTING_WAREHOUSE;
public int num_warehouses = 1;
public boolean warehouse_per_partition = false;
public boolean warehouse_affinity = false;
public boolean warehouse_debug = false;
public boolean warehouse_pairing = false;
public boolean reset_on_clear = false;
public int num_loadthreads = 1;
public boolean loadthread_per_warehouse = false;
public boolean noop = false;
public boolean neworder_only = false;
public boolean neworder_abort = false;
public boolean neworder_multip = true;
public boolean neworder_skew_warehouse = false;
/** Percentage of neworder txns that are forced to be multi-partitioned */
public int neworder_multip_mix = -1;
/** Whether neworder txns that are forced to be remote or not */
public boolean neworder_multip_remote = false;
public boolean payment_only = false;
public boolean payment_multip = true;
public boolean payment_multip_remote = false;
/** Percentage of neworder txns that are forced to be multi-partitioned */
public int payment_multip_mix = -1;
/** If set to true, then we will use temporal skew for generating warehouse ids */
public boolean temporal_skew = false;
/** Percentage of warehouse ids that will be temporally skewed during the benchmark run */
public int temporal_skew_mix = 0;
public boolean temporal_skew_rotate = false;
private TPCCConfig() {
// Nothing
}
private TPCCConfig(Catalog catalog, Map<String, String> params) {
for (Entry<String, String> e : params.entrySet()) {
String key = e.getKey();
String val = e.getValue();
// FIRST WAREHOUSE ID
if (key.equalsIgnoreCase("first_warehouse") && !val.isEmpty()) {
first_warehouse = Integer.parseInt(val);
}
// NUMBER OF WAREHOUSES
else if (key.equalsIgnoreCase("warehouses") && !val.isEmpty()) {
num_warehouses = Integer.parseInt(val);
}
// ONE WAREHOUSE PER PARTITION
else if (key.equalsIgnoreCase("warehouse_per_partition") && !val.isEmpty()) {
warehouse_per_partition = Boolean.parseBoolean(val);
}
// WAREHOUSE AFFINITY
else if (key.equalsIgnoreCase("warehouse_affinity") && !val.isEmpty()) {
warehouse_affinity = Boolean.parseBoolean(val);
}
// WAREHOUSE PAIRING
else if (key.equalsIgnoreCase("warehouse_pairing") && !val.isEmpty()) {
warehouse_pairing = Boolean.parseBoolean(val);
}
// ENABLE WAREHOUSE DEBUGGING
else if (key.equalsIgnoreCase("warehouse_debug") && !val.isEmpty()) {
warehouse_debug = Boolean.parseBoolean(val);
}
// RESET WHEN CLEAR IS CALLED FROM BENCHMARKCONTROLLER
else if (key.equalsIgnoreCase("reset_on_clear") && !val.isEmpty()) {
reset_on_clear = Boolean.parseBoolean(val);
}
// LOAD THREADS
else if (key.equalsIgnoreCase("loadthreads") && !val.isEmpty()) {
num_loadthreads = Integer.parseInt(val);
}
// ONE LOADTHREAD PER WAREHOUSE
else if (key.equalsIgnoreCase("loadthread_per_warehouse") && !val.isEmpty()) {
loadthread_per_warehouse = Boolean.parseBoolean(val);
}
// NOOPs
else if (key.equalsIgnoreCase("noop") && !val.isEmpty()) {
noop = Boolean.parseBoolean(val);
}
// ONLY NEW ORDER
else if (key.equalsIgnoreCase("neworder_only") && !val.isEmpty()) {
neworder_only = Boolean.parseBoolean(val);
}
// ALLOW NEWORDER ABORTS
else if (key.equalsIgnoreCase("neworder_abort") && !val.isEmpty()) {
neworder_abort = Boolean.parseBoolean(val);
}
// NEWORDER DTXN PERCENTAGE
else if (key.equalsIgnoreCase("neworder_multip") && !val.isEmpty()) {
neworder_multip = Boolean.parseBoolean(val);
}
// FORCE NEWORDER REMOTE W_ID DTXNS
else if (key.equalsIgnoreCase("neworder_multip_remote") && !val.isEmpty()) {
neworder_multip_remote = Boolean.parseBoolean(val);
}
// % OF MULTI-PARTITION NEWORDERS
else if (key.equalsIgnoreCase("neworder_multip_mix") && !val.isEmpty()) {
neworder_multip_mix = Integer.parseInt(val);
}
// SKEW NEWORDERS W_IDS
else if (key.equalsIgnoreCase("neworder_skew_warehouse") && !val.isEmpty()) {
neworder_skew_warehouse = Boolean.parseBoolean(val);
}
// ONLY PAYMENT
else if (key.equalsIgnoreCase("payment_only") && !val.isEmpty()) {
payment_only = Boolean.parseBoolean(val);
}
// ALLOW PAYMENT DTXNS
else if (key.equalsIgnoreCase("payment_multip") && !val.isEmpty()) {
payment_multip = Boolean.parseBoolean(val);
}
// FORCE PAYMENT REMOTE W_ID DTXNS
else if (key.equalsIgnoreCase("payment_multip_remote") && !val.isEmpty()) {
payment_multip_remote = Boolean.parseBoolean(val);
}
// PAYMENT DTXN PERCENTAGE
else if (key.equalsIgnoreCase("payment_multip_mix") && !val.isEmpty()) {
payment_multip_mix = Integer.parseInt(val);
}
// TEMPORAL SKEW
else if (key.equalsIgnoreCase("temporal_skew") && !val.isEmpty()) {
temporal_skew = Boolean.parseBoolean(val);
}
// TEMPORAL SKEW MIX
else if (key.equalsIgnoreCase("temporal_skew_mix") && !val.isEmpty()) {
temporal_skew_mix = Integer.parseInt(val);
}
// TEMPORAL SKEW ROTATE
else if (key.equalsIgnoreCase("temporal_skew_rotate") && !val.isEmpty()) {
temporal_skew_rotate = Boolean.parseBoolean(val);
}
} // FOR
if (warehouse_per_partition) num_warehouses = CatalogUtil.getNumberOfPartitions(catalog);
if (loadthread_per_warehouse) {
num_loadthreads = num_warehouses;
} else {
num_loadthreads = Math.min(num_warehouses, num_loadthreads);
}
}
public static TPCCConfig defaultConfig() {
return new TPCCConfig();
}
public static TPCCConfig createConfig(Catalog catalog, Map<String, String> params) {
return new TPCCConfig(catalog, params);
}
@Override
public String toString() {
return StringUtil.formatMaps(this.debugMap());
}
public Map<String, Object> debugMap() {
Class<?> confClass = this.getClass();
Map<String, Object> m = new ListOrderedMap<String, Object>();
for (Field f : confClass.getFields()) {
Object obj = null;
try {
obj = f.get(this);
} catch (IllegalAccessException ex) {
throw new RuntimeException(ex);
}
m.put(f.getName().toUpperCase(), obj);
} // FOR
return (m);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
b33fe044efe0fb3797bb63b3c3707f97123e7652 | 0d86a98cd6a6477d84152026ffc6e33e23399713 | /kata/6-kyu/when-greatest-is-less-than-smallest/test/GreatestSmallestTests.java | 421a072284d254546b19ef3c4f23d91ea1bb116e | [
"MIT"
] | permissive | ParanoidUser/codewars-handbook | 0ce82c23d9586d356b53070d13b11a6b15f2d6f7 | 692bb717aa0033e67995859f80bc7d034978e5b9 | refs/heads/main | 2023-07-28T02:42:21.165107 | 2023-07-27T12:33:47 | 2023-07-27T12:33:47 | 174,944,458 | 224 | 65 | MIT | 2023-09-14T11:26:10 | 2019-03-11T07:07:34 | Java | UTF-8 | Java | false | false | 1,680 | java | import static org.junit.jupiter.api.Assertions.assertEquals;
import java.math.BigInteger;
import org.junit.jupiter.api.Test;
class GreatestSmallestTests {
@Test
void sample() {
assertEquals(new BigInteger("0"), GreatestSmallest.greatest(new BigInteger("13"), new BigInteger("17"), new BigInteger("100")));
assertEquals(new BigInteger("0"), GreatestSmallest.greatest(new BigInteger("10"), new BigInteger("100"), new BigInteger("100")));
assertEquals(new BigInteger("18"), GreatestSmallest.greatest(new BigInteger("2"), new BigInteger("3"), new BigInteger("20")));
assertEquals(new BigInteger("8565894632610"), GreatestSmallest.greatest(new BigInteger("51735"), new BigInteger("77238"), new BigInteger("8567205540015")));
assertEquals(new BigInteger("9000000144000000567"), GreatestSmallest.greatest(new BigInteger("1000000007"), new BigInteger("1000000009"), new BigInteger("10000000000000000000")));
assertEquals(new BigInteger("24"), GreatestSmallest.smallest(new BigInteger("2"), new BigInteger("3"), new BigInteger("20")));
assertEquals(new BigInteger("221"), GreatestSmallest.smallest(new BigInteger("13"), new BigInteger("17"), new BigInteger("100")));
assertEquals(new BigInteger("200"), GreatestSmallest.smallest(new BigInteger("10"), new BigInteger("100"), new BigInteger("100")));
assertEquals(new BigInteger("8567226601920"), GreatestSmallest.smallest(new BigInteger("51735"), new BigInteger("77238"), new BigInteger("8567205540015")));
assertEquals(new BigInteger("10000000160000000630"), GreatestSmallest.smallest(new BigInteger("1000000007"), new BigInteger("1000000009"), new BigInteger("10000000000000000000")));
}
} | [
"5120290+ParanoidUser@users.noreply.github.com"
] | 5120290+ParanoidUser@users.noreply.github.com |
27ad9689aaeba05e8ec1555dae2153f286b906f6 | f6c55fcb1497f797ab0bb6241c8a15eb4bd6a5ff | /core-tests/src/test/java/com/segment/analytics/TrackPayloadTest.java | d3f4a98a4695d4617bb516d57f2231b962245da2 | [
"MIT"
] | permissive | hiBrianLee/analytics-android | 42e56b01dd5344be176bcedec26ab28f3309ec5a | 92ec7ef026aae6e432871ddf0cf7ece3f871a410 | refs/heads/master | 2020-12-30T22:10:48.754864 | 2014-12-22T19:53:29 | 2014-12-22T19:53:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,559 | java | package com.segment.analytics;
import java.io.IOException;
import java.util.LinkedHashMap;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import static com.segment.analytics.TestUtils.createValueMap;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(RobolectricTestRunner.class) @Config(emulateSdk = 18, manifest = Config.NONE)
public class TrackPayloadTest {
@Test public void testSerialization() throws IOException {
AnalyticsContext analyticsContext =
createValueMap(new LinkedHashMap<String, Object>(), AnalyticsContext.class);
analyticsContext.setTraits(new Traits());
TrackPayload trackPayload =
new TrackPayload(analyticsContext, new Options(), "foo", new Properties());
// put some predictable values for randomly automatically data
trackPayload.put("messageId", "a161304c-498c-4830-9291-fcfb8498877b");
trackPayload.put("timestamp", "2014-12-15T13:32:44-0700");
String json = JsonUtils.mapToJson(trackPayload);
assertThat(json).isEqualTo("{\""
+ "messageId\":\"a161304c-498c-4830-9291-fcfb8498877b\","
+ "\"type\":\"track\","
+ "\"channel\":\"mobile\","
+ "\"context\":{\"traits\":{}},"
+ "\"anonymousId\":null,"
+ "\"userId\":null,"
+ "\"timestamp\":\"2014-12-15T13:32:44-0700\","
+ "\"integrations\":"
+ "{\"All\":true},"
+ "\"event\":\"foo\","
+ "\"properties\":{}"
+ "}");
}
}
| [
"f2prateek@gmail.com"
] | f2prateek@gmail.com |
c28db3eaaf9f802c4a480520945b6ba639a9fceb | 41ae950b46036a9ebe6a221fcc0a23601bfbf190 | /Codeforces/src/educational_round087/B.java | a67700cde1818282e0270c439050628d1f453958 | [] | no_license | yuruiyin/AlgorithmLearn | f7a88a499d050fa9c5d666514a74de0f0a56d001 | 4224b664e6d05f233512f77088f6d1437a87cd97 | refs/heads/master | 2023-07-08T09:19:41.101604 | 2023-07-03T01:48:08 | 2023-07-03T01:48:08 | 143,147,502 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,948 | java | package educational_round087;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;
public class B {
static class Task {
private char[] charArr = new char[]{'1', '2', '3'};
private List<Character> getOtherChars(char c) {
List<Character> ansList = new ArrayList<>();
for (int i = 0; i < 3; i++) {
if (c != charArr[i]) {
ansList.add(charArr[i]);
}
}
return ansList;
}
public void solve(int testNumber, InputReader in, PrintWriter out) {
int t = in.nextInt();
while ((t--) > 0) {
char[] arr = in.next().toCharArray();
int[] indexArr = new int[]{-1, -1, -1};
int len = arr.length;
int ansMin = Integer.MAX_VALUE;
for (int i = 0; i < len; i++) {
char cur = arr[i];
List<Character> otherChars = getOtherChars(cur);
boolean isOk = true;
int minIdx = Integer.MAX_VALUE;
for (Character otherChar : otherChars) {
int tmpIdx = indexArr[otherChar - '1'];
if (tmpIdx == -1) {
isOk = false;
break;
}
minIdx = Math.min(minIdx, tmpIdx);
}
indexArr[cur - '1'] = i;
if (!isOk) {
continue;
}
ansMin = Math.min(ansMin, i - minIdx + 1);
}
out.println(ansMin == Integer.MAX_VALUE ? 0 : ansMin);
}
}
}
private static void sort(double[] arr) {
Double[] objArr = Arrays.stream(arr).boxed().toArray(Double[]::new);
Arrays.sort(objArr);
for (int i = 0; i < arr.length; i++) {
arr[i] = objArr[i];
}
}
private static void sort(int[] arr) {
Integer[] objArr = Arrays.stream(arr).boxed().toArray(Integer[]::new);
Arrays.sort(objArr);
for (int i = 0; i < arr.length; i++) {
arr[i] = objArr[i];
}
}
private static void sort(long[] arr) {
Long[] objArr = Arrays.stream(arr).boxed().toArray(Long[]::new);
Arrays.sort(objArr);
for (int i = 0; i < arr.length; i++) {
arr[i] = objArr[i];
}
}
private static void solve() {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Task task = new Task();
task.solve(1, in, out);
out.close();
}
public static void main(String[] args) {
new Thread(null, () -> solve(), "1", 1 << 26).start();
}
static class InputReader {
public BufferedReader reader;
public StringTokenizer tokenizer;
public InputReader(InputStream stream) {
reader = new BufferedReader(new InputStreamReader(stream), 32768);
tokenizer = null;
}
public String next() {
while (tokenizer == null || !tokenizer.hasMoreTokens()) {
try {
tokenizer = new StringTokenizer(reader.readLine());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return tokenizer.nextToken();
}
public int nextInt() {
return Integer.parseInt(next());
}
public long nextLong() {
return Long.parseLong(next());
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}
| [
"yuruiyin@cyou-inc.com"
] | yuruiyin@cyou-inc.com |
67da72ac929276e4d1161d8ead4e171060185f22 | cd5dc0b9e9bbd8aa870f97dcc17c1b1802cf1362 | /app/src/main/java/com/jeannypr/scientificstudy/Student/model/AdmissionBean.java | dbf2bf044b3b29394a9a907986bc601abe1ce678 | [] | no_license | SOFTSEER002/scientific-school-Android-SRG | ffa9a88fd5285be2857bf957485fba06cf2a95c6 | 453e96a20ab51c343fa7dbb44bf76b0ba4ef2fee | refs/heads/master | 2022-12-20T12:46:43.197101 | 2020-10-13T09:50:01 | 2020-10-13T09:50:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.jeannypr.scientificstudy.Student.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.jeannypr.scientificstudy.Base.Model.Bean;
public class AdmissionBean extends Bean {
@SerializedName("data")
@Expose
public AdmissionModel data;
}
| [
"khungersourav30@gmail.com"
] | khungersourav30@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.