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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4fbfdce45b4fdea28eb96f60153fb2708a0a4b53
|
f0d0631e221382c8a7d48c8bed6acc4efe0bfd2d
|
/JavaSource/org/unitime/timetable/tags/Copyright.java
|
9e0dcf796caf820453db297fda3f607818b9d0c3
|
[
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"CC-BY-3.0",
"EPL-1.0",
"CC0-1.0",
"CDDL-1.0",
"MIT",
"LGPL-2.1-or-later",
"LGPL-3.0-only",
"BSD-3-Clause",
"LGPL-2.1-only",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-freemarker",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-free-unknown"
] |
permissive
|
tomas-muller/unitime
|
8c7097003b955053f32fe5891f1d29b554c4dd45
|
de307a63552128b75ae9a83d7e1d44c71b3dc266
|
refs/heads/master
| 2021-12-29T04:57:46.000745
| 2021-12-09T19:02:43
| 2021-12-09T19:02:43
| 30,605,965
| 4
| 0
|
Apache-2.0
| 2021-02-17T15:14:49
| 2015-02-10T18:01:29
|
Java
|
UTF-8
|
Java
| false
| false
| 2,165
|
java
|
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation 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.unitime.timetable.tags;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import org.unitime.commons.Debug;
/**
* @author Tomas Muller
*/
public class Copyright extends BodyTagSupport {
private static final long serialVersionUID = -4463420165596054395L;
private boolean iBr = true;
public void setBr(boolean br) { iBr = br; }
public boolean isBr() { return iBr; }
public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED;
}
public int doEndTag() throws JspException {
// WARNING: Changing or removing the following copyright notice will violate the license terms.
// If you need a different licensing, please contact us at support@unitime.org
String body =
"<a class='unitime-FooterLink' href='http://www.unitime.org' tabIndex='-1'>© 2008 - 2021 The Apereo Foundation</a>," +
(isBr() ? "<br>" : " ") +
"<a class='unitime-FooterLink' href='http://www.unitime.org/uct_license.php' tabIndex='-1'>distributed under the Apache License, Version 2.</a>";
try {
pageContext.getOut().print(body);
}
catch (Exception e) {
Debug.error("Could not display copyright notice: " + e.getMessage());
}
return EVAL_PAGE;
}
}
|
[
"muller@unitime.org"
] |
muller@unitime.org
|
7eaf3f70d7f40d23fd4835c8862eecc724c3993f
|
da3537bca16b7f1716524b3f720b6a419b31d3a6
|
/litho-core/src/main/java/com/facebook/litho/LithoYogaMeasureFunction.java
|
8573067eb77eeed8ae424c594d8d31978526c1ac
|
[
"Apache-2.0"
] |
permissive
|
adityasharat/litho
|
b2a9bc37ad8824dc821aa50e8160f81ca465cce6
|
e8fb1fee4c05fe6186b18c16a9ee773fc8831d24
|
refs/heads/master
| 2021-12-02T02:45:17.844504
| 2021-07-05T17:59:42
| 2021-07-05T17:59:42
| 383,224,084
| 0
| 0
|
Apache-2.0
| 2021-07-05T17:55:11
| 2021-07-05T17:55:11
| null |
UTF-8
|
Java
| false
| false
| 6,379
|
java
|
/*
* Copyright (c) Facebook, Inc. and 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 com.facebook.litho;
import android.annotation.SuppressLint;
import androidx.annotation.Nullable;
import com.facebook.litho.LithoLayoutResult.NestedTreeHolderResult;
import com.facebook.yoga.YogaMeasureFunction;
import com.facebook.yoga.YogaMeasureMode;
import com.facebook.yoga.YogaMeasureOutput;
import com.facebook.yoga.YogaNode;
public class LithoYogaMeasureFunction implements YogaMeasureFunction {
private Size acquireSize(int initialValue) {
return new Size(initialValue, initialValue);
}
@Override
@SuppressLint("WrongCall")
@SuppressWarnings("unchecked")
public long measure(
YogaNode cssNode,
float width,
YogaMeasureMode widthMode,
float height,
YogaMeasureMode heightMode) {
final LithoLayoutResult result = (LithoLayoutResult) cssNode.getData();
final InternalNode node = result.getInternalNode();
final LayoutStateContext layoutStateContext = result.getContext().getLayoutStateContext();
final Component component = node.getTailComponent();
final String componentGlobalKey = node.getTailComponentKey();
final ComponentContext componentScopedContext =
component.getScopedContext(layoutStateContext, componentGlobalKey);
try {
if (componentScopedContext != null && componentScopedContext.wasLayoutCanceled()) {
return 0;
}
final DiffNode diffNode = result.areCachedMeasuresValid() ? result.getDiffNode() : null;
final int widthSpec;
final int heightSpec;
final boolean isTracing = ComponentsSystrace.isTracing();
widthSpec = SizeSpec.makeSizeSpecFromCssSpec(width, widthMode);
heightSpec = SizeSpec.makeSizeSpecFromCssSpec(height, heightMode);
if (isTracing) {
ComponentsSystrace.beginSectionWithArgs("measure:" + component.getSimpleName())
.arg("widthSpec", SizeSpec.toString(widthSpec))
.arg("heightSpec", SizeSpec.toString(heightSpec))
.arg("componentId", component.getId())
.flush();
}
result.setLastWidthSpec(widthSpec);
result.setLastHeightSpec(heightSpec);
int outputWidth = 0;
int outputHeight = 0;
ComponentContext context = result.getContext();
if (Component.isNestedTree(context, component) || result instanceof NestedTreeHolderResult) {
final int size = node.getComponents().size();
final ComponentContext parentContext;
if (size == 1) {
final String parentKey = result.getParent().getInternalNode().getTailComponentKey();
parentContext =
result
.getParent()
.getInternalNode()
.getTailComponent()
.getScopedContext(layoutStateContext, parentKey);
} else {
parentContext =
node.getComponents()
.get(1)
.getScopedContext(layoutStateContext, node.getComponentKeys().get(1));
}
final LayoutState layoutState = layoutStateContext.getLayoutState();
final @Nullable LayoutStateContext prevLayoutStateContext;
if (layoutState == null) {
throw new IllegalStateException(
component.getSimpleName()
+ ": To measure a component outside of a layout calculation use"
+ " Component#measureMightNotCacheInternalNode.");
}
prevLayoutStateContext = layoutState.getPrevLayoutStateContext();
final LithoLayoutResult nestedTree =
Layout.create(
parentContext,
(NestedTreeHolderResult) result,
widthSpec,
heightSpec,
prevLayoutStateContext);
outputWidth = nestedTree.getWidth();
outputHeight = nestedTree.getHeight();
} else if (diffNode != null
&& diffNode.getLastWidthSpec() == widthSpec
&& diffNode.getLastHeightSpec() == heightSpec
&& !component.shouldAlwaysRemeasure()) {
outputWidth = (int) diffNode.getLastMeasuredWidth();
outputHeight = (int) diffNode.getLastMeasuredHeight();
} else {
final Size size = acquireSize(Integer.MIN_VALUE /* initialValue */);
component.onMeasure(componentScopedContext, result, widthSpec, heightSpec, size);
if (size.width < 0 || size.height < 0) {
throw new IllegalStateException(
"MeasureOutput not set, Component is: "
+ component
+ " Width: "
+ width
+ " Height: "
+ height
+ " WidthMode: "
+ widthMode.name()
+ " HeightMode: "
+ heightMode.name()
+ " Measured width : "
+ size.width
+ " Measured Height: "
+ size.height);
}
outputWidth = size.width;
outputHeight = size.height;
if (result.getDiffNode() != null) {
result.getDiffNode().setLastWidthSpec(widthSpec);
result.getDiffNode().setLastHeightSpec(heightSpec);
result.getDiffNode().setLastMeasuredWidth(outputWidth);
result.getDiffNode().setLastMeasuredHeight(outputHeight);
}
}
result.setLastMeasuredWidth(outputWidth);
result.setLastMeasuredHeight(outputHeight);
result.setLastWidthSpec(widthSpec);
result.setLastHeightSpec(heightSpec);
if (isTracing) {
ComponentsSystrace.endSection();
}
return YogaMeasureOutput.make(outputWidth, outputHeight);
} catch (Exception e) {
ComponentUtils.handle(componentScopedContext, e);
return YogaMeasureOutput.make(0, 0);
}
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
485ec23939c1dad7e93b089eb802188b1d32b168
|
79d081703d7516e474be2da97ee6419a5320b6ff
|
/src/everyday/addToArrayForm/Solution.java
|
8e08440c6c663f37ebdb572a698d70f801c8b5ec
|
[] |
no_license
|
ITrover/Algorithm
|
e22494ca4c3b2e41907cc606256dcbd1d173886d
|
efa4eecc7e02754078d284269556657814cb167c
|
refs/heads/master
| 2022-05-26T01:48:28.956693
| 2022-04-01T11:58:24
| 2022-04-01T11:58:24
| 226,656,770
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,022
|
java
|
package everyday.addToArrayForm;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
/**
* @author itrover
* 989. 数组形式的整数加法 https://leetcode-cn.com/problems/add-to-array-form-of-integer/
* 使用栈(Java的Stack 效率低)
*/
class Solution {
public List<Integer> addToArrayForm(int[] A, int K) {
Stack<Integer> stack = new Stack<>();
int last = 0;
int i = A.length - 1;
while (i >= 0 || K > 0) {
int base = last;
if (K > 0) {
base += K % 10;
K /= 10;
}
if (i >= 0) {
base = A[i] + base;
i--;
}
stack.push(base % 10);
last = base / 10;
}
// 进位
if (last > 0) {
stack.push(last);
}
ArrayList<Integer> res = new ArrayList<>();
while (!stack.isEmpty()) {
res.add(stack.pop());
}
return res;
}
}
|
[
"1172610139@qq.com"
] |
1172610139@qq.com
|
88d99934895bd8178beb87c3d60a3fb5cd7506e8
|
a29aff36c8d59c4ed4e4e64e8eced61f51c225b8
|
/binea/binea-upms/binea-upms-dao/src/main/java/com/binea/upms/dao/mapper/UpmsLogMapper.java
|
c12ff444fa0d6cd100a29c614928d2745f5dca39
|
[
"MIT"
] |
permissive
|
xu6148152/BackEndSample
|
3f4e2b3ae0015431d04e9ac87c81622a9b9c0344
|
c5f6b2b2e60a67d92c39ad244f5a4c499f751866
|
refs/heads/master
| 2021-09-15T03:29:01.835300
| 2018-05-25T07:38:58
| 2018-05-25T07:38:58
| 108,426,819
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,096
|
java
|
package com.binea.upms.dao.mapper;
import com.binea.upms.dao.model.UpmsLog;
import com.binea.upms.dao.model.UpmsLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UpmsLogMapper {
long countByExample(UpmsLogExample example);
int deleteByExample(UpmsLogExample example);
int deleteByPrimaryKey(Integer logId);
int insert(UpmsLog record);
int insertSelective(UpmsLog record);
List<UpmsLog> selectByExampleWithBLOBs(UpmsLogExample example);
List<UpmsLog> selectByExample(UpmsLogExample example);
UpmsLog selectByPrimaryKey(Integer logId);
int updateByExampleSelective(@Param("record") UpmsLog record, @Param("example") UpmsLogExample example);
int updateByExampleWithBLOBs(@Param("record") UpmsLog record, @Param("example") UpmsLogExample example);
int updateByExample(@Param("record") UpmsLog record, @Param("example") UpmsLogExample example);
int updateByPrimaryKeySelective(UpmsLog record);
int updateByPrimaryKeyWithBLOBs(UpmsLog record);
int updateByPrimaryKey(UpmsLog record);
}
|
[
"xu6148152@gmail.com"
] |
xu6148152@gmail.com
|
58ea414d58e99c148effce49b1044166958a25c5
|
1f90b86cb54987c53397d8b57295d291ba512d02
|
/src/org.bzdev.graphics/org/bzdev/graphs/symbols/SolidCircle.java
|
708139377502f12e9f808b9b3b0e9296641cf6f8
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
BillZaumen/libbzdev
|
2bd97fc98b92320f079e4615e0aad700813c0a53
|
948f0a1fa2bdba91d55b2a2f792f3c89679742af
|
refs/heads/master
| 2023-09-01T11:24:14.811257
| 2023-08-25T03:04:17
| 2023-08-25T03:04:17
| 459,379,399
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,145
|
java
|
package org.bzdev.graphs.symbols;
import org.bzdev.graphs.Graph;
import java.awt.Shape;
import java.awt.geom.Ellipse2D;
import java.awt.Graphics2D;
/**
* Graph-symbol class for a filled circle.
*/
public class SolidCircle extends Graph.Symbol {
static final Shape circle =
new Ellipse2D.Double(-5.0, -5.0, 10.0, 10.0);
protected Graph.UserGraphic getUserGraphic(boolean xAxisPointsRight,
boolean yAxisPointsDown)
{
return new Graph.UserGraphic() {
public void addTo(Graph graph, Graphics2D g2d) {
g2d.draw(circle);
g2d.fill(circle);
}
};
}
@Override
protected double getEBarStartRight(boolean xAxisPointsRight,
boolean yAxisPointsDown)
{
return 5.0;
}
@Override
protected double getEBarStartLeft(boolean xAxisPointsRight,
boolean yAxisPointsDown)
{
return -5.0;
}
@Override
protected double getEBarStartTop(boolean xAxisPointsRight,
boolean yAxisPointsDown)
{
return -5.0;
}
@Override
protected double getEBarStartBottom(boolean xAxisPointsRight,
boolean yAxisPointsDown)
{
return 5.0;
}
}
|
[
"bzdev.org@gmail.com"
] |
bzdev.org@gmail.com
|
871041ad9da46166fdfdc7d8b733788cf2f620fa
|
52e18ef3dfd838a06449e1df56889fef05e84c41
|
/IloveSeoul_source_from_JADX/gnu/kawa/xml/XInteger.java
|
544639c7af84292e62754934d1dc17684342aa7e
|
[
"MIT"
] |
permissive
|
MobileSeoul/2017seoul-55
|
75dda8bbcd51f4648e7f44e80b46a6d543d57b14
|
55f8f8a97bf954b47753e2d750dac723354bcbab
|
refs/heads/master
| 2021-05-05T01:57:26.306068
| 2018-02-01T01:23:36
| 2018-02-01T01:23:36
| 119,765,284
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 343
|
java
|
package gnu.kawa.xml;
import gnu.math.IntNum;
public class XInteger extends IntNum {
private XIntegerType type;
public XIntegerType getIntegerType() {
return this.type;
}
XInteger(IntNum value, XIntegerType type) {
this.words = value.words;
this.ival = value.ival;
this.type = type;
}
}
|
[
"mobile@seoul.go.kr"
] |
mobile@seoul.go.kr
|
2e5d095cb932c49b441d116b4b099b00c9b32513
|
31b7d2067274728a252574b2452e617e45a1c8fb
|
/jpa-connector-beehive-bdk/com/oracle/beehive/ClientApplicationVendorPredicate.java
|
70bfe85537eacf2090b43dd4b243ebf80921361d
|
[] |
no_license
|
ericschan/open-icom
|
c83ae2fa11dafb92c3210a32184deb5e110a5305
|
c4b15a2246d1b672a8225cbb21b75fdec7f66f22
|
refs/heads/master
| 2020-12-30T12:22:48.783144
| 2017-05-28T00:51:44
| 2017-05-28T00:51:44
| 91,422,338
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,819
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.11.08 at 05:31:42 PM PST
//
package com.oracle.beehive;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for clientApplicationVendorPredicate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="clientApplicationVendorPredicate">
* <complexContent>
* <extension base="{http://www.oracle.com/beehive}clientApplicationPredicate">
* <sequence>
* <element name="vendor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "clientApplicationVendorPredicate", propOrder = {
"vendor"
})
public class ClientApplicationVendorPredicate
extends ClientApplicationPredicate
{
protected String vendor;
/**
* Gets the value of the vendor property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVendor() {
return vendor;
}
/**
* Sets the value of the vendor property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVendor(String value) {
this.vendor = value;
}
}
|
[
"eric.sn.chan@gmail.com"
] |
eric.sn.chan@gmail.com
|
6dd9acb2a926adb13b10657b3270701a783a4e14
|
8012e034bd7251eda16c18f8552fb22a7025450f
|
/kodilla-patterns/src/main/java/com/kodilla/patterns/factory/tasks/PaintingTask.java
|
1a936b90941bab98f8bcd2704a0bb05eedc3c382
|
[] |
no_license
|
radoslaw-lazur/radoslaw-lazur-kodilla-java
|
a7d490e62b007a1781362c3ed1b133c4618ff66d
|
c384009e86023167d73232525bbb015a5756f0d8
|
refs/heads/master
| 2020-06-30T18:17:53.480488
| 2020-02-22T19:19:28
| 2020-02-22T19:19:28
| 198,699,775
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 687
|
java
|
package com.kodilla.patterns.factory.tasks;
public class PaintingTask implements Task {
private final String taskName;
private final String color;
private final String whatToPaint;
public PaintingTask(String taskName, String color, String whatToPaint) {
this.taskName = taskName;
this.color = color;
this.whatToPaint = whatToPaint;
}
@Override
public void executeTask() {
System.out.println("I am painting " + whatToPaint + " with " + color);
}
@Override
public String getTaskName() {
return taskName;
}
@Override
public boolean isTaskExecuted() {
return taskName != null;
}
}
|
[
"radoslaw.lazur@gmail.com"
] |
radoslaw.lazur@gmail.com
|
28c557baa116d4733b65bd26192b8606072d6c37
|
6c9fbb7e83b671671a2f951371c06aa3694cdcc3
|
/adscms/src/main/java/org/broadleafcommerce/cms/page/service/PageRuleProcessor.java
|
922c0f06b9970a5ec0109b0c1f3632b1118f917a
|
[] |
no_license
|
buchiramreddy/ActiveDiscounts
|
19aeca79cfdc8902d1a58d48b24f5591d68a8d95
|
d71f900ded641ab7404df9a19241f60b03ae58bf
|
refs/heads/master
| 2021-05-27T10:16:54.107132
| 2013-11-06T19:12:04
| 2013-11-06T19:12:04
| 11,724,930
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,058
|
java
|
/*
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.broadleafcommerce.cms.page.service;
import java.util.Map;
import org.broadleafcommerce.cms.page.dto.PageDTO;
/**
* Page rule processors check each content item to see if it qualifies for inclusion in the result set.
*
* <p>This is called by PageService to determine if a given content item should be returned to the caller.</p>
*
* <p>BLC created rule processors to solve a dependency issue. Some variables to be used in rule processing are within
* the scope of the CMS module while others are not.</p>
*
* <p>For example, checking for cart rules would tie the CMS rules engine with a direct dependency on the cart.</p>
*
* <p>Instead, we've opted to create this interface which allows other components to add rule-processors as needed.</p>
*
* @see {@link org.broadleafcommerce.cms.page.service.PageDefaultRuleProcessor}
* @author bpolster.
* @version $Revision$, $Date$
*/
public interface PageRuleProcessor {
//~ Methods ----------------------------------------------------------------------------------------------------------
/**
* Returns true if the passed in <code>Page</code> is valid according to this rule processor.
*
* @param page DOCUMENT ME!
* @param valueMap DOCUMENT ME!
*
* @return true if the passed in <code>Page</code> is valid according to this rule processor.
*/
boolean checkForMatch(PageDTO page, Map<String, Object> valueMap);
}
|
[
"bchittepu@cmcagile.com"
] |
bchittepu@cmcagile.com
|
9cce92b183f7c91792323def86c6c4d2ce86d5fc
|
aa2cd49a57c043d5aa5429728c657da105e22c46
|
/app/src/main/java/com/lianxi/dingtu/newsnfc/app/utils/ShakeAnimation.java
|
946d7848da3f9bee84ee89d405e045d7f4aea220
|
[] |
no_license
|
scygh/NEW_NFC
|
3718ebbe22b89f7e8d31e952b575d0dc44ed8fdf
|
61df95fbd7a2c779853edebc0b0d1b4299c8757f
|
refs/heads/master
| 2020-09-08T10:06:52.128400
| 2020-04-18T08:36:17
| 2020-04-18T08:36:17
| 221,102,822
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,163
|
java
|
package com.lianxi.dingtu.newsnfc.app.utils;
import android.animation.Keyframe;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.view.View;
import com.lianxi.dingtu.newsnfc.R;
public class ShakeAnimation {
public static ObjectAnimator tada(View view) {
return tada(view, 1f);
}
public static ObjectAnimator tada(View view, float shakeFactor) {
PropertyValuesHolder pvhScaleX = PropertyValuesHolder.ofKeyframe(View.SCALE_X,
Keyframe.ofFloat(0f, 1f),
Keyframe.ofFloat(.1f, .9f),
Keyframe.ofFloat(.2f, .9f),
Keyframe.ofFloat(.3f, 1.1f),
Keyframe.ofFloat(.4f, 1.1f),
Keyframe.ofFloat(.5f, 1.1f),
Keyframe.ofFloat(.6f, 1.1f),
Keyframe.ofFloat(.7f, 1.1f),
Keyframe.ofFloat(.8f, 1.1f),
Keyframe.ofFloat(.9f, 1.1f),
Keyframe.ofFloat(1f, 1f)
);
PropertyValuesHolder pvhScaleY = PropertyValuesHolder.ofKeyframe(View.SCALE_Y,
Keyframe.ofFloat(0f, 1f),
Keyframe.ofFloat(.1f, .9f),
Keyframe.ofFloat(.2f, .9f),
Keyframe.ofFloat(.3f, 1.1f),
Keyframe.ofFloat(.4f, 1.1f),
Keyframe.ofFloat(.5f, 1.1f),
Keyframe.ofFloat(.6f, 1.1f),
Keyframe.ofFloat(.7f, 1.1f),
Keyframe.ofFloat(.8f, 1.1f),
Keyframe.ofFloat(.9f, 1.1f),
Keyframe.ofFloat(1f, 1f)
);
PropertyValuesHolder pvhRotate = PropertyValuesHolder.ofKeyframe(View.ROTATION,
Keyframe.ofFloat(0f, 0f),
Keyframe.ofFloat(.1f, -3f * shakeFactor),
Keyframe.ofFloat(.2f, -3f * shakeFactor),
Keyframe.ofFloat(.3f, 3f * shakeFactor),
Keyframe.ofFloat(.4f, -3f * shakeFactor),
Keyframe.ofFloat(.5f, 3f * shakeFactor),
Keyframe.ofFloat(.6f, -3f * shakeFactor),
Keyframe.ofFloat(.7f, 3f * shakeFactor),
Keyframe.ofFloat(.8f, -3f * shakeFactor),
Keyframe.ofFloat(.9f, 3f * shakeFactor),
Keyframe.ofFloat(1f, 0)
);
return ObjectAnimator.ofPropertyValuesHolder(view, pvhScaleX, pvhScaleY, pvhRotate).
setDuration(1000);
}
public static ObjectAnimator nope(View view) {
int delta = view.getResources().getDimensionPixelOffset(R.dimen.spacing_medium);
PropertyValuesHolder pvhTranslateX = PropertyValuesHolder.ofKeyframe(View.TRANSLATION_X,
Keyframe.ofFloat(0f, 0),
Keyframe.ofFloat(.10f, -delta),
Keyframe.ofFloat(.26f, delta),
Keyframe.ofFloat(.42f, -delta),
Keyframe.ofFloat(.58f, delta),
Keyframe.ofFloat(.74f, -delta),
Keyframe.ofFloat(.90f, delta),
Keyframe.ofFloat(1f, 0f)
);
return ObjectAnimator.ofPropertyValuesHolder(view, pvhTranslateX).
setDuration(500);
}
}
|
[
"1797484636@qq.com"
] |
1797484636@qq.com
|
5a07a74f62a9c72ab6cf09523d4da12ce1080d72
|
2c0da6f10a8789bdad22f65c912e3eb7b2a0a1e2
|
/camel-spring-salesforce/src/main/java/org/apache/camel/salesforce/dto/QueryRecordsDcSocialProfile.java
|
ae5fb03ed989f8267609e6cf098b354947238bdb
|
[] |
no_license
|
xiwu/gss.samples
|
9fe35e4c2c673a09463da72378936ce46c558211
|
d5dc2c0a91c0435c183038fc9384b461ede92772
|
refs/heads/master
| 2023-05-13T04:21:24.468623
| 2023-04-28T09:34:13
| 2023-04-28T09:34:13
| 42,858,630
| 1
| 0
| null | 2022-12-23T09:15:35
| 2015-09-21T10:05:59
|
Java
|
UTF-8
|
Java
| false
| false
| 712
|
java
|
/*
* Salesforce Query DTO generated by camel-salesforce-maven-plugin
* Generated on: Mon Aug 15 13:54:43 CST 2016
*/
package org.apache.camel.salesforce.dto;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import org.apache.camel.component.salesforce.api.dto.AbstractQueryRecordsBase;
import java.util.List;
/**
* Salesforce QueryRecords DTO for type DcSocialProfile
*/
public class QueryRecordsDcSocialProfile extends AbstractQueryRecordsBase {
@XStreamImplicit
private List<DcSocialProfile> records;
public List<DcSocialProfile> getRecords() {
return records;
}
public void setRecords(List<DcSocialProfile> records) {
this.records = records;
}
}
|
[
"vicky.wuxiaohui@gmail.com"
] |
vicky.wuxiaohui@gmail.com
|
6459fe896f338efcb46a0535abebbd29945959f9
|
d523206fce46708a6fe7b2fa90e81377ab7b6024
|
/com/google/android/gms/fitness/result/DataStatsResult.java
|
f2631318c5a416f5e0f7c59bebb6604316acf375
|
[] |
no_license
|
BlitzModder/BlitzJava
|
0ee94cc069dc4b7371d1399ff5575471bdc88aac
|
6c6d71d2847dfd5f9f4f7c716cd820aeb7e45f2c
|
refs/heads/master
| 2021-06-11T15:04:05.571324
| 2017-02-04T16:04:55
| 2017-02-04T16:04:55
| 77,459,517
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,362
|
java
|
package com.google.android.gms.fitness.result;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import java.util.List;
public class DataStatsResult
implements Result, SafeParcelable
{
public static final Parcelable.Creator<DataStatsResult> CREATOR = new zzf();
private final int mVersionCode;
private final Status zzTA;
private final List<DataSourceStatsResult> zzazr;
DataStatsResult(int paramInt, Status paramStatus, List<DataSourceStatsResult> paramList)
{
this.mVersionCode = paramInt;
this.zzTA = paramStatus;
this.zzazr = paramList;
}
public int describeContents()
{
return 0;
}
public Status getStatus()
{
return this.zzTA;
}
int getVersionCode()
{
return this.mVersionCode;
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
zzf.zza(this, paramParcel, paramInt);
}
List<DataSourceStatsResult> zzuL()
{
return this.zzazr;
}
}
/* Location: /Users/subdiox/Downloads/dex2jar-2.0/net.wargaming.wot.blitz-dex2jar.jar!/com/google/android/gms/fitness/result/DataStatsResult.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"subdiox@gmail.com"
] |
subdiox@gmail.com
|
d622c842b43c2524be0deee32af82882e0c63222
|
c519b7eeaf4ec02978737a3fe6c4dafe2e94925d
|
/src/com/diamond/android/massagenearby/MessagesFragment.java
|
11547f8615785c07d31ecf8a379a3d49326435c2
|
[] |
no_license
|
samuelsmichael/MassageNearby
|
2702fe7f990c62bf5350f44461c767e38a293b01
|
6404871a06a20fedefa76e61bf1ba4f78c43d0f0
|
refs/heads/master
| 2020-05-20T13:04:34.009593
| 2014-12-11T07:34:08
| 2014-12-11T07:34:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,513
|
java
|
package com.diamond.android.massagenearby;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.diamond.android.massagenearby.MainActivity.PlaceholderFragment;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.ListFragment;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
/**
* A fragment representing a list of Items.
* <p />
* <p /> diamondsoftware
* Activities containing this fragment MUST implement the {@link Callbacks}
* interface.
*/
public class MessagesFragment extends ListFragment implements LoaderManager.LoaderCallbacks<Cursor> {
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static final DateFormat[] df = new DateFormat[] {
DateFormat.getDateInstance(), DateFormat.getTimeInstance()};
private OnFragmentInteractionListener mListener;
private SimpleCursorAdapter adapter;
private Date now;
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
try {
mListener = (OnFragmentInteractionListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener");
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
now = new Date();
adapter = new SimpleCursorAdapter(getActivity(),
R.layout.chat_list_item,
null,
new String[]{DataProvider.COL_MSG, DataProvider.COL_AT},
new int[]{R.id.text1, R.id.text2},
0);
adapter.setViewBinder(new SimpleCursorAdapter.ViewBinder() {
@Override
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
String from = cursor.getString(cursor.getColumnIndex(DataProvider.COL_FROM));
String to = cursor.getString(cursor.getColumnIndex(DataProvider.COL_TO));
switch(view.getId()) {
case R.id.text1:
LinearLayout parent = (LinearLayout) view.getParent();
LinearLayout root = (LinearLayout) parent.getParent();
if (from == null) {//myself
root.setGravity(Gravity.RIGHT);
root.setPadding(50, 10, 10, 10);
parent.setBackgroundColor(getResources().getColor(android.R.color.white));
} else {
root.setGravity(Gravity.LEFT);
root.setPadding(10, 10, 50, 10);
parent.setBackgroundColor(getResources().getColor(android.R.color.background_light));
}
break;
case R.id.text2:
TextView timeText = (TextView) view;
timeText.setText(getDisplayTime(cursor.getString(columnIndex)));
return true;
}
return false;
}
});
setListAdapter(adapter);
}
private static final String ARG_SECTION_NUMBER = "section_number";
/**
* Returns a new instance of this fragment for the given section
* number.
*/
public static MessagesFragment newInstance(int sectionNumber) {
MessagesFragment fragment = new MessagesFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, sectionNumber);
fragment.setArguments(args);
return fragment;
}
public MessagesFragment() {}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
getListView().setDivider(null);
Bundle args = new Bundle();
args.putString(DataProvider.COL_CHATID, mListener.getProfileChatId());
getLoaderManager().initLoader(0, args, this);
}
@Override
public void onDetach() {
super.onDetach();
mListener = null;
}
public interface OnFragmentInteractionListener {
public String getProfileChatId();
}
private String getDisplayTime(String datetime) {
try {
Date dt = sdf.parse(datetime);
if (now.getYear()==dt.getYear() && now.getMonth()==dt.getMonth() && now.getDate()==dt.getDate()) {
return df[1].format(dt);
}
return df[0].format(dt);
} catch (ParseException e) {
return datetime;
}
}
//----------------------------------------------------------------------------
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
String profileChatId = args.getString(DataProvider.COL_CHATID);
CursorLoader loader = new CursorLoader(getActivity(),
DataProvider.CONTENT_URI_MESSAGES,
null,
DataProvider.COL_TO + " = ? or (" + DataProvider.COL_FROM + " = ? and " + DataProvider.COL_TO + " = ?)",
new String[]{profileChatId, profileChatId, ((ApplicationMassageNearby) getActivity().getApplication()).getSettingsManager().getChatId()},
DataProvider.COL_AT + " DESC");
return loader;
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
adapter.swapCursor(data);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
adapter.swapCursor(null);
}
}
|
[
"samuelsmichael222@gmail.com"
] |
samuelsmichael222@gmail.com
|
5497471a748efb44ef02c9081d0a85655afcbc59
|
88389f591d69dfe8f623c97989b2a9414b1a98f9
|
/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxMetricsExportAutoConfiguration.java
|
7dc1b765cff1d9d71d4b520c2546d60acf26037e
|
[
"Apache-2.0"
] |
permissive
|
slaveuser/spring-boot20180215
|
155b0ba7127b667812dfe611d565e5ff766f5cdc
|
c4feb0dd4258f0db8fa2f65245a5ea89548f3595
|
refs/heads/master
| 2023-01-12T09:55:00.789178
| 2019-04-02T15:22:19
| 2019-04-02T15:22:19
| 179,105,753
| 0
| 0
|
Apache-2.0
| 2022-12-27T14:52:23
| 2019-04-02T15:20:16
|
Java
|
UTF-8
|
Java
| false
| false
| 2,901
|
java
|
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.metrics.export.jmx;
import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.util.HierarchicalNameMapper;
import io.micrometer.jmx.JmxConfig;
import io.micrometer.jmx.JmxMeterRegistry;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* {@link EnableAutoConfiguration Auto-configuration} for exporting metrics to JMX.
*
* @author Jon Schneider
* @since 2.0.0
*/
@Configuration
@AutoConfigureBefore(SimpleMetricsExportAutoConfiguration.class)
@AutoConfigureAfter(MetricsAutoConfiguration.class)
@ConditionalOnBean(Clock.class)
@ConditionalOnClass(JmxMeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.jmx", name = "enabled", havingValue = "true", matchIfMissing = true)
@EnableConfigurationProperties(JmxProperties.class)
public class JmxMetricsExportAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public JmxConfig jmxConfig(JmxProperties jmxProperties) {
return new JmxPropertiesConfigAdapter(jmxProperties);
}
@Bean(destroyMethod = "stop")
@ConditionalOnMissingBean
public JmxMeterRegistry jmxMeterRegistry(JmxConfig config,
HierarchicalNameMapper nameMapper, Clock clock) {
return new JmxMeterRegistry(config, clock, nameMapper);
}
@Bean
@ConditionalOnMissingBean
public HierarchicalNameMapper hierarchicalNameMapper() {
return HierarchicalNameMapper.DEFAULT;
}
}
|
[
"gmcpo@LAPTOP-2AD376QK"
] |
gmcpo@LAPTOP-2AD376QK
|
77714dce9ea95347452ba6d8b3f476d552aab9d4
|
183931eedd8ed7ff685e22cb055f86f12a54d707
|
/geekBrains/todolist/src/main/java/ru/geekbrains/todolist/controllers/LoginController.java
|
28f841695ff796731411d4f5df54b14963583615
|
[] |
no_license
|
cynepCTAPuk/headFirstJava
|
94a87be8f6958ab373cd1640a5bdb9c3cc3bf166
|
7cb45f6e2336bbc78852d297ad3474fd491e5870
|
refs/heads/master
| 2023-08-16T06:51:14.206516
| 2023-08-08T16:44:11
| 2023-08-08T16:44:11
| 154,661,091
| 0
| 1
| null | 2023-01-06T21:32:31
| 2018-10-25T11:40:54
|
Java
|
UTF-8
|
Java
| false
| false
| 1,691
|
java
|
package ru.geekbrains.todolist.controllers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import ru.geekbrains.todolist.repr.UserRepr;
import ru.geekbrains.todolist.service.UserService;
import javax.validation.Valid;
@Controller
public class LoginController {
private static final Logger logger = LoggerFactory.getLogger(LoginController.class);
private final UserService userService;
@Autowired
public LoginController(UserService userService) {
this.userService = userService;
}
@GetMapping("/login")
public String loginPage() {
return "login";
}
@GetMapping("/register")
public String registerPage(Model model) {
model.addAttribute("user", new UserRepr());
return "register";
}
@PostMapping("/register")
public String registerNewUser(@ModelAttribute("user") @Valid UserRepr userRepr, BindingResult result) {
logger.info("New user {}", userRepr);
if (result.hasErrors()) {
return "register";
}
if (!userRepr.getPassword().equals(userRepr.getMatchingPassword())) {
result.rejectValue("password", "", "Password not matching");
return "register";
}
userService.create(userRepr);
return "redirect:/login";
}
}
|
[
"CTAPuk@gmail.com"
] |
CTAPuk@gmail.com
|
b3ac4b53a53ded00ab2bae062762a920ff34e3f4
|
36bda14cc10d4d1f53c06620ccb94c100a1368b3
|
/DuelistMod/src/main/java/duelistmod/cards/pools/dragons/WhiteHornDragon.java
|
55d3be7b5fbc0e09b68e1e7ad6e8d89cd11a1303
|
[
"Unlicense"
] |
permissive
|
Dream5366/StS-DuelistMod
|
465e5e3ec56e630ac659cc0e57861f9dd6c15548
|
f2902db0e14cfa175053188b9f37b4c9611955ac
|
refs/heads/master
| 2021-05-18T02:43:50.357300
| 2020-02-15T15:17:54
| 2020-02-15T15:17:54
| 251,068,687
| 0
| 0
|
Unlicense
| 2020-03-29T15:43:02
| 2020-03-29T15:43:01
| null |
UTF-8
|
Java
| false
| false
| 4,238
|
java
|
package duelistmod.cards.pools.dragons;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import duelistmod.DuelistMod;
import duelistmod.abstracts.DuelistCard;
import duelistmod.orbs.WhiteOrb;
import duelistmod.patches.AbstractCardEnum;
import duelistmod.powers.*;
import duelistmod.powers.duelistPowers.WhiteHornDragonPower;
import duelistmod.variables.*;
public class WhiteHornDragon extends DuelistCard
{
// TEXT DECLARATION
public static final String ID = DuelistMod.makeID("WhiteHornDragon");
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
public static final String IMG = DuelistMod.makePath(Strings.WHITE_HORNED);
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION;
// /TEXT DECLARATION/
// STAT DECLARATION
private static final CardRarity RARITY = CardRarity.UNCOMMON;
private static final CardTarget TARGET = CardTarget.SELF;
private static final CardType TYPE = CardType.POWER;
public static final CardColor COLOR = AbstractCardEnum.DUELIST_MONSTERS;
private static final int COST = 2;
// /STAT DECLARATION/
public WhiteHornDragon() {
super(ID, NAME, IMG, COST, DESCRIPTION, TYPE, COLOR, RARITY, TARGET);
this.baseMagicNumber = this.magicNumber = 3;
this.tags.add(Tags.MONSTER);
this.tags.add(Tags.DRAGON);
this.misc = 0;
this.originalName = this.name;
this.tributes = this.baseTributes = 3;
}
// Actions the card should do.
@Override
public void use(AbstractPlayer p, AbstractMonster m)
{
tribute(p, this.tributes, false, this);
applyPowerToSelf(new WhiteHornDragonPower(this.magicNumber));
channel(new WhiteOrb());
}
// Which card to return when making a copy of this card.
@Override
public AbstractCard makeCopy() {
return new WhiteHornDragon();
}
// Upgraded stats.
@Override
public void upgrade() {
if (!this.upgraded) {
this.upgradeName();
this.upgradeMagicNumber(2);
this.rawDescription = UPGRADE_DESCRIPTION;
this.initializeDescription();
}
}
// If player doesn't have enough summons, can't play card
@Override
public boolean canUse(AbstractPlayer p, AbstractMonster m)
{
// Check super canUse()
boolean canUse = super.canUse(p, m);
if (!canUse) { return false; }
// Pumpking & Princess
else if (this.misc == 52) { return true; }
// Mausoleum check
else if (p.hasPower(EmperorPower.POWER_ID))
{
EmperorPower empInstance = (EmperorPower)p.getPower(EmperorPower.POWER_ID);
if (!empInstance.flag)
{
return true;
}
else
{
if (p.hasPower(SummonPower.POWER_ID)) { int temp = (p.getPower(SummonPower.POWER_ID).amount); if (temp >= this.tributes) { return true; } }
}
}
// Check for # of summons >= tributes
else { if (p.hasPower(SummonPower.POWER_ID)) { int temp = (p.getPower(SummonPower.POWER_ID).amount); if (temp >= this.tributes) { return true; } } }
// Player doesn't have something required at this point
this.cantUseMessage = this.tribString;
return false;
}
@Override
public void onTribute(DuelistCard tributingCard)
{
dragonSynTrib(tributingCard);
}
@Override
public void onResummon(int summons) {
// TODO Auto-generated method stub
}
@Override
public void summonThis(int summons, DuelistCard c, int var) {
// TODO Auto-generated method stub
}
@Override
public void summonThis(int summons, DuelistCard c, int var, AbstractMonster m) {
// TODO Auto-generated method stub
}
@Override
public String getID() {
return ID;
}
@Override
public void optionSelected(AbstractPlayer arg0, AbstractMonster arg1, int arg2) {
// TODO Auto-generated method stub
}
}
|
[
"nyoxidetwitter@gmail.com"
] |
nyoxidetwitter@gmail.com
|
e3152f82868871d17a759c5a37dab9139ca90bdb
|
ae16d23a4add4a97aac91c3cd4390f1a77d198ac
|
/bus-health/src/main/java/org/aoju/bus/health/hardware/UsbDevice.java
|
7895bac6eb10e39d7dfc5709b1e36451b2291534
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
beixinjing/bus
|
343cfdcc56c1d9ab05d10da0b703a817d19e6209
|
0396544fd5dc65edf48ae6cc999b8e9538c41216
|
refs/heads/master
| 2020-12-14T17:27:58.354218
| 2020-01-15T02:52:34
| 2020-01-15T02:52:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,646
|
java
|
/*
* The MIT License
*
* Copyright (c) 2015-2020 aoju.org All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.aoju.bus.health.hardware;
/**
* A USB device is a device connected via a USB port, possibly
* internally/permanently. Hubs may contain ports to which other devices connect
* in a recursive fashion.
*
* @author Kimi Liu
* @version 5.5.3
* @since JDK 1.8+
*/
public interface UsbDevice extends Comparable<UsbDevice> {
/**
* Name of the USB device
*
* @return The device name
*/
String getName();
/**
* Vendor that manufactured the USB device
*
* @return The vendor name
*/
String getVendor();
/**
* ID of the vendor that manufactured the USB device
*
* @return The vendor ID, a 4-digit hex string
*/
String getVendorId();
/**
* Product ID of the USB device
*
* @return The product ID, a 4-digit hex string
*/
String getProductId();
/**
* Serial number of the USB device
*
* @return The serial number, if known
*/
String getSerialNumber();
/**
* A Unique Device ID of the USB device, such as the PnPDeviceID (Windows),
* Device Node Path (Linux), Registry Entry ID (macOS), or Device Node number
* (Unix)
*
* @return The Unique Device ID
*/
String getUniqueDeviceId();
/**
* Other devices connected to this hub
*
* @return An array of other devices connected to this hub, if any, or an empty
* array if none
*/
UsbDevice[] getConnectedDevices();
}
|
[
"839536@qq.com"
] |
839536@qq.com
|
9a744e0c259b117aa1844254856031b267db0871
|
2c669ccff008612f6e12054d9162597f2088442c
|
/MEVO_apkpure.com_source_from_JADX/sources/com/inverce/mod/integrations/support/recycler/DataBinder$$Lambda$7.java
|
09a98e5cd4fbb1b9bf7a471237eb1480da875962
|
[] |
no_license
|
PythonicNinja/mevo
|
e97fb27f302cb3554a69b27022dada2134ff99c0
|
cab7cea9376085caead1302b93e62e0d34a75470
|
refs/heads/master
| 2020-05-02T22:32:46.764930
| 2019-03-28T23:37:51
| 2019-03-28T23:37:51
| 178,254,526
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 580
|
java
|
package com.inverce.mod.integrations.support.recycler;
import android.view.View;
import android.widget.TextView;
import com.inverce.mod.integrations.support.annotations.IBind.ToView;
import com.inverce.mod.integrations.support.annotations.MapValue.ToStringRes;
final /* synthetic */ class DataBinder$$Lambda$7 implements ToView {
private final ToStringRes arg$1;
DataBinder$$Lambda$7(ToStringRes toStringRes) {
this.arg$1 = toStringRes;
}
public void bind(Object obj, View view, int i) {
((TextView) view).setText(this.arg$1.get(obj));
}
}
|
[
"mail@pythonic.ninja"
] |
mail@pythonic.ninja
|
a0b5647ebd7a783257e98118da87e27f8cb22bc0
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project54/src/main/java/org/gradle/test/performance54_3/Production54_214.java
|
72a8401036f05df512cf7340b9532a0265585d36
|
[] |
no_license
|
gradle/performance-comparisons
|
b0d38db37c326e0ce271abebdb3c91769b860799
|
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
|
refs/heads/master
| 2023-08-14T19:24:39.164276
| 2022-11-24T05:18:33
| 2022-11-24T05:18:33
| 80,121,268
| 17
| 15
| null | 2022-09-30T08:04:35
| 2017-01-26T14:25:33
| null |
UTF-8
|
Java
| false
| false
| 305
|
java
|
package org.gradle.test.performance54_3;
public class Production54_214 extends org.gradle.test.performance15_3.Production15_214 {
private final String property;
public Production54_214() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
0cfc4d2c4d4e72fcda447f7538a9875363413ac8
|
f7295dfe3c303e1d656e7dd97c67e49f52685564
|
/smali/com/google/zxing/pdf417/decoder/BoundingBox.java
|
1bf98d28eab05f8abed0b0c1dc6ee3f9e9597ff8
|
[] |
no_license
|
Eason-Chen0452/XiaoMiGame
|
36a5df0cab79afc83120dab307c3014e31f36b93
|
ba05d72a0a0c7096d35d57d3b396f8b5d15729ef
|
refs/heads/master
| 2022-04-14T11:08:31.280151
| 2020-04-14T08:57:25
| 2020-04-14T08:57:25
| 255,541,211
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,672
|
java
|
package com.google.zxing.pdf417.decoder;
import com.google.zxing.NotFoundException;
import com.google.zxing.ResultPoint;
import com.google.zxing.common.BitMatrix;
final class BoundingBox
{
private ResultPoint bottomLeft;
private ResultPoint bottomRight;
private BitMatrix image;
private int maxX;
private int maxY;
private int minX;
private int minY;
private ResultPoint topLeft;
private ResultPoint topRight;
BoundingBox(BitMatrix paramBitMatrix, ResultPoint paramResultPoint1, ResultPoint paramResultPoint2, ResultPoint paramResultPoint3, ResultPoint paramResultPoint4)
throws NotFoundException
{
if (((paramResultPoint1 == null) && (paramResultPoint3 == null)) || ((paramResultPoint2 == null) && (paramResultPoint4 == null)) || ((paramResultPoint1 != null) && (paramResultPoint2 == null)) || ((paramResultPoint3 != null) && (paramResultPoint4 == null))) {
throw NotFoundException.getNotFoundInstance();
}
init(paramBitMatrix, paramResultPoint1, paramResultPoint2, paramResultPoint3, paramResultPoint4);
}
BoundingBox(BoundingBox paramBoundingBox)
{
init(paramBoundingBox.image, paramBoundingBox.topLeft, paramBoundingBox.bottomLeft, paramBoundingBox.topRight, paramBoundingBox.bottomRight);
}
private void calculateMinMaxValues()
{
if (this.topLeft == null)
{
this.topLeft = new ResultPoint(0.0F, this.topRight.getY());
this.bottomLeft = new ResultPoint(0.0F, this.bottomRight.getY());
}
for (;;)
{
this.minX = ((int)Math.min(this.topLeft.getX(), this.bottomLeft.getX()));
this.maxX = ((int)Math.max(this.topRight.getX(), this.bottomRight.getX()));
this.minY = ((int)Math.min(this.topLeft.getY(), this.topRight.getY()));
this.maxY = ((int)Math.max(this.bottomLeft.getY(), this.bottomRight.getY()));
return;
if (this.topRight == null)
{
this.topRight = new ResultPoint(this.image.getWidth() - 1, this.topLeft.getY());
this.bottomRight = new ResultPoint(this.image.getWidth() - 1, this.bottomLeft.getY());
}
}
}
private void init(BitMatrix paramBitMatrix, ResultPoint paramResultPoint1, ResultPoint paramResultPoint2, ResultPoint paramResultPoint3, ResultPoint paramResultPoint4)
{
this.image = paramBitMatrix;
this.topLeft = paramResultPoint1;
this.bottomLeft = paramResultPoint2;
this.topRight = paramResultPoint3;
this.bottomRight = paramResultPoint4;
calculateMinMaxValues();
}
static BoundingBox merge(BoundingBox paramBoundingBox1, BoundingBox paramBoundingBox2)
throws NotFoundException
{
if (paramBoundingBox1 == null) {
return paramBoundingBox2;
}
if (paramBoundingBox2 == null) {
return paramBoundingBox1;
}
return new BoundingBox(paramBoundingBox1.image, paramBoundingBox1.topLeft, paramBoundingBox1.bottomLeft, paramBoundingBox2.topRight, paramBoundingBox2.bottomRight);
}
BoundingBox addMissingRows(int paramInt1, int paramInt2, boolean paramBoolean)
throws NotFoundException
{
Object localObject3 = this.topLeft;
ResultPoint localResultPoint1 = this.bottomLeft;
Object localObject4 = this.topRight;
ResultPoint localResultPoint2 = this.bottomRight;
Object localObject1 = localObject3;
Object localObject2 = localObject4;
if (paramInt1 > 0)
{
if (paramBoolean)
{
localObject1 = this.topLeft;
int i = (int)((ResultPoint)localObject1).getY() - paramInt1;
paramInt1 = i;
if (i < 0) {
paramInt1 = 0;
}
localObject1 = new ResultPoint(((ResultPoint)localObject1).getX(), paramInt1);
if (!paramBoolean) {
break label201;
}
localObject2 = localObject4;
}
}
else
{
label90:
localObject3 = localResultPoint1;
localObject4 = localResultPoint2;
if (paramInt2 > 0)
{
if (!paramBoolean) {
break label212;
}
localObject3 = this.bottomLeft;
label112:
paramInt2 = (int)((ResultPoint)localObject3).getY() + paramInt2;
paramInt1 = paramInt2;
if (paramInt2 >= this.image.getHeight()) {
paramInt1 = this.image.getHeight() - 1;
}
localObject3 = new ResultPoint(((ResultPoint)localObject3).getX(), paramInt1);
if (!paramBoolean) {
break label221;
}
localObject4 = localResultPoint2;
}
}
for (;;)
{
calculateMinMaxValues();
return new BoundingBox(this.image, (ResultPoint)localObject1, (ResultPoint)localObject3, (ResultPoint)localObject2, (ResultPoint)localObject4);
localObject1 = this.topRight;
break;
label201:
localObject2 = localObject1;
localObject1 = localObject3;
break label90;
label212:
localObject3 = this.bottomRight;
break label112;
label221:
localObject4 = localObject3;
localObject3 = localResultPoint1;
}
}
ResultPoint getBottomLeft()
{
return this.bottomLeft;
}
ResultPoint getBottomRight()
{
return this.bottomRight;
}
int getMaxX()
{
return this.maxX;
}
int getMaxY()
{
return this.maxY;
}
int getMinX()
{
return this.minX;
}
int getMinY()
{
return this.minY;
}
ResultPoint getTopLeft()
{
return this.topLeft;
}
ResultPoint getTopRight()
{
return this.topRight;
}
}
/* Location: C:\Users\Administrator\Desktop\apk\dex2jar\classes-dex2jar.jar!\com\google\zxing\pdf417\decoder\BoundingBox.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"chen_guiq@163.com"
] |
chen_guiq@163.com
|
6cb24d98cf62b1ba74c36fbddfec58834262bfb1
|
2395a9adc271362b10e9189582d2e82237a369f3
|
/MinecraftTools/server/work/decompile-ba9a3cce/net/minecraft/server/PacketPlayOutSpawnPosition.java
|
e25b052a4693184265e706c211534ce705382928
|
[] |
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
| 870
|
java
|
package net.minecraft.server;
import java.io.IOException;
public class PacketPlayOutSpawnPosition implements Packet<PacketListenerPlayOut> {
public BlockPosition position;
public PacketPlayOutSpawnPosition() {}
public PacketPlayOutSpawnPosition(BlockPosition blockposition) {
this.position = blockposition;
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
this.position = packetdataserializer.c();
}
public void b(PacketDataSerializer packetdataserializer) throws IOException {
packetdataserializer.a(this.position);
}
public void a(PacketListenerPlayOut packetlistenerplayout) {
packetlistenerplayout.a(this);
}
public void a(PacketListener packetlistener) {
this.a((PacketListenerPlayOut) packetlistener);
}
}
|
[
"pennykrakow@Nicoles-Mac-mini.local"
] |
pennykrakow@Nicoles-Mac-mini.local
|
b556bcc5f5b14da3f1f39b6e6afef8951e3c6b4e
|
29f80c707a1484826dc1b316bb00ba2aefc5e227
|
/5° Modulo/java-9-Crud-User/src/main/java/com/challenge/controller/UserController.java
|
3d01b77ddb8694695f821777b5d915e289fd7aa3
|
[] |
no_license
|
marcelosoliveira/aceleracao-java
|
f892cac90922f73aa834783947e7a4dcdab415b5
|
adb4d065c457abddb8acc64a7b69597dbbcdb6bf
|
refs/heads/master
| 2023-04-20T17:07:28.791559
| 2021-05-14T23:57:16
| 2021-05-14T23:57:16
| 338,312,704
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,053
|
java
|
package com.challenge.controller;
import com.challenge.entity.user.User;
import com.challenge.repository.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping(path = "/")
public class UserController {
@Autowired
private RepositoryUser repositoryUser;
@GetMapping(path = "/user")
public Iterable<User> list() {
return repositoryUser.findAll();
}
@GetMapping(path = "/user/{id}")
public User userListUnique(@PathVariable(value = "id") long id) {
return repositoryUser.findById(id);
}
@PostMapping(path = "/user")
public User saveUser(@RequestBody User user) {
return repositoryUser.save(user);
}
@PutMapping(path = "/user")
public User upadateUser(@RequestBody User user) {
return repositoryUser.save(user);
}
@DeleteMapping(path = "/user/{id}")
public void deleteUser(@PathVariable(value = "id") long id) {
repositoryUser.deleteById(id);
}
}
|
[
"msbobsk8@gmail.com"
] |
msbobsk8@gmail.com
|
8bb9423dfff822fffcdf98119c12d7f73e24f20d
|
d5dad5e819bd88e09cd1f4c8a6ebe7a6f57d9593
|
/LeetCode/src/main/java/easy/NonDecreasingArray.java
|
993a00ec2dbc9f53862fe7889c4e50d84c2b8ceb
|
[] |
no_license
|
SergiOn/algorithms
|
195c91dc1b3acba2e63c64eab8f4ca4c4730e740
|
84c877229c4d74ede6368d3f384cf0581982ee9e
|
refs/heads/main
| 2023-04-27T05:47:49.615760
| 2021-04-02T15:20:35
| 2021-04-02T15:20:35
| 255,287,885
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,014
|
java
|
package easy;
/**
* 665. Non-decreasing Array
*
* https://leetcode.com/problems/non-decreasing-array
*
* Given an array nums with n integers,
* your task is to check if it could become non-decreasing by modifying at most 1 element.
*
* We define an array is non-decreasing
* if nums[i] <= nums[i + 1] holds for every i (0-based) such that (0 <= i <= n - 2).
*
* Example 1:
* Input: nums = [4,2,3]
* Output: true
* Explanation: You could modify the first 4 to 1 to get a non-decreasing array.
*
* Example 2:
* Input: nums = [4,2,1]
* Output: false
* Explanation: You can't get a non-decreasing array by modify at most one element.
*
* Constraints:
* 1 <= n <= 10 ^ 4
* - 10 ^ 5 <= nums[i] <= 10 ^ 5
*/
public class NonDecreasingArray {
public boolean checkPossibility(int[] nums) {
final int length = nums.length;
int errorCount = 0;
if (length <= 2) {
return true;
}
final int[] newNums = new int[length];
System.arraycopy(nums, 0, newNums, 0, length);
for (int i = 0; i < length - 1; i++) {
if (newNums[i] > newNums[i + 1]) {
errorCount += 1;
if (i - 1 >= 0 && newNums[i - 1] <= newNums[i + 1]) {
newNums[i] = newNums[i - 1];
} else if (i + 2 < length && newNums[i] <= newNums[i + 2]) {
newNums[i + 1] = newNums[i + 2];
} else if (i - 1 >= 0 && i + 2 < length
&& newNums[i + 1] <= newNums[i + 2]
&& newNums[i - 1] <= newNums[i + 1]) {
newNums[i] = newNums[i + 1];
} else if (i - 1 < 0 && newNums[i + 1] <= newNums[i + 2]) {
newNums[i] = newNums[i + 1];
} else if (i + 2 == length) {
newNums[i + 1] = newNums[i];
} else {
return false;
}
}
}
return errorCount < 2;
}
}
|
[
"onishhenko@gmail.com"
] |
onishhenko@gmail.com
|
1679a57fe47844c2c6bef0bd5cfdb44a367d9fbb
|
6cc3040c20a3c395d6f48bfbb0a12949b7de9753
|
/jeecg-p3-biz-qywx/src/main/java/com/jeecg/qywx/core/weixin/model/req/LinkMessage.java
|
6588f5edf8a055f76ca10ff632be7ab903ba586e
|
[
"Apache-2.0"
] |
permissive
|
1621740748/jeewx
|
286e07e8e519db02de4b44af7ee09d1f7f1f2a69
|
fd2f2a2a97bda2fc6b86f1bd660f240ce1140bd3
|
refs/heads/master
| 2022-04-24T03:02:45.576929
| 2020-04-28T05:25:27
| 2020-04-28T05:25:27
| 259,304,515
| 0
| 0
|
Apache-2.0
| 2020-04-27T12:12:38
| 2020-04-27T12:12:37
| null |
UTF-8
|
Java
| false
| false
| 727
|
java
|
package com.jeecg.qywx.core.weixin.model.req;
/**
* 连接消息
* @author Administrator
*
*/
public class LinkMessage extends BaseMessage{
// 消息标题
private String Title;
// 消息描述
private String Description;
// 消息链接
private String Url;
public String getTitle() {
return Title;
}
public void setTitle(String title) {
Title = title;
}
public String getDescription() {
return Description;
}
public void setDescription(String description) {
Description = description;
}
public String getUrl() {
return Url;
}
public void setUrl(String url) {
Url = url;
}
}
|
[
"zhangdaiscott@163.com"
] |
zhangdaiscott@163.com
|
6988bff10a82cc6a74238aabe5f8ba23b7ab37ff
|
71d964c84072e18e166aadf4a3168c39b967a65c
|
/src/main/java/org/jboss/pnc/bifrost/endpoint/websocket/MethodUnSubscribe.java
|
c388feda3bc01be38bc2d99c4859ef675c420e33
|
[] |
no_license
|
janinko/bifrost
|
00207895771c8463520e575e82f8c091361bca6e
|
cc5ccb695f8de8533a06c0271d20ebef11fb85e1
|
refs/heads/master
| 2022-10-02T23:52:59.161820
| 2020-04-02T09:17:38
| 2020-04-02T09:17:38
| 252,449,160
| 0
| 0
| null | 2020-04-02T12:29:04
| 2020-04-02T12:29:03
| null |
UTF-8
|
Java
| false
| false
| 1,053
|
java
|
package org.jboss.pnc.bifrost.endpoint.websocket;
import org.jboss.pnc.api.bifrost.dto.Line;
import org.jboss.pnc.bifrost.common.scheduler.Subscription;
import org.jboss.pnc.bifrost.endpoint.provider.DataProvider;
import javax.inject.Inject;
import java.util.function.Consumer;
/**
* @author <a href="mailto:matejonnet@gmail.com">Matej Lazar</a>
*/
public class MethodUnSubscribe extends MethodBase implements Method<UnSubscribeDto> {
@Inject
DataProvider dataProvider;
@Override
public String getName() {
return "UNSUBSCRIBE";
}
@Override
public Class<UnSubscribeDto> getParameterType() {
return UnSubscribeDto.class;
}
@Override
public Result apply(UnSubscribeDto methodUnSubscribeIn, Consumer<Line> responseConsumer) {
Subscription subscription = new Subscription(
getSession().getId(),
methodUnSubscribeIn.getSubscriptionTopic(),
() -> {});
dataProvider.unsubscribe(subscription);
return new OkResult();
}
}
|
[
"matejonnet@gmail.com"
] |
matejonnet@gmail.com
|
0973c259c7628a6cc2cac663de613667e27b74ff
|
f698ac11c7ebe708750371a3d2336f6ff3776f18
|
/src/main/java/littleservantmod/LSMBiomes.java
|
554a40b996f446669af9184b9748052b4be002e6
|
[] |
no_license
|
shift02/LittleServantMod
|
4763f833c4c56f851833130d7066e34bbd968428
|
b3ea0ee5d84b255d0cc11102f1ac4a8a2f35fb0b
|
refs/heads/master
| 2021-06-28T17:25:15.614452
| 2019-02-18T13:44:01
| 2019-02-18T13:44:01
| 133,219,783
| 6
| 2
| null | 2018-07-24T11:54:34
| 2018-05-13T08:43:09
|
Java
|
UTF-8
|
Java
| false
| false
| 1,513
|
java
|
package littleservantmod;
import java.util.Iterator;
import org.apache.logging.log4j.Logger;
import littleservantmod.entity.EntityLittleServant;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.fml.common.registry.EntityRegistry;
public class LSMBiomes {
public static void registerBiomesSpawn(Logger logger) {
Iterator<Biome> biomeIterator = Biome.REGISTRY.iterator();
while (biomeIterator.hasNext()) {
Biome biome = biomeIterator.next();
if (biome != null && canSpawn(biome)) {
EntityRegistry.addSpawn(EntityLittleServant.class, 7, 2, 6, EnumCreatureType.CREATURE, biome);
logger.info("Registering spawn in " + LSMProxy.getProxy().getBiomeName(biome));
}
}
}
private static boolean canSpawn(Biome biome) {
//伝統 砂漠で探す
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY)) return true;
//if(BiomeDictionary.hasType(biome, BiomeDictionary.Type.HOT))return false;
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.COLD)) return false;
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)) return false;
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.END)) return false;
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.VOID)) return false;
return true;
}
}
|
[
"shift02ss@gmail.com"
] |
shift02ss@gmail.com
|
1fbc7d3fad8688a88939d715619826765d2adaa1
|
7f20b1bddf9f48108a43a9922433b141fac66a6d
|
/cytoscape/tags/Cyto-2_3_2/src/cytoscape/view/unitTests/CytoscapeViewTests.java
|
7b48e718ee70d87e391f8ae6efb990ec2ed01259
|
[] |
no_license
|
ahdahddl/cytoscape
|
bf783d44cddda313a5b3563ea746b07f38173022
|
a3df8f63dba4ec49942027c91ecac6efa920c195
|
refs/heads/master
| 2020-06-26T16:48:19.791722
| 2013-08-28T04:08:31
| 2013-08-28T04:08:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,433
|
java
|
/*
File: CytoscapeViewTests.java
Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
The Cytoscape Consortium is:
- Institute for Systems Biology
- University of California San Diego
- Memorial Sloan-Kettering Cancer Center
- Institut Pasteur
- Agilent Technologies
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
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. The software and
documentation provided hereunder is on an "as is" basis, and the
Institute for Systems Biology and the Whitehead Institute
have no obligations to provide maintenance, support,
updates, enhancements or modifications. In no event shall the
Institute for Systems Biology and the Whitehead Institute
be liable to any party for direct, indirect, special,
incidental or consequential damages, including lost profits, arising
out of the use of this software and its documentation, even if the
Institute for Systems Biology and the Whitehead Institute
have been advised of the possibility of such damage. 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.
*/
// $Revision$
// $Date$
// $Author$
package cytoscape.view.unitTests;
import junit.framework.*;
import java.io.*;
import java.util.*;
import giny.model.*;
import giny.view.*;
import cytoscape.*;
import cytoscape.view.CyNetworkView;
import cytoscape.unitTests.AllTests;
public class CytoscapeViewTests extends TestCase {
CyNetwork network;
CyNode node1;
CyNode node2;
CyEdge edge1;
CyEdge edge2;
CyNetworkView view;
NodeView nodeView1;
NodeView nodeView2;
EdgeView edgeView1;
EdgeView edgeView2;
public CytoscapeViewTests (String name) {
super (name);
}
public void setUp () throws Exception {
node1 = Cytoscape.getCyNode("node1", true);
node2 = Cytoscape.getCyNode("node2", true);
edge1 = Cytoscape.getCyEdge("node1", "node1 (pp) node2", "node2", "pp");
edge2 = Cytoscape.getCyEdge("node2", "node2 (pp) node1", "node1", "pp");
int[] nodeArray = { node1.getRootGraphIndex(), node2.getRootGraphIndex() };
int[] edgeArray = { edge1.getRootGraphIndex(), edge2.getRootGraphIndex() };
network = Cytoscape.createNetwork(nodeArray, edgeArray, null);
view = Cytoscape.createNetworkView(network);
nodeView1 = view.getNodeView(node1);
nodeView2 = view.getNodeView(node2);
edgeView1 = view.getEdgeView(edge1);
edgeView2 = view.getEdgeView(edge2);
}
public void tearDown () throws Exception {
}
/**
* Tests that the view is properly modified when the flagger is changed.
*/
public void testFilterToView() throws Exception {
checkState(false, false, false, false);
network.setFlagged(node1, true);
checkState(true, false, false, false);
network.setFlagged(edge2, true);
checkState(true, false, false, true);
network.flagAllNodes();
checkState(true, true, false, true);
network.flagAllEdges();
checkState(true, true, true, true);
network.setFlagged(node2, false);
checkState(true, false, true, true);
network.setFlagged(edge1, false);
checkState(true, false, false, true);
network.unFlagAllEdges();
checkState(true, false, false, false);
network.unFlagAllNodes();
checkState(false, false, false, false);
}
/**
* Tests that the flagger is properly modified when the view is changed.
*/
public void testViewToFilter() throws Exception {
checkState(false, false, false, false);
nodeView1.setSelected(true);
checkState(true, false, false, false);
edgeView2.setSelected(true);
checkState(true, false, false, true);
nodeView2.setSelected(true);
checkState(true, true, false, true);
edgeView1.setSelected(true);
checkState(true, true, true, true);
nodeView2.setSelected(false);
checkState(true, false, true, true);
edgeView1.setSelected(false);
checkState(true, false, false, true);
edgeView2.setSelected(false);
checkState(true, false, false, false);
nodeView1.setSelected(false);
checkState(false, false, false, false);
}
/**
* Checks that the current state of the filter and the view match the state
* defined by the arguments.
*/
public void checkState ( boolean n1, boolean n2, boolean e1, boolean e2 ) {
assertTrue( network.isFlagged(node1) == n1 );
assertTrue( network.isFlagged(node2) == n2 );
//assertTrue( network.isFlagged(edge1) == e1 );
//assertTrue( network.isFlagged(edge2) == e2 );
//assertTrue( nodeView1.isSelected() == n1 );
// assertTrue( nodeView2.isSelected() == n2 );
//assertTrue( edgeView1.isSelected() == e1 );
//assertTrue( edgeView2.isSelected() == e2 );
}
public static void main ( String[] args ) {
junit.textui.TestRunner.run (new TestSuite (CytoscapeViewTests.class));
Cytoscape.exit(0);
}
//------------------------------------------------------------------------------
}
|
[
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] |
mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5
|
02256c62c644583da7a7a2a4461246c28027eb20
|
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
|
/java/classes2/com/superrtc/call/MediaStream.java
|
c6d93cfe98b8f057a6153940ccb0f3d1d5e0e633
|
[
"Apache-2.0"
] |
permissive
|
Paladin1412/house
|
2bb7d591990c58bd7e8a9bf933481eb46901b3ed
|
b9e63db1a4975b614c422fed3b5b33ee57ea23fd
|
refs/heads/master
| 2021-09-17T03:37:48.576781
| 2018-06-27T12:39:38
| 2018-06-27T12:41:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,617
|
java
|
package com.superrtc.call;
import java.util.LinkedList;
public class MediaStream
{
public final LinkedList<b> a = new LinkedList();
public final LinkedList<VideoTrack> b = new LinkedList();
public final LinkedList<VideoTrack> c = new LinkedList();
final long d;
public MediaStream(long paramLong)
{
this.d = paramLong;
}
private static native void free(long paramLong);
private static native boolean nativeAddAudioTrack(long paramLong1, long paramLong2);
private static native boolean nativeAddVideoTrack(long paramLong1, long paramLong2);
private static native String nativeLabel(long paramLong);
private static native boolean nativeRemoveAudioTrack(long paramLong1, long paramLong2);
private static native boolean nativeRemoveVideoTrack(long paramLong1, long paramLong2);
public boolean addPreservedTrack(VideoTrack paramVideoTrack)
{
if (nativeAddVideoTrack(this.d, paramVideoTrack.a))
{
this.c.add(paramVideoTrack);
return true;
}
return false;
}
public boolean addTrack(VideoTrack paramVideoTrack)
{
if (nativeAddVideoTrack(this.d, paramVideoTrack.a))
{
this.b.add(paramVideoTrack);
return true;
}
return false;
}
public boolean addTrack(b paramb)
{
if (nativeAddAudioTrack(this.d, paramb.a))
{
this.a.add(paramb);
return true;
}
return false;
}
public void dispose()
{
Object localObject;
while (!this.a.isEmpty())
{
localObject = (b)this.a.getFirst();
removeTrack((b)localObject);
((b)localObject).dispose();
}
while (!this.b.isEmpty())
{
localObject = (VideoTrack)this.b.getFirst();
removeTrack((VideoTrack)localObject);
((VideoTrack)localObject).dispose();
}
while (!this.c.isEmpty()) {
removeTrack((VideoTrack)this.c.getFirst());
}
free(this.d);
}
public String label()
{
return nativeLabel(this.d);
}
public boolean removeTrack(VideoTrack paramVideoTrack)
{
this.b.remove(paramVideoTrack);
this.c.remove(paramVideoTrack);
return nativeRemoveVideoTrack(this.d, paramVideoTrack.a);
}
public boolean removeTrack(b paramb)
{
this.a.remove(paramb);
return nativeRemoveAudioTrack(this.d, paramb.a);
}
public String toString()
{
return "[" + label() + ":A=" + this.a.size() + ":V=" + this.b.size() + "]";
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes2-dex2jar.jar!/com/superrtc/call/MediaStream.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"ght163988@autonavi.com"
] |
ght163988@autonavi.com
|
27a64ad2c9135bee0d24fe22bbbe997ff95f1b10
|
6252c165657baa6aa605337ebc38dd44b3f694e2
|
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/TemperatureController1383.java
|
ec3e3883d4208554ff3e21f2fc7cdbbe14231b2b
|
[] |
no_license
|
soha500/EglSync
|
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
|
55101bc781349bb14fefc178bf3486e2b778aed6
|
refs/heads/master
| 2021-06-23T02:55:13.464889
| 2020-12-11T19:10:01
| 2020-12-11T19:10:01
| 139,832,721
| 0
| 1
| null | 2019-05-31T11:34:02
| 2018-07-05T10:20:00
|
Java
|
UTF-8
|
Java
| false
| false
| 371
|
java
|
package syncregions;
public class TemperatureController1383 {
public int execute(int temperature1383, int targetTemperature1383) {
//sync _bfpnFUbFEeqXnfGWlV1383, behaviour
1-if(temperatureDifference > 0 && boilerStatus == true) { return 1; } else if (temperatureDifference < 0 && boilerStatus == false) { return 2; } else return 0;
//endSync
}
}
|
[
"sultanalmutairi@172.20.10.2"
] |
sultanalmutairi@172.20.10.2
|
602f54d53717a19282c15aee37a6c1f057a6261e
|
1d11d02630949f18654d76ed8d5142520e559b22
|
/TolwebHibernate/src/org/tolweb/dao/PermissionChecker.java
|
fce7febd941ea3784cd16c2337e13d5f3c5c65ec
|
[] |
no_license
|
tolweb/tolweb-app
|
ca588ff8f76377ffa2f680a3178351c46ea2e7ea
|
3a7b5c715f32f71d7033b18796d49a35b349db38
|
refs/heads/master
| 2021-01-02T14:46:52.512568
| 2012-03-31T19:22:24
| 2012-03-31T19:22:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,648
|
java
|
/*
* Created on Nov 19, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.tolweb.dao;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.jdom.Document;
import org.tolweb.hibernate.MappedAccessoryPage;
import org.tolweb.hibernate.MappedPage;
import org.tolweb.treegrow.main.Contributor;
import org.tolweb.treegrow.main.NodeImage;
import org.tolweb.treegrow.main.Permission;
/**
* @author dmandel
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public interface PermissionChecker {
public Document checkPermission(String user, String password);
/**
* Checks to see if the password works for the contributor
* @param user
* @param password
* @return An error document if failure, null otherwise
*/
public Document checkPermission(Contributor user, String password);
/**
* Returns an xml doc specifying if this contributor has permissions for the node
* @param user
* @param password
* @param nodeId
* @return Null, if the contributor has permissions, an error document otherwise
*/
public Document checkPermissionForNode(Contributor user, String password, Long nodeId);
/**
* Returns an xml doc specifying if this contributor has permissions for the node
* @param email of the contributor to check
* @param password
* @param nodeId
* @return Null, if the contributor has permissions, an error document otherwise
*/
public Document checkPermissionForNode(String user, String password, Long nodeId);
/**
* Returns a boolean if this contributor has read/write permissions for the node
* @param contributor
* @param nodeId
* @return true, if the contributor has permissions, false otherwise
*/
public boolean checkHasPermissionForNode(Contributor contributor, Long nodeId);
/**
* checks to see whether the given contributor can edit the page.
* if the page is currently checked out to another contributor,
* it returns that contributor. otherwise it returns null
*
* @param contr
* @param page
* @return the checked out contributor, if they exist, null otherwise
*/
public Contributor checkPageIsLocked(Contributor contr, MappedPage page);
/**
* Checks whether the page has been submitted for publication
* @param page the page to check
* @return true if submitted, false otherwise
*/
public boolean checkPageIsSubmitted(MappedPage page);
/**
* Checks whether the page has been submitted for publication
* and also whether the contributor is an editor and can edit
* the submitted page
* @param contr The contributor to check if they are an editor
* @param page the page to check
* @return true if submitted, false otherwise
*/
public boolean checkPageIsSubmitted(Contributor contr, MappedPage page);
public String getLockedMessageForEditHistory(Long editHistoryId);
public Contributor checkAccessoryPageIsLocked(Contributor contr, MappedAccessoryPage page);
public boolean checkAccessoryPageIsSubmitted(Contributor contr, MappedAccessoryPage page);
/**
* Checks whether the contributor is an EDITOR for a particular
* node, not just whether they can change node content
* @param contributor
* @param nodeId
* @return
*/
public boolean checkHasEditingPermissionForNode(Contributor contributor, Long nodeId);
/**
* Returns a list of contributor ids that have read/write permissions for the nodeId
* parameter or any of its ancestors
* @param nodeId
* @return
*/
public List getContributorIdsWithPermissionsForAncestorNodes(Long nodeId);
/**
* Returns a list of the scientific editor who have editing permissions over
* a particular node
* @param node
* @return
*/
public List getScientificEditorsForNodes(Set nodeId);
public Document returnNoContributorDocument();
public Document returnWrongPasswordDocument();
public Document returnNoPermissionsDocument();
/**
* Removes all node attachments for the contributor, permissions or not
* @param contr
*/
public void removeAllNodeAttachmentsForContributor(Contributor contr);
public void updatePermissionsForContributor(Contributor contr);
/**
* @deprecated
* @param contr
* @param hasPermissions
*/
public void updateNodeAttachmentsForContributor(Contributor contr, boolean hasPermissions);
public void updateNodeAttachmentsForContributor(Contributor contr, int attachmentType, Collection<Permission> permissions);
public void removeNodeAttachmentForContributor(int contrId, Long nodeId);
public void addNodeAttachmentForContributor(int contrId, Long nodeId);
public void addNodeAttachmentForContributor(int contrId, Long nodeId, boolean hasPermissions);
/**
* Checks to see if a contributor is *physically* attached to a node. If
* they are it returns the boolean true. If not, but they are attached to
* an ancestor, it returns the ancestor name. If not attached to the node
* or an ancestor, it returns the boolean false.
* @param contrId
* @param nodeId
* @param hasPermissions
* @return
*/
public Object checkIsAttachedToNode(int contrId, Long nodeId, boolean hasPermissions);
public boolean isLearningEditor(Contributor contr);
/**
* Whether the contributor is an editor (currently only David, Danny, and Katja)
* @param contr
* @return
*/
public boolean isEditor(Contributor contr);
public boolean checkEditingPermissionForPage(Contributor contr, MappedAccessoryPage page);
public boolean checkEditingPermissionForSubmittedPage(Contributor contr, MappedAccessoryPage page);
public boolean checkUsePermissionForImageOnPage(Contributor contr, NodeImage img, Long accPageId, boolean isBranchOrLeaf);
public boolean checkEditingPermissionForImage(Contributor contr, NodeImage img);
/**
* Returns a list of node ids that this contributor has editing permission over
* @param contr
* @return
*/
public List getPermissionsForContributor(Contributor contr);
/**
* Returns a list of node ids that this contributor is attached to, conditionally
* also checking whether they have editing permissions
* @param contr
* @param checkEditingPermissions Whether to check for editing permissions
* @return
*/
public List<Long> getNodeAttachmentsForContributor(Contributor contr, boolean checkEditingPermissions);
/**
* Returns a list of node ids that this contributor is attached to
* that have the specified node attachment type
* @param contr
* @param attachmentType (as of now: interest, permission, or cutoff)
* @return
*/
public List<Long> getNodeAttachmentsForContributor(Contributor contr, int attachmentType);
/**
* Checks whether the editingContributor has permissions to edit the
* editedContributor
* @param editingContributor
* @param editedContributor
* @return
*/
public boolean checkHasEditingPermissionForContributor(Contributor editingContribuor, Contributor editedContributor);
public Collection getContributorIdsAttachedToNodeIds(Collection nodeIds, boolean hasPermission);
public List getNodeNamesContributorAttachedTo(Integer contrId, boolean checkPermission);
}
|
[
"lenards@iplantcollaborative.org"
] |
lenards@iplantcollaborative.org
|
f47e2bf935f384ef78fbd1086bd3bb3aa46fff27
|
dc75eafadd4e87e035b933527424f3366d07a9c0
|
/src/main/java/net/malisis/core/renderer/font/FontGenerator.java
|
ddc28af610dd1cd4f75c076dc0ff6e817fce2cc9
|
[
"MIT"
] |
permissive
|
AlmuraDev/MalisisCore
|
44ac0d365bcbecdcc2eb0ce128ddd431d0aae185
|
24f4f0c91abc9e39432847a9def32799627d3692
|
refs/heads/1.8.9
| 2021-07-18T21:45:17.811806
| 2016-05-01T13:08:53
| 2016-05-01T13:08:53
| 135,522,365
| 2
| 2
|
MIT
| 2020-04-03T19:25:39
| 2018-05-31T02:41:29
|
Java
|
UTF-8
|
Java
| false
| false
| 4,988
|
java
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Ordinastie
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package net.malisis.core.renderer.font;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import javax.imageio.ImageIO;
import net.malisis.core.MalisisCore;
import org.apache.commons.io.FileUtils;
/**
* @author Ordinastie
*
*/
public class FontGenerator
{
static
{
File f = new File("fonts/");
if (!f.exists())
f.mkdir();
}
private Font font;
private CharData[] charData;
private FontGeneratorOptions options;
public FontGenerator(Font font, CharData[] charData, FontGeneratorOptions options)
{
this.font = font;
this.charData = charData;
this.options = options;
}
public BufferedImage generate(int size, File textureFile, File uvFile)
{
BufferedImage img = generateTexture(size, textureFile);
generateUVs(size, uvFile);
return img;
}
private BufferedImage generateTexture(int size, File textureFile)
{
BufferedImage img = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = initGraphics(img);
int x = 10;
int y = 10;
for (char c = 35; c < 256; c++)
{
CharData cd = charData[c];
if (x + cd.getFullWidth(options) > size)
{
x = (int) options.mx;
y += options.fontSize + options.my + options.py + 15;
}
g.drawString("" + cd.getChar(), x, y + cd.getAscent());
cd.setUVs(x, y, size, options);
if (options.debug)
{
//baseLine
g.setColor(Color.RED);
g.drawLine(x, (int) (y + cd.getAscent()), (int) (x + cd.getFullWidth(options)), (int) (y + cd.getAscent()));
g.setColor(Color.MAGENTA);
g.drawRect(x, y, (int) (cd.getCharWidth()), (int) (cd.getCharHeight()));
g.setColor(Color.BLACK);
}
x += cd.getFullWidth(options) + 15;
}
try
{
ImageIO.write(img, "png", textureFile);
MalisisCore.log.info(textureFile.getName() + " (" + size + "x" + size + ") written.");
}
catch (IOException e)
{
MalisisCore.log.error("Failed to create font texture file for {}.", font.getName(), e);
}
return img;
}
private void generateUVs(int size, File uvFile)
{
try
{
StringBuilder sb = new StringBuilder();
for (CharData cd : charData)
{
if (cd.getChar() < 35 || cd.getChar() == ';')
sb.append((int) cd.getChar());
else
sb.append(cd.getChar());
sb.append(";");
sb.append(cd.u());
sb.append(";");
sb.append(cd.v());
sb.append(";");
sb.append(cd.U());
sb.append(";");
sb.append(cd.V());
sb.append(";\n");
}
FileUtils.write(uvFile, sb, StandardCharsets.UTF_8);
}
catch (IOException e)
{
MalisisCore.log.error("Failed to create UV file for {}.", font.getName(), e);
}
}
/**
* Initializes the {@link Graphics2D} object. Sets the font and the color for the graphics.<br>
* If debug mode, will also draw a grid on the image.
*
* @param img the img
* @return the graphics2 d
*/
private Graphics2D initGraphics(BufferedImage img)
{
Graphics2D g = img.createGraphics();
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
if (options.antialias)
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setFont(font);
if (options.debug)
{
int color = 0x666666;
for (int i = 0; i < img.getWidth(); i += 25)
{
if (i % 500 == 0)
color = 0x333333;
else if (i % 100 == 0)
color = 0x777777;
else
color = 0xBBBBBB;
g.setColor(new Color(color));
g.drawLine(i, 0, i, img.getWidth());
g.drawLine(0, i, img.getHeight(), i);
}
}
g.setColor(options.debug ? Color.BLACK : Color.WHITE);
return g;
}
}
|
[
"ordinastie@hotmail.com"
] |
ordinastie@hotmail.com
|
c50a11e3172657e7191dab4799d02ef5ebfda10d
|
eef372565ca7a8ed8a9a0faeb79338a4edc8f094
|
/PTN_Client(2015)/src/com/nms/ui/ptn/ne/dual/view/AllTunnelPanel.java
|
8af41d0187f538d2834c06797a9038e822e1571c
|
[] |
no_license
|
ptn2017/ptn2017
|
f42db27fc54c1fe5938407467b395e6b0a8721f7
|
7090e2c64b2ea7f38e530d58247dfba4b2906b9a
|
refs/heads/master
| 2021-09-04T08:12:08.639049
| 2018-01-17T07:24:44
| 2018-01-17T07:24:44
| 112,810,000
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,757
|
java
|
package com.nms.ui.ptn.ne.dual.view;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ScrollPaneConstants;
import com.nms.db.bean.ptn.path.tunnel.Tunnel;
import com.nms.ui.frame.ViewDataTable;
import com.nms.ui.manager.ExceptionManage;
import com.nms.ui.manager.ResourceUtil;
import com.nms.ui.manager.keys.StringKeysPanel;
/**
* MPS保护下方端口信息面板
*
* @author dzy
*
*/
public class AllTunnelPanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1576957269410364251L;
private JScrollPane scrollPane; // 滚动条
private ViewDataTable<Tunnel> table; // table对象
private final String TABLENAME = "selectTunnelTable"; // table表名
List<Tunnel> tunnelList ;
/**
* 创建一个新的实例
*/
public AllTunnelPanel(List<Tunnel> tunnelList) {
try {
this.initComponent();
this.setLayout();
this.tunnelList = tunnelList;
initData(tunnelList);
} catch (Exception e) {
ExceptionManage.dispose(e,this.getClass());
}
}
/**
* 清空表
*/
public void clear() {
this.table.clear();
}
/**
* 绑定数据
* @param mspPortInfoList
* @throws Exception
*/
public void initData(List<Tunnel> tunnelList) throws Exception {
if(null!=tunnelList&&tunnelList.size()>0){
table.initData(tunnelList);
}
}
/**
* 初始化控件
*/
private void initComponent() {
this.table = new ViewDataTable<Tunnel>(this.TABLENAME);
this.table.getTableHeader().setResizingAllowed(true);
this.table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
this.table.setTableHeaderPopupMenuFactory(null);
this.table.setTableBodyPopupMenuFactory(null);
this.scrollPane = new JScrollPane();
this.scrollPane.setViewportView(this.table);
this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
}
/**
* 设置布局
*/
private void setLayout() {
this.setBorder(BorderFactory.createTitledBorder(ResourceUtil.srcStr(StringKeysPanel.PANEL_SELECTABLE_TUNNEL)));
GridBagConstraints c = new GridBagConstraints();
GridBagLayout layout = new GridBagLayout();
layout.columnWidths = new int[] { 230 };
layout.columnWeights = new double[] { 0 };
layout.rowHeights = new int[] {200};
layout.rowWeights = new double[] { 0.1};
this.setLayout(layout);
addComponent(this, this.scrollPane, 0, 0, 0.5, 1.0, 0, 1, GridBagConstraints.BOTH, new Insets(5, 0, 0, 0), GridBagConstraints.NORTHWEST, c);
}
/**
* 添加控件
*
* @param panel
* 要添加的容器
* @param component
* 要添加的控件
*/
private void addComponent(JPanel panel, JComponent component, int gridx, int gridy, double weightx, double weighty, int gridwidth, int gridheight, int fill, Insets insets, int anchor, GridBagConstraints gridBagConstraints) {
gridBagConstraints.gridx = gridx;
gridBagConstraints.gridy = gridy;
gridBagConstraints.weightx = weightx;
gridBagConstraints.weighty = weighty;
gridBagConstraints.gridwidth = gridwidth;
gridBagConstraints.gridheight = gridheight;
gridBagConstraints.fill = fill;
gridBagConstraints.insets = insets;
gridBagConstraints.anchor = anchor;
panel.add(component, gridBagConstraints);
}
public ViewDataTable<Tunnel> getTable() {
return table;
}
public List<Tunnel> getTunnelList() {
return tunnelList;
}
public void setTunnelList(List<Tunnel> tunnelList) {
this.tunnelList = tunnelList;
}
}
|
[
"a18759149@qq.com"
] |
a18759149@qq.com
|
cd1750595e0ec4663afc517eeb85fd3acca9803c
|
7bda7971c5953d65e33bdf054360bdf4488aa7eb
|
/src/com/arcsoft/office/fc/hslf/record/DummyPositionSensitiveRecordWithChildren.java
|
ba030bf82d8aa9086406a8d3c04c08bcaf077a57
|
[
"Apache-2.0"
] |
permissive
|
daddybh/iOffice
|
ee5dd5938f258d7dcfc0757b1809d31662dd07ef
|
d1d6b57fb0d496db5c5649f5bc3751b2a1539f83
|
refs/heads/master
| 2021-12-10T20:47:15.238083
| 2016-09-20T12:14:17
| 2016-09-20T12:14:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,456
|
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 com.arcsoft.office.fc.hslf.record;
import java.io.IOException;
import java.io.OutputStream;
import com.arcsoft.office.fc.util.LittleEndian;
/**
* If we come across a record we know has children of (potential)
* interest, but where the record itself is boring, but where other
* records may care about where this one lives, we create one
* of these. It allows us to get at the children, and track where on
* disk this is, but not much else.
* Anything done using this should quite quickly be transitioned to its
* own proper record class!
*
* @author Nick Burch
*/
public final class DummyPositionSensitiveRecordWithChildren extends
PositionDependentRecordContainer
{
private byte[] _header;
private long _type;
/**
* Create a new holder for a boring record with children, but with
* position dependent characteristics
*/
protected DummyPositionSensitiveRecordWithChildren(byte[] source, int start, int len)
{
// Just grab the header, not the whole contents
_header = new byte[8];
System.arraycopy(source, start, _header, 0, 8);
_type = LittleEndian.getUShort(_header, 2);
// Find our children
_children = Record.findChildRecords(source, start + 8, len - 8);
}
/**
* Return the value we were given at creation
*/
public long getRecordType()
{
return _type;
}
/**
*
*/
public void dispose()
{
super.dispose();
_header = null;
}
}
|
[
"ljj@xinlonghang.cn"
] |
ljj@xinlonghang.cn
|
f58a533b06cec007c2e421fc9c21b6e065cd3049
|
8d8fb4dfd7be299076651e02d26eba6cd879428c
|
/newrelic-agent/src/main/java/com/newrelic/agent/errors/ReportableError.java
|
fa62169d16f64772e53ff0880ddf602026c5c00c
|
[
"Apache-2.0"
] |
permissive
|
newrelic/newrelic-java-agent
|
db6dd20f6ba3f43909b004ce4a058f589dd4b017
|
eb298ecd8d31f93622388aa12d3ba1e68a58f912
|
refs/heads/main
| 2023-08-31T05:14:44.428903
| 2023-08-29T10:37:35
| 2023-08-30T18:08:38
| 275,016,355
| 177
| 150
|
Apache-2.0
| 2023-09-11T14:50:06
| 2020-06-25T21:13:42
|
Java
|
UTF-8
|
Java
| false
| false
| 355
|
java
|
/*
*
* * Copyright 2020 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/
package com.newrelic.agent.errors;
public class ReportableError extends Throwable {
private static final long serialVersionUID = 3472056044517410355L;
public ReportableError(String message) {
super(message);
}
}
|
[
"49817386+jeffalder@users.noreply.github.com"
] |
49817386+jeffalder@users.noreply.github.com
|
8c41498d497f83dcc81eae0de4844670a6cd2f63
|
d5a2e330fda32b9a0dd4a983d2af0a242168dc7a
|
/restapidemo-mvc/src/main/java/com/example/domain/Customer.java
|
426096cda7163b833840cc66a74d29484d638b3d
|
[] |
no_license
|
jfspps/RestAPI-Spring
|
6320cff0c6f3b3855d50795ed3c08f791b2a5e31
|
602d83c343ca6e901ecb048e1ce6c902737678b5
|
refs/heads/main
| 2023-03-19T16:17:30.521873
| 2021-02-17T22:35:14
| 2021-02-17T22:35:14
| 337,500,098
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 381
|
java
|
package com.example.domain;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Data
@Entity
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String firstname;
private String lastname;
}
|
[
"jfsapps@gmail.com"
] |
jfsapps@gmail.com
|
7d0dd22daabfd579ea0487030e1b0111f330fe3f
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/test/ninja/template/TemplateEngineFreemarkerTest.java
|
b72d4b743fc2520973297858b7d23b3a9fece0f5
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 4,482
|
java
|
/**
* Copyright (C) 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* 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 ninja.template;
import TemplateEngineFreemarker.FREEMARKER_CONFIGURATION_FILE_SUFFIX;
import freemarker.template.Configuration;
import java.io.Writer;
import javax.inject.Singleton;
import ninja.Context;
import ninja.Result;
import ninja.Results;
import ninja.Route;
import ninja.exceptions.RenderingException;
import ninja.i18n.Lang;
import ninja.i18n.Messages;
import ninja.utils.NinjaProperties;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.slf4j.Logger;
@RunWith(MockitoJUnitRunner.class)
public class TemplateEngineFreemarkerTest {
@Mock
Lang lang;
@Mock
Logger logger;
@Mock
TemplateEngineHelper templateEngineHelper;
@Mock
TemplateEngineManager templateEngineManager;
@Mock
TemplateEngineFreemarkerReverseRouteMethod templateEngineFreemarkerReverseRouteMethod;
@Mock
TemplateEngineFreemarkerAssetsAtMethod templateEngineFreemarkerAssetsAtMethod;
@Mock
TemplateEngineFreemarkerWebJarsAtMethod templateEngineFreemarkerWebJarsAtMethod;
@Mock
NinjaProperties ninjaProperties;
@Mock
Messages messages;
@Mock
Context context;
@Mock
Result result;
@Mock
Route route;
TemplateEngineFreemarker templateEngineFreemarker;
Writer writer;
@Test
public void testThatTemplateEngineFreemarkerHasSingletonAnnotation() {
Singleton singleton = TemplateEngineFreemarker.class.getAnnotation(Singleton.class);
Assert.assertThat(singleton, CoreMatchers.notNullValue());
}
@Test
public void testBasicInvocation() throws Exception {
templateEngineFreemarker.invoke(context, Results.ok());
Mockito.verify(ninjaProperties).getWithDefault(FREEMARKER_CONFIGURATION_FILE_SUFFIX, ".ftl.html");
Assert.assertThat(templateEngineFreemarker.getSuffixOfTemplatingEngine(), CoreMatchers.equalTo(".ftl.html"));
Mockito.verify(templateEngineHelper).getTemplateForResult(ArgumentMatchers.eq(route), ArgumentMatchers.any(Result.class), ArgumentMatchers.eq(".ftl.html"));
Assert.assertThat(writer.toString(), CoreMatchers.equalTo("Just a plain template for testing..."));
}
@Test
public void testThatConfigurationCanBeRetrieved() throws Exception {
templateEngineFreemarker.invoke(context, Results.ok());
Assert.assertThat(templateEngineFreemarker.getConfiguration(), CoreMatchers.notNullValue(Configuration.class));
}
@Test
public void testThatWhenNotProdModeThrowsRenderingException() {
Mockito.when(templateEngineHelper.getTemplateForResult(ArgumentMatchers.any(Route.class), ArgumentMatchers.any(Result.class), Mockito.anyString())).thenReturn("views/broken.ftl.html");
// only freemarker templates generated exceptions to browser -- it makes
// sense that this continues in diagnostic mode only
// when(ninjaProperties.isDev()).thenReturn(true);
// when(ninjaProperties.areDiagnosticsEnabled()).thenReturn(true);
try {
templateEngineFreemarker.invoke(context, Results.ok());
Assert.fail("exception expected");
} catch (RenderingException e) {
// expected
}
}
@Test(expected = RuntimeException.class)
public void testThatProdModeThrowsTemplateException() throws RuntimeException {
Mockito.when(templateEngineHelper.getTemplateForResult(ArgumentMatchers.any(Route.class), ArgumentMatchers.any(Result.class), Mockito.anyString())).thenReturn("views/broken.ftl.html");
Mockito.when(ninjaProperties.isProd()).thenReturn(true);
templateEngineFreemarker.invoke(context, Results.ok());
}
}
|
[
"benjamin.danglot@inria.fr"
] |
benjamin.danglot@inria.fr
|
f4dbe874db3316bd9b4e625501c716e2e1e92c2d
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/tencent/mm/g/a/ce.java
|
a94b34ee8b6a1234d18dfee2d00023452b86cec1
|
[] |
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
| 597
|
java
|
package com.tencent.mm.g.a;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.sdk.b.b;
public final class ce extends b
{
public ce.a cvl;
public ce()
{
this((byte)0);
}
private ce(byte paramByte)
{
AppMethodBeat.i(15759);
this.cvl = new ce.a();
this.xxG = false;
this.callback = null;
AppMethodBeat.o(15759);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes4-dex2jar.jar
* Qualified Name: com.tencent.mm.g.a.ce
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
cb502e5ed1f334dda150ac4376d7b00380f47853
|
b3b5985a5fb51bb30bf4ad24f93559e2df82f0d8
|
/app/src/main/java/me/jfenn/alarmio/fragments/sound/BaseSoundChooserFragment.java
|
6a49a952c37441bab871a8bd0e91d59fed2d4cd3
|
[
"Apache-2.0"
] |
permissive
|
fennifith/Alarmio
|
9afdb6cc9fd44c76b68c96d08f2ad690ae1e18d8
|
2b48ec5cdb816dfd7420f4a4ee76b0f2a4bd21be
|
refs/heads/main
| 2023-08-24T10:56:10.819252
| 2021-03-04T21:47:33
| 2021-03-04T21:53:21
| 101,005,994
| 310
| 109
|
Apache-2.0
| 2023-01-30T17:03:23
| 2017-08-22T01:09:45
|
Java
|
UTF-8
|
Java
| false
| false
| 1,577
|
java
|
package me.jfenn.alarmio.fragments.sound;
import android.content.Context;
import java.lang.ref.WeakReference;
import androidx.annotation.Nullable;
import me.jfenn.alarmio.data.SoundData;
import me.jfenn.alarmio.fragments.BasePagerFragment;
import me.jfenn.alarmio.interfaces.ContextFragmentInstantiator;
import me.jfenn.alarmio.interfaces.SoundChooserListener;
public abstract class BaseSoundChooserFragment extends BasePagerFragment implements SoundChooserListener {
private SoundChooserListener listener;
public void setListener(SoundChooserListener listener) {
this.listener = listener;
}
@Override
public void onSoundChosen(SoundData sound) {
if (listener != null)
listener.onSoundChosen(sound);
}
@Override
public void onDestroy() {
super.onDestroy();
listener = null;
}
abstract static class Instantiator extends ContextFragmentInstantiator {
private WeakReference<SoundChooserListener> listener;
public Instantiator(Context context, SoundChooserListener listener) {
super(context);
this.listener = new WeakReference<>(listener);
}
@Nullable
@Override
public BasePagerFragment newInstance(int position) {
SoundChooserListener listener = this.listener.get();
if (listener != null)
return newInstance(position, listener);
else return null;
}
abstract BasePagerFragment newInstance(int position, SoundChooserListener listener);
}
}
|
[
"18jafenn90@gmail.com"
] |
18jafenn90@gmail.com
|
cefab76ab5df3b2b6d391abfcba2d7e6522135c3
|
d08f939da8d986e285ca617971713b4263e75a4b
|
/src/learn14/Login.java
|
d28437d6dfd776c237ac4a0529c8cdc6e6015005
|
[] |
no_license
|
spyit/FY1907
|
f486c39ed19849dece1a9edb084a3a1d8f123986
|
37c6150af95d7ac4faaeb874a1a9923bb2203b8b
|
refs/heads/master
| 2020-06-04T13:06:19.924986
| 2019-06-15T04:26:01
| 2019-06-15T04:26:01
| 192,032,253
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 599
|
java
|
package learn14;
/**
* 输入三次密码错误 显示没有机会
* 2019-5-22
*/
import java.util.Scanner;
public class Login {
private Scanner scan;
public void LoginPassword() {
scan = new Scanner(System.in);
for(int i=1;i<=3;i++) {
System.out.println("请输入密码");
int password = scan.nextInt();
if(password==123456) {
System.out.println("密码正确");
continue;
}else if(i==3)
{
System.out.println("不好意思 没有机会了 ");
}
}
}
public static void main(String[] args) {
Login lg = new Login();
lg.LoginPassword();
}
}
|
[
"you@example.com"
] |
you@example.com
|
b3b22ac7384e950a33f2e5d364f4c3a8607eaba4
|
c53c074440f01951e24fec40b24ac9fe02b6a2a9
|
/s/h/src/main.old/java/com/anz/file/ADirWatcher.java
|
e9ea2274f51518ce0335fc30481dfc99a78cf98e
|
[] |
no_license
|
robertfg/Sandbox
|
c1c0ca73bf4f5e3b4707ca33bd6c22de60c276dd
|
cd808cf3ccf6f5e51e920ed52363f5e435c6dad1
|
refs/heads/master
| 2021-04-27T10:59:50.060378
| 2018-02-28T02:50:38
| 2018-02-28T02:50:38
| 122,550,086
| 0
| 0
| null | 2018-02-22T23:56:00
| 2018-02-22T23:56:00
| null |
UTF-8
|
Java
| false
| false
| 1,950
|
java
|
package com.anz.file;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TimerTask;
public abstract class ADirWatcher extends TimerTask {
private String path;
private File filesArray[];
private HashMap<File, Long> dir = new HashMap<File, Long>();
private DirectoryFilterWatcher dfw;
public ADirWatcher(String path) {
this(path, "");
}
public ADirWatcher(String path, String filter) {
this.path = path;
dfw = new DirectoryFilterWatcher(filter);
filesArray = new File(path).listFiles(dfw);
// transfer to the hashmap be used a reference and keep the
// lastModfied value
//for (int i = 0; i < filesArray.length; i++) {
// dir.put(filesArray[i], new Long(filesArray[i].lastModified()));
//}
}
@SuppressWarnings("unchecked")
public final void run() {
HashSet<File> checkedFiles = new HashSet<File>();
filesArray = new File(path).listFiles(dfw);
// scan the files and check for modification/addition
for (int i = 0; i < filesArray.length; i++) {
Long current = dir.get(filesArray[i]);
checkedFiles.add(filesArray[i]);
if (current == null) {
// new file
dir.put(filesArray[i], new Long(filesArray[i].lastModified()));
onChange(filesArray[i], "add");
} else if (current.longValue() != filesArray[i].lastModified()) {
// modified file
dir.put(filesArray[i], new Long(filesArray[i].lastModified()));
onChange(filesArray[i], "modify");
}
}
// now check for deleted files
Set<File> ref = ((HashMap<File, Long>) dir.clone()).keySet();
ref.removeAll((Set<File>) checkedFiles);
Iterator<File> it = ref.iterator();
while (it.hasNext()) {
File deletedFile = it.next();
dir.remove(deletedFile);
onChange(deletedFile, "delete");
}
}
protected abstract void onChange(File file, String action);
}
|
[
"degs@ubuntu.(none)"
] |
degs@ubuntu.(none)
|
0f8b0a530d3e1784b51b696339c4e6a4224d8412
|
dd5372efb0c7b488126063c0710014a642fa77db
|
/puzzler-github/src/main/java/com/github/skapral/puzzler/github/project/GprjFromGithubEvent.java
|
6348cb7ed3167f36510e7ff749cda3322ec9158d
|
[
"MIT"
] |
permissive
|
skapral/puzzlerbot
|
1b538b82f8efcccc7ba857e119f91c09aca0421a
|
9990d2485084b2b6fae280a8d3a61ac0dbde9ca6
|
refs/heads/master
| 2021-07-17T20:28:40.290003
| 2020-01-14T19:28:24
| 2020-01-14T19:31:53
| 134,487,043
| 20
| 4
|
MIT
| 2021-07-15T02:24:10
| 2018-05-22T23:34:56
|
Java
|
UTF-8
|
Java
| false
| false
| 2,297
|
java
|
/*-
* ===========================================================================
* puzzler-github
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Copyright (C) 2019 Kapralov Sergey
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* ============================================================================
*/
package com.github.skapral.puzzler.github.project;
import org.json.JSONObject;
/**
* Github project's coordinates, obtained from Github event JSON.
*
* @author Kapralov Sergey
*/
public class GprjFromGithubEvent implements GithubProject {
private final String eventBody;
/**
* Ctor.
*
* @param eventBody Github event body (JSON)
*/
public GprjFromGithubEvent(String eventBody) {
this.eventBody = eventBody;
}
@Override
public final String owner() {
return new JSONObject(eventBody)
.getJSONObject("repository")
.getJSONObject("owner")
.getString("login");
}
@Override
public final String repository() {
return new JSONObject(eventBody)
.getJSONObject("repository")
.getString("name");
}
}
|
[
"skapralov@mail.ru"
] |
skapralov@mail.ru
|
bd15d56bfd410d90e13996faf42d2d4081b061a5
|
601582228575ca0d5f61b4c211fd37f9e4e2564c
|
/logisoft_revision1/src/com/gp/cong/logisoft/domain/FclBuy.java
|
00801122e24e3fddc3442a1d910ad99e3d53fd20
|
[] |
no_license
|
omkarziletech/StrutsCode
|
3ce7c36877f5934168b0b4830cf0bb25aac6bb3d
|
c9745c81f4ec0169bf7ca455b8854b162d6eea5b
|
refs/heads/master
| 2021-01-11T08:48:58.174554
| 2016-12-17T10:45:19
| 2016-12-17T10:45:19
| 76,713,903
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,951
|
java
|
package com.gp.cong.logisoft.domain;
import java.util.*;
public class FclBuy implements java.io.Serializable {
// Fields
private Integer fclStdId;
private UnLocation originTerminal;
private UnLocation destinationPort;
private String originalRegion;
private String destinationRegion;
private TradingPartnerTemp sslineNo;
private GenericCode comNum;
private Set fclBuyCostsSet;
private Date startDate;
private Date endDate;
private String contract;
private List displaySellList;
private String polCode;
private String podCode;
// Constructors
public List getDisplaySellList() {
return displaySellList;
}
public void setDisplaySellList(List displaySellList) {
this.displaySellList = displaySellList;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
/**
* default constructor
*/
public FclBuy() {
}
/**
* minimal constructor
*/
public FclBuy(Integer fclStdId) {
this.fclStdId = fclStdId;
}
// Property accessors
public Integer getFclStdId() {
return this.fclStdId;
}
public void setFclStdId(Integer fclStdId) {
this.fclStdId = fclStdId;
}
public UnLocation getOriginTerminal() {
return originTerminal;
}
public void setOriginTerminal(UnLocation originTerminal) {
this.originTerminal = originTerminal;
}
public UnLocation getDestinationPort() {
return destinationPort;
}
public void setDestinationPort(UnLocation destinationPort) {
this.destinationPort = destinationPort;
}
public GenericCode getComNum() {
return comNum;
}
public TradingPartnerTemp getSslineNo() {
return sslineNo;
}
public void setSslineNo(TradingPartnerTemp sslineNo) {
this.sslineNo = sslineNo;
}
public void setComNum(GenericCode comNum) {
this.comNum = comNum;
}
public Set getFclBuyCostsSet() {
return fclBuyCostsSet;
}
public void setFclBuyCostsSet(Set fclBuyCostsSet) {
this.fclBuyCostsSet = fclBuyCostsSet;
}
public String getContract() {
return contract;
}
public void setContract(String contract) {
this.contract = contract;
}
public String getOriginalRegion() {
return originalRegion;
}
public void setOriginalRegion(String originalRegion) {
this.originalRegion = originalRegion;
}
public String getDestinationRegion() {
return destinationRegion;
}
public void setDestinationRegion(String destinationRegion) {
this.destinationRegion = destinationRegion;
}
public String getPolCode() {
return polCode;
}
public void setPolCode(String polCode) {
this.polCode = polCode;
}
public String getPodCode() {
return podCode;
}
public void setPodCode(String podCode) {
this.podCode = podCode;
}
public int hashCode() {
int hash = 0;
hash += (fclStdId != null ? fclStdId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof FclBuy)) {
return false;
}
FclBuy other = (FclBuy) object;
return !((this.fclStdId == null && other.fclStdId != null) || (this.fclStdId != null && !this.fclStdId.equals(other.fclStdId)));
}
@Override
public String toString() {
return "com.gp.cong.logisoft.domain.FclBuy[id=" + fclStdId + "]";
}
}
|
[
"omkar@ziletech.com"
] |
omkar@ziletech.com
|
81747aaf1303c91edf35bcf8a279e2aafee08b9b
|
d4ec7429fa3f4a766550303f8234b35b74a75c52
|
/src/com/javarush/test/level03/lesson06/task04/Solution.java
|
b32a8101a0f39af3b5eb25616114bb0cfd34287e
|
[] |
no_license
|
lnalna/JavaRush
|
d7c7fe2d8e8b8d8d7bb319bbb4719128b9aa7985
|
1b5f22c7301efa2a51194a2b7be895c52d002c33
|
refs/heads/master
| 2021-01-19T05:21:40.582061
| 2017-05-25T14:48:17
| 2017-05-25T14:48:17
| 87,427,920
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 769
|
java
|
package com.javarush.test.level03.lesson06.task04;
/* Экранирование символов
Про экранирование символов в Java читайте в дополнительном материале к лекции.
Вывести на экран следующий текст - две строки:
It's Windows path: "C:\Program Files\Java\jdk1.7.0\bin"
It's Java string: \"C:\\Program Files\\Java\\jdk1.7.0\\bin\"
*/
public class Solution
{
public static void main(String[] args){
//Напишите тут ваш код
System.out.println("It's Windows path: \"C:\\Program Files\\Java\\jdk1.7.0\\bin\"");
System.out.println("It's Java string: \\\"C:\\\\Program Files\\\\Java\\\\jdk1.7.0\\\\bin\\\"");
}
}
|
[
"lnalna@yandex.ru"
] |
lnalna@yandex.ru
|
e05940bc7bc3972ec8e37222d8fe2806c618b3ee
|
78f284cd59ae5795f0717173f50e0ebe96228e96
|
/factura-negocio/src/cl/stotomas/factura/negocio/ia_6/copy/copy/copy/TestingFinal.java
|
da606c393207d754d56a4f8dcbfc54409fbbfad1
|
[] |
no_license
|
Pattricio/Factura
|
ebb394e525dfebc97ee2225ffc5fca10962ff477
|
eae66593ac653f85d05071b6ccb97fb1e058502d
|
refs/heads/master
| 2020-03-16T03:08:45.822070
| 2018-05-07T15:29:25
| 2018-05-07T15:29:25
| 132,481,305
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 1,696
|
java
|
package cl.stotomas.factura.negocio.ia_6.copy.copy.copy;
import java.applet.Applet;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class TestingFinal {
public static String decryptMessage(final byte[] message, byte[] secretKey)
{
try {
// CÓDIGO VULNERABLE
final SecretKeySpec KeySpec = new SecretKeySpec(secretKey, "DES");
final Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, KeySpec);
// RECOMENDACIÓN VERACODE
// final Cipher cipher = Cipher.getInstance("DES...");
// cipher.init(Cipher.DECRYPT_MODE, KeySpec);
return new String(cipher.doFinal(message));
}
catch(Exception e)
{
e.printStackTrace();
}
return null;
}
class Echo {
// Control de Proceso
// Posible reemplazo de librería por una maliciosa
// Donde además se nos muestra el nombre explícito de esta.
public native void runEcho();
{
System.loadLibrary("echo"); // Se carga librería
}
public void main(String[] args)
{
new Echo().runEcho();
}
public final class TestApplet extends Applet {
private static final long serialVersionUID = 1L;
}
//Comparación de referencias de objeto en lugar de contenido de objeto
// El if dentro de este código no se ejecutará.
// porque se prioriza el String a mostrar.
public final class compareStrings{
public String str1;
public String str2;
public void comparar()
{
if (str1 == str2)
{
System.out.println("str1 == str2");
}
}
}
}
}
|
[
"Adriana Molano@DESKTOP-GQ96FK8"
] |
Adriana Molano@DESKTOP-GQ96FK8
|
fbe664bad46bbf80b9f8ec04eef9ec59cc163a44
|
4c5188cf67f62c15380e791e1d25cb5d8216d89e
|
/69_SpringBootCarroCompraEug/src/main/java/curso/controlador/ControladorUsuario.java
|
2c622db3893cedd2d9d5f48ec627a8aedcfd4969
|
[] |
no_license
|
EugenioMartinDev/LearningJava
|
39254189d8fabd081c547d7c97a9f966402b2f28
|
2e951fca0b48ae1dc80cdd0466258531d0eea50a
|
refs/heads/master
| 2022-12-22T03:35:15.865575
| 2020-02-24T13:21:03
| 2020-02-24T13:21:03
| 222,642,311
| 0
| 0
| null | 2022-12-16T13:56:01
| 2019-11-19T08:07:36
|
Java
|
UTF-8
|
Java
| false
| false
| 2,373
|
java
|
package curso.controlador;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import curso.modelo.entidad.Usuario;
import curso.modelo.negocio.GestorUsuario;
@Controller
public class ControladorUsuario {
@Autowired
private Usuario usuario;
@Autowired
private GestorUsuario gu;
@RequestMapping("login")
public String mostrarLogin() {
return "login";
}
@RequestMapping("mostrarAlta")
public String mostrarAlta() {
return "altaUsuario";
}
@RequestMapping("doAltaUsuario")
public ModelAndView hacerAlta(@RequestParam() String nombre
,@RequestParam() String pass
,@RequestParam() String email
,@RequestParam() String direccion
,ModelAndView mav) {
usuario.setNombre(nombre);
usuario.setDireccion(direccion);
usuario.setEmail(email);
usuario.setPassword(pass);
gu.alta();
mav.setViewName("redirect:login");
//Al hacer un sendRedirect pedemos el objeto
//request donde metemos los atributos
//por lo tanto no podemos utilizar addObject
//tenemos que pasar por parametro
//y lo podemos hacer de esta manera
mav.getModelMap().addAttribute("mensaje","El usuario se ha registrado");
//opcion 2
//mav.setViewName("redirect:pepe?mensaje=El usuario se ha registrado");
return mav;
}
@RequestMapping("doLogin")
public ModelAndView hacerLogin(@RequestParam() String nombre
,@RequestParam() String pass
,ModelAndView mav) {
usuario.setNombre(nombre);
usuario.setPassword(pass);
boolean validado = gu.login();
if(validado) {
mav.setViewName("redirect:seleccionCategoria");
mav.getModelMap().addAttribute("nombre",nombre);
}else {
mav.setViewName("redirect:login");
mav.getModelMap().addAttribute("error","Usuario y contraseniaa incorretas");
}
return mav;
}
@RequestMapping("inicio")
public ModelAndView mostrarInicio(
ModelAndView mav) {
if (usuario.isRegistrado()) {
mav.getModelMap().addAttribute("nombre", usuario.getNombre());
mav.setViewName("index");
} else {
mav.getModelMap().addAttribute("error", "El usuario no esta registrado");
mav.setViewName("redirect:login");
}
return mav;
}
}
|
[
"you@example.com"
] |
you@example.com
|
6fc9ee4f8c3919016bd6d17fc80ea01cff461047
|
005eee690918165f69f28f8e4e250c83760343a6
|
/rse2 (RDi)/iSphere RSE Plugin (RDi)/src/biz/isphere/rse/internal/AbstractFilterCreator.java
|
258a5cfb2e52b0de03f606a015b01ec8dc184351
|
[] |
no_license
|
wimjongman/iSphere
|
c6a90d86263355954f7b5568f547fb2e14ce5bb1
|
b312e9014bb2677d72b230ce8c49346e7b12c171
|
refs/heads/master
| 2023-03-10T09:32:00.750637
| 2021-02-15T09:53:55
| 2021-02-15T09:53:55
| 342,906,747
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,059
|
java
|
package biz.isphere.rse.internal;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile;
import biz.isphere.core.resourcemanagement.filter.RSEFilter;
import biz.isphere.core.resourcemanagement.filter.RSEFilterPool;
import biz.isphere.core.resourcemanagement.filter.RSEProfile;
import biz.isphere.rse.resourcemanagement.filter.RSEFilterHelper;
import com.ibm.etools.iseries.subsystems.qsys.IQSYSFilterTypes;
/*******************************************************************************
* Copyright (c) 2012-2017 iSphere Project Owners All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Common Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/cpl-v10.html
*******************************************************************************/
public abstract class AbstractFilterCreator {
public RSEFilterPool[] getFilterPools(String connectionName) {
ISystemFilterPool[] filterPools = RSEFilterHelper.getFilterPools(connectionName);
List<RSEFilterPool> rseFilterPools = new ArrayList<RSEFilterPool>();
for (ISystemFilterPool filterPool : filterPools) {
rseFilterPools.add(createRSEFilterPool(filterPool));
}
RSEFilterPool[] sortedFilterPoolNames = rseFilterPools.toArray(new RSEFilterPool[rseFilterPools.size()]);
// Arrays.sort(sortedFilterPoolNames);
return sortedFilterPoolNames;
}
private RSEFilterPool createRSEFilterPool(ISystemFilterPool filterPool) {
RSEFilterPool rseFilterPool = new RSEFilterPool(createRSEProfile(filterPool), filterPool.getName(), filterPool.isDefault(), filterPool);
ISystemFilter[] filters = filterPool.getFilters();
for (ISystemFilter filter : filters) {
RSEFilter rseFilter = null;
if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_LIBRARY)) {
rseFilter = createRSEFilter(rseFilterPool, filter);
} else if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_OBJECT)) {
rseFilter = createRSEFilter(rseFilterPool, filter);
} else if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_MEMBER)) {
rseFilter = createRSEFilter(rseFilterPool, filter);
}
if (rseFilter != null) {
rseFilterPool.addFilter(rseFilter);
}
}
return rseFilterPool;
}
private RSEFilter createRSEFilter(RSEFilterPool rseFilterPool, ISystemFilter filter) {
RSEFilter rseFilter = new RSEFilter(rseFilterPool, filter.getName(), getRSEFilterType(filter), filter.getFilterStrings(), false, filter);
rseFilter.setFilterStrings(filter.getFilterStrings());
return rseFilter;
}
private String getRSEFilterType(ISystemFilter filter) {
if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_LIBRARY)) {
return RSEFilter.TYPE_LIBRARY;
} else if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_OBJECT)) {
return RSEFilter.TYPE_OBJECT;
} else if (filter.getType().equals(IQSYSFilterTypes.FILTERTYPE_MEMBER)) {
return RSEFilter.TYPE_MEMBER;
} else
return null;
}
private RSEProfile createRSEProfile(ISystemFilterPool filterPool) {
RSEProfile rseProfile = null;
IRSEPersistableContainer parentProfile = filterPool.getPersistableParent();
if (parentProfile instanceof ISystemProfile) {
ISystemProfile systemProfile = (ISystemProfile)parentProfile;
rseProfile = new RSEProfile(systemProfile.getName(), systemProfile);
}
return rseProfile;
}
}
|
[
"tools400@b80707e1-d4e2-4098-9cf0-108009fc4daf"
] |
tools400@b80707e1-d4e2-4098-9cf0-108009fc4daf
|
cff9a6f50ce33f43a9013981da0f83dc0f4dc884
|
9e6175752640891f54aad0dca18fd3bca13b6c45
|
/src/main/java/io/jboot/web/session/JbootSessionConfig.java
|
33e9c6d8593a9dd6b7ab9066602f53c45a490079
|
[
"Apache-2.0"
] |
permissive
|
c2cn/jboot
|
68a28b59d9ee3a413a746ac7cdfc71b51d5161b0
|
66b5b015f1024912c2f95133ae07b89ad00e07b6
|
refs/heads/master
| 2023-04-19T16:57:52.314575
| 2021-05-08T05:15:33
| 2021-05-08T05:15:33
| 288,644,695
| 0
| 0
|
Apache-2.0
| 2021-05-08T05:15:33
| 2020-08-19T05:46:39
| null |
UTF-8
|
Java
| false
| false
| 2,909
|
java
|
/**
* Copyright (c) 2015-2021, Michael Yang 杨福海 (fuhai999@gmail.com).
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jboot.web.session;
import io.jboot.Jboot;
import io.jboot.app.config.annotation.ConfigModel;
import io.jboot.components.cache.JbootCacheConfig;
@ConfigModel(prefix = "jboot.web.session")
public class JbootSessionConfig {
public final static int DEFAULT_MAX_INACTIVE_INTERVAL = 60 * 60;
public final static String DEFAULT_COOKIE_CONTEXT_PATH = "/";
public final static int DEFAULT_COOKIE_MAX_AGE = -1;
public final static String DEFAULT_SESSION_COOKIE_NAME = "_JSID";
public final static String DEFAULT_SESSION_CACHE_NAME = "JBOOTSESSION";
private String cookieName = DEFAULT_SESSION_COOKIE_NAME;
private String cookieDomain;
private String cookieContextPath = DEFAULT_COOKIE_CONTEXT_PATH;
private int maxInactiveInterval = DEFAULT_MAX_INACTIVE_INTERVAL;
private int cookieMaxAge = DEFAULT_COOKIE_MAX_AGE;
private String cacheName = DEFAULT_SESSION_CACHE_NAME;
private String cacheType = Jboot.config(JbootCacheConfig.class).getType();
public String getCookieName() {
return cookieName;
}
public void setCookieName(String cookieName) {
this.cookieName = cookieName;
}
public String getCookieDomain() {
return cookieDomain;
}
public void setCookieDomain(String cookieDomain) {
this.cookieDomain = cookieDomain;
}
public String getCookieContextPath() {
return cookieContextPath;
}
public void setCookieContextPath(String cookieContextPath) {
this.cookieContextPath = cookieContextPath;
}
public int getMaxInactiveInterval() {
return maxInactiveInterval;
}
public void setMaxInactiveInterval(int maxInactiveInterval) {
this.maxInactiveInterval = maxInactiveInterval;
}
public int getCookieMaxAge() {
return cookieMaxAge;
}
public void setCookieMaxAge(int cookieMaxAge) {
this.cookieMaxAge = cookieMaxAge;
}
public String getCacheName() {
return cacheName;
}
public void setCacheName(String cacheName) {
this.cacheName = cacheName;
}
public String getCacheType() {
return cacheType;
}
public void setCacheType(String cacheType) {
this.cacheType = cacheType;
}
}
|
[
"fuhai999@gmail.com"
] |
fuhai999@gmail.com
|
9820be1a8bb9e93236e9ef1f704d90a524f022f3
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava7/Foo893Test.java
|
3ffc944ba0c7c161fcd11cb68d8ad5bf9ba336c0
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 481
|
java
|
package applicationModulepackageJava7;
import org.junit.Test;
public class Foo893Test {
@Test
public void testFoo0() {
new Foo893().foo0();
}
@Test
public void testFoo1() {
new Foo893().foo1();
}
@Test
public void testFoo2() {
new Foo893().foo2();
}
@Test
public void testFoo3() {
new Foo893().foo3();
}
@Test
public void testFoo4() {
new Foo893().foo4();
}
@Test
public void testFoo5() {
new Foo893().foo5();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
56e8b30f884d218ee0b3a19f8b121d2f1ccf665d
|
815cb2f74b1c48835d2763df6dbf2fd673772dd0
|
/services/bonita-integration-tests/src/test/java/org/bonitasoft/engine/archive/model/TestLogBuilder.java
|
acf3105a281fee64f970e7fb7645ec2c8c5cd903
|
[] |
no_license
|
Melandro/bonita-engine
|
04238b7b1f6daefbf568e2985f9ad990e66d2a10
|
bd4a9ab2492d5e9843a90fd9bbfe14700eb4bddb
|
refs/heads/master
| 2021-01-15T18:36:29.949274
| 2013-08-14T14:22:15
| 2013-08-14T14:47:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,005
|
java
|
package org.bonitasoft.engine.archive.model;
import org.bonitasoft.engine.queriablelogger.model.SQueriableLog;
import org.bonitasoft.engine.queriablelogger.model.builder.HasCRUDEAction;
import org.bonitasoft.engine.queriablelogger.model.builder.SPersistenceLogBuilder;
import org.bonitasoft.engine.queriablelogger.model.builder.impl.CRUDELogBuilder;
/**
* @author Elias Ricken de Medeiros
*/
public class TestLogBuilder extends CRUDELogBuilder implements SPersistenceLogBuilder, HasCRUDEAction {
@Override
public SPersistenceLogBuilder objectId(final long objectId) {
queriableLogBuilder.numericIndex(0, objectId);
return this;
}
@Override
public String getObjectIdKey() {
return "numericIndex1";
}
@Override
protected String getActionTypePrefix() {
return "TEST";
}
@Override
protected void checkExtraRules(final SQueriableLog log) {
// TODO Auto-generated method stub
}
}
|
[
"emmanuel.duchastenier@bonitasoft.com"
] |
emmanuel.duchastenier@bonitasoft.com
|
15e426bab3a960896490cb3ee7c5bf2c729ade77
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/ant_cluster/10314/tar_0.java
|
126821aeae27e448f3303ca16670c6d8f0bbb7a8
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,666
|
java
|
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
* ITS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.taskdefs;
import org.apache.tools.ant.*;
import org.apache.tools.ant.types.Commandline;
import java.io.*;
/**
*
*
* @author costin@dnt.ro
* @author stefano@apache.org
* @author Wolfgang Werner <a href="mailto:wwerner@picturesafe.de">wwerner@picturesafe.de</a>
*/
public class Cvs extends Task {
private Commandline cmd = new Commandline();
private String cvsRoot;
private String pack;
private String command = "checkout";
private boolean quiet = false;
private boolean noexec = false;
private File dest;
public void execute() throws BuildException {
// XXX: we should use JCVS (www.ice.com/JCVS) instead of command line
// execution so that we don't rely on having native CVS stuff around (SM)
// We can't do it ourselves as jCVS is GPLed, a third party task
// outside of jakarta repositories would be possible though (SB).
Commandline toExecute = new Commandline();
toExecute.setExecutable("cvs");
if (cvsRoot != null) {
toExecute.createArgument().setValue("-d");
toExecute.createArgument().setValue(cvsRoot);
}
if (noexec) {
toExecute.createArgument().setValue("-n");
}
if (quiet) {
toExecute.createArgument().setValue("-q");
}
toExecute.createArgument().setLine(command);
toExecute.addArguments(cmd.getCommandline());
if (pack != null) {
toExecute.createArgument().setValue(pack);
}
Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
Project.MSG_WARN),
null);
exe.setAntRun(project);
if (dest == null) dest = project.getBaseDir();
exe.setWorkingDirectory(dest);
exe.setCommandline(toExecute.getCommandline());
try {
exe.execute();
} catch (IOException e) {
throw new BuildException(e, location);
}
}
public void setCvsRoot(String root) {
// Check if not real cvsroot => set it to null
if (root != null) {
if (root.trim().equals(""))
root = null;
}
this.cvsRoot = root;
}
public void setDest(File dest) {
this.dest = dest;
}
public void setPackage(String p) {
this.pack = p;
}
public void setTag(String p) {
// Check if not real tag => set it to null
if (p != null && p.trim().length() > 0) {
cmd.createArgument().setValue("-r");
cmd.createArgument().setValue(p);
}
}
public void setDate(String p) {
if(p != null && p.trim().length() > 0) {
cmd.createArgument().setValue("-D");
cmd.createArgument().setValue(p);
}
}
public void setCommand(String c) {
this.command = c;
}
public void setQuiet(boolean q) {
quiet = q;
}
public void setNoexec(boolean ne) {
noexec = ne;
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
4609c57ad57782574d12bf6f0ea91c6f1ca9a407
|
6e519fbb687ec990926f81e9cedac3042cbf4548
|
/core/src/test/java/net/adamcin/oakpal/core/ErrorListenerTest.java
|
365da9e957bee80d1e8f3ebde6c760887e377b4e
|
[
"Apache-2.0"
] |
permissive
|
chandut028/oakpal
|
f36c9881429bd3f298100e038e494d32d2fcc63b
|
a40981e0c61fb740e3117cfaa7946671288f1239
|
refs/heads/master
| 2020-05-07T09:56:23.510356
| 2019-03-13T00:36:39
| 2019-03-13T00:36:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,530
|
java
|
/*
* Copyright 2019 Mark Adamcin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.adamcin.oakpal.core;
import java.util.Collection;
import java.util.Collections;
import org.junit.Test;
public class ErrorListenerTest {
@Test
public void testDefaults() throws Exception {
ErrorListener mock = new ErrorListener() {
@Override
public Collection<Violation> getReportedViolations() {
return Collections.emptyList();
}
};
mock.startedScan();
mock.onForcedRootCreationError(null, null);
mock.onImporterException(null, null, null);
mock.onJcrNamespaceRegistrationError(null, null, null);
mock.onJcrPrivilegeRegistrationError(null, null);
mock.onListenerException(null, null, null);
mock.onListenerPathException(null, null, null, null);
mock.onNodeTypeRegistrationError(null, null);
mock.onSubpackageException(null, null);
mock.finishedScan();
}
}
|
[
"adamcin@gmail.com"
] |
adamcin@gmail.com
|
a6d0c46d13c2c172e0612637b72fbfd3c0cc217e
|
f13e2382359691b6245f8574573fd3126c2f0a90
|
/repository/engine/src/test/java/org/hippoecm/repository/impl/WorkflowPostActionsTest.java
|
cfba833a8e5422aebd7c932bfabb7a1fd8505cae
|
[
"Apache-2.0"
] |
permissive
|
CapeSepias/hippo-1
|
cd8cbbf2b0f6cd89806a3861c0214d72ac5ee80f
|
3a7a97ec2740d0e3745859f7067666fdafe58a64
|
refs/heads/master
| 2023-04-27T21:04:19.976319
| 2013-12-13T13:01:51
| 2013-12-13T13:01:51
| 306,922,672
| 0
| 0
|
NOASSERTION
| 2023-04-17T17:42:23
| 2020-10-24T16:17:22
| null |
UTF-8
|
Java
| false
| false
| 3,531
|
java
|
/*
* Copyright 2008-2013 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hippoecm.repository.impl;
import javax.jcr.Node;
import org.easymock.EasyMock;
import org.hippoecm.repository.api.Document;
import org.hippoecm.repository.standardworkflow.WorkflowEventsWorkflow;
import org.junit.Before;
import org.junit.Test;
/**
* WorkflowPostActionsBoundMethodTest
* <P>
* This tests if the eventsWorkflow is invoked exactly by WorkflowPostActions
* with setWorkflowCategory(String), setWorkflowMethod(String) and fire(Document).
* </P>
* @version $Id$
*/
public class WorkflowPostActionsTest {
private Node wfSubject;
private Node wfNode;
private Document document;
private String workflowCategory = "default";
private String workflowMethod = "publish";
private WorkflowEventsWorkflow eventsWorkflow;
private WorkflowManagerImpl workflowManager;
@Before
public void setUp() throws Exception {
// preparing mocks for wfSubject, wfNode and document
wfSubject = EasyMock.createNiceMock(Node.class);
wfNode = EasyMock.createNiceMock(Node.class);
document = EasyMock.createNiceMock(Document.class);
EasyMock.replay(wfSubject);
EasyMock.replay(wfNode);
EasyMock.replay(document);
eventsWorkflow = EasyMock.createMock(WorkflowEventsWorkflow.class);
// preparing the mock for workflowManager which just returns the eventsWorkflow
workflowManager = EasyMock.createNiceMock(WorkflowManagerImpl.class);
EasyMock.expect(workflowManager.getWorkflowInternal(wfNode, wfSubject)).andReturn(eventsWorkflow).anyTimes();
EasyMock.replay(workflowManager);
// expecting method calls: #setWorkflowCategory(String), #setWorkflowMethod(String) and finally #fire(Document) method.
eventsWorkflow.setWorkflowCategory(workflowCategory);
EasyMock.expectLastCall();
eventsWorkflow.setWorkflowMethod(workflowMethod);
EasyMock.expectLastCall();
eventsWorkflow.fire(document);
EasyMock.expectLastCall();
EasyMock.replay(eventsWorkflow);
}
@Test
public void testWorkflowEventsWorkflowWithWorkflowPostActionsBoundMethod() throws Exception {
// Now, create a postActionBoundMethod and execute it with the mock document.
WorkflowPostActionsBoundMethod postAction = new WorkflowPostActionsBoundMethod(workflowManager, wfSubject,
true, wfNode, workflowCategory, workflowMethod);
postAction.execute(document);
}
@Test
public void testWorkflowEventsWorkflowWithWorkflowPostActionSimpleQuery() throws Exception {
// Now, create a postActionBoundMethod and execute it with the mock document.
WorkflowPostActionSimpleQuery postAction = new WorkflowPostActionSimpleQuery(workflowManager, wfSubject,
true, wfNode, workflowCategory, workflowMethod);
postAction.execute(document);
}
}
|
[
"m.denburger@onehippo.com"
] |
m.denburger@onehippo.com
|
f5be63662f512ef084d6578cf3a35e3de58cb6bc
|
c697b14836a01be88e6bbf43ac648be83426ade0
|
/Algorithms/1001-2000/1073. Adding Two Negabinary Numbers/Solution.java
|
7ff9276f92baa744a8058759c93eeff328af7aa7
|
[] |
no_license
|
jianyimiku/My-LeetCode-Solution
|
8b916d7ebbb89606597ec0657f16a8a9e88895b4
|
48058eaeec89dc3402b8a0bbc8396910116cdf7e
|
refs/heads/master
| 2023-07-17T17:50:11.718015
| 2021-09-05T06:27:06
| 2021-09-05T06:27:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,092
|
java
|
class Solution {
public int[] addNegabinary(int[] arr1, int[] arr2) {
int length1 = arr1.length, length2 = arr2.length;
int sumLength = Math.max(length1, length2) + 2;
int[] arr1Ext = new int[sumLength];
System.arraycopy(arr1, 0, arr1Ext, sumLength - length1, length1);
int[] arr2Ext = new int[sumLength];
System.arraycopy(arr2, 0, arr2Ext, sumLength - length2, length2);
int[] sumArr = new int[sumLength];
for (int i = sumLength - 1; i > 0; i--) {
sumArr[i] += arr1Ext[i] + arr2Ext[i];
int carry = sumArr[i] >> 1;
sumArr[i] -= carry * 2;
sumArr[i - 1] -= carry;
}
int startIndex = sumLength - 1;
for (int i = 0; i < sumLength; i++) {
if (sumArr[i] != 0) {
startIndex = i;
break;
}
}
int trimLength = sumLength - startIndex;
int[] sumArrTrim = new int[trimLength];
System.arraycopy(sumArr, startIndex, sumArrTrim, 0, trimLength);
return sumArrTrim;
}
}
|
[
"chenyi_storm@sina.com"
] |
chenyi_storm@sina.com
|
545549c2b0e50a5946de0b1a0a5c3e9513b73c3f
|
3118c18cd35244dea763c396ef8be550e0c477d6
|
/distest-web/src/main/java/com/testwa/distest/server/mongo/model/AppiumRunningLog.java
|
afb20baad3d893017fe6841a9c5c039558a2f123
|
[] |
no_license
|
felixruan/TestwaCloud
|
e31f1576e87776cbe28c87d312dccbf5d3b976d6
|
fb9f2e94c6ac02ebe3f636d972f09c33e1f253fa
|
refs/heads/master
| 2023-04-15T19:49:03.829675
| 2020-03-10T04:31:50
| 2020-03-10T04:31:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,880
|
java
|
package com.testwa.distest.server.mongo.model;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.testwa.distest.common.serializer.StringValueToLongSerializer;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
/**
* Created by wen on 16/8/27.
*/
@Data
@Document(collection = "t_appium_running_log")
public class AppiumRunningLog {
@Id
private String id;
private Integer status;
private String value;
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long runtime;
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long cpurate;
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long memory;
private String battery;
@Indexed
private String sessionId;
@Indexed
private String deviceId;
// 脚本ID
@Indexed
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long testSuit;
@Indexed
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long testcaseId;
// 任务ID
@Indexed
@JSONField(serializeUsing = StringValueToLongSerializer.class)
private Long taskCode;
private String screenshotPath;
private String description;
private AppiumRunningCommand command;
@CreatedDate
private Date createDate;
private Long timestamp;
@JsonIgnore
private Long userId;
@JsonIgnore
private String token;
public static String getCollectionName() {
Document doc = AppiumRunningLog.class.getAnnotation(Document.class);
return doc.collection();
}
}
|
[
"wencz0321@gmail.com"
] |
wencz0321@gmail.com
|
eec16a5973163bfe1b0d59b192598c462034ab35
|
94070d0696ed3825caf620b544bdf2a9d21ba1f9
|
/.svn/pristine/ee/eec16a5973163bfe1b0d59b192598c462034ab35.svn-base
|
dc592611709942310f79e66a19b7df256d13dad1
|
[] |
no_license
|
jbzhang99/Howweb
|
d801a60635ed7a09ba0ff65fa8df16724ae031fc
|
ee256aef286369214f749791c23977637e06821c
|
refs/heads/master
| 2020-12-05T21:51:15.704406
| 2017-08-04T14:43:41
| 2017-08-04T14:43:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,355
|
package com.hoau.wechat.service.impl;
import java.util.Date;
import java.util.Random;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import com.hoau.wechat.dao.ILotteryRecordDao;
import com.hoau.wechat.dao.IVouchersDao;
import com.hoau.wechat.service.ILotteryService;
import com.hoau.wechat.util.JsonUtils;
import com.hoau.wechat.util.StringUtil;
import com.hoau.wechat.vo.LotteryRecord;
import com.hoau.wechat.vo.UserInfo;
import com.hoau.wechat.vo.Vouchers;
@Service
public class LotteryService implements ILotteryService{
private Logger logger = Logger.getLogger(LotteryService.class);
@Resource
private ILotteryRecordDao lotteryRecordDao;
@Resource
private IVouchersDao vouchersDao;
@Resource
private PhoneBindService phoneBindService;
/*@Autowired(required=true) @Qualifier("voucherWS")
private OuterVocherServices outerVocherServices;*/
@Override
public Vouchers LuckDraw(String openid, String type, String versionNo) {
Vouchers vouchers = null;
//验证是否已经领取三次优惠券
UserInfo userInfo = phoneBindService.findOneUserInfo(openid);
if(userInfo == null || StringUtil.isEmpty(userInfo.getPhone())){
throw new RuntimeException();
}
//versonNo
LotteryRecord record = lotteryRecordDao.findLotterByVersonNo(openid, type, versionNo);
if(record != null ){
vouchers = new Vouchers();
vouchers.setStatus(0);
vouchers.setType(type);
vouchers.setVouchersCode(record.getVouchersNo());
vouchers.setVouchersName(record.getDetail().substring(0, record.getDetail().length()-4));
}else{
vouchers = gainVouchers(openid, type, userInfo.getPhone(), versionNo);
}
return vouchers;
}
@Override
public Vouchers gainVouchers(String openid, String type, String phone, String versionNo) {
// WebApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
// OuterVocherServices outerVocherServices = (OuterVocherServices) act.getBean("voucherWS");
/*VoucherInfo info = null;//outerVocherServices.getNewVoucher(Constant.COUPON_DC_APPID, getVouchersValue());
logger.info(JsonUtils.toJson(info));
Vouchers vouchers = null;
try {
if(info != null){
vouchers = new Vouchers();
vouchers.setVouchersCode(info.getVoucherCode());
vouchers.setVouchersName(info.getValue()+"");
vouchers.setType(type);
//保存优惠券
vouchersDao.saveVouchers(vouchers);
LotteryRecord record = new LotteryRecord();
record.setDetail(info.getValue()+"元优惠券");
// record.setId(UUIDUtil.getUUID());
record.setLotteryTime(new Date());
record.setOpenid(openid.trim());
record.setType(type.trim());
record.setVouchersNo(info.getVoucherCode().trim());
record.setPhone(phone);
record.setId(versionNo);
lotteryRecordDao.saveLotteryRecord(record);
}else{
throw new RuntimeException("获取优惠券失败!");
}
} catch (Exception e) {
throw new RuntimeException("获取优惠券失败!");
}*/
return null;
}
private static int getVouchersValue(){
int[] arr = {5,10,20,50};
Random ran = new Random();
return arr[ran.nextInt(arr.length)];
}
}
|
[
"xiao_c1025@163.com"
] |
xiao_c1025@163.com
|
|
573e33a58834466e854000e7c70fb6c89a26ad27
|
16b81076b476a535072cb7d1fe6bf76650c42744
|
/base/src/main/java/cn/cqs/base/ZipHelper.java
|
bd2fe3073a8e27239df9681452d1331f5431caa7
|
[] |
no_license
|
bingoloves/HelloAndroid
|
49ea8961eb148f865c06dd964bb928607bcad195
|
df6577beb36cd930b325b5fa16b6e2df6105b551
|
refs/heads/main
| 2023-03-01T04:07:09.561176
| 2021-02-08T03:27:21
| 2021-02-08T03:27:21
| 333,014,323
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,913
|
java
|
package cn.cqs.base;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.DataFormatException;
import java.util.zip.Deflater;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.Inflater;
public class ZipHelper {
/**
* zlib decompress 2 String
*
* @param bytesToDecompress
* @return
*/
public static String decompressToStringForZlib(byte[] bytesToDecompress) {
byte[] bytesDecompressed = decompressForZlib(bytesToDecompress);
String returnValue = null;
try {
returnValue = new String(bytesDecompressed,
0,
bytesDecompressed.length,
"UTF-8");
} catch (UnsupportedEncodingException uee) {
uee.printStackTrace();
}
return returnValue;
}
/**
* zlib decompress 2 byte
*
* @param bytesToDecompress
* @return
*/
public static byte[] decompressForZlib(byte[] bytesToDecompress) {
byte[] returnValues = null;
Inflater inflater = new Inflater();
int numberOfBytesToDecompress = bytesToDecompress.length;
inflater.setInput(bytesToDecompress, 0, numberOfBytesToDecompress);
int bufferSizeInBytes = numberOfBytesToDecompress;
int numberOfBytesDecompressedSoFar = 0;
List<Byte> bytesDecompressedSoFar = new ArrayList<Byte>();
try {
while (inflater.needsInput() == false) {
byte[] bytesDecompressedBuffer = new byte[bufferSizeInBytes];
int numberOfBytesDecompressedThisTime = inflater.inflate(bytesDecompressedBuffer);
numberOfBytesDecompressedSoFar += numberOfBytesDecompressedThisTime;
for (int b = 0; b < numberOfBytesDecompressedThisTime; b++) {
bytesDecompressedSoFar.add(bytesDecompressedBuffer[b]);
}
}
returnValues = new byte[bytesDecompressedSoFar.size()];
for (int b = 0; b < returnValues.length; b++) {
returnValues[b] = (byte) (bytesDecompressedSoFar.get(b));
}
} catch (DataFormatException dfe) {
dfe.printStackTrace();
}
inflater.end();
return returnValues;
}
/**
* zlib compress 2 byte
*
* @param bytesToCompress
* @return
*/
public static byte[] compressForZlib(byte[] bytesToCompress) {
Deflater deflater = new Deflater();
deflater.setInput(bytesToCompress);
deflater.finish();
byte[] bytesCompressed = new byte[Short.MAX_VALUE];
int numberOfBytesAfterCompression = deflater.deflate(bytesCompressed);
byte[] returnValues = new byte[numberOfBytesAfterCompression];
System.arraycopy(bytesCompressed,
0,
returnValues,
0,
numberOfBytesAfterCompression);
return returnValues;
}
/**
* zlib compress 2 byte
*
* @param stringToCompress
* @return
*/
public static byte[] compressForZlib(String stringToCompress) {
byte[] returnValues = null;
try {
returnValues = compressForZlib(stringToCompress.getBytes("UTF-8"));
} catch (UnsupportedEncodingException uee) {
uee.printStackTrace();
}
return returnValues;
}
/**
* gzip compress 2 byte
*
* @param string
* @return
* @throws IOException
*/
public static byte[] compressForGzip(String string) {
ByteArrayOutputStream os = null;
GZIPOutputStream gos = null;
try {
os = new ByteArrayOutputStream(string.length());
gos = new GZIPOutputStream(os);
gos.write(string.getBytes("UTF-8"));
byte[] compressed = os.toByteArray();
return compressed;
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (gos != null) {
gos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (os != null) {
os.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
/**
* gzip decompress 2 string
*
* @param compressed
* @return
* @throws IOException
*/
public static String decompressForGzip(byte[] compressed) {
final int BUFFER_SIZE = compressed.length;
GZIPInputStream gis = null;
ByteArrayInputStream is = null;
try {
is = new ByteArrayInputStream(compressed);
gis = new GZIPInputStream(is, BUFFER_SIZE);
StringBuilder string = new StringBuilder();
byte[] data = new byte[BUFFER_SIZE];
int bytesRead;
while ((bytesRead = gis.read(data)) != -1) {
string.append(new String(data, 0, bytesRead, "UTF-8"));
}
return string.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (gis != null) {
gis.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (is != null) {
is.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
}
|
[
"657952166@qq.com"
] |
657952166@qq.com
|
a8e3920ad9ca6962fb336fd3e6bbc39ddc395b7d
|
625af974d7fac78637fcbe7f6b66d19bbf2ff149
|
/WebServer/AutoBuild/Build/Temp/linuximaging-webui/com/ca/arcserve/linuximaging/ui/client/common/BaseAsyncCallback.java
|
0c124a6c26475836cdd2bef6266adee5911848aa
|
[] |
no_license
|
cliicy/kvm
|
25d22c84bcf374a3ca1b3828ebbd442813458c75
|
9a4cf5ac895a85466e3ac88f3081bdcb93f8951e
|
refs/heads/master
| 2021-01-24T08:05:38.767986
| 2018-02-26T12:56:27
| 2018-02-26T12:56:27
| 122,967,305
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,158
|
java
|
package com.ca.arcserve.linuximaging.ui.client.common;
import com.ca.arcserve.linuximaging.ui.client.UIContext;
import com.ca.arcserve.linuximaging.ui.client.exception.BusinessLogicException;
import com.ca.arcserve.linuximaging.ui.client.exception.ServiceConnectException;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.InvocationException;
public class BaseAsyncCallback<T> implements AsyncCallback<T> {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof InvocationException){
MessageBox messageBox = new MessageBox();
messageBox.setTitle(UIContext.Constants.productName());
messageBox.setMessage(UIContext.Constants.cantConnectToServer());
messageBox.setIcon(MessageBox.ERROR);
messageBox.setModal(true);
messageBox.setMinWidth(400);
messageBox.addCallback(new Listener<MessageBoxEvent>(){
@Override
public void handleEvent(MessageBoxEvent be) {
Window.Location.reload();
}
});
messageBox.show();
return;
}
if (caught instanceof ServiceConnectException){
Utils.showMessage(UIContext.Constants.productName(),MessageBox.ERROR,((ServiceConnectException)caught).getDisplayMessage());
return;
}
if(caught instanceof BusinessLogicException){
BusinessLogicException ex=(BusinessLogicException)caught;
if (ex.getErrorCode().equals(String.valueOf(0x0000000100000000L + 15))) {//data base error
Utils.showMessage(UIContext.productName, MessageBox.ERROR, UIContext.Constants.databaseBusy());
} else if(ex.getErrorCode().equals(String.valueOf(0x0000000100000000L + 6))){// web service session timeout
Window.Location.reload();
} else {
Utils.showMessage(UIContext.Constants.productName(),MessageBox.ERROR,ex.getDisplayMessage());
}
}else{
Utils.showMessage(UIContext.Constants.productName(),MessageBox.ERROR,caught.getMessage());
}
}
@Override
public void onSuccess(T result) {
}
}
|
[
"cliicy@gmail.com"
] |
cliicy@gmail.com
|
a55d3da27875b2bbe104579eeaa7a32a07fb6a9d
|
ad21934baa88cb1abb0886aca154d0342537abdc
|
/awifi-np-biz-common/src/main/java/com/awifi/np/biz/api/client/dbcenter/device/entity/service/EntityApiService.java
|
cc3c7699b1af5db5f252ca81d5843a24d2775dbe
|
[] |
no_license
|
un-knower/awifi-np-biz
|
5b74f89a1810d6d4accbfb3c52797f9adf9e00bb
|
ade4d0fa580100707325db0d8cfacee3f525ce21
|
refs/heads/master
| 2020-03-17T21:20:43.755520
| 2017-08-23T02:36:12
| 2017-08-23T02:36:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,192
|
java
|
package com.awifi.np.biz.api.client.dbcenter.device.entity.service;
import java.util.List;
import com.awifi.np.biz.api.client.dbcenter.device.entity.model.EntityInfo;
/**
* 版权所有: 爱WiFi无线运营中心
* 创建日期:2017年2月8日 上午9:09:33
* 创建作者:亢燕翔
* 文件名称:EntityApiService.java
* 版本: v1.0
* 功能:
* 修改记录:
*/
public interface EntityApiService {
/**
* 设备监控查询总数
* @param params 请求参数
* @return count
* @author 亢燕翔
* @throws Exception
* @date 2017年2月8日 上午9:54:48
*/
int getEntityInfoCountByMerId(String params) throws Exception;
/**
* 设备监控列表
* @param params 请求参数
* @return list
* @author 亢燕翔
* @throws Exception
* @date 2017年2月8日 上午10:02:59
*/
List<EntityInfo> getEntityInfoListByMerId(String params) throws Exception;
/**
* 编辑设备
* @param params 请求参数
* @author 亢燕翔
* @throws Exception
* @date 2017年2月10日 下午3:39:56
*/
void update(String params) throws Exception;
}
|
[
"fangzhiwei229@gmail.com"
] |
fangzhiwei229@gmail.com
|
c27ffeff7aa392d2a864ff1ee0c7329535b2caf0
|
a6e5bdf124a1905e0cbf548bfd29d84bb508990c
|
/javamelody-core/src/main/java/net/bull/javamelody/Stopwatch.java
|
a7a29f7ca5cd7a12ba652b764f56c8efacaad51a
|
[
"Apache-2.0"
] |
permissive
|
brentcm/javamelody
|
d3bf5802f0e500325e8fc512d202eeb216296385
|
203960e1a9cf4895d158929b7a8e5919ef77fc1c
|
refs/heads/master
| 2020-05-24T12:01:32.257764
| 2019-08-12T16:13:02
| 2019-08-12T16:13:02
| 187,260,202
| 0
| 1
|
Apache-2.0
| 2019-08-12T16:13:03
| 2019-05-17T17:59:36
|
Java
|
UTF-8
|
Java
| false
| false
| 972
|
java
|
package net.bull.javamelody;
import net.bull.javamelody.internal.model.Counter;
/**
* Stopwatch to record execution times of a piece of code in the services statistics.
* (To monitor whole methods, see MonitoringSpringInterceptor, MonitoringInterceptor or MonitoringProxy.)
* @author Emeric Vernat
*/
public class Stopwatch implements AutoCloseable {
private static final Counter SERVICES_COUNTER = MonitoringProxy.getServicesCounter();
/**
* Starts a stopwatch (must always be used in try-with-resource):
* <pre>
* try (Stopwatch stopwatch = new Stopwatch("nameyouwant")) {
* // your code
* }
* </pre>
* @param stopwatchName Whatever name you want to display in the statistics
*/
public Stopwatch(String stopwatchName) {
super();
SERVICES_COUNTER.bindContextIncludingCpu(stopwatchName);
}
/**
* Stops the stopwatch.
*/
@Override
public void close() throws Exception {
SERVICES_COUNTER.addRequestForCurrentContext(false);
}
}
|
[
"evernat@free.fr"
] |
evernat@free.fr
|
ffc63a7e3f49f64cd13b4ff06e64eec7672fbbfd
|
9b7d4a44a40499893178febfaa4dcfaa0d466baa
|
/src/main/java/com/lmh/demo/config/TestOneDataSourceConfig.java
|
0027dae17eccbb1f2a94f5b1fe0a277a159bf1cc
|
[] |
no_license
|
lmh370106004/MyBatisDemo
|
749d0b7efe56fa287935ad3a5c64a82e8168c2b4
|
7c84380581a344869e8dfac80a743e3d00855b3b
|
refs/heads/master
| 2020-03-21T15:49:23.730311
| 2018-06-26T14:24:56
| 2018-06-26T14:24:56
| 138,735,018
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,526
|
java
|
package com.lmh.demo.config;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.boot.autoconfigure.MybatisProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import com.alibaba.druid.pool.DruidDataSource;
import javax.sql.DataSource;
/**
* Created by liumuhang on 2018/6/15.
*/
@Configuration
@MapperScan(basePackages = {"com.lmh.demo.mapper.testOne"}, sqlSessionFactoryRef = "testOneSqlSessionFactory")
public class TestOneDataSourceConfig {
@Autowired
private MybatisProperties mybatisProperties;
/**
* mybatis mapper resource 路径
*/
private static final String MAPPER_PATH = "mapper/testOne/**.xml";
@Bean("testOneDataSource")
@ConfigurationProperties(prefix = "spring.datasource.druid")
public DruidDataSource dataSource() {
return new DruidDataSource();
}
@Bean("testOneTransactionManager")
public DataSourceTransactionManager dataSourceTransactionManager(
@Qualifier("testOneDataSource") DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean("testOneSqlSessionFactory")
public SqlSessionFactory sqlSessionFactoryBean(@Qualifier("testOneDataSource") DataSource dataSource)
throws Exception {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource);
sqlSessionFactoryBean.setTypeAliasesPackage(mybatisProperties.getTypeAliasesPackage());
/** 添加mapper 扫描路径 */
PathMatchingResourcePatternResolver
pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + MAPPER_PATH;
sqlSessionFactoryBean.setMapperLocations(pathMatchingResourcePatternResolver.getResources(packageSearchPath));
return sqlSessionFactoryBean.getObject();
}
}
|
[
"="
] |
=
|
7112eb491f93dee7c9e5fcfcd7c3c3d82f9039b6
|
43ca534032faa722e206f4585f3075e8dd43de6c
|
/src/com/instagram/api/e/a.java
|
2432976cd9db9065880b807efeadbfdc9216ec7c
|
[] |
no_license
|
dnoise/IG-6.9.1-decompiled
|
3e87ba382a60ba995e582fc50278a31505109684
|
316612d5e1bfd4a74cee47da9063a38e9d50af68
|
refs/heads/master
| 2021-01-15T12:42:37.833988
| 2014-10-29T13:17:01
| 2014-10-29T13:17:01
| 26,952,948
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 826
|
java
|
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.instagram.api.e;
import com.instagram.common.a.c.b;
import com.instagram.common.y.e;
public abstract class a extends com.instagram.common.a.a.a
{
private final String a;
protected a(String s)
{
a = s;
}
public b a()
{
b b1 = new b();
b1.a("access_token", a);
return b1;
}
protected abstract String b();
public int c()
{
return com.instagram.common.a.c.a.c;
}
public final String g_()
{
Object aobj[] = new Object[2];
aobj[0] = "https://graph.facebook.com/";
aobj[1] = b();
return e.a("%s%s", aobj);
}
}
|
[
"leo.sjoberg@gmail.com"
] |
leo.sjoberg@gmail.com
|
b691d5f2e5a9316598887703c6398a8ba9fd9e52
|
c4816c3806b4fde2764085b838340287f81a8827
|
/com.sap.jnc.marketing.service/src/main/java/com/sap/jnc/marketing/service/migration/validate/rule/DependencyRule.java
|
b6067fb22dbc9cfe5906b461178bd9312f7d9d8a
|
[] |
no_license
|
enyeama/jnc-marketing
|
65e87588109504920251a2c44b3873b09825fc07
|
9e0ab45c29af57536128161bc6084c63408d74e7
|
refs/heads/master
| 2021-01-11T22:13:03.164353
| 2017-01-14T13:26:37
| 2017-01-14T13:26:37
| 78,935,958
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,129
|
java
|
package com.sap.jnc.marketing.service.migration.validate.rule;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.sap.jnc.marketing.service.config.migration.UploadConf;
import com.sap.jnc.marketing.service.config.migration.UploadField;
import com.sap.jnc.marketing.service.config.migration.UploadRow;
import com.sap.jnc.marketing.service.migration.cache.BusinessKey;
import com.sap.jnc.marketing.service.migration.cache.CacheManager;
/**
* 缓存依赖校验
*
* @author I322359
*/
@Component
public class DependencyRule implements Rule {
private static Logger logger = LoggerFactory.getLogger(EntityExistRule.class);
@Override
public <T extends UploadRow> String check(T row, UploadField uploadField, UploadConf conf) {
try {
if (row == null) {
throw new RuntimeException("被校验的数据为空");
}
if (!uploadField.dependency()) {
return null;
}
Class<? extends Serializable> entityCls = uploadField.dependencyEntity();
// 得到相同实体的所有业务键
Map<String, UploadField> uploadFields = conf.getFieldsAnnotation();
List<UploadField> list = new ArrayList<UploadField>();
for (UploadField field : uploadFields.values()) {
if (field.dependencyEntity() == entityCls) {
list.add(field);
}
}
BusinessKey businessKey = new BusinessKey();
for (UploadField filed : list) {
// TODO get values
String prop = filed.prop();
businessKey.addKeyValue(filed.dependencyKeys(), BeanUtils.getProperty(row, prop));
}
CacheManager cacheManager = CacheManager.getInstance();
return cacheManager.contains(conf, entityCls, businessKey) ? null : uploadField.header() + "不存在";
}
catch (Exception e) {
if (row != null) {
logger.error(conf.getFileAnnotation().sheetName() + ",错误记录" + JSONObject.toJSONString(row));
}
throw new RuntimeException(e);
}
}
}
|
[
"vincent.chen01@sap.com"
] |
vincent.chen01@sap.com
|
b5a3b1039b115cf1470443f969779d7fda836d60
|
180e78725121de49801e34de358c32cf7148b0a2
|
/dataset/protocol1/mapstruct/learning/4843/TargetType.java
|
aa68c53db16535dda49270e484aa78605b7930ec
|
[] |
no_license
|
ASSERT-KTH/synthetic-checkstyle-error-dataset
|
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
|
40c057e1669584bfc6fecf789b5b2854660222f3
|
refs/heads/master
| 2023-03-18T12:50:55.410343
| 2019-01-25T09:54:39
| 2019-01-25T09:54:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 751
|
java
|
/*
* Copyright MapStruct Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package org.mapstruct;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Declares a parameter of a custom mapping method to be populated with the target type of the mapping.
* <p>
* Not more than one parameter can be declared as {@code TargetType} and that parameter needs to be of type
* {@link Class} (may be parameterized), or a super-type of it.
*
* @author Andreas Gudian
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.CLASS)
public @interface TargetType {
}
|
[
"bloriot97@gmail.com"
] |
bloriot97@gmail.com
|
8b06453896094437f1d203dacb14b01400198991
|
10d77fabcbb945fe37e15ae438e360a89a24ea05
|
/graalvm/transactions/fork/narayana/qa/tests/src/org/jboss/jbossts/qa/CrashRecovery01Clients/Client11.java
|
1917000a5a173ebaddf1779e5c5b9d97a47a7925
|
[
"Apache-2.0",
"LGPL-2.1-only",
"LGPL-2.1-or-later",
"LicenseRef-scancode-other-copyleft"
] |
permissive
|
nmcl/scratch
|
1a881605971e22aa300487d2e57660209f8450d3
|
325513ea42f4769789f126adceb091a6002209bd
|
refs/heads/master
| 2023-03-12T19:56:31.764819
| 2023-02-05T17:14:12
| 2023-02-05T17:14:12
| 48,547,106
| 2
| 1
|
Apache-2.0
| 2023-03-01T12:44:18
| 2015-12-24T15:02:58
|
Java
|
UTF-8
|
Java
| false
| false
| 4,119
|
java
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2007, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* 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,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2005-2006,
* @author JBoss Inc.
*/
//
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
//
// Arjuna Technologies Ltd.,
// Newcastle upon Tyne,
// Tyne and Wear,
// UK.
//
package org.jboss.jbossts.qa.CrashRecovery01Clients;
/*
* Copyright (C) 1999-2001 by HP Bluestone Software, Inc. All rights Reserved.
*
* HP Arjuna Labs,
* Newcastle upon Tyne,
* Tyne and Wear,
* UK.
*
* $Id: Client11.java,v 1.2 2003/06/26 11:43:15 rbegg Exp $
*/
/*
* Try to get around the differences between Ansi CPP and
* K&R cpp with concatenation.
*/
/*
* Copyright (C) 1999-2001 by HP Bluestone Software, Inc. All rights Reserved.
*
* HP Arjuna Labs,
* Newcastle upon Tyne,
* Tyne and Wear,
* UK.
*
* $Id: Client11.java,v 1.2 2003/06/26 11:43:15 rbegg Exp $
*/
import org.jboss.jbossts.qa.CrashRecovery01.*;
import org.jboss.jbossts.qa.Utils.*;
import org.omg.CORBA.TRANSACTION_ROLLEDBACK;
public class Client11
{
public static void main(String[] args)
{
try
{
ORBInterface.initORB(args, null);
OAInterface.initOA();
String serviceIOR = ServerIORStore.loadIOR(args[args.length - 1]);
Service service = ServiceHelper.narrow(ORBInterface.orb().string_to_object(serviceIOR));
boolean correct = true;
OTS.current().begin();
service.setup_oper(2);
OTS.current().rollback_only();
try
{
OTS.current().commit(true);
correct = false;
}
catch (TRANSACTION_ROLLEDBACK transactionRolledBack)
{
}
// code changed to cope with recovery manager fix
// that makes reply_completion cause resource to rollback even though
// transaction has completed
ResourceTrace resourceTrace1 = service.get_resource_trace(0);
ResourceTrace resourceTrace2 = service.get_resource_trace(1);
// trace should be rollback
correct = correct && (resourceTrace1 == ResourceTrace.ResourceTraceRollback);
correct = correct && (resourceTrace2 == ResourceTrace.ResourceTraceRollback);
// check_oper will invoke reply_completion and check the state of the transaction
correct = correct && service.check_oper();
// now sleep to let reply completion do its job 1 second should be more than enough
CrashRecoveryDelays.awaitReplayCompletionCR01();
correct = correct && service.is_correct();
// after reply_completion is called the resource will have rollback called on
// it again, changing the ResourceTrace to ResourceTrace.ResourceTraceUnknown
resourceTrace1 = service.get_resource_trace(0);
resourceTrace2 = service.get_resource_trace(1);
correct = correct && (resourceTrace1 == ResourceTrace.ResourceTraceUnknown);
correct = correct && (resourceTrace2 == ResourceTrace.ResourceTraceUnknown);
if (correct)
{
System.out.println("Passed");
}
else
{
System.out.println("Failed");
}
}
catch (Exception exception)
{
System.out.println("Failed");
System.err.println("Client11.main: " + exception);
exception.printStackTrace(System.err);
}
try
{
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
}
catch (Exception exception)
{
System.err.println("Client11.main: " + exception);
exception.printStackTrace(System.err);
}
}
}
|
[
"mlittle@redhat.com"
] |
mlittle@redhat.com
|
719e661bad1bcece759047160509229f72a28aad
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-12798-88-7-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/internal/template/DefaultTemplateManager_ESTest_scaffolding.java
|
5a515eeacc7da298d0afbe6d234c736ab2ab9017
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 458
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Apr 02 16:05:46 UTC 2020
*/
package com.xpn.xwiki.internal.template;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DefaultTemplateManager_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
18cfeb37ea658ac521fd6283708ff7118cea7606
|
71975999c9d702a0883ec9038ce3e76325928549
|
/src2.4.0/src/main/java/com/alibaba/wireless/security/open/SecException.java
|
dd2634ada36993af32c832e0cfcf45f1a405d4d9
|
[] |
no_license
|
XposedRunner/PhysicalFitnessRunner
|
dc64179551ccd219979a6f8b9fe0614c29cd61de
|
cb037e59416d6c290debbed5ed84c956e705e738
|
refs/heads/master
| 2020-07-15T18:18:23.001280
| 2019-09-02T04:21:34
| 2019-09-02T04:21:34
| 205,620,387
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,390
|
java
|
package com.alibaba.wireless.security.open;
import java.io.PrintStream;
import java.io.PrintWriter;
public class SecException extends Exception {
public static final int ERROR_NULL_CONTEXT = -100;
private int a;
public SecException(int i) {
this.a = i;
}
public SecException(String str, int i) {
super(str);
this.a = i;
}
public SecException(String str, Throwable th, int i) {
super(str, th);
this.a = i;
}
public SecException(Throwable th, int i) {
super(th);
this.a = i;
}
public int getErrorCode() {
return this.a;
}
public void printStackTrace(PrintStream printStream) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("ErrorCode = ");
stringBuilder.append(getErrorCode());
printStream.println(stringBuilder.toString());
super.printStackTrace(printStream);
}
public void printStackTrace(PrintWriter printWriter) {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("ErrorCode = ");
stringBuilder.append(getErrorCode());
printWriter.println(stringBuilder.toString());
super.printStackTrace(printWriter);
}
public void setErrorCode(int i) {
this.a = i;
}
}
|
[
"xr_master@mail.com"
] |
xr_master@mail.com
|
a7be2c7ee1e7f7539a60589e0c0999629b633f75
|
8ee5a999d21e82b65ed87b71babf76911221ad6d
|
/app/src/main/java/com/next/eswaraj/adapters/ComplaintListAdapter.java
|
b6c43fbb0ef9d1d5e959f95fb7d95d85a1412066
|
[] |
no_license
|
eswaraj/eswaraj-android2
|
1092c4742e5751b56aac01cc650a4366aea12dc1
|
e52ba7746a27b0a297e5fbb429d2f58569c9753a
|
refs/heads/master
| 2020-05-23T14:05:14.896083
| 2015-02-01T21:23:35
| 2015-02-01T21:23:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,813
|
java
|
package com.next.eswaraj.adapters;
import android.app.Activity;
import android.content.Context;
import android.location.Address;
import android.net.Uri;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.next.eswaraj.R;
import com.next.eswaraj.models.ComplaintDto;
import com.next.eswaraj.widgets.CustomNetworkImageView;
import com.eswaraj.web.dto.CategoryDto;
import com.google.gson.Gson;
import com.squareup.picasso.Picasso;
import java.util.Date;
import java.util.List;
public class ComplaintListAdapter extends ArrayAdapter<ComplaintDto> {
private Context context;
private int layoutResourceId;
private List<ComplaintDto> complaintDtoList;
public ComplaintListAdapter(Context context, int layoutResourceId, List<ComplaintDto> complaintDtoList) {
super(context, layoutResourceId, complaintDtoList);
this.context = context;
this.layoutResourceId = layoutResourceId;
this.complaintDtoList = complaintDtoList;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ComplaintDtoHolder holder = null;
if(row == null)
{
LayoutInflater inflater = ((Activity)context).getLayoutInflater();
row = inflater.inflate(layoutResourceId, parent, false);
holder = new ComplaintDtoHolder();
holder.mcId = (TextView)row.findViewById(R.id.mcID);
holder.mcCategory = (TextView)row.findViewById(R.id.mcCategory);
holder.mcDate = (TextView)row.findViewById(R.id.mcDate);
holder.mcStatus = (TextView)row.findViewById(R.id.mcStatus);
holder.mcIcon = (CustomNetworkImageView)row.findViewById(R.id.mcIcon);
holder.mcImage = (CustomNetworkImageView)row.findViewById(R.id.mcImage);
holder.mcProfilePhoto = (CustomNetworkImageView)row.findViewById(R.id.mcProfilePhoto);
holder.mcName = (TextView) row.findViewById(R.id.mcSubmitterName);
holder.mcDescription = (TextView) row.findViewById(R.id.mcDescription);
holder.mcAddress = (TextView) row.findViewById(R.id.mcAddress);
holder.mcAmenity = (TextView) row.findViewById(R.id.mcAmenityName);
row.setTag(holder);
}
else
{
holder = (ComplaintDtoHolder)row.getTag();
}
ComplaintDto complaintDto = complaintDtoList.get(position);
for(CategoryDto categoryDto : complaintDto.getCategories()) {
if(!categoryDto.isRoot()) {
holder.mcCategory.setText(categoryDto.getName());
}
else {
holder.mcAmenity.setText(categoryDto.getName());
}
}
holder.mcId.setText(complaintDto.getId().toString());
holder.mcDate.setText(DateUtils.getRelativeTimeSpanString(complaintDto.getComplaintTime(), new Date().getTime(), DateUtils.MINUTE_IN_MILLIS));
holder.mcStatus.setText(complaintDto.getStatus());
holder.mcName.setText(complaintDto.getCreatedBy().get(0).getName());
if(complaintDto.getDescription() != null) {
holder.mcDescription.setText(complaintDto.getDescription());
}
else {
holder.mcDescription.setVisibility(View.GONE);
}
if(complaintDto.getCreatedBy().get(0).getProfilePhoto() != null && !complaintDto.getCreatedBy().get(0).getProfilePhoto().equals("")) {
//holder.mcProfilePhoto.loadProfileImage(complaintDto.getCreatedBy().get(0).getProfilePhoto(), complaintDto.getCreatedBy().get(0).getId());
Picasso.with(context).load(complaintDto.getCreatedBy().get(0).getProfilePhoto().replace("http", "https")).error(R.drawable.anon).placeholder(R.drawable.anon).into(holder.mcProfilePhoto);
}
if(complaintDto.getImages() != null && complaintDto.getImages().get(0) != null && complaintDto.getImages().get(0).getOrgUrl() != null && !complaintDto.getImages().get(0).getOrgUrl().equals("")) {
//holder.mcImage.loadComplaintImage(complaintDto.getImages().get(0).getOrgUrl(), complaintDto.getId());
Picasso.with(context).load(complaintDto.getImages().get(0).getOrgUrl()).into(holder.mcImage);
holder.mcImage.setVisibility(View.VISIBLE);
}
else {
holder.mcImage.setVisibility(View.GONE);
}
if(getRootCategoryId(complaintDto) != null) {
holder.mcIcon.setImageURI(Uri.parse(context.getFilesDir() + "/eSwaraj_" + String.valueOf(getRootCategoryId(complaintDto)) + ".png"));
}
if(complaintDto.getLocationString() != null) {
Address bestMatch = new Gson().fromJson(complaintDto.getLocationString(), Address.class);
String complaintLocationString = null;
if(bestMatch != null) {
complaintLocationString = bestMatch.getAddressLine(1) + ", " + bestMatch.getAddressLine(2);
holder.mcAddress.setText(complaintLocationString);
}
else {
holder.mcAddress.setText("");
}
}
else {
holder.mcAddress.setText("");
}
return row;
}
private Long getRootCategoryId(ComplaintDto complaintDto) {
for(CategoryDto categoryDto : complaintDto.getCategories()) {
if(categoryDto.isRoot()) {
return categoryDto.getId();
}
}
return null;
}
public void addComplaint(ComplaintDto newComplaintDto) {
if(newComplaintDto != null) {
complaintDtoList.add(newComplaintDto);
}
}
public ComplaintDto removeComplaint(Long id) {
for(ComplaintDto complaintDto : complaintDtoList) {
if(complaintDto.getId().equals(id)) {
complaintDtoList.remove(complaintDto);
return complaintDto;
}
}
return null;
}
public void markComplaintClosed(Long id) {
for(ComplaintDto complaintDto : complaintDtoList) {
if(complaintDto.getId().equals(id)) {
complaintDto.setStatus("Done");
}
}
}
public void clearComplaints() {
complaintDtoList.clear();
}
static class ComplaintDtoHolder
{
TextView mcId;
TextView mcCategory;
TextView mcDate;
TextView mcStatus;
CustomNetworkImageView mcIcon;
CustomNetworkImageView mcProfilePhoto;
CustomNetworkImageView mcImage;
TextView mcName;
TextView mcDescription;
TextView mcAddress;
TextView mcAmenity;
}
}
|
[
"ping2ravi@gmail.com"
] |
ping2ravi@gmail.com
|
2b6b59a794a49fac0a495ced2f31922721707854
|
d71e879b3517cf4fccde29f7bf82cff69856cfcd
|
/ExtractedJars/Apk_Extractor_com.ext.ui.apk/javafiles/com/ext/file/FilePickerActivity$c$a.java
|
49bf0719570a096d49157db2f45248432569593c
|
[
"MIT"
] |
permissive
|
Andreas237/AndroidPolicyAutomation
|
b8e949e072d08cf6c6166c3f15c9c63379b8f6ce
|
c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a
|
refs/heads/master
| 2020-04-10T02:14:08.789751
| 2019-05-16T19:29:11
| 2019-05-16T19:29:11
| 160,739,088
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,058
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package com.ext.file;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
// Referenced classes of package com.ext.file:
// FilePickerActivity
public class FilePickerActivity$c$a extends android.support.v7.widget.
{
static TextView a(FilePickerActivity$c$a filepickeractivity$c$a)
{
return filepickeractivity$c$a.c;
// 0 0:aload_0
// 1 1:getfield #37 <Field TextView c>
// 2 4:areturn
}
static ImageView b(FilePickerActivity$c$a filepickeractivity$c$a)
{
return filepickeractivity$c$a.b;
// 0 0:aload_0
// 1 1:getfield #32 <Field ImageView b>
// 2 4:areturn
}
final FilePickerActivity.c a;
private ImageView b;
private TextView c;
public FilePickerActivity$c$a(FilePickerActivity.c c1, View view)
{
a = c1;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #18 <Field FilePickerActivity$c a>
super(view);
// 3 5:aload_0
// 4 6:aload_2
// 5 7:invokespecial #21 <Method void android.support.v7.widget.RecyclerView$ViewHolder(View)>
b = (ImageView)view.findViewById(0x7f090054);
// 6 10:aload_0
// 7 11:aload_2
// 8 12:ldc1 #22 <Int 0x7f090054>
// 9 14:invokevirtual #28 <Method View View.findViewById(int)>
// 10 17:checkcast #30 <Class ImageView>
// 11 20:putfield #32 <Field ImageView b>
c = (TextView)view.findViewById(0x7f090055);
// 12 23:aload_0
// 13 24:aload_2
// 14 25:ldc1 #33 <Int 0x7f090055>
// 15 27:invokevirtual #28 <Method View View.findViewById(int)>
// 16 30:checkcast #35 <Class TextView>
// 17 33:putfield #37 <Field TextView c>
// 18 36:return
}
}
|
[
"silenta237@gmail.com"
] |
silenta237@gmail.com
|
d7770fb40b5c060d800644dc1c3c0a9042ca9ec0
|
305e64233c32670c3b8522854142d59fe9c80167
|
/baek/baek22252.java
|
04a402c4519a1f53e2c1f37508932be43025859b
|
[] |
no_license
|
Kastori1206/algo
|
144f7708ecd653c01a2c98d83d0406a90390ace8
|
ea937ae3e4def01f7949c11254035a33f6aae6bb
|
refs/heads/master
| 2023-01-08T11:11:24.155073
| 2022-12-28T04:41:45
| 2022-12-28T04:41:45
| 239,990,626
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,968
|
java
|
package baek;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
/**
* 정보 상인 호석
* https://www.acmicpc.net/problem/22252
*/
public class baek22252 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int Q = Integer.parseInt(br.readLine());
Map<String, PriorityQueue<Integer>> hm = new HashMap<>();
long answer = 0;
for (int i = 0; i < Q; i++) {
st = new StringTokenizer(br.readLine());
int query = Integer.parseInt(st.nextToken());
String name = st.nextToken();
int k = Integer.parseInt(st.nextToken());
PriorityQueue<Integer> q;
switch (query) {
case 1:
if (hm.containsKey(name)) {
q = hm.get(name);
for (int j = 0; j < k; j++) {
q.offer(Integer.parseInt(st.nextToken()));
}
} else {
q = new PriorityQueue<>(Collections.reverseOrder());
for (int j = 0; j < k; j++) {
q.offer(Integer.parseInt(st.nextToken()));
}
}
hm.put(name, q);
break;
case 2:
if (hm.containsKey(name)) {
q = hm.get(name);
while (!q.isEmpty()) {
if (k <= 0) {
break;
}
answer += q.poll();
k--;
}
hm.put(name, q);
}
break;
}
}
System.out.println(answer);
}
}
|
[
"kastori1990@gmail.com"
] |
kastori1990@gmail.com
|
8ac0b69db598de435606b48290b6200e4e09966f
|
2f0fd635d1de3bed6cc6357b67107968833fa595
|
/xiaomall-admin/src/main/java/com/xiao/xiaomall/admin/service/PmsProductService.java
|
069da4a456f321c1a21dc98e65b4141eb546eea6
|
[] |
no_license
|
xrqing/xiaoMall
|
d28c9b5c59ab8a71a3c16c77f5c52bdb019ccafd
|
c13af58dd69f3294329286927dc4e77e1826f002
|
refs/heads/master
| 2022-06-26T22:41:38.125845
| 2019-07-19T12:56:31
| 2019-07-19T12:56:31
| 194,498,525
| 0
| 0
| null | 2022-06-21T01:27:52
| 2019-06-30T09:31:43
|
Java
|
UTF-8
|
Java
| false
| false
| 1,491
|
java
|
package com.xiao.xiaomall.admin.service;
import com.xiao.xiaomall.admin.dto.PmsProductParam;
import com.xiao.xiaomall.admin.dto.PmsProductQueryParam;
import com.xiao.xiaomall.admin.dto.PmsProductResult;
import com.xiao.xiaomall.entity.PmsProduct;
import io.swagger.models.auth.In;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*商品管理 service
**/
public interface PmsProductService {
/**
*增加商品
* */
@Transactional
int create(PmsProductParam pmsProductParam);
/**
*根据商品的编号去查询更新的信息
**/
PmsProductResult getUpdateInfo(Long id);
/**
* 根据id去更新商品
* */
int update(Long id,PmsProductParam productParam);
/**
*查询商品分页
* */
List<PmsProduct> list(PmsProductQueryParam productQueryParam,Integer pageSize,Integer pageNum);
/**
*批量修改审核状态
* */
@Transactional
int updateVerifyStatus(List<Long> ids,Integer verifyStatus,String detail);
/**
*根据货号和商品名称查询
* */
List<PmsProduct> listOne(String keyword);
/**
* 批量修改推荐状态
* */
int updateRecommandStatus(List<Long> ids,Integer recommendStatus);
/**
*批量修改新品状态
* */
int updateNewStatus(List<Long> ids, Integer newStatus);
/**
*批量删除
* */
int deleteAll(List<Long> ids,Integer deleteStatus);
}
|
[
"2978183194@qq.com"
] |
2978183194@qq.com
|
14d0506dd31083cad6c421813f7486acb6a7f5f2
|
6be39fc2c882d0b9269f1530e0650fd3717df493
|
/weixin反编译/sources/com/tencent/mm/protocal/c/beg.java
|
65e9860e55ed9740ab99d85556e2f74cdc7d6a28
|
[] |
no_license
|
sir-deng/res
|
f1819af90b366e8326bf23d1b2f1074dfe33848f
|
3cf9b044e1f4744350e5e89648d27247c9dc9877
|
refs/heads/master
| 2022-06-11T21:54:36.725180
| 2020-05-07T06:03:23
| 2020-05-07T06:03:23
| 155,177,067
| 5
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,554
|
java
|
package com.tencent.mm.protocal.c;
import com.tencent.mm.bp.a;
import com.tencent.mm.bp.b;
import java.util.LinkedList;
public final class beg extends a {
public String nlE;
public int wQU;
public int wQV;
public LinkedList<bjz> wQW = new LinkedList();
public String wQX;
public int wfl;
public b wgG;
public String wgY;
protected final int a(int i, Object... objArr) {
int h;
byte[] bArr;
if (i == 0) {
e.a.a.c.a aVar = (e.a.a.c.a) objArr[0];
if (this.wgY == null) {
throw new e.a.a.b("Not all required fields were included: MD5");
} else if (this.nlE == null) {
throw new e.a.a.b("Not all required fields were included: Url");
} else if (this.wQX == null) {
throw new e.a.a.b("Not all required fields were included: OriginalMD5");
} else {
if (this.wgY != null) {
aVar.g(1, this.wgY);
}
aVar.fX(2, this.wQU);
if (this.nlE != null) {
aVar.g(3, this.nlE);
}
aVar.fX(4, this.wQV);
aVar.d(5, 8, this.wQW);
if (this.wgG != null) {
aVar.b(6, this.wgG);
}
if (this.wQX != null) {
aVar.g(7, this.wQX);
}
aVar.fX(8, this.wfl);
return 0;
}
} else if (i == 1) {
if (this.wgY != null) {
h = e.a.a.b.b.a.h(1, this.wgY) + 0;
} else {
h = 0;
}
h += e.a.a.a.fU(2, this.wQU);
if (this.nlE != null) {
h += e.a.a.b.b.a.h(3, this.nlE);
}
h = (h + e.a.a.a.fU(4, this.wQV)) + e.a.a.a.c(5, 8, this.wQW);
if (this.wgG != null) {
h += e.a.a.a.a(6, this.wgG);
}
if (this.wQX != null) {
h += e.a.a.b.b.a.h(7, this.wQX);
}
return h + e.a.a.a.fU(8, this.wfl);
} else if (i == 2) {
bArr = (byte[]) objArr[0];
this.wQW.clear();
e.a.a.a.a aVar2 = new e.a.a.a.a(bArr, unknownTagHandler);
for (h = a.a(aVar2); h > 0; h = a.a(aVar2)) {
if (!super.a(aVar2, this, h)) {
aVar2.cKx();
}
}
if (this.wgY == null) {
throw new e.a.a.b("Not all required fields were included: MD5");
} else if (this.nlE == null) {
throw new e.a.a.b("Not all required fields were included: Url");
} else if (this.wQX != null) {
return 0;
} else {
throw new e.a.a.b("Not all required fields were included: OriginalMD5");
}
} else if (i != 3) {
return -1;
} else {
e.a.a.a.a aVar3 = (e.a.a.a.a) objArr[0];
beg beg = (beg) objArr[1];
int intValue = ((Integer) objArr[2]).intValue();
switch (intValue) {
case 1:
beg.wgY = aVar3.AEQ.readString();
return 0;
case 2:
beg.wQU = aVar3.AEQ.rz();
return 0;
case 3:
beg.nlE = aVar3.AEQ.readString();
return 0;
case 4:
beg.wQV = aVar3.AEQ.rz();
return 0;
case 5:
LinkedList JD = aVar3.JD(intValue);
int size = JD.size();
for (intValue = 0; intValue < size; intValue++) {
bArr = (byte[]) JD.get(intValue);
a bjz = new bjz();
e.a.a.a.a aVar4 = new e.a.a.a.a(bArr, unknownTagHandler);
for (boolean z = true; z; z = bjz.a(aVar4, bjz, a.a(aVar4))) {
}
beg.wQW.add(bjz);
}
return 0;
case 6:
beg.wgG = aVar3.cKw();
return 0;
case 7:
beg.wQX = aVar3.AEQ.readString();
return 0;
case 8:
beg.wfl = aVar3.AEQ.rz();
return 0;
default:
return -1;
}
}
}
}
|
[
"denghailong@vargo.com.cn"
] |
denghailong@vargo.com.cn
|
c0b7ed72e5fb567ef8a428eac86bc6a4b7117efd
|
64031a8e5ff5ef0a5ecf5f249d781d287b114b2b
|
/netty4-demos/src/main/java/com/waylau/netty/demo/cs/HeartBreakNioServer.java
|
31924231490e6b4b3b0b6b6d4021adabaa88bd4f
|
[] |
no_license
|
gavin2lee/netty-4-user-guide-demos
|
706e467e5255d61fada3fa3a99f7f1ca509c4a50
|
ef81bf82b7862f8764ec0b507cf4c017ba1628f8
|
refs/heads/master
| 2021-01-12T10:03:43.078752
| 2016-12-16T03:46:43
| 2016-12-16T03:46:43
| 76,346,262
| 0
| 0
| null | 2016-12-13T09:58:45
| 2016-12-13T09:58:45
| null |
UTF-8
|
Java
| false
| false
| 4,229
|
java
|
package com.waylau.netty.demo.cs;
import java.io.ByteArrayOutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Date;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicLong;
public class HeartBreakNioServer {
public void server(int port) throws Exception {
AtomicLong count = new AtomicLong();
AtomicLong nameCount = new AtomicLong();
System.out.println("Listening for connections on port " + port);
// open Selector that handles channels
Selector selector = Selector.open();
// open ServerSocketChannel
ServerSocketChannel serverChannel = ServerSocketChannel.open();
// get ServerSocket
ServerSocket serverSocket = serverChannel.socket();
// bind server to port
serverSocket.bind(new InetSocketAddress(port));
// set to non-blocking
serverChannel.configureBlocking(false);
// register ServerSocket to selector and specify that it is interested
// in new accepted clients
serverChannel.register(selector, SelectionKey.OP_ACCEPT);
final ByteBuffer msg = ByteBuffer.wrap("Hi!\r\n".getBytes());
while (true) {
// Wait for new events that are ready for process. This will block
// until something happens
int n = selector.select();
if (n > 0) {
// Obtain all SelectionKey instances that received events
Iterator<SelectionKey> iter = selector.selectedKeys().iterator();
while (iter.hasNext()) {
SelectionKey key = iter.next();
iter.remove();
if (key.isConnectable()) {
System.out.println("connectable");
}
try {
if (key.isAcceptable()) {
ServerSocketChannel server = (ServerSocketChannel) key.channel();
SocketChannel client = server.accept();
System.out.println("Accepted connection from " + client);
client.configureBlocking(false);
String scName = "SC-"+nameCount.incrementAndGet();
client.register(selector, SelectionKey.OP_READ, scName);
key.interestOps(SelectionKey.OP_ACCEPT);
}
// Check if event was because new client ready to get
// accepted
if (key.isReadable()) {
String scName = (String) key.attachment();
System.out.println("read");
SocketChannel client = (SocketChannel) key.channel();
System.out.println("Read connection from " + client);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ByteBuffer buf = ByteBuffer.allocate(100);
while(client.read(buf)>0){
buf.flip();
bos.write(buf.array());
buf.clear();
}
System.out.println("RECV from " + scName + " - " + new String(bos.toByteArray(),"UTF-8"));
String msgSend = count.getAndIncrement() + "hi client :" + new Date().toString();
client.write(ByteBuffer.wrap(msgSend.getBytes("UTF-8")));
client.register(selector, SelectionKey.OP_READ,scName);
key.interestOps(SelectionKey.OP_READ);
// Accept client and register it to selector
// client.register(selector, SelectionKey.OP_WRITE,
// msg.duplicate());
}
// Check if event was because socket is ready to write
// data
if (key.isWritable()) {
System.out.println("write");
SocketChannel client = (SocketChannel) key.channel();
client.write(ByteBuffer.wrap("hi client".getBytes("UTF-8")));
// ByteBuffer buff = (ByteBuffer) key.attachment();
// //write data to connected client
// while (buff.hasRemaining()) {
// if (client.write(buff) == 0) {
// break;
// }
// }
// client.close();//close client
client.register(selector, SelectionKey.OP_ACCEPT);
key.interestOps(SelectionKey.OP_WRITE);
}
} catch (Exception e) {
key.cancel();
key.channel().close();
}
}
}
}
}
public static void main(String... args) {
HeartBreakNioServer server = new HeartBreakNioServer();
try {
server.server(20180);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
[
"gavin2lee@163.com"
] |
gavin2lee@163.com
|
5224e80430980ad624250d06a68dc13b2cb17369
|
3b91ed788572b6d5ac4db1bee814a74560603578
|
/com/tencent/mm/protocal/c/qi.java
|
7017fb9cfd3188a6bdf9c21c021df8f7df7848e6
|
[] |
no_license
|
linsir6/WeChat_java
|
a1deee3035b555fb35a423f367eb5e3e58a17cb0
|
32e52b88c012051100315af6751111bfb6697a29
|
refs/heads/master
| 2020-05-31T05:40:17.161282
| 2018-08-28T02:07:02
| 2018-08-28T02:07:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,882
|
java
|
package com.tencent.mm.protocal.c;
import f.a.a.b;
import f.a.a.c.a;
import java.util.LinkedList;
public final class qi extends bhp {
public String pjK;
public LinkedList<kw> ruL = new LinkedList();
public int ruM;
public int ruN;
public int version;
protected final int a(int i, Object... objArr) {
int fS;
byte[] bArr;
if (i == 0) {
a aVar = (a) objArr[0];
if (this.six == null) {
throw new b("Not all required fields were included: BaseResponse");
}
if (this.six != null) {
aVar.fV(1, this.six.boi());
this.six.a(aVar);
}
aVar.d(2, 8, this.ruL);
aVar.fT(3, this.version);
aVar.fT(4, this.ruM);
aVar.fT(5, this.ruN);
if (this.pjK == null) {
return 0;
}
aVar.g(6, this.pjK);
return 0;
} else if (i == 1) {
if (this.six != null) {
fS = f.a.a.a.fS(1, this.six.boi()) + 0;
} else {
fS = 0;
}
fS = (((fS + f.a.a.a.c(2, 8, this.ruL)) + f.a.a.a.fQ(3, this.version)) + f.a.a.a.fQ(4, this.ruM)) + f.a.a.a.fQ(5, this.ruN);
if (this.pjK != null) {
fS += f.a.a.b.b.a.h(6, this.pjK);
}
return fS;
} else if (i == 2) {
bArr = (byte[]) objArr[0];
this.ruL.clear();
f.a.a.a.a aVar2 = new f.a.a.a.a(bArr, unknownTagHandler);
for (fS = bhp.a(aVar2); fS > 0; fS = bhp.a(aVar2)) {
if (!super.a(aVar2, this, fS)) {
aVar2.cJS();
}
}
if (this.six != null) {
return 0;
}
throw new b("Not all required fields were included: BaseResponse");
} else if (i != 3) {
return -1;
} else {
f.a.a.a.a aVar3 = (f.a.a.a.a) objArr[0];
qi qiVar = (qi) objArr[1];
int intValue = ((Integer) objArr[2]).intValue();
LinkedList IC;
int size;
f.a.a.a.a aVar4;
boolean z;
switch (intValue) {
case 1:
IC = aVar3.IC(intValue);
size = IC.size();
for (intValue = 0; intValue < size; intValue++) {
bArr = (byte[]) IC.get(intValue);
fl flVar = new fl();
aVar4 = new f.a.a.a.a(bArr, unknownTagHandler);
for (z = true; z; z = flVar.a(aVar4, flVar, bhp.a(aVar4))) {
}
qiVar.six = flVar;
}
return 0;
case 2:
IC = aVar3.IC(intValue);
size = IC.size();
for (intValue = 0; intValue < size; intValue++) {
bArr = (byte[]) IC.get(intValue);
kw kwVar = new kw();
aVar4 = new f.a.a.a.a(bArr, unknownTagHandler);
for (z = true; z; z = kwVar.a(aVar4, kwVar, bhp.a(aVar4))) {
}
qiVar.ruL.add(kwVar);
}
return 0;
case 3:
qiVar.version = aVar3.vHC.rY();
return 0;
case 4:
qiVar.ruM = aVar3.vHC.rY();
return 0;
case 5:
qiVar.ruN = aVar3.vHC.rY();
return 0;
case 6:
qiVar.pjK = aVar3.vHC.readString();
return 0;
default:
return -1;
}
}
}
}
|
[
"707194831@qq.com"
] |
707194831@qq.com
|
444d5e6dcbebb7a5049cfba9b080fc0de00f8e15
|
4abd603f82fdfa5f5503c212605f35979b77c406
|
/html/Programs/hw6-2-diff/r04921012-89-1/Diff.java
|
2cc03749b1522914c9ca7cdbbb26139fb9ffa4ff
|
[] |
no_license
|
dn070017/1042-PDSA
|
b23070f51946c8ac708d3ab9f447ab8185bd2a34
|
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
|
refs/heads/master
| 2020-03-20T12:13:43.229042
| 2018-06-15T01:00:48
| 2018-06-15T01:00:48
| 137,424,305
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,962
|
java
|
import java.util.ArrayList;
import java.util.Arrays;
public class Player implements Comparable<Player>{
private Card[] cards = new Card[5];
private String name;
private String type;
private ArrayList<count> C=new ArrayList<count>();
private Card great;
// DO NOT MODIFY THIS
public Player(String name) {
this.name = name;
}
// DO NOT MODIFY THIS
public String getName() {
return this.name;
}
// DO NOT MODIFY THIS
public void setCards(Card[] cards) {
Arrays.sort(cards);
this.cards = cards;
}
// TODO
public int compareTo(Player that) {
.
this.setType();
that.setType();
String[] typeOrder={"" highcard"", ""pair"", ""2pairs"", ""straight"", ""flush"", ""fullhouse""};
int thisI=getIndex(typeOrder,this.type);
int thatI=getIndex(typeOrder,that.type);
if (thisI>thatI)return 1;
else if (thisI==thatI){
if (this.type.equals(""straight"")||this.type.equals(""highcard"")||this.type.equals(""flush""))
return this.cards[0].compareTo(that.cards[0]);
else if(this.type.equals(""fullhouse"")){
return this.cards[0].compareTo(that.cards[0]);
}
else return this.cards[0].compareTo(that.cards[0]);
}
else return -1;
}
public void setType(){
C.add(new count(cards[0]));
for (int i =1;i<5;i++){
for (int j=0;j<C.size();j++){
if (cards[i].getFace().equals(C.get(j).val.getFace()))
C.get(j).N++;
else
C.add(new count(cards[i]));
}
}
String[] faceOrder={"" 2"", ""3"", ""4"", ""5"", ""6"", ""7"", ""8"", ""9"", ""10"", ""J"", ""Q"", ""K"",""A""};
if (C.size()==2)
type=""fullhouse"";
else if (C.size()==3)
type=""2pairs"";
else if (C.size()==4)
type=""pair"";
else{
boolean b=true;
for (int k=0;k<4;k++){
if (cards[k].getSuit()!=cards[k+1].getSuit()){
b=false;
break;
}
}
if (b)type=""flush"";
else if(getIndex(faceOrder,cards[0].getFace())==getIndex(faceOrder,cards[4].getFace())+4)type=""straight"";
else type=""highcard"";
}
}
public int getIndex(String[] ref,String s){
int I=0;
for (int i=0;i<ref.length;i++){
if (ref[i].equals(s))
I=i;
}
return I;
}
}
class count{
public Card val;
public int N;
public count(Card val){
this.val=val;
this.N=1;
}
}
|
[
"dn070017@gmail.com"
] |
dn070017@gmail.com
|
1856e228194e8298adfb784934cade3fc850bdc8
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Math/101/org/apache/commons/math/stat/inference/TestUtils_getUnknownDistributionChiSquareTest_106.java
|
756e2daf934688e3b8093ecb758f9acb79057448
|
[] |
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
| 911
|
java
|
org apach common math stat infer
collect method creat infer test instanc
perform infer test
version revis date
test util testutil
return singleton unknown distribut chi squar test unknowndistributionchisquaretest instanc creat instanc
unknown distribut chi squar test unknowndistributionchisquaretest instanc
unknown distribut chi squar test unknowndistributionchisquaretest unknown distribut chi squar test getunknowndistributionchisquaretest
unknown distribut chi squar test unknowndistributionchisquaretest
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
ea08312e026787bfca7e71c645edf7326c24c753
|
0b2bd27c57b2e75cb5f39b0b6e44dddca14b5aba
|
/org.schema/src/main/java/org/schema/AssessAction.java
|
144917191bcc988edd866a0a233d90ed52cc2e01
|
[
"Apache-2.0"
] |
permissive
|
Eduworks/ec
|
f6f9cff86bd52ab01e94da01060fd6668fe59715
|
e06ce19773b2d7a24a1c1d8f65852e9a99388b45
|
refs/heads/master
| 2023-04-27T06:06:47.571800
| 2020-12-11T14:41:54
| 2020-12-11T14:41:54
| 103,451,933
| 1
| 2
|
Apache-2.0
| 2023-04-19T03:53:14
| 2017-09-13T21:18:39
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 446
|
java
|
package org.schema;
/**
* Schema.org/AssessAction
* The act of forming one's opinion, reaction or sentiment.
*
* @author schema.org
* @class AssessAction
* @module org.schema
* @extends Action
*/
public class AssessAction extends Action {
/**
* Constructor, automatically sets @context and @type.
*
* @constructor
*/
public AssessAction() {
context = "http://schema.org/";
type = "AssessAction";
}
}
|
[
"fritz.ray@eduworks.com"
] |
fritz.ray@eduworks.com
|
eceb8fbaf590726aee76908f0c37323b10bbd9ac
|
092c76fcc6c411ee77deef508e725c1b8277a2fe
|
/hybris/bin/ext-accelerator/acceleratorcms/src/de/hybris/platform/acceleratorcms/model/CMSActionRestrictionDynamicDescription.java
|
55d054df799a05ebc412cb6c77aa418f649edc4e
|
[
"MIT"
] |
permissive
|
BaggaShivanshu2/hybris-bookstore-tutorial
|
4de5d667bae82851fe4743025d9cf0a4f03c5e65
|
699ab7fd8514ac56792cb911ee9c1578d58fc0e3
|
refs/heads/master
| 2022-11-28T12:15:32.049256
| 2020-08-05T11:29:14
| 2020-08-05T11:29:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,318
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.platform.acceleratorcms.model;
import de.hybris.platform.acceleratorcms.model.restrictions.CMSActionRestrictionModel;
import de.hybris.platform.servicelayer.model.attribute.DynamicAttributeHandler;
import de.hybris.platform.util.localization.Localization;
/**
*/
public class CMSActionRestrictionDynamicDescription implements DynamicAttributeHandler<String, CMSActionRestrictionModel>
{
@Override
public String get(final CMSActionRestrictionModel model)
{
final StringBuilder result = new StringBuilder();
final String localizedString = Localization.getLocalizedString("type.CMSActionRestriction.description.text");
result.append(localizedString == null ? "CMS Action only applies to the applicable cms components" : localizedString);
return result.toString();
}
@Override
public void set(final CMSActionRestrictionModel model, final String value)
{
throw new UnsupportedOperationException();
}
}
|
[
"xelilim@hotmail.com"
] |
xelilim@hotmail.com
|
3fed061e666f681a4a533678791133cf026fb77a
|
ed5159d056e98d6715357d0d14a9b3f20b764f89
|
/src/irvine/math/group/ShanksPhi.java
|
35987e33be030f0ee0347681d71fedb578f61843
|
[] |
no_license
|
flywind2/joeis
|
c5753169cf562939b04dd246f8a2958e97f74558
|
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
|
refs/heads/master
| 2020-09-13T18:34:35.080552
| 2019-11-19T05:40:55
| 2019-11-19T05:40:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,326
|
java
|
package irvine.math.group;
import irvine.factor.factor.Cheetah;
import irvine.factor.util.FactorSequence;
import irvine.math.z.Z;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* A special implementation for calculating a variation of the Euler totient
* function for the case of determining if two multiplicative groups are
* isomorphic.
* @author Sean A. Irvine
*/
final class ShanksPhi {
private ShanksPhi() { }
static List<Z> phi(final Z n) {
final FactorSequence fs = Cheetah.factor(n);
if (!fs.isComplete()) {
throw new UnsupportedOperationException();
}
final ArrayList<Z> res = new ArrayList<>();
for (final Z p : fs.toZArray()) {
final int e = fs.getExponent(p);
if (Z.TWO.equals(p)) {
if (e >= 2) {
res.add(Z.TWO);
if (e > 2) {
res.add(Z.ONE.shiftLeft(e - 2));
}
}
} else {
if (e > 1) {
res.add(p.pow(e - 1));
}
final FactorSequence fsp = Cheetah.factor(p.subtract(1));
if (!fsp.isComplete()) {
throw new UnsupportedOperationException();
}
for (final Z q : fsp.toZArray()) {
res.add(q.pow(fsp.getExponent(q)));
}
}
}
Collections.sort(res);
return res;
}
}
|
[
"sairvin@gmail.com"
] |
sairvin@gmail.com
|
90ec773c4f792f5421a4acfa0578795b7178ca37
|
0ad51dde288a43c8c2216de5aedcd228e93590ac
|
/src/com/vmware/converter/GuestRegistryKeyAlreadyExists.java
|
f04c5c3c1a52bb06f7960f2419ecc21caeee763c
|
[] |
no_license
|
YujiEda/converter-sdk-java
|
61c37b2642f3a9305f2d3d5851c788b1f3c2a65f
|
bcd6e09d019d38b168a9daa1471c8e966222753d
|
refs/heads/master
| 2020-04-03T09:33:38.339152
| 2019-02-11T15:19:04
| 2019-02-11T15:19:04
| 155,151,917
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,934
|
java
|
/**
* GuestRegistryKeyAlreadyExists.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.vmware.converter;
public class GuestRegistryKeyAlreadyExists extends com.vmware.converter.GuestRegistryKeyFault implements java.io.Serializable {
public GuestRegistryKeyAlreadyExists() {
}
public GuestRegistryKeyAlreadyExists(
com.vmware.converter.LocalizedMethodFault faultCause,
com.vmware.converter.LocalizableMessage[] faultMessage,
long windowsSystemErrorCode,
java.lang.String keyName) {
super(
faultCause,
faultMessage,
windowsSystemErrorCode,
keyName);
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof GuestRegistryKeyAlreadyExists)) return false;
GuestRegistryKeyAlreadyExists other = (GuestRegistryKeyAlreadyExists) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj);
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(GuestRegistryKeyAlreadyExists.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:vim25", "GuestRegistryKeyAlreadyExists"));
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
[
"yuji_eda@dwango.co.jp"
] |
yuji_eda@dwango.co.jp
|
20ff00c7ea93f4ee5270e6205ece05efa17fd387
|
cba7f24d33478cd1f12d68e3f9c371eac78e2e91
|
/src/main/java/com/guangzhou/college/common/utils/AesUtil.java
|
25ff9620b35322ffe7ec4453c49a1643938a4f8b
|
[] |
no_license
|
smartluobo/guangzhou-college
|
a3923c863f5ea9cfb6352a0e28d94d7cf464fd67
|
e6ed7100100a34bbf996ec5203fc90701a79357d
|
refs/heads/master
| 2023-02-13T18:40:28.799202
| 2021-01-12T05:59:38
| 2021-01-12T05:59:38
| 296,090,559
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,739
|
java
|
package com.guangzhou.college.common.utils;
/**
* @author: 云
* @date: 2020/5/11 14:27
* @version: 1.0
*/
import org.apache.commons.codec.binary.Base64;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.*;
import java.security.spec.InvalidParameterSpecException;
public class AesUtil {
static {
//BouncyCastle是一个开源的加解密解决方案,主页在http://www.bouncycastle.org/
Security.addProvider(new BouncyCastleProvider());
}
/**
* AES解密
*
* @param data //密文,被加密的数据
* @param key //秘钥
* @param iv //偏移量
* @param encodingFormat //解密后的结果需要进行的编码
* @return
* @throws Exception
*/
public static String decrypt(String data, String key, String iv, String encodingFormat) throws Exception {
//被加密的数据
byte[] dataByte = Base64.decodeBase64(data);
//加密秘钥
byte[] keyByte = Base64.decodeBase64(key);
//偏移量
byte[] ivByte = Base64.decodeBase64(iv);
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
parameters.init(new IvParameterSpec(ivByte));
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);// 初始化
byte[] resultByte = cipher.doFinal(dataByte);
if (null != resultByte && resultByte.length > 0) {
String result = new String(resultByte, encodingFormat);
return result;
}
return null;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidParameterSpecException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (InvalidAlgorithmParameterException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
}
|
[
"935984143@qq.com"
] |
935984143@qq.com
|
64cd2d3bf37536c6194bceb4efda2162e188510d
|
54d16bcc48f1ae7c4a1d5518c1fd1392a5e37df3
|
/AskCody/src/service/CD_ClothService.java
|
4f03eba52e10553ed2c517c63cc0f33d7d4864d2
|
[] |
no_license
|
daniel0458/team2project
|
88c8d8483fb52515b6a68fe7ef3ecdc2875de4cd
|
de0f0b4dad233c2a2a40858604ebfa0b834a9592
|
refs/heads/master
| 2020-07-26T20:20:47.100743
| 2019-09-27T03:53:24
| 2019-09-27T03:53:24
| 208,755,833
| 0
| 1
| null | 2019-09-20T01:39:40
| 2019-09-16T09:03:23
|
Java
|
UTF-8
|
Java
| false
| false
| 278
|
java
|
package service;
import java.util.List;
import vo.CD_ClothVO;
import vo.SuggestionVO;
public interface CD_ClothService {
List <CD_ClothVO> loadCoordi(int coordi_id);
int addCoordi(CD_ClothVO vo);
int deleteCoordi(int coordi_id);
List<SuggestionVO> loadSuggestion();
}
|
[
"queen.minhee@gmail.com"
] |
queen.minhee@gmail.com
|
2170ec80a5e197fb140c5b763e54cd39408165c7
|
13db4a1d034aa9dc3b97ba5a4c758eb37ef254df
|
/opserv-sp-batch-metrics/src/main/java/com/cognizant/opserv/sp/common/MetricConstants.java
|
bc129be09e28c178214a00dc3267ebf07c15f0fe
|
[] |
no_license
|
deepthikamaraj/javaCode
|
3436c539c0abcaeb3fbec87ccd1b79b543dffbc6
|
7634d01d5553496c7f5549382651ae63f371f8cc
|
refs/heads/master
| 2021-04-06T08:54:22.184740
| 2018-03-13T09:57:40
| 2018-03-13T09:57:40
| 125,029,394
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,164
|
java
|
package com.cognizant.opserv.sp.common;
/**
* ****************************************************************************.
*
* @class MetricConstants
* @author Cognizant Technology Solutions
* @version OpServ 3.0
* @since 30/03/2016
* ***************************************************************************
*/
public class MetricConstants {
/** The Constant MTR_TRIGGER_QUERY. */
public static final String MTR_TRIGGER_QUERY = "select myTMtrTrigger.trigger_id, myTMtrTrigger.feature_id, myTMtrTrigger.type_id from t_mtr_trigger myTMtrTrigger " +
" where myTMtrTrigger.trigger_id = ? AND myTMtrTrigger.tenant_id = ? AND myTMtrTrigger.active_flag = 'Y'";
/** The Constant MTR_DATA_QUERY. */
public static final String MTR_DATA_QUERY = "select mtr.mtr_id,mtr.mtr_name,mtr.min_value,mtr.max_value,expr.mtr_expr,confg.child_rollup_flag " +
" from t_mtr mtr inner join t_algmnt_sales_team alst on alst.algmnt_id = mtr.algmnt_id AND alst.buss_unit_id = mtr.buss_unit_id AND alst.sales_team_id = mtr.sales_team_id " +
" inner join t_mtr_config confg on mtr.mtr_id = confg.mtr_id inner join t_mtr_expr expr on mtr.mtr_id = expr.mtr_id " +
" inner join t_mtr_exec_config execConfg on mtr.mtr_id = execConfg.mtr_id " +
" where alst.algmnt_id = :algId and alst.buss_unit_id = :buId and alst.sales_team_id = :stId and confg.sales_hier_id = :shId " +
" and expr.expr_type IN (:predCal) and execConfg.trigger_id = :triggerId and mtr.tenant_id = :tenantId " +
" and mtr.active_flag=execConfg.active_flag and mtr.active_flag = confg.active_flag and mtr.active_flag = 'Y' " +
" group by mtr.mtr_id order by mtr.mtr_name";
/** The Constant SP_COUNT_QUERY. */
public static final String SP_COUNT_QUERY = "select count(*) from t_sales_pos myTSalesPos where myTSalesPos.active_flag = 'Y'" +
" and myTSalesPos.sales_pos_id = ? and myTSalesPos.tenant_id =?";
/** The Constant PREDICTIVE. */
public static final Character PREDICTIVE = 'P';
/** The Constant CALCULATIVE. */
public static final Character CALCULATIVE = 'C';
/** The Constant PRNT_SP_ID. */
public static final String PRNT_SP_ID = "prntSpId";
/** The Constant SP_IDS. */
public static final String SP_IDS = "spIds";
/** The Constant MTR_ID. */
public static final String MTR_ID = "mtrId";
/** The Constant FEATURE_ID. */
public static final String TRIGGER_ID = "triggerId";
/** The Constant FEATURE_ID. */
public static final String FEATURE_ID = "featureId";
/** The Constant TYPE_ID. */
public static final String TYPE_ID = "typeId";
/** The Constant TENANT_ID. */
public static final String TENANT_ID = "tenantId";
/** The Constant TENANT_ID. */
public static final String SUBSCRIBER_ID = "subscriberId";
/** The Constant POSTAL_CD. */
public static final String POSTAL_CD = "postalCd";
/** The Constant ALG_ID. */
public static final String ALG_ID = "algId";
/** The Constant BU_ID. */
public static final String BU_ID = "buId";
/** The Constant ST_ID. */
public static final String ST_ID = "stId";
/** The Constant SH_ID. */
public static final String SH_ID = "shId";
/** The Constant SP_ID. */
public static final String SP_ID = "spId";
/** The Constant EXEC_TYPE. */
public static final String EXEC_TYPE = "execType";
/** The Constant USER_ID. */
public static final String USER_ID = "userId";
/** The Constant VALUES. */
public static final String VALUES = "values";
/** The Constant COUNT. */
public static final String COUNT = "count(*)";
/** The Constant PREDCAL. */
public static final String PREDCAL = "predCal";
/** The Constant COLUMN_TRIGGER_ID. */
public static final String COLUMN_TRIGGER_ID = "trigger_id";
/** The Constant COLUMN_FEATURE_ID. */
public static final String COLUMN_FEATURE_ID = "feature_id";
/** The Constant COLUMN_TYPE_ID. */
public static final String COLUMN_TYPE_ID = "type_id";
/** The Constant ERROR. */
public static final String ERROR = "Error";
/** The Constant STORE_PROC. */
public static final String STORE_PROC = "storeProc";
/** The Constant TENANT_KEY. */
public static final String TENANT_KEY = "tenantKey";
}
|
[
"deepthi.k2@cognizant.com"
] |
deepthi.k2@cognizant.com
|
f888180e74b45b04996afaf717f78446c3ae78b6
|
eb9f655206c43c12b497c667ba56a0d358b6bc3a
|
/java/typeMigration/testData/inspections/guava/migrateMethodAsChainQualifier.java
|
f571e0abf41006a2f929b32c284edffd429c2934
|
[
"Apache-2.0"
] |
permissive
|
JetBrains/intellij-community
|
2ed226e200ecc17c037dcddd4a006de56cd43941
|
05dbd4575d01a213f3f4d69aa4968473f2536142
|
refs/heads/master
| 2023-09-03T17:06:37.560889
| 2023-09-03T11:51:00
| 2023-09-03T12:12:27
| 2,489,216
| 16,288
| 6,635
|
Apache-2.0
| 2023-09-12T07:41:58
| 2011-09-30T13:33:05
| null |
UTF-8
|
Java
| false
| false
| 394
|
java
|
import com.google.common.collect.FluentIterable;
import java.util.ArrayList;
public class Test {
public FluentIterable<String> create() {
return FluentIterable.from(new ArrayList<String>()).transform(s -> s + s);
}
public FluentIterable<String> create2() {
return create().limit(12);
}
public FluentI<caret>terable<String> create3() {
return create2().limit(12);
}
}
|
[
"dmitry.batkovich@jetbrains.com"
] |
dmitry.batkovich@jetbrains.com
|
cb8a6bdd90fc90312d7add26e0c8870e186cb22c
|
eda3b39d84ff1c36fb1b9cbec7346c55e88d18ac
|
/src/com/nis/cdc/service/CtgSys013SerialService.java
|
7d94c6a7e5719638708357435e5465b889a48cd1
|
[] |
no_license
|
caofujun/lqt
|
cea1defccf3e62886b2472369504d931b3af7cc4
|
ae3e93074304243198aa0c631c0eca4541dbd389
|
refs/heads/master
| 2021-07-07T03:40:29.331414
| 2017-10-03T03:12:22
| 2017-10-03T03:12:22
| 105,349,611
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 616
|
java
|
package com.nis.cdc.service;
import com.nis.cdc.entity.CtgSys013Serial;
import com.nis.comm.entity.MyPage;
import java.util.List;
import org.springframework.stereotype.Component;
@Component
public interface CtgSys013SerialService {
void save(CtgSys013Serial arg0);
void delete(String arg0);
void update(CtgSys013Serial arg0);
CtgSys013Serial get(String arg0);
MyPage<CtgSys013Serial> a(CtgSys013Serial arg0);
List<CtgSys013Serial> getAll();
CtgSys013Serial getAUnusedRecord();
String x(String arg0);
void updateUnusedRecord(String arg0, String arg1, String arg2);
String isSNUsed(String arg0);
}
|
[
"cfj00707@vipmro.net"
] |
cfj00707@vipmro.net
|
4436f977e0a913d56ec33242c11703892232d4e9
|
0d53dfaea68f22fc4312f18a83885876f0220dbc
|
/src/main/java/com/yearn/life/zto/HttpRequestFormat.java
|
0c52d5406180fbc0cf28f9b06d7351b4827b4148
|
[] |
no_license
|
438483836/Yearn
|
b6e5a136da9df5c37560fccf465ae900938958e2
|
22388f4e724cc7cc70fe38f042d8e3d3b132634f
|
refs/heads/master
| 2020-03-26T16:03:45.612998
| 2018-11-23T03:58:51
| 2018-11-23T03:58:51
| 145,077,474
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,667
|
java
|
package com.yearn.life.zto;
import com.alibaba.fastjson.JSONObject;
import com.yearn.life.utils.JsonUtil;
import com.yearn.life.utils.MD5Util;
import com.yearn.life.zto.httpSortResultUtil.SortResultEntity;
import java.util.HashMap;
import java.util.Map;
public class HttpRequestFormat {
//开关流水线的请求
public static String switchLine(String status){
long switchTime=System.currentTimeMillis();
String sortMode="sorting";
//String pipeLine= ParamConfigCache.getPipeline();
JSONObject data = new JSONObject();
//data.put("pipeLine",pipeLine);
data.put("switchTime",switchTime);
data.put("status",status);
data.put("sortMode",sortMode);
String data_digest= MD5Util.encrypt(data.toString());
String msg_type="WCS_PIPELINE_STATUS";
String company_id="zto";
return "data="+data+"&data_digest="+data_digest+"&msg_type="+msg_type+"&company_id="
+company_id;
}
//校验时间的请求
public static String timeVerify(){
return "data=null&data_digest=&msg_type=ZTO_INSPECTION_TIME&company_id=zto";
}
//端口配置信息请求同步
public static String portSync(){
Map<String,String> map = new HashMap<>();
map.put("data","57730-001");
map.put("data_digest","");
map.put("msg_type","WCS_SORTING_SETTING");
map.put("company_id","zto");
String digestContent= JsonUtil.toJsonByObj(map);
String digestedContent=MD5Util.encrypt(digestContent);
String sendContent="data={\"".concat(map.get("data")).concat("\"}&data_digest=").concat(digestedContent)
.concat("&msg_type=WCS_SORTING_SETTING&company_id=zto");
return sendContent;
}
//一段码省市区请求
public static String oneMarkProvince(){
Map<String,String> map = new HashMap<>();
//map.put("data",ParamConfigCache.getPipeline());
map.put("data_digest","");
map.put("msg_type","GET_LINE_INFO");
map.put("company_id","zto");
String digestContent= JsonUtil.toJsonByObj(map);
String digestedContent=MD5Util.encrypt(digestContent);
String sendContent="data={\"".concat(map.get("data")).concat("\"}&data_digest=").concat(digestedContent)
.concat("&msg_type=WCS_SORTING_SETTING&company_id=zto");
return sendContent;
}
//面单规则请求
public static String billRule(){
String sendContent="data=null".concat("&data_digest=");
sendContent=sendContent.concat("&msg_type=GET_BILL_RULE&company_id=zto");
return sendContent;
}
//分拣信息请求
/*public static String sortInfo(SortInfoEntity sortInfoEntity){
String digestContent= JsonUtil.toJsonByObj(sortInfoEntity);
String digestContentMD5=MD5Util.encrypt(digestContent);
String sendContent="data=".concat(digestContent).concat("&data_digest=").concat(digestContentMD5);
sendContent=sendContent.concat("&msg_type=WCS_SORTING_INFO&company_id=zto");
return sendContent;
}*/
//分拣结果信息
/*public static String sortResult(SortResultEntity sortResultEntity){
String digestContent= JsonUtil.toJsonByObj(sortResultEntity);
String digestContentMD5=MD5Util.encrypt(digestContent);
String sendContent="data=".concat(digestContent).concat("&data_digest=").concat(digestContentMD5);
sendContent=sendContent.concat("&msg_type=WCS_SORTING_RESULT&company_id=zto");
return sendContent;
}*/
//请求快速补码信息
public static String complementRequest(SortResultEntity sortResultEntity){
String digestContent= JsonUtil.toJsonByObj(sortResultEntity);
String digestContentMD5=MD5Util.encrypt(digestContent);
String sendContent="data=".concat(digestContent).concat("&data_digest=").concat(digestContentMD5);
sendContent=sendContent.concat("&msg_type=WCS_FOR_PACKAGE&company_id=zto");
return sendContent;
}
//请求包牌打印信息
/*public static String packagePrint(PackagePrintEntity packagePrintEntity){
String digestContent= JsonUtil.toJsonByObj(packagePrintEntity);
String digestContentMD5=MD5Util.encrypt(digestContent);
String sendContent="data=".concat(digestContent).concat("&data_digest=").concat(digestContentMD5);
sendContent=sendContent.concat("&msg_type=WCS_BAG_PRINTING&company_id=zto");
return sendContent;
}*/
//集包绑定信息
/*public static String packageBind(PackageBindEntity packageBindEntity){
String digestContent= JsonUtil.toJsonByObj(packageBindEntity);
String digestContentMD5=MD5Util.encrypt(digestContent);
String sendContent="data=".concat(digestContent).concat("&data_digest=").concat(digestContentMD5);
sendContent=sendContent.concat("&msg_type=WCS_BAG_BIND&company_id=zto");
return sendContent;
}*/
//分拣口和集包绑定数据查询
public static String packageCodeInfo(){
Map<String,String> map = new HashMap<>();
//map.put("data",ParamConfigCache.getPipeline());
map.put("data_digest","");
map.put("msg_type","GET_BAGCODE_INFO");
map.put("company_id","zto");
String digestContent= JsonUtil.toJsonByObj(map);
String digestedContent=MD5Util.encrypt(digestContent);
String sendContent="data={\"".concat(map.get("data")).concat("\"}&data_digest=").concat(digestedContent)
.concat("&msg_type=WCS_SORTING_SETTING&company_id=zto");
return sendContent;
}
}
|
[
"438483836@qq.com"
] |
438483836@qq.com
|
4669ff40e0eef087c54203eddf862db77d43fc96
|
5b7c08bb8df21a223dfba86ae764548c1642e353
|
/src/com/company/chun/week11/프로그래머스_보석쇼핑.java
|
390554643e68db866d7cf567a6e93a834f2624ff
|
[] |
no_license
|
java-algorism/algorism-study
|
686d489eea313ce78afd0f775f059b23899dd7c6
|
9c58b184f443bfcf81ad53ccda9db0538cd37652
|
refs/heads/master
| 2023-03-29T18:03:41.769433
| 2021-04-06T10:31:28
| 2021-04-06T10:31:28
| 324,068,914
| 1
| 5
| null | 2021-04-02T03:30:41
| 2020-12-24T04:56:01
|
Java
|
UTF-8
|
Java
| false
| false
| 874
|
java
|
import java.util.*;
class Solution {
public int[] solution(String[] gems) {
Set<String> gemSet = new HashSet<>(Arrays.asList(gems));
Map<String, Integer> map = new HashMap<>();
Queue<String> queue = new LinkedList<>();
int tmpStartIdx = 0;
int startIdx = 0;
int length = Integer.MAX_VALUE;
for(String gem : gems){
map.merge(gem, 1, Integer::sum);
queue.offer(gem);
while(map.get(queue.peek()) > 1){
map.put(queue.peek(), map.get(queue.peek())-1);
queue.poll();
tmpStartIdx++;
}
if(map.size() == gemSet.size() && length > queue.size()){
length = queue.size();
startIdx = tmpStartIdx;
}
}
return new int[]{startIdx+1, startIdx + length};
}
}
|
[
"cnsth123@gmail.com"
] |
cnsth123@gmail.com
|
7148aef8d3ec7ff256c02f437cf446a4ec377557
|
bf41ce542547444fc5828738c9d81dbc046a52f4
|
/web/Project1/JDBC/jdbc3/jdbc/src/cn/itcast/jdbc/TxTest.java
|
aba6fcdbe938275f2e2ec13adbce62f11dfb6535
|
[] |
no_license
|
wsx180808/-
|
b63debdb52a55c952d0dcef4156cefaedcedc4c5
|
22bb972d86166f9b2f51dff1b7dd92f957cc0f48
|
refs/heads/master
| 2021-07-25T10:16:19.838344
| 2019-12-04T14:55:42
| 2019-12-04T14:55:42
| 225,890,339
| 0
| 0
| null | 2020-10-13T17:58:18
| 2019-12-04T14:48:15
|
HTML
|
GB18030
|
Java
| false
| false
| 1,240
|
java
|
package cn.itcast.jdbc;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
*
* 2008-12-7
*
* @author <a href="mailto:liyongibm@gmail.com">liyong</a>
*
*/
public class TxTest {
/**
* @param args
* @throws SQLException
*/
public static void main(String[] args) throws SQLException {
test();
}
static void test() throws SQLException {
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
conn = JdbcUtils.getConnection();
conn.setAutoCommit(false);
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
st = conn.createStatement();
String sql = "update user set money=money-10 where id=1";
st.executeUpdate(sql);
sql = "select money from user where id=2";
rs = st.executeQuery(sql);
float money = 0.0f;
if (rs.next()) {
money = rs.getFloat("money");
}
if (money > 400)
throw new RuntimeException("已经超过最大值!");
sql = "update user set money=money+10 where id=2";
st.executeUpdate(sql);
conn.commit();
} catch (SQLException e) {
if (conn != null)
conn.rollback();
throw e;
} finally {
JdbcUtils.free(rs, st, conn);
}
}
}
|
[
"123456"
] |
123456
|
71aa69b1263d6b6702313e26a13db2c6c63e2e97
|
adc596a481ab7eeb589942ddb0d38eb026a92f92
|
/src/edu/pku/test/Regex.java
|
fd5de1c4b56a8b08e4aeda9aa313f75b09e1dec8
|
[] |
no_license
|
SteveChe/protege-owl-src-3.4.8
|
dadfddd8c8d9269decc05de47084c7425509ac7e
|
f56d3400345725991a6164d3678a9717d4c8456e
|
refs/heads/master
| 2016-09-08T01:54:33.269768
| 2013-06-28T06:11:09
| 2013-06-28T06:11:09
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 726
|
java
|
package edu.pku.test;
import java.util.regex.Pattern;
public class Regex {
public static void main(String[] args) {
// // 生成一个Pattern,同时编译一个正则表达式
// Pattern p = Pattern.compile("[/]+");
//
// //用Pattern的split()方法把字符串按"/"分割
// String[] result = p.split(
// "Kevin has seen《LEON》seveal times,because it is a good film."
// +"/ 凯文已经看过《这个杀手不太冷》几次了,因为它是一部"
// +"好电影。/名词:凯文。");
//
// for (int i=0; i<result.length; i++)
// System.out.println(result[i]);
String str = "[a[b[cd]e]f]";
System.out.println(str.replace("[", "").replace("]", ""));
}
}
|
[
"chexinshuai669@gmail.com"
] |
chexinshuai669@gmail.com
|
aeb37901c4d661903e48a8e2bf730f0acfbcd4bd
|
15274f5065c785297baba29934a1bc6052f64e29
|
/hw-gae-server/src/main/java/hu/hw/cloud/server/controller/v1/RoomController.java
|
2823c200e9be7e28f7d88ad18c38396dd6ea6850
|
[
"Apache-2.0"
] |
permissive
|
LetsCloud/hw-gae
|
e5196cc9f1c7744c341e6d34fda2bfc0100d82de
|
e4a55f8fe152ad588156942ddc28e852faf8ebcd
|
refs/heads/master
| 2018-11-04T03:43:23.338526
| 2018-10-06T20:36:14
| 2018-10-06T20:36:14
| 115,553,009
| 0
| 1
|
Apache-2.0
| 2018-10-06T20:36:15
| 2017-12-27T19:55:26
|
Java
|
UTF-8
|
Java
| false
| false
| 5,454
|
java
|
/**
*
*/
package hu.hw.cloud.server.controller.v1;
import static hu.hw.cloud.shared.api.ApiPaths.SpaV1.ROOT;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.QueryParam;
import static hu.hw.cloud.shared.api.ApiParameters.HOTEL_KEY;
import static hu.hw.cloud.shared.api.ApiParameters.ONLY_ACTIVE;
import static hu.hw.cloud.shared.api.ApiParameters.ROOM_KEY;
import static hu.hw.cloud.shared.api.ApiParameters.ROOM_STATUS;
import static hu.hw.cloud.shared.api.ApiPaths.PATH_WEBSAFEKEY;
import static hu.hw.cloud.shared.api.ApiPaths.SpaV1.ROOM;
import static hu.hw.cloud.shared.api.ApiPaths.SpaV1.AVAILABLE_ON_DATE;
import static hu.hw.cloud.shared.api.ApiPaths.SpaV1.STATUS_CHANGE;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.POST;
import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import hu.hw.cloud.server.entity.hotel.Room;
import hu.hw.cloud.server.service.RoomService;
import hu.hw.cloud.shared.cnst.RoomStatus;
import hu.hw.cloud.shared.dto.filter.RoomStatusFilterDto;
import hu.hw.cloud.shared.dto.hotel.RoomDto;
import hu.hw.cloud.shared.exception.RestApiException;
/**
* @author CR
*
*/
@RestController
@RequestMapping(value = ROOT + ROOM, produces = MediaType.APPLICATION_JSON_VALUE)
public class RoomController extends HotelChildController<Room, RoomDto> {
private static final Logger logger = LoggerFactory.getLogger(RoomController.class);
private final RoomService roomService;
private final ModelMapper modelMapper;
@Autowired
RoomController(RoomService roomService, ModelMapper modelMapper) {
super(Room.class, roomService, modelMapper);
logger.info("RoomController()");
this.roomService = roomService;
this.modelMapper = modelMapper;
}
@Override
protected RoomDto createDto(Room entity) {
RoomDto dto = modelMapper.map(entity, RoomDto.class);
return dto;
}
@RequestMapping(method = GET)
public ResponseEntity<List<RoomDto>> getByHotel(@QueryParam(HOTEL_KEY) String hotelKey,
@QueryParam(ONLY_ACTIVE) Boolean onlyActive) {
logger.info("RoomController().getByHotel()");
if (onlyActive) {
logger.info("RoomController().getByHotel()->onlyActive");
List<RoomDto> result = new ArrayList<RoomDto>();
for (Room room : roomService.getActiveRoomsByHotel(hotelKey)) {
logger.info("RoomController().getByHotel()->onlyActive->room.getCode()=" + room.getCode());
result.add(modelMapper.map(room, RoomDto.class));
}
return new ResponseEntity<List<RoomDto>>(result, OK);
} else {
return getChildren(hotelKey);
}
}
@Override
@RequestMapping(method = GET, value = PATH_WEBSAFEKEY)
public ResponseEntity<RoomDto> get(@PathVariable String webSafeKey) throws RestApiException {
return super.get(webSafeKey);
}
@Override
@RequestMapping(method = POST)
public ResponseEntity<RoomDto> saveOrCreate(@RequestBody RoomDto dto) throws RestApiException {
logger.info("RoomController()->dto=" + dto);
return super.saveOrCreate(dto);
}
@Override
@RequestMapping(method = DELETE, value = PATH_WEBSAFEKEY)
@ResponseStatus(HttpStatus.OK)
public void delete(@PathVariable String webSafeKey) throws RestApiException {
super.delete(webSafeKey);
}
@RequestMapping(method = GET, value = STATUS_CHANGE)
public ResponseEntity<RoomDto> changeStatus(@QueryParam(ROOM_KEY) String roomKey,
@QueryParam(ROOM_STATUS) RoomStatus roomStatus) {
Room room;
try {
room = roomService.changeStatus(roomKey, roomStatus);
RoomDto roomDto = modelMapper.map(room, RoomDto.class);
// LOGGER.info("changeStatus()->roomDto=" + roomDto);
return new ResponseEntity<RoomDto>(roomDto, OK);
} catch (Throwable e) {
e.printStackTrace();
return new ResponseEntity<RoomDto>(NOT_FOUND);
}
}
// public List<RoomDto> getAvailableRoomsByHotel(@QueryParam(HOTEL_KEY)
// String hotelKey,
// @QueryParam(DATE) @DateTimeFormat(iso = ISO.DATE) Date date, @RequestBody
// RoomStatusFilterDto filterDto) {
@RequestMapping(method = POST, value = AVAILABLE_ON_DATE)
public ResponseEntity<List<RoomDto>> getAvailableRoomsByHotel(@RequestBody RoomStatusFilterDto filterDto) {
List<Room> allRooms = roomService.getAvailableRoomsByHotelOnDateWithReservations(filterDto.getHotelKey(),
filterDto.getDate());
allRooms = Room.filterByRoomStatus(allRooms, filterDto);
List<RoomDto> roomDtos = new ArrayList<RoomDto>();
for (Room room : allRooms)
roomDtos.add(modelMapper.map(room, RoomDto.class));
return new ResponseEntity<List<RoomDto>>(roomDtos, OK);
}
}
|
[
"csernikr@gmail.com"
] |
csernikr@gmail.com
|
c2d29a05784d54aab4eff37b95146c240fad4309
|
6b4125b3d69cbc8fc291f93a2025f9f588d160d3
|
/components/common/src/test/java/org/limewire/util/BufferUtilsTest.java
|
9707104c6633e0c2bb17662566c290db8e57b565
|
[] |
no_license
|
mnutt/limewire5-ruby
|
d1b079785524d10da1b9bbae6fe065d461f7192e
|
20fc92ea77921c83069e209bb045b43b481426b4
|
refs/heads/master
| 2022-02-10T12:20:02.332362
| 2009-09-11T15:47:07
| 2009-09-11T15:47:07
| 89,669
| 2
| 3
| null | 2022-01-27T16:18:46
| 2008-12-12T19:40:01
|
Java
|
UTF-8
|
Java
| false
| false
| 3,727
|
java
|
package org.limewire.util;
import java.nio.ByteBuffer;
import java.util.Random;
import junit.framework.Test;
public class BufferUtilsTest extends BaseTestCase {
public BufferUtilsTest(String name) {
super(name);
}
public static Test suite() {
return buildTestSuite(BufferUtilsTest.class);
}
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}
public void testDelete()throws Exception {
byte[] data = data(100);
byte[] copy = new byte[100];
System.arraycopy(data, 0, copy, 0, 100);
ByteBuffer buf = ByteBuffer.wrap(copy).compact();
assertEquals(100, buf.position());
for(int i = 0; i < 100; i++)
assertEquals("wrong data at: " + i, buf.get(i), data[i]);
assertEquals(0, BufferUtils.delete(buf, 1));
assertEquals(99, buf.position());
for(int i = 0; i < 99; i++)
assertEquals("wrong data at: " + i, buf.get(i), data[i+1]);
assertEquals(51, BufferUtils.delete(buf, 150));
assertEquals(0, buf.position());
data = data(100);
buf = ByteBuffer.wrap(data).compact();
assertEquals(0, BufferUtils.delete(buf, 100));
assertEquals(0, buf.position());
}
public void testTransfer() throws Exception {
byte[] srcData = data(100);
ByteBuffer src = buffer(srcData).compact();
ByteBuffer dst = ByteBuffer.allocate(100);
assertEquals(100, src.position());
assertEquals(100, BufferUtils.transfer(src, dst));
assertEquals(0, src.position());
assertEquals(srcData, dst.array());
}
public void testTransferNoFlip() throws Exception {
byte[] srcData = data(100);
ByteBuffer src = buffer(srcData);
ByteBuffer dst = ByteBuffer.allocate(100);
assertTrue(src.hasRemaining());
assertEquals(100, BufferUtils.transfer(src, dst, false));
assertFalse(src.hasRemaining());
assertEquals(srcData, dst.array());
}
public void testReadAll() throws Exception {
byte[] bufferData = data(100);
ByteBuffer bufferSrc = buffer(bufferData).compact();
byte[] channelData = data(100);
ByteBuffer channelBuf = buffer(channelData);
ReadBufferChannel channelSrc = new ReadBufferChannel(channelBuf);
ByteBuffer dst = ByteBuffer.allocate(500);
assertEquals(100, bufferSrc.position());
assertEquals(0, BufferUtils.readAll(bufferSrc, channelSrc, dst));
assertEquals(0, bufferSrc.position());
assertFalse(channelBuf.hasRemaining());
assertEquals(bufferData, dst.array(), 0, 100);
assertEquals(channelData, dst.array(), 100, 100);
assertEquals(0, BufferUtils.readAll(bufferSrc, channelSrc, dst));
assertEquals(0, bufferSrc.position());
assertFalse(channelBuf.hasRemaining());
assertEquals(bufferData, dst.array(), 0, 100);
assertEquals(channelData, dst.array(), 100, 100);
channelData = data(100);
channelSrc = new ReadBufferChannel(buffer(channelData), true);
assertEquals(-1, BufferUtils.readAll(bufferSrc, channelSrc, dst));
assertEquals(channelData, dst.array(), 200, 100);
}
private ByteBuffer buffer(byte[] b) {
byte[] copy = new byte[b.length];
System.arraycopy(b, 0, copy, 0, copy.length);
ByteBuffer buf = ByteBuffer.wrap(copy);
return buf;
}
private byte[] data(int len) {
Random rnd = new Random();
byte[] b = new byte[len];
rnd.nextBytes(b);
return b;
}
}
|
[
"michael@nuttnet.net"
] |
michael@nuttnet.net
|
255a2b6eab7cbd71863f516e14b7968f33dd34e1
|
447520f40e82a060368a0802a391697bc00be96f
|
/apks/playstore_apps/ro_ing_mobile_banking_android_activity/source/ヌ.java
|
6583bb12d21b3463ba01ed67eb258891a21619ee
|
[
"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
| 2,508
|
java
|
import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public final class ヌ
{
public ヌ() {}
public static String encodeURIComponent(String paramString)
{
try
{
String str = URLEncoder.encode(paramString, "UTF-8").replaceAll("\\+", "%20").replaceAll("\\%21", "!").replaceAll("\\%27", "'").replaceAll("\\%28", "(").replaceAll("\\%29", ")").replaceAll("\\%7E", "~");
return str;
}
catch (UnsupportedEncodingException localUnsupportedEncodingException)
{
for (;;) {}
}
return paramString;
}
private static String getIt(String paramString)
{
if (paramString.substring(0, 24).lastIndexOf('/') != 23) {
return "";
}
return paramString.substring(0, 23);
}
private static String ruthless(String paramString)
{
try
{
paramString = MessageDigest.getInstance("MD5").digest(paramString.getBytes());
StringBuffer localStringBuffer = new StringBuffer();
int i = 0;
while (i < paramString.length)
{
localStringBuffer.append(Integer.toHexString(paramString[i] & 0xFF | 0x100).substring(1, 3));
i += 1;
}
paramString = localStringBuffer.toString();
return paramString;
}
catch (NoSuchAlgorithmException paramString)
{
for (;;) {}
}
return null;
}
public static boolean urlIscomplete(String paramString)
{
Log.d("---------urlIscomplete--------------------URL-->", g.getBaseSecureUrl());
if (("data:text/html,%3Chtml%3E%3Cbody%3E%3C/body%3E%3C/html%3E".equalsIgnoreCase(paramString)) || ("data:text/html,<html><body></body></html>".equalsIgnoreCase(paramString))) {
return true;
}
if ("inapp://pushStatus".equalsIgnoreCase(paramString)) {
return true;
}
if ("inapp://atmlocator".contains(paramString)) {
return true;
}
if (paramString.contains("inapp://atmlocator")) {
return true;
}
if (paramString.startsWith("inapp://shareIban?")) {
return true;
}
if (paramString.startsWith("inapp://camera?")) {
return true;
}
if ((paramString.startsWith("mailto:")) || (paramString.startsWith("tel:"))) {
return true;
}
paramString = ruthless(getIt(paramString));
if (paramString != null) {
return paramString.equalsIgnoreCase("efe51c77e504231c8f439959090b7067");
}
return false;
}
}
|
[
"antal.micky@yahoo.com"
] |
antal.micky@yahoo.com
|
634d8f8d5d8bfe07d9462cc2a5cafd5e767a2959
|
bdcb8ec7e4e7e5f16dd6711d55cef6dfa223e8a2
|
/src/org/anddev/andengine/examples/ParticleSystemCoolExample.java
|
04ab5947bdc6527a7d4c6322fa35f61f87e8eb6f
|
[] |
no_license
|
Midnightshao/andengineexamples
|
cc3476091b985b9f89e9d50b0fc6f84dbb31fb41
|
e3e41f831ddd1b12309b9292c8f1d97d15da2331
|
refs/heads/master
| 2020-12-24T21:12:10.698953
| 2016-04-23T13:59:15
| 2016-04-23T13:59:28
| 56,386,427
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,397
|
java
|
package org.anddev.andengine.examples;
import javax.microedition.khronos.opengles.GL10;
import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.particle.ParticleSystem;
import org.anddev.andengine.entity.particle.emitter.PointParticleEmitter;
import org.anddev.andengine.entity.particle.initializer.AccelerationInitializer;
import org.anddev.andengine.entity.particle.initializer.ColorInitializer;
import org.anddev.andengine.entity.particle.initializer.RotationInitializer;
import org.anddev.andengine.entity.particle.initializer.VelocityInitializer;
import org.anddev.andengine.entity.particle.modifier.AlphaModifier;
import org.anddev.andengine.entity.particle.modifier.ColorModifier;
import org.anddev.andengine.entity.particle.modifier.ExpireModifier;
import org.anddev.andengine.entity.particle.modifier.ScaleModifier;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
/**
* (c) 2010 Nicolas Gramlich
* (c) 2011 Zynga
*
* @author Nicolas Gramlich
* @since 11:54:51 - 03.04.2010
*/
public class ParticleSystemCoolExample extends BaseExample {
// ===========================================================
// Constants
// ===========================================================
private static final int CAMERA_WIDTH = 480;
private static final int CAMERA_HEIGHT = 320;
// ===========================================================
// Fields
// ===========================================================
private Camera mCamera;
private BitmapTextureAtlas mBitmapTextureAtlas;
private TextureRegion mParticleTextureRegion;
// ===========================================================
// Constructors
// ===========================================================
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public Engine onLoadEngine() {
this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
}
@Override
public void onLoadResources() {
this.mBitmapTextureAtlas = new BitmapTextureAtlas(32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
this.mParticleTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mBitmapTextureAtlas, this, "particle_fire.png", 0, 0);
this.mEngine.getTextureManager().loadTexture(this.mBitmapTextureAtlas);
}
@Override
public Scene onLoadScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
final Scene scene = new Scene();
scene.setBackground(new ColorBackground(0.0f, 0.0f, 0.0f));
/* Left to right Particle System. */
{
final ParticleSystem particleSystem = new ParticleSystem(new PointParticleEmitter(0, CAMERA_HEIGHT), 6, 10, 200, this.mParticleTextureRegion);
particleSystem.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE);
particleSystem.addParticleInitializer(new VelocityInitializer(15, 22, -60, -90));
particleSystem.addParticleInitializer(new AccelerationInitializer(5, 15));
particleSystem.addParticleInitializer(new RotationInitializer(0.0f, 360.0f));
particleSystem.addParticleInitializer(new ColorInitializer(1.0f, 0.0f, 0.0f));
particleSystem.addParticleModifier(new ScaleModifier(0.5f, 2.0f, 0, 5));
particleSystem.addParticleModifier(new ExpireModifier(11.5f));
particleSystem.addParticleModifier(new AlphaModifier(1.0f, 0.0f, 2.5f, 3.5f));
particleSystem.addParticleModifier(new AlphaModifier(0.0f, 1.0f, 3.5f, 4.5f));
particleSystem.addParticleModifier(new ColorModifier(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 11.5f));
particleSystem.addParticleModifier(new AlphaModifier(1.0f, 0.0f, 4.5f, 11.5f));
scene.attachChild(particleSystem);
}
/* Right to left Particle System. */
{
final ParticleSystem particleSystem = new ParticleSystem(new PointParticleEmitter(CAMERA_WIDTH - 32, CAMERA_HEIGHT), 8, 12, 200, this.mParticleTextureRegion);
particleSystem.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE);
particleSystem.addParticleInitializer(new VelocityInitializer(-15, -22, -60, -90));
particleSystem.addParticleInitializer(new AccelerationInitializer(-5, 15));
particleSystem.addParticleInitializer(new RotationInitializer(0.0f, 360.0f));
particleSystem.addParticleInitializer(new ColorInitializer(0.0f, 0.0f, 1.0f));
particleSystem.addParticleModifier(new ScaleModifier(0.5f, 2.0f, 0, 5));
particleSystem.addParticleModifier(new ExpireModifier(11.5f));
particleSystem.addParticleModifier(new AlphaModifier(1.0f, 0.0f, 2.5f, 3.5f));
particleSystem.addParticleModifier(new AlphaModifier(0.0f, 1.0f, 3.5f, 4.5f));
particleSystem.addParticleModifier(new ColorModifier(0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 11.5f));
particleSystem.addParticleModifier(new AlphaModifier(1.0f, 0.0f, 4.5f, 11.5f));
scene.attachChild(particleSystem);
}
return scene;
}
@Override
public void onLoadComplete() {
}
// ===========================================================
// Methods
// ===========================================================
// ===========================================================
// Inner and Anonymous Classes
// ===========================================================
}
|
[
"ngramlich@zynga.com"
] |
ngramlich@zynga.com
|
3db0ed7c983a0375077294ba211e20793581e38d
|
6567f7ac7eed8d213b4b8aa82622b8ddb2cc37eb
|
/core/testj/ReadXMLFile.java
|
7ac98ae3299bcc2f88a401ea648ea7fcfa74e93b
|
[] |
no_license
|
ttgiang/central
|
2a9e64244eb7341aab77ad5162fb8ba0b4888eb0
|
39785a654c739a1b20c87b91cc36a437241495a9
|
refs/heads/main
| 2023-02-13T08:28:33.333957
| 2021-01-08T04:39:52
| 2021-01-08T04:39:52
| 313,086,967
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,576
|
java
|
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.File;
public class ReadXMLFile {
public static void main(String argv[]) {
try {
File fXmlFile = new File("c:\\file.xml");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
doc.getDocumentElement().normalize();
System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
NodeList nList = doc.getElementsByTagName("staff");
System.out.println("-----------------------");
for (int temp = 0; temp < nList.getLength(); temp++) {
Node nNode = nList.item(temp);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
Element eElement = (Element) nNode;
System.out.println("First Name : " + getTagValue("firstname", eElement));
System.out.println("Last Name : " + getTagValue("lastname", eElement));
System.out.println("Nick Name : " + getTagValue("nickname", eElement));
System.out.println("Salary : " + getTagValue("salary", eElement));
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
private static String getTagValue(String sTag, Element eElement) {
NodeList nlList = eElement.getElementsByTagName(sTag).item(0).getChildNodes();
Node nValue = (Node) nlList.item(0);
return nValue.getNodeValue();
}
}
|
[
"ttgiang@gmail.com"
] |
ttgiang@gmail.com
|
e5c6e4497292595f9429812e5f75aebe4faa830e
|
bf4122f5ae3a9f9b9c2cc94ef87cdb9dcadc9dc9
|
/Transfer/My Study/HSCM29/src/hebbal/abstracts/Uber/UberGo.java
|
da9c3710a52c219412c05b8652476e6ada4eee47
|
[] |
no_license
|
haren7474/TY_ELF_JFS_HarendraKumar
|
7ef8b9a0bb6d6bdddb94b88ab2db4e0aef0fbc1d
|
f99ef30b40d0877167c8159e8b7f322af7cc87b9
|
refs/heads/master
| 2023-01-11T01:01:10.458037
| 2020-01-23T18:20:20
| 2020-01-23T18:20:20
| 225,845,989
| 0
| 0
| null | 2023-01-07T22:01:21
| 2019-12-04T11:00:37
|
HTML
|
UTF-8
|
Java
| false
| false
| 174
|
java
|
package hebbal.abstracts.Uber;
public class UberGo implements Uber
{
public double getPrice()
{
return 250.0;
}
public String getVehical()
{
return "Indica";
}
}
|
[
"harendra10104698@gmail.com"
] |
harendra10104698@gmail.com
|
a0ec1bd0f46a2ea75af0ac14f555ca936e91e890
|
863acb02a064a0fc66811688a67ce3511f1b81af
|
/sources/com/mopub/nativeads/C11636qb.java
|
7239d5cbe54409c97ec52a06ab314cb9aa5a6374
|
[
"MIT"
] |
permissive
|
Game-Designing/Custom-Football-Game
|
98d33eb0c04ca2c48620aa4a763b91bc9c1b7915
|
47283462b2066ad5c53b3c901182e7ae62a34fc8
|
refs/heads/master
| 2020-08-04T00:02:04.876780
| 2019-10-06T06:55:08
| 2019-10-06T06:55:08
| 211,914,568
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,025
|
java
|
package com.mopub.nativeads;
import org.jacoco.agent.p025rt.internal_8ff85ea.Offline;
/* renamed from: com.mopub.nativeads.qb */
/* compiled from: SomaMopubVideoAdapter */
class C11636qb implements Runnable {
/* renamed from: a */
private static transient /* synthetic */ boolean[] f36221a;
/* renamed from: b */
final /* synthetic */ C11639rb f36222b;
/* renamed from: a */
private static /* synthetic */ boolean[] m38463a() {
boolean[] zArr = f36221a;
if (zArr != null) {
return zArr;
}
boolean[] probes = Offline.getProbes(6117269582612546832L, "com/mopub/nativeads/SomaMopubVideoAdapter$3$1", 2);
f36221a = probes;
return probes;
}
C11636qb(C11639rb this$1) {
boolean[] a = m38463a();
this.f36222b = this$1;
a[0] = true;
}
public void run() {
boolean[] a = m38463a();
SomaMopubVideoAdapter.m38388a(this.f36222b.f36229b).onInterstitialClicked();
a[1] = true;
}
}
|
[
"tusharchoudhary0003@gmail.com"
] |
tusharchoudhary0003@gmail.com
|
e33add765cdb6d280a527732466234d5d4b1b48d
|
b1db7cf979aaed9a60e376fe2a61e020b66f84e0
|
/src/java/com/jilit/irp/persistence/dao/impl/DepartmentSubjectTaggingDAO.java
|
4397b3ad6cc37b8441df853bff9b3857f3b0454e
|
[] |
no_license
|
livcoding/CLXRegistration_OLD
|
c2a569c0c05c46b9fbb6e176ffc1fd9ca3ebd7e1
|
a167f29d20d9c9f1de0e4e78bfca6317f837bc4d
|
refs/heads/master
| 2023-06-21T11:14:20.595579
| 2021-07-23T07:26:29
| 2021-07-23T07:26:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,287
|
java
|
package com.jilit.irp.persistence.dao.impl;
import com.jilit.irp.persistence.dao.HibernateDAO;
import com.jilit.irp.persistence.dao.DepartmentSubjectTaggingIDAO;
import com.jilit.irp.persistence.dto.DepartmentSubjectTagging;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.hibernate.Criteria;
import org.hibernate.criterion.Expression;
import org.hibernate.Session;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
/**
*
* @author v.kumar
*/
public class DepartmentSubjectTaggingDAO extends HibernateDAO implements DepartmentSubjectTaggingIDAO {
private static final Log log = LogFactory.getLog(DepartmentSubjectTaggingDAO.class);
public Collection<?> findAll() {
log.info("Retrieving all DepartmentSubjectTagging records via Hibernate from the database");
return this.find("from DepartmentSubjectTagging as tname order by academicyear asc");
}
public Object findByPrimaryKey(Serializable id) {
return getHibernateTemplate().get(DepartmentSubjectTagging.class, id);
}
@Override
public List getDepartmentSubjectTaggingData(final String instituteid) {
List list = null;
String qrystring = " select dst.id.instituteid as instituteid, sm.subjectcode as subjectcode, dst.id.subjectid as subjectid, sm.subjectdesc as subjectdesc, dst.id.departmentid as departmentid, dm.departmentcode as departmentcode, dm.department as department "
+ " from SubjectMaster sm, DepartmentMaster dm, DepartmentSubjectTagging dst where dst.id.instituteid = '" + instituteid + "' "
+ " and sm.id.subjectid = dst.id.subjectid and sm.id.instituteid = dst.id.instituteid "
+ " and dm.departmentid = dst.id.departmentid ";
try {
list = getHibernateTemplate().find(qrystring);
} catch (Exception e) {
}
return list;
}
public List<String> doValidate(final DepartmentSubjectTagging departmentSubjectTagging, final String mode) {
List<String> errors = new ArrayList<String>();
Integer count = new Integer(0);
//Unique Key Constraint
count = (Integer) getHibernateTemplate().executeFind(new HibernateCallback() {
public Object doInHibernate(Session session) {
Criteria criteria = session.createCriteria(DepartmentSubjectTagging.class);
System.err.println("INSTITUTECODE - " + departmentSubjectTagging.getId().getInstituteid());
criteria.add(Restrictions.eq("id.instituteid", departmentSubjectTagging.getId().getInstituteid()).ignoreCase());
criteria.add(Restrictions.eq("id.subjectid", departmentSubjectTagging.getId().getSubjectid()).ignoreCase());
criteria.add(Restrictions.eq("id.departmentid", departmentSubjectTagging.getId().getDepartmentid()).ignoreCase());
if (mode.equals("edit")) {
}
criteria.setProjection(Projections.projectionList().add(Projections.rowCount()));
System.err.println("In doValidate method");
System.err.println("criteria.list() - " + criteria.list());
return criteria.list();
}
}).get(0);
if (count.intValue() > 0) {
errors.add("Duplicate Department-Subject Tagging Found! ");
}
return errors;
}
public List getSubjectCodeUsingDepartmentBased(String instituteid, String departmentid, String subjectid, String registrationid,String currentsubjectid) {
List list = null;
StringBuilder sb = new StringBuilder();
sb.append(" select distinct ds.id.subjectid, sm.subjectcode, sm.subjectdesc ,sm.subjectflag from DepartmentSubjectTagging ds, SubjectMaster sm "
+ " where ds.id.instituteid = sm.id.instituteid and ds.id.subjectid = sm.id.subjectid and ds.id.instituteid = :instituteid and "
+ " sm.id.subjectid<>:subjectid and coalesce(sm.deactive,'N') = 'N' ");
if (!(departmentid.equalsIgnoreCase("ALL"))) {
sb.append(" and ds.id.departmentid = :departmentid ");
}
sb.append(" and sm.id.subjectid not in( select ost.currentsubjectid from OfferedODSubjectTagging ost where ost.id.instituteid=:instituteid and ost.id.registrationid=:registrationid and ost.currentsubjectid<>:currentsubjectid ) order by sm.subjectcode ");
try {
if (!(departmentid.equalsIgnoreCase("ALL"))) {
list = getHibernateSession().createQuery(sb.toString()).setParameter("instituteid", instituteid).setParameter("departmentid", departmentid).setParameter("subjectid", subjectid).setParameter("registrationid", registrationid).setParameter("currentsubjectid", currentsubjectid).list();
} else {
list = getHibernateSession().createQuery(sb.toString()).setParameter("instituteid", instituteid).setParameter("subjectid", subjectid).setParameter("registrationid", registrationid).setParameter("currentsubjectid", currentsubjectid).list();
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
@Override
public List getDepartmentWiseSubjectTaggingData(String instituteid, String deptId) {
List list = null;
String qrystring = " select dst.id.instituteid as instituteid, sm.subjectcode as subjectcode, dst.id.subjectid as subjectid, sm.subjectdesc as subjectdesc, dst.id.departmentid as departmentid, dm.departmentcode as departmentcode, dm.department as department "
+ " from SubjectMaster sm, DepartmentMaster dm, DepartmentSubjectTagging dst where dst.id.instituteid = '" + instituteid + "' and dst.id.departmentid='" + deptId + "' "
+ " and sm.id.subjectid = dst.id.subjectid and sm.id.instituteid = dst.id.instituteid "
+ " and dm.departmentid = dst.id.departmentid ";
try {
list = getHibernateTemplate().find(qrystring);
} catch (Exception e) {
}
return list;
}
}
|
[
"uvsir001@gmail.com"
] |
uvsir001@gmail.com
|
644ce4cf6731cf0b8318bd63b4966d8d3efacbc7
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava3/Foo853.java
|
5072acde36fca03dfe15cfc838a7e540ac336892
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 346
|
java
|
package applicationModulepackageJava3;
public class Foo853 {
public void foo0() {
new applicationModulepackageJava3.Foo852().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
6867b982ca78ddb4559d0990bb9a84521f01d4fa
|
96342d1091241ac93d2d59366b873c8fedce8137
|
/java/com/l2jolivia/gameserver/model/conditions/ConditionPlayerCp.java
|
388062cbb8fd5e0f50eec25ba8a0115c4cf8aaee
|
[] |
no_license
|
soultobe/L2JOlivia_EpicEdition
|
c97ac7d232e429fa6f91d21bb9360cf347c7ee33
|
6f9b3de9f63d70fa2e281b49d139738e02d97cd6
|
refs/heads/master
| 2021-01-10T03:42:04.091432
| 2016-03-09T06:55:59
| 2016-03-09T06:55:59
| 53,468,281
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,376
|
java
|
/*
* This file is part of the L2J Olivia project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jolivia.gameserver.model.conditions;
import com.l2jolivia.gameserver.model.actor.L2Character;
import com.l2jolivia.gameserver.model.items.L2Item;
import com.l2jolivia.gameserver.model.skills.Skill;
/**
* The Class ConditionPlayerCp.
*/
public class ConditionPlayerCp extends Condition
{
private final int _cp;
/**
* Instantiates a new condition player cp.
* @param cp the cp
*/
public ConditionPlayerCp(int cp)
{
_cp = cp;
}
@Override
public boolean testImpl(L2Character effector, L2Character effected, Skill skill, L2Item item)
{
return (effector != null) && (((effector.getCurrentCp() * 100) / effector.getMaxCp()) >= _cp);
}
}
|
[
"kim@tsnet-j.co.jp"
] |
kim@tsnet-j.co.jp
|
80180ce8ed46986a58572ecd631d273003d54591
|
b2b51a98effdf3637de3caf08834e817fb1750a2
|
/app/src/main/java/com/hy/powerplatform/phone/model/PhoneModel.java
|
e6fcab200617d8d9803c65d35d080a1b9fa04939
|
[] |
no_license
|
huxf15269179758/joffice_yichun
|
acdcdce9e09200dca5ec903fe30c6a94016b136a
|
a5e78916fa0080268cb92eebf473488e9c3d09e5
|
refs/heads/master
| 2021-02-09T13:45:51.733119
| 2020-03-05T01:32:03
| 2020-03-05T01:32:03
| 244,289,213
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 334
|
java
|
package com.hy.powerplatform.phone.model;
import android.content.Context;
import com.hy.powerplatform.my_utils.base.BaseModeBackLisenter;
/**
* Created by dell on 2018/6/12.
*/
public interface PhoneModel {
void getPhoneModelData(String httpTag, String userId, Context context, BaseModeBackLisenter baseModeBackLisenter);
}
|
[
"914036951@qq.com"
] |
914036951@qq.com
|
78e030c9298de3064d92ae0ec01def3d76417fd1
|
11935ac971fef9b4fd2e031c29ce711eb60823da
|
/application/src/components/Datamodel/src/com/eas/client/model/application/ApplicationPlatypusEntity.java
|
771673d8f321974c6da83e100018e1424a7987a0
|
[
"Apache-2.0"
] |
permissive
|
AlexeyKashintsev/PlatypusJS
|
21f12be36830551c907b384a2007e83539d8f40f
|
5df9c241843d6598f4e97a22a06cf99e07ce92eb
|
refs/heads/master
| 2021-01-22T22:15:19.280711
| 2015-09-28T07:04:51
| 2015-09-28T07:04:51
| 39,898,619
| 0
| 0
|
Apache-2.0
| 2019-09-03T18:16:01
| 2015-07-29T14:40:59
|
Java
|
UTF-8
|
Java
| false
| false
| 2,559
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.eas.client.model.application;
import com.eas.client.changes.Change;
import com.eas.client.model.visitors.ModelVisitor;
import com.eas.client.queries.PlatypusQuery;
import com.eas.script.ScriptFunction;
import com.eas.script.Scripts;
import java.util.ArrayList;
import java.util.List;
import jdk.nashorn.api.scripting.JSObject;
/**
*
* @author mg
*/
public class ApplicationPlatypusEntity extends ApplicationEntity<ApplicationPlatypusModel, PlatypusQuery, ApplicationPlatypusEntity> {
public ApplicationPlatypusEntity() {
super();
}
public ApplicationPlatypusEntity(ApplicationPlatypusModel aModel) {
super(aModel);
}
public ApplicationPlatypusEntity(String aQueryName) {
super(aQueryName);
}
@Override
public void accept(ModelVisitor<ApplicationPlatypusEntity, ApplicationPlatypusModel> visitor) {
visitor.visit(this);
}
@ScriptFunction(jsDoc = ENQUEUE_UPDATE_JSDOC)
@Override
public void enqueueUpdate() throws Exception {
model.getChangeLog().add(getQuery().prepareCommand());
}
@ScriptFunction(jsDoc = EXECUTE_UPDATE_JSDOC, params = {"onSuccess", "onFailure"})
@Override
public int executeUpdate(JSObject aOnSuccess, JSObject aOnFailure) throws Exception {
List<Change> localLog = new ArrayList<>();
localLog.add(getQuery().prepareCommand());
if (aOnSuccess != null) {
return model.serverProxy.commit(localLog, Scripts.getSpace(), (Integer aUpdated) -> {
aOnSuccess.call(null, new Object[]{aUpdated});
}, (Exception ex) -> {
if (aOnFailure != null) {
aOnFailure.call(null, new Object[]{ex.getMessage()});
}
});
} else {
return model.serverProxy.commit(localLog, Scripts.getSpace(), null, null);
}
}
@Override
public List<Change> getChangeLog() throws Exception {
return model.getChangeLog();
}
@Override
public void validateQuery() throws Exception {
if (query == null) {
if (queryName != null) {
PlatypusQuery q = model.queries.getCachedQuery(queryName);
if (q != null) {
query = q.copy();
}
} else {
throw new IllegalStateException("Only managed queries are allowed in three-tier mode!");
}
}
}
}
|
[
"mg@altsoft.biz"
] |
mg@altsoft.biz
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.