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
47f05b8ad3357c4c18caa1034568a178911ab5f0
a9914626c19f4fbcb5758a1953a4efe4c116dfb9
/L2JTW_DataPack_Ertheia/dist/game/data/scripts/handlers/voicedcommandhandlers/CastleVCmd.java
14d0d0af02577ffafdf6f381c5d9491a74161d0a
[]
no_license
mjsxjy/l2jtw_datapack
ba84a3bbcbae4adbc6b276f9342c248b6dd40309
c6968ae0475a076080faeead7f94bda1bba3def7
refs/heads/master
2021-01-19T18:21:37.381390
2015-08-03T00:20:39
2015-08-03T00:20:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,997
java
/* * Copyright (C) 2004-2014 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package handlers.voicedcommandhandlers; import com.l2jserver.gameserver.handler.IVoicedCommandHandler; import com.l2jserver.gameserver.instancemanager.CastleManager; import com.l2jserver.gameserver.model.actor.instance.L2DoorInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.entity.Castle; import com.l2jserver.gameserver.network.SystemMessageId; /** * @author Zoey76 */ public class CastleVCmd implements IVoicedCommandHandler { private static final String[] VOICED_COMMANDS = { "opendoors", "closedoors", "ridewyvern" }; @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) { switch (command) { case "opendoors": if (!params.equals("castle")) { activeChar.sendMessage("Only Castle doors can be open."); return false; } if (!activeChar.isClanLeader()) { activeChar.sendPacket(SystemMessageId.ONLY_CLAN_LEADER_CAN_ISSUE_COMMANDS); return false; } final L2DoorInstance door = (L2DoorInstance) activeChar.getTarget(); if (door == null) { activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); return false; } final Castle castle = CastleManager.getInstance().getCastleById(activeChar.getClan().getCastleId()); if (castle == null) { activeChar.sendMessage("Your clan does not own a castle."); return false; } if (castle.getSiege().isInProgress()) { activeChar.sendPacket(SystemMessageId.GATES_NOT_OPENED_CLOSED_DURING_SIEGE); return false; } if (castle.checkIfInZone(door.getX(), door.getY(), door.getZ())) { activeChar.sendPacket(SystemMessageId.GATE_IS_OPENING); door.openMe(); } break; case "closedoors": if (!params.equals("castle")) { activeChar.sendMessage("Only Castle doors can be closed."); return false; } if (!activeChar.isClanLeader()) { activeChar.sendPacket(SystemMessageId.ONLY_CLAN_LEADER_CAN_ISSUE_COMMANDS); return false; } final L2DoorInstance door2 = (L2DoorInstance) activeChar.getTarget(); if (door2 == null) { activeChar.sendPacket(SystemMessageId.INCORRECT_TARGET); return false; } final Castle castle2 = CastleManager.getInstance().getCastleById(activeChar.getClan().getCastleId()); if (castle2 == null) { activeChar.sendMessage("Your clan does not own a castle."); return false; } if (castle2.getSiege().isInProgress()) { activeChar.sendPacket(SystemMessageId.GATES_NOT_OPENED_CLOSED_DURING_SIEGE); return false; } if (castle2.checkIfInZone(door2.getX(), door2.getY(), door2.getZ())) { activeChar.sendMessage("The gate is being closed."); door2.closeMe(); } break; case "ridewyvern": if (activeChar.isClanLeader() && (activeChar.getClan().getCastleId() > 0)) { activeChar.mount(12621, 0, true); } break; } return true; } @Override public String[] getVoicedCommandList() { return VOICED_COMMANDS; } }
[ "rocknow@9bd44e3e-6552-0410-907e-a6ca40b856b6" ]
rocknow@9bd44e3e-6552-0410-907e-a6ca40b856b6
8745590d48ecf7ba84d969a2ee6f467774e6caa9
f505416ad655f8d99fc7cc081fb2381a1a4725f4
/src/test/java/lk/lankaDrivingSchool/DrivingSchool/DrivingSchoolApplicationTests.java
6729d3ef63900dd96ce244106d51a58fef060bb4
[]
no_license
SitharaDedigamuwa/DrivingSchool
470e2587dd184865c55584b500e16357e21ffe77
b9957702d8180e9390b2d20204c642d27376befb
refs/heads/master
2021-05-18T01:39:36.782086
2020-03-28T20:43:11
2020-03-28T20:43:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
234
java
package lk.lankaDrivingSchool.DrivingSchool; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class DrivingSchoolApplicationTests { @Test void contextLoads() { } }
[ "asakahatapitiya@gmail.com" ]
asakahatapitiya@gmail.com
d327263dd8c138abfa3395d12c6938c48d3b4345
7a9ba5e31ef02c74a1fac63e56dfdc19b44856c3
/src/togos/solidtree/trace/NodeConverter.java
3e3b91d9d2c812da462043236e01e234231d67a3
[]
no_license
TOGoS/SolidTree
53705c3c1040191c4f26936618f798b285549fb8
74c2748c2e37808284fe41cf92a957bff4461328
refs/heads/master
2021-01-21T08:11:38.051135
2016-04-21T17:36:23
2016-04-21T17:36:23
9,753,196
0
0
null
null
null
null
UTF-8
Java
false
false
6,895
java
package togos.solidtree.trace; import java.util.WeakHashMap; import togos.lazy.Ref; import togos.solidtree.DereferenceException; import togos.solidtree.NodeDereffer; import togos.solidtree.PathTraceMaterial; import togos.solidtree.SolidNode; public class NodeConverter { protected final NodeDereffer nodeDereffer; protected final WeakHashMap<TraceNode,TraceNode> canonicalTraceNodes = new WeakHashMap<TraceNode,TraceNode>(); protected final WeakHashMap<PathTraceMaterial,TraceNode> materialTraceNodeCache = new WeakHashMap<PathTraceMaterial,TraceNode>(); protected final WeakHashMap<SolidNode,TraceNode> solidTraceNodeCache = new WeakHashMap<SolidNode,TraceNode>(); /** Maps to FALSE when not homogeneous, material otherwise. */ protected final WeakHashMap<SolidNode,Object> nodeHomogeneityCache = new WeakHashMap<SolidNode,Object>(); public NodeConverter( NodeDereffer nodeDereffer ) { this.nodeDereffer = nodeDereffer; } public void reset() { materialTraceNodeCache.clear(); solidTraceNodeCache.clear(); } protected TraceNode intern( TraceNode tn ) { TraceNode i = canonicalTraceNodes.get(tn); if( i != null ) return i; canonicalTraceNodes.put(tn, tn); return tn; } protected TraceNode solidTraceNode( PathTraceMaterial mat ) { return intern(new TraceNode(mat)); } protected TraceNode dividedTraceNode( int div, TraceNode subNodeA, double splitPoint, TraceNode subNodeB ) { return intern(new TraceNode(div, splitPoint, subNodeA, subNodeB)); } protected TraceNode traceNodeForMaterial(PathTraceMaterial mat) { TraceNode tn = materialTraceNodeCache.get(mat); if( tn == null ) { materialTraceNodeCache.put(mat, tn = solidTraceNode(mat)); } return tn; } protected PathTraceMaterial nodeIsHomogeneous( SolidNode sn ) throws DereferenceException { if( sn.getType() == SolidNode.Type.HOMOGENEOUS ) return sn.getHomogeneousMaterial(); if( sn.getType() == SolidNode.Type.DENSITY_FUNCTION_SUBDIVIDED ) return null; // lets ignore this possibility for now Object o = nodeHomogeneityCache.get(sn); if( o == null ) { PathTraceMaterial m = regionIsHomogeneous( sn, 0, 0, 0, sn.getDivX(), sn.getDivY(), sn.getDivZ() ); nodeHomogeneityCache.put(sn, o = (m == null ? Boolean.FALSE : m)); } return o == Boolean.FALSE ? null : (PathTraceMaterial)o; } protected PathTraceMaterial regionIsHomogeneous( SolidNode sn, int rx, int ry, int rz, int rw, int rh, int rd ) throws DereferenceException { SolidNode subNode = nodeDereffer.deref(sn.subNode(rx, ry, rz), SolidNode.class); PathTraceMaterial mat0 = nodeIsHomogeneous(subNode); if( mat0 == null ) return null; for( int dz=0; dz<rd; ++dz ) for( int dy=0; dy<rh; ++dy ) for( int dx=0; dx<rw; ++dx ) { PathTraceMaterial matN = nodeIsHomogeneous(nodeDereffer.deref(sn.subNode(rx+dx, ry+dy, rz+dz), SolidNode.class)); if( matN != mat0 ) return null; } return mat0; } /* protected boolean subdividable( int dim ) { assert dim > 0; while( (dim & 1) == 0 ) dim >>= 1; return dim == 1; } protected void ensureSubdividable( int dim, String dimName ) { if( !subdividable(dim) ) throw new RuntimeException( "Cannot subdivide node because '"+dimName+"' division is non-power-of-2: "+dim); } protected void ensureSubdividable( SolidNode sn ) { if( sn.divX != 1 ) ensureSubdividable(sn.divX, "X"); if( sn.divY != 1 ) ensureSubdividable(sn.divX, "Y"); if( sn.divZ != 1 ) ensureSubdividable(sn.divX, "Z"); } */ protected TraceNode regionToTraceNode( SolidNode sn, int rx, int ry, int rz, int rw, int rh, int rd ) throws DereferenceException { assert rw > 0; assert rh > 0; assert rd > 0; PathTraceMaterial mat; if( (mat = regionIsHomogeneous(sn, rx, ry, rz, rw, rh, rd)) != null ) { return traceNodeForMaterial(mat); } if( rw == 1 && rh == 1 && rd == 1 ) return toTraceNode(sn.subNode(rx, ry, rz)); int maxDim = rw > rh ? rw : rh; maxDim = maxDim > rd ? maxDim : rd; int mostHomogeneousDim = 0; int maxHomogeneity = 0; // For each dimension, find number of layers that are internally homogeneous, // weighted by the number of cells they contain if( rw != 1 ) { int hg = 0; for( int x=0; x<rw; ++x ) if( regionIsHomogeneous(sn, rx+x, ry, rz, 1, rh, rd) != null ) { hg += rh*rd; } hg = hg * maxDim / rw; if( hg >= maxHomogeneity ) { mostHomogeneousDim = TraceNode.DIV_X; maxHomogeneity = hg; } } if( rd != 1 ) { int hg = 0; for( int z=0; z<rd; ++z ) if( regionIsHomogeneous(sn, rx, ry, rz+z, rw, rh, 1) != null ) { hg += rw*rh; } hg = hg * maxDim / rd; if( hg >= maxHomogeneity ) { mostHomogeneousDim = TraceNode.DIV_Z; maxHomogeneity = hg; } } if( rh != 1 ) { int hg = 0; for( int y=0; y<rh; ++y ) if( regionIsHomogeneous(sn, rx, ry+y, rz, rw, 1, rd) != null ) { hg += rw*rd; } hg = hg * maxDim / rh; if( hg >= maxHomogeneity ) { mostHomogeneousDim = TraceNode.DIV_Y; maxHomogeneity = hg; } } switch( mostHomogeneousDim ) { case TraceNode.DIV_X: assert rw >= 2; return dividedTraceNode( TraceNode.DIV_X, regionToTraceNode(sn, rx , ry, rz, rw/2 , rh, rd), (double)(rw/2)/rw, regionToTraceNode(sn, rx+rw/2, ry, rz, (rw-rw/2), rh, rd) ); case TraceNode.DIV_Y: assert rh >= 2; return dividedTraceNode( TraceNode.DIV_Y, regionToTraceNode(sn, rx, ry , rz, rw, rh/2 , rd), (double)(rh/2)/rh, regionToTraceNode(sn, rx, ry+rh/2, rz, rw, (rh-rh/2), rd) ); case TraceNode.DIV_Z: assert rd >= 2; return dividedTraceNode( TraceNode.DIV_Z, regionToTraceNode(sn, rx, ry, rz , rw, rh, rd/2 ), (double)(rd/2)/rd, regionToTraceNode(sn, rx, ry, rz+rd/2, rw, rh, (rd-rd/2)) ); default: throw new RuntimeException("Bad direction for most homogeneous division direction: "+mostHomogeneousDim); } } protected TraceNode _toTraceNode( SolidNode sn ) throws DereferenceException { PathTraceMaterial mat = nodeIsHomogeneous(sn); if( mat != null ) return traceNodeForMaterial(mat); switch( sn.getType() ) { case REGULARLY_SUBDIVIDED: return regionToTraceNode( sn, 0, 0, 0, sn.getDivX(), sn.getDivY(), sn.getDivZ() ); case DENSITY_FUNCTION_SUBDIVIDED: return new TraceNode(TraceNode.DIV_FUNC_GLOBAL, sn.getSubdivisionFunction(), toTraceNode(sn.subNode(0)), toTraceNode(sn.subNode(1)) ); default: throw new RuntimeException("Unexpected SolidNode type: "+sn.getType()); } } public TraceNode toTraceNode( SolidNode sn ) throws DereferenceException { TraceNode tn = solidTraceNodeCache.get(sn); if( tn == null ) { solidTraceNodeCache.put(sn, tn = _toTraceNode(sn)); } return tn; } public TraceNode toTraceNode( Ref<SolidNode> sn ) throws DereferenceException { return toTraceNode( nodeDereffer.deref(sn, SolidNode.class) ); } }
[ "togos00@gmail.com" ]
togos00@gmail.com
23c5418a54d0561498aa50c21c30bb4d14933644
a57a1621792699ea2cbb4872dc26b664f2f80466
/src/com/android/opensource/bitmapfun/ui/ImageGridActivity.java
1bbe0346cf1328cf88d74913a0c1efb84969a904
[]
no_license
zhouxiaoli521/bitmapfun
4c0ed7682b14665a9b96dd1490dee3b3dc9d34ec
3a3f6989c92e376cc85f60c3c29a3efe6de7b443
refs/heads/master
2020-03-28T11:13:34.410570
2013-12-23T05:41:20
2013-12-23T05:41:20
15,519,006
1
0
null
null
null
null
UTF-8
Java
false
false
1,404
java
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.opensource.bitmapfun.ui; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; /** * Simple FragmentActivity to hold the main {@link ImageGridFragment} and not much else. */ public class ImageGridActivity extends FragmentActivity { private static final String TAG = "ImageGridFragment"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getSupportFragmentManager().findFragmentByTag(TAG) == null) { final FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.add(android.R.id.content, new ImageGridFragment(), TAG); ft.commit(); } } }
[ "yinglovezhuzhu@139.com" ]
yinglovezhuzhu@139.com
61e5584993e2fdb18c771f9d74c1ed81ad9496d9
acef3734b40f00c3db23455883d2610dfbb41f7e
/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SubscribeMapping.java
727ed024cc6da572695cf776d33a5014444e8123
[ "Apache-2.0" ]
permissive
soaryang/spring
50ff0e1b138307aee999c183938150e32aa87a83
dba1b0d3498c07f9bad6a1e856120c4f009c4edc
refs/heads/master
2023-01-07T18:42:41.622736
2020-10-14T17:07:40
2020-10-14T17:07:40
295,474,567
1
0
null
null
null
null
UTF-8
Java
false
false
2,623
java
/* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.messaging.simp.annotation; import java.lang.annotation.*; /** * Annotation for mapping subscription messages onto specific handler methods based * on the destination of a subscription. Supported with STOMP over WebSocket only * (e.g. STOMP SUBSCRIBE frame). * * <p>This is a method-level annotation that can be combined with a type-level * {@link org.springframework.messaging.handler.annotation.MessageMapping @MessageMapping}. * * <p>Supports the same method arguments as {@code @MessageMapping}; however, * subscription messages typically do not have a body. * * <p>The return value also follows the same rules as for {@code @MessageMapping}, * except if the method is not annotated with * {@link org.springframework.messaging.handler.annotation.SendTo SendTo} or * {@link SendToUser}, the message is sent directly back to the connected * user and does not pass through the message broker. This is useful for * implementing a request-reply pattern. * * <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying), * make sure to consistently put <i>all</i> your mapping annotations - such as * {@code @MessageMapping} and {@code @SubscribeMapping} - on * the controller <i>interface</i> rather than on the implementation class. * * @author Rossen Stoyanchev * @see org.springframework.messaging.handler.annotation.MessageMapping * @see org.springframework.messaging.handler.annotation.SendTo * @see org.springframework.messaging.simp.annotation.SendToUser * @since 4.0 */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface SubscribeMapping { /** * Destination-based mapping expressed by this annotation. * <p>This is the destination of the STOMP message (e.g. {@code "/positions"}). * Ant-style path patterns (e.g. {@code "/price.stock.*"}) and path template * variables (e.g. <code>"/price.stock.{ticker}"</code>) are also supported. */ String[] value() default {}; }
[ "asdasd" ]
asdasd
2df9f4c70c55d3752fbe178987371d2e794adca1
65befe28d69189681a2c79c77d9fcbdceab3dc27
/Algorithms/SWTest/src/basicD1D2/HealthManagement.java
0e8fa435b801b739850050a0b4f1fe3da3b9076d
[]
no_license
solwish/TIL
554a67f79c66ed5d5a5075f08b6f0369aa363249
4314767fa763de73238aa141e105a5cf3641a9fc
refs/heads/master
2023-01-08T01:11:34.677452
2021-01-07T13:43:56
2021-01-07T13:43:56
101,876,124
10
0
null
2023-01-03T14:41:06
2017-08-30T12:03:25
CSS
UTF-8
Java
false
false
488
java
package basicD1D2; import java.util.Scanner; public class HealthManagement { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); long L = 0, U = 0, X = 0; long ans; for (int t_case = 1; t_case <= T; t_case++) { L = sc.nextLong(); U = sc.nextLong(); X = sc.nextLong(); ans = (X < L) ? (L - X) : ((L <= X && X <= U) ? 0 : -1); System.out.println("#" + t_case + " " + ans); } } }
[ "solwish90@gmail.com" ]
solwish90@gmail.com
a072425813e7405c71f2adeb0519aeb1fcb0e34a
730f07dbf2232fb4e44e63637971bcca818a958a
/src/main/java/com/notronix/lw/impl/method/purchaseorder/CreatePurchaseOrderInitialMethod.java
bd5e0b41b536d5a2e1f4f0f5202893547463a826
[ "Apache-2.0" ]
permissive
Notronix/JaLAPI
d008d8796792f5ca618bc5699fd4a40ee41be65d
3e3a3750ef0de428253ff43e7b66e6b8c414123d
refs/heads/master
2020-12-25T17:15:42.179441
2020-11-12T12:46:01
2020-11-12T12:46:01
59,916,048
1
1
null
null
null
null
UTF-8
Java
false
false
1,488
java
package com.notronix.lw.impl.method.purchaseorder; import com.google.api.client.http.HttpContent; import com.google.gson.Gson; import com.notronix.lw.api.model.CreatePurchaseOrderInitialParameter; import com.notronix.lw.impl.method.AbstractLinnworksAPIMethod; import java.util.UUID; import static com.notronix.lw.impl.method.MethodUtils.urlEncode; import static java.util.Objects.requireNonNull; public class CreatePurchaseOrderInitialMethod extends AbstractLinnworksAPIMethod<UUID> { private CreatePurchaseOrderInitialParameter createParameters; @Override public String getURI() { return "PurchaseOrder/Create_PurchaseOrder_Initial"; } @Override public HttpContent getContent(Gson gson) { return urlEncode("createParameters", gson.toJson(requireNonNull(createParameters))); } @Override public UUID getResponse(Gson gson, String jsonPayload) { return UUID.fromString(gson.fromJson(jsonPayload, String.class)); } public CreatePurchaseOrderInitialParameter getCreateParameters() { return createParameters; } public void setCreateParameters(CreatePurchaseOrderInitialParameter createParameters) { this.createParameters = createParameters; } public CreatePurchaseOrderInitialMethod withCreateParameters(CreatePurchaseOrderInitialParameter createParameters) { this.createParameters = createParameters; return this; } }
[ "clint.munden@notronix.com" ]
clint.munden@notronix.com
45eb2d65e00d73017323a2f4bac5f788f180162b
53e04ba03c4ddef5a1a64b429fe2c58a5704e1b9
/atrs-web/src/main/java/jp/co/ntt/atrs/app/common/view/package-info.java
193233e15d43b8d4fb0a4a7e622a7cca523a4c4a
[]
no_license
Macchinetta/atrs-jms
c56ebcd3a18de2ec44e1e42d48136f874af28425
a75d2753adf2254394a11923f3b4608b5e28a960
refs/heads/master
2021-01-22T23:10:32.876660
2018-03-08T06:33:41
2018-03-08T06:33:41
94,040,180
0
1
null
null
null
null
UTF-8
Java
false
false
772
java
/* * Copyright 2014-2018 NTT Corporation. * * 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. * */ /** * 画面表示に関する共通機能のパッケージ。 * * @author NTT 電電太郎 */ package jp.co.ntt.atrs.app.common.view;
[ "macchinetta.fw@gmail.com" ]
macchinetta.fw@gmail.com
f04331047dd9c8da83bc345f5e818e53e3586c52
d71e879b3517cf4fccde29f7bf82cff69856cfcd
/ExtractedJars/iRobot_com.irobot.home/javafiles/ch/qos/logback/core/joran/event/InPlayListener.java
ba63ec6aacc8eee4784206c0d8b5b582be98f5c7
[ "MIT" ]
permissive
Andreas237/AndroidPolicyAutomation
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
refs/heads/master
2020-04-10T02:14:08.789751
2019-05-16T19:29:11
2019-05-16T19:29:11
160,739,088
5
1
null
null
null
null
UTF-8
Java
false
false
375
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) annotate safe package ch.qos.logback.core.joran.event; // Referenced classes of package ch.qos.logback.core.joran.event: // SaxEvent public interface InPlayListener { public abstract void inPlay(SaxEvent saxevent); }
[ "silenta237@gmail.com" ]
silenta237@gmail.com
0e199b9d94933f9689230161f9c59b4c35863e6c
e11d3e6ad13b5466e86e52ea13a912513dc5c9e6
/ml-components/ml-linearalg/src/test/java/com/github/chen0040/ml/tests/linearalg/QRTests.java
6273c56b8ddf3358a5d53ccb16316d2e2ebb197a
[ "MIT" ]
permissive
zyq11223/java-machine-learning-web-api
c0dbcad09878e3eb37c3caecec5db10b075d0de4
562c861997392b8e50f4ce8405e9a04c340ecb14
refs/heads/master
2020-04-22T09:10:33.619398
2017-11-24T04:18:55
2017-11-24T04:18:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,010
java
package com.github.chen0040.ml.tests.linearalg; import com.github.chen0040.ml.linearalg.Vector; import com.github.chen0040.ml.linearalg.qr.QRSolver; import com.github.chen0040.ml.linearalg.Matrix; import com.github.chen0040.ml.linearalg.qr.QR; import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; /** * Created by chen0469 on 10/13/2015 0013. */ public class QRTests { public static double[][] Data = new double[][]{ new double[] { 12, -51, 4}, new double[] { 6, 167, -68}, new double[] { -4, 24, -41} }; public static Matrix A = new Matrix(Data); @Test public void TestQR() { QR QR = A.QR(); Matrix Q = QR.getQ(); Matrix R = QR.getR(); Matrix Api = Q.multiply(R); for (int r = 0; r < A.getRowCount(); ++r) { for (int c = 0; c < A.getColumnCount(); ++c) { System.out.println(A.get(r, c)+" = "+Api.get(r, c)); //assertTrue(Math.abs(A.get(r, c) - Api.get(r, c)) < 1e-10); } } //assertEquals(A, Q.multiply(R)); } @Test public void TestQRSolver() { Vector x = new Vector(new double[] { 2, 4, 1 }); Vector b = A.multiply(x); Vector x_pi = QRSolver.solve(A, b); assertEquals(x, x_pi); } @Test public void TestMatrixInverse() { //A = new SparseMatrix<int, double>(2, 2); //A[0, 0] = 4; //A[0, 1] = 7; //A[1, 0] = 2; //A[1, 1] = 6; Matrix Ainv = QRSolver.invert(A); Matrix Ipi = A.multiply(Ainv); //for (int row = 0; row < 2; ++row) //{ // Console.WriteLine(Ipi[row]); //} assertEquals(Matrix.identity(3), Ipi); Ipi = Ainv.multiply(A); //for (int row = 0; row < 2; ++row) //{ // Console.WriteLine(Ipi[row]); //} assertEquals(Matrix.identity(3), Ipi); } }
[ "xs0040@gmail.com" ]
xs0040@gmail.com
f169c34bb7925105d88bfd1fe8197fd8c48ed4a9
0eab961b7cf24b155631983cacadd6405427bffd
/src/test/java/org/clafer/compiler/ReachedLimitTest.java
1c4f2aef9da6338fed98f9235b6eca9e38afa721
[ "MIT" ]
permissive
rkamath3/chocosolver
fd322790c70b27af3a1645dcdeaefe6142eb3444
229ab5d3e6a304ccc52eeee0401ee4dade24484a
refs/heads/master
2020-12-14T06:11:28.248255
2015-05-13T16:09:00
2015-05-13T16:09:00
36,599,453
0
0
MIT
2020-05-11T19:39:52
2015-05-31T11:07:19
Java
UTF-8
Java
false
false
7,581
java
package org.clafer.compiler; import org.clafer.ast.AstConcreteClafer; import org.clafer.ast.AstModel; import static org.clafer.ast.Asts.*; import org.clafer.objective.Objective; import org.clafer.scope.Scope; import static org.junit.Assert.*; import org.junit.Test; /** * * @author jimmy */ public class ReachedLimitTest { @Test(timeout = 60000) public void testLimitTime() { AstModel model = newModel(); model.addChild("A").refTo(IntType); model.addChild("B").refTo(IntType); model.addChild("C").refTo(IntType); model.addChild("D").refTo(IntType); model.addChild("E").refTo(IntType); model.addChild("F").refTo(IntType); model.addChild("G").refTo(IntType); model.addChild("H").refTo(IntType); model.addChild("I").refTo(IntType); model.addChild("J").refTo(IntType); ClaferSolver solver = ClaferCompiler.compile(model, Scope.defaultScope(10)); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.allInstances(); fail("Expected timeout."); } catch (ReachedLimitException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); } } @Test(timeout = 60000) public void testLimitTimeSingleObjective() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").refTo(IntType); model.addChild("B").refTo(IntType); model.addChild("C").refTo(IntType); model.addChild("D").refTo(IntType); model.addChild("E").refTo(IntType); model.addChild("F").refTo(IntType); model.addChild("G").refTo(IntType); model.addChild("H").refTo(IntType); model.addChild("I").refTo(IntType); model.addChild("J").refTo(IntType); ClaferOptimizer solver = ClaferCompiler.compile(model, Scope.defaultScope(10), Objective.maximize(joinRef(a))); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.allInstances(); fail("Expected timeout."); } catch (ReachedLimitException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); } } @Test(timeout = 60000) public void testLimitTimeSingleObjectiveBestKnown() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").refTo(IntType); AstConcreteClafer b = model.addChild("B").refTo(IntType); AstConcreteClafer c = model.addChild("C").refToUnique(IntType); AstConcreteClafer d = model.addChild("D").refTo(IntType); AstConcreteClafer e = model.addChild("E").refToUnique(IntType); model.addConstraint(equal(add(joinRef(a), joinRef(b), minus(joinRef(c)), joinRef(d), minus(joinRef(e))), card(global(a)))); ClaferOptimizer solver = ClaferCompiler.compile(model, Scope.defaultScope(10), Objective.maximize(joinRef(a))); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.find(); fail("Expected timeout."); } catch (ReachedLimitBestKnownException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); assertEquals(1, rle.getObjectiveValues().length); assertTrue(rle.getObjectiveValues()[0] > 0); } } @Test(timeout = 60000) public void testLimitTimeMultiObjective() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").refTo(IntType); AstConcreteClafer b = model.addChild("B").refTo(IntType); model.addChild("C").refTo(IntType); model.addChild("D").refTo(IntType); model.addChild("E").refTo(IntType); model.addChild("F").refTo(IntType); model.addChild("G").refTo(IntType); model.addChild("H").refTo(IntType); model.addChild("I").refTo(IntType); model.addChild("J").refTo(IntType); ClaferOptimizer solver = ClaferCompiler.compile(model, Scope.defaultScope(10), Objective.maximize(joinRef(a)), Objective.maximize(joinRef(b))); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.allInstances(); fail("Expected timeout."); } catch (ReachedLimitException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); } } @Test(timeout = 60000) public void testLimitTimeMultipleObjectiveBestKnown() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").refTo(IntType); AstConcreteClafer b = model.addChild("B").refTo(IntType); AstConcreteClafer c = model.addChild("C").refToUnique(IntType); AstConcreteClafer d = model.addChild("D").refTo(IntType); AstConcreteClafer e = model.addChild("E").refToUnique(IntType); model.addConstraint(equal(add(joinRef(a), joinRef(b), minus(joinRef(c)), joinRef(d), minus(joinRef(e))), card(global(a)))); ClaferOptimizer solver = ClaferCompiler.compile(model, Scope.defaultScope(10), Objective.maximize(joinRef(a)), Objective.maximize(joinRef(b))); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.find(); fail("Expected timeout."); } catch (ReachedLimitBestKnownException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); assertEquals(2, rle.getObjectiveValues().length); } } @Test(timeout = 60000) public void testLimitTimeMinUnsat() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").withCard(1).refTo(IntType); AstConcreteClafer b = model.addChild("B").withCard(1).refTo(IntType); AstConcreteClafer c = model.addChild("C").withCard(1).refTo(IntType); model.addConstraint(equal( mul(joinRef(a), joinRef(a), joinRef(a)), add( mul(joinRef(b), joinRef(b), joinRef(b)), mul(joinRef(c), joinRef(c), joinRef(c))))); ClaferUnsat solver = ClaferCompiler.compileUnsat(model, Scope.defaultScope(10).intLow(2).intHigh(100)); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.minUnsat(); fail("Expected timeout."); } catch (ReachedLimitException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); } } @Test(timeout = 60000) public void testLimitTimeUnsatCore() { AstModel model = newModel(); AstConcreteClafer a = model.addChild("A").withCard(1).refTo(IntType); AstConcreteClafer b = model.addChild("B").withCard(1).refTo(IntType); AstConcreteClafer c = model.addChild("C").withCard(1).refTo(IntType); model.addConstraint(equal( mul(joinRef(a), joinRef(a), joinRef(a)), add( mul(joinRef(b), joinRef(b), joinRef(b)), mul(joinRef(c), joinRef(c), joinRef(c))))); ClaferUnsat solver = ClaferCompiler.compileUnsat(model, Scope.defaultScope(10).intLow(2).intHigh(100)); long start = System.currentTimeMillis(); solver.limitTime(1000); try { solver.unsatCore(); fail("Expected timeout."); } catch (ReachedLimitException rle) { assertTrue(System.currentTimeMillis() - start >= 1000); } } }
[ "paradoxical.reasoning@gmail.com" ]
paradoxical.reasoning@gmail.com
274fd97fe763fdaf6388bd250ca8d219a5c944c8
c01e713c662663e9678132003ca40a5ba4f6b552
/02.Workshop - Heroes/src/main/java/kristian9577/heroes/services/AuthValidationService.java
4f4dd36a9295a56d0b729897725c465486af590a
[]
no_license
kristian9577/Java-Spring
7915178e549a61a85e33c7f0565ec5bbea55147b
6b80ce4eae1730d8338f9d64707188443cba4c20
refs/heads/master
2020-09-06T13:25:08.088064
2019-12-10T10:01:06
2019-12-10T10:01:06
220,436,496
0
0
null
null
null
null
UTF-8
Java
false
false
205
java
package kristian9577.heroes.services; import kristian9577.heroes.data.models.auth.RegisterUserServiceModel; public interface AuthValidationService { boolean isValid(RegisterUserServiceModel user); }
[ "kristian9577@gmail.com" ]
kristian9577@gmail.com
efa70717805dc1b6f5c772aa0718626f81286695
6252c165657baa6aa605337ebc38dd44b3f694e2
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/TemperatureController3585.java
7fc04fea9fa146ace63d186c2f49def632bb737e
[]
no_license
soha500/EglSync
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
55101bc781349bb14fefc178bf3486e2b778aed6
refs/heads/master
2021-06-23T02:55:13.464889
2020-12-11T19:10:01
2020-12-11T19:10:01
139,832,721
0
1
null
2019-05-31T11:34:02
2018-07-05T10:20:00
Java
UTF-8
Java
false
false
371
java
package syncregions; public class TemperatureController3585 { public int execute(int temperature3585, int targetTemperature3585) { //sync _bfpnFUbFEeqXnfGWlV3585, behaviour 1-if(temperatureDifference > 0 && boilerStatus == true) { return 1; } else if (temperatureDifference < 0 && boilerStatus == false) { return 2; } else return 0; //endSync } }
[ "sultanalmutairi@172.20.10.2" ]
sultanalmutairi@172.20.10.2
7b4703d93326480d343b352c55028d95d6a9d837
7dbe6165180bd40267bff563fe1e5c9c84b291ed
/homelibrary/src/main/java/com/lantel/setting/personal/list/holder/SettingPersonHolder.java
ecc565dbf26e62778954757cddf220ef4e803f82
[]
no_license
13302864582/Lantel360CRM_Parent
ef02380e0886f885ea6496c93e2dd87c0ca92805
b29b1aab925f83927c6122d3c73767c9cc5b8953
refs/heads/master
2020-05-22T23:38:11.039162
2019-06-25T10:50:19
2019-06-25T10:50:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
558
java
package com.lantel.setting.personal.list.holder; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.lantel.homelibrary.R; import com.xiao360.baselibrary.listview.BaseViewHolder; public class SettingPersonHolder extends BaseViewHolder { public TextView title; public TextView value; public ImageView arrow; public SettingPersonHolder(View view) { super(view); title = getView(R.id.title); value = getView(R.id.value); arrow = getView(R.id.arrow); } }
[ "759030201@qq.com" ]
759030201@qq.com
0ed368779146ba6b7724d30fd0433afe2fd5716f
2d659a53f1b1ea4472737691b80ad9354f1e4db4
/android/support/v7/internal/view/menu/C0180f.java
b01ebcd1b4fd1593be52ef7657fb0f6272e8dc20
[]
no_license
sydneyli/bylock_src
52117e0e419f4d57f352547c5e5c597228247a93
226d54fdafb14dfd3bab48c1a343c83a5544e060
refs/heads/master
2021-04-29T18:11:57.792778
2018-02-15T23:05:02
2018-02-15T23:05:02
121,687,542
0
0
null
null
null
null
UTF-8
Java
false
false
884
java
package android.support.v7.internal.view.menu; import android.content.Context; import android.support.v7.p008b.C0149c; import android.widget.ImageButton; /* compiled from: MyApp */ class C0180f extends ImageButton implements C0166j { final /* synthetic */ ActionMenuPresenter f692a; public C0180f(ActionMenuPresenter actionMenuPresenter, Context context) { this.f692a = actionMenuPresenter; super(context, null, C0149c.actionOverflowButtonStyle); setClickable(true); setFocusable(true); setVisibility(0); setEnabled(true); } public boolean performClick() { if (!super.performClick()) { playSoundEffect(0); this.f692a.m1237a(); } return true; } public boolean mo206c() { return false; } public boolean mo207d() { return false; } }
[ "sydney@eff.org" ]
sydney@eff.org
2cb2a29415c7ae2b66aeae8ec80ed2ec8e596866
7aca27cf2bd654ddd112d1ace75bba11b4c53d84
/Strategy Pattern/src/behaviors/ClingyBehavior.java
55b6c74f39dd1dab58aaafc2a2ed30f96aab2607
[]
no_license
joshbarcher/IT426_Fall2018_6081
865246ee23a9199b21f31fc8b0e68101b25aa45c
11c9ea9377f654e52eb76acc181ac89e7d542d65
refs/heads/master
2020-03-28T21:46:10.276976
2018-11-29T23:00:02
2018-11-29T23:00:02
149,180,998
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
package behaviors; public class ClingyBehavior implements IBehavior { @Override public void act() { System.out.println("Don't go away, not now?!"); } }
[ "jarcher@greenriver.edu" ]
jarcher@greenriver.edu
34add07dcb993720afbfc19bae3779339e4f4b59
eec92a39ffedd7601d7bee56fd95a419fc0dba62
/zookeeper-exercise/zookeeper/src/java/main/org/apache/jute/compiler/JCompType.java
fe1cff015ce81d97fde8b690af4a856fd3c80333
[ "Apache-2.0" ]
permissive
tkobayas/example-projects
b8c63e833f5dc2e730a6e4ec8213399b0fbea93c
2cc46eb58ba7b6de19534e7a8f6abde545fdd327
refs/heads/master
2023-05-01T07:27:11.978316
2022-06-29T09:57:47
2022-06-29T09:57:47
3,946,094
2
6
null
2023-04-14T19:33:39
2012-04-06T02:16:49
Java
UTF-8
Java
false
false
1,995
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jute.compiler; /** * Abstract base class for all the "compound" types such as ustring, * buffer, vector, map, and record. */ abstract class JCompType extends JType { /** Creates a new instance of JCompType */ JCompType(String cType, String cppType, String javaType, String suffix, String wrapper) { super(cType, cppType, javaType, suffix, wrapper, null); } String genCppGetSet(String fname, int fIdx) { String cgetFunc = " virtual const "+getCppType()+"& get"+fname+"() const {\n"; cgetFunc += " return m"+fname+";\n"; cgetFunc += " }\n"; String getFunc = " virtual "+getCppType()+"& get"+fname+"() {\n"; getFunc += " bs_.set("+fIdx+");return m"+fname+";\n"; getFunc += " }\n"; return cgetFunc + getFunc; } String genJavaCompareTo(String fname) { return " ret = "+fname+".compareTo(peer."+fname+");\n"; } String genJavaEquals(String fname, String peer) { return " ret = "+fname+".equals("+peer+");\n"; } String genJavaHashCode(String fname) { return " ret = "+fname+".hashCode();\n"; } }
[ "toshiyakobayashi@gmail.com" ]
toshiyakobayashi@gmail.com
46df138cf90e52427188d267212ff737e068c7c9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_4997e70d1c263b375a227cba9077576d2b55fa49/Messages/34_4997e70d1c263b375a227cba9077576d2b55fa49_Messages_t.java
9d60376ef32af47a474fda8bf706788e8b8bc0a6
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,515
java
/* * Copyright 2011 Sebastian Köhler <sebkoehler@whoami.org.uk>. * * 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 uk.org.whoami.authme.settings; import java.io.File; import java.util.HashMap; import org.bukkit.util.config.Configuration; public class Messages extends Configuration { private static Messages singleton = null; private HashMap<String, String> map; private Messages() { super(new File(Settings.MESSAGE_FILE)); map = new HashMap<String, String>(); loadDefaults(); loadFile(); } private void loadDefaults() { map.put("logged_in", "&cAlready logged in!"); map.put("not_logged_in", "&cNot logged in!"); map.put("reg_disabled", "&cRegistration is disabled"); map.put("user_regged", "&cUsername already registered"); map.put("usage_reg", "&cUsage: /register password"); map.put("usage_log", "&cUsage: /login password"); map.put("user_unknown", "&cUsername not registered"); map.put("pwd_changed", "&cPassword changed!"); map.put("reg_only", "Registered players only! Please visit http://example.com to register"); map.put("valid_session", "&cSession login"); map.put("login_msg", "&cPlease login with \"/login password\""); map.put("reg_msg", "&cPlease register with \"/register password\""); map.put("timeout", "Login Timeout"); map.put("wrong_pwd", "&cWrong password"); map.put("logout", "&cSuccessful logout"); map.put("usage_unreg", "&cUsage: /unregister password"); map.put("registered", "&cSuccessfully registered!"); map.put("unregistered", "&cSuccessfully unregistered!"); map.put("login", "&cSuccessful login!"); map.put("no_perm", "&cNo Permission"); map.put("same_nick", "Same nick is already playing"); map.put("reg_voluntarily", "You can register your nickname with the server with the command \"/register password\""); map.put("reload", "Configuration and database has been reloaded"); map.put("error", "An error ocurred; Please contact the admin"); map.put("unknown_user", "User is not in database"); } private void loadFile() { this.load(); for (String key : map.keySet()) { if (this.getString(key) == null) { this.setProperty(key, map.get(key)); } else { map.put(key, this.getString(key)); } } this.save(); } public String _(String msg) { String loc = map.get(msg); if (loc != null) { return loc.replace("&", "\u00a7"); } return msg; } public void reload() { loadFile(); } public static Messages getInstance() { if (singleton == null) { singleton = new Messages(); } return singleton; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
7036ebd992569d8d9996315b6ccadad9ba41de8f
99db30cac9ad89c8fc8ffefa819135cebb01d7b1
/GluePS/src/glueps/core/model/Activity.java
d7ced00da3446b9d1c23d9c2712ebbd7b3dccc8e
[]
no_license
METIS-Project/ILDE
b4bbf52c39fae24b7dafda7f0c3684cb3901f201
f6e87f7f08dbe251a26ac78302bc30288142a9dd
refs/heads/master
2021-01-01T16:30:40.596086
2015-02-06T16:45:17
2015-02-06T16:45:17
7,796,946
2
0
null
null
null
null
UTF-8
Java
false
false
7,618
java
package glueps.core.model; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; public class Activity { //@XmlAttribute private String id; private String name; private String description; //TODO By now, the order is the one in the ArrayList of children, unless otherwise specified //private ArrayList<String> nextActivityIds; //Sequencing of the array of children activities, sequencing by default public static final int SEQUENCE = 0; public static final int PARALLEL = 1; public static final int CHOOSE_ONE = 2; private int childrenSequenceMode = SEQUENCE; //TODO: Change this to some kind of Enum? public static final String CLASS = "class"; public static final String INDIVIDUAL = "individual"; public static final String GROUP_SEPARATE = "group"; public static final String GROUP_OPEN = "groupopen"; private String mode; //ie. class, group (open or separate), individual private ArrayList<Activity> childrenActivities; private String parentActivityId; private ArrayList<String> resourceIds; private ArrayList<String> roleIds; //This is the location of the activity in the VLE, once it is deployed (only for live deployments) private URL location; private boolean toDeploy = true; public Activity() { super(); } public Activity(String id, String name, String description, String mode, ArrayList<Activity> childrenActivities, String parentActivityId, ArrayList<String> resourceIds, ArrayList<String> roleIds) { super(); this.id = id; this.name = name; this.description = description; this.mode = mode; this.childrenActivities = childrenActivities; this.parentActivityId = parentActivityId; this.resourceIds = resourceIds; this.roleIds = roleIds; } @XmlAttribute public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getMode() { return mode; } public void setMode(String mode) { this.mode = mode; } public String getParentActivityId() { return parentActivityId; } public void setParentActivityId(String parentActivityId) { this.parentActivityId = parentActivityId; } @XmlElementWrapper @XmlElement(name="resourceId") public ArrayList<String> getResourceIds() { return resourceIds; } public void setResourceIds(ArrayList<String> resourceIds) { this.resourceIds = resourceIds; } @XmlElementWrapper @XmlElement(name="roleId") public ArrayList<String> getRoleIds() { return roleIds; } public void setRoleIds(ArrayList<String> roleIds) { this.roleIds = roleIds; } @XmlElementWrapper @XmlElement(name="activity") public void setChildrenActivities(ArrayList<Activity> childrenActivities) { this.childrenActivities = childrenActivities; } public ArrayList<Activity> getChildrenActivities() { return childrenActivities; } @Override public String toString() { return "Activity [id=" + id + ", name=" + name + ", description=" + description + ", childrenSequenceMode=" + childrenSequenceMode + ", mode=" + mode + ", childrenActivities=" + childrenActivities + ", parentActivityId=" + parentActivityId + ", resourceIds=" + resourceIds + ", roleIds=" + roleIds + "]"; } public void addChild(Activity child){ if(child==null) return; else{ if(childrenActivities==null){ childrenActivities=new ArrayList<Activity>(); } childrenActivities.add(child); } } public void setChildrenSequenceMode(int childrenSequenceMode) { this.childrenSequenceMode = childrenSequenceMode; } public int getChildrenSequenceMode() { return childrenSequenceMode; } public void setChildrenRoleIds(ArrayList<String> arrayList) { //Recursively sets the roles of all children activities to the provided role list if(childrenActivities!=null){ for (Iterator<Activity> it = childrenActivities.iterator();it.hasNext();){ Activity child = (Activity) it.next(); child.setRoleIds(arrayList); child.setChildrenRoleIds(arrayList); } } } public void fixParentActivities() { if(childrenActivities!=null){ for(Iterator it = childrenActivities.iterator();it.hasNext();){ Activity child = (Activity) it.next(); child.parentActivityId = this.id; child.fixParentActivities(); } } return; } public ArrayList<String> getResourceIdsByInstantiable( Design design, boolean instantiable) { ArrayList<String> relevantResourceIds = null; if(design==null || design.getResources()==null || this.resourceIds==null) return null; for(Iterator<String> it = this.resourceIds.iterator();it.hasNext();){ Resource res = design.findResourceById(it.next()); if(res.isInstantiable() == instantiable){ //This is a relevant resource, add it to the array if(relevantResourceIds==null) relevantResourceIds = new ArrayList<String>(); relevantResourceIds.add(res.getId()); } } return relevantResourceIds; } public Activity findChildrenActivityById(String activityId) { if(childrenActivities==null || activityId==null) return null; for(Iterator<Activity> it = childrenActivities.iterator();it.hasNext();){ Activity act = it.next(); if(act.getId().equals(activityId)) return act; else{ act = act.findChildrenActivityById(activityId); if(act!=null) return act; } } return null; } public boolean usesResource(String id) { if(this.resourceIds==null || this.resourceIds.size()==0) return false; for(Iterator<String> it = resourceIds.iterator(); it.hasNext();){ if(it.next().equals(id)) return true; } return false; } //returns a list with the children activities that use the resource (not counting the current activity) public ArrayList<Activity> getChildrenActivitiesUsingResource(String id, ArrayList<Activity> activities) { ArrayList<Activity> newActivities = activities; if(this.getChildrenActivities()!=null && this.getChildrenActivities().size()>0){ for(Iterator<Activity> it = this.getChildrenActivities().iterator();it.hasNext();){//we iterate recursively through the children activities Activity child = it.next(); if(child.usesResource(id)){ if(newActivities==null) newActivities = new ArrayList<Activity>(); newActivities.add(child); newActivities = child.getChildrenActivitiesUsingResource(id, newActivities); } } } return newActivities; } public void setLocation(URL location) { this.location = location; } public URL getLocation() { return location; } public boolean isPerformedOnlyByStaff(Design design) { if(this.roleIds==null || this.roleIds.size()==0) return false;//if we do not have enough information, return false just in case boolean hasStaff = false; for(String rolId : roleIds){ if(design.findRoleById(rolId).isTeacher()) hasStaff = true; else return false;//If there is any non-staff, then it is not performed only by staff! } return hasStaff; } public void setToDeploy(boolean toDeploy) { this.toDeploy = toDeploy; } public boolean isToDeploy() { return toDeploy; } }
[ "javierht@gmail.com" ]
javierht@gmail.com
144167da7126d4112137accdfe220b13c074e4db
072095d6215c7e16061eb639ece16aa8a780b1e0
/src/snapcharts/view/ChartViewUtils.java
e632e87d7a92eaae777d32ea22599a612a7d944f
[]
no_license
reportmill/SnapCharts
e9278c8fcd51e5b90f8cd923e1d463d785d26b8b
98507b51ae8d7f7c104d6fcb4386c1eaaa91e12e
refs/heads/master
2023-07-20T01:48:23.577093
2023-07-12T20:28:23
2023-07-12T20:28:23
236,382,084
7
0
null
null
null
null
UTF-8
Java
false
false
465
java
package snapcharts.view; /** * Some utility methods for ChartView and friends. */ public class ChartViewUtils { /** * Returns the log of given value. */ public static double log10(double aValue) { if (aValue<=0) return 0; return Math.log10(aValue); } /** * Returns the inverse of log10. */ public static double invLog10(double aValue) { return Math.pow(10, aValue); } }
[ "jeff@reportmill.com" ]
jeff@reportmill.com
ca4e15218944cb80cac35e28c95e8c9c24fb3a60
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/lucene-solr/2015/12/DocSetBase.java
a37f049a3abd2feb9aa18bfcc6bc6aa552cda1da
[ "Apache-2.0" ]
permissive
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
7,624
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.solr.search; import java.io.IOException; import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.DocIdSet; import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BitDocIdSet; import org.apache.lucene.util.FixedBitSet; import org.apache.solr.common.SolrException; /** A base class that may be usefull for implementing DocSets */ abstract class DocSetBase implements DocSet { public static FixedBitSet toBitSet(DocSet set) { if (set instanceof DocSetBase) { return ((DocSetBase) set).getBits(); } else { FixedBitSet bits = new FixedBitSet(64); for (DocIterator iter = set.iterator(); iter.hasNext();) { int nextDoc = iter.nextDoc(); bits = FixedBitSet.ensureCapacity(bits, nextDoc); bits.set(nextDoc); } return bits; } } // Not implemented efficiently... for testing purposes only @Override public boolean equals(Object obj) { if (!(obj instanceof DocSet)) return false; DocSet other = (DocSet)obj; if (this.size() != other.size()) return false; if (this instanceof DocList && other instanceof DocList) { // compare ordering DocIterator i1=this.iterator(); DocIterator i2=other.iterator(); while(i1.hasNext() && i2.hasNext()) { if (i1.nextDoc() != i2.nextDoc()) return false; } return true; // don't compare matches } // if (this.size() != other.size()) return false; return this.getBits().equals(toBitSet(other)); } /** * @throws SolrException Base implementation does not allow modifications */ @Override public void add(int doc) { throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Unsupported Operation"); } /** * @throws SolrException Base implementation does not allow modifications */ @Override public void addUnique(int doc) { throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Unsupported Operation"); } /** * Return a {@link FixedBitSet} with a bit set for every document in this * {@link DocSet}. The default implementation iterates on all docs and sets * the relevant bits. You should override if you can provide a more efficient * implementation. */ protected FixedBitSet getBits() { FixedBitSet bits = new FixedBitSet(64); for (DocIterator iter = iterator(); iter.hasNext();) { int nextDoc = iter.nextDoc(); bits = FixedBitSet.ensureCapacity(bits, nextDoc); bits.set(nextDoc); } return bits; } @Override public DocSet intersection(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersection(this); } // Default... handle with bitsets. FixedBitSet newbits = getBits().clone(); newbits.and(toBitSet(other)); return new BitDocSet(newbits); } @Override public boolean intersects(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersects(this); } // less efficient way: get the intersection size return intersectionSize(other) > 0; } @Override public DocSet union(DocSet other) { FixedBitSet otherBits = toBitSet(other); FixedBitSet newbits = FixedBitSet.ensureCapacity(getBits().clone(), otherBits.length()); newbits.or(otherBits); return new BitDocSet(newbits); } @Override public int intersectionSize(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersectionSize(this); } // less efficient way: do the intersection then get its size return intersection(other).size(); } @Override public int unionSize(DocSet other) { return this.size() + other.size() - this.intersectionSize(other); } @Override public DocSet andNot(DocSet other) { FixedBitSet newbits = getBits().clone(); newbits.andNot(toBitSet(other)); return new BitDocSet(newbits); } @Override public int andNotSize(DocSet other) { return this.size() - this.intersectionSize(other); } @Override public Filter getTopFilter() { final FixedBitSet bs = getBits(); return new Filter() { @Override public DocIdSet getDocIdSet(final LeafReaderContext context, Bits acceptDocs) { LeafReader reader = context.reader(); // all Solr DocSets that are used as filters only include live docs final Bits acceptDocs2 = acceptDocs == null ? null : (reader.getLiveDocs() == acceptDocs ? null : acceptDocs); if (context.isTopLevel) { return BitsFilteredDocIdSet.wrap(new BitDocIdSet(bs), acceptDocs); } final int base = context.docBase; final int maxDoc = reader.maxDoc(); final int max = base + maxDoc; // one past the max doc in this segment. return BitsFilteredDocIdSet.wrap(new DocIdSet() { @Override public DocIdSetIterator iterator() { return new DocIdSetIterator() { int pos=base-1; int adjustedDoc=-1; @Override public int docID() { return adjustedDoc; } @Override public int nextDoc() { pos = bs.nextSetBit(pos+1); return adjustedDoc = pos<max ? pos-base : NO_MORE_DOCS; } @Override public int advance(int target) { if (target==NO_MORE_DOCS) return adjustedDoc=NO_MORE_DOCS; pos = bs.nextSetBit(target+base); return adjustedDoc = pos<max ? pos-base : NO_MORE_DOCS; } @Override public long cost() { return bs.length(); } }; } @Override public long ramBytesUsed() { return bs.ramBytesUsed(); } @Override public Bits bits() { // sparse filters should not use random access return null; } }, acceptDocs2); } @Override public String toString(String field) { return "DocSetTopFilter"; } }; } @Override public void addAllTo(DocSet target) { DocIterator iter = iterator(); while (iter.hasNext()) { target.add(iter.nextDoc()); } } /** FUTURE: for off-heap */ @Override public void close() throws IOException { } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
3b54142a7868fd827b26e4a6043965f0df8a88f1
1c02ea2eb17861a958cc661bb843a00a18582744
/extension/src/main/java/com/maxdemarzi/Time.java
e7729fdd26c20041a0befec75d43407f9be6f687
[ "MIT" ]
permissive
jknack/dating_site
76c040a39ee0df9fe4d5d40b59a35eeaca7205ce
6ef4a102a634468694242db4ffa9ff1466b85b6a
refs/heads/master
2023-05-31T22:17:26.722390
2018-08-29T14:48:24
2018-08-29T16:11:56
146,362,969
0
0
MIT
2018-08-27T22:51:10
2018-08-27T22:51:09
null
UTF-8
Java
false
false
719
java
package com.maxdemarzi; import javax.ws.rs.QueryParam; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.TimeZone; public class Time { public static final ZoneId utc = TimeZone.getTimeZone("UTC").toZoneId(); public static final DateTimeFormatter dateFormatter = DateTimeFormatter .ofPattern("yyyy_MM_dd") .withZone(utc); public static ZonedDateTime getLatestTime(@QueryParam("since") String since) { ZonedDateTime latest; if (since == null) { latest = ZonedDateTime.now(utc); } else { latest = ZonedDateTime.parse(since); } return latest; } }
[ "maxdemarzi@hotmail.com" ]
maxdemarzi@hotmail.com
2c465c37b7cb1d709daae2d2482faa81a793e988
ccb69e19fd6cec4917aa5f2f6b705927eb5973d8
/src/main/java/tss/com/pe/mileage/UpdateMileageApplication.java
4fcb043a943251ca2cbf67cdc4e0ffab43412468
[ "Apache-2.0" ]
permissive
zjrstar/AkkaExample
a32a88797b40f64c5b0988962016b340dbbd37dd
64bfd3fcd0dc2f266af1bb8b9137e00b6d56eb47
refs/heads/master
2021-05-01T13:40:10.706283
2016-09-06T17:38:52
2016-09-06T17:38:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,697
java
package tss.com.pe.mileage; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.TypedActor; import akka.event.Logging; import akka.event.LoggingAdapter; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import scala.concurrent.duration.Duration; import tss.com.pe.mileage.actors.Supervisor; import tss.com.pe.mileage.extension.SpringExtension; import java.util.concurrent.TimeUnit; @Configuration @EnableAutoConfiguration @ComponentScan("tss.com.pe.mileage.configuration") public class UpdateMileageApplication { public static void main(String[] args) { ApplicationContext context = SpringApplication.run(UpdateMileageApplication.class, args); ActorSystem system = context.getBean(ActorSystem.class); final LoggingAdapter log = Logging.getLogger(system, "Application"); Long collectorInterval = (Long)context.getBean("getCollectorInterval"); log.info("Starting up mileage collector with collector interval of {}", collectorInterval); SpringExtension ext = context.getBean(SpringExtension.class); // Use the Spring Extension to create props for a named actor bean ActorRef supervisor = system.actorOf( ext.props("supervisor")); system.scheduler().schedule(Duration.Zero(), Duration.create(collectorInterval, TimeUnit.MINUTES), supervisor, Supervisor .START_COLLECTING, system.dispatcher(), null); } }
[ "josediaz@tss.com.pe" ]
josediaz@tss.com.pe
14d133a63737d0951414d3f4d339b47511c7c742
67ed11c728deb72bfcd4dfa01640400476d11103
/src/test/java/assertion/AssertUtils.java
d17e470579c29d09d850d031aee239ce08d6cbe5
[]
no_license
infinitiessoft/AttendenceSystem
f753e8a2f36877d8705adc3a2cbc2924cafee2e0
d43659e627979d4dacf7a29c518aeea33dde99c1
refs/heads/master
2021-01-14T08:50:37.739898
2017-12-14T11:27:43
2017-12-14T11:27:43
48,523,986
1
1
null
null
null
null
UTF-8
Java
false
false
1,009
java
package assertion; import static org.junit.Assert.assertEquals; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import exceptions.ErrorMessage; public class AssertUtils { private AssertUtils() { } public static void assertNotFound(Response response) { assertSafeError(Status.NOT_FOUND.getStatusCode(), response); } public static void assertBadRequest(Response response) { assertSafeError(Status.BAD_REQUEST.getStatusCode(), response); } public static void assertSafeError(int code, Response response) { assertEquals(code, response.getStatus()); ErrorMessage error = response.readEntity(ErrorMessage.class); assertEquals("true", response.getHeaderString("safe")); assertEquals(code, error.getCode()); } public static void assertConflict(Response response) { assertSafeError(Status.CONFLICT.getStatusCode(), response); } public static void assertForbidden(Response response) { assertSafeError(Status.FORBIDDEN.getStatusCode(), response); } }
[ "pohsun@infinitiesoft.com" ]
pohsun@infinitiesoft.com
9a8ab0ad3c5af2be9dc725c9b8fdf992d9970fe4
2284a1a18315e12d10abd3427121d05c45319092
/persistence/rocksdb/src/test/java/org/infinispan/persistence/rocksdb/RocksDBStoreTest.java
4f799c4b3e5abcb2ea4bd60ebf66ade65ebeb557
[ "Apache-2.0" ]
permissive
is00hcw/infinispan
8be2f2a53b652fb1309d9610f78e4499ee4feb9a
7bf7ddf0158f4eeac188092a4af70d5c6420291c
refs/heads/master
2021-01-19T07:35:19.793449
2017-04-06T04:13:11
2017-04-06T04:22:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,991
java
package org.infinispan.persistence.rocksdb; import static org.testng.Assert.assertEquals; import static org.testng.Assert.fail; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.infinispan.commons.util.Util; import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.configuration.cache.PersistenceConfigurationBuilder; import org.infinispan.container.entries.InternalCacheEntry; import org.infinispan.marshall.core.MarshalledEntry; import org.infinispan.persistence.BaseStoreTest; import org.infinispan.persistence.rocksdb.configuration.RocksDBStoreConfigurationBuilder; import org.infinispan.persistence.spi.AdvancedLoadWriteStore; import org.infinispan.persistence.spi.PersistenceException; import org.infinispan.test.TestingUtil; import org.infinispan.test.fwk.TestCacheManagerFactory; import org.infinispan.test.fwk.TestInternalCacheEntryFactory; import org.testng.annotations.AfterClass; import org.testng.annotations.Test; @Test(groups = "unit", testName = "persistence.rocksdb.RocksDBStoreTest") public class RocksDBStoreTest extends BaseStoreTest { private String tmpDirectory = TestingUtil.tmpDirectory(this.getClass()); @AfterClass(alwaysRun = true) protected void clearTempDir() { Util.recursiveFileRemove(tmpDirectory); } protected RocksDBStoreConfigurationBuilder createCacheStoreConfig(PersistenceConfigurationBuilder lcb) { RocksDBStoreConfigurationBuilder cfg = lcb.addStore(RocksDBStoreConfigurationBuilder.class); cfg.location(tmpDirectory + "/data"); cfg.expiredLocation(tmpDirectory + "/expiry"); cfg.clearThreshold(2); return cfg; } @Override protected AdvancedLoadWriteStore createStore() throws Exception { clearTempDir(); RocksDBStore fcs = new RocksDBStore(); ConfigurationBuilder cb = TestCacheManagerFactory.getDefaultCacheConfiguration(false); createCacheStoreConfig(cb.persistence()); fcs.init(createContext(cb.build())); return fcs; } @Test(groups = "stress") public void testConcurrentWriteAndRestart() { concurrentWriteAndRestart(true); } @Test(groups = "stress") public void testConcurrentWriteAndStop() { concurrentWriteAndRestart(true); } private void concurrentWriteAndRestart(boolean start) { final int THREADS = 4; final AtomicBoolean run = new AtomicBoolean(true); final AtomicInteger writtenPre = new AtomicInteger(); final AtomicInteger writtenPost = new AtomicInteger(); final AtomicBoolean post = new AtomicBoolean(false); final CountDownLatch started = new CountDownLatch(THREADS); final CountDownLatch finished = new CountDownLatch(THREADS); for (int i = 0; i < THREADS; ++i) { final int thread = i; fork(new Runnable() { @Override public void run() { try { started.countDown(); int i = 0; while (run.get()) { InternalCacheEntry entry = TestInternalCacheEntryFactory.create("k" + i, "v" + i); MarshalledEntry me = TestingUtil.marshalledEntry(entry, getMarshaller()); try { AtomicInteger record = post.get() ? writtenPost : writtenPre; cl.write(me); ++i; int prev; do { prev = record.get(); if ((prev & (1 << thread)) != 0) break; } while (record.compareAndSet(prev, prev | (1 << thread))); } catch (PersistenceException e) { // when the store is stopped, exceptions are thrown } } } catch (Exception e) { log.error("Failed", e); throw new RuntimeException(e); } finally { finished.countDown(); } } }); } try { if (!started.await(30, TimeUnit.SECONDS)) { fail(); } Thread.sleep(1000); cl.stop(); post.set(true); Thread.sleep(1000); if (start) { cl.start(); Thread.sleep(1000); } } catch (InterruptedException e) { fail(); } finally { run.set(false); } try { if (!finished.await(30, TimeUnit.SECONDS)) { fail(); } } catch (InterruptedException e) { fail(); } assertEquals(writtenPre.get(), (1 << THREADS) - 1, "pre"); if (start) { assertEquals(writtenPost.get(), (1 << THREADS) - 1, "post"); } else { assertEquals(writtenPost.get(), 0, "post"); } } }
[ "remerson@redhat.com" ]
remerson@redhat.com
857e24f3930979915377e69bbd082bc032301774
7babc8d969e1e0878a1917901b10c1777c128b03
/ddl-learn/src/main/java/com/ddl/guava/eventbus/listeners/DeadEventListener.java
07ec5a3e71c9dbc9feeb341519582724b69e018f
[]
no_license
vigour0423/ddlall
430912dde1a3cd881d29b017f2952ec4b727d852
7915abf5f9e93391cefdbb8d75952b6755fcca48
refs/heads/master
2022-12-25T05:29:28.990336
2020-05-14T15:43:05
2020-05-14T15:43:05
154,122,468
0
2
null
2022-12-16T09:45:08
2018-10-22T10:05:15
Java
UTF-8
Java
false
false
325
java
package com.ddl.guava.eventbus.listeners; import com.google.common.eventbus.DeadEvent; import com.google.common.eventbus.Subscribe; public class DeadEventListener { @Subscribe public void handle(DeadEvent event) { System.out.println(event.getSource()); System.out.println(event.getEvent()); } }
[ "489582986@qq.com" ]
489582986@qq.com
2575a32c09fb71913dbe91c11645f572eab49be3
5fb2cfa8797dd187d41cdaffa0114577db320439
/jspwiki-main/src/main/java/org/apache/wiki/tags/AttachmentsIteratorTag.java
1825aca2880a15df066326243e7c42e11ace78f5
[ "Apache-2.0", "MPL-2.0", "DOC", "MIT" ]
permissive
YYTVicky/jspwiki
b09f719f6093a5ff2e5a0b467aaaa961ec8b4d10
70b667758b3cd7ee23b748b1896e467fc02bd5a6
refs/heads/master
2021-02-21T07:23:31.110507
2020-03-05T15:37:55
2020-03-05T15:37:55
245,353,137
0
0
Apache-2.0
2020-03-06T07:11:42
2020-03-06T07:11:42
null
UTF-8
Java
false
false
4,518
java
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.apache.wiki.tags; import org.apache.log4j.Logger; import org.apache.wiki.WikiContext; import org.apache.wiki.WikiPage; import org.apache.wiki.api.core.Engine; import org.apache.wiki.api.exceptions.ProviderException; import org.apache.wiki.attachment.Attachment; import org.apache.wiki.attachment.AttachmentManager; import org.apache.wiki.pages.PageManager; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.PageContext; import java.io.IOException; import java.util.List; /** * Iterates through the list of attachments one has. * * <P><B>Attributes</B></P> * <UL> * <LI>page - Page name to refer to. Default is the current page. * </UL> * * @since 2.0 */ // FIXME: Too much in common with IteratorTag - REFACTOR public class AttachmentsIteratorTag extends IteratorTag { private static final long serialVersionUID = 0L; private static final Logger log = Logger.getLogger( AttachmentsIteratorTag.class ); /** * {@inheritDoc} */ @Override public final int doStartTag() { m_wikiContext = (WikiContext) pageContext.getAttribute( WikiContext.ATTR_CONTEXT, PageContext.REQUEST_SCOPE ); final Engine engine = m_wikiContext.getEngine(); final AttachmentManager mgr = engine.getManager( AttachmentManager.class ); final WikiPage page; page = m_wikiContext.getPage(); if( !mgr.attachmentsEnabled() ) { return SKIP_BODY; } try { if( page != null && engine.getManager( PageManager.class ).wikiPageExists(page) ) { final List< Attachment > atts = mgr.listAttachments( page ); if( atts == null ) { log.debug("No attachments to display."); // There are no attachments included return SKIP_BODY; } m_iterator = atts.iterator(); if( m_iterator.hasNext() ) { final Attachment att = (Attachment) m_iterator.next(); final WikiContext context = (WikiContext)m_wikiContext.clone(); context.setPage( att ); pageContext.setAttribute( WikiContext.ATTR_CONTEXT, context, PageContext.REQUEST_SCOPE ); pageContext.setAttribute( getId(), att ); } else { return SKIP_BODY; } } else { return SKIP_BODY; } return EVAL_BODY_BUFFERED; } catch( final ProviderException e ) { log.fatal("Provider failed while trying to iterator through history",e); // FIXME: THrow something. } return SKIP_BODY; } /** * {@inheritDoc} */ @Override public final int doAfterBody() { if( bodyContent != null ) { try { final JspWriter out = getPreviousOut(); out.print(bodyContent.getString()); bodyContent.clearBody(); } catch( final IOException e ) { log.error("Unable to get inner tag text", e); // FIXME: throw something? } } if( m_iterator != null && m_iterator.hasNext() ) { final Attachment att = ( Attachment )m_iterator.next(); final WikiContext context = ( WikiContext )m_wikiContext.clone(); context.setPage( att ); pageContext.setAttribute( WikiContext.ATTR_CONTEXT, context, PageContext.REQUEST_SCOPE ); pageContext.setAttribute( getId(), att ); return EVAL_BODY_BUFFERED; } return SKIP_BODY; } }
[ "juanpablo@apache.org" ]
juanpablo@apache.org
2dd56374e505c8851d9b354e7006cf7492c5c907
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/easygene-20210315/src/main/java/com/aliyun/easygene20210315/models/ListUserActiveRunsRequest.java
328648c55e02f0a823883065b47b497afabd826f
[ "Apache-2.0" ]
permissive
aliyun/alibabacloud-java-sdk
83a6036a33c7278bca6f1bafccb0180940d58b0b
008923f156adf2e4f4785a0419f60640273854ec
refs/heads/master
2023-09-01T04:10:33.640756
2023-09-01T02:40:45
2023-09-01T02:40:45
288,968,318
40
45
null
2023-06-13T02:47:13
2020-08-20T09:51:08
Java
UTF-8
Java
false
false
683
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.easygene20210315.models; import com.aliyun.tea.*; public class ListUserActiveRunsRequest extends TeaModel { @NameInMap("MaxResults") public Integer maxResults; public static ListUserActiveRunsRequest build(java.util.Map<String, ?> map) throws Exception { ListUserActiveRunsRequest self = new ListUserActiveRunsRequest(); return TeaModel.build(map, self); } public ListUserActiveRunsRequest setMaxResults(Integer maxResults) { this.maxResults = maxResults; return this; } public Integer getMaxResults() { return this.maxResults; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7ae8b2db9684ad93925b68719d2e263798103bb5
a5a1f6d45a3f8e602501fddd6c86d9bd61877e6a
/ch3/spring-dependency-injection-context-replace/src/main/java/jun/prospring5/ch3/Main.java
846fa12be200f2f116f2238d2bbc0ad0b8cb66f6
[ "MIT" ]
permissive
jdcsma/prospring5
8318c9e7510462ab40079e8da1e45eed600e036d
3ee9d91f91b0a2fc6e1fc78b770f5c6f1f5f33b4
refs/heads/master
2022-12-22T12:36:20.430682
2019-06-28T10:07:00
2019-06-28T10:07:00
185,557,154
0
0
MIT
2022-12-16T00:37:09
2019-05-08T07:42:15
JavaScript
UTF-8
Java
false
false
1,245
java
package jun.prospring5.ch3; import org.springframework.context.support.GenericXmlApplicationContext; import org.springframework.util.StopWatch; public class Main { public static void main(String[] args) { GenericXmlApplicationContext applicationContext = new GenericXmlApplicationContext(); applicationContext.load("app-context-xml.xml"); applicationContext.refresh(); ReplacementTarget replacementTarget = (ReplacementTarget) applicationContext.getBean("replacementTarget"); ReplacementTarget standardTarget = (ReplacementTarget) applicationContext.getBean("standardTarget"); displayInfo(replacementTarget); displayInfo(standardTarget); } private static void displayInfo(ReplacementTarget rt) { System.out.println(rt.formatMessage("Thanks for playing, try again!")); StopWatch sw = new StopWatch(); sw.start("test"); for (int i = 0; i < 1000000; i++) { String out = rt.formatMessage("No filter in my head"); // System.out.println(out); } sw.stop(); System.out.println("1000000 invocations took: " + sw.getTotalTimeMillis() + " ms"); } }
[ "jdcsma@163.com" ]
jdcsma@163.com
e280b51dc5fe3c7d93e7d559ea0679f8dd6d2710
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/12/12_3a74fd5c6728740dc9db158c221211c19f97d499/AmbiguousAlphabet/12_3a74fd5c6728740dc9db158c221211c19f97d499_AmbiguousAlphabet_t.java
530178ceac8c9a94e064e04acd189edcd505d36d
[]
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,588
java
package com.java.hackermeter.recursion; import java.util.*; /** * A couple of friends are afraid of their nosy roommates looking at their LINE history, so they have the following discussion: * * X: I really don't want my messages to be read...let's start encrypting our messages. We'll replace each letter with a number. 'A' is 1, 'B' is 2, and so on... * Y: What. The. ****. * X: It'll be great! * Y: I guess you didn't study cryptography in college. But, just to let you know, that would let you decode words in different ways. For example, "ABBA" is the same as "LU". * X: Maybe there aren't that many ways to do it? * Y: Well, THAT we can find out. Where's your laptop? * * --- * * The first line of the input will be an integer N (1 <= N <= 1000). * * The following N lines each contain a string S comprised only of digits (no spaces or special characters - just digits). * * For each test case, print the number of different ways there are to decrypt S. */ public class AmbiguousAlphabet { public static void run(Scanner scanner) { //Code here! String numStr = scanner.nextLine(); //String numStr = "25110"; int length = numStr.toCharArray().length; int[] s = new int[length]; for(int i = 0; i < length; i++) { s[i] = Character.getNumericValue(numStr.charAt(i)); } int x = perms(s, 0); System.out.println(x); } public static int perms(int[] s, int count) { //base case for(int i = 0; i < s.length; i++) { if(s[0] == 0 || //kinda sloppy, i know s[i] > 26 || //what comes after 'Z' ? (s[i] == 0 && s[i-1] > 2) || //is it 0 or 20 ? (s[i] == 0 && s[i-1] < 1)) //it it 0 or 10 ? ( merge with prev statement ?) return count; } count++; for(int j = 1; j < s.length; j++) { int[] s2 = Arrays.copyOf(s, s.length); if(s2[j-1] == 0) continue; if(s2[j-1] > 9) s2[j-1] = s2[j-1]%10; s2[j] = (s[j-1]*10) + s[j]; count = perms(Arrays.copyOfRange(s2, j, s2.length), count); } return count; } public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int cases = Integer.parseInt(scanner.nextLine()); for(int i = 0; i < cases; i++) { run(scanner); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9be226758e2e5570e5d6243277995f4befa4b273
6fad62a1dcd3142f7589cae781ee884fa990eb2f
/CommonModule/src/main/java/com/ddtkj/commonmodule/MVP/View/Implement/Activity/Common_Act_NetworkError_Implement.java
3431449682f557ea9fc4633a67f56474bb3a864f
[]
no_license
fhlxyzczq0001/AndroidStudio_GrabRedEnvelope
f825364609731ea2e6c23aaba4d7d83bcc510816
93b3f9d38f153d15a2e2d546d0de21aea229000d
refs/heads/master
2020-03-22T21:19:48.114595
2018-08-11T08:17:49
2018-08-11T08:17:49
140,232,683
0
0
null
null
null
null
UTF-8
Java
false
false
2,005
java
package com.ddtkj.commonmodule.MVP.View.Implement.Activity; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.chenenyu.router.annotation.Route; import com.ddtkj.commonmodule.Base.Common_View_BaseActivity; import com.ddtkj.commonmodule.Public.Common_RouterUrl; import com.ddtkj.commonmodule.R; import com.utlis.lib.ViewUtils; /** * 网络异常显示界面 * * @author: Administrator 杨重诚 * @date: 2016/10/25:13:38 */ @Route(Common_RouterUrl.MAIN_NetworkErrorRouterUrl) public class Common_Act_NetworkError_Implement extends Common_View_BaseActivity { //显示图片 ImageView mImg; //点击重试 TextView mPromptInformation; public static int NO_NETWORK=0;//无网络 public static int NO_PING=1;//不能访问外网 public static int NO_REQUEST=2;//无数据 @Override public void onClick(View v) { super.onClick(v); if(v.getId()== R.id.prompt_information){ finish(); } } @Override protected void initMyView() { //显示图片 mImg=(ImageView)findViewById(R.id.img); //点击重试 mPromptInformation=(TextView)findViewById(R.id.prompt_information); mPromptInformation.setBackgroundDrawable(ViewUtils.getGradientDrawable(getResources().getDimension(R.dimen.x2),1,getResources().getColor(R.color.app_color),getResources().getColor(R.color.white))); } @Override protected void setContentView() { contentView= R.layout.common_act_network_error_layout; setContentView(contentView); } @Override protected void init() { } @Override protected void setListeners() { mPromptInformation.setOnClickListener(this); } @Override protected void setTitleBar() { //设置Actionbar setActionbarBar("网络异常", R.color.white, R.color.app_text_normal_color, true,true); } @Override protected void getData() { } }
[ "387776364@qq.com" ]
387776364@qq.com
45ac8b54ee825fd7b1c4d222f9a2c9e9190faf15
63c650e67fbaaf946777e7f803c7ef004803c8e2
/src/main/java/ipfilter/IpRange.java
a901a61ab477e991ce4d7c4cb1d2c426cd9de8b6
[]
no_license
madvirus/ipfilter-parser
5e427000ae0c5d5cd91535e712af768b6240f183
d46eafd344eff634bb0228b8177e14701b11c73a
refs/heads/master
2021-01-18T00:07:10.917482
2015-07-30T06:10:06
2015-07-30T06:10:06
39,800,534
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package ipfilter; public class IpRange { private String range; public IpRange(String range) { this.range = range; } public boolean ipIn(String ip) { return false; } @Override public String toString() { return "IpRange{" + "range='" + range + '\'' + '}'; } @Override public boolean equals(Object other) { if (this == other) return true; if (other == null || getClass() != other.getClass()) return false; IpRange that = (IpRange) other; return !(range != null ? !range.equals(that.range) : that.range != null); } }
[ "madvirus@madvirus.net" ]
madvirus@madvirus.net
3f136afb2b25fa6a30059d2a3da32a9b4ad71a86
9044fd0c93348d2aaef5b3b5cb5268032e5897b6
/mynlp-pinyin/src/test/java/com/mayabot/nlp/pinyin/PinyinTest.java
7430781805b4ad58da8eeeb28c5a68dd52804d98
[ "Apache-2.0" ]
permissive
sunxuening/mynlp
94a227a648d102487a4f167afb9741e17f302ece
638bdf1c918a48e819d8107c4e2268a5770133c3
refs/heads/master
2020-04-11T21:30:57.993608
2018-12-17T06:30:51
2018-12-17T06:30:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,114
java
/* * Copyright 2018 mayabot.com authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mayabot.nlp.pinyin; import com.mayabot.nlp.Mynlps; import org.junit.Assert; import org.junit.Test; public class PinyinTest { @Test public void testSpeed() { Mynlps.getInstance(PinyinDictionary.class); long t1 = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { Mynlps.getInstance(PinyinDictionary.class); } long t2 = System.currentTimeMillis(); System.out.println(t2 - t1); } @Test public void test() { PinyinResult result = Pinyins.convert("123aed,.你好朝朝暮暮,银行"); Assert.assertEquals("",result.asString(),"1 2 3 a e d ni hao zhao zhao mu mu yin hang"); Assert.assertEquals("",result.asHeadString(),"1 2 3 a e d n h z z m m y h"); } @Test public void testShow() { PinyinResult result = Pinyins.convert("招商银行推出朝朝盈理财产品"); System.out.println(result.asList()); System.out.println(result.asHeadList()); System.out.println(result.asHeadString()); System.out.println(result.asHeadString("")); System.out.println(result.asString()); System.out.println(result.asString("|")); } @Test public void test2() { Mynlps.clear(); Mynlps.install(builder -> { builder.set(PinyinDictionary.pinyinExtDicSetting, "pinyin.txt"); }); Pinyins.reset(); PinyinResult result = Pinyins.convert("123aed,.你好朝朝暮暮,银行"); Assert.assertEquals("", result.asString(), "1 2 3 a e d ni hao zhao zhao mu mu yin hang"); Assert.assertEquals("", result.asHeadString(), "1 2 3 a e d n h z z m m y h"); System.out.println(Pinyins.convert("朝朝盈")); } @Test public void test3() { Mynlps.clear(); PinyinDictionary pinyinService = Mynlps.getInstance(PinyinDictionary.class); CustomPinyin customPinyin = pinyinService.getCustomPinyin(); customPinyin.put("朝朝盈", "zhao1,zhao1,yin2"); pinyinService.rebuild(); PinyinResult result = pinyinService.text2Pinyin("123aed,.你好朝朝暮暮,银行"); Assert.assertEquals("", result.asString(), "1 2 3 a e d ni hao zhao zhao mu mu yin hang"); Assert.assertEquals("", result.asHeadString(), "1 2 3 a e d n h z z m m y h"); Assert.assertEquals("", pinyinService.text2Pinyin("朝朝盈").asString(), "zhao zhao yin"); } }
[ "jimichan@mayabot.com" ]
jimichan@mayabot.com
a7689c9ccf16dd5438eb12e4937986cc8d04fa3a
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/HyperSQL/HyperSQL3764.java
cee744d88c6b7ff0f11d4a8d7d5f6b13ecb2d59c
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
641
java
public Collation getCollation(Session session, String name, String schemaName) { Collation collation = null; if (schemaName == null || SqlInvariants.INFORMATION_SCHEMA.equals(schemaName)) { try { collation = Collation.getCollation(name); } catch (HsqlException e) {} } if (collation == null) { schemaName = session.getSchemaName(schemaName); collation = (Collation) getSchemaObject(name, schemaName, SchemaObject.COLLATION); } return collation; }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
0df770b355dff2aafbc4d92f597ae7295ac4ca23
da68f9ca0a9ee47c6756f369a07388ac84030988
/src/tailor/datasource/xml/description/GroupDescriptionXmlHandler.java
0951e3e978005428342456dc0d13f3a9551196dd
[]
no_license
gilleain/tailor
b25b1685c4687a03e20476f769b4781c560cb4ac
348daa749d2c1dc945f29b512060a7b9f9e06e6d
refs/heads/master
2021-05-02T08:14:02.130570
2020-11-21T22:14:50
2020-11-21T22:14:50
672,955
0
1
null
2020-11-21T15:06:58
2010-05-18T12:30:45
Java
UTF-8
Java
false
false
1,274
java
package tailor.datasource.xml.description; import org.xml.sax.Attributes; import tailor.datasource.xml.DescriptionParseException; import tailor.description.ChainDescription; import tailor.description.Description; import tailor.description.GroupDescription; public class GroupDescriptionXmlHandler implements DescriptionXmlHandler { public GroupDescription create(Attributes attrs, Description parent) throws DescriptionParseException { if (parent instanceof ChainDescription) { ChainDescription chainDescription = (ChainDescription) parent; String labelStr = attrs.getValue("label"); String nameStr = attrs.getValue("name"); GroupDescription groupDescription; if (nameStr == null) { groupDescription = new GroupDescription(); } else { groupDescription = new GroupDescription(nameStr); } if (labelStr != null) { groupDescription.setLabel(labelStr); } chainDescription.addGroupDescription(groupDescription); return groupDescription; } else { throw new DescriptionParseException("Invalid parent " + parent.getClass().getSimpleName()); } } }
[ "gilleain.torrance@gmail.com" ]
gilleain.torrance@gmail.com
34cd190138e38f7005aaec983e74bd677f0e025d
455c7836a8831b1cb6299284545470f969c8f684
/ExemploSoma/app/src/main/java/br/com/nuvemapp/exemplosoma/MainActivity.java
5886ba9a082ff1b053bfddcb8c522fec1310c912
[]
no_license
cleitonferreira/WorkAndroid
1e162bdec328c8e38823d7cc97c408fd856a0824
9bba4ad40db53fc3872f0681a80fd0df5ba37f4b
refs/heads/master
2020-12-29T02:32:40.721673
2016-12-10T00:55:14
2016-12-10T00:55:14
49,303,845
1
0
null
null
null
null
UTF-8
Java
false
false
1,045
java
package br.com.nuvemapp.exemplosoma; import android.app.Activity; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void soma(View view){ EditText n1 = (EditText) findViewById(R.id.n1); int n1Num = Integer.parseInt(n1.getText().toString()); EditText n2 = (EditText) findViewById(R.id.n2); int n2Num = Integer.parseInt(n2.getText().toString()); int soma = n1Num + n2Num; Toast.makeText(this,"Resultado: "+soma,Toast.LENGTH_LONG).show(); } }
[ "cleitonferreiraa@hotmail.com" ]
cleitonferreiraa@hotmail.com
37fdfc398b95057cf70ed189df603202a37c2711
12fd0f48511152d67b23ea1f85773b39fc77b9e6
/app/src/main/java/com/sy/piaoliupin/model/VideoMessage.java
9c91ebd2277fa967cc7e8a7189e1861b3ea50528
[]
no_license
jiangadmin/PiaoLiuPin
b7ccc1f34132fa4739a57f8412878397e7451ebc
aff61c16602f56b2c3fdab2d98f0b4da7afdef60
refs/heads/master
2020-03-17T00:19:48.819337
2018-05-24T11:44:52
2018-05-24T11:44:52
133,112,281
0
1
null
null
null
null
UTF-8
Java
false
false
6,664
java
package com.sy.piaoliupin.model; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.ThumbnailUtils; import android.provider.MediaStore; import android.view.View; import android.widget.ImageView; import com.tencent.imsdk.TIMCallBack; import com.tencent.imsdk.TIMMessage; import com.tencent.imsdk.TIMSnapshot; import com.tencent.imsdk.TIMVideo; import com.tencent.imsdk.TIMVideoElem; import com.sy.piaoliupin.MyApplication; import com.sy.piaoliupin.R; import com.sy.piaoliupin.adapters.ChatAdapter; import com.sy.piaoliupin.ui.VideoActivity; import com.sy.piaoliupin.utils.FileUtil; import com.sy.piaoliupin.utils.LogUtil; import com.sy.piaoliupin.utils.MediaUtil; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; /** * 小视频消息数据 */ public class VideoMessage extends Message { private static final String TAG = "VideoMessage"; public VideoMessage(TIMMessage message) { this.message = message; } public VideoMessage(String fileName) { message = new TIMMessage(); TIMVideoElem elem = new TIMVideoElem(); elem.setVideoPath(FileUtil.getCacheFilePath(fileName)); Bitmap thumb = ThumbnailUtils.createVideoThumbnail(FileUtil.getCacheFilePath(fileName), MediaStore.Images.Thumbnails.MINI_KIND); elem.setSnapshotPath(FileUtil.createFile(thumb, new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()))); TIMSnapshot snapshot = new TIMSnapshot(); snapshot.setType("PNG"); snapshot.setHeight(thumb.getHeight()); snapshot.setWidth(thumb.getWidth()); TIMVideo video = new TIMVideo(); video.setType("MP4"); video.setDuaration(MediaUtil.getInstance().getDuration(FileUtil.getCacheFilePath(fileName))); elem.setSnapshot(snapshot); elem.setVideo(video); message.addElement(elem); } public VideoMessage(String filePath, String coverPath, long duration) { message = new TIMMessage(); TIMVideoElem elem = new TIMVideoElem(); elem.setVideoPath(filePath); elem.setSnapshotPath(coverPath); TIMSnapshot snapshot = new TIMSnapshot(); File file = new File(coverPath); int height = 0, width = 0; if (file.exists()) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(coverPath, options); height = options.outHeight; width = options.outWidth; } snapshot.setType("PNG"); snapshot.setHeight(height); snapshot.setWidth(width); TIMVideo video = new TIMVideo(); video.setType("MP4"); video.setDuaration(duration); elem.setSnapshot(snapshot); elem.setVideo(video); message.addElement(elem); } /** * 显示消息 * * @param viewHolder 界面样式 * @param context 显示消息的上下文 */ @Override public void showMessage(final ChatAdapter.ViewHolder viewHolder, final Context context) { clearView(viewHolder); if (checkRevoke(viewHolder)) return; final TIMVideoElem e = (TIMVideoElem) message.getElement(0); switch (message.status()) { case Sending: showSnapshot(viewHolder, BitmapFactory.decodeFile(e.getSnapshotPath(), new BitmapFactory.Options())); break; case SendSucc: final TIMSnapshot snapshot = e.getSnapshotInfo(); if (FileUtil.isCacheFileExist(snapshot.getUuid())) { showSnapshot(viewHolder, BitmapFactory.decodeFile(FileUtil.getCacheFilePath(snapshot.getUuid()), new BitmapFactory.Options())); } else { snapshot.getImage(FileUtil.getCacheFilePath(snapshot.getUuid()), new TIMCallBack() { @Override public void onError(int i, String s) { LogUtil.e(TAG, "get snapshot failed. code: " + i + " errmsg: " + s); } @Override public void onSuccess() { showSnapshot(viewHolder, BitmapFactory.decodeFile(FileUtil.getCacheFilePath(snapshot.getUuid()), new BitmapFactory.Options())); } }); } final String fileName = e.getVideoInfo().getUuid(); if (!FileUtil.isCacheFileExist(fileName)) { e.getVideoInfo().getVideo(FileUtil.getCacheFilePath(fileName), new TIMCallBack() { @Override public void onError(int i, String s) { LogUtil.e(TAG, "get video failed. code: " + i + " errmsg: " + s); } @Override public void onSuccess() { setVideoEvent(viewHolder, fileName, context); } }); } else { setVideoEvent(viewHolder, fileName, context); } break; } showStatus(viewHolder); } /** * 获取消息摘要 */ @Override public String getSummary() { String str = getRevokeSummary(); if (str != null) return str; return MyApplication.getContext().getString(R.string.summary_video); } /** * 保存消息或消息文件 */ @Override public void save() { } /** * 显示缩略图 */ private void showSnapshot(final ChatAdapter.ViewHolder viewHolder, final Bitmap bitmap) { if (bitmap == null) return; ImageView imageView = new ImageView(MyApplication.getContext()); imageView.setImageBitmap(bitmap); getBubbleView(viewHolder).addView(imageView); } private void showVideo(String path, Context context) { if (context == null) return; Intent intent = new Intent(context, VideoActivity.class); intent.putExtra("path", path); context.startActivity(intent); } private void setVideoEvent(final ChatAdapter.ViewHolder viewHolder, final String fileName, final Context context) { getBubbleView(viewHolder).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showVideo(FileUtil.getCacheFilePath(fileName), context); } }); } }
[ "www.fangmu@qq.com" ]
www.fangmu@qq.com
018a86ad330a4a149764022bbf2cca7d915a0782
16244f3724c622f995c0c0cc5a72d8f6feb2bbdb
/app/src/main/java/app/witkey/live/utils/customviews/CustomEditText.java
01117fb1c9e793fa473986aa5cde178ba15ceb09
[]
no_license
JitendraKumar7/WitKey_Android_V1-2.8.1
1abbdead466393048b234058a5d673854a2b5910
0b39dbe6218d9f28f5b6b6b33e3ce413ce0548ef
refs/heads/master
2020-03-13T08:40:17.754334
2018-04-25T18:32:17
2018-04-25T18:32:17
131,048,197
0
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
package app.witkey.live.utils.customviews; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Typeface; import android.text.Editable; import android.text.Selection; import android.util.AttributeSet; import android.util.Log; import android.widget.EditText; import app.witkey.live.Constants; import app.witkey.live.R; /** * created by developer on 4/22/2016. */ public class CustomEditText extends EditText { private static final String TAG = "EditText"; public CustomEditText(Context context) { super(context); } public CustomEditText(Context context, AttributeSet attrs) { super(context, attrs); setCustomFont(context, attrs); } public CustomEditText(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setCustomFont(context, attrs); } private void setCustomFont(Context ctx, AttributeSet attrs) { TypedArray a = ctx.obtainStyledAttributes(attrs, R.styleable.CustomTextView); String customFont = a.getString(R.styleable.CustomTextView_customFont); setCustomFont(ctx, customFont); a.recycle(); } public boolean setCustomFont(Context ctx, String fontName) { Typeface typeface = null; try { if (fontName == null) { fontName = Constants.DEFAULT_FONT_NAME_FOR_ET; } typeface = Typeface.createFromAsset(ctx.getAssets(), "fonts/" + fontName); } catch (Exception e) { Log.e(TAG, "Unable to load typeface: " + e.getMessage()); return false; } setTypeface(typeface); return true; } protected void setSpan_internal(Object span, int start, int end, int flags) { final int textLength = getText().length(); ((Editable) getText()).setSpan(span, start, Math.min(end, textLength), flags); } protected void setCursorPosition_internal(int start, int end) { final int textLength = getText().length(); Selection.setSelection(((Editable) getText()), Math.min(start, textLength), Math.min(end, textLength)); } }
[ "jitendrasoam90@gmail.com" ]
jitendrasoam90@gmail.com
0ceff7d5cc0275cc1fe33620e7ef98d3dc475a3f
92b7cbb3c657170d38d75a5cd646fa3be12fd4bb
/L2J_Mobius_C6_Interlude/dist/game/data/scripts/quests/Q633_InTheForgottenVillage/Q633_InTheForgottenVillage.java
e05fd8357371fd88956f511916034df91c539880
[]
no_license
uvbs/l2j_mobius
1197702ecd2e2b37b4c5a5f98ec665d6b1c0efef
bf4bbe4124497f338cb5ce50c88c06c6280ca50a
refs/heads/master
2020-07-29T20:43:38.851566
2019-08-08T10:29:34
2019-08-08T10:29:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,242
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package quests.Q633_InTheForgottenVillage; import java.util.HashMap; import java.util.Map; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.quest.QuestState; import org.l2jmobius.gameserver.model.quest.State; public class Q633_InTheForgottenVillage extends Quest { private static final String qn = "Q633_InTheForgottenVillage"; // NPCS private static final int MINA = 31388; // ITEMS private static final int RIB_BONE = 7544; private static final int ZOMBIE_LIVER = 7545; // MOBS / DROP chances private static final Map<Integer, Integer> MOBS = new HashMap<>(); static { MOBS.put(21557, 328000); // Bone Snatcher MOBS.put(21558, 328000); // Bone Snatcher MOBS.put(21559, 337000); // Bone Maker MOBS.put(21560, 337000); // Bone Shaper MOBS.put(21563, 342000); // Bone Collector MOBS.put(21564, 348000); // Skull Collector MOBS.put(21565, 351000); // Bone Animator MOBS.put(21566, 359000); // Skull Animator MOBS.put(21567, 359000); // Bone Slayer MOBS.put(21572, 365000); // Bone Sweeper MOBS.put(21574, 383000); // Bone Grinder MOBS.put(21575, 383000); // Bone Grinder MOBS.put(21580, 385000); // Bone Caster MOBS.put(21581, 395000); // Bone Puppeteer MOBS.put(21583, 397000); // Bone Scavenger MOBS.put(21584, 401000); // Bone Scavenger } private static final Map<Integer, Integer> UNDEADS = new HashMap<>(); static { UNDEADS.put(21553, 347000); // Trampled Man UNDEADS.put(21554, 347000); // Trampled Man UNDEADS.put(21561, 450000); // Sacrificed Man UNDEADS.put(21578, 501000); // Behemoth Zombie UNDEADS.put(21596, 359000); // Requiem Lord UNDEADS.put(21597, 370000); // Requiem Behemoth UNDEADS.put(21598, 441000); // Requiem Behemoth UNDEADS.put(21599, 395000); // Requiem Priest UNDEADS.put(21600, 408000); // Requiem Behemoth UNDEADS.put(21601, 411000); // Requiem Behemoth } public Q633_InTheForgottenVillage() { super(633, qn, "In the Forgotten Village"); registerQuestItems(RIB_BONE, ZOMBIE_LIVER); addStartNpc(MINA); addTalkId(MINA); for (int i : MOBS.keySet()) { addKillId(i); } for (int i : UNDEADS.keySet()) { addKillId(i); } } @Override public String onAdvEvent(String event, NpcInstance npc, PlayerInstance player) { String htmltext = event; QuestState st = player.getQuestState(qn); if (st == null) { return htmltext; } if (event.equals("31388-04.htm")) { st.setState(State.STARTED); st.set("cond", "1"); st.playSound(QuestState.SOUND_ACCEPT); } else if (event.equals("31388-10.htm")) { st.takeItems(RIB_BONE, -1); st.playSound(QuestState.SOUND_GIVEUP); st.exitQuest(true); } else if (event.equals("31388-09.htm")) { if (st.getQuestItemsCount(RIB_BONE) >= 200) { htmltext = "31388-08.htm"; st.takeItems(RIB_BONE, 200); st.rewardItems(57, 25000); st.rewardExpAndSp(305235, 0); st.playSound(QuestState.SOUND_FINISH); } st.set("cond", "1"); } return htmltext; } @Override public String onTalk(NpcInstance npc, PlayerInstance player) { QuestState st = player.getQuestState(qn); String htmltext = getNoQuestMsg(); if (st == null) { return htmltext; } switch (st.getState()) { case State.CREATED: htmltext = (player.getLevel() < 65) ? "31388-03.htm" : "31388-01.htm"; break; case State.STARTED: final int cond = st.getInt("cond"); if (cond == 1) { htmltext = "31388-06.htm"; } else if (cond == 2) { htmltext = "31388-05.htm"; } break; } return htmltext; } @Override public String onKill(NpcInstance npc, PlayerInstance player, boolean isPet) { int npcId = npc.getNpcId(); if (UNDEADS.containsKey(npcId)) { PlayerInstance partyMember = getRandomPartyMemberState(player, npc, State.STARTED); if (partyMember == null) { return null; } partyMember.getQuestState(qn).dropItems(ZOMBIE_LIVER, 1, 0, UNDEADS.get(npcId)); } else if (MOBS.containsKey(npcId)) { PlayerInstance partyMember = getRandomPartyMember(player, npc, "1"); if (partyMember == null) { return null; } QuestState st = partyMember.getQuestState(qn); if (st == null) { return null; } if (st.dropItems(RIB_BONE, 1, 200, MOBS.get(npcId))) { st.set("cond", "2"); } } return null; } }
[ "mobius@cyber-wizard.com" ]
mobius@cyber-wizard.com
e4755fca80750e0b1808f52978c315add425d16e
4810a15f89f4481fa2f600386a73983e48c3fdfe
/workspace/ModelBoard/src/kr/co/mlec/service/BoardServiceImpl.java
540f453b2951d644a01c0debb4017a94ecf1b81d
[]
no_license
fship1124/java86
54d779e46f8296ce6fb5e38dd58bd5d8ead92d05
d116fa70af0829675e281f90fc6baa8128f60cc5
refs/heads/master
2022-12-08T17:20:16.713751
2020-08-20T12:18:30
2020-08-20T12:18:30
288,993,715
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
package kr.co.mlec.service; import java.util.HashMap; import java.util.List; import java.util.Map; import kr.co.mlec.board.Board; import kr.co.mlec.board.BoardDAO; import kr.co.mlec.board.Comment; public class BoardServiceImpl implements BoardService{ private BoardDAO dao; public BoardServiceImpl() { dao = new BoardDAO(); } @Override public List<Board> list() throws Exception { return dao.selectList(); } @Override public Map<String, Object> detail(int no) throws Exception { Map<String, Object> detail = new HashMap<>(); detail.put("board", dao.selectListByNo(no)); detail.put("file", dao.selectListFileByNo(no)); return detail; } @Override public void delete(int no) throws Exception { dao.deleteBoard(no); } @Override public void update(Board board) throws Exception { dao.updateBoard(board); } @Override public void commentDelete(int commentNo) throws Exception { dao.deleteComment(commentNo); } @Override public void commentRegist(Comment comment) throws Exception { dao.insertComment(comment); } @Override public void commentUpdate(Comment comment) throws Exception { dao.updateComment(comment); } @Override public List<Comment> listComment(int no) throws Exception { return dao.selectCommentByNo(no); } }
[ "fship1124@gmail.com" ]
fship1124@gmail.com
13269e0a593f8eda2b7da4d5910b91f47a26ae28
1f2693e57a8f6300993aee9caa847d576f009431
/testleo/myfaces-skins2/trinidad-core-api/src/main/java/org/apache/myfaces/trinidad/component/MethodBindingMethodExpression.java
1734ba57b17a725756aa8d2e44ac200d076f3ff7
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
mr-sobol/myfaces-csi
ad80ed1daadab75d449ef9990a461d9c06d8c731
c142b20012dda9c096e1384a46915171bf504eb8
refs/heads/master
2021-01-10T06:11:13.345702
2009-01-05T09:46:26
2009-01-05T09:46:26
43,557,323
0
0
null
null
null
null
UTF-8
Java
false
false
2,499
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.myfaces.trinidad.component; import java.io.Serializable; import javax.el.ELContext; import javax.el.ELException; import javax.el.MethodExpression; import javax.el.MethodInfo; import javax.faces.context.FacesContext; import javax.faces.el.EvaluationException; import javax.faces.el.MethodBinding; @Deprecated class MethodBindingMethodExpression extends MethodExpression implements Serializable { // TODO implement serialization correctly? public MethodBindingMethodExpression(MethodBinding binding) { _binding = binding; } public MethodBinding getMethodBinding() { return _binding; } public MethodInfo getMethodInfo(ELContext context) { Class type = _binding.getType(FacesContext.getCurrentInstance()); return new MethodInfo(null, type, null); } public Object invoke(ELContext elContext, Object[] params) { try { return _binding.invoke(FacesContext.getCurrentInstance(), params); } // Convert EvaluationExceptions into ELExceptions catch (EvaluationException ee) { throw new ELException(ee.getMessage(), ee.getCause()); } } public String getExpressionString() { return _binding.getExpressionString(); } public boolean isLiteralText() { return false; } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof MethodBindingMethodExpression)) return false; MethodBindingMethodExpression that = (MethodBindingMethodExpression) o; return that._binding.equals(_binding); } public int hashCode() { return _binding.hashCode(); } private final MethodBinding _binding; }
[ "lu4242@ea1d4837-9632-0410-a0b9-156113df8070" ]
lu4242@ea1d4837-9632-0410-a0b9-156113df8070
3d5d3d5df1b80fb35e7aa3a650eb1c5f0c09a9d7
562a351abef292b6095250e31c48aab23e2bbb26
/src/test/java/com/openpojo/validation/rule/impl/sampleclasses/AClassImplementingEqualsAndHashCode.java
251143ddff04f39cfdf5396298ed0f455677bafe
[]
no_license
hwaastad/openpojo
93416ab9d76e9ed910a1a02df168686e07350b24
8e23ce713671e8bc4224318fadc9412abbaa4061
refs/heads/master
2021-08-29T02:09:04.332129
2017-12-13T11:30:44
2017-12-13T11:30:44
113,445,409
0
0
null
2017-12-07T11:57:16
2017-12-07T11:57:15
null
UTF-8
Java
false
false
909
java
/* * Copyright (c) 2010-2017 Osman Shoukry * * 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.openpojo.validation.rule.impl.sampleclasses; /** * @author oshoukry */ public class AClassImplementingEqualsAndHashCode { @Override public int hashCode() { return super.hashCode(); } @Override public boolean equals(Object obj) { return super.equals(obj); } }
[ "oshoukry@openpojo.com" ]
oshoukry@openpojo.com
9abc2322d790892a723eb15b00f54e951759e03f
cb762d4b0f0ea986d339759ba23327a5b6b67f64
/src/service/com/joymain/jecs/pm/service/JmiMemberTeamManager.java
55d17121a5658fb16a40a93af125c2c1f14b3cad
[ "Apache-2.0" ]
permissive
lshowbiz/agnt_ht
c7d68c72a1d5fa7cd0e424eabb9159d3552fe9dc
fd549de35cb12a2e3db1cd9750caf9ce6e93e057
refs/heads/master
2020-08-04T14:24:26.570794
2019-10-02T03:04:13
2019-10-02T03:04:13
212,160,437
0
0
null
null
null
null
UTF-8
Java
false
false
1,801
java
package com.joymain.jecs.pm.service; import java.util.List; import com.joymain.jecs.pm.model.JmiMemberTeam; import com.joymain.jecs.service.Manager; import com.joymain.jecs.sys.model.SysUser; import com.joymain.jecs.util.data.CommonRecord; import com.joymain.jecs.util.data.Pager; public interface JmiMemberTeamManager extends Manager { /** * Retrieves all of the jmiMemberTeams */ public List<JmiMemberTeam> getJmiMemberTeams(JmiMemberTeam jmiMemberTeam); /** * Gets jmiMemberTeam's information based on code. * @param code the jmiMemberTeam's code * @return jmiMemberTeam populated jmiMemberTeam object */ public JmiMemberTeam getJmiMemberTeam(final String code); /** * Saves a jmiMemberTeam's information * @param jmiMemberTeam the object to be saved */ public void saveJmiMemberTeam(JmiMemberTeam jmiMemberTeam); /** * Removes a jmiMemberTeam from the database by code * @param code the jmiMemberTeam's code */ public void removeJmiMemberTeam(final String code); //added for getJmiMemberTeamsByCrm public List getJmiMemberTeamsByCrm(CommonRecord crm); //added for getJmiMemberTeamsByCrm public List getJmiMemberTeamsByCrm(CommonRecord crm,Pager pager); /** * @param crm:查询条件 * @param type:查询类型 0:新增 1:修改 * @return:返回是否已经有重复的数据 */ public boolean isExist(CommonRecord crm,String type); /** * 判定当前用户属于某一团队 * @param curUser * @return team code or "root" */ public String getTeamStr(SysUser curUser); /** * 找团队 20150228 w * @param curUser * @return */ public String teamStr(SysUser curUser); }
[ "727736571@qq.com" ]
727736571@qq.com
2dab2ab597d51d5f220902b75b7a303856f42436
f6b90fae50ea0cd37c457994efadbd5560a5d663
/android/nut-dex2jar.src/com/facebook/Request$GraphUserListCallback.java
458df9c001b5d83c896edc786e248234f3f3afd5
[]
no_license
dykdykdyk/decompileTools
5925ae91f588fefa7c703925e4629c782174cd68
4de5c1a23f931008fa82b85046f733c1439f06cf
refs/heads/master
2020-01-27T09:56:48.099821
2016-09-14T02:47:11
2016-09-14T02:47:11
66,894,502
1
0
null
null
null
null
UTF-8
Java
false
false
419
java
package com.facebook; import com.facebook.model.GraphUser; import java.util.List; public abstract interface Request$GraphUserListCallback { public abstract void onCompleted(List<GraphUser> paramList, Response paramResponse); } /* Location: C:\crazyd\work\ustone\odm2016031702\baidu\android\nut-dex2jar.jar * Qualified Name: com.facebook.Request.GraphUserListCallback * JD-Core Version: 0.6.2 */
[ "819468107@qq.com" ]
819468107@qq.com
84c603dd2b18f0d60d76e999cf9988884c12dfdc
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE191_Integer_Underflow/s05/CWE191_Integer_Underflow__int_getCookies_Servlet_predec_52c.java
ed9f0e7c45ee95e4b659fd5bbea8edf70c99fe04
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
2,090
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_getCookies_Servlet_predec_52c.java Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-52c.tmpl.java */ /* * @description * CWE: 191 Integer Underflow * BadSource: getCookies_Servlet Read data from the first cookie using getCookies() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: decrement * GoodSink: Ensure there will not be an underflow before decrementing data * BadSink : Decrement data, which can cause an Underflow * Flow Variant: 52 Data flow: data passed as an argument from one method to another to another in three different classes in the same package * * */ package testcases.CWE191_Integer_Underflow.s05; import testcasesupport.*; import javax.servlet.http.*; public class CWE191_Integer_Underflow__int_getCookies_Servlet_predec_52c { public void badSink(int data , HttpServletRequest request, HttpServletResponse response) throws Throwable { /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ int result = (int)(--data); IO.writeLine("result: " + result); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(int data , HttpServletRequest request, HttpServletResponse response) throws Throwable { /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ int result = (int)(--data); IO.writeLine("result: " + result); } /* goodB2G() - use badsource and goodsink */ public void goodB2GSink(int data , HttpServletRequest request, HttpServletResponse response) throws Throwable { /* FIX: Add a check to prevent an underflow from occurring */ if (data > Integer.MIN_VALUE) { int result = (int)(--data); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too small to decrement."); } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
9664cd1b428f505616ece68acc205c5b3166cdc7
656ce78b903ef3426f8f1ecdaee57217f9fbc40e
/src/org/spongycastle/jcajce/provider/symmetric/Shacal2$KeyGen.java
cfa9aa5e63ac939a135edd995864978cc5a03914
[]
no_license
zhuharev/periscope-android-source
51bce2c1b0b356718be207789c0b84acf1e7e201
637ab941ed6352845900b9d465b8e302146b3f8f
refs/heads/master
2021-01-10T01:47:19.177515
2015-12-25T16:51:27
2015-12-25T16:51:27
48,586,306
8
10
null
null
null
null
UTF-8
Java
false
false
599
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package org.spongycastle.jcajce.provider.symmetric; import org.spongycastle.crypto.CipherKeyGenerator; import org.spongycastle.jcajce.provider.symmetric.util.BaseKeyGenerator; // Referenced classes of package org.spongycastle.jcajce.provider.symmetric: // Shacal2 public static class erator extends BaseKeyGenerator { public erator() { super("Shacal2", 512, new CipherKeyGenerator()); } }
[ "hostmaster@zhuharev.ru" ]
hostmaster@zhuharev.ru
c4e1a17091574027b70186fba1f702604874882f
d2e2b1353f3fbde9db74b643285e377de356eb75
/fr.obeo.bpmn.cmof/src/bpmn2/SubChoreography.java
4cba7ab9c2f0518bf398841cfa69c6c613e29e12
[]
no_license
ajperalt/BPMN-Cmof2Ecore
9a2b74800ddf1f8dbff5345bef48eb131fea162e
addce109a6e263bb7baa54ecb42b75cfc023e04c
refs/heads/master
2021-01-16T18:02:11.917158
2013-07-11T14:55:33
2013-07-11T14:55:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,180
java
/** * <copyright> * </copyright> * * $Id$ */ package bpmn2; import org.eclipse.emf.common.util.EList; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Sub Choreography</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link bpmn2.SubChoreography#getArtifacts <em>Artifacts</em>}</li> * </ul> * </p> * * @see bpmn2.Bpmn2Package#getSubChoreography() * @model * @generated */ public interface SubChoreography extends ChoreographyActivity, FlowElementsContainer { /** * Returns the value of the '<em><b>Artifacts</b></em>' containment reference list. * The list contents are of type {@link bpmn2.Artifact}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Artifacts</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Artifacts</em>' containment reference list. * @see bpmn2.Bpmn2Package#getSubChoreography_Artifacts() * @model containment="true" ordered="false" * @generated */ EList<Artifact> getArtifacts(); } // SubChoreography
[ "ali.takarabt@gmail.com" ]
ali.takarabt@gmail.com
cabbc3712840ca7c165ef2fcfd095c13c6b30372
3144b109eade61ab22c43a5da1863aaa7ff7807d
/src/main/java/org/ict/algorithm/leetcode/string/ReplaceAllQuestionMarkAvoidConsecutiveRepeatingCharacters.java
ba918ea96cc97850e7fb52ff67292e6e759599bb
[]
no_license
xuelianhan/basic-algos
1f3458c1d6790b31a7a8828f5ca8aee7baaa5073
dd9aae141a3f83b95b0bc50fa77af51ad6dac9e9
refs/heads/master
2023-08-31T21:05:29.333204
2023-08-31T06:07:56
2023-08-31T06:07:56
9,878,731
5
0
null
2023-06-15T02:10:19
2013-05-06T03:32:24
Java
UTF-8
Java
false
false
5,011
java
package org.ict.algorithm.leetcode.string; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; /** * Given a string s containing only lowercase English letters and the '?' character, * convert all the '?' characters into lowercase letters * such that the final string does not contain any consecutive repeating characters. * You cannot modify the non '?' characters. * * It is guaranteed that there are no consecutive repeating characters in the given string except for '?'. * * Return the final string after all the conversions (possibly zero) have been made. * If there is more than one solution, return any of them. * It can be shown that an answer is always possible with the given constraints. * * * * Example 1: * * Input: s = "?zs" * Output: "azs" * Explanation: There are 25 solutions for this problem. * From "azs" to "yzs", all are valid. * Only "z" is an invalid modification as the string will consist of consecutive repeating characters in "zzs". * Example 2: * * Input: s = "ubv?w" * Output: "ubvaw" * Explanation: There are 24 solutions for this problem. * Only "v" and "w" are invalid modifications as the strings will consist of consecutive repeating characters in "ubvvw" and "ubvww". * * * Constraints: * * 1 <= s.length <= 100 * s consist of lowercase English letters and '?'. * @author sniper * @date 2022/8/15 * LC1576 */ public class ReplaceAllQuestionMarkAvoidConsecutiveRepeatingCharacters { public static void main(String[] args) { String s = "ubv??w"; //String s = "????????ubv????w??"; //String s = "?zs"; String result = modifyString(s); System.out.println(result); } public String modifyStringV3(String s) { char[] chars = s.toCharArray(); for (int i = 0; i < chars.length; ++i) { if (chars[i] == '?') { // Replace the current '?' with 'a', 'b', or 'c'. for (char curr = 'a'; curr <= 'c'; curr++) { boolean prevUnequal = (i - 1 == - 1 || chars[i - 1] != curr); boolean nextUnequal = (i + 1 == chars.length || curr != chars[i + 1]); if (prevUnequal && nextUnequal) { chars[i] = curr; } } } } return new String(chars); } public String modifyStringV2(String s) { Set<Character> abcSet = new HashSet<>(Arrays.asList('a','b','c')); Set<Character> exceptSet = new HashSet<>(); StringBuilder sb = new StringBuilder(); char prev = '0'; char next = '0'; for (int i = 0; i < s.length(); i++) { exceptSet.clear(); char c = s.charAt(i); if (c == '?') { if (i >= 0 && i < (s.length() - 1)) { next = s.charAt(i+1); } if (prev != '0') { exceptSet.add(prev); } if (next != '0' && next != '?') { exceptSet.add(next); } /** * select anyone character except the ones in exceptSet. */ Set<Character> diff = new HashSet<>(abcSet); diff.removeIf(exceptSet::contains); char replaced = diff.iterator().next(); sb.append(replaced); prev = replaced; } else { sb.append(c); prev = c; } } return sb.toString(); } public static String modifyString(String s) { char[] arr = "abcdefghijklmnopqrstuvwxyz".toCharArray(); Set<Character> exceptSet = new HashSet<>(); StringBuilder sb = new StringBuilder(); char prev = '0'; char next = '0'; for (int i = 0; i < s.length(); i++) { exceptSet.clear(); char c = s.charAt(i); if (c == '?') { if (i >= 0 && i < (s.length() - 1)) { next = s.charAt(i+1); } if (prev != '0') { exceptSet.add(prev); } if (next != '0' && next != '?') { exceptSet.add(next); } /** * select anyone character except the ones in exceptSet. */ char replaced = selectOne(arr, exceptSet); sb.append(replaced); prev = replaced; } else { sb.append(c); prev = c; } } return sb.toString(); } public static char selectOne(char[] arr, Set<Character> exceptSet) { char res = '0'; for (char ch : arr) { if (!exceptSet.contains(ch)) { return ch; } } return res; } }
[ "xueliansniper@gmail.com" ]
xueliansniper@gmail.com
34744b6e78d3551138954d2694ee903035044eff
9006f432fbaccd1d79affa0901d433f0370d2311
/dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientIdentifierAndAttributeAction.java
8121fbe9d61aac8d1de5be5f219aec672a5d8397
[ "BSD-3-Clause" ]
permissive
hispindia/MAHARASHTRA-2.13
173a72b025242221b99cd03969a2c9b456cf8ef8
f50ec5b3ca2c5fabb43058166fd0c0fbbaa946a9
refs/heads/master
2020-05-25T08:42:22.989760
2017-03-21T11:20:34
2017-03-21T11:20:34
84,927,851
0
0
null
null
null
null
UTF-8
Java
false
false
4,928
java
/* * Copyright (c) 2004-2013, University of Oslo * 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 the HISP project nor 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 org.hisp.dhis.caseentry.action.patient; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.patient.Patient; import org.hisp.dhis.patient.PatientAttribute; import org.hisp.dhis.patient.PatientAttributeService; import org.hisp.dhis.patient.PatientIdentifierType; import org.hisp.dhis.patient.PatientService; import org.hisp.dhis.patientattributevalue.PatientAttributeValue; import org.hisp.dhis.patientattributevalue.PatientAttributeValueService; import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramService; import org.springframework.beans.factory.annotation.Autowired; import com.opensymphony.xwork2.Action; /** * @author Chau Thu Tran * * @version $ GetPatientIdentifierAndAttributeAction.java Jan 8, 2014 4:16:30 PM * $ */ public class GetPatientIdentifierAndAttributeAction implements Action { // ------------------------------------------------------------------------- // Dependency // ------------------------------------------------------------------------- @Autowired private ProgramService programService; @Autowired private PatientAttributeService attributeService; @Autowired private PatientAttributeValueService attributeValueService; @Autowired private PatientService patientService; // ------------------------------------------------------------------------- // Getter && Setter // ------------------------------------------------------------------------- private Integer id; public void setId( Integer id ) { this.id = id; } private Integer patientId; public void setPatientId( Integer patientId ) { this.patientId = patientId; } private List<PatientIdentifierType> patientIdentifierTypes; public List<PatientIdentifierType> getPatientIdentifierTypes() { return patientIdentifierTypes; } private List<PatientAttribute> patientAttributes; public List<PatientAttribute> getPatientAttributes() { return patientAttributes; } private Map<Integer, String> attributeValueMaps = new HashMap<Integer, String>(); public Map<Integer, String> getAttributeValueMaps() { return attributeValueMaps; } // ------------------------------------------------------------------------- // Implementation Action // ------------------------------------------------------------------------- @Override public String execute() throws Exception { Program program = programService.getProgram( id ); patientIdentifierTypes = program.getPatientIdentifierTypes(); patientAttributes = program.getPatientAttributes(); Collections.sort( patientAttributes, IdentifiableObjectNameComparator.INSTANCE ); if ( patientId != null ) { Patient patient = patientService.getPatient( patientId ); for ( PatientAttributeValue attributeValue : attributeValueService.getPatientAttributeValues( patient ) ) { attributeValueMaps.put( attributeValue.getPatientAttribute().getId(), attributeValue.getValue() ); } } return SUCCESS; } }
[ "mithilesh.hisp@gmail.com" ]
mithilesh.hisp@gmail.com
db58eafaec9cbfdc5b76f32c5b3163ec9d382a7b
47615faf90f578bdad1fde4ef3edae469d995358
/practise/SCJP5.0 猛虎出閘/第一次練習/unit 9/DecimalFormatTest2.java
db66a1c817aed48f0704ad7d5cf83d6092558bf7
[]
no_license
hungmans6779/JavaWork-student-practice
dca527895e7dbb37aa157784f96658c90cbcf3bd
9473ca55c22f30f63fcd1d84c2559b9c609d5829
refs/heads/master
2020-04-14T01:26:54.467903
2018-12-30T04:52:38
2018-12-30T04:52:38
null
0
0
null
null
null
null
BIG5
Java
false
false
309
java
import java.text.*; public class DecimalFormatTest2 { public static void main(String argv[]) { int total=68*464*4626*35342; System.out.println("總共有 : "+total+" 元."); DecimalFormat df=new DecimalFormat("$####,####,####,####"); System.out.println("總共有 : "+df.format(total)+" 元."); } }
[ "hungmans6779@msn.com" ]
hungmans6779@msn.com
ea3b1fc92436bc085066b45b5a1e9cb197ca72da
073399ae68d52bcbe5fa9bbd9070615041895138
/src/main/java/be/vdab/servlets/AlbumDetailServlet.java
2ca3abfb4e62049a9c99690b414eb306401d363b
[]
no_license
YThibos/Muziek
578408aa17ed22839b1850aef63615cb02efe540
b3122c0d41d37df53df603622bb729500acef1f4
refs/heads/master
2020-12-24T20:24:04.922516
2016-04-28T07:47:53
2016-04-28T07:47:53
57,125,105
0
0
null
null
null
null
UTF-8
Java
false
false
1,331
java
package be.vdab.servlets; import java.io.IOException; import java.util.Collections; 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 be.vdab.services.AlbumService; /** * Servlet implementation class AlbumDetailServlet */ @WebServlet("/albumDetail.htm") public class AlbumDetailServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final String VIEW = "/WEB-INF/JSP/albumdetail.jsp"; private final transient AlbumService albumService = new AlbumService(); /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getParameter("id") != null) { try { request.setAttribute("album", albumService.read(Long.parseLong(request.getParameter("id")))); } catch (NumberFormatException ex) { request.setAttribute("fouten", Collections.singletonMap("album", "Geen geldig album id opgegeven")); } } request.getRequestDispatcher(VIEW).forward(request, response); } }
[ "yannick.thibos@gmail.com" ]
yannick.thibos@gmail.com
4a0629fa1ef9ee324db6018873f96ac0ee4199d4
a9818c7261ce743907ed9bc5c409132479b8eb0f
/src/main/java/gg/steve/mc/tp/framework/cmd/SubCommandType.java
4d8e1606e819d50f5239917176f3bf92ff4f48d3
[]
no_license
nbdSteve/ToolsPlus
7afee928c2f80d3dc4c2d0ff80fb3356ee992284
0fb804aa8058b381761a83105c9d4e6250511659
refs/heads/master
2021-06-17T18:10:30.482568
2021-03-25T13:33:48
2021-03-25T13:33:48
183,634,640
2
1
null
null
null
null
UTF-8
Java
false
false
647
java
package gg.steve.mc.tp.framework.cmd; import gg.steve.mc.tp.cmd.give.GiveSubCmd; import gg.steve.mc.tp.cmd.module.ModuleSubCmd; import gg.steve.mc.tp.framework.cmd.misc.HelpSubCmd; import gg.steve.mc.tp.framework.cmd.misc.ReloadSubCmd; import gg.steve.mc.tp.cmd.tool.ToolSubCmd; public enum SubCommandType { HELP_CMD(new HelpSubCmd()), TOOL_LIST_CMD(new ToolSubCmd()), MODULE_LIST_CMD(new ModuleSubCmd()), GIVE_CMD(new GiveSubCmd()), RELOAD_CMD(new ReloadSubCmd()); private SubCommand sub; SubCommandType(SubCommand sub) { this.sub = sub; } public SubCommand getSub() { return sub; } }
[ "s.goodhill@protonmail.com" ]
s.goodhill@protonmail.com
4dbed5c1f04b3aef6db9d0b4155a8b98ab405d62
c52658f58916b641912485b7a0b2a3a56676dfec
/app/src/main/java/com/journals/ijmrhs/network/NoConnectivityException.java
1515bb4a5b3f9118d36e6737c5f509e2dc3a2195
[]
no_license
suresh429/IJMRHS
b9b396cc74034c5b1fada03daa34ca3013e46ea0
842725ae416b37f7d2a1a9a619e446481339eb93
refs/heads/master
2022-12-30T17:38:45.322596
2020-10-23T12:17:02
2020-10-23T12:17:02
306,626,728
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package com.journals.ijmrhs.network; import java.io.IOException; public class NoConnectivityException extends IOException { @Override public String getMessage() { return "No network available, please check your WiFi or Data connection"; // You can send any message whatever you want from here. } }
[ "ksuresh.unique@gmail.com" ]
ksuresh.unique@gmail.com
8f5f48e4104a53d0188776ce8849d29f981f8a41
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/shiro/authz/permission/WildcardPermissionResolverTest.java
48e70514370ccc8c8d99242b89d0b0fcec5816a5
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
3,113
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.shiro.authz.permission; import org.junit.Assert; import org.junit.Test; public class WildcardPermissionResolverTest { @Test public void testDefaultIsNonCaseSensitive() { WildcardPermissionResolver resolver = new WildcardPermissionResolver(); Assert.assertFalse("Default sensitivity should be false", resolver.isCaseSensitive()); /* this is a round-about test as permissions don't store case sensitivity just lower case the string. */ WildcardPermission permission = ((WildcardPermission) (resolver.resolvePermission("Foo:*"))); Assert.assertEquals("string should be lowercase", "foo:*", permission.toString()); } @Test public void testCaseSensitive() { WildcardPermissionResolver resolver = new WildcardPermissionResolver(true); Assert.assertTrue("Sensitivity should be true", resolver.isCaseSensitive()); /* this is a round-about test as permissions don't store case sensitivity just lower case the string. */ WildcardPermission permission = ((WildcardPermission) (resolver.resolvePermission("Foo:*"))); Assert.assertEquals("string should be mixed case", "Foo:*", permission.toString()); } @Test public void testCaseInsensitive() { WildcardPermissionResolver resolver = new WildcardPermissionResolver(false); Assert.assertFalse("Sensitivity should be false", resolver.isCaseSensitive()); /* this is a round-about test as permissions don't store case sensitivity just lower case the string. */ WildcardPermission permission = ((WildcardPermission) (resolver.resolvePermission("Foo:*"))); Assert.assertEquals("string should be lowercase", "foo:*", permission.toString()); } @Test public void testCaseSensitiveToggle() { WildcardPermissionResolver resolver = new WildcardPermissionResolver(); Assert.assertFalse("Default sensitivity should be false", resolver.isCaseSensitive()); resolver.setCaseSensitive(true); Assert.assertTrue("Sensitivity should be true", resolver.isCaseSensitive()); resolver.setCaseSensitive(false); Assert.assertFalse("Sensitivity should be false", resolver.isCaseSensitive()); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
928ef319652d34799ae8ced7b1fd4483f92e2de8
1a4770c215544028bad90c8f673ba3d9e24f03ad
/second/quark/src/main/java/com/alibaba/analytics/core/d/c.java
84ab04d90a5cf367e06acf335e4e69c0b3636666
[]
no_license
zhang1998/browser
e480fbd6a43e0a4886fc83ea402f8fbe5f7c7fce
4eee43a9d36ebb4573537eddb27061c67d84c7ba
refs/heads/master
2021-05-03T06:32:24.361277
2018-02-10T10:35:36
2018-02-10T10:35:36
120,590,649
8
10
null
null
null
null
UTF-8
Java
false
false
595
java
package com.alibaba.analytics.core.d; import android.content.Context; /* compiled from: ProGuard */ final class c implements Runnable { Context a; final /* synthetic */ g b; public c(g gVar) { this.b = gVar; } public final void run() { if (this.a != null && e.a(this.a)) { String[] b = g.b(this.a); if (this.b.e == null || !this.b.e[0].equals(b[0]) || !this.b.e[1].equals(b[1])) { for (a a : this.b.d) { a.a(b[0]); } this.b.e = b; } } } }
[ "2764207312@qq.com" ]
2764207312@qq.com
ddd9c24a778c26c2c3dbb1421d245b50a0d04435
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/JFreeChart/rev91-2272/right-trunk-2272/source/org/jfree/data/statistics/SimpleHistogramBin.java
b5c429ec5e7722c05fca618e32ce68c6a3bc5cde
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
4,167
java
package org.jfree.data.statistics; import java.io.Serializable; import org.jfree.chart.util.PublicCloneable; public class SimpleHistogramBin implements Comparable, Cloneable, PublicCloneable, Serializable { private static final long serialVersionUID = 3480862537505941742L; private double lowerBound; private double upperBound; private boolean includeLowerBound; private boolean includeUpperBound; private int itemCount; private boolean selected; public SimpleHistogramBin(double lowerBound, double upperBound) { this(lowerBound, upperBound, true, true); } public SimpleHistogramBin(double lowerBound, double upperBound, boolean includeLowerBound, boolean includeUpperBound) { if (lowerBound >= upperBound) { throw new IllegalArgumentException("Invalid bounds; " + lowerBound + " to " + upperBound); } this.lowerBound = lowerBound; this.upperBound = upperBound; this.includeLowerBound = includeLowerBound; this.includeUpperBound = includeUpperBound; this.itemCount = 0; this.selected = false; } public double getLowerBound() { return this.lowerBound; } public double getUpperBound() { return this.upperBound; } public int getItemCount() { return this.itemCount; } public void setItemCount(int count) { this.itemCount = count; } public boolean isSelected() { return this.selected; } public void setSelected(boolean selected) { this.selected = selected; } public boolean accepts(double value) { if (Double.isNaN(value)) { return false; } if (value < this.lowerBound) { return false; } if (value > this.upperBound) { return false; } if (value == this.lowerBound) { return this.includeLowerBound; } if (value == this.upperBound) { return this.includeUpperBound; } return true; } public boolean overlapsWith(SimpleHistogramBin bin) { if (this.upperBound < bin.lowerBound) { return false; } if (this.lowerBound > bin.upperBound) { return false; } if (this.upperBound == bin.lowerBound) { return this.includeUpperBound && bin.includeLowerBound; } if (this.lowerBound == bin.upperBound) { return this.includeLowerBound && bin.includeUpperBound; } return true; } public int compareTo(Object obj) { if (!(obj instanceof SimpleHistogramBin)) { return 0; } SimpleHistogramBin bin = (SimpleHistogramBin) obj; if (this.lowerBound < bin.lowerBound) { return -1; } if (this.lowerBound > bin.lowerBound) { return 1; } if (this.upperBound < bin.upperBound) { return -1; } if (this.upperBound > bin.upperBound) { return 1; } return 0; } public boolean equals(Object obj) { if (!(obj instanceof SimpleHistogramBin)) { return false; } SimpleHistogramBin that = (SimpleHistogramBin) obj; if (this.lowerBound != that.lowerBound) { return false; } if (this.upperBound != that.upperBound) { return false; } if (this.includeLowerBound != that.includeLowerBound) { return false; } if (this.includeUpperBound != that.includeUpperBound) { return false; } if (this.itemCount != that.itemCount) { return false; } if (this.selected != that.selected) { return false; } return true; } public Object clone() throws CloneNotSupportedException { return super.clone(); } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
5dfd77b8ac8fa81b1136e9c242afa9955dab2657
ad611ffafeac2d97e45d935b14bdb6d54d8fa781
/src/main/java/rudiney/security/jwt/JWTConfigurer.java
62f6beab72cf814e217b483a8a6fcfee7e7a7785
[]
no_license
rudiney388/SilasMalafai
239b679913f3451c6c81ef99766c3421cc07302c
a9983c1c7e64ad5ceb09de486e0717960804eb29
refs/heads/master
2020-04-03T23:54:45.513936
2018-10-31T23:05:19
2018-10-31T23:05:19
155,634,150
0
0
null
null
null
null
UTF-8
Java
false
false
847
java
package rudiney.security.jwt; import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.DefaultSecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; public class JWTConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> { private TokenProvider tokenProvider; public JWTConfigurer(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void configure(HttpSecurity http) throws Exception { JWTFilter customFilter = new JWTFilter(tokenProvider); http.addFilterBefore(customFilter, UsernamePasswordAuthenticationFilter.class); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
e46ff0f908db758c7967f337aba83e7b4bab1be1
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-422-4-21-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/listener/chaining/BlockStateChainingListener_ESTest.java
8064b26149109d8b8e252183d02c61300ff57b00
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
1,713
java
/* * This file was automatically generated by EvoSuite * Fri Apr 03 18:09:37 UTC 2020 */ package org.xwiki.rendering.listener.chaining; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.shaded.org.mockito.Mockito.*; import static org.evosuite.runtime.EvoAssertions.*; import java.util.HashMap; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.ViolatedAssumptionAnswer; import org.junit.runner.RunWith; import org.xwiki.rendering.listener.Format; import org.xwiki.rendering.listener.chaining.BlockStateChainingListener; import org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener; import org.xwiki.rendering.listener.chaining.ListenerChain; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class BlockStateChainingListener_ESTest extends BlockStateChainingListener_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { ListenerChain listenerChain0 = new ListenerChain(); EmptyBlockChainingListener emptyBlockChainingListener0 = new EmptyBlockChainingListener(listenerChain0); ListenerChain listenerChain1 = mock(ListenerChain.class, new ViolatedAssumptionAnswer()); doReturn(emptyBlockChainingListener0).when(listenerChain1).getNextListener(nullable(java.lang.Class.class)); BlockStateChainingListener blockStateChainingListener0 = new BlockStateChainingListener(listenerChain1); Format format0 = Format.SUBSCRIPT; HashMap<String, String> hashMap0 = new HashMap<String, String>(); // Undeclared exception! blockStateChainingListener0.endFormat(format0, hashMap0); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
48c1520138fec7349f128eade40a2539ae99a446
dea04aa4c94afd38796e395b3707d7e98b05b609
/Participant results/P25/Interaction-3/ArrayIntList_ES_1_Test.java
32cd4b5f94f520f2003bb02116e630ae26ae92be
[]
no_license
PdedP/InterEvo-TR
aaa44ef0a4606061ba4263239bafdf0134bb11a1
77878f3e74ee5de510e37f211e907547674ee602
refs/heads/master
2023-04-11T11:51:37.222629
2023-01-09T17:37:02
2023-01-09T17:37:02
486,658,497
0
0
null
null
null
null
UTF-8
Java
false
false
956
java
/* * This file was automatically generated by EvoSuite * Thu Jan 20 17:36:03 GMT 2022 */ package com.org.apache.commons.collections.primitives; import org.junit.Test; import static org.junit.Assert.*; import com.org.apache.commons.collections.primitives.ArrayIntList; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class ArrayIntList_ES_1_Test extends ArrayIntList_ES_1_Test_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { ArrayIntList arrayIntList0 = new ArrayIntList(); arrayIntList0.add((-1)); arrayIntList0.add(1, 85); int int0 = arrayIntList0.removeElementAt(1); assertEquals(1, arrayIntList0.size()); assertEquals(85, int0); } }
[ "pedro@uca.es" ]
pedro@uca.es
6fc1de3ea2c7effc40129f187c957d1b87e7d7aa
c6de2274fc8e80fcb4fb273be91f609d8bd536b8
/src/main/java/org/fao/fenix/web/modules/x/server/utils/XWebServicePayload.java
12575a5c446815c2556177984f224c88b179525c
[]
no_license
FENIX-Platform-Projects/amis-statistics-legacy
d583f7db5e07ce4d8b0afcf5795291422d31754d
b51ff91efab51113e03b2e1cf21eb70f0ca24ce1
refs/heads/master
2021-06-10T05:12:20.671404
2017-01-31T12:56:19
2017-01-31T12:57:16
63,598,791
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package org.fao.fenix.web.modules.x.server.utils; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; public class XWebServicePayload { private final static String NAMESPACE = "http://webservice.communication.fenix.fao.org/xsd"; public static OMElement requestUpdate(String payload) { OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace namespace = fac.createOMNamespace(NAMESPACE, "ns"); OMElement method = fac.createOMElement("requestUpdate", namespace); OMElement value = fac.createOMElement("payload", namespace); value.addChild(fac.createOMText(value, payload)); method.addChild(value); return method; } }
[ "fabrizio.castelli@fao.org" ]
fabrizio.castelli@fao.org
521af8a579852bbd6fd24d29f84e0b2c846cdfd4
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/order/model/MallOrderDetailObject.java
1c04e15b74893978d5d2195cb91c0983e06d60e7
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,212
java
package com.tencent.mm.plugin.order.model; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable.Creator; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.plugin.order.model.ProductSectionItem.Skus; import com.tencent.mm.sdk.platformtools.ab; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public final class MallOrderDetailObject { public String cBb; public String lCb; public MallTransactionObject pbI; public b pbJ; public ArrayList<ProductSectionItem> pbK; public List<a> pbL; public List<HelpCenter> pbM = new LinkedList(); int pbN = -1; public String pbO; public String pbP; public int pbQ; public static class HelpCenter implements Parcelable { public static final Creator<HelpCenter> CREATOR = new Creator<HelpCenter>() { public final /* bridge */ /* synthetic */ Object[] newArray(int i) { return new HelpCenter[i]; } public final /* synthetic */ Object createFromParcel(Parcel parcel) { AppMethodBeat.i(43739); HelpCenter helpCenter = new HelpCenter(parcel); AppMethodBeat.o(43739); return helpCenter; } }; public boolean cui; public String name; public String url; protected HelpCenter() { } protected HelpCenter(Parcel parcel) { AppMethodBeat.i(43740); this.name = parcel.readString(); this.url = parcel.readString(); this.cui = parcel.readByte() != (byte) 0; AppMethodBeat.o(43740); } public void writeToParcel(Parcel parcel, int i) { AppMethodBeat.i(43741); parcel.writeString(this.name); parcel.writeString(this.url); parcel.writeByte((byte) (this.cui ? 1 : 0)); AppMethodBeat.o(43741); } public int describeContents() { return 0; } static { AppMethodBeat.i(43742); AppMethodBeat.o(43742); } } public static class a { public int jumpType; public String jumpUrl; public boolean kch; public String name; public int type = 0; public String value; } public static class b { public String mZj; public int oyB; public String pbR; public String pbS; public String thumbUrl; } public MallOrderDetailObject() { AppMethodBeat.i(43743); AppMethodBeat.o(43743); } static ArrayList<ProductSectionItem> ac(JSONObject jSONObject) { AppMethodBeat.i(43744); JSONObject jSONObject2 = jSONObject.getJSONObject("product_section"); if (jSONObject2 == null) { AppMethodBeat.o(43744); return null; } JSONArray jSONArray = jSONObject2.getJSONArray("items"); if (jSONArray == null || jSONArray.length() == 0) { AppMethodBeat.o(43744); return null; } ArrayList<ProductSectionItem> arrayList = new ArrayList(); for (int i = 0; i < jSONArray.length(); i++) { JSONObject jSONObject3 = jSONArray.getJSONObject(i); ProductSectionItem productSectionItem = new ProductSectionItem(); productSectionItem.iconUrl = jSONObject3.optString("icon_url"); productSectionItem.name = jSONObject3.optString("name"); try { productSectionItem.pdy = ad(jSONObject3); } catch (JSONException e) { ab.printErrStackTrace("MicroMsg.MallOrderDetailObject", e, "", new Object[0]); } catch (Exception e2) { ab.printErrStackTrace("MicroMsg.MallOrderDetailObject", e2, "", new Object[0]); } productSectionItem.count = jSONObject3.optInt("count"); productSectionItem.pdz = jSONObject3.optString(com.google.firebase.analytics.FirebaseAnalytics.b.PRICE); productSectionItem.jumpUrl = jSONObject3.optString("jump_url"); productSectionItem.pdA = jSONObject3.optString("pid"); productSectionItem.scene = jSONObject3.optInt("scene"); arrayList.add(productSectionItem); } AppMethodBeat.o(43744); return arrayList; } private static List<Skus> ad(JSONObject jSONObject) { AppMethodBeat.i(43745); JSONArray jSONArray = jSONObject.getJSONArray("skus"); if (jSONArray == null || jSONArray.length() == 0) { AppMethodBeat.o(43745); return null; } ArrayList arrayList = new ArrayList(); for (int i = 0; i < jSONArray.length(); i++) { JSONObject jSONObject2 = jSONArray.getJSONObject(i); Skus skus = new Skus(); skus.key = jSONObject2.optString("key"); skus.value = jSONObject2.optString("value"); arrayList.add(skus); } AppMethodBeat.o(43745); return arrayList; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
454f437412b3f54439a351a03e6eb394b3034148
838576cc2e44f590d4c59f8a4d120f629969eedf
/src/com/sino/ams/system/user/dao/SfUserDAO.java
cac2aa5ca446ae4fd4810f0b0cb2cc21bc3b348c
[]
no_license
fancq/CQEAM
ecbfec8290fc4c213101b88365f7edd4b668fdc8
5dbb23cde5f062d96007f615ddae8fd474cb37d8
refs/heads/master
2021-01-16T20:33:40.983759
2013-09-03T16:00:57
2013-09-03T16:00:57
null
0
0
null
null
null
null
GB18030
Java
false
false
5,326
java
package com.sino.ams.system.user.dao; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.sino.ams.system.user.dto.SfUserDTO; import com.sino.ams.system.user.dto.SfUserRightDTO; import com.sino.ams.system.user.model.SfUserModel; import com.sino.base.data.RowSet; import com.sino.base.db.query.SimpleQuery; import com.sino.base.db.sql.model.SQLModel; import com.sino.base.db.util.SeqProducer; import com.sino.base.dto.DTO; import com.sino.base.dto.DTOSet; import com.sino.base.exception.DataHandleException; import com.sino.base.exception.QueryException; import com.sino.base.util.StrUtil; import com.sino.framework.dao.BaseDAO; import com.sino.framework.dto.BaseUserDTO; /** * <p>Title: SinoApplication</p> * <p>Description: Java Enterprise Edition 平台应用开发基础框架</p> * <p>Copyright: 唐明胜版权所有Copyright (c) 2003~2007。 * <p>Copyright: 其中使用到的第三方组件,根据中华人民共和国相关法律以及中华人民共和国加入的相关国际公约,版权属原作者所有。</p> * <p>Copyright: 作者授权北京思诺博信息技术有限公司在一定范围内使用</p> * <p>Company: 北京思诺博信息技术有限公司</p> * * @author 唐明胜 * @version 0.1 */ public class SfUserDAO extends BaseDAO { private SfUserDTO userAccount = null; public SfUserDAO(BaseUserDTO userAccount, SfUserDTO dtoParameter, Connection conn) { super(userAccount, dtoParameter, conn); } /** * 功能:SQL生成器baseSQLProducer的初始化。 * * @param userAccount BaseUserDTO * @param dtoParameter DTO */ protected void initSQLProducer(BaseUserDTO userAccount, DTO dtoParameter) { SfUserDTO sfUser = (SfUserDTO) dtoParameter; super.sqlProducer = new SfUserModel(userAccount, sfUser); } private void prodNextUserId() throws SQLException { } /** * 检查用户登录名是否存在 * * @param sfUser * @return * @throws QueryException */ public boolean checkSfUser(SfUserDTO sfUser) throws QueryException { boolean hasRecord = false; SQLModel sqlModel = getCheckUserModel(sfUser); SimpleQuery simpleQuery = new SimpleQuery(sqlModel, conn); simpleQuery.executeQuery(); if (simpleQuery.hasResult()) { hasRecord = true; } return hasRecord; } public boolean saveData(SfUserDTO sfUser, DTOSet dtoSet) throws DataHandleException { boolean operateResult = true; try { boolean autoCommit = conn.getAutoCommit(); conn.setAutoCommit(false); boolean isNew = StrUtil.isEmpty(sfUser.getUserId()); if (isNew) { SeqProducer seqProducer = new SeqProducer(conn); sfUser.setUserId(seqProducer.getStrNextSeq("SF_USER_S")); createData(); } else { updateData(); } SfUserRightDTO userRightDTO = new SfUserRightDTO(); userRightDTO.setUserId(sfUser.getUserId()); SfUserRightDAO sfUserRightDAO = new SfUserRightDAO(userAccount, userRightDTO, conn); sfUserRightDAO.deleteData(); if (dtoSet != null && dtoSet.getSize() > 0) { for (int i = 0; i < dtoSet.getSize(); i++) { userRightDTO = (SfUserRightDTO) dtoSet.getDTO(i); if (isNew) { userRightDTO.setUserId(sfUser.getUserId()); } sfUserRightDAO.setDTOParameter(userRightDTO); sfUserRightDAO.createData(); } } conn.commit(); conn.setAutoCommit(autoCommit); } catch (SQLException e) { e.printStackTrace(); } return operateResult; } public RowSet getGroupOfOu(String organizationId) throws QueryException { SQLModel sqlModel = new SQLModel(); List sqlArgs = new ArrayList(); String sqlStr = "SELECT SG.GROUP_ID, SG.GROUP_NAME\n" + " FROM SF_GROUP SG\n" + " WHERE SG.ORGANIZATION_ID = ?\n" + " AND SG.ENABLED = 'Y'"; sqlArgs.add(organizationId); sqlModel.setSqlStr(sqlStr); sqlModel.setArgs(sqlArgs); SimpleQuery simpleQuery = new SimpleQuery(sqlModel, conn); simpleQuery.executeQuery(); return simpleQuery.getSearchResult(); } /** * 检查用户登录名是否重复 * * @param sfUser SfUserDTO * @return SQLModel */ private SQLModel getCheckUserModel(SfUserDTO sfUser) { SQLModel sqlModel = new SQLModel(); List sqlArgs = new ArrayList(); String sqlStr = "SELECT * FROM SF_USER SU WHERE UPPER(SU.LOGIN_NAME) = UPPER(?)"; sqlArgs.add(sfUser.getLoginName().toUpperCase()); sqlModel.setArgs(sqlArgs); sqlModel.setSqlStr(sqlStr); return sqlModel; } public Object getMuxData() throws QueryException { return super.getMuxData(); } }
[ "lq_xm@163.com" ]
lq_xm@163.com
7b003041fb15a1017b9df65a3380fd050d1a6aa8
0dac704a71c9d962c2809b005471e70d7c174d2e
/app/src/main/java/example/com/shoppingcart/ShoppingCartAdapter.java
7fa4b0a6686bc4edaebbe9b692f3467becd49496
[]
no_license
1097919195/shoppingChart
0d6506605c6d66e70dcd99718520c006336f797e
59c1f407fd8048debf0ad5e3620937a1e7f86a8c
refs/heads/master
2020-03-20T00:02:19.376012
2018-09-21T06:59:52
2018-09-21T06:59:52
137,029,684
0
0
null
null
null
null
UTF-8
Java
false
false
2,602
java
package example.com.shoppingcart; import android.support.v7.widget.RecyclerView; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.text.NumberFormat; public class ShoppingCartAdapter extends RecyclerView.Adapter<ShoppingCartAdapter.ViewHolder>{ private MainActivity activity; private SparseArray<GoodsItem> dataList; private NumberFormat nf; private LayoutInflater mInflater; public ShoppingCartAdapter(MainActivity activity, SparseArray<GoodsItem> dataList) { this.activity = activity; this.dataList = dataList; nf = NumberFormat.getCurrencyInstance(); nf.setMaximumFractionDigits(2); mInflater = LayoutInflater.from(activity); } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = mInflater.inflate(R.layout.item_selected_goods,parent,false); return new ViewHolder(view); } @Override public void onBindViewHolder(ViewHolder holder, int position) { GoodsItem item = dataList.valueAt(position); holder.bindData(item); } @Override public int getItemCount() { if(dataList==null) { return 0; } return dataList.size(); } class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{ private GoodsItem item; private TextView tvCost,tvCount,tvAdd,tvMinus,tvName; public ViewHolder(View itemView) { super(itemView); tvName = (TextView) itemView.findViewById(R.id.tvName); tvCost = (TextView) itemView.findViewById(R.id.tvCost); tvCount = (TextView) itemView.findViewById(R.id.count); tvMinus = (TextView) itemView.findViewById(R.id.tvMinus); tvAdd = (TextView) itemView.findViewById(R.id.tvAdd); tvMinus.setOnClickListener(this); tvAdd.setOnClickListener(this); } @Override public void onClick(View v) { int i = v.getId(); if (i == R.id.tvAdd) { activity.add(item, true); } else if (i == R.id.tvMinus) { activity.remove(item, true); } else { } } public void bindData(GoodsItem item){ this.item = item; tvName.setText(item.name); tvCost.setText(nf.format(item.count*item.price)); tvCount.setText(String.valueOf(item.count)); } } }
[ "1097919195@qq.com" ]
1097919195@qq.com
649d09f549fd031e136f33b6ac307a9ecd3f1c18
7612e20ec9b1f32f065101ba909fd1fd2052754f
/src/main/java/com/gtranslator/akka/extension/ActorRefUtils.java
dd31e1f3c1dcd76b9fdd6beedbd4f447d4e3bb0e
[]
no_license
vnsimonenko/gtranslator
50ed82bb753a17105e458ccfb6a81935e80e139b
00a8c8aa42add7db05b8ce2d0349cfbd6edd8631
refs/heads/master
2021-01-10T01:33:14.919384
2016-03-14T13:47:50
2016-03-14T13:47:50
52,779,705
0
0
null
null
null
null
UTF-8
Java
false
false
1,173
java
package com.gtranslator.akka.extension; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.UntypedActor; import com.gtranslator.utils.SpringApplicationContext; import org.apache.commons.lang3.StringUtils; public class ActorRefUtils { public static ActorRef getRef(Class<? extends UntypedActor> clazz) { return (ActorRef) SpringApplicationContext.getContext().getBean(normalRef(clazz)); } public static ActorRef createRef(Class<? extends UntypedActor> clazz) { ActorSystem system = getActorSystem(); SpringExtension springExtension = SpringApplicationContext.getContext().getBean(SpringExtension.class); return system.actorOf(springExtension.props(normal(clazz))); } public static ActorSystem getActorSystem() { return SpringApplicationContext.getContext().getBean(ActorSystem.class); } private static String normal(Class clazz) { String className = clazz.getSimpleName(); return StringUtils.lowerCase(className.substring(0, 1)) + className.substring(1); } private static String normalRef(Class clazz) { return normal(clazz) + "Ref"; } }
[ "you@example.com" ]
you@example.com
1307844324fb616dd44d612286788abb98014b71
d5f095cf2fed8b87e0a242aa8fb77da951e90097
/app/src/main/java/com/mkh/mobilemall/ui/widget/swipemenulistview/SwipeMenuAdapter.java
7443ca898d6cb809b468b4bc3f47f9a4a0b61334
[]
no_license
misty-rain/mkh_mall_android
7a2f3b6919555eaae59d8e0b7ecf0d7cbb56d3db
20d80011449a3459227ef40fbf1dc2825588a5c3
refs/heads/master
2020-04-28T11:21:40.941289
2019-03-12T15:06:45
2019-03-12T15:06:45
175,235,107
1
0
null
null
null
null
UTF-8
Java
false
false
4,142
java
package com.mkh.mobilemall.ui.widget.swipemenulistview; import android.content.Context; import android.database.DataSetObserver; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.view.View; import android.view.ViewGroup; import android.widget.ListAdapter; import android.widget.WrapperListAdapter; /** * @author baoyz * @date 2014-8-24 */ public class SwipeMenuAdapter implements WrapperListAdapter, SwipeMenuView.OnSwipeItemClickListener { private ListAdapter mAdapter; private Context mContext; private SwipeMenuListView.OnMenuItemClickListener onMenuItemClickListener; public SwipeMenuAdapter(Context context, ListAdapter adapter) { mAdapter = adapter; mContext = context; } @Override public int getCount() { return mAdapter.getCount(); } @Override public Object getItem(int position) { return mAdapter.getItem(position); } @Override public long getItemId(int position) { return mAdapter.getItemId(position); } @Override public View getView(int position, View convertView, ViewGroup parent) { SwipeMenuLayout layout = null; if (convertView == null) { View contentView = mAdapter.getView(position, convertView, parent); SwipeMenu menu = new SwipeMenu(mContext); menu.setViewType(mAdapter.getItemViewType(position)); createMenu(menu); SwipeMenuView menuView = new SwipeMenuView(menu, (SwipeMenuListView) parent); menuView.setOnSwipeItemClickListener(this); SwipeMenuListView listView = (SwipeMenuListView) parent; layout = new SwipeMenuLayout(contentView, menuView, listView.getCloseInterpolator(), listView.getOpenInterpolator()); layout.setPosition(position); } else { layout = (SwipeMenuLayout) convertView; layout.closeMenu(); layout.setPosition(position); View view = mAdapter.getView(position, layout.getContentView(), parent); } return layout; } public void createMenu(SwipeMenu menu) { // Test Code SwipeMenuItem item = new SwipeMenuItem(mContext); item.setTitle("Item 1"); item.setBackground(new ColorDrawable(Color.GRAY)); item.setWidth(300); menu.addMenuItem(item); item = new SwipeMenuItem(mContext); item.setTitle("Item 2"); item.setBackground(new ColorDrawable(Color.RED)); item.setWidth(300); menu.addMenuItem(item); } @Override public void onItemClick(SwipeMenuView view, SwipeMenu menu, int index) { if (onMenuItemClickListener != null) { onMenuItemClickListener.onMenuItemClick(view.getPosition(), menu, index); } } public void setOnMenuItemClickListener( SwipeMenuListView.OnMenuItemClickListener onMenuItemClickListener) { this.onMenuItemClickListener = onMenuItemClickListener; } @Override public void registerDataSetObserver(DataSetObserver observer) { mAdapter.registerDataSetObserver(observer); } @Override public void unregisterDataSetObserver(DataSetObserver observer) { mAdapter.unregisterDataSetObserver(observer); } @Override public boolean areAllItemsEnabled() { return mAdapter.areAllItemsEnabled(); } @Override public boolean isEnabled(int position) { return mAdapter.isEnabled(position); } @Override public boolean hasStableIds() { return mAdapter.hasStableIds(); } @Override public int getItemViewType(int position) { return mAdapter.getItemViewType(position); } @Override public int getViewTypeCount() { return mAdapter.getViewTypeCount(); } @Override public boolean isEmpty() { return mAdapter.isEmpty(); } @Override public ListAdapter getWrappedAdapter() { return mAdapter; } }
[ "taowu78@gmail.com" ]
taowu78@gmail.com
2b543e45ff48b319a928ac05391fc055e31e3498
ff6eb01484ce7eb25b243521c3098f0f79849150
/app/src/main/java/com/dailypit/dp/Interface/ServiceItemChargListner.java
6aff23d9a126bf26dd4718c8b69f604f7012d7ac
[]
no_license
Eminenceinnovationindia/Dailypit_User
ee10c13d1dfd46c20c7dbdc4ca365b75859190bc
d93ea7885a1004e7628ad7aba2a7a0fd835bae35
refs/heads/master
2023-08-23T11:34:39.331831
2021-10-18T09:09:41
2021-10-18T09:09:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
144
java
package com.dailypit.dp.Interface; public interface ServiceItemChargListner { void serviceItemClick(String itemCharg,String discount ); }
[ "vijaygupta7503637339@gmail.com" ]
vijaygupta7503637339@gmail.com
414222a9dc3df735954e77cd480eda2b29bad1d3
0c862c2256cef6acbafeb8f23a87aa128badd18b
/assist/asist/src/main/java/com/asist/redis/RedisHelper.java
d71466ce24405bbb7f0d1d28a5beaf22cf3a4958
[]
no_license
zhangguangxi/work
3a907520bf3ffa90a403f327249f830053ba4474
8de58aae36a42d3fa29e96943f56ff5b97dc5784
refs/heads/master
2016-09-11T14:45:00.163466
2016-03-23T09:27:40
2016-03-23T09:27:40
27,987,834
1
0
null
null
null
null
UTF-8
Java
false
false
2,051
java
package com.asist.redis; import java.util.Set; /** * * redis 操作接口 * * @version 2016年3月16日下午5:05:00 * @author guangxi.zhang */ public interface RedisHelper { /** * * 增加记录到库 * @version 2016年3月16日下午5:06:05 * @author guangxi.zhang * @param key 字节数组类型的键 * @param value 字节数组类型的值 * @return 字节数组类型返回value */ byte[] set(byte[] key, byte[] value); /** * * 增加记录到库(设置记录存活时间) * @version 2016年3月16日下午5:11:11 * @author guangxi.zhang * @param key 字节数组类型的键 * @param value 字节数组类型的值 * @param expire 存活时间(0:永不超时) * @return 字节数组类型返回value */ byte[] set(byte[] key,byte[] value,int expire); /** * * 根据key删除指定的记录 * @version 2016年3月16日下午5:19:06 * @author guangxi.zhang * @param key 字节数组类型的键 */ void del(byte[] key); /** * * 根据key查询指定的记录 * @version 2016年3月16日下午5:20:58 * @author guangxi.zhang * @param key 节数组类型的键 * @return 字节数组类型返回记录 */ byte[] get(byte[] key); /** * 根据key查询指定的记录 * @version 2016年3月16日下午5:23:16 * @author guangxi.zhang * @param key 字符串类型的键 * @return 字符串类型的记录 */ String get(String key); /** * * 查询集合 * @version 2016年3月16日下午5:26:08 * @author guangxi.zhang * @param key 字符串类型键 * @param startIndex 开始索引 * @param endIndex 结束索引 * @return set记录集合 */ Set<?> get(String key,long startIndex,long endIndex); }
[ "zhangguangxito@sina.cn" ]
zhangguangxito@sina.cn
23b33c1d591575facdc6e114d85683014160e690
b78c20b4da2875982a8af2dee560a1b278a6eafc
/src/main/java/br/com/swconsultoria/efd/icms/registros/blocoC/RegistroC160.java
adda65f471aa2414a4a387cedaf6accba186f953
[ "MIT" ]
permissive
Samuel-Oliveira/Java-Efd-Icms
d2820580c7c4190565211d98db3e1321d937cfc0
27474c53148b7e576f93fbe545daff62489d598f
refs/heads/master
2023-03-18T21:45:03.056128
2023-03-13T01:47:52
2023-03-13T01:47:52
72,212,697
21
16
MIT
2023-03-13T01:39:38
2016-10-28T14:06:04
Java
UTF-8
Java
false
false
1,991
java
/** * */ package br.com.swconsultoria.efd.icms.registros.blocoC; import lombok.EqualsAndHashCode; /** * @author Samuel Oliveira * */ @EqualsAndHashCode public class RegistroC160 { private final String reg = "C160"; private String cod_part; private String veic_id; private String qtd_vol; private String peso_brt; private String peso_liq; private String uf_id; /** * @return the cod_part */ public String getCod_part() { return cod_part; } /** * @param cod_part the cod_part to set */ public void setCod_part(String cod_part) { this.cod_part = cod_part; } /** * @return the veic_id */ public String getVeic_id() { return veic_id; } /** * @param veic_id the veic_id to set */ public void setVeic_id(String veic_id) { this.veic_id = veic_id; } /** * @return the qtd_vol */ public String getQtd_vol() { return qtd_vol; } /** * @param qtd_vol the qtd_vol to set */ public void setQtd_vol(String qtd_vol) { this.qtd_vol = qtd_vol; } /** * @return the peso_brt */ public String getPeso_brt() { return peso_brt; } /** * @param peso_brt the peso_brt to set */ public void setPeso_brt(String peso_brt) { this.peso_brt = peso_brt; } /** * @return the peso_liq */ public String getPeso_liq() { return peso_liq; } /** * @param peso_liq the peso_liq to set */ public void setPeso_liq(String peso_liq) { this.peso_liq = peso_liq; } /** * @return the uf_id */ public String getUf_id() { return uf_id; } /** * @param uf_id the uf_id to set */ public void setUf_id(String uf_id) { this.uf_id = uf_id; } /** * @return the reg */ public String getReg() { return reg; } }
[ "samuk.exe@hotmail.com" ]
samuk.exe@hotmail.com
efc5d0ac8f16291c13e9c492b0a287dad72d84aa
e6a856d95fa653dffd0f4d5e740a5c0d1cfb0722
/src/board/entities/Entity.java
754ef5e81e4538e78942d1e96f7a819ea7b2cb65
[]
no_license
JamiePurchase/TKRPG
e97248718f4d442047e2035cb7b532a3f39c04f8
3fafa9122f17a3634b24b5aae19e093fbc201219
refs/heads/master
2016-09-06T05:05:28.430518
2015-09-06T12:47:27
2015-09-06T12:47:27
40,754,182
0
0
null
null
null
null
UTF-8
Java
false
false
2,359
java
package board.entities; import board.BoardFile; import gfx.Drawing; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.image.BufferedImage; import states.System; public abstract class Entity { private BoardFile entityBoard; private String entityRef; private int entityPosX, entityPosY; private int entitySizeX, entitySizeY; private EntityType entityType; private boolean entitySolid, entityPlayer; public Entity(BoardFile board, String ref, int posX, int posY, EntityType type, boolean player) { this.entityBoard = board; this.entityRef = ref; this.entityPosX = posX; this.entityPosY = posY; this.entitySizeX = 32; this.entitySizeY = 32; this.entityType = type; this.entitySolid = true; this.entityPlayer = player; } public BoardFile getBoard() { return this.entityBoard; } public Rectangle getCollisionArea() { return new Rectangle(this.entityPosX, this.entityPosY, this.entitySizeX, this.entitySizeY); } public String getData() { return this.entityRef + "|" + this.entityPosX + "|" + entityPosY + "|" + this.entityType.toString(); // may also include data on what happens when the player collides/interacts with the entity } public int getPositionX() { return this.entityPosX; } public int getPositionY() { return this.entityPosY; } public abstract void interact(states.System system); public boolean isInteractive() { return true; // NOTE: come back to this later } public boolean isPlayer() { return this.entityPlayer; } public boolean isSolid() { return this.entitySolid; } public abstract void render(Graphics g, int posX, int posY); public void renderEntity(Graphics g, BufferedImage image, int posX, int posY) { // DEBUG Drawing.drawRect(g, this.getCollisionArea(), Color.RED); Drawing.drawImage(g, image, posX, posY); } public void setPosition(int posX, int posY) { this.entityPosX = posX; this.entityPosY = posY; } public void tick() { // } }
[ "jamie.purchase@medicapp.com" ]
jamie.purchase@medicapp.com
b5a341beb6eb4bfe78c38dbf6cbb95ac475b8a2d
b97a9d99fbf4066469e64592065d6a62970d9833
/ares-core/common/src/main/java/com/aw/common/util/DGCommandLine.java
1eb4e6e5712bbffd9c74b998d8695d586c1815c3
[]
no_license
analyticswarescott/ares
2bacb8eaac612e36836f7138c4398b6560468a91
5ac8d4ed50ca749b52eafc6fe95593ff68b85b54
refs/heads/master
2020-05-29T16:08:56.917029
2016-11-11T21:11:02
2016-11-11T21:11:02
59,563,723
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
package com.aw.common.util; import org.apache.commons.cli.BasicParser; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import com.aw.common.exceptions.InitializationException; /** * Wrapper for command line interface to provide some common code. * * * */ public class DGCommandLine extends Options { /** * serial version UID */ private static final long serialVersionUID = 1L; public DGCommandLine(Option... options) { if (options == null || options.length == 0) { throw new InitializationException("no options provided"); } //build the options for (Option option : options) { addOption(option); } } public CommandLine parse(String[] args) throws ParseException { return new BasicParser().parse(this, args); } public void printUsage() { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("<command>", this); } }
[ "scott@analyticsware.com" ]
scott@analyticsware.com
518df6f673c88bd0efc3d6ca847fc27345e35727
d7524fa49fda33cbf70a6179fc546392bca478dc
/app/src/main/java/cesu/qrcode/zxing/client/result/ProductResultParser.java
8100cc6d6016213a9d4a46360753761f3201211a
[]
no_license
avik1990/Portal
11d554cbec0eb9f877ad48601b9205c507f0a6c7
c2fc776eaed7fd47d8c7d81b110da2d62955e838
refs/heads/master
2023-04-05T14:29:41.533061
2021-04-07T12:26:48
2021-04-07T12:26:48
347,930,827
0
0
null
null
null
null
UTF-8
Java
false
false
1,851
java
/* * Copyright 2007 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 cesu.qrcode.zxing.client.result; import cesu.qrcode.zxing.BarcodeFormat; import cesu.qrcode.zxing.Result; import cesu.qrcode.zxing.oned.UPCEReader; /** * Parses strings of digits that represent a UPC code. * * @author dswitkin@google.com (Daniel Switkin) */ public final class ProductResultParser extends ResultParser { // Treat all UPC and EAN variants as UPCs, in the sense that they are all product barcodes. @Override public ProductParsedResult parse(Result result) { BarcodeFormat format = result.getBarcodeFormat(); if (!(format == BarcodeFormat.UPC_A || format == BarcodeFormat.UPC_E || format == BarcodeFormat.EAN_8 || format == BarcodeFormat.EAN_13)) { return null; } String rawText = getMassagedText(result); if (!isStringOfDigits(rawText, rawText.length())) { return null; } // Not actually checking the checksum again here String normalizedProductID; // Expand UPC-E for purposes of searching if (format == BarcodeFormat.UPC_E && rawText.length() == 8) { normalizedProductID = UPCEReader.convertUPCEtoUPCA(rawText); } else { normalizedProductID = rawText; } return new ProductParsedResult(rawText, normalizedProductID); } }
[ "avik1990@gmail.com" ]
avik1990@gmail.com
b76c4cf49eb60c557861621399188697e2affa46
b63aa2d4ace363ca12533131404c60eb4fa2f94e
/src/main/java/it/etianus/legal/security/SecurityUtils.java
89f51c25892675739761f7c5c9415591b2cd9d34
[]
no_license
gbrlcnv/legTech
70ce53575f54b53ca73c27e21275fd7bac8a926e
875d5b81491d30419951ee987589e53d98762e44
refs/heads/master
2021-01-25T13:58:06.689395
2018-03-02T21:00:16
2018-03-02T21:00:16
123,630,297
0
0
null
null
null
null
UTF-8
Java
false
false
2,489
java
package it.etianus.legal.security; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import java.util.Optional; /** * Utility class for Spring Security. */ public final class SecurityUtils { private SecurityUtils() { } /** * Get the login of the current user. * * @return the login of the current user */ public static Optional<String> getCurrentUserLogin() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> { if (authentication.getPrincipal() instanceof UserDetails) { UserDetails springSecurityUser = (UserDetails) authentication.getPrincipal(); return springSecurityUser.getUsername(); } else if (authentication.getPrincipal() instanceof String) { return (String) authentication.getPrincipal(); } return null; }); } /** * Check if a user is authenticated. * * @return true if the user is authenticated, false otherwise */ public static boolean isAuthenticated() { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> authentication.getAuthorities().stream() .noneMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(AuthoritiesConstants.ANONYMOUS))) .orElse(false); } /** * If the current user has a specific authority (security role). * <p> * The name of this method comes from the isUserInRole() method in the Servlet API * * @param authority the authority to check * @return true if the current user has the authority, false otherwise */ public static boolean isCurrentUserInRole(String authority) { SecurityContext securityContext = SecurityContextHolder.getContext(); return Optional.ofNullable(securityContext.getAuthentication()) .map(authentication -> authentication.getAuthorities().stream() .anyMatch(grantedAuthority -> grantedAuthority.getAuthority().equals(authority))) .orElse(false); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
134a7327dfc663c816f1f056f927b23a144463cb
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/deeplearning4j--deeplearning4j/63b8277f800a3a737f5bf7853613fe0309d50c2d/after/Word2VecLoader.java
20f9347a437704a93a2465fa19e0295b31b97c8f
[]
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
6,208
java
package org.deeplearning4j.word2vec.loader; import java.io.*; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; import java.util.zip.GZIPInputStream; import org.deeplearning4j.linalg.api.ndarray.INDArray; import org.deeplearning4j.linalg.factory.NDArrays; import org.deeplearning4j.word2vec.VocabWord; import org.deeplearning4j.word2vec.Word2Vec; import org.deeplearning4j.util.Index; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Word2VecLoader { private static Logger log = LoggerFactory.getLogger(Word2VecLoader.class); private static final int MAX_SIZE = 50; public static Word2Vec loadModel(File file) throws Exception { log.info("Loading model from " + file.getAbsolutePath()); Word2Vec ret = new Word2Vec(); ret.load(new BufferedInputStream(new FileInputStream(file))); return ret; } private static Word2Vec loadGoogleVocab(Word2Vec vec,String path) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(new File(path))); String temp = null; vec.setWordIndex(new Index()); vec.getVocab().clear(); while((temp = reader.readLine()) != null) { String[] split = temp.split(" "); if(split[0].equals("</s>")) continue; int freq = Integer.parseInt(split[1]); VocabWord realWord = new VocabWord(freq,vec.getLayerSize()); realWord.setIndex(vec.getVocab().size()); vec.getVocab().put(split[0], realWord); vec.getWordIndex().add(split[0]); } reader.close(); return vec; } public static Word2Vec loadGoogleText(String path,String vocabPath) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(new File(path))); String temp = null; boolean first = true; Integer vectorSize = null; Integer rows = null; int currRow = 0; Word2Vec ret = new Word2Vec(); while((temp = reader.readLine()) != null) { if(first) { String[] split = temp.split(" "); rows = Integer.parseInt(split[0]); vectorSize = Integer.parseInt(split[1]); ret.setLayerSize(vectorSize); ret.setSyn0(NDArrays.create(rows - 1,vectorSize)); first = false; } else { StringTokenizer tokenizer = new StringTokenizer(temp); float[] vec = new float[ret.getLayerSize()]; int count = 0; String word = tokenizer.nextToken(); if(word.equals("</s>")) continue; while(tokenizer.hasMoreTokens()) { vec[count++] = Float.parseFloat(tokenizer.nextToken()); } ret.getSyn0().putRow(currRow, NDArrays.create(vec)); currRow++; } } reader.close(); return loadGoogleVocab(ret,vocabPath); } /** * Read a string from a data input stream * Credit to: https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java * @param dis * @return * @throws IOException */ private static String readString(DataInputStream dis) throws IOException { byte[] bytes = new byte[MAX_SIZE]; byte b = dis.readByte(); int i = -1; StringBuilder sb = new StringBuilder(); while (b != 32 && b != 10) { i++; bytes[i] = b; b = dis.readByte(); if (i == 49) { sb.append(new String(bytes)); i = -1; bytes = new byte[MAX_SIZE]; } } sb.append(new String(bytes, 0, i + 1)); return sb.toString(); } /** * Loads the google binary model * Credit to: https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java * @param path path to model * * @throws IOException */ public static Word2Vec loadGoogleModel(String path) throws IOException { DataInputStream dis = null; BufferedInputStream bis = null; double len = 0; float vector = 0; Word2Vec ret = new Word2Vec(); Index wordIndex = new Index(); INDArray wordVectors = null; try { bis = new BufferedInputStream(path.endsWith(".gz") ? new GZIPInputStream(new FileInputStream(path)) : new FileInputStream(path)); dis = new DataInputStream(bis); Map<String,INDArray> wordMap = new HashMap<>(); //number of words int words = Integer.parseInt(readString(dis)); //word vector size int size = Integer.parseInt(readString(dis)); wordVectors = NDArrays.create(words,size); String word; float[] vectors = null; for (int i = 0; i < words; i++) { word = readString(dis); log.info("Loaded " + word); vectors = new float[size]; len = 0; for (int j = 0; j < size; j++) { vector = readFloat(dis); len += vector * vector; vectors[j] = vector; } len = Math.sqrt(len); for (int j = 0; j < size; j++) { vectors[j] /= len; } wordIndex.add(word); wordVectors.putRow(i, NDArrays.create(vectors)); } } finally { bis.close(); dis.close(); } ret.setWordIndex(wordIndex); ret.setSyn0(wordVectors); return ret; } /** * Credit to: https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java * @param is * @return * @throws IOException */ public static float readFloat(InputStream is) throws IOException { byte[] bytes = new byte[4]; is.read(bytes); return getFloat(bytes); } /** * Read float from byte array, credit to: * Credit to: https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java * * @param b * @return */ public static float getFloat(byte[] b) { int accum = 0; accum = accum | (b[0] & 0xff) << 0; accum = accum | (b[1] & 0xff) << 8; accum = accum | (b[2] & 0xff) << 16; accum = accum | (b[3] & 0xff) << 24; return Float.intBitsToFloat(accum); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
3330005970312688a74b71e3d9b654ac51899d2f
836ca471d581608233298fa7607f0df732ef2f93
/springboot-websocket/src/main/java/com/geekerstar/websocket/task/ServerTask.java
a9c682bf66df7a32ac7336ed6d7f56c92816632c
[]
no_license
geekerstar/springboot-tutorial
4c33b16e1e74b2416b1b6e03429be63f660693b6
00b03a56cf183355746164feee0617f3e95f342c
refs/heads/master
2022-12-01T21:01:58.247315
2021-08-18T08:53:09
2021-08-18T08:53:09
202,674,686
5
5
null
2022-11-16T08:57:36
2019-08-16T06:51:49
Java
UTF-8
Java
false
false
1,474
java
package com.geekerstar.websocket.task; import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Dict; import cn.hutool.json.JSONUtil; import com.geekerstar.websocket.constant.CommonConstant; import com.geekerstar.websocket.model.Server; import com.geekerstar.websocket.model.ServerVO; import com.geekerstar.websocket.util.ServerUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; /** * @author geekerstar * @date 2020/11/4 16:47 * @description */ @Slf4j @Component public class ServerTask { @Autowired private SimpMessagingTemplate wsTemplate; /** * 按照标准时间来算,每隔 2s 执行一次 */ @Scheduled(cron = "0/2 * * * * ?") public void websocket() throws Exception { log.info("【推送消息】开始执行:{}", DateUtil.formatDateTime(new Date())); // 查询服务器状态 Server server = new Server(); server.copyTo(); ServerVO serverVO = ServerUtil.wrapServerVO(server); Dict dict = ServerUtil.wrapServerDict(serverVO); wsTemplate.convertAndSend(CommonConstant.PUSH_SERVER, JSONUtil.toJsonStr(dict)); log.info("【推送消息】执行结束:{}", DateUtil.formatDateTime(new Date())); } }
[ "247507792@qq.com" ]
247507792@qq.com
5f4ce0d74c982e1e3f272646a6cf3757ac8c78bf
47798511441d7b091a394986afd1f72e8f9ff7ab
/src/main/java/com/alipay/api/domain/KoubeiMerchantDepartmentShopsQueryModel.java
96893507677e202fc2e316cb85f963729e2f386d
[ "Apache-2.0" ]
permissive
yihukurama/alipay-sdk-java-all
c53d898371032ed5f296b679fd62335511e4a310
0bf19c486251505b559863998b41636d53c13d41
refs/heads/master
2022-07-01T09:33:14.557065
2020-05-07T11:20:51
2020-05-07T11:20:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,259
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 查询部门对应门店 * * @author auto create * @since 1.0, 2018-03-23 15:00:30 */ public class KoubeiMerchantDepartmentShopsQueryModel extends AlipayObject { private static final long serialVersionUID = 7265742695213786191L; /** * isv回传的auth_code,通过auth_code校验当前操作人与商户的关系 */ @ApiField("auth_code") private String authCode; /** * 部门id */ @ApiField("dept_id") private String deptId; /** * 判断是否需要加载下属部门的门店列表,当为true是加载当前及其下属部门关联的门店列表,为false时仅加载当前部门id关联的门店列表 */ @ApiField("need_sub") private Boolean needSub; public String getAuthCode() { return this.authCode; } public void setAuthCode(String authCode) { this.authCode = authCode; } public String getDeptId() { return this.deptId; } public void setDeptId(String deptId) { this.deptId = deptId; } public Boolean getNeedSub() { return this.needSub; } public void setNeedSub(Boolean needSub) { this.needSub = needSub; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
87af2b49cd66f8d7c9dcfa6079142a9aad0a5956
69e8d40a685b0affa61f940c49feadf585397267
/spring-webmvc/src/main/java/org/springframework/web/servlet/function/support/HandlerFunctionAdapter.java
a20f32da1f7ad80c00f8533ccc9186104f0b2087
[ "Apache-2.0" ]
permissive
rocky-peng/spring-framework-v5.2.1.RELEASE-sourcecode-read
5be7e3e1ef408f0b2bee5b65b76d1d7b68b21011
4991a34860407ddcd644732a5ea8f84bc058efb1
refs/heads/master
2020-09-30T15:16:32.014509
2020-03-05T15:11:10
2020-03-05T15:11:10
227,312,986
1
0
null
null
null
null
UTF-8
Java
false
false
3,360
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.servlet.function.support; import org.springframework.core.Ordered; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.web.servlet.HandlerAdapter; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.function.HandlerFunction; import org.springframework.web.servlet.function.RouterFunctions; import org.springframework.web.servlet.function.ServerRequest; import org.springframework.web.servlet.function.ServerResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * {@code HandlerAdapter} implementation that supports {@link HandlerFunction}s. * * @author Arjen Poutsma * @since 5.2 */ public class HandlerFunctionAdapter implements HandlerAdapter, Ordered { private int order = Ordered.LOWEST_PRECEDENCE; @Override public int getOrder() { return this.order; } /** * Specify the order value for this HandlerAdapter bean. * <p>The default value is {@code Ordered.LOWEST_PRECEDENCE}, meaning non-ordered. * * @see org.springframework.core.Ordered#getOrder() */ public void setOrder(int order) { this.order = order; } @Override public boolean supports(Object handler) { return handler instanceof HandlerFunction; } @Nullable @Override public ModelAndView handle(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Object handler) throws Exception { HandlerFunction<?> handlerFunction = (HandlerFunction<?>) handler; ServerRequest serverRequest = getServerRequest(servletRequest); ServerResponse serverResponse = handlerFunction.handle(serverRequest); return serverResponse.writeTo(servletRequest, servletResponse, new ServerRequestContext(serverRequest)); } private ServerRequest getServerRequest(HttpServletRequest servletRequest) { ServerRequest serverRequest = (ServerRequest) servletRequest.getAttribute(RouterFunctions.REQUEST_ATTRIBUTE); Assert.state(serverRequest != null, () -> "Required attribute '" + RouterFunctions.REQUEST_ATTRIBUTE + "' is missing"); return serverRequest; } @Override public long getLastModified(HttpServletRequest request, Object handler) { return -1L; } private static class ServerRequestContext implements ServerResponse.Context { private final ServerRequest serverRequest; public ServerRequestContext(ServerRequest serverRequest) { this.serverRequest = serverRequest; } @Override public List<HttpMessageConverter<?>> messageConverters() { return this.serverRequest.messageConverters(); } } }
[ "rocky.peng@qq.com" ]
rocky.peng@qq.com
b0429555c51bda488e8c3b43a36b44aab5ec468c
96d71f73821cfbf3653f148d8a261eceedeac882
/external/decompiled/blackberry/WhatsApp OS6 V2.8.1914/decompiled/WhatsApp-39/com/whatsapp/client/MediaFullBrowserScreen$5.java
8f311ac79308eb6fdaa17d3b37f7ce71401433b8
[]
no_license
JaapSuter/Niets
9a9ec53f448df9b866a8c15162a5690b6bcca818
3cc42f8c2cefd9c3193711cbf15b5304566e08cb
refs/heads/master
2020-04-09T19:09:40.667155
2012-09-28T18:11:33
2012-09-28T18:11:33
5,751,595
2
1
null
null
null
null
UTF-8
Java
false
false
1,692
java
// ####################################################### // Decompiled by : coddec // Module : WhatsApp-39.cod // Module version : 2.8.1914 // Class ID : 19 // ######################################################## package com.whatsapp.client; abstract final class MediaFullBrowserScreen$5 extends Object implements net.rim.device.api.ui.FocusChangeListener { // @@@@@@@@@@@@@ Fields private final com.whatsapp.client.MediaFullBrowserScreen /*com.whatsapp.client.MediaFullBrowserScreen*/ field_55520 ; // ofs = 55520 addr = 0) // @@@@@@@@@@@@@ Static routines <init>( com.whatsapp.client.MediaFullBrowserScreen$5, com.whatsapp.client.MediaFullBrowserScreen ); // address: 0 { enter_narrow aload_0 invokespecial_lib java.lang.Object.<init> // pc=1 aload_0 aload_1 putfield .field_0_ // get_name_1: .field_0_ // get_name_2: .field_0_ // get_Name: .field_0_ // getName->1: null // getName->2: null // getName->N: null // ofs = -1 ord = 0 addr = 0 return } // @@@@@@@@@@@@@ Virtual routines public final focusChanged( com.whatsapp.client.MediaFullBrowserScreen$5, net.rim.device.api.ui.Field, int ); // address: 0 { enter aload_1 checkcast_lib com.whatsapp.client.MediaFullBrowserField//com.whatsapp.client.MediaFullBrowserField com.whatsapp.client.MediaFullBrowserField com.whatsapp.client.MediaFullBrowserField astore_3 aload_0_getfield .field_0_ // get_name_1: .field_0_ // get_name_2: .field_0_ // get_Name: .field_0_ // getName->1: null // getName->2: null // getName->N: null // ofs = -1 ord = 0 addr = 0 aload_3 iload_2 invokespecial_lib .routine_1326 // pc=3 return } }
[ "git@jaapsuter.com" ]
git@jaapsuter.com
27724faee1ce63daf80d21ec478bb9332d769d3e
4eff712e6c961dcd8a261a3c618c4b8bfa0a0fef
/app/src/main/java/com/gay/xmen/config/FavoritesItem.java
c10a3ee4050cc5c357d58ff956657ab331cb683f
[]
no_license
cmFodWx5YWRhdjEyMTA5/WallpaperTumblrOriginal-master
782444a240c42fca3d9e6bde34815e028bd23c2e
32ed6be89fdbe36667dce5d0050ceb6b32789848
refs/heads/master
2020-04-04T06:59:48.067184
2018-10-30T19:57:17
2018-10-30T19:57:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
package com.gay.xmen.config; import com.orm.SugarRecord; import com.orm.dsl.Table; @Table public class FavoritesItem extends SugarRecord { public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } private String url; public String getName() { return name; } public void setName(String name) { this.name = name; } private String name; }
[ "shaiyafusion30@gmail.com" ]
shaiyafusion30@gmail.com
624c138465d1f7c04189d049952401ec39aa6bcc
1453ec9a1cb5b1bfade9211b3e6a5082e303012a
/j2ee-h5-id-example/java/xyz/vaith/app/App.java
6e865049a493a947c88eac2643932f76fdc685ef
[]
no_license
vaithwee/javaee-tutorial-example
a05952f76a1841ffaf3b0c8f9a5c4822c07925ae
7f877812af51edc3f8bd03ccec71e23c13425815
refs/heads/master
2020-04-16T06:14:10.790376
2019-05-04T07:19:59
2019-05-04T07:19:59
165,337,527
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package xyz.vaith.app; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import xyz.vaith.app.domain.Person; public class App { public static void main(String[] args) { Configuration cfg = new Configuration().configure(); SessionFactory sessionFactory = cfg.buildSessionFactory(); Session session = sessionFactory.getCurrentSession(); Transaction transaction = session.beginTransaction(); Person person = new Person(); person.setAge(28); person.setFirst("Wee"); person.setLast("Vaith"); session.save(person); transaction.commit(); } }
[ "vaithwee@yeah.net" ]
vaithwee@yeah.net
bed82cf2df48e7ecb04940250f0e0921b070d981
f25a31d765b3772306bc25f75a0fb314985baddf
/app/src/main/java/com/huiche/lib/lib/Utils/DateUtils.java
48b26faf7a3e3d377a273d69696f74983befbaca
[]
no_license
Helen403/HuiChe
c47ca90924d517d14797d45dd2e5adabcc61bbc7
ca9a612ad0481936c20d47ecab2e79fd699c5056
refs/heads/master
2021-01-11T04:38:47.461041
2016-10-28T03:33:12
2016-10-28T03:33:12
71,121,426
0
0
null
null
null
null
UTF-8
Java
false
false
4,946
java
package com.huiche.lib.lib.Utils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * 日期工具类 * formatDataTime 格式化日期时间 * formatDate 格式化日期 * formatTime 格式化时间 * formatDateCustom 自定义格式的格式化日期时间 * string2Date 将时间字符串转换成Date * getDate 获取系统日期 * getTime 获取系统时间 * getDateTime 获取系统日期时间 * subtractDate 计算两个时间差 * getDateAfter 得到几天后的时间 * getWeekOfMonth 获取当前时间为本月的第几周 * getDayOfWeek 获取当前时间为本周的第几天 */ public final class DateUtils { private static final SimpleDateFormat DATE_FORMAT_DATETIME = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private static final SimpleDateFormat DATE_FORMAT_DATE = new SimpleDateFormat("yyyy-MM-dd"); private static final SimpleDateFormat DATE_FORMAT_TIME = new SimpleDateFormat("HH:mm:ss"); private static final SimpleDateFormat DATE_FORMAT_YEAR = new SimpleDateFormat("yyyy"); private static final SimpleDateFormat DATE_FORMAT_MONTH = new SimpleDateFormat("MM"); private DateUtils() { } /** * formatDataTime 格式化日期时间 */ public static String formatDataTime(long date) { return DATE_FORMAT_DATETIME.format(new Date(date)); } /** * formatDataTime 格式化当前年 */ public static String formatDataYear(long date) { return DATE_FORMAT_YEAR.format(new Date(date)); } /** * formatDataTime 格式化当前月 */ public static String formatDataMonth(long date) { return DATE_FORMAT_MONTH.format(new Date(date)); } /** * formatDate 格式化日期 */ public static String formatDate(long date) { return DATE_FORMAT_DATE.format(new Date(date)); } /** * formatTime 格式化时间 */ public static String formatTime(long date) { return DATE_FORMAT_TIME.format(new Date(date)); } /** * formatDateCustom 自定义格式的格式化日期时间 */ public static String formatDateCustom(String beginDate, String format) { return new SimpleDateFormat(format).format(new Date(Long.parseLong(beginDate))); } public static String formatDateCustom(Date beginDate, String format) { return new SimpleDateFormat(format).format(beginDate); } /** * stringToDate 将时间字符串转换成Date */ public static Date stringToDate(String s, String style) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(); simpleDateFormat.applyPattern(style); Date date = null; if (s == null || s.length() < 6) { return null; } try { date = simpleDateFormat.parse(s); } catch (ParseException e) { e.printStackTrace(); } return date; } /** * getTime 获取系统时间 */ public static String getTime() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(System.currentTimeMillis()); return cal.get(Calendar.HOUR_OF_DAY) + ":" + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND); } /** * getDate 获取系统日期 */ public static String getDate() { return new SimpleDateFormat("yyyyMMdd").format(System.currentTimeMillis()); } /** * getDateTime 获取系统日期时间 */ public static String getDateTime() { return DATE_FORMAT_DATETIME.format(System.currentTimeMillis()); } /** * getDateTime 获取系统日期时间 */ public static String getDateTime(String format) { return new SimpleDateFormat(format).format(System.currentTimeMillis()); } /** * subtractDate 计算两个时间差 */ public static long subtractDate(Date dateStart, Date dateEnd) { return dateEnd.getTime() - dateStart.getTime(); } /** * getDateAfter 得到几天后的时间 */ public static Date getDateAfter(Date d, int day) { Calendar now = Calendar.getInstance(); now.setTime(d); now.set(Calendar.DATE, now.get(Calendar.DATE) + day); return now.getTime(); } /** * getWeekOfMonth 获取当前时间为本月的第几周 */ public static int getWeekOfMonth() { Calendar calendar = Calendar.getInstance(); int week = calendar.get(Calendar.WEEK_OF_MONTH); return week - 1; } /** * getDayOfWeek 获取当前时间为本周的第几天 */ public static int getDayOfWeek() { Calendar calendar = Calendar.getInstance(); int day = calendar.get(Calendar.DAY_OF_WEEK); if (day == 1) { day = 7; } else { day = day - 1; } return day; } }
[ "852568775@qq.com" ]
852568775@qq.com
c0d0c398d948b533634cf84c10819930689ffb00
613d8ce7ac90e07fadb0f4c88bc1461f74a23574
/app/src/main/java/com/freak/shopping/activity/official/OfficialOrderAdapter.java
780151942ca3f0f6bf085fe575fca9fd3380b0e1
[]
no_license
freakcsh/shopping
d588d54333bda73d6c46aa319daee2ae24fb9520
0c269841ac05ccfa1622c7554a40efb7e63dee6b
refs/heads/master
2021-05-08T11:41:39.891186
2018-02-01T23:55:44
2018-02-01T23:55:44
119,907,559
0
0
null
null
null
null
UTF-8
Java
false
false
3,852
java
package com.freak.shopping.activity.official; import android.content.Context; import android.graphics.Paint; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.EditText; import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; import android.widget.ToggleButton; import com.bumptech.glide.Glide; import com.freak.shopping.R; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; /** * Created by Administrator on 2017/11/30. */ public class OfficialOrderAdapter extends BaseAdapter implements View.OnClickListener { private Context context; private List<OfficialOrderDishBean> orderDishBeen; OfficialOrderDishBean bean = new OfficialOrderDishBean(); ListView listView; public OfficialOrderAdapter(Context context, List<OfficialOrderDishBean> orderDishBeen, ListView listView) { this.context = context; this.orderDishBeen = orderDishBeen; this.listView = listView; } @Override public int getCount() { return orderDishBeen.size(); } @Override public Object getItem(int i) { return orderDishBeen.get(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(final int i, View view, ViewGroup viewGroup) { ViewHolder orderViewHolder = null; if (view == null) { view = LayoutInflater.from(context).inflate(R.layout.official_order_dishes_item, null); orderViewHolder = new ViewHolder(view); view.setTag(orderViewHolder); } else { orderViewHolder = (ViewHolder) view.getTag(); } Glide.with(context).load(orderDishBeen.get(i).order_dish_img).centerCrop().placeholder(R.mipmap.ic_launcher).into(orderViewHolder.officialOrderDishImg); orderViewHolder.officialOrderDishName.setText(orderDishBeen.get(i).order_dish_name); orderViewHolder.officialOrderDishMore.setText(orderDishBeen.get(i).order_dish_more); orderViewHolder.officialOrderDishPrice.setText(orderDishBeen.get(i).order_dish_price); orderViewHolder.officialOrderDishPriceYuan.setText(orderDishBeen.get(i).order_dish_price_yuan); orderViewHolder.officialOrderDishPriceYuan.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);//中间横线 // orderViewHolder.officialOrderDishPriceYuan.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线 // orderViewHolder.officialOrderDishPriceYuan.getPaint().setAntiAlias(true);//抗锯齿 return view; } @Override public void onClick(View view) { switch (view.getId()) { case R.id.official_order_dish_jia: break; case R.id.official_order_dish_minus: break; } } static class ViewHolder { @BindView(R.id.official_order_dish_img) ImageView officialOrderDishImg; @BindView(R.id.official_order_dish_name) TextView officialOrderDishName; @BindView(R.id.official_order_dish_more) TextView officialOrderDishMore; @BindView(R.id.official_order_dish_price) TextView officialOrderDishPrice; @BindView(R.id.official_order_dish_price_yuan) TextView officialOrderDishPriceYuan; @BindView(R.id.official_order_dish_minus) ImageView officialOrderDishMinus; @BindView(R.id.official_order_dish_num) EditText officialOrderDishNum; @BindView(R.id.official_order_dish_jia) ImageView officialOrderDishJia; ViewHolder(View view) { ButterKnife.bind(this, view); } } }
[ "740997937@qq.com" ]
740997937@qq.com
fa122db7b951d31302f592c8569348418e744358
2cf1e5a7e3532b1db2d28074f57123c9f75619ef
/src/main/java/practice/problem/TriplesWithBitwiseANDEqualToZero.java
5a486aba7c7ff5c51a4f210b291604dc52f49176
[]
no_license
jimty0511/algorithmPractice
33f15c828a1463d7a1ea247b424e577fde37e1dd
dd524388e9d5c70ee97869b63465f3cd171f9460
refs/heads/master
2020-03-20T14:57:01.722957
2020-02-19T19:43:39
2020-02-19T19:43:39
137,497,450
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package practice.problem; import java.util.HashMap; import java.util.Map; // 982. Triples with Bitwise AND Equal To Zero public class TriplesWithBitwiseANDEqualToZero { public int countTriplets(int[] A) { int ans = 0; Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < A.length; i++) { for (int j = 0; j < A.length; j++) { int num = A[i] & A[j]; map.put(num, map.getOrDefault(num, 0) + 1); } } for (int i = 0; i < A.length; i++) { for (int n : map.keySet()) { if ((A[i] & n) == 0) ans += map.get(n); } } return ans; } }
[ "ty90511@gmail.com" ]
ty90511@gmail.com
4586e2556caa89a5efbcff9b04ed6097835d2848
106cce45fa593bc6ef7ea105f5055b5d13d251d0
/Examples/Discourse/src/generated/java/discourse/example/com/anonymous/admin/sitesettings/UniquePostsMin.java
6f001b6f80f78b0e77d258ed57c95cf4aaeb3bf9
[]
no_license
glelouet/JSwaggerMaker
f7faf2267e900d78019db42979922d2f2c2fcb33
1bf9572d313406d1d9e596094714daec6f50e068
refs/heads/master
2022-12-08T04:28:53.468581
2022-12-04T14:37:47
2022-12-04T14:37:47
177,210,549
0
0
null
2022-12-04T14:37:48
2019-03-22T21:19:28
Java
UTF-8
Java
false
false
896
java
package discourse.example.com.anonymous.admin.sitesettings; import java.util.HashMap; import java.util.Map; import discourse.example.com.Anonymous; import fr.lelouet.jswaggermaker.client.common.impl.DelegateTransfer; public class UniquePostsMin extends DelegateTransfer<Anonymous> { public UniquePostsMin(Anonymous delegate) { super(delegate); } /** * * <p> * unique posts mins * </p> * * @param unique_posts_min * "How many minutes before a user can make a post with the same content again" * */ public void put(long unique_posts_min) { String url = ("https://discourse.example.com//admin/site_settings/unique_posts_min"); Map<String, Object> content = new HashMap<>(); content.put("unique_posts_min", (unique_posts_min)); requestPut(url, null, content, Void.class); } }
[ "guillaume.lelouet@gmail.com" ]
guillaume.lelouet@gmail.com
b41aed5445d3568a94fd359e5aef1244ceea63b7
d98a4fbbcaf1a21d99c6791aeb54882c774922e4
/src/com/easecom/common/util/mysqlDialect.java
37e3ea962f47e86851fe544af61b89bcecc33f0d
[]
no_license
JohnVeZh/jn_spark_online_admin_new_DLB
c99ebc5d36711d62fc08add4d6dd084598bf71fa
58030276de950c4846b74d791b7278e507011865
refs/heads/master
2021-01-01T06:37:11.992343
2017-07-19T01:55:34
2017-07-19T01:55:34
97,469,963
0
0
null
null
null
null
UTF-8
Java
false
false
620
java
/** * mysqlDialect.java Dec 12, 2011 10:13:42 AM * Copyright: Copyright (c) 2011 * Company:山东益信通科贸有限公司 */ package com.easecom.common.util; import java.sql.Types; import org.hibernate.Hibernate; import org.hibernate.dialect.MySQLDialect; /** * * @Description 功能描述 * * @author Administrator * @date Dec 12, 2011 10:13:42 AM */ public class mysqlDialect extends MySQLDialect{ public mysqlDialect() { super(); registerHibernateType(Types.DECIMAL, Hibernate.BIG_DECIMAL.getName()); registerHibernateType(Types.LONGVARCHAR, Hibernate.TEXT.getName()); } }
[ "530225288@qq.com" ]
530225288@qq.com
e99ef1c54dda855afd490a7c0d8d74d062d5838a
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/37_petsoar-org.petsoar.security.DefaultUserAccessor-1.0-8/org/petsoar/security/DefaultUserAccessor_ESTest_scaffolding.java
6df1276574b967f82b1435cccfdd4f8c2499054a
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Oct 25 23:31:44 GMT 2019 */ package org.petsoar.security; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DefaultUserAccessor_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
d8da8d67a57455936a5f58015c7afa4276507898
ce7f089378d817e242793649785b097c9be3f96b
/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/gondor/Card1_109.java
1347f49bef250601d5720b2ff119105a19932faa
[]
no_license
TheSkyGold/gemp-lotr
aaba1f461a3d9237d12ca340a7e899b00e4151e4
aab299c87fc9cabd10b284c25b699f10a84fe622
refs/heads/master
2021-01-11T07:39:27.678795
2014-11-21T00:44:25
2014-11-21T00:44:25
32,382,766
1
0
null
null
null
null
UTF-8
Java
false
false
3,577
java
package com.gempukku.lotro.cards.set1.gondor; import com.gempukku.lotro.cards.AbstractOldEvent; import com.gempukku.lotro.cards.PlayConditions; import com.gempukku.lotro.cards.actions.PlayEventAction; import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect; import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; import com.gempukku.lotro.cards.modifiers.AllyParticipatesInArcheryFireAndSkirmishesModifier; import com.gempukku.lotro.common.CardType; import com.gempukku.lotro.common.Culture; import com.gempukku.lotro.common.Phase; import com.gempukku.lotro.common.Side; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; import com.gempukku.lotro.logic.modifiers.StrengthModifier; /** * Set: The Fellowship of the Ring * Side: Free * Culture: Gondor * Twilight Cost: 0 * Type: Event * Game Text: Maneuver: Exert Aragorn to spot an ally. Until the regroup phase, that ally is strength +2 and * participates in archery fire and skirmishes. */ public class Card1_109 extends AbstractOldEvent { public Card1_109() { super(Side.FREE_PEOPLE, Culture.GONDOR, "One Whom Men Would Follow", Phase.MANEUVER); } @Override public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) && PlayConditions.canExert(self, game, Filters.aragorn); } @Override public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { final PlayEventAction action = new PlayEventAction(self); action.appendCost( new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.aragorn) { @Override protected void forEachCardExertedCallback(PhysicalCard character) { action.appendEffect( new ChooseActiveCardEffect(self, playerId, "Choose an ally", CardType.ALLY) { @Override protected void cardSelected(LotroGame game, PhysicalCard ally) { action.appendEffect( new AddUntilStartOfPhaseModifierEffect( new StrengthModifier(self, Filters.sameCard(ally), 2) , Phase.REGROUP)); action.appendEffect( new AddUntilStartOfPhaseModifierEffect( new AllyParticipatesInArcheryFireAndSkirmishesModifier(self, Filters.sameCard(ally)) , Phase.REGROUP)); } } ); } } ); return action; } @Override public int getTwilightCost() { return 0; } }
[ "marcins78@gmail.com@eb7970ca-0f6f-de4b-2938-835b230b9d1f" ]
marcins78@gmail.com@eb7970ca-0f6f-de4b-2938-835b230b9d1f
4119a1ef1883a758debb567d1c87d89f91ec3640
ea688975b1bdd7322ae0e61013d8bca0e88c499c
/order-server/src/main/java/com/cloud/order/mapper/OrderMasterMapper.java
b989ceaa7f54531499c56b00d2f59fa84fc34021
[]
no_license
xwzl/microservice
d341ed9fe75f5516ea1124f34b54cdf1d4017703
592fe6f5643aeb2b7465fd12cee78042b829f495
refs/heads/master
2020-05-24T23:09:02.915426
2019-09-17T08:48:04
2019-09-17T08:48:04
187,509,283
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.cloud.order.mapper; import com.cloud.order.model.OrderMaster; import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * <p> * Mapper 接口 * </p> * * @author xuweizhi * @since 2019-05-20 */ public interface OrderMasterMapper extends BaseMapper<OrderMaster> { }
[ "624244232@qq.com" ]
624244232@qq.com
0d453ccd1b932323e392f7d0c73f6338edbde54b
39a113f0f12e2d010b066dc88fc099aabe167ff1
/core/src/fr/fireowls/mercenaire/controller/PlayerController.java
bddc856c9b8767746610cb04cd3cae7cba68b250
[]
no_license
fireowls/mercenaire
ff66d227de98980c68838ebd3c4c7a1598935157
e42472b17cad58c92d5d9ab1b29e70c1228e1645
refs/heads/master
2023-01-20T10:42:17.558029
2020-02-07T09:54:41
2020-02-07T09:54:41
222,315,229
0
0
null
2023-01-07T12:48:29
2019-11-17T21:34:34
Java
UTF-8
Java
false
false
1,383
java
package fr.fireowls.mercenaire.controller; import fr.fireowls.apigame.entity.Player; import fr.fireowls.apigame.entity.type.movable.Direction; public class PlayerController extends Controller { private Player player; public PlayerController(Player player) { this.player = player; } @Override public void handler(ControllerStatus status) { if (status.isUp()) { if (status.isLeft()) { player.move(Direction.NORTH_WEST); return; } else if (status.isRight()) { player.move(Direction.NORTH_EST); return; } player.move(Direction.NORTH); } else if (status.isDown()) { if (status.isLeft()) { player.move(Direction.SOUTH_WEST); return; } else if (status.isRight()) { player.move(Direction.SOUTH_EST); return; } player.move(Direction.SOUTH); } else if (status.isLeft()) { player.move(Direction.WEST); } else if (status.isRight()) { player.move(Direction.EST); } else { player.move(Direction.STATIC); } } public Player getPlayer() { return player; } public void setPlayer(Player player) { this.player = player; } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
8ef8b3e4c46a41452432e62be15274edf42906eb
b5ec53fdc23fe0ca147b9f410aad421132e0c57f
/src/main/groovy/com/scarlatti/launch4j/ManifestProvider.java
c4a3f240e6886c5b7184228ed84c1c874d6b73ff
[ "MIT" ]
permissive
alessandroscarlatti/launch4j-gradle-plugin
2c274015b75d0dcbe6a7b1f5b84dd636c5a78bc8
1abd3c58fde2a66f33baae01e926121660605ab9
refs/heads/master
2020-03-15T17:55:33.265033
2018-09-01T20:50:26
2018-09-01T20:50:26
132,272,262
0
0
MIT
2018-09-01T20:50:41
2018-05-05T18:01:23
Java
UTF-8
Java
false
false
530
java
package com.scarlatti.launch4j; import java.io.Serializable; /** * ______ __ __ ____ __ __ __ _ * ___/ _ | / /__ ___ ___ ___ ____ ___/ /______ / __/______ _____/ /__ _/ /_/ /_(_) * __/ __ |/ / -_|_-<(_-</ _ `/ _ \/ _ / __/ _ \ _\ \/ __/ _ `/ __/ / _ `/ __/ __/ / * /_/ |_/_/\__/___/___/\_,_/_//_/\_,_/_/ \___/ /___/\__/\_,_/_/ /_/\_,_/\__/\__/_/ * Tuesday, 5/22/2018 */ public interface ManifestProvider extends Serializable { String buildRawManifest(); }
[ "violanotesnoextras@gmail.com" ]
violanotesnoextras@gmail.com
51c3f7d30d30aefc5f43ee3406d19485f2e47e5e
a94d20a6346d219c84cc97c9f7913f1ce6aba0f8
/felles/integrasjon/arbeidsfordeling-klient/src/main/java/no/nav/vedtak/felles/integrasjon/arbeidsfordeling/klient/ArbeidsfordelingConsumerProducerDelegator.java
9cb889f325ab9dba37a125c5b69c30a26156a3df
[ "MIT" ]
permissive
junnae/spsak
3c8a155a1bf24c30aec1f2a3470289538c9de086
ede4770de33bd896d62225a9617b713878d1efa5
refs/heads/master
2020-09-11T01:56:53.748986
2019-02-06T08:14:42
2019-02-06T08:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
795
java
package no.nav.vedtak.felles.integrasjon.arbeidsfordeling.klient; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.inject.Produces; import javax.inject.Inject; @ApplicationScoped public class ArbeidsfordelingConsumerProducerDelegator { private ArbeidsfordelingConsumerProducer producer; @Inject public ArbeidsfordelingConsumerProducerDelegator(ArbeidsfordelingConsumerProducer producer) { this.producer = producer; } @Produces public ArbeidsfordelingConsumer arbeidsfordelingConsumerForEndUser() { return producer.arbeidsfordelingConsumer(); } @Produces public ArbeidsfordelingSelftestConsumer arbeidsfordelingSelftestConsumerForSystemUser() { return producer.arbeidsfordelingSelftestConsumer(); } }
[ "roy.andre.gundersen@nav.no" ]
roy.andre.gundersen@nav.no
407b805c69f2524e863829b10c4a3f7443babfbc
f36c29c44e93b4c86741a7de4ab9dd85b7cd1b43
/core-customize/hybris/bin/custom/theBodyShopcore/src/uk/co/thebodyshop/core/strategies/impl/VariantProductsSortStrategy.java
52131fb1d69f45a15428ee515b78964fcb7324c2
[]
no_license
genabush/en-shop
22f2a3aed5867825b53409fb0bbcd9fefa9a81e7
3d5a4741e7af071c77374769410ec8a46d62a027
refs/heads/master
2023-01-28T23:23:26.086256
2020-01-25T16:02:22
2020-01-25T16:02:22
235,858,083
0
0
null
2023-01-05T05:42:42
2020-01-23T18:23:23
Java
UTF-8
Java
false
false
1,751
java
/* * Copyright (c) * 2019 THE BODY SHOP INTERNATIONAL LIMITED. * All rights reserved. */ package uk.co.thebodyshop.core.strategies.impl; import java.util.List; import de.hybris.platform.commercefacades.product.data.VariantOptionData; import uk.co.thebodyshop.core.enums.TbsBaseType; import uk.co.thebodyshop.core.model.TbsBaseProductModel; import uk.co.thebodyshop.core.variant.solr.data.VariantData; /** * @author Krishna */ public class VariantProductsSortStrategy { public List<VariantOptionData> sortVariantProductsInProductPage(final List<VariantOptionData> variantOptions, final TbsBaseProductModel baseProduct) { if (null != baseProduct.getType() && baseProduct.getType().equals(TbsBaseType.SIZE)) { variantOptions.sort((variantOption1, variantOption2) -> variantOption1.getSizeForSort().compareTo(variantOption2.getSizeForSort())); } if (null != baseProduct.getType() && baseProduct.getType().equals(TbsBaseType.COLOUR)) { variantOptions.sort((variantOption1, variantOption2) -> variantOption2.getColourPosition().compareTo(variantOption1.getColourPosition())); } return variantOptions; } public List<VariantData> sortVariantProducts(final List<VariantData> variantsData, final TbsBaseProductModel baseProduct) { if (null != baseProduct.getType() && baseProduct.getType().equals(TbsBaseType.SIZE)) { variantsData.sort((variantOption1, variantOption2) -> variantOption1.getSizeForSort().compareTo(variantOption2.getSizeForSort())); } if (null != baseProduct.getType() && baseProduct.getType().equals(TbsBaseType.COLOUR)) { variantsData.sort((variantOption1, variantOption2) -> variantOption2.getColourPosition().compareTo(variantOption1.getColourPosition())); } return variantsData; } }
[ "gennadiykulabukhov@ratiose.com" ]
gennadiykulabukhov@ratiose.com
66c86216f90275294ae775ce6ad5ca4955c732b4
b63ce462ac9cae6a223527e59e805b4d68cd7cea
/tdb2/src/main/java/org/seaborne/tdb2/store/Hash.java
6692325e8565fa9363e9b3c80a5eabb01430ce88
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
tonywoode/mantis
eccecd6891e44500375eefb99bee7b4b20eb0ef4
22318894704af206ee288ed4b3d3d45c8560f1c0
refs/heads/master
2021-04-29T05:12:34.060913
2017-01-02T17:42:02
2017-01-02T17:42:02
78,016,135
1
0
null
2017-01-04T13:04:47
2017-01-04T13:04:46
null
UTF-8
Java
false
false
1,491
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. * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. */ package org.seaborne.tdb2.store; import java.util.Arrays; import org.apache.jena.atlas.lib.Bytes ; /** Hash values. */ public class Hash { private byte [] bytes ; public Hash(int len) { bytes = new byte[len] ; } public int getLen() { return bytes.length ; } public byte [] getBytes() { return bytes ; } @Override public int hashCode() { return Arrays.hashCode(bytes) ; } @Override public boolean equals(Object other) { if ( this == other ) return true ; if ( ! (other instanceof Hash) ) return false ; boolean b = Arrays.equals(bytes, ((Hash)other).bytes) ; return b ; } @Override public String toString() { return "hash:"+Bytes.asHex(bytes) ; } }
[ "andy@seaborne.org" ]
andy@seaborne.org
aa4df4d407a8442709a6bdcdc41bf06b129f4fc1
32cd70512c7a661aeefee440586339211fbc9efd
/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/GetIdentityPoolRolesResult.java
1bb20e295fd75fb1edb65cccf954e92c7e6a04d4
[ "Apache-2.0" ]
permissive
twigkit/aws-sdk-java
7409d949ce0b0fbd061e787a5b39a93db7247d3d
0b8dd8cf5e52ad7ae57acd2ce7a584fd83a998be
refs/heads/master
2020-04-03T16:40:16.625651
2018-05-04T12:05:14
2018-05-04T12:05:14
60,255,938
0
1
Apache-2.0
2018-05-04T12:48:26
2016-06-02T10:40:53
Java
UTF-8
Java
false
false
6,597
java
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights * Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.cognitoidentity.model; import java.io.Serializable; /** * <p> * Returned in response to a successful <code>GetIdentityPoolRoles</code> * operation. * </p> */ public class GetIdentityPoolRolesResult implements Serializable, Cloneable { /** * <p> * An identity pool ID in the format REGION:GUID. * </p> */ private String identityPoolId; /** * <p> * The map of roles associated with this pool. Currently only authenticated * and unauthenticated roles are supported. * </p> */ private java.util.Map<String, String> roles; /** * <p> * An identity pool ID in the format REGION:GUID. * </p> * * @param identityPoolId * An identity pool ID in the format REGION:GUID. */ public void setIdentityPoolId(String identityPoolId) { this.identityPoolId = identityPoolId; } /** * <p> * An identity pool ID in the format REGION:GUID. * </p> * * @return An identity pool ID in the format REGION:GUID. */ public String getIdentityPoolId() { return this.identityPoolId; } /** * <p> * An identity pool ID in the format REGION:GUID. * </p> * * @param identityPoolId * An identity pool ID in the format REGION:GUID. * @return Returns a reference to this object so that method calls can be * chained together. */ public GetIdentityPoolRolesResult withIdentityPoolId(String identityPoolId) { setIdentityPoolId(identityPoolId); return this; } /** * <p> * The map of roles associated with this pool. Currently only authenticated * and unauthenticated roles are supported. * </p> * * @return The map of roles associated with this pool. Currently only * authenticated and unauthenticated roles are supported. */ public java.util.Map<String, String> getRoles() { return roles; } /** * <p> * The map of roles associated with this pool. Currently only authenticated * and unauthenticated roles are supported. * </p> * * @param roles * The map of roles associated with this pool. Currently only * authenticated and unauthenticated roles are supported. */ public void setRoles(java.util.Map<String, String> roles) { this.roles = roles; } /** * <p> * The map of roles associated with this pool. Currently only authenticated * and unauthenticated roles are supported. * </p> * * @param roles * The map of roles associated with this pool. Currently only * authenticated and unauthenticated roles are supported. * @return Returns a reference to this object so that method calls can be * chained together. */ public GetIdentityPoolRolesResult withRoles( java.util.Map<String, String> roles) { setRoles(roles); return this; } public GetIdentityPoolRolesResult addRolesEntry(String key, String value) { if (null == this.roles) { this.roles = new java.util.HashMap<String, String>(); } if (this.roles.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.roles.put(key, value); return this; } /** * Removes all the entries added into Roles. &lt;p> Returns a reference to * this object so that method calls can be chained together. */ public GetIdentityPoolRolesResult clearRolesEntries() { this.roles = null; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getIdentityPoolId() != null) sb.append("IdentityPoolId: " + getIdentityPoolId() + ","); if (getRoles() != null) sb.append("Roles: " + getRoles()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetIdentityPoolRolesResult == false) return false; GetIdentityPoolRolesResult other = (GetIdentityPoolRolesResult) obj; if (other.getIdentityPoolId() == null ^ this.getIdentityPoolId() == null) return false; if (other.getIdentityPoolId() != null && other.getIdentityPoolId().equals(this.getIdentityPoolId()) == false) return false; if (other.getRoles() == null ^ this.getRoles() == null) return false; if (other.getRoles() != null && other.getRoles().equals(this.getRoles()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getIdentityPoolId() == null) ? 0 : getIdentityPoolId() .hashCode()); hashCode = prime * hashCode + ((getRoles() == null) ? 0 : getRoles().hashCode()); return hashCode; } @Override public GetIdentityPoolRolesResult clone() { try { return (GetIdentityPoolRolesResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
[ "aws@amazon.com" ]
aws@amazon.com
247fb9b7f1b223cf748a21283d3718faed745d58
2bf30c31677494a379831352befde4a5e3d8ed19
/exportLibraries/vnxe/src/main/java/com/emc/storageos/vnxe/requests/FileSystemRequest.java
c9d3f117e859641b712a5478f6a1d50878cba282
[]
no_license
dennywangdengyu/coprhd-controller
fed783054a4970c5f891e83d696a4e1e8364c424
116c905ae2728131e19631844eecf49566e46db9
refs/heads/master
2020-12-30T22:43:41.462865
2015-07-23T18:09:30
2015-07-23T18:09:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
993
java
/* * Copyright 2015 EMC Corporation * All Rights Reserved */ /** * Copyright (c) 2014 EMC Corporation * All Rights Reserved * * This software contains the intellectual property of EMC Corporation * or is licensed to EMC Corporation from third parties. Use of this * software and the intellectual property contained therein is expressly * limited to the terms and conditions of the License Agreement under which * it is provided by or on behalf of EMC. */ package com.emc.storageos.vnxe.requests; import com.emc.storageos.vnxe.models.VNXeFileSystem; public class FileSystemRequest extends KHRequests<VNXeFileSystem>{ private static final String URL = "/api/instances/filesystem/"; public FileSystemRequest(KHClient client, String id) { super(client); _url = URL + id; } /** * Get the specific file system details * @return */ public VNXeFileSystem get(){ return getDataForOneObject(VNXeFileSystem.class); } }
[ "review-coprhd@coprhd.org" ]
review-coprhd@coprhd.org
37fb24757295fa1c7e7411f3d94a80968941f7a1
a33aac97878b2cb15677be26e308cbc46e2862d2
/data/libgdx/BufferUtils_reallocateBuffer.java
5c593d36483d0e8b7130eab3c7082a97c2206b03
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
601
java
/** * Reallocate a float buffer. A 'deferred' buffer is reallocated only if it is not NULL. If * 'userSuppliedCapacity' is not zero, buffer is user supplied and must be kept. */ public static float[] reallocateBuffer(float[] buffer, int userSuppliedCapacity, int oldCapacity, int newCapacity, boolean deferred) { assert (newCapacity > oldCapacity); assert (userSuppliedCapacity == 0 || newCapacity <= userSuppliedCapacity); if ((!deferred || buffer != null) && userSuppliedCapacity == 0) { buffer = reallocateBuffer(buffer, oldCapacity, newCapacity); } return buffer; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
bccb3754a8cd2f5b88b78085511567c26c722ae8
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-418-9-17-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/listener/chaining/AbstractChainingListener_ESTest_scaffolding.java
8e2f1a47e95db8115f5d12c0066f875d65625e14
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Apr 04 03:21:03 UTC 2020 */ package org.xwiki.rendering.listener.chaining; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class AbstractChainingListener_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
4322dd38ecd5d2c9f19dc2b2f71f5fc4e97617c9
1043c01b7637098d046fbb9dba79b15eefbad509
/entity-view/testsuite/src/test/java/com/blazebit/persistence/view/testsuite/subview/model/PersonSubView.java
bd7ddd9b9414ff649a2dbbd9f10c5710f757e28d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
ares3/blaze-persistence
45c06a3ec25c98236a109ab55a3205fc766734ed
2258e9d9c44bb993d41c5295eccbc894f420f263
refs/heads/master
2020-10-01T16:13:01.380347
2019-12-06T01:24:34
2019-12-09T09:29:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,266
java
/* * Copyright 2014 - 2019 Blazebit. * * 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.blazebit.persistence.view.testsuite.subview.model; import com.blazebit.persistence.view.EntityView; import com.blazebit.persistence.view.Mapping; import com.blazebit.persistence.testsuite.entity.Person; /** * * @author Christian Beikov * @since 1.0.0 */ @EntityView(Person.class) public interface PersonSubView extends SimplePersonSubView { // Although it might not be used, we add it to cover array expressions in subviews @Mapping("localized[1]") public String getFirstLocalized(); @Mapping("VIEW_ROOT()") public SimpleDocumentView getRoot(); @Mapping("EMBEDDING_VIEW()") public SimpleDocumentView getParent(); }
[ "christian.beikov@gmail.com" ]
christian.beikov@gmail.com
cc5488e7759349df707011fc69c41520d3eb8f10
5f3690eabb577d0b366fabcf45145f8f24ddb2e5
/user/src/main/java/com/core/user/utils/KeyUtil.java
c2b5e26d94a6e24b6cf1ef97e081cf67c70a8ae7
[]
no_license
zhlxs/Spring-Cloud-Rep
2f582216694e6014cfb882b1fb2344f84582f846
45899b2a962d1d5a279b485e78aaf35180bde988
refs/heads/main
2023-05-14T05:27:00.764115
2021-06-07T16:12:20
2021-06-07T16:12:20
363,565,653
0
0
null
null
null
null
UTF-8
Java
false
false
401
java
package com.core.user.utils; import java.util.Random; /** * Created by 廖师兄 * 2017-12-10 16:57 */ public class KeyUtil { /** * 生成唯一的主键 * 格式: 时间+随机数 */ public static synchronized String genUniqueKey() { Random random = new Random(); Integer number = random.nextInt(900000) + 100000; return System.currentTimeMillis() + String.valueOf(number); } }
[ "1358311815@qq.com" ]
1358311815@qq.com
5d805e1596edc7afa1772308ff0275b652dc1b09
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module953/src/main/java/module953packageJava0/Foo204.java
023b75ff59c7d3aeeaf315bcf799f551df486385
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
368
java
package module953packageJava0; import java.lang.Integer; public class Foo204 { Integer int0; Integer int1; Integer int2; public void foo0() { new module953packageJava0.Foo203().foo4(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
be54b043c544b09be4731b961ca4642aa81a5c8c
3225756485124eb52a137886dfc6a274151f80ab
/personalBlogDao/src/main/java/pl/java/borowiec/common/dao/hibernate/AbstractCriteriaHibernateDao.java
6dec5fc92a9abec96e414d010348e8dd1635b231
[ "MIT" ]
permissive
przodownikR1/springMvcStartKata
07e14a7dbd755d73f54d3217ae0a98597cc997c5
3a5673f30003287e9be9a36d32ffb807e00e1bfd
refs/heads/master
2022-12-21T11:46:22.854931
2014-09-26T19:36:08
2014-09-26T19:36:08
21,331,916
0
1
MIT
2022-12-16T03:02:52
2014-06-29T20:43:24
JavaScript
UTF-8
Java
false
false
1,817
java
package pl.java.borowiec.common.dao.hibernate; import java.io.Serializable; import java.util.List; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import com.google.common.base.Preconditions; /** * @author Sławomir Borowiec * Module name : personalBlogDao * Creating time : 06-04-2013 16:52:02 */ public abstract class AbstractCriteriaHibernateDao<T extends Serializable> { private final Class<T> clazz; @Autowired SessionFactory sessionFactory; public AbstractCriteriaHibernateDao(final Class<T> clazzToSet) { this.clazz = clazzToSet; } public T findById(final Long id) { Preconditions.checkArgument(id != null); return (T) this.getCurrentSession().get(this.clazz, id); } public List<T> getAll() { return this.getCurrentSession().createQuery("FROM " + this.clazz.getName()).list(); } public void save(final T entity) { Preconditions.checkNotNull(entity); this.getCurrentSession().persist(entity); } public T update(final T entity) { Preconditions.checkNotNull(entity); return (T) this.getCurrentSession().merge(entity); } public void remove(final T entity) { Preconditions.checkNotNull(entity); this.getCurrentSession().delete(entity); } public void removeById(final Long entityId) { final T entity = this.findById(entityId); Preconditions.checkState(entity != null); this.remove(entity); } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } protected final Session getCurrentSession() { return this.sessionFactory.getCurrentSession(); } public long countAll() { return (Long) sessionFactory.getCurrentSession().createQuery("Select count(*) FROM " + this.clazz.getName()).uniqueResult(); } }
[ "przodownik@tlen.pl" ]
przodownik@tlen.pl