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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b4929a0150e15e1e87021b4614f33169de90f32f | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-service/src/test/java/nta/med/service/integration/ihis/LoadPatientNaewonListTest.java | 009f4742619a239be4432496642758176528460e | [] | no_license | zhiji6/mih | fa1d2279388976c901dc90762bc0b5c30a2325fc | 2714d15853162a492db7ea8b953d5b863c3a8000 | refs/heads/master | 2023-08-16T18:35:19.836018 | 2017-12-28T09:33:19 | 2017-12-28T09:33:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,353 | java | package nta.med.service.integration.ihis;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import nta.med.common.remoting.rpc.protobuf.Rpc;
import nta.med.service.ihis.proto.SystemServiceProto;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;
import org.vertx.java.core.eventbus.Message;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:META-INF/spring/spring-master.xml" })
public class LoadPatientNaewonListTest {
@Autowired
protected Vertx vertx;
@Test
public void Test() throws InterruptedException {
SystemServiceProto.LoadPatientNaewonListRequest request =SystemServiceProto.LoadPatientNaewonListRequest
.newBuilder()
.setBunho("000000001")
.setPkKeyOut("")
.setPkKeyInp("329433")
.setJaewonFlag("%")
.setDoctorModeYn("Y")
.setIoGubun("%")
.setIsEnableIpwonReser("Y")
.setApproveDoctor("HIE")
.setGwa("%")
.setDoctor("%")
.build();
Rpc.RpcMessage rpcMessage = Rpc.RpcMessage
.newBuilder()
.setId(System.currentTimeMillis())
.setService("patientInsurance ")
.setVersion("1.0.0")
.setPayloadClass(
SystemServiceProto.LoadPatientNaewonListRequest.class
.getSimpleName())
.setPayloadData(request.toByteString()).build();
final CountDownLatch latch = new CountDownLatch(1);
vertx.eventBus()
.send(SystemServiceProto.LoadPatientNaewonListRequest.class
.getSimpleName(),
rpcMessage.toByteArray(),
new Handler<Message<byte[]>>() {
@Override
public void handle(Message<byte[]> event) {
System.out.println("Success!");
latch.countDown();
}
});
latch.await(100, TimeUnit.SECONDS);
}
} | [
"duc_nt@nittsusystem-vn.com"
] | duc_nt@nittsusystem-vn.com |
8aa204498cfbe91a1b094be9fc817e757ad4e30b | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_5178940b001e0f2f4adeddef56ca17fee687bc6e/ViewFeedModelBuilder/33_5178940b001e0f2f4adeddef56ca17fee687bc6e_ViewFeedModelBuilder_s.java | fc2570ab99313fc6cb665c2d932087d9424e1c66 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,859 | java | package nz.co.searchwellington.controllers.models;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import nz.co.searchwellington.feeds.RssfeedNewsitemService;
import nz.co.searchwellington.model.Feed;
import nz.co.searchwellington.model.FeedNewsitem;
import nz.co.searchwellington.model.Resource;
import nz.co.searchwellington.repositories.ResourceRepository;
import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
public class ViewFeedModelBuilder extends AbstractModelBuilder implements ModelBuilder {
Logger log = Logger.getLogger(ViewFeedModelBuilder.class);
private ResourceRepository resourceDAO;
private RssfeedNewsitemService rssfeedNewsitemService;
public ViewFeedModelBuilder(ResourceRepository resourceDAO, RssfeedNewsitemService rssfeedNewsitemService) {
this.resourceDAO = resourceDAO;
this.rssfeedNewsitemService = rssfeedNewsitemService;
}
public boolean isValid(HttpServletRequest request) {
return request.getAttribute("feedAttribute") != null;
}
public ModelAndView populateContentModel(HttpServletRequest request, boolean showBroken) {
if (isValid(request)) {
log.info("Building view feed model");
Feed feed = (Feed) request.getAttribute("feedAttribute");
if (feed != null) {
ModelAndView mv = new ModelAndView();
mv.addObject("feed", feed);
List<FeedNewsitem> feedNewsitems = rssfeedNewsitemService.getFeedNewsitems(feed);
for (FeedNewsitem feedNewsitem : feedNewsitems) {
if (feedNewsitem.getUrl() != null) {
Resource localCopy = resourceDAO.loadResourceByUrl(feedNewsitem.getUrl());
if (localCopy != null) {
feedNewsitem.setLocalCopy(localCopy);
}
}
}
if (feedNewsitems != null && feedNewsitems.size() > 0) {
mv.addObject("main_content", feedNewsitems);
} else {
log.warn("No newsitems were loaded from feed: " + feed.getName());
}
setRss(mv, feed.getName(), feed.getUrl());
mv.setViewName("viewfeed");
return mv;
}
}
return null;
}
public void populateExtraModelConent(HttpServletRequest request, boolean showBroken, ModelAndView mv) {
populateSecondaryFeeds(mv);
}
// TODO duplication with BaseM'E'C
public void populateSecondaryFeeds(ModelAndView mv) {
mv.addObject("righthand_heading", "Local Feeds");
mv.addObject("righthand_description", "Recently updated feeds from local organisations.");
final List<Feed> allFeeds = resourceDAO.getAllFeeds();
if (allFeeds.size() > 0) {
mv.addObject("righthand_content", allFeeds);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f6b4bc0e98084c6f9696f989a80e3985c83ecbbe | e8883f189365a8a4be518f4737264c35b054250a | /optaplanner-core/src/test/java/org/optaplanner/core/impl/partitionedsearch/TestdataSolutionPartitioner.java | 8e0b9839d7082d770e7255c0974358fffd255c39 | [
"Apache-2.0"
] | permissive | deyangdianzi/optaplanner | 06ee9e7be0e9a931ea6befafd1f6e7890b1553cd | 7841052c98d84664fe5c44fb3b1da5aed9f7ffa7 | refs/heads/master | 2020-06-21T03:45:54.060479 | 2019-07-07T18:33:20 | 2019-07-16T11:11:38 | 197,335,263 | 2 | 0 | Apache-2.0 | 2019-07-17T07:11:03 | 2019-07-17T07:11:03 | null | UTF-8 | Java | false | false | 2,533 | java | /*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* 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.optaplanner.core.impl.partitionedsearch;
import java.util.ArrayList;
import java.util.List;
import org.optaplanner.core.impl.partitionedsearch.partitioner.SolutionPartitioner;
import org.optaplanner.core.impl.score.director.ScoreDirector;
import org.optaplanner.core.impl.testdata.domain.TestdataEntity;
import org.optaplanner.core.impl.testdata.domain.TestdataSolution;
public class TestdataSolutionPartitioner implements SolutionPartitioner<TestdataSolution> {
/**
* {@link PartitionedSearchPhaseConfig#solutionPartitionerCustomProperties Custom property}.
*/
private int partSize = 1;
public void setPartSize(int partSize) {
this.partSize = partSize;
}
@Override
public List<TestdataSolution> splitWorkingSolution(ScoreDirector<TestdataSolution> scoreDirector,
Integer runnablePartThreadLimit) {
TestdataSolution workingSolution = scoreDirector.getWorkingSolution();
List<TestdataEntity> allEntities = workingSolution.getEntityList();
if (allEntities.size() % partSize > 0) {
throw new IllegalStateException("This partitioner can only make equally sized partitions."
+ " This is impossible because number of allEntities (" + allEntities.size()
+ ") is not divisible by partSize (" + partSize + ").");
}
List<TestdataSolution> partitions = new ArrayList<>();
for (int i = 0; i < allEntities.size() / partSize; i++) {
List<TestdataEntity> partitionEntitites
= new ArrayList<>(allEntities.subList(i * partSize, (i + 1) * partSize));
TestdataSolution partition = new TestdataSolution();
partition.setEntityList(partitionEntitites);
partition.setValueList(workingSolution.getValueList());
partitions.add(partition);
}
return partitions;
}
}
| [
"gds.geoffrey.de.smet@gmail.com"
] | gds.geoffrey.de.smet@gmail.com |
e203f6040256dad5b66fa51d33d2c01cca971e76 | c3bada0c00143d02b3ba9649c14fd646acb032e8 | /src/main/java/net/dryuf/process/command/GetOptionsStd.java | c093b5e12a91acb776e4187cadc5172f2cf6901f | [] | no_license | kvr000/dryuf-old-core | 5fffd9418cb276a3d535676f07dab833be3c5505 | 63d629661dda1e412bfbfa87d45310fe1604de3b | refs/heads/master | 2023-03-09T04:31:05.716458 | 2022-04-04T21:52:01 | 2022-04-04T21:52:01 | 229,680,811 | 0 | 0 | null | 2023-02-22T02:52:09 | 2019-12-23T05:10:58 | Java | UTF-8 | Java | false | false | 4,412 | java | /*
* Dryuf framework
*
* ----------------------------------------------------------------------------------
*
* Copyright (C) 2000-2015 Zbyněk Vyškovský
*
* ----------------------------------------------------------------------------------
*
* LICENSE:
*
* This file is part of Dryuf
*
* Dryuf 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.
*
* Dryuf 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 Dryuf; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author 2000-2015 Zbyněk Vyškovský
* @link mailto:kvr@matfyz.cz
* @link http://kvr.matfyz.cz/software/java/dryuf/
* @link http://github.com/dryuf/
* @license http://www.gnu.org/licenses/lgpl.txt GNU Lesser General Public License v3
*/
package net.dryuf.process.command;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.dryuf.core.CallerContext;
import net.dryuf.core.Textual;
import net.dryuf.textual.TextualManager;
public class GetOptionsStd extends java.lang.Object implements GetOptions
{
public GetOptionsStd()
{
}
public GetOptionsStd setDefinition(Map<String, ?> map)
{
this.optionsDefinition = map;
return this;
}
public GetOptionsStd setMandatories(Set<String> mandatories)
{
this.mandatories = mandatories;
return this;
}
public GetOptionsStd setMinParameters(int minParameters)
{
this.minParameters = minParameters;
return this;
}
public GetOptionsStd setMaxParameters(int maxParameters)
{
this.maxParameters = maxParameters;
return this;
}
public String parseArguments(CallerContext callerContext, Map<String, Object> options, String[] args)
{
if (optionsDefinition == null)
optionsDefinition = new HashMap<String, Object>();
if (mandatories == null)
mandatories = new HashSet<String>();
int i;
Set<String> appeared = new HashSet<String>();
for (i = 0; i < args.length; i++) {
if (args[i].startsWith("-")) {
if (args[i].equals("--")) {
i++;
break;
}
if (args[i].equals("-"))
return "missing option string: "+args[i]+"\n";
String option = args[i].substring(1);
if (!optionsDefinition.containsKey(option))
return "unknown argument: "+option+"\n";
if (appeared.contains(option))
return "option "+option+" already specified\n";
Object textualClassName = optionsDefinition.get(option);
if (textualClassName == null) {
options.put(option, true);
}
else {
Textual<?> textual;
try {
@SuppressWarnings("unchecked")
Class<? extends Textual<?>> textualClass = (Class<? extends Textual<?>>)(textualClassName instanceof Class ? (Class<?>)textualClassName : Class.forName((String)optionsDefinition.get(option)));
textual = TextualManager.createTextualUnsafe(textualClass, callerContext);
}
catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
if (++i >= args.length)
return "option "+args[i-1]+" expects a value\n";
String value = textual.prepare(args[i], null);
String error;
if ((error = textual.check(value, null)) != null)
return "invalid option value for "+args[i]+": "+error+"\n";
options.put(option, textual.convert(value, null));
}
appeared.add(option);
}
else {
break;
}
}
for (String name: mandatories) {
if (!appeared.contains(name))
return "Option "+name+" is mandatory\n";
}
if (args.length-i < minParameters)
return "Expected at least "+maxParameters+" arguments\n";
if (args.length-i > maxParameters)
return "Expected at most "+maxParameters+" arguments\n";
options.put("", Arrays.copyOfRange(args, i, args.length));
return null;
}
protected int minParameters = 0;
protected int maxParameters = 0;
protected Map<String, ?> optionsDefinition;
protected Set<String> mandatories;
}
| [
"kvr@centrum.cz"
] | kvr@centrum.cz |
9649d16833ccc1ee8cf7bcc89a44d54b86923a0e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_942fea96735168afe5a91c77c16efcad58c388aa/Patch/2_942fea96735168afe5a91c77c16efcad58c388aa_Patch_s.java | b23dcf5aea6679ed3afb3a6175cf15e018ce8898 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,298 | java | /***
* Copyright (c) 2009 Caelum - www.caelum.com.br/opensource
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package br.com.caelum.vraptor;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Supports the OPTIONS http method.
*
* @author Nykolas Lima
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Patch {
/**
* All paths that will be mapped to an annotated Resource method.
* @return
*/
String[] value() default {};
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ca4057cbd92f1aeacd1f0e96e63abc6be2a6fff0 | 82a8f35c86c274cb23279314db60ab687d33a691 | /duokan/reader/ui/bookshelf/bo.java | 4def5cc23ad602850abddbba392aba79da8672f4 | [] | no_license | QMSCount/DReader | 42363f6187b907dedde81ab3b9991523cbf2786d | c1537eed7091e32a5e2e52c79360606f622684bc | refs/heads/master | 2021-09-14T22:16:45.495176 | 2018-05-20T14:57:15 | 2018-05-20T14:57:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 329 | java | package com.duokan.reader.ui.bookshelf;
import com.duokan.core.app.c;
import com.duokan.core.app.d;
class bo implements d {
final /* synthetic */ bn a;
bo(bn bnVar) {
this.a = bnVar;
}
public void onCancel(c cVar) {
this.a.f = true;
this.a.close();
this.a.c.dismiss();
}
}
| [
"lixiaohong@p2peye.com"
] | lixiaohong@p2peye.com |
dd78d85a33ca833e40e95d01b7af7091c9c99453 | 5a9987719654ebdc6c3b9281194ea4c5939c1456 | /source/smc/generator/csharp/CSharpCodeGenerators/CSharpCodeGenerator.java | 5cdfbaf6fb9392c53fc1807f7fa33289a4051ae3 | [] | no_license | vlado-b/smcjava | 2ebec70d2518f05eb0b858000b42260c497ac92f | d658dcf89f47c3b5b2d68c9bbd8cf9706a07a480 | refs/heads/master | 2020-03-15T05:25:34.243072 | 2009-01-27T12:56:07 | 2009-01-27T12:56:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 994 | java | package smc.generator.csharp.CSharpCodeGenerators;
import smc.generator.csharp.SMCSharpGenerator;
import smc.fsmrep.State;
public abstract class CSharpCodeGenerator
{
public abstract String generateCode(SMCSharpGenerator gen);
public String printSeparator( int level )
{
if( level == 0 )
return "//----------------------------------------------\n";
else
return "//--------------------------------------------\n";
}
public String createMethodName( State s )
{
StringBuffer buff = new StringBuffer( s.getName() );
if( buff.length() > 0 )
buff.setCharAt(0, Character.toUpperCase( buff.charAt(0) ));
return( buff.toString() );
}
public String createMethodName( String event )
{
StringBuffer buff = new StringBuffer( event );
if( buff.length() > 0 )
buff.setCharAt(0, Character.toUpperCase( buff.charAt(0) ));
return( buff.toString() );
}
}
| [
"unclebob@objectmentor.com"
] | unclebob@objectmentor.com |
fa70fac4a04bb778b62ceafbc7773600a8079779 | ec0fea6a034d4a4383bd4b5da8733e0061895c64 | /src/main/java/act/util/ActErrorPageRender.java | aa0b89fcf7810e217b81afb8fb2e1ebeed972389 | [
"Apache-2.0"
] | permissive | yws/actframework | f49045c40ed370f272e75c973657313f0ff60cf7 | 121d48b4bfe433eb3c8efba7ea694a7684f9596c | refs/heads/master | 2021-01-19T21:45:15.979482 | 2017-04-18T06:00:32 | 2017-04-18T06:00:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,824 | java | package act.util;
/*-
* #%L
* ACT Framework
* %%
* Copyright (C) 2014 - 2017 ActFramework
* %%
* 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.
* #L%
*/
import act.Act;
import act.app.ActionContext;
import act.view.Template;
import act.view.ViewManager;
import com.alibaba.fastjson.JSON;
import org.osgl.$;
import org.osgl.http.H;
import org.osgl.mvc.ErrorPageRenderer;
import org.osgl.mvc.MvcConfig;
import org.osgl.mvc.result.ErrorResult;
import org.osgl.util.S;
import java.util.HashMap;
import java.util.Map;
public class ActErrorPageRender extends ErrorPageRenderer {
public static final String ARG_ERROR = "_error";
private volatile Boolean i18n;
private Map<String, $.Var<Template>> templateCache = new HashMap<>();
@Override
protected String renderTemplate(ErrorResult error, H.Format format) {
ActionContext context = ActionContext.current();
if (null == context) {
return null;
}
Integer errorCode = error.errorCode();
int statusCode = error.statusCode();
Template t = getTemplate(statusCode, context);
if (null == t) {
String errorMsg = error.getMessage();
if (null == errorMsg) {
errorMsg = MvcConfig.errorMessage(error.status());
}
if (i18n()) {
String translated = context.i18n(true, errorMsg);
if (translated == errorMsg) {
translated = context.i18n(true, MvcConfig.class, errorMsg);
}
errorMsg = translated;
}
H.Format accept = context.accept();
if (H.Format.JSON == accept) {
return jsonContent(error, errorCode, errorMsg);
} else if (H.Format.HTML == accept) {
String header = S.concat("HTTP/1.1 ", Integer.toString(statusCode), " ", errorMsg);
return S.concat("<!DOCTYPE html><html><head><meta charset='utf-8'><title>"
, header
, "</title></head><body><h1>"
, header, "</h1></body></html>");
} else if (H.Format.XML == accept) {
S.Buffer sb = context.strBuf();
sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><error>");
if (null != errorCode) {
sb.append("<code>").append(errorCode).append("</code");
}
sb.append("<message>").append(errorMsg).append("</message></error>");
return sb.toString();
} else if (H.Format.CSV == accept) {
if (null == errorCode) {
return S.concat("message\n", errorMsg);
} else {
return S.concat("code,message\n", Integer.toString(errorCode), ",", errorMsg);
}
} else if (H.Format.TXT == accept) {
return null == errorCode ? errorMsg : S.concat(Integer.toString(errorCode), " ", errorMsg);
} else {
// Unknown accept format
return "";
}
}
context.renderArg(ARG_ERROR, error);
return t.render(context);
}
private String jsonContent(ErrorResult error, Integer errorCode, String errorMsg) {
Object payload = error.attachment();
if (null != payload) {
return JSON.toJSONString(payload);
}
if (null == errorCode) {
return S.concat("{\"message\":\"", errorMsg, "\"}");
} else {
return S.concat("{\"code\":", S.string(errorCode), ",\"message\":\"", errorMsg, "\"}");
}
}
private String templatePath(int code, ActionContext context) {
ErrorTemplatePathResolver resolver = context.config().errorTemplatePathResolver();
if (null == resolver) {
resolver = new ErrorTemplatePathResolver.DefaultErrorTemplatePathResolver();
}
return resolver.resolve(code, context.accept());
}
private Template getTemplate(int statusCode, ActionContext context) {
H.Format format = context.accept();
String key = statusCode + "" + format;
$.Var<Template> templateBag = templateCache.get(key);
if (null == templateBag) {
ViewManager vm = Act.viewManager();
if (null == vm) {
// unit testing
return null;
}
context.templatePath(templatePath(statusCode, context));
Template t = vm.load(context);
if (null == t) {
// try default one
if (Act.isDev()) {
context.templatePath("/error/dev/errorPage." + context.accept().name());
} else {
context.templatePath("/error/errorPage." + context.accept().name());
}
t = vm.load(context);
}
templateBag = $.var(t);
templateCache.put(key, templateBag);
}
return templateBag.get();
}
private boolean i18n() {
if (null == i18n) {
synchronized (this) {
if (null == i18n) {
i18n = Act.appConfig().i18nEnabled();
}
}
}
return i18n;
}
}
| [
"greenlaw110@gmail.com"
] | greenlaw110@gmail.com |
22a21676f4ace0510265e1bb532770bfac9163b7 | 27f5457d47aaf3491f0d64032247adc08efba867 | /vertx-gaia/vertx-ams/src/main/jib/io/horizon/uca/qr/syntax/QLeaf.java | 293fad2a0951e74b000677c87f0cbfb6827a6b49 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | silentbalanceyh/vertx-zero | e73d22f4213263933683e4ebe87982ba68803878 | 1ede4c3596f491d5251eefaaaedc56947ef784cd | refs/heads/master | 2023-06-11T23:10:29.241769 | 2023-06-08T16:15:33 | 2023-06-08T16:15:33 | 108,104,586 | 348 | 71 | Apache-2.0 | 2020-04-10T02:15:18 | 2017-10-24T09:21:56 | HTML | UTF-8 | Java | false | false | 377 | java | package io.horizon.uca.qr.syntax;
public interface QLeaf extends QNode {
/*
* Read current node field information
* 1. If current node is leaf, field will be attribute/column name
* 2. If current node is not leaf, field will be expr such as `$0` or `$1`
*/
String field();
/*
* Get the value of current node
*/
Object value();
}
| [
"silentbalanceyh@126.com"
] | silentbalanceyh@126.com |
bfba4b9184129bde04ca5c79db6b0775c03c6b48 | 736fef3dcf85164cf103976e1753c506eb13ae09 | /seccon_2015/Reverse-Engineering Android APK 1/files/source/src/android/support/v4/app/SharedElementCallback.java | f2798b1465fcad5d4c10048b4fefea1bbbb6c306 | [
"MIT"
] | permissive | Hamz-a/MyCTFWriteUps | 4b7dac9a7eb71fceb7d83966dc63cf4e5a796007 | ffa98e4c096ff1751f5f729d0ec882e079a6b604 | refs/heads/master | 2021-01-10T17:46:10.014480 | 2018-04-01T22:14:31 | 2018-04-01T22:14:31 | 47,495,748 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,966 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package android.support.v4.app;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.widget.ImageView;
import java.util.List;
import java.util.Map;
public abstract class SharedElementCallback
{
private static final String BUNDLE_SNAPSHOT_BITMAP = "sharedElement:snapshot:bitmap";
private static final String BUNDLE_SNAPSHOT_IMAGE_MATRIX = "sharedElement:snapshot:imageMatrix";
private static final String BUNDLE_SNAPSHOT_IMAGE_SCALETYPE = "sharedElement:snapshot:imageScaleType";
private static int MAX_IMAGE_SIZE = 0x100000;
private Matrix mTempMatrix;
public SharedElementCallback()
{
}
private static Bitmap createDrawableBitmap(Drawable drawable)
{
int i = drawable.getIntrinsicWidth();
int j = drawable.getIntrinsicHeight();
if (i <= 0 || j <= 0)
{
return null;
}
float f = Math.min(1.0F, (float)MAX_IMAGE_SIZE / (float)(i * j));
if ((drawable instanceof BitmapDrawable) && f == 1.0F)
{
return ((BitmapDrawable)drawable).getBitmap();
} else
{
i = (int)((float)i * f);
j = (int)((float)j * f);
Bitmap bitmap = Bitmap.createBitmap(i, j, android.graphics.Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Rect rect = drawable.getBounds();
int k = rect.left;
int l = rect.top;
int i1 = rect.right;
int j1 = rect.bottom;
drawable.setBounds(0, 0, i, j);
drawable.draw(canvas);
drawable.setBounds(k, l, i1, j1);
return bitmap;
}
}
public Parcelable onCaptureSharedElementSnapshot(View view, Matrix matrix, RectF rectf)
{
if (view instanceof ImageView)
{
ImageView imageview = (ImageView)view;
Object obj = imageview.getDrawable();
Drawable drawable = imageview.getBackground();
if (obj != null && drawable == null)
{
obj = createDrawableBitmap(((Drawable) (obj)));
if (obj != null)
{
view = new Bundle();
view.putParcelable("sharedElement:snapshot:bitmap", ((Parcelable) (obj)));
view.putString("sharedElement:snapshot:imageScaleType", imageview.getScaleType().toString());
if (imageview.getScaleType() == android.widget.ImageView.ScaleType.MATRIX)
{
matrix = imageview.getImageMatrix();
rectf = new float[9];
matrix.getValues(rectf);
view.putFloatArray("sharedElement:snapshot:imageMatrix", rectf);
}
return view;
}
}
}
int j = Math.round(rectf.width());
int i = Math.round(rectf.height());
Object obj1 = null;
Bitmap bitmap = obj1;
if (j > 0)
{
bitmap = obj1;
if (i > 0)
{
float f = Math.min(1.0F, (float)MAX_IMAGE_SIZE / (float)(j * i));
j = (int)((float)j * f);
i = (int)((float)i * f);
if (mTempMatrix == null)
{
mTempMatrix = new Matrix();
}
mTempMatrix.set(matrix);
mTempMatrix.postTranslate(-rectf.left, -rectf.top);
mTempMatrix.postScale(f, f);
bitmap = Bitmap.createBitmap(j, i, android.graphics.Bitmap.Config.ARGB_8888);
matrix = new Canvas(bitmap);
matrix.concat(mTempMatrix);
view.draw(matrix);
}
}
return bitmap;
}
public View onCreateSnapshotView(Context context, Parcelable parcelable)
{
Object obj = null;
if (!(parcelable instanceof Bundle)) goto _L2; else goto _L1
_L1:
Object obj1 = (Bundle)parcelable;
obj = (Bitmap)((Bundle) (obj1)).getParcelable("sharedElement:snapshot:bitmap");
if (obj == null)
{
return null;
}
parcelable = new ImageView(context);
context = parcelable;
parcelable.setImageBitmap(((Bitmap) (obj)));
parcelable.setScaleType(android.widget.ImageView.ScaleType.valueOf(((Bundle) (obj1)).getString("sharedElement:snapshot:imageScaleType")));
obj = context;
if (parcelable.getScaleType() == android.widget.ImageView.ScaleType.MATRIX)
{
obj = ((Bundle) (obj1)).getFloatArray("sharedElement:snapshot:imageMatrix");
obj1 = new Matrix();
((Matrix) (obj1)).setValues(((float []) (obj)));
parcelable.setImageMatrix(((Matrix) (obj1)));
obj = context;
}
_L4:
return ((View) (obj));
_L2:
if (parcelable instanceof Bitmap)
{
parcelable = (Bitmap)parcelable;
obj = new ImageView(context);
((ImageView) (obj)).setImageBitmap(parcelable);
}
if (true) goto _L4; else goto _L3
_L3:
}
public void onMapSharedElements(List list, Map map)
{
}
public void onRejectSharedElements(List list)
{
}
public void onSharedElementEnd(List list, List list1, List list2)
{
}
public void onSharedElementStart(List list, List list1, List list2)
{
}
}
| [
"dzcyberdev@gmail.com"
] | dzcyberdev@gmail.com |
a1b1f9662b459d984113aa7210a7b1e33e6a9869 | 64b1df0897b21985211e5ed33ce962f5712b2121 | /src/main/java/ninja/bytecode/shuriken/io/bytetag/jnbt/IntArrayTag.java | 24cca845babe5070216f27daf184d43a8ac12368 | [] | no_license | cyberpwnn/LaunchKit | 582d8f6913aaa2f8c12415179e66b39b66b18024 | dca11bfd5e1b839a4dd267c37d8cd96a43bbcd65 | refs/heads/master | 2022-11-07T07:57:09.255853 | 2021-04-15T20:04:31 | 2021-04-15T20:04:31 | 195,697,931 | 2 | 2 | null | 2021-12-14T21:29:16 | 2019-07-07T21:18:52 | Java | UTF-8 | Java | false | false | 3,193 | java | package ninja.bytecode.shuriken.io.bytetag.jnbt;
import java.util.Arrays;
//@formatter:off
/*
* JNBT License
*
* Copyright (c) 2010 Graham Edgecombe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of the JNBT team nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
//@formatter:on
/**
* The <code>TAG_Byte_Array</code> tag.
*
* @author Jocopa3
*
*/
public final class IntArrayTag extends Tag {
/**
* The value.
*/
private final int[] value;
/**
* Creates the tag.
*
* @param name
* The name.
* @param value
* The value.
*/
public IntArrayTag(final String name, final int[] value) {
super(name);
this.value = value;
}
@Override
public int[] getValue() {
return value;
}
@Override
public String toString() {
final StringBuilder integers = new StringBuilder();
for (final int b : value) {
integers.append(b).append(" ");
}
final String name = getName();
String append = "";
if ((name != null) && !name.equals("")) {
append = "(\"" + getName() + "\")";
}
return "TAG_Int_Array" + append + ": " + integers.toString();
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = (prime * result) + Arrays.hashCode(value);
return result;
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) { return true; }
if (!super.equals(obj)) { return false; }
if (!(obj instanceof IntArrayTag)) { return false; }
final IntArrayTag other = (IntArrayTag) obj;
if (!Arrays.equals(value, other.value)) { return false; }
return true;
}
}
| [
"danielmillst@gmail.com"
] | danielmillst@gmail.com |
949bb4221785601583d9a9854ea7af3c8fbc3a37 | 4a015f5a9b655f027a4d4e04fdc926bb893d093d | /career-service/src/main/java/mk/ukim/finki/career/service/impl/PostServiceImpl.java | 39b19f83ee6d017e6f7cd9bc2c1df3a698020827 | [
"MIT"
] | permissive | kirkovg/university-microservices | cd1bfe8f92dba3b422c56903b972a2aa9f0b45c7 | 2c8db22c3337014e3a8aa5de3e6a1a32d35c9ba0 | refs/heads/master | 2021-12-26T13:05:05.598702 | 2018-09-11T18:53:35 | 2018-09-11T18:53:35 | 147,234,534 | 0 | 0 | MIT | 2021-08-12T22:16:40 | 2018-09-03T17:25:19 | Java | UTF-8 | Java | false | false | 2,015 | java | package mk.ukim.finki.career.service.impl;
import mk.ukim.finki.career.service.PostService;
import mk.ukim.finki.career.domain.Post;
import mk.ukim.finki.career.repository.PostRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
/**
* Service Implementation for managing Post.
*/
@Service
@Transactional
public class PostServiceImpl implements PostService {
private final Logger log = LoggerFactory.getLogger(PostServiceImpl.class);
private final PostRepository postRepository;
public PostServiceImpl(PostRepository postRepository) {
this.postRepository = postRepository;
}
/**
* Save a post.
*
* @param post the entity to save
* @return the persisted entity
*/
@Override
public Post save(Post post) {
log.debug("Request to save Post : {}", post); return postRepository.save(post);
}
/**
* Get all the posts.
*
* @param pageable the pagination information
* @return the list of entities
*/
@Override
@Transactional(readOnly = true)
public Page<Post> findAll(Pageable pageable) {
log.debug("Request to get all Posts");
return postRepository.findAll(pageable);
}
/**
* Get one post by id.
*
* @param id the id of the entity
* @return the entity
*/
@Override
@Transactional(readOnly = true)
public Optional<Post> findOne(Long id) {
log.debug("Request to get Post : {}", id);
return postRepository.findById(id);
}
/**
* Delete the post by id.
*
* @param id the id of the entity
*/
@Override
public void delete(Long id) {
log.debug("Request to delete Post : {}", id);
postRepository.deleteById(id);
}
}
| [
"gjorgjikirkov@gmail.com"
] | gjorgjikirkov@gmail.com |
043e330a6725b12262e57baa8e8ff68bc2703d02 | 2395a9adc271362b10e9189582d2e82237a369f3 | /MinecraftTools/server/work/decompile-ba9a3cce/net/minecraft/server/ContainerChest.java | 97c182a9f8e6b8ea44a89869946d06431c7314a4 | [] | no_license | pkrakow/PennyProjects | 4abb06e7d64cef1e43866006199f17375c42cfcf | bfb661501c625035bd539a40ac9e0f6182213d78 | refs/heads/master | 2021-01-21T04:50:59.299863 | 2018-02-17T15:40:55 | 2018-02-17T15:40:55 | 54,284,291 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,043 | java | package net.minecraft.server;
public class ContainerChest extends Container {
private IInventory container;
private int f;
public ContainerChest(IInventory iinventory, IInventory iinventory1, EntityHuman entityhuman) {
this.container = iinventory1;
this.f = iinventory1.getSize() / 9;
iinventory1.startOpen(entityhuman);
int i = (this.f - 4) * 18;
int j;
int k;
for (j = 0; j < this.f; ++j) {
for (k = 0; k < 9; ++k) {
this.a(new Slot(iinventory1, k + j * 9, 8 + k * 18, 18 + j * 18));
}
}
for (j = 0; j < 3; ++j) {
for (k = 0; k < 9; ++k) {
this.a(new Slot(iinventory, k + j * 9 + 9, 8 + k * 18, 103 + j * 18 + i));
}
}
for (j = 0; j < 9; ++j) {
this.a(new Slot(iinventory, j, 8 + j * 18, 161 + i));
}
}
public boolean a(EntityHuman entityhuman) {
return this.container.a(entityhuman);
}
public ItemStack b(EntityHuman entityhuman, int i) {
ItemStack itemstack = null;
Slot slot = (Slot) this.c.get(i);
if (slot != null && slot.hasItem()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.cloneItemStack();
if (i < this.f * 9) {
if (!this.a(itemstack1, this.f * 9, this.c.size(), true)) {
return null;
}
} else if (!this.a(itemstack1, 0, this.f * 9, false)) {
return null;
}
if (itemstack1.count == 0) {
slot.set((ItemStack) null);
} else {
slot.f();
}
}
return itemstack;
}
public void b(EntityHuman entityhuman) {
super.b(entityhuman);
this.container.closeContainer(entityhuman);
}
public IInventory e() {
return this.container;
}
}
| [
"pennykrakow@Nicoles-Mac-mini.local"
] | pennykrakow@Nicoles-Mac-mini.local |
694b7e5a5673236820d2db6d1facd462cddec246 | 92e5430fc48f166ca5b7129e154b74311db4cf5d | /Spock/spock-up-and-running/code/tdd-with-rxjava/src/main/java/squawker/client/SquawkerApi.java | 7027cc785b30ba410696d80830a4c9351a64c921 | [] | no_license | naaspati-practicing/testing-frameworks | e13a54ccebfc40a8f1f72fe80e1678bd8c0624d6 | e5af4a87765a8d3ad683f7b3ac82fec3ac335b87 | refs/heads/master | 2020-04-16T09:27:03.914182 | 2019-01-25T19:16:44 | 2019-01-25T19:16:44 | 165,464,640 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 835 | java | /*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package squawker.client;
import java.io.*;
import java.util.*;
import squawker.*;
// tag::api[]
public interface SquawkerApi {
List<Message> getTimeline(String username, Serializable sinceId); // <1>
}
// end::api[]
| [
"naaspati@gmail.com"
] | naaspati@gmail.com |
a8aac5e40a5b1bb111dfa4a644e9a364a79d6f86 | f92fc9afe992d0a23a8d6bb7c1e1133049ba094a | /vboot-core/src/main/java/com/carson/vboot/core/entity/RolePermission.java | 5732263c69313b14952d2e92440f6986665c08ac | [] | no_license | Niofh/vboot | 1db31c310c07c27950b27b2d090d07560cb7c2e2 | dd3bcc1d7e8c218906e606a2d230c43c39263a11 | refs/heads/master | 2022-07-03T20:22:06.939237 | 2020-09-29T09:12:26 | 2020-09-29T09:12:26 | 245,214,799 | 0 | 0 | null | 2022-06-21T03:52:06 | 2020-03-05T16:34:47 | Java | UTF-8 | Java | false | false | 587 | java | package com.carson.vboot.core.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.carson.vboot.core.base.VbootBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author oufuhua
*/
@Data
@ApiModel("角色权限表")
@TableName("t_role_permission")
public class RolePermission extends VbootBaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("角色id")
private String roleId;
@ApiModelProperty("权限id")
private String permissionId;
}
| [
"l"
] | l |
6cb484f4a2c23508d946d5d0118a81611bacdf4f | 88f60611ea3ec5e7c8f83ab7746fe185563de396 | /src/flow/MP/IdentificaParticipant/Tier.java | ad14226e9710eed5d8e08ea80b477e37b8397c68 | [] | no_license | gtau/WSTeste | ac6b8bcba4d002a2b70ac94c71940742e89c9ca2 | 998359cc9346e9f4a614a8552a59f5b9ce5bcf3d | refs/heads/master | 2021-01-01T04:06:50.085131 | 2016-04-27T01:49:30 | 2016-04-27T01:49:30 | 57,174,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,011 | java |
package flow.MP.IdentificaParticipant;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for Tier complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Tier">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="level" type="{http://ebo.multiplusfidelidade.com.br/v1}TipoReferencia" minOccurs="0"/>
* <element name="regras-tier" type="{http://ebo.multiplusfidelidade.com.br/v1}RegraTierList" minOccurs="0"/>
* <element name="data-validade" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Tier", propOrder = {
"level",
"regrasTier",
"dataValidade"
})
public class Tier {
protected TipoReferencia level;
@XmlElement(name = "regras-tier")
protected RegraTierList regrasTier;
@XmlElement(name = "data-validade")
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar dataValidade;
/**
* Gets the value of the level property.
*
* @return
* possible object is
* {@link TipoReferencia }
*
*/
public TipoReferencia getLevel() {
return level;
}
/**
* Sets the value of the level property.
*
* @param value
* allowed object is
* {@link TipoReferencia }
*
*/
public void setLevel(TipoReferencia value) {
this.level = value;
}
/**
* Gets the value of the regrasTier property.
*
* @return
* possible object is
* {@link RegraTierList }
*
*/
public RegraTierList getRegrasTier() {
return regrasTier;
}
/**
* Sets the value of the regrasTier property.
*
* @param value
* allowed object is
* {@link RegraTierList }
*
*/
public void setRegrasTier(RegraTierList value) {
this.regrasTier = value;
}
/**
* Gets the value of the dataValidade property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDataValidade() {
return dataValidade;
}
/**
* Sets the value of the dataValidade property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDataValidade(XMLGregorianCalendar value) {
this.dataValidade = value;
}
}
| [
"gabrieltau@365ti.com.br"
] | gabrieltau@365ti.com.br |
292b4cfd515c8eb5ad142b7e70a4bbc724b0cb34 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/serge-rider--dbeaver/c61e01d3553ec0bcb52482e6a7c7ec8637e721ea/after/ResultSetDataReceiver.java | ee77ed140e12c58596601ba5769346a2d427f599 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,445 | java | /*
* Copyright (C) 2010-2014 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ui.controls.resultset;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.swt.widgets.Control;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.DBDAttributeBindingMeta;
import org.jkiss.dbeaver.model.data.DBDDataReceiver;
import org.jkiss.dbeaver.model.exec.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Data pump for SQL queries
*/
class ResultSetDataReceiver implements DBDDataReceiver {
static final Log log = LogFactory.getLog(ResultSetDataReceiver.class);
private ResultSetViewer resultSetViewer;
private int columnsCount;
private DBDAttributeBindingMeta[] metaColumns;
private List<Object[]> rows = new ArrayList<Object[]>();
private boolean hasMoreData;
private boolean nextSegmentRead;
private Map<DBCAttributeMetaData, List<DBCException>> errors = new HashMap<DBCAttributeMetaData, List<DBCException>>();
ResultSetDataReceiver(ResultSetViewer resultSetViewer)
{
this.resultSetViewer = resultSetViewer;
}
boolean isHasMoreData() {
return hasMoreData;
}
void setHasMoreData(boolean hasMoreData) {
this.hasMoreData = hasMoreData;
}
void setNextSegmentRead(boolean nextSegmentRead) {
this.nextSegmentRead = nextSegmentRead;
}
@Override
public void fetchStart(DBCSession session, DBCResultSet resultSet)
throws DBCException
{
rows.clear();
if (!nextSegmentRead) {
// Get columns metadata
DBCResultSetMetaData metaData = resultSet.getResultSetMetaData();
List<DBCAttributeMetaData> rsAttributes = metaData.getAttributes();
columnsCount = rsAttributes.size();
// Extract column info
metaColumns = new DBDAttributeBindingMeta[columnsCount];
for (int i = 0; i < columnsCount; i++) {
metaColumns[i] = DBUtils.getColumnBinding(session, rsAttributes.get(i));
}
resultSetViewer.setMetaData(metaColumns);
}
}
@Override
public void fetchRow(DBCSession session, DBCResultSet resultSet)
throws DBCException
{
Object[] row = new Object[columnsCount];
for (int i = 0; i < columnsCount; i++) {
try {
row[i] = metaColumns[i].getValueHandler().fetchValueObject(
session,
resultSet,
metaColumns[i].getMetaAttribute(),
metaColumns[i].getOrdinalPosition());
}
catch (DBCException e) {
// Do not reports the same error multiple times
// There are a lot of error could occur during result set fetch
// We report certain error only once
List<DBCException> errorList = errors.get(metaColumns[i].getMetaAttribute());
if (errorList == null) {
errorList = new ArrayList<DBCException>();
errors.put(metaColumns[i].getMetaAttribute(), errorList);
}
if (!errorList.contains(e)) {
log.warn("Could not read column '" + metaColumns[i].getName() + "' value", e);
errorList.add(e);
}
}
}
rows.add(row);
}
@Override
public void fetchEnd(DBCSession session)
throws DBCException
{
{
// Read locators' metadata
DBUtils.findValueLocators(session, metaColumns, rows);
}
final List<Object[]> tmpRows = rows;
int segmentSize = resultSetViewer.getSegmentMaxRows();
hasMoreData = segmentSize > 0 && tmpRows.size() >= segmentSize;
final boolean nextSegmentRead = this.nextSegmentRead;
Control control = resultSetViewer.getControl();
if (!control.isDisposed()) {
control.getDisplay().asyncExec(new Runnable() {
@Override
public void run()
{
// Check for more data
// Push data into viewer
if (!nextSegmentRead) {
resultSetViewer.setData(tmpRows);
} else {
resultSetViewer.appendData(tmpRows);
}
}
});
}
}
@Override
public void close()
{
nextSegmentRead = false;
errors.clear();
rows = new ArrayList<Object[]>();
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
39478655a9a7038f3cef407d4e54992866746e7e | 169f4b4cb60dc918bf0d8b8db1a7efdf5d4ebc23 | /java-client/src/main/java/co/elastic/clients/elasticsearch/security/get_token/AuthenticatedUser.java | 091d830f2aaf5f16796afaa49ab5a962490a8a00 | [
"Apache-2.0"
] | permissive | PyJava1984/elasticsearch-java | 387d2212cc0784c06d1a8af0d284f4ee2b1cf9b4 | 5c7c24d9dd33de37e00ca183b32ec5cb17ea8b17 | refs/heads/main | 2023-08-28T17:35:38.220152 | 2021-10-18T19:21:23 | 2021-10-18T19:21:23 | 419,573,301 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,804 | java | /*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. 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.
*/
//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
package co.elastic.clients.elasticsearch.security.get_token;
import co.elastic.clients.elasticsearch.security.User;
import co.elastic.clients.json.DelegatingDeserializer;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
import co.elastic.clients.json.ObjectBuilderDeserializer;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;
// typedef: security.get_token.AuthenticatedUser
@JsonpDeserializable
public final class AuthenticatedUser extends User {
private final UserRealm authenticationRealm;
private final UserRealm lookupRealm;
@Nullable
private final AuthenticationProvider authenticationProvider;
private final String authenticationType;
// ---------------------------------------------------------------------------------------------
public AuthenticatedUser(Builder builder) {
super(builder);
this.authenticationRealm = Objects.requireNonNull(builder.authenticationRealm, "authentication_realm");
this.lookupRealm = Objects.requireNonNull(builder.lookupRealm, "lookup_realm");
this.authenticationProvider = builder.authenticationProvider;
this.authenticationType = Objects.requireNonNull(builder.authenticationType, "authentication_type");
}
public AuthenticatedUser(Function<Builder, Builder> fn) {
this(fn.apply(new Builder()));
}
/**
* Required - API name: {@code authentication_realm}
*/
public UserRealm authenticationRealm() {
return this.authenticationRealm;
}
/**
* Required - API name: {@code lookup_realm}
*/
public UserRealm lookupRealm() {
return this.lookupRealm;
}
/**
* API name: {@code authentication_provider}
*/
@Nullable
public AuthenticationProvider authenticationProvider() {
return this.authenticationProvider;
}
/**
* Required - API name: {@code authentication_type}
*/
public String authenticationType() {
return this.authenticationType;
}
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
super.serializeInternal(generator, mapper);
generator.writeKey("authentication_realm");
this.authenticationRealm.serialize(generator, mapper);
generator.writeKey("lookup_realm");
this.lookupRealm.serialize(generator, mapper);
if (this.authenticationProvider != null) {
generator.writeKey("authentication_provider");
this.authenticationProvider.serialize(generator, mapper);
}
generator.writeKey("authentication_type");
generator.write(this.authenticationType);
}
// ---------------------------------------------------------------------------------------------
/**
* Builder for {@link AuthenticatedUser}.
*/
public static class Builder extends User.AbstractBuilder<Builder> implements ObjectBuilder<AuthenticatedUser> {
private UserRealm authenticationRealm;
private UserRealm lookupRealm;
@Nullable
private AuthenticationProvider authenticationProvider;
private String authenticationType;
/**
* Required - API name: {@code authentication_realm}
*/
public Builder authenticationRealm(UserRealm value) {
this.authenticationRealm = value;
return this;
}
/**
* Required - API name: {@code authentication_realm}
*/
public Builder authenticationRealm(Function<UserRealm.Builder, ObjectBuilder<UserRealm>> fn) {
return this.authenticationRealm(fn.apply(new UserRealm.Builder()).build());
}
/**
* Required - API name: {@code lookup_realm}
*/
public Builder lookupRealm(UserRealm value) {
this.lookupRealm = value;
return this;
}
/**
* Required - API name: {@code lookup_realm}
*/
public Builder lookupRealm(Function<UserRealm.Builder, ObjectBuilder<UserRealm>> fn) {
return this.lookupRealm(fn.apply(new UserRealm.Builder()).build());
}
/**
* API name: {@code authentication_provider}
*/
public Builder authenticationProvider(@Nullable AuthenticationProvider value) {
this.authenticationProvider = value;
return this;
}
/**
* API name: {@code authentication_provider}
*/
public Builder authenticationProvider(
Function<AuthenticationProvider.Builder, ObjectBuilder<AuthenticationProvider>> fn) {
return this.authenticationProvider(fn.apply(new AuthenticationProvider.Builder()).build());
}
/**
* Required - API name: {@code authentication_type}
*/
public Builder authenticationType(String value) {
this.authenticationType = value;
return this;
}
@Override
protected Builder self() {
return this;
}
/**
* Builds a {@link AuthenticatedUser}.
*
* @throws NullPointerException
* if some of the required fields are null.
*/
public AuthenticatedUser build() {
return new AuthenticatedUser(this);
}
}
// ---------------------------------------------------------------------------------------------
/**
* Json deserializer for {@link AuthenticatedUser}
*/
public static final JsonpDeserializer<AuthenticatedUser> _DESERIALIZER = ObjectBuilderDeserializer
.lazy(Builder::new, AuthenticatedUser::setupAuthenticatedUserDeserializer, Builder::build);
protected static void setupAuthenticatedUserDeserializer(DelegatingDeserializer<AuthenticatedUser.Builder> op) {
User.setupUserDeserializer(op);
op.add(Builder::authenticationRealm, UserRealm._DESERIALIZER, "authentication_realm");
op.add(Builder::lookupRealm, UserRealm._DESERIALIZER, "lookup_realm");
op.add(Builder::authenticationProvider, AuthenticationProvider._DESERIALIZER, "authentication_provider");
op.add(Builder::authenticationType, JsonpDeserializer.stringDeserializer(), "authentication_type");
}
}
| [
"sylvain@elastic.co"
] | sylvain@elastic.co |
8831a2b234f070cc828fef5fe156ccccb201c9be | 447520f40e82a060368a0802a391697bc00be96f | /apks/malware/app46/source/com/unity3d/ads/android/k.java | 5bca030ec905c5187c0be6499719caef3f565089 | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 1,124 | java | package com.unity3d.ads.android;
import android.app.Activity;
import com.unity3d.ads.android.properties.UnityAdsProperties;
import com.unity3d.ads.android.view.UnityAdsFullscreenActivity;
import com.unity3d.ads.android.webapp.UnityAdsWebData;
import com.unity3d.ads.android.zone.UnityAdsZone;
import com.unity3d.ads.android.zone.UnityAdsZoneManager;
final class k
implements Runnable
{
private k() {}
public final void run()
{
if ((UnityAdsProperties.getCurrentActivity() != null) && ((UnityAdsProperties.getCurrentActivity() instanceof UnityAdsFullscreenActivity)))
{
Activity localActivity = UnityAdsProperties.getCurrentActivity();
if ((localActivity != null) && ((localActivity instanceof UnityAdsFullscreenActivity)) && (!localActivity.isFinishing()) && (!UnityAdsProperties.isActivityDestroyed(localActivity)))
{
localActivity.finish();
if ((UnityAdsWebData.getZoneManager() != null) && (!UnityAdsWebData.getZoneManager().getCurrentZone().openAnimated())) {
localActivity.overridePendingTransition(0, 0);
}
}
}
UnityAds.k();
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
95fdbc3fcd1222e1f2b25b3d56db8177863bd56b | b76f1ad0c4bfe3e554ea87b92d9ca4d414ca11fb | /LeetCode/src/LRUCache.java | c86008d1cdb3d1a3d1ce9c38365b193d4fc049c4 | [] | no_license | arnavahire/LeetcodeProjects | 18dba8f04758f702f032bc8252746c7fe624016e | 71764ddfd530e4e1c3f844c3c6e352f001ae4d38 | refs/heads/master | 2020-03-20T20:07:50.510100 | 2018-06-17T17:30:52 | 2018-06-17T17:30:52 | 137,671,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,328 | java | /*PROBLEM STATEMENT: LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
Follow up:
Could you do both operations in O(1) time complexity?
Example:
LRUCache cache = new LRUCache( 2 capacity );
cache.put(1, 1);
cache.put(2, 2);
cache.get(1); // returns 1
cache.put(3, 3); // evicts key 2
cache.get(2); // returns -1 (not found)
cache.put(4, 4); // evicts key 1
cache.get(1); // returns -1 (not found)
cache.get(3); // returns 3
cache.get(4); // returns 4
*/
import java.util.Hashtable;
public class LRUCache {
Hashtable<Integer,DoublyLinkedNode> myCache=new Hashtable<Integer, DoublyLinkedNode>(); // our cache will be a hash table of Integer value as key and a doubly linked node associated with it as its value
int count;
int capacity;
DoublyLinkedNode head, tail; // we use nodes head and tail so that we can preform operations on all the nodes between them
public LRUCache(int capacity)
{
this.count=0;
this.capacity=capacity;
head=new DoublyLinkedNode();
head.prev=null;
tail=new DoublyLinkedNode();
tail.next=null;
head.next=tail;
tail.prev=head;
}
class DoublyLinkedNode
{
int key;
int value;
DoublyLinkedNode prev;
DoublyLinkedNode next;
}
/* Add the new node after the Head node */
private void addNode(DoublyLinkedNode node)
{
node.prev=head;
node.next=head.next;
head.next.prev=node;
head.next=node;
}
/* Remove the node from doubly Linked List */
private void removeNode(DoublyLinkedNode node)
{
DoublyLinkedNode previousNode=node.prev;
DoublyLinkedNode nextNode=node.next;
nextNode.prev=previousNode;
previousNode.next=nextNode;
}
/* On each access to the same key, move the respective node to the head of the list signifying that it is the most recently used key */
private void moveNodeToHead(DoublyLinkedNode node)
{
this.removeNode(node);
this.addNode(node);
}
/* This is going to be the least recently used key, whose node would be removed from tail */
private DoublyLinkedNode removeFromTail()
{
DoublyLinkedNode node=tail.prev;
this.removeNode(node);
return node;
}
public int get(int key)
{
DoublyLinkedNode node=myCache.get(key);
if(node==null) // if the node corresponding to the key is null, it means the node was removed by LRU cache and hence is unavailable
{
return -1;
}
else
{
this.moveNodeToHead(node); // now this key will become the most recently used, since it will go to head's next directly
return node.value;
}
}
public void put(int key, int value)
{
DoublyLinkedNode node=myCache.get(key);
if(node==null) // if inserting a key for the first time
{
node=new DoublyLinkedNode();
node.key=key;
node.value=value;
myCache.put(key,node); // if the entry is being made for the first time, then the entry will be made in the cache and the node would be added to the linked list, just ahead of the head node
this.addNode(node);
count++;
if(count > capacity) // after adding a new entry, the least recently used entry will be removed from the cache
{
DoublyLinkedNode LRUEntry=removeFromTail();
myCache.remove(LRUEntry.key);
count--;
}
}
else // if key is already present, update the node to the head
{
node.value=value;
this.moveNodeToHead(node);
}
}
}
| [
"arnavstarsmj@gmail.com"
] | arnavstarsmj@gmail.com |
7e591f42855383bc3f5a2e3d01cb44efcbd6e6c6 | 7eb746c88662e75a19f66f363aadd5d5237242af | /vangoghcore/src/main/java/dev/tornaco/vangogh/request/DisplayRequestDispatcher.java | f14cfb1397a2de7fe5db990a1bba5eeba0e36e41 | [] | no_license | Tornaco/DataMigration | f03824288e995fa2088d325afa76849a839591b4 | 7304d95a5feb2068d4f26585f5a8c50e087fcefa | refs/heads/master | 2022-10-18T15:49:45.564065 | 2022-10-08T07:29:31 | 2022-10-08T07:29:31 | 84,621,616 | 19 | 5 | null | 2017-07-14T03:59:40 | 2017-03-11T03:42:24 | Java | UTF-8 | Java | false | false | 199 | java | package dev.tornaco.vangogh.request;
/**
* Created by guohao4 on 2017/8/25.
* Email: Tornaco@163.com
*/
public interface DisplayRequestDispatcher extends Dispatcher<DisplayRequest> {
}
| [
"tornaco@163.com"
] | tornaco@163.com |
74bd04f39a9404f6f561b6f06bb92c6a8dfe2c58 | 672363ecfc769877e1b4c81de0abce312c3c8fc5 | /Lab10/Database.java | babc422562cfd264009f83cd43499745d810683c | [] | no_license | VolodymyrMoskalenko/JavaLearn | 9605692e2c365f9df41d7a7de2db2e81bc41d541 | 135f1940591181102dd41aa2b9068a2c6efe0429 | refs/heads/master | 2020-11-24T15:45:00.319199 | 2020-01-23T19:47:43 | 2020-01-23T19:47:43 | 228,223,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | package lab10;
import java.util.ArrayList;
import java.util.List;
public class Database {
private static List<Film> allfilms = new ArrayList();
public static void addFilm(Film film) { allfilms.add(film); }
private static List<Actor> allactors = new ArrayList();
public static void addActor(Actor actor) {
allactors.add(actor);
}
public static List<Actor> getActors(){
return allactors;
}
public static List<Film> getFilms(){
return allfilms;
}
} | [
"you@example.com"
] | you@example.com |
7636ad3d101bd59e8de9ecde9a269d840f6a335c | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/MOCKITO-3b-9-30-Single_Objective_GGA-WeightedSum/org/mockito/internal/handler/InvocationNotifierHandler_ESTest_scaffolding.java | b42c0f678e8b31212ef6eb324e8e237faa362c64 | [
"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 | 458 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Mar 30 15:49:47 UTC 2020
*/
package org.mockito.internal.handler;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class InvocationNotifierHandler_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
49c0716b17e9a3d8fe8b789352a16971d54ec477 | 2696b09417f4038e1206334d47821807ba5d76f7 | /Simulator/src/main/java/simulator/coreelements/RunElementDataWithValue.java | 05e7d78a5c60387e1637efb4252cd1bd2d7bc8ce | [
"Apache-2.0",
"LGPL-3.0-only",
"LicenseRef-scancode-proprietary-license",
"BSD-3-Clause",
"CC-BY-4.0",
"CC0-1.0",
"CC-BY-3.0",
"CDDL-1.1",
"CC-BY-NC-4.0",
"LGPL-2.1-only",
"CC-BY-NC-SA-4.0",
"EPL-2.0",
"JSON",
"CDDL-1.0",
"MIT",
"LGPL-2.0-or-later",
"Zlib",
"MPL-2.0",
"Classpath-... | permissive | A-Herzog/Warteschlangensimulator | d62b39ae58006da5dff497cf993de40f35f0a79b | ea5f804f8d9425c30c0eb666bfee2c96f93e111a | refs/heads/master | 2023-09-01T08:50:54.103199 | 2023-08-31T23:56:23 | 2023-08-31T23:56:23 | 253,913,348 | 31 | 7 | Apache-2.0 | 2023-07-07T22:09:19 | 2020-04-07T21:13:47 | Java | ISO-8859-1 | Java | false | false | 1,064 | java | /**
* Copyright 2020 Alexander Herzog
*
* 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 simulator.coreelements;
/**
* Laufzeitdaten-Objekt, welches einen konkreten Wert für die Station besitzt
* (z.B. bei einem Zähler)
* @author Alexander Herzog
*/
public interface RunElementDataWithValue {
/**
* Liefert den Zählerwert
* @param fullValue Gesamtwert (<code>true</code>) oder Anteil (<code>false</code>; bei Zählergruppen)
* @return Wert des Zählers
*/
double getValue(final boolean fullValue);
}
| [
"alexander.herzog@gmx.de"
] | alexander.herzog@gmx.de |
dfc1e22672e0769d400569c33b4cbc090d4bb9ca | 2a3f19a4a2b91d9d715378aadb0b1557997ffafe | /sources/p041io/fabric/sdk/android/services/settings/PromptSettingsData.java | 6ff17454b70ae9e302d681a9ff2c1042c84bb101 | [] | no_license | amelieko/McDonalds-java | ce5062f863f7f1cbe2677938a67db940c379d0a9 | 2fe00d672caaa7b97c4ff3acdb0e1678669b0300 | refs/heads/master | 2022-01-09T22:10:40.360630 | 2019-04-21T14:47:20 | 2019-04-21T14:47:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package p041io.fabric.sdk.android.services.settings;
/* renamed from: io.fabric.sdk.android.services.settings.PromptSettingsData */
public class PromptSettingsData {
public final String alwaysSendButtonTitle;
public final String cancelButtonTitle;
public final String message;
public final String sendButtonTitle;
public final boolean showAlwaysSendButton;
public final boolean showCancelButton;
public final String title;
public PromptSettingsData(String title, String message, String sendButtonTitle, boolean showCancelButton, String cancelButtonTitle, boolean showAlwaysSendButton, String alwaysSendButtonTitle) {
this.title = title;
this.message = message;
this.sendButtonTitle = sendButtonTitle;
this.showCancelButton = showCancelButton;
this.cancelButtonTitle = cancelButtonTitle;
this.showAlwaysSendButton = showAlwaysSendButton;
this.alwaysSendButtonTitle = alwaysSendButtonTitle;
}
}
| [
"makfc1234@gmail.com"
] | makfc1234@gmail.com |
d40f92f84cdb352f900d2e88ddbf73f021a3a0d1 | 19137db5aaf3cefa4899f125aa626ddbd8736044 | /WEB-INF/src/com/yhaguy/gestion/compras/importacion/ImportacionFacturaDetalleDTO.java | e7888952ffae70162f982ebb23202a835bc248ba | [] | no_license | sraul/yhaguy-project | e10ebeabe52222b48cadfd39ca0dd935fa9f00ff | a41d140f0618725cf5e2780f02853d50bf7c4f16 | refs/heads/master | 2019-07-29T18:45:47.046457 | 2018-09-20T15:35:03 | 2018-09-20T15:35:03 | 34,340,587 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,154 | java | package com.yhaguy.gestion.compras.importacion;
import org.zkoss.bind.annotation.DependsOn;
import com.coreweb.dto.DTO;
import com.coreweb.util.MyPair;
import com.yhaguy.Configuracion;
import com.yhaguy.gestion.articulos.ArticuloDTO;
import com.yhaguy.util.Utiles;
@SuppressWarnings("serial")
public class ImportacionFacturaDetalleDTO extends DTO{
private double costoGs = 0;
private double costoDs = 0;
private double costoSinProrrateoGs = 0;
private double costoSinProrrateoDs = 0;
private String textoDescuento = "0";
private double descuentoGs = 0;
private double descuentoDs = 0;
private double importeGastoDescuentoGs = 0;
private double importeGastoDescuentoDs = 0;
private boolean gastoDescuento = false;
private boolean valorProrrateo = false;
private MyPair tipoGastoDescuento = new MyPair();
private int cantidad = 0;
private int cantidadRecibida = 0;
private double precioFinalGs = 0;
private double minoristaGs = 0;
private double listaGs = 0;
private ArticuloDTO articulo = new ArticuloDTO();
@DependsOn({"articulo", "gastoDescuento"})
public String getDescripcion(){
if (this.isGastoDescuento() == true) {
return this.tipoGastoDescuento.getText();
}
return this.articulo.getDescripcion();
}
@DependsOn({"costoGs", "cantidad", "descuentoGs", "gastoDescuento", "importeGastoDescuentoGs"})
public double getImporteGsCalculado(){
if (this.isGastoDescuento() == true) {
return importeGastoDescuentoGs;
} else {
double out = (costoGs * cantidad) - (descuentoGs * cantidad);
return this.getMisc().redondeoCuatroDecimales(out);
}
}
@DependsOn({"costoDs", "cantidad", "descuentoDs", "gastoDescuento", "importeGastoDescuentoDs"})
public double getImporteDsCalculado(){
if (this.isGastoDescuento() == true) {
return importeGastoDescuentoDs;
} else {
double out = (costoDs * cantidad) - (descuentoDs * cantidad);
return this.getMisc().redondeoCuatroDecimales(out);
}
}
@DependsOn({"costoSinProrrateoGs", "cantidad", "descuentoGs"})
public double getImporteSinProrrateoGs(){
double out = (costoSinProrrateoGs * cantidad) - (descuentoGs * cantidad);
return this.getMisc().redondeoCuatroDecimales(out);
}
@DependsOn({"costoSinProrrateoDs", "cantidad", "descuentoDs"})
public double getImporteSinProrrateoDs(){
double out = (costoSinProrrateoDs * cantidad) - (descuentoDs * cantidad);
return this.getMisc().redondeoCuatroDecimales(out);
}
@DependsOn({"gastoDescuento", "valorProrrateo", "importeGastoDescuentoDs"})
public String getStyleItem(){
if ((this.isGastoDescuento() == true) && (this.importeGastoDescuentoDs < 0)) {
return Configuracion.BACKGROUND_NARANJA;
} else if (this.isValorProrrateo() == true) {
return Configuracion.BACKGROUND_AMARILLO;
} else {
return "";
}
}
@DependsOn({"cantidad", "cantidadRecibida"})
public int getDiferenciaCantidad(){
return cantidadRecibida - cantidad;
}
@SuppressWarnings("static-access")
@DependsOn("diferenciaCantidad")
public String getStyle(){
int dif = this.getDiferenciaCantidad();
if (dif > 0) {
return this.getMisc().TEXTO_VERDE;
} else if( dif < 0){
return this.getMisc().TEXTO_ROJO;
} else {
return this.getMisc().TEXTO_NORMAL;
}
}
@DependsOn("articulo")
public boolean isReferencia(){
return this.getArticulo().getCodigoInterno().trim().startsWith("@");
}
/**
* @return el margen..
*/
public double getMargen(double tipoCambio, double coeficiente) {
double costoGs = this.costoDs * tipoCambio;
double incrementoGs = costoGs * coeficiente;
double costoFinalGs = costoGs + incrementoGs;
return Utiles.obtenerPorcentajeDelValor((this.precioFinalGs - costoFinalGs), costoFinalGs);
}
public double getCostoGs() {
return costoGs;
}
public void setCostoGs(double costoGs) {
this.costoGs = this.getMisc().redondeoCuatroDecimales(costoGs);
}
public double getCostoDs() {
return costoDs;
}
public void setCostoDs(double costoDs) {
this.costoDs = this.getMisc().redondeoCuatroDecimales(costoDs);
}
public String getTextoDescuento() {
return textoDescuento;
}
public void setTextoDescuento(String textoDescuento) {
this.textoDescuento = textoDescuento;
}
public double getDescuentoGs() {
return descuentoGs;
}
public void setDescuentoGs(double descuentoGs) {
this.descuentoGs = this.getMisc().redondeoCuatroDecimales(descuentoGs);
}
public double getDescuentoDs() {
return descuentoDs;
}
public void setDescuentoDs(double descuentoDs) {
this.descuentoDs = this.getMisc().redondeoCuatroDecimales(descuentoDs);
}
public double getImporteGastoDescuentoGs() {
return importeGastoDescuentoGs;
}
public void setImporteGastoDescuentoGs(double importeGastoDescuentoGs) {
this.importeGastoDescuentoGs = this.getMisc().redondeoCuatroDecimales(importeGastoDescuentoGs);
}
public double getImporteGastoDescuentoDs() {
return importeGastoDescuentoDs;
}
public void setImporteGastoDescuentoDs(double importeGastoDescuentoDs) {
this.importeGastoDescuentoDs = this.getMisc().redondeoCuatroDecimales(importeGastoDescuentoDs);
}
public boolean isGastoDescuento() {
return gastoDescuento;
}
public void setGastoDescuento(boolean gastoDescuento) {
this.gastoDescuento = gastoDescuento;
}
public MyPair getTipoGastoDescuento() {
return tipoGastoDescuento;
}
public void setTipoGastoDescuento(MyPair tipoGastoDescuento) {
this.tipoGastoDescuento = tipoGastoDescuento;
}
public int getCantidad() {
return cantidad;
}
public void setCantidad(int cantidad) {
this.cantidad = cantidad;
}
public int getCantidadRecibida() {
return cantidadRecibida;
}
public void setCantidadRecibida(int cantidadRecibida) {
this.cantidadRecibida = cantidadRecibida;
}
public ArticuloDTO getArticulo() {
return articulo;
}
public void setArticulo(ArticuloDTO articulo) {
this.articulo = articulo;
}
public boolean isValorProrrateo() {
return valorProrrateo;
}
public void setValorProrrateo(boolean valorProrrateo) {
this.valorProrrateo = valorProrrateo;
}
public double getCostoSinProrrateoGs() {
return costoSinProrrateoGs;
}
public void setCostoSinProrrateoGs(double costoSinProrrateoGs) {
this.costoSinProrrateoGs = costoSinProrrateoGs;
}
public double getCostoSinProrrateoDs() {
return costoSinProrrateoDs;
}
public void setCostoSinProrrateoDs(double costoSinProrrateoDs) {
this.costoSinProrrateoDs = costoSinProrrateoDs;
}
public double getPrecioFinalGs() {
return precioFinalGs;
}
public void setPrecioFinalGs(double precioFinalGs) {
this.precioFinalGs = precioFinalGs;
}
public double getMinoristaGs() {
return minoristaGs;
}
public void setMinoristaGs(double minoristaGs) {
this.minoristaGs = minoristaGs;
}
public double getListaGs() {
return listaGs;
}
public void setListaGs(double listaGs) {
this.listaGs = listaGs;
}
}
| [
"sraul@users.noreply.github.com"
] | sraul@users.noreply.github.com |
f64300ff467250438a160b61f97129696cb041fb | f33208772ab7bf1754212b060b72f698b35fcbe5 | /InterviewPuzzles/src/puzzles/cracking/chapter4/ListOfDepths.java | 545e0da8662779f3de9edeb547fc2bc23fdcab56 | [] | no_license | sabotuer99/InterviewPuzzles | 0bddae37735bb451612a42e3b5ce309c989d018f | ccef0549dbc02ffad1ba29aba003ddd9ec35f79f | refs/heads/master | 2020-06-28T16:53:41.645503 | 2017-01-17T22:46:27 | 2017-01-17T22:46:27 | 74,487,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,000 | java | package puzzles.cracking.chapter4;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ListOfDepths {
public static Map<Integer, List<TreeNode>> getDepths(TreeNode root) {
if(root == null){
return null;
}
Map<Integer, List<TreeNode>> listOfDepths = new HashMap<>();
Deque<TreeNode> q = new ArrayDeque<>();
Deque<Integer> depths = new ArrayDeque<>();
TreeNode current = root;
q.offer(root);
depths.offer(1);
while(q.size() > 0){
current = q.poll();
int curDepth = depths.poll();
if(current.left != null){
q.offer(current.left);
depths.offer(curDepth + 1);
}
if(current.right != null){
q.offer(current.right);
depths.offer(curDepth + 1);
}
if(!listOfDepths.containsKey(curDepth)){
listOfDepths.put(curDepth, new ArrayList<TreeNode>());
}
listOfDepths.get(curDepth).add(current);
}
return listOfDepths;
}
}
| [
"sabotuer99@gmail.com"
] | sabotuer99@gmail.com |
74fff0d2839bb1fc36a09eb0dcdd3422964a7330 | a4a51084cfb715c7076c810520542af38a854868 | /src/main/java/com/shopee/app/d/b/a/a/a/f.java | c28a2c038a65bb3ca6358183fd196988b191d6d7 | [] | no_license | BharathPalanivelu/repotest | ddaf56a94eb52867408e0e769f35bef2d815da72 | f78ae38738d2ba6c9b9b4049f3092188fabb5b59 | refs/heads/master | 2020-09-30T18:55:04.802341 | 2019-12-02T10:52:08 | 2019-12-02T10:52:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,432 | java | package com.shopee.app.d.b.a.a.a;
import android.view.View;
import com.shopee.app.d.b.a.a;
import com.shopee.app.data.viewmodel.OrderDetail;
import com.shopee.id.R;
public class f extends a {
/* renamed from: c reason: collision with root package name */
OrderDetail f16000c;
public f(OrderDetail orderDetail) {
super(orderDetail);
this.f16000c = orderDetail;
}
public long a() {
return this.f16000c.getOrderId();
}
public String b() {
return a((int) R.string.action_buyer_cancelled_by_system_underpaid_summary_text);
}
public a.C0251a d() {
return new a.C0251a(a((int) R.string.sp_check_details), 0, new View.OnClickListener() {
public void onClick(View view) {
f.this.f15981b.a("ORDER_GOTO_CANCEL_DETAIL", new com.garena.android.appkit.b.a(f.this.f16000c));
}
});
}
public a.C0251a i() {
return new a.C0251a(a((int) R.string.sp_label_buy_again), 0, new View.OnClickListener() {
public void onClick(View view) {
f.this.f15981b.a("ORDER_CANCELLED_BUY", new com.garena.android.appkit.b.a(f.this.f16000c));
}
});
}
public String j() {
return a((int) R.string.sp_label_order_status_canceled);
}
public String k() {
return a((int) R.string.action_buyer_cancelled_by_system_underpaid_detail_text);
}
}
| [
"noiz354@gmail.com"
] | noiz354@gmail.com |
004afd779ebda78e8dab31505a9d297255a026eb | 80c66c984ce60bc7d17e02d04507b87b2cc684ff | /net/minecraft/inventory/ContainerHorseInventory.java | 550f899fe93227a545583dac6071f23c32aefdf9 | [
"WTFPL"
] | permissive | MinecraftModdedClients/Resilience-Client-Source | 26d9ed318a41797660e05ed89df24d37fd48482e | 4a3b2bd906f17b99be9e5eceaf9d6fcfc1470c01 | refs/heads/master | 2022-12-31T23:28:15.559468 | 2020-10-02T12:01:18 | 2020-10-02T12:01:18 | 39,420,083 | 111 | 45 | WTFPL | 2020-10-02T12:01:19 | 2015-07-21T02:41:38 | Java | UTF-8 | Java | false | false | 4,525 | java | package net.minecraft.inventory;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class ContainerHorseInventory extends Container
{
private IInventory field_111243_a;
private EntityHorse theHorse;
private static final String __OBFID = "CL_00001751";
public ContainerHorseInventory(IInventory par1IInventory, final IInventory par2IInventory, final EntityHorse par3EntityHorse)
{
this.field_111243_a = par2IInventory;
this.theHorse = par3EntityHorse;
byte var4 = 3;
par2IInventory.openInventory();
int var5 = (var4 - 4) * 18;
this.addSlotToContainer(new Slot(par2IInventory, 0, 8, 18)
{
private static final String __OBFID = "CL_00001752";
public boolean isItemValid(ItemStack par1ItemStack)
{
return super.isItemValid(par1ItemStack) && par1ItemStack.getItem() == Items.saddle && !this.getHasStack();
}
});
this.addSlotToContainer(new Slot(par2IInventory, 1, 8, 36)
{
private static final String __OBFID = "CL_00001753";
public boolean isItemValid(ItemStack par1ItemStack)
{
return super.isItemValid(par1ItemStack) && par3EntityHorse.func_110259_cr() && EntityHorse.func_146085_a(par1ItemStack.getItem());
}
public boolean func_111238_b()
{
return par3EntityHorse.func_110259_cr();
}
});
int var6;
int var7;
if (par3EntityHorse.isChested())
{
for (var6 = 0; var6 < var4; ++var6)
{
for (var7 = 0; var7 < 5; ++var7)
{
this.addSlotToContainer(new Slot(par2IInventory, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18));
}
}
}
for (var6 = 0; var6 < 3; ++var6)
{
for (var7 = 0; var7 < 9; ++var7)
{
this.addSlotToContainer(new Slot(par1IInventory, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5));
}
}
for (var6 = 0; var6 < 9; ++var6)
{
this.addSlotToContainer(new Slot(par1IInventory, var6, 8 + var6 * 18, 160 + var5));
}
}
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
{
return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F;
}
/**
* Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
*/
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot)this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 < this.field_111243_a.getSizeInventory())
{
if (!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true))
{
return null;
}
}
else if (this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack())
{
if (!this.mergeItemStack(var5, 1, 2, false))
{
return null;
}
}
else if (this.getSlot(0).isItemValid(var5))
{
if (!this.mergeItemStack(var5, 0, 1, false))
{
return null;
}
}
else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false))
{
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack)null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
/**
* Called when the container is closed.
*/
public void onContainerClosed(EntityPlayer par1EntityPlayer)
{
super.onContainerClosed(par1EntityPlayer);
this.field_111243_a.closeInventory();
}
}
| [
"admin@timo.de.vc"
] | admin@timo.de.vc |
73881be26395697432ccdf757a50482ec01759e8 | de2eff0e71efe69175d7e54889d84d449d6ed974 | /ext-api/src/main/java/org/omg/SecurityReplaceable/ClientSecurityContext.java | 87e11d15fae0b75d7b8e166b4d4010ada46ab2ae | [] | no_license | mmusgrov/corba | bb266f631ebdcbabb4719f7d70cb8c766609a3e5 | 03d993498b68d745018061b39196e7818e0fe64d | refs/heads/master | 2021-01-18T10:42:20.114343 | 2013-01-22T06:02:07 | 2013-01-22T06:02:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 392 | java | package org.omg.SecurityReplaceable;
/**
* Generated from IDL interface "ClientSecurityContext".
*
* @author JacORB IDL compiler V 2.3.1, 27-May-2009
* @version generated at 10/01/2013 11:46:17 AM
*/
public interface ClientSecurityContext
extends ClientSecurityContextOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, org.omg.SecurityReplaceable.SecurityContext
{
}
| [
"stuart.w.douglas@gmail.com"
] | stuart.w.douglas@gmail.com |
1ec71625456079a0c52a71076279d8ae61a2c1a8 | 63152c4f60c3be964e9f4e315ae50cb35a75c555 | /core/target/java/org/apache/spark/RangePartitioner$.java | 640fe875c3af94943c5790768a0c30f5cecff293 | [
"EPL-1.0",
"Classpath-exception-2.0",
"LicenseRef-scancode-unicode",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-free-unknown",
"GCC-exception-3.1",
"LGPL-2.0-or-later",
"CDDL-1.0",
"MIT",
"CC-BY-SA-3.0",
"NAIST-2003",
"LGPL-2.1-only",
"LicenseRef-scancode-other... | permissive | PowersYang/spark-cn | 76c407d774e35d18feb52297c68c65889a75a002 | 06a0459999131ee14864a69a15746c900e815a14 | refs/heads/master | 2022-12-11T20:18:37.376098 | 2020-03-30T09:48:22 | 2020-03-30T09:48:22 | 219,248,341 | 0 | 0 | Apache-2.0 | 2022-12-05T23:46:17 | 2019-11-03T03:55:17 | HTML | UTF-8 | Java | false | false | 1,605 | java | package org.apache.spark;
public class RangePartitioner$ implements scala.Serializable {
/**
* Static reference to the singleton instance of this Scala object.
*/
public static final RangePartitioner$ MODULE$ = null;
public RangePartitioner$ () { throw new RuntimeException(); }
/**
* Sketches the input RDD via reservoir sampling on each partition.
* <p>
* @param rdd the input RDD to sketch
* @param sampleSizePerPartition max sample size per partition
* @return (total number of items, an array of (partitionId, number of items, sample))
* @param evidence$5 (undocumented)
*/
public <K extends java.lang.Object> scala.Tuple2<java.lang.Object, scala.Tuple3<java.lang.Object, java.lang.Object, java.lang.Object>[]> sketch (org.apache.spark.rdd.RDD<K> rdd, int sampleSizePerPartition, scala.reflect.ClassTag<K> evidence$5) { throw new RuntimeException(); }
/**
* Determines the bounds for range partitioning from candidates with weights indicating how many
* items each represents. Usually this is 1 over the probability used to sample this candidate.
* <p>
* @param candidates unordered candidates with weights
* @param partitions number of partitions
* @return selected bounds
* @param evidence$6 (undocumented)
* @param evidence$7 (undocumented)
*/
public <K extends java.lang.Object> java.lang.Object determineBounds (scala.collection.mutable.ArrayBuffer<scala.Tuple2<K, java.lang.Object>> candidates, int partitions, scala.math.Ordering<K> evidence$6, scala.reflect.ClassTag<K> evidence$7) { throw new RuntimeException(); }
}
| [
"577790911@qq.com"
] | 577790911@qq.com |
6c83e8286a24dadec0c9de0eeae65c679ca3dd34 | 4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849 | /aliyun-java-sdk-workbench-ide/src/main/java/com/aliyuncs/workbench_ide/model/v20210121/RemoveOrgMemberRequest.java | f16b007fcb4c94c53e294fb234599d007efd49ea | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-java-sdk | a263fa08e261f12d45586d1b3ad8a6609bba0e91 | e19239808ad2298d32dda77db29a6d809e4f7add | refs/heads/master | 2023-09-03T12:28:09.765286 | 2023-09-01T09:03:00 | 2023-09-01T09:03:00 | 39,555,898 | 1,542 | 1,317 | NOASSERTION | 2023-09-14T07:27:05 | 2015-07-23T08:41:13 | Java | UTF-8 | Java | false | false | 1,791 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.workbench_ide.model.v20210121;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
/**
* @author auto create
* @version
*/
public class RemoveOrgMemberRequest extends RpcAcsRequest<RemoveOrgMemberResponse> {
private String uid;
private String currentOrgId;
private String memberId;
public RemoveOrgMemberRequest() {
super("Workbench-ide", "2021-01-21", "RemoveOrgMember");
setMethod(MethodType.POST);
}
public String getUid() {
return this.uid;
}
public void setUid(String uid) {
this.uid = uid;
if(uid != null){
putQueryParameter("Uid", uid);
}
}
public String getCurrentOrgId() {
return this.currentOrgId;
}
public void setCurrentOrgId(String currentOrgId) {
this.currentOrgId = currentOrgId;
if(currentOrgId != null){
putQueryParameter("CurrentOrgId", currentOrgId);
}
}
public String getMemberId() {
return this.memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
if(memberId != null){
putQueryParameter("MemberId", memberId);
}
}
@Override
public Class<RemoveOrgMemberResponse> getResponseClass() {
return RemoveOrgMemberResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
a5c56f20437c7430ac4201b41e54fd1059d66748 | ccfe7fc17d6823d1a39b59f9fc2937b2d80baa5e | /src/TimerController.java | 7d1b3b3f6eca5f928047edad828c42c725bf999a | [] | no_license | almcken/TheTimer | 6bc3f5d2d3e5475ec424cd0e439ab3921adcdcbc | 9da058c099e86c347e95527917e75ec9fff03fa7 | refs/heads/master | 2021-04-26T16:43:44.251383 | 2015-10-24T03:11:40 | 2015-10-24T03:11:40 | 44,850,124 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,960 | java | import java.awt.Component;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
* This class allows the user to control a Timer via buttons
* @author Alex
*
*/
public class TimerController {
private final Timer m_timer;
private final JPanel m_panel;
private JTextField m_time;
private JButton start;
private JButton stop;
private JButton restart;
public TimerController(Timer timer) {
m_timer = timer;
m_panel = new JPanel(new GridBagLayout());
setDisplay();
}
public void setText(String time) {
m_time.setText(time);
}
private void setDisplay() {
GridBagConstraints c = new GridBagConstraints();
m_time = new JTextField();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
m_panel.add(m_time, c);
start = new JButton("START");
start.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_timer.start();
}
});
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 1;
m_panel.add(start, c);
stop = new JButton("STOP");
stop.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_timer.stop();
}
});
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 2;
m_panel.add(stop, c);
restart = new JButton("RESTART");
restart.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_timer.restart(false);
}
});
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 3;
m_panel.add(restart, c);
}
public Component getComponent() {
return m_panel;
}
}
| [
"Alex@Alex-PC"
] | Alex@Alex-PC |
260d0ad404b05b46f0935b77e7162ccfcbaa778e | bed6ca18792e853ed3575105da33cd1da268d603 | /src/excersizes/First2array.java | e535de92a8e90c3db4b89e25c46052eb66165c08 | [] | no_license | NickOwhadi/java-practice | 66030f9af31b48784e189fdc7350ebdafc685346 | 54b227eacd11386030685a177e470e51d3a0dd4d | refs/heads/master | 2020-05-18T06:56:12.693994 | 2019-05-29T22:22:48 | 2019-05-29T22:22:48 | 184,247,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package excersizes;
import java.util.*;
public class First2array {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int size = scan.nextInt();
int[] num = new int[size];
for(int i =0; i < size; i++) {
num[i] = scan.nextInt();
}
//WRITE YOUR CODE HERE
int [] arr= new int[2];
if (size>2){
for(int i=0; i<2; i++){
arr[i]=num[i];
}
}else {
arr=num;
}
System.out.println(Arrays.toString(arr));
}
}
| [
"n7owhad@hotmail.com"
] | n7owhad@hotmail.com |
721f424639a4884c46c93c249bed196aed55f3ef | a14deb218f7e90e16e9fdcfe7723b924a7851f2b | /src/main/java/net/sourceforge/plantuml/sequencediagram/graphic/GraphicalReference.java | 77b5218d79150f8fa327c72b60b3703eb4df2408 | [
"Apache-2.0"
] | permissive | btomala/sbt-plantuml-plugin | aac0dc27b5597452cc8dd5c3cd2576c8565cfc28 | 7b710ebbd9da6c9b5e95c66c592cf9a021f42987 | refs/heads/master | 2021-01-16T18:57:14.036051 | 2016-02-26T14:45:05 | 2016-02-26T14:45:05 | 67,075,540 | 0 | 0 | null | 2016-09-07T18:27:29 | 2016-08-31T21:42:49 | Java | UTF-8 | Java | false | false | 3,636 | java | /* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2014, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* This file is part of PlantUML.
*
* 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.
*
*
* Original Author: Arnaud Roques
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class GraphicalReference extends GraphicalElement implements InGroupable {
private final Component comp;
private final LivingParticipantBox livingParticipantBox1;
private final LivingParticipantBox livingParticipantBox2;
private final Url url;
public GraphicalReference(double startingY, Component comp, LivingParticipantBox livingParticipantBox1,
LivingParticipantBox livingParticipantBox2, Url url) {
super(startingY);
if (livingParticipantBox1 == null || livingParticipantBox2 == null) {
throw new IllegalArgumentException();
}
this.url = url;
this.comp = comp;
this.livingParticipantBox1 = livingParticipantBox1;
this.livingParticipantBox2 = livingParticipantBox2;
}
@Override
protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
final StringBounder stringBounder = ug.getStringBounder();
final double posX = getMinX(stringBounder);
ug = ug.apply(new UTranslate(posX, getStartingY()));
final double preferredWidth = comp.getPreferredWidth(stringBounder);
final double w = getMaxX(stringBounder) - getMinX(stringBounder);
final double width = Math.max(preferredWidth, w);
final Dimension2D dim = new Dimension2DDouble(width, comp.getPreferredHeight(stringBounder));
if (url != null) {
ug.startUrl(url);
}
comp.drawU(ug, new Area(dim), context);
if (url != null) {
ug.closeAction();
}
}
@Override
public double getPreferredHeight(StringBounder stringBounder) {
return comp.getPreferredHeight(stringBounder);
}
@Override
public double getPreferredWidth(StringBounder stringBounder) {
return comp.getPreferredWidth(stringBounder);
}
@Override
public double getStartingX(StringBounder stringBounder) {
return getMinX(stringBounder);
}
public double getMaxX(StringBounder stringBounder) {
return Math.max(livingParticipantBox1.getMaxX(stringBounder), livingParticipantBox2.getMaxX(stringBounder));
}
public double getMinX(StringBounder stringBounder) {
return Math.min(livingParticipantBox1.getMinX(stringBounder), livingParticipantBox2.getMinX(stringBounder));
}
public String toString(StringBounder stringBounder) {
return toString();
}
}
| [
"adam@ashannon.us"
] | adam@ashannon.us |
53e02619700a5c41d1c0435aa42d32917981f232 | 24d8cf871b092b2d60fc85d5320e1bc761a7cbe2 | /JFreeChart/rev91-2020/right-trunk-1969/tests/org/jfree/data/xy/junit/XYIntervalTests.java | 663e9602ff710716bd27235827741d1e326b4347 | [] | no_license | joliebig/featurehouse_fstmerge_examples | af1b963537839d13e834f829cf51f8ad5e6ffe76 | 1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad | refs/heads/master | 2016-09-05T10:24:50.974902 | 2013-03-28T16:28:47 | 2013-03-28T16:28:47 | 9,080,611 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,515 | java |
package org.jfree.data.xy.junit;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInput;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jfree.data.xy.XYInterval;
public class XYIntervalTests extends TestCase {
public static Test suite() {
return new TestSuite(XYIntervalTests.class);
}
public XYIntervalTests(String name) {
super(name);
}
public void testEquals() {
XYInterval i1 = new XYInterval(1.0, 2.0, 3.0, 2.5, 3.5);
XYInterval i2 = new XYInterval(1.0, 2.0, 3.0, 2.5, 3.5);
assertEquals(i1, i2);
i1 = new XYInterval(1.1, 2.0, 3.0, 2.5, 3.5);
assertFalse(i1.equals(i2));
i2 = new XYInterval(1.1, 2.0, 3.0, 2.5, 3.5);
assertTrue(i1.equals(i2));
i1 = new XYInterval(1.1, 2.2, 3.0, 2.5, 3.5);
assertFalse(i1.equals(i2));
i2 = new XYInterval(1.1, 2.2, 3.0, 2.5, 3.5);
assertTrue(i1.equals(i2));
i1 = new XYInterval(1.1, 2.2, 3.3, 2.5, 3.5);
assertFalse(i1.equals(i2));
i2 = new XYInterval(1.1, 2.2, 3.3, 2.5, 3.5);
assertTrue(i1.equals(i2));
i1 = new XYInterval(1.1, 2.2, 3.3, 2.6, 3.5);
assertFalse(i1.equals(i2));
i2 = new XYInterval(1.1, 2.2, 3.3, 2.6, 3.5);
assertTrue(i1.equals(i2));
i1 = new XYInterval(1.1, 2.2, 3.3, 2.6, 3.6);
assertFalse(i1.equals(i2));
i2 = new XYInterval(1.1, 2.2, 3.3, 2.6, 3.6);
assertTrue(i1.equals(i2));
}
public void testCloning() {
XYInterval i1 = new XYInterval(1.0, 2.0, 3.0, 2.5, 3.5);
assertFalse(i1 instanceof Cloneable);
}
public void testSerialization() {
XYInterval i1 = new XYInterval(1.0, 2.0, 3.0, 2.5, 3.5);
XYInterval i2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(i1);
out.close();
ObjectInput in = new ObjectInputStream(
new ByteArrayInputStream(buffer.toByteArray()));
i2 = (XYInterval) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
assertEquals(i1, i2);
}
}
| [
"joliebig@fim.uni-passau.de"
] | joliebig@fim.uni-passau.de |
261c8f8bc5c359c09f8e69552f6c37fb3dba869c | a2440dbe95b034784aa940ddc0ee0faae7869e76 | /modules/lwjgl/llvm/src/generated/java/org/lwjgl/llvm/LLVMSymbolLookupCallbackI.java | 519a7404de53205093d3ccbcfbb220dc5d5f572b | [
"Apache-2.0",
"LLVM-exception",
"NCSA",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LWJGL/lwjgl3 | 8972338303520c5880d4a705ddeef60472a3d8e5 | 67b64ad33bdeece7c09b0f533effffb278c3ecf7 | refs/heads/master | 2023-08-26T16:21:38.090410 | 2023-08-26T16:05:52 | 2023-08-26T16:05:52 | 7,296,244 | 4,835 | 1,004 | BSD-3-Clause | 2023-09-10T12:03:24 | 2012-12-23T15:40:04 | Java | UTF-8 | Java | false | false | 2,828 | java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.llvm;
import org.lwjgl.system.*;
import org.lwjgl.system.libffi.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.libffi.LibFFI.*;
/**
* Instances of this interface may be passed to the {@link LLVMDisassembler#LLVMCreateDisasm CreateDisasm}, {@link LLVMDisassembler#LLVMCreateDisasmCPU CreateDisasmCPU} and {@link LLVMDisassembler#LLVMCreateDisasmCPUFeatures CreateDisasmCPUFeatures} methods.
*
* <h3>Type</h3>
*
* <pre><code>
* char const * (*{@link #invoke}) (
* void *DisInfo,
* uint64_t ReferenceValue,
* uint64_t *ReferenceType,
* uint64_t ReferencePC,
* char const **ReferenceName
* )</code></pre>
*/
@FunctionalInterface
@NativeType("char const * (*) (void *, uint64_t, uint64_t *, uint64_t, char const **)")
public interface LLVMSymbolLookupCallbackI extends CallbackI {
FFICIF CIF = apiCreateCIF(
FFI_DEFAULT_ABI,
ffi_type_pointer,
ffi_type_pointer, ffi_type_uint64, ffi_type_pointer, ffi_type_uint64, ffi_type_pointer
);
@Override
default FFICIF getCallInterface() { return CIF; }
@Override
default void callback(long ret, long args) {
long __result = invoke(
memGetAddress(memGetAddress(args)),
memGetLong(memGetAddress(args + POINTER_SIZE)),
memGetAddress(memGetAddress(args + 2 * POINTER_SIZE)),
memGetLong(memGetAddress(args + 3 * POINTER_SIZE)),
memGetAddress(memGetAddress(args + 4 * POINTER_SIZE))
);
apiClosureRetP(ret, __result);
}
/**
* The type for the symbol lookup function.
*
* <p>This may be called by the disassembler for things like adding a comment for a PC plus a constant offset load instruction to use a symbol name instead
* of a load address value. It is passed the block information is saved when the disassembler context is created and the {@code ReferenceValue} to look up
* as a symbol. If no symbol is found for the {@code ReferenceValue} {@code NULL} is returned. The {@code ReferenceType} of the instruction is passed indirectly
* as is the {@code PC} of the instruction in {@code ReferencePC}. If the output reference can be determined its type is returned indirectly in
* {@code ReferenceType} along with {@code ReferenceName} if any, or that is set to {@code NULL}.</p>
*/
@NativeType("char const *") long invoke(@NativeType("void *") long DisInfo, @NativeType("uint64_t") long ReferenceValue, @NativeType("uint64_t *") long ReferenceType, @NativeType("uint64_t") long ReferencePC, @NativeType("char const **") long ReferenceName);
} | [
"iotsakp@gmail.com"
] | iotsakp@gmail.com |
c6c26b50eee90d8d6c1712afdb744e11c308d34f | 8bba923942604359185cfceffc680b006efb9306 | /DatabasesFrameworksHibernate/HibernateCodeFirstAllExercises/GringottsSalesAndHotel/src/main/java/c_Hotel/entities/Employee.java | c919beb5ef888909b843ae90034938ba319c88c6 | [] | no_license | KaPrimov/JavaCoursesSoftUni | d8a48ab30421d7a847f35d970535ddc3da595597 | 9676ec4c9bc1ece13d64880ff47a3728227bf4c9 | refs/heads/master | 2022-12-04T13:27:47.249203 | 2022-07-14T14:44:10 | 2022-07-14T14:44:10 | 97,306,295 | 1 | 2 | null | 2022-11-24T09:28:28 | 2017-07-15T09:39:47 | Java | UTF-8 | Java | false | false | 1,076 | java | package c_Hotel.entities;
import javax.persistence.*;
@Entity(name = "employees")
public class Employee {
private Long id;
private String firstName;
private String lastName;
private String title;
private String notes;
public Employee() {
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Column(columnDefinition = "TEXT")
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
}
| [
"k.primov92@gmail.com"
] | k.primov92@gmail.com |
95417ce8b23177372f1a6bec05b0fd6b75b4bb6c | c8800e493abfdd503807a889bdf259e00add6023 | /base-core/src/main/java/core/protocol/Protocol.java | a649fb8e9f17b67c58366b1b83f81b4938eed1e0 | [] | no_license | xuxueyang/game-java-card | 2b858ddcddc9bada7c263cc07c88ba945f930178 | fbf91884aabe0d62991a1596d84941f56e4dcbe5 | refs/heads/master | 2022-12-22T13:33:19.890601 | 2020-07-02T02:59:54 | 2020-07-02T02:59:54 | 197,751,204 | 0 | 0 | null | 2022-12-10T05:10:17 | 2019-07-19T10:11:14 | Java | UTF-8 | Java | false | false | 3,014 | java | package core.protocol;
public interface Protocol {
public static final String TOKEN = "TOKEN";
public static final String ACCESS_TOKEN = "access_token";
public static final String REFRESH_TOKEN = "refresh_token";
public static final String USERINFO = "userinfo";
//token超时时间
public static final Long TOKEN_VALID_TIME = 30*30*60L;
public static final Long Head_TIME = 60000L;//60s
//token超时时间
public static final Long REDIS_VAILD_TIME = TOKEN_VALID_TIME;
final class AreaL {
private static final Long TEXT = 1L;
public static Long[] getAllArea(){
return new Long[]{TEXT};
}
public static final String split = "-";
}
final class Area{
// public static Byte TEXT = 0x1;
public final static byte Sys = 0x1;
public final static byte Netty = 0x2;
}
final class Type{
public static final byte SYS = 0x1;
public static final byte LOGIN = 0x2;
public static final byte CHAT = 0x3;
public static final byte ITEM = 0x4;
public static final byte ROOM = 0x5;
public static final byte FILE = 0x6;
public static final byte MATCH = 0x7;
}
public final static class Status{
public static int YES =1;
public static int NOT =0;
}
interface HeadType
{
byte Login_Request = 1; //登陆请求
byte Login_Response = 2; //登录响应
byte Logout_Request =3 ;//退出请求
byte Logout_Response =3 ;
byte Keepalive_Request =3 ;//心跳请求ping;
byte Keepalive_Response =3 ;
byte Message_Request =3 ;//消息请求;
byte Message_Response =3 ;//消息回执;
byte Message_Notification =3 ;//通知消息
}
interface _Index {
int ConstatnProtocolIndex = 100;
int PvpTwoRoomIndex_CLIENT = 10000;
int PvpTwoRoomIndex_SERVER = 12000;
int AutoChessRoomIndex_CLIENT = 14000;
int AutoChessRoomIndex_SERVER = 16000;
int ChatIndex = 20000;
int CommonProtocolIndex_CLIENT = 40000;
int CommonProtocolIndex_SERVER = 50000;
int CommonProtocolIndex_ERROR = 60000;
}
interface ConstatnProtocol{
int Head = _Index.ConstatnProtocolIndex + 1;
int SUCCESS = _Index.ConstatnProtocolIndex + 2;
}
interface ChatIndex{
int WORLD = _Index.ChatIndex + 1;
int ONE = _Index.ChatIndex + 1;
}
/*登录信息*/
// LoginRequest对应的HeadType为Login_Request
// 消息名称去掉下划线,更加符合Java 的类名规范
// class LoginRequest{
// required String uid = 1; // 用户唯一id
// required string deviceId = 2; // 设备ID
// required string token = 3; // 用户token
// optional uint32 platform = 4; //客户端平台 windows、mac、android、ios、web
// optional string app_version = 5; // APP版本号
// }
}
| [
"xuxy@fengyuntec.com"
] | xuxy@fengyuntec.com |
ef88e90b1908e11321d43a19b8870d8f4a2f4338 | ac392f1cadd4979813a810f87041efdae3ca4832 | /spring-batch-example/src/main/java/com/vther/spring/batch/ch08/ExistService.java | 30fe1e3eae60f361e7a31d492cb35b34043d72f8 | [] | no_license | vther/spring-batch | 234356b7823e89e4d13df0d34a61175547dd69b7 | 8ace01e90c82851c45e975aabfd924874090b86e | refs/heads/master | 2021-01-19T19:22:23.505823 | 2017-04-18T15:49:58 | 2017-04-18T15:49:58 | 88,414,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java |
package com.vther.spring.batch.ch08;
import org.springframework.batch.item.validator.ValidationException;
/**
*
*
* 2013-9-30下午11:04:52
*/
public class ExistService {
public CreditBill validate(CreditBill creditBill) throws ValidationException {
if(Double.compare(0, creditBill.getAmount()) >0) {
throw new ValidationException("Credit bill cannot be negative!");
}
return creditBill;
}
}
| [
"vther@qq.com"
] | vther@qq.com |
8d579f980bd09b56286579adc637d86aaceb55f1 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/14/org/apache/commons/math3/stat/descriptive/summary/Sum_Sum_57.java | 62fa7fb806ab5534954405ad65dc659020060613 | [] | 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 | 578 | java |
org apach common math3 stat descript summari
return sum valu
valu dataset return
valu
code nan code code nan code return
strong note implement strong
multipl thread access instanc concurr
thread invok code increment code
code clear code method extern
version
sum abstract storeless univari statist abstractstorelessunivariatestatist serializ
creat sum instanc
sum
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
7c3d3b695ef850f500226c4a952646c55134eb1f | 49d8d4bb1aab046452eb548e73ded43d6537191a | /forge/src/test_mod/java/info/u_team/u_team_test/init/TestTiers.java | 7bce11de5d16d2a95f2da2e81d9e6ae83a2cb279 | [
"Apache-2.0"
] | permissive | MC-U-Team/U-Team-Core | d06df440b6f65fd31beee0b264e9155ce873bc69 | 86148e8a1ca81b20e8d4a2a39def097bc3842252 | refs/heads/1.20.1 | 2023-08-08T00:15:11.731135 | 2023-08-03T23:05:35 | 2023-08-03T23:05:35 | 100,517,716 | 20 | 11 | Apache-2.0 | 2023-07-12T04:20:36 | 2017-08-16T17:58:58 | Java | UTF-8 | Java | false | false | 1,178 | java | package info.u_team.u_team_test.init;
import java.util.List;
import info.u_team.u_team_core.api.item.ExtendedTier;
import info.u_team.u_team_core.item.tier.UForgeExtendedTier;
import info.u_team.u_team_core.util.TagUtil;
import info.u_team.u_team_test.TestMod;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraftforge.common.TierSortingRegistry;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
public class TestTiers {
public static final ExtendedTier BASIC = new UForgeExtendedTier(new float[] { 8, 0, 4, 2, 6 }, new float[] { -3.1F, -1, -2, -2, 0 }, TagUtil.createBlockTag(TestMod.MODID, "needs_basic_tier"), 500, 10F, 8, 30, () -> Ingredient.of(Items.ZOMBIE_HEAD));
private static void setup(FMLCommonSetupEvent event) {
TierSortingRegistry.registerTier(BASIC, new ResourceLocation(TestMod.MODID, "basic_tier"), List.of(Tiers.NETHERITE), List.of());
}
public static void registerMod(IEventBus bus) {
bus.addListener(TestTiers::setup);
}
}
| [
"hycrafthd@live.de"
] | hycrafthd@live.de |
3f70ea3d998ff2fc6e6d8ddc1709e95cdfae6422 | f0a512e0dfabfe1df56072e5f5587c0b302dd687 | /src/main/java/com/uc/web/persistence/AppOptimizedMapper.java | 1c07ee15e0c1a845b16970b639fcdeb0263b7b65 | [] | no_license | guohong365/webapp2 | ccdaace4e4f60178564f177f5529e2d2f6da80bf | 3c8b04648365e52769551ba9a16e3c9c049be74a | refs/heads/master | 2021-01-20T09:42:32.219133 | 2018-05-24T15:46:26 | 2018-05-24T15:46:26 | 90,056,031 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java | package com.uc.web.persistence;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface AppOptimizedMapper extends Mapper {
Long selectCountOptimized(
@Param("queryForm")
Object qureForm
);
List<?> selectOptimized(
@Param("queryForm")
Object queryForm,
@Param("offset")
long offset,
@Param("count")
long count);
}
| [
"guohong365@263.net"
] | guohong365@263.net |
995093ab62797e115dcc763be7ffc15fd7d93414 | 070b9e745c5aad76fb310f5c9111ed77a1036291 | /Drona-Package/com/google/android/gms/package_8/mediation/customevent/CustomEventBanner.java | 66207cf70000aa7b31bfe54468af91cce0c855ec | [] | no_license | Drona-team/Drona | 0f057e62e7f77babf112311734ee98c5824f166c | e33a9d92011ef7790c7547cc5a5380083f0dbcd7 | refs/heads/master | 2022-11-18T06:38:57.404528 | 2020-07-18T09:35:57 | 2020-07-18T09:35:57 | 280,390,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 536 | java | package com.google.android.gms.package_8.mediation.customevent;
import android.content.Context;
import android.os.Bundle;
import com.google.android.gms.package_8.AdSize;
import com.google.android.gms.package_8.mediation.MediationAdRequest;
public abstract interface CustomEventBanner
extends CustomEvent
{
public abstract void requestBannerAd(Context paramContext, CustomEventBannerListener paramCustomEventBannerListener, String paramString, AdSize paramAdSize, MediationAdRequest paramMediationAdRequest, Bundle paramBundle);
}
| [
"samridh6759@gmail.com"
] | samridh6759@gmail.com |
26f5568e1d2ae8aa616f3b25e25f1f9322beccf8 | 5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab | /app/src/main/wechat6.5.3/com/tencent/mm/protocal/c/akx.java | 6edfcb64d416e83404bfde0851686135df0f68a5 | [] | no_license | newtonker/wechat6.5.3 | 8af53a870a752bb9e3c92ec92a63c1252cb81c10 | 637a69732afa3a936afc9f4679994b79a9222680 | refs/heads/master | 2020-04-16T03:32:32.230996 | 2017-06-15T09:54:10 | 2017-06-15T09:54:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,282 | java | package com.tencent.mm.protocal.c;
import a.a.a.b;
import a.a.a.c.a;
import java.util.LinkedList;
public final class akx extends aqx {
protected final int a(int i, Object... objArr) {
if (i == 0) {
a aVar = (a) objArr[0];
if (this.mQl == null) {
throw new b("Not all required fields were included: BaseResponse");
} else if (this.mQl == null) {
return 0;
} else {
aVar.dX(1, this.mQl.aHr());
this.mQl.a(aVar);
return 0;
}
} else if (i == 1) {
if (this.mQl != null) {
r0 = a.a.a.a.dU(1, this.mQl.aHr()) + 0;
} else {
r0 = 0;
}
return r0;
} else if (i == 2) {
a.a.a.a.a aVar2 = new a.a.a.a.a((byte[]) objArr[0], unknownTagHandler);
for (r0 = com.tencent.mm.ba.a.a(aVar2); r0 > 0; r0 = com.tencent.mm.ba.a.a(aVar2)) {
if (!super.a(aVar2, this, r0)) {
aVar2.bQL();
}
}
if (this.mQl != null) {
return 0;
}
throw new b("Not all required fields were included: BaseResponse");
} else if (i != 3) {
return -1;
} else {
a.a.a.a.a aVar3 = (a.a.a.a.a) objArr[0];
akx com_tencent_mm_protocal_c_akx = (akx) objArr[1];
int intValue = ((Integer) objArr[2]).intValue();
switch (intValue) {
case 1:
LinkedList zQ = aVar3.zQ(intValue);
int size = zQ.size();
for (intValue = 0; intValue < size; intValue++) {
byte[] bArr = (byte[]) zQ.get(intValue);
com.tencent.mm.ba.a eoVar = new eo();
a.a.a.a.a aVar4 = new a.a.a.a.a(bArr, unknownTagHandler);
for (boolean z = true; z; z = eoVar.a(aVar4, eoVar, com.tencent.mm.ba.a.a(aVar4))) {
}
com_tencent_mm_protocal_c_akx.mQl = eoVar;
}
return 0;
default:
return -1;
}
}
}
}
| [
"zhangxhbeta@gmail.com"
] | zhangxhbeta@gmail.com |
9834dcb77978cff320e851702b6c5cb16f36b940 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/google/android/exoplayer2/c/f/t.java | 72e204d9f3c7ad1cd2d1224d980724e029f1627b | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,616 | java | package com.google.android.exoplayer2.c.f;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.c.g;
import com.google.android.exoplayer2.c.m;
import com.google.android.exoplayer2.i.l;
import com.google.android.exoplayer2.i.s;
import com.tencent.matrix.trace.core.AppMethodBeat;
public final class t
implements q
{
private m aTw;
private s aYf;
private boolean bdq;
public final void a(s params, g paramg, v.d paramd)
{
AppMethodBeat.i(95163);
this.aYf = params;
paramd.rz();
this.aTw = paramg.dM(paramd.rA());
this.aTw.f(Format.k(paramd.rB(), "application/x-scte35"));
AppMethodBeat.o(95163);
}
public final void t(l paraml)
{
long l = -9223372036854775807L;
AppMethodBeat.i(95164);
if (!this.bdq)
{
if (this.aYf.tQ() == -9223372036854775807L)
{
AppMethodBeat.o(95164);
return;
}
this.aTw.f(Format.c("application/x-scte35", this.aYf.tQ()));
this.bdq = true;
}
int i = paraml.tB();
this.aTw.a(paraml, i);
paraml = this.aTw;
s locals = this.aYf;
if (locals.brL != -9223372036854775807L)
l = locals.brL;
while (true)
{
paraml.a(l, 1, i, 0, null);
AppMethodBeat.o(95164);
break;
if (locals.bbh != 9223372036854775807L)
l = locals.bbh;
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar
* Qualified Name: com.google.android.exoplayer2.c.f.t
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
06c8616618a66a97ec7e75019b9c99b5a127e924 | 835e64825c05e493bb2d3f4ffd2498747b2c2649 | /etl-web/src/main/java/xdata/etl/web/server/service/login/LoginService.java | 0a82fb9b3d81ddfa5b9136f17bd0bf88028609f8 | [] | no_license | wowcinder/canna | 9120419d44d8010740a57f4d8ff6a1ebc503838e | 61ac897a5812f2941c79d5c36776fd79859026b7 | refs/heads/master | 2021-01-02T09:38:07.170089 | 2013-10-15T13:39:28 | 2013-10-15T13:39:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | /*
* Copyright (C) 2013 BEIJING UNION VOOLE TECHNOLOGY CO., LTD
*/
package xdata.etl.web.server.service.login;
/**
* @author XuehuiHe
* @date 2013年8月13日
*/
public interface LoginService {
Integer login(String username, String password);
Boolean isLogin();
void logout();
}
| [
"xuehuihe.java@gmail.com"
] | xuehuihe.java@gmail.com |
08d15a881a7daf74f196e1ef34b9e9d2587f3a4d | e0c271f609dce516ee3d063c6d7472ea689442ff | /main_java/src/LKY/test/SwingTable04.java | baf1815960e9fa7724ebc296137e6edf9f35029b | [] | no_license | bym90/Java-Web | d99edb4b61b0daa94abc71f1fcc66e4c9328ce44 | 74cf88a9e78799b5b5f4191b0d58af28474a9d88 | refs/heads/master | 2021-01-12T16:14:26.007241 | 2016-10-26T01:40:01 | 2016-10-26T01:40:01 | 71,954,347 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 3,089 | java | package LKY.test;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.TableModel;
/*
* JTable은 마우스이벤트가 발생하므로 MouseListener를 등록해서 이벤트를 처리할 수 있음
*
* MouseListener(MouseAdapter)의 MouseClicked()메소드에서 getSelectedColumn()과
* getSelectedRow()메소드를 이용해서 어떤 컬럼과 행이 클릭되었는지를 알 수 있다
*
* 만약 선택된 셀이 없다면 getSelectedColumn()과 getSelectedRow()메소드들은
* -1을 리턴한다. 따라서 -1이 아닐 때 이벤트 처리 코드를 실행하면 된다.
*/
public class SwingTable04 extends JFrame{
JTable jtable;
JPanel jp;
JTextField txtName;
JTextField txtAge;
Object[][] rowData;
public SwingTable04() {
this.setTitle("Table");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//JScrollPane(Component view, int vsbPolicy, int hsbPolicy)
this.add(new JScrollPane(getJTable()), BorderLayout.CENTER);
this.add(new JScrollPane(getPSouth()), BorderLayout.SOUTH);
this.setSize(250, 280);
this.setVisible(true);
}
public JTable getJTable(){
if(jtable == null){
String[] columnNames = new String[]{"이름","나이"};
rowData = new Object[][]{{"이규영",28},{"이규영2",27},{"이규영3",26}};
jtable = new JTable(rowData,columnNames );
//이벤트 처리
jtable.addMouseListener(new MouseAdapter(){
public void mouseClicked(MouseEvent e){
int rowIndex = jtable.getSelectedRow(); //선택된 로우의 인덱스번호를 가져옴(선택안되면 -1상태)
if(rowIndex != -1){
TableModel tableModel = jtable.getModel();
//getValueAt(rowIndex(row인덱스값), 0(컬럼인덱스))컬럼인덱스와 로우인덱스에 해당하는 셀의 값을 꺼내옴
String name = (String)tableModel.getValueAt(rowIndex, 0);
Integer age = (Integer)tableModel.getValueAt(rowIndex, 1);
getTxtName().setText(name);
getTxtAge().setText(String.valueOf(age.intValue()));
}
}
});
}
return jtable;
}
public JPanel getPSouth(){
if(jp==null){
jp = new JPanel();
jp.setLayout(new GridLayout(4,2)); //세로 ,가로
jp.add(new JLabel("[선택한 행 정보]"));
jp.add(new JLabel(""));
jp.add(new JLabel("이름",JLabel.CENTER));
jp.add(getTxtName());
jp.add(new JLabel("나이",JLabel.CENTER));
jp.add(getTxtAge());
}
return jp;
}
public JTextField getTxtName(){
if(txtName == null){
txtName = new JTextField();
}
return txtName;
}
public JTextField getTxtAge(){
if(txtAge == null){
txtAge = new JTextField();
}
return txtAge;
}
public static void main(String[] args) {
new SwingTable04();
}
}
| [
"qodudals90@naver.com"
] | qodudals90@naver.com |
c49b4133bd3e0c2745e987df422d4ce0e547a000 | 47cb4bbdd38ad03ff93fe784a452bafd6bec48bd | /spring-data-rest-repository/src/test/java/org/springframework/data/rest/repository/domain/jpa/PersonRepository.java | 7733c07b14e608c5f1a817f6345170b17a6de2ae | [
"Apache-2.0"
] | permissive | jbrisbin/spring-data-rest | 295d2f4f429bc5dd934bebda944811a5c0cd61b0 | 054b9dc5c513eb68aa90777455c05efbb3e0c2c7 | refs/heads/master | 2021-01-17T00:26:55.633118 | 2013-01-18T16:16:56 | 2013-01-18T16:16:56 | 7,443,997 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,444 | java | package org.springframework.data.rest.repository.domain.jpa;
import java.util.Date;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.convert.ISO8601DateConverter;
import org.springframework.data.rest.repository.annotation.ConvertWith;
import org.springframework.data.rest.repository.annotation.RestResource;
/**
* A repository to manage {@link Person}s.
*
* @author Jon Brisbin
*/
@RestResource(rel = "people", path = "people")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
@RestResource(rel = "firstname", path = "firstname")
public Page<Person> findByFirstName(@Param("firstName") String firstName, Pageable pageable);
public Page<Person> findByCreatedGreaterThan(@Param("date") Date date, Pageable pageable);
@Query("select p from Person p where p.created > :date")
public Page<Person> findByCreatedUsingISO8601Date(@Param("date")
@ConvertWith(
ISO8601DateConverter.class)
Date date,
Pageable pageable);
}
| [
"jon@jbrisbin.com"
] | jon@jbrisbin.com |
9e5d1574f1e4b76d1f87c64e9d5f93ca7bdd0b24 | 177828e20974da78b118c4058c97cc6d3821e683 | /app/src/main/java/com/teamcomputers/bam/ExpandableRecyclerview/libmoduleExpandable/adapter/ExpandableRecyclerAdapterHelper.java | 9eb31a128da35b5e3c869ba2588a9d14df7a19fd | [] | no_license | coderhimanshu0007/BAM | 6d3618491ae8df05da4847103a5008e6802c312a | 0fcfb9ac6700f6cc0b1037daa1e2090fa461491a | refs/heads/master | 2022-12-06T19:44:11.456603 | 2020-08-20T10:12:58 | 2020-08-20T10:12:58 | 290,387,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,781 | java | package com.teamcomputers.bam.ExpandableRecyclerview.libmoduleExpandable.adapter;
import com.teamcomputers.bam.ExpandableRecyclerview.libmoduleExpandable.model.ParentListItem;
import com.teamcomputers.bam.ExpandableRecyclerview.libmoduleExpandable.model.ParentWrapper;
import java.util.ArrayList;
import java.util.List;
/**
* Helper for {@link ExpandableRecyclerAdapter}.
* <p>
* Created by Sarvesh on 2020/01/14 :)
*/
public class ExpandableRecyclerAdapterHelper {
/**
* Generates a full list of all {@link ParentListItem} objects and their
* children, in order.
*
* @param parentItemList A list of the {@code ParentListItem} objects from
* the {@link ExpandableRecyclerAdapter}
* @return A list of all {@code ParentListItem} objects and their children, expanded
*/
public static List<Object> generateParentChildItemList(List<? extends ParentListItem> parentItemList) {
List<Object> parentWrapperList = new ArrayList<>();
ParentListItem parentListItem;
ParentWrapper parentWrapper;
int parentListItemCount = parentItemList.size();
for (int i = 0; i < parentListItemCount; i++) {
parentListItem = parentItemList.get(i);
parentWrapper = new ParentWrapper(parentListItem);
parentWrapperList.add(parentWrapper);
if (parentWrapper.isInitiallyExpanded()) {
parentWrapper.setExpanded(true);
int childListItemCount = parentWrapper.getChildItemList().size();
for (int j = 0; j < childListItemCount; j++) {
parentWrapperList.add(parentWrapper.getChildItemList().get(j));
}
}
}
return parentWrapperList;
}
}
| [
"johndoe@example.com"
] | johndoe@example.com |
6471386a538ca53f0067cdf5d25923ba36736cb1 | 770c76a2180ee695bc02064d24d87f5c47c0fb79 | /factory-dz/src/main/java/com/lc/ibps/loans/baoZhengRen/persistence/dao/BZRXXBDao.java | a6cd498a3331af8959d1cc78c2813891df144e5e | [] | no_license | incidunt/qingjiao_dev | aff658944c0f89c822d547f5a2180649f48cbf00 | 385a69cddabc784e974f7d802807fc19101e83ee | refs/heads/master | 2020-09-23T17:05:12.859324 | 2018-12-18T08:26:04 | 2018-12-18T08:26:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 445 | java | package com.lc.ibps.loans.baoZhengRen.persistence.dao;
import com.lc.ibps.base.framework.persistence.dao.IDao;
import com.lc.ibps.loans.baoZhengRen.persistence.entity.BZRXXBPo;
/**
* t_bzrxxb Dao接口
*
*<pre>
* 开发公司:广州流辰信息技术有限公司
* 开发人员:litao
* 邮箱地址:1546077710@qq.com
* 创建时间:2017-07-24 03:01:17
*</pre>
*/
public interface BZRXXBDao extends IDao<String, BZRXXBPo> {
}
| [
"marco23037@163.com"
] | marco23037@163.com |
5399e80ba74895d310ac3cdd2ccb20d78f225fae | 2c55167b086b19933d5a28e03c9d210dc26caf4c | /commercetools-sdk-base/src/main/java/io/sphere/sdk/queries/DoubleQuerySortingModel.java | 14844f7aac01945b3f105b7fa0e1b7ec440117f1 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | commercetools/commercetools-jvm-sdk | 02a1b6162aff245dce35a2e17b41c5fc8481cf33 | 9268215185628611ad12502cb9c844e8b65c2944 | refs/heads/master | 2023-08-31T20:04:34.331396 | 2023-08-11T07:43:29 | 2023-08-11T07:43:29 | 20,855,247 | 46 | 50 | NOASSERTION | 2023-08-11T09:27:43 | 2014-06-15T12:46:24 | Java | UTF-8 | Java | false | false | 917 | java | package io.sphere.sdk.queries;
public interface DoubleQuerySortingModel<T> extends QueryModel<T>, QuerySortingModel<T>, OptionalQueryModel<T>, EqualityQueryModel<T, Double>, NotEqualQueryModel<T, Double>, IsInQueryModel<T, Double>, IsNotInQueryModel<T, Double>, InequalityQueryModel<T, Double> {
@Override
QueryPredicate<T> is(Double i);
@Override
QueryPredicate<T> isGreaterThan(Double value);
@Override
QueryPredicate<T> isGreaterThanOrEqualTo(Double value);
@Override
QueryPredicate<T> isLessThan(Double value);
@Override
QueryPredicate<T> isLessThanOrEqualTo(Double value);
@Override
QueryPredicate<T> isNot(Double i);
@Override
QueryPredicate<T> isNotIn(Iterable<Double> args);
@Override
QueryPredicate<T> isNotPresent();
@Override
QueryPredicate<T> isIn(Iterable<Double> args);
@Override
QueryPredicate<T> isPresent();
}
| [
"michael.schleichardt@commercetools.de"
] | michael.schleichardt@commercetools.de |
fdc6e9a8b95b06ebeeac5d4be801afc2556d337a | d4130f5d43ee38739d2595cda10714e68992af74 | /main/java/net/journey/client/render/model/mob/corba/ModelLeafBlower.java | 686b1d200fa814cfc02c13c2a8d6e49b8c10e8d2 | [] | no_license | Oshi41/Journey-Into-The-Light | a945f7dae9922d69ab2df647ebafaea699281370 | 931c7efed782a5b2e80406b5996ef81a8c8c9ddf | refs/heads/master | 2020-11-30T13:17:31.165992 | 2020-03-22T20:21:26 | 2020-03-22T20:21:26 | 230,402,251 | 0 | 0 | null | 2019-12-27T08:18:30 | 2019-12-27T08:18:29 | null | UTF-8 | Java | false | false | 3,475 | java | package net.journey.client.render.model.mob.corba;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
public class ModelLeafBlower extends ModelBase {
private ModelRenderer head;
private ModelRenderer body;
private ModelRenderer stick4;
private ModelRenderer stick3;
private ModelRenderer[] sticks = new ModelRenderer[4];
private ModelRenderer leaves;
public ModelLeafBlower() {
textureWidth = 64;
textureHeight = 64;
for(int i = 0; i < this.sticks.length; i++) {
this.sticks[i] = new ModelRenderer(this, 0, 16);
this.sticks[i].addBox(-2F, 0F, -2F, 2, 13, 2);
}
head = new ModelRenderer(this, 0, 0);
head.addBox(-4F, -8F, -4F, 8, 8, 8);
head.setRotationPoint(0F, 0F, -1F);
head.setTextureSize(64, 64);
setRotation(head, 0F, 0F, 0F);
body = new ModelRenderer(this, 16, 16);
body.addBox(-4F, 0F, -2F, 2, 8, 2);
body.setRotationPoint(3F, 0F, 0F);
body.setTextureSize(64, 64);
setRotation(body, 0F, 0F, 0F);
stick4 = new ModelRenderer(this, 32, 16);
stick4.addBox(-3F, -2F, -2F, 2, 24, 2);
stick4.setRotationPoint(-2F, 2F, 0F);
stick4.setTextureSize(64, 64);
setRotation(stick4, 0F, 0F, 0F);
stick3 = new ModelRenderer(this, 32, 16);
stick3.addBox(-1F, -2F, -2F, 2, 24, 2);
stick3.setRotationPoint(4F, 2F, 0F);
stick3.setTextureSize(64, 64);
setRotation(stick3, 0F, 0F, 0F);
leaves = new ModelRenderer(this, 0, 32);
leaves.addBox(-4F, 0F, -4F, 8, 10, 8);
leaves.setRotationPoint(0F, 0F, -1F);
leaves.setTextureSize(64, 64);
setRotation(leaves, 0F, 0F, 0F);
}
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
head.render(f5);
body.render(f5);
stick4.render(f5);
stick3.render(f5);
leaves.render(f5);
for(int i = 0; i < sticks.length; i++) this.sticks[i].render(f5);
}
@Override
public void setRotationAngles(float f, float f2, float f3, float f4, float f5, float f7, Entity e) {
this.stick3.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f2;
this.stick4.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f2;
float f6 = f3 * (float)Math.PI * -0.1F;
int i;
for(i = 0; i < 1; i++) {
this.sticks[i].rotationPointY = -5.0F + MathHelper.cos((i * 3 + f3) * 0.25F);
this.sticks[i].rotationPointX = MathHelper.cos(f6) * 15.0F;
this.sticks[i].rotationPointZ = MathHelper.sin(f6) * 15.0F;
f6++;
}
f6 = ((float)Math.PI / 4F) + f3 * (float)Math.PI * 0.03F;
for(i = 1; i < 2; i++) {
this.sticks[i].rotationPointY = 2.0F + MathHelper.cos((i * 2 + f3) * 0.25F);
this.sticks[i].rotationPointX = MathHelper.cos(f6) * 9.0F;
this.sticks[i].rotationPointZ = MathHelper.sin(f6) * 9.0F;
f6++;
}
f6 = 0.47123894F + f3 * (float)Math.PI * -0.05F;
for(i = 2; i < 4; i++) {
this.sticks[i].rotationPointY = 11.0F + MathHelper.cos((i * 1.5F + f3) * 0.5F);
this.sticks[i].rotationPointX = MathHelper.cos(f6) * 12.0F;
this.sticks[i].rotationPointZ = MathHelper.sin(f6) * 12.0F;
f6++;
}
}
} | [
"brock.kerley@hotmail.com"
] | brock.kerley@hotmail.com |
e74713bd131a9e85c30e2f275b123d2b83fd2096 | b40ff3afc5595aa1e807f312ec15e298ffc13bf2 | /Java OOP Advanced/Exam/RecyclingStation/src/main/java/wasteDisposal/contracts/Readable.java | 8ca23401e4976e3d8bf8c925bf325e4ee42b1a8f | [] | no_license | ViktorGorchev/Java-Fundamentals | 26815f2fe35346c6f7b2a0073b16ee514f87382b | c2e318cc472a999750a72adce4feeb6b9f2e8c80 | refs/heads/master | 2020-12-24T09:38:21.871947 | 2016-11-09T10:56:59 | 2016-11-09T10:56:59 | 73,275,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package wasteDisposal.contracts;
import java.io.IOException;
/**
* Interface that defines a way of rending the data input.
*/
public interface Readable {
/**
* A method for rending input data.
* @return input data in string format.
* @exception throws IOException;
*/
String read() throws IOException;
}
| [
"viktor_g_g@yahoo.com"
] | viktor_g_g@yahoo.com |
4eda09f2538b78255a1b8e9476663a1948f82a72 | 9259bb523e4f2085ca0ae3be84ff3ce861875b9a | /common/java/router/net/i2p/router/message/SendMessageDirectJob.java | 8880a778547efbeda2fac5be2c59468596b94306 | [
"Unlicense",
"LicenseRef-scancode-public-domain"
] | permissive | PDAHubbard/Nightweb | 8f607bd48cf72dd7221a3093fc10bac4b53fed88 | 7966ab2bcb87ea92abd6741f6184885afbad6fee | refs/heads/master | 2021-01-22T12:12:22.346366 | 2013-11-26T20:35:57 | 2013-11-26T20:35:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,199 | java | package net.i2p.router.message;
/*
* free (adj.): unencumbered; not under the control of others
* Written by jrandom in 2003 and released into the public domain
* with no warranty of any kind, either expressed or implied.
* It probably won't make your computer catch on fire, or eat
* your children, but it might. Use at your own risk.
*
*/
import java.util.Date;
import net.i2p.data.Hash;
import net.i2p.data.RouterInfo;
import net.i2p.data.i2np.I2NPMessage;
import net.i2p.router.Job;
import net.i2p.router.JobImpl;
import net.i2p.router.MessageSelector;
import net.i2p.router.OutNetMessage;
import net.i2p.router.ReplyJob;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
/**
* Send a message directly to another router, i.e. not through a tunnel.
* This is safe to run inline via runJob().
* If the RouterInfo for the Hash is not found locally, it will
* queue a lookup and register itself to be run again when the lookup
* succeeds or times out.
*/
public class SendMessageDirectJob extends JobImpl {
private final Log _log;
private final I2NPMessage _message;
private final Hash _targetHash;
private RouterInfo _router;
private final long _expiration;
private final int _priority;
private final Job _onSend;
private final ReplyJob _onSuccess;
private final Job _onFail;
private final MessageSelector _selector;
private boolean _alreadySearched;
private boolean _sent;
private long _searchOn;
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) {
this(ctx, message, toPeer, null, null, null, null, timeoutMs, priority);
}
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
this(ctx, message, toPeer, null, onSuccess, onFail, selector, timeoutMs, priority);
}
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
super(ctx);
_log = getContext().logManager().getLog(SendMessageDirectJob.class);
_message = message;
_targetHash = toPeer;
if (timeoutMs < 10*1000) {
if (_log.shouldLog(Log.WARN))
_log.warn("Very little time given [" + timeoutMs + "], resetting to 5s", new Exception("stingy bastard"));
_expiration = ctx.clock().now() + 10*1000;
} else {
_expiration = timeoutMs + ctx.clock().now();
}
_priority = priority;
_onSend = onSend;
_onSuccess = onSuccess;
_onFail = onFail;
_selector = selector;
if (message == null)
throw new IllegalArgumentException("Attempt to send a null message");
if (_targetHash == null)
throw new IllegalArgumentException("Attempt to send a message to a null peer");
}
public String getName() { return "Send Message Direct"; }
public void runJob() {
long now = getContext().clock().now();
if (_expiration < now) {
if (_log.shouldLog(Log.WARN))
_log.warn("Timed out sending message " + _message + " directly (expiration = "
+ new Date(_expiration) + ") to " + _targetHash.toBase64());
if (_onFail != null)
getContext().jobQueue().addJob(_onFail);
return;
}
if (_router != null) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Router specified, sending");
send();
} else {
_router = getContext().netDb().lookupRouterInfoLocally(_targetHash);
if (_router != null) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Router not specified but lookup found it");
send();
} else {
if (!_alreadySearched) {
if (_log.shouldLog(Log.DEBUG))
_log.debug("Router not specified, so we're looking for it...");
getContext().netDb().lookupRouterInfo(_targetHash, this, this,
_expiration - getContext().clock().now());
_searchOn = getContext().clock().now();
_alreadySearched = true;
} else {
if (_log.shouldLog(Log.WARN))
_log.warn("Unable to find the router to send to: " + _targetHash
+ " after searching for " + (getContext().clock().now()-_searchOn)
+ "ms, message: " + _message);
if (_onFail != null)
getContext().jobQueue().addJob(_onFail);
}
}
}
}
private void send() {
if (_sent) {
if (_log.shouldLog(Log.WARN))
_log.warn("Not resending!", new Exception("blah"));
return;
}
_sent = true;
Hash to = _router.getIdentity().getHash();
Hash us = getContext().routerHash();
if (us.equals(to)) {
if (_selector != null) {
OutNetMessage outM = new OutNetMessage(getContext());
outM.setExpiration(_expiration);
outM.setMessage(_message);
outM.setOnFailedReplyJob(_onFail);
outM.setOnFailedSendJob(_onFail);
outM.setOnReplyJob(_onSuccess);
outM.setOnSendJob(_onSend);
outM.setPriority(_priority);
outM.setReplySelector(_selector);
outM.setTarget(_router);
getContext().messageRegistry().registerPending(outM);
}
if (_onSend != null)
getContext().jobQueue().addJob(_onSend);
getContext().inNetMessagePool().add(_message, _router.getIdentity(), null);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Adding " + _message.getClass().getName()
+ " to inbound message pool as it was destined for ourselves");
//_log.debug("debug", _createdBy);
} else {
OutNetMessage msg = new OutNetMessage(getContext());
msg.setExpiration(_expiration);
msg.setMessage(_message);
msg.setOnFailedReplyJob(_onFail);
msg.setOnFailedSendJob(_onFail);
msg.setOnReplyJob(_onSuccess);
msg.setOnSendJob(_onSend);
msg.setPriority(_priority);
msg.setReplySelector(_selector);
msg.setTarget(_router);
getContext().outNetMessagePool().add(msg);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Adding " + _message.getClass().getName()
+ " to outbound message pool targeting "
+ _router.getIdentity().getHash().toBase64());
//_log.debug("Message pooled: " + _message);
}
}
}
| [
"zsoakes@gmail.com"
] | zsoakes@gmail.com |
1f783ee604719f358716015c7c96bb7d17bea48c | 20125f8d605a65f0efc2a617c0044ed00494e69f | /TRABAJOS/G_04_0840_Wong_Guerrero/ProyectoXML/src/pe/egcc/proyectoxml/service/service.java | da078dec55466661b57216ceb09b61a5dd25f048 | [] | no_license | gcoronelc/UCS_LENG_PROG_2017-0 | 550f37f02c1dc5bbcc59ebecb134ec81391809c0 | 7395f1d7ef4b49eb68076055dda6ac79e4e5cdf2 | refs/heads/master | 2021-01-12T02:02:35.863101 | 2017-03-02T02:37:29 | 2017-03-02T02:37:29 | 78,460,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,759 | java |
package pe.egcc.proyectoxml.service;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import pe.egcc.proyectoxml.Departamento;
import pe.egcc.proyectoxml.Empleado;
import pe.egcc.proyectoxml.main;
import pe.egcc.proyectoxml.model.dto;
/**
*
* @author Ze Carlos Guerrero / David Wong Herrera
*/
public class service {
//
public static void crearXML(dto Dto){
try{
List<Empleado> empleados = new ArrayList<>();
Empleado emp = new Empleado();
emp.setIdEmpleado(Dto.getIdEmpleado());
emp.setNombre(Dto.getNombre());
emp.setPaterno(Dto.getPaterno());
emp.setMaterno(Dto.getMaterno());
empleados.add(emp);
Departamento depto = new Departamento();
depto.setEmpleados(empleados);
//Contexto JAXB
JAXBContext ctx = JAXBContext.newInstance(Departamento.class);
//Realiza la conversión de los objetos Java a XML
Marshaller ms = ctx.createMarshaller();
//Preparames el formato como se va a generar el archivo de XML
ms.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
//Genera el archivo XML
ms.marshal(depto, new File("D:\\TRABAJOS\\G_04_0840_Wong_Guerrero\\ProyectoXML\\Archivos XML\\" + Dto.getNombreArchivo() + ".xml"));
}catch(JAXBException ex){
Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);
}
}
public static void LeerXml() {
try{
//Crear el Contexto de JAXB
JAXBContext ctx = JAXBContext.newInstance(Departamento.class);
//Crear la Clase que nos permite leer el Archivo XML
Unmarshaller ums = ctx.createUnmarshaller();
Departamento depto = (Departamento)ums.unmarshal(
new File("D:\\EGCC\\Proyectos\\ProyectoXML\\Archivos XML\\depto11leer.xml"));
for (Empleado emp : depto.getEmpleados()){
System.out.println(emp.getIdEmpleado() + " "
+ emp.getNombre() + " "
+ emp.getPaterno() + " "
+ emp.getMaterno());
}
}catch(JAXBException ex){
Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| [
"gcoronelc@gmail.com"
] | gcoronelc@gmail.com |
561ac3ab016d8663e3d27925667a6a97bbeb9987 | 726b6d9f5bd965b8047662cdf3c7f2796139e69c | /InteraxTelephonyCommons/src/com/interax/telephony/service/agi/InteraxTelephonyBaseAgi.java | 333cf90ecfa54f6bf49772f2a212257aec635677 | [] | no_license | adiquintero/interaxtelephony | 794e8311d3f61e3fdec233c055c0e5df4db3274a | 14dcd109fa3dd5ed74797f681dd87ec793ded703 | refs/heads/master | 2020-08-23T09:24:31.158545 | 2019-10-21T14:21:34 | 2019-10-21T14:21:34 | 216,584,831 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.interax.telephony.service.agi;
import org.asteriskjava.fastagi.AgiException;
import org.asteriskjava.fastagi.BaseAgiScript;
public abstract class InteraxTelephonyBaseAgi extends BaseAgiScript{
public String createDialOption(String serviceFamily, String serviceType, String accessType, Long enterpriseId, String dni, int priority ){
String dialOptions = null;
try {
dialOptions = getFullVariable("${ODBC_IT_GET_OUTGOING_ROUTE_BY_PRIORITY("+serviceFamily+"|"+serviceType+"|"+ accessType +"|"+enterpriseId+"|"+dni+"|"+priority+")}");
if(dialOptions.isEmpty()){
dialOptions = null;
}
System.out.println(dialOptions);
} catch (AgiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dialOptions;
}
public String createDialOption(String serviceFamily, String serviceType, String accessType, Long enterpriseId, String dni){
String dialOptions = null;
try {
dialOptions = getFullVariable("${ODBC_IT_GET_OUTGOING_ROUTE("+serviceFamily+"|"+serviceType+"|"+ accessType +"|"+enterpriseId+"|"+dni+")}");
} catch (AgiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return dialOptions;
}
}
| [
"yquintero@alodiga.com"
] | yquintero@alodiga.com |
104ac5780c44c56dc30a70761550555286f68196 | 3982cc0a73455f8ce32dba330581b4a809988a17 | /platform/platform-api/src/com/intellij/ui/CollectionListModel.java | 1a6f024c29a9c188d86b538e0575d2a5777699fd | [
"Apache-2.0"
] | permissive | lshain-android-source/tools-idea | 56d754089ebadd689b7d0e6400ef3be4255f6bc6 | b37108d841684bcc2af45a2539b75dd62c4e283c | refs/heads/master | 2016-09-05T22:31:43.471772 | 2014-07-09T07:58:59 | 2014-07-09T07:58:59 | 16,572,470 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,414 | java | /*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ui;
import com.intellij.util.ui.EditableModel;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.util.*;
/**
* @author yole
*/
public class CollectionListModel<T> extends AbstractListModel implements EditableModel {
private final List<T> myItems;
public CollectionListModel(@NotNull final List<? extends T> items) {
myItems = new ArrayList<T>(items);
}
public CollectionListModel(final T... items) {
myItems = new ArrayList<T>(Arrays.asList(items));
}
@Override
public int getSize() {
return myItems.size();
}
@Override
public T getElementAt(final int index) {
return myItems.get(index);
}
public void add(final T element) {
int i = myItems.size();
myItems.add(element);
fireIntervalAdded(this, i, i);
}
public void add(@NotNull final List<? extends T> elements) {
if (elements.isEmpty()) return;
int i = myItems.size();
myItems.addAll(elements);
fireIntervalAdded(this, i, i + elements.size() - 1);
}
public void remove(@NotNull final T element) {
int i = myItems.indexOf(element);
myItems.remove(element);
fireIntervalRemoved(this, i, i);
}
public void setElementAt(@NotNull final T element, final int index) {
myItems.set(index, element);
fireContentsChanged(this, index, index);
}
public void remove(final int index) {
myItems.remove(index);
fireIntervalRemoved(this, index, index);
}
public void removeAll() {
int size = myItems.size();
if (size > 0) {
myItems.clear();
fireIntervalRemoved(this, 0, size - 1);
}
}
public void contentsChanged(@NotNull final T element) {
int i = myItems.indexOf(element);
fireContentsChanged(this, i, i);
}
public void sort(final Comparator<T> comparator) {
Collections.sort(myItems, comparator);
}
public List<T> getItems() {
return Collections.unmodifiableList(myItems);
}
public void replaceAll(@NotNull final List<? extends T> elements) {
removeAll();
add(elements);
}
@Override
public void addRow() {
}
@Override
public void removeRow(int index) {
remove(index);
}
@Override
public void exchangeRows(int oldIndex, int newIndex) {
Collections.swap(myItems, oldIndex, newIndex);
fireContentsChanged(this, oldIndex, oldIndex);
fireContentsChanged(this, newIndex, newIndex);
}
@Override
public boolean canExchangeRows(int oldIndex, int newIndex) {
return true;
}
@NonNls
@Override
public String toString() {
return getClass().getName() + " (" + getSize() + " elements)";
}
public List<T> toList() {
return new ArrayList<T>(myItems);
}
public int getElementIndex(T item) {
return myItems.indexOf(item);
}
}
| [
"lshain.gyh@gmail.com"
] | lshain.gyh@gmail.com |
35ab4ccc7cbd0f3ae4820a7293b0dd2cb2dd31b6 | 17bfe5bf23d259b93359a1aad48cb064f34bf670 | /engines/servicemix-pdf/src/main/java/org/apache/servicemix/pdf/marshaler/PdfComposerRequest.java | ec625160658c8263957f2eb88437fa90d4541869 | [
"Apache-2.0"
] | permissive | apache/servicemix-components | 732fff76977a3f026ea85cc99e70fa5b1a0889f1 | 6bf1e46e7e173275a17571ab28c6174ff26f0651 | refs/heads/trunk | 2023-08-28T17:39:33.860650 | 2014-04-09T17:51:21 | 2014-04-09T17:51:21 | 1,167,439 | 4 | 17 | null | 2023-09-12T13:54:34 | 2010-12-14T08:00:08 | Java | UTF-8 | Java | false | false | 1,744 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.servicemix.pdf.marshaler;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
/**
* <p>
* Represents a PdfComposer request including template and data.
* </p>
*
* @author jbonofre
*
*/
@XmlRootElement(namespace="http://servicemix.apache.org/pdfcomposer")
public class PdfComposerRequest {
private String template;
private List<PdfComposerDataField> data;
public String getTemplate() {
return template;
}
@XmlElement(name="template")
public void setTemplate(String template) {
this.template = template;
}
public List<PdfComposerDataField> getData() {
return data;
}
@XmlElementWrapper(name="data")
@XmlElement(name="field")
public void setData(List<PdfComposerDataField> data) {
this.data = data;
}
}
| [
"gertv@apache.org"
] | gertv@apache.org |
b1d7ee4c1b12e6da873b3f9c480ffad3ddb719db | abe96460ebf3ab464949d6f62fcace0ad16efefd | /runescape-client/src/main/java/osrs/FaceNormal.java | f08ff831a8bec8aa45b3851860c7f9c5e0864847 | [] | no_license | Dabalon/MeteorLite | 2e2b05efa34eeb465faf5009f2fcf11d35fb07e5 | 9b8e6ed5f9e26ad9c9de52880fd623b6f0f1ba0d | refs/heads/main | 2023-07-16T05:10:29.209935 | 2021-08-25T11:25:03 | 2021-08-25T11:25:03 | 397,429,013 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package osrs;
import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
@ObfuscatedName("hi")
@Implements("FaceNormal")
public class FaceNormal {
@ObfuscatedName("n")
@ObfuscatedGetter(
intValue = -401677395
)
@Export("x")
int x;
@ObfuscatedName("c")
@ObfuscatedGetter(
intValue = 1245481
)
@Export("y")
int y;
@ObfuscatedName("m")
@ObfuscatedGetter(
intValue = 1613056851
)
@Export("z")
int z;
FaceNormal() {
}
@ObfuscatedName("n")
@ObfuscatedSignature(
descriptor = "(IS)Z",
garbageValue = "13608"
)
@Export("isWorldMapEvent")
public static boolean isWorldMapEvent(int var0) {
return var0 == 10 || var0 == 11 || var0 == 12 || var0 == 13 || var0 == 14 || var0 == 15 || var0 == 16 || var0 == 17;
}
@ObfuscatedName("l")
@ObfuscatedSignature(
descriptor = "(CI)Z",
garbageValue = "-1523765132"
)
@Export("isDigit")
public static boolean isDigit(char var0) {
return var0 >= '0' && var0 <= '9';
}
}
| [
"therealnull@gmail.com"
] | therealnull@gmail.com |
419b61a26f83e1f0efba4e02f6177533a84df2ed | 83d56024094d15f64e07650dd2b606a38d7ec5f1 | /sicc_druida/fuentes/java/CalGuiasComboFormatter.java | 7284910865319f58015215168913c4e75ac14a32 | [] | no_license | cdiglesias/SICC | bdeba6af8f49e8d038ef30b61fcc6371c1083840 | 72fedb14a03cb4a77f62885bec3226dbbed6a5bb | refs/heads/master | 2021-01-19T19:45:14.788800 | 2016-04-07T16:20:51 | 2016-04-07T16:20:51 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,507 | java |
/*
INDRA/CAR/mmg
$Id: CalGuiasComboFormatter.java,v 1.1 2009/12/03 18:42:41 pecbazalar Exp $
DESC
*/
/*
INDRA/CAR/mmg
$Id: CalGuiasComboFormatter.java,v 1.1 2009/12/03 18:42:41 pecbazalar Exp $
fdsfdsf
DRUIDATARGET=/install/cvsiniciales
*/
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import java.util.Vector;
import es.indra.belcorp.mso.*;
import es.indra.druida.DruidaFormatoObjeto;
import es.indra.druida.belcorp.MMGDruidaFormatoObjeto;
import es.indra.druida.belcorp.MMGDruidaHelper;
import es.indra.mare.common.dto.IMareDTO;
import es.indra.utils.*;
/**
* Clase de formateo de objetos "CalGuias" para Druida
*
* @author Indra
*/
public class CalGuiasComboFormatter extends MMGDruidaFormatoObjeto {
public CalGuiasComboFormatter() {
}
public void formatea(String s, Object obj) throws Exception {
IMareDTO dto = (IMareDTO) obj;
Vector calGuiasCombo = (Vector) dto.getProperty("result");
Vector result = new Vector();
//Ordenamos los elementos
//TreeMap orderBy = new TreeMap();
TreeMap orderBy = new TreeMap(new Comparador());
for(int i=0; i< calGuiasCombo.size(); i++){
CalGuiasData calGuiasData = (CalGuiasData)calGuiasCombo.get(i);
String description = calGuiasData.getPaisOidPais() != null ?
FormatUtils.formatObject(calGuiasData.getPaisOidPais(),
MMGDruidaHelper.getUserDecimalFormatPattern(this),
MMGDruidaHelper.getUserDecimalFormatSymbols(this)) : "";
orderBy.put(description.toUpperCase(), calGuiasData);
}
//Construimos cada fila con los valores de la clave y la descripción del elemento que se mostrará en el combo
for (Iterator it = orderBy.entrySet().iterator() ; it.hasNext();) {
CalGuiasData calGuiasData = (CalGuiasData)((Map.Entry)it.next()).getValue();
Vector row = new Vector();
// Añadir la clave
Hashtable primaryKey = calGuiasData.mmgGetPrimaryKey();
Enumeration keys = primaryKey.keys();
while (keys.hasMoreElements()) {
Object element = primaryKey.get(keys.nextElement());
row.add((element != null ? element.toString() : ""));
}
// Añadir el atributo choice
row.add((calGuiasData.getPaisOidPais() != null ?
FormatUtils.formatObject(calGuiasData.getPaisOidPais(),
MMGDruidaHelper.getUserDecimalFormatPattern(this),
MMGDruidaHelper.getUserDecimalFormatSymbols(this)) : ""));
result.add(row);
}
setCampo(s, result);
}
}
| [
"hp.vega@hotmail.com"
] | hp.vega@hotmail.com |
a14b1de8025f619ec4d54f50f58253e7c435ca69 | b45be506bc6a78b78b534924cd5e44efd2c25911 | /FirstWebProject/src/com/allstates/training/controller/logoutServlet.java | 78bddcef1182208741036bef9d456c947bcc891f | [] | no_license | trivedidivya/javacode1 | fd23c5b61dbccdd8b349e9b775dd9f60c0570bda | 58ce8826372eb6f6ad9dc2e7f9eb879e2a274079 | refs/heads/master | 2020-07-19T20:37:23.542787 | 2019-09-10T05:05:06 | 2019-09-10T05:05:06 | 206,511,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package com.allstates.training.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@WebServlet("/logout")
public class logoutServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public logoutServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out=response.getWriter();
response.setContentType("text/html");
response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate");
HttpSession session=request.getSession(false);
session.removeAttribute("sname");
session.invalidate();
out.print("login again");
response.sendRedirect("Login.html");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"user@user-PC"
] | user@user-PC |
5ca4055ba2b7f89c9e87edf94a1e2d400f5514fe | abbad3c611af75ee84a8ad71409190f57058f9af | /core/src/main/java/org/carbondata/query/datastorage/TableSlicePathInfo.java | ee0e8a17938c0bc64beeedc169c15c3ccb31fe10 | [
"Apache-2.0"
] | permissive | kumarvishal09/carbondata | dbefb88f3edecc14acc1c0efb01d76877862d810 | b527a8fab347dd47b0ede973a77c6cbec5c7701b | refs/heads/master | 2022-07-20T12:57:00.635767 | 2016-05-20T12:35:52 | 2016-05-20T12:35:57 | 54,094,408 | 0 | 0 | Apache-2.0 | 2022-05-20T20:50:45 | 2016-03-17T06:32:19 | Java | UTF-8 | Java | false | false | 1,595 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.carbondata.query.datastorage;
import org.carbondata.core.datastorage.store.filesystem.CarbonFile;
import org.carbondata.core.datastorage.store.impl.FileFactory;
/**
* Class that deduces the info from Load path supplied
*/
public class TableSlicePathInfo {
/**
*
*/
private String loadPath;
/**
* @param loadPath
*/
public TableSlicePathInfo(String loadPath) {
formInfo(loadPath);
}
/**
* @param loadFolderPath
*/
private void formInfo(String loadFolderPath) {
//
CarbonFile loadPathFolder =
FileFactory.getCarbonFile(loadFolderPath, FileFactory.getFileType(loadFolderPath));
loadPath = loadPathFolder.getCanonicalPath();
}
/**
* @return
*/
public String getLoadPath() {
return loadPath;
}
}
| [
"ravi.pesala@gmail.com"
] | ravi.pesala@gmail.com |
4a022ae35fa32c24cdd5538cc95f43e964b7939e | 0ff12c4d3965c34db8c92ceebd8b6313c12b7561 | /yeon/yeon-core/src/main/java/com/yeon/config/Ticket.java | fc3e33331353eb555b6e9fba5b146db5ff9f55e7 | [] | no_license | Uncontainer/proto | aba023cf12e8245abe5a72e2a5fd95aaa4b1d25a | a136bd7e4a11782927bc55d9d9cb1e35abe25013 | refs/heads/master | 2021-01-19T19:14:16.693873 | 2015-04-21T01:52:44 | 2015-04-21T01:52:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,025 | java | package com.yeon.config;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.yeon.lang.ResourceIdentifiable;
import com.yeon.lang.impl.MapResource;
public class Ticket extends MapResource {
private static final Logger LOG = LoggerFactory.getLogger(Ticket.class);
protected static final String PARAM_NAME = "_name";
protected static final String PARAM_STATUS = "_status";
public static final List<String> EMPTY_LIST = Collections.emptyList();
protected Ticket(ResourceIdentifiable classId) {
super(classId);
}
protected Ticket(ResourceIdentifiable classId, Ticket ticket) {
// TODO [LOW] field 값까지 복사하는 코드 추가.
super(classId, ticket == null ? null : ticket.getValues());
}
protected Ticket(ResourceIdentifiable classId, Map<String, Object> properties) {
super(classId, properties);
}
@Override
public void setValues(Map<String, Object> properties) {
super.setValues(properties);
Class<?> clazz = getClass();
while (!Ticket.class.equals(clazz)) {
initializeFields(clazz, this);
clazz = clazz.getSuperclass();
}
}
protected static void initializeFields(Class<?> clazz, Object obj) {
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
int mod = field.getModifiers();
if (Modifier.isStatic(mod) || Modifier.isFinal(mod)) {
continue;
}
Class<?> type = field.getType();
if (Object.class.isAssignableFrom(type)) {
try {
if (field.isAccessible()) {
field.set(obj, null);
} else {
field.setAccessible(true);
field.set(obj, null);
field.setAccessible(false);
}
} catch (IllegalArgumentException e) {
LOG.error("[YEON] Fail to clear field.(" + field.getName() + ")", e);
} catch (IllegalAccessException e) {
LOG.error("[YEON] Fail to clear field.(" + field.getName() + ")", e);
}
} else if (type.isPrimitive()) {
// TODO [LOW] 기본 값으로 초기화할 지 여부 결정.
}
}
}
@Override
public int hashCode() {
return data == null ? 0 : data.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof Ticket)) {
return false;
}
Ticket other = (Ticket) obj;
if (data == null) {
return other.getValues() == null;
} else {
return data.equals(other.getValues());
}
}
}
| [
"veiner.202@daumkakao.com"
] | veiner.202@daumkakao.com |
9e7b2c37f0af408d71a1fc7eaca9ce20cf8a0412 | ec9bf57a07b7b06134ec7a21407a11f69cc644f7 | /src/cab.java | cefb6fb23a9082a4a75ebe43ac10775a94642eca | [] | no_license | jzarca01/com.ubercab | f95c12cab7a28f05e8f1d1a9d8a12a5ac7fbf4b1 | e6b454fb0ad547287ae4e71e59d6b9482369647a | refs/heads/master | 2020-06-21T04:37:43.723581 | 2016-07-19T16:30:34 | 2016-07-19T16:30:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 700 | java | import android.net.Uri;
import com.paypal.android.sdk.onetouch.core.Request;
import com.paypal.android.sdk.onetouch.core.Result;
public final class cab
{
public static Result a(byv parambyv, Request paramRequest, Uri paramUri)
{
paramUri = paramRequest.a(paramUri);
switch (cab.1.a[paramUri.a().ordinal()])
{
default:
return paramUri;
case 1:
paramRequest.a(parambyv.b(), bzv.j);
return paramUri;
case 2:
paramRequest.a(parambyv.b(), bzv.h);
return paramUri;
}
paramRequest.a(parambyv.b(), bzv.i);
return paramUri;
}
}
/* Location:
* Qualified Name: cab
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
ca6433b673e704aaba270cd5c0c972ecb1ff4d52 | e9474845462e5f2531a74c760b7770d17c74baef | /10-Application/Application/Swing-Sample-APP/src/main/java/com/sgu/infowksporga/jfx/views/file/explorer/tree/UtilFileTreeFilter.java | c431a3a5629f293cb064a87dc4b6eeab2672b84c | [
"Apache-2.0"
] | permissive | github188/InfoWkspOrga | 869051f4e70ebc9a0125a0bddecdc1704e868b52 | 89162f127af51d697e25a46bc32dc90553388a54 | refs/heads/master | 2020-12-03T00:43:46.453187 | 2016-11-06T05:48:37 | 2016-11-06T05:48:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package com.sgu.infowksporga.jfx.views.file.explorer.tree;
import com.sgu.core.framework.gui.swing.textfield.GTextField;
import com.sgu.core.framework.util.UtilString;
import com.sgu.infowksporga.jfx.views.file.explorer.FileExplorerView;
/**
* The Class UtilFileTreeFilter.
*/
public class UtilFileTreeFilter {
/**
* The Constructor.
*/
public UtilFileTreeFilter() {
}
/**
* Apply filter.
*
* @param fileExplorerView the directory desk view
*/
public static void applyFilter(final FileExplorerView fileExplorerView) {
final boolean onLeaf = fileExplorerView.getChkFilter().isSelected();
final FileTree fileTree = fileExplorerView.getFileTree();
final GTextField textField = fileExplorerView.getTxtFilter();
final String filterTxt = textField.getText();
if (UtilString.isNotBlank(filterTxt)) {
fileTree.loadAllFileRecursively((FileTreeNode) fileTree.getModel().getRoot(), true);
fileTree.filterTree(filterTxt, onLeaf);
fileTree.expandAllNode();
}
else {
fileTree.filterTree("", onLeaf);
fileTree.collapseAllNode();
fileTree.expandAllNode(1);
}
}
}
| [
"sebguisse@gmail.com"
] | sebguisse@gmail.com |
d68a3268b086163d387bcacbf14ac75a963dfd43 | a8a82e1e54559357377191e99cb1b522334e289d | /src/main/java/com/itsolution/tkbr/service/dto/MouvementStockSearch.java | 2a565aed4af83ee448d5b3ec4234dcbd9693bbd2 | [] | no_license | tchipi88/TKBRApp | 7bc09edcc469ad9d43b966453cd16229fd300abc | 81370783b9b83f1a6606a0c3a7e9265fe2b393de | refs/heads/master | 2021-01-19T10:23:34.462323 | 2017-05-09T21:59:16 | 2017-05-09T21:59:16 | 87,860,049 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,614 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.itsolution.tkbr.service.dto;
import com.itsolution.tkbr.domain.Entrepot;
import com.itsolution.tkbr.domain.Produit;
import java.io.Serializable;
import java.time.LocalDate;
import javax.validation.constraints.NotNull;
/**
*
* @author tchipi
*/
public class MouvementStockSearch implements Serializable {
@NotNull
private LocalDate dateDebut;
@NotNull
private LocalDate dateFin;
private Produit produit;
private Entrepot entrepotDepart;
private Entrepot entrepotDestination;
public LocalDate getDateDebut() {
return dateDebut;
}
public void setDateDebut(LocalDate dateDebut) {
this.dateDebut = dateDebut;
}
public LocalDate getDateFin() {
return dateFin;
}
public void setDateFin(LocalDate dateFin) {
this.dateFin = dateFin;
}
public Produit getProduit() {
return produit;
}
public void setProduit(Produit produit) {
this.produit = produit;
}
public Entrepot getEntrepotDepart() {
return entrepotDepart;
}
public void setEntrepotDepart(Entrepot entrepotDepart) {
this.entrepotDepart = entrepotDepart;
}
public Entrepot getEntrepotDestination() {
return entrepotDestination;
}
public void setEntrepotDestination(Entrepot entrepotDestination) {
this.entrepotDestination = entrepotDestination;
}
}
| [
"ngansop.arthur@gmail.com"
] | ngansop.arthur@gmail.com |
36d2e226bccf1c46118699f967b7c1f71ec3cae9 | f7dd1eea9ca2889a2fb37133e60d3ed6a43328ed | /neuro4j-workflow-core/src/main/java/org/neuro4j/workflow/common/ParameterDefinitionImpl.java | bb0e0db08e7cc4378ccbc3797b2a05769fb66acc | [] | no_license | josejamilena/workflow | 878937f52fe07f363ce16917a415e2c1d3a0aaf0 | df2f223393bd59f13786f5f1cbba70907cd9f54f | refs/heads/master | 2021-01-18T08:02:47.424899 | 2015-02-05T00:08:36 | 2015-02-05T00:08:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,347 | java | /*
* Copyright (c) 2013-2014, Neuro4j
*
* 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.neuro4j.workflow.common;
import java.lang.annotation.Annotation;
public class ParameterDefinitionImpl implements ParameterDefinition {
private String name;
private String type;
private Boolean optional;
public ParameterDefinitionImpl(String name, String type, Boolean optional)
{
this.name = name;
this.type = type;
this.optional = optional;
}
public Class<? extends Annotation> annotationType() {
return ParameterDefinition.class;
}
public String name() {
return name;
}
public String type() {
return type;
}
public boolean isOptional() {
return optional;
}
}
| [
"pdaviti@gmail.com"
] | pdaviti@gmail.com |
5c071135a73ee4a8ad45d00d0d44539e4bfb38fc | 53f5a941261609775dc3eedf0cb487956b734ab0 | /com.samsung.accessory.atticmgr/sources/com/accessorydm/eng/parser/XDMParserGet.java | e10afcda6a0d011bb57dde89101c3d0094796de1 | [] | no_license | ThePBone/BudsProAnalysis | 4a3ede6ba6611cc65598d346b5a81ea9c33265c0 | 5b04abcae98d1ec8d35335d587b628890383bb44 | refs/heads/master | 2023-02-18T14:24:57.731752 | 2021-01-17T12:44:58 | 2021-01-17T12:44:58 | 322,783,234 | 16 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,167 | java | package com.accessorydm.eng.parser;
import com.accessorydm.agent.XDMHandleCmd;
import com.accessorydm.eng.core.XDMList;
import com.accessorydm.eng.core.XDMWbxml;
import com.samsung.android.fotaprovider.log.Log;
import java.io.IOException;
public class XDMParserGet extends XDMHandleCmd implements XDMWbxml {
public int cmdid;
public XDMParserCred cred;
public int is_noresp;
public XDMList itemlist = null;
public int lang;
public XDMParserMeta meta;
public int xdmParParseGet(XDMParser xDMParser) {
int xdmParParseCheckElement = xDMParser.xdmParParseCheckElement(19);
if (xdmParParseCheckElement != 0) {
return xdmParParseCheckElement;
}
int xdmParParseZeroBitTagCheck = xDMParser.xdmParParseZeroBitTagCheck();
if (xdmParParseZeroBitTagCheck == 8) {
return 0;
}
if (xdmParParseZeroBitTagCheck != 0) {
Log.E("not WBXML_ERR_OK");
return xdmParParseZeroBitTagCheck;
}
int i = -1;
do {
try {
i = xDMParser.xdmParParseCurrentElement();
} catch (IOException e) {
Log.E(e.toString());
}
if (i == 1) {
xDMParser.xdmParParseReadElement();
xdmAgentHdlCmdGet(xDMParser.userdata, this);
return 0;
} else if (i == 0) {
xDMParser.xdmParParseReadElement();
i = xDMParser.xdmParParseReadElement();
if (xdmParParseZeroBitTagCheck != 0) {
return xdmParParseZeroBitTagCheck;
}
xDMParser.codePage = i;
continue;
} else if (i == 11) {
xdmParParseZeroBitTagCheck = xDMParser.xdmParParseElement(i);
this.cmdid = Integer.parseInt(xDMParser.m_szParserElement);
continue;
} else if (i == 14) {
this.cred = new XDMParserCred();
xdmParParseZeroBitTagCheck = this.cred.xdmParParseCred(xDMParser);
this.cred = xDMParser.Cred;
continue;
} else if (i == 26) {
this.meta = new XDMParserMeta();
xdmParParseZeroBitTagCheck = this.meta.xdmParParseMeta(xDMParser);
this.meta = xDMParser.Meta;
continue;
} else if (i == 29) {
this.is_noresp = xDMParser.xdmParParseBlankElement(i);
continue;
} else if (i == 20) {
this.itemlist = xDMParser.xdmParParseItemlist(this.itemlist);
continue;
} else if (i != 21) {
xdmParParseZeroBitTagCheck = 2;
continue;
} else {
xdmParParseZeroBitTagCheck = xDMParser.xdmParParseElement(i);
this.lang = Integer.parseInt(xDMParser.m_szParserElement);
continue;
}
} while (xdmParParseZeroBitTagCheck == 0);
return xdmParParseZeroBitTagCheck;
}
}
| [
"thebone.main@gmail.com"
] | thebone.main@gmail.com |
e4aa14ba942308eaf6c283c76ff4ce97ec0c9cc5 | c9b34ce87c328e2126a20a90296d8f15584e1a00 | /transform-dozer/src/test/java/org/switchyard/quickstarts/transform/dozer/DozerTransformationClient.java | 2b5da214cf5d1188879a8cc979aba4eee1b2de7c | [] | no_license | tgubeli/quickstarts | 5bd862f8b9506adc2efaf0278d88797ccb3f14d9 | ba1d7f05c666e14a42cf837933b7eb6c9f1ee1a8 | refs/heads/master | 2020-12-25T16:02:52.598243 | 2014-07-24T23:39:28 | 2014-07-24T23:42:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,609 | java | /*
* Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors.
*
* 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.switchyard.quickstarts.transform.dozer;
import static java.lang.System.out;
import javax.xml.namespace.QName;
import org.switchyard.remote.RemoteInvoker;
import org.switchyard.remote.RemoteMessage;
import org.switchyard.remote.http.HttpInvoker;
/**
* Test client which uses RemoteInvoker to invoke a service with an SCA binding.
*/
public final class DozerTransformationClient {
private static final QName SERVICE = new QName( "urn:switchyard-quickstart:transform-dozer:0.1.0", "OrderService");
private static final String URL = "http://localhost:8080/switchyard-remote";
/**
* Private no-args constructor.
*/
private DozerTransformationClient() {
}
/**
* Only execution point for this application.
* @param ignored not used.
* @throws Exception if something goes wrong.
*/
public static void main(final String[] ignored) throws Exception {
// Create a new remote client invoker
RemoteInvoker invoker = new HttpInvoker(URL);
// Create request payload
Order order = new Order();
order.setItem("Turkey");
order.setQuantity(1);
// Create the request message
RemoteMessage message = new RemoteMessage();
message.setService(SERVICE).setOperation("submitOrder").setContent(order);
// Invoke the service
RemoteMessage reply = invoker.invoke(message);
if (reply.isFault()) {
System.err.println("Oops ... something bad happened. " + reply.getContent());
} else {
OrderAck orderAck = (OrderAck) reply.getContent();
out.println("==================================");
out.println("Was the offer accepted? " + orderAck.isAccepted());
out.println("Description: " + orderAck.getStatusDescription());
out.println("Order ID: " + orderAck.getOrderId());
out.println("==================================");
}
}
}
| [
"rcernich@redhat.com"
] | rcernich@redhat.com |
d09de5d1f3cba60b54959dd68d7feed471246884 | 875a9c7cfc77740cde671709ace2106dd5d42268 | /projects/Java/src/com/chronoxor/test/fbe/FinalModelOptionalprotoBalance.java | 14009b6d25e36f26d4d5b093f81116ceba8c3421 | [
"MIT"
] | permissive | virgiliofornazin/FastBinaryEncoding | eb8507b16c020e63676ac882021bc9ba97f24e28 | c718c750510b1823c43e90ddcc0c76b2e3f20a72 | refs/heads/master | 2022-11-08T22:12:21.340594 | 2020-07-04T01:20:43 | 2020-07-04T01:20:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,830 | java | // Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: test.fbe
// Version: 1.3.0.0
package com.chronoxor.test.fbe;
// Fast Binary Encoding optional protoBalance final model
public final class FinalModelOptionalprotoBalance extends com.chronoxor.fbe.FinalModel
{
public FinalModelOptionalprotoBalance(com.chronoxor.fbe.Buffer buffer, long offset)
{
super(buffer, offset);
value = new com.chronoxor.proto.fbe.FinalModelBalance(buffer, 0);
}
// Get the allocation size
public long fbeAllocationSize(com.chronoxor.proto.Balance optional) { return 1 + ((optional != null) ? value.fbeAllocationSize(optional) : 0); }
// Checks if the object contains a value
public boolean hasValue()
{
if ((_buffer.getOffset() + fbeOffset() + 1) > _buffer.getSize())
return false;
byte fbeHasValue = readInt8(fbeOffset());
return (fbeHasValue != 0);
}
// Base final model value
public final com.chronoxor.proto.fbe.FinalModelBalance value;
// Check if the optional value is valid
@Override
public long verify()
{
if ((_buffer.getOffset() + fbeOffset() + 1) > _buffer.getSize())
return Long.MAX_VALUE;
byte fbeHasValue = readInt8(fbeOffset());
if (fbeHasValue == 0)
return 1;
_buffer.shift(fbeOffset() + 1);
long fbeResult = value.verify();
_buffer.unshift(fbeOffset() + 1);
return 1 + fbeResult;
}
// Get the optional value
public com.chronoxor.proto.Balance get(com.chronoxor.fbe.Size size)
{
assert ((_buffer.getOffset() + fbeOffset() + 1) <= _buffer.getSize()) : "Model is broken!";
if ((_buffer.getOffset() + fbeOffset() + 1) > _buffer.getSize())
{
size.value = 0;
return null;
}
if (!hasValue())
{
size.value = 1;
return null;
}
_buffer.shift(fbeOffset() + 1);
com.chronoxor.proto.Balance optional = value.get(size);
_buffer.unshift(fbeOffset() + 1);
size.value += 1;
return optional;
}
// Set the optional value
public long set(com.chronoxor.proto.Balance optional)
{
assert ((_buffer.getOffset() + fbeOffset() + 1) <= _buffer.getSize()) : "Model is broken!";
if ((_buffer.getOffset() + fbeOffset() + 1) > _buffer.getSize())
return 0;
byte fbeHasValue = (byte)((optional != null) ? 1 : 0);
write(fbeOffset(), fbeHasValue);
if (fbeHasValue == 0)
return 1;
_buffer.shift(fbeOffset() + 1);
long size = value.set(optional);
_buffer.unshift(fbeOffset() + 1);
return 1 + size;
}
}
| [
"chronoxor@gmail.com"
] | chronoxor@gmail.com |
425bf5b26e46183468a63b05fc4c72255546c971 | 82fd1fefe5ca9eada6491679e24f8ab1791e6b8e | /common/src/main/java/com/serenegiant/system/PermissionCheck.java | 60796a8bcbfb0713c5cacbdb00512973e5c8229d | [
"Apache-2.0"
] | permissive | blinkjum/libcommon | 1d464c29f29411a00877e0abb9e05b158393e72a | 4155cc26dae55f3aea7b3e8045a8c27b0493c6b3 | refs/heads/master | 2022-09-10T02:34:15.323199 | 2020-05-28T07:17:58 | 2020-05-28T07:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,907 | java | package com.serenegiant.system;
/*
* libcommon
* utility/helper classes for myself
*
* Copyright (c) 2014-2020 saki t_saki@serenegiant.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.
*/
import android.Manifest.permission;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PermissionGroupInfo;
import android.net.Uri;
import android.provider.Settings;
import android.util.Log;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public final class PermissionCheck {
private PermissionCheck() {
// インスタンス化をエラーにするためにデフォルトコンストラクタをprivateに
}
public static final void dumpPermissions(@Nullable final Context context) {
if (context == null) return;
try {
final PackageManager pm = context.getPackageManager();
final List<PermissionGroupInfo> list = pm.getAllPermissionGroups(PackageManager.GET_META_DATA);
for (final PermissionGroupInfo info : list) {
Log.d("PermissionCheck", info.name);
}
} catch (final Exception e) {
Log.w("", e);
}
}
/**
* パーミッションを確認
* @param context
* @param permissionName
* @return
*/
@SuppressLint("NewApi")
public static int checkSelfPermission(@Nullable final Context context, final String permissionName) {
if (context == null) return PackageManager.PERMISSION_DENIED;
int result = PackageManager.PERMISSION_DENIED;
try {
if (BuildCheck.isMarshmallow()) {
result = context.checkSelfPermission(permissionName);
} else {
final PackageManager pm = context.getPackageManager();
result = pm.checkPermission(permissionName, context.getPackageName());
}
} catch (final Exception e) {
Log.w("", e);
}
return result;
}
/**
* パーミッションを確認
* @param context
* @param permissionName
* @return 指定したパーミッションがあればtrue
*/
@SuppressLint("NewApi")
public static boolean hasPermission(@Nullable final Context context, final String permissionName) {
if (context == null) return false;
boolean result = false;
try {
final int check;
if (BuildCheck.isMarshmallow()) {
check = context.checkSelfPermission(permissionName);
} else {
final PackageManager pm = context.getPackageManager();
check = pm.checkPermission(permissionName, context.getPackageName());
}
switch (check) {
case PackageManager.PERMISSION_DENIED:
break;
case PackageManager.PERMISSION_GRANTED:
result = true;
break;
}
} catch (final Exception e) {
Log.w("", e);
}
return result;
}
/**
* 録音のミッションがあるかどうかを確認
* @param context
* @return 録音のパーミッションがあればtrue
*/
public static boolean hasAudio(@Nullable final Context context) {
return hasPermission(context, permission.RECORD_AUDIO);
}
/**
* ネットワークへのアクセスパーミッションがあるかどうかを確認
* @param context
* @return ネットワークへのアクセスパーミッションがあればtrue
*/
public static boolean hasNetwork(@Nullable final Context context) {
return hasPermission(context, permission.INTERNET);
}
/**
* 外部ストレージへの書き込みパーミッションがあるかどうかを確認
* @param context
* @return 外部ストレージへの書き込みパーミッションがあればtrue
*/
public static boolean hasWriteExternalStorage(@Nullable final Context context) {
return hasPermission(context, permission.WRITE_EXTERNAL_STORAGE);
}
/**
* 外部ストレージからの読み込みパーミッションがあるかどうかを確認
* @param context
* @return 外部ストレージへの読み込みパーミッションがあればtrue
*/
@SuppressLint("InlinedApi")
public static boolean hasReadExternalStorage(@Nullable final Context context) {
if (BuildCheck.isAndroid4())
return hasPermission(context, permission.READ_EXTERNAL_STORAGE);
else
return hasPermission(context, permission.WRITE_EXTERNAL_STORAGE);
}
/**
* 位置情報アクセスのパーミッションが有るかどうかを確認
* @param context
* @return
*/
public static boolean hasAccessLocation(@Nullable final Context context) {
return hasPermission(context, permission.ACCESS_COARSE_LOCATION)
&& hasPermission(context, permission.ACCESS_FINE_LOCATION);
}
/**
* 低精度位置情報アクセスのパーミッションが有るかどうかを確認
* @param context
* @return
*/
public static boolean hasAccessCoarseLocation(@Nullable final Context context) {
return hasPermission(context, permission.ACCESS_COARSE_LOCATION);
}
/**
* 高精度位置情報アクセスのパーミッションが有るかどうかを確認
* @param context
* @return
*/
public static boolean hasAccessFineLocation(@Nullable final Context context) {
return hasPermission(context, permission.ACCESS_FINE_LOCATION);
}
/**
* カメラへアクセス可能かどうか
* @param context
* @return
*/
public static boolean hasCamera(@Nullable final Context context) {
return hasPermission(context, permission.CAMERA);
}
/**
* アプリの詳細設定へ遷移させる(パーミッションを取得できなかった時など)
* @param context
*/
public static void openSettings(@NonNull final Context context) {
final Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
final Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
context.startActivity(intent);
}
/**
* AndroidManifest.xmlに設定されているはずのパーミッションをチェックする
* @param context
* @param expectations
* @return 空リストなら全てのパーミッションが入っていた,
* @throws IllegalArgumentException
* @throws PackageManager.NameNotFoundException
*/
public static List<String> missingPermissions(@NonNull final Context context, @NonNull final String[] expectations) throws IllegalArgumentException, PackageManager.NameNotFoundException {
return missingPermissions(context, new ArrayList<String>(Arrays.asList(expectations)));
}
/**
* AndroidManifest.xmlに設定されているはずのパーミッションをチェックする
* @param context
* @param expectations
* @return 空リストなら全てのパーミッションが入っていた,
* @throws IllegalArgumentException
* @throws PackageManager.NameNotFoundException
*/
public static List<String> missingPermissions(@NonNull final Context context, @NonNull final List<String> expectations) throws IllegalArgumentException, PackageManager.NameNotFoundException {
final PackageManager pm = context.getPackageManager();
final PackageInfo pi = pm.getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
final String[] info = pi.requestedPermissions;
if (info != null) {
for (String i : info) {
expectations.remove(i);
}
}
return expectations;
}
}
| [
"saki4510t@gmail.com"
] | saki4510t@gmail.com |
82b785134a532c66ed42010bc06284b0ff4ace95 | 162045517fe2be5fcc7161f8c18f5a318944bde1 | /trunk/webapi/src/main/java/com/ry/project/bussiness/controller/action/IRtmpNotifyActionService.java | 849872baea24f7ca44b394cd0abdc3f86cd452aa | [] | no_license | zhangjihai520/gzzbk | 45fe870310c13c0b7fdddbcfbbc273b0aa787cab | 4322d57a10539116ae2a494abd1f674c4ce215ac | refs/heads/master | 2023-03-04T15:36:58.725799 | 2021-02-18T09:04:46 | 2021-02-18T09:04:46 | 339,990,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 293 | java | package com.ry.project.bussiness.controller.action;
import java.util.Map;
/**
* <p>
* 消息 服务类
* </p>
*
* @author xrq
* @since 2020-04-26
*/
public interface IRtmpNotifyActionService {
//推流权限校验
boolean pushAuth(Map<String, String> map) throws Exception;
}
| [
"www.920175308@qq.com"
] | www.920175308@qq.com |
2a4d876436961450abb1e0beb8e1270cd75ad25d | fd73aa5db00e5bc23367d57fd4b9ef540f363585 | /src/main/java/com/citadier/amelie/web/rest/errors/FieldErrorVM.java | 4299d56174f7a5302f3e6239f257f77cab76f42f | [] | no_license | rafreid/amelie | 6346da149ab27ce4416df3ce799cd6ef7ea6b8db | b6291f03d40f80b43a56802db764ec48ed219427 | refs/heads/master | 2022-12-21T10:53:44.424400 | 2020-02-24T00:37:03 | 2020-02-24T00:37:03 | 242,612,342 | 0 | 0 | null | 2022-12-16T05:13:08 | 2020-02-24T00:09:13 | TypeScript | UTF-8 | Java | false | false | 651 | java | package com.citadier.amelie.web.rest.errors;
import java.io.Serializable;
public class FieldErrorVM implements Serializable {
private static final long serialVersionUID = 1L;
private final String objectName;
private final String field;
private final String message;
public FieldErrorVM(String dto, String field, String message) {
this.objectName = dto;
this.field = field;
this.message = message;
}
public String getObjectName() {
return objectName;
}
public String getField() {
return field;
}
public String getMessage() {
return message;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
417b0b37065de7b6d1b469f50b1c85aafa7bab12 | 7f785360d78bb5bb91c50e788c0ad6f3081741f2 | /results/Nopol+UnsatGuided/EvoSuite Tests/Math/Math87/seed60/generatedTests/org/apache/commons/math/optimization/linear/SimplexTableau_ESTest_scaffolding.java | 9a3c6ff40d17a84ff46cb893424dfc5bcdb32dd2 | [] | no_license | Spirals-Team/test4repair-experiments | 390a65cca4e2c0d3099423becfdc47bae582c406 | 5bf4dabf0ccf941d4c4053b6a0909f106efa24b5 | refs/heads/master | 2021-01-13T09:47:18.746481 | 2020-01-27T03:26:15 | 2020-01-27T03:26:15 | 69,664,991 | 5 | 6 | null | 2020-10-13T05:57:11 | 2016-09-30T12:28:13 | Java | UTF-8 | Java | false | false | 5,656 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Jan 24 03:31:39 GMT 2017
*/
package org.apache.commons.math.optimization.linear;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class SimplexTableau_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.optimization.linear.SimplexTableau";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
public static void setSystemProperties() {
/*No java.lang.System property to set*/
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(SimplexTableau_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math.optimization.linear.Relationship$1",
"org.apache.commons.math.linear.SparseRealVectorTest$SparseRealVectorTestImpl",
"org.apache.commons.math.linear.RealVectorImplTest$RealVectorTestImpl",
"org.apache.commons.math.linear.RealMatrixImpl",
"org.apache.commons.math.util.MathUtils",
"org.apache.commons.math.linear.RealVectorFormat",
"org.apache.commons.math.optimization.linear.Relationship",
"org.apache.commons.math.linear.AnyMatrix",
"org.apache.commons.math.linear.RealMatrix",
"org.apache.commons.math.linear.RealMatrixPreservingVisitor",
"org.apache.commons.math.optimization.linear.SimplexTableau",
"org.apache.commons.math.linear.RealVectorImpl",
"org.apache.commons.math.linear.SparseRealVectorTest",
"org.apache.commons.math.linear.NonSquareMatrixException",
"org.apache.commons.math.linear.MatrixVisitorException",
"org.apache.commons.math.linear.MatrixIndexException",
"org.apache.commons.math.linear.AbstractRealMatrix",
"org.apache.commons.math.optimization.RealPointValuePair",
"org.apache.commons.math.optimization.linear.LinearObjectiveFunction",
"org.apache.commons.math.util.CompositeFormat",
"org.apache.commons.math.linear.RealVectorImplTest",
"org.apache.commons.math.optimization.linear.LinearConstraint",
"org.apache.commons.math.MathRuntimeException",
"org.apache.commons.math.linear.InvalidMatrixException",
"org.apache.commons.math.linear.RealVector",
"org.apache.commons.math.linear.RealMatrixChangingVisitor",
"org.apache.commons.math.MathRuntimeException$1",
"org.apache.commons.math.MathRuntimeException$2",
"org.apache.commons.math.MathRuntimeException$3",
"org.apache.commons.math.MathRuntimeException$4",
"org.apache.commons.math.MathRuntimeException$5",
"org.apache.commons.math.MathRuntimeException$6",
"org.apache.commons.math.MathRuntimeException$7",
"org.apache.commons.math.MathRuntimeException$8",
"org.apache.commons.math.optimization.GoalType",
"org.apache.commons.math.MathRuntimeException$9"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(SimplexTableau_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.math.optimization.linear.SimplexTableau",
"org.apache.commons.math.optimization.linear.Relationship",
"org.apache.commons.math.optimization.GoalType",
"org.apache.commons.math.linear.SparseRealVectorTest$SparseRealVectorTestImpl",
"org.apache.commons.math.linear.RealVectorImplTest$RealVectorTestImpl",
"org.apache.commons.math.optimization.linear.LinearObjectiveFunction",
"org.apache.commons.math.util.CompositeFormat",
"org.apache.commons.math.linear.RealVectorFormat",
"org.apache.commons.math.linear.RealVectorImpl",
"org.apache.commons.math.linear.RealMatrixImpl",
"org.apache.commons.math.optimization.RealPointValuePair",
"org.apache.commons.math.MathRuntimeException",
"org.apache.commons.math.linear.MatrixIndexException",
"org.apache.commons.math.optimization.linear.LinearConstraint",
"org.apache.commons.math.MathRuntimeException$4",
"org.apache.commons.math.linear.OpenMapRealVector",
"org.apache.commons.math.util.OpenIntToDoubleHashMap",
"org.apache.commons.math.MathRuntimeException$7",
"org.apache.commons.math.util.MathUtils",
"org.apache.commons.math.optimization.linear.Relationship$1"
);
}
}
| [
"martin.monperrus@gnieh.org"
] | martin.monperrus@gnieh.org |
fafa7322b8305fe6a4c97219238174b46f8c973b | fa90f168bb534bd41f206a1cde10f971a35a9e69 | /youlai-admin/src/main/java/com/youlai/admin/service/impl/SysDeptServiceImpl.java | 3246f4b313860618a7f1b7b6ec25832b16beb23c | [
"MulanPSL-2.0",
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yidaibawang/youlai-mall | bebd87d77a764df3988c6b1601fcaf8cfec7177e | dfa891e7e89a4f2148c6c5c6265c21b50f073165 | refs/heads/master | 2022-12-09T16:23:11.631516 | 2020-09-17T16:57:32 | 2020-09-17T16:57:32 | 296,495,532 | 1 | 0 | NOASSERTION | 2020-09-18T02:43:00 | 2020-09-18T02:42:59 | null | UTF-8 | Java | false | false | 3,006 | java | package com.youlai.admin.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.admin.common.AdminConstant;
import com.youlai.admin.domain.entity.SysDept;
import com.youlai.admin.mapper.SysDeptMapper;
import com.youlai.admin.service.ISysDeptService;
import com.youlai.admin.domain.vo.DeptVO;
import com.youlai.admin.domain.vo.TreeSelectVO;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService {
@Override
public List<DeptVO> listForTableData(LambdaQueryWrapper<SysDept> baseQuery) {
List<SysDept> deptList = this.baseMapper.selectList(baseQuery);
List<DeptVO> list = recursionForTableData(AdminConstant.ROOT_DEPT_ID, deptList);
return list;
}
@Override
public List<TreeSelectVO> listForTreeSelect(LambdaQueryWrapper<SysDept> baseQuery) {
List<SysDept> deptList = this.baseMapper.selectList(baseQuery);
List<TreeSelectVO> list = recursionForTreeSelect(AdminConstant.ROOT_DEPT_ID, deptList);
return list;
}
/**
* 递归生成部门表格数据
* @param parentId
* @param deptList
* @return
*/
public static List<DeptVO> recursionForTableData(int parentId, List<SysDept> deptList) {
List<DeptVO> list = new ArrayList<>();
Optional.ofNullable(deptList).orElse(new ArrayList<>())
.stream()
.filter(dept -> dept.getParentId().equals(parentId))
.forEach(dept -> {
DeptVO deptVO = new DeptVO();
BeanUtil.copyProperties(dept, deptVO);
List<DeptVO> children = recursionForTableData(dept.getId(), deptList);
deptVO.setChildren(children);
list.add(deptVO);
});
return list;
}
/**
* 递归生成部门树形下拉数据
* @param parentId
* @param deptList
* @return
*/
public static List<TreeSelectVO> recursionForTreeSelect(int parentId, List<SysDept> deptList) {
List<TreeSelectVO> list = new ArrayList<>();
Optional.ofNullable(deptList).orElse(new ArrayList<>())
.stream()
.filter(dept -> dept.getParentId().equals(parentId))
.forEach(dept -> {
TreeSelectVO treeSelectVO = new TreeSelectVO();
treeSelectVO.setId(dept.getId());
treeSelectVO.setLabel(dept.getName());
List<TreeSelectVO> children = recursionForTreeSelect(dept.getId(), deptList);
treeSelectVO.setChildren(children);
list.add(treeSelectVO);
});
return list;
}
}
| [
"1490493387@qq.com"
] | 1490493387@qq.com |
991bd390cc3d8e9eaad2a34f8be27be7f21f1f7c | 0005158bf85fcb8f40cb4b8dcf503cbff7aace40 | /src/main/java/at/yawk/catdb/db/Database.java | cc45a5587bed544c915bc69d2c187c7b180ebfd3 | [] | no_license | yawkat/catdb | 3c32f7dfcb35dba8e10b86e93b5407160f1b12a3 | cbd0a5bf78b96063d99ec71b5a26221f8904a7b6 | refs/heads/master | 2016-09-06T04:53:20.987628 | 2015-08-07T19:04:08 | 2015-08-07T19:04:08 | 33,455,171 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 451 | java | package at.yawk.catdb.db;
import java.util.Collection;
import java.util.NoSuchElementException;
import java.util.Set;
import org.springframework.stereotype.Service;
/**
* @author yawkat
*/
@Service
public interface Database {
Image getImage(int id) throws NoSuchElementException;
Collection<Image> listImages(Set<String> tags);
Collection<Image> listImages();
void storeImage(Image image);
void deleteImage(Image image);
}
| [
"me@yawk.at"
] | me@yawk.at |
a2c18840c2459bc29f8f78c3b5e371b761e1728d | 4fe2271293410196af2fe5fa2cc924dba5f9de71 | /archive/branches/jdk15/src/java/org/skife/jdbi/Configuration.java | 6aa1cd4cad647b193a94b727192c947d19f681ce | [
"Apache-2.0"
] | permissive | TimVonsee/jdbi | 888058ae0dca71d33201aceca86eefa568e123b6 | 21a2a38ab60d2cef07029db8e98cf20def45db4c | refs/heads/master | 2020-03-11T15:34:39.734809 | 2011-12-01T18:44:45 | 2011-12-01T18:44:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,784 | java | /* Copyright 2004-2005 Brian McCallister
*
* 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.skife.jdbi;
/**
* Used by {@see AutoConfigurator} to hold found config values
*/
class Configuration
{
/** jdbc connection string url */
private String conn;
private String driver;
private String user;
private String pass;
private String handleDecoratorBuilder;
private String transactionHandler;
private String statementLocator;
String getRowMapper()
{
return rowMapper;
}
void setRowMapper(String rowMapper)
{
this.rowMapper = rowMapper;
}
private String rowMapper;
String getUsername()
{
return user;
}
void setUsername(String username)
{
this.user = username;
}
String getPassword()
{
return pass;
}
void setPassword(String password)
{
this.pass = password;
}
String getDriver()
{
return driver;
}
void setDriver(String driver)
{
this.driver = driver;
}
String getUrl()
{
return conn;
}
void setUrl(String url)
{
this.conn = url;
}
void validate()
{
if (conn == null) throw new DBIError("must provide a jdbc url property in properties");
if (driver == null) throw new DBIError("must provide a driver class name in properties");
if ((user != null && pass == null) || (pass != null && user == null))
{
throw new DBIError("If you specify username, or passwoord, in theproperties, you must specify both");
}
}
public void setHandleDecoratorBuilder(String class_name)
{
this.handleDecoratorBuilder = class_name;
}
public String getHandleDecoratorBuilder()
{
return handleDecoratorBuilder;
}
public String getTransactionHandler()
{
return transactionHandler;
}
public void setTransactionHandler(String transactionHandler)
{
this.transactionHandler = transactionHandler;
}
public void setStatementLocator(String property)
{
this.statementLocator = property;
}
public String getStatementLocator()
{
return statementLocator;
}
}
| [
"brianm@bef26512-0eee-0310-aad4-d1eb80de6c02"
] | brianm@bef26512-0eee-0310-aad4-d1eb80de6c02 |
a25c04b18976e26c5893bbe63704aa6b8e236653 | d60e287543a95a20350c2caeabafbec517cabe75 | /LACCPlus/Cloudstack/526_2.java | e86e3279e4e802012bb54b16d60c47b9a4e63619 | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,715 | java | //,temp,SHA256SaltedUserAuthenticator.java,48,92,temp,PBKDF2UserAuthenticator.java,52,104
//,3
public class xxx {
@Override
public Pair<Boolean, UserAuthenticator.ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Retrieving user: " + username);
}
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
s_logger.debug("Username or Password cannot be empty");
return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
}
boolean isValidUser = false;
UserAccount user = this._userAccountDao.getUserAccount(username, domainId);
if (user != null) {
isValidUser = true;
} else {
s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
}
byte[] salt = new byte[0];
int rounds = s_rounds;
try {
if (isValidUser) {
String[] storedPassword = user.getPassword().split(":");
if ((storedPassword.length != 3) || (!StringUtils.isNumeric(storedPassword[2]))) {
s_logger.warn("The stored password for " + username + " isn't in the right format for this authenticator");
isValidUser = false;
} else {
// Encoding format = <salt>:<password hash>:<rounds>
salt = decode(storedPassword[0]);
rounds = Integer.parseInt(storedPassword[2]);
}
}
boolean result = false;
if (isValidUser && validateCredentials(password, salt)) {
result = ConstantTimeComparator.compareStrings(user.getPassword(), encode(password, salt, rounds));
}
UserAuthenticator.ActionOnFailedAuthentication action = null;
if ((!result) && (isValidUser)) {
action = UserAuthenticator.ActionOnFailedAuthentication.INCREMENT_INCORRECT_LOGIN_ATTEMPT_COUNT;
}
return new Pair(Boolean.valueOf(result), action);
} catch (NumberFormatException e) {
throw new CloudRuntimeException("Unable to hash password", e);
} catch (NoSuchAlgorithmException e) {
throw new CloudRuntimeException("Unable to hash password", e);
} catch (UnsupportedEncodingException e) {
throw new CloudRuntimeException("Unable to hash password", e);
} catch (InvalidKeySpecException e) {
throw new CloudRuntimeException("Unable to hash password", e);
}
}
}; | [
"sgholami@uwaterloo.ca"
] | sgholami@uwaterloo.ca |
36e76c8483b641bbc0c89d909f1b469f6ebd84bc | 5b9a04d3c911c16aba63258d48606d6ea364a6da | /distribution_member/modules/dismember/app/mapper/dismember/AccountOperationRecordMapper.java | c5baaf5428f3422da5edc012ec18ce69a2d7a722 | [
"Apache-2.0"
] | permissive | yourant/repository1 | 40fa5ce602bbcad4e6f61ad6eb1330cfe966f780 | 9ab74a2dfecc3ce60a55225e39597e533975a465 | refs/heads/master | 2021-12-15T04:22:23.009473 | 2017-07-28T06:06:35 | 2017-07-28T06:06:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 551 | java | package mapper.dismember;
import java.util.List;
import entity.dismember.AccountOperationRecord;
public interface AccountOperationRecordMapper{
int deleteByPrimaryKey(Integer id);
int insert(AccountOperationRecord record);
int insertSelective(AccountOperationRecord record);
AccountOperationRecord selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AccountOperationRecord record);
int updateByPrimaryKey(AccountOperationRecord record);
List<AccountOperationRecord> selectByAccountId(Integer accountId);
} | [
"3002781863@qq.com"
] | 3002781863@qq.com |
5e6f14c1b0d15b449bc025f5f6ddadc1102aa0f1 | 7201a64a8f2380d4ec58edfa0f4c3526c9c3b0fe | /app/src/main/java/com/jc/message/MessageActivity.java | 96821187067f74ef59d268b2d29e2cd7c0102ba0 | [] | no_license | bsty2015/hsdandroid | 3a37a729eb025e563e6beb2927dfbff82b7fcb79 | 8f16c356c5be0481e023c49e3a02d6afb51c9776 | refs/heads/master | 2021-01-10T12:54:06.555882 | 2015-11-27T08:01:17 | 2015-11-27T08:01:17 | 46,967,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,208 | java | package com.jc.message;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import com.jc.base.Configure;
import com.jc.ui.FreshenList;
import com.jc.ui.HeadMenuActiviyt;
import com.jc.utils.GsonRequest;
/**
* Created by zy on 15/8/10.
*/
public class MessageActivity extends HeadMenuActiviyt {
private GsonRequest request;
protected FreshenList contentListview;
private String reqUrl = Configure.API_HOST+"/api/message/list";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(com.jc.R.layout.homepage);
initView();
setHeadTitleName("消息");
contentListview = (FreshenList)findViewById(com.jc.R.id.listView);
getData();
contentListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Message message = (Message) parent.getItemAtPosition(position);
Intent intent = new Intent(MessageActivity.this, MessageDetailActivity.class);
intent.putExtra("id", message.getMsgId());
startActivity(intent);
}
});
}
@Override
protected void onStart() {
super.onStart();
MessageAdapter adapter = new MessageAdapter(this,new MessageHolder(),contentListview);
request = new GsonRequest(reqUrl,adapter).withRequestParams("userId",app.getUserId().toString());
addRequest(request);
}
public void getData() {
// 调用MyListView中自定义接口
contentListview.setonRefreshListener(new FreshenList.OnRefreshListener() {
@Override
public void onRefresh() {
MessageAdapter adapter = new MessageAdapter(MessageActivity.this,new MessageHolder(),contentListview);
request = new GsonRequest(reqUrl,adapter).withRequestParams("userId",app.getUserId().toString());
addRequest(request);
contentListview.onRefreshComplete();
}
});
}
}
| [
"xxx@xxx.com"
] | xxx@xxx.com |
77e23e8953ed54a4d92e04d7b7ddc1e38a035733 | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/com/baidu/tts/database/FsFileInfoTable.java | 0b0546ed18d908a704c7818242beb7f3a3414808 | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 919 | java | package com.baidu.tts.database;
import com.baidu.tts.tools.SqlTool;
public class FsFileInfoTable {
public enum Field {
ABS_PATH("absPath", "varchar primary key"),
STATE("state", "integer");
/* renamed from: c */
private final String f10454c;
/* renamed from: d */
private final String f10455d;
private Field(String str, String str2) {
this.f10454c = str;
this.f10455d = str2;
}
public String getColumnName() {
return this.f10454c;
}
public String getDataType() {
return this.f10455d;
}
}
/* renamed from: a */
public static String m10971a() {
return SqlTool.sqlCreateTable("fsFileInfo", Field.values());
}
/* renamed from: b */
public static String m10972b() {
return SqlTool.sqlDropTable("fsFileInfo");
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
e09a3de8ab7ec64638cd7125d1cbcc34a1a3d4db | cef446b2308a485f5ab5d0c92c9a35e606902be6 | /npBle/src/main/java/npble/nopointer/ble/conn/callbacks/NpDataReceivedCallback.java | 99a40de430fbfb0c0bed5579348019ed38fab210 | [] | no_license | nopointer/npBle | 37843bc2a74c2daa97946acc00aa92af6c464a57 | 5123e66ae534e18379310426aec6739b6fa1eda7 | refs/heads/master | 2022-09-11T02:47:03.276379 | 2022-09-05T15:21:36 | 2022-09-05T15:21:36 | 228,141,790 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 707 | java | package npble.nopointer.ble.conn.callbacks;
import android.bluetooth.BluetoothDevice;
import android.support.annotation.NonNull;
import java.util.UUID;
import no.nordicsemi.android.ble.callback.DataReceivedCallback;
import no.nordicsemi.android.ble.data.Data;
public abstract class NpDataReceivedCallback implements DataReceivedCallback {
private UUID uuid;
public NpDataReceivedCallback(UUID uuid) {
this.uuid = uuid;
}
@Override
public void onDataReceived(@NonNull BluetoothDevice device, @NonNull Data data) {
onDataReceived(device, data, uuid);
}
public abstract void onDataReceived(@NonNull BluetoothDevice device, @NonNull Data data, UUID uuid);
}
| [
"857508412@qq.com"
] | 857508412@qq.com |
02cbe72330e2e6310be626474613e4de73b95661 | 565dc84a954f8e370f18bfbd1d37ee74f990b5dc | /src/main/java/party/lemons/gubbins/misc/CampfireDye.java | 70f16bcccdb503c8fe959aea0c9ca89df230b5d4 | [
"MIT"
] | permissive | Lemonszz/gubbins | bde496fdaa6a85ba359ce59afa7c6ca04c2465f9 | 9694e31bd6d8c0250c958d7c66a76814ecc6028c | refs/heads/master | 2022-11-27T01:14:54.161508 | 2020-07-17T04:32:30 | 2020-07-17T04:32:30 | 252,819,163 | 1 | 1 | MIT | 2020-06-29T13:12:33 | 2020-04-03T19:16:41 | Java | UTF-8 | Java | false | false | 160 | java | package party.lemons.gubbins.misc;
import net.minecraft.util.DyeColor;
public interface CampfireDye
{
DyeColor getColor();
void setColor(DyeColor color);
}
| [
"lemonverse@gmail.com"
] | lemonverse@gmail.com |
563c3c5c8c57b1c22f69cb576f5b444aea2bf613 | bae044700e430e4725e81c824904b7a11c15d1fd | /app/src/main/java/app/mamac/albadiya/SecondFragment.java | fd350ed43584a1a14cbeb1bc2afc1ca047fdca79 | [] | no_license | prudhviraj038/MyApplicationAl | bcec636185743ff7a78d3f181c7bbc04a48bbc06 | ca4c6998c7265bf36340aee2dcae9d3536fda39e | refs/heads/master | 2021-01-11T11:52:55.875623 | 2017-02-06T10:17:51 | 2017-02-06T10:17:51 | 76,710,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,520 | java | package app.mamac.albadiya;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.gson.JsonObject;
import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.ion.Ion;
/**
* Created by T on 30-11-2016.
*/
public class SecondFragment extends Fragment {
EditText firstname;
EditText lastname;
EditText username;
EditText password;
EditText email;
EditText phone;
TextView signin_btn;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.second_fragment, container, false);
firstname = (EditText) view.findViewById(R.id.firstname);
lastname = (EditText) view.findViewById(R.id.lastname);
username = (EditText) view.findViewById(R.id.email);
password = (EditText) view.findViewById(R.id.password);
email = (EditText) view.findViewById(R.id.email);
phone = (EditText) view.findViewById(R.id.phone);
signin_btn = (TextView) view.findViewById(R.id.signin_btn);
signin_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String EMAIL_REGEX="^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
//final String PHONE_REGEX= "\\d{3}-\\d{7}";
String fname = firstname.getText().toString();
fname = fname.trim();
String lname = lastname.getText().toString();
lname = lname.trim();
String uname = username.getText().toString();
uname = uname.trim();
String pass = password.getText().toString();
String Email = email.getText().toString();
Email = Email.trim();
String number = phone.getText().toString();
if (fname.equals("")){
Toast.makeText(getActivity(),"please enter firstname",Toast.LENGTH_SHORT).show();
firstname.requestFocus();
}else if (!fname.matches("[a-zA-Z|\\s]+")){
Toast.makeText(getActivity(),"please enter valid firstname",Toast.LENGTH_SHORT).show();
}else if (lname.equals("")){
Toast.makeText(getActivity(),"please eneter lastname",Toast.LENGTH_SHORT).show();
lastname.requestFocus();
}else if (!lname.matches("[a-zA-Z|\\s]+")){
Toast.makeText(getActivity(),"please enter valid lastname",Toast.LENGTH_SHORT).show();
}else if (uname.equals("")){
Toast.makeText(getActivity(),"please enter username",Toast.LENGTH_SHORT).show();
username.requestFocus();
}else if (!uname.matches("[a-zA-Z|[0-9]\\s]+")){
Toast.makeText(getActivity(),"please enter valid username",Toast.LENGTH_SHORT).show();
}else if (pass.equals("")){
Toast.makeText(getActivity(),"please enter password",Toast.LENGTH_SHORT).show();
password.requestFocus();
}else if (Email.equals("")){
Toast.makeText(getActivity(),"please enter email",Toast.LENGTH_SHORT).show();
email.requestFocus();
}else if (!Email.matches(EMAIL_REGEX)){
Toast.makeText(getActivity(),"please enter valid email",Toast.LENGTH_SHORT).show();
}else if (number.equals("")) {
Toast.makeText(getActivity(), "please enter phone number", Toast.LENGTH_SHORT).show();
phone.requestFocus();
}else {
Ion.with(SecondFragment.this)
.load("http://clients.yellowsoft.in/lawyers/api/add-member.php")
.setBodyParameter("fname",fname)
.setBodyParameter("lname",lname)
.setBodyParameter("username",uname)
.setBodyParameter("phone",number)
.setBodyParameter("email",Email)
.setBodyParameter("password",pass)
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() {
@Override
public void onCompleted(Exception e, JsonObject result) {
if (result.get("status").getAsString().equals("Success")) {
Toast.makeText(getActivity(), result.get("message").getAsString(), Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(getActivity(),result.get("message").getAsString(),Toast.LENGTH_SHORT).show();
}
}
});
}
}
});
return view;
}
}
| [
"prudhviraj038@gmail.com"
] | prudhviraj038@gmail.com |
be7b39463a300f1d3fdc15f5b88f1d5da0ff12be | a6b49ffd6597c768712a98df27c306ad4549266b | /src/main/java/cn/xdean/jex/lang/TimingUtil.java | 27e9934d0c033dc351b3a3a1e852499ae4bdb9cd | [
"Apache-2.0"
] | permissive | anandvarkeyphilips/Java-EX | 1374992be64d7e0640070db6613b02a1dfda4baa | 4aa47f110abbae74ad4888721df83731a05f1f31 | refs/heads/master | 2022-12-25T02:06:03.710377 | 2020-07-15T08:30:04 | 2020-07-15T08:30:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,234 | java | package cn.xdean.jex.lang;
import cn.xdean.jex.lang.function.FunctionAdapter;
import com.google.common.base.Stopwatch;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class TimingUtil {
public static void timeThen(Runnable r, Consumer<Long> then) {
Stopwatch s = getShareStopwatch();
s.reset();
s.start();
r.run();
s.stop();
if (then != null) {
then.accept(s.elapsed(TimeUnit.MILLISECONDS));
}
}
public static void timeThenPrint(Runnable r, String format) {
timeThen(r, l -> System.out.printf(format, l));
}
public static <T> T timeThen(Supplier<T> s, Consumer<Long> then) {
return FunctionAdapter.supplierToRunnable(s, t -> timeThen(t, then));
}
public static <T> T timeThenPrint(Supplier<T> r, String format) {
return timeThen(r, l -> System.out.printf(format, l));
}
/**
* @param uniqueKey unique key
* @param r the task
* @param then (this time, total time) -> {...}
*/
public static void seriesTimeThen(Object uniqueKey, Runnable r, BiConsumer<Long, Long> then) {
Stopwatch total = CacheUtil.cache(TimingUtil.class, uniqueKey, () -> Stopwatch.createUnstarted());
Stopwatch temp = getShareStopwatch();
temp.reset();
temp.start();
total.start();
r.run();
temp.stop();
total.stop();
if (then != null) {
then.accept(temp.elapsed(TimeUnit.MILLISECONDS), total.elapsed(TimeUnit.MILLISECONDS));
}
}
public static void seriesTimeThen(Runnable r, BiConsumer<Long, Long> then) {
seriesTimeThen(r, r, then);
}
public static <T> T seriesTimeThen(Object uniqueKey, Supplier<T> s, BiConsumer<Long, Long> then) {
return FunctionAdapter.supplierToRunnable(s, t -> seriesTimeThen(uniqueKey, t, then));
}
public static <T> T seriesTimeThen(Supplier<T> s, BiConsumer<Long, Long> then) {
return seriesTimeThen(s, s, then);
}
private static Stopwatch getShareStopwatch() {
Stopwatch share = CacheUtil.cache(TimingUtil.class, Thread.currentThread(), () -> Stopwatch.createUnstarted());
return share.isRunning() ? Stopwatch.createUnstarted() : share;
}
}
| [
"373216024@qq.com"
] | 373216024@qq.com |
b4d3df6fbd060d114e6ad768d59f3f0408a9b927 | bb448de9035032578768a9951ddd55f98ac3f5d9 | /task-server/src/main/java/com/fuli/task/server/model/Result.java | f78ec01d35f376b7c13c524ac94c7b39a579a73e | [] | no_license | zhangdongsheng1991/fuli-basic-platform1 | 61476969a74449f5f05452205044336844846cdd | ee7d7bdda01651a0ddb4507cd083e6af42266335 | refs/heads/master | 2022-06-22T12:56:38.025301 | 2020-01-13T10:14:53 | 2020-01-13T10:14:53 | 233,567,009 | 0 | 0 | null | 2022-06-17T02:51:13 | 2020-01-13T10:13:15 | Java | UTF-8 | Java | false | false | 3,356 | java | package com.fuli.task.server.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fuli.task.server.constant.CodeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;
import java.io.Serializable;
/**
* 统一响应对象
*
* @Author: XYJ
* @CreateDate: 2019/7/5
* @Version: 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldNameConstants
public class Result<T> implements Serializable {
private static final long serialVersionUID = -993309571681498675L;
@ApiModelProperty(name = "data", value = "响应数据")
private T data;
@ApiModelProperty(name = "code", value = "响应编码")
private int code;
@ApiModelProperty(name = "msg", value = "响应消息")
private String msg;
@JsonIgnore
public boolean checkIs200() {
return code == CodeEnum.SUCCESS.getCode();
}
/**
* 操作成功,返回默认响应 code 200
*
* @param <T>
* @return
*/
public static <T> Result<T> succeed() {
return succeedWith(null, CodeEnum.SUCCESS.getCode(), CodeEnum.SUCCESS.getMsg());
}
/**
* 操作失败,返回默认响应 code -1
*
* @param <T>
* @return
*/
public static <T> Result<T> failed() {
return failedWith(null, CodeEnum.ERROR.getCode(), CodeEnum.ERROR.getMsg());
}
public Result(CodeEnum codeEnum) {
this.data = null;
this.code = codeEnum.getCode();
this.msg = codeEnum.getMsg();
}
public static <T> Result<T> succeedMsg(String msg) {
return succeedWith(null, CodeEnum.SUCCESS.getCode(), msg);
}
public static <T> Result<T> succeed(T model, String msg) {
return succeedWith(model, CodeEnum.SUCCESS.getCode(), msg);
}
public static <T> Result<T> succeed(T data) {
return succeedWith(data, CodeEnum.SUCCESS.getCode(), CodeEnum.SUCCESS.getMsg());
}
public static <T> Result<T> succeed(Integer code, String msg) {
return new Result<T>(null, code, msg);
}
public static <T> Result<T> succeedWith(T data, Integer code, String msg) {
return new Result<T>(data, code, msg);
}
public static <T> Result<T> failed(String msg) {
return failedWith(null, CodeEnum.ERROR.getCode(), msg);
}
public static <T> Result<T> failed(T data, String msg) {
return failedWith(data, CodeEnum.ERROR.getCode(), msg);
}
/**
* 操作失败,传入CodeEnum
*
* @param <T>
* @return
*/
public static <T> Result<T> failed(CodeEnum codeEnum) {
return new Result<T>(null, codeEnum.getCode(), codeEnum.getMsg());
}
public static <T> Result<T> failedWith(T data, Integer code, String msg) {
return new Result<T>(data, code, msg);
}
/**
* 判断影响的行数, 如果不对报--操作失败,传入非法数据
*
* @param rows
* @return
*/
public static <T> Result<T> verify(int rows) {
if (1 != rows) {
return new Result<T>(null, CodeEnum.ILLEGAL_DATA_ERROR.getCode(), CodeEnum.ILLEGAL_DATA_ERROR.getMsg());
}
return succeedWith(null, CodeEnum.SUCCESS.getCode(), CodeEnum.SUCCESS.getMsg());
}
}
| [
"360940982@qq.com"
] | 360940982@qq.com |
37826b653c0e8c1bf72476e8143916501a7aeec9 | c336d69e37fa2231146ce28361112f7ef90e56a3 | /src/parties/in4010/q12015/group10/OpponentStrategyEstimator.java | 924d7b69129e12da4eec491fc71153e5457b9b1b | [] | no_license | Escheck/agents | a1ca77337ab86b8529a5c79cfcd5b4dd042f9d1b | eaf931a9d08ae04e5e6a73a5c55d7838bb52eb74 | refs/heads/master | 2021-03-30T23:41:20.882648 | 2018-09-15T20:54:30 | 2018-09-15T20:54:30 | 125,048,191 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,896 | java | package parties.in4010.q12015.group10;
import static java.lang.Math.pow;
import java.util.Iterator;
import java.util.List;
import misc.Range;
import negotiator.Bid;
import negotiator.Deadline;
import negotiator.DeadlineType;
import negotiator.bidding.BidDetails;
import negotiator.boaframework.OutcomeSpace;
import negotiator.timeline.TimeLineInfo;
import negotiator.utility.AdditiveUtilitySpace;
public class OpponentStrategyEstimator {
static double updateAllModels(Opponent[] opponents, Deadline deadLine,
TimeLineInfo timeLine, AdditiveUtilitySpace myUtilitySpace) {
boolean acceptableQuality = false;
if (deadLine.getType() == DeadlineType.TIME) {
return 0.0;
}
int maxNumberOfBids = deadLine.getValue();
double nextBidNumberDouble = timeLine.getCurrentTime()
/ timeLine.getTotalTime();
int nextBidNumber = ((int) nextBidNumberDouble);
// generate time array
double[] totalTimeArray = new double[maxNumberOfBids];
for (int bidNumber = 0; bidNumber < maxNumberOfBids; bidNumber++) {
totalTimeArray[bidNumber] = ((double) nextBidNumber)
/ ((double) maxNumberOfBids);
}
// for each opponent
// u = 1+a*t+b*t^c
// see report
double[] a = new double[opponents.length]; // estimated boulware
// parameter
double[] b = new double[opponents.length]; // estimated boulware
// parameter
double[] c = new double[opponents.length]; // estimated boulware
// parameter
double[] d = new double[opponents.length]; // estimated boulware
// parameter
double[] errorVariance = new double[opponents.length]; // estimated
// variance of
// error for the
// found fit
// estimate fitting parameters
double minimumPassedTime = 0.75; // this is the minimum time that must
// be passed before we consider
// getting an estimate
double powerIncrement = 0.2;
int maxLoops = 100;
int spacing = 5;
int beginOffset = 1;
// System.out.println("minimumPassedTimeboolean"+minimumPassedTime);
if (timeLine.getTime() > minimumPassedTime) {
acceptableQuality = true;
}
for (int opponentNumber = 0; opponentNumber < opponents.length; opponentNumber++) {
if (opponents[opponentNumber].getHistorySize() < 10 * spacing) {
return 0.0;
}
}
if (acceptableQuality) {
for (int opponentNumber = 0; opponentNumber < opponents.length; opponentNumber++) {
double[] bidEval = new double[opponents[opponentNumber]
.getHistorySize()];
double[] time = new double[opponents[opponentNumber]
.getHistorySize()];
// for each bid in the history
Bid bid;
for (int bidNumber = 0; bidNumber < opponents[opponentNumber]
.getHistorySize(); bidNumber++) {
bid = opponents[opponentNumber]
.getBidfromHistory(bidNumber);
try {
bidEval[bidNumber] = opponents[opponentNumber]
.getEstimatedUtilitySpace().getUtility(bid);
} catch (Exception e) {
e.printStackTrace();
}
time[bidNumber] = ((double) bidNumber)
/ ((double) deadLine.getValue());
}
// begin offset not implemented
double[] minTime = boulwareParameterEstimator.getMinTime(
bidEval, time, spacing, beginOffset);
double[] minBidEval = boulwareParameterEstimator.getMinEval(
bidEval, time, spacing, beginOffset);
double[] parABCE = boulwareParameterEstimator.leastSquaresFit(
minBidEval, minTime, maxLoops, powerIncrement);
a[opponentNumber] = parABCE[0];
b[opponentNumber] = parABCE[1];
c[opponentNumber] = parABCE[2];
d[opponentNumber] = parABCE[3];
errorVariance[opponentNumber] = parABCE[4];
System.out.println("errorVariance"
+ errorVariance[opponentNumber]);
}
}
// if the minimum variance is higher than the threshold the model is
// deemed unusable
double modelQualityThreshold = 0.02;
for (int n = 0; n < errorVariance.length; n++) {
if (errorVariance[n] > modelQualityThreshold) {
acceptableQuality = true;
}
}
// get the full outcome space
Range UtilRange = new Range(0, 1);
OutcomeSpace fullOutComeSpace = new OutcomeSpace(myUtilitySpace);
List<BidDetails> allPossibleBids = fullOutComeSpace
.getBidsinRange(UtilRange);
double[] maxUtilityMySpaceOfCommonBids = new double[maxNumberOfBids];
// for each opponent:
// get the estimated lowerbound on the bidding utility that they will
// bid unitl N bids before the deadline
double t; // non array time variable
int offsetBidsFromDeadLine = 4;
double[] lowerBoundOfferedUtility = new double[opponents.length];
double totalMaxUtilityMySpaceOfCommonBids = 0;
if (acceptableQuality) {
// for each future bidnumber
for (int bidNumber = nextBidNumber; bidNumber < maxNumberOfBids
- offsetBidsFromDeadLine; bidNumber++) {
// for each opponent get the lower bound on the expected utility
for (int opponentNumber = 1; opponentNumber < opponents.length; opponentNumber++) {
t = totalTimeArray[bidNumber];
lowerBoundOfferedUtility[opponentNumber] = a[opponentNumber]
+ b[opponentNumber]
* t
+ c[opponentNumber]
* pow(t, d[opponentNumber]);
}
// ////// check the max attainable common utility
maxUtilityMySpaceOfCommonBids[bidNumber] = 0;
for (Iterator<BidDetails> BidDetailsIterator = allPossibleBids
.iterator(); BidDetailsIterator.hasNext();) {
// Iterates over all possible bids
BidDetails bidDetails = BidDetailsIterator.next();
Bid bid = bidDetails.getBid();
boolean bidInCommonBidRange = true;
double utilityOfBid;
for (int opponentNumber = 1; opponentNumber < opponents.length; opponentNumber++) {
utilityOfBid = 0;
try {
utilityOfBid = opponents[opponentNumber]
.getEstimatedUtilitySpace().getUtility(bid);
} catch (Exception e1) {
e1.printStackTrace();
} // Throws Exception when bid is invalid
if (utilityOfBid < lowerBoundOfferedUtility[opponentNumber]) {
bidInCommonBidRange = false;
}
}
if (bidInCommonBidRange) {
utilityOfBid = 0;
try {
utilityOfBid = myUtilitySpace.getUtility(bid);
} catch (Exception e1) {
e1.printStackTrace();
} // Throws Exception when bid is invalid
if (maxUtilityMySpaceOfCommonBids[bidNumber] < utilityOfBid) {
maxUtilityMySpaceOfCommonBids[bidNumber] = utilityOfBid;
}
}
}
// //////
}
for (int bidNumber = nextBidNumber; bidNumber < maxNumberOfBids
- offsetBidsFromDeadLine; bidNumber++) {
if (totalMaxUtilityMySpaceOfCommonBids < maxUtilityMySpaceOfCommonBids[bidNumber]) {
totalMaxUtilityMySpaceOfCommonBids = maxUtilityMySpaceOfCommonBids[bidNumber];
}
}
}
double uncertaintyBandwidth = 0.05;
return totalMaxUtilityMySpaceOfCommonBids - uncertaintyBandwidth;
}
}
| [
"Escheck2000-o2@yahoo.de"
] | Escheck2000-o2@yahoo.de |
c1bac0ef5942ec3d4f293c6615eaf3f6a0c157f0 | b718686e4feb0fb7579af268f2037c737a1ceb9a | /src/main/java/com/mossle/guest/web/GuestController.java | a1242ef3914b5c4bc007f10da32d29f612bf3eb1 | [
"Apache-2.0"
] | permissive | SuiteLHY/lemon | cc0ff01df0c16c3ffaebdf64ae4a7bf736e47dea | b2bfe0487adbc8cdd5042dab7e2a992c4bb36e53 | refs/heads/master | 2020-05-26T19:51:03.913796 | 2019-05-07T11:20:46 | 2019-05-07T11:20:46 | 188,353,423 | 1 | 0 | Apache-2.0 | 2019-05-24T04:42:42 | 2019-05-24T04:42:42 | null | UTF-8 | Java | false | false | 3,214 | java | package com.mossle.guest.web;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.mossle.core.spring.MessageHelper;
import com.mossle.user.service.ChangePasswordService;
import com.mossle.user.support.ChangePasswordResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
@RequestMapping("guest")
public class GuestController {
private static Logger logger = LoggerFactory
.getLogger(GuestController.class);
private MessageHelper messageHelper;
private ChangePasswordService changePasswordService;
@RequestMapping("change-password-input")
public String changePasswordInput(HttpServletRequest request, Model model) {
String username = (String) request.getSession().getAttribute(
"SECURITY_LAST_USERNAME");
if (username == null) {
logger.info("username is null");
return "redirect:/common/login.jsp";
}
return "guest/change-password-input";
}
@RequestMapping("change-password-save")
public String changePasswordSave(
@RequestParam("oldPassword") String oldPassword,
@RequestParam("newPassword") String newPassword,
@RequestParam("confirmPassword") String confirmPassword,
HttpServletRequest request, RedirectAttributes redirectAttributes)
throws Exception {
String username = (String) request.getSession().getAttribute(
"SECURITY_LAST_USERNAME");
if (username == null) {
logger.info("username is null");
return "redirect:/common/login.jsp";
}
ChangePasswordResult changePasswordResult = changePasswordService
.changePassword(username, oldPassword, newPassword,
confirmPassword);
if (changePasswordResult.isSuccess()) {
messageHelper.addFlashMessage(redirectAttributes,
changePasswordResult.getCode(),
changePasswordResult.getMessage());
return "redirect:/guest/change-password-success.do";
} else {
messageHelper.addFlashMessage(redirectAttributes,
changePasswordResult.getCode(),
changePasswordResult.getMessage());
return "redirect:/guest/change-password-input.do";
}
}
@RequestMapping("change-password-success")
public String changePasswordSuccess() {
return "guest/change-password-success";
}
// ~ ======================================================================
@Resource
public void setMessageHelper(MessageHelper messageHelper) {
this.messageHelper = messageHelper;
}
@Resource
public void setChangePasswordService(
ChangePasswordService changePasswordService) {
this.changePasswordService = changePasswordService;
}
}
| [
"xyz20003@gmail.com"
] | xyz20003@gmail.com |
cb502efb623a5d1eb00b0f41616947f67cffece8 | 139960e2d7d55e71c15e6a63acb6609e142a2ace | /mobile_app1/module1183/src/main/java/module1183packageJava0/Foo2502.java | ce390844089436e6042a3e4a088fdc2a4a70742b | [
"Apache-2.0"
] | permissive | uber-common/android-build-eval | 448bfe141b6911ad8a99268378c75217d431766f | 7723bfd0b9b1056892cef1fef02314b435b086f2 | refs/heads/master | 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 | Apache-2.0 | 2021-09-24T08:55:30 | 2020-09-11T23:27:37 | Java | UTF-8 | Java | false | false | 378 | java | package module1183packageJava0;
import java.lang.Integer;
public class Foo2502 {
Integer int0;
public void foo0() {
new module1183packageJava0.Foo2501().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"oliviern@uber.com"
] | oliviern@uber.com |
d7384178916db1728154060af6bef6c4e46f0274 | 21017a76c972c0d1220bba05a9ffeb75fa620403 | /Replicacao/CAPESReplicacaoComumEJB/src/main/java/br/com/sicoob/capes/replicacao/negocio/delegates/ListaItemDelegate.java | 191bd4ec4787786def79a6824f910471af166929 | [] | no_license | pabllo007/cpes | a1b3b8920c9b591b702156ae36663483cd62a880 | f4fc8dce3d487df89ac8f88c41023bc8db91b0c2 | refs/heads/master | 2022-11-28T02:55:07.675359 | 2019-10-27T22:17:53 | 2019-10-27T22:17:53 | 217,923,554 | 0 | 0 | null | 2022-11-24T06:24:02 | 2019-10-27T22:13:09 | Java | ISO-8859-1 | Java | false | false | 2,069 | java | /**
*
*/
package br.com.sicoob.capes.replicacao.negocio.delegates;
import br.com.bancoob.excecao.BancoobException;
import br.com.sicoob.capes.negocio.entidades.legado.ListaItem;
import br.com.sicoob.capes.negocio.entidades.legado.pk.ListaItemPK;
import br.com.sicoob.capes.replicacao.negocio.servicos.ListaItemServico;
import br.com.sicoob.capes.replicacao.negocio.servicos.locator.CAPESReplicacaoComumServiceLocator;
/**
* Delegate para os itens das listas.
* @author Erico.Junior
*/
public class ListaItemDelegate extends EntidadeDominioReplicavelDelegate<ListaItem, ListaItemServico> {
/**
* {@inheritDoc}
*/
@Override
protected ListaItemServico localizarServico() {
return CAPESReplicacaoComumServiceLocator.getInstance().localizarListaItemServico();
}
/**
* Obter prod lab.
*
* @param listaItemPK o valor de lista item pk
* @param idCooperativaProdlab o valor de id cooperativa prodlab
* @return ListaItem
* @throws BancoobException lança a exceção BancoobException
*/
public ListaItem obterProdLab(ListaItemPK listaItemPK, Integer idCooperativaProdlab) throws BancoobException {
return getServico().obterProdLab(listaItemPK, idCooperativaProdlab);
}
/**
* O método Incluir prod lab.
*
* @param listaItemReplicacao o valor de lista item replicacao
* @param idCooperativaProdlab o valor de id cooperativa prodlab
* @throws BancoobException lança a exceção BancoobException
*/
public void incluirProdLab(ListaItem listaItemReplicacao, Integer idCooperativaProdlab) throws BancoobException {
getServico().incluirProdLab(listaItemReplicacao, idCooperativaProdlab);
}
/**
* O método Alterar prod lab.
*
* @param listaItemReplicacao o valor de lista item replicacao
* @param idCooperativaProdlab o valor de id cooperativa prodlab
* @throws BancoobException lança a exceção BancoobException
*/
public void alterarProdLab(ListaItem listaItemReplicacao, Integer idCooperativaProdlab) throws BancoobException {
getServico().alterarProdLab(listaItemReplicacao, idCooperativaProdlab);
}
} | [
"="
] | = |
aeb0644dd950b393fdccc5bc82bf08e73b5fc9c8 | 51a0fe217447f27c9ab961bb79753bbccb6233dc | /src/main/java/com/xtel/nipservicesdk/callback/CallbackManager.java | f9eb7daf045223a46dff1d3523523ce8430cf9c3 | [] | no_license | vihahb/NIPmodule | b2969cb1ed0500f029abe3374862336c47755b79 | 72714ae7ea7b94e3f6d329729a91aae86899727e | refs/heads/master | 2021-03-30T17:28:22.387640 | 2017-11-05T06:35:28 | 2017-11-05T06:35:28 | 78,005,005 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | package com.xtel.nipservicesdk.callback;
import com.xtel.nipservicesdk.model.entity.Error;
import com.xtel.nipservicesdk.model.entity.RESP_Login;
/**
* Created by vihahb on 1/4/2017
*/
public interface CallbackManager {
void onSuccess(RESP_Login success);
void onError(Error error);
}
| [
"vihahb@gmail.com"
] | vihahb@gmail.com |
07abb88355c73e207361b7a5764952dff8bcacfd | 3bc15fa92f9a7336e855a32f8b16173dd916713c | /mobile-core-new/src/main/java/com/shangpin/core/dao/RoleDAO.java | 903924011f5c7e4b90790053d5e3a141a8b3f3db | [] | no_license | cenbow/2016_sp_mobile | 36018bea8154b9deaf9d15dbf1b4e2ec90eb1191 | 5edb6203a5cf4352db7c051f3fd1ef12ccada32c | refs/heads/master | 2020-04-06T04:44:14.075549 | 2016-06-15T05:19:25 | 2016-06-15T05:19:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | /**
* <pre>
* Copyright: Copyright(C) 2011-2012, shangpin.com
* Filename: com.shangpin.manager.dao.RoleDao.java
* Class: RoleDao
* Date: 2012-8-7
* Author: <a href="mailto:sundful@gmail.com">sundful</a>
* Version 1.1.0
* Description:
*
* </pre>
**/
package com.shangpin.core.dao;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import com.shangpin.core.entity.main.Role;
/**
*
* @author <a href="mailto:sundful@gmail.com">sundful</a>
* Version 1.1.0
* @since 2012-8-7 下午5:03:07
*/
public interface RoleDAO extends JpaRepository<Role, Long> {
Page<Role> findByNameContaining(String name, Pageable pageable);
}
| [
"fengwenyu@shangpin.com"
] | fengwenyu@shangpin.com |
25ba956589b3fbfb164c439884a883a0abf1df1c | 9dfb06fb888a7f5d79f590eb11f62618d893af93 | /hashmap/187. Repeated DNA Sequences.java | ce11798feae2bc66f94997f420d52463bfacff4e | [] | no_license | fanyang88/leetcode_java | ac1b009d2ae374a4a87c92610820af391ec530b8 | 73e145a7f8f5f76c1159e622ccc2c8f6ffa53f48 | refs/heads/master | 2022-07-20T00:47:04.826563 | 2022-07-18T22:25:37 | 2022-07-18T22:25:37 | 163,878,007 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,724 | java | /**
*
* All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG".
* When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.
Write a function to find all the 10-letter-long sequences (substrings)
that occur more than once in a DNA molecule.
Example:
Input: s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
Output: ["AAAAACCCCC", "CCCCCAAAAA"]
*/
/*
The whole idea is to transform the DNA string to numbers (so it'll be quicker for comparison), and this is actually easy since we know for a fact that the sequence only consists of 4 letters (all upper case) 'A', 'C', 'G' and 'T'.
If we want to map this to binary, we'd need (log 4 = 2)
00 -> 'A'
01 -> 'C'
10 -> 'G'
11 -> 'T'
so we create an array to save these value
char[] map = new char[26];
map['A' - 'A'] = 0;
map['C' - 'A'] = 1;
map['G' - 'A'] = 2;
map['T' - 'A'] = 3;
So, let's transform the sequence:
First of all, we need 20 bits (10 letters * 2 bits for representing each letter)
So we start with a variable V = 0.
Then for each letter we shift V to the left by 2 bits and OR it with the letter representation
so for sequence "CG" for example:
v = 0
v <<= 2
v = 00
v= v | map[s.charAt(j) - 'A'] = 00 | 01 = 01
Nex Character "G":
v = 01
v <<= 2
v = 0100
v = v | map[s.charAt(j) - 'A'] = 0100 | 10 = 0110
go on for the 10 chars.
Added to set1 (Then don't do anything, and notice here that we're depending on the condition short circuiting, so it won't continue to execute the addition to the second set since we're using && and the first condition was true and we're using not, so it will be false) - then - we do nothing.
Not added to set1 and added to set 2 - then - that means that we saw that exact number before, so we add it to the output list.
Not added to set and Not added to set 2 - then - that means that we saw that number before Twice, so do nothing.
*/
class Solution {
public List<String> findRepeatedDnaSequences(String s) {
Map<Character, Integer> map = new HashMap<Character, Integer>();
HashSet<Integer> set = new HashSet<Integer>();
HashSet<Integer> secSet = new HashSet<Integer>();
List<String> res = new ArrayList<String>();
map.put('A', 0);
map.put('C', 1);
map.put('G', 2);
map.put('T', 3);
for(int i=0; i<s.length()-9;i++) {
int v=0;
// make every 10 ACGT represent by a value v
for(int j=i; j<i+10; j++) {
v= v<<2;
v = v| map.get(s.charAt(j));
}
if(!set.add(v) && secSet.add(v)) {// set has, secSet doesn't has
res.add(s.substring(i, i+10));
}
}
return res;
}
}
| [
"fan.yang@oath.com"
] | fan.yang@oath.com |
2ee6c11c2dd7ee0744c61dd557aab9cbd56319f5 | 5a1e8427823a5e21cc88a35599d81f10bdcbd7d0 | /ch01/src/ch01/LiteralExam9.java | fcef6bda34bea2d6cc5400dda9d3c1a571aa1b61 | [] | no_license | unisung/java01 | b5e6d71d0c1561f143c9c5549e3789a9503e11f0 | e1cfb4a81fcebb2af8fd1c4cfe323451da17161f | refs/heads/master | 2022-07-24T07:57:37.281861 | 2020-05-13T08:44:44 | 2020-05-13T08:44:44 | 257,546,913 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 605 | java | package ch01;
//리터럴- 정수리터럴의 기본타입-int/실수리터럴의 기본타입-double
public class LiteralExam9 {
public static void main(String[] args) {
int i = 12;//정수타입의 리터럴은 int타입이 default
int j = 24;//int타입 리터럴로 간주
long l = 24l;
float f = 0.1234f;
double d = .1234d;//실수타입의 리터럴은 double이 default
float e = .1234f;//실수타입 double 리터럴로 간주
System.out.println("i="+i);
System.out.println("l="+l);
System.out.println("f="+f);
System.out.println("d="+d);
System.out.println("e="+e);
}
}
| [
"vctor@naver.com"
] | vctor@naver.com |
d0e843577e961cfc2dc52072509f332d6558c804 | 3c4524a142e408cf02aef140c83bae3f1550d3d2 | /src/inputport/datacomm/simplex/buffer/nio/ObservableNIOManager.java | 8f2c52b6a582fb5e79d5dccd830cd337a8488fd6 | [] | no_license | JohnEspenhahn/GIPC | de36c9732070750e9aaa37d055679784a4ad60d9 | ce0455dd29d00a85bfc6bbb3f11a47d2f5b7c4e2 | refs/heads/master | 2021-01-20T14:19:45.441759 | 2017-05-09T21:39:08 | 2017-05-09T21:39:08 | 90,592,602 | 0 | 0 | null | 2017-05-08T06:13:35 | 2017-05-08T06:13:35 | null | UTF-8 | Java | false | false | 1,110 | java | package inputport.datacomm.simplex.buffer.nio;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
public interface ObservableNIOManager {
public void accept(ServerSocketChannel aChannel, SocketChannelAcceptListener aListener);
public void accept(ServerSocketChannel aChannel, SocketChannelAcceptListener[] listeners);
public void connect(SocketChannel aSocketChannel, InetAddress theServerHost, int thePort, SocketChannelConnectListener aListener);
public void connect(SocketChannel aSocketChannel, InetAddress theServerHost, int thePort, SocketChannelConnectListener[] listeners);
public void write(SocketChannel aChannel, ByteBuffer aByteBuffer, SocketChannelWriteListener aListener);
public void write(SocketChannel aChannel, ByteBuffer aByteBuffer, SocketChannelWriteListener[] listeners);
public void addReadListener(SocketChannel aChannel, SocketChannelReadListener aListener);
public void addCloseListener(SocketChannel aChannel, SocketChannelCloseListener aListener);
}
| [
"dewan@DEWAN.cs.unc.edu"
] | dewan@DEWAN.cs.unc.edu |
b1ecf8900e38be21813766a920df68c31221bf46 | 6a76f50178607b4843d560cf9fb2e1d34a456b1b | /validation/src/main/java/org/syaku/tutorials/spring/boot/config/ValidationConfiguration.java | 703a8b0daa19ecf13193101795bdd5c77c7c297f | [] | no_license | syakuis/spring-tutorials | 3935eeb5e4cfae3eb78ef4b56a00435825d6f6f7 | f0f7450c02aa979bcf602b6dd854e65a75162650 | refs/heads/master | 2021-01-19T14:01:18.435828 | 2017-05-30T08:59:28 | 2017-05-30T08:59:28 | 88,118,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,876 | java | package org.syaku.tutorials.spring.boot.config;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.validation.Validator;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
import org.syaku.tutorials.spring.validation.ValidationAspect;
import org.syaku.tutorials.spring.validation.ValidationResponseAspect;
/**
* @author Seok Kyun. Choi. 최석균 (Syaku)
* @site http://syaku.tistory.com
* @since 2017. 5. 11.
*/
@Configuration
public class ValidationConfiguration {
private MessageSource messageSource;
@Bean
public ValidationResponseAspect validationResponseAspect() {
return new ValidationResponseAspect();
}
@Bean
public ValidationAspect validationAspect() {
return new ValidationAspect();
}
@Bean
public MessageSource messageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.setBasename("classpath:org/syaku/tutorials/spring/i18n/message");
this.messageSource = messageSource;
return messageSource;
}
@Bean
public MessageSourceAccessor messageSourceAccessor() {
return new MessageSourceAccessor(messageSource);
}
/**
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource" />
</bean>
* @return
*/
@Bean
public Validator validator() {
LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
validator.setValidationMessageSource(messageSource);
validator.afterPropertiesSet();
return validator;
}
}
| [
"syaku@naver.com"
] | syaku@naver.com |
cf6daccd3a0f8c29450e6775c991fbec19557cc9 | d015ccd17f917fbb2446f211977fd78a96ec0591 | /cp-book/ch3/dp/_11951_Area.java | c250b4781affef4ca623bb1c2f0f5abf2224674e | [
"MIT"
] | permissive | andrey-yemelyanov/competitive-programming | f74d4f35c527b80f4ef0b5fc17d1a4aedbc36ff3 | f5c5fc9a5951a81dbae1250e17cd3d51a96b7a47 | refs/heads/master | 2021-01-12T17:29:32.384671 | 2018-08-03T08:57:00 | 2018-08-03T08:57:00 | 71,582,272 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,402 | java | package helvidios.cp.ch3.dp;
import java.util.*;
import java.io.*;
public class _11951_Area {
public static void main(String[] args) throws IOException{
String data = "1\r\n5 6 15\r\n10 1 10 20 10 10\r\n30 1 1 5 1 1\r\n50 1 1 20 1 1\r\n10 5 5 10 5 1\r\n40 10 90 1 10 10";
String data3 = "1\n2 3 25\n1 2 3\n4 5 6";
String data4 = "1\n2 3 25\n0 0 0\n0 0 0";
BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data.getBytes())));
int nTestCases = Integer.parseInt(reader.readLine());
for(int c = 1; c <= nTestCases; c++){
String[] line1 = reader.readLine().split("\\s+");
int nRows = Integer.parseInt(line1[0]);
int nCols = Integer.parseInt(line1[1]);
int moneyAvailable = Integer.parseInt(line1[2]);
long[][] matrix = new long[nRows][nCols];
for(int i = 0; i < matrix.length; i++){
String[] line = reader.readLine().split("\\s+");
for(int j = 0; j < matrix[0].length; j++){
matrix[i][j] = Long.parseLong(line[j]);
}
}
long[] answer = buyOptimalPlot(transform(matrix), moneyAvailable);
System.out.printf("Case #%d: %d %d\n", c, answer[0], answer[1]);
}
}
static long[] buyOptimalPlot(long[][] matrix, int moneyAvailable){
int largestArea = 0;
long lowestCost = 0;
int nRows = matrix.length;
int nCols = matrix[0].length;
for(int i = 0; i < nRows; i++){
int maxHeight = nRows - i;
if(maxHeight * nCols < largestArea) break;
for(int j = 0; j < nCols; j++){ // start coordinate
int maxWidth = nCols - j;
if(maxWidth * maxHeight < largestArea) break;
for(int k = i; k < nRows; k++){
for(int l = j; l < nCols; l++){ // end coordinate
int area = (k - i + 1) * (l - j + 1);
long cost = plotCost(matrix, i, j, k, l);
if(cost > moneyAvailable) break;
if(area > largestArea){
largestArea = area;
lowestCost = cost;
}else if(area == largestArea){
lowestCost = Math.min(cost, lowestCost);
}
}
}
}
}
return new long[]{largestArea, lowestCost};
}
static long plotCost(long[][] matrix, int i, int j, int k, int l){
long cost = matrix[k][l];
if(i > 0) cost -= matrix[i - 1][l];
if(j > 0) cost -= matrix[k][j - 1];
if(i > 0 && j > 0) cost += matrix[i - 1][j - 1];
return cost;
}
static long[][] transform(long[][] matrix){
long[][] transformed = new long[matrix.length][matrix[0].length];
for(int i = 0; i < transformed.length; i++){
for(int j = 0; j < transformed[0].length; j++){
transformed[i][j] = matrix[i][j];
if(i > 0) transformed[i][j] += transformed[i - 1][j];
if(j > 0) transformed[i][j] += transformed[i][j - 1];
if(i > 0 && j > 0) transformed[i][j] -= transformed[i - 1][j - 1];
}
}
return transformed;
}
} | [
"andrey.yemelyanov@gmail.com"
] | andrey.yemelyanov@gmail.com |
d24fe0b3e4c8ebc5f8f897cd85b97f84a7eaac1f | e543b89a172d55bb81bdd8f2da79d3e3702a0260 | /aCis_gameserver/java/net/sf/l2j/gameserver/scripting/quest/Q037_MakeFormalWear.java | f291491981ac055cff09a4ece817ac1117ce6993 | [] | no_license | nick1pas/acis_rusacis-folk | 72afb2d529c7762c22f9ee97d7763abecf0dff33 | 9e96774f73b7d4def1bc472043adeba0fb99986e | refs/heads/main | 2023-08-23T17:38:16.496608 | 2021-10-16T00:51:24 | 2021-10-16T00:51:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,462 | java | package net.sf.l2j.gameserver.scripting.quest;
import net.sf.l2j.gameserver.enums.QuestStatus;
import net.sf.l2j.gameserver.model.actor.Npc;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.scripting.Quest;
import net.sf.l2j.gameserver.scripting.QuestState;
public class Q037_MakeFormalWear extends Quest
{
private static final String QUEST_NAME = "Q037_MakeFormalWear";
// NPCs
private static final int ALEXIS = 30842;
private static final int LEIKAR = 31520;
private static final int JEREMY = 31521;
private static final int MIST = 31627;
// Items
private static final int MYSTERIOUS_CLOTH = 7076;
private static final int JEWEL_BOX = 7077;
private static final int SEWING_KIT = 7078;
private static final int DRESS_SHOES_BOX = 7113;
private static final int SIGNET_RING = 7164;
private static final int ICE_WINE = 7160;
private static final int BOX_OF_COOKIES = 7159;
// Reward
private static final int FORMAL_WEAR = 6408;
public Q037_MakeFormalWear()
{
super(37, "Make Formal Wear");
setItemsIds(SIGNET_RING, ICE_WINE, BOX_OF_COOKIES);
addStartNpc(ALEXIS);
addTalkId(ALEXIS, LEIKAR, JEREMY, MIST);
}
@Override
public String onAdvEvent(String event, Npc npc, Player player)
{
String htmltext = event;
QuestState st = player.getQuestList().getQuestState(QUEST_NAME);
if (st == null)
return htmltext;
if (event.equalsIgnoreCase("30842-1.htm"))
{
st.setState(QuestStatus.STARTED);
st.setCond(1);
playSound(player, SOUND_ACCEPT);
}
else if (event.equalsIgnoreCase("31520-1.htm"))
{
st.setCond(2);
playSound(player, SOUND_MIDDLE);
giveItems(player, SIGNET_RING, 1);
}
else if (event.equalsIgnoreCase("31521-1.htm"))
{
st.setCond(3);
playSound(player, SOUND_MIDDLE);
takeItems(player, SIGNET_RING, 1);
giveItems(player, ICE_WINE, 1);
}
else if (event.equalsIgnoreCase("31627-1.htm"))
{
st.setCond(4);
playSound(player, SOUND_MIDDLE);
takeItems(player, ICE_WINE, 1);
}
else if (event.equalsIgnoreCase("31521-3.htm"))
{
st.setCond(5);
playSound(player, SOUND_MIDDLE);
giveItems(player, BOX_OF_COOKIES, 1);
}
else if (event.equalsIgnoreCase("31520-3.htm"))
{
st.setCond(6);
playSound(player, SOUND_MIDDLE);
takeItems(player, BOX_OF_COOKIES, 1);
}
else if (event.equalsIgnoreCase("31520-5.htm"))
{
st.setCond(7);
playSound(player, SOUND_MIDDLE);
takeItems(player, JEWEL_BOX, 1);
takeItems(player, MYSTERIOUS_CLOTH, 1);
takeItems(player, SEWING_KIT, 1);
}
else if (event.equalsIgnoreCase("31520-7.htm"))
{
takeItems(player, DRESS_SHOES_BOX, 1);
giveItems(player, FORMAL_WEAR, 1);
playSound(player, SOUND_FINISH);
st.exitQuest(false);
}
return htmltext;
}
@Override
public String onTalk(Npc npc, Player player)
{
QuestState st = player.getQuestList().getQuestState(QUEST_NAME);
String htmltext = getNoQuestMsg();
if (st == null)
return htmltext;
switch (st.getState())
{
case CREATED:
htmltext = (player.getStatus().getLevel() < 60) ? "30842-0a.htm" : "30842-0.htm";
break;
case STARTED:
int cond = st.getCond();
switch (npc.getNpcId())
{
case ALEXIS:
if (cond == 1)
htmltext = "30842-2.htm";
break;
case LEIKAR:
if (cond == 1)
htmltext = "31520-0.htm";
else if (cond == 2)
htmltext = "31520-1a.htm";
else if (cond == 5 || cond == 6)
{
if (player.getInventory().hasItems(MYSTERIOUS_CLOTH, JEWEL_BOX, SEWING_KIT))
htmltext = "31520-4.htm";
else if (player.getInventory().hasItems(BOX_OF_COOKIES))
htmltext = "31520-2.htm";
else
htmltext = "31520-3a.htm";
}
else if (cond == 7)
htmltext = (player.getInventory().hasItems(DRESS_SHOES_BOX)) ? "31520-6.htm" : "31520-5a.htm";
break;
case JEREMY:
if (player.getInventory().hasItems(SIGNET_RING))
htmltext = "31521-0.htm";
else if (cond == 3)
htmltext = "31521-1a.htm";
else if (cond == 4)
htmltext = "31521-2.htm";
else if (cond > 4)
htmltext = "31521-3a.htm";
break;
case MIST:
if (cond == 3)
htmltext = "31627-0.htm";
else if (cond > 3)
htmltext = "31627-2.htm";
break;
}
break;
case COMPLETED:
htmltext = getAlreadyCompletedMsg();
break;
}
return htmltext;
}
} | [
"59799175+Daniel2gt18@users.noreply.github.com"
] | 59799175+Daniel2gt18@users.noreply.github.com |
e566c221befb99a410085796bdaa26b1702d8e73 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/ant/1.5/org/apache/tools/ant/taskdefs/optional/depend/constantpool/NameAndTypeCPInfo.java | 7f1c6c9164013e06c34926afeb7f63a2ae5f27dc | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,569 | java | package org.apache.tools.ant.taskdefs.optional.depend.constantpool;
import java.io.DataInputStream;
import java.io.IOException;
/**
* A NameAndType CP Info
*
* @author Conor MacNeill
*/
public class NameAndTypeCPInfo extends ConstantPoolEntry {
/** Constructor. */
public NameAndTypeCPInfo() {
super(CONSTANT_NAMEANDTYPE, 1);
}
/**
* read a constant pool entry from a class stream.
*
* @param cpStream the DataInputStream which contains the constant pool
* entry to be read.
* @exception IOException if there is a problem reading the entry from
* the stream.
*/
public void read(DataInputStream cpStream) throws IOException {
nameIndex = cpStream.readUnsignedShort();
descriptorIndex = cpStream.readUnsignedShort();
}
/**
* Print a readable version of the constant pool entry.
*
* @return the string representation of this constant pool entry.
*/
public String toString() {
String value;
if (isResolved()) {
value = "Name = " + name + ", type = " + type;
} else {
value = "Name index = " + nameIndex
+ ", descriptor index = " + descriptorIndex;
}
return value;
}
/**
* Resolve this constant pool entry with respect to its dependents in
* the constant pool.
*
* @param constantPool the constant pool of which this entry is a member
* and against which this entry is to be resolved.
*/
public void resolve(ConstantPool constantPool) {
name = ((Utf8CPInfo) constantPool.getEntry(nameIndex)).getValue();
type = ((Utf8CPInfo) constantPool.getEntry(descriptorIndex)).getValue();
super.resolve(constantPool);
}
/**
* Get the name component of this entry
*
* @return the name of this name and type entry
*/
public String getName() {
return name;
}
/**
* Get the type signature of this entry
*
* @return the type signature of this entry
*/
public String getType() {
return type;
}
/** the name component of this entry */
private String name;
/** the type component of this entry */
private String type;
/**
* the index into the constant pool at which the name component's string
* value is stored
*/
private int nameIndex;
/**
* the index into the constant pool where the type descriptor string is
* stored.
*/
private int descriptorIndex;
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.