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
4b2dfcab0736f14a64f1ded2709a99303ce3940b
745bf73f1fce0a23b4653d703d83f53b157c4a55
/src/main/java/org/jurassicraft/server/container/slot/CustomSlot.java
ecb78fe90dc11f2ab464f0b835720bc2b78c0624
[ "LicenseRef-scancode-public-domain" ]
permissive
TheXnator/JurassiCraft2
d1c479176c686db9416b71ac443423f2dbf40b03
850c3f5d0896d19e3626ed9c3589c77d958d85b7
refs/heads/master
2021-01-16T23:14:27.043344
2016-07-02T08:42:00
2016-07-02T08:42:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
607
java
package org.jurassicraft.server.container.slot; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import java.util.function.Predicate; public class CustomSlot extends Slot { private Predicate<ItemStack> item; public CustomSlot(IInventory inventory, int slotIndex, int xPosition, int yPosition, Predicate<ItemStack> item) { super(inventory, slotIndex, xPosition, yPosition); this.item = item; } @Override public boolean isItemValid(ItemStack stack) { return item.test(stack); } }
[ "gegy1000@gmail.com" ]
gegy1000@gmail.com
df6e8eab36f00a142eba02a9244103ae5da17de1
c5e8f518e5958468443f8bec41c8b7010d7bfb52
/IndWork/juhi-patel-individual-work/basic/RPS/src/main/java/sg/rps/rps.java
7a56c4c9aeba091d1eb5cd75522d8bf6266025a3
[]
no_license
juhipatel608/softwareguildwork
b180de200241b6e9518f7429b29254108cdb5418
7dda9bd1a7e6ec998788ce738c807c8357317912
refs/heads/master
2020-04-05T13:59:18.970997
2018-11-12T17:18:20
2018-11-12T17:18:20
156,915,847
0
0
null
null
null
null
UTF-8
Java
false
false
3,427
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package sg.rps; import java.util.Scanner; import java.util.Random; /** * * @author apprentice */ public class rps { public void doit() { Scanner capture = new Scanner(System.in); Random randomizer = new Random(); //boolean values, game has started but we dont know if user input is ok yet boolean validCheck = false, keepPlaying = true; int rounds = 11, compNumber; String userPick, computerPick; do { int tie = 0; int userWins = 0; int computerWins = 0; do { System.out.println("Let's play!!"); System.out.println("Choose number of rounds from 1 to 10 rounds"); if (capture.hasNextInt()) { rounds = capture.nextInt(); if (rounds >= 0 && rounds <= 10) { validCheck = true; } } else { System.out.println("That is not a number from 1 to 10!"); capture.next(); } } while (!validCheck); for (int i = 1; i < (rounds + 1); i++) { System.out.println("Pick: rock, paper, or scissors. CHECK YOUR SPELLING"); userPick = capture.next().toLowerCase(); System.out.print("Round " + i + " You picked " + userPick); compNumber = randomizer.nextInt(3); switch (compNumber) { case 0: computerPick = "rock"; break; case 1: computerPick = "paper"; break; default: computerPick = "scissors"; break; } System.out.println(" The computer picks " + computerPick); if ((userPick.equals("rock") && computerPick.equals("scissors")) || (userPick.equals("paper") && computerPick.equals("rock")) || (userPick.equals("scissors") && computerPick.equals("paper"))) { userWins += 1; System.out.println("You Win!"); } else if (userPick.equals(computerPick)) { tie += 1; System.out.println("Tie!"); } else { computerWins += 1; System.out.println("Sorry, you loose"); } } System.out.println("User wins: " + userWins + " Computer wins: " + computerWins + " Ties: " + tie); if (userWins > computerWins) { System.out.println("You win!!"); } else if (userWins == computerWins) { System.out.println("Kiss your sister, It's a tie"); } else { System.out.println("You lose.."); } System.out.println("Keep Playing? (y/n)"); String play = capture.next(); if (play.equals("n")) { keepPlaying = false; } } while (keepPlaying == true); } }
[ "you@example.com" ]
you@example.com
f9e5d24d71668090a06ca72db8887f502ee3ebdf
93561649a99d5f16e6427c0017570b6ae7273d49
/DatePicker/src/main/java/com/yk/silenct/datepicker/WheelPicker.java
d58321c229e5f7ebb5bde98c760b7ca68be97dce
[]
no_license
muyishuangfeng/DatePicker
205907e29a904d1ea4c297e3fb80f1439ebf2895
20cb737a08dc4bc85227c7dc687bb4696972e74d
refs/heads/master
2020-06-15T10:08:28.753384
2019-07-04T16:41:33
2019-07-04T16:41:33
195,269,582
0
0
null
null
null
null
UTF-8
Java
false
false
3,940
java
package com.yk.silenct.datepicker; import android.app.Activity; import android.support.annotation.ColorInt; import android.support.annotation.IntRange; import android.support.annotation.Nullable; import android.view.View; import com.yk.silenct.datepicker.dialog.ConfirmDialog; import com.yk.silenct.datepicker.wheelView.LineConfig; import com.yk.silenct.datepicker.wheelView.WheelListView; /** * 滑轮选择器 */ public abstract class WheelPicker extends ConfirmDialog<View> { protected int textSize = WheelListView.TEXT_SIZE; protected int textColorNormal = WheelListView.TEXT_COLOR_NORMAL; protected int textColorFocus = WheelListView.TEXT_COLOR_FOCUS; protected int offset = WheelListView.ITEM_OFF_SET; protected boolean canLoop = true; protected boolean wheelModeEnable = false; protected boolean weightEnable = false; protected boolean canLinkage = false;//是否联动 protected LineConfig lineConfig; private View contentView; public WheelPicker(Activity activity) { super(activity); } /** * 设置文字大小 */ public void setTextSize(int textSize) { this.textSize = textSize; } /** * 设置未选中文字颜色 */ public void setUnSelectedTextColor(@ColorInt int unSelectedTextColor) { this.textColorNormal = unSelectedTextColor; } /** * 设置选中文字颜色 */ public void setSelectedTextColor(@ColorInt int selectedTextColor) { this.textColorFocus = selectedTextColor; } /** * 设置分隔线是否可见 */ public void setLineVisible(boolean lineVisible) { if (null == lineConfig) { lineConfig = new LineConfig(); } lineConfig.setVisible(lineVisible); } /** * 设置分隔阴影是否可见 * 暂时去掉此功能 */ // public void setShadowVisible(boolean shadowVisible) { // if (null == lineConfig) { // lineConfig = new LineConfig(); // } // lineConfig.setShadowVisible(shadowVisible); // } /** * 设置是否自动联动 */ public void setCanLinkage(boolean canLinkage) { this.canLinkage = canLinkage; } /** * 设置分隔线颜色 */ public void setLineColor(@ColorInt int lineColor) { if (null == lineConfig) { lineConfig = new LineConfig(); } lineConfig.setVisible(true); lineConfig.setColor(lineColor); } /** * 设置分隔线配置项,设置null将隐藏分割线及阴影 */ public void setLineConfig(@Nullable LineConfig config) { if (null == config) { lineConfig = new LineConfig(); lineConfig.setVisible(false); lineConfig.setShadowVisible(false); } else { lineConfig = config; } } /** * 设置选项偏移量,可用来要设置显示的条目数,范围为1-3。 * 1显示3条、2显示5条、3显示7条 */ public void setOffset(@IntRange(from = 1, to = 3) int offset) { this.offset = offset; } /** * 设置是否禁用循环 * true 循环 false 不循环 */ public void setCanLoop(boolean canLoop) { this.canLoop = canLoop; } /** * 设置是否启用ios滚轮模式 */ public void setWheelModeEnable(boolean wheelModeEnable) { this.wheelModeEnable = wheelModeEnable; } /** * 线性布局设置是否启用权重 * true 启用 false 自适应width */ public void setWeightEnable(boolean weightEnable) { this.weightEnable = weightEnable; } /** * 得到选择器视图,可内嵌到其他视图容器 */ @Override public View getContentView() { if (null == contentView) { contentView = makeCenterView(); } return contentView; } }
[ "yangkemuyi@sina.com" ]
yangkemuyi@sina.com
3bb9941736bf0174a9c14cf50e5e56d2cbe03c1d
5c41116d17ef8864423bcc5498c4efd6c696cbac
/com/rwtema/extrautils/asm/RemoteCallFactory.java
847cac871b48a19d6053091a66357d7e3c252487
[]
no_license
richardhendricks/ExtraUtilities
519175ce14406f95620c34a425e1fd54964cbcf6
1b9d60a14cc7f76754eb8f0e7c1e1c77f3bda7a6
refs/heads/master
2021-07-14T11:56:53.480656
2017-10-19T16:03:19
2017-10-19T16:03:19
107,566,180
0
0
null
null
null
null
UTF-8
Java
false
false
5,202
java
/* 1: */ package com.rwtema.extrautils.asm; /* 2: */ /* 3: */ import com.google.common.base.Throwables; /* 4: */ import java.lang.reflect.Method; /* 5: */ import java.lang.reflect.Modifier; /* 6: */ import net.minecraft.item.ItemStack; /* 7: */ import net.minecraft.launchwrapper.LaunchClassLoader; /* 8: */ import org.objectweb.asm.ClassWriter; /* 9: */ import org.objectweb.asm.MethodVisitor; /* 10: */ import org.objectweb.asm.Type; /* 11: */ /* 12: */ public class RemoteCallFactory /* 13: */ { /* 14: */ static LaunchClassLoader cl; /* 15: */ static Method m_defineClass; /* 16: */ /* 17: */ static /* 18: */ { /* 19:17 */ cl = (LaunchClassLoader)RemoteCallFactory.class.getClassLoader(); /* 20: */ try /* 21: */ { /* 22:22 */ m_defineClass = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] { String.class, [B.class, Integer.TYPE, Integer.TYPE }); /* 23:23 */ m_defineClass.setAccessible(true); /* 24: */ } /* 25: */ catch (Exception e) /* 26: */ { /* 27:25 */ throw new RuntimeException(e); /* 28: */ } /* 29: */ } /* 30: */ /* 31:29 */ public static IObjectEvaluate<ItemStack> pulverizer = getEvaluator("cofh.thermalexpansion.util.crafting.PulverizerManager", "recipeExists", ItemStack.class); /* 32: */ /* 33: */ public static <T> IObjectEvaluate<T> getEvaluator(String baseClass, String baseMethod, Class param) /* 34: */ { /* 35: */ try /* 36: */ { /* 37:33 */ Class<?> clazz = Class.forName(baseClass); /* 38:34 */ Method method = clazz.getDeclaredMethod(baseMethod, new Class[] { param }); /* 39:35 */ if ((!$assertionsDisabled) && (!Modifier.isStatic(method.getModifiers()))) { /* 40:35 */ throw new AssertionError(); /* 41: */ } /* 42: */ } /* 43: */ catch (Exception e) /* 44: */ { /* 45:37 */ return null; /* 46: */ } /* 47:40 */ String classname = "XU_caller_" + baseClass.replace('.', '_') + "_" + baseMethod + "_" + param.getSimpleName(); /* 48:41 */ String superName = Type.getInternalName(Object.class); /* 49: */ /* 50:43 */ ClassWriter cw = new ClassWriter(0); /* 51: */ /* 52:45 */ cw.visit(50, 33, classname, null, superName, new String[] { Type.getInternalName(IObjectEvaluate.class) }); /* 53:46 */ cw.visitSource(".dynamic", null); /* 54: */ /* 55:48 */ MethodVisitor constructor = cw.visitMethod(1, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]), null, null); /* 56:49 */ constructor.visitCode(); /* 57:50 */ constructor.visitVarInsn(25, 0); /* 58:51 */ constructor.visitMethodInsn(183, superName, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, new Type[0]), false); /* 59:52 */ constructor.visitInsn(177); /* 60:53 */ constructor.visitMaxs(1, 1); /* 61:54 */ constructor.visitEnd(); /* 62: */ /* 63:56 */ MethodVisitor getData = cw.visitMethod(1, "evaluate", Type.getMethodDescriptor(Type.BOOLEAN_TYPE, new Type[] { Type.getType(Object.class) }), null, null); /* 64:57 */ getData.visitCode(); /* 65:58 */ if (param != null) /* 66: */ { /* 67:59 */ getData.visitVarInsn(25, 1); /* 68:60 */ if (param != Object.class) { /* 69:61 */ getData.visitTypeInsn(192, Type.getInternalName(param)); /* 70: */ } /* 71:63 */ getData.visitMethodInsn(184, baseClass.replace('.', '/'), baseMethod, Type.getMethodDescriptor(Type.BOOLEAN_TYPE, new Type[] { Type.getType(param) }), false); /* 72: */ } /* 73: */ else /* 74: */ { /* 75:65 */ getData.visitMethodInsn(184, baseClass.replace('.', '/'), baseMethod, Type.getMethodDescriptor(Type.BOOLEAN_TYPE, new Type[0]), false); /* 76: */ } /* 77:67 */ getData.visitInsn(172); /* 78:68 */ getData.visitMaxs(1, 2); /* 79:69 */ getData.visitEnd(); /* 80: */ /* 81:71 */ cw.visitEnd(); /* 82: */ /* 83:73 */ byte[] b = cw.toByteArray(); /* 84: */ try /* 85: */ { /* 86:76 */ Class<? extends IObjectEvaluate> clazz = (Class)m_defineClass.invoke(cl, new Object[] { classname, b, Integer.valueOf(0), Integer.valueOf(b.length) }); /* 87:77 */ return (IObjectEvaluate)clazz.newInstance(); /* 88: */ } /* 89: */ catch (Throwable e) /* 90: */ { /* 91:79 */ throw Throwables.propagate(e); /* 92: */ } /* 93: */ } /* 94: */ /* 95:87 */ public static IObjectEvaluate nullValuate = new IObjectEvaluate() /* 96: */ { /* 97: */ public boolean evaluate(Object object) /* 98: */ { /* 99:90 */ return false; /* :0: */ } /* :1: */ }; /* :2: */ /* :3: */ public static abstract interface IObjectEvaluate<T> /* :4: */ { /* :5: */ public abstract boolean evaluate(T paramT); /* :6: */ } /* :7: */ } /* Location: E:\TechnicPlatform\extrautilities\extrautilities-1.2.13.jar * Qualified Name: com.rwtema.extrautils.asm.RemoteCallFactory * JD-Core Version: 0.7.0.1 */
[ "richard.hendricks@silabs.com" ]
richard.hendricks@silabs.com
78a7f0448b775a45e2b8d11ddff63b5e5f0fb073
b85d0ce8280cff639a80de8bf35e2ad110ac7e16
/com/fossil/cnd.java
7ba50052e7d7af73be0ce0d8afcfaa684e42c1ce
[]
no_license
MathiasMonstrey/fosil_decompiled
3d90433663db67efdc93775145afc0f4a3dd150c
667c5eea80c829164220222e8fa64bf7185c9aae
refs/heads/master
2020-03-19T12:18:30.615455
2018-06-07T17:26:09
2018-06-07T17:26:09
136,509,743
1
0
null
null
null
null
UTF-8
Java
false
false
781
java
package com.fossil; import android.text.SpannableString; import android.text.TextUtils; import android.text.style.RelativeSizeSpan; public class cnd { private static int cyH = -1; public static SpannableString m7187a(String str, String str2, float f) { SpannableString spannableString = new SpannableString(str + str2); spannableString.setSpan(new RelativeSizeSpan(f), str.length(), str.length() + str2.length(), 0); return spannableString; } public static char gn(String str) { if (TextUtils.isEmpty(str)) { return '#'; } char toUpperCase = Character.toUpperCase(str.charAt(0)); if (Character.isAlphabetic(toUpperCase)) { return toUpperCase; } return '#'; } }
[ "me@mathiasmonstrey.be" ]
me@mathiasmonstrey.be
e139e130f7f1103b663fd6d890ceea4868ee22a3
3fe13cf6c08efb6e1789b7335c4a4c3164dda044
/platform-camel/ihe/fhir/stu3/mhd/src/test/java/org/openehealth/ipf/platform/camel/ihe/fhir/iti66/TestIti66Success.java
17249d6eb8f6fcaca3411f016d1d6edb09b6f5f2
[ "Apache-2.0" ]
permissive
lukasznidecki/ipf
aeb40c1fd0586bc7cba4c489c6ca5669e726db9b
30b52739b5807bc6fee82edc8d2b7b9e60a97183
refs/heads/master
2021-06-29T00:03:09.917235
2017-09-17T01:43:40
2017-09-17T01:51:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,254
java
/* * Copyright 2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openehealth.ipf.platform.camel.ihe.fhir.iti66; import org.hl7.fhir.dstu3.model.Bundle; import org.hl7.fhir.dstu3.model.DocumentManifest; import org.hl7.fhir.dstu3.model.ResourceType; import org.junit.BeforeClass; import org.junit.Test; import org.openehealth.ipf.commons.ihe.core.atna.MockedSender; import org.openehealth.ipf.commons.ihe.core.atna.custom.CustomIHETransactionEventTypeCodes; import org.openhealthtools.ihe.atna.auditor.codes.dicom.DICOMEventIdCodes; import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ActiveParticipantCodes; import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes; import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ParticipantObjectCodes; import org.openhealthtools.ihe.atna.auditor.models.rfc3881.*; import javax.servlet.ServletException; import static org.junit.Assert.*; /** * */ public class TestIti66Success extends AbstractTestIti66 { private static final String CONTEXT_DESCRIPTOR = "iti-66.xml"; @BeforeClass public static void setUpClass() throws ServletException { startServer(CONTEXT_DESCRIPTOR); } @Test public void testGetConformance() { assertConformance("DocumentManifest"); } @Test public void testSendManualIti66() { Bundle result = sendManually(manifestPatientIdentifierParameter()); assertEquals(Bundle.BundleType.SEARCHSET, result.getType()); assertEquals(ResourceType.Bundle, result.getResourceType()); assertEquals(1, result.getTotal()); DocumentManifest p = (DocumentManifest) result.getEntry().get(0).getResource(); assertEquals("9bc72458-49b0-11e6-8a1c-3c1620524153", p.getIdElement().getIdPart()); // Check ATNA Audit MockedSender sender = getAuditSender(); assertEquals(1, sender.getMessages().size()); AuditMessage event = sender.getMessages().get(0).getAuditMessage(); // Event assertEquals( RFC3881EventCodes.RFC3881EventOutcomeCodes.SUCCESS.getCode().intValue(), event.getEventIdentification().getEventOutcomeIndicator()); assertEquals( RFC3881EventCodes.RFC3881EventActionCodes.EXECUTE.getCode(), event.getEventIdentification().getEventActionCode()); CodedValueType eventId = event.getEventIdentification().getEventID(); CodedValueType expectedEventId = new DICOMEventIdCodes.Query(); assertEquals(expectedEventId.getCode(), eventId.getCode()); assertEquals(expectedEventId.getCodeSystemName(), eventId.getCodeSystemName()); assertEquals(expectedEventId.getOriginalText(), eventId.getOriginalText()); CodedValueType eventTypeCode = event.getEventIdentification().getEventTypeCode().get(0); CodedValueType expectedEventTypeCode = new CustomIHETransactionEventTypeCodes.DocumentManifestQuery(); assertEquals(expectedEventTypeCode.getCode(), eventTypeCode.getCode()); assertEquals(expectedEventTypeCode.getCodeSystemName(), eventTypeCode.getCodeSystemName()); assertEquals(expectedEventTypeCode.getOriginalText(), eventTypeCode.getOriginalText()); // ActiveParticipant Source ActiveParticipantType source = event.getActiveParticipant().get(0); assertTrue(source.isUserIsRequestor()); assertEquals("127.0.0.1", source.getNetworkAccessPointID()); assertEquals(RFC3881ActiveParticipantCodes.RFC3881NetworkAccessPointTypeCodes.IP_ADDRESS.getCode(), source.getNetworkAccessPointTypeCode()); // ActiveParticipant Destination ActiveParticipantType destination = event.getActiveParticipant().get(1); assertFalse(destination.isUserIsRequestor()); assertEquals("http://localhost:" + DEMO_APP_PORT + "/DocumentManifest", destination.getUserID()); assertEquals("localhost", destination.getNetworkAccessPointID()); // Audit Source AuditSourceIdentificationType sourceIdentificationType = event.getAuditSourceIdentification().get(0); assertEquals("IPF", sourceIdentificationType.getAuditSourceID()); assertEquals("IPF", sourceIdentificationType.getAuditEnterpriseSiteID()); // Patient ParticipantObjectIdentificationType patient = event.getParticipantObjectIdentification().get(0); assertEquals(RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes.PERSON.getCode(), patient.getParticipantObjectTypeCode()); assertEquals(RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes.PATIENT.getCode(), patient.getParticipantObjectTypeCodeRole()); assertEquals("urn:oid:2.16.840.1.113883.3.37.4.1.1.2.1.1|1", new String(patient.getParticipantObjectID())); // Query Parameters ParticipantObjectIdentificationType query = event.getParticipantObjectIdentification().get(1); assertEquals(RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes.SYSTEM.getCode(), query.getParticipantObjectTypeCode()); assertEquals(RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes.QUERY.getCode(), query.getParticipantObjectTypeCodeRole()); assertEquals("http://localhost:8999/DocumentManifest?patient.identifier=urn%3Aoid%3A2.16.840.1.113883.3.37.4.1.1.2.1.1%7C1", new String(query.getParticipantObjectQuery())); CodedValueType poitTypeCode = query.getParticipantObjectIDTypeCode(); assertEquals("ITI-66", poitTypeCode.getCode()); assertEquals("IHE Transactions", poitTypeCode.getCodeSystemName()); assertEquals("Mobile Document Manifest Query", poitTypeCode.getOriginalText()); assertEquals("MobileDocumentManifestQuery", query.getParticipantObjectID()); } @Test public void testSendIti66WithPatientReference() { Bundle result = sendManually(manifestPatientReferenceParameter()); assertEquals(Bundle.BundleType.SEARCHSET, result.getType()); assertEquals(ResourceType.Bundle, result.getResourceType()); assertEquals(1, result.getTotal()); DocumentManifest p = (DocumentManifest) result.getEntry().get(0).getResource(); assertEquals("9bc72458-49b0-11e6-8a1c-3c1620524153", p.getIdElement().getIdPart()); } @Test public void testGetResource() { DocumentManifest p = client.read() .resource(DocumentManifest.class) .withId("9bc72458-49b0-11e6-8a1c-3c1620524153") .execute(); assertEquals(String.format("http://localhost:%d/DocumentManifest/9bc72458-49b0-11e6-8a1c-3c1620524153", DEMO_APP_PORT), p.getId()); } }
[ "christian.ohr@gmail.com" ]
christian.ohr@gmail.com
da95c505b6ef6fa6f40f66eccefa24d4df784590
85710848a116e0b70b380fb47847b673eddc2d75
/app/src/test/java/io/github/hidroh/materialistic/ReadabilityFragmentLazyLoadTest.java
9951714697edfa4c76864fc87a7772637c7fe426
[ "Apache-2.0" ]
permissive
konyan/materialistic
17c9844999d82757a164c524b64791a35e683d7f
40d9c619ae1bfa3a857c384bb214885afca1d6fa
refs/heads/master
2020-12-27T11:47:40.352021
2016-01-17T06:06:40
2016-01-17T06:06:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,792
java
package io.github.hidroh.materialistic; import android.content.Context; import android.net.ConnectivityManager; import android.os.Bundle; import android.support.v4.app.Fragment; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.Robolectric; import org.robolectric.RobolectricGradleTestRunner; import org.robolectric.annotation.Config; import org.robolectric.shadows.ShadowNetworkInfo; import org.robolectric.util.ActivityController; import javax.inject.Inject; import io.github.hidroh.materialistic.data.ItemManager; import io.github.hidroh.materialistic.data.ReadabilityClient; import io.github.hidroh.materialistic.test.ShadowSupportPreferenceManager; import io.github.hidroh.materialistic.test.TestReadabilityActivity; import io.github.hidroh.materialistic.test.TestWebItem; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; import static org.robolectric.Shadows.shadowOf; @Config(shadows = {ShadowSupportPreferenceManager.class}) @RunWith(RobolectricGradleTestRunner.class) public class ReadabilityFragmentLazyLoadTest { private TestReadabilityActivity activity; private ActivityController<TestReadabilityActivity> controller; @Inject ReadabilityClient readabilityClient; private Fragment fragment; @Before public void setUp() { TestApplication.applicationGraph.inject(this); reset(readabilityClient); controller = Robolectric.buildActivity(TestReadabilityActivity.class); activity = controller.create().start().resume().visible().get(); Bundle args = new Bundle(); ItemManager.WebItem item = new TestWebItem() { @Override public String getId() { return "1"; } @Override public String getUrl() { return "http://example.com/article.html"; } }; args.putParcelable(ReadabilityFragment.EXTRA_ITEM, item); fragment = Fragment.instantiate(activity, ReadabilityFragment.class.getName(), args); shadowOf((ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE)) .setActiveNetworkInfo(null); } @Test public void testLazyLoadByDefault() { activity.getSupportFragmentManager() .beginTransaction() .replace(R.id.content_frame, fragment, "tag") .commit(); verify(readabilityClient, never()).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); reset(readabilityClient); fragment.setUserVisibleHint(true); fragment.setUserVisibleHint(false); verify(readabilityClient).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); } @Test public void testLazyLoadOnWifi() { ShadowSupportPreferenceManager.getDefaultSharedPreferences(activity) .edit() .putBoolean(activity.getString(R.string.pref_lazy_load), false) .commit(); activity.getSupportFragmentManager() .beginTransaction() .replace(R.id.content_frame, fragment, "tag") .commit(); verify(readabilityClient, never()).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); reset(readabilityClient); fragment.setUserVisibleHint(true); fragment.setUserVisibleHint(false); verify(readabilityClient).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); } @Test public void testVisible() { ShadowSupportPreferenceManager.getDefaultSharedPreferences(activity) .edit() .putBoolean(activity.getString(R.string.pref_lazy_load), false) .commit(); shadowOf((ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE)) .setActiveNetworkInfo(ShadowNetworkInfo.newInstance(null, ConnectivityManager.TYPE_WIFI, 0, true, true)); fragment.setUserVisibleHint(true); verify(readabilityClient, never()).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); reset(readabilityClient); activity.getSupportFragmentManager() .beginTransaction() .replace(R.id.content_frame, fragment, "tag") .commit(); verify(readabilityClient).parse(anyString(), anyString(), any(ReadabilityClient.Callback.class)); } @After public void tearDown() { controller.pause().stop().destroy(); } }
[ "haduytrung@gmail.com" ]
haduytrung@gmail.com
844119f788b293f4d2d49910bde8c912f5f0a238
6490bdaaf040280870c8d51620f2a89153cd6b28
/jni/src/main/java/native_types/utils/StringArray.java
f86a7bb721457ff8944bf1e4aaacd2cefc340ae2
[ "Apache-2.0" ]
permissive
boluoyu/tf_scala
1d0c12b898541137783ca4334e7ccbd24f113a7d
d1b9bea95347ac10ebed9d176fe731964f789886
refs/heads/master
2020-08-01T17:29:55.779064
2018-11-04T12:32:20
2018-11-04T12:32:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,507
java
package native_types.utils; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; @Platform(include={ "<string>" }) @Name("std::string") public class StringArray extends Pointer { public StringArray(Pointer p) { super(p); } public StringArray() { allocate(); } private native void allocate(); public StringArray(StringArray p) { allocate(p); } private native void allocate(@ByRef StringArray p); public StringArray(BytePointer s, long count) { allocate(s, count); } private native void allocate(@Cast("char*") BytePointer s, long count); public StringArray(String s) { allocate(s); } private native void allocate(String s); public native @Name("operator=") @ByRef StringArray put(@ByRef StringArray str); public native @Name("operator=") @ByRef StringArray put(String str); @Override public StringArray position(long position) { return (StringArray)super.position(position); } public native @Cast("size_t") long size(); public native void resize(@Cast("size_t") long n); @Index public native @Cast("char") int get(@Cast("size_t") long pos); public native StringArray put(@Cast("size_t") long pos, int c); public native @Cast("const char*") BytePointer data(); @Override public String toString() { long length = size(); byte[] bytes = new byte[length < Integer.MAX_VALUE ? (int)length : Integer.MAX_VALUE]; data().get(bytes); return new String(bytes); } }
[ "you@example.com" ]
you@example.com
827e23e30835924377166b192989bed80444a921
5304c99344ae36f868e598e27de6e70aa0555602
/src/main/java/org/elasticsearch/index/gateway/cloud/CloudIndexGateway.java
8ef5b86236dafaf410f271fe7de46621382bced7
[]
no_license
dlobue/elasticsearch-cloud-jcloud
9cdd63a6144b739b6a70f1c83907dfa0ba3a332f
1506f22213a3b1fa63f8759f7140498bb0005d47
refs/heads/master
2020-06-06T11:04:51.975955
2014-01-22T21:31:21
2014-01-22T21:31:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,684
java
/* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search 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.elasticsearch.index.gateway.cloud; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.gateway.Gateway; import org.elasticsearch.index.Index; import org.elasticsearch.index.gateway.IndexShardGateway; import org.elasticsearch.index.gateway.blobstore.BlobStoreIndexGateway; import org.elasticsearch.index.settings.IndexSettings; /** * @author kimchy (shay.banon) */ public class CloudIndexGateway extends BlobStoreIndexGateway { @Inject public CloudIndexGateway(Index index, @IndexSettings Settings indexSettings, Gateway gateway) { super(index, indexSettings, gateway); } @Override public String type() { return "cloud"; } @Override public Class<? extends IndexShardGateway> shardGatewayClass() { return CloudIndexShardGateway.class; } }
[ "kimchy@gmail.com" ]
kimchy@gmail.com
41ef3f236e06e03512294706d730137670b77298
5aaebaafeb75c7616689bcf71b8dd5ab2c89fa3b
/src/ANXGallery/sources/com/miui/gallery/search/resultpage/LocationListFragment.java
14033664efb81fff5f1bbd146e7d09a2ed40d220
[]
no_license
gitgeek4dx/ANXGallery9
9bf2b4da409ab16492e64340bde4836d716ea7ec
af2e3c031d1857fa25636ada923652b66a37ff9e
refs/heads/master
2022-01-15T05:23:24.065872
2019-07-25T17:34:35
2019-07-25T17:34:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,395
java
package com.miui.gallery.search.resultpage; import android.content.Context; import com.miui.gallery.R; import com.miui.gallery.search.StatusHandleHelper.AbstractErrorViewAdapter; import com.miui.gallery.search.StatusHandleHelper.InfoViewPosition; public class LocationListFragment extends SearchResultFragment { private class LocationListErrorViewAdapter extends ErrorViewAdapter { public LocationListErrorViewAdapter(Context context) { super(context); } /* access modifiers changed from: protected */ public int getIconResForStatus(int i, InfoViewPosition infoViewPosition) { if (infoViewPosition == InfoViewPosition.FULL_SCREEN) { return R.drawable.empty_page_places; } if (infoViewPosition == InfoViewPosition.FOOTER) { return R.drawable.search_connection_error_icon; } return 0; } /* access modifiers changed from: protected */ public String getInfoTitleForStatus(int i, InfoViewPosition infoViewPosition) { boolean z = infoViewPosition == InfoViewPosition.FULL_SCREEN; int i2 = R.string.places_album_empty_title; if (i != 1) { if (i == 10) { i2 = R.string.search_syncing; } else if (i != 13) { switch (i) { case 3: if (!z) { i2 = R.string.search_login_title; break; } break; case 4: if (!z) { i2 = R.string.search_backup_title; break; } break; default: if (!z) { i2 = R.string.search_error_and_retry; break; } break; } } else { i2 = R.string.ai_album_requesting_title; } } else if (!z) { i2 = R.string.search_connection_error_and_set; } return this.mContext.getString(i2); } } /* JADX WARNING: type inference failed for: r1v0, types: [com.miui.gallery.activity.BaseActivity, android.content.Context] */ /* access modifiers changed from: protected */ /* JADX WARNING: Multi-variable type inference failed. Error: jadx.core.utils.exceptions.JadxRuntimeException: No candidate types for var: r1v0, types: [com.miui.gallery.activity.BaseActivity, android.content.Context] assigns: [com.miui.gallery.activity.BaseActivity] uses: [android.content.Context] mth insns count: 7 at jadx.core.dex.visitors.typeinference.TypeSearch.fillTypeCandidates(TypeSearch.java:237) at java.util.ArrayList.forEach(Unknown Source) at jadx.core.dex.visitors.typeinference.TypeSearch.run(TypeSearch.java:53) at jadx.core.dex.visitors.typeinference.TypeInferenceVisitor.runMultiVariableSearch(TypeInferenceVisitor.java:99) at jadx.core.dex.visitors.typeinference.TypeInferenceVisitor.visit(TypeInferenceVisitor.java:92) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:27) at jadx.core.dex.visitors.DepthTraversal.lambda$visit$1(DepthTraversal.java:14) at java.util.ArrayList.forEach(Unknown Source) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14) at jadx.core.ProcessClass.process(ProcessClass.java:30) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:311) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:217) */ /* JADX WARNING: Unknown variable types count: 1 */ public AbstractErrorViewAdapter getErrorViewAdapter() { if (this.mErrorViewAdapter == null) { this.mErrorViewAdapter = new LocationListErrorViewAdapter(this.mActivity); } return this.mErrorViewAdapter; } /* access modifiers changed from: protected */ public int getLayoutResource() { return R.layout.search_location_list_fragment; } }
[ "sv.xeon@gmail.com" ]
sv.xeon@gmail.com
60ba8df5e233cd39d57bab4f0c354852c59ad766
c32ebeaeeac4ddeafdd587cc7e2f2b73e10af8e2
/montage-application/src/br/ufc/montage/proxies/MBgExecProxie.java
008f1dedede7e8b76115be51d11f39fb530756fa
[]
no_license
UFC-MDCC-HPC/HPC-Storm-SAFe
94eb398e2c366742004046fe7feb9a6afe3495f5
be39f2f4cb89ec139f76e1243775f7ce479db072
refs/heads/master
2020-05-29T11:42:23.943344
2017-05-13T20:59:26
2017-05-13T20:59:26
34,304,530
0
0
null
null
null
null
UTF-8
Java
false
false
3,412
java
package br.ufc.montage.proxies; import br.montage.stubs.mBgExec.IMBgExecImplService; import br.ufc.mdcc.pargo.safe.framework.exception.HShelfException; import br.ufc.mdcc.pargo.safe.framework.port.HShelfUsesPort; import br.ufc.mdcc.pargo.safe.framework.services.IHShelfService; import br.ufc.montage.ports.MontageShelfProvidesPort; import br.ufc.montage.ports.MontageTypes; import br.ufc.montage.ports.tsk.GoPortTask; public class MBgExecProxie extends MontageShelfComputationComponent { private HShelfUsesPort tblPortUsesA; private HShelfUsesPort tblPortUsesB; private HShelfUsesPort dirPortUsesIn; private HShelfUsesPort dirPortUsesOut; private GoPortTask goPortTask; @Override public void setServices(IHShelfService services) { this.services = services; this.goPortTask = new GoPortTask(this); this.goPortTask.setName("mbgexec-go"); try { this.services.registerTaskPort(goPortTask); this.services.registerUsesPort("mbgexec-go-tbl-port-uses-a", MontageTypes.TBL_TYPE); this.services.registerUsesPort("mbgexec-go-dir-port-uses-in", MontageTypes.DIR_TYPE); this.services.registerUsesPort("mbgexec-go-dir-port-uses-out", MontageTypes.DIR_TYPE); this.services.registerUsesPort("mbgexec-go-tbl-port-uses-b", MontageTypes.TBL_TYPE); // comunicar com o web service uses aqui, passando o parâmetro a // ele, conseguido da local // WS_USES.SET_VALUE... } catch (HShelfException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public void go() { String tblValueA = null; String dirInValue = null; String dirOutValue = null; String tblValueB = null; IMBgExecImplService service = new IMBgExecImplService(); try { this.tblPortUsesA = (HShelfUsesPort) this.services .getPort("mbgexec-go-tbl-port-uses-a"); this.dirPortUsesIn = (HShelfUsesPort) this.services .getPort("mbgexec-go-dir-port-uses-in"); this.dirPortUsesOut = (HShelfUsesPort) this.services .getPort("mbgexec-go-dir-port-uses-out"); this.tblPortUsesB = (HShelfUsesPort) this.services .getPort("mbgexec-go-tbl-port-uses-b"); dirInValue = ((MontageShelfProvidesPort) this.dirPortUsesIn .getProvidesPort()).getValue(); dirOutValue = ((MontageShelfProvidesPort) this.dirPortUsesOut .getProvidesPort()).getValue(); tblValueA = ((MontageShelfProvidesPort) this.tblPortUsesA .getProvidesPort()).getValue(); tblValueB = ((MontageShelfProvidesPort) this.tblPortUsesB .getProvidesPort()).getValue(); // comunicar com o web service uses aqui, passando os 4 parâmetros a // ele, conseguido da local // 4 x WS_USES.SET_VALUE.. service.getIMBgExecImplPort().setDirPortUsesIn(dirInValue); service.getIMBgExecImplPort().setDirPortUsesOut(dirOutValue); service.getIMBgExecImplPort().setTblPortUsesA(tblValueA); service.getIMBgExecImplPort().setTblPortUsesB(tblValueB); } catch (HShelfException e) { // TODO Auto-generated catch block e.printStackTrace(); } // SIMULAÇAO DA CHAMADA REMOTA DO WEB SERVICE PELA PORTA GO // WS_GO.GO // begin some computation... // mBgExec -p projdir images.tbl corrections.tbl corrdir //String cmd = "mBgExec -p " + dirInValue + " " + tblValueA + " " // + tblValueB + " " + dirOutValue; //System.out.println(cmd); service.getIMBgExecImplPort().go(); // end some computation! // FIM DA SIMULAÇÃO } }
[ "jeffersoncarvalho@gmail.com" ]
jeffersoncarvalho@gmail.com
84a462250ad28a6b4dce2c9f257a8f34d79aaf80
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2007-12-14/seasar2-2.4.18/seasar2/s2-framework/src/main/java/org/seasar/framework/container/creator/DaoCreator.java
1915352b3089c8a2e313cb73f85a17fefeac8852
[ "Apache-2.0" ]
permissive
svn2github/s2container
54ca27cf0c1200a93e1cb88884eb8226a9be677d
625adc6c4e1396654a7297d00ec206c077a78696
refs/heads/master
2020-06-04T17:15:02.140847
2013-08-09T09:38:15
2013-08-09T09:38:15
10,850,644
0
1
null
null
null
null
UTF-8
Java
false
false
2,943
java
/* * Copyright 2004-2007 the Seasar Foundation and the Others. * * 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.seasar.framework.container.creator; import org.seasar.framework.container.ComponentCreator; import org.seasar.framework.container.ComponentCustomizer; import org.seasar.framework.container.deployer.InstanceDefFactory; import org.seasar.framework.convention.NamingConvention; /** * Daoクラス用の {@link ComponentCreator}です。 * <p> * 決められた命名規約に従って、クラスからDaoクラスのコンポーネント定義を作成します。 作成されるコンポーネント定義の各種属性は以下になります。 * * <table> * <tr> * <th>サフィックス</th> * <td>{@link NamingConvention#getActionSuffix() Dao(デフォルト)}</td> * </tr> * <tr> * <th>インスタンス定義</th> * <td>prototype</td> * </tr> * <tr> * <th>自動バインディング</th> * <td>auto</td> * </tr> * <tr> * <th>外部バインディング</th> * <td>無効</td> * </tr> * <tr> * <th>インターフェース</th> * <td>有効</td> * </tr> * <tr> * <th>抽象クラス</th> * <td>有効</td> * </tr> * </table> * </p> * * @author higa * @author yatsu */ public class DaoCreator extends ComponentCreatorImpl { /** * 指定された{@link NamingConvention 命名規約}に従った{@link DaoCreator}を作成します。 * * @param namingConvention * 命名規約 */ public DaoCreator(NamingConvention namingConvention) { super(namingConvention); setNameSuffix(namingConvention.getDaoSuffix()); setInstanceDef(InstanceDefFactory.PROTOTYPE); setEnableInterface(true); setEnableAbstract(true); } /** * Dao用の {@link ComponentCustomizer コンポーネントカスタマイザ}を返します。 * * @return コンポーネントカスタマイザ */ public ComponentCustomizer getDaoCustomizer() { return getCustomizer(); } /** * Dao用の コンポーネントカスタマイザを設定します。 * * @param customizer * コンポーネントカスタマイザ */ public void setDaoCustomizer(ComponentCustomizer customizer) { setCustomizer(customizer); } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
f82c8d627810a2cd204ef74fb4173021f7b7618c
2692a566517b0a8213194381aa3425721a9788fd
/src/main/java/com/dimple/project/system/service/DictTypeService.java
40525d4be1ba8615c0ef3096bbc58cd1716d2573
[ "Apache-2.0" ]
permissive
pjsqwerty/DimpleBlog
262f7ad6f5affd55a5832d1f5f2ee4e880bcf19d
2504ea39cb13d8dab513cee38bef2aac337d216b
refs/heads/master
2023-02-21T01:20:36.331699
2021-01-07T11:00:35
2021-01-07T11:00:35
269,525,943
0
0
Apache-2.0
2020-06-05T03:53:27
2020-06-05T03:53:26
null
UTF-8
Java
false
false
1,631
java
package com.dimple.project.system.service; import com.dimple.project.system.domain.DictType; import java.util.List; /** * @className: DictTypeService * @description: 字典 业务层 * @author: Dimple * @date: 10/22/19 */ public interface DictTypeService { /** * 根据条件分页查询字典类型 * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ List<DictType> selectDictTypeList(DictType dictType); /** * 根据所有字典类型 * * @return 字典类型集合信息 */ List<DictType> selectDictTypeAll(); /** * 根据字典类型ID查询信息 * * @param dictId 字典类型ID * @return 字典类型 */ DictType selectDictTypeById(Long dictId); /** * 根据字典类型查询信息 * * @param dictType 字典类型 * @return 字典类型 */ DictType selectDictTypeByType(String dictType); /** * 通过字典ID删除字典信息 * * @param dictId 字典ID * @return 结果 */ int deleteDictTypeById(Long dictId); /** * 新增保存字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ int insertDictType(DictType dictType); /** * 修改保存字典类型信息 * * @param dictType 字典类型信息 * @return 结果 */ int updateDictType(DictType dictType); /** * 校验字典类型称是否唯一 * * @param dictType 字典类型 * @return 结果 */ String checkDictTypeUnique(DictType dictType); }
[ "bianxiaofeng@sohu.com" ]
bianxiaofeng@sohu.com
15c2f0b5b91427edd8f083843ed005e9fb045f1c
ed29778a20ac25b4eda542fcfce449a764a9229c
/ProductRecommendation/src/main/java/com/prime/jax/package-info.java
82a68edf52f1afe2b8e9d6b2a99c51241a8f7299
[]
no_license
AgilePrimeFighting/2016Semester2Agile
e9b7d7feb84260088d21d85ea2987be3ddafe42b
f12df0183b368838c381a7aa5a83a76a9674f021
refs/heads/master
2020-04-10T21:25:15.717018
2016-10-06T07:29:09
2016-10-06T07:29:09
65,066,545
1
2
null
2016-10-05T05:22:47
2016-08-06T05:24:40
Java
UTF-8
Java
false
false
177
java
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.acumatica.com/generic/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.prime.jax;
[ "liu_taichen@hotmail.com" ]
liu_taichen@hotmail.com
9c7738649f0973f0d7e1570e3848c29d6c89c7c1
2023f5cf238e31d3d99b5e36715d80fe7af727b8
/src/main/java/org/pstcl/ea/dao/impl/HibernateTokenRepositoryImpl.java
2a9026b7014cf31da4d7d8cf36e1809179a1ab64
[]
no_license
pstcl/EA2_S_BOOT
868fd05e590130f0cd2e1f79ada2dfeabb36d45e
86f5b7280261e1a68802aa8cbe5b40b75bc29719
refs/heads/master
2021-06-17T03:11:07.333025
2019-08-25T05:36:09
2019-08-25T05:36:09
197,333,708
0
0
null
2021-04-26T19:20:46
2019-07-17T07:00:44
Java
UTF-8
Java
false
false
2,644
java
package org.pstcl.ea.dao.impl; import java.util.Date; import org.hibernate.Criteria; import org.hibernate.criterion.Restrictions; import org.pstcl.ea.entity.PersistentLogin; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.web.authentication.rememberme.PersistentRememberMeToken; import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; @Repository("tokenRepositoryDao") @Transactional(value="sldcTxnManager") public class HibernateTokenRepositoryImpl extends AbstractDaoSLDC<String, PersistentLogin> implements PersistentTokenRepository { static final Logger logger = LoggerFactory.getLogger(HibernateTokenRepositoryImpl.class); @Override public void createNewToken(PersistentRememberMeToken token) { logger.info("Creating Token for user : {}", token.getUsername()); PersistentLogin persistentLogin = new PersistentLogin(); persistentLogin.setUsername(token.getUsername()); persistentLogin.setSeries(token.getSeries()); persistentLogin.setToken(token.getTokenValue()); persistentLogin.setLast_used(token.getDate()); persist(persistentLogin); } @Override public PersistentRememberMeToken getTokenForSeries(String seriesId) { logger.info("Fetch Token if any for seriesId : {}", seriesId); try { Criteria crit = createEntityCriteria(); crit.add(Restrictions.eq("series", seriesId)); PersistentLogin persistentLogin = (PersistentLogin) crit.uniqueResult(); return new PersistentRememberMeToken(persistentLogin.getUsername(), persistentLogin.getSeries(), persistentLogin.getToken(), persistentLogin.getLast_used()); } catch (Exception e) { logger.info("Token not found..."); return null; } } @Override public void removeUserTokens(String username) { logger.info("Removing Token if any for user : {}", username); Criteria crit = createEntityCriteria(); crit.add(Restrictions.eq("username", username)); PersistentLogin persistentLogin = (PersistentLogin) crit.uniqueResult(); if (persistentLogin != null) { logger.info("rememberMe was selected"); delete(persistentLogin); } } @Override public void updateToken(String seriesId, String tokenValue, Date lastUsed) { logger.info("Updating Token for seriesId : {}", seriesId); PersistentLogin persistentLogin = getByKey(seriesId); persistentLogin.setToken(tokenValue); persistentLogin.setLast_used(lastUsed); update(persistentLogin); } }
[ "40257916+pstcl@users.noreply.github.com" ]
40257916+pstcl@users.noreply.github.com
2854a6336b74e636913cec9e19c21d59871af807
4c304a7a7aa8671d7d1b9353acf488fdd5008380
/src/main/java/com/alipay/api/response/AlipayInsAutoBenefitUseResponse.java
d10503032ca2a1319262811983da278b8d13a02d
[ "Apache-2.0" ]
permissive
zhaorongxi/alipay-sdk-java-all
c658983d390e432c3787c76a50f4a8d00591cd5c
6deda10cda38a25dcba3b61498fb9ea839903871
refs/heads/master
2021-02-15T19:39:11.858966
2020-02-16T10:44:38
2020-02-16T10:44:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.ins.auto.benefit.use response. * * @author auto create * @since 1.0, 2020-01-08 19:54:59 */ public class AlipayInsAutoBenefitUseResponse extends AlipayResponse { private static final long serialVersionUID = 4892315677129612284L; /** * 蚂蚁平台使用记录id */ @ApiField("use_flow_id") private String useFlowId; public void setUseFlowId(String useFlowId) { this.useFlowId = useFlowId; } public String getUseFlowId( ) { return this.useFlowId; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
174f81ceecd4a8838621f223b1384f622c1f7a3d
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/ebraminio_DroidPersianCalendar/PersianCalendar/src/main/java/com/cepmuvakkit/times/posAlgo/Horizontal.java
7b0b00582ecaeffb6e9274d90388cd764177144e
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,165
java
// isComment package com.cepmuvakkit.times.posAlgo; import android.graphics.Canvas; public class isClassOrIsInterface { // isComment public double isVariable; // isComment public double isVariable; public isConstructor() { } public isConstructor(double isParameter, double isParameter) { this.isFieldAccessExpr = isNameExpr; this.isFieldAccessExpr = isNameExpr; } public double isMethod() { return isNameExpr; } public void isMethod(double isParameter) { isNameExpr = isNameExpr; } public double isMethod() { return isNameExpr; } public void isMethod(double isParameter) { isNameExpr = isNameExpr; } public ScreenPosition isMethod(Canvas isParameter, int isParameter, boolean isParameter) { int isVariable = isNameExpr.isMethod() / isIntegerConstant; int isVariable = isNameExpr.isMethod() / isIntegerConstant; int isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr); ScreenPosition isVariable = new ScreenPosition(); double isVariable = ((isIntegerConstant - isNameExpr) / isIntegerConstant) * isNameExpr; double isVariable = isNameExpr.isMethod(isNameExpr - isNameExpr); isNameExpr.isFieldAccessExpr = (int) (isNameExpr.isMethod(isNameExpr) * isNameExpr) * (isNameExpr ? -isIntegerConstant : isIntegerConstant) + isNameExpr; isNameExpr.isFieldAccessExpr = (int) (isNameExpr.isMethod(isNameExpr) * (-isNameExpr)) + isNameExpr; return isNameExpr; } public ScreenPosition isMethod(int isParameter, int isParameter) { int isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr); ScreenPosition isVariable = new ScreenPosition(); double isVariable = ((isIntegerConstant - isNameExpr) / isIntegerConstant) * isNameExpr; double isVariable = isNameExpr.isMethod(isNameExpr); isNameExpr.isFieldAccessExpr = (int) (isNameExpr.isMethod(isNameExpr) * isNameExpr) + isNameExpr; isNameExpr.isFieldAccessExpr = (int) (isNameExpr.isMethod(isNameExpr) * (-isNameExpr)) + isNameExpr; return isNameExpr; } }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
b1a773ca9c81e531d6405d077ae275aadc19b0dc
12ac90c71a646511fe50ee0589caed73ab4dc544
/QuickAdapter/app/src/main/java/com/heaven7/core/adapter/demo/TestMainActivity.java
92412a2182b661f94c933596adb11610bc70428c
[ "Apache-2.0" ]
permissive
LightSun/android-common-util-light
828269bdd22258c9ca21a933ca5a3bef2eb9147e
6008027bc211f581930ae16a77383c5db3095f9e
refs/heads/master
2020-04-04T07:14:47.471760
2019-05-16T11:57:29
2019-05-16T11:57:29
52,590,493
14
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.heaven7.core.adapter.demo; import java.util.List; /** * Created by heaven7 on 2017/12/22. */ public class TestMainActivity extends AbsMainActivity { @Override protected void addDemos(List<ActivityInfo> list) { list.add(new ActivityInfo(TestQtActivity.class)); list.add(new ActivityInfo(AudioFxDemo.class)); } }
[ "978136772@qq.com" ]
978136772@qq.com
e1e1d2e1293ed38ea74a1ade3488d8bd8e3eb3bf
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/com/whatsapp/instrumentation/service/InstrumentationFGService.java
6fccc22d4761b6a6e637f155d01d80108ab3efa6
[]
no_license
technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666116
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
UTF-8
Java
false
false
1,957
java
package com.whatsapp.instrumentation.service; import X.AnonymousClass01X; import X.AnonymousClass03E; import X.AnonymousClass0BS; import X.AnonymousClass0E4; import X.AnonymousClass0GC; import android.app.PendingIntent; import android.content.Intent; import android.os.Build; import android.os.Handler; import android.os.IBinder; import com.google.android.search.verification.client.R; import com.whatsapp.HomeActivity; import com.whatsapp.util.Log; public class InstrumentationFGService extends AnonymousClass0GC { public Handler A00 = new Handler(); public Runnable A01 = new RunnableEBaseShape10S0100000_I1_5(this, 32); public IBinder onBind(Intent intent) { return null; } public InstrumentationFGService() { super("instrumentationfgservice", true); } @Override // X.AnonymousClass0GC public void onDestroy() { stopForeground(true); super.onDestroy(); } public int onStartCommand(Intent intent, int i, int i2) { StringBuilder sb = new StringBuilder("instrumentationfgservice/onStartCommand:"); sb.append(intent); sb.append(" startId:"); sb.append(i2); Log.i(sb.toString()); AnonymousClass03E A002 = AnonymousClass0BS.A00(this); A002.A0J = "other_notifications@1"; AnonymousClass01X r2 = ((AnonymousClass0E4) this).A01; A002.A0B(r2.A06(R.string.localized_app_name)); A002.A0A(r2.A06(R.string.localized_app_name)); A002.A09(r2.A06(R.string.notification_text_instrumentation_fg)); A002.A09 = PendingIntent.getActivity(this, 1, new Intent(this, HomeActivity.class), 0); int i3 = -2; if (Build.VERSION.SDK_INT >= 26) { i3 = -1; } A002.A03 = i3; A002.A07.icon = R.drawable.notifybar; A00(i2, 25, A002.A01()); this.A00.removeCallbacks(this.A01); this.A00.postDelayed(this.A01, 5000); return 2; } }
[ "madeinborneo@gmail.com" ]
madeinborneo@gmail.com
d6fcbfaf251100c5b0c6a5951ee7660615e9be38
eb2690583fc03c0d9096389e1c07ebfb80e7f8d5
/src/main/java/org/owasp/benchmark/testcode/BenchmarkTest00442.java
0527acdd4218f720036727dd7fe4cac08640a636
[]
no_license
leroy-habberstad/java-benchmark
126671f074f81bd7ab339654ed1b2d5d85be85dd
bce2a30bbed61a7f717a9251ca2cbb38b9e6a732
refs/heads/main
2023-03-15T03:02:42.714614
2021-03-23T00:03:36
2021-03-23T00:03:36
350,495,796
0
0
null
null
null
null
UTF-8
Java
false
false
3,237
java
/** * OWASP Benchmark Project v1.2 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The OWASP Benchmark 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, version 2. * * The OWASP Benchmark 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. * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet(value="/xpathi-00/BenchmarkTest00442") public class BenchmarkTest00442 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String param = request.getParameter("BenchmarkTest00442"); if (param == null) param = ""; String bar; // Simple ? condition that assigns param to bar on false condition int num = 106; bar = (7*42) - num > 200 ? "This should never happen" : param; try { java.io.FileInputStream file = new java.io.FileInputStream(org.owasp.benchmark.helpers.Utils.getFileFromClasspath("employees.xml", this.getClass().getClassLoader())); javax.xml.parsers.DocumentBuilderFactory builderFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); // Prevent XXE builderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); javax.xml.parsers.DocumentBuilder builder = builderFactory.newDocumentBuilder(); org.w3c.dom.Document xmlDocument = builder.parse(file); javax.xml.xpath.XPathFactory xpf = javax.xml.xpath.XPathFactory.newInstance(); javax.xml.xpath.XPath xp = xpf.newXPath(); response.getWriter().println( "Your query results are: <br/>" ); String expression = "/Employees/Employee[@emplid='"+bar+"']"; response.getWriter().println( xp.evaluate(expression, xmlDocument) + "<br/>" ); } catch (javax.xml.xpath.XPathExpressionException e) { // OK to swallow System.out.println("XPath expression exception caught and swallowed: " + e.getMessage()); } catch (javax.xml.parsers.ParserConfigurationException e) { System.out.println("XPath expression exception caught and swallowed: " + e.getMessage()); } catch (org.xml.sax.SAXException e) { System.out.println("XPath expression exception caught and swallowed: " + e.getMessage()); } } }
[ "jjohnson@gitlab.com" ]
jjohnson@gitlab.com
138c705323319a2e2b9d5da5449a1c93d2e2b115
882d3591752a93792bd8c734dd91b1e5439c5ffe
/android/QNLiveShow/liveshowApp/src/main/java/com/qpidnetwork/livemodule/liveshow/sayhi/view/SayHiListResponseFilterView.java
4b8c9271cd53408d650d91546dbf79b7f577e898
[]
no_license
KingsleyYau/LiveClient
f4d4d2ae23cbad565668b1c4d9cd849ea5ca2231
cdd2694ddb4f1933bef40c5da3cc7d1de8249ae2
refs/heads/master
2022-10-15T13:01:57.566157
2022-09-22T07:37:05
2022-09-22T07:37:05
93,734,517
27
14
null
null
null
null
UTF-8
Java
false
false
6,265
java
package com.qpidnetwork.livemodule.liveshow.sayhi.view; import android.content.Context; import android.graphics.drawable.ColorDrawable; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.PopupWindow; import com.qpidnetwork.livemodule.R; import com.qpidnetwork.livemodule.httprequest.RequestJniSayHi; import com.qpidnetwork.livemodule.liveshow.datacache.preference.LocalPreferenceManager; import com.qpidnetwork.livemodule.view.ButtonRaised; /** * Created by Hardy on 2019/5/31. * SayHi response 列表底部的浮层 View */ public class SayHiListResponseFilterView extends FrameLayout implements View.OnClickListener { private String UNREAD_STRING; private String LATEST_STRING; private ButtonRaised mBtn; private LocalPreferenceManager localPreferenceManager; private PopupWindow mPopWindow; private View mPopUnread; private View mPopNewest; private int mPopX; private int mPopY; public SayHiListResponseFilterView(@NonNull Context context) { this(context, null); } public SayHiListResponseFilterView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public SayHiListResponseFilterView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context); } private void init(Context context) { UNREAD_STRING = context.getString(R.string.Unread_First); LATEST_STRING = context.getString(R.string.Newest_First); // pop view View mPopView = LayoutInflater.from(context).inflate(R.layout.layout_say_hi_response_filter_pop, this, false); mPopUnread = mPopView.findViewById(R.id.layout_say_hi_response_filter_pop_ll_unread); mPopNewest = mPopView.findViewById(R.id.layout_say_hi_response_filter_pop_ll_newest); mPopUnread.setOnClickListener(this); mPopNewest.setOnClickListener(this); int w = context.getResources().getDimensionPixelSize(R.dimen.sayHi_list_response_filter_width); mPopWindow = new PopupWindow(mPopView, w, ViewGroup.LayoutParams.WRAP_CONTENT, true); // 设置PopupWindow是否能响应外部点击事件 mPopWindow.setOutsideTouchable(true); mPopWindow.setTouchable(true); mPopWindow.setBackgroundDrawable(new ColorDrawable()); // mPopWindow.setAnimationStyle(R.style.CustomTheme_SimpleDialog_Anim); // 偏移量 mPopX = context.getResources().getDimensionPixelSize(R.dimen.live_size_20dp); // 距离右边的边距 mPopY = mPopX + context.getResources().getDimensionPixelSize(R.dimen.btn_height_46dp); // 距离底部的边距,要加上浮层按钮的高度 } @Override protected void onFinishInflate() { super.onFinishInflate(); mBtn = findViewById(R.id.layout_say_hi_response_filter_btn); mBtn.setOnClickListener(this); // 初始化上次记录的数据 RequestJniSayHi.SayHiListOperateType type = getResponseFilterType(); setBtnText(type); } @Override public void onClick(View v) { int id = v.getId(); if (id == R.id.layout_say_hi_response_filter_btn) { // 设置 pop 的过滤方式选中样式 setPopSelectUI(); mPopWindow.showAtLocation(mBtn, Gravity.BOTTOM | Gravity.END, mPopX, mPopY); } else if (id == R.id.layout_say_hi_response_filter_pop_ll_unread || id == R.id.layout_say_hi_response_filter_pop_ll_newest) { mPopWindow.dismiss(); RequestJniSayHi.SayHiListOperateType type = RequestJniSayHi.SayHiListOperateType.UnRead; if (id == R.id.layout_say_hi_response_filter_pop_ll_newest) { type = RequestJniSayHi.SayHiListOperateType.Latest; } // 保存记录在本地 saveResponseFilterType(type); // 设置按钮文本 setBtnText(type); if (mOnResponseListFilterListener != null) { mOnResponseListFilterListener.onFilterChange(type); } } } private void setBtnText(RequestJniSayHi.SayHiListOperateType type) { if (type == RequestJniSayHi.SayHiListOperateType.UnRead) { mBtn.setButtonTitle(UNREAD_STRING); } else { mBtn.setButtonTitle(LATEST_STRING); } } private void setPopSelectUI() { RequestJniSayHi.SayHiListOperateType type = getResponseFilterType(); if (type == RequestJniSayHi.SayHiListOperateType.UnRead) { mPopUnread.setSelected(true); mPopNewest.setSelected(false); } else { mPopUnread.setSelected(false); mPopNewest.setSelected(true); } } public RequestJniSayHi.SayHiListOperateType getResponseFilterType() { return getLocalPreferenceManager().getSayHiResponseListFilterType(); } private void saveResponseFilterType(RequestJniSayHi.SayHiListOperateType type) { getLocalPreferenceManager().saveSayHiResponseListFilterType(type); } private LocalPreferenceManager getLocalPreferenceManager() { if (localPreferenceManager == null) { localPreferenceManager = new LocalPreferenceManager(getContext()); } return localPreferenceManager; } //======================== interface ==================================== private OnResponseListFilterListener mOnResponseListFilterListener; public void setOnResponseListFilterListener(OnResponseListFilterListener mOnResponseListFilterListener) { this.mOnResponseListFilterListener = mOnResponseListFilterListener; } public interface OnResponseListFilterListener { void onFilterChange(RequestJniSayHi.SayHiListOperateType type); } }
[ "Kingsleyyau@gmail.com" ]
Kingsleyyau@gmail.com
6ea30a286b18814555729f35400cf4ad443d880f
0565885aa67e16033b5e6526397d10b03787e1ac
/fulfillment-pe-master/fulfillment-pe-biz/src/main/java/com/mallcai/fulfillment/pe/biz/service/task/StandardOrderAggregationTask.java
80f93dc9c6828d44c47be6644527004e9904dc42
[]
no_license
youngzil/fulfillment-center
e05b364f160a6e84f84ee3ef1a3bdc3cfafcdad2
9b86b810b1e40cfe77e82ff972f99b645f598b57
refs/heads/master
2020-09-22T10:56:25.810905
2019-12-01T13:19:13
2019-12-01T13:19:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,008
java
package com.mallcai.fulfillment.pe.biz.service.task; import com.mallcai.fulfillment.pe.biz.service.bo.DataBo; import com.mallcai.fulfillment.pe.biz.service.inner.ProduceOrderService; import com.mallcai.fulfillment.pe.biz.service.inner.configuration.ConfigurationConditionProcessor; import com.mallcai.fulfillment.pe.biz.service.inner.configuration.ConfigurationProcessor; import com.mallcai.fulfillment.pe.common.constants.Constants; import com.mallcai.fulfillment.pe.common.utils.DateUtil; import com.mallcai.fulfillment.pe.common.utils.MdcTraceIdUtil; import com.mallcai.fulfillment.pe.common.utils.RedisDistributeLockUtil; import com.mallcai.fulfillment.pe.infrastructure.OrderQueryDto; import com.mallcai.fulfillment.pe.infrastructure.enums.GroupValueEnum; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.IJobHandler; import com.xxl.job.core.handler.annotation.JobHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import java.util.Date; import java.util.UUID; /** * @description: 订单聚合task * @author: chentao * @create: 2019-08-26 21:25:53 */ @JobHandler(value = "standardOrderAggregationTask") @Slf4j @Component public class StandardOrderAggregationTask extends IJobHandler { @Autowired private ProduceOrderService produceOrderService; @Autowired private RedisDistributeLockUtil redisDistributeLockUtil; private final Long LOCK_EXPIRE_TIME = 30 * 60L; @Autowired private ConfigurationProcessor configurationPorcessor; @Autowired private Environment environment; private final String TASK_NAME = "standardOrderAggregationTask"; @Autowired private ConfigurationConditionProcessor configurationConditionProcessor; @Override public ReturnT<String> execute(String cron) throws Exception { MdcTraceIdUtil.addTraceId(); log.info("开始执行标品集单任务,当前执行环境:{}, cron:{}", environment.getActiveProfiles()[0], cron); if (!environment.getActiveProfiles()[0].contains("product")){ log.error("非生产环境触发定时任务"); } String requestId = UUID.randomUUID().toString(); String lockKey = Constants.REDIS_LOCK_PREFIX + Constants.REDIS_LOCK_KEY_STANDARD_ORDER_AGGREGATE; boolean lockResult = false; try { lockResult = redisDistributeLockUtil.tryGetDistributedLock(lockKey, requestId, LOCK_EXPIRE_TIME); if (lockResult == false) { log.info("获取锁失败,lockKey:{},requestId:{}", lockKey, requestId); return FAIL; } Date todayStart = DateUtil.todayStart(); // log.info("执行聚单任务开始,日期:{}, orderHoldMins:{}", DateUtil.formatDate(todayStart), orderHoldMins); // DataBo dataBo = configurationConditionProcessor.getQueryAndFilterCondition(TASK_NAME + cron); OrderQueryDto orderQueryDto = new OrderQueryDto(); // 额外增加查询条件 orderQueryDto.setStartTime(todayStart); orderQueryDto.setEndTime(DateUtil.addDays(todayStart, 1)); orderQueryDto.setGroupValue(GroupValueEnum.ORDER_TYPE_STANDARD.getGroupValue()); Integer orderHoldMins = configurationPorcessor.getOrderHoldMins(orderQueryDto); orderQueryDto.setOrderHoldMins(orderHoldMins); produceOrderService.createProduceOrder(new DataBo(orderQueryDto, null)); log.info("执行聚单任务结束,日期:{}", DateUtil.formatDate(todayStart)); } catch (Exception e) { log.error("执行聚单任务异常", e); throw e; } finally { if (lockResult == true) { redisDistributeLockUtil.releaseDistributedLock(lockKey, requestId); } } return SUCCESS; } }
[ "58103987+dailuobo-code@users.noreply.github.com" ]
58103987+dailuobo-code@users.noreply.github.com
f6c8511e68d631648b8911a556ab025d6631b2a7
31ed4c8c9f9564176978d22c0fcda821c0491cc9
/scouter.agent/src/scouter/agent/counter/task/CountingVisitor.java
330b37dce27dceb7f268443873167052606b2fbd
[ "Apache-2.0" ]
permissive
ahnyj/scouter
21c9142ad0b86b84340344b1639dcb1cc5ddda5f
112b08abb9e6112d924840b6117bcd27b3558a63
refs/heads/master
2021-01-15T08:48:11.860685
2015-06-07T14:52:20
2015-06-07T14:52:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,567
java
/* * Copyright 2015 LG CNS. * * 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 scouter.agent.counter.task; import scouter.agent.counter.CounterBasket; import scouter.agent.counter.anotation.Counter; import scouter.agent.counter.meter.VisitMeter; import scouter.lang.TimeTypeEnum; import scouter.lang.counters.CounterConstants; import scouter.lang.pack.PerfCounterPack; import scouter.lang.value.DecimalValue; public class CountingVisitor { @Counter public void visitor(CounterBasket pw) { PerfCounterPack p = pw.getPack(TimeTypeEnum.REALTIME); int visit5m =VisitMeter.getVisitors(); int visit0=VisitMeter.getNewVisitors(); p.put(CounterConstants.WAS_VISIT_5M, new DecimalValue(visit5m)); p.put(CounterConstants.WAS_VISIT0, new DecimalValue(visit0)); p = pw.getPack(TimeTypeEnum.FIVE_MIN); p.put(CounterConstants.WAS_VISIT_5M, new DecimalValue(visit5m)); p.put(CounterConstants.WAS_VISIT0, new DecimalValue(visit0)); //System.out.println(" visit5m="+visit5m + " visit0="+visit0 ); } }
[ "scouter.project@gmail.com" ]
scouter.project@gmail.com
94cf7476c8816d51b7798aea8b6aa9e8ea4afd98
85d41602dec0c268509f339c1bbc1983e2feecb3
/src/main/java/org/lastaflute/web/exception/ExecuteMethodAccessFailureException.java
19b0615b2f4bcec89ca078ad7bd5d39f555792f2
[ "Apache-2.0" ]
permissive
yu1ro/lastaflute
e638505ffe00e01e9dc403816b9e231e76133925
ff7385dd432ac8056ade92c554989fecbc35a4e1
refs/heads/master
2021-01-18T11:21:29.221370
2016-09-25T03:01:59
2016-09-25T03:01:59
56,915,588
0
0
null
2016-04-23T11:20:07
2016-04-23T11:20:07
null
UTF-8
Java
false
false
1,074
java
/* * Copyright 2015-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.lastaflute.web.exception; import org.lastaflute.core.exception.LaSystemException; /** * @author jflute */ public class ExecuteMethodAccessFailureException extends LaSystemException { private static final long serialVersionUID = 1L; public ExecuteMethodAccessFailureException(String msg) { super(msg); } public ExecuteMethodAccessFailureException(String msg, Throwable cause) { super(msg, cause); } }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
4735a2ca68b53e93c7b6e618aa3dc347e2dff9f5
652a5812e57850147aa7e2d20179227e18eb39d1
/src/com/skyisland/questmaker/spell/SingleValueWindow.java
d8c0d3df5ac5f20bdfbb65b34e83b43a144f7daf
[]
no_license
Dove-Bren/QuestMaker
73403a024133e5221007f1a73445b2749eeae240
37336f3a658a7a8b918c9ee0e52f858729c24523
refs/heads/master
2020-04-02T07:57:01.938016
2016-07-09T03:27:08
2016-07-09T03:27:08
61,507,140
0
1
null
null
null
null
UTF-8
Java
false
false
2,465
java
package com.skyisland.questmaker.spell; import java.awt.Component; import java.awt.Dimension; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import javax.swing.JFormattedTextField; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SpringLayout; import com.skyisland.questmaker.swingutils.Theme; import com.skyisland.questmaker.swingutils.Theme.Themed; public abstract class SingleValueWindow<T> implements SpellEffectWindow, Themed { private JPanel gui; private JFormattedTextField damageField; private boolean dirty; public SingleValueWindow(String guiText, String labelText, T defaultValue) { dirty = false; this.gui = new JPanel(); gui.setPreferredSize(new Dimension(400, 200)); setupGui(guiText, labelText, defaultValue); } /** * Called to set up gui with the single field. */ protected void setupGui(String guiLabel, String labelText, T defaultValue) { gui.setBackground(Theme.BACKGROUND_EDITWINDOW.get()); SpringLayout lay = new SpringLayout(); gui.setLayout(lay); JLabel label = new JLabel(guiLabel); label.setForeground(Theme.TEXT_FORWARD.get()); gui.add(label); lay.putConstraint(SpringLayout.NORTH, label, 10, SpringLayout.NORTH, gui); lay.putConstraint(SpringLayout.HORIZONTAL_CENTER, label, 0, SpringLayout.HORIZONTAL_CENTER, gui); label = new JLabel(labelText); label.setForeground(Theme.TEXT_EDITWINDOW.register(this)); gui.add(label); lay.putConstraint(SpringLayout.NORTH, label, 40, SpringLayout.NORTH, gui); lay.putConstraint(SpringLayout.WEST, label, 10, SpringLayout.WEST, gui); damageField = new JFormattedTextField(defaultValue); damageField.setColumns(5); damageField.setEditable(true); damageField.addPropertyChangeListener("value", new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { dirty(); } }); gui.add(damageField); lay.putConstraint(SpringLayout.WEST, damageField, 0, SpringLayout.WEST, label); lay.putConstraint(SpringLayout.NORTH, damageField, 3, SpringLayout.SOUTH, label); gui.validate(); } @Override public Component getWindow() { return gui; } @SuppressWarnings("unchecked") protected T getValue() { return ((T) damageField.getValue()); } @Override public void themeChange(Theme theme) { } protected void dirty() { dirty = true; } @Override public boolean isDirty() { return dirty; } }
[ "skymanzanares@hotmail.com" ]
skymanzanares@hotmail.com
e4a5474db8a6e2deee47a49b4fda38d1781c2e52
b61660473ae9678b2471b72ff0ee62adc3d0b9b5
/bus-example/bus-example-003/src/main/java/com/jufeng/cloud/bus/example003/AppBus003.java
7b8ede95538abd55485249b8a7aafc9a7a90c383
[]
no_license
zhaojun2066/spring-cloud-example
8afdde27fad2419a5942f1c4bd25626226c99406
c4182808d15c3fda2a9d8346eb0b2c9d5564d0b6
refs/heads/master
2022-06-30T01:03:15.973493
2019-10-09T08:32:00
2019-10-09T08:32:00
205,805,308
3
0
null
2022-06-17T02:28:05
2019-09-02T07:55:43
Java
UTF-8
Java
false
false
1,305
java
package com.jufeng.cloud.bus.example003; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationEventPublisher; /** * @program: spring-cloud-example * @description: * @author: JuFeng(ZhaoJun) * @create: 2019-09-27 14:12 **/ @SpringBootApplication public class AppBus003 implements CommandLineRunner { @Autowired private ApplicationEventPublisher eventPublisher; /** * 应用上下文(通过实现 ApplicationContextAware 实现自动装载) */ @Autowired private ApplicationContext applicationContext; public static void main(String[] args) { SpringApplication.run(AppBus003.class,args); } @Override public void run(String... args) throws Exception { //获取应用id String serviceInstanceId = applicationContext.getId(); //新建 自定义事件 对象 MyRemoteApplicationEvent event = new MyRemoteApplicationEvent(this, serviceInstanceId, ""); //发布事件 eventPublisher.publishEvent(event); } }
[ "zhaojun@300.cn" ]
zhaojun@300.cn
ef4c367f83482b2cf7ac999230e275fa7fcf7c52
108af247cb11dd11b1fb212eff408ac94423aac4
/concurrent_study/src/com/leo/study/no11/ConcurrentStack.java
736fac867ad1d2d2e861bdb7d0f28a8160605714
[]
no_license
leogoing/concurrent_study
b96bf104664ef3e5e207e2f759c9326fc22c745e
20e73e418d253a6b372fa06082bfc7bf8f795716
refs/heads/master
2021-01-10T08:40:12.183693
2016-02-16T12:45:53
2016-02-16T12:45:53
51,350,062
0
0
null
null
null
null
UTF-8
Java
false
false
795
java
package com.leo.study.no11; import java.util.concurrent.atomic.AtomicReference; /** * 使用Treiber算法构造非阻塞栈 * @author leo * */ public class ConcurrentStack<E> { AtomicReference<Node<E>> top=new AtomicReference<Node<E>>(); public void push(E item){ Node<E> newHead=new Node<E>(item); Node<E> oldHead; do{ oldHead=top.get(); newHead.next=oldHead; }while(!top.compareAndSet(oldHead, newHead)); } public E pop(){ Node<E> newHead; Node<E> oldHead; do{ oldHead=top.get(); if(oldHead==null) return null; newHead=oldHead.next; }while(!top.compareAndSet(oldHead, newHead)); return oldHead.item; } private static class Node<E>{ public final E item; public Node<E> next; public Node(E item) { this.item=item; } } }
[ "81391276@qq.com" ]
81391276@qq.com
8d1924d2e66e66fd9efaec49aa39cc53619f71ba
2b471869420a4c685dfd52403d7fb3d564257f6a
/src/main/java/quizretakes/Quizzes.java
ae17093d9571e6c607b7f9c65316a7e4829403cf
[]
no_license
ldruitt/SWE-437
6a78a4b4454390c0a94a669d6c6066e158be52fc
766eb848ee9634ac004535d06620ba5f8f2ba81b
refs/heads/master
2020-04-25T20:11:03.345814
2019-02-28T04:06:36
2019-02-28T04:06:36
173,045,498
0
0
null
2019-02-28T05:15:57
2019-02-28T05:15:56
null
UTF-8
Java
false
false
772
java
package quizretakes; import quizretakes.bean.QuizBean; import java.util.*; import java.util.stream.Stream; /** * This class holds a collection of quizzes * * @author Jeff Offutt */ public class Quizzes implements Iterable<QuizBean> { private final List<QuizBean> quizzes = new ArrayList<>(); public Quizzes(){} public void sort() { Collections.sort(quizzes); } public Stream<QuizBean> stream() { return quizzes.stream(); } public Optional<QuizBean> get(int id) { return stream().filter(q -> q.getID() == id).findAny(); } @Override public Iterator<QuizBean> iterator() { return quizzes.iterator(); } public void addQuiz(QuizBean qb) { quizzes.add(qb); } public String toString() { return (Arrays.toString(quizzes.toArray())); } }
[ "mcoley2@gmu.edu" ]
mcoley2@gmu.edu
36235c90e1721ed2c743ce367b7c9c3fccacb0c9
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/lib/payments/creditcard/textwatcher/CardCvvTextWatcher.java
28c6e57495b49a86a529bbc5b120b831ad36b5a6
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
1,460
java
package com.airbnb.android.lib.payments.creditcard.textwatcher; import android.text.Editable; import com.airbnb.android.core.enums.CardType; import com.airbnb.android.lib.payments.creditcard.validation.CreditCardValidator; import com.airbnb.android.utils.SimpleTextWatcher; public class CardCvvTextWatcher extends SimpleTextWatcher { private CardType cardType; private final CreditCardValidator cardValidator; private final CardCvvTextListener listener; public interface CardCvvTextListener { void hideCardCvvError(); void onFullCardCvvEntered(); void showCardCvvError(); } public CardCvvTextWatcher(CardCvvTextListener listener2, CreditCardValidator cardValidator2) { this.listener = listener2; this.cardValidator = cardValidator2; } public void updateCardType(CardType cardType2) { this.cardType = cardType2; } public void afterTextChanged(Editable s) { validateCvv(s.toString()); } private void validateCvv(String securityCode) { if (this.cardType == null) { return; } if (this.cardValidator.isCardCvvFullLength(securityCode, this.cardType)) { this.listener.onFullCardCvvEntered(); } else if (this.cardValidator.isCardCvvTooLong(securityCode, this.cardType)) { this.listener.showCardCvvError(); } else { this.listener.hideCardCvvError(); } } }
[ "thanhhuu2apc@gmail.com" ]
thanhhuu2apc@gmail.com
1eab58c1cbf62fce98c6e4d7829ce5caca3c5b92
d866fc2c63a74fae396f2b8137bd2a6236343071
/tags/release-2.1.2-beforetrunkmove-SNAPSHOT/facebook-java-api/src/main/java/com/google/code/facebookapi/Attachment.java
6f8d1d3e2b5cf21f1cee4a9a2d941c7e0fad0559
[ "BSD-2-Clause" ]
permissive
BGCX067/facebook-java-api-svn-to-git
8c2f2f34e1b161758606c6e5f230bd0c34207102
7f776213ad2c5b67fc841c1a3bb33858067b45e5
refs/heads/master
2016-09-01T08:53:48.452845
2015-12-28T14:29:01
2015-12-28T14:29:01
48,834,403
0
0
null
null
null
null
UTF-8
Java
false
false
4,476
java
package com.google.code.facebookapi; import java.io.Serializable; import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.json.JSONException; import org.json.JSONObject; /** * A simple data structure for storing stream attachments used in the stream_publish API call. * * @see {@link http://wiki.developers.facebook.com/index.php/Attachment_(Streams)} */ @SuppressWarnings("serial") public class Attachment implements Serializable { private String name; private String href; private String caption; private String description; private List<AttachmentProperty> properties; private AttachmentMedia media; private Map<String,String> additionalInfo; private JSONObject jsonAttachment; /** * Constructor. */ public Attachment() { // empty } /** * @return a JSON representation of attachment. */ public JSONObject toJson() { jsonAttachment = new JSONObject(); putJsonObject( "name", name ); putJsonObject( "href", href ); putJsonObject( "caption", caption ); putJsonObject( "description", description ); putJsonProperties(); putJsonMedia(); putJsonAdditionalInfo(); return jsonAttachment; } private void putJsonObject( final String key, final Object value ) { if ( jsonAttachment == null ) { // this should only be called by toJson() after the object is initialized return; } try { jsonAttachment.put( key, value ); } catch ( Exception ignored ) { // ignore } } private void putJsonProperties() { if ( properties == null || properties.isEmpty() ) { return; } JSONObject jsonProperties = new JSONObject(); for ( AttachmentProperty link : properties ) { try { if ( !StringUtils.isEmpty( link.getCaption() ) ) { if ( !StringUtils.isEmpty( link.getText() ) && !StringUtils.isEmpty( link.getHref() ) ) { jsonProperties.put( link.getCaption(), link.toJson() ); } else if ( !StringUtils.isEmpty( link.getText() ) ) { jsonProperties.put( link.getCaption(), link.getText() ); } } } catch ( JSONException exception ) { throw ExtensibleClient.runtimeException( exception ); } } putJsonObject( "properties", jsonProperties ); } private void putJsonMedia() { if ( media == null ) { return; } putJsonObject( "media", media.toJson() ); } private void putJsonAdditionalInfo() { if ( additionalInfo == null || additionalInfo.isEmpty() ) { return; } for ( String key : additionalInfo.keySet() ) { putJsonObject( key, additionalInfo.get( key ) ); } } /** * @return a JSON-encoded String representation of this template. The resulting String is appropriate for passing to the Facebook API server. */ public String toJsonString() { return this.toJson().toString(); } /** * @return the name */ public String getName() { return name; } /** * @param name * the name to set */ public void setName( String name ) { this.name = name; } /** * @return the href */ public String getHref() { return href; } /** * @param href * the href to set */ public void setHref( String href ) { this.href = href; } /** * @return the caption */ public String getCaption() { return caption; } /** * @param caption * the caption to set */ public void setCaption( String caption ) { this.caption = caption; } /** * @return the description */ public String getDescription() { return description; } /** * @param description * the description to set */ public void setDescription( String description ) { this.description = description; } /** * @return the properties */ public List<AttachmentProperty> getProperties() { return properties; } /** * @param properties * the properties to set */ public void setProperties( List<AttachmentProperty> properties ) { this.properties = properties; } /** * @return the additionalInfo */ public Map<String,String> getAdditionalInfo() { return additionalInfo; } /** * @param additionalInfo * the additionalInfo to set */ public void setAdditionalInfo( Map<String,String> additionalInfo ) { this.additionalInfo = additionalInfo; } /** * @return the media */ public AttachmentMedia getMedia() { return media; } /** * @param media * the media to set */ public void setMedia( AttachmentMedia media ) { this.media = media; } }
[ "you@example.com" ]
you@example.com
2c8c6d3b053b25490dcc9b30d53618199d3220e8
c84088fed6a7b4f392810bb166e66dbfe3df4286
/hco2011/src/main/java/com/yongjun/tdms/dao/base/jobs/hibernate/HibernateJobs.java
c58104cd241fbe57def5a2ff84eb9af5f59e62b1
[]
no_license
1Will/Work1
4c419b9013d2989c4bbe6721c155de609e5ce9b5
16e707588da13e9dede5f7de97ca53e15a7d5a78
refs/heads/master
2020-05-22T16:52:56.501596
2018-03-20T01:21:01
2018-03-20T01:21:01
84,697,600
0
0
null
null
null
null
UTF-8
Java
false
false
1,919
java
/* */ package com.yongjun.tdms.dao.base.jobs.hibernate; /* */ /* */ import com.yongjun.pluto.dao.hibernate.BaseHibernateDao; /* */ import com.yongjun.pluto.exception.DaoException; /* */ import com.yongjun.tdms.dao.base.jobs.JobsDao; /* */ import com.yongjun.tdms.model.base.jobs.Jobs; /* */ import java.util.Collection; /* */ import java.util.List; /* */ /* */ public class HibernateJobs extends BaseHibernateDao /* */ implements JobsDao /* */ { /* */ public void storeJobs(Jobs job) /* */ { /* 43 */ super.store(job); /* */ } /* */ /* */ public void deleteJobs(Jobs job) /* */ { /* 52 */ super.delete(job); /* */ } /* */ /* */ public void deleteAllJobs(Collection<Jobs> jobs) /* */ { /* 61 */ super.deleteAll(jobs); /* */ } /* */ /* */ public List<Jobs> loadAllJobs(Long[] jobsIds) /* */ { /* 71 */ return super.loadAll(Jobs.class, jobsIds); /* */ } /* */ /* */ public Jobs loadJobs(Long jobsId) /* */ { /* 81 */ return (Jobs)super.load(Jobs.class, jobsId); /* */ } /* */ /* */ public List<Jobs> loadAllJobs() /* */ { /* 90 */ return super.loadAll(Jobs.class); /* */ } /* */ /* */ public List<Jobs> loadByKey(String keyName, Object keyValue) /* */ throws DaoException /* */ { /* 101 */ return super.loadByKey(Jobs.class, keyName, keyValue); /* */ } /* */ /* */ public List<Jobs> loadByKeyArray(String[] keyNames, Object[] keyValues) /* */ throws DaoException /* */ { /* 112 */ return super.loadByKeyArray(Jobs.class, keyNames, keyValues); /* */ } /* */ } /* Location: E:\crm2010\110\crm2009\WEB-INF\classes\ * Qualified Name: com.yongjun.tdms.dao.base.jobs.hibernate.HibernateJobs * JD-Core Version: 0.6.2 */
[ "287463504@qq.com" ]
287463504@qq.com
25d90dad9eb64f0b9b533ac2f76de8b8321f597e
949bfdb25752857abe8e919915d305b1bc936d44
/contrib/haox-asn1/src/main/java/org/apache/haox/asn1/type/Asn1Any.java
29aeb1a459d7729a1cc82e51a3677795debd7f16
[ "Apache-2.0" ]
permissive
deepika087/haox
91293c8917629f860b7af4981b937d76131cf6a4
a8d6b62142e169d23d0c308ce2728e614d3258c1
refs/heads/master
2021-07-20T21:13:13.873458
2017-10-28T23:34:30
2017-10-28T23:34:30
108,691,180
0
0
null
2017-10-28T23:21:36
2017-10-28T23:21:36
null
UTF-8
Java
false
false
735
java
package org.apache.haox.asn1.type; import org.apache.haox.asn1.LimitedByteBuffer; import java.io.IOException; import java.nio.ByteBuffer; public class Asn1Any extends AbstractAsn1Type<Asn1Type> { public Asn1Any(Asn1Type anyValue) { super(anyValue.tagFlags(), anyValue.tagNo(), anyValue); } @Override protected int encodingBodyLength() { return ((AbstractAsn1Type) getValue()).encodingBodyLength(); } @Override protected void encodeBody(ByteBuffer buffer) { ((AbstractAsn1Type) getValue()).encodeBody(buffer); } @Override protected void decodeBody(LimitedByteBuffer content) throws IOException { ((AbstractAsn1Type) getValue()).decodeBody(content); } }
[ "drankye@gmail.com" ]
drankye@gmail.com
e3ea8349289f1b0cff038c24d03cbd5f953eaa1c
b46fb9b9983a52eaa8e28fd12ca812d911e54515
/desktop/src/main/java/dragon3/anime/AnimePanel.java
e7f07e88d8bdedec3e222cdabfa71172731ef629
[]
no_license
piropiro/dragon3
1c7e41a7c859e629faae076a7a3dd4010103a640
bc338c1b03b1cbf3ba90aeb00b47e0c22418733c
refs/heads/master
2020-11-27T22:10:54.205231
2016-08-25T03:05:43
2016-08-25T03:05:43
66,204,218
0
0
null
null
null
null
UTF-8
Java
false
false
8,467
java
package dragon3.anime; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import dragon3.Statics; import dragon3.anime.listener.AllAnime; import dragon3.anime.listener.AnimeListener; import dragon3.anime.listener.ArrowAnime; import dragon3.anime.listener.CloseAnime; import dragon3.anime.listener.CriticalAnime; import dragon3.anime.listener.DropTextAnime; import dragon3.anime.listener.EraseAnime; import dragon3.anime.listener.NumberAnime; import dragon3.anime.listener.PictureAnime; import dragon3.anime.listener.RotateAnime; import dragon3.anime.listener.SingleAnime; import dragon3.anime.listener.SlideTextAnime; import dragon3.anime.listener.SomeArrowAnime; import dragon3.anime.listener.StatusAnime; import dragon3.anime.listener.SummonAnime; import dragon3.anime.listener.WalkAnime; import dragon3.common.DataList; import dragon3.common.constant.AnimeType; import dragon3.data.AnimeData; import dragon3.image.ImageManager; import dragon3.map.MapWorks; import dragon3.map.StageMap; import mine.event.PaintComponent; import mine.event.PaintListener; import mine.event.SleepManager; import mine.paint.MineGraphics; import mine.paint.MineImage; @Singleton public class AnimePanel implements AnimeManager, AnimeWorks, PaintListener { private PaintComponent panel; @Inject SleepManager sm; @Inject MapWorks mw; @Inject StageMap map; @Inject ImageManager imageManager; private DataList<AnimeData> animeList; private AnimeListener np; private AnimeListener al; @Inject public AnimePanel(@Named("animeC") PaintComponent panel, Statics statics) { this.panel = panel; this.animeList = statics.getAnimeList(); np = null; al = null; panel.setPaintListener(this); } @Override public AnimeData getData(String id) { return animeList.getData(id); } /** * Dispose */ @Override public void dispose() { np = null; al = null; setVisible(false); } /** * タイトル表示アニメーション */ @Override public void openTitle() { panel.setBounds(0, 0, 640, 480); al = new PictureAnime(imageManager.getImage("title.png")); al.animation(this); setVisible(true); } /** * タイトル消去アニメーション1 */ @Override public void closeTitleOut() { al = new CloseAnime(CloseAnime.OUT, imageManager.getImage("title.png")); al.animation(this); } /** * タイトル消去アニメーション2 */ @Override public void closeTitleIn() { al = new CloseAnime(CloseAnime.IN, imageManager.getImage("title.png")); al.animation(this); setVisible(false); al = null; } /** * キャラ消去アニメーション * * @param x * @param y */ @Override public void eraseAnime(int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); setVisible(true); al = new EraseAnime(mw, map.getMap(), x, y); al.animation(this); al = null; } /** * 移動アニメーション * * @param x * @param y */ @Override public void walkAnime(int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); np = null; al = new WalkAnime(mw, map.getMap(), x, y); setVisible(true); al.animation(this); setVisible(false); sm.sleep(15); al = null; } /** * ダメージアニメーション * * @param n * @param x * @param y */ @Override public void numberAnime(int n, int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); setVisible(true); np = new NumberAnime(n, imageManager.getNum()); np.animation(this); np = null; } /** * 即死アニメーション * * @param x * @param y */ @Override public void criticalAnime(int x, int y) { np = null; al = new CriticalAnime(mw, map.getMap(), x, y); panel.setBounds(x * 32 - 32, y * 32, 96, 32); setVisible(true); al.animation(this); al = null; } /** * 落下テキストアニメーション * * @param text * @param x * @param y */ public void dropText(int text, int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); setVisible(true); al = new DropTextAnime(text, imageManager.getText()); al.animation(this); al = null; } /** * スライドテキストアニメーション * * @param text * @param x * @param y */ @Override public void slideText(int text, int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); setVisible(true); al = new SlideTextAnime(text, imageManager.getText()); al.animation(this); al = null; } /** * ステータスアニメーション * * @param status * @param x * @param y */ @Override public void statusAnime(int status, int x, int y) { panel.setBounds(x * 32, y * 32 - 16, 32, 48); setVisible(true); al = new StatusAnime(mw, map.getMap(), status, x, y, imageManager.getStatus()); al.animation(this); al = null; setVisible(false); } /** * 召喚アニメーション * * @param image * @param x * @param y */ @Override public void summonAnime(int image, int x, int y) { panel.setBounds(x * 32, y * 32 - 32, 32, 56); setVisible(true); al = new SummonAnime(mw, map.getMap(), image, x, y); al.animation(this); al = null; setVisible(false); } /** * 単体アニメーション * * @param data * @param x * @param y */ @Override public void singleAnime(AnimeData data, int x, int y) { panel.setBounds(x * 32, y * 32, 32, 32); setVisible(true); MineImage[] image = imageManager.getAnimeImageList().getImage(data.getImage()); al = new SingleAnime(image, data.getSleep()); al.animation(this); al = null; } /** * 全体アニメーション * * @param data */ public void allAnime(AnimeData data) { setVisible(true); MineImage[] image = imageManager.getAnimeImageList().getImage(data.getImage()); al = new AllAnime(map.getMap(), image, data.getSleep()); al.animation(this); al = null; } /** * 単体矢アニメーション * * @param data * @param startX * @param startY * @param goalX * @param goalY */ @Override public void singleArrowAnime(AnimeData data, int startX, int startY, int goalX, int goalY) { np = null; panel.setBounds(startX * 32, startY * 32, 32, 32); setVisible(true); MineImage[] image = imageManager.getAnimeImageList().getImage(data.getImage()); al = new ArrowAnime(image, data.getSleep(), startX * 32, startY * 32, goalX * 32, goalY * 32); al.animation(this); al = null; } /** * 複数矢アニメーション * * @param data * @param x * @param y */ @Override public void someArrowAnime(AnimeData data, int x, int y) { np = null; setVisible(true); MineImage[] image = imageManager.getAnimeImageList().getImage(data.getImage()); al = new SomeArrowAnime(map.getMap(), image, data.getSleep(), x*32, y*32); al.animation(this); al = null; } /** * 回転アニメーション * * @param data * @param startX * @param startY * @param goalX * @param goalY */ @Override public void rotateAnime(AnimeData data, int startX, int startY, int goalX, int goalY) { np = null; setVisible(true); MineImage[] image = imageManager.getAnimeImageList().getImage(data.getImage()); al = new RotateAnime(image, data.getSleep(), startX * 32, startY * 32, goalX * 32, goalY * 32); al.animation(this); al = null; } /** * システムアニメーション * * @param id * @param x * @param y */ @Override public void systemAnime(String id, int x, int y) { AnimeData animeData = animeList.getData(id); if (animeData.getType() == AnimeType.SINGLE) { singleAnime(animeData, x, y); return; } } /*** Paint *************************************************/ @Override public void paint(MineGraphics g) { if (np != null) np.paint(g); if (al != null) al.paint(g); } @Override public void sleep(long t) { sm.sleep(t); } @Override public void repaint() { panel.repaint(); } @Override public void setLocation(int x, int y) { panel.setLocation(x, y); } @Override public void setSize(int w, int h) { panel.setSize(w, h); } @Override public void setVisible(boolean flag) { panel.setVisible(flag); } }
[ "mela825@gmail.com" ]
mela825@gmail.com
7e597a2c3f3cff26997409d4f2f156e8ad7957bc
377e5e05fb9c6c8ed90ad9980565c00605f2542b
/.gitignore/bin/ext-addon/b2bacceleratoraddon/src/de/hybris/platform/b2bacceleratoraddon/event/ReplenishmentOrderConfirmationEventListener.java
528b16f4dc21e27fd1f9ebe5266220f7cd2a00a0
[]
no_license
automaticinfotech/HybrisProject
c22b13db7863e1e80ccc29774f43e5c32e41e519
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
refs/heads/master
2021-07-20T18:41:04.727081
2017-10-30T13:24:11
2017-10-30T13:24:11
108,957,448
0
0
null
null
null
null
UTF-8
Java
false
false
2,162
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.b2bacceleratoraddon.event; import de.hybris.platform.b2bacceleratorservices.event.ReplenishmentOrderConfirmationEvent; import de.hybris.platform.core.model.order.OrderModel; import de.hybris.platform.orderprocessing.model.OrderProcessModel; import de.hybris.platform.processengine.BusinessProcessService; import de.hybris.platform.servicelayer.event.impl.AbstractEventListener; import de.hybris.platform.servicelayer.model.ModelService; import org.springframework.beans.factory.annotation.Required; public class ReplenishmentOrderConfirmationEventListener extends AbstractEventListener<ReplenishmentOrderConfirmationEvent> { private ModelService modelService; private BusinessProcessService businessProcessService; protected BusinessProcessService getBusinessProcessService() { return businessProcessService; } @Required public void setBusinessProcessService(final BusinessProcessService businessProcessService) { this.businessProcessService = businessProcessService; } protected ModelService getModelService() { return modelService; } @Required public void setModelService(final ModelService modelService) { this.modelService = modelService; } @Override protected void onEvent(final ReplenishmentOrderConfirmationEvent event) { final OrderModel orderModel = event.getOrder(); final OrderProcessModel orderProcessModel = (OrderProcessModel) getBusinessProcessService().createProcess( "replenishmentOrderConfirmationEmailProcess" + "-" + orderModel.getCode() + "-" + System.currentTimeMillis(), "replenishmentOrderConfirmationEmailProcess"); orderProcessModel.setOrder(orderModel); getModelService().save(orderProcessModel); getBusinessProcessService().startProcess(orderProcessModel); } }
[ "santosh.kshirsagar@automaticinfotech.com" ]
santosh.kshirsagar@automaticinfotech.com
d41e43beb4b1680df71e706a2fa95f9bab1915fe
efcf518788b979839a5e8ac054c52ee39c01a37f
/app/src/main/java/com/scanpj/work/universal/http/RequestPacking.java
a1383eb1bf990e66e2b355ff044fc6b09ddae2ac
[]
no_license
AliesYangpai/ScanPJ
3e10232ed54e027a0e07687580d418876d1bbdcb
c1d21303c9402c09af40f8f03694e39526ffe72f
refs/heads/master
2020-03-29T22:46:26.336649
2018-09-26T14:29:34
2018-09-26T14:29:34
150,439,747
0
0
null
null
null
null
UTF-8
Java
false
false
5,689
java
package com.scanpj.work.universal.http; import android.util.Base64; import android.util.Log; import com.scanpj.work.constant.ConstSp; import com.scanpj.work.constant.HttpConst; import com.scanpj.work.universal.cache.sp.SpUtil; import com.yanzhenjie.nohttp.Binary; import com.yanzhenjie.nohttp.FileBinary; import com.yanzhenjie.nohttp.NoHttp; import com.yanzhenjie.nohttp.RequestMethod; import com.yanzhenjie.nohttp.rest.Request; import org.feezu.liuli.timeselector.Utils.TextUtil; import java.util.List; /** * Created by Administrator on 2017/4/27. * 类描述 封装的请求方法 * 版本 */ public class RequestPacking { /** * GET * POST * DELETE * PUT */ private Request<String> request; private static volatile RequestPacking mInstance; public static RequestPacking getInstance() { if(null == mInstance) { synchronized (RequestPacking.class) { if(null == mInstance) { mInstance = new RequestPacking(); } } } return mInstance; } /** * 1.获取token,这个方法是适用于登陆时候获取token * * @param url * @param requestMethod * @param userName * @param pass * @return */ public Request<String> getTokenInBascAuthorization(String url, RequestMethod requestMethod, String userName, String pass) { request = NoHttp.createStringRequest(url, requestMethod); request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); String string = new String(Base64.encode((userName + ":" + pass).getBytes(), Base64.DEFAULT)); String author = HttpConst.BASIC + string.trim(); request.addHeader(HttpConst.AUTHORIZATION, author); return request; } /** * 用于测试 * @param url * @param requestMethod * @param param * @return */ public Request<String> getRequestParamForJsonNoToken(String url, RequestMethod requestMethod, String param) { request = NoHttp.createStringRequest(url, requestMethod); request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); if (param != null) { request.setDefineRequestBodyForJson(param); } Log.i(HttpConst.LOG_REQUEST, "URL:" + url + " 请求方法:" + requestMethod + " 请求参数:" + param); return request; } /** * 一般请求数据 * * @param url * @param requestMethod * @param param * @return */ public Request<String> getRequestParamForJson(String url, RequestMethod requestMethod, String param) { request = NoHttp.createStringRequest(url, requestMethod); request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); request.addHeader(HttpConst.AUTHORIZATION, HttpConst.BEARER + SpUtil.getInstance().getStringValue(ConstSp.SP_KEY_TOKEN, "")); if (param != null) { request.setDefineRequestBodyForJson(param); } Log.i(HttpConst.LOG_REQUEST, "URL:" + url + " 请求方法:" + requestMethod + " 请求参数:" + param); return request; } /** * set传递token的请求 * * @param url * @param requestMethod * @param param * @return */ public Request<String> getRequestParamSetTokenForJson(String url, RequestMethod requestMethod, String token, String param) { request = NoHttp.createStringRequest(url, requestMethod); request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); if(!TextUtil.isEmpty(token)) { request.addHeader(HttpConst.AUTHORIZATION, HttpConst.BEARER + token); } if (param != null) { request.setDefineRequestBodyForJson(param); } Log.i(HttpConst.LOG_REQUEST, "URL:" + url + " 请求方法:" + requestMethod + " 请求参数:" + param); return request; } /** * 单张图片上传接口 * * @param url * @param requestMethod * @return */ public Request<String> getRequestParamForUpLoad(String url, FileBinary fileBinary, RequestMethod requestMethod) { request = NoHttp.createStringRequest(url, requestMethod); // request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); request.addHeader(HttpConst.AUTHORIZATION, HttpConst.BEARER + SpUtil.getInstance().getStringValue(ConstSp.SP_KEY_TOKEN, "")); request.add(HttpConst.UPLOAD_DATA_KEY, fileBinary); request.add(HttpConst.UPLOAD_DATA_KEY_FILE_NAME, HttpConst.UPLOAD_DATA_VALUE_NAME); Log.i(HttpConst.LOG_REQUEST, "URL:" + url + " 请求方法:" + requestMethod ); return request; } /** * 多文件上传接口 * * @param url * @param requestMethod * @return */ public Request<String> getRequestParamForUpLoadMulti(String url, List<Binary> binaries, RequestMethod requestMethod) { request = NoHttp.createStringRequest(url, requestMethod); // request.addHeader(HttpConst.CONTENT_TYPE, HttpConst.CONTENT_TYPE_APPLICATION); request.addHeader(HttpConst.AUTHORIZATION, HttpConst.BEARER + SpUtil.getInstance().getStringValue(ConstSp.SP_KEY_TOKEN, "")); request.add(HttpConst.UPLOAD_DATA_KEY, binaries); request.add(HttpConst.UPLOAD_DATA_KEY_FILE_NAME, HttpConst.UPLOAD_DATA_VALUE_NAME); Log.i(HttpConst.LOG_REQUEST, "URL:" + url + " 请求方法:" + requestMethod ); return request; } }
[ "yangpai_beibei@163.com" ]
yangpai_beibei@163.com
0eca94e803703f752c18d502ae3d97c34a7ed6e5
76852b1b29410436817bafa34c6dedaedd0786cd
/sources-2020-11-04-tempmail/sources/com/google/android/gms/internal/ads/v00.java
1cb38c42089702e0fa091bc54b51cc4b13cbba1f
[]
no_license
zteeed/tempmail-apks
040e64e07beadd8f5e48cd7bea8b47233e99611c
19f8da1993c2f783b8847234afb52d94b9d1aa4c
refs/heads/master
2023-01-09T06:43:40.830942
2020-11-04T18:55:05
2020-11-04T18:55:05
310,075,224
0
0
null
null
null
null
UTF-8
Java
false
false
1,227
java
package com.google.android.gms.internal.ads; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; /* compiled from: com.google.android.gms:play-services-ads@@19.2.0 */ final class v00<V> implements Runnable { /* renamed from: b reason: collision with root package name */ private final Future<V> f5273b; /* renamed from: c reason: collision with root package name */ private final zzduu<? super V> f5274c; v00(Future<V> future, zzduu<? super V> zzduu) { this.f5273b = future; this.f5274c = zzduu; } public final void run() { Throwable a2; Future<V> future = this.f5273b; if (!(future instanceof zzdwa) || (a2 = zzdvz.a((zzdwa) future)) == null) { try { this.f5274c.onSuccess(zzdux.e(this.f5273b)); } catch (ExecutionException e2) { this.f5274c.a(e2.getCause()); } catch (Error | RuntimeException e3) { this.f5274c.a(e3); } } else { this.f5274c.a(a2); } } public final String toString() { zzdsc a2 = zzdsa.a(this); a2.a(this.f5274c); return a2.toString(); } }
[ "zteeed@minet.net" ]
zteeed@minet.net
7e8a5ee9b235a35751442677287dcff747252928
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/da5ca66e358d60344a8d8008938459710cefc265/before/ROStatusChange.java
2f7659bf61724df1c2cfc951df1c59f430e044e4
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,641
java
package com.intellij.history.core.changes; import com.intellij.history.core.storage.Stream; import com.intellij.history.core.tree.Entry; import com.intellij.history.core.IdPath; import java.io.IOException; public class ROStatusChange extends StructuralChange<ROStatusChangeNonAppliedState, ROStatusChangeAppliedState> { public ROStatusChange(String path, boolean isReadOnly) { super(path); getNonAppliedState().myNewStatus = isReadOnly; } public ROStatusChange(Stream s) throws IOException { super(s); getAppliedState().myOldStatus = s.readBoolean(); } @Override public void write(Stream s) throws IOException { super.write(s); s.writeBoolean(getAppliedState().myOldStatus); } @Override protected ROStatusChangeAppliedState createAppliedState() { return new ROStatusChangeAppliedState(); } @Override protected ROStatusChangeNonAppliedState createNonAppliedState() { return new ROStatusChangeNonAppliedState(); } public boolean getOldStatus() { return getAppliedState().myOldStatus; } @Override protected IdPath doApplyTo(Entry r, ROStatusChangeAppliedState newState) { Entry e = r.getEntry(getPath()); newState.myOldStatus = e.isReadOnly(); e.setReadOnly(getNonAppliedState().myNewStatus); return e.getIdPath(); } @Override public void revertOn(Entry r) { getEntry(r).setReadOnly(getAppliedState().myOldStatus); } private Entry getEntry(Entry r) { return r.getEntry(getAffectedIdPath()); } @Override public void accept(ChangeVisitor v) throws IOException, ChangeVisitor.StopVisitingException { v.visit(this); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
38a51195e52f061a165cc65d4c9f5295b671c7df
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/2.6-stable1/code/base/dso-statistics/src/com/tc/statistics/StatisticsGathererSubSystem.java
486cbcbf749b39cef9bb2a8f2c8b25392cfe818e
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
5,178
java
/* * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved. */ package com.tc.statistics; import com.tc.config.schema.NewStatisticsConfig; import com.tc.logging.CustomerLogging; import com.tc.logging.TCLogger; import com.tc.statistics.database.exceptions.StatisticsDatabaseStructureMismatchError; import com.tc.statistics.gatherer.StatisticsGatherer; import com.tc.statistics.gatherer.impl.StatisticsGathererImpl; import com.tc.statistics.store.StatisticsStore; import com.tc.statistics.store.exceptions.StatisticsStoreException; import com.tc.statistics.store.h2.H2StatisticsStoreImpl; import java.io.File; public class StatisticsGathererSubSystem { private final static TCLogger DSO_LOGGER = CustomerLogging.getDSOGenericLogger(); private final static TCLogger CONSOLE_LOGGER = CustomerLogging.getConsoleLogger(); private volatile StatisticsStore statisticsStore; private volatile StatisticsGatherer statisticsGatherer; private volatile boolean active = false; public boolean isActive() { return active; } public synchronized boolean setup(final NewStatisticsConfig config) { // create the statistics store File stat_path = config.statisticsPath().getFile(); try { stat_path.mkdirs(); } catch (Exception e) { // TODO: needs to be properly written and put in a properties file String msg = "\n**************************************************************************************\n" + "Unable to create the directory '" + stat_path.getAbsolutePath() + "' for the statistics store.\n" + "The CVT gathering system will not be active on this node.\n" + "**************************************************************************************\n"; CONSOLE_LOGGER.error(msg); DSO_LOGGER.error(msg, e); return false; } try { statisticsStore = new H2StatisticsStoreImpl(stat_path); statisticsStore.open(); } catch (StatisticsDatabaseStructureMismatchError e) { // TODO: needs to be properly written and put in a properties file String msg = "\n**************************************************************************************\n" + "The statistics store couldn't be opened at \n" + "'" + stat_path.getAbsolutePath() + "'.\n" + "The CVT system will not be active for this node because the statistics store database\n" + "structure version doesn't correspond to the one expected by the system.\n" + "\n" + "A simple solution is to delete the directory in which the statistics are stored so\n" + "that a new version of the database can be installed.\n" + "**************************************************************************************\n"; CONSOLE_LOGGER.error(msg); DSO_LOGGER.error(msg, e); return false; } catch (StatisticsStoreException e) { // TODO: needs to be properly written and put in a properties file String msg = "\n**************************************************************************************\n" + "The statistics store couldn't be opened at \n" + "'" + stat_path.getAbsolutePath() + "'.\n" + "The CVT gathering system will not be active for this node.\n" + "\n" + "A common reason for this is that you're launching several Terracotta L1\n" + "clients on the same machine. The default directory for the statistics store\n" + "uses the IP address of the machine that it runs on as the identifier.\n" + "When several clients are being executed on the same machine, a typical solution\n" + "to properly separate these directories is by using a JVM property at startup\n" + "that is unique for each client.\n" + "\n" + "For example:\n" + " dso-java.sh -Dtc.node-name=node1 your.main.Class\n" + "\n" + "You can then adapt the tc-config.xml file so that this JVM property is picked\n" + "up when the statistics directory is configured by using %(tc.node-name) in the\n" + "statistics path.\n" + "**************************************************************************************\n"; CONSOLE_LOGGER.error(msg); DSO_LOGGER.error(msg, e); return false; } String info_msg = "Statistics store: '" + stat_path.getAbsolutePath() + "'."; CONSOLE_LOGGER.info(info_msg); DSO_LOGGER.info(info_msg); statisticsGatherer = new StatisticsGathererImpl(statisticsStore); active = true; return true; } public synchronized void reinitialize() throws Exception { statisticsGatherer.reinitialize(); statisticsStore.reinitialize(); } public synchronized void cleanup() throws Exception { if (statisticsGatherer != null) { statisticsGatherer.disconnect(); } if (statisticsStore != null) { statisticsStore.close(); } } public StatisticsStore getStatisticsStore() { return statisticsStore; } public StatisticsGatherer getStatisticsGatherer() { return statisticsGatherer; } }
[ "jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864
c9a78558c1928fc5f8f447c388c1d283e9987053
1b25373e7fdd7871cdeea182c454f117c76fbdd8
/src/test/java/com/github/davidmoten/rx2/internal/flowable/DelimitedStringLinkedListTest.java
e3517c3f75ada2d92338ca3b52d6f37ca8fab64b
[ "Apache-2.0" ]
permissive
janbols/rxjava2-extras
d6f3f88947f46a40afbd77531e91428195a51508
b3b44589bcecb8b535170cf87f3ac3cf4dd7265d
refs/heads/master
2021-01-11T10:08:06.285756
2017-01-13T13:06:45
2017-01-13T13:06:45
78,618,048
0
0
null
2017-01-11T08:22:22
2017-01-11T08:22:22
null
UTF-8
Java
false
false
5,568
java
package com.github.davidmoten.rx2.internal.flowable; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Test; public class DelimitedStringLinkedListTest { @Test public void testEmpty() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); assertNull(s.next()); } @Test public void testNotEmptyNotFound() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo"); assertNull(s.next()); assertEquals("boo",s.remaining()); } @Test public void testFindsFirst() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:and"); assertEquals("boo",s.next()); assertEquals(4, s.searchPosition()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsFirstLongDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList("::"); s.add("boo::and"); assertEquals("boo",s.next()); assertEquals(5, s.searchPosition()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsTwo() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:and:sue"); assertEquals("boo",s.next()); assertEquals("and",s.next()); assertNull(s.next()); assertEquals("sue", s.remaining()); } @Test public void testFindsTwoLongDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList("::"); s.add("boo::and::sue"); assertEquals("boo",s.next()); assertEquals("and",s.next()); assertNull(s.next()); assertEquals("sue", s.remaining()); } @Test public void testFindsThree() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:and:sue:me"); assertEquals("boo",s.next()); assertEquals("and",s.next()); assertEquals("sue",s.next()); assertNull(s.next()); assertEquals("me", s.remaining()); } @Test public void testFindsOneAcrossTwoDelimiterStartsSecond() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo"); s.add(":and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossTwoDelimiterEndsFirst() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:"); s.add("and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossTwoDelimiterEndsFirstLongDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList("::"); s.add("boo::"); s.add("and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossTwoDelimiterSplitAcrossTwo() { DelimitedStringLinkedList s = new DelimitedStringLinkedList("::"); s.add("boo:"); assertNull(s.next()); assertEquals("boo:", s.remaining()); } @Test public void testFindsOneEndsWithDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:"); assertEquals("boo",s.next()); assertNull(s.next()); assertNull(s.remaining()); } @Test public void testFindsOneAcrossTwoEndsWithDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo"); s.add(":"); assertEquals("boo",s.next()); assertNull(s.next()); assertNull(s.remaining()); } @Test public void testFindsNoneBecauseOnlyPartialMatchToDelimiter() { DelimitedStringLinkedList s = new DelimitedStringLinkedList("::"); s.add("boo:"); s.add("and"); assertNull(s.next()); } @Test public void testFindsOneAcrossTwoDelimiterMiddleFirst() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("boo:a"); s.add("nd"); assertEquals("boo",s.next()); assertEquals(4, s.searchPosition()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossTwoDelimiterMiddleSecond() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("bo"); s.add("o:and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossThree() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("bo"); s.add("o"); s.add(":and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } @Test public void testFindsOneAcrossFour() { DelimitedStringLinkedList s = new DelimitedStringLinkedList(":"); s.add("bo"); s.add("o"); s.add(":"); s.add("and"); assertEquals("boo",s.next()); assertNull(s.next()); assertEquals("and", s.remaining()); } }
[ "davidmoten@gmail.com" ]
davidmoten@gmail.com
08c2890be467e4cd0b57da36ec47ca2faec81b05
f731eea3d31426aa680953d9d9777a0eba84b153
/common-lib/src/main/java/asia/cmg/f8/common/spec/order/ImportUserResult.java
9daae18084adec9f520a27c92b153b2a00b75599
[ "Apache-2.0" ]
permissive
longpham041292/java-sample
893a53b182d8d91a4aac4b05126438efeec16cca
0b3ef36688eabbcf690de1b3daff57586dc010b7
refs/heads/main
2023-08-04T20:23:33.935587
2021-10-03T06:37:02
2021-10-03T06:37:02
412,994,810
0
0
null
null
null
null
UTF-8
Java
false
false
1,339
java
package asia.cmg.f8.common.spec.order; import javax.annotation.Nullable; import com.fasterxml.jackson.annotation.JsonProperty; public class ImportUserResult { @JsonProperty("error_code") private int errorCode; @JsonProperty("user_code") @Nullable private String userCode; @JsonProperty("level") @Nullable private String level; @JsonProperty("name") @Nullable private String name; @JsonProperty("mobile") @Nullable private String mobile; @JsonProperty("club") @Nullable private String club; public int getErrorCode() { return errorCode; } public void setErrorCode(final int errorCode) { this.errorCode = errorCode; } public String getUserCode() { return userCode; } public void setUserCode(final String userCode) { this.userCode = userCode; } public String getLevel() { return level; } public void setLevel(final String level) { this.level = level; } public String getName() { return name; } public void setName(final String name) { this.name = name; } public String getMobile() { return mobile; } public void setMobile(final String mobile) { this.mobile = mobile; } public String getClub() { return club; } public void setClub(final String club) { this.club = club; } }
[ "longpham@leep.app" ]
longpham@leep.app
9cc82fb2248de6779af79eefc2f7e963a832a8d9
06e34596185c90f3c1cce7cbca5cfb4f2594782c
/xgen4j/src/test-gen/java/com/rodrigodev/xgen4j/test/code/codeNumericIdAndNumberAreGeneratedWhenNameIsAlsoSpecifiedSpecified/code_name_2/E1Exception.java
05bdd28a1cbee174a0452d8477f4732cbf160d00
[ "MIT" ]
permissive
RodrigoQuesadaDev/XGen4J
3e45593c1de9f842b2e2de682bec6b59c34d5ab7
8d7791494521f54cbf8d89b5e12001e295cff3f4
refs/heads/master
2021-01-21T05:00:42.559899
2015-07-28T10:11:13
2015-07-28T10:11:13
39,287,751
0
0
null
null
null
null
UTF-8
Java
false
false
1,344
java
package com.rodrigodev.xgen4j.test.code.codeNumericIdAndNumberAreGeneratedWhenNameIsAlsoSpecifiedSpecified.code_name_2; import com.rodrigodev.xgen4j.test.code.codeNumericIdAndNumberAreGeneratedWhenNameIsAlsoSpecifiedSpecified.RootException; import com.rodrigodev.xgen4j.test.code.codeNumericIdAndNumberAreGeneratedWhenNameIsAlsoSpecifiedSpecified.RootException; import com.rodrigodev.xgen4j.test.code.codeNumericIdAndNumberAreGeneratedWhenNameIsAlsoSpecifiedSpecified.ErrorCode; /** * Autogenerated by XGen4J on January 1, 0001. */ public class E1Exception extends RootException { public static final ExceptionType TYPE = new ExceptionType(); protected E1Exception(ErrorCode errorCode, String message) { super(errorCode, message); } protected E1Exception(ErrorCode errorCode, String message, Throwable cause) { super(errorCode, message, cause); } private static class ExceptionType extends RootException.ExceptionType { @Override protected RootException createException(ErrorCode errorCode, String message) { return new E1Exception(errorCode, message); } @Override protected RootException createException(ErrorCode errorCode, String message, Throwable cause) { return new E1Exception(errorCode, message, cause); } } }
[ "rodrigoquesada@gmail.com" ]
rodrigoquesada@gmail.com
00ac4a87ec2a9eb00ff34d8fbaeabf1fd96c8839
8e6e6b28180a613eb868fe88a7da4be031ede782
/src/main/java/com/teammetallurgy/aquaculture/misc/StackHelper.java
f445514784353ff6e653ef04390ae01bb8e72751
[]
no_license
sscards55/Aquaculture
1ddddc7d62a7ed182f8ca22a79cc43508f14c014
5c1c86366151a5ead5eae4aa73e48d97c478dc57
refs/heads/master
2021-12-06T13:07:11.125824
2021-12-05T01:44:20
2021-12-05T01:44:20
219,638,832
0
0
null
2019-11-05T02:19:54
2019-11-05T02:19:53
null
UTF-8
Java
false
false
2,081
java
package com.teammetallurgy.aquaculture.misc; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.Containers; import net.minecraft.world.InteractionHand; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.items.IItemHandler; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class StackHelper { /* * Gives the specified ItemStack to the player */ public static void giveItem(Player player, @Nonnull ItemStack stack) { if (!player.getInventory().add(stack)) { player.drop(stack, false); } else if (player instanceof ServerPlayer) { player.inventoryMenu.sendAllDataToRemote(); } } public static void dropInventory(Level world, BlockPos pos, IItemHandler handler) { for (int slot = 0; slot < handler.getSlots(); ++slot) { Containers.dropItemStack(world, pos.getX(), pos.getY(), pos.getZ(), handler.getStackInSlot(slot)); } } public static InteractionHand getUsedHand(@Nonnull ItemStack stackMainHand, Class<? extends Item> clazz) { return clazz.isAssignableFrom(stackMainHand.getItem().getClass()) ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND; } public static Ingredient mergeIngredient(Ingredient i1, Ingredient i2) { List<ItemStack> stackList = new ArrayList<>(); stackList.addAll(Arrays.asList(i1.getItems())); stackList.addAll(Arrays.asList(i2.getItems())); return ingredientFromStackList(stackList); } public static Ingredient ingredientFromStackList(List<ItemStack> stackList) { return Ingredient.fromValues(stackList.stream().map(Ingredient.ItemValue::new)); } }
[ "faj10@msn.com" ]
faj10@msn.com
89bab24462e5e0e893180e6d486885299956da7c
12e4e1a5a742613d76d8c973333b9f6d1eb0a0d7
/Map/MappingTest.java
2b26a6080bbb9db66b41a3fcd7f12ad7edec1133
[ "MIT" ]
permissive
satisatanica/data-structures-1
9572a979c9aae05814e473f039c74909f3008ce1
b1aa22bd198144e144187048c2706d64f5894992
refs/heads/master
2021-01-19T22:24:29.998839
2017-04-18T13:51:55
2017-04-18T13:51:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,376
java
import static java.lang.Math.*; import static org.junit.Assert.*; import org.junit.*; import java.util.Random; import java.util.Set; import java.util.List; import java.util.HashSet; import java.util.HashMap; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; // You can set the hash value of this object to be whatever you want // This makes it great for testing special cases. class ConstHashObj { int hash, data; public ConstHashObj (int hash, int data) { this.hash = hash; this.data = data; } @Override public int hashCode() { return hash; } @Override public boolean equals(Object o) { return data == ((ConstHashObj)o).data; } } public class MappingTest { static Random r = new Random(); static final int LOOPS = 30000; static final int MAX_SIZE = 100; static final int MAX_RAND_NUM = 50; Mapping <Integer, Integer> map; @Before public void setup() { map = new Mapping<>(); } @Test(expected=IllegalArgumentException.class) public void testNullKey() { map.put(null, 5); } @Test(expected=IllegalArgumentException.class) public void testIllegalCreation1() { new Mapping<>(-3, 0.5); } @Test(expected=IllegalArgumentException.class) public void testIllegalCreation2() { new Mapping<>(5, Double.POSITIVE_INFINITY); } @Test(expected=IllegalArgumentException.class) public void testIllegalCreation3() { new Mapping<>(6, -0.5); } @Test public void testLegalCreation() { new Mapping<>(6, 0.9); } @Test public void testUpdatingValues() { map.add(1,1); assertTrue(map.get(1) == 1); map.add(1, 5); assertTrue(map.get(1) == 5); map.add(1, -7); assertTrue(map.get(1) == -7); } @Test public void testIterator() { HashMap <Integer, Integer> map2 = new HashMap<>(); for (int loop = 0; loop < LOOPS; loop++) { map.clear(); map2.clear(); assertTrue(map.isEmpty()); List <Integer> rand_nums = genRandList(MAX_SIZE); for (Integer key : rand_nums) assertEquals(map.add(key, key), map2.put(key, key)); int count = 0; for (Integer key : map) { assertEquals(key, map.get(key)); assertEquals(map.get(key), map2.get(key)); assertTrue(map.hasKey(key)); assertTrue(rand_nums.contains(key)); count++; } for (Integer key : map2.keySet()) { assertEquals(key, map.get(key)); } Set <Integer> set = new HashSet<>(rand_nums); assertEquals( set.size() , count); assertEquals( map2.size(), count ); } } @Test(expected=java.util.ConcurrentModificationException.class) public void testConcurrentModificationException() { map.add(1,1); map.add(2,1); map.add(3,1); for (Integer key : map) map.add(4,4); } @Test(expected=java.util.ConcurrentModificationException.class) public void testConcurrentModificationException2() { map.add(1,1); map.add(2,1); map.add(3,1); for (Integer key : map) map.remove(2); } @Test public void randomRemove() { Mapping <Integer, Integer> map = new Mapping<>(); for (int loop = 0; loop < LOOPS; loop++) { map.clear(); // Add some random values Set <Integer> keys_set = new HashSet<>(); for(int i = 0; i < MAX_SIZE; i++) { int randomVal = r.nextInt() % 400000; keys_set.add(randomVal); map.put(randomVal, 5); } assertEquals( map.size(), keys_set.size() ); List <Integer> keys = map.keys(); for (Integer key : keys) map.remove(key); assertTrue( map.isEmpty() ); } } @Test public void removeTest() { Mapping <Integer, Integer> map = new Mapping<>( 7 ); // Add three elements map.put(11, 0); map.put(12, 0); map.put(13, 0); assertEquals(3, map.size()); // Add ten more for(int i = 1; i <= 10; i++) map.put(i, 0); assertEquals(13, map.size()); // Remove ten for(int i = 1; i <= 10; i++) map.remove(i); assertEquals(3, map.size()); // remove three map.remove(11); map.remove(12); map.remove(13); assertEquals(0, map.size()); } @Test public void removeTestComplex1() { Mapping <ConstHashObj, Integer> map = new Mapping<>(); ConstHashObj o1 = new ConstHashObj(88, 1); ConstHashObj o2 = new ConstHashObj(88, 2); ConstHashObj o3 = new ConstHashObj(88, 3); ConstHashObj o4 = new ConstHashObj(88, 4); map.add(o1, 111); map.add(o2, 111); map.add(o3, 111); map.add(o4, 111); map.remove(o2); map.remove(o3); map.remove(o1); map.remove(o4); assertEquals(0, map.size()); } @Test public void testRandomMapOperations() { HashMap <Integer, Integer> map2 = new HashMap<>(); for (int loop = 0; loop < LOOPS; loop++) { List <Integer> nums = genRandList(MAX_SIZE); map.clear(); map2.clear(); assertTrue(map.size() == map2.size()); for (int i = 0; i < MAX_SIZE; i++ ) { double r = Math.random(); if ( r < 0.5 ) assertEquals( map.put( nums.get(i), i ), map2.put( nums.get(i), i )); assertEquals( map.containsKey(nums.get(i)), map2.containsKey(nums.get(i)) ); assertEquals( map.size(), map2.size() ); if ( r > 0.5 ) assertEquals( map.remove( nums.get(i) ), map2.remove( nums.get(i) ) ); assertEquals( map.containsKey(nums.get(i)), map2.containsKey(nums.get(i)) ); assertEquals( map.size(), map2.size() ); } } } @Test public void randomIteratorTests() { Mapping <Integer, LinkedList<Integer>> m = new Mapping<>(); HashMap <Integer, LinkedList<Integer>> hm = new HashMap<>(); for (int loop = 0; loop < LOOPS; loop++ ) { m.clear(); hm.clear(); int sz = (int)(Math.random() * MAX_SIZE); m = new Mapping<>(sz); hm = new HashMap<>(sz); for (int i = 0; i < MAX_SIZE; i++) { int index = (int)(Math.random() * MAX_SIZE); LinkedList <Integer> l1 = m.get(index); LinkedList <Integer> l2 = hm.get(index); if ( l2 == null ) { l1 = new LinkedList<Integer>(); l2 = new LinkedList<Integer>(); m.put(index, l1); hm.put(index, l2); } int rand_val = (int)(Math.random() * MAX_SIZE); if ( Math.random() < 0.5 ) { l1. removeFirstOccurrence(rand_val); l2. removeFirstOccurrence(rand_val); } else { l1.add(rand_val); l2.add(rand_val); } // Compare Lists for (Integer I : l1) assertTrue(l2.contains(I)); for (Integer I : l2) assertTrue(l1.contains(I)); assertEquals( m.size(), hm.size() ); assertEquals( l1.size(), l2.size() ); } } } // Generate a list of random numbers static List <Integer> genRandList(int sz) { List <Integer> lst = new ArrayList<>(sz); for (int i = 0; i < sz; i++) lst.add( (int) (Math.random()*MAX_RAND_NUM )); Collections.shuffle( lst ); return lst; } // Generate a list of unique random numbers static List <Integer> genUniqueRandList(int sz) { List <Integer> lst = new ArrayList<>(sz); for (int i = 0; i < sz; i++) lst.add( i ); Collections.shuffle( lst ); return lst; } }
[ "fisetwill@gmail.com" ]
fisetwill@gmail.com
bfde5926e4b3948b3617846c02371162738c855d
107d78903c1d036a99980ee1312035771ecb6839
/oneview-sdk-java-lib/src/main/java/com/hp/ov/sdk/dto/Oa.java
cb909bb481789df593b5abb9ce555546f4456efc
[ "Apache-2.0" ]
permissive
vandewilly/oneview-sdk-java
3f741c478fdbd2782f79d9eb3bc6dd41e8a35384
9d27b64d07f3022f97ef079e0e61a24e715008da
refs/heads/master
2021-01-21T19:13:44.513683
2016-04-29T18:43:59
2016-04-29T18:43:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,352
java
/******************************************************************************* * (C) Copyright 2015 Hewlett Packard Enterprise Development LP * * 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.hp.ov.sdk.dto; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class Oa implements Serializable { /** * */ private static final long serialVersionUID = 1L; private Integer bayNumber; private Boolean dhcpEnable; private Boolean dhcpIpv6Enable; private String fqdnHostName; private String fwBuildDate; private String fwVersion; private String ipAddress; private List<OaIpv6Address> ipv6Addresses = new ArrayList<OaIpv6Address>(); private OaRole role; private OaState state; /** * @return the bayNumber */ public Integer getBayNumber() { return bayNumber; } /** * @param bayNumber * the bayNumber to set */ public void setBayNumber(final Integer bayNumber) { this.bayNumber = bayNumber; } /** * @return the dhcpEnable */ public Boolean getDhcpEnable() { return dhcpEnable; } /** * @param dhcpEnable * the dhcpEnable to set */ public void setDhcpEnable(final Boolean dhcpEnable) { this.dhcpEnable = dhcpEnable; } /** * @return the dhcpIpv6Enable */ public Boolean getDhcpIpv6Enable() { return dhcpIpv6Enable; } /** * @param dhcpIpv6Enable * the dhcpIpv6Enable to set */ public void setDhcpIpv6Enable(final Boolean dhcpIpv6Enable) { this.dhcpIpv6Enable = dhcpIpv6Enable; } /** * @return the fqdnHostName */ public String getFqdnHostName() { return fqdnHostName; } /** * @param fqdnHostName * the fqdnHostName to set */ public void setFqdnHostName(final String fqdnHostName) { this.fqdnHostName = fqdnHostName; } /** * @return the fwBuildDate */ public String getFwBuildDate() { return fwBuildDate; } /** * @param fwBuildDate * the fwBuildDate to set */ public void setFwBuildDate(final String fwBuildDate) { this.fwBuildDate = fwBuildDate; } /** * @return the fwVersion */ public String getFwVersion() { return fwVersion; } /** * @param fwVersion * the fwVersion to set */ public void setFwVersion(final String fwVersion) { this.fwVersion = fwVersion; } /** * @return the ipAddress */ public String getIpAddress() { return ipAddress; } /** * @param ipAddress * the ipAddress to set */ public void setIpAddress(final String ipAddress) { this.ipAddress = ipAddress; } /** * @return the ipv6Addresses */ public List<OaIpv6Address> getIpv6Addresses() { return ipv6Addresses; } /** * @param ipv6Addresses * the ipv6Addresses to set */ public void setIpv6Addresses(final List<OaIpv6Address> ipv6Addresses) { this.ipv6Addresses = ipv6Addresses; } /** * @return the role */ public OaRole getRole() { return role; } /** * @param role * the role to set */ public void setRole(final OaRole role) { this.role = role; } /** * @return the state */ public OaState getState() { return state; } /** * @param state * the state to set */ public void setState(final OaState state) { this.state = state; } }
[ "prakash-r.mirji@hp.com" ]
prakash-r.mirji@hp.com
1a34c18d6b59c06ea16410e1a7f605ba15839649
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/31/31_a98e192c5c4ac64dda459e7427243719c210bbfa/DirectoryPanel/31_a98e192c5c4ac64dda459e7427243719c210bbfa_DirectoryPanel_t.java
e03b4f7f9797c4e3476ecd8868fb2dfc09516c03
[]
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,425
java
package cz.zcu.kiv.kc.shell; import java.awt.BorderLayout; import java.awt.Component; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.ComboBoxModel; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.ListModel; import javax.swing.Timer; import javax.swing.filechooser.FileSystemView; public class DirectoryPanel extends JPanel implements ActionListener, FocusListener { private static final long serialVersionUID = 840871288858771069L; private boolean refreshInProgress = false; private List<FocusListener> listeners = new ArrayList<FocusListener>(1); private FileListModel listModel = new FileListModel(); private JList<File> list = new JList<File>(listModel); private String currentFolder = new File("/").getAbsolutePath(); private JTextField field = new JTextField(currentFolder); private JComboBox<File> mountpoints = new JComboBox<File>(new MountpointsModel()); private static final int REFRESH_DELAY = 10000; // TODO public void changeDir() { listModel.setDirPath(this.currentFolder); list.setSelectedIndex(0); } public DirectoryPanel() { Timer timer = new Timer(REFRESH_DELAY, this); timer.start(); setLayout(new BorderLayout()); JPanel topPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints( 0, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(2, 1, 2, 1), 5, 5 ); JButton go = new JButton("GO"); go.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!new File(field.getText()).isDirectory()) { field.setText(DirectoryPanel.this.currentFolder); return; } String newPath = new File(field.getText()).getAbsolutePath(); ComboBoxModel<File> model = DirectoryPanel.this.mountpoints.getModel(); int i; for (i = 0; i < model.getSize(); i++) { String root = ((File)model.getElementAt(i)).getAbsolutePath().toLowerCase(); if (newPath.startsWith(root)) { break; } } if (i >= model.getSize()) { return; } DirectoryPanel.this.currentFolder = newPath; model.setSelectedItem(((File)model.getElementAt(i))); DirectoryPanel.this.changeDir(); } }); this.mountpoints.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String currentPath = DirectoryPanel.this.currentFolder.toLowerCase(); String newRoot = ((File)DirectoryPanel.this.mountpoints.getSelectedItem()).getAbsolutePath().toLowerCase(); if (!currentPath.startsWith(newRoot)) { DirectoryPanel.this.currentFolder = ((File)DirectoryPanel.this.mountpoints.getSelectedItem()).getAbsolutePath(); DirectoryPanel.this.field.setText(DirectoryPanel.this.currentFolder); DirectoryPanel.this.changeDir(); } } }); gbc.weightx = 1; topPanel.add(this.field, gbc); gbc.weightx = 0; gbc.gridx++; topPanel.add(go, gbc); gbc.gridx++; topPanel.add(this.mountpoints, gbc); /*JPanel menu = new JPanel(new BorderLayout()); menu.add(field, BorderLayout.CENTER); menu.add(go, BorderLayout.LINE_END); add(menu, BorderLayout.PAGE_START);*/ add(topPanel, BorderLayout.PAGE_START); add(new JScrollPane(list), BorderLayout.CENTER); list.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { @SuppressWarnings("unchecked") JList<File> list = (JList<File>) evt.getSource(); if (evt.getClickCount() == 2) { int index = list.locationToIndex(evt.getPoint()); File file = list.getModel().getElementAt(index); if (file.isDirectory()) { field.setText(file.getAbsolutePath()); listModel.setDirPath(field.getText()); list.setSelectedIndex(0); currentFolder = field.getText(); } } } }); list.setCellRenderer(new DefaultListCellRenderer() { private static final long serialVersionUID = -8566161868989812047L; @Override public Component getListCellRendererComponent( @SuppressWarnings("rawtypes") JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel jLabel = (JLabel) super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus ); if (value instanceof FirstFile) { jLabel.setText(".."); } else { jLabel.setIcon(FileSystemView.getFileSystemView().getSystemIcon((File) value)); jLabel.setText(value == null ? null : ((File) value).getName()); } return jLabel; } }); list.addFocusListener(this); } @Override public void actionPerformed(ActionEvent arg0) { refreshLists(); } public void refreshLists() { if (refreshInProgress) { // previous refresh is in process, skip this round } else { refreshInProgress = true; List<File> selectedValues = list.getSelectedValuesList(); listModel.refresh(); setSelectedValues(list, selectedValues); refreshInProgress = false; } } public void setSelectedValues(JList<File> list, List<File> values) { list.clearSelection(); for (File value : values) { int index = getIndex(list.getModel(), value); if (index >=0) { list.addSelectionInterval(index, index); } } } public int getIndex(ListModel<File> model, Object value) { if (value == null) return -1; if (model instanceof DefaultListModel) { return ((DefaultListModel<File>) model).indexOf(value); } for (int i = 0; i < model.getSize(); i++) { if (value.equals(model.getElementAt(i))) return i; } return -1; } public String getCurrentFolder() { return currentFolder; } public List<File> getSelectedFiles() { return list.getSelectedValuesList(); } @Override public void focusGained(FocusEvent arg0) { FocusEvent event = new FocusEvent(this, FocusEvent.FOCUS_GAINED); for (FocusListener listener : listeners) { listener.focusGained(event); } } @Override public void focusLost(FocusEvent arg0) { FocusEvent event = new FocusEvent(this, FocusEvent.FOCUS_LOST); for (FocusListener listener : listeners) { listener.focusLost(event); } } public void addFocusListener(FocusListener listener){ listeners.add(listener); } public void clearSelection() { list.clearSelection(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c4d650223969a9d5b5c7faaf6d3244bef2c1d497
ac6fe0f82231b44f64451ac3e78513d9392061d8
/common/service/facade/src/main/java/com/xianglin/act/common/service/facade/constant/PopTipTypeEnum.java
bab0bf867774b08f7db949d3afa6c4df21429b84
[]
no_license
heke183/act
015ef0d0dd57f53afefe41d88f810a9cb0e59b8e
2378cf1056b672a898a3c7c8fd1e540fd8ee0a42
refs/heads/master
2020-04-15T11:00:33.035873
2019-01-09T05:46:07
2019-01-09T05:46:07
164,609,667
0
1
null
null
null
null
UTF-8
Java
false
false
2,243
java
package com.xianglin.act.common.service.facade.constant; /** * @author Yungyu * @description Created by Yungyu on 2018/4/10 11:05. */ public enum PopTipTypeEnum implements EnumReadable { /** * 活动导流提示弹窗 */ POP_TIP_OF_NO_BUTTON("活动弹框", 0), /** * 活动结果提示弹窗——一个按钮 */ POP_TIP_OF_ONE_BUTTON("2连图", 1), /** * 活动结果提示弹窗——两个按钮 */ POP_TIP_OF_TWO_BUTTON("2按钮", 2), /** * 活动导流提示弹窗——tab */ POP_TIP_OF_TAB("打卡", 3) { public boolean shouldLog() { //不自动记录日志,回调接口后记录日志 return false; } }, /** * 活动结果提示弹窗——两秒跳转 */ POP_TIP_OF_UNFINISH_ACTIVITY("两秒跳转", 4), /** * 右悬浮框 */ FLOAT_WINDOW_OF_RIGHT("右悬浮框", 5){ public boolean shouldLog() { //不自动记录日志,回调接口后记录日志 return false; } }; private String desc; private int code; PopTipTypeEnum() { } PopTipTypeEnum(String desc, int code) { this.desc = desc; this.code = code; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } @Override public String getName() { return desc; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public static PopTipTypeEnum vauleOfCode(int code) { for (PopTipTypeEnum popTipTypeEnum : PopTipTypeEnum.values()) { if (popTipTypeEnum.getCode() == code) { return popTipTypeEnum; } } return null; } /** * 返回弹窗结果时,是否主动记录弹窗日志 * 如果返回为false,则需要客户端在用户关闭弹窗时回调关闭接口记录日志 * * @return * @see com.xianglin.act.biz.service.implement.ActServiceImpl#open(java.lang.Integer, java.lang.Long) */ public boolean shouldLog() { return true; } }
[ "wangleitom@126.com" ]
wangleitom@126.com
c998ecee73c94c6ef95a23c797b5e49e6825e7c0
b50354cade5028c83a29d73bbcb5703eafaf9eae
/dailyAPI/src/com/axp/domain/Adverpool.java
8968356870d192665c833ffee054e941b2509e9b
[]
no_license
jameszgw/open-pdd
73a8407cf6e0b80f6501fccff881f1706a398e9b
e51dad626170623495a966513a1e5b915336ff10
refs/heads/master
2023-07-20T18:09:12.187409
2019-02-20T08:44:10
2019-02-20T08:44:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
540
java
package com.axp.domain; import java.sql.Timestamp; /** * Adverpool entity. @author MyEclipse Persistence Tools */ public class Adverpool extends AbstractAdverpool implements java.io.Serializable { // Constructors /** default constructor */ public Adverpool() { } /** full constructor */ public Adverpool(Goods goods, AdminUser adminUser, Integer playtotal, Integer batch, Boolean higelevel, Boolean isvalid, Timestamp createtime) { super(goods, adminUser, playtotal, batch, higelevel, isvalid, createtime); } }
[ "crazyda@outlook.com" ]
crazyda@outlook.com
fd00fd17eb27f090d8494c72d79546116a8b34bd
b755a269f733bc56f511bac6feb20992a1626d70
/qiyun-ticket/ticket-service/src/main/java/com/qiyun/service/Impl/LotteryTypeServiceImpl.java
762ee4686957e4a344ead92b21d8c948e6529164
[]
no_license
yysStar/dubbo-zookeeper-SSM
55df313b58c78ab2eaa3d021e5bb201f3eee6235
e3f85dea824159fb4c29207cc5c9ccaecf381516
refs/heads/master
2022-12-21T22:50:33.405116
2020-05-09T09:20:41
2020-05-09T09:20:41
125,301,362
2
0
null
2022-12-16T10:51:09
2018-03-15T02:27:17
Java
UTF-8
Java
false
false
1,733
java
package com.qiyun.service.Impl; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.qiyun.DTO.LotteryBusinessDTO; import com.qiyun.mapper.LotteryTypeMapper; import com.qiyun.mapper2.LotteryType2Mapper; import com.qiyun.model2.LotteryType2; import com.qiyun.model.LotteryType; import com.qiyun.service.LotteryTypeService; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; @Service("lotteryTypeService") public class LotteryTypeServiceImpl implements LotteryTypeService { @Resource private LotteryTypeMapper lotteryTypeMapper; @Resource private LotteryType2Mapper lotteryType2Mapper; // public List<LotteryBusinessDTO> getLotteryBusinessList(int offset, int pageSize) { // List<LotteryBusinessDTO> list = lotteryTypeMapper.getLotteryBusinessList(offset, pageSize); // return list; // } public PageInfo<LotteryBusinessDTO> getPageLotteryBusinessList(int offset, int pageSize) { PageHelper.startPage(offset + 1, pageSize); List<LotteryBusinessDTO> list = lotteryTypeMapper.getLotteryBusinessList(); PageInfo page = new PageInfo(list); return page; } public LotteryType getById(int typeId) { return lotteryTypeMapper.selectByPrimaryKey(typeId); } public void updateByPrimaryKeySelective(LotteryType lotteryType) { lotteryTypeMapper.updateByPrimaryKeySelective(lotteryType); //同步老库 LotteryType2 lotteryType2 = lotteryType2Mapper.selectByPrimaryKey(lotteryType.getId()); lotteryType2.setTicketId(lotteryType.getTicketId()); lotteryType2Mapper.updateByPrimaryKeySelective(lotteryType2); } }
[ "qawsed1231010@126.com" ]
qawsed1231010@126.com
8a6d5b966478c4c7af76604a351744d4f30aec5d
75f0d81197655407fd59ec1dca79243d2aa70be9
/nd4j-jcublas-parent/nd4j-jcublas-common/src/main/java/jcuda/jcublas/cublasOperation.java
553d7785e827b5c3c937d50edda842ddaee604b7
[ "Apache-2.0" ]
permissive
noelnamai/nd4j
1a547e9ee5ad08f26d8a84f10af85c6c4278558f
f31d63d95e926c5d8cc93c5d0613f3b3c92e521c
refs/heads/master
2021-01-22T09:04:35.467401
2015-06-05T02:49:29
2015-06-05T02:49:29
36,916,394
2
0
null
2015-06-05T06:37:09
2015-06-05T06:37:09
null
UTF-8
Java
false
false
1,684
java
/* * * * Copyright 2015 Skymind,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 jcuda.jcublas; /** * Indicates which operation needs to be performed with the * dense matrix. */ public class cublasOperation { /** * The non-transpose operation is selected */ public static final int CUBLAS_OP_N = 0; /** * The transpose operation is selected */ public static final int CUBLAS_OP_T = 1; /** * The conjugate transpose operation is selected */ public static final int CUBLAS_OP_C = 2; /** * Private constructor to prevent instantiation */ private cublasOperation(){} /** * Returns a string representation of the given constant * * @return A string representation of the given constant */ public static String stringFor(int n) { switch (n) { case CUBLAS_OP_N: return "CUBLAS_OP_N"; case CUBLAS_OP_T: return "CUBLAS_OP_T"; case CUBLAS_OP_C: return "CUBLAS_OP_C"; } return "INVALID cublasOperation: "+n; } }
[ "adam@skymind.io" ]
adam@skymind.io
6361dd36252e269d95b0004544d4fbb039184b8a
94307a4c953cb76a40c27ed10f2861117e433b2f
/cathode/src/main/java/net/simonvt/cathode/ui/dashboard/DashboardMoviesAdapter.java
a1849a35819f097ea5a12d1680c49139bd7c9023
[ "Apache-2.0" ]
permissive
thiagocard/cathode
8c4b1bb8b8dc33fb37a2476641424ec616fed0a8
246879849e79068f8b4eaca5dbf6b95c59424360
refs/heads/master
2021-06-20T01:47:38.578346
2017-08-11T21:37:04
2017-08-11T21:37:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,619
java
/* * Copyright (C) 2016 Simon Vig Therkildsen * * 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 net.simonvt.cathode.ui.dashboard; import android.content.Context; import android.database.Cursor; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import butterknife.BindView; import butterknife.ButterKnife; import javax.inject.Inject; import net.simonvt.cathode.Injector; import net.simonvt.cathode.R; import net.simonvt.cathode.images.ImageType; import net.simonvt.cathode.images.ImageUri; import net.simonvt.cathode.provider.DatabaseContract.MovieColumns; import net.simonvt.cathode.provider.DatabaseSchematic; import net.simonvt.cathode.scheduler.MovieTaskScheduler; import net.simonvt.cathode.ui.adapter.RecyclerCursorAdapter; import net.simonvt.cathode.widget.RemoteImageView; import net.simonvt.schematic.Cursors; public class DashboardMoviesAdapter extends RecyclerCursorAdapter<DashboardMoviesAdapter.ViewHolder> { public static final String[] PROJECTION = new String[] { DatabaseSchematic.Tables.MOVIES + "." + MovieColumns.ID, DatabaseSchematic.Tables.MOVIES + "." + MovieColumns.TITLE, DatabaseSchematic.Tables.MOVIES + "." + MovieColumns.OVERVIEW, DatabaseSchematic.Tables.MOVIES + "." + MovieColumns.LAST_MODIFIED, }; @Inject MovieTaskScheduler movieScheduler; private DashboardFragment.OverviewCallback callback; public DashboardMoviesAdapter(Context context, DashboardFragment.OverviewCallback callback) { super(context); this.callback = callback; Injector.inject(this); } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { final View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.list_row_dashboard_movie, parent, false); final ViewHolder holder = new ViewHolder(view); view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final int position = holder.getAdapterPosition(); if (position != RecyclerView.NO_POSITION) { Cursor cursor = getCursor(position); final String title = Cursors.getString(cursor, MovieColumns.TITLE); final String overview = Cursors.getString(cursor, MovieColumns.OVERVIEW); callback.onDisplayMovie(holder.getItemId(), title, overview); } } }); return holder; } @Override protected void onBindViewHolder(ViewHolder holder, Cursor cursor, int position) { final long id = Cursors.getLong(cursor, MovieColumns.ID); final String poster = ImageUri.create(ImageUri.ITEM_MOVIE, ImageType.POSTER, id); holder.poster.setImage(poster); holder.title.setText(Cursors.getString(cursor, MovieColumns.TITLE)); } static class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.poster) RemoteImageView poster; @BindView(R.id.title) TextView title; ViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); } } }
[ "simonvt@gmail.com" ]
simonvt@gmail.com
d618662ab0e764144b0a97dd3c0e0e45db5e0e37
6d0b97c6cd23f99db508c08f99b651d08a3ac7ef
/src/test/java/org/assertj/core/data/Offset_toString_Test.java
695ffa5198c59d7c91b5ece5da23b30c8d3dbd68
[ "Apache-2.0" ]
permissive
lpandzic/assertj-core
14054dd2e42019fc173168e4e6e494ce3528a8f1
165a4b4f54e2c78cfca652ae6324a49d6d20243b
refs/heads/master
2021-01-21T05:32:10.144265
2016-01-04T07:43:56
2016-01-04T07:43:56
31,382,191
1
0
null
2015-02-26T18:33:50
2015-02-26T18:33:50
null
UTF-8
Java
false
false
1,159
java
/** * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * Copyright 2012-2015 the original author or authors. */ package org.assertj.core.data; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; import org.assertj.core.data.Offset; import org.junit.*; /** * Tests for {@link Offset#toString()}. * * @author Alex Ruiz */ public class Offset_toString_Test { private static Offset<Integer> offset; @BeforeClass public static void setUpOnce() { offset = offset(8); } @Test public void should_implement_toString() { assertThat(offset.toString()).isEqualTo("Offset[value=8]"); } }
[ "joel.costigliola@gmail.com" ]
joel.costigliola@gmail.com
f44c30d3754af3e5bbd9eca127382609a37eeb2a
953836ca644fd3694fbf4dc2a227ed6ea7f46698
/MyFramwork/src/main/java/com/sanshang/li/mybaseframwork/systemfloat/rom/OppoUtils.java
6e26503d7fa519b8ed177f63cea8a7c46705144e
[]
no_license
runwusheng/MyBaseFramwork
cb71ca01c5db77d9f748c804873bbf245a7e4661
2476363c200b85a57bd5ddfbb0b1bf70637196ae
refs/heads/master
2021-01-05T20:41:30.455558
2018-08-03T09:21:52
2018-08-03T09:21:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,371
java
package com.sanshang.li.mybaseframwork.systemfloat.rom; import android.annotation.TargetApi; import android.app.AppOpsManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Binder; import android.os.Build; import android.util.Log; import java.lang.reflect.Method; /** * Oppo悬浮窗权限 * Created by li on 2018/7/17. * WeChat 18571658038 * author LiWei */ public class OppoUtils { private static final String TAG = "--TAG--"; /** * 检测 Oppo 悬浮窗权限 */ public static boolean checkFloatWindowPermission(Context context) { final int version = Build.VERSION.SDK_INT; if (version >= 19) { return checkOp(context, 24); //OP_SYSTEM_ALERT_WINDOW = 24; } return true; } @TargetApi(Build.VERSION_CODES.KITKAT) private static boolean checkOp(Context context, int op) { final int version = Build.VERSION.SDK_INT; if (version >= 19) { AppOpsManager manager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); try { Class clazz = AppOpsManager.class; Method method = clazz.getDeclaredMethod("checkOp", int.class, int.class, String.class); return AppOpsManager.MODE_ALLOWED == (int) method.invoke(manager, op, Binder.getCallingUid(), context.getPackageName()); } catch (Exception e) { Log.e(TAG, Log.getStackTraceString(e)); } } else { Log.e(TAG, "Below API 19 cannot invoke!"); } return false; } /** * oppo ROM 权限申请 */ public static void applyOppoPermission(Context context) { //merge request from https://github.com/zhaozepeng/FloatWindowPermission/pull/26 try { Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //com.coloros.safecenter/.sysfloatwindow.FloatWindowListActivity ComponentName comp = new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.sysfloatwindow.FloatWindowListActivity");//悬浮窗管理页面 intent.setComponent(comp); context.startActivity(intent); } catch(Exception e){ e.printStackTrace(); } } }
[ "liwei49699@163.com" ]
liwei49699@163.com
2af70a17d1e000aaf260778644236754d5be300d
1bf466dd417b5d4c32ba50f554b9db85957b1172
/core/src/main/java/io/darkstar/ducksboard/RequestDucksboardReporter.java
56adff52e9e885b417f1b950014cb15c526dcef7
[]
no_license
darkstario/darkstar
adc0e471c2479f9db75e364b1928f30e7cb31528
2bdff8efae4b3d15a6642e77e561075de2ee2220
refs/heads/master
2020-05-20T02:02:28.370784
2014-08-07T04:52:02
2014-08-07T04:52:02
18,457,508
6
1
null
null
null
null
UTF-8
Java
false
false
3,457
java
package io.darkstar.ducksboard; //@Component public class RequestDucksboardReporter { /* implements InitializingBean { @Autowired private AsyncListenableTaskExecutor executor; @Autowired private EventBus eventBus; @Autowired private DucksboardPayloadFactory factory; @Autowired private DucksboardPoster ducksboardPoster; private final Map<String, MetricValue> lastReportedValues = new ConcurrentHashMap<>(); @Override public void afterPropertiesSet() throws Exception { eventBus.register(this); } @SuppressWarnings("UnusedDeclaration") //called by the EventBus via reflection @Subscribe public void onEvent(RequestMetricsEvent e) { for (MetricValue<?> mv : e.getMetricValues()) { executor.submit(new MetricValueReporter(ducksboardPoster, factory, mv)); } } private final class MetricValueReporter implements Runnable { private final DucksboardPoster poster; private final DucksboardPayloadFactory factory; private final MetricValue<?> metricValue; public MetricValueReporter(DucksboardPoster poster, DucksboardPayloadFactory factory, MetricValue metricValue) { this.poster = poster; this.factory = factory; this.metricValue = metricValue; } @Override public void run() { final String ducksboardLabel = metricValue.getName(); final Object valueToReport = sanitize(metricValue.getValue()); //only report if the new value is different than the last reported value. This prevents us //from flooding Ducksboard if there is no data change: MetricValue last = lastReportedValues.get(ducksboardLabel); if (last == null || (metricValue.isAfter(last) && !valueToReport.equals(last.getValue()))) { //Ducksboard requires time in secs, not millis: final long secondsSinceEpoch = metricValue.getTimeMillis() / 1000; final String json = factory.value(valueToReport, secondsSinceEpoch); poster.post(ducksboardLabel, json); //we keep the previous record of what we reported to Ducksboard, not the raw metric value //(which has a precision greater than what we report). We only want to post if what we report //is different from what we last reported: MetricValue<Object> reported = new MetricValue<>(ducksboardLabel, valueToReport, metricValue.getTimeMillis()); lastReportedValues.put(ducksboardLabel, reported); } //else, nothing has changed since this metric's last update, so don't post anything } private Object sanitize(Object value) { //we don't want to show huge numbers: hundredths is good enough granularity for reporting: if (value instanceof Double) { if (((double) value) < 0.01) { value = 0.00; } } else if (value instanceof Float) { if (((float) value) < 0.01f) { value = 0.00; } } return value; } /* public static String format(double value) { if (value < 0.01) { return "0.0"; } return String.format("%.2f", value); } } */ }
[ "les@hazlewood.com" ]
les@hazlewood.com
ce958b9908a5c17dfa01c7d56234090144c9b527
368d983ab780e67fcead1562bf7cd14b3d0f350e
/dmit2015-jsf-demo/src/main/java/ca/nait/dmit/service/JobService.java
f2f8b3ddc016c92cd2785129a7a97a202291ba52
[]
no_license
DMIT-2015/dmit2015-oa02-1201-demos
8ad1e369be7b502af8988fb90e2133525832b5ae
020b52f3d488e7623c7fe269fdb5bfda9e8af41e
refs/heads/master
2023-02-02T05:03:25.264451
2020-12-17T18:55:09
2020-12-17T18:55:09
297,771,007
0
1
null
null
null
null
UTF-8
Java
false
false
363
java
package ca.nait.dmit.service; import ca.nait.dmit.model.Job; import lombok.Getter; import javax.enterprise.context.ApplicationScoped; import java.util.ArrayList; import java.util.List; @ApplicationScoped public class JobService { @Getter private List<Job> jobs = new ArrayList<>(); public void add(Job newJob) { jobs.add(newJob); } }
[ "swu@nait.ca" ]
swu@nait.ca
44e3f9dc4955655a58b152f0715e652e52568df4
b81ea76cf655841e7abc9a2addbc0436ccbad67c
/src/main/java/org/cyclops/evilcraft/event/LivingUpdateEventHook.java
2016f9ddf8af9994217cae4987630f51f30daee8
[ "CC-BY-4.0" ]
permissive
josephcsible/EvilCraft
bdb64db3f25d734bcda11c456fc84ef7abedb5b7
0a606dee60fbdb41fcbaa4464e9027ed60bfa873
refs/heads/master-1.12
2021-09-12T04:43:28.333523
2017-10-15T08:09:12
2017-10-15T08:09:12
107,916,666
0
0
null
2017-10-23T01:12:47
2017-10-23T01:12:47
null
UTF-8
Java
false
false
3,613
java
package org.cyclops.evilcraft.event; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.cyclops.cyclopscore.helper.WorldHelpers; import org.cyclops.evilcraft.Configs; import org.cyclops.evilcraft.ExtendedDamageSource; import org.cyclops.evilcraft.GeneralConfig; import org.cyclops.evilcraft.block.ExcrementPile; import org.cyclops.evilcraft.block.ExcrementPileConfig; import org.cyclops.evilcraft.entity.monster.Werewolf; import org.cyclops.evilcraft.entity.villager.WerewolfVillager; import org.cyclops.evilcraft.entity.villager.WerewolfVillagerConfig; /** * Event hook for {@link LivingUpdateEvent}. * @author rubensworks * */ public class LivingUpdateEventHook { private static final int CHANCE_DROP_EXCREMENT = 500; // Real chance is 1/CHANCE_DROP_EXCREMENT private static final int CHANCE_DIE_WITHOUT_ANY_REASON = 1000000; // Real chance is 1/CHANCE_DIE_WITHOUT_ANY_REASON /** * When a sound event is received. * @param event The received event. */ @SubscribeEvent(priority = EventPriority.NORMAL) public void onLivingUpdate(LivingUpdateEvent event) { if(WorldHelpers.efficientTick(event.getEntity().world, 80)) { dropExcrement(event); dieWithoutAnyReason(event); transformWerewolfVillager(event); } } private void dropExcrement(LivingUpdateEvent event) { if(event.getEntity() instanceof EntityAnimal && Configs.isEnabled(ExcrementPileConfig.class) && !event.getEntity().world.isRemote && event.getEntity().world.rand.nextInt(CHANCE_DROP_EXCREMENT) == 0) { EntityAnimal entity = (EntityAnimal) event.getEntity(); World world = entity.world; BlockPos blockPos = entity.getPosition(); if(world.getBlockState(blockPos).getBlock() == Blocks.AIR && world.getBlockState(blockPos.add(0, -1, 0)).isNormalCube()) { world.setBlockState(blockPos, ExcrementPile.getInstance().getDefaultState()); } else if(world.getBlockState(blockPos).getBlock() == ExcrementPile.getInstance()) { ExcrementPile.getInstance().heightenPileAt(world, blockPos); } } } private void dieWithoutAnyReason(LivingUpdateEvent event) { if(event.getEntity() instanceof EntityPlayer && GeneralConfig.dieWithoutAnyReason && event.getEntity().world.rand.nextInt(CHANCE_DIE_WITHOUT_ANY_REASON) == 0 && !event.getEntity().world.isRemote) { EntityPlayer entity = (EntityPlayer) event.getEntity(); entity.attackEntityFrom(ExtendedDamageSource.dieWithoutAnyReason, Float.MAX_VALUE); } } private void transformWerewolfVillager(LivingUpdateEvent event) { if(event.getEntity() instanceof EntityVillager && !event.getEntity().world.isRemote) { EntityVillager villager = (EntityVillager) event.getEntity(); if(Werewolf.isWerewolfTime(event.getEntity().world) && Configs.isEnabled(WerewolfVillagerConfig.class) && villager.getProfessionForge() == WerewolfVillager.getInstance()) { Werewolf.replaceVillager(villager); } } } }
[ "rubensworks@gmail.com" ]
rubensworks@gmail.com
3e427a7e00652c4bb563dec21fe444cd1d748051
ddce3c1d623fc6887e288a4e5fa022abd2707761
/src/com/MCAAlgorithm/bigshua/class16/Code01_IsSum.java
9a4ddac02ad7c950f1987a5f6ea9fb6ca1af5cd0
[]
no_license
tjzhaomengyi/DataStructure-java
e1632758761ab66f58dee6f84d81ac101d2a3289
7f1a95bd2918ea7a4763df7858d1ea28e538698d
refs/heads/master
2023-07-07T19:09:21.349154
2023-06-27T02:59:12
2023-06-27T02:59:12
81,512,160
0
0
null
null
null
null
UTF-8
Java
false
false
5,948
java
package com.MCAAlgorithm.bigshua.class16; import java.util.HashMap; import java.util.HashSet; // 这道题是一个小小的补充,课上没有讲 // 但是如果你听过体系学习班动态规划专题和本节课的话 // 这道题就是一道水题 public class Code01_IsSum { // arr中的值可能为正,可能为负,可能为0 // 自由选择arr中的数字,能不能累加得到sum // 暴力递归方法 public static boolean isSum1(int[] arr, int sum) { if (sum == 0) { return true; } if (arr == null || arr.length == 0) { return false; } return process1(arr, arr.length - 1, sum); } // 可以自由使用arr[0...i]上的数字,能不能累加得到sum public static boolean process1(int[] arr, int i, int sum) { if (sum == 0) { return true; } if (i == -1) { return false; } return process1(arr, i - 1, sum) || process1(arr, i - 1, sum - arr[i]); } // arr中的值可能为正,可能为负,可能为0 // 自由选择arr中的数字,能不能累加得到sum // 记忆化搜索方法 // 从暴力递归方法来,加了记忆化缓存,就是动态规划了 public static boolean isSum2(int[] arr, int sum) { if (sum == 0) { return true; } if (arr == null || arr.length == 0) { return false; } return process2(arr, arr.length - 1, sum, new HashMap<>()); } public static boolean process2(int[] arr, int i, int sum, HashMap<Integer, HashMap<Integer, Boolean>> dp) { if (dp.containsKey(i) && dp.get(i).containsKey(sum)) { return dp.get(i).get(sum); } boolean ans = false; if (sum == 0) { ans = true; } else if (i != -1) { ans = process2(arr, i - 1, sum, dp) || process2(arr, i - 1, sum - arr[i], dp); } if (!dp.containsKey(i)) { dp.put(i, new HashMap<>()); } dp.get(i).put(sum, ans); return ans; } // arr中的值可能为正,可能为负,可能为0 // 自由选择arr中的数字,能不能累加得到sum // 经典动态规划 public static boolean isSum3(int[] arr, int sum) { if (sum == 0) { return true; } // sum != 0 if (arr == null || arr.length == 0) { return false; } // arr有数,sum不为0 int min = 0; int max = 0; for (int num : arr) { min += num < 0 ? num : 0; max += num > 0 ? num : 0; } // min~max if (sum < min || sum > max) { return false; } // min <= sum <= max int N = arr.length; // dp[i][j] // // 0 1 2 3 4 5 6 7 (实际的对应) // -7 -6 -5 -4 -3 -2 -1 0(想象中) // // dp[0][-min] -> dp[0][7] -> dp[0][0] boolean[][] dp = new boolean[N][max - min + 1]; // dp[0][0] = true dp[0][-min] = true; // dp[0][arr[0]] = true dp[0][arr[0] - min] = true; for (int i = 1; i < N; i++) { for (int j = min; j <= max; j++) { // dp[i][j] = dp[i-1][j] dp[i][j - min] = dp[i - 1][j - min]; // dp[i][j] |= dp[i-1][j - arr[i]] int next = j - min - arr[i]; dp[i][j - min] |= (next >= 0 && next <= max - min && dp[i - 1][next]); } } // dp[N-1][sum] return dp[N - 1][sum - min]; } // arr中的值可能为正,可能为负,可能为0 // 自由选择arr中的数字,能不能累加得到sum // 分治的方法 // 如果arr中的数值特别大,动态规划方法依然会很慢 // 此时如果arr的数字个数不算多(40以内),哪怕其中的数值很大,分治的方法也将是最优解 public static boolean isSum4(int[] arr, int sum) { if (sum == 0) { return true; } if (arr == null || arr.length == 0) { return false; } if (arr.length == 1) { return arr[0] == sum; } int N = arr.length; int mid = N >> 1; HashSet<Integer> leftSum = new HashSet<>(); HashSet<Integer> rightSum = new HashSet<>(); // 0...mid-1 process4(arr, 0, mid, 0, leftSum); // mid..N-1 process4(arr, mid, N, 0, rightSum); // 单独查看,只使用左部分,能不能搞出sum // 单独查看,只使用右部分,能不能搞出sum // 左+右,联合能不能搞出sum // 左部分搞出所有累加和的时候,包含左部分一个数也没有,这种情况的,leftsum表里,0 // 17 17 for (int l : leftSum) { if (rightSum.contains(sum - l)) { return true; } } return false; } // arr[0...i-1]决定已经做完了!形成的累加和是pre // arr[i...end - 1] end(终止) 所有数字随意选择, // arr[0...end-1]所有可能的累加和存到ans里去 public static void process4(int[] arr, int i, int end, int pre, HashSet<Integer> ans) { if (i == end) { ans.add(pre); } else { process4(arr, i + 1, end, pre, ans); process4(arr, i + 1, end, pre + arr[i], ans); } } // 为了测试 // 生成长度为len的随机数组 // 值在[-max, max]上随机 public static int[] randomArray(int len, int max) { int[] arr = new int[len]; for (int i = 0; i < len; i++) { arr[i] = (int) (Math.random() * ((max << 1) + 1)) - max; } return arr; } // 对数器验证所有方法 public static void main(String[] args) { int N = 20; int M = 100; int testTime = 100000; System.out.println("测试开始"); for (int i = 0; i < testTime; i++) { int size = (int) (Math.random() * (N + 1)); int[] arr = randomArray(size, M); int sum = (int) (Math.random() * ((M << 1) + 1)) - M; boolean ans1 = isSum1(arr, sum); boolean ans2 = isSum2(arr, sum); boolean ans3 = isSum3(arr, sum); boolean ans4 = isSum4(arr, sum); if (ans1 ^ ans2 || ans3 ^ ans4 || ans1 ^ ans3) { System.out.println("出错了!"); System.out.print("arr : "); for (int num : arr) { System.out.print(num + " "); } System.out.println(); System.out.println("sum : " + sum); System.out.println("方法一答案 : " + ans1); System.out.println("方法二答案 : " + ans2); System.out.println("方法三答案 : " + ans3); System.out.println("方法四答案 : " + ans4); break; } } System.out.println("测试结束"); } }
[ "tjzhaomengyi@163.com" ]
tjzhaomengyi@163.com
9fd6b74a571ab32a4cb278fd1bea25c1cf5920a7
d67d14df76c19e932a4418f27f72688758fddcd7
/flowcentral-dashboard/src/main/java/com/flowcentraltech/flowcentral/dashboard/business/DashboardUsageServiceImpl.java
744b615d7cedf1a8696f1c0baf75ba4c73ffcc61
[]
no_license
flowcentraltechnologies/flowcentral
a5a664419c9aeb4201dffe1330e60a97966b1d55
83d41843e370268d4e34007e83403ab295921d55
refs/heads/master
2023-08-31T19:11:24.335803
2023-08-28T11:41:34
2023-08-28T11:41:34
458,516,691
0
2
null
2023-09-14T19:48:18
2022-02-12T12:32:54
Java
UTF-8
Java
false
false
4,065
java
/* * Copyright 2021-2023 FlowCentral Technologies Limited. * * 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.flowcentraltech.flowcentral.dashboard.business; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.flowcentraltech.flowcentral.application.business.UsageProvider; import com.flowcentraltech.flowcentral.application.data.Usage; import com.flowcentraltech.flowcentral.application.data.UsageType; import com.flowcentraltech.flowcentral.common.business.AbstractFlowCentralService; import com.flowcentraltech.flowcentral.configuration.data.ModuleInstall; import com.flowcentraltech.flowcentral.dashboard.constants.DashboardModuleNameConstants; import com.flowcentraltech.flowcentral.dashboard.entities.DashboardTile; import com.flowcentraltech.flowcentral.dashboard.entities.DashboardTileQuery; import com.tcdng.unify.core.UnifyException; import com.tcdng.unify.core.annotation.Component; import com.tcdng.unify.core.annotation.Transactional; /** * Default implementation of dashboard usage service. * * @author FlowCentral Technologies Limited * @since 1.0 */ @Transactional @Component(DashboardModuleNameConstants.DASHBOARD_USAGE_SERVICE) public class DashboardUsageServiceImpl extends AbstractFlowCentralService implements UsageProvider { @Override public List<Usage> findApplicationUsagesByOtherApplications(String applicationName, UsageType usageType) throws UnifyException { final String applicationNameBase = applicationName + '.'; List<Usage> usageList = new ArrayList<Usage>(); // Dashboard tile if (UsageType.isQualifiesEntity(usageType)) { List<DashboardTile> dashboardTileList = environment().listAll( new DashboardTileQuery().applicationNameNot(applicationName).chartBeginsWith(applicationNameBase) .addSelect("applicationName", "dashboardName", "name", "chart")); for (DashboardTile dashboardTile : dashboardTileList) { Usage usage = new Usage( UsageType.ENTITY, "DashboardTile", dashboardTile.getApplicationName() + "." + dashboardTile.getDashboardName() + "." + dashboardTile.getName(), "chart", dashboardTile.getChart()); usageList.add(usage); } } return usageList; } @Override public long countApplicationUsagesByOtherApplications(String applicationName, UsageType usageType) throws UnifyException { final String applicationNameBase = applicationName + '.'; long usages = 0L; // Dashboard tile if (UsageType.isQualifiesEntity(usageType)) { usages += environment().countAll( new DashboardTileQuery().applicationNameNot(applicationName).chartBeginsWith(applicationNameBase) .addSelect("applicationName", "dashboardName", "name", "chart")); } return usages; } @Override public List<Usage> findEntityUsages(String entity, UsageType usageType) throws UnifyException { return Collections.emptyList(); } @Override public long countEntityUsages(String entity, UsageType usageType) throws UnifyException { return 0; } @Override protected void doInstallModuleFeatures(ModuleInstall moduleInstall) throws UnifyException { } }
[ "lateef.ojulari@tcdng.com" ]
lateef.ojulari@tcdng.com
ee090019e630862d1595ecbac9fff125aabc1b29
0ebb638b03f4f66431e34d54382b5982a025e773
/modeshape-jcr/src/main/java/org/modeshape/jcr/value/basic/UuidReference.java
7523969bbffd5e76c624e0528a2bccfb86069a30
[]
no_license
bwallis42/modeshape
1d2d5e80466e91afe97dd60e300e649c9ff23765
4de334f9b1615d1111e1dd7ab3e38c4b66a544e4
refs/heads/master
2020-12-25T00:27:56.729606
2012-05-14T17:48:55
2012-05-14T17:49:36
4,353,179
1
0
null
null
null
null
UTF-8
Java
false
false
3,499
java
/* * ModeShape (http://www.modeshape.org) * See the COPYRIGHT.txt file distributed with this work for information * regarding copyright ownership. Some portions may be licensed * to Red Hat, Inc. under one or more contributor license agreements. * See the AUTHORS.txt file in the distribution for a full listing of * individual contributors. * * ModeShape is free software. Unless otherwise indicated, all code in ModeShape * is licensed to you under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * ModeShape is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.modeshape.jcr.value.basic; import java.util.UUID; import org.modeshape.common.annotation.Immutable; import org.modeshape.common.text.TextEncoder; import org.modeshape.jcr.value.Path; import org.modeshape.jcr.value.Reference; /** * A {@link Reference} implementation that uses a single {@link UUID} as the pointer. */ @Immutable public class UuidReference implements Reference { private static final long serialVersionUID = 2299467578161645109L; private/*final*/UUID uuid; private/*final*/boolean isWeak; public UuidReference( UUID uuid ) { this.uuid = uuid; this.isWeak = false; } public UuidReference( UUID uuid, boolean weak ) { this.uuid = uuid; this.isWeak = weak; } /** * @return uuid */ public UUID getUuid() { return this.uuid; } @Override public String getString() { return this.uuid.toString(); } @Override public String getString( TextEncoder encoder ) { if (encoder == null) encoder = Path.DEFAULT_ENCODER; return encoder.encode(getString()); } @Override public boolean isWeak() { return isWeak; } @Override public int hashCode() { return uuid.hashCode(); } @Override public int compareTo( Reference that ) { if (this == that) return 0; if (this.isWeak()) { if (!that.isWeak()) return -1; } else { if (that.isWeak()) return 1; } if (that instanceof UuidReference) { return this.uuid.compareTo(((UuidReference)that).getUuid()); } return this.getString().compareTo(that.getString()); } @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof UuidReference) { UuidReference that = (UuidReference)obj; return this.isWeak() == that.isWeak() && this.uuid.equals(that.getUuid()); } if (obj instanceof Reference) { Reference that = (Reference)obj; return this.isWeak() == that.isWeak() && this.getString().equals(that.getString()); } return super.equals(obj); } @Override public String toString() { return this.uuid.toString(); } }
[ "rhauch@gmail.com" ]
rhauch@gmail.com
0c2625a032abeab2a8b1b11423f64f4619b8506d
8e615ccc5b96e64a3e50a74e668f658cff9640cb
/ccredit/src/main/java/ccredit/xtmodules/xtservice/impl/XtAreaRegionServiceImpl.java
b215a88c8f41849401bf13ba5e771d7278b42264
[]
no_license
Adoxhh/ccredit
bf6156cce6c207d2f7f852ce267e26b225beb665
f52ae7b354adfec3556943904bbde7f047f81bc5
refs/heads/master
2022-12-25T00:57:24.501846
2018-05-21T03:01:44
2018-05-21T03:01:44
132,726,468
0
1
null
2022-12-16T08:04:04
2018-05-09T08:32:06
JavaScript
UTF-8
Java
false
false
4,551
java
package ccredit.xtmodules.xtservice.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import ccredit.xtmodules.xtcore.base.BaseService; import ccredit.xtmodules.xtcore.util.ExceptionUtil; import ccredit.xtmodules.xtdao.XtAreaRegionDao; import ccredit.xtmodules.xtmodel.XtAreaRegion; import ccredit.xtmodules.xtservice.XtAreaRegionService; /** * 行政区划表 * 2017-05-04 14:54:34 邓纯杰 */ @Service("xtAreaRegionService") public class XtAreaRegionServiceImpl extends BaseService implements XtAreaRegionService{ @Autowired private XtAreaRegionDao xtAreaRegionDao; /** * 分页 * @param condition * @return */ public List<XtAreaRegion> getXtAreaRegionListByCondition(Map<String,Object> condition){ try{ return xtAreaRegionDao.getXtAreaRegionListByCondition(condition); } catch (Exception e) { /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } } /** * 查询对象 * @param ID * @return */ public XtAreaRegion getXtAreaRegionById(String ID){ try{ XtAreaRegion xt_Area_Region = xtAreaRegionDao.getXtAreaRegionById(ID); return xt_Area_Region; } catch (Exception e) { /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } } /** * 添加 * @param xt_area_region * @return */ public int addXtAreaRegion(XtAreaRegion xt_Area_Region){ int i = 0; try { i = xtAreaRegionDao.addXtAreaRegion(xt_Area_Region); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 修改 * @param xt_area_region * @return */ public int updateXtAreaRegion(XtAreaRegion xt_Area_Region){ int i = 0; try { i = xtAreaRegionDao.updateXtAreaRegion(xt_Area_Region); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 修改(根据动态条件) * @param xt_area_region * @return */ public int updateXtAreaRegionBySelective(XtAreaRegion xt_Area_Region){ int i = 0; try { i = xtAreaRegionDao.updateXtAreaRegionBySelective(xt_Area_Region); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 删除 * @param condition * @return */ public int delXtAreaRegion(Map<String,Object> condition){ int i = 0; try { i = xtAreaRegionDao.delXtAreaRegion(condition); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 批量添加 * @param xt_area_regionList * @return */ public int addBatchXtAreaRegion(List<XtAreaRegion> xt_Area_RegionList){ int i = 0; try { i = xtAreaRegionDao.addBatchXtAreaRegion(xt_Area_RegionList); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 批量修改 * @param xt_area_regionList * @return */ public int updateBatchXtAreaRegion(List<XtAreaRegion> xt_Area_RegionList){ int i = 0; try { i = xtAreaRegionDao.updateBatchXtAreaRegion(xt_Area_RegionList); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } /** * 批量修改(根据动态条件) * @param xt_area_regionList * @return */ public int updateBatchXtAreaRegionBySelective(List<XtAreaRegion> xt_Area_RegionList){ int i = 0; try { i = xtAreaRegionDao.updateBatchXtAreaRegionBySelective(xt_Area_RegionList); } catch (Exception e) { i = 0; /**方案一加上这句话这样程序异常时才能被aop捕获进而回滚**/ throw new ExceptionUtil(e.getMessage(),e.getCause()); } return i; } }
[ "87052113@qq.com" ]
87052113@qq.com
91d6e3396583daf3873e5ce084c7c8defe28a629
215a4730547344b35b4a4bf467450b1aef4f0fe3
/qg-portlet/src/main/java/de/saschafeldmann/adesso/master/thesis/portlet/view/ViewWithMenu.java
3476c84a009fad59b4713ec4191e02f85dcc9d78
[]
no_license
sasfeld-thesis/question-generator
224b891276659de55e254ccdfbfbb7527fb3a353
c41247148bdd5658abaf0a47ff608506e35f2a58
refs/heads/master
2020-04-05T14:05:30.767748
2016-09-16T14:33:12
2016-09-16T14:33:12
58,561,020
0
1
null
null
null
null
UTF-8
Java
false
false
1,303
java
package de.saschafeldmann.adesso.master.thesis.portlet.view; import com.vaadin.navigator.View; import de.saschafeldmann.adesso.master.thesis.portlet.model.QuestionGenerationSession; /** * Project: Masterthesis of Sascha Feldmann * Creation date: 23.05.2016 * Author: Sascha Feldmann (sascha.feldmann@gmx.de) * <br><br> * University: * Hochschule für Technik und Wirtschaft, Berlin * Fachbereich 4 * Studiengang Internationale Medieninformatik (Master) * <br><br> * Company: * adesso AG * <br><br> * All views with menus should implement this interface so that using presenters can register themselves as menu listeners. */ public interface ViewWithMenu extends View { /** * Sets the menu listener which is informed if menu items are clicked. * @param menuListener the menu listener (a presenter). */ void setMenuListener(MenuListener menuListener); /** * Sets the current user session status so that the menu can be adjusted. * @param currentSessionStatus the current session status */ void setCurrentSessionStatus(QuestionGenerationSession.Status currentSessionStatus); /** * Refreshes the view by reinitializing the labels and * resetting all inputs in the current view. */ void refreshView(); }
[ "sascha.feldmann@gmx.de" ]
sascha.feldmann@gmx.de
432910d8f0d8646d09557d0378e558e12a439ca5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_96c91cf4c117c27d697fc89749a7ed5047c79c15/IgnoreCollector/4_96c91cf4c117c27d697fc89749a7ed5047c79c15_IgnoreCollector_s.java
7472c8268842110d2ea2cefd98166679d26bde49
[]
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
2,032
java
package org.openqa.selenium.internal; import org.json.JSONArray; import org.json.JSONException; import org.openqa.selenium.testing.Ignore; import org.openqa.selenium.remote.BeanToJsonConverter; import org.openqa.selenium.testing.IgnoredTestCallback; import java.lang.reflect.Method; import java.util.*; public class IgnoreCollector implements IgnoredTestCallback { private Set<Map> tests = new HashSet<Map>(); private BeanToJsonConverter converter = new BeanToJsonConverter(); public void callback(Class clazz, String testName, Ignore ignore) { for (String name : getTestMethodsFor(clazz, testName)) { tests.add(IgnoredTestCase.asMap(clazz.getName(), name, ignore)); } } private List<String> getTestMethodsFor(Class clazz, String testName) { if (!testName.isEmpty()) { return Arrays.asList(testName); } List<String> testMethods = new ArrayList<String>(); Method[] methods = clazz.getDeclaredMethods(); for (Method method : methods) { if (isTestMethod(method)) { testMethods.add(method.getName()); } } return testMethods; } private boolean isTestMethod(Method method) { return method.getAnnotation(org.junit.Test.class) != null || method.getName().startsWith("test"); } public String toJson() throws JSONException { return new JSONArray(converter.convert(tests)).toString(); } private static class IgnoredTestCase { public static Map<String, Object> asMap(String className, String testName, Ignore ignore) { final Map<String, Object> map = new HashMap<String, Object>(); map.put("className", className); map.put("testName", testName); map.put("reason", ignore.reason()); map.put("issues", ignore.issues()); final Set<String> drivers = new HashSet<String>(); for (Ignore.Driver driver : ignore.value()) { drivers.add(driver.name()); } map.put("drivers", drivers); return map; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e40ba5ffc967d3a8326136ecc31c5423fba14ed8
261053ece2f16bdd98cfacb9782d50068d289d91
/default/ovms1/ovms-common/ovms-common-security/src/main/java/com/htstar/ovms/common/security/exception/ForbiddenException.java
4da85a354d951ed9c3b0a8e9be195d6c8c32b615
[]
no_license
jiangdm/java
0e271a2f2980b1bb9f7459bb8c2fcb90d61dfaa9
4d9428619247ba4fa3f9513505c62e506ecdaf3b
refs/heads/main
2023-01-12T15:15:18.300314
2020-11-19T09:43:24
2020-11-19T09:43:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
703
java
package com.htstar.ovms.common.security.exception; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.htstar.ovms.common.security.component.OvmsAuth2ExceptionSerializer; import org.springframework.http.HttpStatus; /** * @author ovms * @date 2018/7/8 */ @JsonSerialize(using = OvmsAuth2ExceptionSerializer.class) public class ForbiddenException extends OvmsAuth2Exception { public ForbiddenException(String msg) { super(msg); } public ForbiddenException(String msg, Throwable t) { super(msg,t); } @Override public String getOAuth2ErrorCode() { return "access_denied"; } @Override public int getHttpErrorCode() { return HttpStatus.FORBIDDEN.value(); } }
[ "ovms@email.com" ]
ovms@email.com
e0a90f4490e6e4eda70f3f5aba8e5452a563b31f
cf2e4937e170f6b38839feca7bdf5dd31fa7e135
/ryqcxls/src/main/java/com/ystech/qywx/core/ParamBuildUtile.java
7a7871b31ed7ff4655b09d01fbba520165c81d4e
[]
no_license
shusanzhan/ryqcxly
ff5ba983613bd9041248dc4d55fd1f593eee626e
3ef738d1a0c7d61ea448a66f2ccbb7fe3ece992d
refs/heads/master
2022-12-24T16:25:47.960029
2021-02-22T02:57:28
2021-02-22T02:57:28
193,863,573
0
0
null
2022-12-16T08:01:59
2019-06-26T08:31:32
Java
UTF-8
Java
false
false
4,049
java
/** * */ package com.ystech.qywx.core; import java.util.HashMap; import java.util.Map; import com.ystech.qywx.model.RedBag; import com.ystech.qywx.model.ScanPayReqData; /** * @author gaodong * @date 2014-9-6 */ public class ParamBuildUtile { //微支付网关地址 public static Map<String,Object> builtParamsWaxp(String notify_urlp,String prepayId) throws Exception{ String packageValue="prepay_id="+prepayId; //获取package包 //随机字符串 String noncestr = Sha1Util.getNonceStr(); //时间戳 String timestamp = Sha1Util.getTimeStamp(); //设置支付参数 Map<String, Object> signParams = new HashMap<String, Object>(); signParams.put("appId", Configure.getAppid()); signParams.put("nonceStr", noncestr); signParams.put("timeStamp", timestamp); signParams.put("package", packageValue); signParams.put("signType", "MD5"); String sign = Signature.getSign(signParams,Configure.getPaySignKey()); //增加非参与签名的额外参数 signParams.put("paySign", sign); return signParams; } /** * 功能描述:构造发起支付参数 * @param request * @param orders * @param payWayBussi * @param oppenId * @param notify_urlp * @return */ public static ScanPayReqData builtParamsScanPayReqData(RedBag redBag){ ScanPayReqData scanPayReqData=new ScanPayReqData(redBag); return scanPayReqData; } /** * 构造查询微信订单接口 * @param payWayBussi * @param outTradeNo * @return *//* public static String builtScanPayQueryReqData(String transactionID, PayWayBussi payWayBussi,String outTradeNo){ ScanPayQueryReqData payQueryReqData=new ScanPayQueryReqData(transactionID, outTradeNo, payWayBussi); XStream xStreamForRequestPostData = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("-_", "_"))); //将要提交给API的数据对象转换成XML格式数据Post给API String postDataXML = xStreamForRequestPostData.toXML(payQueryReqData); return postDataXML; } *//** * 构造查询微信订单接口 * @param payWayBussi * @param outTradeNo * @return *//* public static String builtCloseOrderReqData(String appid, String mch_id, String out_trade_no,String paySignKey){ CloseOrder closeOrder=new CloseOrder(appid, mch_id, out_trade_no, paySignKey); XStream xStreamForRequestPostData = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("-_", "_"))); //将要提交给API的数据对象转换成XML格式数据Post给API String postDataXML = xStreamForRequestPostData.toXML(closeOrder); return postDataXML; } *//** * 构造退库申请接口 * @param payWayBussi * @param outTradeNo * @return *//* public static String builtRefundReqData(PayWayBussi payWayBussi, String transactionID, String out_trade_no,String outRefundNo,int totalFee,int refundFee){ String deviceInfo="WEB"; String opUserID=payWayBussi.getMchid(); String refundFeeType="CNY"; RefundReqData refundReqData=new RefundReqData(payWayBussi, transactionID, out_trade_no, deviceInfo, outRefundNo, totalFee, refundFee, opUserID, refundFeeType); XStream xStreamForRequestPostData = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("-_", "_"))); //将要提交给API的数据对象转换成XML格式数据Post给API String postDataXML = xStreamForRequestPostData.toXML(refundReqData); return postDataXML; }*/ /** * 构造退库查询接口 * @param payWayBussi * @param outTradeNo * @return *//* public static String builtRefundQueryReqData(String transactionID, String out_trade_no,String outRefundNo,String refundID){ String deviceInfo="WEB"; RefundQueryReqData refundReqData=new RefundQueryReqData(payWayBussi, transactionID, out_trade_no, deviceInfo, outRefundNo, refundID); XStream xStreamForRequestPostData = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("-_", "_"))); //将要提交给API的数据对象转换成XML格式数据Post给API String postDataXML = xStreamForRequestPostData.toXML(refundReqData); return postDataXML; }*/ }
[ "shusanzhan@163.com" ]
shusanzhan@163.com
6daea3bdf5550a9c87b1d8263556cc129a08a3f6
5ec06dab1409d790496ce082dacb321392b32fe9
/clients/java-undertow-server/generated/src/main/java/org/openapitools/model/ComDayCqDamCoreImplServletDamContentDispositionFilterInfo.java
14797d2a50bbc1a8898498da2d9f76d463e0305c
[ "Apache-2.0" ]
permissive
shinesolutions/swagger-aem-osgi
e9d2385f44bee70e5bbdc0d577e99a9f2525266f
c2f6e076971d2592c1cbd3f70695c679e807396b
refs/heads/master
2022-10-29T13:07:40.422092
2021-04-09T07:46:03
2021-04-09T07:46:03
190,217,155
3
3
Apache-2.0
2022-10-05T03:26:20
2019-06-04T14:23:28
null
UTF-8
Java
false
false
4,052
java
package org.openapitools.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.ComDayCqDamCoreImplServletDamContentDispositionFilterProperties; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen", date = "2019-08-05T00:56:20.785Z[GMT]") public class ComDayCqDamCoreImplServletDamContentDispositionFilterInfo { private String pid = null; private String title = null; private String description = null; private ComDayCqDamCoreImplServletDamContentDispositionFilterProperties properties = null; /** **/ public ComDayCqDamCoreImplServletDamContentDispositionFilterInfo pid(String pid) { this.pid = pid; return this; } @ApiModelProperty(value = "") @JsonProperty("pid") public String getPid() { return pid; } public void setPid(String pid) { this.pid = pid; } /** **/ public ComDayCqDamCoreImplServletDamContentDispositionFilterInfo title(String title) { this.title = title; return this; } @ApiModelProperty(value = "") @JsonProperty("title") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } /** **/ public ComDayCqDamCoreImplServletDamContentDispositionFilterInfo description(String description) { this.description = description; return this; } @ApiModelProperty(value = "") @JsonProperty("description") public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } /** **/ public ComDayCqDamCoreImplServletDamContentDispositionFilterInfo properties(ComDayCqDamCoreImplServletDamContentDispositionFilterProperties properties) { this.properties = properties; return this; } @ApiModelProperty(value = "") @JsonProperty("properties") public ComDayCqDamCoreImplServletDamContentDispositionFilterProperties getProperties() { return properties; } public void setProperties(ComDayCqDamCoreImplServletDamContentDispositionFilterProperties properties) { this.properties = properties; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ComDayCqDamCoreImplServletDamContentDispositionFilterInfo comDayCqDamCoreImplServletDamContentDispositionFilterInfo = (ComDayCqDamCoreImplServletDamContentDispositionFilterInfo) o; return Objects.equals(pid, comDayCqDamCoreImplServletDamContentDispositionFilterInfo.pid) && Objects.equals(title, comDayCqDamCoreImplServletDamContentDispositionFilterInfo.title) && Objects.equals(description, comDayCqDamCoreImplServletDamContentDispositionFilterInfo.description) && Objects.equals(properties, comDayCqDamCoreImplServletDamContentDispositionFilterInfo.properties); } @Override public int hashCode() { return Objects.hash(pid, title, description, properties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ComDayCqDamCoreImplServletDamContentDispositionFilterInfo {\n"); sb.append(" pid: ").append(toIndentedString(pid)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" properties: ").append(toIndentedString(properties)).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 "); } }
[ "cliffano@gmail.com" ]
cliffano@gmail.com
442c5023d8a88d08fa9442a3651cb74de29dd633
867bb3414c183bc19cf985bb6d3c55f53bfc4bfd
/mall-pay/src/main/java/com/cjcx/pay/dao/StaffDao.java
3cccedc6112b34a2d6172b87f740dd8ee97c8ffa
[]
no_license
easonstudy/cloud-dev
49d02fa513df3c92c5ed03cec61844d10890b80b
fe898cbfb746232fe199e83969b89cb83e85dfaf
refs/heads/master
2020-03-29T05:39:36.279494
2018-10-22T10:55:14
2018-10-22T10:55:32
136,574,935
0
0
null
null
null
null
UTF-8
Java
false
false
321
java
package com.cjcx.pay.dao; import com.cjcx.pay.dto.StaffDto; import com.cjcx.pay.framework.orm.IBaseDao; import org.springframework.stereotype.Repository; /** * */ @Repository public interface StaffDao extends IBaseDao<StaffDto, Integer> { public void login(); public StaffDto findByToken(String token); }
[ "11" ]
11
5266da93b683add214ba8b853dab7a154ed9f0ee
9b9dd4b68f21e57d219fb3af422e76be7fc7a7ee
/src/main/java/org/lanternpowered/server/network/vanilla/message/codec/play/CodecPlayInTabComplete.java
a8dea1bd0e69a4d2a8c48f1f0b9331a4629e6268
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Mosaplex/Lantern
3cf754db3a3e0240ecd1d6070074cf0d097f729c
7f536b5b0d06a05dfeb62d2873664c42ee28f91f
refs/heads/master
2021-03-21T11:02:08.501286
2019-07-02T15:49:13
2019-07-02T15:49:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,279
java
/* * This file is part of LanternServer, licensed under the MIT License (MIT). * * Copyright (c) LanternPowered <https://www.lanternpowered.org> * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.lanternpowered.server.network.vanilla.message.codec.play; import com.flowpowered.math.vector.Vector3i; import io.netty.handler.codec.CodecException; import org.lanternpowered.server.network.buffer.ByteBuffer; import org.lanternpowered.server.network.message.codec.Codec; import org.lanternpowered.server.network.message.codec.CodecContext; import org.lanternpowered.server.network.vanilla.message.type.play.MessagePlayInTabComplete; public final class CodecPlayInTabComplete implements Codec<MessagePlayInTabComplete> { @Override public MessagePlayInTabComplete decode(CodecContext context, ByteBuffer buf) throws CodecException { String text = buf.readString(); boolean assumeCommand = buf.readBoolean(); Vector3i blockPosition = null; if (buf.readBoolean()) { blockPosition = buf.readVector3i(); } return new MessagePlayInTabComplete(text, assumeCommand, blockPosition); } }
[ "seppevolkaerts@hotmail.com" ]
seppevolkaerts@hotmail.com
0b7d4afaeaba972f8ed40400ec75aee03ba41489
84a2afe3aad3e6b6f806d2cb47457ec5a7314aa2
/idea-p4server/api/src/main/java/net/groboclown/p4/server/api/commands/file/GetFileContentsResult.java
e7b4140b967b18d101dd3dab084d4a0e03fc8a92
[ "Apache-2.0", "BSD-2-Clause" ]
permissive
groboclown/p4ic4idea
f8cf4d4dda8f9c0d2e30c4695d0dd40673e6a910
0395af66ee6c90e238b43994a42c940ef13c1905
refs/heads/master
2022-07-28T12:14:56.411884
2022-07-08T23:27:06
2022-07-08T23:27:06
30,258,802
35
15
Apache-2.0
2022-03-14T16:03:55
2015-02-03T18:51:06
Java
UTF-8
Java
false
false
2,250
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.groboclown.p4.server.api.commands.file; import com.intellij.openapi.vcs.FilePath; import net.groboclown.p4.server.api.P4CommandRunner; import net.groboclown.p4.server.api.config.ClientConfig; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; public class GetFileContentsResult implements P4CommandRunner.ClientResult { private final ClientConfig config; private final String depotPath; private final FilePath localFile; private final byte[] data; private final String charset; public GetFileContentsResult(ClientConfig config, String depotPath, byte[] data, String charset) { this.config = config; this.depotPath = depotPath; this.localFile = null; this.data = data; this.charset = charset == null ? Charset.defaultCharset().name() : charset; } public GetFileContentsResult(ClientConfig config, FilePath localFile, byte[] data, String charset) { this.config = config; this.depotPath = null; this.localFile = localFile; this.data = data; this.charset = charset == null ? Charset.defaultCharset().name() : charset; } @NotNull @Override public ClientConfig getClientConfig() { return config; } public String getDepotPath() { return depotPath; } public byte[] getData() { return data; } @Nullable public String getStringData() throws UnsupportedEncodingException { if (data == null) { return null; } return new String(data, charset); } }
[ "matt@groboclown.net" ]
matt@groboclown.net
b11d3d6d446bd6808b6b4eaa0f49bca8c9d2d8f3
f7df4579a40789b460d9dcea44ba554b02a08453
/Day0409_Object/src/MultiplierTest.java
54ba0041e334f1d2f2082455bc3d4a7971b28cf5
[]
no_license
ser6440/java
c17dd42e9528e3cdd846915ccb8eafe2f1719d5c
6fe01c2feddbb3d98a8114595ceac73eca504cea
refs/heads/master
2020-03-19T04:06:32.421125
2018-06-02T07:21:44
2018-06-02T07:21:44
135,792,944
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
public class MultiplierTest { public static void main(String[] args) { //Multiplier //상태값: 결과를 저장하는 변수: result(정수) //동작(메서드): 출력X, 매개변수로 전달받은 //두 정수를 곱해서 결과를 result에 저장하고, //결과를 반환(return)하는 메서드 multiply()작성 //MultiplierTest main에서 해야할일 //Multiplier 객체 만들고 multiply()실행해보기 Multiplier mul = new Multiplier(); //생성자 호출 new 다음 multiplier()는 객체를 생성하는 문장 int multResult = mul.multiply(3,5); mul.multiply(2.5, 4.5); //같은 기능을 하는 메서드인데 데이터 타입에 따라서 이름을 다르게 쓰는게 헷갈린다. //다른 데이터 타입을 동시에 사용할 수 있게 만들기 위해서 오버로딩을 한다. //메서드 오버로딩을 통해서 다양한 데이터타입을 매개변수로 받도록 선언해 두었기 때문에 쉽게 사용가능하다. } }
[ "bit@DESKTOP-CAR2FCE" ]
bit@DESKTOP-CAR2FCE
ca2770e7d391ba8f08d5193ee4fc4c5dc31c519a
3f22d7ca681b2c717eedc8c5d533cbb756aecdb7
/spring-demo-javaNoXML/src/com/mohit/springdemo/SwimCoach.java
0134c14dd544b69903e2c1c6d801ff9aef710c06
[]
no_license
mickmohit/Mohit_2019_Java_Content
90ce7d2b85f0dd3a2bcecdee5a38e298fbf0143d
014ea1c4071396a386e3acf88e91dd550336ac8a
refs/heads/master
2022-12-20T15:24:27.921992
2019-11-07T09:51:38
2019-11-07T09:51:38
215,511,351
0
0
null
2022-12-16T04:50:52
2019-10-16T09:39:22
Java
UTF-8
Java
false
false
1,562
java
package com.mohit.springdemo; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; public class SwimCoach implements Coach { @Value("${foo.email}") private String email; @Value("${foo.team}") private String team; private FortuneService fortuneService; @Override public String getDailyWorkout() { // TODO Auto-generated method stub return "Practise 100 meter swim for warm up!"; } @Override public String getDailyFortune() { // TODO Auto-generated method stub return fortuneService.getFortune(); } public SwimCoach() { System.out.println("Default Constructor"); } //constructor DI public SwimCoach(FortuneService fortuneService) { this.fortuneService=fortuneService; } /*//setter DI @Autowired public void setFortuneService(FortuneService fortuneService) { this.fortuneService = fortuneService; }*/ //define my init method through Annotation @PostConstruct public void doMyStartUp() { System.out.println("inside of doMyStartUp"); } //define my destroy method through Annotation @PreDestroy public void doMyCleanUp() { System.out.println("inside of doMyCleanUp"); } public String getEmail() { return email; } public String getTeam() { return team; } }
[ "mohit.darmwal@sita.aero" ]
mohit.darmwal@sita.aero
88491248266e0ed57b2ed2c0dc84da1a2fd20954
0d4edfbd462ed72da9d1e2ac4bfef63d40db2990
/base/src/main/java/com/dvc/base/BaseAppCompatActivity.java
246b4f730e5d2a9a59403be2da57e3594123c21c
[]
no_license
dvc890/MyBilibili
1fc7e0a0d5917fb12a7efed8aebfd9030db7ff9f
0483e90e6fbf42905b8aff4cbccbaeb95c733712
refs/heads/master
2020-05-24T22:49:02.383357
2019-11-23T01:14:14
2019-11-23T01:14:14
187,502,297
31
3
null
null
null
null
UTF-8
Java
false
false
5,173
java
package com.dvc.base; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.ImageButton; import butterknife.ButterKnife; import cn.bingoogolapple.swipebacklayout.BGASwipeBackHelper; import dagger.android.support.DaggerAppCompatActivity; public abstract class BaseAppCompatActivity extends DaggerAppCompatActivity implements BGASwipeBackHelper.Delegate { private final String TAG = this.getClass().getSimpleName(); protected BGASwipeBackHelper mSwipeBackHelper; protected boolean existActivityWithAnimation = true; protected Context context; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { initSwipeBackFinish(); super.onCreate(savedInstanceState); context = this; setContentView(getContentViewResID()); } @Override protected void onStart() { super.onStart(); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); } @Override public void setContentView(int layoutResID) { if(layoutResID != 0) { super.setContentView(layoutResID); ButterKnife.bind(this); } } /** * 初始化滑动返回。在 super.onCreate(savedInstanceState) 之前调用该方法 */ private void initSwipeBackFinish() { mSwipeBackHelper = new BGASwipeBackHelper(this, this); // 「必须在 Application 的 onCreate 方法中执行 BGASwipeBackHelper.init 来初始化滑动返回」 // 下面几项可以不配置,这里只是为了讲述接口用法。 // 设置滑动返回是否可用。默认值为 true mSwipeBackHelper.setSwipeBackEnable(true); // 设置是否仅仅跟踪左侧边缘的滑动返回。默认值为 true mSwipeBackHelper.setIsOnlyTrackingLeftEdge(true); // 设置是否是微信滑动返回样式。默认值为 true mSwipeBackHelper.setIsWeChatStyle(true); // 设置阴影资源 id。默认值为 R.drawable.bga_sbl_shadow mSwipeBackHelper.setShadowResId(com.dvc.base.R.drawable.bga_sbl_shadow); // 设置是否显示滑动返回的阴影效果。默认值为 true mSwipeBackHelper.setIsNeedShowShadow(true); // 设置阴影区域的透明度是否根据滑动的距离渐变。默认值为 true mSwipeBackHelper.setIsShadowAlphaGradient(true); // 设置触发释放后自动滑动返回的阈值,默认值为 0.3f mSwipeBackHelper.setSwipeBackThreshold(0.3f); // 设置底部导航条是否悬浮在内容上,默认值为 false mSwipeBackHelper.setIsNavigationBarOverlap(false); } /** * 是否支持滑动返回。这里在父类中默认返回 true 来支持滑动返回,如果某个界面不想支持滑动返回则重写该方法返回 false 即可 * * @return zhichi */ @Override public boolean isSupportSwipeBack() { return true; } /** * 正在滑动返回 * * @param slideOffset 从 0 到 1 */ @Override public void onSwipeBackLayoutSlide(float slideOffset) { } /** * 没达到滑动返回的阈值,取消滑动返回动作,回到默认状态 */ @Override public void onSwipeBackLayoutCancel() { } /** * 滑动返回执行完毕,销毁当前 Activity */ @Override public void onSwipeBackLayoutExecuted() { mSwipeBackHelper.swipeBackward(); } @Override protected void onDestroy() { super.onDestroy(); } // /** // * 带动画的启动activity // */ // public void startActivityWithAnimation(Intent intent) { // startActivity(intent); // overridePendingTransition(com.dvc.base.R.anim.slide_in_right, com.dvc.base.R.anim.slide_out_left); // } // // /** // * 带动画的启动activity // */ // public void startActivityForResultWithAnimation(Intent intent, int requestCode) { // startActivityForResult(intent, requestCode); // overridePendingTransition(com.dvc.base.R.anim.slide_in_right, com.dvc.base.R.anim.slide_out_left); // } @Override public void onBackPressed() { // 正在滑动返回的时候取消返回按钮事件 if (mSwipeBackHelper.isSliding()) { return; } mSwipeBackHelper.backward(); super.onBackPressed(); if (existActivityWithAnimation) { overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right); } } protected void visible(View... views) { for(View view :views) view.setVisibility(View.VISIBLE); } protected void gone(View... views) { for(View view :views) view.setVisibility(View.GONE); } public abstract int getContentViewResID(); /** * 初始化组件 */ protected abstract void initViews(); /** * 数据处理 */ protected abstract void loadDatas(); }
[ "dvc890@139.com" ]
dvc890@139.com
2935c695d3de4c6f287a5d97abcf5ca15f55b901
ecf796983785c4e92a1377b3271b5b1cf66a6495
/Projects/萍水相逢的生活/android/Rong_Cloud_SDK/v4_0_3_Dev/CallKit/src/main/java/io/rong/callkit/util/RTCPhoneStateReceiver.java
33a0a1da3f19f5052539f1bb97bc769854087ce8
[ "MIT" ]
permissive
rongcloud-community/RongCloud_Hackathon_2020
1b56de94b470229242d3680ac46d6a00c649c7d6
d4ef61d24cfed142cd90f7d1d8dcd19fb5cbf015
refs/heads/master
2022-07-27T18:24:19.210225
2020-10-16T01:14:41
2020-10-16T01:14:41
286,389,237
6
129
null
2020-10-16T05:44:11
2020-08-10T05:59:35
JavaScript
UTF-8
Java
false
false
1,567
java
package io.rong.callkit.util; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.telephony.TelephonyManager; import android.text.TextUtils; import io.rong.calllib.RongCallClient; import io.rong.calllib.RongCallSession; import io.rong.common.RLog; public class RTCPhoneStateReceiver extends BroadcastReceiver { private static final String TAG = "RTCPhoneStateReceiver"; // 21以上会回调两次(状态值一样) private static String twice = ""; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (("android.intent.action.PHONE_STATE").equals(action)) { String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE); RLog.i(TAG, "state :" + state + " , twice : " + twice); if (!TextUtils.isEmpty(state) && !twice.equals(state)) { twice = state; if (RongCallClient.getInstance() == null) { return; } RongCallSession session = RongCallClient.getInstance().getCallSession(); if (session != null && (twice.equals(TelephonyManager.EXTRA_STATE_RINGING) || twice.equals(TelephonyManager.EXTRA_STATE_OFFHOOK))) { RongCallClient.getInstance().hangUpCall(); } else { RLog.i(TAG, "onReceive->session = null."); } } } } }
[ "geekonline@126.com" ]
geekonline@126.com
9c80349e826ca615e1279b12d0387ac2c300b7f1
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/XRENDERING-422-10-23-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener_ESTest.java
93277e0963a3556cec2603849f668723f979ebf2
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
/* * This file was automatically generated by EvoSuite * Tue Mar 31 20:45:13 UTC 2020 */ package org.xwiki.rendering.internal.parser.wikimodel; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultXWikiGeneratorListener_ESTest extends DefaultXWikiGeneratorListener_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
1aa256584f1dcf81c00c2ffec4dbff799597e112
f113ad399b9867a8832dc6720f9d1ef6bcd2add5
/springBoot/src/main/java/com/caideli/springBoot/headfirst/state/gumballstatewinner/SoldOutState.java
71491a3ae39eec5ce096eb821a2c1565785e5435
[]
no_license
caideli1/myGeneration
a3d761457d97f126255d804fd6ca5d91c7f08db3
0875cb9508f8269daf966f6148245ae9f20382e2
refs/heads/master
2023-08-03T17:04:17.201122
2022-06-20T02:26:36
2022-06-20T02:26:36
214,383,397
1
0
null
2023-07-22T18:29:13
2019-10-11T08:25:53
Java
UTF-8
Java
false
false
712
java
package com.caideli.springBoot.headfirst.state.gumballstatewinner; public class SoldOutState implements State { GumballMachine gumballMachine; public SoldOutState(GumballMachine gumballMachine) { this.gumballMachine = gumballMachine; } public void insertQuarter() { System.out.println("You can't insert a quarter, the machine is sold out"); } public void ejectQuarter() { System.out.println("You can't eject, you haven't inserted a quarter yet"); } public void turnCrank() { System.out.println("You turned, but there are no gumballs"); } public void dispense() { System.out.println("No gumball dispensed"); } public String toString() { return "sold out"; } }
[ "deri@moneed.net" ]
deri@moneed.net
11233a9f646c159b1f02051fdf4b3b84c5704741
edb52284995497d6e1a425d85e5a1bc8847ba76e
/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/FindFunctionalInterfaceTest.java
64b013d44df73e9f103c0387ff38ea4e2f8783b0
[]
no_license
Elizaveta239/ta
fac6d9f6fd491b13abaf658f5cafbe197567bf53
58e1c3136c48a43bed77034784a0d1412d2d5c50
refs/heads/master
2020-04-10T21:25:39.581838
2015-05-27T18:12:26
2015-05-27T18:12:26
28,911,347
1
0
null
null
null
null
UTF-8
Java
false
false
3,513
java
/* * Copyright 2000-2014 JetBrains s.r.o. * * 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.intellij.codeInsight.daemon.lambda; import com.intellij.JavaTestUtil; import com.intellij.idea.Bombed; import com.intellij.psi.*; import com.intellij.psi.search.searches.FunctionalExpressionSearch; import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.testFramework.LightProjectDescriptor; import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; import org.jetbrains.annotations.NotNull; import java.util.Calendar; import java.util.Collection; public class FindFunctionalInterfaceTest extends LightCodeInsightFixtureTestCase { public void testMethodArgument() throws Exception { myFixture.configureByFile(getTestName(false) + ".java"); final PsiElement elementAtCaret = myFixture.getElementAtCaret(); assertNotNull(elementAtCaret); final PsiClass psiClass = PsiTreeUtil.getParentOfType(elementAtCaret, PsiClass.class, false); assertTrue(psiClass != null && psiClass.isInterface()); final Collection<PsiFunctionalExpression> expressions = FunctionalExpressionSearch.search(psiClass).findAll(); assertTrue(expressions.size() == 1); final PsiFunctionalExpression next = expressions.iterator().next(); assertNotNull(next); assertEquals("() -> {}", next.getText()); } public void testMethodArgumentByTypeParameter() throws Exception { myFixture.configureByFile(getTestName(false) + ".java"); final PsiElement elementAtCaret = myFixture.getElementAtCaret(); assertNotNull(elementAtCaret); final PsiClass psiClass = PsiTreeUtil.getParentOfType(elementAtCaret, PsiClass.class, false); assertTrue(psiClass != null && psiClass.isInterface()); final Collection<PsiFunctionalExpression> expressions = FunctionalExpressionSearch.search(psiClass).findAll(); assertTrue(expressions.size() == 1); final PsiFunctionalExpression next = expressions.iterator().next(); assertNotNull(next); assertEquals("() -> {}", next.getText()); } public void testFieldFromAnonymousClassScope() throws Exception { myFixture.configureByFile(getTestName(false) + ".java"); final PsiElement elementAtCaret = myFixture.getElementAtCaret(); assertNotNull(elementAtCaret); final PsiField field = PsiTreeUtil.getParentOfType(elementAtCaret, PsiField.class, false); assertNotNull(field); final PsiClass aClass = field.getContainingClass(); assertTrue(aClass instanceof PsiAnonymousClass); final Collection<PsiReference> references = ReferencesSearch.search(field).findAll(); assertFalse(references.isEmpty()); assertEquals(1, references.size()); } @Override protected String getBasePath() { return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/daemonCodeAnalyzer/lambda/findUsages/"; } @NotNull @Override protected LightProjectDescriptor getProjectDescriptor() { return JAVA_8; } }
[ "anna.kozlova@jetbrains.com" ]
anna.kozlova@jetbrains.com
1e94923b0770589091ab12cbf891e860ec67fd9f
217e44b1dad361145b400f3c413d12e4342f7413
/jsp_04_02_mvc2_controller_board/src/control/Controller.java
32b94ced13cc78f52e237ff7d326a5a60a4a7411
[]
no_license
s02asy/study
7e5cc299edf2848aeba5a8fa7909fb06bd4b7f5d
55a1a6f9ae3a9bc83702c9679d239bbab7f4ede8
refs/heads/master
2023-08-15T14:15:31.652270
2021-09-06T08:56:55
2021-09-06T08:56:55
403,499,304
0
0
null
null
null
null
UTF-8
Java
false
false
2,569
java
package control; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import command.CommandAction; import command._01_Index; import command._01_write; import command._02_writePro; import command._03_boardList; import command._04_boardInfo; import command._05_answer; import command._06_answerPro; import command._07_update; import command._08_updatePro; import command._09_delete; import command._10_deletePro; @WebServlet("*.do") public class Controller extends HttpServlet { private static final long serialVersionUID = 1L; private Map<String, Object> commandMap = new HashMap<String, Object>(); public void init() throws ServletException { // commandMap = new HashMap<String, Object>(); System.out.println("init()"); commandMap.put("/01_index.do", new _01_Index()); commandMap.put("/_01_write.do", new _01_write()); commandMap.put("/_02_writePro.do", new _02_writePro()); commandMap.put("/_03_boardList.do", new _03_boardList()); commandMap.put("/_04_boardInfo.do", new _04_boardInfo()); commandMap.put("/_05_answer.do", new _05_answer()); commandMap.put("/_06_answerPro.do", new _06_answerPro()); commandMap.put("/_07_update.do", new _07_update()); commandMap.put("/_08_updatePro.do", new _08_updatePro()); commandMap.put("/_09_delete.do", new _09_delete()); commandMap.put("/_10_deletePro.do", new _10_deletePro()); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { reqPro(request, response); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { reqPro(request, response); } protected void reqPro(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String view = ""; CommandAction com = null; try { String command = request.getServletPath(); System.out.println("command : " + command); com = (CommandAction)commandMap.get(command); view = com.requestPro(request, response); }catch(Exception e) { e.printStackTrace(); } request.setAttribute("cont", view); RequestDispatcher dispatcher = request.getRequestDispatcher("/01_index.jsp"); dispatcher.forward(request, response); } }
[ "A@DESKTOP-H0948LR" ]
A@DESKTOP-H0948LR
b244b4a77314d28109155beab20b18ecc394ebb6
9bac6b22d956192ba16d154fca68308c75052cbb
/icmsint-ejb/src/main/java/hk/judiciary/icmsint/model/sysinf/inf/gdsnij2d/VariableDescriptionChineseV10CT.java
d737062a593f7b8faedc29308ab8fb88a6a68dd8
[]
no_license
peterso05168/icmsint
9d4723781a6666cae8b72d42713467614699b66d
79461c4dc34c41b2533587ea3815d6275731a0a8
refs/heads/master
2020-06-25T07:32:54.932397
2017-07-13T10:54:56
2017-07-13T10:54:56
96,960,773
0
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // 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: 2017.05.31 at 05:38:22 AM CST // package hk.judiciary.icmsint.model.sysinf.inf.gdsnij2d; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * SOD - variable description in Chinese * * <p>Java class for VariableDescriptionChinese.V1.0.CT complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="VariableDescriptionChinese.V1.0.CT"&gt; * &lt;simpleContent&gt; * &lt;restriction base="&lt;CCT&gt;Text.CT"&gt; * &lt;/restriction&gt; * &lt;/simpleContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VariableDescriptionChinese.V1.0.CT") public class VariableDescriptionChineseV10CT extends TextCT { }
[ "chiu.cheukman@gmail.com" ]
chiu.cheukman@gmail.com
27ade8b8b9d2551155054b264a25bdc78fa4ce8e
81b8f649b2e92d82a7610281eecf37a70cf57ef1
/Lab1_09_751_Габдуллин_Б/src/com/company/Landlord.java
19c967b877794c41f8e9d60ebc93d39a47157b63
[]
no_license
Bulet007/oodb
e8ecd71be4e7e236be874d3a29348de707cf6797
a81f6cc66adfa9d9efb07b3e7694307bc9c4707e
refs/heads/master
2020-08-01T21:06:17.321485
2019-10-15T19:45:09
2019-10-15T19:45:09
211,117,478
0
0
null
null
null
null
UTF-8
Java
false
false
665
java
package com.company; public class Landlord extends Person{ private Long id; private String position; private String code; public Landlord(String firstName, String lastName, String phoneNumber, String email, String position, String code) { super(firstName, lastName, phoneNumber, email); this.position = position; this.code = code; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } }
[ "you@example.com" ]
you@example.com
f2d83c132113366cbab24d415b806abeeb324dcf
373eb837bf87b7f9d2323b6400c843fe03051a30
/src/main/java/lu/kremi151/_3dttt/util/TextHelper.java
7de636116819279479b37d8d454bc8fccd0d1de2
[ "MIT" ]
permissive
kremi151/3D-Tic-Tac-Toe-for-Sponge
08711695d9e1eee75037d29d54f92c22273ec9f6
043ce8e0628efae02869a08210c9f98387b20ad0
refs/heads/master
2021-01-11T18:06:28.771045
2017-01-20T08:05:01
2017-01-20T08:05:01
79,495,697
0
0
null
null
null
null
UTF-8
Java
false
false
1,073
java
/* * Michel Kremer */ package lu.kremi151._3dttt.util; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.format.TextColor; /** * * @author michm */ public class TextHelper { private static final int lineWidth = 50; public static Text buildTitleLine(Text title, char decor, TextColor decorColor) { int titleLength = title.toPlain().length(); int sideLength = (lineWidth - titleLength) / 2; if (sideLength >= 0) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < sideLength; i++) { sb.append(decor); } return Text.join(Text.of(decorColor, sb.toString()), title, Text.of(decorColor, sb.toString())); } else { return title; } } public static Text buildEmptyTitleLine(char decor, TextColor decorColor) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < lineWidth; i++) { sb.append(decor); } return Text.of(decorColor, sb.toString()); } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
369b28f1fffa3e0e58abc56c738cd4683cdbdd5d
b1473679b84519ff2be56bc8fa5b5c168603ece7
/driver-service/src/main/java/vn/com/omart/driver/entity/CarType.java
935f16d3b0ea08e0d5cccac3e7594d64ca3d87a8
[]
no_license
hxhits/omvnok
64540effc1172eeadf8331592619454353994db6
661ec6d3606bb108a73af7e0f15cd443b9054dee
refs/heads/master
2020-03-28T03:57:56.562736
2018-09-06T14:26:54
2018-09-06T14:26:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,150
java
package vn.com.omart.driver.entity; import java.io.Serializable; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import org.springframework.util.comparator.BooleanComparator; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonView; import vn.com.omart.driver.jsonview.BookCarView; import vn.com.omart.driver.jsonview.InitialView; @Entity @Table(name = "omart_driver_car_type") public class CarType implements Serializable { private static final long serialVersionUID = -8949831185350955932L; @Id @Column(name = "id", columnDefinition = "int") @GeneratedValue(strategy = GenerationType.IDENTITY) @JsonView({ InitialView.OveralView.class,BookCarView.OveralView.class }) private Long id; @Column(name = "name", columnDefinition = "varchar") @JsonView({ InitialView.OveralView.class, }) private String name; @Column(name = "name_en", columnDefinition = "varchar") @JsonView({ InitialView.OveralView.class }) private String nameEn; @Column(name = "image", columnDefinition = "text") @JsonView({ InitialView.DetailView.class }) private String image; @Column(name = "order", columnDefinition = "int") @JsonView({ InitialView.DetailView.class }) private Long order; @Column(name = "unit_price", columnDefinition = "int") @JsonView({ InitialView.OveralView.class }) private Long unitPrice; @Column(name = "unit_price_2km", columnDefinition = "int") @JsonView({ InitialView.OveralView.class }) private Long unitPrice2Km; @Column(name = "keywords", columnDefinition = "varchar") @JsonView({ InitialView.DetailView.class }) private String keywords; @OneToMany(mappedBy = "carType", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = false) List<DriverFollow> driverFollows; @OneToMany(mappedBy = "carType", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = false) List<DriverLocation> driverLocations; @OneToMany(mappedBy = "carType", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = false) List<BookCar> bookCars; @OneToMany(mappedBy = "carType", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = false) private List<DriverInfo> driverInfos; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getNameEn() { return nameEn; } public void setNameEn(String nameEn) { this.nameEn = nameEn; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public Long getOrder() { return order; } public void setOrder(Long order) { this.order = order; } public Long getUnitPrice() { return unitPrice; } public void setUnitPrice(Long unitPrice) { this.unitPrice = unitPrice; } public Long getUnitPrice2Km() { return unitPrice2Km; } public void setUnitPrice2Km(Long unitPrice2Km) { this.unitPrice2Km = unitPrice2Km; } public String getKeywords() { return keywords; } public void setKeywords(String keywords) { this.keywords = keywords; } public List<DriverFollow> getDriverFollows() { return driverFollows; } public void setDriverFollows(List<DriverFollow> driverFollows) { this.driverFollows = driverFollows; } public List<DriverLocation> getDriverLocations() { return driverLocations; } public void setDriverLocations(List<DriverLocation> driverLocations) { this.driverLocations = driverLocations; } public List<BookCar> getBookCars() { return bookCars; } public void setBookCars(List<BookCar> bookCars) { this.bookCars = bookCars; } public List<DriverInfo> getDriverInfos() { return driverInfos; } public void setDriverInfos(List<DriverInfo> driverInfos) { this.driverInfos = driverInfos; } }
[ "huonghx@omartvietnam.com" ]
huonghx@omartvietnam.com
fc974cf6de804903e7067c8331b0caf1faa6f04f
dbd405eed0f4a621d2ebcf5d8a879aaee69136e8
/main/social-refs/src/main/java/org/osforce/connect/task/team/MemberApproveEmailTask.java
42bdef0ff2e74bb7a8f356a33f80020fcd7bb2ec
[]
no_license
shengang1978/AA
a39fabd54793d0c77a64ad94d8e3dda3f0cd6951
d7b98b8998d33b48f60514457a873219776d9f38
refs/heads/master
2022-12-24T02:42:04.489183
2021-04-28T03:26:09
2021-04-28T03:26:09
33,310,666
0
1
null
2022-12-16T02:29:57
2015-04-02T13:36:05
Java
UTF-8
Java
false
false
1,997
java
package org.osforce.connect.task.team; import java.util.Map; import org.osforce.connect.entity.team.TeamMember; import org.osforce.connect.service.team.MemberService; import org.osforce.spring4me.task.AbstractEmailTask; import org.osforce.spring4me.task.annotation.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; import freemarker.template.Configuration; /** * * @author gavin * @since 1.0.2 * @create May 5, 2011 - 11:22:57 AM * <a href="http://www.opensourceforce.org">开源力量</a> */ @Task public class MemberApproveEmailTask extends AbstractEmailTask { private static final String MEMBER_APPROVE_SUBJECT = "email/member_approve_subject.ftl"; private static final String MEMBER_APPROVE_CONTENT = "email/member_approve_content.ftl"; private Configuration configuration; private MemberService memberService; public MemberApproveEmailTask() { } @Autowired public void setConfiguration(Configuration configuration) { this.configuration = configuration; } @Autowired public void setMemberService(MemberService memberService) { this.memberService = memberService; } @Override protected void prepareMessage(MimeMessageHelper helper, Map<Object, Object> context) throws Exception { Long memberId = (Long) context.get("memberId"); TeamMember member = memberService.getMember(memberId); context.put("member", member); //context.put("site", member.getProject().getCategory().getSite()); helper.addTo(member.getUser().getEmail(), member.getUser().getNickname()); // String subject = FreeMarkerTemplateUtils.processTemplateIntoString( configuration.getTemplate(MEMBER_APPROVE_SUBJECT), context); String content = FreeMarkerTemplateUtils.processTemplateIntoString( configuration.getTemplate(MEMBER_APPROVE_CONTENT), context); helper.setSubject(subject); helper.setText(content, true); } }
[ "shengang1978@hotmail.com" ]
shengang1978@hotmail.com
a49485855825203796e1a1ef5c2f977248283ad6
995f73d30450a6dce6bc7145d89344b4ad6e0622
/Mate20-9.0/src/main/java/com/android/systemui/shared/system/RotationWatcher.java
2e10821028c8b2dafd098badd500e01388c9095f
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
package com.android.systemui.shared.system; import android.content.Context; import android.os.RemoteException; import android.util.Log; import android.view.IRotationWatcher; import android.view.WindowManagerGlobal; public abstract class RotationWatcher { private static final String TAG = "RotationWatcher"; private final Context mContext; private boolean mIsWatching = false; private final IRotationWatcher mWatcher = new IRotationWatcher.Stub() { public void onRotationChanged(int rotation) { RotationWatcher.this.onRotationChanged(rotation); } }; /* access modifiers changed from: protected */ public abstract void onRotationChanged(int i); public RotationWatcher(Context context) { this.mContext = context; } public void enable() { if (!this.mIsWatching) { try { WindowManagerGlobal.getWindowManagerService().watchRotation(this.mWatcher, this.mContext.getDisplay().getDisplayId()); this.mIsWatching = true; } catch (RemoteException e) { Log.w(TAG, "Failed to set rotation watcher", e); } } } public void disable() { if (this.mIsWatching) { try { WindowManagerGlobal.getWindowManagerService().removeRotationWatcher(this.mWatcher); this.mIsWatching = false; } catch (RemoteException e) { Log.w(TAG, "Failed to remove rotation watcher", e); } } } }
[ "dstmath@163.com" ]
dstmath@163.com
3b64a5be0975abbe258e59cdeac080b1eae83ba8
eadbd66326595610715448345387b9f6549c8359
/dmit2015-chinook-exercises-swu/src/test/java/chinook/data/EmployeeRepositoryTest.java
857e75b334628530762ba7f55db2e27f2f9ae850
[]
no_license
swunait/dmit2015-fall2017-exercises-repo
0b2750efe58eadc3b28d6b8eb691e97ff23c81a1
00159d3c1957c6a6198c3b7a5d42286097a92261
refs/heads/master
2021-08-23T22:19:31.033159
2017-12-06T21:03:42
2017-12-06T21:03:42
103,452,973
0
3
null
null
null
null
UTF-8
Java
false
false
1,430
java
package chinook.data; import static org.junit.Assert.*; import java.util.List; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import chinook.model.Employee; import chinook.util.Resources; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class EmployeeRepositoryTest { @Deployment public static Archive<?> createTestArchive() { return ShrinkWrap.create(WebArchive.class, "test.war") .addPackage("chinook.model") .addClasses(EmployeeRepository.class, AbstractJpaRepository.class, Resources.class) .addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") // Deploy our test datasource .addAsWebInfResource("test-ds.xml"); } @Inject private EmployeeRepository employeeRepository; @Test public void shouldFindAll() { List<Employee> employees = employeeRepository.findAll(); System.out.println("Found " + employees.size() + " employees."); assertEquals(8, employees.size()); } }
[ "swu@nait.ca" ]
swu@nait.ca
b4dcc4ecb0ad1d0f226ff2de3d714f354c57387d
fdf0ae1822e66fe01b2ef791e04f7ca0b9a01303
/src/main/java/ms/html/IHTMLObjectElement5.java
7abad80117299cc2a82d5e275a2e1be7cd181571
[]
no_license
wangguofeng1923/java-ie-webdriver
7da41509aa858fcd046630f6833d50b7c6cde756
d0f3cb8acf9be10220c4b85c526486aeb67b9b4f
refs/heads/master
2021-12-04T18:19:08.251841
2013-02-10T16:26:54
2013-02-10T16:26:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package ms.html ; import com4j.*; @IID("{305104B5-98B5-11CF-BB82-00AA00BDCE0B}") public interface IHTMLObjectElement5 extends Com4jObject { // Methods: /** * <p> * Setter method for the COM property "object" * </p> * @param p Mandatory java.lang.String parameter. */ @DISPID(-2147415079) //= 0x80010bd9. The runtime will prefer the VTID if present @VTID(7) void object( java.lang.String p); /** * <p> * Getter method for the COM property "object" * </p> * @return Returns a value of type java.lang.String */ @DISPID(-2147415079) //= 0x80010bd9. The runtime will prefer the VTID if present @VTID(8) java.lang.String object(); // Properties: }
[ "schneidh@gmail.com" ]
schneidh@gmail.com
aef378824fd544d08814d9fa0cf2d37d7999d61e
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/checkstyle_cluster/2863/src_172.java
744e6b4dc2d93cbc76d3b444b4b13c710e2d75d2
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,183
java
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2007 Oliver Burn // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.checks.header; import com.puppycrawl.tools.checkstyle.api.DetailAST; /** * Checks the header of the source against a header file that contains a * {@link java.util.regex.Pattern regular expression} * for each line of the source header. * * @author Lars K�hne * @author o_sukhodolsky */ public class RegexpHeaderCheck extends AbstractHeaderCheck { /** * A HeaderViolationMonitor that is used when running a Check, * as a subcomponents of TreeWalker. */ private final class CheckViolationMonitor implements HeaderViolationMonitor { /** * {@inheritDoc} */ public void reportHeaderMismatch(int aLineNo, String aHeaderLine) { log(aLineNo, "header.mismatch", aHeaderLine); } /** * {@inheritDoc} */ public void reportHeaderMissing() { log(1, "header.missing"); } } /** A delegate for the actual checking functionality. */ private RegexpHeaderChecker mRegexpHeaderChecker; /** * Provides typesafe access to the subclass specific HeaderInfo. * * @return the result of {@link #createHeaderInfo()} */ protected RegexpHeaderInfo getRegexpHeaderInfo() { return (RegexpHeaderInfo) getHeaderInfo(); } /** * Set the lines numbers to repeat in the header check. * @param aList comma separated list of line numbers to repeat in header. */ public void setMultiLines(int[] aList) { getRegexpHeaderInfo().setMultiLines(aList); } /** * @see com.puppycrawl.tools.checkstyle.api.Check#init() */ public void init() { super.init(); mRegexpHeaderChecker = new RegexpHeaderChecker( getRegexpHeaderInfo(), new CheckViolationMonitor()); } /** {@inheritDoc} */ public void beginTree(DetailAST aRootAST) { final String[] lines = getLines(); mRegexpHeaderChecker.checkLines(lines); } /** {@inheritDoc} */ protected HeaderInfo createHeaderInfo() { return new RegexpHeaderInfo(); } }
[ "375833274@qq.com" ]
375833274@qq.com
19afff11051e73e9c6b41959f7bed123287eae51
56d1c5242e970ca0d257801d4e627e2ea14c8aeb
/src/com/csms/leetcode/number/n200/n280/Leetcode290.java
a104f17db0aa844c90da8bea44b17043f3efd016
[]
no_license
dai-zi/leetcode
e002b41f51f1dbd5c960e79624e8ce14ac765802
37747c2272f0fb7184b0e83f052c3943c066abb7
refs/heads/master
2022-12-14T11:20:07.816922
2020-07-24T03:37:51
2020-07-24T03:37:51
282,111,073
0
0
null
null
null
null
UTF-8
Java
false
false
1,012
java
package com.csms.leetcode.number.n200.n280; import java.util.HashMap; import java.util.Map; //单词规律 //简单 public class Leetcode290 { public boolean wordPattern(String pattern, String str) { String[] s = str.split(" "); //以空格分隔str if(s.length != pattern.length()) return false; //如果没有全部成对的映射则返回false Map<Character, String> map = new HashMap<>(); //存放映射 for(int i = 0; i < pattern.length(); i++){ if(!map.containsKey(pattern.charAt(i))){ //1. 没有映射时执行 if(map.containsValue(s[i])) return false; //2. 没有映射的情况下s[i]已被使用,则不匹配返回false map.put(pattern.charAt(i), s[i]); //3. 构建映射 }else{ if(!map.get(pattern.charAt(i)).equals(s[i])) return false; //当前字符串与映射不匹配,返回false } } return true; } public static void main(String[] args) { } }
[ "liuxiaotongdaizi@sina.com" ]
liuxiaotongdaizi@sina.com
513f26199d8920fa3b4fe350cb7f313b8059344d
ef36a37da31eacc83cb0a51703f09baa338e15f5
/src/cn/code/source/org/omg/PortableServer/ServantActivatorOperations.java
0483b7252d0f090b6d96dce92650b9e24cb2eec6
[]
no_license
xinput123/javaSourceLearn
a2670349cb4804ed87b3485e7eb12426384da374
82c3ec4e8cd410981f7914f18e69e632e46470d2
refs/heads/master
2022-05-25T05:33:49.799826
2020-05-03T10:36:16
2020-05-03T10:36:16
260,882,869
0
0
null
null
null
null
UTF-8
Java
false
false
2,700
java
package org.omg.PortableServer; /** * org/omg/PortableServer/ServantActivatorOperations.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from /Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u162/10278/corba/src/share/classes/org/omg/PortableServer/poa.idl * Tuesday, December 19, 2017 5:35:14 PM PST */ /** * When the POA has the RETAIN policy it uses servant * managers that are ServantActivators. */ public interface ServantActivatorOperations extends org.omg.PortableServer.ServantManagerOperations { /** * This operation is invoked by the POA whenever the * POA receives a request for an object that is not * currently active, assuming the POA has the * USE_SERVANT_MANAGER and RETAIN policies. * @param oid object Id associated with the object on * the request was made. * @param adapter object reference for the POA in which * the object is being activated. * @return Servant corresponding to oid is created or * located by the user supplied servant manager. * @exception ForwardRequest to indicate to the ORB * that it is responsible for delivering * the current request and subsequent * requests to the object denoted in the * forward_reference member of the exception. */ org.omg.PortableServer.Servant incarnate (byte[] oid, org.omg.PortableServer.POA adapter) throws org.omg.PortableServer.ForwardRequest; /** * This operation is invoked whenever a servant for * an object is deactivated, assuming the POA has * the USE_SERVANT_MANAGER and RETAIN policies. * @param oid object Id associated with the object * being deactivated. * @param adapter object reference for the POA in which * the object was active. * @param serv contains reference to the servant * associated with the object being deactivated. * @param cleanup_in_progress if TRUE indicates that * destroy or deactivate is called with * etherealize_objects param of TRUE. FALSE * indicates that etherealize was called due to * other reasons. * @param remaining_activations indicates whether the * Servant Manager can destroy a servant. If * set to TRUE, the Servant Manager should wait * until all invocations in progress have * completed. */ void etherealize (byte[] oid, org.omg.PortableServer.POA adapter, org.omg.PortableServer.Servant serv, boolean cleanup_in_progress, boolean remaining_activations); } // interface ServantActivatorOperations
[ "yuan_lai1234@163.com" ]
yuan_lai1234@163.com
12ae4577a33bbc359fd953956e2f271abc866ea5
05948ca1cd3c0d2bcd65056d691c4d1b2e795318
/classes/com/alibaba/sdk/android/session/impl/CredentialManager$2.java
684b008f418318938bb88e6145014324f6f3cd5b
[]
no_license
waterwitness/xiaoenai
356a1163f422c882cabe57c0cd3427e0600ff136
d24c4d457d6ea9281a8a789bc3a29905b06002c6
refs/heads/master
2021-01-10T22:14:17.059983
2016-10-08T08:39:11
2016-10-08T08:39:11
70,317,042
0
8
null
null
null
null
UTF-8
Java
false
false
1,800
java
package com.alibaba.sdk.android.session.impl; import com.alibaba.sdk.android.session.model.InternalSession; import com.alibaba.sdk.android.session.model.RefreshToken; import com.alibaba.sdk.android.session.model.Session; import com.alibaba.sdk.android.session.model.User; import java.util.Map; class CredentialManager$2 implements Session { CredentialManager$2(CredentialManager paramCredentialManager) {} public String getAuthorizationCode() { return CredentialManager.access$500(this.this$0); } public Long getLoginTime() { if (CredentialManager.access$300(this.this$0) == null) { return null; } return CredentialManager.access$300(this.this$0).createTime; } public Map<String, Object> getOtherInfo() { if (CredentialManager.access$400(this.this$0) == null) { return null; } return CredentialManager.access$400(this.this$0).otherInfo; } public User getUser() { if (!isLogin().booleanValue()) {} while (CredentialManager.access$400(this.this$0) == null) { return null; } return CredentialManager.access$400(this.this$0).user; } public String getUserId() { if (!isLogin().booleanValue()) {} while ((CredentialManager.access$400(this.this$0) == null) || (CredentialManager.access$400(this.this$0).user == null)) { return null; } return CredentialManager.access$400(this.this$0).user.id; } public Boolean isLogin() { if (!this.this$0.isRefreshTokenExpired()) {} for (boolean bool = true;; bool = false) { return Boolean.valueOf(bool); } } } /* Location: E:\apk\xiaoenai2\classes-dex2jar.jar!\com\alibaba\sdk\android\session\impl\CredentialManager$2.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
3520404af21306e6608b7613b90147e9b151badb
7a456c3014778ff490083657373d4073da7c4924
/oulipo-streams/src/test/java/org/oulipo/streams/opcodes/ApplyOverlayOpTest.java
1fc5136af44397dd8e61d5ba42097532a1f74b1f
[ "Apache-2.0" ]
permissive
leinadlime/oulipo
af88bd3e77a9a7ca465ea337bea5caf1f7affc18
e9c4eb5dbfa21c61e5f7bbbbaee0f4761b4788ea
refs/heads/master
2020-03-28T10:51:28.791805
2018-07-10T16:14:35
2018-07-10T16:14:35
148,152,506
1
0
Apache-2.0
2018-09-10T12:34:57
2018-09-10T12:34:57
null
UTF-8
Java
false
false
3,639
java
/******************************************************************************* * OulipoMachine 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. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. *******************************************************************************/ package org.oulipo.streams.opcodes; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import org.junit.Test; import org.oulipo.streams.VariantSpan; import com.google.common.collect.Sets; public class ApplyOverlayOpTest { @Test public void encode() throws Exception { ApplyOverlayOp op = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.APPLY_OVERLAY, dis.read()); assertEquals(1, dis.readLong()); assertEquals(100, dis.readLong()); assertEquals(2, dis.readInt()); assertEquals(1, dis.readInt()); assertEquals(10, dis.readInt()); } @Test public void encodeDecode() throws Exception { ApplyOverlayOp op = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); byte[] data = op.encode(); DataInputStream dis = new DataInputStream(new ByteArrayInputStream(data)); assertEquals(Op.APPLY_OVERLAY, dis.readByte()); ApplyOverlayOp decoded = new ApplyOverlayOp(dis); assertEquals(op, decoded); } @Test public void equalsLinkTypesFalse() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); } @Test public void equalsTrue() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertTrue(op1.equals(op2)); assertTrue(op2.equals(op1)); } @Test public void equalsVariantsFalse() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(2, 100), Sets.newHashSet(1, 10)); assertFalse(op1.equals(op2)); assertFalse(op2.equals(op1)); } @Test public void hashTrue() throws Exception { ApplyOverlayOp op1 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); ApplyOverlayOp op2 = new ApplyOverlayOp(new VariantSpan(1, 100), Sets.newHashSet(1, 10)); assertEquals(op1.hashCode(), op2.hashCode()); ; } @Test(expected = IllegalArgumentException.class) public void nullLinkTypes() throws Exception { new ApplyOverlayOp(new VariantSpan(1, 100), null); } @Test(expected = IllegalArgumentException.class) public void nullVariantSpan() throws Exception { new ApplyOverlayOp(null, Sets.newHashSet(1, 10)); } }
[ "shane.isbell@gmail.com" ]
shane.isbell@gmail.com
f17a8d1fa35deb2f2989bd6313734f55b0a25ce1
5e12a12323d3401578ea2a7e4e101503d700b397
/tags/jtester-1.1.8/test/src/main/java/org/jtester/module/dbfit/AutoFindDbFitTest.java
55f05316b90b7fb8fb60591540b2dd4dd7dea0b5
[]
no_license
xiangyong/jtester
369d4b689e4e66f25c7217242b835d1965da3ef8
5f4b3948cd8d43d3e8fea9bc34e5bd7667f4def9
refs/heads/master
2021-01-18T21:02:05.493497
2013-10-08T01:48:18
2013-10-08T01:48:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,732
java
package org.jtester.module.dbfit; import java.lang.reflect.Method; import org.jtester.module.dbfit.AutoFindDbFit; import org.jtester.testng.JTester; import org.testng.annotations.Test; @Test(groups = "jtester") public class AutoFindDbFitTest extends JTester { @Test public void testAutoFindMethodWhen_HasDBFit_FileExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test1"); String[] whens = AutoFindDbFit.autoFindMethodWhen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(1).isEqualTo(new String[] { "data/ForAutoFindDbFit/test1.when.wiki" }); } @Test public void testAutoFindMethodThen_HasDbFit_FileExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test1"); String[] whens = AutoFindDbFit.autoFindMethodThen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(1).isEqualTo(new String[] { "data/ForAutoFindDbFit/test1.then.wiki" }); } @Test public void testAutoFindMethodWhen_NoDBFit_FileUnExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test2"); String[] whens = AutoFindDbFit.autoFindMethodWhen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(1).isEqualTo(new String[] { "data/ForAutoFindDbFit/test2.when.wiki" }); } @Test public void testAutoFindMethodThen_NoDBFit_FileExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test2"); String[] whens = AutoFindDbFit.autoFindMethodThen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(1).isEqualTo(new String[] { "data/ForAutoFindDbFit/test2.then.wiki" }); } @Test public void testAutoFindMethodWhen_HasDBFit_FileUnExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test3"); String[] whens = AutoFindDbFit.autoFindMethodWhen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(0); } @Test public void testAutoFindMethodThen_HasDBFit_FileUnExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test3"); String[] thens = AutoFindDbFit.autoFindMethodThen(ForAutoFindDbFit.class, m); want.array(thens).sizeEq(0); } @Test public void testAutoFindMethodWhen_NoDBFit_FileUnExist2() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test4"); String[] thens = AutoFindDbFit.autoFindMethodWhen(ForAutoFindDbFit.class, m); want.array(thens).sizeEq(0); } @Test public void testAutoFindMethodThen_NoDBFit_FileUnExist() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test4"); String[] thens = AutoFindDbFit.autoFindMethodThen(ForAutoFindDbFit.class, m); want.array(thens).sizeEq(0); } @Test public void testAutoFindMethodWhen_HasDBFit_FileExist_AndDbFitWhenHasValue() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test5"); String[] whens = AutoFindDbFit.autoFindMethodWhen(ForAutoFindDbFit.class, m); want.array(whens).sizeEq(3) .isEqualTo(new String[] { "1.when.wiki", "2.when.wiki", "data/ForAutoFindDbFit/test5.when.wiki" }); } @Test public void testAutoFindMethodThen_HasDBFit_FileExist_AndDbFitThenHasValue() throws Exception { Method m = ForAutoFindDbFit.class.getMethod("test5"); String[] thens = AutoFindDbFit.autoFindMethodThen(ForAutoFindDbFit.class, m); want.array(thens).sizeEq(2).isEqualTo(new String[] { "1.then.wiki", "data/ForAutoFindDbFit/test5.then.wiki" }); } @Test public void testAutoFindClassWhen() { String[] wikis = AutoFindDbFit.autoFindClassWhen(ForAutoFindDbFit.class); want.array(wikis).sizeEq(2); } @Test public void testAutoFindClassWhen_UnAutoFind() { String[] wikis = AutoFindDbFit.autoFindClassWhen(ForAutoFindDbFit2.class); want.array(wikis).sizeEq(1); } }
[ "darui.wu@9ac485da-fb45-aad8-5227-9c360d3c5fad" ]
darui.wu@9ac485da-fb45-aad8-5227-9c360d3c5fad
33b474b2b95c81d495c5d1e19bf00da37786ac86
f9cd17921a0c820e2235f1cd4ee651a59b82189b
/src/net/cbtltd/server/rapa/FormatHandlerFactory.java
dbfd41e77e7a9f78ad6a5ecec32c1dd6b46d1059
[]
no_license
bookingnet/booking
6042228c12fd15883000f4b6e3ba943015b604ad
0047b1ade78543819bcccdace74e872ffcd99c7a
refs/heads/master
2021-01-10T14:19:29.183022
2015-12-07T21:51:06
2015-12-07T21:51:06
44,936,675
2
1
null
null
null
null
UTF-8
Java
false
false
521
java
package net.cbtltd.server.rapa; import net.cbtltd.server.rapa.formatter.FormatHandler; import net.cbtltd.server.rapa.formatter.XMLHandler; public class FormatHandlerFactory { public FormatHandler create(String format) { FormatHandler handler = null; if (format.equalsIgnoreCase("xml")) { handler = new XMLHandler(); } // else if (format.equalsIgnoreCase("json")) { // handler = new JSonHandler(); // } else { throw new RuntimeException("Unsupported Format " + format); } return handler; } }
[ "bookingnet@mail.ru" ]
bookingnet@mail.ru
2d9a379dfc6150fd74e08b6920275487690089df
6148c05cb07f772bf3d46ed83087a4da0964d79f
/QrCodeScan/src/main/java/cn/appoa/qrcodescan/decoding/CaptureActivityHandler.java
1879777e0432c66e2f5539f7f41ece2ecff8ea59
[]
no_license
lijiazhen1201/AfDemo
c19a12aec465874552f43351fe784c61926ed5b6
6c59fbb850413d8a6527fa9d814a93a421f00a1d
refs/heads/master
2021-07-11T12:11:52.192994
2020-07-27T06:28:56
2020-07-27T06:28:56
161,132,778
10
2
null
null
null
null
UTF-8
Java
false
false
6,394
java
/* * Copyright (C) 2008 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package cn.appoa.qrcodescan.decoding; import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import com.google.zxing.BarcodeFormat; import com.google.zxing.Result; import java.util.Vector; import cn.appoa.qrcodescan.R; import cn.appoa.qrcodescan.camera.CameraManager; import cn.appoa.qrcodescan.ui.ZmQRCodeFragment; import cn.appoa.qrcodescan.view.ViewfinderResultPointCallback; /** * This class handles all the messaging which comprises the state machine for * capture. */ public final class CaptureActivityHandler extends Handler { private static final String TAG = CaptureActivityHandler.class.getSimpleName(); private final ZmQRCodeFragment activity; private final DecodeThread decodeThread; private State state; private enum State { PREVIEW, SUCCESS, DONE } public CaptureActivityHandler(ZmQRCodeFragment activity, Vector<BarcodeFormat> decodeFormats, String characterSet) { this.activity = activity; decodeThread = new DecodeThread(activity, decodeFormats, characterSet, new ViewfinderResultPointCallback(activity.getViewfinderView())); decodeThread.start(); state = State.SUCCESS; // Start ourselves capturing previews and decoding. CameraManager.get().startPreview(); restartPreviewAndDecode(); } @Override public void handleMessage(Message message) { if (message.what == R.id.auto_focus) { // Log.d(TAG, "Got auto-focus message"); // When one auto focus pass finishes, start another. This is the // closest thing to // continuous AF. It does seem to hunt a bit, but I'm not sure what // else to do. if (state == State.PREVIEW) { CameraManager.get().requestAutoFocus(this, R.id.auto_focus); } } if (message.what == R.id.restart_preview) { Log.d(TAG, "Got restart preview message"); restartPreviewAndDecode(); } if (message.what == R.id.decode_succeeded) { Log.d(TAG, "Got decode succeeded message"); state = State.SUCCESS; Bundle bundle = message.getData(); /***********************************************************************/ Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);// ���ñ����߳� activity.handleDecode((Result) message.obj, barcode);// ���ؽ��? // /***********************************************************************/ } if (message.what == R.id.decode_failed) { // We're decoding as fast as possible, so when one decode fails, // start another. state = State.PREVIEW; CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); } if (message.what == R.id.return_scan_result) { Log.d(TAG, "Got return scan result message"); // activity.setResult(Activity.RESULT_OK, (Intent) message.obj); // activity.finish(); } if (message.what == R.id.launch_product_query) { Log.d(TAG, "Got product query message"); String url = (String) message.obj; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); activity.startActivity(intent); } // switch (message.what) { // case R.id.auto_focus: // // Log.d(TAG, "Got auto-focus message"); // // When one auto focus pass finishes, start another. This is the // // closest thing to // // continuous AF. It does seem to hunt a bit, but I'm not sure what // // else to do. // if (state == State.PREVIEW) { // CameraManager.get().requestAutoFocus(this, R.id.auto_focus); // } // break; // case R.id.restart_preview: // Log.d(TAG, "Got restart preview message"); // restartPreviewAndDecode(); // break; // case R.id.decode_succeeded: // Log.d(TAG, "Got decode succeeded message"); // state = State.SUCCESS; // Bundle bundle = message.getData(); // // /***********************************************************************/ // Bitmap barcode = bundle == null ? null : (Bitmap) bundle.getParcelable(DecodeThread.BARCODE_BITMAP);// ���ñ����߳� // // activity.handleDecode((Result) message.obj, barcode);// ���ؽ��? // // /***********************************************************************/ // break; // case R.id.decode_failed: // // We're decoding as fast as possible, so when one decode fails, // // start another. // state = State.PREVIEW; // CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); // break; // case R.id.return_scan_result: // Log.d(TAG, "Got return scan result message"); // // activity.setResult(Activity.RESULT_OK, (Intent) message.obj); // // activity.finish(); // break; // case R.id.launch_product_query: // Log.d(TAG, "Got product query message"); // String url = (String) message.obj; // Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); // intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); // activity.startActivity(intent); // break; // } } public void quitSynchronously() { state = State.DONE; CameraManager.get().stopPreview(); Message quit = Message.obtain(decodeThread.getHandler(), R.id.quit); quit.sendToTarget(); try { decodeThread.join(); } catch (InterruptedException e) { // continue } // Be absolutely sure we don't send any queued up messages removeMessages(R.id.decode_succeeded); removeMessages(R.id.decode_failed); } public void restartPreviewAndDecode() { if (state == State.SUCCESS) { state = State.PREVIEW; CameraManager.get().requestPreviewFrame(decodeThread.getHandler(), R.id.decode); CameraManager.get().requestAutoFocus(this, R.id.auto_focus); activity.drawViewfinder(); } } }
[ "949393653@qq.com" ]
949393653@qq.com
4afd43316fd94b3ac16d2f28b70cde5724e9463c
b726affeea30012e7ebdff8f271cf5c0fbffbb76
/spring-restdocs/src/test/java/br/com/leonardoferreira/poc/restdocs/extension/DocumentSpecificationExtension.java
3f5c0fab73bf967291e635bd58fb7591fb6c2279
[]
no_license
LeonardoFerreiraa/poc
3114ef0a78240f3b74eab8198f266ac63e026c17
19f6224e155087f18545b8cf5364ad2fadd52c09
refs/heads/master
2023-04-12T09:14:38.601232
2022-07-31T21:09:53
2022-07-31T21:09:53
115,114,577
16
11
null
2022-10-19T06:01:44
2017-12-22T12:44:57
Java
UTF-8
Java
false
false
2,250
java
package br.com.leonardoferreira.poc.restdocs.extension; import io.restassured.builder.RequestSpecBuilder; import io.restassured.specification.RequestSpecification; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ParameterContext; import org.junit.jupiter.api.extension.ParameterResolutionException; import org.junit.jupiter.api.extension.ParameterResolver; import org.springframework.restdocs.RestDocumentationContextProvider; import org.springframework.restdocs.RestDocumentationExtension; import org.springframework.restdocs.operation.preprocess.Preprocessors; import org.springframework.restdocs.restassured3.RestAssuredRestDocumentation; public class DocumentSpecificationExtension extends RestDocumentationExtension implements ParameterResolver { @Override public boolean supportsParameter(final ParameterContext parameterContext, final ExtensionContext extensionContext) throws ParameterResolutionException { return parameterContext.getParameter().getType() == RequestSpecification.class && parameterContext.getParameter().isAnnotationPresent(DocumentSpecification.class); } @Override public Object resolveParameter(final ParameterContext parameterContext, final ExtensionContext extensionContext) throws ParameterResolutionException { final RestDocumentationContextProvider restDocumentation = (RestDocumentationContextProvider) super.resolveParameter(parameterContext, extensionContext); return new RequestSpecBuilder() .addFilter(RestAssuredRestDocumentation.documentationConfiguration(restDocumentation) .operationPreprocessors() .withRequestDefaults( Preprocessors.prettyPrint(), Preprocessors.modifyUris().scheme("http").host("poc-spring-rest-docs").removePort()) .withResponseDefaults( Preprocessors.prettyPrint(), Preprocessors.modifyUris().scheme("http").host("poc-spring-rest-docs").removePort()) ).build(); } }
[ "mail@leonardoferreira.com.br" ]
mail@leonardoferreira.com.br
b4ec5444723d13910d499ced166b0a7aa0379adc
eab922fe910874239ba9e70004477151fc1edd6f
/_src/pfbg-allinone/src/main/java/com/packtpub/techbuzz/controllers/RequestContextController.java
e2cf806856b72484d4b63bf16cc7ab191d76a32f
[ "Apache-2.0" ]
permissive
paullewallencom/primefaces-978-1-7832-8069-8
589dfe373f0bc2ac8b4a72779a37a4f28d89f570
0b57048b06ae49e332bcf1f10a5f063478100551
refs/heads/main
2023-02-04T18:29:50.960154
2020-12-28T18:21:58
2020-12-28T18:21:58
319,425,263
0
0
null
null
null
null
UTF-8
Java
false
false
940
java
package com.packtpub.techbuzz.controllers; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; import org.primefaces.context.RequestContext; import com.packtpub.techbuzz.entities.User; /** * @author Siva * */ @ManagedBean @RequestScoped public class RequestContextController { private String emailId = ""; public void setEmailId(String emailId) { this.emailId = emailId; } public String getEmailId() { return emailId; } public void doSearch() { RequestContext context = RequestContext.getCurrentInstance(); context.update("form1"); context.addCallbackParam("emailId", emailId); User user = new User(); user.setFirstName("Optimus"); user.setLastName("Prime"); context.addCallbackParam("user", user); context.execute("dlg.show()"); } public void scroll() { RequestContext.getCurrentInstance().scrollTo("panel"); } }
[ "paullewallencom@users.noreply.github.com" ]
paullewallencom@users.noreply.github.com
8bc448949ac4b42fbd330dd70add8637b9f780e1
58e9d313dbb1c1a30fe7376afe453a712f1a9040
/app/src/main/java/by/boiko/erizo/educationapi/ui/base/BaseViewHolder.java
d70135a0589bc000822e2035377bb06f6272eb9d
[]
no_license
erizoo/InstagramAPI
d73e49f68e1575336155a0d375aba55c335dfb1b
e2aa2fc325b62e41dc051c226583230cc4224681
refs/heads/master
2020-04-05T18:40:38.420488
2018-11-14T09:15:53
2018-11-14T09:15:53
157,108,529
0
0
null
null
null
null
UTF-8
Java
false
false
461
java
package by.boiko.erizo.educationapi.ui.base; import android.support.v7.widget.RecyclerView; import android.view.View; public abstract class BaseViewHolder extends RecyclerView.ViewHolder { private int currentPosition; public BaseViewHolder(View itemView) { super(itemView); } public void onBind(int position) { currentPosition = position; } public int getCurrentPosition() { return currentPosition; } }
[ "alexboiko1993@gmail.com" ]
alexboiko1993@gmail.com
08c9bc1fbd61fa4ed84d0dac9b31737ae55fcbc4
2b8c47031dddd10fede8bcf16f8db2b52521cb4f
/subject SPLs and test cases/BerkeleyDB(5)/BerkeleyDB_P1/evosuite-tests4/com/sleepycat/je/utilint/BitMap_ESTest_scaffolding4.java
2f44561e2367f000b09cab2d9cd6ae229d0d2434
[]
no_license
psjung/SRTST_experiments
6f1ff67121ef43c00c01c9f48ce34f31724676b6
40961cb4b4a1e968d1e0857262df36832efb4910
refs/heads/master
2021-06-20T04:45:54.440905
2019-09-06T04:05:38
2019-09-06T04:05:38
206,693,757
1
0
null
2020-10-13T15:50:41
2019-09-06T02:10:06
Java
UTF-8
Java
false
false
1,440
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Apr 22 16:54:15 KST 2017 */ package com.sleepycat.je.utilint; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @EvoSuiteClassExclude public class BitMap_ESTest_scaffolding4 { @org.junit.Rule public org.junit.rules.Timeout globalTimeout = new org.junit.rules.Timeout(4000); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "com.sleepycat.je.utilint.BitMap"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } }
[ "psjung@kaist.ac.kr" ]
psjung@kaist.ac.kr
19f64174a248367dee467a4e7842c376622862e4
59d56ad52a7e016883b56b73761104a17833a453
/src/main/java/com/whatever/ProductRangeService/GenericType.java
7ea814e430d226cfa89f1b400ef4f921740563ba
[]
no_license
zapho/cxf-client-quarkus
3c330a3a5f370cce21c5cd1477ffbe274d1bba59
6e147d44b9ea9cc455d52f0efe234ef787b336c4
refs/heads/master
2023-01-22T03:33:27.579072
2020-12-08T14:55:27
2020-12-08T14:55:27
319,641,033
0
0
null
null
null
null
UTF-8
Java
false
false
889
java
package com.whatever.ProductRangeService; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java pour GenericType. * * <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe. * <p> * <pre> * &lt;simpleType name="GenericType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="GENERIC"/> * &lt;enumeration value="REFERENT"/> * &lt;enumeration value="NULL"/> * &lt;enumeration value="SUBSTITUTABLE"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "GenericType") @XmlEnum public enum GenericType { GENERIC, REFERENT, NULL, SUBSTITUTABLE; public String value() { return name(); } public static GenericType fromValue(String v) { return valueOf(v); } }
[ "fabrice.aupert@dedalus-group.com" ]
fabrice.aupert@dedalus-group.com
66ef5ff8fde38828729992d612e973409af34f0a
4b5abde75a6daab68699a9de89945d8bf583e1d0
/app-release-unsigned/sources/d/a/a/b.java
4e014ead3df89a31cb614b09ace05e2d029d8b68
[]
no_license
agustrinaldokurniawan/News_Android_Kotlin_Mobile_Apps
95d270d4fa2a47f599204477cb25bae7bee6e030
a1f2e186970cef9043458563437b9c691725bcb5
refs/heads/main
2023-07-03T01:03:22.307300
2021-08-08T10:47:00
2021-08-08T10:47:00
375,330,796
0
0
null
null
null
null
UTF-8
Java
false
false
188
java
package d.a.a; public class b<T> { public Object[] a = new Object[16]; public int b; /* renamed from: c reason: collision with root package name */ public int f1755c; }
[ "agust.kurniawan@Agust-Rinaldo-Kurniawan.local" ]
agust.kurniawan@Agust-Rinaldo-Kurniawan.local
4a929a615b341587d38e665ab8ae386df0c980ff
41cf2d9ba68e2b0f1d3c8d91de531479ac8d529e
/queue-demo/src/com/demo/inter/ILinkedList.java
d1da9d794074fe5e1566092253429d327420e4f8
[]
no_license
zt1115798334/java-advanced
09451239a1397f1f8bd9c8bd5cd104bfed0ebc49
660e24dbe0a63b20bfa15326144d0a05e8cc8ff4
refs/heads/master
2023-03-31T00:06:26.870214
2019-07-25T05:56:46
2019-07-25T05:56:46
198,194,781
0
0
null
2021-03-31T21:28:26
2019-07-22T09:50:18
Java
UTF-8
Java
false
false
353
java
package com.demo.inter; public interface ILinkedList<T> { boolean isEmpty(); int length(); T get(int index); T set(int index, T data); boolean add(int index, T data); boolean add(T data); T remove(int index); boolean removeAll(T data); void clear(); boolean contains(T data); String toString(); }
[ "zhangtong9498@qq.com" ]
zhangtong9498@qq.com
966911fb3e396b68b0b4d99b03311e2f6860ad39
38ae33ee28f3836f6d77b46917825c9f9a07729e
/test_examples/src/com/swing/example/TreeTableCellRenderer.java
4f36888f7dff76e1cb4657ea2f5a19c2f6039c65
[]
no_license
chinmaysept/java_general
c4f771cd30cffdcd24870f93ea699ac4703e838c
cb391b0dd1a3908814f6f3d1c26251576afa9c74
refs/heads/master
2022-12-22T20:25:16.680389
2019-11-14T08:44:53
2019-11-14T08:44:53
221,638,495
0
0
null
2022-12-16T03:32:16
2019-11-14T07:36:18
Java
UTF-8
Java
false
false
8,033
java
/*package com.swing.example; import java.awt.Component; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.MouseEvent; import java.util.EventObject; import javax.swing.AbstractCellEditor; import javax.swing.JTable; import javax.swing.JTree; import javax.swing.ListSelectionModel; import javax.swing.LookAndFeel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeExpansionListener; import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; public class TreeTableCellRenderer extends JTree implements TableCellRenderer { *//** Last table/tree row asked to renderer. *//* protected int visibleRow; public TreeTableCellRenderer(TreeModel model) { super(model); } *//** * updateUI is overridden to set the colors of the Tree's renderer * to match that of the table. *//* public void updateUI() { super.updateUI(); // Make the tree's cell renderer use the table's cell selection // colors. TreeCellRenderer tcr = getCellRenderer(); if (tcr instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer dtcr = ((DefaultTreeCellRenderer)tcr); // For 1.1 uncomment this, 1.2 has a bug that will cause an // exception to be thrown if the border selection color is // null. // dtcr.setBorderSelectionColor(null); dtcr.setTextSelectionColor(UIManager.getColor ("Table.selectionForeground")); dtcr.setBackgroundSelectionColor(UIManager.getColor ("Table.selectionBackground")); } } *//** * Sets the row height of the tree, and forwards the row height to * the table. *//* public void setRowHeight(int rowHeight) { if (rowHeight > 0) { super.setRowHeight(rowHeight); if (JTreeTable.this != null && JTreeTable.this.getRowHeight() != rowHeight) { JTreeTable.this.setRowHeight(getRowHeight()); } } } *//** * This is overridden to set the height to match that of the JTable. *//* public void setBounds(int x, int y, int w, int h) { super.setBounds(x, 0, w, JTreeTable.this.getHeight()); } *//** * Sublcassed to translate the graphics such that the last visible * row will be drawn at 0,0. *//* public void paint(Graphics g) { g.translate(0, -visibleRow * getRowHeight()); super.paint(g); } *//** * TreeCellRenderer method. Overridden to update the visible row. *//* public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if(isSelected) setBackground(table.getSelectionBackground()); else setBackground(table.getBackground()); visibleRow = row; return this; } } *//** * TreeTableCellEditor implementation. Component returned is the * JTree. *//* class TreeTableCellEditor extends AbstractCellEditor implements TableCellEditor { public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int r, int c) { return tree; } *//** * Overridden to return false, and if the event is a mouse event * it is forwarded to the tree.<p> * The behavior for this is debatable, and should really be offered * as a property. By returning false, all keyboard actions are * implemented in terms of the table. By returning true, the * tree would get a chance to do something with the keyboard * events. For the most part this is ok. But for certain keys, * such as left/right, the tree will expand/collapse where as * the table focus should really move to a different column. Page * up/down should also be implemented in terms of the table. * By returning false this also has the added benefit that clicking * outside of the bounds of the tree node, but still in the tree * column will select the row, whereas if this returned true * that wouldn't be the case. * <p>By returning false we are also enforcing the policy that * the tree will never be editable (at least by a key sequence). *//* public boolean isCellEditable(EventObject e) { if (e instanceof MouseEvent) { for (int counter = getColumnCount() - 1; counter >= 0; counter--) { if (getColumnClass(counter) == TreeTableModel.class) { MouseEvent me = (MouseEvent)e; MouseEvent newME = new MouseEvent(tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, counter, true).x, me.getY(), me.getClickCount(), me.isPopupTrigger()); tree.dispatchEvent(newME); break; } } } return false; } public Object getCellEditorValue() { // TODO Auto-generated method stub return null; } } *//** * ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel * to listen for changes in the ListSelectionModel it maintains. Once * a change in the ListSelectionModel happens, the paths are updated * in the DefaultTreeSelectionModel. *//* class ListToTreeSelectionModelWrapper extends DefaultTreeSelectionModel { *//** Set to true when we are updating the ListSelectionModel. *//* protected boolean updatingListSelectionModel; public ListToTreeSelectionModelWrapper() { super(); getListSelectionModel().addListSelectionListener (createListSelectionListener()); } *//** * Returns the list selection model. ListToTreeSelectionModelWrapper * listens for changes to this model and updates the selected paths * accordingly. *//* ListSelectionModel getListSelectionModel() { return listSelectionModel; } *//** * This is overridden to set <code>updatingListSelectionModel</code> * and message super. This is the only place DefaultTreeSelectionModel * alters the ListSelectionModel. *//* public void resetRowSelection() { if(!updatingListSelectionModel) { updatingListSelectionModel = true; try { super.resetRowSelection(); } finally { updatingListSelectionModel = false; } } // Notice how we don't message super if // updatingListSelectionModel is true. If // updatingListSelectionModel is true, it implies the // ListSelectionModel has already been updated and the // paths are the only thing that needs to be updated. } *//** * Creates and returns an instance of ListSelectionHandler. *//* protected ListSelectionListener createListSelectionListener() { return new ListSelectionHandler(); } *//** * If <code>updatingListSelectionModel</code> is false, this will * reset the selected paths from the selected rows in the list * selection model. *//* protected void updateSelectedPathsFromSelectedRows() { if(!updatingListSelectionModel) { updatingListSelectionModel = true; try { // This is way expensive, ListSelectionModel needs an // enumerator for iterating. int min = listSelectionModel.getMinSelectionIndex(); int max = listSelectionModel.getMaxSelectionIndex(); clearSelection(); if(min != -1 && max != -1) { for(int counter = min; counter <= max; counter++) { if(listSelectionModel.isSelectedIndex(counter)) { TreePath selPath = tree.getPathForRow (counter); if(selPath != null) { addSelectionPath(selPath); } } } } } finally { updatingListSelectionModel = false; } } } *//** * Class responsible for calling updateSelectedPathsFromSelectedRows * when the selection of the list changse. *//* class ListSelectionHandler implements ListSelectionListener { public void valueChanged(ListSelectionEvent e) { updateSelectedPathsFromSelectedRows(); } } } } */
[ "chinmaya.sept@rediffmail.com" ]
chinmaya.sept@rediffmail.com
e2dab0b6fe87f12320db9a3ee39df70e7699aefc
beb22f9aa75e5894d737e417a392d4e8017a400b
/TaskUnifier/TaskUnifierGui/src/main/java/com/leclercb/taskunifier/gui/components/taskrules/TaskRuleConfigurationDialog.java
9a8ebb6e67d8cfbb2dc23672a1cb40db3e374fa8
[]
no_license
gdinit/taskunifier
4434c1f983162f5a4e534524dc3f414b6c2b5081
ae1c9d50ca57a2129ceb323271f40532099154ac
refs/heads/master
2021-10-19T06:50:45.884694
2019-02-18T23:13:57
2019-02-18T23:13:57
171,366,977
1
0
null
null
null
null
UTF-8
Java
false
false
2,499
java
/* * TaskUnifier * Copyright (c) 2013, Benjamin Leclerc * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of TaskUnifier or the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.leclercb.taskunifier.gui.components.taskrules; import com.leclercb.taskunifier.gui.api.rules.TaskRule; import com.leclercb.taskunifier.gui.swing.TUDialog; import com.leclercb.taskunifier.gui.translations.Translations; public class TaskRuleConfigurationDialog extends TUDialog { public TaskRuleConfigurationDialog() { super(TaskRuleConfigurationDialogPanel.getInstance()); this.initialize(); } public void setSelectedRule(TaskRule rule) { TaskRuleConfigurationDialogPanel.getInstance().setSelectedRule(rule); } private void initialize() { this.setModal(true); this.setTitle(Translations.getString("general.manage_task_rules")); this.setSize(900, 500); this.setResizable(true); this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); this.loadWindowSettings("window.task_rule"); } }
[ "leclercb@1731239b-9234-42ac-9561-35e68316607f" ]
leclercb@1731239b-9234-42ac-9561-35e68316607f