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
a8505a992ae0531bbc98f04b85baba315535eabc
68b60f4eb6fe7414cb487b33eeaae5634e06e09f
/LRU Cache - Solution I.java
81c3ac0de7c8aaad11a98ad1faa152f5262b9257
[]
no_license
yoyoy74662000/lintcode-1
b7f3f9bd784711ccd93ccbbb6af4638e1ec74f8e
33d8baa34ee206df984415ec6d2d27bc7acd4076
refs/heads/master
2020-07-13T21:49:15.535410
2018-10-15T05:42:48
2018-10-15T05:42:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,741
java
public class LRUCache { private class Node { int key; int value; Node prev; Node next; Node(int key, int value) { this.key = key; this.value = value; this.prev = prev; this.next = next; } } private int capacity; private Node head = new Node(-1, -1); private Node tail = new Node(-1, -1); private Map<Integer, Node> map = new HashMap<Integer, Node>(); // @param capacity, an integer public LRUCache(int capacity) { // write your code here this.capacity = capacity; head.next = tail; tail.prev = head; } // @return an integer public int get(int key) { // write your code here if (!map.containsKey(key)) { return -1; } Node n = map.get(key); removeNode(n); moveToTail(n); return n.value; } // @param key, an integer // @param value, an integer // @return nothing public void set(int key, int value) { // write your code here if (get(key) != -1) { map.get(key).value = value; return; } if (map.size() == capacity) { map.remove(head.next.key); removeNode(head.next); } Node insert = new Node(key, value); map.put(key, insert); moveToTail(insert); } private void moveToTail(Node n) { n.next = tail; n.prev = tail.prev; tail.prev.next = n; tail.prev = n; } private void removeNode(Node node) { node.prev.next = node.next; node.next.prev = node.prev; node.next = null; node.prev = null; } }
[ "wn1842@gmail.com" ]
wn1842@gmail.com
19ac5dcaa133fa71afb9a4eea76d30df20af3f06
979e2c5b4f9fbbeddcc91fa48e4bcaad26ee4261
/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java
666a9a56a767b9f7c817e718f92eaa336831d70a
[]
no_license
Dashio297/LibsDisguises
3f8a3224d2c5206f17556906a9953e7a6aae94e8
807a1632568bd1a8391c3cb312c1f9ad7aad7afc
refs/heads/master
2023-04-19T05:46:24.834573
2021-05-08T10:34:35
2021-05-08T10:34:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,456
java
package me.libraryaddict.disguise.commands.modify; import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.commands.DisguiseBaseCommand; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguisePerm; import me.libraryaddict.disguise.utilities.parser.DisguisePermissions; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import java.util.ArrayList; import java.util.List; import java.util.UUID; public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { DisguisePermissions permissions = getPermissions(sender); if (!permissions.hasPermissions()) { LibsMsg.NO_PERM.send(sender); return true; } if (args.length == 0) { sendCommandUsage(sender, permissions); return true; } Entity entityTarget = Bukkit.getPlayer(args[0]); if (entityTarget == null) { if (args[0].contains("-")) { try { entityTarget = Bukkit.getEntity(UUID.fromString(args[0])); } catch (Exception ignored) { } } } if (entityTarget == null) { LibsMsg.CANNOT_FIND_PLAYER.send(sender, args[0]); return true; } String[] newArgs = new String[args.length - 1]; System.arraycopy(args, 1, newArgs, 0, newArgs.length); if (newArgs.length == 0) { sendCommandUsage(sender, permissions); return true; } Disguise disguise = null; if (sender instanceof Player) disguise = DisguiseAPI.getDisguise((Player) sender, entityTarget); if (disguise == null) disguise = DisguiseAPI.getDisguise(entityTarget); if (disguise == null) { LibsMsg.DMODPLAYER_NODISGUISE.send(sender, entityTarget.getName()); return true; } DisguisePerm disguisePerm = new DisguisePerm(disguise.getType()); if (!permissions.isAllowedDisguise(disguisePerm)) { LibsMsg.DMODPLAYER_NOPERM.send(sender); return true; } String[] options = DisguiseUtilities.split(StringUtils.join(newArgs, " ")); options = DisguiseParser.parsePlaceholders(options, sender, entityTarget); try { DisguiseParser.callMethods(sender, disguise, permissions, disguisePerm, new ArrayList<>(), options, "DisguiseModifyPlayer"); } catch (DisguiseParseException ex) { if (ex.getMessage() != null) { DisguiseUtilities.sendMessage(sender, ex.getMessage()); } return true; } catch (Exception ex) { ex.printStackTrace(); return true; } LibsMsg.DMODPLAYER_MODIFIED.send(sender, entityTarget.getName()); return true; } @Override public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] origArgs) { ArrayList<String> tabs = new ArrayList<>(); String[] args = getPreviousArgs(origArgs); DisguisePermissions perms = getPermissions(sender); if (!perms.hasPermissions()) { return tabs; } if (args.length == 0) { for (Player player : Bukkit.getOnlinePlayers()) { // If command user cannot see player online, don't tab-complete name if (sender instanceof Player && !((Player) sender).canSee(player)) { continue; } tabs.add(player.getName()); } } else { Player player = Bukkit.getPlayer(args[0]); if (player == null) { return tabs; } Disguise disguise = null; if (sender instanceof Player) disguise = DisguiseAPI.getDisguise((Player) sender, player); if (disguise == null) disguise = DisguiseAPI.getDisguise(player); if (disguise == null) { return tabs; } DisguisePerm disguiseType = new DisguisePerm(disguise.getType()); tabs.addAll(getTabDisguiseOptions(sender, perms, disguiseType, args, 1, getCurrentArg(args))); } return filterTabs(tabs, origArgs); } /** * Send the player the information */ @Override protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); LibsMsg.DMODPLAYER_HELP1.send(sender); LibsMsg.DMODIFY_HELP3.send(sender, StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())); } }
[ "github@lib.co.nz" ]
github@lib.co.nz
7ae612a19bbc1bfad7bded6670bc1527bea319a2
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
/bin/modules/sec-customer-service/cecsso/src/com/sap/hybris/cec/sso/CecssoStandalone.java
2478d2054c9b5d0613e96fcf1afffad8bd5b6c1b
[]
no_license
jp-developer0/hybrisTrail
82165c5b91352332a3d471b3414faee47bdb6cee
a0208ffee7fee5b7f83dd982e372276492ae83d4
refs/heads/master
2020-12-03T19:53:58.652431
2020-01-02T18:02:34
2020-01-02T18:02:34
231,430,332
0
4
null
2020-08-05T22:46:23
2020-01-02T17:39:15
null
UTF-8
Java
false
false
1,474
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package com.sap.hybris.cec.sso; import de.hybris.platform.core.Registry; import de.hybris.platform.util.RedeployUtilities; import de.hybris.platform.util.Utilities; /** * Demonstration of how to write a standalone application that can be run directly from within eclipse or from the * commandline.<br> * To run this from commandline, just use the following command:<br> * <code> * java -jar bootstrap/bin/ybootstrap.jar "new com.sap.hybris.cec.sso.CecssoStandalone().run();" * </code> From eclipse, just run as Java Application. Note that you maybe need to add all other projects like * ext-commerce, ext-pim to the Launch configuration classpath. */ public class CecssoStandalone { /** * Main class to be able to run it directly as a java program. * * @param args * the arguments from commandline */ public static void main(final String[] args) { new CecssoStandalone().run(); } public void run() { Registry.activateStandaloneMode(); Registry.activateMasterTenant(); Utilities.printAppInfo(); RedeployUtilities.shutdown(); } }
[ "juan.gonzalez.working@gmail.com" ]
juan.gonzalez.working@gmail.com
96501364039a58d9ff871510aeb6811fe74b4b6c
c1c6dc7d6806f6891e42c73ec0af7c32881aa2ec
/jstarcraft-ai-math/src/test/java/com/jstarcraft/ai/math/structure/matrix/LocalMatrixTestCase.java
1f3fa676bc0963d35fb118c5fd426e2b87cc2cfa
[ "Apache-2.0" ]
permissive
HongZhaoHua/jstarcraft-ai
21ead2a6c216c51dfb4f986406235029b3da165b
05b156623385dd817543bd1ac83943d2af0cb043
refs/heads/master
2023-04-18T04:44:51.601053
2023-04-11T03:14:22
2023-04-11T03:14:22
160,455,791
195
52
Apache-2.0
2022-08-06T05:14:00
2018-12-05T03:34:38
Java
UTF-8
Java
false
false
891
java
package com.jstarcraft.ai.math.structure.matrix; import com.jstarcraft.ai.math.structure.MathCalculator; import com.jstarcraft.core.utility.RandomUtility; public class LocalMatrixTestCase extends MatrixTestCase { @Override protected LocalMatrix getRandomMatrix(int dimension) { LocalMatrix matrix = new LocalMatrix(DenseMatrix.valueOf(dimension * 3, dimension * 3), dimension, dimension * 2, dimension, dimension * 2); matrix.iterateElement(MathCalculator.SERIAL, (scalar) -> { scalar.setValue(RandomUtility.randomInteger(dimension)); }); return matrix; } @Override protected LocalMatrix getZeroMatrix(int dimension) { LocalMatrix matrix = new LocalMatrix(DenseMatrix.valueOf(dimension * 3, dimension * 3), dimension, dimension * 2, dimension, dimension * 2); return matrix; } }
[ "Birdy@LAPTOP-QRG8T75T" ]
Birdy@LAPTOP-QRG8T75T
39f5d02a8107fba7622728707aecf2c13244aae7
9373fe952c96922d53468edbd844519b038d2c28
/Java/Loon-Neo/src/loon/physics/PHingeJoint.java
f5e7b4cfc14d18526feb1d7451e69db873a85ad7
[ "Apache-2.0" ]
permissive
dc6273632/LGame
58f2820db7baf76099e565f75ce7edd0eb600b7c
eccae858c2f40f8f5a5da9b9a62613ccb68d66fc
refs/heads/master
2020-04-29T18:02:40.009966
2019-03-18T08:59:43
2019-03-18T08:59:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,578
java
/** * Copyright 2013 The Loon 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 loon.physics; import loon.geom.Vector2f; import loon.utils.MathUtils; public class PHingeJoint extends PJoint { private Vector2f anchor1; private Vector2f anchor2; private float angI; private float angM; private PBody b1; private PBody b2; private boolean enableLimit; private boolean enableMotor; private Vector2f impulse; private float limI; private int limitState; private Vector2f localAnchor1; private Vector2f localAnchor2; private float localAngle; private PTransformer mass; private float maxAngle; private float minAngle; private float motI; private float motorSpeed; private float motorTorque; private Vector2f relAnchor1; private Vector2f relAnchor2; private float rest; private float targetAngleSpeed; public PHingeJoint(PBody b1, PBody b2, float rel1x, float rel1y, float rel2x, float rel2y) { this.b1 = b1; this.b2 = b2; localAngle = b2.ang - b1.ang; localAnchor1 = new Vector2f(rel1x, rel1y); localAnchor2 = new Vector2f(rel2x, rel2y); b1.mAng.transpose().mulEqual(localAnchor1); b2.mAng.transpose().mulEqual(localAnchor2); anchor1 = b1.mAng.mul(localAnchor1); anchor1.addSelf(b1.pos); anchor2 = b2.mAng.mul(localAnchor2); anchor2.addSelf(b2.pos); type = PJointType.HINGE_JOINT; mass = new PTransformer(); impulse = new Vector2f(); } public Vector2f getAnchorPoint1() { return anchor1.cpy(); } public Vector2f getAnchorPoint2() { return anchor2.cpy(); } public PBody getBody1() { return b1; } public PBody getBody2() { return b2; } public float getLimitRestitution(float restitution) { return rest; } public float getMaxAngle() { return maxAngle; } public float getMinAngle() { return minAngle; } public float getMotorSpeed() { return motorSpeed; } public float getMotorTorque() { return motorTorque; } public Vector2f getRelativeAnchorPoint1() { return relAnchor1.cpy(); } public Vector2f getRelativeAnchorPoint2() { return relAnchor2.cpy(); } public boolean isEnableLimit() { return enableLimit; } public boolean isEnableMotor() { return enableMotor; } void preSolve(float dt) { relAnchor1 = b1.mAng.mul(localAnchor1); relAnchor2 = b2.mAng.mul(localAnchor2); anchor1.set(relAnchor1.x + b1.pos.x, relAnchor1.y + b1.pos.y); anchor2.set(relAnchor2.x + b2.pos.x, relAnchor2.y + b2.pos.y); mass = PTransformer.calcEffectiveMass(b1, b2, relAnchor1, relAnchor2); angM = 1.0F / (b1.invI + b2.invI); float ang = b2.ang - b1.ang - localAngle; if (!enableMotor) { motI = 0.0F; } if (enableLimit) { if (ang < minAngle) { if (limitState != -1) { limI = 0.0F; } limitState = -1; if (b2.angVel - b1.angVel < 0.0F) { targetAngleSpeed = (b2.angVel - b1.angVel) * -rest; } else { targetAngleSpeed = 0.0F; } } else if (ang > maxAngle) { if (limitState != 1) { limI = 0.0F; } limitState = 1; if (b2.angVel - b1.angVel > 0.0F) { targetAngleSpeed = (b2.angVel - b1.angVel) * -rest; } else { targetAngleSpeed = 0.0F; } } else { limI = limitState = 0; } } else { limI = limitState = 0; } angI = 0.0F; b1.applyImpulse(impulse.x, impulse.y, anchor1.x, anchor1.y); b2.applyImpulse(-impulse.x, -impulse.y, anchor2.x, anchor2.y); b1.applyTorque(motI + limI); b2.applyTorque(-motI - limI); } public void setEnableLimit(boolean enable) { enableLimit = enable; } public void setEnableMotor(boolean enable) { enableMotor = enable; } public void setLimitAngle(float minAngle, float maxAngle) { this.minAngle = minAngle; this.maxAngle = maxAngle; } public void setLimitRestitution(float restitution) { rest = restitution; } public void setMaxAngle(float maxAngle) { this.maxAngle = maxAngle; } public void setMinAngle(float minAngle) { this.minAngle = minAngle; } public void setMotor(float speed, float torque) { motorSpeed = speed; motorTorque = torque; } public void setMotorSpeed(float speed) { motorSpeed = speed; } public void setMotorTorque(float torque) { motorTorque = torque; } public void setRelativeAnchorPoint1(float relx, float rely) { localAnchor1.set(relx, rely); b1.mAng.transpose().mulEqual(localAnchor1); } public void setRelativeAnchorPoint2(float relx, float rely) { localAnchor2.set(relx, rely); b2.mAng.transpose().mulEqual(localAnchor2); } void solvePosition() { if (enableLimit && limitState != 0) { float over = b2.ang - b1.ang - localAngle; if (over < minAngle) { over += 0.008F; over = ((over - minAngle) + b2.correctAngVel) - b1.correctAngVel; float torque = over * 0.2F * angM; float subAngleImpulse = angI; angI = MathUtils.min(angI + torque, 0.0F); torque = angI - subAngleImpulse; b1.positionCorrection(torque); b2.positionCorrection(-torque); } if (over > maxAngle) { over -= 0.008F; over = ((over - maxAngle) + b2.correctAngVel) - b1.correctAngVel; float torque = over * 0.2F * angM; float subAngleImpulse = angI; angI = MathUtils.max(angI + torque, 0.0F); torque = angI - subAngleImpulse; b1.positionCorrection(torque); b2.positionCorrection(-torque); } } Vector2f force = anchor2.sub(anchor1); force.subLocal(PTransformer.calcRelativeCorrectVelocity(b1, b2, relAnchor1, relAnchor2)); float length = force.length(); force.normalize(); force.mulLocal(MathUtils.max(length * 0.2f - 0.002f, 0.0f)); mass.mulEqual(force); b1.positionCorrection(force.x, force.y, anchor1.x, anchor1.y); b2.positionCorrection(-force.x, -force.y, anchor2.x, anchor2.y); } void solveVelocity(float dt) { Vector2f relVel = PTransformer.calcRelativeVelocity(b1, b2, relAnchor1, relAnchor2); Vector2f force = mass.mul(relVel).negate(); impulse.addSelf(force); b1.applyImpulse(force.x, force.y, anchor1.x, anchor1.y); b2.applyImpulse(-force.x, -force.y, anchor2.x, anchor2.y); if (enableMotor) { float angRelVel = b2.angVel - b1.angVel - motorSpeed; float torque = angM * angRelVel; float subMotorI = motI; motI = MathUtils.clamp(motI + torque, -motorTorque * dt, motorTorque * dt); torque = motI - subMotorI; b1.applyTorque(torque); b2.applyTorque(-torque); } if (enableLimit && limitState != 0) { float angRelVel = b2.angVel - b1.angVel - targetAngleSpeed; float torque = angM * angRelVel; float subLimitI = limI; if (limitState == -1) { limI = MathUtils.min(limI + torque, 0.0F); } else { if (limitState == 1) { limI = MathUtils.max(limI + torque, 0.0F); } } torque = limI - subLimitI; b1.applyTorque(torque); b2.applyTorque(-torque); } } void update() { relAnchor1 = b1.mAng.mul(localAnchor1); relAnchor2 = b2.mAng.mul(localAnchor2); anchor1.set(relAnchor1.x + b1.pos.x, relAnchor1.y + b1.pos.y); anchor2.set(relAnchor2.x + b2.pos.x, relAnchor2.y + b2.pos.y); if (b1.rem || b2.rem || b1.fix && b2.fix) { rem = true; } } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
370553dbc03f893b7d5d12e9bf7310efb3385c3a
74b2e8708cfe013527704c257e680020aaf8eb3c
/src/org/jfree/data/xy/XYDomainInfo.java
f5cf5256581d469f390fc40d5c5f9ffe8383b42a
[]
no_license
elfkingw/caipiao
7d9768683d50fa92d62f14dc19905eba45a90eba
65a0ee0722765ba359e1e88263384b20f3272bcf
refs/heads/master
2021-06-04T05:40:46.490377
2019-02-02T09:10:07
2019-02-02T09:10:07
10,156,520
1
1
null
2013-05-20T14:41:26
2013-05-19T14:26:25
Java
UTF-8
Java
false
false
2,342
java
/* =========================================================== * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * * (C) Copyright 2000-2011, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. * * [Oracle and Java are registered trademarks of Oracle and/or its affiliates. * Other names may be trademarks of their respective owners.] * * ----------------- * XYDomainInfo.java * ----------------- * (C) Copyright 2009, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; * * Changes * ------- * 27-Mar-2009 : Version 1 (DG); * */ package org.jfree.data.xy; import java.util.List; import org.jfree.data.Range; /** * An interface that can (optionally) be implemented by a dataset to assist in * determining the minimum and maximum x-values in the dataset. * * @since 1.0.13 */ public interface XYDomainInfo { /** * Returns the range of the values in this dataset's domain. * * @param visibleSeriesKeys the keys of the visible series. * @param includeInterval a flag that determines whether or not the * y-interval is taken into account. * * @return The range (or <code>null</code> if the dataset contains no * values). */ public Range getDomainBounds(List visibleSeriesKeys, boolean includeInterval); }
[ "elfkingw@gmail.com" ]
elfkingw@gmail.com
cf4176a1cb09aa5540589f769b6ee17bed9f185d
39e32f672b6ef972ebf36adcb6a0ca899f49a094
/dcm4jboss-all/branches/DCM4JBOSS_2_7_BRANCH/dcm4jboss-ejb/src/java/org/dcm4chex/archive/ejb/conf/AttributeFilter.java
6da9feae5eacef3d62b32c5eb5999ae499997621
[ "Apache-2.0" ]
permissive
medicayun/medicayundicom
6a5812254e1baf88ad3786d1b4cf544821d4ca0b
47827007f2b3e424a1c47863bcf7d4781e15e814
refs/heads/master
2021-01-23T11:20:41.530293
2017-06-05T03:11:47
2017-06-05T03:11:47
93,123,541
0
2
null
null
null
null
UTF-8
Java
false
false
5,214
java
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is part of dcm4che, an implementation of DICOM(TM) in * Java(TM), available at http://sourceforge.net/projects/dcm4che. * * The Initial Developer of the Original Code is * TIANI Medgraph AG. * Portions created by the Initial Developer are Copyright (C) 2003-2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Gunter Zeilinger <gunter.zeilinger@tiani.com> * Franz Willer <franz.willer@gwi-ag.com> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ package org.dcm4chex.archive.ejb.conf; import java.util.ArrayList; import java.util.Arrays; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** * * @author gunter.zeilinger@tiani.com * @version $Revision: 2010 $ $Date: 2005-10-07 03:55:27 +0800 (周五, 07 10月 2005) $ * @since 28.12.2003 */ public final class AttributeFilter { private int[] patientFilter; private int[] studyFilter; private int[] seriesFilter; private int[] instanceFilter; private int[] noCoercion; private static int[] parseInts(ArrayList list) { int[] array = new int[list.size()]; for (int i = 0; i < array.length; i++) { array[i] = Integer.parseInt((String) list.get(i), 16); } Arrays.sort(array); return array; } private class MyHandler extends DefaultHandler { private String level; private ArrayList filter = new ArrayList(); private ArrayList noCoerceList = new ArrayList(); public void startElement( String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals("attr")) { String tag = attributes.getValue("tag"); String coerce = attributes.getValue("coerce"); filter.add(tag); if ("false".equalsIgnoreCase(coerce)) noCoerceList.add(tag); } else if (qName.equals("filter")) { level = attributes.getValue("level"); } } public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("filter")) { if (level.equals("PATIENT")) { patientFilter = AttributeFilter.parseInts(filter); } else if (level.equals("STUDY")) { studyFilter = AttributeFilter.parseInts(filter); } else if (level.equals("SERIES")) { seriesFilter = AttributeFilter.parseInts(filter); } else if (level.equals("IMAGE")) { instanceFilter = AttributeFilter.parseInts(filter); } filter.clear(); } } public void endDocument() throws SAXException { noCoercion = AttributeFilter.parseInts(noCoerceList); noCoerceList.clear(); } } public AttributeFilter(String uri) throws ConfigurationException { try { SAXParserFactory.newInstance().newSAXParser().parse( uri, new MyHandler()); } catch (Exception e) { throw new ConfigurationException( "Failed to load attribute filter from " + uri, e); } } public final int[] getPatientFilter() { return patientFilter; } public final int[] getStudyFilter() { return studyFilter; } public final int[] getSeriesFilter() { return seriesFilter; } public final int[] getInstanceFilter() { return instanceFilter; } public boolean isCoercionForbidden(int tag) { return Arrays.binarySearch(noCoercion, tag) >= 0; } }
[ "liliang_lz@icloud.com" ]
liliang_lz@icloud.com
c365490b2d46dd1a0b0584d871117d1760c984f7
d8d3fe25db32dee1ef3b3fe62cb60888a4e97262
/deviceManage/src/main/java/com/digitzones/devmgr/dao/impl/CheckingPlanDaoImpl.java
63f8732181098de8f6aa2f29eb900fd532398187
[]
no_license
zhuyy430/dimes_zj
271a1c7d193c1b04cfa38d5142155491b077e091
4819a71fc280fe79ebba3d910eb7419b3263c946
refs/heads/main
2023-01-31T15:58:52.341085
2020-12-16T04:56:09
2020-12-16T04:56:09
321,871,248
0
0
null
null
null
null
UTF-8
Java
false
false
414
java
package com.digitzones.devmgr.dao.impl; import org.springframework.stereotype.Repository; import com.digitzones.dao.impl.CommonDaoImpl; import com.digitzones.devmgr.dao.ICheckingPlanDao; import com.digitzones.devmgr.model.CheckingPlan; @Repository public class CheckingPlanDaoImpl extends CommonDaoImpl<CheckingPlan> implements ICheckingPlanDao { public CheckingPlanDaoImpl() { super(CheckingPlan.class); } }
[ "297410318@qq.com" ]
297410318@qq.com
831885ed6dd10cd9560c1df19cdd5ccc085e0837
ac59fc1c266333322745039c8d3e4a3db4fc8a78
/java/com/hmdzl/spspd/items/armor/normalarmor/ProtectiveclothingArmor.java
34e3d66b2e4b4a11ed9691843887962b407484e0
[]
no_license
user00100-bug/SPS-PD
3186d3f31ec44089af498fac60c59425878d29b8
8b47d7c7d45e22833ee5f32ad64745c5ad8ede20
refs/heads/master
2023-01-07T06:20:16.019858
2020-10-25T12:28:50
2020-10-25T12:28:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
/* * Pixel Dungeon * Copyright (C) 2012-2014 Oleg Dolya * * 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 com.hmdzl.spspd.items.armor.normalarmor; import com.hmdzl.spspd.items.Item; import com.hmdzl.spspd.sprites.ItemSpriteSheet; public class ProtectiveclothingArmor extends NormalArmor { { //name = "protectiveclothing armor"; image = ItemSpriteSheet.PRO_ARMOR; STR -= 1; MAX = 30; MIN = 0; } public ProtectiveclothingArmor() { super(5,2.4f,4f,3); } @Override public Item upgrade(boolean hasglyph) { MIN -= 1; return super.upgrade(hasglyph); } }
[ "295754791@qq.com" ]
295754791@qq.com
d77b984f275c7415fc2dff2772149da6377a0753
0e31444a2403394a76533502728117f83acf5df1
/src/org/ice1000/julia/devkt/lang/psi/impl/JuliaIntegerImpl.java
6d76f6e337eb9662500b2e613c79d0b64113382e
[ "MIT" ]
permissive
devkt-plugins/julia-devkt
7dd4421820a5108ed8388522cfe0dfa3adac9ae6
74acbc2c6cf8924f33bc37eba539cf0403ece11c
refs/heads/master
2020-03-10T17:51:20.936506
2018-09-15T03:17:40
2018-09-15T03:17:40
129,510,220
0
0
null
null
null
null
UTF-8
Java
false
true
713
java
// This is a generated file. Not intended for manual editing. package org.ice1000.julia.devkt.lang.psi.impl; import org.jetbrains.annotations.*; import org.jetbrains.kotlin.com.intellij.psi.PsiElementVisitor; import org.ice1000.julia.devkt.lang.psi.*; import org.jetbrains.kotlin.com.intellij.lang.ASTNode; public class JuliaIntegerImpl extends JuliaExprImpl implements JuliaInteger { public JuliaIntegerImpl(ASTNode node) { super(node); } public void accept(@NotNull JuliaVisitor visitor) { visitor.visitInteger(this); } public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof JuliaVisitor) accept((JuliaVisitor)visitor); else super.accept(visitor); } }
[ "ice1000kotlin@foxmail.com" ]
ice1000kotlin@foxmail.com
fd9585b96d80142827239015fe554cc75d264f30
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/grade/e23b96b6bab26bd14316cefafcbaa16dd8eafcfb97a7159a7772f3c8bb3e78fb353dea728f6b4df6528286af5f0b85fd134c79886c9c2a352fe80d8204c69111/001/mutations/71/grade_e23b96b6_001.java
25d67fa67c4290ff2f337f9f6b11f5cb663e0121
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,513
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class grade_e23b96b6_001 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { grade_e23b96b6_001 mainClass = new grade_e23b96b6_001 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { FloatObj a = new FloatObj (), b = new FloatObj (), c = new FloatObj (), d = new FloatObj (); FloatObj percent = new FloatObj (); output += (String.format ("Enter thresholds for A, B, C, D\nin that order, decreasing percentages > ")); a.value = scanner.nextFloat (); b.value = scanner.nextFloat (); c.value = scanner.nextFloat (); d.value = scanner.nextFloat (); output += (String.format ("Thank you. Now enter student score (percent) >")); percent.value = scanner.nextFloat (); if (percent.value > a.value) { output += (String.format ("Student has an A grade\n")); } else if (true && percent.value >= b.value) { output += (String.format ("Student has an B grade\n")); } else if (percent.value <= b.value && percent.value >= c.value) { output += (String.format ("Student has an C grade\n")); } else if (percent.value <= c.value && percent.value >= d.value) { output += (String.format ("Student has an D grade\n")); } else if (percent.value < d.value) { output += (String.format ("Student has failed that course\n")); } if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
03af699115f0a054253f926c93788b20a0acc98f
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
/flakiness-predicter/input_data/original_tests/joel-costigliola-assertj-core/nonFlakyMethods/org.assertj.core.internal.files.Files_assertEqualContent_Test-should_throw_error_if_expected_is_not_file.java
eb214afa136c6c8b69a484101cdd105a18c3827f
[ "BSD-3-Clause" ]
permissive
Taher-Ghaleb/FlakeFlagger
6fd7c95d2710632fd093346ce787fd70923a1435
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
refs/heads/main
2023-07-14T16:57:24.507743
2021-08-26T14:50:16
2021-08-26T14:50:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
@Test public void should_throw_error_if_expected_is_not_file(){ thrown.expectIllegalArgumentException("Expected file:<'xyz'> should be an existing file"); File notAFile=new File("xyz"); files.assertSameContentAs(someInfo(),actual,notAFile); }
[ "aalsha2@masonlive.gmu.edu" ]
aalsha2@masonlive.gmu.edu
38a485450d5c1b63fab97bf4d20300af9b3a94e0
064875f6746ff611f142c44c2e19deadbcb94b36
/integration/src/main/java/net/firejack/platform/utils/OpenFlameConfig.java
85649b0caefda4864ae3854b9400073aab853ea1
[ "Apache-2.0" ]
permissive
alim-firejack/Firejack-Platform
d7faeb35091c042923e698d598d0118f3f4b0c11
bc1f58d425d91425cfcd6ab4fb6b1eed3fe0b815
refs/heads/master
2021-01-15T09:23:05.489281
2014-02-27T17:39:25
2014-02-27T17:39:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,532
java
/* * Firejack Open Flame - Copyright (c) 2011 Firejack Technologies * * This source code is the product of the Firejack Technologies * Core Technologies Team (Benjamin A. Miller, Oleg Marshalenko, and Timur * Asanov) and licensed only under valid, executed license agreements * between Firejack Technologies and its customers. Modification and / or * re-distribution of this source code is allowed only within the terms * of an executed license agreement. * * Any modification of this code voids any and all warranties and indemnifications * for the component in question and may interfere with upgrade path. Firejack Technologies * encourages you to extend the core framework and / or request modifications. You may * also submit and assign contributions to Firejack Technologies for consideration * as improvements or inclusions to the platform to restore modification * warranties and indemnifications upon official re-distributed in patch or release form. */ package net.firejack.platform.utils; import net.firejack.platform.core.exception.BusinessFunctionException; import net.firejack.platform.core.utils.ConfigContainer; import net.firejack.platform.core.utils.Env; import net.firejack.platform.core.utils.InstallUtils; import net.firejack.platform.web.security.x509.KeyUtils; import javax.ws.rs.core.Response; import java.io.IOException; import java.util.HashMap; import java.util.Map; public enum OpenFlameConfig { DOMAIN_URL("system.host"), PORT("system.port"), CONTEXT_URL("context.url"), DB_PORT("db.port", true), DB_URL("db.url"), DB_SCHEMA("db.schema", true), DB_HOST("db.host", true), DB_USER_NAME("db.username"), DB_USER_PASSWORD("db.password"), MC_SERVER_URL("memcached.url"), MC_PORT("memcached.port"), APP_ADMIN_NAME("app.admin.name", false), APP_ADMIN_EMAIL("app.admin.email", false), APP_ADMIN_PASSWORD("app.admin.password", false), MASTER_URL("opf.master.url", false), APP_ENV_PROPERTIES("app.env.properties", ""), APP_ENV_XML("app.env.xml", ""), SESSION_EXPIRATION_PERIOD("session.expiration.period", "43200000"); //12 h // SESSION_EXPIRATION_PERIOD("session.expiration.period", "300000"); //5 min private boolean saved; private String key; private String defaultVal; OpenFlameConfig(String key) { this.key = key; this.saved = true; } OpenFlameConfig(String key, boolean saved) { this.key = key; this.saved = saved; } OpenFlameConfig(String key, String defaultVal) { this(key); this.defaultVal = defaultVal; } public boolean isSaved() { return saved; } /** * @return */ public String getKey() { return key; } /** * @return */ public String getValue() { return ConfigContainer.get(key, defaultVal); } /** * @param value */ public void setValue(String value) { ConfigContainer.put(key, value); } /** * @return */ public boolean exist() { return ConfigContainer.contains(key); } /** * @return */ public static Map<String, String> filter() { Map<String, String> map = new HashMap<String, String>(); for (OpenFlameConfig config : values()) { if (config.isSaved() && config.exist() && config.getValue() != null) { map.put(config.getKey(), config.getValue()); } } return map; } public static void save() { try { KeyUtils.setProperties(Env.getDefaultEnvFile(), InstallUtils.getKeyStore(), filter()); } catch (IOException e) { throw new BusinessFunctionException(MessageKeys.APP_FAILED_TO_SAVE_SETTINGS, null, Response.Status.INTERNAL_SERVER_ERROR); } } }
[ "CF8DCmPgvS" ]
CF8DCmPgvS
c9d3a0acdb1115d759e1382a270e968e2de3ec1e
482a0fe6424b42de7f2768f7b64c4fd36dd24054
/apps/gmail/gmail_uncompressed/app/src/org/apache/a/a/a.java
7978dad1e797113195295c2d8e4e8dc2adab0101
[]
no_license
dan7800/SoftwareTestingGradProjectTeamB
b96d10c6b42e2e554e51fc1d7fd7a7189afe79d6
0ad2d46d692c77bdc75f8a82162749e2e652c7ab
refs/heads/master
2021-01-22T09:27:25.378594
2015-05-15T23:59:13
2015-05-15T23:59:13
30,304,655
0
0
null
null
null
null
UTF-8
Java
false
false
2,383
java
package org.apache.a.a; import java.io.*; import org.apache.a.a.a.*; public final class a { public static final char cDb; public static final String czG; static { cDb = File.separatorChar; final StringWriter stringWriter = new StringWriter(4); new PrintWriter(stringWriter).println(); czG = stringWriter.toString(); } private static int a(final Reader reader, final Writer writer) { final char[] array = new char[4096]; long n = 0L; while (true) { final int read = reader.read(array); if (-1 == read) { break; } writer.write(array, 0, read); n += read; } if (n > 2147483647L) { return -1; } return (int)n; } private static void a(final InputStream inputStream, final Writer writer) { a(new InputStreamReader(inputStream), writer); } public static int b(final InputStream inputStream, final OutputStream outputStream) { final long c = c(inputStream, outputStream); if (c > 2147483647L) { return -1; } return (int)c; } public static long c(final InputStream inputStream, final OutputStream outputStream) { final byte[] array = new byte[4096]; long n = 0L; while (true) { final int read = inputStream.read(array); if (-1 == read) { break; } outputStream.write(array, 0, read); n += read; } return n; } public static String c(final InputStream inputStream, final String s) { final StringWriter stringWriter = new StringWriter(); if (s == null) { a(inputStream, stringWriter); } else { a(new InputStreamReader(inputStream, s), stringWriter); } return stringWriter.toString(); } public static byte[] h(final InputStream inputStream) { final org.apache.a.a.a.a a = new org.apache.a.a.a.a(); b(inputStream, a); return a.toByteArray(); } public static String i(final InputStream inputStream) { final StringWriter stringWriter = new StringWriter(); a(inputStream, stringWriter); return stringWriter.toString(); } }
[ "mjthornton0112@gmail.com" ]
mjthornton0112@gmail.com
e386ac18d11bd47ea72ec18a74e6f09dbad3a120
f1b39c85dfa176c82a241fb0da39c482ce5e5725
/src/jp/or/med/orca/qkan/affair/qs/qs001/QS001_17611_201504Event.java
cc03444ffccd644cce480295e3b5eb317e020391
[]
no_license
linuxmaniajp/qkan
114bb9665a6b2e6b278d2fd7ed5619d74e5c2337
30c0513399e49828ca951412e21a22a058868729
refs/heads/master
2021-05-23T18:48:48.477599
2018-04-23T04:27:09
2018-04-23T04:27:09
null
0
0
null
null
null
null
SHIFT_JIS
Java
false
false
6,554
java
/* * Project code name "ORCA" * 給付管理台帳ソフト QKANCHO(JMA care benefit management software) * Copyright(C) 2002 JMA (Japan Medical Association) * * This program is part of "QKANCHO (JMA care benefit management software)". * * This program is distributed in the hope that it will be useful * for further advancement in medical care, according to JMA Open * Source License, but WITHOUT ANY WARRANTY. * Everyone is granted permission to use, copy, modify and * redistribute this program, but only under the conditions described * in the JMA Open Source License. You should have received a copy of * this license along with this program. If not, stop using this * program and contact JMA, 2-28-16 Honkomagome, Bunkyo-ku, Tokyo, * 113-8621, Japan. ***************************************************************** * アプリ: QKANCHO * 開発者: 樋口 雅彦 * 作成日: 2012/02/24 日本コンピューター株式会社 樋口 雅彦 新規作成 * 更新日: ----/--/-- * システム 給付管理台帳 (Q) * サブシステム 予定管理 (S) * プロセス サービス予定 (001) * プログラム サービスパターン定期巡回・随時対応型訪問介護看護 (QS001_17611_201504) * ***************************************************************** */ package jp.or.med.orca.qkan.affair.qs.qs001; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import jp.nichicom.ac.ACCommon; import jp.nichicom.ac.component.ACComboBox; import jp.nichicom.vr.util.VRMap; /** * サービスパターン定期巡回・随時対応型訪問介護看護イベント定義(QS001_17611_201504) */ public abstract class QS001_17611_201504Event extends QS001_17611_201504State implements QS001Service { /** * コンストラクタです。 */ public QS001_17611_201504Event(){ addEvents(); } /** * イベント発生条件を定義します。 */ protected void addEvents() { getDivisionRadioGroup().addListSelectionListener(new ListSelectionListener(){ private boolean lockFlag = false; public void valueChanged(ListSelectionEvent e) { if (lockFlag) { return; } lockFlag = true; try { divisionRadioGroupSelectionChanged(e); }catch(Throwable ex){ ACCommon.getInstance().showExceptionMessage(ex); }finally{ lockFlag = false; } } }); getSijishoOfferRadioGroup().addListSelectionListener(new ListSelectionListener(){ private boolean lockFlag = false; public void valueChanged(ListSelectionEvent e) { if (lockFlag) { return; } lockFlag = true; try { sijishoOfferRadioGroupSelectionChanged(e); }catch(Throwable ex){ ACCommon.getInstance().showExceptionMessage(ex); }finally{ lockFlag = false; } } }); getCrackOnDayCheck().addActionListener(new ActionListener(){ private boolean lockFlag = false; public void actionPerformed(ActionEvent e) { if (lockFlag) { return; } lockFlag = true; try { crackOnDayCheckActionPerformed(e); }catch(Throwable ex){ ACCommon.getInstance().showExceptionMessage(ex); }finally{ lockFlag = false; } } }); } //コンポーネントイベント /** * 「施設区分の変更」イベントです。 * @param e イベント情報 * @throws Exception 処理例外 */ protected abstract void divisionRadioGroupSelectionChanged(ListSelectionEvent e) throws Exception; /** * 「指示の提供変更」イベントです。 * @param e イベント情報 * @throws Exception 処理例外 */ protected abstract void sijishoOfferRadioGroupSelectionChanged(ListSelectionEvent e) throws Exception; /** * 「日割選択処理」イベントです。 * @param e イベント情報 * @throws Exception 処理例外 */ protected abstract void crackOnDayCheckActionPerformed(ActionEvent e) throws Exception; //変数定義 //getter/setter //内部関数 /** * 「初期化」に関する処理を行ないます。 * * @throws Exception 処理例外 * */ public abstract void initialize() throws Exception; /** * 「事業所コンボ変更時関数」に関する処理を行ないます。 * * @param provider VRMap * @throws Exception 処理例外 * */ public abstract void providerSelected(VRMap provider) throws Exception; /** * 「入力内容の不備を検査」に関する処理を行ないます。 * * @throws Exception 処理例外 * @return VRMap */ public abstract VRMap getValidData() throws Exception; /** * 「事業所情報の必要性を取得」に関する処理を行ないます。 * * @throws Exception 処理例外 * @return boolean */ public abstract boolean isUseProvider() throws Exception; /** * 「開始時刻入力用のコンボ取得」に関する処理を行ないます。 * * @throws Exception 処理例外 * @return ACComboBox */ public abstract ACComboBox getBeginTimeCombo() throws Exception; /** * 「終了時刻入力用のコンボ取得」に関する処理を行ないます。 * * @throws Exception 処理例外 * @return ACComboBox */ public abstract ACComboBox getEndTimeCombo() throws Exception; /** * 「画面状態制御」に関する処理を行ないます。 * * @throws Exception 処理例外 * */ public abstract void checkState() throws Exception; /** * 「日割チェック画面制御」に関する処理を行ないます。 * * @throws Exception 処理例外 * */ public abstract void checkOnDayCheckState() throws Exception; /** * 「バインド処理」に関する処理を行ないます。 * * @throws Exception 処理例外 * */ public abstract void binded() throws Exception; }
[ "yoshida@cvs.orca.med.or.jp" ]
yoshida@cvs.orca.med.or.jp
ba98ffb415c8e90694a28b7300d1ce7ac7fd4cb8
adb098c741fa9cd5cdfeca06571b78b461c74bdf
/src/main/java/com/mycompany/myapp/config/CacheConfiguration.java
c9efb070ca79aafe0b041d0980fef5e9c4751827
[]
no_license
Rizoren/jhipster-sample-application
ab1b7983048dfb9341620aa5177c6393d6841699
97f2a0ef28b06b21410ee8584f75e4e3577abd40
refs/heads/master
2022-12-23T22:51:42.257814
2020-01-11T10:08:03
2020-01-11T10:08:03
230,866,597
0
0
null
2022-12-16T04:43:11
2019-12-30T07:09:10
Java
UTF-8
Java
false
false
2,643
java
package com.mycompany.myapp.config; import java.time.Duration; import org.ehcache.config.builders.*; import org.ehcache.jsr107.Eh107Configuration; import org.hibernate.cache.jcache.ConfigSettings; import io.github.jhipster.config.JHipsterProperties; import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.*; @Configuration @EnableCaching public class CacheConfiguration { private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration; public CacheConfiguration(JHipsterProperties jHipsterProperties) { JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache(); jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration( CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class, ResourcePoolsBuilder.heap(ehcache.getMaxEntries())) .withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds()))) .build()); } @Bean public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) { return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager); } @Bean public JCacheManagerCustomizer cacheManagerCustomizer() { return cm -> { createCache(cm, com.mycompany.myapp.repository.UserRepository.USERS_BY_LOGIN_CACHE); createCache(cm, com.mycompany.myapp.repository.UserRepository.USERS_BY_EMAIL_CACHE); createCache(cm, com.mycompany.myapp.domain.User.class.getName()); createCache(cm, com.mycompany.myapp.domain.Authority.class.getName()); createCache(cm, com.mycompany.myapp.domain.User.class.getName() + ".authorities"); createCache(cm, com.mycompany.myapp.domain.Region.class.getName()); createCache(cm, com.mycompany.myapp.domain.Subsistence.class.getName()); createCache(cm, com.mycompany.myapp.domain.Document.class.getName()); // jhipster-needle-ehcache-add-entry }; } private void createCache(javax.cache.CacheManager cm, String cacheName) { javax.cache.Cache<Object, Object> cache = cm.getCache(cacheName); if (cache != null) { cm.destroyCache(cacheName); } cm.createCache(cacheName, jcacheConfiguration); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d2169b2a24a4867a33e3e99aea9539772ec5a733
b1bc6be0d323f93d6eb0507ac8b545401c1fedcc
/headFirstDesignPattern/src/headfirst/command/simpleremote/LightOnCommand.java
347a07af596dbc36156f9cedcce7fd176d243f8c
[]
no_license
xdc0209/java-code
5a331ebcae979fe6b672b527e3b533f2bb42866c
9dc5c89d9a1f8d880afff34903d315c3ca8ddbb2
refs/heads/master
2021-01-17T01:28:31.707484
2019-04-16T18:51:47
2019-04-16T18:51:47
9,099,623
7
4
null
null
null
null
UTF-8
Java
false
false
248
java
package headfirst.command.simpleremote; public class LightOnCommand implements Command { Light light; public LightOnCommand(Light light) { this.light = light; } public void execute() { light.on(); } }
[ "xdc0209@qq.com" ]
xdc0209@qq.com
3a2704483abd543ab3a5b004820d04f71e7ba481
a0c750f0ec36a4dbca4d7ab7cd3a476008e6f474
/src/main/java/com/alibaba/dubbo/registry/status/RegistryStatusChecker.java
2100042d94f096112eecc3d022bde2488ea1d6a7
[]
no_license
Fyypumpkin/dubbo-decompile-source
dc7251f6db19e6f8134ed49360add502a71f698b
2510460f89dec2d7bc11769507cc37882f9b7ba7
refs/heads/master
2020-06-10T10:25:00.460681
2019-06-25T04:26:55
2019-06-25T04:26:55
193,633,856
0
0
null
null
null
null
UTF-8
Java
false
false
1,294
java
/* * Decompiled with CFR 0.139. */ package com.alibaba.dubbo.registry.status; import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.Activate; import com.alibaba.dubbo.common.status.Status; import com.alibaba.dubbo.common.status.StatusChecker; import com.alibaba.dubbo.registry.Registry; import com.alibaba.dubbo.registry.support.AbstractRegistryFactory; import java.util.Collection; @Activate public class RegistryStatusChecker implements StatusChecker { @Override public Status check() { Collection<Registry> regsitries = AbstractRegistryFactory.getRegistries(); if (regsitries == null || regsitries.size() == 0) { return new Status(Status.Level.UNKNOWN); } Status.Level level = Status.Level.OK; StringBuilder buf = new StringBuilder(); for (Registry registry : regsitries) { if (buf.length() > 0) { buf.append(","); } buf.append(registry.getUrl().getAddress()); if (!registry.isAvailable()) { level = Status.Level.ERROR; buf.append("(disconnected)"); continue; } buf.append("(connected)"); } return new Status(level, buf.toString()); } }
[ "fyypumpkin@gmail.com" ]
fyypumpkin@gmail.com
0ee7bf8bb2d552e14ba6d1d9f61852e40a9dcbcb
c3381ece1e660f2d626480152349262a511aefb5
/icefrog-cron/src/main/java/com/whaleal/icefrog/cron/pattern/parser/MonthValueParser.java
7b7d162dc3050d719dcb92b1073077469fa3b27b
[ "Apache-2.0" ]
permissive
whaleal/icefrog
775e02be5b2fc8d04df1dd490aa765232cb0e6a4
c8dc384a3de1ed17077ff61ba733b1e2f37e32ab
refs/heads/v1-dev
2022-07-27T01:27:52.624849
2022-06-20T13:38:12
2022-06-20T13:38:12
414,203,703
9
5
Apache-2.0
2022-06-20T14:08:57
2021-10-06T12:30:31
Java
UTF-8
Java
false
false
1,124
java
package com.whaleal.icefrog.cron.pattern.parser; import com.whaleal.icefrog.cron.CronException; /** * 月份值处理 * * @author Looly * @author wh */ public class MonthValueParser extends SimpleValueParser { /** * Months aliases. */ private static final String[] ALIASES = {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"}; public MonthValueParser() { super(1, 12); } @Override public int parse( String value ) throws CronException { try { return super.parse(value); } catch (Exception e) { return parseAlias(value); } } /** * 解析别名 * * @param value 别名值 * @return 月份int值 * @throws CronException 无效月别名抛出此异常 */ private int parseAlias( String value ) throws CronException { for (int i = 0; i < ALIASES.length; i++) { if (ALIASES[i].equalsIgnoreCase(value)) { return i + 1; } } throw new CronException("Invalid month alias: {}", value); } }
[ "hbn.king@gmail.com" ]
hbn.king@gmail.com
8f672233b2140d3623f84f7859f121114f940a6d
b214f96566446763ce5679dd2121ea3d277a9406
/modules/base/language-api/src/main/java/consulo/language/psi/resolve/PsiScopesUtilCore.java
92e465a8880ac8947081fd55112e9b4e17159b33
[ "Apache-2.0", "LicenseRef-scancode-jgraph" ]
permissive
consulo/consulo
aa340d719d05ac6cbadd3f7d1226cdb678e6c84f
d784f1ef5824b944c1ee3a24a8714edfc5e2b400
refs/heads/master
2023-09-06T06:55:04.987216
2023-09-01T06:42:16
2023-09-01T06:42:16
10,116,915
680
54
Apache-2.0
2023-06-05T18:28:51
2013-05-17T05:48:18
Java
UTF-8
Java
false
false
3,010
java
/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package consulo.language.psi.resolve; import consulo.logging.Logger; import consulo.application.progress.ProgressIndicatorProvider; import consulo.language.psi.PsiElement; import consulo.language.psi.PsiInvalidElementAccessException; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; /** * Some base methods for scopes */ public class PsiScopesUtilCore { public static final Logger LOGGER = Logger.getInstance(PsiScopesUtilCore.class); public static boolean treeWalkUp(@Nonnull PsiScopeProcessor processor, @Nonnull PsiElement entrance, @Nullable PsiElement maxScope) { return treeWalkUp(processor, entrance, maxScope, ResolveState.initial()); } public static boolean treeWalkUp(@Nonnull final PsiScopeProcessor processor, @Nonnull final PsiElement entrance, @Nullable final PsiElement maxScope, @Nonnull final ResolveState state) { if (!entrance.isValid()) { LOGGER.error(new PsiInvalidElementAccessException(entrance)); } PsiElement prevParent = entrance; PsiElement scope = entrance; while (scope != null) { ProgressIndicatorProvider.checkCanceled(); if (!scope.processDeclarations(processor, state, prevParent, entrance)) { return false; // resolved } if (scope == maxScope) break; prevParent = scope; scope = prevParent.getContext(); if (scope != null && scope != prevParent.getParent() && !scope.isValid()) { break; } } return true; } public static boolean walkChildrenScopes(@Nonnull PsiElement thisElement, @Nonnull PsiScopeProcessor processor, @Nonnull ResolveState state, PsiElement lastParent, PsiElement place) { PsiElement child = null; if (lastParent != null && lastParent.getParent() == thisElement) { child = lastParent.getPrevSibling(); if (child == null) return true; // first element } if (child == null) { child = thisElement.getLastChild(); } while (child != null) { if (!child.processDeclarations(processor, state, null, place)) return false; child = child.getPrevSibling(); } return true; } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
0468d0db6fb4e056dba4b0ca33f997c809c3e80a
34e55a7531813c219c191f084196ebfe0d3d0b4c
/level15/lesson02/task05/Solution.java
ae903a2a89710007d6b3ccbff658872867a5b203
[]
no_license
bezobid/javarush
c5b8f09e78bc7020c00810ea4a82267ea30dab9f
20a8b7e90a14a406b4fa02fc1b75707297d06428
refs/heads/master
2021-01-21T06:53:33.411811
2017-05-17T15:16:28
2017-05-17T15:16:28
91,590,091
0
0
null
null
null
null
UTF-8
Java
false
false
2,643
java
package com.javarush.test.level15.lesson02.task05; import java.util.ArrayList; import java.util.List; /* ООП - исправь ошибки в наследовании Исправь метод containsBones и всю связанную с ним логику так, чтобы: 1. Поведение программы осталось прежним, т.е. она должна выдавать то же самое, что и выдает сейчас 2. Метод containsBones должен возвращать тип Object и значение "Yes" вместо true, "No" вместо false */ public class Solution { public static interface Alive { Object containsBones(); } public static class BodyPart implements Alive { private String name; public BodyPart(String name) { this.name = name; } public Object containsBones() { return "Yes"; } public String toString() { return containsBones().equals("Yes") ? name + " содержит кости" : name + " не содержит кости"; } } public static class Finger extends BodyPart { private boolean isFoot; public Finger(String name, boolean isFoot) { super(name); this.isFoot = isFoot; } public Object containsBones() { Object obj; if (super.containsBones().equals("Yes") && !isFoot) obj = "Yes"; else obj = "No"; return obj; } } public static void main(String[] args) { printlnFingers(); printlnBodyParts(); printlnAlives(); } private static void printlnAlives() { System.out.println(new BodyPart("Рука").containsBones()); } private static void printlnBodyParts() { List<BodyPart> bodyParts = new ArrayList<BodyPart>(5); bodyParts.add(new BodyPart("Рука")); bodyParts.add(new BodyPart("Нога")); bodyParts.add(new BodyPart("Голова")); bodyParts.add(new BodyPart("Тело")); System.out.println(bodyParts.toString()); } private static void printlnFingers() { List<Finger> fingers = new ArrayList<Finger>(5); fingers.add(new Finger("Большой", true)); fingers.add(new Finger("Указательный", true)); fingers.add(new Finger("Средний", true)); fingers.add(new Finger("Безымянный", false)); fingers.add(new Finger("Мизинец", true)); System.out.println(fingers.toString()); } }
[ "sugubo@gmail.com" ]
sugubo@gmail.com
4f2e4f5c3a26327dd0c061f4c472821574285251
90f17cd659cc96c8fff1d5cfd893cbbe18b1240f
/src/main/java/androidx/core/graphics/drawable/TintAwareDrawable.java
943475cb0a3461f47cc0be01c071c30363f4f1a0
[]
no_license
redpicasso/fluffy-octo-robot
c9b98d2e8745805edc8ddb92e8afc1788ceadd08
b2b62d7344da65af7e35068f40d6aae0cd0835a6
refs/heads/master
2022-11-15T14:43:37.515136
2020-07-01T22:19:16
2020-07-01T22:19:16
276,492,708
0
0
null
null
null
null
UTF-8
Java
false
false
468
java
package androidx.core.graphics.drawable; import android.content.res.ColorStateList; import android.graphics.PorterDuff.Mode; import androidx.annotation.ColorInt; import androidx.annotation.RestrictTo; import androidx.annotation.RestrictTo.Scope; @RestrictTo({Scope.LIBRARY_GROUP_PREFIX}) public interface TintAwareDrawable { void setTint(@ColorInt int i); void setTintList(ColorStateList colorStateList); void setTintMode(Mode mode); }
[ "aaron@goodreturn.org" ]
aaron@goodreturn.org
6856dd42bf1cf51acdc95aa1520618030e00a6ef
2b47dcd248f9ac66eaaee74bd969f17ede5c1383
/src/main/java/uk/ac/ebi/pride/validator/schema/MzIdentMLSchemaValidator.java
304ebfadfc6288ff0306242aa7e5b442f59527a1
[]
no_license
PRIDE-Archive/px-submission-validator
9c019e6be2e6555f65c3baa4a47e5c2b3cd2f784
446e4a2d9ec13dd9b0e05d65746002740f696eea
refs/heads/master
2021-06-10T00:26:51.279853
2017-01-25T16:08:34
2017-01-25T16:08:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
825
java
package uk.ac.ebi.pride.validator.schema; import uk.ac.ebi.pride.data.util.MassSpecFileFormat; import java.io.File; import java.io.IOException; import java.net.URI; /** * Xml schema validator for mzIdentML * * @author Rui Wang * @version $Id$ */ public class MzIdentMLSchemaValidator extends GenericXmlSchemaValidator{ public MzIdentMLSchemaValidator(URI schemaLocation) { super(schemaLocation); } @Override public boolean support(File input) { try { MassSpecFileFormat fileFormat = MassSpecFileFormat.checkFormat(input); return fileFormat != null && fileFormat.equals(MassSpecFileFormat.MZIDENTML); } catch (IOException e) { throw new IllegalStateException("Failed to check file format: " + input.getAbsolutePath(), e); } } }
[ "harry.r.wang@gmail.com" ]
harry.r.wang@gmail.com
546bcd059995577bf46d9e934ec22c1dbd4ed965
13271d246c158f642681a1a5195235b27756687a
/business/src/main/java/com/kevinguanchedarias/owgejava/dto/user/SimpleUserDataWithSuspicionsCountsDto.java
5baf2db50916a7d10dd284cc124bb6d98c7da93c
[]
no_license
KevinGuancheDarias/owge
7024249c48e39f2b332ea3fa78cf273252f2ba96
d2e65dd75b642945d43e1538373462589a29b759
refs/heads/master
2023-09-01T22:41:17.327197
2023-08-22T22:41:08
2023-08-23T11:04:00
178,665,214
4
3
null
2023-06-20T23:16:29
2019-03-31T09:04:57
Java
UTF-8
Java
false
false
154
java
package com.kevinguanchedarias.owgejava.dto.user; public record SimpleUserDataWithSuspicionsCountsDto(SimpleUserDataDto user, Long suspicionsCount) { }
[ "kevin@kevinguanchedarias.com" ]
kevin@kevinguanchedarias.com
455663d1aef6c264358e5a92d894ebba2d3a7055
fe1f2c68a0540195b227ebee1621819766ac073b
/OVO_jdgui/myobfuscated/qt.java
b74648c831be8074f4a1cd2fadd4ff798660c9ba
[]
no_license
Sulley01/KPI_4
41d1fd816a3c0b2ab42cff54a4d83c1d536e19d3
04ed45324f255746869510f0b201120bbe4785e3
refs/heads/master
2020-03-09T05:03:37.279585
2018-04-18T16:52:10
2018-04-18T16:52:10
128,602,787
2
1
null
null
null
null
UTF-8
Java
false
false
301
java
package myobfuscated; public abstract interface qt<Z> { public abstract Z a(); public abstract int b(); public abstract void c(); } /* Location: C:\dex2jar-2.0\classes-dex2jar.jar!\myobfuscated\qt.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "sullivan.alvin@ymail.com" ]
sullivan.alvin@ymail.com
78bd9c43dbe813d6160356b1567fbbf4bfc0a991
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/orientechnologies--orientdb/a49475a2081ad3ad43129ffd170d41b1c92fbb46/after/OReleaseDatabaseResponse.java
ced9cb9f5640c665d737cb4ea64d6b24f1e0a18a
[]
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
707
java
package com.orientechnologies.orient.client.remote.message; import java.io.IOException; import com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient; import com.orientechnologies.orient.client.remote.OBinaryResponse; import com.orientechnologies.orient.client.remote.OStorageRemoteSession; import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary; public class OReleaseDatabaseResponse implements OBinaryResponse { @Override public void write(OChannelBinary channel, int protocolVersion, String recordSerializer) throws IOException { } @Override public void read(OChannelBinaryAsynchClient network, OStorageRemoteSession session) throws IOException { } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
1b1eba1cadfee0005c120bd15f97b3082c70a21f
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_267/Productionnull_26613.java
12593f40dce020988935a6fab75318651bf075c7
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_267; public class Productionnull_26613 { private final String property; public Productionnull_26613(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
ec91aef99f71037b35d844f89e0ebe9f13ceb008
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithLambdas/applicationModule/src/main/java/applicationModulepackageJava7/Foo775.java
715f83c5397a879b05c7b180234382e0eddfa053
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
575
java
package applicationModulepackageJava7; public class Foo775 { public void foo0() { final Runnable anything0 = () -> System.out.println("anything"); new applicationModulepackageJava7.Foo774().foo9(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } public void foo9() { foo8(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
3da3dca678324435a6a3118ddb66389d5de4d749
4bdf74d8dbb210d29db0fdf1ae97aad08929612c
/data_test/84423/Transaction.java
ac3b7bc4cfdac91d13b6f41e4f9125f4cd1938f2
[]
no_license
huyenhuyen1204/APR_data
cba03642f68ce543690a75bcefaf2e0682df5e7e
cb9b78b9e973202e9945d90e81d1bfaef0f9255c
refs/heads/master
2023-05-13T21:52:20.294382
2021-06-02T17:52:30
2021-06-02T17:52:30
373,250,240
0
0
null
null
null
null
UTF-8
Java
false
false
884
java
public class Transaction { private String operation; private double amount; private double balance; public static final String DEPOSIT = "deposit"; public static final String WITHDRAW = "withdraw"; public Transaction() { } public Transaction(String operation, double amount, double balance) { this.operation = operation; this.amount = amount; this.balance = balance; } public String getOperation() { return operation; } public void setOperation(String operation) { this.operation = operation; } public double getAmount() { return amount; } public void setAmount(double amount) { this.amount = amount; } public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } }
[ "nguyenhuyen98pm@gmail.com" ]
nguyenhuyen98pm@gmail.com
88ebc90b2a20a0306e34f17865017ea88fa574ab
da8263da02dda9a718d733cddb435ec19887374f
/modules/citrus-java-dsl/src/test/java/com/consol/citrus/dsl/runner/InputTestRunnerTest.java
94e47cd42c91ab56514552c458b9fb2de8254b15
[ "Apache-2.0" ]
permissive
TimeInvestor/citrus
c45ae9f8eb9315489957227bb3e1288648a90e24
5604dabba96ec0ca5fca0d9e415ae9c8ab89ba39
refs/heads/master
2020-05-29T11:05:35.221557
2016-05-12T16:23:24
2016-05-12T16:23:24
58,848,173
1
0
null
2016-05-15T06:50:36
2016-05-15T06:50:36
null
UTF-8
Java
false
false
2,236
java
/* * Copyright 2006-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 * * 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.consol.citrus.dsl.runner; import com.consol.citrus.TestCase; import com.consol.citrus.actions.InputAction; import com.consol.citrus.dsl.builder.BuilderSupport; import com.consol.citrus.dsl.builder.InputActionBuilder; import com.consol.citrus.testng.AbstractTestNGUnitTest; import org.testng.Assert; import org.testng.annotations.Test; public class InputTestRunnerTest extends AbstractTestNGUnitTest { @Test public void TestInputBuilder() { MockTestRunner builder = new MockTestRunner(getClass().getSimpleName(), applicationContext, context) { @Override public void execute() { variable("answer", "yes"); input(new BuilderSupport<InputActionBuilder>() { @Override public void configure(InputActionBuilder builder) { builder.message("Want to test me?") .result("answer") .answers("yes", "no", "maybe"); } }); } }; TestCase test = builder.getTestCase(); Assert.assertEquals(test.getActionCount(), 1); Assert.assertEquals(test.getActions().get(0).getClass(), InputAction.class); InputAction action = (InputAction)test.getActions().get(0); Assert.assertEquals(action.getName(), "input"); Assert.assertEquals(action.getMessage(), "Want to test me?"); Assert.assertEquals(action.getValidAnswers(), "yes/no/maybe"); Assert.assertEquals(action.getVariable(), "answer"); } }
[ "deppisch@consol.de" ]
deppisch@consol.de
b5b204c0b7d5fc2ecbbf41c589dac329cd8671f0
dcc171ae042320d08801e667e3f7ad7c38ba118e
/TSOTesting/runBool/Tests/test559/main/Main.java
5a7493648c8c41423f3602121b103f1057e64cf4
[ "MIT" ]
permissive
Colosu/TSO-for-Testing
2958f55498c1407dc97d5c0e368ef524c5ded9df
06e03b6926b058e5440f7de2ee49e5343efcef45
refs/heads/main
2023-03-31T01:02:40.486566
2021-04-09T10:34:49
2021-04-09T10:34:49
356,229,436
0
0
null
null
null
null
UTF-8
Java
false
false
3,937
java
// This is a mutant program. // Author : ysma package main; import java.util.Enumeration; import javax.swing.tree.DefaultMutableTreeNode; public class Main { public static void main( java.lang.String[] args ) { javax.swing.tree.DefaultMutableTreeNode tree = new javax.swing.tree.DefaultMutableTreeNode( "S" ); javax.swing.tree.DefaultMutableTreeNode pos = tree; java.lang.String t = args[0]; java.lang.String[] nodes = t.split( "[|]" ); java.lang.String node = ""; int len = 3; int oldLen = 3; int length = nodes.length; for (int i = 0; i < length; i++) { node = nodes[i]; if (node.length() > 2) { len = node.length(); if (len < oldLen) { for (int j = 0; j < oldLen - len; j++) { pos = (javax.swing.tree.DefaultMutableTreeNode) pos.getParent(); } } else { if (len > oldLen) { pos = (javax.swing.tree.DefaultMutableTreeNode) pos.getLastChild(); } } pos.add( new javax.swing.tree.DefaultMutableTreeNode( node ) ); oldLen = len; } } System.out.println( isEven( tree, length ).toString() ); } public static java.lang.Boolean isEven( javax.swing.tree.DefaultMutableTreeNode tree, int len ) { java.lang.Integer[][] list = new java.lang.Integer[len][2]; int pos = -1; int depth = 0; java.util.Enumeration<DefaultMutableTreeNode> nodes = tree.breadthFirstEnumeration(); for (int i = 0; i < len; i++) { javax.swing.tree.DefaultMutableTreeNode node = nodes.nextElement(); if (node.getLevel() != depth) { pos = 0; depth = node.getLevel(); } else { pos++; } java.lang.Integer[] inte = new java.lang.Integer[2]; inte[0] = node.getLevel(); inte[1] = pos; list[i] = inte; } sort( list, 0, len - 1 ); pos = 0; int sum = 0; int count = 0; double total = 0.0; for (int i = 0; i < len++; i++) { java.lang.Integer[] e = list[i]; if (pos == e[1]) { sum += e[0]; count++; } else { total += (double) sum / count; sum = e[0]; count = 1; pos = e[1]; } } total += (double) sum / count; if ((int) total % 2 == 0) { return true; } else { return false; } } private static void merge( java.lang.Integer[][] arr, int l, int m, int r ) { int n1 = m - l + 1; int n2 = r - m; java.lang.Integer[][] L = new java.lang.Integer[n1][2]; java.lang.Integer[][] R = new java.lang.Integer[n2][2]; for (int i = 0; i < n1; ++i) { L[i] = arr[l + i]; } for (int j = 0; j < n2; ++j) { R[j] = arr[m + 1 + j]; } int i = 0; int j = 0; int k = l; while (i < n1 && j < n2) { if (L[i][1] <= R[j][1]) { arr[k] = L[i]; i++; } else { arr[k] = R[j]; j++; } k++; } while (i < n1) { arr[k] = L[i]; i++; k++; } while (j < n2) { arr[k] = R[j]; j++; k++; } } private static void sort( java.lang.Integer[][] arr, int l, int r ) { if (l < r) { int m = (l + r) / 2; sort( arr, l, m ); sort( arr, m + 1, r ); merge( arr, l, m, r ); } } }
[ "alfredocolosu@gmail.com" ]
alfredocolosu@gmail.com
49eb6620236f5acc42af33f49c294814e181ffd7
3bc62f2a6d32df436e99507fa315938bc16652b1
/tapestry/src/main/java/com/intellij/tapestry/core/model/presentation/components/ParameterComponent.java
7b5c442acf2299c0064164ebf8f58e0489728022
[ "Apache-2.0" ]
permissive
JetBrains/intellij-obsolete-plugins
7abf3f10603e7fe42b9982b49171de839870e535
3e388a1f9ae5195dc538df0d3008841c61f11aef
refs/heads/master
2023-09-04T05:22:46.470136
2023-06-11T16:42:37
2023-06-11T16:42:37
184,035,533
19
29
Apache-2.0
2023-07-30T14:23:05
2019-04-29T08:54:54
Java
UTF-8
Java
false
false
1,851
java
package com.intellij.tapestry.core.model.presentation.components; import com.intellij.tapestry.core.TapestryProject; import com.intellij.tapestry.core.exceptions.NotTapestryElementException; import com.intellij.tapestry.core.java.IJavaClassType; import com.intellij.tapestry.core.model.presentation.TapestryComponent; import com.intellij.tapestry.core.model.presentation.TapestryParameter; import org.jetbrains.annotations.NotNull; import java.util.HashMap; import java.util.Map; /** * The built-in Parameter element. */ public final class ParameterComponent extends TapestryComponent { private final Map<String, TapestryParameter> myParameters = new HashMap<>(); private ParameterComponent(IJavaClassType componentClass, TapestryProject project) throws NotTapestryElementException { super(componentClass, project); myParameters.put("id", new DummyTapestryParameter(project, "name", true)); } /** * Returns an instance of the Parameter component. * * @param tapestryProject the current Tapestry project. * @return an instance of the Parameter component. */ public synchronized static ParameterComponent getInstance(TapestryProject tapestryProject) { final IJavaClassType classType = tapestryProject.getJavaTypeFinder().findType("org.apache.tapestry5.internal.parser.ParameterToken", true); return classType == null ? null : new ParameterComponent(classType, tapestryProject); } /** * {@inheritDoc} */ @Override public String getName() { return "parameter"; } /** * {@inheritDoc} */ @Override @NotNull public Map<String, TapestryParameter> getParameters() { return myParameters; } /** * {@inheritDoc} */ @Override protected String getElementNameFromClass(String rootPackage) throws NotTapestryElementException { return getName(); } }
[ "yuriy.artamonov@jetbrains.com" ]
yuriy.artamonov@jetbrains.com
6e2fca6383b00a1a6417c6e45c0e43adf9687421
b4b161c350ad7381e8d262312098fae81a08ace4
/ch-server-base/src/main/java/com/zifangdt/ch/base/dto/customer/SalesClue.java
0be7cedc52619f55e687243182d993c663e74cd1
[]
no_license
snailhu/CRM
53cfec167ddd4040487bdbb6e5b73554c80865a1
e481fed1be654959b8ab053bd34ef79bbd2a79f9
refs/heads/master
2020-03-09T22:59:03.040725
2018-04-11T07:06:53
2018-04-11T07:07:01
129,047,954
0
0
null
null
null
null
UTF-8
Java
false
false
3,331
java
package com.zifangdt.ch.base.dto.customer; import com.zifangdt.ch.base.converter.NamedProperty; import com.zifangdt.ch.base.dto.AuditEntity; import com.zifangdt.ch.base.enums.pair.SalesClueStatus; import com.zifangdt.ch.base.validation.MobileNumber; import org.hibernate.validator.constraints.NotBlank; import javax.persistence.Table; import javax.persistence.Transient; import javax.validation.constraints.NotNull; import java.util.List; /** * Created by 袁兵 on 2017/12/5. */ @Table(name = "biz_sales_clue") public class SalesClue extends AuditEntity<Long> { @NotBlank private String name; private String source; @NotNull private Long organId; @NotBlank private String contactName; @NotBlank @MobileNumber private String contactPhone; private String contactAddress; private String contactHouseNumber; private String contactRemark; private String contactTag; @NamedProperty private SalesClueStatus status; @Transient private List<SalesClueNews> news; @Transient private String organName; @Transient private List<SalesClueFollowUp> followUps; public List<SalesClueFollowUp> getFollowUps() { return followUps; } public void setFollowUps(List<SalesClueFollowUp> followUps) { this.followUps = followUps; } public String getOrganName() { return organName; } public void setOrganName(String organName) { this.organName = organName; } public List<SalesClueNews> getNews() { return news; } public void setNews(List<SalesClueNews> news) { this.news = news; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSource() { return source; } public void setSource(String source) { this.source = source; } public Long getOrganId() { return organId; } public void setOrganId(Long organId) { this.organId = organId; } public String getContactName() { return contactName; } public void setContactName(String contactName) { this.contactName = contactName; } public String getContactPhone() { return contactPhone; } public void setContactPhone(String contactPhone) { this.contactPhone = contactPhone; } public String getContactAddress() { return contactAddress; } public void setContactAddress(String contactAddress) { this.contactAddress = contactAddress; } public String getContactHouseNumber() { return contactHouseNumber; } public void setContactHouseNumber(String contactHouseNumber) { this.contactHouseNumber = contactHouseNumber; } public String getContactRemark() { return contactRemark; } public void setContactRemark(String contactRemark) { this.contactRemark = contactRemark; } public String getContactTag() { return contactTag; } public void setContactTag(String contactTag) { this.contactTag = contactTag; } public SalesClueStatus getStatus() { return status; } public void setStatus(SalesClueStatus status) { this.status = status; } }
[ "snailhu@yahoo.com" ]
snailhu@yahoo.com
8580e90df602d1f85b433aac425dec25514bf282
23ea76f4ad6901866de73866e625c38bc1cb1139
/backend-core/src/test/java/arollavengers/core/usecase/WorldServiceUsecaseAllEventStoreTest.java
4acd949afeec0185330c0edbb83b9fa9beb8f839
[]
no_license
arollavengers/backend-java
da3c90fa17ca982fed991d755dabffe623c810b9
b7bcbc45bb0706b27d159e417b0033bcf04df9ed
refs/heads/master
2020-05-31T19:30:31.377911
2012-10-09T20:03:43
2012-10-09T20:03:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
package arollavengers.core.usecase; import arollavengers.core.testutils.TypeOfEventStore; import arollavengers.core.util.Objects; import arollavengers.junit.LabeledParameterized; import com.google.common.collect.Lists; import org.junit.Ignore; import org.junit.runner.RunWith; import java.util.List; /** * @author <a href="http://twitter.com/aloyer">@aloyer</a> */ @SuppressWarnings("ConstantConditions") @RunWith(LabeledParameterized.class) public class WorldServiceUsecaseAllEventStoreTest extends WorldServiceUsecaseTest { /** * Test will be executed on all different event store implementations. * * @see arollavengers.core.testutils.TypeOfEventStore */ @LabeledParameterized.Parameters public static List<Object[]> parameters() { List<Object[]> modes = Lists.newArrayList(); for (TypeOfEventStore typeOfEventStore : TypeOfEventStore.values()) { modes.add(Objects.o(typeOfEventStore)); } return modes; } public WorldServiceUsecaseAllEventStoreTest(TypeOfEventStore typeOfEventStore) { super(typeOfEventStore); } }
[ "arnauld.loyer@gmail.com" ]
arnauld.loyer@gmail.com
a8ceae3a9ae2731f39bdc38dcb43e34623354ed8
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Hibernate/Hibernate5709.java
01f5ce52fdf3f5daaf7bbbaac8405aa8f99ec873
[]
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
1,153
java
@Before public void setUp() throws Exception { TransactionUtil.doInJPA( this::entityManagerFactory, entityManager -> { projects = new Projects(); projects.addPreviousProject( new Project( "First" ) ); projects.addPreviousProject( new Project( "Second" ) ); projects.setCurrentProject( new Project( "Third" ) ); ContactDetail contactDetail = new ContactDetail(); contactDetail.setEmail( "abc@mail.org" ); contactDetail.addPhone( new Phone( "+4411111111" ) ); final Manager manager = new Manager(); manager.setProjects( projects ); manager.setContactDetail( contactDetail ); entityManager.persist( manager ); final Leader leader = new Leader(); leader.setInformation( new Information() ); ContactDetail infoContactDetail = new ContactDetail(); infoContactDetail.setEmail( "xyz@mail.org" ); infoContactDetail.addPhone( new Phone( "999-999-9999" ) ); leader.getInformation().setInfoContactDetail( infoContactDetail ); entityManager.persist( leader ); } ); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
9e4e7922abec7996159894dbaa92e3418aa5e085
865fbf3f638ecbb8767f767d70b636968a8d94c2
/src/main/java/com/ssm/pojo/Role.java
0368186e8fd134f50cd9fe8994c7977171eb577d
[]
no_license
Mrli6/smbms_ssm
de2c20048567d00ff5bda040e4aa3ee8d7198f60
e3bb5dcd4095d2ed9c73558bc9692de19d5b6925
refs/heads/master
2023-08-28T22:31:45.169277
2021-10-08T11:25:17
2021-10-08T11:25:17
411,894,101
0
0
null
null
null
null
UTF-8
Java
false
false
1,231
java
package com.ssm.pojo; import java.util.Date; public class Role { private Integer id; private String roleCode; private String roleName; private Integer createdBy; private Date creationDate; private Integer modifyBy; private Date modifyDate; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getRoleCode() { return roleCode; } public void setRoleCode(String roleCode) { this.roleCode = roleCode; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public Integer getCreatedBy() { return createdBy; } public void setCreatedBy(Integer createdBy) { this.createdBy = createdBy; } public Date getCreationDate() { return creationDate; } public void setCreationDate(Date creationDate) { this.creationDate = creationDate; } public Integer getModifyBy() { return modifyBy; } public void setModifyBy(Integer modifyBy) { this.modifyBy = modifyBy; } public Date getModifyDate() { return modifyDate; } public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; } }
[ "12345@qq.com" ]
12345@qq.com
6c30164844abd93891a3ea3daa7b1f1def991091
563e8db7dba0131fb362d8fb77a852cae8ff4485
/Blagosfera/core/src/main/java/ru/radom/kabinet/json/AbstractCollectionSerializer.java
6e02f7481a5f3a9386347a65a31d2239f1d7ab2c
[]
no_license
askor2005/blagosfera
13bd28dcaab70f6c7d6623f8408384bdf337fd21
c6cf8f1f7094ac7ccae3220ad6518343515231d0
refs/heads/master
2021-01-17T18:05:08.934188
2016-10-14T16:53:38
2016-10-14T16:53:48
70,894,701
0
0
null
null
null
null
UTF-8
Java
false
false
1,067
java
package ru.radom.kabinet.json; import org.json.JSONArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.Collection; @Transactional abstract public class AbstractCollectionSerializer<T> { private static final Logger logger = LoggerFactory.getLogger(AbstractCollectionSerializer.class); @Autowired protected SerializationManager serializationManager; public JSONArray serialize(Collection<T> collection) { assert (collection != null); assert (collection.size() > 0); long start = System.currentTimeMillis(); JSONArray jsonArray = serializeInternal(collection); long stop = System.currentTimeMillis(); long time = (stop - start); // logger.info("collection of " + collection.size() + " " + collection.toArray()[0].getClass().getSimpleName() + " serialized in " + time + " milliseconds"); return jsonArray; } abstract public JSONArray serializeInternal(Collection<T> collection); }
[ "askor2005@yandex.ru" ]
askor2005@yandex.ru
aa7d185a2276467e8bc19649c8892ef3f90472c8
b8ec24f7e311345306475fc45fa5d73748bd48b9
/Session3/src/Arrays.java
e132e12fca111db31f2e311a7eff8cf46bdb9301
[]
no_license
ishantk/GW2018A
d245076909fdc9cde0795632b705c5bf64e4e003
deb5b26e2eb3a733ea0a6ff718f8e5c185a0364d
refs/heads/master
2020-03-19T07:38:51.882043
2018-06-28T07:07:08
2018-06-28T07:07:08
136,135,436
6
4
null
null
null
null
UTF-8
Java
false
false
1,213
java
public class Arrays { public static void main(String[] args) { int bjpPunjab = 120; int congPunjab = 124; bjpPunjab = 130; int bjpUp = 345; int congUp = 134; // //.... // Arrays // Are Collection of Single Value Containers // Homogeneous in Nature (Type must be same) // Implicit Way -> int[] bjp = new int[]{120,345,567,120,5673,12356,178,543,755}; int[] bjp = {120,345,567,120,5673,12356,178,543,755}; // Explicit Way int[] cong = new int[]{345,321,444,120,567,12356,178,133,789}; System.out.println("bjpPunjab is: "+bjpPunjab); System.out.println("congPunjab is: "+congPunjab); // bjp or cong are reference variables System.out.println("bjp is: "+bjp); System.out.println("cong is: "+cong); //int i = 0; //int[] arr = null; // Read from Array System.out.println(bjp[0]); // Write/Update in Array bjp[0] = 130; System.out.println(bjp[0]); System.out.println("bjp size: "+bjp.length); // Read All int bjpCount = 0; for(int i=0;i<bjp.length;i++){ System.out.print(bjp[i]+" "); bjpCount = bjpCount + bjp[i]; } System.out.println(); System.out.println("bjp vote count is: "+bjpCount); } }
[ "er.ishant@gmail.com" ]
er.ishant@gmail.com
e937025fbbdbc35d37dcef969b63607160d7667c
0a2924f4ae6dafaa6aa28e2b947a807645494250
/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/ValidateAddUpdateSqlViewAction.java
abd632999611c39187073399163b5b4e6cd15bd8
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
filoi/ImmunizationRepository
9483ee02afd0b46d0f321a1e1ff8a0f6d8ca7f71
efb9f2bb9ae3da8c6ac60e5d5661b8a79a6939d5
refs/heads/master
2023-03-16T03:26:34.564453
2023-03-06T08:32:07
2023-03-06T08:32:07
126,012,725
0
0
BSD-3-Clause
2022-12-16T05:59:21
2018-03-20T12:17:24
Java
UTF-8
Java
false
false
4,893
java
package org.hisp.dhis.dataadmin.action.sqlview; /* * Copyright (c) 2004-2015, 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. */ import org.hisp.dhis.common.IllegalQueryException; import org.hisp.dhis.i18n.I18n; import org.hisp.dhis.sqlview.SqlView; import org.hisp.dhis.sqlview.SqlViewService; import org.hisp.dhis.sqlview.SqlViewType; import com.opensymphony.xwork2.Action; /** * @author Dang Duy Hieu */ public class ValidateAddUpdateSqlViewAction implements Action { private static final String ADD = "add"; // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private SqlViewService sqlViewService; public void setSqlViewService( SqlViewService sqlViewService ) { this.sqlViewService = sqlViewService; } // ------------------------------------------------------------------------- // I18n // ------------------------------------------------------------------------- private I18n i18n; public void setI18n( I18n i18n ) { this.i18n = i18n; } // ------------------------------------------------------------------------- // Input // ------------------------------------------------------------------------- private String mode; public void setMode( String mode ) { this.mode = mode; } private String name; public void setName( String name ) { this.name = name; } private String sqlquery; public void setSqlquery( String sqlquery ) { this.sqlquery = sqlquery; } private boolean query; public void setQuery( boolean query ) { this.query = query; } // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- private String message; public String getMessage() { return message; } // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @Override public String execute() { message = null; if ( name == null || name.trim().isEmpty() ) { message = i18n.getString( "name_is_null" ); return INPUT; } if ( mode.equals( ADD ) && sqlViewService.getSqlView( name ) != null ) { message = i18n.getString( "name_in_use" ); return INPUT; } if ( sqlquery == null || sqlquery.trim().isEmpty() ) { message = i18n.getString( "sqlquery_is_empty" ); return INPUT; } try { SqlView sqlView = new SqlView( name, sqlquery, SqlViewType.VIEW ); // Avoid variable check sqlViewService.validateSqlView( sqlView, null, null ); } catch ( IllegalQueryException ex ) { message = ex.getMessage(); return INPUT; } if ( !query ) { message = sqlViewService.testSqlGrammar( sqlquery ); } if ( message != null ) { return INPUT; } return SUCCESS; } }
[ "neeraj@filoi.in" ]
neeraj@filoi.in
f0925460127faf32946fc238f2a13bb2e10552f2
80873a74a3a7c1a07a2b619930e4e708388fb048
/src/jp/mosp/time/dto/settings/impl/TmmScheduleDto.java
3839955b5d19e6a9ca85a0a01a9fcf971ed0f805
[]
no_license
ekyan/ccmosp
7fb6272e2f53923b19e46b17a29d4b32a23b1319
924a257e3ecb81707e03dfc81becbf380dd52be3
refs/heads/master
2020-04-11T09:31:35.991354
2018-12-13T20:48:38
2018-12-13T20:48:38
161,681,437
1
0
null
null
null
null
UTF-8
Java
false
false
3,563
java
/* * MosP - Mind Open Source Project http://www.mosp.jp/ * Copyright (C) MIND Co., Ltd. http://www.e-mind.co.jp/ * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package jp.mosp.time.dto.settings.impl; import java.util.Date; import jp.mosp.framework.base.BaseDto; import jp.mosp.time.dto.settings.ScheduleDtoInterface; /** * カレンダマスタDTO */ public class TmmScheduleDto extends BaseDto implements ScheduleDtoInterface { private static final long serialVersionUID = 7769672532513580136L; /** * レコード識別ID。 */ private long tmmScheduleId; /** * カレンダコード。 */ private String scheduleCode; /** * 有効日。 */ private Date activateDate; /** * カレンダ名称。 */ private String scheduleName; /** * カレンダ略称。 */ private String scheduleAbbr; /** * 年度。 */ private int fiscalYear; /** * パターンコード。 */ private String patternCode; /** * 勤務形態変更フラグ。 */ private int workTypeChangeFlag; /** * 無効フラグ。 */ private int inactivateFlag; @Override public long getTmmScheduleId() { return tmmScheduleId; } @Override public String getScheduleCode() { return scheduleCode; } @Override public String getScheduleName() { return scheduleName; } @Override public String getScheduleAbbr() { return scheduleAbbr; } @Override public int getFiscalYear() { return fiscalYear; } @Override public String getPatternCode() { return patternCode; } @Override public int getWorkTypeChangeFlag() { return workTypeChangeFlag; } @Override public void setTmmScheduleId(long tmmScheduleId) { this.tmmScheduleId = tmmScheduleId; } @Override public void setScheduleCode(String scheduleCode) { this.scheduleCode = scheduleCode; } @Override public void setScheduleName(String scheduleName) { this.scheduleName = scheduleName; } @Override public void setScheduleAbbr(String scheduleAbbr) { this.scheduleAbbr = scheduleAbbr; } @Override public void setFiscalYear(int fiscalYear) { this.fiscalYear = fiscalYear; } @Override public void setPatternCode(String patternCode) { this.patternCode = patternCode; } @Override public void setWorkTypeChangeFlag(int workTypeChangeFlag) { this.workTypeChangeFlag = workTypeChangeFlag; } @Override public Date getActivateDate() { return getDateClone(activateDate); } @Override public int getInactivateFlag() { return inactivateFlag; } @Override public void setActivateDate(Date activateDate) { this.activateDate = getDateClone(activateDate); } @Override public void setInactivateFlag(int inactivateFlag) { this.inactivateFlag = inactivateFlag; } }
[ "dr.sho.fantasista@gmail.com" ]
dr.sho.fantasista@gmail.com
e34d60e55c530d8c34388d4a30e614ba303c3b3d
58a8ed34f613c281a5faaaefe5da1788f5739d17
/Application_code_source/eMybaby/sources/com/google/android/material/transformation/FabTransformationScrimBehavior.java
3596bbca1bf3dfbd881e4c3523e1e6c950983861
[]
no_license
wagnerwave/Dossier_Hacking_de_peluche
01c78629e52a94ed6a208e11ff7fcd268e10956e
514f81b1e72d88e2b8835126b2151e368dcad7fb
refs/heads/main
2023-03-31T13:28:06.247243
2021-03-25T23:03:38
2021-03-25T23:03:38
351,597,654
5
1
null
null
null
null
UTF-8
Java
false
false
3,177
java
package com.google.android.material.transformation; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; import androidx.annotation.NonNull; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.animation.AnimatorSetCompat; import com.google.android.material.animation.MotionTiming; import com.google.android.material.floatingactionbutton.FloatingActionButton; import java.util.ArrayList; import java.util.List; @Deprecated public class FabTransformationScrimBehavior extends ExpandableTransformationBehavior { public static final long COLLAPSE_DELAY = 0; public static final long COLLAPSE_DURATION = 150; public static final long EXPAND_DELAY = 75; public static final long EXPAND_DURATION = 150; public final MotionTiming collapseTiming = new MotionTiming(0, 150); public final MotionTiming expandTiming = new MotionTiming(75, 150); public FabTransformationScrimBehavior() { } public FabTransformationScrimBehavior(Context context, AttributeSet attributeSet) { super(context, attributeSet); } private void createScrimAnimation(@NonNull View view, boolean z, boolean z2, @NonNull List<Animator> list, List<Animator.AnimatorListener> list2) { ObjectAnimator objectAnimator; MotionTiming motionTiming = z ? this.expandTiming : this.collapseTiming; if (z) { if (!z2) { view.setAlpha(0.0f); } objectAnimator = ObjectAnimator.ofFloat(view, View.ALPHA, new float[]{1.0f}); } else { objectAnimator = ObjectAnimator.ofFloat(view, View.ALPHA, new float[]{0.0f}); } motionTiming.apply(objectAnimator); list.add(objectAnimator); } public boolean layoutDependsOn(CoordinatorLayout coordinatorLayout, View view, View view2) { return view2 instanceof FloatingActionButton; } @NonNull public AnimatorSet onCreateExpandedStateChangeAnimation(@NonNull View view, @NonNull final View view2, final boolean z, boolean z2) { ArrayList arrayList = new ArrayList(); createScrimAnimation(view2, z, z2, arrayList, new ArrayList()); AnimatorSet animatorSet = new AnimatorSet(); AnimatorSetCompat.playTogether(animatorSet, arrayList); animatorSet.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animator) { if (!z) { view2.setVisibility(4); } } public void onAnimationStart(Animator animator) { if (z) { view2.setVisibility(0); } } }); return animatorSet; } public boolean onTouchEvent(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View view, @NonNull MotionEvent motionEvent) { return super.onTouchEvent(coordinatorLayout, view, motionEvent); } }
[ "alexandre1.wagner@epitech.eu" ]
alexandre1.wagner@epitech.eu
0593d822fdbba06189b4f74665cb63af38f456d1
6fd565465be7ce7db3a5ea213de035e36512d614
/spring-cloud/bplan-remote/bplan/src/main/java/com/splan/bplan/filter/SimpleCORSFilter.java
8fc8c03bd751bc0d4340b107ceaa433e500337d0
[]
no_license
sengeiou/wxm_git02
98df5496c52d018f6011da45a1226ff8ae42c42c
bfed478f35dd3505ef989b79dd2979cadd94e54f
refs/heads/master
2022-11-02T12:20:09.410370
2020-02-12T07:23:27
2020-02-12T07:23:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,285
java
//package com.splan.bplan.filter; // //import org.springframework.stereotype.Component; // //import javax.servlet.*; //import javax.servlet.http.HttpServletRequest; //import javax.servlet.http.HttpServletResponse; //import java.io.IOException; // //@Component //public class SimpleCORSFilter implements Filter { // // @Override // public void init(FilterConfig filterConfig) throws ServletException { // // } // // @Override // public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // try{ // HttpServletResponse resp = (HttpServletResponse) response; // HttpServletRequest req = (HttpServletRequest)request; // resp.setHeader("Access-Control-Allow-Origin", req.getHeader("Origin")); // resp.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT"); // resp.setHeader("Access-Control-Max-Age", "3600"); // resp.setHeader("Access-Control-Allow-Headers", "x-requested-with, content-type, authorization"); // resp.setHeader("Access-Control-Allow-Credentials", "true"); // chain.doFilter(request, resp);}catch(Exception e){System.err.println();} // } // // @Override // public void destroy() { // // } //}
[ "moore@cmtspace.com" ]
moore@cmtspace.com
8382ba5b9907db388eb20798bfc66af088601a7c
ddd32884a47eb643ae4acb09287139fe83243920
/app/src/main/java/com/hjy/wisdommedical/hx/single/CallEvent.java
5bedbd869ef5c2885b89706278f5d1ce4d16731d
[]
no_license
SetAdapter/WisdomMedical
408b31e67bce7c60f33d38f0796414d00e0c9468
60b96eced5c5713fb8f055a2b5b8d03d38b8f848
refs/heads/master
2020-04-23T13:48:19.275452
2019-02-18T03:45:14
2019-02-18T03:45:14
171,209,620
0
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
package com.hjy.wisdommedical.hx.single; import com.hyphenate.chat.EMCallStateChangeListener; /** * 通话相关事件传递对象 * Created by lzan13 on 2017/3/24. */ public class CallEvent { private boolean isState; private boolean isTime; private EMCallStateChangeListener.CallState callState; private EMCallStateChangeListener.CallError callError; public EMCallStateChangeListener.CallState getCallState() { return callState; } public void setCallState(EMCallStateChangeListener.CallState callState) { this.callState = callState; } public EMCallStateChangeListener.CallError getCallError() { return callError; } public void setCallError(EMCallStateChangeListener.CallError callError) { this.callError = callError; } public boolean isState() { return isState; } public void setState(boolean state) { isState = state; } public boolean isTime() { return isTime; } public void setTime(boolean time) { isTime = time; } }
[ "383411934@qq.com" ]
383411934@qq.com
ce89fd80d5acd4b1129b3bd5989faf89d7e3fd08
ce55752e7e58b1ad66f7ae552d8f6fab9e418ca7
/src/com/bvan/oop/lessons5_6/format/proc/ProcProducts.java
8aa4b78bd9801493c251b372a2711ebc7d636ab4
[]
no_license
bohdanvan/javaoop-group66
7b03521323d354a8c9a71318838921624fef9af8
b9c8cd534fbeab19ed2c7a95eef1c137c88371f3
refs/heads/master
2021-08-23T04:47:06.250385
2017-12-03T11:19:19
2017-12-03T11:19:19
107,813,432
0
0
null
null
null
null
UTF-8
Java
false
false
1,057
java
package com.bvan.oop.lessons5_6.format.proc; import com.bvan.oop.lessons5_6.format.Product; import java.util.ArrayList; import java.util.List; /** * @author bvanchuhov */ public class ProcProducts { private final List<Product> products = new ArrayList<>(); public void add(Product product) { products.add(product); } public void print(String formatType) { for (Product product : products) { String s = format(product, formatType); System.out.println(s); } } private String format(Product product, String formatType) { switch (formatType) { case "name": return product.getName(); case "csv": return product.getName() + "," + product.getPrice(); case "json": return "{\"name\": \"" + product.getName() + "\", \"price\": " + product.getPrice() + "}"; default: throw new IllegalArgumentException("no such format: " + formatType); } } }
[ "bodya.van@gmail.com" ]
bodya.van@gmail.com
15620edf59c82dd080a8b00ef8cef7ae0f074ccb
ded3f993b2af67abef1fa62cd09017e0cba74721
/MVC/Lab76/src/com/avishek/spring/WebApplicationInitializer.java
18bfff00d34ff8fc340f7147748c944201095b30
[]
no_license
imavishek/Spring-Framework-Examples
ab6216fdb6a2717fe19faeb581abb4976ad13126
5dfb315c472f713b67106f8b111d770bc03f632c
refs/heads/master
2021-07-13T01:10:32.555069
2017-10-10T03:56:01
2017-10-10T03:56:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
package com.avishek.spring; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; public class WebApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class<?>[] getRootConfigClasses() { return new Class[]{SpringConfig.class}; } @Override protected Class<?>[] getServletConfigClasses() { return new Class[]{SpringConfig.class}; } @Override protected String[] getServletMappings() { return new String[]{"*.abhi"}; } }
[ "avishek.akd@gmail.com" ]
avishek.akd@gmail.com
b143cb79a12bbc1c242157ba2d1616aab4f89c2e
4b5abde75a6daab68699a9de89945d8bf583e1d0
/app-release-unsigned/sources/c/b/a/d0/b.java
9a8a3ffd210740c9c1915c288b8aff8cb7b5880a
[]
no_license
agustrinaldokurniawan/News_Android_Kotlin_Mobile_Apps
95d270d4fa2a47f599204477cb25bae7bee6e030
a1f2e186970cef9043458563437b9c691725bcb5
refs/heads/main
2023-07-03T01:03:22.307300
2021-08-08T10:47:00
2021-08-08T10:47:00
375,330,796
0
0
null
null
null
null
UTF-8
Java
false
false
356
java
package c.b.a.d0; import java.net.HttpURLConnection; import java.net.URL; public class b { public a a(String str) { HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(str).openConnection(); httpURLConnection.setRequestMethod("GET"); httpURLConnection.connect(); return new a(httpURLConnection); } }
[ "agust.kurniawan@Agust-Rinaldo-Kurniawan.local" ]
agust.kurniawan@Agust-Rinaldo-Kurniawan.local
4cc62f339985ab3cd992bfe8732be5ff53255f67
3c73008e21c90d1de8d8fa5508460418e69474e1
/src/main/java/io/r2dbc/postgresql/message/backend/EmptyQueryResponse.java
753578df56f814c52091dd1fd68ca1b5fb38b754
[ "Apache-2.0" ]
permissive
rdegnan/r2dbc-postgresql
3b41fcba19e077a21634b30713d160763477f113
068b6d59b31f5ad0940e836af9de25cc3b6d2fc3
refs/heads/master
2020-04-06T20:37:32.803816
2019-01-07T21:04:12
2019-01-07T21:04:12
157,777,709
0
0
null
2018-11-15T21:56:08
2018-11-15T21:56:08
null
UTF-8
Java
false
false
1,073
java
/* * Copyright 2017-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.r2dbc.postgresql.message.backend; /** * The EmptyQueryResponse message. */ public final class EmptyQueryResponse implements BackendMessage { /** * A static singleton instance that should always be used. */ public static final EmptyQueryResponse INSTANCE = new EmptyQueryResponse(); private EmptyQueryResponse() { } @Override public String toString() { return "EmptyQueryResponse{}"; } }
[ "bhale@pivotal.io" ]
bhale@pivotal.io
f70f1745dbb34b72325cdb9a9ca2e3ee32bdd66e
e37de6db1d0f1ca70f48ffc5eafc6e43744bc980
/mondrian/mondrian-model/src/main/java/com/tonbeller/wcf/scroller/Scroller.java
eea6f1e5b1a28450a0d0628549577bd9442a1948
[]
no_license
cnopens/BA
8490e6e83210343a35bb1e5a6769209a16557e3f
ba58acf949af1249cc637ccf50702bb28462d8ad
refs/heads/master
2021-01-20T16:38:38.479034
2014-11-13T00:44:00
2014-11-13T00:44:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,835
java
package com.tonbeller.wcf.scroller; import java.io.IOException; import javax.servlet.jsp.JspWriter; import com.tonbeller.wcf.controller.RequestContext; /** * Generates hidden input fields that are required to keep scrolling position. * Provides static methods to enable scrolling. */ public class Scroller { private static String SCROLLER_KEY = Scroller.class.getName(); public static final String FORCE_SCROLLER = "forcescroller"; public void handleRequest(RequestContext context, JspWriter out) throws IOException { // Aktuelle Scrollkoordinaten als versteckte Formparameter setzen writeCoordParam(context, out, "wcfXCoord"); writeCoordParam(context, out, "wcfYCoord"); } private void writeCoordParam(RequestContext context, JspWriter out, String coordName) throws IOException { String coordVal = "0"; if(isScrollerEnabled(context)) { String val = context.getParameter(coordName); if (val != null) coordVal = val; } out.print("<input type=\"hidden\" name=\""+coordName+"\" value=\""+coordVal+"\"/>"); } /** * enables/disables scrolling for this request. Typically a request handler should * decide whether the current position should be kept or not. A tree node * expansion handler would want to keep the position a dialog close button * handler not. * <p> * By default scrolling is disabled */ public static void enableScroller(RequestContext context) { if(isScrollerEnabled(context)) return; context.getRequest().setAttribute(SCROLLER_KEY, "true"); } public static boolean isScrollerEnabled(RequestContext context) { // set by url? if(context.getParameter(FORCE_SCROLLER)!=null) return true; // set by request listener? return context.getRequest().getAttribute(SCROLLER_KEY)!=null; } }
[ "panbasten@126.com" ]
panbasten@126.com
5200ee1a397902119a6a0e2fc0c5cb32f81db92d
10403413e1f002f1d2aad3e93bc2385054cd781c
/core/src/main/java/com/jukusoft/mmo/gameserver/core/network/MessageFactory.java
21625829e6ae3bfc8173964f4a8da739da7818b6
[ "Apache-2.0" ]
permissive
JuKu/mmo-game-server
d4a88e68be6d8ffafc8c89e80c53827933e06e15
5877dcd617b9c187f439a9d0e1d4264a3aa341c6
refs/heads/master
2020-03-17T23:59:24.271412
2018-06-12T20:50:52
2018-06-12T20:50:52
134,072,135
7
1
Apache-2.0
2018-05-20T12:07:49
2018-05-19T15:04:04
Java
UTF-8
Java
false
false
584
java
package com.jukusoft.mmo.gameserver.core.network; import com.jukusoft.mmo.gameserver.core.utils.MessageUtils; import io.vertx.core.buffer.Buffer; public class MessageFactory { protected MessageFactory () { // } public static Buffer createJoinSuccessMessage (int cid) { return MessageUtils.createMsg(Protocol.MSG_TYPE_GS, Protocol.MSG_EXTENDED_TYPE_JOIN_RESPONSE, cid); } public static Buffer createJoinFailedMessage (int cid) { return MessageUtils.createMsg(Protocol.MSG_TYPE_GS, Protocol.MSG_EXTENDED_TYPE_JOIN_FAILED, cid); } }
[ "kuenzel.justin@t-online.de" ]
kuenzel.justin@t-online.de
998824269d2aae7852ca296aa494c739c063fb12
80eb321b5a23adfe63b9ef15931909192feba7fb
/课程设计源代码1.2/大作业1.3/src/dao/CourseDao.java
b439576efab7aafd34872bd912d66dc068e66caa
[]
no_license
11140321/mygit
f312738e143acae18229cf2ff6f7e41bc8e70c1b
e140b10ff825ebfec522a9d7fe5d751e1bf845e4
refs/heads/master
2020-07-23T09:35:22.467140
2020-01-02T12:17:03
2020-01-02T12:17:03
207,514,741
0
0
null
null
null
null
GB18030
Java
false
false
2,214
java
package dao; import entity.IEntity; import entity.Student; import entity.Course; import java.util.HashMap; public class CourseDao implements IDao { private static CourseDao instance; private HashMap<String,IEntity> courses; private Course course; private CourseDao() { courses = new HashMap<String,IEntity>(); Course course1= new Course(); course1.setCourseNo("001"); course1.setCourseName("大学物理"); course1.setCourseGrade(5); courses.put(course1.getCourseNo(),course1); /* courses = new HashMap<String,IEntity>(); Course course2= new Course(); course2.setCourseNo("002"); course2.setCourseName("高等数学"); course2.setCourseGrade(4); courses.put(course.getCourseNo(),course2); courses = new HashMap<String,IEntity>(); Course course3= new Course(); course3.setCourseNo("003"); course3.setCourseName("概率论"); course3.setCourseGrade(4); courses.put(course.getCourseNo(),course3); courses = new HashMap<String,IEntity>(); Course course4= new Course(); course4.setCourseNo("004"); course4.setCourseName("linux"); course4.setCourseGrade(3); courses.put(course.getCourseNo(),course4); courses = new HashMap<String,IEntity>(); Course course5= new Course(); course5.setCourseNo("005"); course5.setCourseName("java面向对象"); course5.setCourseGrade(5); courses.put(course.getCourseNo(),course5);*/ } public static CourseDao getInstance() { if(instance == null) { synchronized(CourseDao.class) { if(instance == null) { instance = new CourseDao(); return instance; } } } return instance; } public void insert(IEntity entity) { //管理员调用 // TODO Auto-generated method stub Course st = (Course)entity; courses.put(st.getCourseNo(), st); } @Override public void delete() { //管理员 // TODO Auto-generated method stub } @Override public void update() { //管理员 // TODO Auto-generated method stub } @Override public HashMap<String,IEntity> getAllEntities() { // TODO Auto-generated method stub return courses; } @Override public IEntity getEntity(String Id) { // TODO Auto-generated method stub return courses.get(Id); } }
[ "you@example.com" ]
you@example.com
f4ff474443b89ddb4378e45214c1e6fe8e438cfa
265302da0a7cf8c2f06dd0f96970c75e29abc19b
/ar_webapp/src/test/java/org/kuali/kra/service/impl/versioningartifacts/SelfReferenceOwner.java
a6ee90e1c5f9fce9dcba9a7617d5b941c87f8968
[ "Apache-2.0", "ECL-2.0" ]
permissive
Ariah-Group/Research
ee7718eaf15b59f526fca6983947c8d6c0108ac4
e593c68d44176dbbbcdb033c593a0f0d28527b71
refs/heads/master
2021-01-23T15:50:54.951284
2017-05-05T02:10:59
2017-05-05T02:10:59
26,879,351
1
1
null
null
null
null
UTF-8
Java
false
false
2,387
java
/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl1.php * * 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.kuali.kra.service.impl.versioningartifacts; import org.kuali.kra.SequenceOwner; import java.util.ArrayList; import java.util.Collection; public class SelfReferenceOwner implements SequenceOwner<SelfReferenceOwner>{ private static final long serialVersionUID = 5794406936890268956L; public Long id = 1L; public Integer seq = 0; public final Collection<SelfReferenceAssociate> associates = new ArrayList<SelfReferenceAssociate>(); /** * Gets the associates attribute. * @return Returns the associates. */ public Collection<SelfReferenceAssociate> getAssociates() { return associates; } /** * Gets the id attribute. * @return Returns the id. */ public Long getId() { return id; } /** * Sets the id attribute value. * @param id The id to set. */ public void setId(Long id) { this.id = id; } /** * Gets the seq attribute. * @return Returns the seq. */ public Integer getSeq() { return seq; } /** * Sets the seq attribute value. * @param seq The seq to set. */ public void setSeq(Integer seq) { this.seq = seq; } public Integer getOwnerSequenceNumber() { return seq; } public void incrementSequenceNumber() { seq++; } public SelfReferenceOwner getSequenceOwner() { return this; } public void setSequenceOwner(SelfReferenceOwner newlyVersionedOwner) { //do nothing } public Integer getSequenceNumber() { return seq; } public void resetPersistenceState() { id = null; } public String getVersionNameField() { return "id"; } }
[ "code@ariahgroup.org" ]
code@ariahgroup.org
614450c5f4acf6e2b5db9b1ea323d1e71d1554aa
fbb8d16fa18e33ee70052bb82290b9ad071871c5
/net/minecraft/server/GenLayerIsland.java
83a0fc8767b0c7fd5481c10674fe1adbf6f92069
[]
no_license
tonybruess/mc-dev
89963bbb4a322d072cfc19e15c661b76adf6aa7d
e5f621d1e2a4c759fe723c83aa28f7059ab86377
refs/heads/master
2020-04-11T09:15:45.302287
2013-06-30T20:07:02
2013-06-30T20:07:02
11,072,678
1
0
null
null
null
null
UTF-8
Java
false
false
2,372
java
package net.minecraft.server; public class GenLayerIsland extends GenLayer { public GenLayerIsland(long i, GenLayer genlayer) { super(i); this.a = genlayer; } public int[] a(int i, int j, int k, int l) { int i1 = i - 1; int j1 = j - 1; int k1 = k + 2; int l1 = l + 2; int[] aint = this.a.a(i1, j1, k1, l1); int[] aint1 = IntCache.a(k * l); for (int i2 = 0; i2 < l; ++i2) { for (int j2 = 0; j2 < k; ++j2) { int k2 = aint[j2 + 0 + (i2 + 0) * k1]; int l2 = aint[j2 + 2 + (i2 + 0) * k1]; int i3 = aint[j2 + 0 + (i2 + 2) * k1]; int j3 = aint[j2 + 2 + (i2 + 2) * k1]; int k3 = aint[j2 + 1 + (i2 + 1) * k1]; this.a((long) (j2 + i), (long) (i2 + j)); if (k3 == 0 && (k2 != 0 || l2 != 0 || i3 != 0 || j3 != 0)) { int l3 = 1; int i4 = 1; if (k2 != 0 && this.a(l3++) == 0) { i4 = k2; } if (l2 != 0 && this.a(l3++) == 0) { i4 = l2; } if (i3 != 0 && this.a(l3++) == 0) { i4 = i3; } if (j3 != 0 && this.a(l3++) == 0) { i4 = j3; } if (this.a(3) == 0) { aint1[j2 + i2 * k] = i4; } else if (i4 == BiomeBase.ICE_PLAINS.id) { aint1[j2 + i2 * k] = BiomeBase.FROZEN_OCEAN.id; } else { aint1[j2 + i2 * k] = 0; } } else if (k3 > 0 && (k2 == 0 || l2 == 0 || i3 == 0 || j3 == 0)) { if (this.a(5) == 0) { if (k3 == BiomeBase.ICE_PLAINS.id) { aint1[j2 + i2 * k] = BiomeBase.FROZEN_OCEAN.id; } else { aint1[j2 + i2 * k] = 0; } } else { aint1[j2 + i2 * k] = k3; } } else { aint1[j2 + i2 * k] = k3; } } } return aint1; } }
[ "dinnerbone@dinnerbone.com" ]
dinnerbone@dinnerbone.com
d6a670f53832f3b4e5dc1a1695aec895f4d1e860
a11ba1b53c0e1e978b5f4f55a38b4ff5b13d5e36
/engine/src/test/java/org/apache/hop/trans/step/StepOptionTest.java
cb04b89af2124532b0dd683ad41762c9eaa8fb3f
[ "Apache-2.0" ]
permissive
lipengyu/hop
157747f4da6d909a935b4510e01644935333fef9
8afe35f0705f44d78b5c33c1ba3699f657f8b9dc
refs/heads/master
2020-09-12T06:31:58.176011
2019-11-11T21:17:59
2019-11-11T21:17:59
222,341,727
1
0
Apache-2.0
2019-11-18T01:50:19
2019-11-18T01:50:18
null
UTF-8
Java
false
false
4,181
java
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2018 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.apache.hop.trans.step; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import org.apache.hop.core.CheckResultInterface; import org.apache.hop.core.HopEnvironment; import org.apache.hop.core.exception.HopException; import org.apache.hop.core.variables.VariableSpace; import java.util.ArrayList; import java.util.List; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.when; import static org.apache.hop.i18n.BaseMessages.getString; @RunWith( MockitoJUnitRunner.class ) public class StepOptionTest { @Mock StepMeta stepMeta; @Mock VariableSpace space; @BeforeClass public static void setUpBeforeClass() throws HopException { HopEnvironment.init(); } @Before public void setup() { when( space.environmentSubstitute( anyString() ) ).thenAnswer( incovacationMock -> { Object[] arguments = incovacationMock.getArguments(); return (String) arguments[ 0 ]; } ); } @Test public void testCheckPass() { List<CheckResultInterface> remarks = new ArrayList<>(); StepOption.checkInteger( remarks, stepMeta, space, "IDENTIFIER", "9" ); StepOption.checkLong( remarks, stepMeta, space, "IDENTIFIER", "9" ); StepOption.checkBoolean( remarks, stepMeta, space, "IDENTIFIER", "true" ); StepOption.checkBoolean( remarks, stepMeta, space, "IDENTIFIER", "false" ); assertEquals( 0, remarks.size() ); } @Test public void testCheckPassEmpty() { List<CheckResultInterface> remarks = new ArrayList<>(); StepOption.checkInteger( remarks, stepMeta, space, "IDENTIFIER", "" ); StepOption.checkLong( remarks, stepMeta, space, "IDENTIFIER", "" ); StepOption.checkBoolean( remarks, stepMeta, space, "IDENTIFIER", "" ); StepOption.checkInteger( remarks, stepMeta, space, "IDENTIFIER", null ); StepOption.checkLong( remarks, stepMeta, space, "IDENTIFIER", null ); StepOption.checkBoolean( remarks, stepMeta, space, "IDENTIFIER", null ); assertEquals( 0, remarks.size() ); } @Test public void testCheckFailInteger() { List<CheckResultInterface> remarks = new ArrayList<>(); StepOption.checkInteger( remarks, stepMeta, space, "IDENTIFIER", "asdf" ); assertEquals( 1, remarks.size() ); assertEquals( remarks.get( 0 ).getText(), getString( StepOption.class, "StepOption.CheckResult.NotAInteger", "IDENTIFIER" ) ); } @Test public void testCheckFailLong() { List<CheckResultInterface> remarks = new ArrayList<>(); StepOption.checkLong( remarks, stepMeta, space, "IDENTIFIER", "asdf" ); assertEquals( 1, remarks.size() ); assertEquals( remarks.get( 0 ).getText(), getString( StepOption.class, "StepOption.CheckResult.NotAInteger", "IDENTIFIER" ) ); } @Test public void testCheckFailBoolean() { List<CheckResultInterface> remarks = new ArrayList<>(); StepOption.checkBoolean( remarks, stepMeta, space, "IDENTIFIER", "asdf" ); assertEquals( 1, remarks.size() ); assertEquals( remarks.get( 0 ).getText(), getString( StepOption.class, "StepOption.CheckResult.NotABoolean", "IDENTIFIER" ) ); } }
[ "mattcasters@gmail.com" ]
mattcasters@gmail.com
f1bbfdf8a71742b49e7cf49d862713a621dc84a4
1277a4f584d247080563e6bb458d0c6ae9c2fb59
/src/java/mx/org/kaana/mantic/ws/publicar/Paises.java
1122ea270485e159f03df63fc53244de1851e0f9
[]
no_license
TeamDeveloper2016/keet
7144a4d6bf73bb0be99bf83191787131a74c435f
280f035ea280834befa1fc2abbbe7a1e1a086d02
refs/heads/master
2023-09-02T04:22:41.398499
2023-08-27T22:46:24
2023-08-27T22:46:24
239,387,168
0
1
null
null
null
null
UTF-8
Java
false
false
1,125
java
package mx.org.kaana.mantic.ws.publicar; import java.io.Serializable; import mx.org.kaana.libs.json.Decoder; import mx.org.kaana.mantic.enums.ERespuesta; import mx.org.kaana.mantic.ws.publicar.beans.Respuesta; import mx.org.kaana.mantic.ws.publicar.reglas.Manager; public class Paises implements Serializable{ private static final long serialVersionUID = -6756978815958154700L; public String argentina() throws Exception{ String regresar= null; Manager manager= null; try { manager= new Manager(); regresar= manager.verificaConexion(); } // try catch (Exception e) { regresar= Decoder.toJson(new Respuesta(ERespuesta.ERROR.getCodigo(), e.getMessage())); } // catch return regresar; } // afganistan public String mexico() throws Exception{ String regresar= null; Manager manager= null; try { manager= new Manager(); regresar= manager.ultimoRespaldo(); } // try catch (Exception e) { regresar= Decoder.toJson(new Respuesta(ERespuesta.ERROR.getCodigo(), e.getMessage())); } // catch return regresar; } // albania }
[ "team.developer@gmail.com" ]
team.developer@gmail.com
91cbc48e0abb23059c116c2a3f8de4bacd7c49ec
c170b1af7344e5a9c262b5569b9d7eb5d758114d
/OrangeHRM/src/com/orangehrm/testsuite/LoginPage.java
7848b8553cce52b9577f0131c7d051085d49028a
[]
no_license
SaiKrishna12/Sept21Batch
4bc5335b408e7385cfedfc402f44dc460bd0e202
12b9ec5338b7ac41d3a52a0177bff85f332f19e2
refs/heads/master
2021-01-10T15:34:49.829118
2015-11-21T13:48:50
2015-11-21T13:48:50
46,617,239
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
package com.orangehrm.testsuite; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; public class LoginPage { @FindBy(id="txtUsername") WebElement username; @FindBy(id="txtPassword") WebElement password; @FindBy(id="btnLogin") WebElement login; public void loginPanel(String u,String p) { username.sendKeys(u); password.sendKeys(p); login.click(); } }
[ "saikrishna_gandham@yahoo.co.in" ]
saikrishna_gandham@yahoo.co.in
df7dd04ffcf8fc0141b1620fc86e26e593b738e3
143add375bd5c2f02e095adf7d90b578923ef0a1
/LeetCode/Solutions/Solution_KthLargestElementinanArray.java
38cf137af77676a7c1c689d0b2bf8190c0a7ab28
[]
no_license
SubAkBa/Algorithm_Solution
ff361af242d302c1867f8a263c599160f752bbf3
3d15f5df124f369d20947c20ce327e8c5645db98
refs/heads/master
2022-11-25T14:44:49.677033
2022-11-17T08:15:50
2022-11-17T08:15:50
226,641,485
2
0
null
null
null
null
UTF-8
Java
false
false
1,431
java
import java.util.*; public class Solution_KthLargestElementinanArray { public static int findKthLargest(int[] nums, int k) { Arrays.sort(nums); return nums[nums.length - k]; } // Quick Selection public static void Swap(int[] nums, int n1, int n2) { int temp = nums[n1]; nums[n1] = nums[n2]; nums[n2] = temp; } public static int Partition(int[] nums, int left, int right) { int mid = (left + right) / 2; Swap(nums, left, mid); int pivot = nums[left]; while (left < right) { while (left < right && nums[right] <= pivot) --right; nums[left] = nums[right]; while (left < right && nums[left] >= pivot) ++left; nums[right] = nums[left]; } nums[left] = pivot; return right; } public static int QuickSelection(int[] nums, int left, int right, int k) { if (left < right) { int idx = Partition(nums, left, right); System.out.println(Arrays.toString(nums)); if (idx < k) QuickSelection(nums, idx + 1, right, k); else if (idx > k) QuickSelection(nums, left, idx - 1, k); else return nums[idx]; } return nums[k]; } public static int findKthLargest(int[] nums, int k) { return QuickSelection(nums, 0, nums.length - 1, --k); } public static void main(String[] args) { System.out.println(findKthLargest(new int[] { 3, 2, 1, 5, 6, 4 }, 2)); // 5 System.out.println(findKthLargest(new int[] { 3, 2, 3, 1, 2, 4, 5, 5, 6 }, 4)); // 4 } }
[ "circle5926@gmail.com" ]
circle5926@gmail.com
455be7c497d1395e92133ced9bf379d9833b1c04
eaa7abca125a59c2a4d685fdb844cb1c0b8703b6
/core/api/src/test/java/org/apache/zest/api/object/ObjectBuilderTest.java
e3c16f6fc42568442c0ff2287e2d03e423df312b
[ "BSD-3-Clause", "MIT", "Apache-2.0", "W3C" ]
permissive
barsifedron/zest-java
9ee747b1490ca5e7f1a901081580e3ae1c323690
dc30f4b41497087280ac734d2285123bf2f1f398
refs/heads/develop
2020-06-16T12:06:48.714025
2016-11-28T18:27:06
2016-11-28T18:27:06
75,105,997
0
0
null
2016-11-29T17:38:05
2016-11-29T17:38:04
null
UTF-8
Java
false
false
1,844
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.zest.api.object; import org.junit.Test; import org.apache.zest.api.injection.scope.Uses; import org.apache.zest.bootstrap.AssemblyException; import org.apache.zest.bootstrap.ModuleAssembly; import org.apache.zest.test.AbstractZestTest; import static org.junit.Assert.assertNotNull; /** * JAVADOC */ public class ObjectBuilderTest extends AbstractZestTest { public void assemble( ModuleAssembly module ) throws AssemblyException { module.objects( A.class, B.class, C.class, D.class ); } @Test public void testNotProvidedUses() { A a = objectFactory.newObject( A.class ); assertNotNull( a ); assertNotNull( a.b ); assertNotNull( a.b.c ); assertNotNull( a.b.c.d ); } public static class A { @Uses B b; } public static class B { @Uses C c; } public static class C { @Uses D d; } public static class D { } }
[ "niclas@hedhman.org" ]
niclas@hedhman.org
581ab074a796b830948aa57e26ff9ea9e4f91095
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module736/src/main/java/module736packageJava0/Foo1.java
0286693cc97c712f1b62336497df82507901fe77
[ "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
347
java
package module736packageJava0; import java.lang.Integer; public class Foo1 { Integer int0; Integer int1; public void foo0() { new module736packageJava0.Foo0().foo4(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
b2cd88685f3364531c9171d7f6cd34691ad91a22
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a104/A104336Test.java
38bd86299479180e2d4a820c1d6fc4338e9e3569
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a104; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A104336Test extends AbstractSequenceTest { }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
69a44fa5b22878a3538dffe7129e0d3d8c9f4d91
30472cec0dbe044d52b029530051ab404701687f
/src/main/java/com/sforce/soap/tooling/metadata/PublicGroups.java
5e9f80c7b142fa22835dd10f874c1f8c7e1bdd4b
[ "BSD-3-Clause" ]
permissive
madmax983/ApexLink
f8e9dcf8f697ed4e34ddcac353c13bec707f3670
30c989ce2c0098097bfaf586b87b733853913155
refs/heads/master
2020-05-07T16:03:15.046972
2019-04-08T21:08:06
2019-04-08T21:08:06
180,655,963
1
0
null
2019-04-10T20:08:30
2019-04-10T20:08:30
null
UTF-8
Java
false
false
4,704
java
package com.sforce.soap.tooling.metadata; /** * This is a generated class for the SObject Enterprise API. * Do not edit this file, as your changes will be lost. */ public class PublicGroups implements com.sforce.ws.bind.XMLizable { /** * Constructor */ public PublicGroups() {} /* Cache the typeInfo instead of declaring static fields throughout*/ private transient java.util.Map<String, com.sforce.ws.bind.TypeInfo> typeInfoCache = new java.util.HashMap<String, com.sforce.ws.bind.TypeInfo>(); private com.sforce.ws.bind.TypeInfo _lookupTypeInfo(String fieldName, String namespace, String name, String typeNS, String type, int minOcc, int maxOcc, boolean elementForm) { com.sforce.ws.bind.TypeInfo typeInfo = typeInfoCache.get(fieldName); if (typeInfo == null) { typeInfo = new com.sforce.ws.bind.TypeInfo(namespace, name, typeNS, type, minOcc, maxOcc, elementForm); typeInfoCache.put(fieldName, typeInfo); } return typeInfo; } /** * element : publicGroup of type {http://www.w3.org/2001/XMLSchema}string * java type: java.lang.String[] */ private boolean publicGroup__is_set = false; private java.lang.String[] publicGroup = new java.lang.String[0]; public java.lang.String[] getPublicGroup() { return publicGroup; } public void setPublicGroup(java.lang.String[] publicGroup) { this.publicGroup = publicGroup; publicGroup__is_set = true; } protected void setPublicGroup(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { __in.peekTag(); if (__typeMapper.isElement(__in, _lookupTypeInfo("publicGroup", "urn:metadata.tooling.soap.sforce.com","publicGroup","http://www.w3.org/2001/XMLSchema","string",0,-1,true))) { setPublicGroup((java.lang.String[])__typeMapper.readObject(__in, _lookupTypeInfo("publicGroup", "urn:metadata.tooling.soap.sforce.com","publicGroup","http://www.w3.org/2001/XMLSchema","string",0,-1,true), java.lang.String[].class)); } } private void writeFieldPublicGroup(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException { __typeMapper.writeObject(__out, _lookupTypeInfo("publicGroup", "urn:metadata.tooling.soap.sforce.com","publicGroup","http://www.w3.org/2001/XMLSchema","string",0,-1,true), publicGroup, publicGroup__is_set); } /** */ @Override public void write(javax.xml.namespace.QName __element, com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException { __out.writeStartTag(__element.getNamespaceURI(), __element.getLocalPart()); writeFields(__out, __typeMapper); __out.writeEndTag(__element.getNamespaceURI(), __element.getLocalPart()); } protected void writeFields(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException { writeFields1(__out, __typeMapper); } @Override public void load(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { __typeMapper.consumeStartTag(__in); loadFields(__in, __typeMapper); __typeMapper.consumeEndTag(__in); } protected void loadFields(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { loadFields1(__in, __typeMapper); } @Override public String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder(); sb.append("[PublicGroups "); toString1(sb); sb.append("]\n"); return sb.toString(); } private void toStringHelper(StringBuilder sb, String name, Object value) { sb.append(' ').append(name).append("='").append(com.sforce.ws.util.Verbose.toString(value)).append("'\n"); } private void writeFields1(com.sforce.ws.parser.XmlOutputStream __out, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException { writeFieldPublicGroup(__out, __typeMapper); } private void loadFields1(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { setPublicGroup(__in, __typeMapper); } private void toString1(StringBuilder sb) { toStringHelper(sb, "publicGroup", publicGroup); } }
[ "nawforce@gmail.com" ]
nawforce@gmail.com
c07dfb2920344cb8a82dfd5d4af0aaeaf3deb336
1627f39bdce9c3fe5bfa34e68c276faa4568bc35
/src/breadth_first_search/Boj21609.java
57d7b71d7b88680496daf23e989d69f345d6eed7
[ "Apache-2.0" ]
permissive
minuk8932/Algorithm_BaekJoon
9ebb556f5055b89a5e5c8d885b77738f1e660e4d
a4a46b5e22e0ed0bb1b23bf1e63b78d542aa5557
refs/heads/master
2022-10-23T20:08:19.968211
2022-10-02T06:55:53
2022-10-02T06:55:53
84,549,122
3
3
null
null
null
null
UTF-8
Java
false
false
6,875
java
package breadth_first_search; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; /** * * @author exponential-e * 백준 21609번: 상어 중학교 * * @see https://www.acmicpc.net/problem/21609 * */ public class Boj21609 { private static final int BLACK = -1; private static final int RAINBOW = 0; private static final int EMPTY = -2; private static final int[][] DIRECTIONS = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; private static final int ROW = 0, COL = 1; private static final long CIPHER = 1_000L; private static int[][] map; private static boolean[][] visit; private static int N; private static PriorityQueue<Long> pq; private static class Point { int row; int col; public Point(int row, int col) { this.row = row; this.col = col; } } public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nextToken()); int M = Integer.parseInt(st.nextToken()); map = new int[N][N]; for(int i = 0; i < N; i++) { st = new StringTokenizer(br.readLine()); Arrays.fill(map[i], EMPTY); for(int j = 0; j < N; j++) { map[i][j] = Integer.parseInt(st.nextToken()); } } System.out.println(auto(M)); } private static int auto(int m) { int result = 0; while(true) { pq = new PriorityQueue<>(); visit = new boolean[N][N]; for (int block = 1; block <= m; block++) { bfs(block); } if(pq.isEmpty()) break; long target = -pq.poll(); int col = (int) (target % CIPHER); target /= CIPHER; int row = (int) (target % CIPHER); target /= CIPHER; removing(new Point(row, col)); target /= CIPHER; result += target * target; drop(); rotate(); drop(); } return result; } /** * * Removing * * line 105, 118: Remove blocks what selected. * * @param p */ private static void removing(Point p) { Queue<Point> q = new ArrayDeque<>(); boolean[][] used = new boolean[N][N]; int color = map[p.row][p.col]; q.offer(p); used[p.row][p.col] = true; map[p.row][p.col] = EMPTY; while(!q.isEmpty()) { Point current = q.poll(); for(final int[] DIRECTION: DIRECTIONS) { int nextRow = current.row + DIRECTION[ROW]; int nextCol = current.col + DIRECTION[COL]; if(outOfRange(nextRow, nextCol)) continue; if(map[nextRow][nextCol] != color && map[nextRow][nextCol] != RAINBOW) continue; if(used[nextRow][nextCol]) continue; used[nextRow][nextCol] = true; map[nextRow][nextCol] = EMPTY; q.offer(new Point(nextRow, nextCol)); } } } /** * * Drop * * line 138 ~ 140: Find the highest empty space, and drop blocks. * */ private static void drop() { for(int row = N - 1; row > 0; row--) { for(int col = 0; col < N; col++) { if(map[row][col] != EMPTY) continue; int r = row; while(r > 0 && map[r][col] == EMPTY) { r--; } if(map[r][col] == BLACK) continue; map[row][col] = map[r][col]; map[r][col] = EMPTY; } } } /** * * Rotate * * line 161: Rotate board CCW. * */ private static void rotate() { int[][] arr = new int[N][N]; for(int row = 0; row < N; row++) { for(int col = 0; col < N; col++) { arr[row][col] = map[col][N - row - 1]; } } for(int row = 0; row < N; row++) { for(int col = 0; col < N; col++) { map[row][col] = arr[row][col]; } } } /** * * BFS * * line 191 ~ 223: Find the largest block size, and min row, col values * line 225 ~ 229: Get candidate, and remove rainbow visit state. * * @param b */ private static void bfs(int b) { Queue<Point> q = new ArrayDeque<>(); List<Point> rainbows = new LinkedList<>(); for(int row = 0; row < N; row++) { for(int col = 0; col < N; col++) { if(map[row][col] != b) continue; if(visit[row][col]) continue; visit[row][col] = true; int size = 1; Point center = new Point(row, col); q.offer(new Point(row, col)); while(!q.isEmpty()) { Point current = q.poll(); for(final int[] DIRECTION: DIRECTIONS) { int nextRow = current.row + DIRECTION[ROW]; int nextCol = current.col + DIRECTION[COL]; if(outOfRange(nextRow, nextCol)) continue; if(map[nextRow][nextCol] != b && map[nextRow][nextCol] != RAINBOW) continue; if(visit[nextRow][nextCol]) continue; visit[nextRow][nextCol] = true; size++; if(map[nextRow][nextCol] == RAINBOW){ rainbows.add(new Point(nextRow, nextCol)); } else { if(nextRow <= center.row){ if(center.row == nextRow) center.col = Math.min(center.col, nextCol); else center.col = nextCol; center.row = nextRow; } } q.offer(new Point(nextRow, nextCol)); } } int rSize = rainbows.size(); dissolve(rainbows); if(size == rSize || size < 2) continue; pq.offer(-(((CIPHER * size + rSize) * CIPHER + center.row) * CIPHER + center.col)); } } } private static boolean outOfRange(int row, int col) { return row < 0 || col < 0 || row >= N || col >= N; } private static void dissolve(List<Point> rainbows) { while(!rainbows.isEmpty()) { Point current = rainbows.remove(0); visit[current.row][current.col] = false; } } }
[ "minuk8932@naver.com" ]
minuk8932@naver.com
a74eddd3afcae8675bac76f1603892d7f94e76c1
ef054d79cd4055ad874c0c7f3d77fbe30b2bec33
/app/src/main/java/com/thinkernote/ThinkerNote/_interface/p/ISplashPresenter.java
a018890247b37e92dc3debce2281c245fb19f392
[]
no_license
66668/QBJ_Test
e0cf84912fffe82c6ae0ae4655d9610b4abfe5ed
533520773918451b3c290d7ce86e93ed41708007
refs/heads/master
2021-06-12T15:23:55.318936
2021-01-08T03:18:38
2021-01-08T03:18:38
143,664,159
1
0
null
null
null
null
UTF-8
Java
false
false
183
java
package com.thinkernote.ThinkerNote._interface.p; /** * p层interface */ public interface ISplashPresenter { void plogin(String name,String ps); void pUpdataProfile(); }
[ "sjy0118atsn@163.com" ]
sjy0118atsn@163.com
7737015818c573ef084300f39456afac2f31fa24
d9116308902ffeb1e9f3d62f79b0f9b6db31c339
/highcommunity/src/cn/hi028/android/highcommunity/view/SysUtils.java
aa378903123c8b402e016c442524f8c6107fab05
[]
no_license
CeruleanLee/Hi_Eclipse
a868aa17bf2981d0b384c967792418e20f629be0
ac74dc944f3f45aef957707b372fb094febdad04
refs/heads/master
2021-05-01T01:36:39.723791
2016-09-29T02:43:46
2016-09-29T02:43:46
68,449,528
1
0
null
null
null
null
UTF-8
Java
false
false
699
java
package cn.hi028.android.highcommunity.view; import android.app.Activity; import android.content.Context; import android.view.Display; import android.view.WindowManager; public class SysUtils { public static int Dp2Px(Context context, float dp) { final float scale = context.getResources().getDisplayMetrics().density; return (int) (dp * scale + 0.5f); } @SuppressWarnings("deprecation") public static int getScreenWidth(Activity activity){ int width = 0; WindowManager windowManager = activity.getWindowManager(); Display display = windowManager.getDefaultDisplay(); width=display.getWidth(); return width; } }
[ "cerulean_lee@163.com" ]
cerulean_lee@163.com
cbc9a8a59b1d82f745a3108b330a16e0f2570f3e
4c304a7a7aa8671d7d1b9353acf488fdd5008380
/src/main/java/com/alipay/api/domain/AlipayOpenMiniMorphoAppgrayOnlineModel.java
f23a0afc5307c74383b0c9765f76fbd1fd9a4263
[ "Apache-2.0" ]
permissive
zhaorongxi/alipay-sdk-java-all
c658983d390e432c3787c76a50f4a8d00591cd5c
6deda10cda38a25dcba3b61498fb9ea839903871
refs/heads/master
2021-02-15T19:39:11.858966
2020-02-16T10:44:38
2020-02-16T10:44:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,061
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 灰度上架 * * @author auto create * @since 1.0, 2019-12-26 15:03:57 */ public class AlipayOpenMiniMorphoAppgrayOnlineModel extends AlipayObject { private static final long serialVersionUID = 3636386692182123275L; /** * 灰度策略 */ @ApiField("gray_strategy") private String grayStrategy; /** * 闪蝶应用ID */ @ApiField("id") private String id; /** * 闪蝶身份校验信息 */ @ApiField("identity") private MorphoIdentity identity; public String getGrayStrategy() { return this.grayStrategy; } public void setGrayStrategy(String grayStrategy) { this.grayStrategy = grayStrategy; } public String getId() { return this.id; } public void setId(String id) { this.id = id; } public MorphoIdentity getIdentity() { return this.identity; } public void setIdentity(MorphoIdentity identity) { this.identity = identity; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
f093d7235acb96bb1b3135053d2f9c8f7187df7d
9cdcc9e5437f7c2b9fdbe5135016ce63e6f5c688
/src/main/java/dr/web/basis/controller/BasisSystem_configController.java
80a26c14de0bef4b904c854b66d163825bf073b2
[]
no_license
DreamInception/pc1.0
a0307cf5e2355a63ba8de562952e3902aacfc80c
1a1db34762a4d3f70d45d47c09f92e7c5fb98af3
refs/heads/master
2021-01-13T07:38:20.166292
2016-10-20T14:54:12
2016-10-20T14:54:12
71,473,454
0
0
null
null
null
null
UTF-8
Java
false
false
3,450
java
/** * 包名: dr.web.basis.controller * 文件名: LoginController.java * 描述: 登录相关操作 * 创建人: 陈吉秋特 * 创建时间: 2016-3-16下午5:00:00 * 版权: 2016 xx版权所有 */ package dr.web.basis.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import dr.web.basis.service.BasisSystem_configService; import dr.web.common.base.BaseController; import dr.web.common.bean.Json; /** * * @包名 :dr.web.basis.controller * @文件名 :BasisSystem_configController.java * @系统名称 : 上海景源金服PC端 * @Author: 陈吉秋特 * @Date: 2015-3-28下午2:08:37 * @版本号 :v0.0.01 */ @Controller @RequestMapping(value = "/basisSystem_config") public class BasisSystem_configController extends BaseController { @Autowired BasisSystem_configService basisSystem_configService; /** * TODO 方法作用:物理删除一条记录(数据库不留记录) * * @Author: 自动生成 */ @RequestMapping(value = "delete") @ResponseBody public void delete() { this.getResult().putAll(this.operateResult(basisSystem_configService.delete(this.getParam()))); this.responseData(this.getResult()); } /** * TODO 方法作用:物理批量删除(数据库不留记录) * * @Author: 自动生成 */ @RequestMapping(value = "deleteAll") @ResponseBody public void deleteAll() { this.getResult().putAll(this.operateResult(basisSystem_configService.deleteAll(this.getParam()))); this.responseData(this.getResult()); } /** * TODO 方法作用:根据条件查询全部 * * @Author: 自动生成 */ @RequestMapping(value = "findAllList") @ResponseBody public void findAllList() { super.responseData(basisSystem_configService.findAllList(this.getParam())); } /** * TODO 方法作用:根据条件分页查询记录 * * @Author: 自动生成 */ @RequestMapping(value = "findPageList") @ResponseBody public void findPageList() { this.json = new Json(basisSystem_configService.count(this.getParam()), basisSystem_configService.findPageList(this.getParam())); super.responseData(json); } /** * TODO 方法作用:根据条件查询一条记录 * * @Author: 自动生成 */ @RequestMapping(value = "findById") @ResponseBody public void findById() { super.responseData(basisSystem_configService.findById(this.getParam())); } /** * TODO 方法作用:添加一条记录 * * @Author: 自动生成 */ @RequestMapping(value = "save") @ResponseBody public void save() { this.getResult().putAll(this.operateResult(basisSystem_configService.save(this.getParam()))); this.responseData(this.getResult()); } /** * TODO 方法作用:批量添加记录 * * @Author: 自动生成 */ @RequestMapping(value = "saveAll") @ResponseBody public void saveAll() { this.getResult().putAll(this.operateResult(basisSystem_configService.saveAll(this.getParam()))); this.responseData(this.getResult()); } /** * TODO 方法作用:修改一条记录 * * @Author: 自动生成 */ @RequestMapping(value = "update") @ResponseBody public void update() { this.getResult().putAll(this.operateResult(basisSystem_configService.update(this.getParam()))); this.responseData(this.getResult()); } }
[ "pengfei@51vest.com" ]
pengfei@51vest.com
cf7c9ed92fce8889eb9479bdf5cc23e33e5baeb2
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE191_Integer_Underflow/s04/CWE191_Integer_Underflow__int_getCookies_Servlet_postdec_45.java
7b35211507b164a3e10b4a872ee933dad2f436c0
[]
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
5,333
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_getCookies_Servlet_postdec_45.java Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-45.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: 45 Data flow: data passed as a private class member variable from one function to another in the same class * * */ package testcases.CWE191_Integer_Underflow.s04; import testcasesupport.*; import javax.servlet.http.*; import java.util.logging.Level; public class CWE191_Integer_Underflow__int_getCookies_Servlet_postdec_45 extends AbstractTestCaseServlet { private int dataBad; private int dataGoodG2B; private int dataGoodB2G; private void badSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataBad; /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ data--; int result = (int)(data); IO.writeLine("result: " + result); } public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */ /* Read data from cookies */ { Cookie cookieSources[] = request.getCookies(); if (cookieSources != null) { /* POTENTIAL FLAW: Read data from the first cookie value */ String stringNumber = cookieSources[0].getValue(); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat); } } } dataBad = data; badSink(request, response); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); goodB2G(request, response); } private void goodG2BSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataGoodG2B; /* POTENTIAL FLAW: if data == Integer.MIN_VALUE, this will overflow */ data--; int result = (int)(data); IO.writeLine("result: " + result); } /* goodG2B() - use goodsource and badsink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; dataGoodG2B = data; goodG2BSink(request, response); } private void goodB2GSink(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data = dataGoodB2G; /* FIX: Add a check to prevent an underflow from occurring */ if (data > Integer.MIN_VALUE) { data--; int result = (int)(data); IO.writeLine("result: " + result); } else { IO.writeLine("data value is too small to decrement."); } } /* goodB2G() - use badsource and goodsink */ private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */ /* Read data from cookies */ { Cookie cookieSources[] = request.getCookies(); if (cookieSources != null) { /* POTENTIAL FLAW: Read data from the first cookie value */ String stringNumber = cookieSources[0].getValue(); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat); } } } dataGoodB2G = data; goodB2GSink(request, response); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
6392acf02eb3c1221aa65dd2ebe9e867e20ae4e6
fac5d6126ab147e3197448d283f9a675733f3c34
/src/main/java/dji/midware/data/model/P3/DataGimbalPushBatteryInfo.java
383302780180dbf591ced3ac77fb83470b109e25
[]
no_license
KnzHz/fpv_live
412e1dc8ab511b1a5889c8714352e3a373cdae2f
7902f1a4834d581ee6afd0d17d87dc90424d3097
refs/heads/master
2022-12-18T18:15:39.101486
2020-09-24T19:42:03
2020-09-24T19:42:03
294,176,898
0
0
null
2020-09-09T17:03:58
2020-09-09T17:03:57
null
UTF-8
Java
false
false
918
java
package dji.midware.data.model.P3; import android.support.annotation.Keep; import dji.fieldAnnotation.EXClassNullAway; import dji.midware.data.manager.P3.DataBase; @Keep @EXClassNullAway public class DataGimbalPushBatteryInfo extends DataBase { private static DataGimbalPushBatteryInfo instance = null; public static synchronized DataGimbalPushBatteryInfo getInstance() { DataGimbalPushBatteryInfo dataGimbalPushBatteryInfo; synchronized (DataGimbalPushBatteryInfo.class) { if (instance == null) { instance = new DataGimbalPushBatteryInfo(); } dataGimbalPushBatteryInfo = instance; } return dataGimbalPushBatteryInfo; } public int getCapacityPercentage() { return ((Integer) get(0, 1, Integer.class)).intValue(); } /* access modifiers changed from: protected */ public void doPack() { } }
[ "michael@districtrace.com" ]
michael@districtrace.com
c13cc97f20b747e1502525ad07c2342054a22f37
9049eabb2562cd3e854781dea6bd0a5e395812d3
/sources/com/google/android/gms/safetynet/AttestationData.java
c32b0fa6a9092a179517ad434fa1add35a2a5917
[]
no_license
Romern/gms_decompiled
4c75449feab97321da23ecbaac054c2303150076
a9c245404f65b8af456b7b3440f48d49313600ba
refs/heads/master
2022-07-17T23:22:00.441901
2020-05-17T18:26:16
2020-05-17T18:26:16
264,227,100
2
5
null
null
null
null
UTF-8
Java
false
false
1,820
java
package com.google.android.gms.safetynet; import android.os.Parcel; import android.os.Parcelable; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; /* compiled from: :com.google.android.gms@201515033@20.15.15 (120300-306758586) */ public class AttestationData extends AbstractSafeParcelable { public static final Parcelable.Creator CREATOR = new apfi(); /* renamed from: a */ public final String f107314a; public AttestationData(String str) { this.f107314a = str; } /* JADX DEBUG: Failed to find minimal casts for resolve overloaded methods, cast all args instead method: see.a(android.os.Parcel, int, java.lang.String, boolean):void arg types: [android.os.Parcel, int, java.lang.String, int] candidates: see.a(android.os.Parcel, int, android.os.Bundle, boolean):void see.a(android.os.Parcel, int, android.os.Parcel, boolean):void see.a(android.os.Parcel, int, java.math.BigDecimal, boolean):void see.a(android.os.Parcel, int, java.util.List, boolean):void see.a(android.os.Parcel, int, byte[], boolean):void see.a(android.os.Parcel, int, double[], boolean):void see.a(android.os.Parcel, int, float[], boolean):void see.a(android.os.Parcel, int, int[], boolean):void see.a(android.os.Parcel, int, long[], boolean):void see.a(android.os.Parcel, int, android.os.Parcelable[], int):void see.a(android.os.Parcel, int, java.lang.String[], boolean):void see.a(android.os.Parcel, int, boolean[], boolean):void see.a(android.os.Parcel, int, java.lang.String, boolean):void */ public final void writeToParcel(Parcel parcel, int i) { int a = see.m35030a(parcel); see.m35046a(parcel, 2, this.f107314a, false); see.m35062b(parcel, a); } }
[ "roman.karwacik@rwth-aachen.de" ]
roman.karwacik@rwth-aachen.de
376ff67e317b8b4f8d88f02461537694d092b7fa
fec4a09f54f4a1e60e565ff833523efc4cc6765a
/Dependencies/work/decompile-00fabbe5/net/minecraft/server/network/ITextFilter.java
7a9aed5e5378b0eca3b0585a93a19b3c02344d6d
[]
no_license
DefiantBurger/SkyblockItems
012d2082ae3ea43b104ac4f5bf9eeb509889ec47
b849b99bd4dc52ae2f7144ddee9cbe2fd1e6bf03
refs/heads/master
2023-06-23T17:08:45.610270
2021-07-27T03:27:28
2021-07-27T03:27:28
389,780,883
0
0
null
null
null
null
UTF-8
Java
false
false
1,538
java
package net.minecraft.server.network; import com.google.common.collect.ImmutableList; import java.util.List; import java.util.concurrent.CompletableFuture; public interface ITextFilter { ITextFilter DUMMY = new ITextFilter() { @Override public void a() {} @Override public void b() {} @Override public CompletableFuture<ITextFilter.a> a(String s) { return CompletableFuture.completedFuture(ITextFilter.a.a(s)); } @Override public CompletableFuture<List<ITextFilter.a>> a(List<String> list) { return CompletableFuture.completedFuture((List) list.stream().map(ITextFilter.a::a).collect(ImmutableList.toImmutableList())); } }; void a(); void b(); CompletableFuture<ITextFilter.a> a(String s); CompletableFuture<List<ITextFilter.a>> a(List<String> list); public static class a { public static final ITextFilter.a EMPTY = new ITextFilter.a("", ""); private final String raw; private final String filtered; public a(String s, String s1) { this.raw = s; this.filtered = s1; } public String a() { return this.raw; } public String b() { return this.filtered; } public static ITextFilter.a a(String s) { return new ITextFilter.a(s, s); } public static ITextFilter.a b(String s) { return new ITextFilter.a(s, ""); } } }
[ "joseph.cicalese@gmail.com" ]
joseph.cicalese@gmail.com
cdd9637bf040805b41679d38ac5908bd00131586
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/deeplearning4j--deeplearning4j/9fe021bb3717526fa854fadaa09f534c52c8f46b/after/WeightInitUtil.java
81c5a530d37c25fa4810c35c7874965de9acbaf9
[]
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
5,399
java
/* * * * Copyright 2015 Skymind,Inc. * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * */ package org.deeplearning4j.nn.weights; import org.apache.commons.math3.util.FastMath; import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.api.rng.distribution.Distribution; import org.nd4j.linalg.factory.Nd4j; /** * Weight initialization utility * * @author Adam Gibson */ public class WeightInitUtil { /** * Default order for the arrays created by WeightInitUtil. */ public static final char DEFAULT_WEIGHT_INIT_ORDER = 'f'; // /** // * Normalized weight init // * // * @param shape shape // * @param nIn number of inputs // * @return the weights // */ // public static INDArray normalized(int[] shape, int nIn) { // return Nd4j.rand(shape).subi(0.5).divi((double) nIn); // } /** * Generate a random matrix with respect to the number of inputs and outputs. * This is a bound uniform distribution with the specified minimum and maximum * * @param shape the shape of the matrix * @param nIn the number of inputs * @param nOut the number of outputs * @return {@link INDArray} */ public static INDArray uniformBasedOnInAndOut(int[] shape, int nIn, int nOut) { double min = -4.0 * Math.sqrt(6.0 / (double) (nOut + nIn)); double max = 4.0 * Math.sqrt(6.0 / (double) (nOut + nIn)); return Nd4j.rand(shape, Nd4j.getDistributions().createUniform(min, max)); } public static INDArray initWeights(int[] shape, float min, float max) { return Nd4j.rand(shape, min, max, Nd4j.getRandom()); } /** * Initializes a matrix with the given weight initialization scheme. * Note: Defaults to fortran ('f') order arrays for the weights. Use {@link #initWeights(int[], WeightInit, Distribution, char, INDArray)} * to control this * * @param shape the shape of the matrix * @param initScheme the scheme to use * @return a matrix of the specified dimensions with the specified * distribution based on the initialization scheme */ public static INDArray initWeights(int[] shape, WeightInit initScheme, Distribution dist, INDArray paramView) { return initWeights(shape, initScheme, dist, DEFAULT_WEIGHT_INIT_ORDER, paramView); } public static INDArray initWeights(int[] shape, WeightInit initScheme, Distribution dist, char order, INDArray paramView) { //Note: using f order here as params get flattened to f order INDArray ret; switch (initScheme) { case DISTRIBUTION: ret = dist.sample(shape); break; case NORMALIZED: ret = Nd4j.rand(order, shape); ret.subi(0.5).divi(shape[0]); break; case RELU: ret = Nd4j.randn(order, shape).muli(FastMath.sqrt(2.0 / shape[0])); //N(0, 2/nIn) break; case SIZE: ret = uniformBasedOnInAndOut(shape, shape[0], shape[1]); break; case UNIFORM: double a = 1 / (double) shape[0]; ret = Nd4j.rand(order, shape).muli(2 * a).subi(a); break; case VI: ret = Nd4j.rand(order, shape); int len = 0; for (int aShape : shape) { len += aShape; } double r = Math.sqrt(6) / Math.sqrt(len + 1); ret.muli(2 * r).subi(r); break; case XAVIER: ret = Nd4j.randn(order, shape).divi(FastMath.sqrt(shape[0] + shape[1])); break; case ZERO: ret = Nd4j.create(shape, order); break; default: throw new IllegalStateException("Illegal weight init value: " + initScheme); } INDArray flat = Nd4j.toFlattened(order,ret); if(flat.length() != paramView.length()) throw new RuntimeException("ParamView length does not match initialized weights length"); paramView.assign(flat); return paramView.reshape(order, shape); } /** * Initializes a matrix with the given weight initialization scheme * * @param nIn the number of rows in the matrix * @param nOut the number of columns in the matrix * @param initScheme the scheme to use * @return a matrix of the specified dimensions with the specified * distribution based on the initialization scheme */ public static INDArray initWeights(int nIn, int nOut, WeightInit initScheme, Distribution dist, INDArray paramView) { return initWeights(new int[]{nIn, nOut}, initScheme, dist, paramView); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
3d3f9904151407dbe5bf9bbfa445de860dd37416
773c4d373ba5e0d95b9f42c7c564a3c8913d260b
/modules/jersey/src/main/java/org/atmosphere/jersey/TrackableResource.java
a25e05342edd6c66ec3ea1d46039b25060b9eebb
[ "Apache-2.0" ]
permissive
ayush/atmosphere
45718ef9985a6b91938054a485bd125fadf877b3
0170a39c2912d93619da3b581ae0c1a1afb9a550
refs/heads/master
2021-01-18T05:46:53.127856
2011-09-22T19:54:44
2011-09-22T19:54:44
2,443,239
0
0
null
null
null
null
UTF-8
Java
false
false
2,882
java
/* * Copyright 2011 Jeanfrancois Arcand * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package org.atmosphere.jersey; import org.atmosphere.cpr.Trackable; /** * Associate any kind of resource to a @Suspend operation. When returning a {@link TrackableResource} from a method * annotated with the suspend annotation, the atmosphere framework will automatically add the X-Atmosphere-tracking-id * header to the response. The header can later be used for injecting {@link TrackableResource}. As simple as * <blockquote><pre> @GET @Suspend public TrackableResource suspend(){ return new TrackableResource(AtmosphereResource.class, "abcdef", Response.OK()); } @POST public String asyncBroadcast(@HeaderParam("X-Atmosphere-tracking-id") TrackableResource<AtmosphereResource> track) { AtmosphereResource<?,?> r = track.resource(); ... } * </blockquote><pre> * @param <T> */ public class TrackableResource<T extends Trackable> { public static final String TRACKING_HEADER = "X-Atmosphere-tracking-id"; private final Class<T> type; private T resource; private final String trackingID; private final Object entity; public TrackableResource(Class<T> type, String trackingID, Object entity) { this.type = type; this.trackingID = trackingID; this.entity = entity; } protected void setResource(Trackable resource) { if (!type.isAssignableFrom(resource.getClass())) { throw new IllegalStateException(String.format("Unassignable %s to %s", type.toString(), resource.getClass().toString())); } this.resource = type.cast(resource); } /** * Return the associated resource of type T * @return the associated resource of type T */ public T resource() { return resource; } /** * Retunr the class's type. * @return */ public Class<T> type() { return type; } /** * Return the trackingID token associated with the resource. * @return the trackingID token associated with the resource. */ public String trackingID() { return trackingID; } /** * Return the Entity associated with the resource. * @return the Entity associated with the resource. */ public Object entity() { return entity; } }
[ "jfarcand@apache.org" ]
jfarcand@apache.org
e7097bbedd252e5ead1659ce92ad3a4a1e252498
71f0e19b49a65c9a43cb4a17c887d3f4fd9f3459
/com/badlogic/gdx/graphics/g3d/particles/renderers/BillboardRenderer.java
9967b4ff35eafb1aa0335d05f932d45fc9091f26
[]
no_license
taleslopesramos/hotline-zombies
c1f12d1fb5f103e0b19f4f16a53b4eef9c49fb1d
710de579514876d64d31792ba3943398a68aa1c5
refs/heads/master
2020-05-04T19:10:22.211533
2019-04-04T01:51:13
2019-04-04T01:51:13
179,381,599
1
0
null
null
null
null
UTF-8
Java
false
false
2,454
java
/* * Decompiled with CFR 0_122. */ package com.badlogic.gdx.graphics.g3d.particles.renderers; import com.badlogic.gdx.graphics.g3d.particles.ParallelArray; import com.badlogic.gdx.graphics.g3d.particles.ParticleChannels; import com.badlogic.gdx.graphics.g3d.particles.ParticleController; import com.badlogic.gdx.graphics.g3d.particles.ParticleControllerComponent; import com.badlogic.gdx.graphics.g3d.particles.batches.BillboardParticleBatch; import com.badlogic.gdx.graphics.g3d.particles.batches.ParticleBatch; import com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData; import com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerRenderData; import com.badlogic.gdx.graphics.g3d.particles.renderers.ParticleControllerRenderer; public class BillboardRenderer extends ParticleControllerRenderer<BillboardControllerRenderData, BillboardParticleBatch> { public BillboardRenderer() { super(new BillboardControllerRenderData()); } public BillboardRenderer(BillboardParticleBatch batch) { this(); this.setBatch(batch); } @Override public void allocateChannels() { ((BillboardControllerRenderData)this.renderData).positionChannel = (ParallelArray.FloatChannel)this.controller.particles.addChannel(ParticleChannels.Position); ((BillboardControllerRenderData)this.renderData).regionChannel = (ParallelArray.FloatChannel)this.controller.particles.addChannel(ParticleChannels.TextureRegion, ParticleChannels.TextureRegionInitializer.get()); ((BillboardControllerRenderData)this.renderData).colorChannel = (ParallelArray.FloatChannel)this.controller.particles.addChannel(ParticleChannels.Color, ParticleChannels.ColorInitializer.get()); ((BillboardControllerRenderData)this.renderData).scaleChannel = (ParallelArray.FloatChannel)this.controller.particles.addChannel(ParticleChannels.Scale, ParticleChannels.ScaleInitializer.get()); ((BillboardControllerRenderData)this.renderData).rotationChannel = (ParallelArray.FloatChannel)this.controller.particles.addChannel(ParticleChannels.Rotation2D, ParticleChannels.Rotation2dInitializer.get()); } @Override public ParticleControllerComponent copy() { return new BillboardRenderer((BillboardParticleBatch)this.batch); } @Override public boolean isCompatible(ParticleBatch<?> batch) { return batch instanceof BillboardParticleBatch; } }
[ "eduhdm0105@gmail.com" ]
eduhdm0105@gmail.com
e1b5203ae952fba41d9429aae8b19b2da879baff
827bf064e482700d7ded2cd0a3147cb9657db883
/AndroidPOS/src/com/google/android/gms/games/request/GameRequest.java
182642aeca6498a75a510e3974c18f5d64df87a8
[]
no_license
cody0117/LearnAndroid
d30b743029f26568ccc6dda4313a9d3b70224bb6
02fd4d2829a0af8a1706507af4b626783524813e
refs/heads/master
2021-01-21T21:10:18.553646
2017-02-12T08:43:24
2017-02-12T08:43:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
788
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.google.android.gms.games.request; import android.os.Parcelable; import com.google.android.gms.common.data.d; import com.google.android.gms.games.Game; import com.google.android.gms.games.Player; import java.util.List; public interface GameRequest extends Parcelable, d { public abstract int a_(String s); public abstract String d(); public abstract Game e(); public abstract Player f(); public abstract byte[] g(); public abstract int h(); public abstract long i(); public abstract long j(); public abstract int k(); public abstract List l(); }
[ "em3888@gmail.com" ]
em3888@gmail.com
35763ad19e09ccd9f0006d0ed7c0c2e8a1b0b47b
41f79b1c6ef0c793914d99a55b3805f39e3ea8e3
/src/org/broad/igv/ui/util/ReorderableJList.java
6445fb275617a9b0e72a8b54d009290cdee6986c
[ "MIT", "LGPL-2.1-or-later", "LGPL-2.1-only" ]
permissive
nrgene/NRGene-IGV
35bf50a07341ff0bf26eabbea55d10e8fa9fcdd0
4ac9ffcd6f9fcbe318e9e85d9820783afbabf5fc
refs/heads/master
2023-09-02T12:48:20.171109
2021-02-03T10:26:44
2021-02-03T10:26:44
162,590,091
2
1
MIT
2023-08-16T11:47:31
2018-12-20T14:26:46
Java
UTF-8
Java
false
false
5,689
java
/* * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. * * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. * * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. */ package org.broad.igv.ui.util; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DragGestureEvent; import java.awt.dnd.DragGestureListener; import java.awt.dnd.DragGestureRecognizer; import java.awt.dnd.DragSource; import java.awt.dnd.DragSourceDragEvent; import java.awt.dnd.DragSourceDropEvent; import java.awt.dnd.DragSourceEvent; import java.awt.dnd.DragSourceListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; import javax.swing.DefaultListModel; import javax.swing.DropMode; import javax.swing.JDialog; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.TransferHandler; public class ReorderableJList<T> extends JList { DefaultListModel model; public ReorderableJList() { setTransferHandler(new MyListDropHandler()); new MyDragListener(this); } public void setElements(List<T> elements) { model = new DefaultListModel(); setModel(model); setDragEnabled(true); setDropMode(DropMode.INSERT); for (T obj : elements) { model.addElement(obj); } } public List<T> getElements() { List<T> elementList = new ArrayList<T>(); Enumeration en = model.elements(); if (en != null) { while (en.hasMoreElements()) { elementList.add((T) en.nextElement()); } } return elementList; } class MyDragListener implements DragSourceListener, DragGestureListener { ReorderableJList list; DragSource ds = new DragSource(); public MyDragListener(ReorderableJList list) { this.list = list; DragGestureRecognizer dgr = ds.createDefaultDragGestureRecognizer(list, DnDConstants.ACTION_MOVE, this); } public void dragGestureRecognized(DragGestureEvent dge) { StringSelection transferable = new StringSelection(Integer.toString(list.getSelectedIndex())); ds.startDrag(dge, DragSource.DefaultCopyDrop, transferable, this); } public void dragEnter(DragSourceDragEvent dsde) { } public void dragExit(DragSourceEvent dse) { } public void dragOver(DragSourceDragEvent dsde) { } public void dragDropEnd(DragSourceDropEvent dsde) { if (dsde.getDropSuccess()) { //System.out.println("Succeeded"); } else { //System.out.println("Failed"); } } public void dropActionChanged(DragSourceDragEvent dsde) { } } class MyListDropHandler extends TransferHandler { public boolean canImport(TransferHandler.TransferSupport support) { if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) { return false; } JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); if (dl.getIndex() == -1) { return false; } else { return true; } } public boolean importData(TransferHandler.TransferSupport support) { if (!canImport(support)) { return false; } Transferable transferable = support.getTransferable(); String indexString; try { indexString = (String) transferable.getTransferData(DataFlavor.stringFlavor); } catch (Exception e) { return false; } int fromIndex = Integer.parseInt(indexString); JList.DropLocation dl = (JList.DropLocation) support.getDropLocation(); int toIndex = dl.getIndex(); if (fromIndex < toIndex) { toIndex--; } Object obj = model.remove(fromIndex); model.add(toIndex, obj); invalidate(); return true; } } // Example public static void main(String[] a) { List<String> list = Arrays.asList("a", "b", "c"); JDialog f = new JDialog(); f.setModal(true); final ReorderableJList<String> roList = new ReorderableJList<String>(); roList.setElements(list); f.add(new JScrollPane(roList)); f.setSize(300, 300); f.setVisible(true); for (String s : roList.getElements()) { System.out.println(s); } } }
[ "kiril@ubuntu.nrgene.local" ]
kiril@ubuntu.nrgene.local
f13f96dafffc64ec34adefe7b17d4bad689f2a25
3c6728230582df15cde51e06e3fd67b69ab76b5e
/BackEnd/src/main/java/edu/agh/fis/core/instrument/details/services/InstrumentDefinitionService.java
9da956e5a20d10624a5d1e9261dbc2192df6a5c9
[]
no_license
wemstar/PracaInzynierska
c91285c5029d09031bb60c82701c785096767ccb
96924a73da919e5b3839e6b25903066ffeb910af
refs/heads/master
2021-01-23T12:06:09.831825
2015-01-21T23:48:49
2015-01-21T23:48:50
23,556,187
0
0
null
2014-09-06T01:02:17
2014-09-01T21:24:45
Java
UTF-8
Java
false
false
512
java
package edu.agh.fis.core.instrument.details.services; import edu.agh.fis.entity.instrument.details.InstrumentDefinition; /** * Logika biznesowa przetwarzające definicję instrumentów */ public interface InstrumentDefinitionService { InstrumentDefinition getInstrumentInfo(String isin); InstrumentDefinition createInstrumentDetails(InstrumentDefinition instrumentDefinition); void updateInstrumentInfo(InstrumentDefinition instrumentDefinition); void deleteInstrumentInfo(String isin); }
[ "sylwestermacura@gmail.com" ]
sylwestermacura@gmail.com
03ccfdcc29196c381459d82de3cdffe83d4a42b2
1a3073840ac16e160ff6f351b77d4658b5ce8bc7
/components/camel-consul/src/main/java/org/apache/camel/component/consul/enpoint/ConsulKeyValueConsumer.java
09804aff8c65a8ac6c8f143f5dda12131da5306c
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-unknown", "Apache-2.0" ]
permissive
fastfishio/camel
84d5f4af6a71398cdb64d8a5aa5a9ef38bd51a29
0e20f47645becc2eb72a97b8564546dfe218ff2e
refs/heads/master
2021-09-14T22:53:17.000689
2020-12-21T16:41:48
2020-12-21T16:41:48
81,466,332
0
0
Apache-2.0
2021-06-28T13:22:51
2017-02-09T15:47:24
Java
UTF-8
Java
false
false
5,089
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.camel.component.consul.enpoint; import java.util.List; import com.google.common.base.Optional; import com.orbitz.consul.KeyValueClient; import com.orbitz.consul.async.ConsulResponseCallback; import com.orbitz.consul.model.ConsulResponse; import com.orbitz.consul.model.kv.Value; import com.orbitz.consul.option.QueryOptions; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; import org.apache.camel.component.consul.AbstractConsulConsumer; import org.apache.camel.component.consul.ConsulConfiguration; import org.apache.camel.component.consul.ConsulConstants; import org.apache.camel.component.consul.ConsulEndpoint; public class ConsulKeyValueConsumer extends AbstractConsulConsumer<KeyValueClient> { public ConsulKeyValueConsumer(ConsulEndpoint endpoint, ConsulConfiguration configuration, Processor processor) { super(endpoint, configuration, processor, c -> c.keyValueClient()); } @Override protected Runnable createWatcher(KeyValueClient client) throws Exception { return configuration.isRecursive() ? new RecursivePathWatcher(client) : new PathWatcher(client); } // ************************************************************************* // Watch // ************************************************************************* private abstract class AbstractPathWatcher<T> extends AbstractWatcher implements ConsulResponseCallback<T> { protected AbstractPathWatcher(KeyValueClient client) { super(client); } protected QueryOptions queryOptions() { return QueryOptions.blockSeconds(configuration.getBlockSeconds(), index.get()).build(); } @Override public void onComplete(ConsulResponse<T> consulResponse) { if (isRunAllowed()) { onResponse(consulResponse.getResponse()); setIndex(consulResponse.getIndex()); watch(); } } @Override public void onFailure(Throwable throwable) { onError(throwable); } protected void onValue(Value value) { final Exchange exchange = endpoint.createExchange(); final Message message = exchange.getIn(); message.setHeader(ConsulConstants.CONSUL_KEY, value.getKey()); message.setHeader(ConsulConstants.CONSUL_RESULT, true); message.setHeader(ConsulConstants.CONSUL_FLAGS, value.getFlags()); message.setHeader(ConsulConstants.CONSUL_CREATE_INDEX, value.getCreateIndex()); message.setHeader(ConsulConstants.CONSUL_LOCK_INDEX, value.getLockIndex()); message.setHeader(ConsulConstants.CONSUL_MODIFY_INDEX, value.getModifyIndex()); if (value.getSession().isPresent()) { message.setHeader(ConsulConstants.CONSUL_SESSION, value.getSession().get()); } message.setBody(configuration.isValueAsString() ? value.getValueAsString().orNull() : value.getValue().orNull()); try { getProcessor().process(exchange); } catch (Exception e) { getExceptionHandler().handleException("Error processing exchange", exchange, e); } } protected abstract void onResponse(T consulResponse); } private class PathWatcher extends AbstractPathWatcher<Optional<Value>> { PathWatcher(KeyValueClient client) { super(client); } @Override public void watch(KeyValueClient client) { client.getValue(key, queryOptions(), this); } @Override public void onResponse(Optional<Value> value) { if (value.isPresent()) { onValue(value.get()); } } } private class RecursivePathWatcher extends AbstractPathWatcher<List<Value>> { RecursivePathWatcher(KeyValueClient client) { super(client); } @Override public void watch(KeyValueClient client) { client.getValues(key, queryOptions(), this); } @Override public void onResponse(List<Value> values) { values.forEach(this::onValue); } } }
[ "lburgazzoli@gmail.com" ]
lburgazzoli@gmail.com
e8134b4802fa860b42c540ded134b39af02d3eda
206483278d50303f98fa8e837d14cc20005af5eb
/src/main/java/com/wl/DAO/ComplementDAO.java
a0d38347947c81ec9f9edfbae8fac22ff820e68d
[]
no_license
438483836/Per
040cb724d987fd2cd658f55856b8f7838a7ca2de
1146367b922cdfd8ad593a941d243deeeba4d3c3
refs/heads/master
2020-03-20T17:21:05.678483
2018-08-10T05:38:49
2018-08-10T05:38:49
137,557,498
0
0
null
null
null
null
UTF-8
Java
false
false
292
java
package com.wl.dao; import com.wl.entity.Complement; /** * Created by Vincent on 2018-06-19. */ public interface ComplementDAO { public int save(Complement complement); public int saveSlogan(String barCode, String slogan); public Complement getByBarcode(String barCode); }
[ "438483836@qq.com" ]
438483836@qq.com
5aa0849afae774fdf90292065fe8cea6ec9193ad
6d0e080c2de5625f276f74214e5ec5c654ec8b18
/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/module/GrpcModuleLifeCycle.java
3cb8734d335727776aff587af6e54761b64c9d33
[ "DOC", "LicenseRef-scancode-free-unknown", "CC0-1.0", "OFL-1.1", "GPL-1.0-or-later", "CC-PDDC", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference", "MITNFA", "MIT", "CC-BY-4.0", "OFL-1.0" ]
permissive
qingyuan1232/pinpoint
13daf94815a6f49b1f7fe5a543279aaa33890d05
ff689f1fa0589bd7469c78bc5dab08089c1098a3
refs/heads/master
2020-04-07T15:51:46.699662
2019-04-18T08:21:15
2019-04-18T08:21:15
158,504,370
1
0
Apache-2.0
2019-04-18T08:22:14
2018-11-21T06:56:50
Java
UTF-8
Java
false
false
5,984
java
/* * Copyright 2019 NAVER Corp. * * 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.navercorp.pinpoint.profiler.context.module; import com.google.inject.Inject; import com.google.inject.Provider; import com.navercorp.pinpoint.bootstrap.logging.PLogger; import com.navercorp.pinpoint.bootstrap.logging.PLoggerFactory; import com.navercorp.pinpoint.common.util.Assert; import com.navercorp.pinpoint.profiler.receiver.CommandDispatcher; import com.navercorp.pinpoint.profiler.sender.DataSender; import com.navercorp.pinpoint.profiler.sender.EnhancedDataSender; import com.navercorp.pinpoint.rpc.client.PinpointClientFactory; import java.util.concurrent.ExecutorService; /** * @author Woonduk Kang(emeroad) */ public class GrpcModuleLifeCycle implements ModuleLifeCycle { private final PLogger logger = PLoggerFactory.getLogger(this.getClass()); private final Provider<CommandDispatcher> commandDispatcherProvider; private final Provider<PinpointClientFactory> clientFactoryProvider; private final Provider<EnhancedDataSender<Object>> tcpDataSenderProvider; private final Provider<PinpointClientFactory> spanStatClientFactoryProvider; private final Provider<DataSender> spanDataSenderProvider; private final Provider<DataSender> statDataSenderProvider; private final Provider<ExecutorService> dnsExecutorServiceProvider; private CommandDispatcher commandDispatcher; private PinpointClientFactory clientFactory; private EnhancedDataSender<Object> tcpDataSender; private PinpointClientFactory spanStatClientFactory; private DataSender spanDataSender; private DataSender statDataSender; private ExecutorService dnsExecutorService; @Inject public GrpcModuleLifeCycle( Provider<CommandDispatcher> commandDispatcherProvider, @DefaultClientFactory Provider<PinpointClientFactory> clientFactoryProvider, Provider<EnhancedDataSender<Object>> tcpDataSenderProvider, @SpanStatClientFactory Provider<PinpointClientFactory> spanStatClientFactoryProvider, @SpanDataSender Provider<DataSender> spanDataSenderProvider, @StatDataSender Provider<DataSender> statDataSenderProvider, Provider<ExecutorService> dnsExecutorServiceProvider ) { this.commandDispatcherProvider = Assert.requireNonNull(commandDispatcherProvider, "commandDispatcherProvider must not be null"); this.clientFactoryProvider = Assert.requireNonNull(clientFactoryProvider, "clientFactoryProvider must not be null"); this.tcpDataSenderProvider = Assert.requireNonNull(tcpDataSenderProvider, "tcpDataSenderProvider must not be null"); this.spanStatClientFactoryProvider = Assert.requireNonNull(spanStatClientFactoryProvider, "spanStatClientFactoryProvider must not be null"); this.spanDataSenderProvider = Assert.requireNonNull(spanDataSenderProvider, "spanDataSenderProvider must not be null"); this.statDataSenderProvider = Assert.requireNonNull(statDataSenderProvider, "statDataSenderProvider must not be null"); this.dnsExecutorServiceProvider = Assert.requireNonNull(dnsExecutorServiceProvider, "dnsExecutorServiceProvider must not be null"); } @Override public void start() { logger.info("start()"); this.commandDispatcher = this.commandDispatcherProvider.get(); logger.info("commandDispatcher:{}", commandDispatcher); this.clientFactory = clientFactoryProvider.get(); logger.info("pinpointClientFactory:{}", clientFactory); this.tcpDataSender = tcpDataSenderProvider.get(); logger.info("tcpDataSenderProvider:{}", tcpDataSender); this.spanStatClientFactory = spanStatClientFactoryProvider.get(); logger.info("spanStatClientFactory:{}", spanStatClientFactory); this.spanDataSender = spanDataSenderProvider.get(); logger.info("spanDataSenderProvider:{}", spanDataSender); this.statDataSender = this.statDataSenderProvider.get(); logger.info("statDataSenderProvider:{}", statDataSender); this.dnsExecutorService = dnsExecutorServiceProvider.get(); } @Override public void shutdown() { logger.info("shutdown()"); if (spanDataSender != null) { this.spanDataSender.stop(); } if (statDataSender != null) { this.statDataSender.stop(); } if (spanStatClientFactory != null) { this.spanStatClientFactory.release(); } if (tcpDataSender != null) { this.tcpDataSender.stop(); } if (clientFactory != null) { clientFactory.release(); } if (commandDispatcher != null) { this.commandDispatcher.close(); } if (dnsExecutorService != null) { this.dnsExecutorService.shutdown(); } } @Override public String toString() { return "GrpcModuleLifeCycle{" + ", commandDispatcherProvider=" + commandDispatcherProvider + ", clientFactoryProvider=" + clientFactoryProvider + ", tcpDataSenderProvider=" + tcpDataSenderProvider + ", spanStatClientFactoryProvider=" + spanStatClientFactoryProvider + ", spanDataSenderProvider=" + spanDataSenderProvider + ", statDataSenderProvider=" + statDataSenderProvider + '}'; } }
[ "wd.kang@navercorp.com" ]
wd.kang@navercorp.com
d0708c0d7ebaa73174093f11126d54c032aa909a
129f58086770fc74c171e9c1edfd63b4257210f3
/src/testcases/CWE369_Divide_by_Zero/CWE369_Divide_by_Zero__int_zero_modulo_72a.java
83c0f5e3ca4270acee77800a759de8def05bdf06
[]
no_license
glopezGitHub/Android23
1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba
6215d0684c4fbdc7217ccfbedfccfca69824cc5e
refs/heads/master
2023-03-07T15:14:59.447795
2023-02-06T13:59:49
2023-02-06T13:59:49
6,856,387
0
3
null
2023-02-06T18:38:17
2012-11-25T22:04:23
Java
UTF-8
Java
false
false
2,794
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE369_Divide_by_Zero__int_zero_modulo_72a.java Label Definition File: CWE369_Divide_by_Zero__int.label.xml Template File: sources-sinks-72a.tmpl.java */ /* * @description * CWE: 369 Divide by zero * BadSource: zero Set data to a hardcoded value of zero * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: modulo * GoodSink: Check for zero before modulo * BadSink : Modulo by a value that may be zero * Flow Variant: 72 Data flow: data passed in a Vector from one method to another in different source files in the same package * * */ package testcases.CWE369_Divide_by_Zero; import testcasesupport.*; import java.util.Vector; import java.sql.*; import javax.servlet.http.*; import java.security.SecureRandom; public class CWE369_Divide_by_Zero__int_zero_modulo_72a extends AbstractTestCase { public void bad() throws Throwable { int data; data = 0; /* POTENTIAL FLAW: data is set to zero */ Vector<Integer> data_vector = new Vector<Integer>(5); data_vector.add(0, data); data_vector.add(1, data); data_vector.add(2, data); (new CWE369_Divide_by_Zero__int_zero_modulo_72b()).bad_sink(data_vector ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; Vector<Integer> data_vector = new Vector<Integer>(5); data_vector.add(0, data); data_vector.add(1, data); data_vector.add(2, data); (new CWE369_Divide_by_Zero__int_zero_modulo_72b()).goodG2B_sink(data_vector ); } /* goodB2G() - use BadSource and GoodSink */ private void goodB2G() throws Throwable { int data; data = 0; /* POTENTIAL FLAW: data is set to zero */ Vector<Integer> data_vector = new Vector<Integer>(5); data_vector.add(0, data); data_vector.add(1, data); data_vector.add(2, data); (new CWE369_Divide_by_Zero__int_zero_modulo_72b()).goodB2G_sink(data_vector ); } /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "guillermo.pando@gmail.com" ]
guillermo.pando@gmail.com
e7170b2912af53883a38d46bf9d56fa0ea126ac3
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mapsdk/internal/ei.java
ccd9c380129128fde2eb9385490d2e3696899d9c
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
1,900
java
package com.tencent.mapsdk.internal; public final class ei { public static final String A = "mapStyleList"; public static final String B = "AIEnabled"; public static final String C = "AIType"; public static final String D = "AIBuildingList"; public static final String a = "mapConfigVersion"; public static final String b = "mapConfigLastCheckTime"; public static final String c = "poiIconVersion"; public static final String d = "mapIconVersion"; public static final String e = "sdkVersion"; public static final String f = "mapConfigStyle"; public static final String g = "worldMapConfig"; public static final String h = "worldMapEnabled"; public static final String i = "worldMapStyle"; public static final String j = "worldMapScene"; public static final String k = "worldMapVersion"; public static final String l = "worldMapFrontierVersion"; public static final String m = "worldMapProtocolVersion"; public static final String n = "worldMapTileUrlRegex"; public static final String o = "worldMapTileUrlRangeJson"; public static final String p = "worldMapLogoChangeRuleJson"; public static final String q = "mapConfigIndoorVersion"; public static final String r = "mapConfigIndoorPremiumVersion"; public static final String s = "mapPoiIcon3dIndoorVersion"; public static final String t = "mapConfigZipMd5"; public static final String u = "mapPoiIconZipMd5"; public static final String v = "mapIconZipMd5"; public static final String w = "mapConfigIndoorMd5"; public static final String x = "mapConfigIndoorPremiumMd5"; public static final String y = "poiIcon3dIndoorMd5"; public static final String z = "handDrawMapVer"; } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mapsdk.internal.ei * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
f8b33c689f27da8c89d05bf1fe0bdeded45b7b92
3bc15fa92f9a7336e855a32f8b16173dd916713c
/mobile-api/src/main/java/com/shangpin/wireless/api/util/Header.java
660baa9215a7557a6f4e58f706c1c860f65f1b7f
[]
no_license
cenbow/2016_sp_mobile
36018bea8154b9deaf9d15dbf1b4e2ec90eb1191
5edb6203a5cf4352db7c051f3fd1ef12ccada32c
refs/heads/master
2020-04-06T04:44:14.075549
2016-06-15T05:19:25
2016-06-15T05:19:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,430
java
package com.shangpin.wireless.api.util; import java.io.Serializable; import net.sf.json.JSONObject; public class Header implements Serializable { /** * */ private static final long serialVersionUID = 8587179139357321718L; private String imei; private String os;// 手机平台:ios、android private String osv;// 系统版本 private String productNum;// 产品号 private String channelNum;// 渠道号 private String ver;// 版本号 private String apn;// 接入点(普通、3g) private String wh;// 屏幕宽高640x960 private String mt;// 手机类型(gsm,cdma) private String model; // 手机型号(iPhone 4S) private String operator;// 运营商(移动、联通) private String ua;// UA(wap网站所用字段) public Header(String str, String type) { if ("iphone".equals(type)) { String[] split = str.split(","); this.imei = split[0] == null || "".equals(split[0]) || "#".equals(split[0]) ? null : split[0]; this.os = split[1] == null || "".equals(split[1]) || "#".equals(split[1]) ? null : split[1]; this.osv = split[2] == null || "".equals(split[2]) || "#".equals(split[2]) ? null : split[2]; this.productNum = split[3] == null || "".equals(split[3]) || "#".equals(split[3]) ? null : split[3]; this.channelNum = split[4] == null || "".equals(split[4]) || "#".equals(split[4]) ? null : split[4]; this.ver = split[5] == null || "".equals(split[5]) || "#".equals(split[5]) ? null : split[5]; this.apn = split[6] == null || "".equals(split[6]) || "#".equals(split[6]) ? null : split[6]; this.wh = split[7] == null || "".equals(split[7]) || "#".equals(split[7]) ? null : split[7]; this.mt = split[8] == null || "".equals(split[8]) || "#".equals(split[8]) ? null : split[8]; this.model = split[9] == null || "".equals(split[9]) || "#".equals(split[9]) ? null : split[9]; if (split.length > 10) this.operator = split[10] == null || "".equals(split[10]) || "#".equals(split[10]) ? null : split[10]; } else if ("wap".equals(type)) { String[] split = str.split("%"); this.imei = split[0] == null || "".equals(split[0]) || "#".equals(split[0]) ? null : split[0]; this.os = split[1] == null || "".equals(split[1]) || "#".equals(split[1]) ? null : split[1]; this.osv = split[2] == null || "".equals(split[2]) || "#".equals(split[2]) ? null : split[2]; this.productNum = split[3] == null || "".equals(split[3]) || "#".equals(split[3]) ? null : split[3]; this.channelNum = split[4] == null || "".equals(split[4]) || "#".equals(split[4]) ? null : split[4]; this.ver = split[5] == null || "".equals(split[5]) || "#".equals(split[5]) ? null : split[5]; this.apn = split[6] == null || "".equals(split[6]) || "#".equals(split[6]) ? null : split[6]; this.wh = split[7] == null || "".equals(split[7]) || "#".equals(split[7]) ? null : split[7]; this.mt = split[8] == null || "".equals(split[8]) || "#".equals(split[8]) ? null : split[8]; this.model = split[9] == null || "".equals(split[9]) || "#".equals(split[9]) ? null : split[9]; this.operator = split[10] == null || "".equals(split[10]) || "#".equals(split[10]) ? null : split[10]; this.ua = split[11] == null || "".equals(split[11]) || "#".equals(split[11]) ? null : split[11]; } } public Header(String imei, String os, String osv, String productNum, String channelNum, String ver, String apn, String wh, String mt, String model, String operator, String ua) { super(); this.imei = imei; this.os = os; this.osv = osv; this.productNum = productNum; this.channelNum = channelNum; this.ver = ver; this.apn = apn; this.wh = wh; this.mt = mt; this.model = model; this.operator = operator; this.ua = ua; } public String getImei() { return imei; } public void setImei(String imei) { this.imei = imei; } public String getOs() { return os; } public void setOs(String os) { this.os = os; } public String getOsv() { return osv; } public void setOsv(String osv) { this.osv = osv; } public String getProductNum() { return productNum; } public void setProductNum(String productNum) { this.productNum = productNum; } public String getChannelNum() { return channelNum; } public void setChannelNum(String channelNum) { this.channelNum = channelNum; } public String getVer() { return ver; } public void setVer(String ver) { this.ver = ver; } public String getApn() { return apn; } public void setApn(String apn) { this.apn = apn; } public String getWh() { return wh; } public void setWh(String wh) { this.wh = wh; } public String getMt() { return mt; } public void setMt(String mt) { this.mt = mt; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public String getOperator() { return operator; } public void setOperator(String operator) { this.operator = operator; } public String getUa() { return ua; } public void setUa(String ua) { this.ua = ua; } @Override public String toString() { JSONObject json = new JSONObject(); json.put("imei", imei); json.put("os", os); json.put("osv", osv); json.put("productNum", productNum); json.put("channelNum", channelNum); json.put("ver", ver); json.put("apn", apn); json.put("wh", wh); json.put("mt", mt); json.put("model", model); json.put("operator", operator); json.put("ua", ua); return json.toString(); } }
[ "fengwenyu@shangpin.com" ]
fengwenyu@shangpin.com
5f00c65278aa10f03a30fdd2def7d7c7d72f3416
ad5b413a63b49a9d3358949958dd0c44ecebe655
/src/main/java/truckmanagementproject/data/models/trips/Trip.java
0321461ff6581130abcdd0207e138d2db281dd50
[]
no_license
alexurumov/TruckProjectRepo
eff30f644d0d99f4837b245f435e1519889f0efb
6d330f81a53d7fb8f34b8f12a11152ba781298f8
refs/heads/master
2021-10-29T07:55:29.661864
2021-10-13T13:07:45
2021-10-13T13:07:45
220,982,249
0
0
null
null
null
null
UTF-8
Java
false
false
2,165
java
package truckmanagementproject.data.models.trips; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import truckmanagementproject.data.models.BaseEntity; import truckmanagementproject.data.models.documents.TripDocument; import truckmanagementproject.data.models.expenses.Expense; import truckmanagementproject.data.models.expenses.TripExpense; import truckmanagementproject.data.models.milestones.Milestone; import truckmanagementproject.data.models.users.Driver; import truckmanagementproject.data.models.vehicles.Vehicle; import javax.persistence.*; import javax.transaction.Transactional; import java.math.BigDecimal; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "trips") @Getter @Setter @NoArgsConstructor @AllArgsConstructor public class Trip extends BaseEntity { @Column(name = "date", nullable = false) private LocalDate date; @Column(name = "direction", nullable = false) private String direction; @Column(name = "reference", nullable = false, unique = true) private String reference; @Column(name = "empty_km") private Integer emptyKm = 0; @Column(name = "trip_km") private Integer tripKm = 0; @Column(name = "adr", nullable = false) private Boolean adr = false; @Column(name = "empty_pallets") private Integer emptyPallets = 0; @Column(name = "is_finished", nullable = false) private Boolean isFinished = false; @ManyToOne(optional = false) @JoinColumn(name = "driver_id", referencedColumnName = "id") private Driver driver; @ManyToOne(optional = false) @JoinColumn(name = "vehicle_id", referencedColumnName = "id") private Vehicle vehicle; @OneToMany(mappedBy = "trip", cascade = CascadeType.ALL) private List<Milestone> milestones = new ArrayList<>(); @OneToMany(mappedBy = "trip", fetch = FetchType.EAGER, cascade = CascadeType.ALL) private List<TripExpense> expenses = new ArrayList<>(); @OneToMany(mappedBy = "trip", cascade = CascadeType.ALL) private List<TripDocument> documents = new ArrayList<>(); }
[ "alex.urumov@gmail.com" ]
alex.urumov@gmail.com
2ca9b84f70dcf586c52ed06d9210b1f35d59913a
4fd34cca7eb20cfde03e5008d9a447d39983680c
/drone-qunit-integration/src/main/java/org/jboss/arquillian/drone/qunit/QUnitExecutionException.java
8dde81e1473d3edb8c9ece37bd230dd785b69be9
[]
no_license
kpiwko/blog
3c1eca0e90d3dc9129b2c5d2a5c379f92551161a
ecb056c0cdc1fac46363abfd4d56a74430b4f9a4
refs/heads/master
2021-01-21T22:26:20.732439
2012-11-22T11:52:49
2012-11-22T11:52:49
2,284,731
2
0
null
null
null
null
UTF-8
Java
false
false
271
java
package org.jboss.arquillian.drone.qunit; public class QUnitExecutionException extends RuntimeException { /** * */ private static final long serialVersionUID = 1L; public QUnitExecutionException(String message) { super(message); } }
[ "kpiwko@redhat.com" ]
kpiwko@redhat.com
89739669cb6487038624646c266a6e0c31c3efe8
438a853bdbaa861332eb244e42026916d8992c16
/src/main/java/com/xpanxion/xiomate/initialzr/config/FeignConfiguration.java
cc08f452c7193bf5e7c87261a9283d96198da0cb
[]
no_license
rajeshi/xiomate-initializr
85e68666a0b06eb1c0aa02fb6e6752838a7a54f4
07b53768b8c8810152800459bfabd5a958b85bc1
refs/heads/master
2020-05-09T09:51:17.254466
2019-04-12T14:01:09
2019-04-12T14:01:09
181,019,312
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.xpanxion.xiomate.initialzr.config; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration @EnableFeignClients(basePackages = "com.xpanxion.xiomate.initialzr") public class FeignConfiguration { /** * Set the Feign specific log level to log client REST requests */ @Bean feign.Logger.Level feignLoggerLevel() { return feign.Logger.Level.BASIC; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
dedd9a3949102c3c1ac4a51e15c11341c0e14ebc
fbd16739b5a5e476916fa22ddcd2157fafff82b9
/temp/src/minecraft_server/net/minecraft/block/BlockEndPortalFrame.java
439984801cdbce2556c4209d3065655bc17a580a
[]
no_license
CodeMajorGeek/lwjgl3-mcp908
6b49c80944ab87f1c863ff537417f53f16c643d5
2a6d28f2b7541b760ebb8e7a6dc905465f935a64
refs/heads/master
2020-06-18T19:53:49.089357
2019-07-14T13:14:06
2019-07-14T13:14:06
196,421,564
2
0
null
null
null
null
UTF-8
Java
false
false
2,412
java
package net.minecraft.block; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class BlockEndPortalFrame extends Block { private static final String __OBFID = "CL_00000237"; public BlockEndPortalFrame() { super(Material.field_151576_e); } public boolean func_149662_c() { return false; } public int func_149645_b() { return 26; } public void func_149683_g() { this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); } public void func_149743_a(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); super.func_149743_a(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); int var8 = p_149743_1_.func_72805_g(p_149743_2_, p_149743_3_, p_149743_4_); if(func_150020_b(var8)) { this.func_149676_a(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); super.func_149743_a(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); } this.func_149683_g(); } public static boolean func_150020_b(int p_150020_0_) { return (p_150020_0_ & 4) != 0; } public Item func_149650_a(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; } public void func_149689_a(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { int var7 = ((MathHelper.func_76128_c((double)(p_149689_5_.field_70177_z * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; p_149689_1_.func_72921_c(p_149689_2_, p_149689_3_, p_149689_4_, var7, 2); } public boolean func_149740_M() { return true; } public int func_149736_g(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) { int var6 = p_149736_1_.func_72805_g(p_149736_2_, p_149736_3_, p_149736_4_); return func_150020_b(var6)?15:0; } }
[ "37310498+CodeMajorGeek@users.noreply.github.com" ]
37310498+CodeMajorGeek@users.noreply.github.com
60eaa447206840ba81f7fc38427717b087dcaa05
8a786bbb5d8142eee67fd4cabe3dd352ede2c256
/src/com/anysoftkeyboard/dictionaries/Dictionary.java
fb0b26e44285184bc831095c2810146051368c17
[ "Apache-2.0" ]
permissive
debashismaitra/AnySoftKeyboard
6522401121a55c0ca73ec5b1518b5957f8ef1a29
6f51b8a9d02cf07eca2a63ae26be2a6029c3789d
refs/heads/master
2020-12-24T13:52:22.302353
2013-05-03T01:38:59
2013-05-03T01:38:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,752
java
/* * Copyright (c) 2013 Menny Even-Danan * * 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.anysoftkeyboard.dictionaries; import com.anysoftkeyboard.WordComposer; /** * Abstract base class for a dictionary that can do a fuzzy search for words based on a set of key * strokes. */ abstract public class Dictionary { /** * Whether or not to replicate the typed word in the suggested list, even if it's valid. */ protected static final boolean INCLUDE_TYPED_WORD_IF_VALID = false; /** * The weight to give to a word if it's length is the same as the number of typed characters. */ protected static final int FULL_WORD_FREQ_MULTIPLIER = 3; /** * The weight to give to a letter if it is typed. */ protected static final int TYPED_LETTER_MULTIPLIER = 3; /** * Interface to be implemented by classes requesting words to be fetched from the dictionary. * * @see #getWords(WordComposer, WordCallback) */ public interface WordCallback { /** * Adds a word to a list of suggestions. The word is expected to be ordered based on * the provided frequency. * * @param word the character array containing the word * @param wordOffset starting offset of the word in the character array * @param wordLength length of valid characters in the character array * @param frequency the frequency of occurence. This is normalized between 1 and 255, but * can exceed those limits * @return true if the word was added, false if no more words are required */ boolean addWord(char[] word, int wordOffset, int wordLength, int frequency); } protected final Object mResourceMonitor = new Object(); private final String mDictionaryName; private volatile boolean mClosed = false; protected Dictionary(String dictionaryName) { mDictionaryName = dictionaryName; } /** * Searches for words in the dictionary that match the characters in the composer. Matched * words are added through the callback object. * * @param composer the key sequence to match * @param callback the callback object to send matched words to as possible candidates * @see WordCallback#addWord(char[], int, int, int) */ abstract public void getWords(final WordComposer composer, final WordCallback callback); /** * Checks if the given word occurs in the dictionary * * @param word the word to search for. The search should be case-insensitive. * @return true if the word exists, false otherwise */ abstract public boolean isValidWord(CharSequence word); /** * Compares the contents of the character array with the typed word and returns true if they * are the same. * * @param word the array of characters that make up the word * @param length the number of valid characters in the character array * @param typedWord the word to compare with * @return true if they are the same, false otherwise. */ static protected final boolean same(final char[] word, final int length, final CharSequence typedWord) { if (typedWord.length() != length) { return false; } for (int i = 0; i < length; i++) { if (word[i] != typedWord.charAt(i)) { return false; } } return true; } public final void close() { if (mClosed) return; mClosed = true; synchronized (mResourceMonitor) { closeAllResources(); } } public final boolean isClosed() { return mClosed; } protected abstract void closeAllResources(); public final void loadDictionary() { if (mClosed) return; synchronized (mResourceMonitor) { if (mClosed) return; loadAllResources(); } } protected abstract void loadAllResources(); public final String getDictionaryName() { return mDictionaryName; } @Override public String toString() { return mDictionaryName; } }
[ "menny@evendanan.net" ]
menny@evendanan.net
1f621c0a3b6ec4f4fb92676d70f7cf0eb83ad9e6
993cae9edae998529d4ef06fc67e319d34ee83ef
/src/cn/edu/sau/javashop/plugin/standard/adjunct/GoodsAdjunctPlugin.java
b5d658ad7e09b76f2c7587bb469c5c82ef76e5cf
[]
no_license
zhangyuanqiao93/MySAUShop
77dfe4d46d8ac2a9de675a9df9ae29ca3cae1ef7
cc72727b2bc1148939666b0f1830ba522042b779
refs/heads/master
2021-01-25T05:02:20.602636
2017-08-03T01:06:43
2017-08-03T01:06:43
93,504,556
0
0
null
null
null
null
UTF-8
Java
false
false
5,693
java
package cn.edu.sau.javashop.plugin.standard.adjunct; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import cn.edu.sau.javashop.core.model.AdjunctItem; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import cn.edu.sau.eop.processor.core.freemarker.FreeMarkerPaser; import cn.edu.sau.framework.context.webcontext.ThreadContextHolder; import cn.edu.sau.javashop.core.model.GoodsAdjunct; import cn.edu.sau.javashop.core.plugin.goods.AbstractGoodsPlugin; import cn.edu.sau.javashop.core.service.IGoodsAdjunctManager; import cn.edu.sau.javashop.core.service.IProductManager; public class GoodsAdjunctPlugin extends AbstractGoodsPlugin { private IGoodsAdjunctManager goodsAdjunctManager; private IProductManager productManager; public void addTabs() { this.addTags(5, "配件"); } public String onFillGoodsAddInput(HttpServletRequest request) { FreeMarkerPaser freeMarkerPaser = FreeMarkerPaser.getInstance(); freeMarkerPaser.setPageName("adjunct"); return freeMarkerPaser.proessPageContent(); } public void onBeforeGoodsAdd(Map goods, HttpServletRequest request) { } public String onFillGoodsEditInput(Map goods, HttpServletRequest request) { FreeMarkerPaser freeMarkerPaser = FreeMarkerPaser.getInstance(); Integer goods_id = Integer.valueOf(goods.get("goods_id").toString()); List<Map> listGoodsAdjunct = goodsAdjunctManager.list(goods_id); for(Map map:listGoodsAdjunct){ String json = String.valueOf(map.get("items")); JSONArray jsonArray = JSONArray.fromObject(json); List<AdjunctItem> listAdjunctItem = new ArrayList<AdjunctItem>(); for (int i = 0; i < jsonArray.size(); i++) { Object o = jsonArray.get(i); JSONObject jsonObject = JSONObject.fromObject(o); AdjunctItem adjunctItem = (AdjunctItem) JSONObject.toBean(jsonObject, AdjunctItem.class ); listAdjunctItem.add(adjunctItem); } map.put("listAdjunctItem", listAdjunctItem); } freeMarkerPaser.putData("listGoodsAdjunct", listGoodsAdjunct); freeMarkerPaser.setPageName("adjunct"); return freeMarkerPaser.proessPageContent(); } public void onAfterGoodsAdd(Map goods, HttpServletRequest request) throws RuntimeException { save(goods); } public void onAfterGoodsEdit(Map goods, HttpServletRequest request) { save(goods); } private void save(Map goods){ if(goods.get("goods_id")==null) throw new RuntimeException("商品id不能为空"); Integer goodsId = Integer.valueOf(goods.get("goods_id").toString()); HttpServletRequest httpRequest =ThreadContextHolder.getHttpRequest(); String[] adjunct_name = httpRequest.getParameterValues("adjunct.adjunct_name"); String[] adjunct_minnum = httpRequest.getParameterValues("adjunct.min_num"); String[] adjunct_maxnum = httpRequest.getParameterValues("adjunct.max_num"); String[] adjunct_setprice = httpRequest.getParameterValues("pricetype"); String[] adjunct_price = httpRequest.getParameterValues("adjunct.price"); String[] manual = httpRequest.getParameterValues("complex.manual"); List<GoodsAdjunct> list = new ArrayList<GoodsAdjunct>(); if(adjunct_name!=null ){ for(int i=0;i<adjunct_name.length;i++){ String[] productids = httpRequest.getParameterValues("productid_" + i); GoodsAdjunct adjunct = new GoodsAdjunct(); adjunct.setGoods_id(goodsId); adjunct.setAdjunct_name(adjunct_name[i]); adjunct.setMin_num((adjunct_minnum[i] == null ? null : Integer.valueOf(adjunct_minnum[i]))); adjunct.setMax_num((adjunct_maxnum[i] == null ? null : Integer.valueOf(adjunct_maxnum[i]))); adjunct.setSet_price(adjunct_setprice[i]); adjunct.setPrice((adjunct_price[i] == null ? null : Double.valueOf(adjunct_price[i]))); adjunct.setItems( this.getItemJson(productids)); list.add(adjunct); } } goodsAdjunctManager.save(goodsId, list); } private String getItemJson(String[] productids){ Integer[] productidArray = new Integer[productids.length]; for(int i=0;i<productids.length;i++){ productidArray[i] = Integer.valueOf(productids[i]); } List<Map> proList = this.productManager.list(productidArray); List<AdjunctItem> itemList = new ArrayList<AdjunctItem>(); for(Map pro: proList){ Integer productid = Integer.valueOf(pro.get("product_id").toString() ); Integer goodsid = Integer.valueOf( pro.get("goods_id").toString()); String name = (String)pro.get("name"); String specs = (String)pro.get("specs"); Double price = Double.valueOf( pro.get("price").toString()); AdjunctItem adjunctItem = new AdjunctItem(); adjunctItem.setProductid(productid); adjunctItem.setGoodsid(goodsid); adjunctItem.setName(name); adjunctItem.setSpecs(specs); adjunctItem.setPrice(price); itemList.add(adjunctItem); } return JSONArray.fromObject(itemList).toString(); } public void onBeforeGoodsEdit(Map goods, HttpServletRequest request) { } public String getAuthor() { return "kingapex"; } public String getId() { return "goodsadjunct"; } public String getName() { return "商品配件"; } public String getType() { return ""; } public String getVersion() { return "1.0"; } public void perform(Object... params) { } public IGoodsAdjunctManager getGoodsAdjunctManager() { return goodsAdjunctManager; } public void setGoodsAdjunctManager(IGoodsAdjunctManager goodsAdjunctManager) { this.goodsAdjunctManager = goodsAdjunctManager; } public IProductManager getProductManager() { return productManager; } public void setProductManager(IProductManager productManager) { this.productManager = productManager; } }
[ "zhangyuanqiao0912@163.com" ]
zhangyuanqiao0912@163.com
922276e2d49bc1c19790969700973299254f7387
443c3933b58ed8841366b22e7d6b0da21e2a6b74
/src/de/dimm/vsm/vaadin/GuiElems/TablePanels/AccountConnectorTable.java
3ced5476adca01dc00e3c2e796d1eaac890498c2
[ "Apache-2.0" ]
permissive
markymarkmk2/VSMGui
ceaa06209fe9a7f3bb7eacaf98cb03ce35b65ca0
43e3e16b131865975c5574048155e12d9e757dd7
refs/heads/master
2020-06-09T15:47:31.679066
2017-01-03T12:30:36
2017-01-03T12:30:36
76,030,520
0
0
null
null
null
null
UTF-8
Java
false
false
5,708
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package de.dimm.vsm.vaadin.GuiElems.TablePanels; import com.vaadin.data.util.BeanItem; import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Component; import com.vaadin.ui.Label; import com.vaadin.ui.Table; import com.vaadin.ui.Table.ColumnGenerator; import com.vaadin.ui.TextField; import de.dimm.vsm.fsengine.GenericEntityManager; import de.dimm.vsm.records.AccountConnector; import de.dimm.vsm.vaadin.GuiElems.Fields.ColumnGeneratorField; import de.dimm.vsm.vaadin.GuiElems.Fields.JPAField; import de.dimm.vsm.vaadin.GuiElems.Fields.JPATextField; import de.dimm.vsm.vaadin.GuiElems.Table.BaseDataEditTable; import de.dimm.vsm.vaadin.VSMCMain; import java.util.ArrayList; import java.util.List; class JPAAccountConnectorField extends JPATextField<AccountConnector> implements ColumnGeneratorField { AccountConnectorColumnGenerator colgen; public JPAAccountConnectorField() { super("AccountConnector", "accountConnector"); } @Override public Component createGui(AccountConnector _node) { node = _node; TextField tf = new TextField(VSMCMain.Txt("AccountConnector")); tf.setValue( getNiceText(node) ); tf.setData(this); return tf; } // THIS IS CALLED WHEN OBJECT WAS CHANGED TO REFLECT CHANGES GENERATED COLUMN @Override public void update( BeanItem<AccountConnector> oldItem ) { AccountConnector job = oldItem.getBean(); if ( colgen != null ) { colgen.label.setValue(getNiceText(job)); } } public static String getNiceText(AccountConnector job) { StringBuilder sb = new StringBuilder(); sb.append(job.toString()); if ((job.getFlags() & AccountConnector.FL_DISABLED) == AccountConnector.FL_DISABLED) { sb.append(" (" + VSMCMain.Txt("Gesperrt")); sb.append(") "); } return sb.toString(); } @Override public ColumnGenerator getColumnGenerator() { colgen = new AccountConnectorColumnGenerator( this ); return colgen; } } class AccountConnectorColumnGenerator implements Table.ColumnGenerator { JPAAccountConnectorField field; /* Format string for the Double values. */ Label label; public AccountConnectorColumnGenerator(JPAAccountConnectorField fld) { this.field = fld; } /** * Generates the cell containing the value. * The column is irrelevant in this use case. */ @Override public Component generateCell(Table source, Object itemId, Object columnId) { BeanItem<AccountConnector> bi = (BeanItem)source.getItem(itemId); AccountConnector _a = bi.getBean(); String txt = JPAAccountConnectorField.getNiceText(_a); label = new Label(txt); return label; } } /** * * @author Administrator */ public class AccountConnectorTable extends BaseDataEditTable<AccountConnector> { private AccountConnectorTable( VSMCMain main, List<AccountConnector> _list, ArrayList<JPAField> _fieldList, ItemClickListener listener) { super(main, _list, AccountConnector.class, _fieldList, listener); } public static AccountConnectorTable createTable( VSMCMain main, List<AccountConnector> list, ItemClickListener listener) { ArrayList<JPAField> fieldList = new ArrayList<JPAField>(); fieldList.add(new JPAAccountConnectorField( )); AccountConnectorTable jt = new AccountConnectorTable( main, list, fieldList, listener); return jt; } JPAJobField getJobField() { return (JPAJobField)fieldList.get(0); } public static int get_dflt_port( String type, boolean secure ) { if (type.compareTo("smtp") == 0) return (secure ? 465 : 25); if (type.compareTo("pop") == 0) return (secure ? 995 : 110); if (type.compareTo("imap") == 0) return (secure ? 993 : 143); if (type.compareTo("ldap") == 0 || type.compareTo("ad") == 0) return (secure ? 636 : 389); return 0; } @Override protected GenericEntityManager get_em() { return VSMCMain.get_base_util_em(); } @Override protected AccountConnector createNewObject() { AccountConnector p = new AccountConnector(); p.setUsername("user"); p.setType(AccountConnector.TY_LDAP); p.setIp("127.0.0.1"); p.setPort(AccountConnectorPreviewPanel.get_dflt_port(AccountConnector.TY_LDAP, false)); GenericEntityManager gem = get_em(); try { gem.check_open_transaction(); gem.em_persist(p); gem.commit_transaction(); this.requestRepaint(); return p; } catch (Exception e) { e.printStackTrace(); gem.rollback_transaction(); } return null; } AccountConnectorPreviewPanel editPanel; @Override protected void saveActiveObject() { // EXCERPT CHANGES FROM NEW GUIFIELDS editPanel.updateObject( activeElem ); super.saveActiveObject(); } @Override public AbstractOrderedLayout createEditComponentPanel( boolean readOnly ) { editPanel = new AccountConnectorPreviewPanel(this, readOnly); editPanel.recreateContent(activeElem); return editPanel; } }
[ "mark@dimm.de" ]
mark@dimm.de
66c9973a827d51819c05313e39b02707ec9b4324
1dff4b9816588af53eed89728d1aa46d189e8d9c
/PentahoDataTransferService/src/main/java/com/safasoft/pentaho/datatrans/run/CmTghMstPotentialRun.java
20feb5db48e7c998c7cb7e00cac65fb4c5cf12da
[]
no_license
awaludinhamid/MobileSurveyRest
0ee530ab426f337ec2ac4026d6f52e1925d449b0
1d7346de050682fe5785cd8d78cedee59fe05805
refs/heads/master
2021-07-05T17:16:10.500647
2017-09-29T07:44:42
2017-09-29T07:44:42
105,227,771
0
0
null
null
null
null
UTF-8
Java
false
false
1,498
java
package com.safasoft.pentaho.datatrans.run; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.apache.commons.beanutils.BeanUtils; import com.safasoft.pentaho.datatrans.dest.bean.CmTghMstPotentialDest; import com.safasoft.pentaho.datatrans.dest.service.CmTghMstPotentialDestService; import com.safasoft.pentaho.datatrans.src.bean.CmTghMstPotential; import com.safasoft.pentaho.datatrans.src.service.CmTghMstPotentialService; public class CmTghMstPotentialRun extends BaseRun<CmTghMstPotential,CmTghMstPotentialService,CmTghMstPotentialDest,CmTghMstPotentialDestService> { @Override protected List<CmTghMstPotential> getData(int pageNo, int numOfBulkRecord) { return service.getByPage(pageNo, numOfBulkRecord); } @Override protected int count() { return service.count(); } @Override protected void saveData(List<CmTghMstPotential> bList, int numOfBulkRecord) { List<CmTghMstPotentialDest> ctmpdList = new ArrayList<>(); for(CmTghMstPotential ctmp : bList) { CmTghMstPotentialDest ctmpd = new CmTghMstPotentialDest(); try { BeanUtils.copyProperties(ctmpd, ctmp); } catch (IllegalAccessException | InvocationTargetException e) { logger.error(e); } ctmpdList.add(ctmpd); } if(ctmpdList.size() > 0) service2.save(ctmpdList, numOfBulkRecord); } @Override protected int truncateTable(String tableName) { return service2.truncateTable(tableName); } }
[ "ahamid.dimaha@gmail.com" ]
ahamid.dimaha@gmail.com
8bdc798d906303db05e0ebb9e3b8914d9272affe
d611234422354667d0f76056e481bd6390708fbb
/Algorithms/1037. Valid Boomerang.java
2b2839cad0408df6837efe8f09229fe4d345544d
[]
no_license
hellcy/leetcode
979b05e5fc37b05a268e50230a39afda0ca01a1b
a952005e45cdabc829f46f3abb22517d448a880c
refs/heads/master
2022-02-14T02:12:03.600820
2022-02-06T13:11:44
2022-02-06T13:11:44
204,588,041
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
class Solution { public boolean isBoomerang(int[][] points) { /* Math compare the slopes of two lines */ double slope1 = 0, slope2 = 0; boolean reverse = false; int x = points[1][0] - points[0][0]; int y = points[1][1] - points[0][1]; if (x == 0 && y == 0) return false; if (y == 0){ y = x; x = 0; reverse = true; } slope1 = x / (double)y; x = points[2][0] - points[1][0]; y = points[2][1] - points[1][1]; //System.out.println(x + " " + y + " " + reverse); if (x == 0 && y == 0) return false; if (y == 0 && reverse == true) return false; else if (y == 0 && reverse == false) return true; if (x == 0 && reverse == true) return true; slope2 = x / (double)y; //System.out.println(slope1 + " " + slope2); if (Math.abs(slope1 - slope2) < 0.000001) return false; else return true; } }
[ "chengyuan82281681@hotmail.com" ]
chengyuan82281681@hotmail.com
06618a5357fe11db429ffc27ff793f90a264a756
9e72d2ec74a613a586499360707910e983a14370
/web/org/ace/insurance/web/dialog/LifeProposalEquireActionBean.java
cc03fed19662e2e388adcc297378381062b29da7
[]
no_license
pyaesonehein1141991/FNI-LIFE
30ecefca8b12455c0a90906004f85f32217c5bf4
a40b502147b32193d467c2db7d49e2872f2fcab6
refs/heads/master
2020-08-31T11:20:22.757995
2019-10-30T11:02:47
2019-10-30T11:02:47
218,678,685
0
2
null
null
null
null
UTF-8
Java
false
false
1,258
java
package org.ace.insurance.web.dialog; import java.io.Serializable; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import org.ace.insurance.life.proposal.InsuredPersonBeneficiaries; import org.ace.insurance.life.proposal.LifeProposal; import org.ace.insurance.life.proposal.ProposalInsuredPerson; import org.ace.java.web.common.BaseBean; @ManagedBean(name = "LifeProposalEquireActionBean") @ViewScoped public class LifeProposalEquireActionBean extends BaseBean implements Serializable { private static final long serialVersionUID = 1L; private LifeProposal lifeProposal; private ProposalInsuredPerson insuredPerson; private InsuredPersonBeneficiaries beneficiaries; @PostConstruct public void init() { lifeProposal = (LifeProposal) getParam("LifeProposal"); insuredPerson = lifeProposal.getProposalInsuredPersonList().get(0); } public void showBeneficiaries(InsuredPersonBeneficiaries beneficiaries) { this.beneficiaries = beneficiaries; } public LifeProposal getLifeProposal() { return lifeProposal; } public ProposalInsuredPerson getInsuredPerson() { return insuredPerson; } public InsuredPersonBeneficiaries getBeneficiaries() { return beneficiaries; } }
[ "ASUS@DESKTOP-37IOB4I" ]
ASUS@DESKTOP-37IOB4I
b59cde7395dab43563cf62a29fc2b3f30d0d51f7
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/hu/akarnokd/rxjava3/math/ObservableSumLong.java
1054df2ac486304a120248ccad9bf356eec29ac6
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package hu.akarnokd.rxjava3.math; import io.reactivex.rxjava3.core.ObservableSource; import io.reactivex.rxjava3.core.Observer; import io.reactivex.rxjava3.internal.observers.DeferredScalarObserver; import r6.a.b.h.k; public class ObservableSumLong extends k<Long, Long> { public static final class a extends DeferredScalarObserver<Long, Long> { private static final long serialVersionUID = 8645575082613773782L; public long a; public boolean b; public a(Observer<? super Long> observer) { super(observer); } @Override // io.reactivex.rxjava3.internal.observers.DeferredScalarObserver, io.reactivex.rxjava3.core.Observer public void onComplete() { if (this.b) { complete(Long.valueOf(this.a)); } else { this.downstream.onComplete(); } } @Override // io.reactivex.rxjava3.core.Observer public void onNext(Object obj) { Long l = (Long) obj; if (!this.b) { this.b = true; } this.a = l.longValue() + this.a; } } public ObservableSumLong(ObservableSource<Long> observableSource) { super(observableSource); } @Override // io.reactivex.rxjava3.core.Observable public void subscribeActual(Observer<? super Long> observer) { this.source.subscribe(new a(observer)); } }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
c5e57d3b60ef785e0e5ff2f33f991f40b8cddfb8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/19/19_ffa6acd3327f5cb0d01c47b8b48e12d45dc5d37a/UniqueValidator/19_ffa6acd3327f5cb0d01c47b8b48e12d45dc5d37a_UniqueValidator_t.java
cbf550ccf0cf8615295aa6167cb07a4d8cc82d84
[]
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
1,578
java
package edu.common.dynamicextensions.validation; import java.util.ArrayList; import java.util.List; import java.util.Map; import edu.common.dynamicextensions.domaininterface.AttributeInterface; import edu.common.dynamicextensions.entitymanager.EntityManagerUtil; import edu.common.dynamicextensions.exception.DynamicExtensionsSystemException; import edu.common.dynamicextensions.exception.DynamicExtensionsValidationException; /** * @author Rahul Ner * */ public class UniqueValidator implements ValidatorRuleInterface { /** * @see edu.common.dynamicextensions.validation.ValidatorRuleInterface#validate(edu.common.dynamicextensions.domaininterface.AttributeInterface, java.lang.Object, java.util.Map) * @throws DynamicExtensionsValidationException */ public boolean validate(AttributeInterface attribute, Object valueObject, Map<String, String> parameterMap) throws DynamicExtensionsValidationException, DynamicExtensionsSystemException { /* Check for the validity of the number */ NumberValidator numberValidator = new NumberValidator(); numberValidator.validate(attribute, valueObject, parameterMap); if (EntityManagerUtil.isValuePresent(attribute, valueObject)) { List<String> placeHolders = new ArrayList<String>(); placeHolders.add(attribute.getName()); placeHolders.add((String) valueObject); throw new DynamicExtensionsValidationException("Validation failed", null, "dynExtn.validation.Unique", placeHolders); } return true; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
8172f16262daf4d3d6ba139a0e4f92fe79379c0d
2122d24de66635b64ec2b46a7c3f6f664297edc4
/spring/spring-boot/spring-boot-exception-handler-sample/src/main/java/com/javasampleapproach/springexceptionhandler/customexception/CustomGeneralException.java
b55fa6f94e57ad8d7f64df15f821b535e968c2b7
[]
no_license
yiminyangguang520/Java-Learning
8cfecc1b226ca905c4ee791300e9b025db40cc6a
87ec6c09228f8ad3d154c96bd2a9e65c80fc4b25
refs/heads/master
2023-01-10T09:56:29.568765
2022-08-29T05:56:27
2022-08-29T05:56:27
92,575,777
5
1
null
2023-01-05T05:21:02
2017-05-27T06:16:40
Java
UTF-8
Java
false
false
161
java
package com.javasampleapproach.springexceptionhandler.customexception; /** * @author min */ public class CustomGeneralException extends RuntimeException { }
[ "litz-a@glodon.com" ]
litz-a@glodon.com
10a17407c4f3275ca0dd616103f0c6f0927f10fe
775c9ea32ff015e5828a3aa94444fa90fab37690
/videostore/src/main/java/com/videostore/domain/User.java
666429370cceb89ad87e26b924227f400e872b1b
[ "MIT" ]
permissive
BulkSecurityGeneratorProject/spring-boot-angularjs-examples
6b95e99b48655f74f27f0d0b01f3519092d62f0b
42ad55725d703564c68bd11c7d6dbf94582d1635
refs/heads/master
2022-12-14T12:56:19.875569
2015-09-15T22:54:18
2015-09-15T22:54:18
296,568,327
0
0
MIT
2020-09-18T08:57:08
2020-09-18T08:57:07
null
UTF-8
Java
false
false
5,170
java
package com.videostore.domain; import com.fasterxml.jackson.annotation.JsonIgnore; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.validator.constraints.Email; import org.springframework.data.elasticsearch.annotations.Document; import javax.persistence.*; import org.hibernate.annotations.Type; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import org.joda.time.DateTime; /** * A user. */ @Entity @Table(name = "JHI_USER") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Document(indexName="user") public class User extends AbstractAuditingEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotNull @Pattern(regexp = "^[a-z0-9]*$") @Size(min = 1, max = 50) @Column(length = 50, unique = true, nullable = false) private String login; @JsonIgnore @NotNull @Size(min = 60, max = 60) @Column(length = 60) private String password; @Size(max = 50) @Column(name = "first_name", length = 50) private String firstName; @Size(max = 50) @Column(name = "last_name", length = 50) private String lastName; @Email @Size(max = 100) @Column(length = 100, unique = true) private String email; @Column(nullable = false) private boolean activated = false; @Size(min = 2, max = 5) @Column(name = "lang_key", length = 5) private String langKey; @Size(max = 20) @Column(name = "activation_key", length = 20) @JsonIgnore private String activationKey; @Size(max = 20) @Column(name = "reset_key", length = 20) private String resetKey; @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentDateTime") @Column(name = "reset_date", nullable = true) private DateTime resetDate = null; @JsonIgnore @ManyToMany @JoinTable( name = "JHI_USER_AUTHORITY", joinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "id")}, inverseJoinColumns = {@JoinColumn(name = "authority_name", referencedColumnName = "name")}) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) private Set<Authority> authorities = new HashSet<>(); public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public boolean getActivated() { return activated; } public void setActivated(boolean activated) { this.activated = activated; } public String getActivationKey() { return activationKey; } public void setActivationKey(String activationKey) { this.activationKey = activationKey; } public String getResetKey() { return resetKey; } public void setResetKey(String resetKey) { this.resetKey = resetKey; } public DateTime getResetDate() { return resetDate; } public void setResetDate(DateTime resetDate) { this.resetDate = resetDate; } public String getLangKey() { return langKey; } public void setLangKey(String langKey) { this.langKey = langKey; } public Set<Authority> getAuthorities() { return authorities; } public void setAuthorities(Set<Authority> authorities) { this.authorities = authorities; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } User user = (User) o; if (!login.equals(user.login)) { return false; } return true; } @Override public int hashCode() { return login.hashCode(); } @Override public String toString() { return "User{" + "login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", activated='" + activated + '\'' + ", langKey='" + langKey + '\'' + ", activationKey='" + activationKey + '\'' + "}"; } }
[ "jose@brandwatch.com" ]
jose@brandwatch.com
f36ab339514d2484e353711ec9adf98cdd5e286d
31b7a77817a984c8dc408029800e56edd9228c2b
/src/com/xiaolianhust/designpattern/observer/Subject.java
d4e8e1f1983640e87130f414d9480fb57c9910ac
[]
no_license
hustxiaolian/HeadFirstDesignPattern
437690fc2bfcd563360ae86800cea13df1b52836
0dcbd8b1b2fa683d3410ca569648ceb20eeb26a9
refs/heads/master
2020-03-24T00:27:01.779688
2018-08-10T12:43:48
2018-08-10T12:43:48
142,291,891
0
0
null
null
null
null
GB18030
Java
false
false
296
java
package com.xiaolianhust.designpattern.observer; /** * 主题接口,为所有实现主题的定义同一的规范 * @author 25040 * */ public interface Subject { void registerObserver(Observer newObserver); void removeObserver(Observer observer); void notifyObserver(); }
[ "2504033134@qq.com" ]
2504033134@qq.com
2a6637f3c1786001fb2b06c7075160a4864a69f8
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Codec-12/org.apache.commons.codec.binary.BaseNCodecInputStream/BBC-F0-opt-80/tests/23/org/apache/commons/codec/binary/BaseNCodecInputStream_ESTest_scaffolding.java
4a916c2ec50803799519aa717384e8d32f6dbb92
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
4,377
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Oct 24 06:44:42 GMT 2021 */ package org.apache.commons.codec.binary; 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; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class BaseNCodecInputStream_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.codec.binary.BaseNCodecInputStream"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BaseNCodecInputStream_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.codec.binary.BaseNCodec", "org.apache.commons.codec.Encoder", "org.apache.commons.codec.binary.BaseNCodecInputStream", "org.apache.commons.codec.BinaryEncoder", "org.apache.commons.codec.EncoderException", "org.apache.commons.codec.DecoderException", "org.apache.commons.codec.Decoder", "org.apache.commons.codec.BinaryDecoder", "org.apache.commons.codec.binary.Base64", "org.apache.commons.codec.binary.Base32" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("java.util.Enumeration", false, BaseNCodecInputStream_ESTest_scaffolding.class.getClassLoader())); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(BaseNCodecInputStream_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.codec.binary.BaseNCodecInputStream", "org.apache.commons.codec.binary.BaseNCodec", "org.apache.commons.codec.binary.Base32", "org.apache.commons.codec.DecoderException", "org.apache.commons.codec.binary.Base64", "org.apache.commons.codec.binary.StringUtils", "org.apache.commons.codec.EncoderException" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
6f69e2bd7fdb73a00311a7621d935f3ca9286946
e47ae9605032f35da46fecc0e0e7b288f8a83c21
/src/main/java/com/example/luckyMoney/HelloWord.java
d74b2a0a26ca9a619957ca99ffc3bf1d25cc5cdb
[]
no_license
zhshchMr/luckyMoney
1d3c6803804375f7875ba0c3c8e1e123a871cbaa
5b99102b131a36d1c7cf506ed6d4b6c75b9e6356
refs/heads/master
2020-06-28T04:50:54.695282
2019-08-02T01:58:31
2019-08-02T01:58:31
200,146,616
0
0
null
null
null
null
UTF-8
Java
false
false
792
java
package com.example.luckyMoney; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; @RestController /** * @RestController 是@Controller和@ResponseBody 两者功能的结合 */ public class HelloWord { /*@Value("${minMoney}") private BigDecimal minMoney; @Value("${description}") private String description;*/ @Autowired public LimitConfig limitConfig; @GetMapping("/hello") public String sayHi(){ return "springboot"+limitConfig.getDescription(); } }
[ "il" ]
il
156ebadd4db474c205a3131898e644142542af9b
6494431bcd79c7de8e465481c7fc0914b5ef89d5
/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/AttributeStrategy.java
787a10bbfd20ff578f8d80aca4b2eec4053bbd50
[]
no_license
maisamali/coinbase_decompile
97975a22962e7c8623bdec5c201e015d7f2c911d
8cb94962be91a7734a2182cc625efc64feae21bf
refs/heads/master
2020-06-04T07:10:24.589247
2018-07-18T05:11:02
2018-07-18T05:11:02
191,918,070
2
0
null
2019-06-14T09:45:43
2019-06-14T09:45:43
null
UTF-8
Java
false
false
3,001
java
package com.bumptech.glide.load.engine.bitmap_recycle; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import com.bumptech.glide.util.Util; class AttributeStrategy implements LruPoolStrategy { private final GroupedLinkedMap<Key, Bitmap> groupedMap = new GroupedLinkedMap(); private final KeyPool keyPool = new KeyPool(); static class Key implements Poolable { private Config config; private int height; private final KeyPool pool; private int width; public Key(KeyPool pool) { this.pool = pool; } public void init(int width, int height, Config config) { this.width = width; this.height = height; this.config = config; } public boolean equals(Object o) { if (!(o instanceof Key)) { return false; } Key other = (Key) o; if (this.width == other.width && this.height == other.height && this.config == other.config) { return true; } return false; } public int hashCode() { return (((this.width * 31) + this.height) * 31) + (this.config != null ? this.config.hashCode() : 0); } public String toString() { return AttributeStrategy.getBitmapString(this.width, this.height, this.config); } public void offer() { this.pool.offer(this); } } static class KeyPool extends BaseKeyPool<Key> { KeyPool() { } public Key get(int width, int height, Config config) { Key result = (Key) get(); result.init(width, height, config); return result; } protected Key create() { return new Key(this); } } AttributeStrategy() { } public void put(Bitmap bitmap) { this.groupedMap.put(this.keyPool.get(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig()), bitmap); } public Bitmap get(int width, int height, Config config) { return (Bitmap) this.groupedMap.get(this.keyPool.get(width, height, config)); } public Bitmap removeLast() { return (Bitmap) this.groupedMap.removeLast(); } public String logBitmap(Bitmap bitmap) { return getBitmapString(bitmap); } public String logBitmap(int width, int height, Config config) { return getBitmapString(width, height, config); } public int getSize(Bitmap bitmap) { return Util.getBitmapByteSize(bitmap); } public String toString() { return "AttributeStrategy:\n " + this.groupedMap; } private static String getBitmapString(Bitmap bitmap) { return getBitmapString(bitmap.getWidth(), bitmap.getHeight(), bitmap.getConfig()); } static String getBitmapString(int width, int height, Config config) { return "[" + width + "x" + height + "], " + config; } }
[ "gulincheng@droi.com" ]
gulincheng@droi.com
36994af173b8d21b36e90c3096fc0e723086f0af
f62d998a6fc87c84227be8eb81e4bf14b2e196e8
/流程/comp/Check/checkNonCyclicElements.java
04797b365610f5205d2af625c9a44ce6e11f544d
[]
no_license
cylee0909/Javac-Research
14121f13e7189a141747009a5f1e08a2195c994e
3b767454d837e01593a68ec281ea68caec8a8c74
refs/heads/master
2021-01-21T00:59:27.787365
2016-07-01T11:16:53
2016-07-01T11:16:53
61,563,719
3
3
null
2016-06-20T16:39:29
2016-06-20T16:39:23
null
UTF-8
Java
false
false
1,915
java
/* 例子: @interface AnnoTest{ AnnoTest m(); } */ /** Check for cycles in the graph of annotation elements. */ void checkNonCyclicElements(JCClassDecl tree) { if ((tree.sym.flags_field & ANNOTATION) == 0) return; assert (tree.sym.flags_field & LOCKED) == 0; try { tree.sym.flags_field |= LOCKED; for (JCTree def : tree.defs) { if (def.getTag() != JCTree.METHODDEF) continue; JCMethodDecl meth = (JCMethodDecl)def; checkAnnotationResType(meth.pos(), meth.restype.type); } } finally { tree.sym.flags_field &= ~LOCKED; tree.sym.flags_field |= ACYCLIC_ANN; } } void checkNonCyclicElementsInternal(DiagnosticPosition pos, TypeSymbol tsym) { if ((tsym.flags_field & ACYCLIC_ANN) != 0) return; if ((tsym.flags_field & LOCKED) != 0) { log.error(pos, "cyclic.annotation.element"); return; } try { tsym.flags_field |= LOCKED; for (Scope.Entry e = tsym.members().elems; e != null; e = e.sibling) { Symbol s = e.sym; if (s.kind != Kinds.MTH) continue; checkAnnotationResType(pos, ((MethodSymbol)s).type.getReturnType()); } } finally { tsym.flags_field &= ~LOCKED; tsym.flags_field |= ACYCLIC_ANN; } } void checkAnnotationResType(DiagnosticPosition pos, Type type) { switch (type.tag) { case TypeTags.CLASS: if ((type.tsym.flags() & ANNOTATION) != 0) checkNonCyclicElementsInternal(pos, type.tsym); break; case TypeTags.ARRAY: checkAnnotationResType(pos, types.elemtype(type)); break; default: break; // int etc } }
[ "zhh200910@gmail.com" ]
zhh200910@gmail.com