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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d708d8d8b1bed3199da8a983751caeac32968951 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-53-22-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/resource/servlet/RoutingFilter_ESTest.java | a72db0f8f05dd54d0806a15d3aea82118655aa90 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | /*
* This file was automatically generated by EvoSuite
* Mon Apr 06 11:11:07 UTC 2020
*/
package org.xwiki.resource.servlet;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class RoutingFilter_ESTest extends RoutingFilter_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
704a04da544e8094e6e23b9ec24dc57da5e96545 | 9fe61097720fb4f37250f1cf0b9f3f1b2cb4a887 | /src/org/aitek/ml/tools/RandomData.java | a68bd619ddb03775e7403b69d20b992b2179c338 | [] | no_license | andreaiacono/MachineLearning | 48e76efe5352fc696601ea5575b8d4a28e9ebfb5 | 8308b1ca996b6cf20507ffad0a9f0d1ff5ab8942 | refs/heads/master | 2021-01-21T05:00:07.245722 | 2014-01-19T21:10:43 | 2014-01-19T21:10:43 | 9,300,751 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,710 | java | package org.aitek.ml.tools;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.aitek.ml.domain.Book;
import org.aitek.ml.domain.Item;
import org.aitek.ml.domain.Reader;
import org.aitek.ml.domain.Voter;
public class RandomData {
public static final int MAX_VOTE = 5;
public static List<Item> createItems(int n) {
List<Item> items = new ArrayList<Item>();
// no lambdas in Java 7!
for (int j = 0; j < n; j++) {
items.add(new Book("Item n." + j));
}
return items;
}
public static List<Voter> createReaders(int n) {
List<Voter> readers = new ArrayList<Voter>();
// no lambdas in Java 7!
for (int j = 0; j < n; j++) {
readers.add(new Reader("Reader n." + j));
}
return readers;
}
public static void setRandomVote(Voter reader, Item item) {
int value = (int) (Math.random() * MAX_VOTE) + 1;
reader.setVote(item, value);
}
public static void setRandomVotesForReader(Voter reader, List<Item> items) {
for (Item item : items) {
setRandomVote(reader, item);
}
}
public static void setRandomVotesForItem(Item item, List<Voter> readers) {
for (Voter reader : readers) {
setRandomVote(reader, item);
}
}
public static void setRandomVotes(List<Item> items, List<Voter> readers) {
for (Voter reader : readers) {
for (Item item : items) {
setRandomVote(reader, item);
}
}
}
public static String getDataAsCsv(List<Item> items, List<Voter> voters, boolean setRandomValues) {
StringBuilder csv = new StringBuilder();
for (Voter reader : voters) {
csv.append(reader).append(",");
}
csv.deleteCharAt(csv.length() - 1);
csv.append("\n");
for (Item item : items) {
csv.append(item).append(",");
for (Voter reader : voters) {
if (setRandomValues) {
if (Math.random() > 0.4) {
csv.append(reader.getVote(item)).append(",");
}
else {
csv.append(" ").append(",");
}
}
else {
csv.append(reader.getVote(item)).append(",");
}
}
csv.deleteCharAt(csv.length() - 1);
csv.append("\n");
}
return csv.toString();
}
public static void readDataset(List<Item> items, int itemsNumber, List<Voter> voters, int votersNumber) throws Exception {
String data = Utils.readTextFile(new File("resources/collaborative_filtering/data.csv"), "UTF-8");
String[] lines = data.split("\n");
for (int j = 0; j < lines.length - 1 && j < itemsNumber; j++) {
String[] votes = lines[j].split(",");
for (int i = 0; i < votes.length && i < votersNumber; i++) {
try {
voters.get(i).setVote(items.get(j), Integer.parseInt(votes[i]));
}
catch (NumberFormatException nfe) {
// just not setting vote
}
}
}
}
}
| [
"andrea.iacono.nl@gmail.com"
] | andrea.iacono.nl@gmail.com |
66bc7910ee3f373cd6af9049cf8a5d9f72eb8cd9 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MATH-32b-5-18-NSGA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math3/geometry/partitioning/BSPTree_ESTest.java | 49ea1c7afc3deef78adca9c3ca427603e8ddead9 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 01 09:35:49 UTC 2020
*/
package org.apache.commons.math3.geometry.partitioning;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BSPTree_ESTest extends BSPTree_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
089191684c8707fbc48b14aee0619833bbd511c0 | 30dc8e7b08eeb72626af7c7a8bb71f0a79b398a0 | /src/main/java/com/feed_the_beast/ftbutilities/net/MessageEditNBTResponse.java | fd20c5fb511ba7ebad44278c2a2ca56c237fc24f | [] | no_license | monster010/FTB-Utilities | 776f90dc86c1c8cefb03fdff8741cf31e6a71ef2 | 6b2db80d73bc2a673b09743778b5911f700358d6 | refs/heads/master | 2020-09-06T06:53:11.836865 | 2019-11-08T02:27:52 | 2019-11-08T02:27:52 | 220,356,419 | 0 | 0 | null | 2019-11-08T00:48:14 | 2019-11-08T00:48:13 | null | UTF-8 | Java | false | false | 2,852 | java | package com.feed_the_beast.ftbutilities.net;
import com.feed_the_beast.ftblib.lib.data.ForgePlayer;
import com.feed_the_beast.ftblib.lib.data.Universe;
import com.feed_the_beast.ftblib.lib.io.DataIn;
import com.feed_the_beast.ftblib.lib.io.DataOut;
import com.feed_the_beast.ftblib.lib.net.MessageToServer;
import com.feed_the_beast.ftblib.lib.net.NetworkWrapper;
import com.feed_the_beast.ftblib.lib.util.BlockUtils;
import com.feed_the_beast.ftbutilities.command.CmdEditNBT;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
public class MessageEditNBTResponse extends MessageToServer
{
private NBTTagCompound info, mainNbt;
public MessageEditNBTResponse()
{
}
public MessageEditNBTResponse(NBTTagCompound i, NBTTagCompound nbt)
{
info = i;
mainNbt = nbt;
}
@Override
public NetworkWrapper getWrapper()
{
return FTBUtilitiesNetHandler.FILES;
}
@Override
public void writeData(DataOut data)
{
data.writeNBT(info);
data.writeNBT(mainNbt);
}
@Override
public void readData(DataIn data)
{
info = data.readNBT();
mainNbt = data.readNBT();
}
@Override
public void onMessage(EntityPlayerMP player)
{
if (CmdEditNBT.EDITING.get(player.getGameProfile().getId()).equals(info))
{
CmdEditNBT.EDITING.remove(player.getGameProfile().getId());
switch (info.getString("type"))
{
case "player":
{
ForgePlayer player1 = Universe.get().getPlayer(info.getUniqueId("id"));
if (player1 != null)
{
player1.setPlayerNBT(mainNbt);
}
break;
}
case "tile":
{
BlockPos pos = new BlockPos(info.getInteger("x"), info.getInteger("y"), info.getInteger("z"));
if (player.world.isBlockLoaded(pos))
{
TileEntity tile = player.world.getTileEntity(pos);
if (tile != null)
{
mainNbt.setInteger("x", pos.getX());
mainNbt.setInteger("y", pos.getY());
mainNbt.setInteger("z", pos.getZ());
mainNbt.setString("id", info.getString("id"));
tile.readFromNBT(mainNbt);
tile.markDirty();
BlockUtils.notifyBlockUpdate(tile.getWorld(), pos, null);
}
}
break;
}
case "entity":
{
Entity entity = player.world.getEntityByID(info.getInteger("id"));
if (entity != null)
{
entity.deserializeNBT(mainNbt);
if (entity.isEntityAlive())
{
player.world.updateEntityWithOptionalForce(entity, true);
}
}
break;
}
case "item":
{
ItemStack stack = new ItemStack(mainNbt);
player.setHeldItem(EnumHand.MAIN_HAND, stack.isEmpty() ? ItemStack.EMPTY : stack);
}
}
}
}
} | [
"latvianmodder@gmail.com"
] | latvianmodder@gmail.com |
900816e8e3501b2df4df6060db5fbdbdd84945e3 | 0f4ac67c5e008e01f2ad5f2f60db8f47f0e79d85 | /src/main/java/net/rehttp/package-info.java | be6e5a7e1e058a50e47c89e768cece344193566d | [
"MIT"
] | permissive | niqmk/rehttp | cb4aba786bf9f74e9cc221a10766258e0e91e30c | 707b9c22f1d2f979c7fa9abdfa8012e69eedce25 | refs/heads/master | 2021-06-22T20:35:06.230293 | 2017-09-05T20:31:08 | 2017-09-05T21:08:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,322 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2017 Yegor Bugayenko
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions: the above copyright notice and this
* permission notice shall be included in all copies or substantial
* portions of the Software. The software is provided "as is", without
* warranty of any kind, express or implied, including but not limited to
* the warranties of merchantability, fitness for a particular purpose
* and non-infringement. In no event shall the authors or copyright
* holders be liable for any claim, damages or other liability, whether
* in an action of contract, tort or otherwise, arising from, out of or
* in connection with the software or the use or other dealings in the
* software.
*/
/**
* ReHTTP.
*
* @author Yegor Bugayenko (yegor256@gmail.com)
* @version $Id$
* @since 1.0
*/
package net.rehttp;
| [
"yegor256@gmail.com"
] | yegor256@gmail.com |
d8c6e0db79cb50dad5530b184f7150bf232f6fbd | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/chart/renderer/xy/StandardXYItemRenderer_getLegendLine_551.java | c769a0b831a00e2bfa50a98f2e9741e070b900bc | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,472 | java |
org jfree chart render
standard item render link plot xyplot draw
shape point line point shape
line
render retain histor reason gener
link line shape render xylineandshaperender
standard item render standardxyitemrender abstract item render abstractxyitemrender
return shape repres line legend
legend line code code
set legend line setlegendlin shape
shape legend line getlegendlin
legend line legendlin
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
be3ef1198cb8de5f298ab0fabaaea83ecf010794 | 940405ba6161e6add4ccc79c5d520f81ff9f7433 | /geonetwork-domain-ebrim/src/main/java/org/geonetwork/domain/ebrim/extensionpackage/basicextension/slottype/ContributorSlot.java | edc40461ae8931127338764f708c118a5131a13b | [] | no_license | isabella232/ebrim | e5276b1fc9a084811b3384b2e66b70337fdbe05c | 949e6bad1f1db4dc089a0025e332aaf04ce14a84 | refs/heads/master | 2023-03-15T20:18:13.577538 | 2012-06-13T15:25:15 | 2012-06-13T15:25:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,054 | java | package org.geonetwork.domain.ebrim.extensionpackage.basicextension.slottype;
import org.geonetwork.domain.ebrim.informationmodel.core.Slot;
import org.geonetwork.domain.ebrim.informationmodel.core.datatype.LongName;
import org.hibernate.search.annotations.Indexed;
/**
*
* An entity responsible for making contributions to the resource.
*
*
* From OGC 07-144r2 : CSW-ebRIM_Registry_Service__Part_2_Basic_extension_package.pdf:
*
* Table 44 � Slot: Contributor Name http://purl.org/dc/elements/1.1/contributor Definition An
* entity responsible for making contributions to the resource. Source DCMI Metadata terms
* <http://dublincore.org/documents/dcmi-terms/#contributor> Slot type
* urn:oasis:names:tc:ebxml-regrep:DataType:String Parent object type
* urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject
*
* @author heikki
*
*/
@Indexed
public class ContributorSlot extends Slot {
public ContributorSlot() {
slotType = new LongName("urn:oasis:names:tc:ebxml-regrep:DataType:String");
}
}
| [
"jesse.eichar@camptocamp.com"
] | jesse.eichar@camptocamp.com |
0034dd18a1036b4b222fff22ffeee61c02e6750b | 526a6683a7bf4909e13d0cd8c6e607243d73b906 | /playgrounds/agarwalamit/src/main/java/playground/agarwalamit/mixedTraffic/patnaIndia/PatnaUtils.java | a147ff280616d2e855501d87d6b4f113beb90dfe | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | Isaquedanielre/matsim | ad15a4f716323290cf3596a937d1d0303fcdd58b | d599f305926b8fe6b9a4590dde1940c59e95d755 | refs/heads/master | 2021-01-14T13:26:51.039748 | 2015-11-30T10:18:39 | 2015-11-30T10:18:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,954 | java | /* *********************************************************************** *
* project: org.matsim.*
* *
* *********************************************************************** *
* *
* copyright : (C) 2014 by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* *********************************************************************** */
package playground.agarwalamit.mixedTraffic.patnaIndia;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Leg;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.PlanElement;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleType;
import org.matsim.vehicles.VehicleUtils;
import playground.agarwalamit.mixedTraffic.MixedTrafficVehiclesUtils;
/**
* @author amit
*/
public final class PatnaUtils {
public static final CoordinateTransformation COORDINATE_TRANSFORMATION = TransformationFactory.getCoordinateTransformation(TransformationFactory.WGS84,"EPSG:24345");
public static final String INPUT_FILES_DIR = "../../../../repos/shared-svn/projects/patnaIndia/inputs/";
public static final String ZONE_FILE = PatnaUtils.INPUT_FILES_DIR+"/wardFile/Wards.shp";
public enum PatnaActivityTypes {
home, work, educational, social, other, unknown;
}
public static final Collection <String> MAIN_MODES = Arrays.asList("car","motorbike","bike");
public static final Collection <String> ALL_MODES = Arrays.asList("car","motorbike","bike","pt","walk");
private PatnaUtils(){}
/**
* @param scenario
* It creates first vehicle types and add them to scenario and then create and add vehicles to the scenario.
*/
public static void createAndAddVehiclesToScenario(final Scenario scenario){
final Map<String, VehicleType> modesType = new HashMap<String, VehicleType>();
for (String mode : PatnaUtils.ALL_MODES){
VehicleType vehicle = VehicleUtils.getFactory().createVehicleType(Id.create(mode,VehicleType.class));
vehicle.setMaximumVelocity(MixedTrafficVehiclesUtils.getSpeed(mode));
vehicle.setPcuEquivalents( MixedTrafficVehiclesUtils.getPCU(mode) );
modesType.put(mode, vehicle);
scenario.getVehicles().addVehicleType(vehicle);
}
for(Person p:scenario.getPopulation().getPersons().values()){
Id<Vehicle> vehicleId = Id.create(p.getId(),Vehicle.class);
String travelMode = null;
for(PlanElement pe :p.getSelectedPlan().getPlanElements()){
if (pe instanceof Leg) {
travelMode = ((Leg)pe).getMode();
break;
}
}
final Vehicle vehicle = VehicleUtils.getFactory().createVehicle(vehicleId,modesType.get(travelMode));
scenario.getVehicles().addVehicle(vehicle);
}
}
} | [
"amit.agarwal@campus.tu-berlin.de"
] | amit.agarwal@campus.tu-berlin.de |
5f39dec15239e4a5c303fa5cb1281f0948032ecd | b0b7a1041553406951ce2df4d01a0cf6a7221972 | /src/test/java/edu/illinois/library/cantaloupe/config/HeritablePropertiesConfigurationTest.java | 0eeb6279242b3641df746dc5af1ddbd86fc6fa47 | [
"LicenseRef-scancode-unknown-license-reference",
"NCSA"
] | permissive | ravalum/cantaloupe | 81f9122908eeb31324cfccc5d6f2530060fb2372 | da98fc68e19f0505ec06860b63021663abeaab72 | refs/heads/develop | 2021-04-28T05:39:05.066321 | 2018-02-22T02:23:08 | 2018-02-22T02:23:08 | 122,181,778 | 1 | 2 | null | 2018-02-20T23:01:03 | 2018-02-20T10:06:21 | Java | UTF-8 | Java | false | false | 3,058 | java | package edu.illinois.library.cantaloupe.config;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Iterator;
import java.util.List;
import static org.junit.Assert.*;
public class HeritablePropertiesConfigurationTest extends FileConfigurationTest {
private HeritablePropertiesConfiguration instance;
@Before
public void setUp() throws Exception {
super.setUp();
// Instances won't work without an actual file backing them up.
File directory = new File(".");
String cwd = directory.getCanonicalPath();
Path configPath = Paths.get(cwd, "src", "test", "resources",
"heritable_level3.properties");
System.setProperty(ConfigurationFactory.CONFIG_VM_ARGUMENT,
configPath.toString());
instance = new HeritablePropertiesConfiguration();
instance.reload();
instance.clear();
}
protected Configuration getInstance() {
return instance;
}
/* getFiles() */
@Test
public void testGetFilesReturnsAllFiles() {
assertEquals(3, instance.getFiles().size());
}
/* getKeys() */
@Test
public void testGetKeysReturnsKeysFromAllAllFiles() throws Exception {
instance.reload();
Iterator<String> it = instance.getKeys();
int count = 0;
while (it.hasNext()) {
it.next();
count++;
}
assertEquals(8, count);
}
/* getProperty() */
@Test
public void testGetPropertyUsesChildmostProperty() throws Exception {
instance.reload();
assertEquals("birds", instance.getProperty("common_key"));
}
@Test
public void testGetPropertyFallsBackToParentFileIfUndefinedInChildFile()
throws Exception {
instance.reload();
assertEquals("dogs", instance.getProperty("level2_key"));
}
/* setProperty() */
@Test
public void testSetPropertySetsExistingPropertiesInSameFile()
throws Exception {
instance.reload();
List<org.apache.commons.configuration.PropertiesConfiguration> commonsConfigs =
instance.getConfigurationTree();
instance.setProperty("level2_key", "bears");
assertNull(commonsConfigs.get(0).getString("level2_key"));
assertEquals("bears", commonsConfigs.get(1).getString("level2_key"));
assertNull(commonsConfigs.get(2).getString("level2_key"));
}
@Test
public void testSetPropertySetsNewPropertiesInChildmostFile()
throws Exception {
instance.reload();
List<org.apache.commons.configuration.PropertiesConfiguration> commonsConfigs =
instance.getConfigurationTree();
instance.setProperty("newkey", "bears");
assertEquals("bears", commonsConfigs.get(0).getString("newkey"));
assertNull(commonsConfigs.get(1).getString("newkey"));
assertNull(commonsConfigs.get(2).getString("newkey"));
}
}
| [
"alexd@n-ary.net"
] | alexd@n-ary.net |
168cf2591c8400d6d0ff7662f1e214aaac61d443 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project33/src/main/java/org/gradle/test/performance33_3/Production33_271.java | ec5b9d9e321e98bbb8f9d077c2968894aab77cb3 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance33_3;
public class Production33_271 extends org.gradle.test.performance12_3.Production12_271 {
private final String property;
public Production33_271() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
6d3e5a2d75fb88148de6c3f9cafcd79827b417d6 | 38c3180624ffa0ab5ae90ffb8ccdaea70734295d | /scm-inventory/src/main/java/com/winway/scm/persistence/dao/ScmKcAllotDao.java | d4e739c63614c8c79d9966ea369ac284841deac6 | [] | no_license | cwy329233832/scm_code | e88fe0296638202443643941fbfca58dc1abf3f0 | fbd3e56af615ce39bca96ce12d71dc5487c51515 | refs/heads/master | 2021-04-17T16:02:51.463958 | 2019-09-05T08:22:39 | 2019-09-05T08:22:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.winway.scm.persistence.dao;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.hotent.base.dao.MyBatisDao;
import com.winway.scm.model.ScmKcAllot;
/**
*
* <pre>
* 描述:库存调拨商品表 DAO接口
* 构建组:x7
* 作者:原浩
* 邮箱:PRD-jun.he@winwayworld.com
* 日期:2019-04-23 17:00:46
* 版权:美达开发小组
* </pre>
*/
public interface ScmKcAllotDao extends MyBatisDao<String, ScmKcAllot> {
/**
* 根据外键获取子表明细列表
* @param masterId
* @return
*/
List<ScmKcAllot> getByMainId(String masterId);
/**
* 根据外键删除子表记录
* @param masterId
* @return
*/
void delByMainId(String masterId);
}
| [
"1540307734@qq.com"
] | 1540307734@qq.com |
2877dc9d40121fe404e9349042eea8f2c0b8e5bc | 91290739b89c271ade9d92422e51aff5c56b0684 | /21/Solution.java | 7c68d2efedb80e58dfc7ebf5bd1fe1ba98585039 | [] | no_license | charles-wangkai/projecteuler | 403337a5ee03c5436a57ec33ac3d195afb0b2e36 | 2aeb3ae144de7410413db90537a683d1a97e27f7 | refs/heads/main | 2022-07-08T11:31:52.162982 | 2022-06-24T11:09:05 | 2022-06-24T11:09:05 | 24,108,349 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | import java.util.stream.IntStream;
public class Solution {
public static void main(String[] args) {
System.out.println(solve());
}
static int solve() {
assert isAmicable(220);
assert isAmicable(284);
return IntStream.range(1, 10000).filter(Solution::isAmicable).sum();
}
static boolean isAmicable(int n) {
return d(n) != n && d(d(n)) == n;
}
static int d(int n) {
return IntStream.range(1, n).filter(x -> n % x == 0).sum();
}
}
| [
"charles.wangkai@gmail.com"
] | charles.wangkai@gmail.com |
8e64355878699a3e1f8754335d3d292d5af51648 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/4da7d7d94d990e15955ba14398d908997434816e/after/CompressedDictionary.java | 47dbfe8ce2e64d57fe46d99c2199f3443a07db70 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,743 | java | /*
* Copyright 2000-2010 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.spellchecker.compress;
import com.intellij.spellchecker.dictionary.Dictionary;
import com.intellij.spellchecker.dictionary.Loader;
import com.intellij.spellchecker.engine.Transformation;
import com.intellij.util.Consumer;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import java.util.*;
public final class CompressedDictionary implements Dictionary {
private final Alphabet alphabet;
private int wordsCount;
private byte[][] words;
private int[] lengths;
private Encoder encoder;
private String name;
private Compressor compressor;
private final Map<Integer, SortedSet<byte[]>> rawData = new THashMap<Integer, SortedSet<byte[]>>();
private static final Comparator<byte[]> COMPARATOR = new Comparator<byte[]>() {
public int compare(byte[] o1, byte[] o2) {
return compareArrays(o1, o2);
}
};
CompressedDictionary(@NotNull Alphabet alphabet, @NotNull Compressor compressor, @NotNull Encoder encoder, @NotNull String name) {
this.alphabet = alphabet;
this.compressor = compressor;
this.encoder = encoder;
this.name = name;
}
void addToDictionary(byte[] word) {
SortedSet<byte[]> set = rawData.get(word.length);
if (set == null) {
set = createSet();
rawData.put(word.length, set);
}
set.add(word);
wordsCount++;
}
void pack() {
if (rawData == null) {
return;
}
lengths = new int[rawData.size()];
this.words = new byte[rawData.size()][];
int row = 0;
for (Map.Entry<Integer, SortedSet<byte[]>> entry : rawData.entrySet()) {
final Integer l = entry.getKey();
lengths[row] = l;
this.words[row] = new byte[entry.getValue().size() * l];
int k = 0;
for (byte[] bytes : entry.getValue()) {
for (byte aByte : bytes) {
this.words[row][k++] = aByte;
}
}
row++;
}
rawData.clear();
}
private static SortedSet<byte[]> createSet() {
return new TreeSet<byte[]>(COMPARATOR);
}
public List<String> getWords(Character first, int minLength, int maxLength) {
int index = alphabet.getIndex(first, false);
List<String> result = new ArrayList<String>();
if (index == -1) {
return result;
}
int i = 0;
for (byte[] data : words) {
int length = lengths[i];
for (int x = 0; x < data.length; x += length) {
byte[] toTest = new byte[length];
System.arraycopy(data, x, toTest, 0, length);
if (toTest[1] != index || toTest[0] > maxLength || toTest[0] < minLength) {
continue;
}
UnitBitSet set = compressor.decompress(toTest);
result.add(encoder.decode(set));
}
i++;
}
return result;
}
public List<String> getWords(Character first) {
return getWords(first, 0, Integer.MAX_VALUE);
}
public String getName() {
return name;
}
public boolean contains(String word) {
if (word == null) {
return false;
}
try {
UnitBitSet bs = encoder.encode(word, false);
byte[] compressed = compressor.compress(bs);
int index = -1;
for (int i = 0; i < lengths.length; i++) {
if (lengths[i] == compressed.length) {
index = i;
break;
}
}
if (index == -1) {
return false;
}
return contains(compressed, words[index]);
}
catch (EncodingException ignored) {
return false;
}
}
public boolean isEmpty() {
return wordsCount <= 0;
}
public void traverse(Consumer<String> action) {
throw new UnsupportedOperationException();
}
public Set<String> getWords() {
throw new UnsupportedOperationException();
}
public int getAlphabetLength() {
return alphabet.getLastIndexUsed();
}
public int size() {
return wordsCount;
}
public String toString() {
final StringBuffer sb = new StringBuffer();
sb.append("CompressedDictionary");
sb.append("{wordsCount=").append(wordsCount);
sb.append(", name='").append(name).append('\'');
sb.append('}');
return sb.toString();
}
public static CompressedDictionary create(@NotNull Loader loader, @NotNull final Transformation transform) {
Alphabet alphabet = new Alphabet();
final Encoder encoder = new Encoder(alphabet);
final Compressor compressor = new Compressor(2);
final CompressedDictionary dictionary = new CompressedDictionary(alphabet, compressor, encoder, loader.getName());
loader.load(new Consumer<String>() {
public void consume(String s) {
String transformed = transform.transform(s);
if (transformed != null) {
UnitBitSet bs = encoder.encode(transformed, true);
byte[] compressed = compressor.compress(bs);
dictionary.addToDictionary(compressed);
}
}
});
dictionary.pack();
return dictionary;
}
public static int compareArrays(byte[] array1, byte[] array2) {
if (array1.length != array2.length) {
return (array1.length < array2.length ? -1 : 1);
}
//array1.length==array2.length
if (Arrays.equals(array1, array2)) {
return 0;
}
//compare elements values
for (int i = 0; i < array1.length; i++) {
if (array1[i] < array2[i]) {
return -1;
}
else if (array1[i] > array2[i]) {
return 1;
}
}
return 0;
}
public static boolean contains(byte[] goal, byte[] data) {
return binarySearchNew(goal, 0, data.length / goal.length, data) >= 0;
}
public static int binarySearchNew(byte[] goal, int fromIndex, int toIndex, byte[] data) {
int unitLength = goal.length;
int low = fromIndex;
int high = toIndex - 1;
while (low <= high) {
int mid = (low + high) >>> 1;
byte[] toTest = new byte[unitLength];
System.arraycopy(data, mid * unitLength, toTest, 0, unitLength);
int check = compareArrays(toTest, goal);
if (check == -1) {
low = mid + 1;
}
else if (check == 1) {
high = mid - 1;
}
else {
return mid;
}
}
return -(low + 1); // key not found.
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
b4c1ffd518355f6d16286292559eeff60aa714df | f20af063f99487a25b7c70134378c1b3201964bf | /appengine/src/main/java/com/dereekb/gae/client/api/service/response/error/ClientResponseError.java | 58c0acbe587fbd9c8ba1df430b9dff432b8725d0 | [] | no_license | dereekb/appengine | d45ad5c81c77cf3fcca57af1aac91bc73106ccbb | d0869fca8925193d5a9adafd267987b3edbf2048 | refs/heads/master | 2022-12-19T22:59:13.980905 | 2020-01-26T20:10:15 | 2020-01-26T20:10:15 | 165,971,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package com.dereekb.gae.client.api.service.response.error;
import java.util.List;
import java.util.Map;
import com.dereekb.gae.client.api.service.response.ClientResponse;
import com.dereekb.gae.client.api.service.response.exception.ClientResponseSerializationException;
/**
* Error for a {@link ClientResponse}.
*
* @author dereekb
*
*/
public interface ClientResponseError {
/**
* Returns the primary error type.
*
* @return {@link ClientApiResponseErrorType}. Never {@code null}.
*/
public ClientApiResponseErrorType getErrorType();
/**
* Returns a list of error info.
*
* @return {@link List}. Never {@code null}, but may be empty.
*/
public List<ClientResponseErrorInfo> getErrorInfo() throws ClientResponseSerializationException;
/**
* Returns a map of errors.
*
* @return {@link Map}. Never {@code null}, but may be empty.
*/
public Map<String, ClientResponseErrorInfo> getErrorInfoMap() throws ClientResponseSerializationException;
}
| [
"dereekb@gmail.com"
] | dereekb@gmail.com |
2a07bb81b503b74a7afb76829f0e50d706ba761f | eeb3cb6658a7b8eb033b0c2cd0e9fac41c6bc5da | /app/src/main/java/com/example/mynestscrollingdemo/TabFragment.java | 33f140d210caf2ad0ce19f9f724ed63d9dfcfca0 | [] | no_license | lyhAdsorption/NestedScrollingParentDemo | 04d36d893fdc691068848ea7734aba7fdf98e876 | d0ee5e7f089059c04ead34d655e72806e0129c2b | refs/heads/master | 2022-02-12T20:47:01.576468 | 2018-04-20T01:57:28 | 2018-04-20T01:57:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,674 | java | package com.example.mynestscrollingdemo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.adapter.CommonAdapter;
import java.util.ArrayList;
import java.util.List;
public class TabFragment extends Fragment{
public static final String TITLE = "title";
private String mTitle = "Defaut Value";
private RecyclerView mRecyclerView;
private List<String> mDatas = new ArrayList<String>();
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
if (getArguments() != null){
mTitle = getArguments().getString(TITLE);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = inflater.inflate(R.layout.fragment_tab, container, false);
mRecyclerView = view.findViewById(R.id.id_stickynavlayout_innerscrollview);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
for (int i = 0; i < 50; i++) {
mDatas.add(mTitle + " -> " + i);
}
mRecyclerView.setAdapter(new CommonAdapter(getActivity(), mDatas));
return view;
}
public static TabFragment newInstance(String title){
TabFragment tabFragment = new TabFragment();
Bundle bundle = new Bundle();
bundle.putString(TITLE, title);
tabFragment.setArguments(bundle);
return tabFragment;
}
}
| [
"guoyong@emcc.net.com"
] | guoyong@emcc.net.com |
6d7f6d023199eea70cd9e83191129a7773fe56a8 | cee0dc1b77778119f6bbb918f6a471352783c8e9 | /src/main/java/adonis/config/LocaleConfiguration.java | fe0f8c38412f45320f00b4307693bc3ef524630a | [] | no_license | adonisdossantos/Meusistema | 5f1eb25ac90a6c95c2588f16fc077ef06d05bf07 | 3a9df8c6906a5f96013761b02e6136231833c92b | refs/heads/master | 2020-04-03T23:54:45.224027 | 2018-10-31T23:05:03 | 2018-10-31T23:05:03 | 155,634,124 | 0 | 0 | null | 2018-10-31T23:43:34 | 2018-10-31T23:04:47 | Java | UTF-8 | Java | false | false | 1,049 | java | package adonis.config;
import io.github.jhipster.config.locale.AngularCookieLocaleResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
@Configuration
public class LocaleConfiguration implements WebMvcConfigurer {
@Bean(name = "localeResolver")
public LocaleResolver localeResolver() {
AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver();
cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY");
return cookieLocaleResolver;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
registry.addInterceptor(localeChangeInterceptor);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
73c6efb1fd32ea9b60e488f06bc975b55837201e | 92f75f65766402204ecbeaac6cece2a75bbf7c0d | /src/main/java/com/demotivirus/Day_228_229/Tip_02/ChickenBurger.java | db9ceebed358e0964441b39121f8eb8af98fd97b | [] | no_license | demotivirus/365_Days_Challenge | 338139efe4f677ebb78abac4e4c674639ad78ab8 | cfc25eb921dd59f9581a39bf00fb0fc15809e4bb | refs/heads/master | 2023-07-21T19:04:26.927157 | 2021-09-07T20:25:29 | 2021-09-07T20:25:29 | 336,847,354 | 1 | 0 | null | 2021-09-07T20:20:42 | 2021-02-07T17:32:36 | Java | UTF-8 | Java | false | false | 207 | java | package com.demotivirus.Day_228_229.Tip_02;
import lombok.ToString;
@ToString
public class ChickenBurger implements Item {
@Override
public String name() {
return "chicken burger";
}
}
| [
"demotivirus@gmail.com"
] | demotivirus@gmail.com |
9d4b7b22b8df0508c568339359964443a9da2731 | 0c50c4bb815d277369a41b010f5c50a17bbd1373 | /Board/app/src/main/java/de/cisha/android/board/video/model/UserActionObservable.java | 7cec479a48c6093f4c98db6f86250ec869af2fea | [] | no_license | korkies22/ReporteMoviles | 645b830b018c1eabbd5b6c9b1ab281ea65ff4045 | e708d4aa313477b644b0485c14682611d6086229 | refs/heads/master | 2022-03-04T14:18:12.406700 | 2022-02-17T03:11:01 | 2022-02-17T03:11:01 | 157,728,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,736 | java | //
// Decompiled by Procyon v0.5.30
//
package de.cisha.android.board.video.model;
import de.cisha.chess.model.Square;
import de.cisha.chess.model.Move;
import de.cisha.chess.model.SEP;
import java.util.Iterator;
import java.util.Map;
import java.util.Collections;
import java.util.WeakHashMap;
import java.util.Set;
import de.cisha.chess.model.MoveSelector;
import de.cisha.chess.model.MoveExecutor;
public class UserActionObservable implements MoveExecutor, MoveSelector
{
private MoveExecutor _moveExeutor;
private MoveSelector _moveSelector;
private Set<UserActionObserver> _observers;
public UserActionObservable(final MoveExecutor moveExeutor, final MoveSelector moveSelector) {
this._observers = Collections.newSetFromMap(new WeakHashMap<UserActionObserver, Boolean>());
this._moveExeutor = moveExeutor;
this._moveSelector = moveSelector;
}
private void notifyUserActionObservers() {
final Iterator<UserActionObserver> iterator = this._observers.iterator();
while (iterator.hasNext()) {
iterator.next().userDidAction();
}
}
public void addUserActionObserver(final UserActionObserver userActionObserver) {
this._observers.add(userActionObserver);
}
@Override
public boolean advanceOneMoveInCurrentLine() {
this.notifyUserActionObservers();
return this._moveExeutor.advanceOneMoveInCurrentLine();
}
@Override
public Move doMoveInCurrentPosition(final SEP sep) {
this.notifyUserActionObservers();
return this._moveExeutor.doMoveInCurrentPosition(sep);
}
@Override
public boolean goBackOneMove() {
this.notifyUserActionObservers();
return this._moveExeutor.goBackOneMove();
}
@Override
public void gotoEndingPosition() {
this.notifyUserActionObservers();
this._moveExeutor.gotoEndingPosition();
}
@Override
public boolean gotoStartingPosition() {
this.notifyUserActionObservers();
return this._moveExeutor.gotoStartingPosition();
}
@Override
public void registerPremove(final Square square, final Square square2) {
this.notifyUserActionObservers();
this._moveExeutor.registerPremove(square, square2);
}
public void removeUserActionObserver(final UserActionObserver userActionObserver) {
this._observers.remove(userActionObserver);
}
@Override
public boolean selectMove(final Move move) {
this.notifyUserActionObservers();
return this._moveSelector.selectMove(move);
}
public interface UserActionObserver
{
void userDidAction();
}
}
| [
"cm.sarmiento10@uniandes.edu.co"
] | cm.sarmiento10@uniandes.edu.co |
11f7b287cec1d240109cfe39fb880a4dd95b6835 | a7766ffe524fbb8fc98426e0a70b3f9ed04a318c | /java/maps-editor/src/main/java/org/openmetromaps/maps/editor/config/PermanentConfigWriter.java | 3a3c16c81c184b81083fcdf6f302c7e1200d7707 | [] | no_license | OpenMetroMaps/OpenMetroMaps | f1b295f000a207ddd385e537caa49595c4bb5e76 | 7e15580aa11ff05e39d5167a9b534372b527159c | refs/heads/master | 2022-05-15T23:16:41.294589 | 2022-04-06T06:44:26 | 2022-04-06T06:44:26 | 102,582,351 | 47 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,503 | java | // Copyright 2017 Sebastian Kuerten
//
// This file is part of OpenMetroMaps.
//
// OpenMetroMaps 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 3 of the License, or
// (at your option) any later version.
//
// OpenMetroMaps 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 OpenMetroMaps. If not, see <http://www.gnu.org/licenses/>.
package org.openmetromaps.maps.editor.config;
import java.io.IOException;
import java.io.OutputStream;
import org.dom4j.Document;
import org.dom4j.DocumentFactory;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
public class PermanentConfigWriter
{
public static void write(PermanentConfiguration configuration, OutputStream out)
throws IOException
{
DocumentFactory documentFactory = DocumentFactory.getInstance();
Document document = documentFactory.createDocument();
buildDocument(documentFactory, document, configuration);
OutputFormat pretty = OutputFormat.createPrettyPrint();
XMLWriter xmlWriter = new XMLWriter(pretty);
xmlWriter.setOutputStream(out);
xmlWriter.write(document);
}
private static void buildDocument(DocumentFactory documentFactory,
Document document, PermanentConfiguration configuration)
{
Element eConfiguration = documentFactory.createElement("configuration");
document.add(eConfiguration);
if (configuration.getLookAndFeel() != null) {
addOption(documentFactory, eConfiguration, "look-and-feel",
configuration.getLookAndFeel());
}
if (configuration.getDockingFramesTheme() != null) {
addOption(documentFactory, eConfiguration, "docking-frames-theme",
configuration.getDockingFramesTheme());
}
}
private static void addOption(DocumentFactory documentFactory,
Element eConfiguration, String name, String value)
{
Element eOption = documentFactory.createElement("option");
eOption.add(documentFactory.createAttribute(eOption, "name", name));
// convert null to ""
String v = value == null ? "" : value;
eOption.add(documentFactory.createAttribute(eOption, "value", v));
eConfiguration.add(eOption);
}
}
| [
"sebastian@topobyte.de"
] | sebastian@topobyte.de |
6ff5884b68368bae67bc79db34ae6c2d4024b38e | 19f7e40c448029530d191a262e5215571382bf9f | /decompiled/instagram/sources/com/instagram/modal/TransparentModalActivity.java | fd47dae9940e5a8010fedc3e6a17144a3e5eac1f | [] | no_license | stanvanrooy/decompiled-instagram | c1fb553c52e98fd82784a3a8a17abab43b0f52eb | 3091a40af7accf6c0a80b9dda608471d503c4d78 | refs/heads/master | 2022-12-07T22:31:43.155086 | 2020-08-26T03:42:04 | 2020-08-26T03:42:04 | 283,347,288 | 18 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,239 | java | package com.instagram.modal;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.C0003R;
import java.util.ArrayList;
import java.util.Collections;
import p000X.AnonymousClass0Z0;
import p000X.AnonymousClass2CD;
public class TransparentModalActivity extends ModalActivity {
public final boolean A0Y() {
return false;
}
public final void onSaveInstanceState(Bundle bundle) {
bundle.putStringArrayList("arg_cleanup_bottom_sheet_fragments", new ArrayList(Collections.singletonList("BottomSheetConstants.FRAGMENT_TAG")));
super.onSaveInstanceState(bundle);
}
public final void A0T() {
if (A0Y()) {
super.A0T();
} else {
setTheme(C0003R.style.IgTranslucentWindow);
}
}
public final void onCreate(Bundle bundle) {
int A00 = AnonymousClass0Z0.A00(-606044621);
if (bundle != null) {
AnonymousClass2CD.A00(bundle, bundle.getStringArrayList("arg_cleanup_bottom_sheet_fragments"));
}
super.onCreate(bundle);
AnonymousClass0Z0.A07(439224304, A00);
}
public final void onNewIntent(Intent intent) {
super.onNewIntent(intent);
A0Z(intent);
}
}
| [
"stan@rooy.works"
] | stan@rooy.works |
d5060f218ab11ed18d787029860a4d93b094bd4a | 8d05c1160446f403168b2132df3eee9ba2b6be08 | /app/src/main/java/yazdaniscodelab/ondemandfinalproject/ClientViewFragment/JobSeekerServiceDetailsActivity/Js_ItandSoftwareServiceDetailsActivity.java | 3a997d0532655244402f20614da9304e9d93fe10 | [] | no_license | Yazdani1/OnDemandService-Application | c6751465127617af33e91462d4506b4433821f42 | 7a0eba68ca1de7b26df8dfb95e6d9287dc0202b9 | refs/heads/master | 2020-04-07T21:25:56.475372 | 2018-12-22T12:12:55 | 2018-12-22T12:12:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 504 | java | package yazdaniscodelab.ondemandfinalproject.ClientViewFragment.JobSeekerServiceDetailsActivity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import yazdaniscodelab.ondemandfinalproject.R;
public class Js_ItandSoftwareServiceDetailsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_js__itand_software_service_details);
}
}
| [
"yaz4dani@gmail.com"
] | yaz4dani@gmail.com |
6b5f624d4af1f5e1234ec45a2a79dd879e60c33a | 699258f4346b9a4db5ef98ad3b7b5fd3621e50ee | /src/main/java/io/quarkus/arc/benchmarks/appbeans/AppBean20.java | 380312000bbfb817f2a87febfdc1b69bce199d60 | [
"Apache-2.0"
] | permissive | mkouba/arc-benchmarks | 3828fc33a1394023136335dc9b9cededce85f5a3 | 0b3536f490217ee9621d8a082c6cfb8286e96e10 | refs/heads/master | 2023-02-16T20:33:51.835507 | 2023-02-02T14:17:21 | 2023-02-02T14:17:21 | 215,313,316 | 0 | 2 | Apache-2.0 | 2021-03-25T12:40:11 | 2019-10-15T14:01:23 | Java | UTF-8 | Java | false | false | 210 | java | package io.quarkus.arc.benchmarks.appbeans;
import javax.enterprise.context.ApplicationScoped;
import io.quarkus.runtime.Startup;
@ApplicationScoped
@Startup
public class AppBean20 {
void ping() {
}
} | [
"mkouba@redhat.com"
] | mkouba@redhat.com |
34d2d10f16ace70d9a7139f482acd14b7df3f333 | 095448842c9c36e9f93a2c27c3d617c74f6a66dd | /src/main/java/net/lemonmodel/patterns/parser/Absyn/EVPSimple.java | 844eee07d2e13a651601ad5ec1586557c5a9d18f | [
"Apache-2.0"
] | permissive | geolffrey/lemon.patterns | cbe67a6c8db3c102f85750e0c6d2f2deb2fbdf4b | 279f7b6016a162880a66461b3973f1aad576aa5c | refs/heads/master | 2023-09-01T03:00:23.352024 | 2018-07-27T15:01:08 | 2018-07-27T15:01:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | package net.lemonmodel.patterns.parser.Absyn; // Java Package generated by the BNF Converter.
public class EVPSimple extends VP {
public final String string_;
public EVPSimple(String p1) { string_ = p1; }
public <R,A> R accept(net.lemonmodel.patterns.parser.Absyn.VP.Visitor<R,A> v, A arg) { return v.visit(this, arg); }
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof net.lemonmodel.patterns.parser.Absyn.EVPSimple) {
net.lemonmodel.patterns.parser.Absyn.EVPSimple x = (net.lemonmodel.patterns.parser.Absyn.EVPSimple)o;
return this.string_.equals(x.string_);
}
return false;
}
public int hashCode() {
return this.string_.hashCode();
}
}
| [
"john@mccr.ae"
] | john@mccr.ae |
c97d3adeff682568ce15f7e09123cded9f1cdf75 | dac548797905984302537804379f53736512bef4 | /yi-core/src/main/java/com/yi/core/commodity/domain/vo/ProductCommentVo.java | 8d9197a345b300899e4e61b2b5678accb14cdea5 | [] | no_license | TanoteAlex/yi | 4c593b71e3285e62775f6293b0c3c0633853bc6d | e877aca354180a3b77db4d2995eff569b6aa4292 | refs/heads/master | 2023-01-09T02:38:44.546467 | 2019-10-22T10:04:59 | 2019-10-22T10:04:59 | 216,754,013 | 0 | 1 | null | 2023-01-05T23:34:27 | 2019-10-22T07:48:51 | TypeScript | UTF-8 | Java | false | false | 3,971 | java | /*
* Powered By [yihz-framework]
* Web Site: yihz
* Since 2018 - 2018
*/
package com.yi.core.commodity.domain.vo;
import java.util.Date;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yihz.common.json.serializer.JsonTimestampSerializer;
import org.hibernate.validator.constraints.Length;
import com.yi.core.commodity.domain.simple.ProductSimple;
import com.yi.core.member.domain.simple.MemberSimple;
import com.yihz.common.convert.domain.VoDomain;
/**
* 商品评价
*
* @author lemosen
* @version 1.0
* @since 1.0
*
*/
public class ProductCommentVo extends VoDomain implements java.io.Serializable {
private static final long serialVersionUID = 1L;
// columns START
/**
* 评论ID
*/
@Max(9999999999L)
private int id;
/**
* GUID
*/
@Length(max = 64)
private String guid;
/**
* 商品(product表ID)
*/
@NotNull
private ProductSimple product;
/**
* 商品名称
*/
@Length(max = 64)
private String productName;
/**
* 会员(member表ID)
*/
@NotNull
private MemberSimple member;
/**
* 会员昵称
*/
@Length(max = 32)
private String nickname;
/**
* 编号
*/
@Length(max = 16)
private String serialNo;
/**
* 评价星级
*/
private Integer reviewStar;
/**
* 评价内容
*/
@Length(max = 256)
private String reviewContent;
/**
* 回复内容
*/
@Length(max = 256)
private String replyContent;
/**
* 是否显示(0不显示1显示)
*/
private Integer display;
/**
* 评价时间
*/
@JsonSerialize(using = JsonTimestampSerializer.class)
private Date reviewTime;
/**
* 回复时间
*/
@JsonSerialize(using = JsonTimestampSerializer.class)
private Date replyTime;
/**
* 删除(0否1是)
*/
@NotNull
private Integer deleted;
/**
* 删除时间
*/
private Date delTime;
// columns END
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getGuid() {
return this.guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public ProductSimple getProduct() {
return product;
}
public void setProduct(ProductSimple product) {
this.product = product;
}
public String getProductName() {
return this.productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public MemberSimple getMember() {
return member;
}
public void setMember(MemberSimple member) {
this.member = member;
}
public String getNickname() {
return this.nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getSerialNo() {
return this.serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public Integer getReviewStar() {
return this.reviewStar;
}
public void setReviewStar(Integer reviewStar) {
this.reviewStar = reviewStar;
}
public String getReviewContent() {
return this.reviewContent;
}
public void setReviewContent(String reviewContent) {
this.reviewContent = reviewContent;
}
public String getReplyContent() {
return this.replyContent;
}
public void setReplyContent(String replyContent) {
this.replyContent = replyContent;
}
public Integer getDisplay() {
return this.display;
}
public void setDisplay(Integer display) {
this.display = display;
}
public Date getReviewTime() {
return this.reviewTime;
}
public void setReviewTime(Date reviewTime) {
this.reviewTime = reviewTime;
}
public Date getReplyTime() {
return this.replyTime;
}
public void setReplyTime(Date replyTime) {
this.replyTime = replyTime;
}
public Integer getDeleted() {
return this.deleted;
}
public void setDeleted(Integer deleted) {
this.deleted = deleted;
}
public Date getDelTime() {
return this.delTime;
}
public void setDelTime(Date delTime) {
this.delTime = delTime;
}
} | [
"582175148@qq.com"
] | 582175148@qq.com |
20e1bef4bb792faae6430b1a2f989e3b7c6c495c | 06bb1087544f7252f6a83534c5427975f1a6cfc7 | /modules/ejbca-ejb-cli/src/org/ejbca/ui/cli/config/scep/DumpAllConfigCommand.java | 0e74cb57c7b03185e5541e2c21c9b3b4ebff678e | [] | no_license | mvilche/ejbca-ce | 65f2b54922eeb47aa7a132166ca5dfa862cee55b | a89c66218abed47c7b310c3999127409180969dd | refs/heads/master | 2021-03-08T08:51:18.636030 | 2020-03-12T18:53:18 | 2020-03-12T18:53:18 | 246,335,702 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,679 | java | /*************************************************************************
* *
* EJBCA Community: The OpenSource Certificate Authority *
* *
* This software 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 any later version. *
* *
* See terms of license at gnu.org. *
* *
*************************************************************************/
package org.ejbca.ui.cli.config.scep;
import java.util.Enumeration;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.cesecore.authorization.AuthorizationDeniedException;
import org.ejbca.config.ScepConfiguration;
import org.ejbca.ui.cli.infrastructure.command.CommandResult;
import org.ejbca.ui.cli.infrastructure.parameter.ParameterContainer;
/**
* @version $Id: DumpAllConfigCommand.java 26057 2017-06-22 08:08:34Z anatom $
*
*/
public class DumpAllConfigCommand extends BaseScepConfigCommand {
private static final Logger log = Logger.getLogger(DumpAllConfigCommand.class);
@Override
public String getMainCommand() {
return "dumpall";
}
@Override
public CommandResult execute(ParameterContainer parameters) {
Properties properties;
try {
properties = getGlobalConfigurationSession().getAllProperties(getAuthenticationToken(),
ScepConfiguration.SCEP_CONFIGURATION_ID);
} catch (AuthorizationDeniedException e) {
log.error("CLI user is not authorized to dump configuration.");
return CommandResult.AUTHORIZATION_FAILURE;
}
Enumeration<Object> enumeration = properties.keys();
while (enumeration.hasMoreElements()) {
String key = (String) enumeration.nextElement();
log.info(" " + key + " = " + properties.getProperty(key));
}
return CommandResult.SUCCESS;
}
@Override
public String getCommandDescription() {
return "Shows all current SCEP configurations.";
}
@Override
public String getFullHelpText() {
return getCommandDescription();
}
@Override
protected Logger getLogger() {
return log;
}
}
| [
"mfvilche@gmail.com"
] | mfvilche@gmail.com |
ef9820a6be344b67fe76f574239750d32f9cf43f | 2f5cd5ba8a78edcddf99c7e3c9c19829f9dbd214 | /java/playgrounds/.svn/pristine/ef/ef9820a6be344b67fe76f574239750d32f9cf43f.svn-base | 697f12d15f9fcd1ec711d878c1b2cfb25e9dadb3 | [] | no_license | HTplex/Storage | 5ff1f23dfe8c05a0a8fe5354bb6bbc57cfcd5789 | e94faac57b42d6f39c311f84bd4ccb32c52c2d30 | refs/heads/master | 2021-01-10T17:43:20.686441 | 2016-04-05T08:56:57 | 2016-04-05T08:56:57 | 55,478,274 | 1 | 1 | null | 2020-10-28T20:35:29 | 2016-04-05T07:43:17 | Java | UTF-8 | Java | false | false | 7,289 | /* *********************************************************************** *
* project: org.matsim.*
* ParallelCASimEngine.java
* *
* *********************************************************************** *
* *
* copyright : (C) 2013 by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* 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 2 of the License, or *
* (at your option) any later version. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* *********************************************************************** */
package playground.christoph.mobsim.ca2;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import org.matsim.api.core.v01.network.Link;
import org.matsim.core.gbl.Gbl;
import org.matsim.core.mobsim.qsim.InternalInterface;
import org.matsim.core.mobsim.qsim.interfaces.Netsim;
import org.matsim.core.mobsim.qsim.qnetsimengine.NetsimNode;
class ParallelCASimEngine extends CASimEngine {
private final int numOfThreads;
private Thread[] threads;
private CASimEngineRunner[] engines;
private CyclicBarrier startBarrier;
private CyclicBarrier separationBarrier; // separates moveNodes and moveLinks
private CyclicBarrier endBarrier;
// use the factory
/*package*/ ParallelCASimEngine(Netsim sim, double spatialResolution) {
super(sim, spatialResolution);
this.numOfThreads = this.getMobsim().getScenario().getConfig().qsim().getNumberOfThreads();
}
@Override
public void setInternalInterface(InternalInterface internalInterface) {
super.setInternalInterface(internalInterface);
/*
* If the engines have already been created, hand the internalinterface
* over to them.
*/
if (this.engines != null) {
for (CASimEngineRunner engine : engines) {
engine.setInternalInterface(internalInterface);
}
}
}
@Override
public void onPrepareSim() {
super.onPrepareSim();
initMultiModalSimEngineRunners();
}
/*
* The Threads are waiting at the startBarrier. We trigger them by reaching this Barrier.
* Now the Threads will start moving the Nodes and Links. We wait until all of them reach
* the endBarrier to move on. We should not have any Problems with Race Conditions because
* even if the Threads would be faster than this Thread, means they reach the endBarrier
* before this Method does, it should work anyway.
*/
@Override
public void doSimStep(final double time) {
try {
// set current Time
for (CASimEngineRunner engine : this.engines) {
engine.doSimStep(time);
}
/*
* Triggering the barrier will cause calls to moveLinks and moveNodes
* in the threads.
*/
this.startBarrier.await();
this.endBarrier.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (BrokenBarrierException e) {
throw new RuntimeException(e);
}
this.printSimLog(time);
}
@Override
/*package*/ void moveNodes(final double time) {
throw new RuntimeException("This method should never be called - calls should go to the MultiModalSimEngineRunner Threads.");
}
@Override
/*package*/ void moveLinks(final double time) {
throw new RuntimeException("This method should never be called - calls should go to the MultiModalSimEngineRunner Threads.");
}
@Override
public void afterSim() {
/*
* Calling the afterSim Method of the QSimEngineThreads
* will set their simulationRunning flag to false.
*/
for (CASimEngineRunner engine : this.engines) {
engine.afterSim();
}
/*
* Triggering the startBarrier of the MultiModalSimEngineRunners.
* They will check whether the Simulation is still running.
* It is not, so the Threads will stop running.
*/
try {
this.startBarrier.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (BrokenBarrierException e) {
throw new RuntimeException(e);
}
// wait until each thread is finished
try {
for (Thread thread : this.threads) {
thread.join();
}
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
super.afterSim();
}
@Override
public void activateLink(CALink link) {
throw new RuntimeException("This method should never be called - calls should go to the MultiModalSimEngineRunner Threads.");
}
@Override
public void activateNode(CANode node) {
throw new RuntimeException("This method should never be called - calls should go to the MultiModalSimEngineRunner Threads.");
}
@Override
public int getNumberOfSimulatedLinks() {
int numLinks = 0;
for (CASimEngineRunner engine : this.engines) {
numLinks = numLinks + engine.getNumberOfSimulatedLinks();
}
return numLinks;
}
@Override
public int getNumberOfSimulatedNodes() {
int numNodes = 0;
for (CASimEngineRunner engine : this.engines) {
numNodes = numNodes + engine.getNumberOfSimulatedNodes();
}
return numNodes;
}
private void initMultiModalSimEngineRunners() {
this.threads = new Thread[numOfThreads];
this.engines = new CASimEngineRunner[numOfThreads];
this.startBarrier = new CyclicBarrier(numOfThreads + 1);
this.separationBarrier = new CyclicBarrier(numOfThreads);
this.endBarrier = new CyclicBarrier(numOfThreads + 1);
// setup runners
for (int i = 0; i < numOfThreads; i++) {
CASimEngineRunner engine = new CASimEngineRunner(startBarrier,
separationBarrier, endBarrier, this.getMobsim(), this.getSpatialResoluation(), this);
engine.setInternalInterface(this.internalInterface);
Thread thread = new Thread(engine);
thread.setName("MultiModalSimEngineRunner" + i);
thread.setDaemon(true); // make the Thread Daemons so they will terminate automatically
this.threads[i] = thread;
this.engines[i] = engine;
thread.start();
}
// assign the Links and Nodes to the SimEngines
assignSimEngines();
}
private void assignSimEngines() {
int roundRobin = 0;
for (NetsimNode node : this.getMobsim().getNetsimNetwork().getNetsimNodes().values()) {
CASimEngine simEngine = engines[roundRobin % this.numOfThreads];
super.getCANode(node.getNode().getId()).setMultiModalSimEngine(simEngine);
/*
* Assign each link to its in-node to ensure that they are processed by the same
* thread which should avoid running into some race conditions.
*/
for (Link l : node.getNode().getOutLinks().values()) {
super.getCALink(l.getId()).setCASimEngine(simEngine);
}
roundRobin++;
}
}
}
| [
"htplex@gmail.com"
] | htplex@gmail.com | |
b2fb96fa708493cec2f34270a1b19e6853978cb3 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /adp-20210720/src/main/java/com/aliyun/adp20210720/models/ListEnvironmentLicensesRequest.java | b3602cfe3f2542eeb956f40e1eb7ab4e32151555 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,409 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.adp20210720.models;
import com.aliyun.tea.*;
public class ListEnvironmentLicensesRequest extends TeaModel {
@NameInMap("pageNum")
public Integer pageNum;
@NameInMap("pageSize")
public Integer pageSize;
@NameInMap("scope")
public String scope;
@NameInMap("type")
public String type;
public static ListEnvironmentLicensesRequest build(java.util.Map<String, ?> map) throws Exception {
ListEnvironmentLicensesRequest self = new ListEnvironmentLicensesRequest();
return TeaModel.build(map, self);
}
public ListEnvironmentLicensesRequest setPageNum(Integer pageNum) {
this.pageNum = pageNum;
return this;
}
public Integer getPageNum() {
return this.pageNum;
}
public ListEnvironmentLicensesRequest setPageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
public Integer getPageSize() {
return this.pageSize;
}
public ListEnvironmentLicensesRequest setScope(String scope) {
this.scope = scope;
return this;
}
public String getScope() {
return this.scope;
}
public ListEnvironmentLicensesRequest setType(String type) {
this.type = type;
return this;
}
public String getType() {
return this.type;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
e596f3ed4d8dafda8493459548ff14379973f5d1 | e73f274263009db014729a8775a3606ebfe87127 | /src/com/pax/spos/utils/net/toolbox/JsonRequest.java | 9fa3d41ab8f6eea64a57cca466f5a54febb0f938 | [] | no_license | fabletang/toolbox | 48a6db83c3e3dfa88ab6315036a493e003ee6a83 | 80119b0fb28132e7b334119bc47423fea076dbcb | refs/heads/master | 2021-01-23T03:16:27.030128 | 2014-09-08T15:41:06 | 2014-09-08T15:41:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,339 | java | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pax.spos.utils.net.toolbox;
import com.pax.spos.utils.net.NetworkResponse;
import com.pax.spos.utils.net.Request;
import com.pax.spos.utils.net.Response;
import com.pax.spos.utils.net.Response.ErrorListener;
import com.pax.spos.utils.net.Response.Listener;
import com.pax.spos.utils.net.VolleyLog;
import java.io.UnsupportedEncodingException;
/**
* A request for retrieving a T type response body at a given URL that also
* optionally sends along a JSON body in the request specified.
*
* @param <T> JSON type of response expected
*/
public abstract class JsonRequest<T> extends Request<T> {
/** Charset for request. */
private static final String PROTOCOL_CHARSET = "utf-8";
/** Content type for request. */
private static final String PROTOCOL_CONTENT_TYPE =
String.format("application/json; charset=%s", PROTOCOL_CHARSET);
private final Listener<T> mListener;
private final String mRequestBody;
/**
* Deprecated constructor for a JsonRequest which defaults to GET unless {@link #getPostBody()}
* or {@link #getPostParams()} is overridden (which defaults to POST).
*
* @deprecated Use {@link #JsonRequest(int, String, String, Listener, ErrorListener)}.
*/
public JsonRequest(String url, String requestBody, Listener<T> listener,
ErrorListener errorListener) {
this(Method.DEPRECATED_GET_OR_POST, url, requestBody, listener, errorListener);
}
public JsonRequest(int method, String url, String requestBody, Listener<T> listener,
ErrorListener errorListener) {
super(method, url, errorListener);
mListener = listener;
mRequestBody = requestBody;
}
@Override
protected void deliverResponse(T response) {
mListener.onResponse(response);
}
@Override
abstract protected Response<T> parseNetworkResponse(NetworkResponse response);
/**
* @deprecated Use {@link #getBodyContentType()}.
*/
@Override
public String getPostBodyContentType() {
return getBodyContentType();
}
/**
* @deprecated Use {@link #getBody()}.
*/
@Override
public byte[] getPostBody() {
return getBody();
}
@Override
public String getBodyContentType() {
return PROTOCOL_CONTENT_TYPE;
}
@Override
public byte[] getBody() {
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s",
mRequestBody, PROTOCOL_CHARSET);
return null;
}
}
}
| [
"tanghai@paxsz.com"
] | tanghai@paxsz.com |
e52312224b7f07998263604f6788b6db9cfb2848 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/ss/sls/brmgr/ds/SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet.java | 635352660bace07accb8c5a20d98f5966e92ee30 | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 3,023 | java | /***************************************************************************************************
* 파일명 : SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet.java
* 기능 : 지국경영-부수증감-본지신청(부수담당)-저장을 위한 DataSet
* 작성일자 : 2004-04-24
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.ss.sls.brmgr.ds;
import java.sql.*;
import java.util.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.ss.sls.brmgr.dm.*;
import chosun.ciis.ss.sls.brmgr.rec.*;
/**
* 지국경영-부수증감-본지신청(부수담당)-저장을 위한 DataSet
*/
public class SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{
public String errcode;
public String errmsg;
public SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet(){}
public SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet(String errcode, String errmsg){
this.errcode = errcode;
this.errmsg = errmsg;
}
public void setErrcode(String errcode){
this.errcode = errcode;
}
public void setErrmsg(String errmsg){
this.errmsg = errmsg;
}
public String getErrcode(){
return this.errcode;
}
public String getErrmsg(){
return this.errmsg;
}
public void getValues(CallableStatement cstmt) throws SQLException{
this.errcode = Util.checkString(cstmt.getString(1));
this.errmsg = Util.checkString(cstmt.getString(2));
}
}/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오.
<%
SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet ds = (SS_U_QTYAPLC_MAIN_NWSP_CLOSDataSet)request.getAttribute("ds");
%>
Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오.
<%= ds.getErrcode()%>
<%= ds.getErrmsg()%>
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Thu Jun 03 13:10:05 KST 2004 */
| [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
8ae44662cc7509f36b6e8ab4df50958e158ac317 | 0f3d1c13615779d74bf280d455e4a82c0d60ff3c | /imooc-vedio-dev-pojo/src/main/java/com/imooc/pojo/UsersLikeVideos.java | 9647990e4a48d9986e0fee6bd5af9997833dc15a | [] | no_license | tengdingxing/wxvedio | a0e84e5c28205e5368cc8ee087d2ecd127cf9f03 | 43f75e096ac92b14da1fb632607ea910d3d05564 | refs/heads/master | 2022-12-22T22:47:05.976536 | 2020-09-15T10:48:40 | 2020-09-15T10:48:40 | 294,698,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,580 | java | package com.imooc.pojo;
public class UsersLikeVideos {
public UsersLikeVideos() {
}
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column users_like_videos.id
*
* @mbggenerated
*/
private String id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column users_like_videos.user_id
*
* @mbggenerated
*/
private String userId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column users_like_videos.video_id
*
* @mbggenerated
*/
private String videoId;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column users_like_videos.id
*
* @return the value of users_like_videos.id
*
* @mbggenerated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column users_like_videos.id
*
* @param id the value for users_like_videos.id
*
* @mbggenerated
*/
public void setId(String id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column users_like_videos.user_id
*
* @return the value of users_like_videos.user_id
*
* @mbggenerated
*/
public String getUserId() {
return userId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column users_like_videos.user_id
*
* @param userId the value for users_like_videos.user_id
*
* @mbggenerated
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column users_like_videos.video_id
*
* @return the value of users_like_videos.video_id
*
* @mbggenerated
*/
public String getVideoId() {
return videoId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column users_like_videos.video_id
*
* @param videoId the value for users_like_videos.video_id
*
* @mbggenerated
*/
public void setVideoId(String videoId) {
this.videoId = videoId;
}
} | [
"123456"
] | 123456 |
f36e6d555d8c2e748b1582794a6357b3dd92258d | dc81649732414dee4d552a240b25cb3d055799b1 | /src/test/java/org/assertj/core/internal/files/Files_assertIsDirectoryContaining_Predicate_Test.java | 92e72979916f84cc7565a2c57e7a3a3a100db80c | [
"Apache-2.0"
] | permissive | darkliang/assertj-core | e40de697a5ac19db7a652178963a523dfe6f89ff | 4a25dab7b99f292d158dc8118ac84dc7b4933731 | refs/heads/integration | 2021-05-16T23:22:49.013854 | 2020-05-31T12:36:31 | 2020-05-31T12:36:31 | 250,513,505 | 1 | 0 | Apache-2.0 | 2020-06-02T09:25:54 | 2020-03-27T11:11:36 | Java | UTF-8 | Java | false | false | 5,981 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright 2012-2020 the original author or authors.
*/
package org.assertj.core.internal.files;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNullPointerException;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.error.ShouldBeDirectory.shouldBeDirectory;
import static org.assertj.core.error.ShouldContain.directoryShouldContain;
import static org.assertj.core.internal.Files.toFileNames;
import static org.assertj.core.util.AssertionsUtil.expectAssertionError;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.core.util.Lists.emptyList;
import static org.assertj.core.util.Lists.list;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.verify;
import java.io.File;
import java.io.FileFilter;
import java.util.List;
import java.util.function.Predicate;
import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.Files;
import org.assertj.core.internal.FilesBaseTest;
import org.junit.jupiter.api.Test;
/**
* Tests for <code>{@link Files#assertIsDirectoryContaining(AssertionInfo, File, Predicate)}</code>
*
* @author Valeriy Vyrva
*/
public class Files_assertIsDirectoryContaining_Predicate_Test extends FilesBaseTest {
private static final Predicate<File> JAVA_SOURCE = file -> file.getName().endsWith(".java");
@Test
public void should_pass_if_actual_contains_a_file_matching_the_given_predicate() {
// GIVEN
File file = mockRegularFile("Test.java");
List<File> items = list(file);
// WHEN
File actual = mockDirectory(items, "root");
// THEN
files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE);
}
@Test
public void should_pass_if_all_actual_files_match_the_given_predicate() {
// GIVEN
File file1 = mockRegularFile("Test.java");
File file2 = mockRegularFile("Utils.java");
List<File> items = list(file1, file2);
// WHEN
File actual = mockDirectory(items, "root");
// THEN
files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE);
}
@Test
public void should_pass_if_actual_contains_at_least_one_file_matching_the_given_predicate() {
// GIVEN
File file1 = mockRegularFile("Test.class");
File file2 = mockRegularFile("Test.java");
File file3 = mockRegularFile("Utils.class");
File file4 = mockRegularFile("Utils.java");
File file5 = mockRegularFile("application.yml");
List<File> items = list(file1, file2, file3, file4, file5);
// WHEN
File actual = mockDirectory(items, "root");
// THEN
files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE);
}
@Test
public void should_throw_npe_if_filter_is_null() {
// GIVEN
Predicate<File> filter = null;
// THEN
assertThatNullPointerException().isThrownBy(() -> files.assertIsDirectoryContaining(INFO, null, filter))
.withMessage("The files filter should not be null");
}
@Test
public void should_fail_if_actual_is_null() {
// GIVEN
File actual = null;
// WHEN
AssertionError error = expectAssertionError(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
assertThat(error).hasMessage(actualIsNull());
}
@Test
public void should_fail_if_actual_does_not_exist() {
// GIVEN
given(actual.exists()).willReturn(false);
// WHEN
expectAssertionError(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
verify(failures).failure(INFO, shouldBeDirectory(actual));
}
@Test
public void should_fail_if_actual_exists_but_is_not_a_directory() {
// GIVEN
given(actual.exists()).willReturn(true);
given(actual.isDirectory()).willReturn(false);
// WHEN
expectAssertionError(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
verify(failures).failure(INFO, shouldBeDirectory(actual));
}
@Test
public void should_throw_error_on_null_directory_listing() {
// GIVEN
given(actual.exists()).willReturn(true);
given(actual.isDirectory()).willReturn(true);
given(actual.listFiles(any(FileFilter.class))).willReturn(null);
// WHEN
Throwable error = catchThrowable(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
assertThat(error).isInstanceOf(NullPointerException.class)
.hasMessage("Directory listing should not be null");
}
@Test
public void should_fail_if_actual_is_empty() {
// GIVEN
List<File> items = emptyList();
File actual = mockDirectory(items, "root");
// WHEN
expectAssertionError(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
verify(failures).failure(INFO, directoryShouldContain(actual, emptyList(), "the given filter"));
}
@Test
public void should_fail_if_actual_does_not_contain_any_files_matching_the_given_predicate() {
// GIVEN
File file = mockRegularFile("root", "Test.class");
List<File> items = list(file);
File actual = mockDirectory(items, "root");
// WHEN
expectAssertionError(() -> files.assertIsDirectoryContaining(INFO, actual, JAVA_SOURCE));
// THEN
verify(failures).failure(INFO, directoryShouldContain(actual, toFileNames(items), "the given filter"));
}
}
| [
"joel.costigliola@gmail.com"
] | joel.costigliola@gmail.com |
86c1d27f2b4567e8192e5dad59780920c19aa951 | 765dab7f9b1834cb0693929c0c30032770b390b2 | /progwards/src/test/java/ru/progwards/java2/lessons/tests/SimpleCalculatorDivTest.java | 33bb2e8bba358f3a2648a5d73f44dfec5397871e | [] | no_license | Massimilian/antispam | 74dc9accbe880c0c0e883150c3ef4c29540f4e1c | 3af9a536aef5e1e034b705b5544a2df8dd0d5ff5 | refs/heads/master | 2022-12-28T07:50:56.495532 | 2020-09-22T08:22:58 | 2020-09-22T08:22:58 | 284,681,830 | 0 | 0 | null | 2020-10-14T00:08:59 | 2020-08-03T11:27:15 | Java | UTF-8 | Java | false | false | 1,031 | java | package ru.progwards.java2.lessons.tests;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
@RunWith(Parameterized.class)
public class SimpleCalculatorDivTest {
private SimpleCalculator sc = new SimpleCalculator();
public int val1;
public int val2;
public int result;
public SimpleCalculatorDivTest(int val1, int val2, int result) {
this.val1 = val1;
this.val2 = val2;
this.result = result;
}
@Parameterized.Parameters() // name = "Test №{index}: {0} / {1} = {2}"
public static Iterable<Object> forTest() {
return Arrays.asList(new Object[][]{
{6, 3, 2},
{200, -200, -1},
{0, Integer.MIN_VALUE, 0},
{-9000, -1000, 9},
{99999999, 3, 33333333}
});
}
@Test
public void WhenTryToSumValuesThenDoIt() {
Assert.assertEquals(sc.div(val1, val2), result);
}
}
| [
"vasalekmas@gmail.com"
] | vasalekmas@gmail.com |
c5af35e028f9db4c5d890f58aa9e414e37e0ccc4 | 7c1a70d7c314c67930b09131ded68da5a5a698a5 | /src/com/kan/base/dao/inf/management/SkillDao.java | dee38bf292251b5b93a0bf3e5fc5230aaba3a054 | [] | no_license | sunwenjie/hris_pro | 8d21c8e2955438086d3bbbacaad7511b3423b3a0 | dfd2a598604f4dc98d5e6e57671e3d479974610c | refs/heads/master | 2020-12-02T22:17:10.263131 | 2017-07-03T12:36:41 | 2017-07-03T12:36:41 | 96,108,657 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,249 | java | package com.kan.base.dao.inf.management;
import java.util.List;
import org.apache.ibatis.session.RowBounds;
import com.kan.base.domain.management.SkillVO;
import com.kan.base.util.KANException;
public interface SkillDao
{
public abstract int countSkillVOsByCondition( final SkillVO skillVO ) throws KANException;
public abstract List< Object > getSkillVOsByCondition( final SkillVO skillVO ) throws KANException;
public abstract List< Object > getSkillVOsByCondition( final SkillVO skillVO, RowBounds rowBounds ) throws KANException;
public abstract SkillVO getSkillVOBySkillId( final String skillId ) throws KANException;
public abstract int updateSkill( final SkillVO skillVO ) throws KANException;
public abstract int insertSkill( final SkillVO skillVO ) throws KANException;
public abstract int deleteSkill( final SkillVO skillVO ) throws KANException;
public abstract List< Object > getSkillVOsByParentSkillId( final SkillVO skillVO ) throws KANException;
public abstract List< Object > getSkillBaseViewsByAccountId( final String accountId ) throws KANException;
public abstract List< Object > getSkillBaseViewsByClientId( final SkillVO skillVO ) throws KANException;
}
| [
"wenjie.sun@i-click.com"
] | wenjie.sun@i-click.com |
da14769321d6918f3c5e9415180593f7bbf5684e | c753b739b8e5484c0251113b797c442ef0b3bb49 | /src/org/greatfree/testing/message/RegisterMemoryServerNotification.java | f8a01f6b232917b7f4d6c5c29e2d9d2f5d4fe1d8 | [] | no_license | 640351963/Wind | 144c0e9e9f3fdf3ee398f9f1a26a3434ca2dfabf | 0493d95a1fa8de2de218e651e8ce16be00b8ba38 | refs/heads/master | 2023-05-03T03:17:06.737980 | 2021-05-22T19:24:41 | 2021-05-22T19:24:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 801 | java | package org.greatfree.testing.message;
import org.greatfree.message.ServerMessage;
/*
* This is the notification for a memory server to register on the coordinator. 11/28/2014, Bing Li
*/
// Created: 11/28/2014, Bing Li
public class RegisterMemoryServerNotification extends ServerMessage
{
private static final long serialVersionUID = -6985005756162124112L;
// The key of the memory server. Here, DC stands for the term, distributed component. 11/28/2014, Bing Li
private String dcKey;
/*
* Initialize. 11/28/2014, Bing Li
*/
public RegisterMemoryServerNotification(String dcKey)
{
super(MessageType.REGISTER_MEMORY_SERVER_NOTIFICATION);
this.dcKey = dcKey;
}
/*
* Expose the key of the memory. 11/28/2014, Bing Li
*/
public String getDCKey()
{
return this.dcKey;
}
}
| [
"bing.li@asu.edu"
] | bing.li@asu.edu |
0c5710c80dde2a398ec19209f6c6a6183c465c6f | b35b03d46c77983a2756972cff0cac50c9ae9329 | /wms-ib/wms-ib-domain/src/main/java/io/wms/ib/domain/step/shelving/addtask/PersistStep.java | a241add83ba820e4642821799cac34aafb9603f1 | [
"Apache-2.0"
] | permissive | haokinglong/dddplus-archetype-demo | 0065de65d6991f44060915c9112da25e859c118e | d78bac2ca9f860e7f4f2670b5b3f0d7c1084e442 | refs/heads/main | 2023-01-05T21:54:23.891329 | 2020-11-03T02:36:00 | 2020-11-03T02:36:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 744 | java | package io.wms.ib.domain.step.shelving.addtask;
import io.github.dddplus.annotation.Step;
import io.wms.ib.domain.facade.repository.IShelvingTaskRepository;
import io.wms.ib.domain.model.ShelvingTask;
import io.wms.ib.domain.step.shelving.AddShelvingTaskStep;
import io.wms.ib.spec.Steps;
import io.wms.ib.spec.ext.IbException;
import javax.annotation.Resource;
@Step
public class PersistStep extends AddShelvingTaskStep {
@Resource
private IShelvingTaskRepository shelvingTaskRepository;
@Override
public void execute(ShelvingTask model) throws IbException {
shelvingTaskRepository.saveTask(model);
}
@Override
public String stepCode() {
return Steps.AddShelvingTask.StepCode.Persist;
}
}
| [
"funky.gao@gmail.com"
] | funky.gao@gmail.com |
4eb8fff6e8d1bc26ebfaef8f14904dc7dcb71198 | f20f21cb9f71fff24ef6145e052daa585a2cedaa | /src/RobotFrameworkCore/org.robotframework.ide.core-functions/src/main/java/org/rf/ide/core/testdata/mapping/variables/DictionaryVariableValueMapper.java | 387ed55951dfd59be15ee46e3604bb8e564077f8 | [
"Apache-2.0"
] | permissive | kackaz/RED | 5b5abaef3e457da2aa1d0c83751d3eacfd52e068 | 08444c373b76b718405dface8494859acc1ddc41 | refs/heads/master | 2020-03-17T16:50:47.489700 | 2018-05-16T09:47:04 | 2018-05-16T10:08:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,422 | java | /*
* Copyright 2015 Nokia Solutions and Networks
* Licensed under the Apache License, Version 2.0,
* see license.txt file for details.
*/
package org.rf.ide.core.testdata.mapping.variables;
import java.util.List;
import java.util.Stack;
import org.rf.ide.core.testdata.mapping.table.IParsingMapper;
import org.rf.ide.core.testdata.mapping.table.ParsingStateHelper;
import org.rf.ide.core.testdata.mapping.table.SpecialEscapedCharactersExtractor;
import org.rf.ide.core.testdata.mapping.table.SpecialEscapedCharactersExtractor.NamedSpecial;
import org.rf.ide.core.testdata.mapping.table.SpecialEscapedCharactersExtractor.Special;
import org.rf.ide.core.testdata.model.FilePosition;
import org.rf.ide.core.testdata.model.RobotFileOutput;
import org.rf.ide.core.testdata.model.table.VariableTable;
import org.rf.ide.core.testdata.model.table.variables.AVariable;
import org.rf.ide.core.testdata.model.table.variables.DictionaryVariable;
import org.rf.ide.core.testdata.model.table.variables.IVariableHolder;
import org.rf.ide.core.testdata.text.read.IRobotTokenType;
import org.rf.ide.core.testdata.text.read.ParsingState;
import org.rf.ide.core.testdata.text.read.RobotLine;
import org.rf.ide.core.testdata.text.read.recognizer.RobotToken;
import org.rf.ide.core.testdata.text.read.recognizer.RobotTokenType;
import com.google.common.annotations.VisibleForTesting;
public class DictionaryVariableValueMapper implements IParsingMapper {
private final ParsingStateHelper stateHelper;
private final SpecialEscapedCharactersExtractor escapedExtractor;
public DictionaryVariableValueMapper() {
this.stateHelper = new ParsingStateHelper();
this.escapedExtractor = new SpecialEscapedCharactersExtractor();
}
@Override
public RobotToken map(final RobotLine currentLine,
final Stack<ParsingState> processingState,
final RobotFileOutput robotFileOutput, final RobotToken rt, final FilePosition fp,
final String text) {
final List<IRobotTokenType> types = rt.getTypes();
types.remove(RobotTokenType.UNKNOWN);
types.add(0, RobotTokenType.VARIABLES_VARIABLE_VALUE);
final VariableTable variableTable = robotFileOutput.getFileModel()
.getVariableTable();
final List<AVariable> variables = variableTable.getVariables();
if (!variables.isEmpty()) {
final IVariableHolder var = variables.get(variables.size() - 1);
final KeyValuePair keyValPair = splitKeyNameFromValue(rt);
((DictionaryVariable) var).put(rt, keyValPair.getKey(),
keyValPair.getValue());
} else {
// FIXME: some error
}
processingState.push(ParsingState.DICTIONARY_VARIABLE_VALUE);
return rt;
}
@VisibleForTesting
protected KeyValuePair splitKeyNameFromValue(final RobotToken raw) {
final List<Special> extract = escapedExtractor.extract(raw.getText());
boolean isValue = false;
final StringBuilder keyText = new StringBuilder();
final StringBuilder keyTextRaw = new StringBuilder();
final StringBuilder valueText = new StringBuilder();
final StringBuilder valueTextRaw = new StringBuilder();
for (final Special special : extract) {
final String specialRawText = special.getText();
if (special.getType() == NamedSpecial.UNKNOWN_TEXT) {
if (isValue) {
valueText.append(specialRawText);
valueTextRaw.append(specialRawText);
} else {
final int equalsIndex = specialRawText.indexOf('=');
if (equalsIndex > -1) {
final String keyPart = specialRawText.substring(0,
equalsIndex);
final String valuePart = specialRawText
.substring(equalsIndex + 1);
keyText.append(keyPart);
keyTextRaw.append(keyPart);
valueText.append(valuePart);
valueTextRaw.append(valuePart);
isValue = true;
} else {
keyText.append(specialRawText);
keyTextRaw.append(specialRawText);
}
}
} else {
if (isValue) {
valueText.append(special.getType().getNormalized());
valueTextRaw.append(specialRawText);
} else {
keyText.append(special.getType().getNormalized());
keyTextRaw.append(specialRawText);
}
}
}
final RobotToken key = new RobotToken();
key.setLineNumber(raw.getLineNumber());
key.setStartColumn(raw.getStartColumn());
key.setRaw(keyTextRaw.toString());
key.setText(keyText.toString());
key.setType(RobotTokenType.VARIABLES_DICTIONARY_KEY);
final RobotToken value = new RobotToken();
value.setLineNumber(raw.getLineNumber());
if (valueText.length() > 0) {
value.setStartColumn(key.getEndColumn() + 1);
} else {
value.setStartColumn(key.getEndColumn());
}
value.setRaw(valueTextRaw.toString());
value.setText(valueText.toString());
value.setType(RobotTokenType.VARIABLES_DICTIONARY_VALUE);
return new KeyValuePair(key, value);
}
protected class KeyValuePair {
private final RobotToken key;
private final RobotToken value;
public KeyValuePair(final RobotToken key, final RobotToken value) {
this.key = key;
this.value = value;
}
public RobotToken getKey() {
return key;
}
public RobotToken getValue() {
return value;
}
}
@Override
public boolean checkIfCanBeMapped(final RobotFileOutput robotFileOutput,
final RobotLine currentLine, final RobotToken rt, final String text,
final Stack<ParsingState> processingState) {
final ParsingState state = stateHelper.getCurrentStatus(processingState);
return (state == ParsingState.DICTIONARY_VARIABLE_DECLARATION || state == ParsingState.DICTIONARY_VARIABLE_VALUE);
}
}
| [
"CI-nokia@users.noreply.github.com"
] | CI-nokia@users.noreply.github.com |
e453527b83781873f85e4045e635235260ab5d2a | c4c1f4ba04e6e94b17473934fe5d725d3216ced9 | /src/main/edp/com/el/edp/sec/domain/EdpAuthRole.java | 84efa861dddf92087ab4456ebca21338324dc797 | [] | no_license | rmzf9192/gy-b2b-svr | 083c6ea362de362191c7d38d3c67b7d0b9704853 | adab150483a26868879641938045ed3f3b29b7c3 | refs/heads/master | 2020-05-19T19:54:00.643603 | 2019-05-06T12:21:19 | 2019-05-06T12:21:22 | 185,190,823 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package com.el.edp.sec.domain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.Size;
/**
* @author neo.pan
* @since 17/8/9
*/
@Data
@EqualsAndHashCode(of = "id")
public class EdpAuthRole {
/**
* ID
*/
private Long id;
/**
* 用户层级
*/
private EdpAuthLayer layer;
/**
* 用户领域
*/
private String field;
/**
* 租户ID
*/
private Long tenantId;
/**
* 角色名称
*/
@Size(min = 1, max = 40)
private String name;
/**
* 是否禁用
*/
private boolean deleteFlag;
}
| [
"goodMorning_pro@163.com"
] | goodMorning_pro@163.com |
a9264050d4c8acbe5d89020fce712c368d8b6425 | 03a08b97d547eee0d1bdada9fab74b8cd8321450 | /deeplearning4j-core/src/test/java/org/deeplearning4j/util/MatrixUtilTests.java | 66176a21ff7ad98528fd7dd744e1e81a16672b97 | [] | no_license | YesBarJALL/java-deeplearning | b3d3df6d3eb7fba5ab5dfccf0ab8f286ea2fea10 | 80ef4a8afc21ad5c3a5453d2054553f329b525d7 | refs/heads/master | 2020-12-29T02:54:44.557329 | 2014-09-01T14:41:36 | 2014-09-01T14:41:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,192 | java | package org.deeplearning4j.util;
import static org.junit.Assert.*;
import org.jblas.DoubleMatrix;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MatrixUtilTests {
private static Logger log = LoggerFactory.getLogger(MatrixUtilTests.class);
@Test
public void testFlip() {
DoubleMatrix d = new DoubleMatrix(new double[][]{
{1,2},
{3,4}
});
DoubleMatrix flipped = new DoubleMatrix(new double[][]{
{3,4},
{1,2}
});
assertEquals(flipped,MatrixUtil.flipDim(d));
}
@Test
public void test1DFilter() {
DoubleMatrix x = new DoubleMatrix(new double[]{
0.166968,
0.064888,
0.428329,
0.864608,
0.154120,
0.881056,
0.608056,
0.575432,
0.197161,
0.047612
});
DoubleMatrix A = new DoubleMatrix(new double[]{
1,
2.7804e-4,
3.2223e-4,
2.4192e-4,
9.5975e-4,
8.5936e-4,
7.5952e-4,
2.6142e-4,
4.7416e-4,
1.3154e-4,
1.8972e-4
});
log.info("A " + A);
DoubleMatrix B = new DoubleMatrix(new double[]{
0.0063109 ,
.3856189,
.9307907,
.1634197,
0.9245115
});
log.info("B " + B);
DoubleMatrix test = MatrixUtil.oneDimensionalDigitalFilter(B,A,x);
DoubleMatrix answer = new DoubleMatrix(new double[]{
0.0010537,
0.0647952,
0.1831190,
0.2582388,
0.8978864,
0.9993074,
1.0234692,
1.8814360,
1.0732472,
1.5226931
});
assertEquals(answer,test);
}
@Test
public void testRot90() {
DoubleMatrix zeros = DoubleMatrix.rand(1, 3);
log.info("Starting " + zeros);
MatrixUtil.rot90(zeros);
log.info("Ending " + zeros);
}
@Test
public void testUpSample() {
DoubleMatrix d = DoubleMatrix.ones(28,28);
DoubleMatrix scale = new DoubleMatrix(2,1);
MatrixUtil.assign(scale,2);
MatrixUtil.upSample(d, scale);
}
@Test
public void testCumSum() {
DoubleMatrix test = new DoubleMatrix(new double[][]{
{1,2,3},
{4,5,6}
});
DoubleMatrix cumSum = MatrixUtil.cumsum(test);
DoubleMatrix solution = new DoubleMatrix(new double[][]{
{1,2,3},
{5,7,9}
});
assertEquals(solution,cumSum);
}
@Test
public void testReverse() {
DoubleMatrix zeros = DoubleMatrix.zeros(1,3);
DoubleMatrix reverse = MatrixUtil.reverse(zeros);
assertEquals(true, zeros.rows == reverse.rows);
assertEquals(true, zeros.columns == reverse.columns);
}
}
| [
"agibson@clevercloudcomputing.com"
] | agibson@clevercloudcomputing.com |
c04739ed2b002dd25d7e78f95e59716462dc14a5 | 7b73756ba240202ea92f8f0c5c51c8343c0efa5f | /classes/com/tencent/commonsdk/soload/MyZipConstants.java | a9300dcc8c1e26ceb98947773f95b6cdc452ab3e | [] | no_license | meeidol-luo/qooq | 588a4ca6d8ad579b28dec66ec8084399fb0991ef | e723920ac555e99d5325b1d4024552383713c28d | refs/heads/master | 2020-03-27T03:16:06.616300 | 2016-10-08T07:33:58 | 2016-10-08T07:33:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,844 | java | package com.tencent.commonsdk.soload;
abstract interface MyZipConstants
{
public static final int CENATT = 36;
public static final int CENATX = 38;
public static final int CENCOM = 32;
public static final int CENCRC = 16;
public static final int CENDSK = 34;
public static final int CENEXT = 30;
public static final int CENFLG = 8;
public static final int CENHDR = 46;
public static final int CENHOW = 10;
public static final int CENLEN = 24;
public static final int CENNAM = 28;
public static final int CENOFF = 42;
public static final long CENSIG = 33639248L;
public static final int CENSIZ = 20;
public static final int CENTIM = 12;
public static final int CENVEM = 4;
public static final int CENVER = 6;
public static final int ENDCOM = 20;
public static final int ENDHDR = 22;
public static final int ENDOFF = 16;
public static final long ENDSIG = 101010256L;
public static final int ENDSIZ = 12;
public static final int ENDSUB = 8;
public static final int ENDTOT = 10;
public static final int EXTCRC = 4;
public static final int EXTHDR = 16;
public static final int EXTLEN = 12;
public static final long EXTSIG = 134695760L;
public static final int EXTSIZ = 8;
public static final int LOCCRC = 14;
public static final int LOCEXT = 28;
public static final int LOCFLG = 6;
public static final int LOCHDR = 30;
public static final int LOCHOW = 8;
public static final int LOCLEN = 22;
public static final int LOCNAM = 26;
public static final long LOCSIG = 67324752L;
public static final int LOCSIZ = 18;
public static final int LOCTIM = 10;
public static final int LOCVER = 4;
}
/* Location: E:\apk\QQ_91\classes-dex2jar.jar!\com\tencent\commonsdk\soload\MyZipConstants.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
089c3fbfd8b2a8c959a37959b28479535451866e | 7691d61c8ade331e6a4a6a13e8a17c2dde0b6135 | /core/src/main/java/org/infinispan/reactive/publisher/impl/KeyPublisherResult.java | 3e5f99db5179f296554ab23e0775519e5610e557 | [
"Apache-2.0",
"LicenseRef-scancode-dco-1.1"
] | permissive | joaedwar/infinispan | 84a4aa33b9199536a5f03a467c962cdfb012fead | 2380c91c4ece8c4efed18e943ed3f33b2570d993 | refs/heads/master | 2020-08-05T03:02:41.833286 | 2019-10-04T00:21:35 | 2019-10-04T00:21:35 | 205,343,641 | 0 | 0 | Apache-2.0 | 2019-08-30T08:52:42 | 2019-08-30T08:52:41 | null | UTF-8 | Java | false | false | 1,036 | java | package org.infinispan.reactive.publisher.impl;
import java.util.Set;
import org.infinispan.commons.util.IntSet;
/**
* A PublisherResult that was performed due to included keys. Note that this response is only ever created on the
* originator node. This is because we can't have a partial response with key based publishers. Either all results
* are returned or the node crashes or has an exception.
* @author wburns
* @since 10.0
*/
public class KeyPublisherResult<K, R> implements PublisherResult<R> {
private final Set<K> suspectedKeys;
public KeyPublisherResult(Set<K> suspectedKeys) {
this.suspectedKeys = suspectedKeys;
}
@Override
public IntSet getSuspectedSegments() {
return null;
}
@Override
public Set<K> getSuspectedKeys() {
return suspectedKeys;
}
@Override
public R getResult() {
return null;
}
@Override
public String toString() {
return "KeyPublisherResult{" +
", suspectedKeys=" + suspectedKeys +
'}';
}
}
| [
"remerson@redhat.com"
] | remerson@redhat.com |
fa178a9ba09d907e3a0a8f63b27dee297d6006ef | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/MATH-84b-1-20-Single_Objective_GGA-WeightedSum/org/apache/commons/math/optimization/direct/DirectSearchOptimizer_ESTest.java | 81e1cac75711b7422011aae50e01c23b907df06d | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,412 | java | /*
* This file was automatically generated by EvoSuite
* Tue Mar 31 11:23:38 UTC 2020
*/
package org.apache.commons.math.optimization.direct;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Comparator;
import org.apache.commons.math.optimization.OptimizationException;
import org.apache.commons.math.optimization.RealPointValuePair;
import org.apache.commons.math.optimization.direct.MultiDirectional;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DirectSearchOptimizer_ESTest extends DirectSearchOptimizer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
MultiDirectional multiDirectional0 = new MultiDirectional();
multiDirectional0.setMaxIterations((-14));
try {
multiDirectional0.iterateSimplex((Comparator<RealPointValuePair>) null);
fail("Expecting exception: OptimizationException");
} catch(OptimizationException e) {
//
// org.apache.commons.math.MaxIterationsExceededException: Maximal number of iterations (-14) exceeded
//
verifyException("org.apache.commons.math.optimization.direct.DirectSearchOptimizer", e);
}
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
420e1d15e22bd11323d5cdce666a6dcf4f35b49e | 1dff4b9816588af53eed89728d1aa46d189e8d9c | /MobileSurveyRest/src/main/java/com/safasoft/mobilesurvey/rest/dao/MasterDistributionDAO.java | 4c3920d164f15818747aa944ab8308301600c803 | [] | 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 | 831 | java | package com.safasoft.mobilesurvey.rest.dao;
import org.springframework.stereotype.Repository;
import com.safasoft.mobilesurvey.rest.bean.MasterDistribution;
/**
* DAO table MASTER_DISTRIBUTION
* extends BaseDAO class
* @see BaseDAO
* @created Dec 4, 2016
* @author awal
*/
@Repository("masterDistributionDAO")
public class MasterDistributionDAO extends BaseDAO<MasterDistribution> {
/**
* Get distribution by office
* @param officeId
* @return distribution object based on given office
*/
public MasterDistribution getByOffice(int officeId) {
return (MasterDistribution) sessionFactory.getCurrentSession().createQuery(
"from " + domainClass.getName() + " dis " +
"where dis.office.officeId = :officeId")
.setInteger("officeId", officeId)
.uniqueResult();
}
}
| [
"ahamid.dimaha@gmail.com"
] | ahamid.dimaha@gmail.com |
d96bf5feca84c6835a86d0a482d0cddb1f215b63 | 32b541f9e2acb81033b77d32d60a83e6c10a4d9f | /Java 8/JavaExercise/src/ExamThree/Factorials.java | 7adc1ec923a93859c1b77632064547d273e91fdb | [] | no_license | mortozafsti/Java-SE-8 | 4c81da201a71cb3181c94a87f84cd4770dfca8dc | d95cd2bdca087e89d4ec7eedcd6ba5b0387fa30d | refs/heads/master | 2021-07-19T17:35:21.535803 | 2018-12-07T06:57:30 | 2018-12-07T06:57:30 | 146,238,654 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java |
package ExamThree;
import java.util.Scanner;
public class Factorials {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Number: ");
int dd = sc.nextInt();
int i,fact=1;
for (i = 1; i <=dd; i++) {
fact = fact*i;
}
System.out.println("Factorial of "+dd+" is "+fact);
}
}
| [
"mortozafsti@gmail.com"
] | mortozafsti@gmail.com |
ce3049b22ffacca4795cc7d2fca2f207ca03cb2f | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava2/Foo404.java | a581a61d7ef7c4ef9d5cef4867abbc8a16150784 | [] | 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 | 346 | java | package applicationModulepackageJava2;
public class Foo404 {
public void foo0() {
new applicationModulepackageJava2.Foo403().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
017d4ed147383b5e15313e074e7a111421920698 | 038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad | /schemaOrgGson/src/org/kyojo/schemaorg/m3n5/gson/core/container/ExecutableLibraryNameDeserializer.java | de42e71ff26ae41e0e07d7b33db271b5e4e8a3e9 | [
"Apache-2.0"
] | permissive | nagaikenshin/schemaOrg | 3dec1626781913930da5585884e3484e0b525aea | 4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8 | refs/heads/master | 2021-06-25T04:52:49.995840 | 2019-05-12T06:22:37 | 2019-05-12T06:22:37 | 134,319,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,140 | java | package org.kyojo.schemaorg.m3n5.gson.core.container;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.kyojo.gson.JsonDeserializationContext;
import org.kyojo.gson.JsonDeserializer;
import org.kyojo.gson.JsonElement;
import org.kyojo.gson.JsonParseException;
import org.kyojo.schemaorg.m3n5.core.impl.EXECUTABLE_LIBRARY_NAME;
import org.kyojo.schemaorg.m3n5.core.Container.ExecutableLibraryName;
import org.kyojo.schemaorg.m3n5.gson.DeserializerTemplate;
public class ExecutableLibraryNameDeserializer implements JsonDeserializer<ExecutableLibraryName> {
public static Map<String, Field> fldMap = new HashMap<>();
@Override
public ExecutableLibraryName deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context)
throws JsonParseException {
if(jsonElement.isJsonPrimitive()) {
return new EXECUTABLE_LIBRARY_NAME(jsonElement.getAsString());
}
return DeserializerTemplate.deserializeSub(jsonElement, type, context,
new EXECUTABLE_LIBRARY_NAME(), ExecutableLibraryName.class, EXECUTABLE_LIBRARY_NAME.class, fldMap);
}
}
| [
"nagai@nagaikenshin.com"
] | nagai@nagaikenshin.com |
bb657451ea58208490642561896bf1013dbff4cb | 908b9859a4b45dca4d916720122a1b40c0fafe43 | /labs/wsclient/src/main/java/com/mt/pos/dto/WelcomeDTO.java | 83afe015b0c55336159873c5917d2625b520f29d | [] | no_license | mugabarigiraCHUK/scotomax-hman | 778a3b48c9ac737414beaee9d72d1138a1e5b1ee | 786478731338b5af7a86cada2e4582ddb3b2569f | refs/heads/master | 2021-01-10T06:50:26.179698 | 2012-08-13T16:35:46 | 2012-08-13T16:35:46 | 46,422,699 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,338 | java | package com.mt.pos.dto;
import com.mt.pos.ws.beans.SidType;
import com.mt.pos.ws.beans.TariffPlan;
import java.io.Serializable;
import java.util.List;
import javax.faces.model.SelectItem;
public abstract class WelcomeDTO implements Serializable {
/**
*
*/
private static final long serialVersionUID = 4859041937108523747L;
protected String userCode;
protected String pinCode;
protected String companyId;
protected String notifyMessage;
protected List<SidType> dtSidType;
protected List<TariffPlan> dtTariffPlan;
protected List<SelectItem> selectionDeviceBrands;
protected String selectedDeviceBrand;
protected List<SelectItem> selectionDeviceModels;
protected List<SelectItem> selectionSimAppGroups;
protected String selectedSimAppGroup;
protected List<SelectItem> selectionSimApplications;
protected String simIccId;
protected Integer idProfile;
protected Long availableMemory;
protected Long totalMemory;
protected void clear() {
userCode = null;
pinCode = null;
companyId = null;
notifyMessage = null;
selectionDeviceBrands = null;
selectionDeviceModels = null;
selectionSimAppGroups = null;
selectionSimApplications = null;
}
public String getUserCode() {
return userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getPinCode() {
return pinCode;
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getNotifyMessage() {
return notifyMessage;
}
public void setNotifyMessage(String notifyMessage) {
this.notifyMessage = notifyMessage;
}
public List<SelectItem> getSelectionDeviceBrands() {
return selectionDeviceBrands;
}
public void setSelectionDeviceBrands(List<SelectItem> selectionDeviceBrands) {
this.selectionDeviceBrands = selectionDeviceBrands;
}
public List<SelectItem> getSelectionDeviceModels() {
return selectionDeviceModels;
}
public void setSelectionDeviceModels(List<SelectItem> selectionDeviceModels) {
this.selectionDeviceModels = selectionDeviceModels;
}
public List<SelectItem> getSelectionSimAppGroups() {
return selectionSimAppGroups;
}
public void setSelectionSimAppGroups(List<SelectItem> selectionSimAppGroups) {
this.selectionSimAppGroups = selectionSimAppGroups;
}
public List<SelectItem> getSelectionSimApplications() {
return selectionSimApplications;
}
public void setSelectionSimApplications(List<SelectItem> selectionSimApplications) {
this.selectionSimApplications = selectionSimApplications;
}
public List<SidType> getDtSidType() {
return dtSidType;
}
public void setDtSidType(List<SidType> dtSidType) {
this.dtSidType = dtSidType;
}
public List<TariffPlan> getDtTariffPlan() {
return dtTariffPlan;
}
public void setDtTariffPlan(List<TariffPlan> dtTariffPlan) {
this.dtTariffPlan = dtTariffPlan;
}
public String getSelectedDeviceBrand() {
return selectedDeviceBrand;
}
public void setSelectedDeviceBrand(String selectedDeviceBrand) {
this.selectedDeviceBrand = selectedDeviceBrand;
}
public String getSelectedSimAppGroup() {
return selectedSimAppGroup;
}
public void setSelectedSimAppGroup(String selectedSimAppGroup) {
this.selectedSimAppGroup = selectedSimAppGroup;
}
public Long getAvailableMemory() {
return availableMemory;
}
public void setAvailableMemory(Long availableMemory) {
this.availableMemory = availableMemory;
}
public Integer getIdProfile() {
return idProfile;
}
public void setIdProfile(Integer idProfile) {
this.idProfile = idProfile;
}
public String getSimIccId() {
return simIccId;
}
public void setSimIccId(String simIccId) {
this.simIccId = simIccId;
}
public Long getTotalMemory() {
return totalMemory;
}
public void setTotalMemory(Long totalMemory) {
this.totalMemory = totalMemory;
}
}
| [
"developmax@ad344d4b-5b83-fe1d-98cd-db9ebd70f650"
] | developmax@ad344d4b-5b83-fe1d-98cd-db9ebd70f650 |
9d1c3e7dde0783c1d58961eac62c65fd6af65731 | b060b42ed1e03c7b40a682db70bf8ba71943e3a3 | /src/main/java/com/app/init/AppInit.java | c63184c82cb1c2ec3da4692f7850d9c12edea70b | [] | no_license | satishyr/ControllerToUi | 6e12cf9581f17f337c4779687376e7bd5466b77e | ab7f891813f340263a78fe1f1b347134c03060ae | refs/heads/master | 2022-12-22T17:02:00.592833 | 2020-01-09T10:52:36 | 2020-01-09T10:52:36 | 232,778,155 | 0 | 0 | null | 2022-12-15T23:50:44 | 2020-01-09T10:01:12 | Java | UTF-8 | Java | false | false | 660 | java | package com.app.init;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import com.app.config.AppConfig;
public class AppInit extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return new Class[] {AppConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
// TODO Auto-generated method stub
return null;
}
@Override
protected String[] getServletMappings() {
// TODO Auto-generated method stub
return new String[] {"/mvc/*"};
}
}
| [
"y.satishkumar34@gmail.com"
] | y.satishkumar34@gmail.com |
3f7282b096dcea83bba20fbd3b03de9d1be5ae89 | 3f169749adceb8a84803c561467e391ef381d7d0 | /workspace/studySystem/src/persistence/PersistentT_2_0.java | 9ec2faffcf6a7a0b88b7fa84e2e3c3bf736e4867 | [] | no_license | Cryzas/FHDW2 | 969619012ad05f455d04dce0f3413f53cedd9351 | 8bc31d4072cc9ed7ddf86154cdf08f0f9a55454b | refs/heads/master | 2021-01-23T05:25:00.249669 | 2017-10-11T06:24:17 | 2017-10-11T06:24:17 | 86,296,546 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package persistence;
public interface PersistentT_2_0 extends PersistentGradesInThird, T_2_04Public {
public PersistentT_2_0 getThis() throws PersistenceException ;
}
| [
"jensburczyk96@gmail.com"
] | jensburczyk96@gmail.com |
5110595b960ddc347d48010abf8398f6e7a5090c | 9f2fca0e70c93821395d73e3466003a4a668230d | /src/main/java/com/tour/test/executor/exception/ResponseException.java | dfcf7c865d5d4ff66adf05bdf19fac35a2f80446 | [] | no_license | bala4cs/mercurynewtour | 8b93e00257b670078aa87f1c5f876dcff7e99e1a | f17cee610756b10795cee9b2ea5fed6f4035f8f5 | refs/heads/master | 2022-07-15T11:47:51.917250 | 2019-12-12T05:27:05 | 2019-12-12T05:27:05 | 227,361,966 | 0 | 0 | null | 2022-06-29T17:50:29 | 2019-12-11T12:34:10 | Java | UTF-8 | Java | false | false | 996 | java | package com.tour.test.executor.exception;
import com.tour.logger.CustomLogger;
public class ResponseException extends Exception{
private static final CustomLogger LOGGER = new CustomLogger(ResponseException.class);
private static final long serialVersionUID = 1;
private String message = null;
public ResponseException() {
super();
}
public ResponseException(String message) {
super(message);
LOGGER.error(message);
}
public ResponseException(Throwable cause) {
super(cause);
}
public ResponseException(String result, Exception e) {
if(e.getMessage().contains("Content is not allowed in prolog.")){
LOGGER.error(" Please check the response : " +result);
}else{
LOGGER.error(e.getMessage());
}
}
@Override
public String toString() {
return message;
}
@Override
public String getMessage() {
return message;
}
}
| [
"you@example.com"
] | you@example.com |
bee64b5ab1453dd383764df864140f3fcdfd5f46 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/6/org/apache/commons/lang3/tuple/MutableTriple_MutableTriple_74.java | 37bb47db7ffedf2734bbf587716d8731a6ba5361 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 436 | java |
org apach common lang3 tupl
mutabl tripl consist code object element
thread safe threadsaf
param left element type
param middl element type
param element type
version
mutabl tripl mutabletripl tripl
creat tripl instanc
param left left
param middl middl
param
mutabl tripl mutabletripl left middl
left left
middl middl
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
e0058431d2e044a09902049d974c7da60fd55a9d | 3130765f287269f474dde937930a6adc00f0806a | /src/main/java/net/minecraft/server/aai.java | 983c6b30171ef8d2dbdda01719fd4b9a8880aeee | [] | no_license | airidas338/mc-dev | 928e105789567d1f0416028f1f0cb75a729bd0ec | 7b23ae7f3ba52ba8405d14cdbfed8da9f5f7092a | refs/heads/master | 2016-09-05T22:12:23.138874 | 2014-09-26T03:57:07 | 2014-09-26T03:57:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,380 | java | package net.minecraft.server;
public class aai extends zf {
private int e;
private EntityVillager f;
public aai(EntityVillager var1) {
super(var1, EntityVillager.class, 3.0F, 0.02F);
this.f = var1;
}
public void c() {
super.c();
if(this.f.cq() && this.b instanceof EntityVillager && ((EntityVillager)this.b).cr()) {
this.e = 10;
} else {
this.e = 0;
}
}
public void e() {
super.e();
if(this.e > 0) {
--this.e;
if(this.e == 0) {
wa var1 = this.f.co();
for(int var2 = 0; var2 < var1.n_(); ++var2) {
ItemStack var3 = var1.a(var2);
ItemStack var4 = null;
if(var3 != null) {
Item var5 = var3.getItem();
int var6;
if((var5 == Items.BREAD || var5 == Items.bS || var5 == Items.bR) && var3.count > 3) {
var6 = var3.count / 2;
var3.count -= var6;
var4 = new ItemStack(var5, var6, var3.getData());
} else if(var5 == Items.WHEAT && var3.count > 5) {
var6 = var3.count / 2 / 3 * 3;
int var7 = var6 / 3;
var3.count -= var6;
var4 = new ItemStack(Items.BREAD, var7, 0);
}
if(var3.count <= 0) {
var1.a(var2, (ItemStack)null);
}
}
if(var4 != null) {
double var11 = this.f.t - 0.30000001192092896D + (double)this.f.aR();
EntityItem var12 = new EntityItem(this.f.o, this.f.s, var11, this.f.u, var4);
float var8 = 0.3F;
float var9 = this.f.aI;
float var10 = this.f.z;
var12.v = (double)(-MathHelper.sin(var9 / 180.0F * 3.1415927F) * MathHelper.cos(var10 / 180.0F * 3.1415927F) * var8);
var12.x = (double)(MathHelper.cos(var9 / 180.0F * 3.1415927F) * MathHelper.cos(var10 / 180.0F * 3.1415927F) * var8);
var12.w = (double)(-MathHelper.sin(var10 / 180.0F * 3.1415927F) * var8 + 0.1F);
var12.p();
this.f.o.addEntity((Entity)var12);
break;
}
}
}
}
}
}
| [
"sam.sun469@gmail.com"
] | sam.sun469@gmail.com |
71a0f8160043e19ff94eeabb27768335b1fefd06 | 52019a46c8f25534afa491a5f68bf5598e68510b | /core/metamodel/src/test/java/org/nakedobjects/metamodel/services/ServicesInjectorNoop.java | 48e9e4502a36e2483b47fdf3684875a46f243f62 | [
"Apache-2.0"
] | permissive | JavaQualitasCorpus/nakedobjects-4.0.0 | e765b4980994be681e5562584ebcf41e8086c69a | 37ee250d4c8da969eac76749420064ca4c918e8e | refs/heads/master | 2023-08-29T13:48:01.268876 | 2020-06-02T18:07:23 | 2020-06-02T18:07:23 | 167,005,009 | 0 | 1 | Apache-2.0 | 2022-06-10T22:44:43 | 2019-01-22T14:08:50 | Java | UTF-8 | Java | false | false | 865 | java | package org.nakedobjects.metamodel.services;
import java.util.List;
import org.nakedobjects.applib.DomainObjectContainer;
import org.nakedobjects.metamodel.commons.component.Noop;
public class ServicesInjectorNoop implements ServicesInjector, Noop {
public void open() {}
public void close() {}
public DomainObjectContainer getContainer() {
return null;
}
public void setContainer(DomainObjectContainer container) {}
public void setServices(List<Object> services) {}
public List<Object> getRegisteredServices() {
return null;
}
public void injectDependencies(Object domainObject) {}
public void injectDependencies(List<Object> objects) {}
public void injectInto(Object candidate) {}
}
// Copyright (c) Naked Objects Group Ltd.
| [
"taibi@sonar-scheduler.rd.tut.fi"
] | taibi@sonar-scheduler.rd.tut.fi |
3355248cf6a516ed9ee3cf0f9f4bdd1ebe2fceae | 8b9190a8c5855d5753eb8ba7003e1db875f5d28f | /sources/com/google/common/escape/Escapers.java | f2fc75bd9805264a3af83d519d35515d7e465678 | [] | no_license | stevehav/iowa-caucus-app | 6aeb7de7487bd800f69cb0b51cc901f79bd4666b | e3c7eb39de0be6bbfa8b6b063aaa85dcbcee9044 | refs/heads/master | 2020-12-29T10:25:28.354117 | 2020-02-05T23:15:52 | 2020-02-05T23:15:52 | 238,565,283 | 21 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,810 | java | package com.google.common.escape;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Preconditions;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.HashMap;
import java.util.Map;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
@GwtCompatible
@Beta
public final class Escapers {
private static final Escaper NULL_ESCAPER = new CharEscaper() {
/* access modifiers changed from: protected */
public char[] escape(char c) {
return null;
}
public String escape(String str) {
return (String) Preconditions.checkNotNull(str);
}
};
private Escapers() {
}
public static Escaper nullEscaper() {
return NULL_ESCAPER;
}
public static Builder builder() {
return new Builder();
}
@Beta
public static final class Builder {
private final Map<Character, String> replacementMap;
private char safeMax;
private char safeMin;
/* access modifiers changed from: private */
public String unsafeReplacement;
private Builder() {
this.replacementMap = new HashMap();
this.safeMin = 0;
this.safeMax = 65535;
this.unsafeReplacement = null;
}
@CanIgnoreReturnValue
public Builder setSafeRange(char c, char c2) {
this.safeMin = c;
this.safeMax = c2;
return this;
}
@CanIgnoreReturnValue
public Builder setUnsafeReplacement(@NullableDecl String str) {
this.unsafeReplacement = str;
return this;
}
@CanIgnoreReturnValue
public Builder addEscape(char c, String str) {
Preconditions.checkNotNull(str);
this.replacementMap.put(Character.valueOf(c), str);
return this;
}
public Escaper build() {
return new ArrayBasedCharEscaper(this.replacementMap, this.safeMin, this.safeMax) {
private final char[] replacementChars;
{
this.replacementChars = Builder.this.unsafeReplacement != null ? Builder.this.unsafeReplacement.toCharArray() : null;
}
/* access modifiers changed from: protected */
public char[] escapeUnsafe(char c) {
return this.replacementChars;
}
};
}
}
static UnicodeEscaper asUnicodeEscaper(Escaper escaper) {
Preconditions.checkNotNull(escaper);
if (escaper instanceof UnicodeEscaper) {
return (UnicodeEscaper) escaper;
}
if (escaper instanceof CharEscaper) {
return wrap((CharEscaper) escaper);
}
throw new IllegalArgumentException("Cannot create a UnicodeEscaper from: " + escaper.getClass().getName());
}
public static String computeReplacement(CharEscaper charEscaper, char c) {
return stringOrNull(charEscaper.escape(c));
}
public static String computeReplacement(UnicodeEscaper unicodeEscaper, int i) {
return stringOrNull(unicodeEscaper.escape(i));
}
private static String stringOrNull(char[] cArr) {
if (cArr == null) {
return null;
}
return new String(cArr);
}
private static UnicodeEscaper wrap(final CharEscaper charEscaper) {
return new UnicodeEscaper() {
/* access modifiers changed from: protected */
public char[] escape(int i) {
if (i < 65536) {
return charEscaper.escape((char) i);
}
char[] cArr = new char[2];
Character.toChars(i, cArr, 0);
char[] escape = charEscaper.escape(cArr[0]);
char[] escape2 = charEscaper.escape(cArr[1]);
if (escape == null && escape2 == null) {
return null;
}
int length = escape != null ? escape.length : 1;
char[] cArr2 = new char[((escape2 != null ? escape2.length : 1) + length)];
if (escape != null) {
for (int i2 = 0; i2 < escape.length; i2++) {
cArr2[i2] = escape[i2];
}
} else {
cArr2[0] = cArr[0];
}
if (escape2 != null) {
for (int i3 = 0; i3 < escape2.length; i3++) {
cArr2[length + i3] = escape2[i3];
}
} else {
cArr2[length] = cArr[1];
}
return cArr2;
}
};
}
}
| [
"steve@havelka.co"
] | steve@havelka.co |
760e381f9cd6eec119933610f86a0c3ccbd0889f | fbc8783d3d89a041d37fd67c098ef6d8c8f25a6e | /src/main/java/org/apache/clerezza/platform/content/PageNotFoundService.java | 431be809533247a02c2033968d63a44294295327 | [
"Apache-2.0"
] | permissive | clerezza/platform.content | 0a3d962e047fe17a4379a5ac9bc8e886e3ce04af | 92cb7579128bab812936b938b80436fbf74cb1f3 | refs/heads/master | 2021-01-11T08:33:06.608560 | 2016-10-04T12:01:53 | 2016-10-04T12:01:53 | 69,960,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,162 | java | /*
* Copyright 2010 reto.
*
* 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.
* under the License.
*/
package org.apache.clerezza.platform.content;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
/**
* An instance of this service is called by DiscoBitHandler if a resource
* is not found in the content graph.
*
* @author reto
*/
public interface PageNotFoundService {
/**
* Creates a response when a resource could not be found in the Content
* ImmutableGraph, this is a 404 response.
*
* @param uriInfo
* @return
*/
public Response createResponse(UriInfo uriInfo);
}
| [
"reto@apache.org"
] | reto@apache.org |
a9e915b496311e6d712563c7acccdc3d273a8d97 | c5488473c8114647c12b835cd7b36e1dfb4c95a9 | /Mobile App/Code/sources/android/support/p000v4/p002os/IResultReceiver.java | c546ba7ab2313513c45b6d871cdd075af81bb750 | [
"MIT"
] | permissive | shivi98g/EpilNet-EpilepsyPredictor | 5cf86835473112f98c130bb066edba4cf8fa3f20 | 15a98fb9ac7ee535005fb2aebb36548f28c7f6d1 | refs/heads/main | 2023-08-04T09:43:24.941854 | 2021-09-24T12:25:42 | 2021-09-24T12:25:42 | 389,867,899 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,125 | java | package android.support.p000v4.p002os;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
/* renamed from: android.support.v4.os.IResultReceiver */
public interface IResultReceiver extends IInterface {
void send(int i, Bundle bundle) throws RemoteException;
/* renamed from: android.support.v4.os.IResultReceiver$Stub */
public static abstract class Stub extends Binder implements IResultReceiver {
private static final String DESCRIPTOR = "android.support.v4.os.IResultReceiver";
static final int TRANSACTION_send = 1;
public Stub() {
attachInterface(this, DESCRIPTOR);
}
public static IResultReceiver asInterface(IBinder obj) {
if (obj == null) {
return null;
}
IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (iin == null || !(iin instanceof IResultReceiver)) {
return new Proxy(obj);
}
return (IResultReceiver) iin;
}
public IBinder asBinder() {
return this;
}
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
Bundle _arg1;
if (code == 1) {
data.enforceInterface(DESCRIPTOR);
int _arg0 = data.readInt();
if (data.readInt() != 0) {
_arg1 = (Bundle) Bundle.CREATOR.createFromParcel(data);
} else {
_arg1 = null;
}
send(_arg0, _arg1);
return true;
} else if (code != 1598968902) {
return super.onTransact(code, data, reply, flags);
} else {
reply.writeString(DESCRIPTOR);
return true;
}
}
/* renamed from: android.support.v4.os.IResultReceiver$Stub$Proxy */
private static class Proxy implements IResultReceiver {
private IBinder mRemote;
Proxy(IBinder remote) {
this.mRemote = remote;
}
public IBinder asBinder() {
return this.mRemote;
}
public String getInterfaceDescriptor() {
return Stub.DESCRIPTOR;
}
public void send(int resultCode, Bundle resultData) throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
_data.writeInt(resultCode);
if (resultData != null) {
_data.writeInt(1);
resultData.writeToParcel(_data, 0);
} else {
_data.writeInt(0);
}
this.mRemote.transact(1, _data, (Parcel) null, 1);
} finally {
_data.recycle();
}
}
}
}
}
| [
"31238277+shivi98g@users.noreply.github.com"
] | 31238277+shivi98g@users.noreply.github.com |
8d69ba853cee1717ad153aebc7d71d7c498a06f2 | eca0527ac315b47e23b8c9a20a6c4b29330e1914 | /com.agit.brooks2.user.management/src/main/java/com/agit/brooks2/user/management/application/security/UserDetailsService.java | 37b821010751bd923f9ebb6387d7924440350cee | [] | no_license | bayuhendra/Project-Aspro---Brooks-2 | f051986516936750a50c63ad7bba14da6740eb52 | a087ceb55027744aae52ba894d38cbdae16b6d20 | refs/heads/master | 2020-12-30T10:49:26.294299 | 2017-08-16T04:25:42 | 2017-08-16T04:25:42 | 98,858,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,188 | java | package com.agit.brooks2.user.management.application.security;
import com.agit.brooks2.common.dto.usermanagement.UserDTO;
import com.agit.brooks2.common.security.UserDetailsImpl;
import com.agit.brooks2.shared.type.StatusData;
import com.agit.brooks2.user.management.application.RoleService;
import com.agit.brooks2.user.management.application.UserService;
import com.agit.brooks2.util.DateUtil;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.web.client.ResourceAccessException;
/**
*
* @author bayutridewanto
*
*/
public class UserDetailsService {
UserService userService;
RoleService roleService;
private final Integer MAX_ATTEMPTS = 3;
public UserDetailsImpl loadUserByUsername(String username) throws UsernameNotFoundException {
UserDTO user = null;
try {
user = userService.findByID(username.toLowerCase());
if (user.getUserName() == null) {
throw new UsernameNotFoundException("AvantradeSecurity.notFound");
}
} catch (ResourceAccessException e) {
/* if connection is refused */
throw new AuthenticationServiceException("AvantradeSecurity.connectionRefuse");
}
List<GrantedAuthority> authorities = SecurityCacheHelper.getAuthorities(user.getRoleDTO().getRoleID());
if (authorities == null) {
List<String> grantedAuthoritys = roleService.grantedAuthoritys(user.getRoleDTO().getRoleID());
authorities = grantedAuthorities(grantedAuthoritys);
SecurityCacheHelper.setAuthorities(user.getRoleDTO().getRoleID(), authorities);
}
boolean credentialsNonExpired = checkNonExpired(user.getUserSpecificationDTO().getUserLoginInfoDTO().getCredentialsExpiredDate());
boolean userNonLocked = user.getUserSpecificationDTO().getUserLoginInfoDTO().getLoginAttempt() < MAX_ATTEMPTS;
return new UserDetailsImpl(user.getUserName(), user.getPassword(), user.getUserStatus() == StatusData.ACTIVE, true, credentialsNonExpired, userNonLocked, authorities, user);
}
protected List<GrantedAuthority> grantedAuthorities(List<String> rolePrivilegeDTOs) {
List<GrantedAuthority> authorities = new ArrayList<>();
for (String auth : rolePrivilegeDTOs) {
authorities.add(new SimpleGrantedAuthority(auth));
}
return authorities;
}
protected boolean checkNonExpired(Date expiredDate) {
if (expiredDate == null) {
return true;
}
Date now = DateUtil.getDateWithoutTime(new Date());
return expiredDate.compareTo(now) > 0;
}
public void setUserService(UserService userService) {
this.userService = userService;
}
public void setRoleService(RoleService roleService) {
this.roleService = roleService;
}
}
| [
"bayuhendra1078@gmail.com"
] | bayuhendra1078@gmail.com |
213d01e73ac9c14986c88b5685eec7beb4963785 | 75f821238e6b2570986c1809925bdb638b7a9264 | /app/src/main/java/com/tonfun/codecsnetty/bll/protocol/commons/transform/parameter/ParamBSD.java | 365da7bfbbf19987629316c1ec14b77e5977bfaa | [] | no_license | zgy520/Android808 | 16d9dcf75de1e5c097629e9c1fa1fb94d640a827 | 4643bca92228366eadbbde8a3566da3319ea4462 | refs/heads/master | 2023-04-09T20:59:56.352962 | 2021-04-10T03:40:14 | 2021-04-10T03:40:14 | 356,259,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | package com.tonfun.codecsnetty.bll.protocol.commons.transform.parameter;
import io.netty.buffer.ByteBuf;
/**
* 盲区监测系统参数
* @author yezhihao
* @home https://gitee.com/yezhihao/jt808-server
*/
public class ParamBSD {
public static final int id = 0xF367;
public static int id() {
return id;
}
// @Schema(description = "后方接近报警时间阈值")
private byte p0;
// @Schema(description = "侧后方接近报警时间阈值")
private byte p1;
public ParamBSD() {
}
public byte getP0() {
return p0;
}
public void setP0(byte p0) {
this.p0 = p0;
}
public byte getP1() {
return p1;
}
public void setP1(byte p1) {
this.p1 = p1;
}
public static class S implements io.github.yezhihao.protostar.Schema<ParamBSD> {
public static final S INSTANCE = new S();
private S() {
}
@Override
public ParamBSD readFrom(ByteBuf input) {
ParamBSD message = new ParamBSD();
message.p0 = input.readByte();
message.p1 = input.readByte();
return message;
}
@Override
public void writeTo(ByteBuf output, ParamBSD message) {
output.writeByte(message.p0);
output.writeByte(message.p1);
}
}
}
| [
"a442391947@gmail.com"
] | a442391947@gmail.com |
782bd61c98341bafd2414db9d57553c6b368a8e7 | 7462f9b3d667fad66e6c60432af0d94c28c199bc | /src/main/java/com/helger/peppol/app/mgr/ISMLConfigurationManager.java | ea0aebb2bf9aeac3db734e8573b7ee662443b298 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | phax/peppol-practical | e969d37ad781a597df040e238b10610abb6756aa | 6f6cd02dc24ecc6c35c845d0f86039188a4a4748 | refs/heads/master | 2023-08-27T20:38:53.770815 | 2023-08-25T16:17:55 | 2023-08-25T16:17:55 | 24,772,884 | 9 | 3 | Apache-2.0 | 2021-12-19T15:47:45 | 2014-10-03T20:35:57 | Java | UTF-8 | Java | false | false | 7,186 | java | /*
* Copyright (C) 2014-2023 Philip Helger (www.helger.com)
* philip[at]helger[dot]com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.helger.peppol.app.mgr;
import java.util.function.Predicate;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.helger.commons.annotation.Nonempty;
import com.helger.commons.annotation.ReturnsMutableCopy;
import com.helger.commons.collection.impl.ICommonsList;
import com.helger.commons.state.EChange;
import com.helger.peppol.domain.ISMLConfiguration;
import com.helger.peppol.sml.ESMPAPIType;
import com.helger.peppol.sml.ISMLInfo;
import com.helger.peppolid.factory.ESMPIdentifierType;
/**
* Base interface for a manager that handles {@link ISMLInfo} objects.
*
* @author Philip Helger
*/
public interface ISMLConfigurationManager
{
/**
* Special ID used for "automatic detection" of SML
*/
String ID_AUTO_DETECT = "autodetect";
/**
* Create a new SML information.
*
* @param sSMLInfoID
* Internal object ID. May neither be <code>null</code> nor empty.
* @param sDisplayName
* The "shorthand" display name like "SML" or "SMK". May neither be
* <code>null</code> nor empty.
* @param sDNSZone
* The DNS zone on which this SML is operating. May not be
* <code>null</code>. It must be ensured that the value consists only
* of lower case characters for comparability! Example:
* <code>sml.peppolcentral.org</code>
* @param sManagementServiceURL
* The service URL where the management application is running on incl.
* the host name. May not be <code>null</code>. The difference to the
* host name is the eventually present context path.
* @param bClientCertificateRequired
* <code>true</code> if this SML requires a client certificate for
* access, <code>false</code> otherwise.<br>
* Both Peppol production SML and SMK require a client certificate.
* Only a locally running SML software may not require a client
* certificate.
* @param eSMPAPIType
* SMP API type. May not be <code>null</code>.
* @param eSMPIdentifierType
* SMP identifier type. May not be <code>null</code>.
* @param bProduction
* <code>true</code> if production SML, <code>false</code> if test
* @return Never <code>null</code>.
*/
@Nonnull
ISMLConfiguration createSMLInfo (@Nonnull @Nonempty String sSMLInfoID,
@Nonnull @Nonempty String sDisplayName,
@Nonnull @Nonempty String sDNSZone,
@Nonnull @Nonempty String sManagementServiceURL,
boolean bClientCertificateRequired,
@Nonnull ESMPAPIType eSMPAPIType,
@Nonnull ESMPIdentifierType eSMPIdentifierType,
boolean bProduction);
/**
* Update an existing SML information.
*
* @param sSMLInfoID
* The ID of the SML information to be updated. May be
* <code>null</code>.
* @param sDisplayName
* The "shorthand" display name like "SML" or "SMK". May neither be
* <code>null</code> nor empty.
* @param sDNSZone
* The DNS zone on which this SML is operating. May not be
* <code>null</code>. It must be ensured that the value consists only
* of lower case characters for comparability! Example:
* <code>sml.peppolcentral.org</code>
* @param sManagementServiceURL
* The service URL where the management application is running on incl.
* the host name. May not be <code>null</code>. The difference to the
* host name is the eventually present context path.
* @param bClientCertificateRequired
* <code>true</code> if this SML requires a client certificate for
* access, <code>false</code> otherwise.<br>
* Both Peppol production SML and SMK require a client certificate.
* Only a locally running SML software may not require a client
* certificate.
* @param eSMPAPIType
* SMP API type. May not be <code>null</code>.
* @param eSMPIdentifierType
* SMP identifier type. May not be <code>null</code>.
* @param bProduction
* <code>true</code> if production SML, <code>false</code> if test
* @return {@link EChange#CHANGED} if something was changed.
*/
@Nonnull
EChange updateSMLInfo (@Nullable String sSMLInfoID,
@Nonnull @Nonempty String sDisplayName,
@Nonnull @Nonempty String sDNSZone,
@Nonnull @Nonempty String sManagementServiceURL,
boolean bClientCertificateRequired,
@Nonnull ESMPAPIType eSMPAPIType,
@Nonnull ESMPIdentifierType eSMPIdentifierType,
boolean bProduction);
/**
* Delete an existing SML information.
*
* @param sSMLInfoID
* The ID of the SML information to be deleted. May be
* <code>null</code>.
* @return {@link EChange#CHANGED} if the removal was successful.
*/
@Nullable
EChange removeSMLInfo (@Nullable String sSMLInfoID);
/**
* @return An unsorted collection of all contained SML information. Never
* <code>null</code> but maybe empty.
*/
@Nonnull
@ReturnsMutableCopy
ICommonsList <ISMLConfiguration> getAll ();
@Nonnull
@ReturnsMutableCopy
ICommonsList <ISMLConfiguration> getAllSorted ();
/**
* Get the SML information with the passed ID.
*
* @param sID
* The ID to be resolved. May be <code>null</code>.
* @return <code>null</code> if no such SML information exists.
*/
@Nullable
ISMLConfiguration getSMLInfoOfID (@Nullable String sID);
/**
* Find the first SML information that matches the provided predicate.
*
* @param aFilter
* The predicate to be applied for searching. May not be
* <code>null</code>.
* @return <code>null</code> if no such SML information exists.
*/
@Nullable
ISMLConfiguration findFirst (@Nullable Predicate <? super ISMLConfiguration> aFilter);
/**
* Check if a SML information with the passed ID is contained.
*
* @param sID
* The ID of the SML information to be checked. May be
* <code>null</code>.
* @return <code>true</code> if the ID is contained, <code>false</code>
* otherwise.
*/
boolean containsSMLInfoWithID (@Nullable String sID);
}
| [
"philip@helger.com"
] | philip@helger.com |
3d74c7b12afcf43adaf8e80d98849ccd70b57158 | 2f4a058ab684068be5af77fea0bf07665b675ac0 | /app/com/facebook/orca/app/AppInitializationActivityHelper.java | 767c56b128ef020cc493e5c8445312690fee839e | [] | no_license | cengizgoren/facebook_apk_crack | ee812a57c746df3c28fb1f9263ae77190f08d8d2 | a112d30542b9f0bfcf17de0b3a09c6e6cfe1273b | refs/heads/master | 2021-05-26T14:44:04.092474 | 2013-01-16T08:39:00 | 2013-01-16T08:39:00 | 8,321,708 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,436 | java | package com.facebook.orca.app;
import android.app.Activity;
import android.content.Intent;
import com.facebook.content.SecureContextHelper;
import com.facebook.orca.activity.AbstractFbActivityListener;
import com.facebook.orca.annotations.AppInitializationNotRequired;
public class AppInitializationActivityHelper extends AbstractFbActivityListener
{
private final AppInitLock a;
private final Class<? extends Activity> b;
private final SecureContextHelper c;
public AppInitializationActivityHelper(AppInitLock paramAppInitLock, SecureContextHelper paramSecureContextHelper, Class<? extends Activity> paramClass)
{
this.a = paramAppInitLock;
this.b = paramClass;
this.c = paramSecureContextHelper;
}
public void f(Activity paramActivity)
{
if (this.a.c());
while (true)
{
return;
if (paramActivity.getClass().getAnnotation(AppInitializationNotRequired.class) == null)
{
Intent localIntent1 = paramActivity.getIntent();
Intent localIntent2 = new Intent(paramActivity, this.b);
localIntent2.putExtra("return_intent", localIntent1);
this.c.a(localIntent2, paramActivity);
paramActivity.finish();
continue;
}
}
}
}
/* Location: /data1/software/jd-gui/com.facebook.katana_2.0_liqucn.com-dex2jar.jar
* Qualified Name: com.facebook.orca.app.AppInitializationActivityHelper
* JD-Core Version: 0.6.0
*/ | [
"macluz@msn.com"
] | macluz@msn.com |
ecab41db940a48760521edafa779f89deffc6aba | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/apache-httpcore/nonFlakyMethods/org.apache.http.impl.entity.TestEntityDeserializer-testEntityWithUnsupportedTransferEncoding.java | 8e29f5ab36274a574667b1cf83558338791a5f70 | [
"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 | 1,072 | java | @Test public void testEntityWithUnsupportedTransferEncoding() throws Exception {
SessionInputBuffer inbuffer=new SessionInputBufferMock("0\r\n","US-ASCII");
HttpMessage message=new DummyHttpMessage();
message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING,false);
message.addHeader("Content-Type","unknown");
message.addHeader("Transfer-Encoding","whatever; param=value, chunked");
message.addHeader("Content-Length","plain wrong");
EntityDeserializer entitygen=new EntityDeserializer(new LaxContentLengthStrategy());
HttpEntity entity=entitygen.deserialize(inbuffer,message);
Assert.assertNotNull(entity);
Assert.assertEquals(-1,entity.getContentLength());
Assert.assertTrue(entity.isChunked());
Assert.assertTrue(entity.getContent() instanceof ChunkedInputStream);
message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING,true);
try {
entitygen.deserialize(inbuffer,message);
Assert.fail("ProtocolException should have been thrown");
}
catch ( ProtocolException ex) {
}
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
f80941c9a11c8399e44daa49a5d6450e19c503d1 | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2008-10-29/seasar2-2.4.31/s2jdbc-gen/s2jdbc-gen/src/test/java/org/seasar/extension/jdbc/gen/internal/generator/GenerateTestTest.java | 16278a1587ee110a2e3cfeec2a0c6bf0157cf5fc | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,553 | java | /*
* Copyright 2004-2008 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.extension.jdbc.gen.internal.generator;
import java.io.File;
import org.junit.Before;
import org.junit.Test;
import org.seasar.extension.jdbc.EntityMeta;
import org.seasar.extension.jdbc.gen.generator.GenerationContext;
import org.seasar.extension.jdbc.gen.internal.model.TestModelFactoryImpl;
import org.seasar.extension.jdbc.gen.model.TestModel;
import org.seasar.extension.jdbc.meta.ColumnMetaFactoryImpl;
import org.seasar.extension.jdbc.meta.EntityMetaFactoryImpl;
import org.seasar.extension.jdbc.meta.PropertyMetaFactoryImpl;
import org.seasar.extension.jdbc.meta.TableMetaFactoryImpl;
import org.seasar.framework.convention.impl.PersistenceConventionImpl;
import org.seasar.framework.util.TextUtil;
import static org.junit.Assert.*;
/**
* @author taedium
*
*/
public class GenerateTestTest {
private EntityMetaFactoryImpl entityMetaFactory;
private TestModelFactoryImpl entityTestModelFactory;
private GeneratorImplStub generator;
/**
*
* @throws Exception
*/
@Before
public void setUp() throws Exception {
PersistenceConventionImpl pc = new PersistenceConventionImpl();
ColumnMetaFactoryImpl cmf = new ColumnMetaFactoryImpl();
cmf.setPersistenceConvention(pc);
PropertyMetaFactoryImpl propertyMetaFactory = new PropertyMetaFactoryImpl();
propertyMetaFactory.setPersistenceConvention(pc);
propertyMetaFactory.setColumnMetaFactory(cmf);
TableMetaFactoryImpl tmf = new TableMetaFactoryImpl();
tmf.setPersistenceConvention(pc);
entityMetaFactory = new EntityMetaFactoryImpl();
entityMetaFactory.setPersistenceConvention(pc);
entityMetaFactory.setPropertyMetaFactory(propertyMetaFactory);
entityMetaFactory.setTableMetaFactory(tmf);
entityTestModelFactory = new TestModelFactoryImpl("s2jdbc.dicon",
"jdbcManager", "Test");
generator = new GeneratorImplStub();
}
/**
*
* @throws Exception
*/
@Test
public void testCompositeId() throws Exception {
EntityMeta entityMeta = entityMetaFactory.getEntityMeta(Ccc.class);
TestModel model = entityTestModelFactory.getEntityTestModel(entityMeta);
GenerationContext context = new GenerationContextImpl(model, new File(
"file"), "java/test.ftl", "UTF-8", false);
generator.generate(context);
String path = getClass().getName().replace(".", "/")
+ "_CompositeId.txt";
assertEquals(TextUtil.readUTF8(path), generator.getResult());
}
/**
*
* @throws Exception
*/
@Test
public void testNoId() throws Exception {
EntityMeta entityMeta = entityMetaFactory.getEntityMeta(Ddd.class);
TestModel model = entityTestModelFactory.getEntityTestModel(entityMeta);
GenerationContext context = new GenerationContextImpl(model, new File(
"file"), "java/test.ftl", "UTF-8", false);
generator.generate(context);
String path = getClass().getName().replace(".", "/") + "_NoId.txt";
assertEquals(TextUtil.readUTF8(path), generator.getResult());
}
/**
*
* @throws Exception
*/
@Test
public void testLeftOuterJoin() throws Exception {
EntityMeta entityMeta = entityMetaFactory.getEntityMeta(Aaa.class);
TestModel model = entityTestModelFactory.getEntityTestModel(entityMeta);
GenerationContext context = new GenerationContextImpl(model, new File(
"file"), "java/test.ftl", "UTF-8", false);
generator.generate(context);
String path = getClass().getName().replace(".", "/")
+ "_LeftOuterJoin.txt";
assertEquals(TextUtil.readUTF8(path), generator.getResult());
}
}
| [
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] | koichik@319488c0-e101-0410-93bc-b5e51f62721a |
dd888b283034d384bb993b4065f663a7a2661a7c | 099e3ac47a38feaf619c6e11214c51e59e19ae5c | /neuron-map/src/main/java/com/adarrivi/neuron/model/Axon.java | eaaa38e6555285f58e6fbc33f615738d598b693e | [] | no_license | adarrivi/neuron-map | c377fe4c26caddbf6b3c8624f9d8f850e4f402c1 | 57516fd0bb4d51e7f0fe926d2d0f1a8616350f29 | refs/heads/master | 2021-01-01T06:38:45.702904 | 2015-01-10T12:17:37 | 2015-01-10T12:17:37 | 25,764,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package com.adarrivi.neuron.model;
import java.util.Optional;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.adarrivi.neuron.brain.neuron.Neuron;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class Axon implements SteppableEntity {
@Autowired
private Randomizer randomizer;
@Value("${brain.axon.speed.min}")
private int minStepsRequiredToSendSpike;
@Value("${brain.axon.speed.max}")
private int maxStepsRequiredToSendSpike;
@Value("${brain.spike.intensity.min}")
private int minSpikeIntensity;
@Value("${brain.spike.intensity.max}")
private int maxSpikeIntensity;
private Dendrite dendrite;
private int spikeIntensity;
private int stepsRequiredToSendSpike;
private Optional<Spike> spike;
private int currentSpikeStep;
private Neuron destination;
@PostConstruct
public void init() {
spikeIntensity = randomizer.getRandomNumber(minSpikeIntensity, maxSpikeIntensity);
stepsRequiredToSendSpike = randomizer.getRandomNumber(minStepsRequiredToSendSpike, maxStepsRequiredToSendSpike);
spike = Optional.empty();
}
public void triggerSpike() {
spike = Optional.of(new Spike(spikeIntensity));
}
public void setDestinationNeuron(Neuron neuron) {
destination = neuron;
}
public Neuron getDestination() {
return destination;
}
public void setDendrite(Dendrite dendrite) {
this.dendrite = dendrite;
}
@Override
public void step() {
if (spike.isPresent()) {
currentSpikeStep++;
if (currentSpikeStep >= stepsRequiredToSendSpike) {
sendSpikeToDendriteAndReset();
}
}
}
private void sendSpikeToDendriteAndReset() {
dendrite.receiveSpike(spike.get());
spike = Optional.empty();
currentSpikeStep = 0;
}
public boolean isReady() {
return currentSpikeStep == 0;
}
}
| [
"adarrivi@gmail.com"
] | adarrivi@gmail.com |
db483086d3c562be0b1b86f1fffee6ee16d6d4e5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_c5348109701543e7047dea1930eefed21f985c15/Authentication/33_c5348109701543e7047dea1930eefed21f985c15_Authentication_t.java | b0ca6d67605ca7491d73bf9977b7c03ed17a79b1 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,791 | java | package chronomatic.server;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.security.SecureRandom;
import java.sql.Connection;
import java.sql.ResultSet;
import java.math.BigInteger;
import chronomatic.database.*;
import org.json.*;
@Path("auth/")
public class Authentication {
/***
* Check of de session key nog geldig is.
* @param sessionKey
* @return
*/
@GET
@Path("check/{sessionKey}")
@Produces(MediaType.APPLICATION_JSON)
public String getInfo(@PathParam("sessionKey") String sessionKey) {
JSONObject returnObject = new JSONObject();
try {
if(getUserId(sessionKey) > 0) {
returnObject.put("success"," true");
returnObject.put("state"," logged in");
}
}
catch(Exception e) {
e.printStackTrace();
}
return returnObject.toString();
}
/**
* Aanmaken van sessie, indien de gebruiker juiste inloggegegevens heeft meegestuurd.
* @param username
* @param password
* @return
* JSON met gebruikersnaam en een sessie ID (random)
*/
@GET
@Path("login/{username}/{password}")
@Produces(MediaType.APPLICATION_JSON)
public String login(@PathParam("username") String username, @PathParam("password") String password) {
Connection con = DatabaseContainer.getConnection();
JSONObject returnObject = new JSONObject();
String query = "SELECT ID,gebruikersnaam FROM gebruikers WHERE gebruikersnaam = '" + username + "' AND passwoord = '" + password + "'";
try{
ResultSet rs = Database.executeQuery(con, query);
if(rs.next()) {
String sessionKey = generateSessionID();
long unixTimestamp = System.currentTimeMillis()/1000;
String sessionQuery = "INSERT INTO sessies (session_key,time_out,last_activity,begin,gebruiker_ID) VALUES ('" + sessionKey + "',3600," + unixTimestamp + "," + unixTimestamp + ", " + rs.getInt(1) + ")";
System.out.println(sessionQuery);
String checkedUsername = rs.getString(2);
// Opslaan van sessie
if(Database.executeNullQuery(con, sessionQuery)) {
returnObject.put("username", checkedUsername);
returnObject.put("key", sessionKey);
}
else
returnObject.put("error","Error saving session data");
}
else {
// Foutieve login
returnObject.put("error","Wrong password/username.");
}
}
catch (Exception e){
System.out.println(e.toString());
}
return "[" + returnObject.toString() + "]";
}
@GET
@Path("users/")
@Produces(MediaType.APPLICATION_JSON)
public String getUsers() {
String query = "SELECT * FROM gebruikers";
Connection con = DatabaseContainer.getConnection();
try {
ResultSet rs = Database.executeQuery(con, query);
return ResultsetConverter.convert(rs).toString();
}
catch(Exception e) {
System.out.println("Error fetching user table");
}
return null;
}
private String generateSessionID() {
SecureRandom random = new SecureRandom();
return new BigInteger(130, random).toString(32);
}
/***
* Retourneert de gebruikersID gekoppelt aan de sessie sleutel. Indien de sleutel niet bestaat of is verlopen wordt er 0 geretourneerd
* @param sessionKey
* @return int gebruiker_ID
*/
public static int getUserId(String sessionKey) {
Connection con = DatabaseContainer.getConnection();
String query = "SELECT gebruiker_ID FROM sessies WHERE session_key = '" + sessionKey + "'";
try {
ResultSet rs = Database.executeQuery(con, query);
if(rs.next())
return rs.getInt(1);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return 0;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
65013c9535053e91b2630d8a29f94b871dc4afc6 | 1efdb4c8c0b0cea3cb5648f7b53d29a4e609c155 | /backend/src/main/java/com/sivalabs/techbuzz/service/UserService.java | 91ae93222f3ad944e02180575c576336f7605258 | [
"MIT"
] | permissive | motoponk/techbuzz | cb321058ee8865fcbe85d345f1b95fb6fb409b64 | d254fd56508a0cdb6ab32090aa806c620fb07364 | refs/heads/master | 2020-04-06T19:54:50.412321 | 2018-04-10T07:07:11 | 2018-04-10T07:07:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | package com.sivalabs.techbuzz.service;
import com.sivalabs.techbuzz.entities.User;
import com.sivalabs.techbuzz.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserService {
@Autowired
private UserRepository userRepository;
public User findByUsername(String username ) throws UsernameNotFoundException {
return userRepository.findByUsername( username );
}
public User findById( Long id ) throws AccessDeniedException {
return userRepository.findById( id ).get();
}
public List<User> findAll() throws AccessDeniedException {
return userRepository.findAll();
}
}
| [
"sivaprasadreddy.k@gmail.com"
] | sivaprasadreddy.k@gmail.com |
ab9f5905dd03361cfaad2e3a1f0bdb3bbe65495e | e953930a5c841597e7d4b12e6cdce8c251395817 | /parte-04/08-estrutura-dados/src/main/java/com/jornadajava/MeuArrayList.java | de83ad9ca1ce421f9eb8535e7d13c6b7c9bca324 | [
"MIT"
] | permissive | igorgsousa/livro | a58110ce3d8241f6b7509913e32ec36a2c315f1e | 8a04ae162b0936c2ff95bc2775100286252c9457 | refs/heads/master | 2022-11-17T03:22:13.677164 | 2020-07-22T12:40:28 | 2020-07-22T12:40:28 | 282,736,348 | 2 | 0 | MIT | 2020-07-26T21:29:06 | 2020-07-26T21:29:06 | null | UTF-8 | Java | false | false | 433 | java | package com.jornadajava;
import java.util.ArrayList;
import java.util.List;
public class MeuArrayList {
public static void main(String[] args) {
List colecao = new ArrayList();
colecao.add("Allan");
colecao.add("Rodrigo");
colecao.add("Leite");
colecao.remove(1);
System.out.println(colecao.get(0)); //Exibe Allan
System.out.println(colecao.size()); //Exibe 2
}
}
| [
"sandrogiacom@gmail.com"
] | sandrogiacom@gmail.com |
31468c4dc43d395a317eea49910703f49f838a22 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_1cc22b0eae98a607a73c97c3a994ca13d18461fc/BookActivity/33_1cc22b0eae98a607a73c97c3a994ca13d18461fc_BookActivity_s.java | f56ff826e3c0dbf378d55b1110c1c60c83a1c6d4 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,064 | java | package org.csie.mpp.buku;
import org.csie.mpp.buku.db.BookEntry;
import org.csie.mpp.buku.db.DBHelper;
import org.csie.mpp.buku.helper.BookUpdater;
import org.csie.mpp.buku.helper.BookUpdater.OnUpdateFinishedListener;
import com.flurry.android.FlurryAgent;
import com.markupartist.android.widget.ActionBar;
import com.markupartist.android.widget.ActionBar.AbstractAction;
import com.markupartist.android.widget.ActionBar.Action;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;
public class BookActivity extends Activity implements OnUpdateFinishedListener {
public static final int REQUEST_CODE = 1437;
public static final String CHECK_DUPLICATE = "duplicate";
private DBHelper db;
private BookEntry entry;
private ActionBar actionBar;
private Action actionAdd, actionDelete;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.book);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
db = new DBHelper(this);
Intent intent = getIntent();
String isbn = intent.getStringExtra(App.ISBN);
entry = BookEntry.get(db.getReadableDatabase(), isbn);
actionBar = ((ActionBar)findViewById(R.id.actionbar));
boolean updateAll = false;
if(entry != null) {
if(intent.getBooleanExtra(CHECK_DUPLICATE, false))
Toast.makeText(this, R.string.book_already_exists, 3000).show();
actionDelete = new AbstractAction(R.drawable.ic_delete) {
@Override
public void performAction(View view) {
Intent data = new Intent();
data.putExtra(App.ISBN, entry.isbn);
setResult(RESULT_FIRST_USER, data);
finish();
}
};
actionBar.addAction(actionDelete);
updateView();
}
else {
entry = new BookEntry();
entry.isbn = isbn;
updateAll = true;
actionAdd = new AbstractAction(R.drawable.ic_bookshelf) {
@Override
public void performAction(View view) {
if(entry.insert(db.getWritableDatabase()) == false)
Log.e(App.TAG, "Insert failed \"" + entry.isbn + "\".");
Intent data = new Intent();
data.putExtra(App.ISBN, entry.isbn);
setResult(RESULT_OK, data);
Toast.makeText(BookActivity.this, getString(R.string.added), App.TOAST_TIME).show();
actionBar.removeAction(this);
}
};
actionBar.addAction(actionAdd);
}
BookUpdater updater = new BookUpdater(entry);
updater.setOnUpdateFinishedListener(this);
<<<<<<< Updated upstream
=======
<<<<<<< Updated upstream
if(updateAll)
updater.update();
else
=======
updater.updateEntryByBooks();
>>>>>>> Stashed changes
if(updateAll) {
if(updater.updateEntry())
updater.updateInfo();
} else {
<<<<<<< Updated upstream
=======
>>>>>>> Stashed changes
>>>>>>> Stashed changes
updater.updateInfo();
}
}
@Override
public void onStart() {
super.onStart();
FlurryAgent.onStartSession(this, App.FLURRY_APP_KEY);
}
@Override
public void onStop() {
super.onStop();
FlurryAgent.onEndSession(this);
}
@Override
public void onDestroy() {
super.onDestroy();
db.close();
}
/* --- OnUpdateFinishedListener (start) --- */
@Override
public void OnUpdateFinished() {
updateView();
}
@Override
public void OnUpdateFailed() {
if(actionAdd != null)
actionBar.removeAction(actionAdd);
showError();
}
/* --- OnUpdateFinishedListener (end) --- */
private void updateView() {
if(entry.cover!=null)
((ImageView)findViewById(R.id.image)).setImageBitmap(entry.cover);
else
((ImageView)findViewById(R.id.image)).setImageResource(R.drawable.book);
((TextView)findViewById(R.id.title)).setText(entry.title);
((TextView)findViewById(R.id.author)).setText(entry.author);
((RatingBar)findViewById(R.id.rating)).setRating(entry.info.rating);
((TextView)findViewById(R.id.description)).setText(entry.info.description);
((TextView)findViewById(R.id.description)).setMovementMethod(new ScrollingMovementMethod());
}
private void showError() {
FlurryAgent.logEvent(App.FlurryEvent.BOOK_NOT_FOUND.toString());
((TextView)findViewById(R.id.title)).setText(R.string.book_not_found);
Toast.makeText(this, R.string.book_not_found_long, App.TOAST_TIME).show();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
22c851422b9a83eba32cfb9031887c4574489f1a | 5c43519886b5aa69d4420680f51737f9f01bbaac | /src/main/java/pl/agh/tai/portsadapter/soap/generated/holders/SiteFlagInfoTypeHolder.java | 52b43989c88785a612cdbc0c41827235b483f157 | [] | no_license | raduy/feeduct | 1de57ee47509eb70d13431f9cdc976d4a36d3328 | 1831cb6961d4fa883dde56a244303e20a158eeaf | refs/heads/master | 2021-01-10T04:50:59.402356 | 2015-06-02T18:57:29 | 2015-06-02T18:57:29 | 36,721,686 | 0 | 0 | null | 2015-06-02T14:03:11 | 2015-06-02T09:12:01 | Java | UTF-8 | Java | false | false | 555 | java | /**
* SiteFlagInfoTypeHolder.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package pl.agh.tai.portsadapter.soap.generated.holders;
public final class SiteFlagInfoTypeHolder implements javax.xml.rpc.holders.Holder {
public pl.agh.tai.portsadapter.soap.generated.SiteFlagInfoType value;
public SiteFlagInfoTypeHolder() {
}
public SiteFlagInfoTypeHolder(pl.agh.tai.portsadapter.soap.generated.SiteFlagInfoType value) {
this.value = value;
}
}
| [
"raduj.lukasz@gmail.com"
] | raduj.lukasz@gmail.com |
bdc6f1c2099ec61eb9b5a3bb44c5fc97de15e026 | 27b052c54bcf922e1a85cad89c4a43adfca831ba | /src/com/parse/ParseObject$30.java | a9469b1fa0b7c1e776d93600390be6c18f0321a8 | [] | no_license | dreadiscool/YikYak-Decompiled | 7169fd91f589f917b994487045916c56a261a3e8 | ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d | refs/heads/master | 2020-04-01T10:30:36.903680 | 2015-04-14T15:40:09 | 2015-04-14T15:40:09 | 33,902,809 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package com.parse;
import l;
import m;
class ParseObject$30
implements l<Void, m<Object>>
{
ParseObject$30(ParseObject paramParseObject, String paramString) {}
public m<Object> then(m<Void> paramm)
{
return this.this$0.deleteAsync(this.val$sessionToken);
}
}
/* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar
* Qualified Name: com.parse.ParseObject.30
* JD-Core Version: 0.7.0.1
*/ | [
"paras@protrafsolutions.com"
] | paras@protrafsolutions.com |
6af68fb45c5cec42cd7b260b485dc32d2eb0e3ec | 791e42c39654e19dd594e834ef02443a3c990cae | /android-job/src/main/java/com/evernote/android/job/JobCreator.java | 812a960570ba881fd90c9ce28b561c059bbfc6f5 | [
"Apache-2.0"
] | permissive | basirsharif/PhoneProfilesPlus | 6d78673dbc0e95f927d709f0ac3859c81ef215c3 | 61bea656aaf96f6aeb8aca493b26abf746ca4a62 | refs/heads/master | 2020-05-04T20:13:44.541170 | 2019-04-03T20:24:10 | 2019-04-03T20:24:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,124 | java | /*
* Copyright (C) 2018 Evernote Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.evernote.android.job;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* A {@code JobCreator} maps a tag to a specific {@link Job} class. You need to pass the tag in the
* {@link JobRequest.Builder} constructor.
*
* <br>
* <br>
*
* The {@link JobManager} can have multiple {@code JobCreator}s with a first come first serve principle.
* That means that a {@code JobCreator} can block others from creating the right {@link Job}, if they
* share the same tag.
*
* @author rwondratschek
*/
public interface JobCreator {
/**
* Map the {@code tag} to a {@code Job}. If you return {@code null}, then other {@code JobCreator}s
* get the chance to create a {@code Job} for this tag. If no job is created at all, then it's assumed
* that job failed. This method is called on a background thread right before the job runs.
*
* @param tag The tag from the {@link JobRequest} which you passed in the constructor of the
* {@link JobRequest.Builder} class.
* @return A new {@link Job} instance for this tag. If you return {@code null}, then the job failed
* and isn't rescheduled.
* @see JobRequest.Builder#Builder(String)
*/
@Nullable
Job create(@NonNull String tag);
/**
* Action to notify receives that the application was instantiated and {@link JobCreator}s should be added.
*/
String ACTION_ADD_JOB_CREATOR = "com.evernote.android.job.ADD_JOB_CREATOR";
/**
* Abstract receiver to get notified about when {@link JobCreator}s need to be added.
*/
abstract class AddJobCreatorReceiver extends BroadcastReceiver {
@Override
public final void onReceive(Context context, Intent intent) {
if (context == null || intent == null || !ACTION_ADD_JOB_CREATOR.equals(intent.getAction())) {
return;
}
try {
addJobCreator(context, JobManager.create(context));
} catch (JobManagerCreateException ignored) {}
}
/**
* Called to add a {@link JobCreator} to this manager instance by calling {@link JobManager#addJobCreator(JobCreator)}.
*
* @param context Any context.
* @param manager The manager instance.
*/
protected abstract void addJobCreator(@NonNull Context context, @NonNull JobManager manager);
}
}
| [
"henrich.gron@chello.sk"
] | henrich.gron@chello.sk |
0ab3d8b934e880688528426b33dee58a42ca5343 | b4cb1360365f87466e6dfac915198a0e2810e0a3 | /app/src/main/java/com/muziko/helpers/ItemTouchHelpers.java | 4d1c8ed9a5acc7e488a5a5447bdb6b36e62c5efb | [] | no_license | Solunadigital/Muziko | 9b7d38d441c5e41fdea17d07c3d0ab00e15c7c5a | 8fb874c4e765949c32591b826baee1937e8d49ca | refs/heads/master | 2021-09-09T01:55:13.063925 | 2018-03-13T08:13:20 | 2018-03-13T08:13:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package com.muziko.helpers;
import android.view.animation.Interpolator;
/**
* Created by Bradley on 28/02/2017.
*/
public class ItemTouchHelpers {
public static final Interpolator sDragScrollInterpolator = t -> {
// return t * t * t * t * t; // default return value, but it's too late for me
return (int) Math.pow(2, (double) t); // optional whatever you like
};
// default
public static final Interpolator sDragViewScrollCapInterpolator = t -> {
t -= 1.0f;
return t * t * t * t * t + 1.0f;
};
}
| [
"lokeshmehta333@gmail.com"
] | lokeshmehta333@gmail.com |
13b72981802fecca6175e06701bbb4864d57ee3a | 88d785ca23def4ca733f7d52a146bc8d34c77429 | /src/dev/zt/UpliftedVFFV/events/Floor3Offices/EastWingOffices/WarpBalconytoStairsRoom.java | 77987ca3d4d193dea21744a915c596afe66f4c74 | [] | no_license | Donpommelo/Uplifted.VFFV | 30fe1e41a9aeefee16c1e224388af6ce55ebfcce | 99b63eb2a00666eb4fdf84ac20cebebefad1a3dc | refs/heads/master | 2020-12-24T17:44:19.147662 | 2016-06-01T21:46:13 | 2016-06-01T21:46:13 | 33,390,964 | 0 | 0 | null | 2015-08-25T01:57:41 | 2015-04-04T01:58:48 | Java | UTF-8 | Java | false | false | 469 | java | package dev.zt.UpliftedVFFV.events.Floor3Offices.EastWingOffices;
import dev.zt.UpliftedVFFV.events.Event;
import dev.zt.UpliftedVFFV.gfx.Assets;
public class WarpBalconytoStairsRoom extends Event {
public static int stagenum = 0;
public WarpBalconytoStairsRoom(float x, float y, int idnum) {
super(Assets.White,idnum,x, y, stagenum);
}
public void run(){
super.transport("/Worlds/Floor3Offices/EastWingOffices/EastOfficesLeft1Room1.txt",16,6,"");
}
}
| [
"donpommelo@gmail"
] | donpommelo@gmail |
a2bd0f197707adbae610a46cd9b74f5f50a58851 | 812be6b9d1ba4036652df166fbf8662323f0bdc9 | /java/Dddml.Wms.JavaCommon/src/generated/java/org/dddml/wms/domain/partyrole/AbstractPartyRoleStateCommandConverter.java | bd4c597a551aad5f7efd3c9c268126628c2c5bbd | [] | no_license | lanmolsz/wms | 8503e54a065670b48a15955b15cea4926f05b5d6 | 4b71afd80127a43890102167a3af979268e24fa2 | refs/heads/master | 2020-03-12T15:10:26.133106 | 2018-09-27T08:28:05 | 2018-09-27T08:28:05 | 130,684,482 | 0 | 0 | null | 2018-04-23T11:11:24 | 2018-04-23T11:11:24 | null | UTF-8 | Java | false | false | 2,966 | java | package org.dddml.wms.domain.partyrole;
import java.util.*;
import java.util.Date;
import org.dddml.wms.domain.*;
public abstract class AbstractPartyRoleStateCommandConverter<TCreatePartyRole extends PartyRoleCommand.CreatePartyRole, TMergePatchPartyRole extends PartyRoleCommand.MergePatchPartyRole, TDeletePartyRole extends PartyRoleCommand.DeletePartyRole>
{
public PartyRoleCommand toCreateOrMergePatchPartyRole(PartyRoleState state)
{
//where TCreatePartyRole : ICreatePartyRole, new()
//where TMergePatchPartyRole : IMergePatchPartyRole, new()
boolean bUnsaved = state.isStateUnsaved();
if (bUnsaved)
{
return toCreatePartyRole(state);
}
else
{
return toMergePatchPartyRole(state);
}
}
public TDeletePartyRole toDeletePartyRole(PartyRoleState state) //where TDeletePartyRole : IDeletePartyRole, new()
{
TDeletePartyRole cmd = newDeletePartyRole();
cmd.setPartyRoleId(state.getPartyRoleId());
cmd.setVersion(state.getVersion());
return cmd;
}
public TMergePatchPartyRole toMergePatchPartyRole(PartyRoleState state) //where TMergePatchPartyRole : IMergePatchPartyRole, new()
{
TMergePatchPartyRole cmd = newMergePatchPartyRole();
cmd.setVersion(state.getVersion());
cmd.setPartyRoleId(state.getPartyRoleId());
cmd.setActive(state.getActive());
if (state.getActive() == null) { cmd.setIsPropertyActiveRemoved(true); }
return cmd;
}
public TCreatePartyRole toCreatePartyRole(PartyRoleState state) //where TCreatePartyRole : ICreatePartyRole, new()
{
TCreatePartyRole cmd = newCreatePartyRole();
cmd.setVersion(state.getVersion());
cmd.setPartyRoleId(state.getPartyRoleId());
cmd.setActive(state.getActive());
return cmd;
}
protected abstract TCreatePartyRole newCreatePartyRole();
protected abstract TMergePatchPartyRole newMergePatchPartyRole();
protected abstract TDeletePartyRole newDeletePartyRole();
public static class SimplePartyRoleStateCommandConverter extends AbstractPartyRoleStateCommandConverter<AbstractPartyRoleCommand.SimpleCreatePartyRole, AbstractPartyRoleCommand.SimpleMergePatchPartyRole, AbstractPartyRoleCommand.SimpleDeletePartyRole>
{
@Override
protected AbstractPartyRoleCommand.SimpleCreatePartyRole newCreatePartyRole() {
return new AbstractPartyRoleCommand.SimpleCreatePartyRole();
}
@Override
protected AbstractPartyRoleCommand.SimpleMergePatchPartyRole newMergePatchPartyRole() {
return new AbstractPartyRoleCommand.SimpleMergePatchPartyRole();
}
@Override
protected AbstractPartyRoleCommand.SimpleDeletePartyRole newDeletePartyRole() {
return new AbstractPartyRoleCommand.SimpleDeletePartyRole();
}
}
}
| [
"yangjiefeng@gmail.com"
] | yangjiefeng@gmail.com |
8c4feabef908d688eb79adff8495e37d54f26630 | fa1408365e2e3f372aa61e7d1e5ea5afcd652199 | /src/testcases/CWE643_Xpath_Injection/CWE643_Xpath_Injection__Environment_66b.java | 2789f7b992bc7e82c82cc154c6725709d3cdc92a | [] | 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,625 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE643_Xpath_Injection__Environment_66b.java
Label Definition File: CWE643_Xpath_Injection.label.xml
Template File: sources-sinks-66b.tmpl.java
*/
/*
* @description
* CWE: 643 Xpath Injection
* BadSource: Environment Read data from an environment variable
* GoodSource: A hardcoded string
* Sinks:
* GoodSink: validate input through StringEscapeUtils
* BadSink : user input is used without validate
* Flow Variant: 66 Data flow: data passed in an array from one method to another in different source files in the same package
*
* */
package testcases.CWE643_Xpath_Injection;
import testcasesupport.*;
import javax.servlet.http.*;
import javax.xml.xpath.*;
import org.xml.sax.InputSource;
import org.apache.commons.lang.StringEscapeUtils;
public class CWE643_Xpath_Injection__Environment_66b
{
public void badSink(String dataArray[] ) throws Throwable
{
String data = dataArray[2];
String xmlFile = null;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
xmlFile = "\\src\\testcases\\CWE643_Xpath Injection\\CWE643_Xpath_Injection__Helper.xml";
}
else
{
/* running on non-Windows */
xmlFile = "./src/testcases/CWE643_Xpath Injection/CWE643_Xpath_Injection__Helper.xml";
}
if (data != null)
{
/* assume username||password as source */
String [] tokens = data.split("||");
if (tokens.length < 2)
{
return;
}
String username = tokens[0];
String password = tokens[1];
/* build xpath */
XPath xPath = XPathFactory.newInstance().newXPath();
InputSource inputXml = new InputSource(xmlFile);
/* INCIDENTAL: CWE180 Incorrect Behavior Order: Validate Before Canonicalize
* The user input should be canonicalized before validation. */
/* POTENTIAL FLAW: user input is used without validate */
String query = "//users/user[name/text()='" + username +
"' and pass/text()='" + password + "']" +
"/secret/text()";
String secret = (String)xPath.evaluate(query, inputXml, XPathConstants.STRING);
}
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(String dataArray[] ) throws Throwable
{
String data = dataArray[2];
String xmlFile = null;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
xmlFile = "\\src\\testcases\\CWE643_Xpath Injection\\CWE643_Xpath_Injection__Helper.xml";
}
else
{
/* running on non-Windows */
xmlFile = "./src/testcases/CWE643_Xpath Injection/CWE643_Xpath_Injection__Helper.xml";
}
if (data != null)
{
/* assume username||password as source */
String [] tokens = data.split("||");
if (tokens.length < 2)
{
return;
}
String username = tokens[0];
String password = tokens[1];
/* build xpath */
XPath xPath = XPathFactory.newInstance().newXPath();
InputSource inputXml = new InputSource(xmlFile);
/* INCIDENTAL: CWE180 Incorrect Behavior Order: Validate Before Canonicalize
* The user input should be canonicalized before validation. */
/* POTENTIAL FLAW: user input is used without validate */
String query = "//users/user[name/text()='" + username +
"' and pass/text()='" + password + "']" +
"/secret/text()";
String secret = (String)xPath.evaluate(query, inputXml, XPathConstants.STRING);
}
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(String dataArray[] ) throws Throwable
{
String data = dataArray[2];
String xmlFile = null;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
xmlFile = "\\src\\testcases\\CWE643_Xpath Injection\\CWE643_Xpath_Injection__Helper.xml";
}
else
{
/* running on non-Windows */
xmlFile = "./src/testcases/CWE643_Xpath Injection/CWE643_Xpath_Injection__Helper.xml";
}
if (data != null)
{
/* assume username||password as source */
String [] tokens = data.split("||");
if( tokens.length < 2 )
{
return;
}
/* FIX: validate input using StringEscapeUtils */
String username = StringEscapeUtils.escapeXml(tokens[0]);
String password = StringEscapeUtils.escapeXml(tokens[1]);
/* build xpath */
XPath xPath = XPathFactory.newInstance().newXPath();
InputSource inputXml = new InputSource(xmlFile);
String query = "//users/user[name/text()='" + username +
"' and pass/text()='" + password + "']" +
"/secret/text()";
String secret = (String)xPath.evaluate(query, inputXml, XPathConstants.STRING);
}
}
}
| [
"bqcuong2212@gmail.com"
] | bqcuong2212@gmail.com |
82b60be21700e8c19f58e6ed958f0ea898fbdec1 | 9a024b64f20c4fda4d73b2d32c949d81a40d3902 | /seltaf/src/com/aqm/staf/library/databin/Exten2DetailsMiscEntity.java | 61ddb8ca2b7008b0b0b4eeb45ba84c032559f060 | [] | no_license | Khaire/NIA | 1d25a8f66761a8ca024b05417a73b9d82b3acd28 | 876d5d1a5fe4f9953bd1d0ef8911ffc8aafa16b6 | refs/heads/master | 2022-12-01T01:40:40.690861 | 2019-05-24T06:25:14 | 2019-05-24T06:25:14 | 188,364,339 | 0 | 0 | null | 2022-11-24T06:12:23 | 2019-05-24T06:22:50 | Java | UTF-8 | Java | false | false | 230 | java | package com.aqm.staf.library.databin;
public class Exten2DetailsMiscEntity extends GenericEntity{
public Exten2DetailsMiscEntity() {
super("Exten2DetailsMiscEntity");
// TODO Auto-generated constructor stub
}
}
| [
"Temp@AQMIT-DSK-10231"
] | Temp@AQMIT-DSK-10231 |
a0281f79f99032a2ba4a520aaac49a026226e773 | afc757cc5283b27982958d48fc41fa366a961c28 | /src/main/java/com/el/betting/sdk/v2/common/FeedsFilterUtil.java | 7b4a79dc1cb5d40ff7a1379880d2a542d2854432 | [] | no_license | davithbul/sport-betting-api | c75b63013a1460d390e9c67923af88fd5c7fcd7a | 943fc6defc2ead6e1e7767379f8ae1fa7bbd483c | refs/heads/master | 2020-03-10T03:20:33.071695 | 2018-04-11T22:40:02 | 2018-04-11T22:40:02 | 129,162,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,929 | java | package com.el.betting.sdk.v2.common;
import com.el.betting.sdk.v2.BookmakerFeeds;
import com.el.betting.sdk.v2.Event;
import com.el.betting.sdk.v2.League;
import com.el.betting.sdk.v2.Sport;
import com.el.betting.sdk.v2.criteria.FeedsFilter;
import com.el.betting.sdk.v4.Participant;
import org.slf4j.Logger;import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class FeedsFilterUtil {
private final static Logger log = LoggerFactory.getLogger(FeedsFilterUtil.class);
public static List<Event<? extends Participant>> searchEvents(BookmakerFeeds bookmakerFeeds, FeedsFilter feedsFilter) {
if (bookmakerFeeds.getSports() == null) {
return Collections.emptyList();
}
Stream<League> leagueStream = applySportsFilters(bookmakerFeeds, feedsFilter)
.filter(sport -> !CollectionUtils.isEmpty(sport.getLeagues()))
.map(Sport::getLeagues)
.flatMap(Collection::stream);
Stream<Event<? extends Participant>> eventStream = applyLeagueFilters(leagueStream, feedsFilter)
.filter(league -> !CollectionUtils.isEmpty(league.getEvents()))
.map(League::getEvents)
.flatMap(Collection::stream);
return applyEventsFilter(eventStream, feedsFilter).collect(Collectors.toList());
}
public static List<League> searchLeagues(BookmakerFeeds bookmakerFeeds, FeedsFilter feedsFilter) {
if (bookmakerFeeds.getSports() == null) {
return Collections.emptyList();
}
//filter sports
Stream<League> leagueStream = applySportsFilters(bookmakerFeeds, feedsFilter)
.filter(sport -> !CollectionUtils.isEmpty(sport.getLeagues()))
.map(Sport::getLeagues)
.flatMap(Collection::stream);
//filter leagues
leagueStream = applyLeagueFilters(leagueStream, feedsFilter)
.map(league -> {
League clonedLeague = league.clone();
if (clonedLeague.getEvents() == null) {
clonedLeague.setEvents(new ArrayList<>());
}
List<Event<? extends Participant>> events = applyEventsFilter(clonedLeague.getEvents().stream(), feedsFilter)
.collect(Collectors.toList());
clonedLeague.setEvents(events);
return clonedLeague;
});
if (containsEventFilters(feedsFilter)) {
leagueStream = leagueStream.filter(league -> !CollectionUtils.isEmpty(league.getEvents()));
}
return leagueStream.collect(Collectors.toList());
}
public static List<Sport> searchSports(BookmakerFeeds bookmakerFeeds, FeedsFilter feedsFilter) {
if (bookmakerFeeds.getSports() == null) {
return Collections.emptyList();
}
Stream<Sport> sportStream = applySportsFilters(bookmakerFeeds, feedsFilter)
.map(sport -> {
Sport sportClone = sport.clone();
if (sportClone.getLeagues() == null) {
sportClone.setLeagues(new ArrayList<>());
}
//filter leagues
Stream<League> leagueStream = applyLeagueFilters(sportClone.getLeagues().stream(), feedsFilter)
.filter(league -> league.getEvents() != null)
.map(league -> {
Stream<Event<? extends Participant>> eventStream = applyEventsFilter(league.getEvents().stream(), feedsFilter);
league.setEvents(eventStream.collect(Collectors.toList()));
return league;
});
if (containsEventFilters(feedsFilter)) {
leagueStream = leagueStream.filter(league -> !CollectionUtils.isEmpty(league.getEvents()));
}
sportClone.setLeagues(leagueStream.collect(Collectors.toList()));
return sportClone;
});
//if there is league filters then check that leagues are not empty after applying filter
if (containsLeagueFilters(feedsFilter)) {
sportStream = sportStream.filter(sport -> !CollectionUtils.isEmpty(sport.getLeagues()));
}
return sportStream.collect(Collectors.toList());
}
private static Stream<Sport> applySportsFilters(BookmakerFeeds bookmakerFeeds, FeedsFilter feedsFilter) {
return bookmakerFeeds.getSports()
.stream()
.filter(sport -> feedsFilter.getSportType() == null || sport.getSportType() == feedsFilter.getSportType());
}
private static Stream<League> applyLeagueFilters(Stream<League> leagues, FeedsFilter feedsFilter) {
return leagues
.filter(league -> {
if (CollectionUtils.isEmpty(feedsFilter.getLeaguePredicates())) {
return true;
}
return feedsFilter.getLeaguePredicates().stream().anyMatch(leaguePredicate -> leaguePredicate.test(league));
});
}
public static Stream<Event<? extends Participant>> applyEventsFilter(Stream<Event<? extends Participant>> eventStream, FeedsFilter feedsFilter) {
return eventStream.filter(event -> {
if (CollectionUtils.isEmpty(feedsFilter.getEventPredicates())) {
return true;
}
return feedsFilter.getEventPredicates().stream().anyMatch(eventPredicate -> eventPredicate.test(event));
}).filter(event -> {
if (CollectionUtils.isEmpty(feedsFilter.getParticipantPredicates())) {
return true;
}
if (event.getParticipants() == null) {
log.error("Teams for event are null: " + event);
return false;
}
if (event.getParticipants().size() < 2) {
return false;
}
return feedsFilter.getParticipantPredicates().stream()
.allMatch(teamPredicate -> event.getParticipants().stream().anyMatch(teamPredicate::test));
});
}
public static boolean containsLeagueFilters(FeedsFilter feedsFilter) {
return !CollectionUtils.isEmpty(feedsFilter.getLeaguePredicates()) || containsEventFilters(feedsFilter);
}
public static boolean containsEventFilters(FeedsFilter feedsFilter) {
return !CollectionUtils.isEmpty(feedsFilter.getEventPredicates())
|| !CollectionUtils.isEmpty(feedsFilter.getParticipantPredicates());
}
}
| [
"davithbul@gmail.com"
] | davithbul@gmail.com |
3df641473423e3ef1336be4bd850558e0fa447df | 4fdec25e8fb18424592d8075c1452c0ad06fe447 | /system/eureka/src/main/java/com/tenio/mmorpg/eureka/EurekaApplication.java | a4ebd75d728a99b9039d2daf3d8be8aba9bd3bcf | [
"MIT"
] | permissive | congcoi123/tenio-mmorpg | da1f6f476bad9ab0be2c8772f32cd79c963244a4 | 2d30cf308734b1bfeb7beaddda68cc5bca9b1b74 | refs/heads/master | 2023-08-16T06:02:21.844367 | 2021-10-24T01:12:54 | 2021-10-24T01:12:54 | 420,264,581 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,503 | java | /*
The MIT License
Copyright (c) 2016-2021 kong <congcoi123@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package com.tenio.mmorpg.eureka;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class);
}
}
| [
"congcoi123@gmail.com"
] | congcoi123@gmail.com |
5edfefe51b026a418e5afccac725a17ef9387687 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes10.dex_source_from_JADX/com/google/android/gms/wearable/zze.java | 67a845ed5f53a98bf092fcaab6d67eacb2c593b5 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,579 | java | package com.google.android.gms.wearable;
import android.net.Uri;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.zza;
public class zze implements Creator<Asset> {
public Object createFromParcel(Parcel parcel) {
Uri uri = null;
int b = zza.b(parcel);
int i = 0;
ParcelFileDescriptor parcelFileDescriptor = null;
String str = null;
byte[] bArr = null;
while (parcel.dataPosition() < b) {
int a = zza.a(parcel);
switch (zza.a(a)) {
case 1:
i = zza.e(parcel, a);
break;
case 2:
bArr = zza.q(parcel, a);
break;
case 3:
str = zza.n(parcel, a);
break;
case 4:
parcelFileDescriptor = (ParcelFileDescriptor) zza.a(parcel, a, ParcelFileDescriptor.CREATOR);
break;
case 5:
uri = (Uri) zza.a(parcel, a, Uri.CREATOR);
break;
default:
zza.a(parcel, a);
break;
}
}
if (parcel.dataPosition() == b) {
return new Asset(i, bArr, str, parcelFileDescriptor, uri);
}
throw new zza.zza("Overread allowed size end=" + b, parcel);
}
public Object[] newArray(int i) {
return new Asset[i];
}
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
e72411560ea9772bd7359f506b043692bdf338eb | 4a47c37bcea65b6b852cc7471751b5239edf7c94 | /src/academy/everyonecodes/java/week5/set1/exercise4/DoubleListMinimumFinderTest.java | 61094394e958106994caba29726d5a9d247d4b67 | [] | no_license | uanave/java-module | acbe808944eae54cfa0070bf8b80edf453a3edcf | f98e49bd05473d394329602db82a6945ad1238b5 | refs/heads/master | 2022-04-07T15:42:36.210153 | 2020-02-27T14:43:29 | 2020-02-27T14:43:29 | 226,831,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | package academy.everyonecodes.java.week5.set1.exercise4;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.Optional;
public class DoubleListMinimumFinderTest {
DoubleListMinimumFinder doubleListMinimumFinder = new DoubleListMinimumFinder();
@Test
void find() {
List<Double> input = List.of(2.3, 1.3, 0.8);
Optional<Double> oResult = doubleListMinimumFinder.find(input);
double expected = 0.8;
Assertions.assertTrue(oResult.isPresent());
Assertions.assertEquals(expected, oResult.get());
}
@Test
void findEmpty() {
List<Double> input = List.of();
Optional<Double> oResult = doubleListMinimumFinder.find(input);
Assertions.assertTrue(oResult.isEmpty());
}
@Test
void findZero() {
List<Double> input = List.of(-0.0, -1.9, -1.2);
Optional<Double> oResult = doubleListMinimumFinder.find(input);
double expected = -1.9;
Assertions.assertTrue(oResult.isPresent());
Assertions.assertEquals(expected, oResult.get());
}
}
| [
"uanavasile@gmail.com"
] | uanavasile@gmail.com |
b3db7c8c764b5dccd49137857c9fb9c83ae0d5ec | 5d23e7f68eb05a50e6d799189b5b5f7dc3a9624e | /CommonsEntity/metamodel/com/bid4win/commons/persistence/entity/connection/ConnectionAbstract_.java | 03980c649a5736ceb49d7aa80ccab30fa7a90276 | [] | no_license | lanaflon-cda2/B4W | 37d9f718bb60c1bf20c62e7d0c3e53fbf4a50c95 | 7ddad31425798cf817c5881dd13de5482431fc7b | refs/heads/master | 2021-05-27T05:47:23.132341 | 2013-10-11T11:51:03 | 2013-10-11T11:51:03 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 1,677 | java | package com.bid4win.commons.persistence.entity.connection;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
import com.bid4win.commons.core.Bid4WinDate;
import com.bid4win.commons.persistence.entity.Bid4WinEntity_;
import com.bid4win.commons.persistence.entity.account.AccountBasedEntityMultipleGeneratedID_;
/**
* Metamodel de la classe ConnectionAbstract<BR>
* <BR>
* @author Emeric Fillâtre
*/
@StaticMetamodel(ConnectionAbstract.class)
public class ConnectionAbstract_ extends AccountBasedEntityMultipleGeneratedID_
{
/** Définition de l'adresse IP de connexion */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, IpAddress> ipAddress;
/** Définition de l'identifiant du process à l'origine de la connexion */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, String> processId;
/** Définition du flag indiquant la rémanence de la connexion */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, Boolean> remanent;
/** Définition du flag indiquant si la connexion est active */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, Boolean> active;
/** Définition de la raison de fin de connexion */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, DisconnectionReason> disconnectionReason;
/** Définition de la date de début de connexion */
public static volatile SingularAttribute<ConnectionAbstract<?, ?, ?>, Bid4WinDate> startDate;
// Définition de la profondeur des relations
static
{
Bid4WinEntity_.startProtection();
Bid4WinEntity_.stopProtection();
}
}
| [
"emeric.fillatre@gmail.com"
] | emeric.fillatre@gmail.com |
7b6868567826db36367ae5d62b1a893ce59bffb9 | 872967c9fa836eee09600f4dbd080c0da4a944c1 | /source/com/sun/org/apache/xml/internal/security/utils/DOMNamespaceContext.java | 5261d3e7265d22c6daf209555f608aee81a31cf0 | [] | no_license | pangaogao/jdk | 7002b50b74042a22f0ba70a9d3c683bd616c526e | 3310ff7c577b2e175d90dec948caa81d2da86897 | refs/heads/master | 2021-01-21T02:27:18.595853 | 2018-10-22T02:45:34 | 2018-10-22T02:45:34 | 101,888,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,560 | java | /*
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.sun.org.apache.xml.internal.security.utils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.xml.namespace.NamespaceContext;
import test.org.w3c.dom.Attr;
import test.org.w3c.dom.Element;
import test.org.w3c.dom.NamedNodeMap;
import test.org.w3c.dom.Node;
/**
*/
public class DOMNamespaceContext implements NamespaceContext {
private Map<String, String> namespaceMap = new HashMap<String, String>();
public DOMNamespaceContext(Node contextNode) {
addNamespaces(contextNode);
}
public String getNamespaceURI(String arg0) {
return namespaceMap.get(arg0);
}
public String getPrefix(String arg0) {
for (String key : namespaceMap.keySet()) {
String value = namespaceMap.get(key);
if (value.equals(arg0)) {
return key;
}
}
return null;
}
public Iterator<String> getPrefixes(String arg0) {
return namespaceMap.keySet().iterator();
}
private void addNamespaces(Node element) {
if (element.getParentNode() != null) {
addNamespaces(element.getParentNode());
}
if (element instanceof Element) {
Element el = (Element)element;
NamedNodeMap map = el.getAttributes();
for (int x = 0; x < map.getLength(); x++) {
Attr attr = (Attr)map.item(x);
if ("xmlns".equals(attr.getPrefix())) {
namespaceMap.put(attr.getLocalName(), attr.getValue());
}
}
}
}
}
| [
"gaopanpan@meituan.com"
] | gaopanpan@meituan.com |
7136ae7ec3d61436d1157552831001e1031b90e5 | 8035961ba790354762d80c229019632e545365bc | /Demos/Lesson08/springbootthymeleaf/src/main/java/edu/mum/cs/springbootthymeleaf/MyWebMvcConfigurer.java | 8b0caca56def5723a0a78e3c822222f5302a8009 | [] | no_license | sarojthapa2019/WAA | ddecdf6170984803c116f19bd9cdd65a9a9d274f | b63d2a1dbbbbb51a12acc9bc75d7f3a2aed5e0c3 | refs/heads/master | 2022-12-27T05:51:52.638904 | 2019-12-19T22:56:56 | 2019-12-19T22:56:56 | 212,652,176 | 0 | 0 | null | 2022-12-16T00:41:00 | 2019-10-03T18:37:58 | Java | UTF-8 | Java | false | false | 1,958 | java | package edu.mum.cs.springbootthymeleaf;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import java.util.Locale;
@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(Locale.US);
return slr;
}
@Bean
public LocaleChangeInterceptor localeChangeInterceptor() {
LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
lci.setParamName("lang");
return lci;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(localeChangeInterceptor());
}
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasenames("classpath:errorMessages", "classpath:messages");
messageSource.setDefaultEncoding("UTF-8");
return messageSource;
}
@Bean
public LocalValidatorFactoryBean validator() {
LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
bean.setValidationMessageSource(messageSource());
return bean;
}
}
| [
"sarose301@gmail.com"
] | sarose301@gmail.com |
bf752c2280831c2efe61917c1ea976dc62b846b4 | 74bc3a1fd6ded5fee51de40fb0822be155555c2c | /gasoline/src/java/com/stepup/gasoline/qt/vendor/oil/VendorFormAction.java | 7a577f7a71bb4cec3ee2a8029bf470aef554c125 | [] | no_license | phuongtu1983/quangtrung | 0863f7a6125918faaaffb6e27fad366369885cb6 | ece90b4876c8680ee6d386e950db2fbb0208a56a | refs/heads/master | 2021-06-05T07:21:30.227630 | 2020-10-07T02:12:19 | 2020-10-07T02:12:19 | 130,137,918 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,872 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.stepup.gasoline.qt.vendor.oil;
import com.stepup.core.util.NumberUtil;
import com.stepup.gasoline.qt.bean.VendorBean;
import com.stepup.gasoline.qt.core.DynamicFieldValueAction;
import com.stepup.gasoline.qt.dao.OrganizationDAO;
import com.stepup.gasoline.qt.dao.VendorDAO;
import com.stepup.gasoline.qt.util.Constants;
import com.stepup.gasoline.qt.util.QTUtil;
import com.stepup.gasoline.qt.vendor.VendorFormBean;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.validator.GenericValidator;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
/**
*
* @author phuongtu
*/
public class VendorFormAction extends DynamicFieldValueAction {
/**
* This is the action called from the Struts framework.
*
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
@Override
public boolean doMainAction(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
VendorOilFormBean formBean = null;
String vendorid = request.getParameter("vendorId");
VendorDAO vendorDAO = new VendorDAO();
ArrayList arrStoreDetail = null;
if (!GenericValidator.isBlankOrNull(vendorid)) {
try {
int id = NumberUtil.parseInt(vendorid, 0);
VendorFormBean vendorBean = vendorDAO.getVendor(id);
if (vendorBean != null) {
formBean = new VendorOilFormBean(vendorBean);
}
arrStoreDetail = vendorDAO.getVendorOilStoreDetail(id);
} catch (Exception ex) {
}
}
if (formBean == null) {
formBean = new VendorOilFormBean();
}
request.setAttribute(Constants.VENDOR_OIL, formBean);
if (arrStoreDetail == null) {
arrStoreDetail = new ArrayList();
}
request.setAttribute(Constants.VENDOR_OIL_STORE, arrStoreDetail);
ArrayList arrStore = null;
try {
OrganizationDAO organizationDAO = new OrganizationDAO();
arrStore = organizationDAO.getStores(QTUtil.getOrganizationManageds(request.getSession()), VendorBean.IS_OIL);
} catch (Exception ex) {
}
if (arrStore == null) {
arrStore = new ArrayList();
}
request.setAttribute(Constants.STORE_LIST, arrStore);
return true;
}
}
| [
"phuongtu1983@gmail.com"
] | phuongtu1983@gmail.com |
ee5258093a19c1e9011b5c54c09e57b2ff24596e | 71297d32b177ee8a89fb356851c7c04e701fa2bf | /app/src/main/java/com/js/shipper/di/ContextLife.java | 792a08c8b0c86ddb13432f673ae6b3afb636b6d3 | [] | no_license | jiangshenapp/JS_Shipper_Android | b91f490f93f637469ad670a7ebbed257c935927b | 07fbea46828baa500b3a160200abe9cf60cf7fbf | refs/heads/master | 2020-05-19T10:26:13.425091 | 2019-07-24T08:39:16 | 2019-07-24T08:39:16 | 172,444,949 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 301 | java | package com.js.shipper.di;
import java.lang.annotation.Retention;
import javax.inject.Scope;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Created by huyg on 2018/8/22.
*/
@Scope
@Retention(RUNTIME)
public @interface ContextLife {
String value() default "Application";
}
| [
"742315209@qq.com"
] | 742315209@qq.com |
6d2ac641cb15513674961ed5f21f5a8463225b36 | 732ba8e2f97b16bd9d7d2d70aebf82978c88cfa2 | /kanguan/src/main/java/com/kanguan/entity/po/Subscription.java | a0f8bfdea81ce9e4149e2b650ed267103249a648 | [
"MIT"
] | permissive | ZSSXL/kanguan | 8e6ef45b7957f5d85b11b71f32e586505fb0cefb | de054ac7f0e9fbe2813433d9ee6fcdbfa14a3fdc | refs/heads/master | 2022-12-10T21:17:54.868859 | 2020-06-28T01:59:29 | 2020-06-28T01:59:29 | 247,619,295 | 0 | 0 | MIT | 2022-06-17T03:03:20 | 2020-03-16T05:35:24 | JavaScript | UTF-8 | Java | false | false | 953 | java | package com.kanguan.entity.po;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import java.io.Serializable;
/**
* @author ZSS
* @date 2020/3/16 15:38
* @description 订阅表
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "kg_subscription")
public class Subscription extends Model<Subscription> implements Serializable {
/**
* 订阅Id
*/
@TableId
private String subId;
/**
* 订阅人
*/
private String subscriber;
/**
* 订阅对象
*/
private String subObject;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
@Override
protected Serializable pkVal() {
return subId;
}
}
| [
"1271130458@qq.com"
] | 1271130458@qq.com |
a8e03a1c42bea2f60d7c1a8ccfdd9ab2696d75a7 | a3a583c5779c8c75af564660f64a342ef5a2c7e9 | /account-server/src/main/java/com/spark/bitrade/controller/MemberTransactionController.java | f13eca5b1f4f5393e29081288c7eed115704c5a6 | [] | no_license | Coredesing/silk-v2 | d55b2311964602ff2256e9d85112d3d21cd26168 | 7bbe0a640e370b676d1b047412b0102152e6ffde | refs/heads/master | 2022-05-24T14:26:53.218326 | 2020-04-28T03:01:25 | 2020-04-28T03:01:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,930 | java | package com.spark.bitrade.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spark.bitrade.constant.TransactionType;
import com.spark.bitrade.entity.MemberTransaction;
import com.spark.bitrade.service.MemberTransactionService;
import com.spark.bitrade.util.MessageRespResult;
import com.spark.bitrade.vo.WidthRechargeStaticsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Date;
/**
* (MemberTransaction)控制层
*
* @author yangch
* @since 2019-06-15 16:27:30
*/
@RestController
@RequestMapping("api/v2/memberTransaction")
@Api(description = "控制层")
public class MemberTransactionController extends ApiController {
/**
* 服务对象
*/
@Resource
private MemberTransactionService memberTransactionService;
/**
* 分页查询所有数据
*
* @param size 分页.每页数量
* @param current 分页.当前页码
* @param memberTransaction 查询实体
* @return 所有数据
*/
@ApiOperation(value = "分页查询所有数据接口", notes = "分页查询所有数据接口")
@ApiImplicitParams({
@ApiImplicitParam(value = "分页.每页数量。eg:10", defaultValue = "10", name = "size", dataTypeClass = Integer.class, required = true),
@ApiImplicitParam(value = "分页.当前页码.eg:从1开始", name = "current", defaultValue = "1", dataTypeClass = Integer.class, required = true),
@ApiImplicitParam(value = "实体对象", name = "memberTransaction", dataTypeClass = MemberTransaction.class)
})
@RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
public MessageRespResult<IPage<MemberTransaction>> list(Integer size, Integer current, MemberTransaction memberTransaction) {
return success(this.memberTransactionService.page(new Page<>(current, size), new QueryWrapper<>(memberTransaction)));
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@ApiOperation(value = "通过主键查询单条数据接口", notes = "通过主键查询单条数据接口")
@ApiImplicitParam(value = "主键", name = "id", dataTypeClass = Serializable.class, required = true)
@RequestMapping(value = "/get", method = {RequestMethod.GET, RequestMethod.POST})
public MessageRespResult<MemberTransaction> get(@RequestParam("id") Serializable id) {
return success(this.memberTransactionService.getById(id));
}
/**
* 分页查询项目方币种充值提币统计
* @param type
* @param current
* @param size
* @param startTime
* @param endTime
* @param coin
* @return
*/
@ApiOperation(value = "分页查询项目方充值提现", notes = "分页查询项目方充值提现")
@RequestMapping(value = "/memberTransctionPage", method = {RequestMethod.POST})
public MessageRespResult<IPage<WidthRechargeStaticsVo>> list(TransactionType type,
Integer current,
Integer size,
Date startTime,
Date endTime,
String coin) {
Page<WidthRechargeStaticsVo> page = new Page<>(current, size);
return success(memberTransactionService.widthRechargeStaticsVo(type,startTime,endTime,coin,page));
}
//
// /**
// * 新增数据
// *
// * @param memberTransaction 实体对象
// * @return 新增结果
// */
// @ApiOperation(value = "新增数据接口", notes = "新增数据接口")
// @ApiImplicitParam(value = "实体对象", name = "memberTransaction", dataTypeClass =MemberTransaction.class )
// @RequestMapping(value = "/add", method = {RequestMethod.GET, RequestMethod.POST})
// public MessageRespResult add(MemberTransaction memberTransaction) {
// return success(this.memberTransactionService.save(memberTransaction));
// }
//
// /**
// * 修改数据
// *
// * @param memberTransaction 实体对象
// * @return 修改结果
// */
// @ApiOperation(value = "修改数据接口", notes = "修改数据接口")
// @ApiImplicitParam(value = "实体对象", name = "memberTransaction", dataTypeClass =MemberTransaction.class )
// @RequestMapping(value = "/update", method = {RequestMethod.GET, RequestMethod.POST})
// public MessageRespResult update(MemberTransaction memberTransaction) {
// return success(this.memberTransactionService.updateById(memberTransaction));
// }
//
// /**
// * 删除数据
// *
// * @param idList 主键集合
// * @return 删除结果
// */
// @DeleteMapping
// @ApiOperation(value = "删除数据接口", notes = "删除数据接口")
// @ApiImplicitParam(value = "主键集合", name = "idList", dataTypeClass = List.class, required = true)
// @RequestMapping(value = "/delete", method = {RequestMethod.GET, RequestMethod.POST})
// public MessageRespResult delete(@RequestParam("idList") List<Serializable> idList) {
// return success(this.memberTransactionService.removeByIds(idList));
// }
} | [
"huihui123"
] | huihui123 |
163d0212ab2b15038e15a9740668a358a2ab0a0c | d04954936e2e71928d4fb51383f2d192d307d160 | /esql-frontend/src/test/java/com/exxeta/iss/sonar/esql/api/tree/CreateRoutineTreeImplTest.java | bf9e66a05778657251444625312b16190e9cb443 | [
"Apache-2.0"
] | permissive | SergeyPugachyov/sonar-esql-plugin | 00678376e1012f36ffe4824d6598af9a1a70a314 | 1c632b64e128b50907d5b177ef8cb50754b976a2 | refs/heads/master | 2020-05-03T01:48:50.320241 | 2018-12-08T14:20:51 | 2018-12-08T14:20:51 | 158,373,931 | 0 | 0 | null | 2018-11-20T10:47:44 | 2018-11-20T10:47:44 | null | UTF-8 | Java | false | false | 1,922 | java | /*
* Sonar ESQL Plugin
* Copyright (C) 2013-2018 Thomas Pohl and EXXETA AG
* http://www.exxeta.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.exxeta.iss.sonar.esql.api.tree;
import static com.exxeta.iss.sonar.esql.utils.TestUtils.createContext;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Set;
import java.util.stream.Collectors;
import org.junit.Test;
import org.sonar.api.batch.fs.InputFile;
import com.exxeta.iss.sonar.esql.api.tree.Tree;
import com.exxeta.iss.sonar.esql.api.visitors.EsqlVisitorContext;
import com.exxeta.iss.sonar.esql.tree.impl.statement.CreateRoutineTreeImpl;
import com.exxeta.iss.sonar.esql.utils.TestUtils;
public class CreateRoutineTreeImplTest {
@Test
public void should_return_outer_scope_symbol_usages() throws Exception {
InputFile inputFile = TestUtils.createTestInputFile("src/test/resources/tree/", "outer_scope_variables.esql");
final EsqlVisitorContext context = createContext(inputFile);
CreateRoutineTreeImpl functionTree = (CreateRoutineTreeImpl) context.getTopTree().esqlContents().descendants().filter(tree -> tree.is(Tree.Kind.CREATE_PROCEDURE_STATEMENT)).findFirst().get();
Set<String> usages = functionTree.outerScopeSymbolUsages().map(usage -> usage.identifierTree().name()).collect(Collectors.toSet());
assertThat(usages).containsExactlyInAnyOrder("a", "b", "writeOnly");
}
}
| [
"thomas.pohl@exxeta.de"
] | thomas.pohl@exxeta.de |
7a62799a2547f5103d13aee7df5c20f3560d2ccc | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MATH-98b-1-3-FEMO-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/linear/BigMatrixImpl_ESTest.java | 974f2744dc4e2e2be6b3da1088a596167d1a7a8a | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 934 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 13:27:45 UTC 2020
*/
package org.apache.commons.math.linear;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.math.BigDecimal;
import org.apache.commons.math.linear.BigMatrixImpl;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class BigMatrixImpl_ESTest extends BigMatrixImpl_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
BigMatrixImpl bigMatrixImpl0 = new BigMatrixImpl(1540, 1540);
BigDecimal[][] bigDecimalArray0 = new BigDecimal[9][0];
bigMatrixImpl0.data = bigDecimalArray0;
// Undeclared exception!
bigMatrixImpl0.operate(bigDecimalArray0[0]);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
0f0601c117a9c02923d748f00403eff0d8ac4ba6 | 48b4fa43385a44665bcd03a4e63c86acad11220b | /src/main/java/com/management/domain/enumeration/Incoterm.java | eeaa92affca2cc097c3f30b45b112ebb76309ec7 | [] | no_license | yehdih2001/GestionStock | 6ae9c6d099d53123d6554fd03f3489e0a5e07bf1 | c113fa6660e8fe6b6f5d9dcd2dede2bdda486797 | refs/heads/master | 2020-04-11T19:59:36.969527 | 2018-12-19T00:23:01 | 2018-12-19T00:23:01 | 162,055,687 | 0 | 0 | null | 2018-12-19T00:23:03 | 2018-12-17T00:53:41 | Java | UTF-8 | Java | false | false | 233 | java | package com.management.domain.enumeration;
/**
* The Incoterm enumeration.
*/
public enum Incoterm {
EX_WORKS, FREE_CARRIER, FREE_ALONGSIDE_SHIP, FREE_ON_BOARD, COST_AND_FREIGHT, COST_INSURANCE_AND_FREIGHT, CARRIAGE_PAID_TO
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
693adb0d370409a70a3754275a28c650deabc75a | bfac99890aad5f43f4d20f8737dd963b857814c2 | /reg3/v0/xwiki-platform-core/xwiki-platform-filter/xwiki-platform-filter-events/xwiki-platform-filter-event-model/src/main/java/org/xwiki/filter/event/model/WikiAttachmentFilter.java | bae203adabc45908e7852c11fda1da42dbb47dbe | [] | no_license | STAMP-project/dbug | 3b3776b80517c47e5cac04664cc07112ea26b2a4 | 69830c00bba4d6b37ad649aa576f569df0965c72 | refs/heads/master | 2021-01-20T03:59:39.330218 | 2017-07-12T08:03:40 | 2017-07-12T08:03:40 | 89,613,961 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,744 | java | /*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.filter.event.model;
import java.io.InputStream;
import org.xwiki.filter.FilterEventParameters;
import org.xwiki.filter.FilterException;
import org.xwiki.filter.annotation.Default;
import org.xwiki.filter.annotation.Name;
/**
* Attachment related events.
*
* @version $Id: ad44293ffc68c26949411382ce27ed3688bfb643 $
* @since 6.2M1
*/
public interface WikiAttachmentFilter
{
/**
* @type {@link String}
*/
String PARAMETER_NAME = "name";
/**
* @type {@link String}
* @since 7.1M1
*/
String PARAMETER_MIMETYPE = "mimetype";
/**
* @type {@link String}
*/
String PARAMETER_CONTENT_TYPE = "content_type";
/**
* @type {@link String}
*/
String PARAMETER_CREATION_AUTHOR = "creation_author";
/**
* @type {@link java.util.Date}
*/
String PARAMETER_CREATION_DATE = "creation_date";
/**
* @type {@link String}
*/
String PARAMETER_REVISION = "revision";
/**
* @type {@link String}
*/
String PARAMETER_REVISION_AUTHOR = "revision_author";
/**
* @type {@link java.util.Date}
*/
String PARAMETER_REVISION_DATE = "revision_date";
/**
* @type {@link String}
*/
String PARAMETER_REVISION_COMMENT = "revision_comment";
/**
* @param name the name of the attachment
* @param content the binary content of the attachment
* @param size the size of the attachment
* @param parameters the properties of the attachment
* @throws FilterException when failing to send event
*/
void onWikiAttachment(@Name("name") String name, @Name("content") InputStream content, @Name("size") Long size,
@Default(FilterEventParameters.DEFAULT) @Name(FilterEventParameters.NAME) FilterEventParameters parameters)
throws FilterException;
}
| [
"caroline.landry@inria.fr"
] | caroline.landry@inria.fr |
f91dd0b85f2ba47e11becee9a6f2d95454aabe30 | f52981eb9dd91030872b2b99c694ca73fb2b46a8 | /Source/Plugins/Core/com.equella.core/src/com/tle/core/portal/service/PortletEditingBean.java | e4d1a41d1ca7e8a96788005c51dc9df15f0fcff8 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"LicenseRef-scancode-jdom",
"GPL-1.0-or-later",
"ICU",
"CDDL-1.0",
"LGPL-3.0-only",
"LicenseRef-scancode-other-permissive",
"CPL-1.0",
"MIT",
"GPL-2.0-only",
"Apache-2.0",
"NetCDF",
"Apache-1.1",
"EPL-1.0",
"Classpath-exception-2.0",
"CDDL-1.1",
"LicenseRef-scancode-freemarker"
] | permissive | phette23/Equella | baa41291b91d666bf169bf888ad7e9f0b0db9fdb | 56c0d63cc1701a8a53434858a79d258605834e07 | refs/heads/master | 2020-04-19T20:55:13.609264 | 2019-01-29T03:27:40 | 2019-01-29T22:31:24 | 168,427,559 | 0 | 0 | Apache-2.0 | 2019-01-30T22:49:08 | 2019-01-30T22:49:08 | null | UTF-8 | Java | false | false | 2,123 | java | /*
* Copyright 2017 Apereo
*
* 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.tle.core.portal.service;
import com.tle.core.entity.EntityEditingBean;
public class PortletEditingBean extends EntityEditingBean
{
private static final long serialVersionUID = 1L;
private String type;
private boolean closeable;
private boolean minimisable;
private boolean institutional;
private String config;
private Object extraData;
private String targetExpression;
private boolean admin;
public String getType()
{
return type;
}
public void setType(String type)
{
this.type = type;
}
public boolean isCloseable()
{
return closeable;
}
public void setCloseable(boolean closeable)
{
this.closeable = closeable;
}
public boolean isMinimisable()
{
return minimisable;
}
public void setMinimisable(boolean minimisable)
{
this.minimisable = minimisable;
}
public boolean isInstitutional()
{
return institutional;
}
public void setInstitutional(boolean institutional)
{
this.institutional = institutional;
}
public String getConfig()
{
return config;
}
public void setConfig(String config)
{
this.config = config;
}
public Object getExtraData()
{
return extraData;
}
public void setExtraData(Object extraData)
{
this.extraData = extraData;
}
public String getTargetExpression()
{
return targetExpression;
}
public void setTargetExpression(String targetExpression)
{
this.targetExpression = targetExpression;
}
public boolean isAdmin()
{
return admin;
}
public void setAdmin(boolean admin)
{
this.admin = admin;
}
} | [
"doolse@gmail.com"
] | doolse@gmail.com |
2eb62555663bfbe2d26d161f8cee819b3cc6d086 | 7707b1d1d63198e86a0b8a7ae27c00e2f27a8831 | /plugins/com.netxforge.editing.base/src/com/netxforge/screens/editing/base/IEditingServiceProvider.java | dfb049df93029acaf1e607b5452f850686b2c0c0 | [] | no_license | dzonekl/netxstudio | 20535f66e5bbecd1cdd9c55a4d691fc48a1a83aa | f12c118b1ef08fe770e5ac29828653a93fea9352 | refs/heads/master | 2016-08-04T17:28:38.486076 | 2015-10-02T16:20:00 | 2015-10-02T16:20:00 | 6,561,565 | 2 | 0 | null | 2014-10-27T06:49:59 | 2012-11-06T12:18:44 | Java | UTF-8 | Java | false | false | 1,151 | java | /*******************************************************************************
* Copyright (c) 9 jun. 2013 NetXForge.
*
* 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/>
*
* Contributors: Christophe Bouhier - initial API and implementation and/or
* initial documentation
*******************************************************************************/
package com.netxforge.screens.editing.base;
import com.google.inject.Provider;
public interface IEditingServiceProvider extends Provider<IEditingService>{
public abstract IEditingService get();
} | [
"dzonekl@gmail.com"
] | dzonekl@gmail.com |
664fe5e75d5f8d6b44bb49eacfc9ee8dca2916ba | 60f8c70d135763ef4ceab106f63af2244b2807f2 | /YiLian/src/main/java/com/yilian/mall/adapter/JPMallGoodsAdapter.java | 48763e1e5932e3448a96f53ed8d0f47a0ab92227 | [
"MIT"
] | permissive | LJW123/YiLianMall | f7f7af4d8d8517001455922e2a55e7064cdf9723 | ea335a66cb4fd6417aa264a959847b094c90fb04 | refs/heads/master | 2022-07-16T08:54:43.231502 | 2020-05-21T09:22:05 | 2020-05-21T09:22:05 | 265,793,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,355 | java | package com.yilian.mall.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.orhanobut.logger.Logger;
import com.yilian.mall.R;
import com.yilian.mall.entity.JPMallGoodsListEntity;
import com.yilian.mall.utils.MoneyUtil;
import com.yilian.mylibrary.GlideUtil;
import java.util.List;
/**
* Created by liuyuqi on 2016/10/22 0022.
*/
public class JPMallGoodsAdapter extends android.widget.BaseAdapter {
private final Context mContext;
private final List<JPMallGoodsListEntity.ListBean> data;
private final ImageLoader imageLoader;
Drawable drawable = null;
private DisplayImageOptions options;
public JPMallGoodsAdapter(Context context, List<JPMallGoodsListEntity.ListBean> allGoodsLists, ImageLoader imageLoader) {
this.mContext = context;
this.data = allGoodsLists;
this.imageLoader = imageLoader;
options = new DisplayImageOptions.Builder()
.showStubImage(R.mipmap.login_module_default_jp) //设置图片在下载期间显示的图片
.showImageForEmptyUri(R.mipmap.login_module_default_jp)//设置图片Uri为空或是错误的时候显示的图片
.showImageOnFail(R.mipmap.login_module_default_jp) //设置图片加载/解码过程中错误时候显示的图片
.cacheInMemory(false) //设置下载的图片是否缓存在内存中
.cacheOnDisc(true) //设置下载的图片是否缓存在SD卡中
.bitmapConfig(Bitmap.Config.RGB_565) //设置图片的解码类型
// .displayer(new SimpleBitmapDisplayer()) // default 可以设置动画,比如圆角或者渐变
.build();
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int i) {
return data.get(i);
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final MyViewHolder holder;
if (convertView == null) {
convertView = View.inflate(mContext, R.layout.item_jp_good, null);
holder = new MyViewHolder();
holder.iv_goods1 = (ImageView) convertView.findViewById(R.id.iv_goods1);
holder.tv_goods_name = (TextView) convertView.findViewById(R.id.tv_goods_name);
holder.tv_cost_price = (TextView) convertView.findViewById(R.id.tv_cost_price);
holder.tv_market_price = (TextView) convertView.findViewById(R.id.tv_market_price);
holder.tv_discount = (TextView) convertView.findViewById(R.id.tv_discount);
holder.tv_tag = (TextView) convertView.findViewById(R.id.tv_tag);
holder.iv_null_goods = (ImageView) convertView.findViewById(R.id.iv_sold_out);
holder.tvPrice = (TextView)convertView.findViewById(R.id.tv_price);
holder.tvSoldNumber =(TextView) convertView.findViewById(R.id.tv_sold_number);
//背包
convertView.setTag(holder);
} else {
holder = (MyViewHolder) convertView.getTag();
}
JPMallGoodsListEntity.ListBean mallGoodsLists = data.get(position);
String imageUrl = mallGoodsLists.goodsIcon;
Logger.i(" 商品搜索 URL "+imageUrl);
if (!TextUtils.isEmpty(imageUrl)){
GlideUtil.showImageNoSuffix(mContext,imageUrl,holder.iv_goods1);
}else {
holder.iv_goods1.setImageResource(R.mipmap.default_jp);
}
Logger.i("精确搜素mallGoodsLists.hasGoods" + mallGoodsLists.hasGoods);
if ("0".equals(mallGoodsLists.hasGoods)) {
holder.iv_null_goods.setVisibility(View.VISIBLE);
} else {
holder.iv_null_goods.setVisibility(View.GONE);
}
holder.tv_goods_name.setText(mallGoodsLists.goodsName);
if (!TextUtils.isEmpty(mallGoodsLists.goodsPrice)&&!mallGoodsLists.goodsPrice.equals("false")){
holder.tv_market_price.setText(MoneyUtil.set¥Money(MoneyUtil.getLeXiangBiNoZero(mallGoodsLists.goodsPrice)));//市场价
}
holder.tvPrice.setText(MoneyUtil.set¥Money(MoneyUtil.getLeXiangBiNoZero(mallGoodsLists.goodsCost)));//售价
holder.tv_market_price.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
holder.tv_discount.setText(mContext.getString(R.string.back_score) + MoneyUtil.getLeXiangBiNoZero(mallGoodsLists.returnIntegral) );
holder.tv_tag.setText(mallGoodsLists.tagsName);
holder.tvSoldNumber.setText("已售:"+mallGoodsLists.sellCount);
return convertView;
}
class MyViewHolder {
ImageView iv_null_goods;
ImageView iv_goods1;
TextView tv_goods_name;
TextView tv_cost_price;
TextView tv_market_price;
TextView tv_discount;
TextView tv_tag;
public TextView tvPrice;
public TextView tvSoldNumber;
}
}
| [
"18203660536@163.com"
] | 18203660536@163.com |
3bd5676ed37c7f708bcf9ed2e53af8be09c45456 | 4be61634117a0aa988f33246d0f425047c027f4c | /zkredis-app/src/jdk6/com/sun/imageio/plugins/jpeg/JPEGImageReaderSpi.java | 0fbd6dc10dee978b79fec139e659e26cdea46e96 | [] | no_license | oldshipmaster/zkredis | c02e84719f663cd620f1a76fba38e4452d755a0c | 3ec53d6904a47a5ec79bc7768b1ca6324facb395 | refs/heads/master | 2022-12-27T01:31:23.786539 | 2020-08-12T01:22:07 | 2020-08-12T01:22:07 | 34,658,942 | 1 | 3 | null | 2022-12-16T04:32:34 | 2015-04-27T09:55:48 | Java | UTF-8 | Java | false | false | 2,162 | java | /*
* @(#)JPEGImageReaderSpi.java 1.11 09/04/29
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.imageio.plugins.jpeg;
import java.util.Locale;
import javax.imageio.spi.ImageReaderSpi;
import javax.imageio.stream.ImageInputStream;
import javax.imageio.spi.IIORegistry;
import javax.imageio.spi.ServiceRegistry;
import java.io.IOException;
import javax.imageio.ImageReader;
import javax.imageio.IIOException;
public class JPEGImageReaderSpi extends ImageReaderSpi {
private static String [] writerSpiNames =
{"com.sun.imageio.plugins.jpeg.JPEGImageWriterSpi"};
public JPEGImageReaderSpi() {
super(JPEG.vendor,
JPEG.version,
JPEG.names,
JPEG.suffixes,
JPEG.MIMETypes,
"com.sun.imageio.plugins.jpeg.JPEGImageReader",
new Class[] { ImageInputStream.class },
writerSpiNames,
true,
JPEG.nativeStreamMetadataFormatName,
JPEG.nativeStreamMetadataFormatClassName,
null, null,
true,
JPEG.nativeImageMetadataFormatName,
JPEG.nativeImageMetadataFormatClassName,
null, null
);
}
public String getDescription(Locale locale) {
return "Standard JPEG Image Reader";
}
public boolean canDecodeInput(Object source) throws IOException {
if (!(source instanceof ImageInputStream)) {
return false;
}
ImageInputStream iis = (ImageInputStream) source;
iis.mark();
// If the first two bytes are a JPEG SOI marker, it's probably
// a JPEG file. If they aren't, it definitely isn't a JPEG file.
int byte1 = iis.read();
int byte2 = iis.read();
iis.reset();
if ((byte1 == 0xFF) && (byte2 == JPEG.SOI)) {
return true;
}
return false;
}
public ImageReader createReaderInstance(Object extension)
throws IIOException {
return new JPEGImageReader(this);
}
}
| [
"oldshipmaster@163.com"
] | oldshipmaster@163.com |
9503281a0431eef3e710e0bbe387fc66522dcaa1 | 40d844c1c780cf3618979626282cf59be833907f | /src/testcases/CWE113_HTTP_Response_Splitting/s02/CWE113_HTTP_Response_Splitting__listen_tcp_setHeaderServlet_74b.java | e2dd0f6438b29e31dd78f1f54a27e1c01644e79d | [] | no_license | rubengomez97/juliet | f9566de7be198921113658f904b521b6bca4d262 | 13debb7a1cc801977b9371b8cc1a313cd1de3a0e | refs/heads/master | 2023-06-02T00:37:24.532638 | 2021-06-23T17:22:22 | 2021-06-23T17:22:22 | 379,676,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,201 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__listen_tcp_setHeaderServlet_74b.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-74b.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: listen_tcp Read data using a listening tcp connection
* GoodSource: A hardcoded string
* Sinks: setHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to setHeader()
* Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package
*
* */
package testcases.CWE113_HTTP_Response_Splitting.s02;
import testcasesupport.*;
import java.util.HashMap;
import javax.servlet.http.*;
import java.net.URLEncoder;
public class CWE113_HTTP_Response_Splitting__listen_tcp_setHeaderServlet_74b
{
public void badSink(HashMap<Integer,String> dataHashMap , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data = dataHashMap.get(2);
if (data != null)
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodG2B() - use GoodSource and BadSink */
public void goodG2BSink(HashMap<Integer,String> dataHashMap , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data = dataHashMap.get(2);
if (data != null)
{
/* POTENTIAL FLAW: Input not verified before inclusion in header */
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
/* goodB2G() - use BadSource and GoodSink */
public void goodB2GSink(HashMap<Integer,String> dataHashMap , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data = dataHashMap.get(2);
if (data != null)
{
/* FIX: use URLEncoder.encode to hex-encode non-alphanumerics */
data = URLEncoder.encode(data, "UTF-8");
response.setHeader("Location", "/author.jsp?lang=" + data);
}
}
}
| [
"you@example.com"
] | you@example.com |
15ff09045b02662477663da0821001b07a6f220a | 3cf870ec335aa1b95e8776ea9b2a9d6495377628 | /admin-sponge/build/tmp/recompileMc/sources/net/minecraft/client/renderer/entity/RenderEvokerFangs.java | 6d5789051a39aa1d4d99aacaaf921dda791e5a60 | [] | no_license | yk133/MyMc | d6498607e7f1f932813178e7d0911ffce6e64c83 | e1ae6d97415583b1271ee57ac96083c1350ac048 | refs/heads/master | 2020-04-03T16:23:09.774937 | 2018-11-05T12:17:39 | 2018-11-05T12:17:39 | 155,402,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,198 | java | package net.minecraft.client.renderer.entity;
import net.minecraft.client.model.ModelEvokerFangs;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.projectile.EntityEvokerFangs;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderEvokerFangs extends Render<EntityEvokerFangs>
{
private static final ResourceLocation EVOKER_ILLAGER_FANGS = new ResourceLocation("textures/entity/illager/fangs.png");
private final ModelEvokerFangs model = new ModelEvokerFangs();
public RenderEvokerFangs(RenderManager renderManagerIn)
{
super(renderManagerIn);
}
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityEvokerFangs entity, double x, double y, double z, float entityYaw, float partialTicks)
{
float f = entity.getAnimationProgress(partialTicks);
if (f != 0.0F)
{
float f1 = 2.0F;
if (f > 0.9F)
{
f1 = (float)((double)f1 * ((1.0D - (double)f) / 0.10000000149011612D));
}
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.enableAlphaTest();
this.bindEntityTexture(entity);
GlStateManager.translatef((float)x, (float)y, (float)z);
GlStateManager.rotatef(90.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.scalef(-f1, -f1, f1);
float f2 = 0.03125F;
GlStateManager.translatef(0.0F, -0.626F, 0.0F);
this.model.render(entity, f, 0.0F, 0.0F, entity.rotationYaw, entity.rotationPitch, 0.03125F);
GlStateManager.popMatrix();
GlStateManager.enableCull();
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityEvokerFangs entity)
{
return EVOKER_ILLAGER_FANGS;
}
} | [
"1060682109@qq.com"
] | 1060682109@qq.com |
3df869a84d72a98a30f0afcdf5e8ef9432b5059e | a7a01204ffea93f9f9255f20319d6563fa27093a | /Java/Java의정석1독/JavaStudySource/src/ch7/SingletonTest.java | f2da86671b05dc2d3d5e842f9ba28b55882c75e5 | [] | no_license | HaeSeongPark/TIL | a4140fdda5c4b5e4affd060a662d4ec83fce0487 | 96436b384c2123ea697d0414b753f8bd05dcea9b | refs/heads/master | 2023-05-19T13:44:41.032584 | 2023-05-13T09:29:43 | 2023-05-13T09:29:43 | 78,113,466 | 2 | 1 | null | 2021-01-20T23:20:21 | 2017-01-05T13:04:00 | Java | WINDOWS-1252 | Java | false | false | 412 | java | package ch7;
final class Singleton {
private static Singleton instance = new Singleton();
private Singleton() {
}
public static Singleton getInstance() {
if (null == instance) {
instance = new Singleton();
}
return instance;
}
}
public class SingletonTest{
public static void main(String[] args) {
// Singleton s = new Singleton(); // ¿¡·¯
Singleton s = Singleton.getInstance();
}
}
| [
"cord7894@gmail.com"
] | cord7894@gmail.com |
3d6200aafcb5d62ada0b8ef197dbb19d6824f06e | aa6d51f247eccff7afe57f344ccf69dd4fe067bb | /app/src/flavor1/java/com/angcyo/flavor1/MainActivity.java | 253fe2ab9e68a846ef5ac2bbee2d3dc6f546db16 | [] | no_license | angcyo/FlavorDemo | bf7242bef63446386307eecd4b0f14705134a2c0 | 61ac2e6d81f3e76f0fbf6f4550b7eed504659601 | refs/heads/master | 2021-01-10T13:51:47.654549 | 2016-01-07T05:17:43 | 2016-01-07T05:17:43 | 49,182,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,364 | java | package com.angcyo.flavor1;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.angcyo.flavordemo.R;
public class MainActivity extends AppCompatActivity {
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
StringBuilder stringBuilder = new StringBuilder();
textView = ((TextView) findViewById(R.id.text));
stringBuilder.append("包名:" + getPackageName());
String fileName, className;
StackTraceElement traceElement = new Exception().getStackTrace()[0];
className = traceElement.getClassName();
fileName = traceElement.getFileName();
stringBuilder.append("\n类名:" + className);
textView.setText(stringBuilder.toString());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"angcyo@126.com"
] | angcyo@126.com |
3b33278e1cf35df3114268d37e05d1104c8e957a | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project39/src/main/java/org/gradle/test/performance/largejavamultiproject/project39/p198/Production3965.java | b584df2267e9a65d911230611bf51549bad753fb | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,402 | java | package org.gradle.test.performance.largejavamultiproject.project39.p198;
import org.gradle.test.performance.largejavamultiproject.project39.p197.Production3956;
import org.gradle.test.performance.largejavamultiproject.project12.p63.Production1265;
import org.gradle.test.performance.largejavamultiproject.project25.p128.Production2565;
import org.gradle.test.performance.largejavamultiproject.project38.p193.Production3865;
import org.gradle.test.performance.largejavamultiproject.project3.p18.Production365;
import org.gradle.test.performance.largejavamultiproject.project0.p3.Production65;
import org.gradle.test.performance.largejavamultiproject.project16.p83.Production1665;
import org.gradle.test.performance.largejavamultiproject.project13.p68.Production1365;
import org.gradle.test.performance.largejavamultiproject.project29.p148.Production2965;
import org.gradle.test.performance.largejavamultiproject.project26.p133.Production2665;
public class Production3965 {
private Production3956 property0;
public Production3956 getProperty0() {
return property0;
}
public void setProperty0(Production3956 value) {
property0 = value;
}
private Production3960 property1;
public Production3960 getProperty1() {
return property1;
}
public void setProperty1(Production3960 value) {
property1 = value;
}
private Production3964 property2;
public Production3964 getProperty2() {
return property2;
}
public void setProperty2(Production3964 value) {
property2 = value;
}
private Production1265 property3;
public Production1265 getProperty3() {
return property3;
}
public void setProperty3(Production1265 value) {
property3 = value;
}
private Production2565 property4;
public Production2565 getProperty4() {
return property4;
}
public void setProperty4(Production2565 value) {
property4 = value;
}
private Production3865 property5;
public Production3865 getProperty5() {
return property5;
}
public void setProperty5(Production3865 value) {
property5 = value;
}
private Production365 property6;
public Production365 getProperty6() {
return property6;
}
public void setProperty6(Production365 value) {
property6 = value;
}
private Production65 property7;
public Production65 getProperty7() {
return property7;
}
public void setProperty7(Production65 value) {
property7 = value;
}
private Production1665 property8;
public Production1665 getProperty8() {
return property8;
}
public void setProperty8(Production1665 value) {
property8 = value;
}
private Production1365 property9;
public Production1365 getProperty9() {
return property9;
}
public void setProperty9(Production1365 value) {
property9 = value;
}
private Production2965 property10;
public Production2965 getProperty10() {
return property10;
}
public void setProperty10(Production2965 value) {
property10 = value;
}
private Production2665 property11;
public Production2665 getProperty11() {
return property11;
}
public void setProperty11(Production2665 value) {
property11 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
cf6f23779a4201a7cf91639a629158efd2bc3c8e | 254c8ae3c82a10ae83d32448065ebe53fc50c529 | /src/main/java/net/duckling/dhome/dao/impl/InstitutionDisciplineOrientationDAOImpl.java | 776885af53d7a43ad96283e3ac1032f4eb0c81d0 | [
"Apache-2.0"
] | permissive | dkai/dhome | 4742711af9bd3d44c3cd2838471a83e9b35160e4 | e006d68bc3ea04bcd046f1338fd2d3a220d90d54 | refs/heads/master | 2021-05-31T23:14:01.544469 | 2016-06-24T12:55:26 | 2016-06-24T12:55:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,846 | java | /*
* Copyright (c) 2008-2016 Computer Network Information Center (CNIC), Chinese Academy of Sciences.
*
* This file is part of Duckling project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package net.duckling.dhome.dao.impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import net.duckling.dhome.common.repository.BaseDao;
import net.duckling.dhome.dao.IInstitutionDisciplineOrientationDAO;
import net.duckling.dhome.domain.institution.InstitutionDisciplineOrientation;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
@Repository
public class InstitutionDisciplineOrientationDAOImpl extends BaseDao implements IInstitutionDisciplineOrientationDAO {
@Override
public List<InstitutionDisciplineOrientation> all() {
String sql="select * from institution_discipline_orientation";
return getNamedParameterJdbcTemplate().query(sql,new HashMap<String,Object>(), new RowMapper<InstitutionDisciplineOrientation>() {
@Override
public InstitutionDisciplineOrientation mapRow(ResultSet rs,
int rowNum) throws SQLException {
InstitutionDisciplineOrientation o=new InstitutionDisciplineOrientation();
o.setId(rs.getInt("id"));
o.setName(rs.getString("name"));
return o;
}
});
}
}
| [
"nankai@cnic.ac.cn"
] | nankai@cnic.ac.cn |
57d6a4bc75f304fa079ac30ad8f283ec8e3cb70a | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/Math/Math_280/2L/AstorMain-Math-issue-280/src/variant-8/org/apache/commons/math/special/Gamma.java | 34cbc057827da91e123af1c5ee3365d3ae3ca5d8 | [] | no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,991 | java | package org.apache.commons.math.special;
public class Gamma {
public static final double GAMMA = 0.5772156649015329;
private static final double DEFAULT_EPSILON = 1.0E-14;
private static final double[] lanczos = new double[]{ 0.9999999999999971 , 57.15623566586292 , -59.59796035547549 , 14.136097974741746 , -0.4919138160976202 , 3.399464998481189E-5 , 4.652362892704858E-5 , -9.837447530487956E-5 , 1.580887032249125E-4 , -2.1026444172410488E-4 , 2.1743961811521265E-4 , -1.643181065367639E-4 , 8.441822398385275E-5 , -2.6190838401581408E-5 , 3.6899182659531625E-6 };
private static final double HALF_LOG_2_PI = 0.5 * (java.lang.Math.log((2.0 * (java.lang.Math.PI))));
private Gamma() {
super();
}
public static double logGamma(double x) {
double ret;
if ((java.lang.Double.isNaN(x)) || (x <= 0.0)) {
ret = java.lang.Double.NaN;
} else {
double g = 607.0 / 128.0;
double sum = 0.0;
for (int i = (org.apache.commons.math.special.Gamma.lanczos.length) - 1 ; i > 0 ; --i) {
sum = sum + ((org.apache.commons.math.special.Gamma.lanczos[i]) / (x + i));
}
sum = sum + (org.apache.commons.math.special.Gamma.lanczos[0]);
double tmp = (x + g) + 0.5;
ret = ((((x + 0.5) * (java.lang.Math.log(tmp))) - tmp) + (org.apache.commons.math.special.Gamma.HALF_LOG_2_PI)) + (java.lang.Math.log((sum / x)));
}
return ret;
}
public static double regularizedGammaP(double a, double x) throws org.apache.commons.math.MathException {
return org.apache.commons.math.special.Gamma.regularizedGammaP(a, x, org.apache.commons.math.special.Gamma.DEFAULT_EPSILON, java.lang.Integer.MAX_VALUE);
}
public static double regularizedGammaP(double a, double x, double epsilon, int maxIterations) throws org.apache.commons.math.MathException {
double ret;
if ((((java.lang.Double.isNaN(a)) || (java.lang.Double.isNaN(x))) || (a <= 0.0)) || (x < 0.0)) {
ret = java.lang.Double.NaN;
} else {
if (x == 0.0) {
ret = 0.0;
} else {
if ((a >= 1.0) && (x > a)) {
ret = 1.0 - (org.apache.commons.math.special.Gamma.regularizedGammaQ(a, x, epsilon, maxIterations));
} else {
double n = 0.0;
double an = 1.0 / a;
double n = 0.0;
while (((java.lang.Math.abs(an)) > epsilon) && (n < maxIterations)) {
n = n + 1.0;
an = an * (x / (a + n));
sum = sum + an;
}
if (n >= maxIterations) {
throw new org.apache.commons.math.MaxIterationsExceededException(maxIterations);
} else {
ret = (java.lang.Math.exp((((-x) + (a * (java.lang.Math.log(x)))) - (org.apache.commons.math.special.Gamma.logGamma(a))))) * sum;
}
}
}
}
return ret;
}
public static double regularizedGammaQ(double a, double x) throws org.apache.commons.math.MathException {
return org.apache.commons.math.special.Gamma.regularizedGammaQ(a, x, org.apache.commons.math.special.Gamma.DEFAULT_EPSILON, java.lang.Integer.MAX_VALUE);
}
public static double regularizedGammaQ(final double a, double x, double epsilon, int maxIterations) throws org.apache.commons.math.MathException {
double ret;
if ((((java.lang.Double.isNaN(a)) || (java.lang.Double.isNaN(x))) || (a <= 0.0)) || (x < 0.0)) {
ret = java.lang.Double.NaN;
} else {
if (x == 0.0) {
ret = 1.0;
} else {
if ((x < a) || (a < 1.0)) {
ret = 1.0 - (org.apache.commons.math.special.Gamma.regularizedGammaP(a, x, epsilon, maxIterations));
} else {
org.apache.commons.math.util.ContinuedFraction cf = new org.apache.commons.math.util.ContinuedFraction() {
@java.lang.Override
protected double getA(int n, double x) {
return (((2.0 * n) + 1.0) - a) + x;
}
@java.lang.Override
protected double getB(int n, double x) {
return n * (a - n);
}
};
ret = 1.0 / (cf.evaluate(x, epsilon, maxIterations));
ret = (java.lang.Math.exp((((-x) + (a * (java.lang.Math.log(x)))) - (org.apache.commons.math.special.Gamma.logGamma(a))))) * ret;
}
}
}
return ret;
}
private static final double C_LIMIT = 49;
private static final double S_LIMIT = 1.0E-5;
public static double digamma(double x) {
if ((x > 0) && (x <= (org.apache.commons.math.special.Gamma.S_LIMIT))) {
return (-(org.apache.commons.math.special.Gamma.GAMMA)) - (1 / x);
}
if (x >= (org.apache.commons.math.special.Gamma.C_LIMIT)) {
double inv = 1 / (x * x);
return ((java.lang.Math.log(x)) - (0.5 / x)) - (inv * ((1.0 / 12) + (inv * ((1.0 / 120) - (inv / 252)))));
}
return (org.apache.commons.math.special.Gamma.digamma((x + 1))) - (1 / x);
}
public static double trigamma(double x) {
if ((x > 0) && (x <= (org.apache.commons.math.special.Gamma.S_LIMIT))) {
return 1 / (x * x);
}
if (x >= (org.apache.commons.math.special.Gamma.C_LIMIT)) {
double inv = 1 / (x * x);
return ((1 / x) + (inv / 2)) + ((inv / x) * ((1.0 / 6) - (inv * ((1.0 / 30) + (inv / 42)))));
}
return (org.apache.commons.math.special.Gamma.trigamma((x + 1))) + (1 / (x * x));
}
}
| [
"sajjad.syed@ucalgary.ca"
] | sajjad.syed@ucalgary.ca |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.