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
716d8acff1a5ab0149e7e68627e7bd2cda9d3be6
8803ec022a004ccb67c4d78b72b549e3c47ad6b7
/mifan-batch-spider/src/main/java/com/mifan/batch/spider/dictionary/util/RemoveChar.java
dbcdfbed303895de73a4c3a195f3b5acdd6a1ad1
[]
no_license
helldzl/moon-api
56ce803d94d94d801913eef4b0b140b19456ca91
44761f7ac6817193f4a562a702e42b01cee3f303
refs/heads/master
2020-03-07T08:24:15.351040
2018-03-30T03:34:24
2018-03-30T03:34:24
127,377,122
0
2
null
null
null
null
UTF-8
Java
false
false
249
java
package com.mifan.batch.spider.dictionary.util; /** * Created by LiuKai on 2017/5/11. * 移除多余符号 */ public class RemoveChar { public static String removeChar(String s,char token) { return s.replace(token, ' '); } }
[ "1949602@qq.com" ]
1949602@qq.com
56fdfa0ca5e3c95810ba92b8a87e10aad454328e
89b27d00973054659dff40b6ec36bf55412094bd
/src/main/java/xwy/delegate/DispatherTest.java
3a18396aefbab735fb85f36a2d3051478589f0c0
[]
no_license
never123450/springSource
33f4bf23469e3e62a902f9ee51efa02c36d4cfef
bc3b6a75a27dd2ec62a445ee99498a5e31c0c013
refs/heads/master
2020-04-16T17:29:42.895246
2019-02-19T02:14:57
2019-02-19T02:14:57
165,777,445
0
0
null
null
null
null
UTF-8
Java
false
false
335
java
package xwy.delegate; public class DispatherTest { public static void main(String[] args) { Dispatcher dispatcher = new Dispatcher(new ExecuterA()); //看上去好像是我们的项目经理在干活,实际上干活的是普通工人 //这就是典型的,干活是我在干,功劳是你的 dispatcher.doing(); } }
[ "845619585@qq.com" ]
845619585@qq.com
cd1626565af5bd895defcc85cb7820126df9189c
7d16d8ea39300f4d9990785e8d3ff8711d1027fc
/src/main/java/org/jtheque/films/view/impl/actions/video/file/AcValidateVideoFileView.java
90d998dc3cccd59d990803958aa1dd3355580a0a
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
wichtounet/jtheque-films-module
1e4701f6fe0a73b5fac0aabfbd564062752d6fc9
ef3e957487a665b9d3ab5751e182f08c18b405c1
refs/heads/master
2020-04-05T23:10:20.258408
2010-07-05T14:42:20
2010-07-05T14:42:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,848
java
package org.jtheque.films.view.impl.actions.video.file; /* * Copyright JTheque (Baptiste Wicht) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.jtheque.core.managers.Managers; import org.jtheque.core.managers.beans.IBeansManager; import org.jtheque.core.managers.view.impl.actions.JThequeAction; import org.jtheque.films.services.able.IFilmsService; import org.jtheque.films.view.able.IVideoFileView; import org.jtheque.films.view.able.IVideoView; import javax.annotation.Resource; import java.awt.event.ActionEvent; /** * An action to validate the video file view. * * @author Baptiste Wicht */ public final class AcValidateVideoFileView extends JThequeAction { @Resource private IFilmsService filmsService; @Resource private IVideoFileView videoFileView; @Resource private IVideoView videoView; /** * Construct a new AcValidateVideoFileView. */ public AcValidateVideoFileView() { super("video.file.view.actions.validate"); Managers.getManager(IBeansManager.class).inject(this); } @Override public void actionPerformed(ActionEvent e) { videoFileView.getFilm().setFilePath(videoFileView.getFilePath()); filmsService.save(videoFileView.getFilm()); videoView.refreshList(); videoFileView.closeDown(); } }
[ "baptistewicht@gmail.com" ]
baptistewicht@gmail.com
773777e0c13297fd5b9df5cd03b6126fddc25b47
de1cda237890a0d7a66cda2188caef3efcedd6f6
/yaya/meet/src/main/java/cn/medcn/meet/dao/VideoCourseDAO.java
c43e10899618d92337715d436933ae8622903b36
[]
no_license
gewuxy/jx_backend
98525725d8e7af1728d1753f1444f4b56779db6e
7d6f24e45f8f8ca05d76b5f147b607b5b33fb04b
refs/heads/master
2021-04-09T10:18:28.607080
2018-03-13T05:36:51
2018-03-13T05:36:51
125,453,798
0
1
null
null
null
null
UTF-8
Java
false
false
217
java
package cn.medcn.meet.dao; import cn.medcn.meet.model.VideoCourse; import com.github.abel533.mapper.Mapper; /** * Created by lixuan on 2017/5/17. */ public interface VideoCourseDAO extends Mapper<VideoCourse> { }
[ "lixuan@medcn.cn" ]
lixuan@medcn.cn
ee9064bfca7ab80460b0ea9448c561135c63f758
2c7bbc8139c4695180852ed29b229bb5a0f038d7
/com/facebook/react/flat/AbstractDrawCommand.java
918f9a55c47169dd73b1e2a0013e3c03e097f79c
[]
no_license
suliyu/evolucionNetflix
6126cae17d1f7ea0bc769ee4669e64f3792cdd2f
ac767b81e72ca5ad636ec0d471595bca7331384a
refs/heads/master
2020-04-27T05:55:47.314928
2017-05-08T17:08:22
2017-05-08T17:08:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,045
java
// // Decompiled by Procyon v0.5.30 // package com.facebook.react.flat; import android.graphics.Canvas; abstract class AbstractDrawCommand extends DrawCommand implements Cloneable { private float mBottom; private float mClipBottom; private float mClipLeft; private float mClipRight; private float mClipTop; private boolean mFrozen; private float mLeft; protected boolean mNeedsClipping; private float mRight; private float mTop; protected static int getDebugBorderColor() { return -16711681; } protected void applyClipping(final Canvas canvas) { canvas.clipRect(this.mClipLeft, this.mClipTop, this.mClipRight, this.mClipBottom); } public final void debugDraw(final FlatViewGroup flatViewGroup, final Canvas canvas) { this.onDebugDraw(flatViewGroup, canvas); } public void draw(final FlatViewGroup flatViewGroup, final Canvas canvas) { this.onPreDraw(flatViewGroup, canvas); if (this.mNeedsClipping && this.shouldClip()) { canvas.save(2); this.applyClipping(canvas); this.onDraw(canvas); canvas.restore(); return; } this.onDraw(canvas); } public final float getBottom() { return this.mBottom; } public final float getClipBottom() { return this.mClipBottom; } public final float getClipLeft() { return this.mClipLeft; } public final float getClipRight() { return this.mClipRight; } public final float getClipTop() { return this.mClipTop; } protected String getDebugName() { return this.getClass().getSimpleName().substring(4); } public final float getLeft() { return this.mLeft; } public final float getRight() { return this.mRight; } public final float getTop() { return this.mTop; } public final boolean isFrozen() { return this.mFrozen; } public final AbstractDrawCommand mutableCopy() { try { final AbstractDrawCommand abstractDrawCommand = (AbstractDrawCommand)super.clone(); abstractDrawCommand.mFrozen = false; return abstractDrawCommand; } catch (CloneNotSupportedException ex) { throw new RuntimeException(ex); } } protected void onDebugDraw(final FlatViewGroup flatViewGroup, final Canvas canvas) { flatViewGroup.debugDrawNamedRect(canvas, getDebugBorderColor(), this.getDebugName(), this.mLeft, this.mTop, this.mRight, this.mBottom); } protected abstract void onDraw(final Canvas p0); protected void onPreDraw(final FlatViewGroup flatViewGroup, final Canvas canvas) { } protected boolean shouldClip() { return this.mLeft < this.getClipLeft() || this.mTop < this.getClipTop() || this.mRight > this.getClipRight() || this.mBottom > this.getClipBottom(); } }
[ "sy.velasquez10@uniandes.edu.co" ]
sy.velasquez10@uniandes.edu.co
198d19aefee54fe76f8f4ef1e17e411050d835f9
24a2accb69be9bed4a8df65dc6be9bc5a0b5aeab
/.metadata/.plugins/org.eclipse.core.resources/.history/2a/105da5b3295a001b1467b3b47f6a5699
cc44da2338c0162b80111b1ea8a62672618b40f1
[]
no_license
hardikkhanna/LeetCode
5aa76d47f1ca45890db08f64eb03853d4cbd6175
a8da2b66ac5a924a6f453b0a58df7c89621b33b5
refs/heads/master
2023-05-29T20:52:28.091201
2021-06-17T17:35:57
2021-06-17T17:35:57
325,298,406
0
0
null
null
null
null
UTF-8
Java
false
false
549
/** * */ package leetcode.string.problems; /** * @author Hardik * * Date : Jan 17, 2021 Time : 2:26:44 PM */ public class CharactersThatHaveOddCount { /** * @param args */ public static void main(String[] args) { int n = 2; String str = generateTheString(n); System.out.println(str); } /** * @param n * @return */ private static String generateTheString(int m) { String str = ""; for (int i = 0; i < m; i++) str += "a"; if (str.length() % 2 == 0) str = "b" + str.substring(1); return str; } }
[ "khannahardik007@gmail.com" ]
khannahardik007@gmail.com
6888e29c31915dc7c6c930a5d50bc8c2ed379b80
9c7074a2467350bd855cbacba2857199cda5ebc7
/20210809(ZJYD_v2.6.0)/app/src/main/java/com/pukka/ydepg/common/http/v6bean/v6node/SingleMark.java
91413e9a28fc3b0164d2ce2eb22ab9e7aaa5512b
[]
no_license
wangkk24/testgit
ce6c3f371bcac56832f62f9631cdffb32d9f2ed2
0eb6d2cc42f61cf28ce50b77d754dcfbd152d91c
refs/heads/main
2023-07-15T21:45:24.674154
2021-08-31T07:13:14
2021-08-31T07:13:14
401,544,031
1
1
null
null
null
null
UTF-8
Java
false
false
845
java
package com.pukka.ydepg.common.http.v6bean.v6node; import com.google.gson.annotations.SerializedName; public class SingleMark { //单包角标名称 @SerializedName("productName") private String productName; //单包角标图片 @SerializedName("icon") private String icon; //单包id @SerializedName("productId") private String productId; public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getProductId() { return productId; } public void setProductId(String productId) { this.productId = productId; } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } }
[ "wangkk@easier.cn" ]
wangkk@easier.cn
f793b3de9e454398680534dfe657f56a97fc9b6f
bc3a295f3c70610f62a0c14b23e113bb8851ace1
/src/main/java/controllers/Application.java
dfea689e66bd180e6cb3250ffa7120a4e63e3391
[]
no_license
jroper/play-java8-presentation
ae63f1a4e74890890faa64fa2f78b712bd971c8f
8289354e5bcfda11ab410ae95e120b165cf4e06d
refs/heads/master
2021-01-22T06:58:40.090030
2014-04-23T13:12:46
2014-04-23T13:12:46
18,792,827
1
0
null
null
null
null
UTF-8
Java
false
false
2,059
java
package controllers; import akka.dispatch.ExecutionContexts; import model.SlicedBread; import play.libs.F.*; import play.libs.Json; import play.libs.ws.WS; import play.libs.ws.WSResponse; import play.mvc.Controller; import play.mvc.Result; import promise.Baker; import scala.concurrent.ExecutionContext; import java.util.concurrent.Executors; public class Application extends Controller { private static Baker baker; public static Promise<Result> action() { // Order the sliced bread Promise<SlicedBread> slicedBreadPromise = baker.orderSlicedBread(); // Map it to a result Promise<Result> resultPromise = slicedBreadPromise.map( slicedBread -> ok(Json.toJson(slicedBread)) ); // Return an asynchronous result return resultPromise; } public static Promise<Result> wsAction() { // Make a REST call Promise<WSResponse> response = WS.url("http://baker.com/slicedBread").get(); // Map it to a result and return as an asynchronous result return response.map(resp -> ok(resp.asJson())); } public static Promise<SlicedBread> orderSlicedBread() { // Make a rest call Promise<WSResponse> response = WS.url("http://baker.com/slicedBread").get(); // Convert the result to sliced bread Promise<SlicedBread> result = response.map( resp -> Json.fromJson(resp.asJson(), SlicedBread.class) ); return result; } public static Promise<Result> backgroundAction() { ExecutionContext ec = ExecutionContexts.fromExecutor( Executors.newSingleThreadExecutor()); // Schedule something that will take a while Promise<Long> sum = Promise.promise(() -> { long total = 0; for (long i = 0; i < 1000000000000L; i++) { total = total + i; } return total; }, ec); // Map it to JSON return sum.map(total -> (Result) ok(Json.toJson(total))); } }
[ "james@jazzy.id.au" ]
james@jazzy.id.au
907afeb03ad0a32778a6d3a3407c11fb5ce226c3
1a32d704493deb99d3040646afbd0f6568d2c8e7
/BOOT-INF/lib/org/springframework/context/expression/EnvironmentAccessor.java
04ae9053049c2759545e6b98181b499418496cec
[]
no_license
yanrumei/bullet-zone-server-2.0
e748ff40f601792405143ec21d3f77aa4d34ce69
474c4d1a8172a114986d16e00f5752dc019cdcd2
refs/heads/master
2020-05-19T11:16:31.172482
2019-03-25T17:38:31
2019-03-25T17:38:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,978
java
/* */ package org.springframework.context.expression; /* */ /* */ import org.springframework.core.env.Environment; /* */ import org.springframework.expression.AccessException; /* */ import org.springframework.expression.EvaluationContext; /* */ import org.springframework.expression.PropertyAccessor; /* */ import org.springframework.expression.TypedValue; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class EnvironmentAccessor /* */ implements PropertyAccessor /* */ { /* */ public Class<?>[] getSpecificTargetClasses() /* */ { /* 36 */ return new Class[] { Environment.class }; /* */ } /* */ /* */ /* */ /* */ /* */ public boolean canRead(EvaluationContext context, Object target, String name) /* */ throws AccessException /* */ { /* 45 */ return true; /* */ } /* */ /* */ /* */ /* */ /* */ public TypedValue read(EvaluationContext context, Object target, String name) /* */ throws AccessException /* */ { /* 54 */ return new TypedValue(((Environment)target).getProperty(name)); /* */ } /* */ /* */ /* */ /* */ public boolean canWrite(EvaluationContext context, Object target, String name) /* */ throws AccessException /* */ { /* 62 */ return false; /* */ } /* */ /* */ public void write(EvaluationContext context, Object target, String name, Object newValue) /* */ throws AccessException /* */ {} /* */ } /* Location: C:\Users\ikatwal\Downloads\bullet-zone-server-2.0.jar!\BOOT-INF\lib\spring-context-4.3.14.RELEASE.jar!\org\springframework\context\expression\EnvironmentAccessor.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ishankatwal@gmail.com" ]
ishankatwal@gmail.com
1a10454345a90b09b3fdfa827be92a705ab649f0
e245eed28688326dff92bd700562ddd461d078d2
/core/src/test/java/com/github/weisj/darklaf/PointerUtilTest.java
8a72c4ff22d7c904c3574e432d5acdf8ecc00e9f
[ "MIT" ]
permissive
lvyitian/darklaf
923959211f4990262b8f5d28f324ca27e4b8ec43
c9593dced092ddebf2c24674140a60267a338153
refs/heads/master
2023-06-27T11:40:33.331629
2021-07-24T13:31:36
2021-07-24T19:20:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,355
java
/* * MIT License * * Copyright (c) 2021 Jannis Weis * * 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.weisj.darklaf; import java.awt.Window; import java.lang.reflect.InvocationTargetException; import javax.swing.JWindow; import javax.swing.SwingUtilities; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; import com.github.weisj.darklaf.platform.windows.PointerUtil; import com.github.weisj.darklaf.platform.windows.WindowsLibrary; import com.sun.jna.Native; class PointerUtilTest { @Test @EnabledOnOs(OS.WINDOWS) void testCustomImplementationEqualsJNA() throws InterruptedException, InvocationTargetException { WindowsLibrary.get().updateLibrary(); Assertions.assertTrue(WindowsLibrary.get().isLoaded()); for (int i = 0; i < 100; i++) { Window frame = new JWindow(); frame.setAutoRequestFocus(false); SwingUtilities.invokeAndWait(() -> frame.setVisible(true)); Assertions.assertEquals(Native.getWindowID(frame), PointerUtil.getHWND(frame)); SwingUtilities.invokeLater(() -> { frame.setVisible(false); frame.dispose(); }); } } }
[ "31143295+weisJ@users.noreply.github.com" ]
31143295+weisJ@users.noreply.github.com
0914b11deb4ef8126f1da6a7339ca4b077b68d25
4661233fd9c3bbf64f862ad627fada7c5d8900e4
/src/main/java/com/project/web/domian/TThreeProducts.java
914fe1ea512cb00a60b4228ec62f29b118d2170b
[]
no_license
renbf/dly_security
c37b3e686f4bd8d2c1f341694d5027be1dc4726a
3f6f863786e174b65a033cdcc84e36de00181a09
refs/heads/master
2020-05-07T16:34:35.821654
2019-05-22T09:26:48
2019-05-22T09:26:48
180,686,455
0
1
null
null
null
null
UTF-8
Java
false
false
5,172
java
package com.project.web.domian; import com.project.common.base.BaseEntity; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.util.Date; /** * 三品查处记录表 t_three_products * * @author rbf * @date 2019-04-17 */ public class TThreeProducts extends BaseEntity { private static final long serialVersionUID = 1L; /** * 主键ID */ private String id; /** * 检查日期 ## */ private Date checkDate; /** * 物品名称 #$ */ private String goodsName; /** * 物品类型 # 字典项(three_products_goods_type) */ private String goodsType; /** * 检查人员 #$ */ private String checkPersonnel; /** * 检查结果 #$ */ private String resultInfo; /** * 备注 */ private String remark; /** * 创建日期 */ private Date createTime; /** * 更新时间 */ private Date updateTime; /** * 创建人id */ private Long userId; /** * 备用字段 */ private String meno; /** * 企业ID */ private String businessId; /** * 修改人id */ private Long updateUserId; /*查询入参新增*/ private Date checkDate1; /*查询出参新增*/ private String checkDateStr; private String createTimeStr; private String goodsTypeName; public String getGoodsTypeName() { return goodsTypeName; } public TThreeProducts setGoodsTypeName(String goodsTypeName) { this.goodsTypeName = goodsTypeName; return this; } public Date getCheckDate1() { return checkDate1; } public TThreeProducts setCheckDate1(Date checkDate1) { this.checkDate1 = checkDate1; return this; } public String getCheckDateStr() { return checkDateStr; } public TThreeProducts setCheckDateStr(String checkDateStr) { this.checkDateStr = checkDateStr; return this; } public String getCreateTimeStr() { return createTimeStr; } public TThreeProducts setCreateTimeStr(String createTimeStr) { this.createTimeStr = createTimeStr; return this; } public String getId() { return id; } public void setId(String id) { this.id = id; } public Date getCheckDate() { return checkDate; } public void setCheckDate(Date checkDate) { this.checkDate = checkDate; } public String getGoodsName() { return goodsName; } public void setGoodsName(String goodsName) { this.goodsName = goodsName; } public String getGoodsType() { return goodsType; } public void setGoodsType(String goodsType) { this.goodsType = goodsType; } public String getCheckPersonnel() { return checkPersonnel; } public void setCheckPersonnel(String checkPersonnel) { this.checkPersonnel = checkPersonnel; } public String getResultInfo() { return resultInfo; } public void setResultInfo(String resultInfo) { this.resultInfo = resultInfo; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } public String getMeno() { return meno; } public void setMeno(String meno) { this.meno = meno; } public String getBusinessId() { return businessId; } public void setBusinessId(String businessId) { this.businessId = businessId; } public Long getUpdateUserId() { return updateUserId; } public void setUpdateUserId(Long updateUserId) { this.updateUserId = updateUserId; } public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("checkDate", getCheckDate()) .append("goodsName", getGoodsName()) .append("goodsType", getGoodsType()) .append("checkPersonnel", getCheckPersonnel()) .append("resultInfo", getResultInfo()) .append("remark", getRemark()) .append("createTime", getCreateTime()) .append("updateTime", getUpdateTime()) .append("userId", getUserId()) .append("meno", getMeno()) .append("businessId", getBusinessId()) .append("updateUserId", getUpdateUserId()) .toString(); } }
[ "864378535@qq.com" ]
864378535@qq.com
8dd3e6761210e544b1fb719b5b4ea409a4793e16
20cf58ae641e58f72dc31eed03de39299bbf441d
/poker/src/main/scala/com/code/server/game/poker/doudizhu/GameDouDiZhuLinFenNoQiang.java
1705302149a59e744e4acc78341cb235928469a4
[ "MIT" ]
permissive
1282127821/summer-1
effe36c59b0a7ddd9cdbf1d75549650e816adc4e
e1b9ca2a67d340b2960175f552604ea3e1936dad
refs/heads/master
2023-04-24T07:25:46.732818
2021-05-12T02:04:40
2021-05-12T02:04:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package com.code.server.game.poker.doudizhu; import com.code.server.constant.response.ErrorCode; import com.code.server.game.room.kafka.MsgSender; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; /** * Created by sunxianping on 2017/6/26. */ public class GameDouDiZhuLinFenNoQiang extends GameDouDiZhuLinFenLongQi { private static final Logger logger = LoggerFactory.getLogger(GameDouDiZhuLinFen.class); /** * 叫地主 * @param userId * @param isJiao * @return */ @Override public int jiaoDizhu(long userId, boolean isJiao, int score){ logger.info(userId +" 叫地主 "+ isJiao); if (canJiaoUser != userId) { return ErrorCode.CAN_NOT_JIAO_TURN; } //叫地主列表 chooseJiaoSet.add(userId); //不叫 下个人能叫 if (!isJiao) { bujiaoSet.add(userId); if (bujiaoSet.size() >= users.size()) { handleLiuju(); } else { long nextJiao = nextTurnId(userId); canJiaoUser = nextJiao; noticeCanJiao(nextJiao); } } else {//叫了 开始游戏 jiaoUser = userId; dizhu = userId; //选定地主 chooseDizhu(); startPlay(jiaoUser); } Map<String, Object> rs = new HashMap<>(); rs.put("userId", userId); rs.put("isJiao", isJiao); MsgSender.sendMsg2Player("gameService","jiaoResponse",rs,users); MsgSender.sendMsg2Player("gameService","jiaoDizhu",0,userId); updateLastOperateTime(); //回放 replay.getOperate().add(Operate.getOperate_JDZ(userId,score,!isJiao)); return 0; } }
[ "redalert3@126.com" ]
redalert3@126.com
74139d8a4fa89366f74760c8e32889d59c80f1e3
981d034927bdb8525860f088acec8aba86393762
/src/main/java/com/madv/mylang/patterns/freeman/command/undo/CeilingFanHighCommand.java
80966fe09a578f15aa375e7517f9ae3b27a3d3b7
[]
no_license
vol2hv/mylang1
5aafdd73bd50c3d20b4216d8aecc3dc2bcab2b68
63576a6f09dca6b3b00dfec8da3c4c339f9fcf6c
refs/heads/master
2021-12-25T19:14:08.101747
2021-06-02T20:07:58
2021-06-02T20:07:58
178,451,964
0
0
null
2021-12-14T21:17:58
2019-03-29T17:50:07
Java
UTF-8
Java
false
false
627
java
package com.madv.mylang.patterns.freeman.command.undo; public class CeilingFanHighCommand implements Command { CeilingFan ceilingFan; int prevSpeed; public CeilingFanHighCommand(CeilingFan ceilingFan) { this.ceilingFan = ceilingFan; } public void execute() { prevSpeed = ceilingFan.getSpeed(); ceilingFan.high(); } public void undo() { if (prevSpeed == CeilingFan.HIGH) { ceilingFan.high(); } else if (prevSpeed == CeilingFan.MEDIUM) { ceilingFan.medium(); } else if (prevSpeed == CeilingFan.LOW) { ceilingFan.low(); } else if (prevSpeed == CeilingFan.OFF) { ceilingFan.off(); } } }
[ "vol2hv@yandex.ru" ]
vol2hv@yandex.ru
68caf5d4e7280bfd26e7bf0ac4eba7b69203aa9c
422b26f798eb58b6cff64e39b7804dca4387e631
/src/main/java/com/korlan/jhipster/web/rest/RegionResource.java
204496287d33adf9bc4faae89ba769132eac7c4f
[]
no_license
koorlan/jhipster
7faa1e4cf51ec507902e0769946b5ebbe77273ad
3f0f6b768c5c159f1ec3bc3ce1eed6942e048092
refs/heads/master
2020-04-17T15:00:18.526316
2019-01-20T16:42:36
2019-01-20T16:42:36
166,681,264
0
0
null
2019-01-20T16:42:37
2019-01-20T16:11:18
Java
UTF-8
Java
false
false
4,365
java
package com.korlan.jhipster.web.rest; import com.codahale.metrics.annotation.Timed; import com.korlan.jhipster.domain.Region; import com.korlan.jhipster.service.RegionService; import com.korlan.jhipster.web.rest.errors.BadRequestAlertException; import com.korlan.jhipster.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing Region. */ @RestController @RequestMapping("/api") public class RegionResource { private final Logger log = LoggerFactory.getLogger(RegionResource.class); private static final String ENTITY_NAME = "region"; private final RegionService regionService; public RegionResource(RegionService regionService) { this.regionService = regionService; } /** * POST /regions : Create a new region. * * @param region the region to create * @return the ResponseEntity with status 201 (Created) and with body the new region, or with status 400 (Bad Request) if the region has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/regions") @Timed public ResponseEntity<Region> createRegion(@RequestBody Region region) throws URISyntaxException { log.debug("REST request to save Region : {}", region); if (region.getId() != null) { throw new BadRequestAlertException("A new region cannot already have an ID", ENTITY_NAME, "idexists"); } Region result = regionService.save(region); return ResponseEntity.created(new URI("/api/regions/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /regions : Updates an existing region. * * @param region the region to update * @return the ResponseEntity with status 200 (OK) and with body the updated region, * or with status 400 (Bad Request) if the region is not valid, * or with status 500 (Internal Server Error) if the region couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/regions") @Timed public ResponseEntity<Region> updateRegion(@RequestBody Region region) throws URISyntaxException { log.debug("REST request to update Region : {}", region); if (region.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } Region result = regionService.save(region); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, region.getId().toString())) .body(result); } /** * GET /regions : get all the regions. * * @return the ResponseEntity with status 200 (OK) and the list of regions in body */ @GetMapping("/regions") @Timed public List<Region> getAllRegions() { log.debug("REST request to get all Regions"); return regionService.findAll(); } /** * GET /regions/:id : get the "id" region. * * @param id the id of the region to retrieve * @return the ResponseEntity with status 200 (OK) and with body the region, or with status 404 (Not Found) */ @GetMapping("/regions/{id}") @Timed public ResponseEntity<Region> getRegion(@PathVariable Long id) { log.debug("REST request to get Region : {}", id); Optional<Region> region = regionService.findOne(id); return ResponseUtil.wrapOrNotFound(region); } /** * DELETE /regions/:id : delete the "id" region. * * @param id the id of the region to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/regions/{id}") @Timed public ResponseEntity<Void> deleteRegion(@PathVariable Long id) { log.debug("REST request to delete Region : {}", id); regionService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
83727c8344ca7df64a68e229381d7d23846da8b5
f11913610e93f6a925204d9e9482980db4a809b6
/features/outdated/dk.dtu.imm.se.ecno.pn.generator/src/dk/dtu/imm/se/ecno/pn/model/Package.java
ca7b8ff85d58c2d174a29121a117d40b48b8c574
[]
no_license
ekkart/ECNO
c402cfbebf29b27f15524459058a72c2c3852a80
2cf7eb844ef897ab4a4d56ae72721d4b000bc34c
refs/heads/master
2020-03-06T23:53:07.109577
2020-03-03T19:57:54
2020-03-03T19:57:54
127,144,163
1
0
null
null
null
null
UTF-8
Java
false
false
173
java
package dk.dtu.imm.se.ecno.pn.model; public class Package extends Namespace { public Package(Namespace container, String name) { super(container, name); } }
[ "ekki@dtu.dk" ]
ekki@dtu.dk
48ca41235abe94d8c53aac521f91a9c8c86b73d4
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/jdbi/learning/6501/BindList.java
20d29c68d85c355379cabb81e6a52c234d3b5300
[]
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
2,734
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jdbi.v3.sqlobject.customizer; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target ; import org.jdbi.v3.sqlobject.customizer.internal.BindListFactory; /** * Binds each value in the annotated {@link Iterable} or array/varargs argument, and defines a named attribute as a * comma-separated list of each bound parameter name. Common use cases: * <pre> * &#64;SqlQuery("select * from things where id in (&lt;ids&gt;)") * List&lt;Thing&gt; getThings(@BindList int... ids) * * &#64;SqlQuery("insert into things (&lt;columnNames&gt;) values (&lt;values&gt;)") * void insertThings(@DefineList List&lt;String&gt; columnNames, @BindList List&lt;Object&gt; values) * </pre> * <p> * Throws IllegalArgumentException if the argument is not an array or Iterable. How null and empty collections are handled can be configured with onEmpty:EmptyHandling - throws IllegalArgumentException by default. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.PARAMETER}) @SqlStatementCustomizingAnnotation(BindListFactory.class) public @interface BindList { /** * The attribute name to define. If omitted, the name of the annotated parameter is used. It is an error to omit * the name when there is no parameter naming information in your class files. * * @return the attribute name. */ String value() default ""; /** * @return what to do when the argument is null or empty */ EmptyHandling onEmpty() default EmptyHandling.THROW; /** * describes what needs to be done if the passed argument is null or empty */ enum EmptyHandling { /** * output "" (without quotes, i.e. nothing) * <p> * select * from things where x in () */ VOID, /** * output "null" (without quotes, as keyword), useful e.g. in postgresql where "in ()" is invalid syntax * <p> * select * from things where x in (null) */ NULL, /** * throw IllegalArgumentException */ THROW; } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
4e5ef2ac7026b341670328fcbd47d3474eb43149
029a60dd1daeac58f1683503d70f9a756d550bbc
/level11/src/main/java/lesson11/home07/Solution.java
d9af66a1762a5660c6e849302c120b578b409ce8
[]
no_license
Borislove/JavaRush-1
4d66837bd07697299d97c234b751c0310ea57042
752373a5972c32e57fa1bffa60013a0da9e49b67
refs/heads/master
2023-05-03T12:32:29.577155
2021-05-24T13:12:55
2021-05-24T13:12:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
674
java
package lesson11.home07; /* Вторая правильная «цепочка наследования» Расставь правильно «цепочку наследования» в классах: Carnivora (плотоядное животное), Cow (корова), Dog(собака), Pig(свинья), Animal (животное). */ public class Solution { public static void main(String[] args) { } public class Carnivora extends Animal { } public class Cow extends Animal { } public class Dog extends Carnivora { } public class Pig extends Animal { } public class Animal { } }
[ "krohmal_kirill@mail.ru" ]
krohmal_kirill@mail.ru
5ee80dce6fb2b7c97f923e434a59d84772f0d7dd
5bc9d8f92f38967cc9ecc03000c0606dbbb38f74
/sca4j/modules/tags/sca4j-modules-parent-pom-0.9.3/extension/binding/sca4j-binding-file/src/main/java/org/sca4j/binding/file/runtime/FileTargetWireAttacher.java
a52597190eb7154d1a6322198e7f89f2cdb41651
[]
no_license
codehaus/service-conduit
795332fad474e12463db22c5e57ddd7cd6e2956e
4687d4cfc16f7a863ced69ce9ca81c6db3adb6d2
refs/heads/master
2023-07-20T00:35:11.240347
2011-08-24T22:13:28
2011-08-24T22:13:28
36,342,601
2
0
null
null
null
null
UTF-8
Java
false
false
2,791
java
/** * SCA4J * Copyright (c) 2009 - 2099 Service Symphony Ltd * * Licensed to you under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. A copy of the license * is included in this distrubtion or you may obtain a copy at * * http://www.opensource.org/licenses/apache2.0.php * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * This project contains code licensed from the Apache Software Foundation under * the Apache License, Version 2.0 and original code from project contributors. */ package org.sca4j.binding.file.runtime; import java.io.File; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLDecoder; import org.sca4j.api.annotation.Monitor; import org.sca4j.binding.file.provision.FileWireTargetDefinition; import org.sca4j.spi.ObjectFactory; import org.sca4j.spi.builder.WiringException; import org.sca4j.spi.builder.component.TargetWireAttacher; import org.sca4j.spi.model.physical.PhysicalWireSourceDefinition; import org.sca4j.spi.wire.Wire; /** * Attaches target end of the wire to the Physical target. * */ public class FileTargetWireAttacher implements TargetWireAttacher<FileWireTargetDefinition> { @Monitor FileBindingMonitor monitor; /** * {@inheritDoc} */ public void attachToTarget(PhysicalWireSourceDefinition source, FileWireTargetDefinition target, Wire wire) throws WiringException { try { final URI uri = URI.create(URLDecoder.decode(target.getUri().toString(), "UTF-8")); final File fileRoot = new File(uri); if (!fileRoot.isDirectory()) { throw new WiringException("Location specified is not a valid directory - " + uri); } final FileTargetInterceptor interceptor = new FileTargetInterceptor(fileRoot, target.getBindingMetaData().acquireLock); wire.getInvocationChains().entrySet().iterator().next().getValue().addInterceptor(interceptor); } catch (UnsupportedEncodingException e) { throw new WiringException(e); } } /** * {@inheritDoc} */ public void detachFromTarget(PhysicalWireSourceDefinition source, FileWireTargetDefinition target) throws WiringException { throw new AssertionError(); } /** * {@inheritDoc} */ public ObjectFactory<?> createObjectFactory(FileWireTargetDefinition target) throws WiringException { throw new AssertionError(); } }
[ "meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e" ]
meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e
5dff0edf84cc91f926d12162380d14ccfc7e8dce
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/31/31_977cc264a25722d16b4b20910f01930202996db7/Record/31_977cc264a25722d16b4b20910f01930202996db7_Record_s.java
1ceb6e5bade9cec630ef3820174984cd0dc66ad1
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,774
java
import java.util.*; public class Record { private static List<Record> record; private int iden; private String ttl; private List<String> art; private List<String> us; private List<Integer> rat; private Record(int i, String t, List <String> a, List <String> u, List <Integer> r) { iden = i; ttl = t; art = a; us = u; rat = r; } public static void initRecord() { Record.record = new ArrayList<Record>(); } public static void newRecord() { record.add(new Record(-1, "null", new ArrayList<String>(), new ArrayList<String>(), new ArrayList<Integer>())); } public static void addTitle(int i, String title) { if (record.get(i).ttl.equals("null")) record.get(i).ttl = title; else System.out.println("That record already has a title, check your " + "index or intent. " + "call updateTitle if you really need to " + "change it"); } public static void updateTitle(int i, String title) { record.get(i).ttl = title; } public static void addID(int i, int id) { if (record.get(i).iden == -1) record.get(i).iden = id; else System.out.println("That record already has an id number, check " + "your index and intent. Call updateID if " + "you really want to change it."); } public static void updateID(int i, int id) { record.get(i).iden = id; } public static void addArtist(int i, String artist) { record.get(i).art.add(artist); } public static void addUserRat(int i, String user, Integer rating) { record.get(i).us.add(user); record.get(i).rat.add(rating); } public static void updateRating(int i, String user, Integer rating) { int j; for (j=0; !record.get(i).us.get(j).equals(user); j++) {} record.get(i).rat.set(j, rating); } public static Integer getID(int i) {return record.get(i).iden;} public static String getTitle(int i) {return record.get(i).ttl;} public static int getNumArtists(int i) {return record.get(i).art.size();} public static int getNumUsers(int i) {return record.get(i).us.size();} public static String[] getArtists(int i) { String[] sArray = new String[1]; return record.get(i).art.toArray(sArray); } public static String[] getUsers(int i) { String[] sArray = new String[1]; return record.get(i).us.toArray(sArray); } public static Integer getRating(int i, String user) { int j; for (j=0; !record.get(i).us.get(j).equals(user); j++) {} return record.get(i).rat.get(j); } public static Record getRecord(int i) { return record.get(i);} public static int recordSize() {return record.size();} }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
78d388aa5eb4b5884fe1abe591cff546be0b548b
480beb8e6931f9492969b6bd5dc25c4877dab576
/dp/Boj10844.java
9f2c958735bdcd3b311e741284288f1a43da8993
[]
no_license
wonseok5893/algorithm
a2905de9abf7b9dc538aaec334ac75996f45b6d3
8c00674321ffa1ee61a2552e425102cf0bcf714c
refs/heads/master
2023-05-28T03:24:25.264814
2021-05-28T07:48:51
2021-05-28T07:48:51
296,323,238
1
0
null
null
null
null
UTF-8
Java
false
false
924
java
package dp; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Boj10844 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int mod = (int)1e9; int[][] dp = new int[n + 1][10]; for (int i = 1; i < 10; i++) { dp[1][i] = 1; } for (int i = 2; i <= n; i++) { for (int j = 0; j < 10; j++) { if(j==0) dp[i][j]=dp[i-1][1]; else if(j==9) dp[i][j]=dp[i-1][8]; else dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j + 1]; dp[i][j] %=mod; } } int ans = 0; for (int i = 0; i < 10; i++) { ans = (ans+dp[n][i])%mod; } System.out.println(ans); } }
[ "wonseok5893@naver.com" ]
wonseok5893@naver.com
a9fb59e99fe6729ee0e720059fa0b7b50674a9d6
75950d61f2e7517f3fe4c32f0109b203d41466bf
/modules/tags/fabric3-modules-parent-pom-1.3/kernel/impl/fabric3-fabric/src/main/java/org/fabric3/fabric/monitor/MonitorWireAttacher.java
c732124957ce2905937be90d6dee96c0befc3a17
[]
no_license
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
3,686
java
/* * Fabric3 * Copyright (c) 2009 Metaform Systems * * Fabric3 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, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.fabric.monitor; import org.osoa.sca.annotations.Reference; import org.fabric3.host.monitor.MonitorFactory; import org.fabric3.spi.ObjectFactory; import org.fabric3.spi.SingletonObjectFactory; import org.fabric3.spi.builder.WiringException; import org.fabric3.spi.builder.component.TargetWireAttacher; import org.fabric3.spi.builder.component.WireAttachException; import org.fabric3.spi.classloader.ClassLoaderRegistry; import org.fabric3.spi.model.physical.PhysicalSourceDefinition; import org.fabric3.spi.wire.Wire; /** * TargetWireAttacher that handles monitor resources. * <p/> * This only support optimized resources. * * @version $Rev$ $Date$ */ public class MonitorWireAttacher implements TargetWireAttacher<MonitorTargetDefinition> { private final MonitorFactory monitorFactory; private final ClassLoaderRegistry classLoaderRegistry; public MonitorWireAttacher(@Reference MonitorFactory monitorFactory, @Reference ClassLoaderRegistry classLoaderRegistry) { this.monitorFactory = monitorFactory; this.classLoaderRegistry = classLoaderRegistry; } public void attach(PhysicalSourceDefinition source, MonitorTargetDefinition target, Wire wire) throws WiringException { throw new UnsupportedOperationException(); } public void detach(PhysicalSourceDefinition source, MonitorTargetDefinition target) throws WiringException { throw new AssertionError(); } public ObjectFactory<?> createObjectFactory(MonitorTargetDefinition target) throws WiringException { try { Class<?> type = classLoaderRegistry.loadClass(target.getClassLoaderId(), target.getMonitorType()); Object monitor = monitorFactory.getMonitor(type, target.getUri()); return new SingletonObjectFactory<Object>(monitor); } catch (ClassNotFoundException e) { throw new WireAttachException("Unable to load monitor class: " + target.getMonitorType(), target.getUri(), null, e); } } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
d934d32a7db38c14f9650fbb71edd61c5c0e14b1
a55f15867f48461bbbf729411060884e9772aea0
/src/main/java/io/github/jhipster/application/web/rest/NewsResource.java
b0542b13101968e00c839575915efa2a4f130b00
[]
no_license
Sobotka95/jhipsterSampleApplication
f75d53cfa59db3ef9117fe07776f7ea460be3061
203e124eea5c0dba1e23c158b3a8668817f4be10
refs/heads/master
2020-03-19T16:23:25.433118
2018-06-09T10:38:27
2018-06-09T10:38:27
136,713,682
0
0
null
2018-06-09T14:48:18
2018-06-09T10:31:46
Java
UTF-8
Java
false
false
4,256
java
package io.github.jhipster.application.web.rest; import com.codahale.metrics.annotation.Timed; import io.github.jhipster.application.domain.News; import io.github.jhipster.application.repository.NewsRepository; import io.github.jhipster.application.web.rest.errors.BadRequestAlertException; import io.github.jhipster.application.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing News. */ @RestController @RequestMapping("/api") public class NewsResource { private final Logger log = LoggerFactory.getLogger(NewsResource.class); private static final String ENTITY_NAME = "news"; private final NewsRepository newsRepository; public NewsResource(NewsRepository newsRepository) { this.newsRepository = newsRepository; } /** * POST /news : Create a new news. * * @param news the news to create * @return the ResponseEntity with status 201 (Created) and with body the new news, or with status 400 (Bad Request) if the news has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/news") @Timed public ResponseEntity<News> createNews(@RequestBody News news) throws URISyntaxException { log.debug("REST request to save News : {}", news); if (news.getId() != null) { throw new BadRequestAlertException("A new news cannot already have an ID", ENTITY_NAME, "idexists"); } News result = newsRepository.save(news); return ResponseEntity.created(new URI("/api/news/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /news : Updates an existing news. * * @param news the news to update * @return the ResponseEntity with status 200 (OK) and with body the updated news, * or with status 400 (Bad Request) if the news is not valid, * or with status 500 (Internal Server Error) if the news couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/news") @Timed public ResponseEntity<News> updateNews(@RequestBody News news) throws URISyntaxException { log.debug("REST request to update News : {}", news); if (news.getId() == null) { return createNews(news); } News result = newsRepository.save(news); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, news.getId().toString())) .body(result); } /** * GET /news : get all the news. * * @return the ResponseEntity with status 200 (OK) and the list of news in body */ @GetMapping("/news") @Timed public List<News> getAllNews() { log.debug("REST request to get all News"); return newsRepository.findAll(); } /** * GET /news/:id : get the "id" news. * * @param id the id of the news to retrieve * @return the ResponseEntity with status 200 (OK) and with body the news, or with status 404 (Not Found) */ @GetMapping("/news/{id}") @Timed public ResponseEntity<News> getNews(@PathVariable Long id) { log.debug("REST request to get News : {}", id); News news = newsRepository.findOne(id); return ResponseUtil.wrapOrNotFound(Optional.ofNullable(news)); } /** * DELETE /news/:id : delete the "id" news. * * @param id the id of the news to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/news/{id}") @Timed public ResponseEntity<Void> deleteNews(@PathVariable Long id) { log.debug("REST request to delete News : {}", id); newsRepository.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
5bb6a0e5c05716c6e47fc5963fe1991e642af18a
a8de4bf8b1b6f3fe7214d8cf0de2036eab49a91f
/land-management-assist/.history/src/main/java/com/xz/landmanagementassist/controller/admin/UserController_20210318142647.java
b4511ca644becf900040be78a0386551b31de0d1
[]
no_license
xuzhu2017/land-management-assist
cb384430373fd2b09d67b9a3857927989f1c5a42
c0d4a3625d3ca4e92451be42b3548c9dde577b11
refs/heads/master
2023-04-15T19:54:16.148789
2021-05-07T07:04:11
2021-05-07T07:04:11
333,630,288
0
0
null
null
null
null
UTF-8
Java
false
false
1,995
java
package com.xz.landmanagementassist.controller.admin; import javax.validation.Valid; import com.baomidou.mybatisplus.core.metadata.IPage; import com.xz.landmanagementassist.controller.BaseController; import com.xz.landmanagementassist.domain.common.Result; import com.xz.landmanagementassist.domain.dto.admin.UserDTO; import com.xz.landmanagementassist.domain.dto.query.UserQueryDTO; import com.xz.landmanagementassist.domain.entity.admin.UserEntity; import com.xz.landmanagementassist.exception.ErrorInfoEnum; import com.xz.landmanagementassist.service.admin.AdminUserRoleService; import com.xz.landmanagementassist.service.admin.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; /** * UserController * * @author xuzhu * @date 2021-3-18 13:10:27 */ public class UserController extends BaseController { @Autowired UserService userService; @Autowired AdminUserRoleService adminUserRoleService; @GetMapping("/api/admin/user") public Result<IPage<UserEntity>> listUsers() { return Result.success(userService.selectUserList(new UserQueryDTO())); } @PutMapping("/api/admin/user/password") public Result<UserDTO> resetPassword(@RequestBody @Valid UserDTO requestUser) { return Result.success(userService.resetPassword(requestUser)); } @PutMapping("/api/admin/user") public Result<Boolean> update(@RequestBody @Valid UserDTO requestUser) { return Result.success(userService.update(requestUser), ErrorInfoEnum.UPDATE_SUCCESS); } @DeleteMapping("/api/admin/user") public Result<Boolean> delete(@RequestBody @Valid UserDTO requestUser) { return Result.success(userService.delete(requestUser), ErrorInfoEnum.DELETE_SUCCESS); } }
[ "a753090302@163.com" ]
a753090302@163.com
89d548839130607cf712c71a5aa5f7e01e36ad3a
12cca0e87b82f816e7765a8ec77c8d997e1e087a
/reuze/aa_TreeSearchBestFirstSearchRecursive.java
a94583972170a16feceefa2e2117001db4b96014
[]
no_license
mageru/softwarereuse
b970e734783bfb6b6de846d226f1dac53f6e68b6
b72af735321ec29e768c76b0cd0c1addb7a07c98
refs/heads/master
2020-06-08T21:26:41.704118
2012-10-25T02:24:28
2012-10-25T02:24:28
5,502,804
1
0
null
null
null
null
UTF-8
Java
false
false
7,009
java
package reuze; import java.util.ArrayList; import java.util.List; import reuze.aa_i_Action; import reuze.das_i_TreeSearchEvaluationFunction; import reuze.aa_TreeSearchNode; import reuze.aa_TreeSearchNodeExpander; import reuze.a_Problem; import reuze.das_i_SearchProblem; import reuze.aa_SearchUtils; /** * Artificial Intelligence A Modern Approach (3rd Edition): Figure 3.26, page * 99.<br> * <br> * * <pre> * function RECURSIVE-BEST-FIRST-SEARCH(problem) returns a solution, or failure * return RBFS(problem, MAKE-NODE(problem.INITIAL-STATE), infinity) * * function RBFS(problem, node, f_limit) returns a solution, or failure and a new f-cost limit * if problem.GOAL-TEST(node.STATE) then return SOLUTION(node) * successors &lt;- [] * for each action in problem.ACTION(node.STATE) do * add CHILD-NODE(problem, node, action) into successors * if successors is empty then return failure, infinity * for each s in successors do // update f with value from previous search, if any * s.f &lt;- max(s.g + s.h, node.f) * repeat * best &lt;- the lowest f-value node in successors * if best.f &gt; f_limit then return failure, best.f * alternative &lt;- the second-lowest f-value among successors * result, best.f &lt;- RBFS(problem, best, min(f_limit, alternative)) * if result != failure then return result * </pre> * * Figure 3.26 The algorithm for recursive best-first search. * * @author Ciaran O'Reilly * @author Mike Stampone */ public class aa_TreeSearchBestFirstSearchRecursive extends aa_TreeSearchNodeExpander implements das_i_SearchProblem { private final das_i_TreeSearchEvaluationFunction evaluationFunction; private static final String MAX_RECURSIVE_DEPTH = "maxRecursiveDepth"; private static final String PATH_COST = "pathCost"; private static final Double INFINITY = Double.MAX_VALUE; public aa_TreeSearchBestFirstSearchRecursive(das_i_TreeSearchEvaluationFunction ef) { evaluationFunction = ef; } // function RECURSIVE-BEST-FIRST-SEARCH(problem) returns a solution, or // failure public List<aa_i_Action> search(a_Problem p) throws Exception { List<aa_i_Action> actions = new ArrayList<aa_i_Action>(); clearInstrumentation(); // RBFS(problem, MAKE-NODE(INITIAL-STATE[problem]), infinity) aa_TreeSearchNode n = new aa_TreeSearchNode(p.getInitialState()); SearchResult sr = rbfs(p, n, evaluationFunction.f(n), INFINITY, 0); if (sr.getOutcome() == SearchResult.SearchOutcome.SOLUTION_FOUND) { aa_TreeSearchNode s = sr.getSolution(); actions = aa_SearchUtils.actionsFromNodes(s.getPathFromRoot()); setPathCost(s.getPathCost()); } // Empty List can indicate already at Goal // or unable to find valid set of actions return actions; } /** * Sets all metrics to zero. */ @Override public void clearInstrumentation() { super.clearInstrumentation(); metrics.set(MAX_RECURSIVE_DEPTH, 0); metrics.set(PATH_COST, 0.0); } /** * Increases the maximum recursive depth if the specified depth is greater * than the current maximum. * * @param recursiveDepth * the depth of the current path */ public void setMaxRecursiveDepth(int recursiveDepth) { int maxRdepth = metrics.getInt(MAX_RECURSIVE_DEPTH); if (recursiveDepth > maxRdepth) { metrics.set(MAX_RECURSIVE_DEPTH, recursiveDepth); } } /** * Returns the maximum recursive depth. * * @return the maximum recursive depth. */ public int getMaxRecursiveDepth() { return metrics.getInt(MAX_RECURSIVE_DEPTH); } /** * Returns the path cost. * * @return the path cost */ public double getPathCost() { return metrics.getDouble(PATH_COST); } /** * Sets the path cost. * * @param pathCost * the cost of the path */ public void setPathCost(Double pathCost) { metrics.set(PATH_COST, pathCost); } // // PRIVATE METHODS // // function RBFS(problem, node, f_limit) returns a solution, or failure and // a new f-cost limit private SearchResult rbfs(a_Problem p, aa_TreeSearchNode n, double node_f, double fLimit, int recursiveDepth) { setMaxRecursiveDepth(recursiveDepth); // if problem.GOAL-TEST(node.STATE) then return SOLUTION(node) if (aa_SearchUtils.isGoalState(p, n)) { return new SearchResult(n, fLimit); } // successors <- [] // for each action in problem.ACTION(node.STATE) do // add CHILD-NODE(problem, node, action) into successors List<aa_TreeSearchNode> successors = expandNode(n, p); // if successors is empty then return failure, infinity if (0 == successors.size()) { return new SearchResult(null, INFINITY); } double[] f = new double[successors.size()]; // for each s in successors do // update f with value from previous search, if any int size = successors.size(); for (int s = 0; s < size; s++) { // s.f <- max(s.g + s.h, node.f) f[s] = Math.max(evaluationFunction.f(successors.get(s)), node_f); } // repeat while (true) { // best <- the lowest f-value node in successors int bestIndex = getBestFValueIndex(f); // if best.f > f_limit then return failure, best.f if (f[bestIndex] > fLimit) { return new SearchResult(null, f[bestIndex]); } // if best.f > f_limit then return failure, best.f int altIndex = getNextBestFValueIndex(f, bestIndex); // result, best.f <- RBFS(problem, best, min(f_limit, alternative)) SearchResult sr = rbfs(p, successors.get(bestIndex), f[bestIndex], Math.min(fLimit, f[altIndex]), recursiveDepth + 1); f[bestIndex] = sr.getFCostLimit(); // if result != failure then return result if (sr.getOutcome() == SearchResult.SearchOutcome.SOLUTION_FOUND) { return sr; } } } // the lowest f-value node private int getBestFValueIndex(double[] f) { int lidx = 0; Double lowestSoFar = INFINITY; for (int i = 0; i < f.length; i++) { if (f[i] < lowestSoFar) { lowestSoFar = f[i]; lidx = i; } } return lidx; } // the second-lowest f-value private int getNextBestFValueIndex(double[] f, int bestIndex) { // Array may only contain 1 item (i.e. no alternative), // therefore default to bestIndex initially int lidx = bestIndex; Double lowestSoFar = INFINITY; for (int i = 0; i < f.length; i++) { if (i != bestIndex && f[i] < lowestSoFar) { lowestSoFar = f[i]; lidx = i; } } return lidx; } } class SearchResult { public enum SearchOutcome { FAILURE, SOLUTION_FOUND }; private aa_TreeSearchNode solution; private SearchOutcome outcome; private final Double fCostLimit; public SearchResult(aa_TreeSearchNode solution, Double fCostLimit) { if (null == solution) { this.outcome = SearchOutcome.FAILURE; } else { this.outcome = SearchOutcome.SOLUTION_FOUND; this.solution = solution; } this.fCostLimit = fCostLimit; } public SearchOutcome getOutcome() { return outcome; } public aa_TreeSearchNode getSolution() { return solution; } public Double getFCostLimit() { return fCostLimit; } }
[ "jmiller9@gmail.com" ]
jmiller9@gmail.com
90c3caf57a2c28f9bc8d81662b9b489d44fb7d66
77623d6dd90f2d1a401ee720adb41c3c0c264715
/DiffTGen-result/output/Chart_24_1_capgen/target/0/20/evosuite-tests/org/jfree/chart/renderer/GrayPaintScale_ESTest_scaffolding.java
f49b78d1cbf68b18aed391ab9939b961afe68882
[]
no_license
wuhongjun15/overfitting-study
40be0f062bbd6716d8de6b06454b8c73bae3438d
5093979e861cda6575242d92ca12355a26ca55e0
refs/heads/master
2021-04-17T05:37:48.393527
2020-04-11T01:53:53
2020-04-11T01:53:53
249,413,962
0
0
null
null
null
null
UTF-8
Java
false
false
4,340
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Mar 27 10:19:01 GMT 2020 */ package org.jfree.chart.renderer; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class GrayPaintScale_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.jfree.chart.renderer.GrayPaintScale"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("file.encoding", "UTF-8"); java.lang.System.setProperty("java.awt.headless", "true"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); java.lang.System.setProperty("user.country", "US"); java.lang.System.setProperty("user.dir", "/home/whj/dowork/DiffTGen/extra_output/Chart_24_1_capgen/target/0/20"); java.lang.System.setProperty("user.home", "/home/whj"); java.lang.System.setProperty("user.language", "en"); java.lang.System.setProperty("user.name", "whj"); java.lang.System.setProperty("user.timezone", "Asia/Shanghai"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(GrayPaintScale_ESTest_scaffolding.class.getClassLoader() , "org.jfree.chart.renderer.PaintScale", "org.jfree.chart.renderer.GrayPaintScale", "org.jfree.chart.util.PublicCloneable" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(GrayPaintScale_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.jfree.chart.renderer.GrayPaintScale" ); } }
[ "375882286@qq.com" ]
375882286@qq.com
f190308baac5164d3feca815f787c56a5b061a03
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_14ecfd587e6e7cb537d745fd2e67e7dc4b0aaa4d/ZLDir/11_14ecfd587e6e7cb537d745fd2e67e7dc4b0aaa4d_ZLDir_s.java
6d5597339d0679082a369ec5a7fac0d1d6c69898
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,146
java
package org.zlibrary.core.filesystem; import java.util.*; import org.zlibrary.core.util.*; public abstract class ZLDir { private String myPath; public static ZLDir getRoot() { return ZLFSManager.getInstance().getRootDirectory(); } public ZLDir(String path) { myPath = path; ZLFSManager.getInstance().normalize(myPath); } public String getPath() { return myPath; } public String getName() { int index = ZLFSManager.getInstance().findLastFileNameDelimiter(myPath); return myPath.substring(index + 1); } public String getParentPath() { return ZLFSManager.getInstance().getParentPath(myPath); } public String getItemPath(String itemName) { if (itemName == "..") { return getParentPath(); } else { return isRoot() ? myPath + itemName : myPath + getDelimiter() + itemName; } } public boolean isRoot() { return myPath == ZLFSManager.getInstance().getRootDirectoryPath(); } abstract public ArrayList collectSubDirs(); abstract public ArrayList collectFiles(); abstract protected String getDelimiter(); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c91c4275146657c632772506c1c019290a275c52
2e3a3ce3e0503e88474b6a4b7c521d04bed581bd
/medialibrary/src/main/java/com/cgfay/media/transcoder/MediaTranscoder.java
8e09f1d52848b24da3dd8a675e4056a3d21960f1
[ "Apache-2.0" ]
permissive
glsdb/CainCamera
ef47f7abc35210605eeb75d8c96765902de8dfba
d03690352666c967a4dd37d625cf087e4e15428a
refs/heads/master
2021-02-05T01:52:51.963078
2020-01-20T13:11:01
2020-01-20T13:11:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,969
java
package com.cgfay.media.transcoder; import androidx.annotation.NonNull; /** * 媒体转码器 */ public class MediaTranscoder { static { System.loadLibrary("ffmpeg"); System.loadLibrary("yuv"); System.loadLibrary("cainfilter"); System.loadLibrary("transcoder"); } // 初始化 private native long nativeInit(); // 释放资源 private native void nativeRelease(long handle); // 设置转码监听器 private native void setTranscodeListener(long handle, Object listener); // 设置输出文件 private native void setOutputPath(long handle, String dstPath); // 指定是否使用硬解码(默认使用硬解硬编) private native void setUseHardCodec(long handle, boolean hardCodec); // 设置视频旋转角度 private native void setVideoRotate(long handle, int rotate); // 设置视频输出参数 private native void setVideoParams(long handle, int width, int height, int frameRate, int pixelFormat, long maxBitrate, int quality); // 设置音频输出参数 private native void setAudioParams(long handle, int sampleRate, int sampleFormat, int channelCount); // 开始转码 private native void startTranscode(long handle); // 停止转码 private native void stopTranscode(long handle); private long handle; private String dstPath; MediaTranscoder() { handle = nativeInit(); } @Override protected void finalize() throws Throwable { release(); super.finalize(); } /** * 释放资源 */ public void release() { if (handle != 0) { nativeRelease(handle); handle = 0; } } /** * 设置转码监听器 * @param listener */ public void setTranscodeListener(OnTranscodeListener listener) { setTranscodeListener(handle, listener); } /** * 设置输出文件 * @param dstPath */ public void setOutput(String dstPath) { this.dstPath = dstPath; setOutputPath(handle, dstPath); } /** * 获取输出路径 * @return */ public String getOutput() { return dstPath; } /** * 设置是否使用硬解硬编 */ public void setUseHardCodec(boolean hardCodec) { setUseHardCodec(handle, hardCodec); } /** * 设置转码输出的旋转角度 * @param rotate */ public void setVideoRotate(int rotate) { setVideoRotate(handle, rotate); } /** * 设置视频输出参数 * @param width * @param height * @param frameRate * @param pixelFormat * @param maxBitrate * @param quality */ public void setVideoParams(int width, int height, int frameRate, int pixelFormat, long maxBitrate, int quality) { setVideoParams(handle, width, height, frameRate, pixelFormat, maxBitrate, quality); } /** * 设置音频输出参数 * @param sampleRate * @param sampleFormat * @param channels */ public void setAudioParams(int sampleRate, int sampleFormat, int channels) { setAudioParams(handle, sampleRate, sampleFormat, channels); } /** * 开始转码 */ public void startTranscode() { startTranscode(handle); } /** * 停止转码 */ public void stopTranscode() { stopTranscode(handle); } /** * 转码参数 */ public class Builder { private String mDstPath; // 文件输出路径 // 视频参数 private int mWidth; // 视频宽度 private int mHeight; // 视频高度 private int mRotate; // 旋转角度 private int mPixelFormat; // 像素格式 private int mFrameRate; // 帧率,默认30fps private long mMaxBitRate; // 最大比特率,当无法达到设置的quality是,quality会自动调整 private int mQuality; // 视频质量系数,默认为23, 推荐17~28之间,值越小,质量越高 // 音频参数 private int mSampleRate; // 采样率 private int mSampleFormat; // 采样格式 private int mChannels; // 声道数 private boolean mUseHardCodec; // 是否使用硬解硬编 public Builder(@NonNull String dstPath) { mDstPath = dstPath; mWidth = -1; mHeight = -1; mRotate = 0; mPixelFormat = -1; mFrameRate = -1; mMaxBitRate = -1; mQuality = 23; mSampleRate = -1; mSampleFormat = -1; mChannels = -1; mUseHardCodec = true; } /** * 设置视频转码输出参数 * @param width * @param height * @param pixelFormat * @param frameRate * @return */ public Builder setVideoParams(int width, int height, int pixelFormat, int frameRate) { mWidth = width; mHeight = height; mPixelFormat = pixelFormat; mFrameRate = frameRate; return this; } /** * 设置音频转码输出参数 * @param sampleRate * @param sampleFormat * @param channels * @return */ public Builder setAudioParams(int sampleRate, int sampleFormat, int channels) { mSampleRate = sampleRate; mSampleFormat = sampleFormat; mChannels = channels; return this; } /** * 设置旋转角度 * @param rotate * @return */ public Builder setRotate(int rotate) { mRotate = rotate; return this; } /** * 设置最大比特率 * @param maxBitRate * @return */ public Builder setMaxBitRate(long maxBitRate) { mMaxBitRate = maxBitRate; return this; } /** * 设置质量系数,只有在软编码才有效 * @param quality * @return */ public Builder setQuality(int quality) { mQuality = quality; return this; } /** * 创建媒体转码器 */ public MediaTranscoder create() { MediaTranscoder transcoder = new MediaTranscoder(); transcoder.setOutput(mDstPath); transcoder.setVideoParams(mWidth, mHeight, mFrameRate, mPixelFormat, mMaxBitRate, mQuality); transcoder.setVideoRotate(mRotate); transcoder.setAudioParams(mSampleRate, mSampleFormat, mChannels); transcoder.setUseHardCodec(mUseHardCodec); return transcoder; } } }
[ "cain.huang@outlook.com" ]
cain.huang@outlook.com
b3f27c66775cf5ded1d256b1933784af6353343c
1e853e8f1367d015056cd078328ef47df65074bc
/drools-wb-screens/drools-wb-enum-editor/drools-wb-enum-editor-client/src/main/java/org/drools/workbench/screens/enums/client/widget/DeleteButtonCellWidget.java
b87d63a156011a35661cc08112e82179be5d5bf9
[]
no_license
anantjot12/drools-wb
207478a787599b586a8b5e3cd1ca23ff5093c16b
e7a27bd86fe596d8599837b81e4689768065031a
refs/heads/master
2020-05-29T11:06:52.997404
2014-11-24T14:36:27
2014-11-24T14:36:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,378
java
/* * Copyright 2012 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.drools.workbench.screens.enums.client.widget; import com.google.gwt.cell.client.ButtonCell; import com.google.gwt.resources.client.ImageResource; import com.google.gwt.safehtml.shared.SafeHtml; import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import org.kie.workbench.common.widgets.client.resources.ItemImages; public class DeleteButtonCellWidget extends ButtonCell { @Override public void render( Context context, SafeHtml data, SafeHtmlBuilder sb ) { final ImageResource imageResource = ItemImages.INSTANCE.deleteItemSmall(); sb.appendHtmlConstant( "<input type=\"image\" src=\"" + imageResource.getURL() + "\" tabindex=\"-1\">" ); sb.appendHtmlConstant( "</input>" ); } }
[ "michael.anstis@gmail.com" ]
michael.anstis@gmail.com
72f2535ce486e6135d3e0fc902ee774d37414d35
ad98fbf266777d7befb9b258d4053d88d5663fef
/zookeeper-server/src/main/java/org/apache/zookeeper/common/AtomicFileOutputStream.java
d641ba5a86fd412ce42e2db88358bdb04f2932e0
[ "Apache-2.0" ]
permissive
WenXiangWu/zookeeper
c666404211958d6cc054eec3c49c2ad50f3073a0
97e18633e66074c32aa1bd128e7475a6a8a09c8f
refs/heads/master
2023-04-01T04:14:06.806989
2021-04-06T10:36:42
2021-04-06T10:36:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,607
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.zookeeper.common; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FilterOutputStream; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /* * This code is originally from HDFS, see the similarly named files there * in case of bug fixing, history, etc... */ /** * A FileOutputStream that has the property that it will only show up at its * destination once it has been entirely written and flushed to disk. While * being written, it will use a .tmp suffix. * * When the output stream is closed, it is flushed, fsynced, and will be moved * into place, overwriting any file that already exists at that location. * * <b>NOTE</b>: on Windows platforms, it will not atomically replace the target * file - instead the target file is deleted before this one is moved into * place. */ public class AtomicFileOutputStream extends FilterOutputStream { public static final String TMP_EXTENSION = ".tmp"; private static final Logger LOG = LoggerFactory.getLogger(AtomicFileOutputStream.class); private final File origFile; private final File tmpFile; public AtomicFileOutputStream(File f) throws FileNotFoundException { // Code unfortunately must be duplicated below since we can't assign // anything // before calling super super(new FileOutputStream(new File(f.getParentFile(), f.getName() + TMP_EXTENSION))); origFile = f.getAbsoluteFile(); tmpFile = new File(f.getParentFile(), f.getName() + TMP_EXTENSION).getAbsoluteFile(); } /** * The default write method in FilterOutputStream does not call the write * method of its underlying input stream with the same arguments. Instead * it writes the data byte by byte, override it here to make it more * efficient. */ @Override public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len); } @Override public void close() throws IOException { boolean triedToClose = false, success = false; try { flush(); ((FileOutputStream) out).getFD().sync(); triedToClose = true; super.close(); success = true; } finally { if (success) { boolean renamed = tmpFile.renameTo(origFile); if (!renamed) { // On windows, renameTo does not replace. if (!origFile.delete() || !tmpFile.renameTo(origFile)) { throw new IOException("Could not rename temporary file " + tmpFile + " to " + origFile); } } } else { if (!triedToClose) { // If we failed when flushing, try to close it to not leak // an FD IOUtils.closeStream(out); } // close wasn't successful, try to delete the tmp file if (!tmpFile.delete()) { LOG.warn("Unable to delete tmp file {}", tmpFile); } } } } /** * Close the atomic file, but do not "commit" the temporary file on top of * the destination. This should be used if there is a failure in writing. */ public void abort() { try { super.close(); } catch (IOException ioe) { LOG.warn("Unable to abort file {}", tmpFile, ioe); } if (!tmpFile.delete()) { LOG.warn("Unable to delete tmp file during abort {}", tmpFile); } } }
[ "280971337@qq.com" ]
280971337@qq.com
534b080eb7036ffa3c4c30a91a085aa793d506dd
78fddaeff9b3bb94ab0f65e60317ce8916b0098b
/src/com/trc/exception/management/PaymentManagementException.java
9b9ebf7e31e6707f8190d572520ceea0378e0e2d
[]
no_license
pongalong/webonthego
1f7666e21428025408037a5128e928677db26b33
d2970a3c93abb56906733c146c273eb7fdf6685d
refs/heads/master
2021-01-10T19:57:25.061696
2013-06-25T21:53:01
2013-06-25T21:53:01
7,276,071
1
0
null
null
null
null
UTF-8
Java
false
false
527
java
package com.trc.exception.management; import com.trc.exception.ManagementException; public class PaymentManagementException extends ManagementException { private static final long serialVersionUID = 1L; public PaymentManagementException() { super(); } public PaymentManagementException(String message) { super(message); } public PaymentManagementException(Throwable cause) { super(cause); } public PaymentManagementException(String message, Throwable cause) { super(message, cause); } }
[ "jonathan.pong@gmail.com" ]
jonathan.pong@gmail.com
7c1039fbc9075113b862d424615acc1752a6bdb7
30455dcf8d0db40aaa36cd54a6cf75a83812fcfb
/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
bcfde580b483cb73d8efe0f1baf45b65ff187314
[]
no_license
excellmania/FastCharger
76c294ca3d172bfdc8bbba46c0f9d38a7e444510
536d0ead49ee2574e7f6a889e81515b899c23a9a
refs/heads/master
2020-05-01T03:26:45.850182
2019-03-23T05:53:49
2019-03-23T05:53:49
177,245,158
0
0
null
null
null
null
UTF-8
Java
false
false
1,986
java
package org.apache.http.impl.conn; import org.apache.http.annotation.Immutable; import org.apache.http.io.HttpTransportMetrics; import org.apache.http.io.SessionOutputBuffer; import org.apache.http.protocol.HTTP; import org.apache.http.util.CharArrayBuffer; @Immutable public class LoggingSessionOutputBuffer implements SessionOutputBuffer { private final String charset; private final SessionOutputBuffer out; private final Wire wire; public LoggingSessionOutputBuffer(SessionOutputBuffer sessionOutputBuffer, Wire wire) { this(sessionOutputBuffer, wire, null); } public LoggingSessionOutputBuffer(SessionOutputBuffer sessionOutputBuffer, Wire wire, String str) { this.out = sessionOutputBuffer; this.wire = wire; if (str == null) { str = HTTP.ASCII; } this.charset = str; } public void flush() { this.out.flush(); } public HttpTransportMetrics getMetrics() { return this.out.getMetrics(); } public void write(int i) { this.out.write(i); if (this.wire.enabled()) { this.wire.output(i); } } public void write(byte[] bArr) { this.out.write(bArr); if (this.wire.enabled()) { this.wire.output(bArr); } } public void write(byte[] bArr, int i, int i2) { this.out.write(bArr, i, i2); if (this.wire.enabled()) { this.wire.output(bArr, i, i2); } } public void writeLine(String str) { this.out.writeLine(str); if (this.wire.enabled()) { this.wire.output((str + "\r\n").getBytes(this.charset)); } } public void writeLine(CharArrayBuffer charArrayBuffer) { this.out.writeLine(charArrayBuffer); if (this.wire.enabled()) { this.wire.output((new String(charArrayBuffer.buffer(), 0, charArrayBuffer.length()) + "\r\n").getBytes(this.charset)); } } }
[ "47793867+excellmania@users.noreply.github.com" ]
47793867+excellmania@users.noreply.github.com
63753940acc19abf74a9c24ea3ab0d7b1ee4b564
ac947063621178b5f6c4460b156e64115268634a
/src/main/test/com/stackroute/pe5/BooleanMapTest.java
cdda6bcda976e980c9ca56bacc5af6ab0f9c96c8
[]
no_license
naneeth/PE5
c112f4fd1a73b231e4c90cbde2cce3be563627c1
ca96c16a89b8f603a873126f2ea306c5f4b73337
refs/heads/master
2020-04-16T01:31:09.640498
2019-01-17T14:06:52
2019-01-17T14:06:52
165,176,896
0
0
null
null
null
null
UTF-8
Java
false
false
1,384
java
package com.stackroute.pe5; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.util.HashMap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class BooleanMapTest { @Before public void setUp() throws Exception { test = new BooleanMap(); } @After public void tearDown() throws Exception { test = null; } BooleanMap test; @Test public void TestBoolean1() { String arr[] = {"a", "b", "c", "e", "a", "c", "c", "d"}; HashMap<String, Boolean> map = new HashMap<>(); map.put("a", true); map.put("b", false); map.put("c", true); map.put("d", false); map.put("e", false); assertEquals( map, test.boolMap(arr)); } @Test public void BooleanTest2() { String arr[] = {"a", "a", "a", "b", "b", "b", "b", "b", "c", "d"}; HashMap<String, Boolean> map = new HashMap<>(); map.put("a", true); map.put("b", true); map.put("c", false); map.put("d", false); assertEquals( map, test.boolMap(arr)); } @Test public void StringBooleanFailure() { BooleanMap test = new BooleanMap(); String arr[] = {"a","a","a","b","b","b","b","b","c"}; assertNotNull("Error",test.boolMap(arr)); } }
[ "you@example.com" ]
you@example.com
fb738387f6e5bbb9b71e7c15c958f15e5d89c216
e808d3e97e19558d15bacbcfeb9785014f2eb93a
/onebusaway-geospatial/src/main/java/org/onebusaway/geospatial/grid/FilteredGrid.java
75d2243bb5e76695e28e68e2ea2dedee50a10986
[ "Apache-2.0" ]
permissive
isabella232/onebusaway-application-modules
82793b63678f21e28c98093cb71b333a2e22a3c1
d2ca6c6e0038d158c9df487cab9f75d18b1214ff
refs/heads/master
2023-03-08T20:02:35.766999
2019-01-03T16:41:11
2019-01-03T16:41:11
335,592,972
0
0
NOASSERTION
2021-02-24T05:43:58
2021-02-03T10:50:26
null
UTF-8
Java
false
false
1,674
java
/** * Copyright (C) 2011 Brian Ferris <bdferris@onebusaway.org> * * 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.onebusaway.geospatial.grid; import org.onebusaway.utility.filter.FilteredIterable; import org.onebusaway.utility.filter.IFilter; public class FilteredGrid<T> extends AbstractGrid<T> { private Grid<T> _grid; private IFilter<T> _filter; public FilteredGrid(Grid<T> grid, IFilter<T> filter) { _grid = grid; _filter = filter; } public boolean contains(int x, int y) { return get(x, y) != null; } public T get(int x, int y) { T element = _grid.get(x, y); if (element != null && _filter.isEnabled(element)) return element; return null; } public Iterable<Grid.Entry<T>> getEntries() { return new FilteredIterable<Grid.Entry<T>>(_grid.getEntries(), new EntryFilter()); } public void set(int x, int y, T element) { if (_filter.isEnabled(element)) _grid.set(x, y, element); } private class EntryFilter implements IFilter<Grid.Entry<T>> { public boolean isEnabled(Grid.Entry<T> entry) { return _filter.isEnabled(entry.getValue()); } } }
[ "bdferris@google.com" ]
bdferris@google.com
36d726d60eeffbcbe06fe2e87aae0cc952d3bd5f
66220fbb2b7d99755860cecb02d2e02f946e0f23
/src/net/sourceforge/plantuml/graphic/USymbolFolder.java
c0f00c730b3462a7cab4186ac3a5c6e2d1083935
[ "MIT" ]
permissive
isabella232/plantuml-mit
27e7c73143241cb13b577203673e3882292e686e
63b2bdb853174c170f304bc56f97294969a87774
refs/heads/master
2022-11-09T00:41:48.471405
2020-06-28T12:42:10
2020-06-28T12:42:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,735
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * Licensed under The MIT License (Massachusetts Institute of Technology License) * * See http://opensource.org/licenses/MIT * * 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. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.graphic; import java.awt.geom.Dimension2D; import java.awt.geom.Point2D; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphicStencil; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UPath; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UTranslate; public class USymbolFolder extends USymbol { private final static int marginTitleX1 = 3; private final static int marginTitleX2 = 3; private final static int marginTitleX3 = 7; private final static int marginTitleY0 = 0; private final static int marginTitleY1 = 3; private final static int marginTitleY2 = 3; private final SkinParameter skinParameter; private final boolean showTitle; public USymbolFolder(SkinParameter skinParameter, boolean showTitle) { this.skinParameter = skinParameter; this.showTitle = showTitle; } @Override public String toString() { return super.toString() + " " + skinParameter + " " + showTitle; } @Override public SkinParameter getSkinParameter() { return skinParameter; } private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing, double roundCorner) { final double wtitle; if (dimTitle.getWidth() == 0) { wtitle = Math.max(30, width / 4); } else { wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2; } final double htitle = getHTitle(dimTitle); final Shadowable shape; if (roundCorner == 0) { final UPolygon poly = new UPolygon(); poly.addPoint(0, 0); poly.addPoint(wtitle, 0); poly.addPoint(wtitle + marginTitleX3, htitle); poly.addPoint(width, htitle); poly.addPoint(width, height); poly.addPoint(0, height); poly.addPoint(0, 0); shape = poly; } else { final UPath path = new UPath(); path.moveTo(roundCorner / 2, 0); path.lineTo(wtitle - roundCorner / 2, 0); // path.lineTo(wtitle, roundCorner / 2); path.arcTo(new Point2D.Double(wtitle, roundCorner / 2), roundCorner / 2 * 1.5, 0, 1); path.lineTo(wtitle + marginTitleX3, htitle); path.lineTo(width - roundCorner / 2, htitle); path.arcTo(new Point2D.Double(width, htitle + roundCorner / 2), roundCorner / 2, 0, 1); path.lineTo(width, height - roundCorner / 2); path.arcTo(new Point2D.Double(width - roundCorner / 2, height), roundCorner / 2, 0, 1); path.lineTo(roundCorner / 2, height); path.arcTo(new Point2D.Double(0, height - roundCorner / 2), roundCorner / 2, 0, 1); path.lineTo(0, roundCorner / 2); path.arcTo(new Point2D.Double(roundCorner / 2, 0), roundCorner / 2, 0, 1); path.closePath(); shape = path; } if (shadowing) { shape.setDeltaShadow(3.0); } ug.draw(shape); ug.apply(UTranslate.dy(htitle)).draw(ULine.hline(wtitle + marginTitleX3)); } private double getHTitle(Dimension2D dimTitle) { final double htitle; if (dimTitle.getWidth() == 0) { htitle = 10; } else { htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2; } return htitle; } private Margin getMargin() { return new Margin(10, 10 + 10, 10 + 3, 10); } @Override public TextBlock asSmall(final TextBlock name, final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) { if (name == null) { throw new IllegalArgumentException(); } return new AbstractTextBlock() { public void drawU(UGraphic ug) { final Dimension2D dim = calculateDimension(ug.getStringBounder()); ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke()); ug = symbolContext.apply(ug); final Dimension2D dimName = showTitle ? name.calculateDimension(ug.getStringBounder()) : new Dimension2DDouble(40, 15); drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing(), symbolContext.getRoundCorner()); final Margin margin = getMargin(); final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER); if (showTitle) { name.drawU(ug.apply(new UTranslate(4, 3))); } tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight()))); } public Dimension2D calculateDimension(StringBounder stringBounder) { final Dimension2D dimName = name.calculateDimension(stringBounder); final Dimension2D dimLabel = label.calculateDimension(stringBounder); final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder); return getMargin().addDimension(Dimension2DDouble.mergeTB(dimName, dimStereo, dimLabel)); } }; } @Override public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype, final double width, final double height, final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) { return new AbstractTextBlock() { public void drawU(UGraphic ug) { final StringBounder stringBounder = ug.getStringBounder(); final Dimension2D dim = calculateDimension(stringBounder); ug = symbolContext.apply(ug); final Dimension2D dimTitle = title.calculateDimension(stringBounder); drawFolder(ug, dim.getWidth(), dim.getHeight(), dimTitle, symbolContext.isShadowing(), symbolContext.getRoundCorner()); title.drawU(ug.apply(new UTranslate(4, 2))); final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder); final double posStereo = (width - dimStereo.getWidth()) / 2; stereotype.drawU(ug.apply(new UTranslate(4 + posStereo, 2 + getHTitle(dimTitle)))); } public Dimension2D calculateDimension(StringBounder stringBounder) { return new Dimension2DDouble(width, height); } }; } @Override public boolean manageHorizontalLine() { return true; } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
1a386bd70a01ebbef164d1ef116ac5194480de71
a0127e392c8fef7392188215aab7e4e31741c634
/core/scope/src/main/java/xapi/scope/spi/package-info.java
934ccedb5dbbd0ec4a606adf32e5a58cd526341b
[ "BSD-3-Clause" ]
permissive
WeTheInternet/xapi
1f0918023bc0b44b9ddac4af92f68cac162470bf
04416d1527f82b5975f9d48bf57f7e407aa480e3
refs/heads/master
2023-08-13T23:00:04.939034
2022-11-26T09:12:09
2022-11-26T09:12:09
9,408,774
24
8
NOASSERTION
2022-07-07T21:43:55
2013-04-13T04:42:51
Java
UTF-8
Java
false
false
446
java
/** * The set of interfaces that you need to implement * in order to "provide" xapi.scope.api; * * If you are using a "native" container, * like j2ee, vert.x, guice, dagger, etc, * you will likely just want to support these types * by wrapping some type we don't know about. * * If you want to build your own container, * then implement and use these interfaces, * and feel free to hack 'n send patches! * */ package xapi.scope.spi;
[ "James@WeTheInter.net" ]
James@WeTheInter.net
82028746a4bca8321db3be827d3a0d8ff06f18bf
01d6b951ce24b3d2c89b1ffa18fd79aaa9c4599c
/src/com/appyet/manager/av.java
396efd5d0cceb7da05f7bcc3346b61319da7880c
[]
no_license
mohsenuss91/KGBANDROID
1a5cc246bf17b85dae4733c10a48cc2c34f978fd
a2906e3de617b66c5927a4d1fd85f6a3c6ed89d0
refs/heads/master
2016-09-03T06:45:38.912322
2015-03-08T12:03:35
2015-03-08T12:03:35
31,847,141
0
0
null
null
null
null
UTF-8
Java
false
false
806
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.appyet.manager; import android.media.MediaPlayer; import android.view.View; import com.appyet.d.d; // Referenced classes of package com.appyet.manager: // as final class av implements android.view.View.OnClickListener { final as a; av(as as1) { a = as1; super(); } public final void onClick(View view) { try { if (as.f(a) != null && as.f(a).isPlaying()) { a.a(-30); } return; } catch (Exception exception) { d.a(exception); } } }
[ "mohsenuss91@hotmail.com" ]
mohsenuss91@hotmail.com
3d963cf0b6dcea33aa32ea0d81b27dc4e1c014ae
2bd168ab80aa283748908ef6fd0827cb9a7d1200
/src/test/java/pages/AdminAddPage.java
bf0b1eed6d0f63ab89d235c7f8dd0666e14ce333
[]
no_license
ridvanceko/OrangeHRM
58f03cf8d93d906947f6fd6a65cfc17ce239c861
8fffcb7bfc11025bceb2f5d760cbbcbeaa32bc48
refs/heads/master
2023-03-27T21:26:42.463846
2021-03-19T20:40:15
2021-03-19T20:40:15
349,247,970
0
0
null
2021-03-19T01:38:13
2021-03-18T23:46:35
Java
UTF-8
Java
false
false
572
java
package pages; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class AdminAddPage { public AdminAddPage(WebDriver driver) { PageFactory.initElements(driver, this); } @FindBy(id = "menu_admin_viewAdminModule") public WebElement adminButton; @FindBy(id = "btnAdd") public WebElement addButton; public void clickAdmin() { adminButton.click(); } public void clickAddButton() { addButton.click(); } }
[ "ridvanceko@gmail.com" ]
ridvanceko@gmail.com
8c5e699b95779d5837826a429713754fb6430ec2
1264e4d85f7119c4eee2f3f350df84791ffddb6d
/Leetcode/src/Q1849_Splitting_a_String_Into_Descending_Consecutive_Values.java
30d8ac50a236c8c17ec747c39e5d5accd04d25bb
[]
no_license
bumblebee618/mylc
37eaa59d19d820aa54f00989c50732f27d84e86f
70e2821b4eb4c5ddbd492a818e3c445a6fcbb72c
refs/heads/master
2022-06-24T11:49:03.987571
2022-05-29T22:59:58
2022-06-01T00:15:56
223,346,232
0
1
null
null
null
null
UTF-8
Java
false
false
2,723
java
/*** * * @author jackie * * You are given a string s that consists of only digits. Check if we can split s into two or more non-empty substrings such that the numerical values of the substrings are in descending order and the difference between numerical values of every two adjacent substrings is equal to 1. For example, the string s = "0090089" can be split into ["0090", "089"] with numerical values [90,89]. The values are in descending order and adjacent values differ by 1, so this way is valid. Another example, the string s = "001" can be split into ["0", "01"], ["00", "1"], or ["0", "0", "1"]. However all the ways are invalid because they have numerical values [0,1], [0,1], and [0,0,1] respectively, all of which are not in descending order. Return true if it is possible to split s​​​​​​ as described above, or false otherwise. A substring is a contiguous sequence of characters in a string. Example 1: Input: s = "1234" Output: false Explanation: There is no valid way to split s. Example 2: Input: s = "050043" Output: true Explanation: s can be split into ["05", "004", "3"] with numerical values [5,4,3]. The values are in descending order with adjacent values differing by 1. Example 3: Input: s = "9080701" Output: false Explanation: There is no valid way to split s. Example 4: Input: s = "10009998" Output: true Explanation: s can be split into ["100", "099", "98"] with numerical values [100,99,98]. The values are in descending order with adjacent values differing by 1. Constraints: 1 <= s.length <= 20 s only consists of digits. */ public class Q1849_Splitting_a_String_Into_Descending_Consecutive_Values { public boolean splitString(String s) { if (s == null || s.length() == 0) { return true; } int size = s.length(); long[][] memo = new long[size][size]; for (int i = 0; i < size; i++) { for (int j = i; j < size; j++) { String str = s.substring(i, j+1); try { long num = Long.parseLong(str); memo[i][j] = num; } catch (Exception e) { // the number exceeds Long maximum, do nothing } } } return backtrack(memo, -1, 0, 0); } private boolean backtrack(long[][] memo, long prevNum, int start, int len) { if (start == memo.length) { return len > 1; } for (int end = start; end < memo.length; end++) { if (prevNum == -1 || memo[start][end] == prevNum - 1) { if (backtrack(memo, memo[start][end], end+1, len+1)) { return true; } } } return false; } }
[ "jackiechan618@gmail.com" ]
jackiechan618@gmail.com
e77011b6f97396547d7f38eb78b4c6ce08e60114
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE89_SQL_Injection/s01/CWE89_SQL_Injection__connect_tcp_executeUpdate_74a.java
3cbad65de4d6f593dd0a9764e5b5772a4db628b8
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
7,420
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE89_SQL_Injection__connect_tcp_executeUpdate_74a.java Label Definition File: CWE89_SQL_Injection.label.xml Template File: sources-sinks-74a.tmpl.java */ /* * @description * CWE: 89 SQL Injection * BadSource: connect_tcp Read data using an outbound tcp connection * GoodSource: A hardcoded string * Sinks: executeUpdate * GoodSink: Use prepared statement and executeUpdate (properly) * BadSink : data concatenated into SQL statement used in executeUpdate(), which could result in SQL Injection * Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package * * */ package testcases.CWE89_SQL_Injection.s01; import testcasesupport.*; import java.util.HashMap; import javax.servlet.http.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.net.Socket; import java.util.logging.Level; public class CWE89_SQL_Injection__connect_tcp_executeUpdate_74a extends AbstractTestCase { public void bad() throws Throwable { String data; data = ""; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } HashMap<Integer,String> dataHashMap = new HashMap<Integer,String>(); dataHashMap.put(0, data); dataHashMap.put(1, data); dataHashMap.put(2, data); (new CWE89_SQL_Injection__connect_tcp_executeUpdate_74b()).badSink(dataHashMap ); } public void good() throws Throwable { goodG2B(); goodB2G(); } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B() throws Throwable { String data; /* FIX: Use a hardcoded string */ data = "foo"; HashMap<Integer,String> dataHashMap = new HashMap<Integer,String>(); dataHashMap.put(0, data); dataHashMap.put(1, data); dataHashMap.put(2, data); (new CWE89_SQL_Injection__connect_tcp_executeUpdate_74b()).goodG2BSink(dataHashMap ); } /* goodB2G() - use BadSource and GoodSink */ private void goodB2G() throws Throwable { String data; data = ""; /* Initialize data */ /* Read data using an outbound tcp connection */ { Socket socket = null; BufferedReader readerBuffered = null; InputStreamReader readerInputStream = null; try { /* Read data using an outbound tcp connection */ socket = new Socket("host.example.org", 39544); /* read input from socket */ readerInputStream = new InputStreamReader(socket.getInputStream(), "UTF-8"); readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data using an outbound tcp connection */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (readerBuffered != null) { readerBuffered.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStream != null) { readerInputStream.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } /* clean up socket objects */ try { if (socket != null) { socket.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing Socket", exceptIO); } } } HashMap<Integer,String> dataHashMap = new HashMap<Integer,String>(); dataHashMap.put(0, data); dataHashMap.put(1, data); dataHashMap.put(2, data); (new CWE89_SQL_Injection__connect_tcp_executeUpdate_74b()).goodB2GSink(dataHashMap ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
b3c3d09295ec18619fa1dbd8a9b75dfd12e25df9
71027e2310f9917cd46ccb6a21c0100487c6b43b
/jaida/freehep-jaida/src/main/java/hep/aida/util/comparison/Chi2ComparisonAlgorithm.java
8abc242e328e0c5858460c34d479b977a38a471e
[]
no_license
kdk-pkg-soft/freehep-ncolor-pdf
f70f99ebdc7a78fc25960f42629e05d3c58f2b03
d317ea43554c75f8ff04e826b4361ad4326574b0
refs/heads/master
2021-01-23T12:18:26.502269
2012-08-22T23:22:21
2012-08-22T23:22:21
5,516,244
1
1
null
null
null
null
UTF-8
Java
false
false
2,699
java
package hep.aida.util.comparison; import hep.aida.ext.IComparisonData; import org.apache.commons.math.distribution.ChiSquaredDistribution; import org.apache.commons.math.distribution.DistributionFactory; /** * * @author The FreeHEP team @ SLAC. * Algorithm taken from http://www.ge.infn.it/geant4/analysis/HEPstatistics/ * */ public class Chi2ComparisonAlgorithm extends AbstractComparisonAlgorithm { private static final String[] names = new String[] {"chiSquared", "chi2"}; private static final int dType = ONLY_BINNED_DATA; private static final int eType = ONLY_SAME_NUMBER_OF_EVENTS; public Chi2ComparisonAlgorithm() { super(dType, eType); } public String[] algorithmNames() { return names; } public double quality(IComparisonData d1, IComparisonData d2) throws RuntimeException { if ( ! canCompare(d1,d2) ) throw new IllegalArgumentException("Invalid data. The "+names[0]+" cannot compare the given datasets. They MUST be binned with the SAME binning."); int n = d1.nPoints(); double chi2 = 0; int nDf = 0; for (int i=0; i < n; i++) { double w1 = d1.weight(i); double w2 = d2.weight(i); double w = w1 + w2; if ( w > 0) { double dw = w1 - w2; chi2 += dw*dw /w; nDf++; } } ChiSquaredDistribution chi2Distribution = DistributionFactory.newInstance().createChiSquareDistribution(nDf); double prob = Double.NaN; try { prob = chi2Distribution.cumulativeProbability(chi2); } catch ( org.apache.commons.math.MathException me) { throw new RuntimeException("Problems evaluating probability ",me); } return prob; } public int nDof(IComparisonData d1, IComparisonData d2) { int n = d1.nPoints(); int nDf = 0; for (int i=0; i < n; i++) { double w1 = d1.weight(i); double w2 = d2.weight(i); double w = w1 + w2; if ( w > 0) nDf++; } return nDf; } public boolean canCompare(IComparisonData d1, IComparisonData d2) { boolean superCanCompare = super.canCompare(d1,d2); if ( ! superCanCompare ) return false; int nPoints = d1.nPoints(); if ( nPoints != d2.nPoints() ) return false; for ( int i = 0; i < nPoints; i++ ) if ( d1.value(i) != d2.value(i) ) return false; return true; } }
[ "hamad.deshmukh@Kodak.com" ]
hamad.deshmukh@Kodak.com
158771b1894e3cd3badb079595d928b538a6a69c
a00326c0e2fc8944112589cd2ad638b278f058b9
/src/main/java/000/139/712/CWE470_Unsafe_Reflection__getCookies_Servlet_54d.java
a3228e10ef8fbfe87b407ca493123c79dc9c0eb2
[]
no_license
Lanhbao/Static-Testing-for-Juliet-Test-Suite
6fd3f62713be7a084260eafa9ab221b1b9833be6
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
refs/heads/master
2020-08-24T13:34:04.004149
2019-10-25T09:26:00
2019-10-25T09:26:00
216,822,684
0
1
null
2019-11-08T09:51:54
2019-10-22T13:37:13
Java
UTF-8
Java
false
false
1,298
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE470_Unsafe_Reflection__getCookies_Servlet_54d.java Label Definition File: CWE470_Unsafe_Reflection.label.xml Template File: sources-sink-54d.tmpl.java */ /* * @description * CWE: 470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') * BadSource: getCookies_Servlet Read data from the first cookie using getCookies() * GoodSource: Set data to a hardcoded class name * Sinks: * BadSink : Instantiate class named in data * Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package * * */ import javax.servlet.http.*; public class CWE470_Unsafe_Reflection__getCookies_Servlet_54d { public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { (new CWE470_Unsafe_Reflection__getCookies_Servlet_54e()).badSink(data , request, response); } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { (new CWE470_Unsafe_Reflection__getCookies_Servlet_54e()).goodG2BSink(data , request, response); } }
[ "anhtluet12@gmail.com" ]
anhtluet12@gmail.com
e2ec8f11056be554e3c41433a53039ae0b874671
5cc01dec9ec1c6dde262d56d42c40dd8acfe2010
/PTSCMC/src/java/com/venus/mc/web/WebFormBean.java
84824d74b0c44130a8f5880a08388134ae49d67b
[]
no_license
phuongtu1983/mc
6defa0c94a02e2ff5ce9886ee87a219396d54ac0
0966390950a911e9fdb75484701bdede381a3042
refs/heads/master
2020-03-11T11:50:15.387384
2018-04-18T00:42:25
2018-04-18T00:42:25
129,980,464
0
0
null
null
null
null
UTF-8
Java
false
false
1,180
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.venus.mc.web; /** * * @author kngo */ public class WebFormBean extends org.apache.struts.action.ActionForm { private int webId; // primary key private String address; private String content; private String comment; private String evaluation; public WebFormBean() { } public int getWebId() { return this.webId; } public void setWebId(int webId) { this.webId = webId; } public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } public void setContent(String content) { this.content = content; } public String getContent() { return this.content; } public String getComment() { return this.comment; } public void setComment(String comment) { this.comment = comment; } public void setEvaluation(String evaluation) { this.evaluation = evaluation; } public String getEvaluation() { return this.evaluation; } }
[ "phuongtu1983@gmail.com" ]
phuongtu1983@gmail.com
c96d1e11de6493c0847846119e10b09e1401e421
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_83b3f9fa2e218caa31a131eb585942b940ec0c44/Actionable/5_83b3f9fa2e218caa31a131eb585942b940ec0c44_Actionable_t.java
4c55e11e9155dabb4bbd196124d0aa686e045c6a
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,349
java
package hudson.model; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import java.util.List; import java.util.Vector; /** * {@link ModelObject} that can have additional {@link Action}s. * * @author Kohsuke Kawaguchi */ public abstract class Actionable extends AbstractModelObject { /** * Actions contributed to this model object. */ private List<Action> actions; /** * Gets actions contributed to this build. * * <p> * A new {@link Action} can be added by {@code getActions().add(...)}. * * @return * may be empty but never null. */ public synchronized List<Action> getActions() { if(actions==null) actions = new Vector<Action>(); return actions; } /** * Gets all actions of a specified type that contributed to this build. * * @param type The type of action to return. * @return * may be empty but never null. * @see #getAction(Class) */ public <T extends Action> List<T> getActions(Class<T> type) { List<T> result = new Vector<T>(); for (Action a : getActions()) if (type.isInstance(a)) result.add(type.cast(a)); return result; } /** * Adds a new action. * * Short for <tt>getActions().add(a)</tt> */ public void addAction(Action a) { getActions().add(a); } public Action getAction(int index) { if(actions==null) return null; return actions.get(index); } /** * Gets the action (first instance to be found) of a specified type that contributed to this build. * * @param type * @return The action or <code>null</code> if no such actions exist. * @see #getActions(Class) */ public <T extends Action> T getAction(Class<T> type) { for (Action a : getActions()) if (type.isInstance(a)) return type.cast(a); return null; } public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) { for (Action a : getActions()) { if(a.getUrlName().equals(token)) return a; } return null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4b98280db9582b8e860a78f5d82229e3d3ae700b
3d1bc9934ca6aceea49d4f63dd59432eef82c8eb
/oa/src/main/java/com/hotent/makshi/model/selfcheck/WorkSelfcheckMonthMain.java
4c31448be2226678bd34c51efdeb5a62f87589d8
[]
no_license
sdzx3783/project2018
570c5d878cc0afb5bda93003b5dc66d78e42fb79
52e0cae652fbd83b5712636e15a2e14401a5a50a
refs/heads/master
2020-03-12T04:28:04.856156
2018-04-21T06:58:25
2018-04-21T06:58:25
130,445,510
1
0
null
null
null
null
UTF-8
Java
false
false
1,026
java
package com.hotent.makshi.model.selfcheck; public class WorkSelfcheckMonthMain { private Long id; private String username; private String userId; private String submitAt; private Integer status; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username == null ? null : username.trim(); } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId == null ? null : userId.trim(); } public String getSubmitAt() { return submitAt; } public void setSubmitAt(String submitAt) { this.submitAt = submitAt == null ? null : submitAt.trim(); } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } }
[ "378377084@qq.com" ]
378377084@qq.com
47f6b23af7026945ec722c0c9a5ff7416a1accc2
f28ddc4e516840ad1eebd6dab717338f0b24daca
/Practice Question/Transpose_Matrix.java
b786f27db46e250083d9e8b5986fb7cfed107779
[]
no_license
Deepanshuchauhan123/The_Data_Structure-and-Algorithms--Java
3e808eae6e045db922ad51a2b5de0f5b6c61623e
81166929b28b0676b0897a10e05be11bbd22b52f
refs/heads/master
2023-05-10T07:02:38.699297
2021-06-08T09:27:04
2021-06-08T09:27:04
263,946,116
0
1
null
null
null
null
UTF-8
Java
false
false
1,165
java
import java.util.Scanner; class Transpose_Matrix{ public static void main(String ar[]) { int row1, col1,i,j; int matrix1[][] = new int[100][100]; int matrix2[][] = new int[100][100]; Scanner sc = new Scanner(System.in); System.out.print("Enter Rows and Columns:"); row1 = sc.nextInt(); col1 = sc.nextInt(); System.out.print("Enter "+row1+"X"+col1+ " Matrix"); for ( i = 0; i < row1; i++) { for ( j = 0; j < col1; j++) { matrix1[i][j] = sc.nextInt(); } } for ( i = 0; i < row1; i++) { for ( j = 0; j < col1; j++) { matrix2[j][i] = matrix1[i][j]; } } System.out.println("Transpose of Matrix: "); for ( i = 0; i < col1; i++) { for ( j = 0; j < row1; j++) { System.out.print(matrix2[i][j]); if (i != (col1 ) && j!=(row1-1)) { System.out.print(" "); } } if (i!= (col1 -1 ) && j != (row1-1 )) { System.out.print("\n"); } } } }
[ "deepanshuchauhan7287@gmail.com" ]
deepanshuchauhan7287@gmail.com
8dd3ae8771121cdd018d6e9834e3231e3a4be9c2
2d1a0366a5387a1ec31c4f729b926a294309e9b2
/service-feign/src/main/java/com/example/demo/SchedualServiceHiHystric.java
9c1c708c68cd8675fc0969997b6e181eb5afb359
[]
no_license
weiwiegeng/spring-cloud
5a5eec5212455847e3c1b7e9fe6419a86af3ee4f
3aaaca0991f993baa44950aa808c48971cc0ac46
refs/heads/master
2021-09-01T09:22:29.057690
2017-11-21T02:27:24
2017-11-21T02:27:24
115,395,918
1
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.example.demo; import org.springframework.stereotype.Component; /** * Created by jiaozhiguang on 2017/8/15. */ @Component public class SchedualServiceHiHystric implements SchedualServiceHi { @Override public String sayHiFromClientOne(String name) { return "sorry "+name; } }
[ "jiaozhiguang@126.com" ]
jiaozhiguang@126.com
4f4d9726c4571b1b22e1df821d31780fd69d8c0f
517466a2efc97b3b96224a40950d487624d34816
/src/com/hjf/beacon/service/impl/NavigationInfoServiceImpl.java
99e10f5a71de68cf830a03e4e0027a6ce6857fd9
[]
no_license
HJianFei/Museum_Beacon_Exhibition_Server
3167d2da5a782c473058cd306a7b0322d0127759
a983a178698abd38dac5653d075f04742e359db6
refs/heads/master
2021-01-12T06:34:11.541388
2017-01-06T06:35:13
2017-01-06T06:35:13
77,385,104
0
0
null
null
null
null
UTF-8
Java
false
false
1,391
java
package com.hjf.beacon.service.impl; import java.util.List; import javax.annotation.Resource; import org.hibernate.Query; import org.springframework.stereotype.Service; import com.hjf.beacon.dao.Dao; import com.hjf.beacon.entity.NavigationInfo; import com.hjf.beacon.service.NavigationInfoService; @Service("NavigationInfoService") public class NavigationInfoServiceImpl implements NavigationInfoService { @Resource(name = "Dao") private Dao dao; @Override public <T> void save(NavigationInfo navigationInfo) { // TODO Auto-generated method stub dao.save(navigationInfo); } @Override public <T> void merge(NavigationInfo navigationInfo) { // TODO Auto-generated method stub dao.merge(navigationInfo); } @Override public <T> void delete(Class<T> clazz, Object id) { // TODO Auto-generated method stub Object obj = dao.find(clazz, id); dao.delete(obj); } @Override public <T> Query getQuery(String hql) { // TODO Auto-generated method stub return (Query) dao.getQuery(hql); } @Override public <T> T find(Class<T> clazz, Object id) { // TODO Auto-generated method stub return (T) dao.find(clazz, id); } @Override public <T> List<T> getResult(String hql, int firstIndex, int maxSize) { // TODO Auto-generated method stub return dao.getResult(hql, firstIndex, maxSize); } }
[ "190766172@qq.com" ]
190766172@qq.com
59190e168321522eeacfcabcdc59188fcd7fd161
a0568cfecfcbe5f33ed3cd207acf6ee443e2098b
/discogs/artists/src/main/java/com/xml2j/discogs/artists/repo/ArtistsTypeRepo.java
0975f2c52c919f4590bc69a22349e3cf4bedb0de
[]
no_license
lolkedijkstra/xml2j-springdata-samples
a3863ccefd3ccb0b9347221e02cd26afa1217f7e
179792fe31f56842c10419a08982822e8bd21db8
refs/heads/master
2020-03-14T07:42:35.992497
2018-04-29T19:13:14
2018-04-29T19:13:14
131,487,603
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.xml2j.discogs.artists.repo; import com.xml2j.discogs.artists.ArtistType; import org.springframework.data.repository.CrudRepository; public interface ArtistsTypeRepo extends CrudRepository<ArtistType, Long> {}
[ "lolkedijkstra@gmail.com" ]
lolkedijkstra@gmail.com
466ecc1b234b8cf473089c362d5de12fb197367f
b0d24836683e636c390e497117ac86831abb5e1a
/AndromedaOldBackup/src/main/com/sc2mod/andromeda/environment/types/FunctionPointer.java
2a270a55930b4ec1cce78f76cd4bc3fc5adf2d84
[]
no_license
lukemshannonhill/andromeda
1b1b884ea00a7a1dd45f25e8406bf44e89f31aee
62107d28e70f99c63454a7670faff4d85c4e1eb2
refs/heads/master
2020-03-27T22:46:26.660518
2014-07-19T21:27:31
2014-07-19T21:27:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,055
java
/** * Andromeda, a galaxy extension language. * Copyright (C) 2010 J. 'gex' Finis (gekko_tgh@gmx.de, sc2mod.com) * * Because of possible Plagiarism, Andromeda is not yet * Open Source. You are not allowed to redistribute the sources * in any form without my permission. * */ package com.sc2mod.andromeda.environment.types; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashSet; import com.sc2mod.andromeda.environment.AbstractFunction; import com.sc2mod.andromeda.environment.Signature; import com.sc2mod.andromeda.environment.variables.FuncPointerDecl; public class FunctionPointer extends Type{ private Signature sig; private Type returnType; private String uid; private LinkedHashSet<FuncPointerDecl> usages; public FunctionPointer(Signature sig2, Type returnType) { this.sig = sig2; this.returnType = returnType; } @Override public int getCategory() { return FUNCTION; } @Override public int getByteSize() { return 4; } @Override public String getDescription() { return "function"; } @Override public int getRuntimeType() { return RuntimeType.FUNCTION; } @Override public String getUid() { if(uid == null) generateUid(); return uid; } private void generateUid() { StringBuilder sb = new StringBuilder(64); sb.append("function<").append(returnType.getFullName()).append("(").append(sig.getFullName()).append(")>"); uid = sb.toString(); } public void registerUsage(FuncPointerDecl funcPointerDecl) { if(usages == null) usages = new LinkedHashSet<FuncPointerDecl>(8); usages.add(funcPointerDecl); } @Override public String getGeneratedDefinitionName() { return BasicType.INT.getGeneratedName(); } @Override public String getGeneratedName() { return BasicType.INT.getGeneratedName(); } public void calcIndices() { int index = 0; for(FuncPointerDecl fpd : usages){ if(fpd.getNumReadAccesses() > 0) fpd.setIndex(index++); } } }
[ "gexicide@ba8a923f-d780-44b6-badb-29f948e90341" ]
gexicide@ba8a923f-d780-44b6-badb-29f948e90341
3326a1851d78d640d2aef5bcee468eef2b937077
bad5506c55435ca12e48347911be8dc46c7b194c
/src/chapter14/Exe9.java
cc8a91a8c0ec7b3374d07884b2d4774dd7ffefa3
[]
no_license
zhwei5311/exercise
825187d88a9ca6525e7fa0515ccf2a14f8712341
f13af9d065ced2ecfbabb590d7e96a9ff704905c
refs/heads/master
2020-03-13T21:40:23.147442
2019-04-04T13:58:58
2019-04-04T13:58:58
131,301,301
1
0
null
null
null
null
UTF-8
Java
false
false
863
java
package chapter14; public class Exe9 { public static void Hierarchy(Object o) { Object[] fields = o.getClass().getDeclaredFields(); if(fields.length == 0) { System.out.println(o.getClass() + "has no fields"); } if(fields.length > 0) { System.out.println("Fields of " + o.getClass() + ":"); for(Object obj : fields) { System.out.println(" " + obj); } } if(o.getClass().getSuperclass() != null) { System.out.println(o.getClass() + " is a subclass of " + o.getClass().getSuperclass()); try { Hierarchy(o.getClass().getSuperclass().newInstance()); } catch(InstantiationException e) { System.out.println("Unabloe to instantiate obj"); } catch(IllegalAccessException e) { System.out.println("Unable to access"); } } } public static void main(String[] args) { Hierarchy(new ExtendsSuper()); } }
[ "zhwei1228@qq.com" ]
zhwei1228@qq.com
562fee6a48646c7807051ef3e8d883174b6475d1
e108d65747c07078ae7be6dcd6369ac359d098d7
/org/bytedeco/javacpp/videoInputLib$videoDevice.java
ca3013148958e13d4bfb15a4bf53d70ed0d630bf
[ "MIT" ]
permissive
kelu124/pyS3
50f30b51483bf8f9581427d2a424e239cfce5604
86eb139d971921418d6a62af79f2868f9c7704d5
refs/heads/master
2020-03-13T01:51:42.054846
2018-04-24T21:03:03
2018-04-24T21:03:03
130,913,008
1
0
null
null
null
null
UTF-8
Java
false
false
6,377
java
package org.bytedeco.javacpp; import org.bytedeco.javacpp.annotation.ByRef; import org.bytedeco.javacpp.annotation.Cast; import org.bytedeco.javacpp.annotation.MemberGetter; import org.bytedeco.javacpp.annotation.NoOffset; @NoOffset public class videoInputLib$videoDevice extends Pointer { private native void allocate(); private native void allocateArray(long j); public native void NukeDownstream(videoInputLib$IBaseFilter org_bytedeco_javacpp_videoInputLib_IBaseFilter); public native videoInputLib$videoDevice autoReconnect(boolean z); @Cast({"bool"}) public native boolean autoReconnect(); public native int connection(); public native videoInputLib$videoDevice connection(int i); public native void destroyGraph(); @Cast({"long"}) public native int formatType(); public native videoInputLib$videoDevice formatType(int i); public native int height(); public native videoInputLib$videoDevice height(int i); public native int myID(); public native videoInputLib$videoDevice myID(int i); @Cast({"char"}) public native byte nDeviceName(int i); @MemberGetter @Cast({"char*"}) public native BytePointer nDeviceName(); public native videoInputLib$videoDevice nDeviceName(int i, byte b); public native int nFramesForReconnect(); public native videoInputLib$videoDevice nFramesForReconnect(int i); @Cast({"unsigned long"}) public native int nFramesRunning(); public native videoInputLib$videoDevice nFramesRunning(int i); @Cast({"AM_MEDIA_TYPE*"}) public native videoInputLib$_AMMediaType pAmMediaType(); public native videoInputLib$videoDevice pAmMediaType(videoInputLib$_AMMediaType org_bytedeco_javacpp_videoInputLib__AMMediaType); @Cast({"char*"}) public native BytePointer pBuffer(); public native videoInputLib$videoDevice pBuffer(BytePointer bytePointer); public native videoInputLib$ICaptureGraphBuilder2 pCaptureGraph(); public native videoInputLib$videoDevice pCaptureGraph(videoInputLib$ICaptureGraphBuilder2 org_bytedeco_javacpp_videoInputLib_ICaptureGraphBuilder2); public native videoInputLib$IMediaControl pControl(); public native videoInputLib$videoDevice pControl(videoInputLib$IMediaControl org_bytedeco_javacpp_videoInputLib_IMediaControl); public native videoInputLib$IBaseFilter pDestFilter(); public native videoInputLib$videoDevice pDestFilter(videoInputLib$IBaseFilter org_bytedeco_javacpp_videoInputLib_IBaseFilter); public native videoInputLib$ISampleGrabber pGrabber(); public native videoInputLib$videoDevice pGrabber(videoInputLib$ISampleGrabber org_bytedeco_javacpp_videoInputLib_ISampleGrabber); public native videoInputLib$IBaseFilter pGrabberF(); public native videoInputLib$videoDevice pGrabberF(videoInputLib$IBaseFilter org_bytedeco_javacpp_videoInputLib_IBaseFilter); public native videoInputLib$IGraphBuilder pGraph(); public native videoInputLib$videoDevice pGraph(videoInputLib$IGraphBuilder org_bytedeco_javacpp_videoInputLib_IGraphBuilder); public native videoInputLib$IMediaEventEx pMediaEvent(); public native videoInputLib$videoDevice pMediaEvent(videoInputLib$IMediaEventEx org_bytedeco_javacpp_videoInputLib_IMediaEventEx); public native videoInputLib$IBaseFilter pVideoInputFilter(); public native videoInputLib$videoDevice pVideoInputFilter(videoInputLib$IBaseFilter org_bytedeco_javacpp_videoInputLib_IBaseFilter); @Cast({"unsigned char*"}) public native BytePointer pixels(); public native videoInputLib$videoDevice pixels(BytePointer bytePointer); public native videoInputLib$videoDevice readyToCapture(boolean z); @Cast({"bool"}) public native boolean readyToCapture(); @Cast({"long"}) public native int requestedFrameTime(); public native videoInputLib$videoDevice requestedFrameTime(int i); public native void setSize(int i, int i2); public native videoInputLib$videoDevice setupStarted(boolean z); @Cast({"bool"}) public native boolean setupStarted(); public native videoInputLib$SampleGrabberCallback sgCallback(); public native videoInputLib$videoDevice sgCallback(videoInputLib$SampleGrabberCallback org_bytedeco_javacpp_videoInputLib_SampleGrabberCallback); public native videoInputLib$videoDevice sizeSet(boolean z); @Cast({"bool"}) public native boolean sizeSet(); public native videoInputLib$videoDevice specificFormat(boolean z); @Cast({"bool"}) public native boolean specificFormat(); public native int storeConn(); public native videoInputLib$videoDevice storeConn(int i); public native videoInputLib$IAMStreamConfig streamConf(); public native videoInputLib$videoDevice streamConf(videoInputLib$IAMStreamConfig org_bytedeco_javacpp_videoInputLib_IAMStreamConfig); public native videoInputLib$videoDevice tryDiffSize(boolean z); @Cast({"bool"}) public native boolean tryDiffSize(); public native int tryHeight(); public native videoInputLib$videoDevice tryHeight(int i); public native int tryWidth(); public native videoInputLib$videoDevice tryWidth(int i); public native videoInputLib$videoDevice useCrossbar(boolean z); @Cast({"bool"}) public native boolean useCrossbar(); public native int videoSize(); public native videoInputLib$videoDevice videoSize(int i); @ByRef @Cast({"GUID*"}) public native Pointer videoType(); public native videoInputLib$videoDevice videoType(Pointer pointer); @Cast({"WCHAR"}) public native char wDeviceName(int i); @MemberGetter @Cast({"WCHAR*"}) public native CharPointer wDeviceName(); public native videoInputLib$videoDevice wDeviceName(int i, char c); public native int width(); public native videoInputLib$videoDevice width(int i); static { Loader.load(); } public videoInputLib$videoDevice(Pointer p) { super(p); } public videoInputLib$videoDevice(long size) { super((Pointer) null); allocateArray(size); } public videoInputLib$videoDevice position(long position) { return (videoInputLib$videoDevice) super.position(position); } public videoInputLib$videoDevice() { super((Pointer) null); allocate(); } }
[ "kelu124@gmail.com" ]
kelu124@gmail.com
99e3237913485a7044688a176d7dc5a3300136e3
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13546-5-17-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/configuration/internal/AbstractDocumentConfigurationSource_ESTest_scaffolding.java
29e8ceb1d43e72083d9a11367f9bb221fd0761c6
[]
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
472
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Apr 03 17:31:06 UTC 2020 */ package org.xwiki.configuration.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class AbstractDocumentConfigurationSource_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
ea8c0db777de5b0a1b341a27d0917a2976ca24ae
5a13f24c35c34082492ef851fb91d404827b7ddb
/src/main/java/com/alipay/api/response/AlipayOfflineMarketReporterrorCreateResponse.java
24933cd78c0ca9e7bf32cc93ef9acf2aaf987030
[]
no_license
featherfly/alipay-sdk
69b2f2fc89a09996004b36373bd5512664521bfd
ba2355a05de358dc15855ffaab8e19acfa24a93b
refs/heads/master
2021-01-22T11:03:20.304528
2017-09-04T09:39:42
2017-09-04T09:39:42
102,344,436
1
0
null
null
null
null
UTF-8
Java
false
false
391
java
package com.alipay.api.response; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.offline.market.reporterror.create response. * * @author auto create * @since 1.0, 2017-07-03 14:41:37 */ public class AlipayOfflineMarketReporterrorCreateResponse extends AlipayResponse { private static final long serialVersionUID = 1295522776469886421L; }
[ "zhongj@cdmhzx.com" ]
zhongj@cdmhzx.com
c7df0ae6814bf861eb6d209fc41499b99ec826bf
9633324216599db0cf1146770c62da8123dc1702
/src/fractalzoomer/fractal_options/orbit_traps/StalksCircleOrbitTrap.java
0abc095e9f0ec47e81a3100e55a78c2a906d14ac
[]
no_license
avachon100501/Fractal-Zoomer
fe3287371fd8716aa3239dd6955239f2c5d161cd
d21c173b8b12f11108bf844b53e09bc0d55ebeb5
refs/heads/master
2022-10-05T21:42:07.433545
2020-06-05T11:19:17
2020-06-05T11:19:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,290
java
/* * Copyright (C) 2020 hrkalona * * 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 fractalzoomer.fractal_options.orbit_traps; import fractalzoomer.core.Complex; /** * * @author hrkalona */ public class StalksCircleOrbitTrap extends OrbitTrap { private double stalksradiushigh; private double stalksradiuslow; private double cnorm; public StalksCircleOrbitTrap(double pointRe, double pointIm, double trapLength, double trapWidth, boolean countTrapIterations) { super(pointRe, pointIm, trapLength, trapWidth, countTrapIterations); } @Override public void check(Complex val, int iteration) { double dist = val.distance(point); if (dist <= stalksradiushigh && dist >= stalksradiuslow && iteration > 0) { distance = dist; trapId = 0; setTrappedData(val, iteration); } dist = Math.abs(val.distance(point) - trapLength); if(dist < trapWidth && dist < distance) { distance = dist; trapId = 1; setTrappedData(val, iteration); } } @Override public double getDistance() { return trapId == 0 ? (distance != Double.MAX_VALUE ? Math.abs(trapWidth - 2 * (distance - cnorm + trapWidth * 0.5)) : distance) : distance; } @Override public void initialize(Complex pixel) { super.initialize(pixel); cnorm = pixel.norm(); stalksradiushigh = cnorm + trapWidth * 0.5; stalksradiuslow = cnorm - trapWidth * 0.5; } @Override public double getMaxValue() { return trapWidth; } }
[ "hrkalona@gmail.com" ]
hrkalona@gmail.com
07016762241c12a19a5cf60558d6795053ff6d61
c7e000e5c6549e095a8ffd032d33e0ca449c7ffd
/bin/ext-integration/sap/synchronousOM/sapordermgmtbol/testsrc/de/hybris/platform/sap/sapordermgmtbol/transaction/salesdocument/backend/impl/erp/strategy/HeaderTextMapperJCoRecTest.java
7f35e72bcc5b94d6ff6297c113410d64c5dafee3
[]
no_license
J3ys/million
e80ff953e228e4bc43a1108a1c117ddf11cc4644
a97974b68b4adaf820f9024aa5181de635c60b4f
refs/heads/master
2021-03-09T22:59:35.115273
2015-05-19T02:47:29
2015-05-19T02:47:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,517
java
/* * [y] hybris Platform * * Copyright (c) 2000-2014 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.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.erp.strategy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import de.hybris.platform.sap.core.jco.mock.JCoMockRepository; import de.hybris.platform.sap.core.jco.rec.JCoRecException; import de.hybris.platform.sap.sapordermgmtbol.constants.SapordermgmtbolConstants; import de.hybris.platform.sap.sapordermgmtbol.order.businessobject.interf.Text; import de.hybris.platform.sap.sapordermgmtbol.transaction.header.businessobject.interf.Header; import de.hybris.platform.sap.sapordermgmtbol.unittests.base.JCORecTestBase; import org.junit.Test; import com.sap.conn.jco.JCoTable; @SuppressWarnings("javadoc") public class HeaderTextMapperJCoRecTest extends JCORecTestBase { public HeadTextMapper classUnderTest; @Override public void setUp() { super.setUp(); classUnderTest = (HeadTextMapper) genericFactory.getBean(SapordermgmtbolConstants.ALIAS_BEAN_HEADER_TEXT_MAPPER); classUnderTest.setConfigLangIso("D"); classUnderTest.setConfigTextId("0"); } @Test public void testRead() throws JCoRecException { final JCoMockRepository testRepository = getJCORepository("jcoErpWecModel2DMapperTextTest"); final JCoTable table = testRepository.getTable("ET_HEAD_TEXT_COMV"); final Header header = (Header) genericFactory.getBean(SapordermgmtbolConstants.ALIAS_BEAN_HEADER); classUnderTest.read(table, header); final Text text = header.getText(); assertNotNull(text); assertEquals("The Header Text", text.getText()); assertEquals("H", text.getHandle()); } @Test public void testReadWrongTextID() throws JCoRecException { final JCoMockRepository testRepository = getJCORepository("jcoErpWecModel2DMapperTextTest"); final JCoTable table = testRepository.getTable("ET_HEAD_TEXT_COMV"); final Header header = (Header) genericFactory.getBean(SapordermgmtbolConstants.ALIAS_BEAN_HEADER); classUnderTest.setConfigTextId("1000"); header.setText(null); classUnderTest.read(table, header); assertNull(header.getText()); } }
[ "yanagisawa@gotandadenshi.jp" ]
yanagisawa@gotandadenshi.jp
6efdc2cde0dd1786f25edfd407b8d314bd065f9b
32f38cd53372ba374c6dab6cc27af78f0a1b0190
/app/src/main/java/com/amap/location/sdk/a/f.java
c5a246758b6165e6532d0eadf677244a20166d3b
[]
no_license
shuixi2013/AmapCode
9ea7aefb42e0413f348f238f0721c93245f4eac6
1a3a8d4dddfcc5439df8df570000cca12b15186a
refs/heads/master
2023-06-06T23:08:57.391040
2019-08-29T04:36:02
2019-08-29T04:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,137
java
package com.amap.location.sdk.a; import com.autonavi.minimap.basemap.favorites.fragment.FavoritesPointFragment; import java.io.ByteArrayOutputStream; import java.security.KeyFactory; import java.security.PublicKey; import java.security.spec.X509EncodedKeySpec; import javax.crypto.Cipher; /* compiled from: RSAUtils */ public class f { public static synchronized byte[] a(byte[] bArr, String str) throws Exception { byte[] byteArray; byte[] bArr2; synchronized (f.class) { try { PublicKey generatePublic = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(d.a(str))); Cipher instance = Cipher.getInstance("RSA/ECB/PKCS1Padding"); instance.init(2, generatePublic); int length = bArr.length; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int i = 0; int i2 = 0; while (true) { int i3 = length - i; if (i3 > 0) { if (i3 > 256) { bArr2 = instance.doFinal(bArr, i, 256); } else { bArr2 = instance.doFinal(bArr, i, i3); } byteArrayOutputStream.write(bArr2, 0, bArr2.length); i2++; i = i2 * 256; } else { byteArray = byteArrayOutputStream.toByteArray(); byteArrayOutputStream.close(); } } } } return byteArray; } public static synchronized byte[] b(byte[] bArr, String str) throws Exception { byte[] byteArray; byte[] bArr2; synchronized (f.class) { try { PublicKey generatePublic = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(d.a(str))); Cipher instance = Cipher.getInstance("RSA/ECB/PKCS1Padding"); instance.init(1, generatePublic); int length = bArr.length; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int i = 0; int i2 = 0; while (true) { int i3 = length - i; if (i3 > 0) { if (i3 > 245) { bArr2 = instance.doFinal(bArr, i, FavoritesPointFragment.REQUEST_TAG_SELECT); } else { bArr2 = instance.doFinal(bArr, i, i3); } byteArrayOutputStream.write(bArr2, 0, bArr2.length); i2++; i = i2 * FavoritesPointFragment.REQUEST_TAG_SELECT; } else { byteArray = byteArrayOutputStream.toByteArray(); byteArrayOutputStream.close(); } } } } return byteArray; } }
[ "hubert.yang@nf-3.com" ]
hubert.yang@nf-3.com
157c60928d22bebd9312573e6a196af40dd286dc
cf5421ca0e450aec39c0b23c9dd7b3eaccd833f8
/src/main/java/net/hasor/rsf/console/CommandManager.java
e40c9ca0171d18abc5ff006890ae44abf29051ef
[ "Apache-2.0" ]
permissive
wuce7758/rsf
33f8bd5a5b65ffd12945989c972771c69c6d3b92
5bdd74cd7b48c67878765373cd43cc76bae14152
refs/heads/master
2021-01-22T10:36:05.496658
2017-01-30T06:01:04
2017-01-30T06:01:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,167
java
/* * Copyright 2008-2009 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 net.hasor.rsf.console; import net.hasor.core.AppContext; import net.hasor.core.Init; import net.hasor.core.Inject; import net.hasor.core.Singleton; import net.hasor.rsf.domain.RsfConstants; import org.more.RepeateException; import org.more.builder.ReflectionToStringBuilder; import org.more.builder.ToStringStyle; import org.more.util.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * * @version : 2016年4月7日 * @author 赵永春(zyc@hasor.net) */ @Singleton public class CommandManager { protected static Logger logger = LoggerFactory.getLogger(RsfConstants.LoggerName_Console); @Inject private AppContext appContext; private final Map<String, RsfInstruct> commandMap = new HashMap<String, RsfInstruct>(); // @Init public void initCommand() throws Throwable { List<RsfInstruct> cmdSet = appContext.findBindingBean(RsfInstruct.class); if (cmdSet == null || cmdSet.isEmpty()) { logger.warn("rsfConsole -> initCommand is empty."); return; } // ArrayList<String> cmdNames = new ArrayList<String>(); for (RsfInstruct cmdObject : cmdSet) { RsfCommand cmdInfo = cmdObject.getClass().getAnnotation(RsfCommand.class); for (String name : cmdInfo.value()) { name = name.toLowerCase(); cmdNames.add(name); if (this.commandMap.containsKey(name)) { RsfInstruct conflictCmd = this.commandMap.get(name); String types = cmdObject.getClass().getName() + " , " + conflictCmd.getClass().getName(); throw new RepeateException("conflict command name '" + name + "' {" + types + "}"); } else { this.commandMap.put(name, cmdObject); } } } logger.info("load rsf Console Commands ={}.", ReflectionToStringBuilder.toString(cmdNames, ToStringStyle.SHORT_PREFIX_STYLE)); // } /**查找命令。*/ public RsfInstruct findCommand(String requestCMD) { if (StringUtils.isBlank(requestCMD)) { return null; } return this.commandMap.get(requestCMD.toLowerCase()); } // public List<String> getCommandNames() { List<String> names = new ArrayList<String>(this.commandMap.keySet()); java.util.Collections.sort(names); return names; } }
[ "zyc@hasor.net" ]
zyc@hasor.net
f53827c0eba8f78bebf550152fab07408059dae1
0b406eebc1717fb4eec9d900eb734cd6b16a584c
/gtd/src/main/java/cz/slama/android/gtd/core/UsersWrapper.java
fd20892b9aa711fd1ecc9c4018c421dcb5b3bea1
[ "Apache-2.0" ]
permissive
Drugnanov/GTD_BP_Android
7884d1dd667cab35e4a51ce04c853422a60d67ac
34e58dfcd2bae658ad903d2ecc0ad3230af85851
refs/heads/master
2020-04-06T15:44:27.906480
2015-05-01T14:31:33
2015-05-01T14:31:33
34,901,418
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package cz.slama.android.gtd.core; import com.google.gson.annotations.SerializedName; import java.util.List; public class UsersWrapper { private List<User> results; public List<User> getResults() { return results; } }
[ "slama.michal84@gmail.com" ]
slama.michal84@gmail.com
ffb4208b85475f35f43ead29cd103defec275299
5e317864cf0d952587457aab6945c7706ddf9055
/crm-microservice/src/main/java/com/example/crm/repository/CustomerRepository.java
40afc2bd040c95aec2d15bdd3742281a1723e6b1
[ "MIT" ]
permissive
deepcloudlabs/dcl350-2020-oct-19
d3048da0d547978b147a496ab8e9026660513eae
eeef31f0fc0da1db8b6de3afba73e0b9caefa664
refs/heads/main
2022-12-30T10:38:33.675766
2020-10-23T21:30:43
2020-10-23T21:30:43
304,814,308
0
0
null
null
null
null
UTF-8
Java
false
false
242
java
package com.example.crm.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.example.crm.entity.Customer; // Ctrl + Shift + O public interface CustomerRepository extends JpaRepository<Customer, String> { }
[ "deepcloudlabs@gmail.com" ]
deepcloudlabs@gmail.com
488bd0a1f79cde7f272ae93739da861b298188a8
0b4844d550c8e77cd93940e4a1d8b06d0fbeabf7
/JavaSource/dream/consult/comp/time/dao/sqlImpl/MaLineTimeDowListDAOSqlImpl.java
9e6dffe5e2a719c0c85b9dbd1bf0a3edabc31afc
[]
no_license
eMainTec-DREAM/DREAM
bbf928b5c50dd416e1d45db3722f6c9e35d8973c
05e3ea85f9adb6ad6cbe02f4af44d941400a1620
refs/heads/master
2020-12-22T20:44:44.387788
2020-01-29T06:47:47
2020-01-29T06:47:47
236,912,749
0
0
null
null
null
null
UHC
Java
false
false
4,521
java
package dream.consult.comp.time.dao.sqlImpl; import java.util.List; import common.bean.User; import common.spring.BaseJdbcDaoSupportSql; import common.util.QuerySqlBuffer; import dream.consult.comp.time.dao.MaLineTimeDowListDAO; import dream.consult.comp.time.dto.MaLineTimeCommonDTO; import dream.consult.comp.time.dto.MaLineTimeDowListDTO; /** * 요일별 설정 목록 dao * @author kim21017 * @version $Id: MaLineTimeDowListDAO.java,v 1.0 2015/12/02 09:14:12 kim21017 Exp $ * @since 1.0 * @spring.bean id="maLineTimeDowListDAOTarget" * @spring.txbn id="maLineTimeDowListDAO" * @spring.property name="dataSource" ref="dataSource" */ public class MaLineTimeDowListDAOSqlImpl extends BaseJdbcDaoSupportSql implements MaLineTimeDowListDAO { /** * grid find * @author kim21017 * @version $Id: MaLineTimeDowListDAO.java,v 1.0 2015/12/02 09:14:12 kim21017 Exp $ * @since 1.0 * * @param maLineTimeCommonDTO * @param maLineTimeDowListDTO * @param loginUser * @return List */ public List findDowList(MaLineTimeCommonDTO maLineTimeCommonDTO, MaLineTimeDowListDTO maLineTimeDowListDTO, User loginUser) { QuerySqlBuffer query = new QuerySqlBuffer(); query.append("SELECT "); query.append(" '' seqNo "); query.append(" ,'' isDelCheck "); query.append(" ,x.eqloc_id eqLocId "); query.append(" ,x.comp_no compNo "); query.append(" ,x.eqlocdowrun_id eqLocDowRunId "); query.append(" ,x.dow dow "); query.append(" ,dbo.SFACODE_TO_DESC(x.dow,'DOW','SYS','','"+loginUser.getLangId()+"') dowDesc "); query.append(" ,x.dtime dayRunTime "); query.append(" ,x.ntime nightRunTime "); query.append(" ,x.etime extraRunTime "); query.append(" ,x.is_use isUse "); query.append(" ,x.ucnt UCNT "); query.append("FROM TAEQLOCDOWRUN x "); query.append("WHERE 1=1 "); query.append(this.getWhere(maLineTimeCommonDTO,maLineTimeDowListDTO,loginUser)); query.getOrderByQuery("x.eqlocdowrun_id","x.ord_no", maLineTimeCommonDTO.getOrderBy(), maLineTimeCommonDTO.getDirection()); return getJdbcTemplate().queryForList(query.toString(maLineTimeCommonDTO.getIsLoadMaxCount(), maLineTimeCommonDTO.getFirstRow())); } private String getWhere(MaLineTimeCommonDTO maLineTimeCommonDTO, MaLineTimeDowListDTO maLineTimeDowListDTO, User loginUser) { QuerySqlBuffer query = new QuerySqlBuffer(); query.getAndQuery("x.lnwrklist_id", maLineTimeCommonDTO.getLnWrkListId()); query.getAndQuery("x.comp_no", maLineTimeCommonDTO.getCompNo()); if (!"".equals(maLineTimeDowListDTO.getEqLocDowRunId())) { query.getAndQuery("x.eqlocdowrun_id", maLineTimeDowListDTO.getEqLocDowRunId()); return query.toString(); } return query.toString(); } public String findTotalCount(MaLineTimeCommonDTO maLineTimeCommonDTO, MaLineTimeDowListDTO maLineTimeDowListDTO, User user) { QuerySqlBuffer query = new QuerySqlBuffer(); query.append("SELECT "); query.append(" COUNT(1) "); query.append("FROM TAEQLOCDOWRUN x "); query.append("WHERE 1=1 "); query.append(this.getWhere(maLineTimeCommonDTO,maLineTimeDowListDTO,user)); List resultList= getJdbcTemplate().queryForList(query.toString()); return QuerySqlBuffer.listToString(resultList); } /** * delete * @author kim21017 * @version $Id: MaLineTimeDowListDAO.java,v 1.0 20155/12/02 08:25:47 kim21017 Exp $ * @since 1.0 * * @param id * @param compNo * @return */ public int deleteDowList(String id, String compNo) { QuerySqlBuffer query = new QuerySqlBuffer(); String eqLocDowRunId=id; query.append("DELETE FROM TAEQLOCDOWRUN "); query.append("WHERE eqlocdowrun_id = '"+eqLocDowRunId+"' "); query.append(" AND comp_no = '"+compNo+"' "); return this.getJdbcTemplate().update(query.toString()); } }
[ "HN4741@10.31.0.185" ]
HN4741@10.31.0.185
a238004a95148ff7720c28bccb5f22f46c2738a1
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/storage/d$av.java
3cf3a7103f7a96a816c03b3f0bf76b393b5b8227
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
670
java
package com.tencent.mm.plugin.finder.storage; import com.tencent.matrix.trace.core.AppMethodBeat; import kotlin.Metadata; import kotlin.g.a.a; import kotlin.g.b.u; @Metadata(d1={""}, d2={"<anonymous>", ""}, k=3, mv={1, 5, 1}, xi=48) final class d$av extends u implements a<Integer> { public static final av FJA; static { AppMethodBeat.i(166898); FJA = new av(); AppMethodBeat.o(166898); } d$av() { super(0); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes.jar * Qualified Name: com.tencent.mm.plugin.finder.storage.d.av * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
66959d0134d5d1baba3f44945c60dc305fbc2c24
447520f40e82a060368a0802a391697bc00be96f
/apks/comparison_androart/de_number26_android/source/de/number26/machete/android/refactor/data/savings/fixedterm/eligibility/e.java
56d8d361a0dfe6abc4b04a026922ceb812e00f17
[ "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
893
java
package de.number26.machete.android.refactor.data.savings.fixedterm.eligibility; import com.n26.a.b.b; public final class e implements c.a.d<d> { private final javax.a.a<com.n26.a.a.a<h.a.e, FixedTermEligibility>> b; private final javax.a.a<b<h.a.e, FixedTermEligibility>> c; public e(javax.a.a<com.n26.a.a.a<h.a.e, FixedTermEligibility>> paramA, javax.a.a<b<h.a.e, FixedTermEligibility>> paramA1) { if ((!a) && (paramA == null)) { throw new AssertionError(); } this.b = paramA; if ((!a) && (paramA1 == null)) { throw new AssertionError(); } this.c = paramA1; } public static c.a.d<d> a(javax.a.a<com.n26.a.a.a<h.a.e, FixedTermEligibility>> paramA, javax.a.a<b<h.a.e, FixedTermEligibility>> paramA1) { return new e(paramA, paramA1); } public d a() { return new d((com.n26.a.a.a)this.b.get(), (b)this.c.get()); } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
22b2c07f4298fec4e80ed8018d03c598dec538e3
36bf98918aebe18c97381705bbd0998dd67e356f
/projects/castor-1.3.3/jpa-extensions-it/src/test/java/org/castor/jpa/scenario/version/VersionITCase.java
f8e522833e1742e56dfa75a6c002e4a961a2798c
[]
no_license
ESSeRE-Lab/qualitas.class-corpus
cb9513f115f7d9a72410b3f5a72636d14e4853ea
940f5f2cf0b3dc4bd159cbfd49d5c1ee4d06d213
refs/heads/master
2020-12-24T21:22:32.381385
2016-05-17T14:03:21
2016-05-17T14:03:21
59,008,169
2
1
null
null
null
null
UTF-8
Java
false
false
4,064
java
package org.castor.jpa.scenario.version; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.exolab.castor.jdo.CacheManager; import org.exolab.castor.jdo.Database; import org.exolab.castor.jdo.JDOManager; import org.exolab.castor.jdo.ObjectModifiedException; import org.exolab.castor.jdo.PersistenceException; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback = true) @Transactional public class VersionITCase { public final Log LOG = LogFactory.getLog(getClass()); @Autowired protected JDOManager jdoManager; Database db; CacheManager cacheManager; @Before @Transactional public void initDb() throws PersistenceException { db = jdoManager.getDatabase(); assertNotNull(db); } @After @Transactional public void cleanDb() throws PersistenceException { if (db.isActive()) { db.rollback(); } db.close(); } @Test @Transactional public void versionWillBeAlteredUponUpdate() throws Exception { OftenUsed object = createPersistentObject(OftenUsed.class); long version1 = object.getVersion(); changeName(object, "name"); long version2 = object.getVersion(); assertTrue(version1 != version2); } @Test(expected = ObjectModifiedException.class) @Transactional public void exceptionWillBeThrownUponConcurrentModification() throws Exception { OftenUsed object = createPersistentObject(OftenUsed.class); OftenUsed failing = loadPersistentObject(OftenUsed.class, object.getId()); changeName(object, "name"); changeName(failing, "failing"); } @Test @Transactional public void versionWillBeAlteredUponUpdateOfNonCachingEntity() throws Exception { NonCached object = createPersistentObject(NonCached.class); long version1 = object.getVersion(); changeName(object, "name"); long version2 = object.getVersion(); assertTrue(version1 != version2); } @Ignore @Transactional public void exceptionWillBeThrownUponConcurrentModificationOfNonCachingEntity() throws Exception { NonCached object = createPersistentObject(NonCached.class); NonCached failing = loadPersistentObject(NonCached.class, object.getId()); changeName(object, "name"); changeName(failing, "failing"); } private <T extends VersionTest> T createPersistentObject(Class<T> k) throws Exception { T instance = k.newInstance(); db.begin(); db.create(instance); db.commit(); return instance; } @SuppressWarnings("unchecked") private <T extends VersionTest> T loadPersistentObject(Class<T> k, long id) throws Exception { db.begin(); T loaded = (T) db .getOQLQuery( "select s from " + k.getCanonicalName() + " s where s.id=" + id).execute().next(); db.commit(); return loaded; } private void changeName(VersionTest object, String name) throws Exception { db.begin(); object.setName(name); db.update(object); db.commit(); } }
[ "marco.zanoni@disco.unimib.it" ]
marco.zanoni@disco.unimib.it
5424ec73621102ba43882d1c01d4c91cc79b31d3
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/ext-accelerator/b2bpunchout/src/org/cxml/Airport.java
7f62bba7c4e32c7ed38b92a5aefe8568e928dd2c
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
2,480
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // 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: 2016.05.12 at 07:19:30 PM EDT // package org.cxml; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "address" }) @XmlRootElement(name = "Airport") public class Airport { @XmlAttribute(name = "airportCode", required = true) @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String airportCode; @XmlElement(name = "Address") protected Address address; /** * Gets the value of the airportCode property. * * @return * possible object is * {@link String } * */ public String getAirportCode() { return airportCode; } /** * Sets the value of the airportCode property. * * @param value * allowed object is * {@link String } * */ public void setAirportCode(String value) { this.airportCode = value; } /** * Gets the value of the address property. * * @return * possible object is * {@link Address } * */ public Address getAddress() { return address; } /** * Sets the value of the address property. * * @param value * allowed object is * {@link Address } * */ public void setAddress(Address value) { this.address = value; } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
a01e2074e5ee4577c0aafcf79402651180f2ce7f
e05982294c92dc045a9a545cf6136329bd5b2ba2
/algorithms/src/graphs/course_scheduling/CourseScheduling.java
2899506cc8dace1540dde9011caf5ee43defcbb8
[ "MIT" ]
permissive
thecomputerguy/coding-interviews
c30f475027391bcf274e1153dcfe7835dd0ddeb9
f0f04843a23e3c26343e6096997f75031f213c4e
refs/heads/main
2023-05-31T08:31:29.377357
2021-07-12T09:19:36
2021-07-12T09:19:36
368,052,428
0
0
null
null
null
null
UTF-8
Java
false
false
2,332
java
import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Queue; public class CourseScheduling { public static boolean isSchedulingPossible(int tasks, int[][] prerequisites) { if(tasks <= 0) return false; //Initialize graph Map<Integer, Integer> inDegree = new HashMap<Integer, Integer>(); Map<Integer, List<Integer>> graph = new HashMap<Integer, List<Integer>>(); Queue<Integer> sources = new LinkedList<Integer>(); List<Integer> sortedOrder = new ArrayList<Integer>(); for (int i = 0; i < tasks; i++) { inDegree.put(i, 0); graph.put(i, new ArrayList<Integer>()); } //Create graph for (int i = 0; i < prerequisites.length; i++) { int parent = prerequisites[i][0]; int child = prerequisites[i][1]; graph.get(parent).add(child); inDegree.put(child, inDegree.get(child) + 1); } //find sources for (Map.Entry<Integer, Integer> entry : inDegree.entrySet()) { if(entry.getValue() == 0){ sources.add(entry.getKey()); } } //Topological sort while(!sources.isEmpty()){ int element = sources.poll(); sortedOrder.add(element); List<Integer> children = graph.get(element); for (Integer child : children) { inDegree.put(child, inDegree.get(child) - 1); if(inDegree.get(child) == 0){ sources.add(child); } } } if(sortedOrder.size() != tasks){ return false; } return true; } public static void main(String[] args) { boolean result = CourseScheduling.isSchedulingPossible(3, new int[][] { new int[] { 0, 1 }, new int[] { 1, 2 } }); System.out.println("Course scheduling possible: " + result); result = CourseScheduling.isSchedulingPossible(3, new int[][] { new int[] { 0, 1 }, new int[] { 1, 2 }, new int[] { 2, 0 } }); System.out.println("Course scheduling possible: " + result); result = CourseScheduling.isSchedulingPossible(6, new int[][] { new int[] { 2, 5 }, new int[] { 0, 5 }, new int[] { 0, 4 }, new int[] { 1, 4 }, new int[] { 3, 2 }, new int[] { 1, 3 } }); System.out.println("Course scheduling possible: " + result); } }
[ "varunsharma12@outlook.com" ]
varunsharma12@outlook.com
f746123a98626e248041488052b164f46e5ad13d
c7f03211a8119c1dddc04405e72752f72a3b803c
/src/main/java/hok/chompzki/hivetera/potion/PotionBase.java
fb3eb1e87a946dbb622e53a1d072f61c818290ca
[]
no_license
DND91/BioCristals
132a7347dda449c9001652276f90dcf9bad1f3d0
98408c697785db49673812cbe8787339e5a1328a
refs/heads/master
2021-01-17T13:11:57.856895
2016-06-04T16:29:27
2016-06-04T16:29:27
38,258,101
1
1
null
2017-04-17T10:53:38
2015-06-29T16:30:04
Java
UTF-8
Java
false
false
1,877
java
package hok.chompzki.hivetera.potion; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; import net.minecraft.potion.Potion; public abstract class PotionBase extends Potion { static void setFinalStatic(Field field, Object newValue) throws Exception { field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, newValue); } static Field getPotionArrayField(){ Field[] declaredFields = String.class.getDeclaredFields(); for (Field field : declaredFields) { if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) { try { Object obj = field.get(null); if(obj != null && obj instanceof Potion[]) return field; } catch (Exception e) { e.printStackTrace(); } } } return null; } static void increasePotionArray() throws Exception{ Field field = getPotionArrayField(); if(field == null){ throw new IllegalArgumentException("ERROR MISSING POTION TYPES FIELD! :("); } String[] newArray = new String[Potion.potionTypes.length + 1]; System.arraycopy(Potion.potionTypes, 0, newArray, 0, Potion.potionTypes.length); setFinalStatic(field, newArray); } public static int addPotionID(){ for(int i = 0; i < Potion.potionTypes.length; i++){ if(Potion.potionTypes[i] == null) return i; } try { increasePotionArray(); return addPotionID(); } catch (Exception e) { e.printStackTrace(); } return -1; } protected PotionBase(boolean p_i1573_2_, int p_i1573_3_) { super(addPotionID(), p_i1573_2_, p_i1573_3_); } }
[ "Jonathan.Crusoe@Gmail.com" ]
Jonathan.Crusoe@Gmail.com
1c517856950640721e7421b8013bb66b3f8fc144
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.socialplatform-base/sources/X/AnonymousClass2et.java
620085a30d3d3deca5b2150d6af674702a1d891c
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
270
java
package X; /* renamed from: X.2et reason: invalid class name */ public class AnonymousClass2et extends AnonymousClass2es { public static final AnonymousClass2eu A00 = new AnonymousClass2et(); public final String toString() { return "fit_end"; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
a96ca30aa3e4e6764e3046d9d371c380b497ac8e
78f7fd54a94c334ec56f27451688858662e1495e
/partyanalyst-service/trunk/src/main/java/com/itgrids/partyanalyst/dao/ICensusParameterDAO.java
0b7dce45732d5c0621d719558325a906597f787a
[]
no_license
hymanath/PA
2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef
d166bf434601f0fbe45af02064c94954f6326fd7
refs/heads/master
2021-09-12T09:06:37.814523
2018-04-13T20:13:59
2018-04-13T20:13:59
129,496,146
1
0
null
null
null
null
UTF-8
Java
false
false
222
java
package com.itgrids.partyanalyst.dao; import org.appfuse.dao.GenericDao; import com.itgrids.partyanalyst.model.CensusParameter; public interface ICensusParameterDAO extends GenericDao<CensusParameter,Long>{ }
[ "itgrids@b17b186f-d863-de11-8533-00e0815b4126" ]
itgrids@b17b186f-d863-de11-8533-00e0815b4126
64767a39378287b705a2f3583411abad28dac2cf
8bca6164fc085936891cda5ff7b2341d3d7696c5
/ext/core/testsrc/de/hybris/platform/test/EncryptionTest.java
c0229280cb83d0cbfaeb074991c3f12db93186c5
[]
no_license
rgonthina1/newplatform
28819d22ba48e48d4edebbf008a925cad0ebc828
1cdc70615ea4e86863703ca9a34231153f8ef373
refs/heads/master
2021-01-19T03:03:22.221074
2016-06-20T14:49:25
2016-06-20T14:49:25
61,548,232
1
0
null
null
null
null
UTF-8
Java
false
false
4,406
java
/* * [y] hybris Platform * * Copyright (c) 2000-2013 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.test; import static junit.framework.Assert.assertEquals; import de.hybris.bootstrap.annotations.IntegrationTest; import de.hybris.platform.core.Constants; import de.hybris.platform.core.Registry; import de.hybris.platform.testframework.HybrisJUnit4TransactionalTest; import de.hybris.platform.util.config.ConfigIntf; import de.hybris.platform.util.encryption.EncryptionUtil; import de.hybris.platform.util.encryption.ValueEncryptor; import java.security.InvalidParameterException; import java.util.HashMap; import java.util.Map; import javax.crypto.SecretKey; import org.apache.log4j.Logger; import org.junit.Test; import org.junit.Before; @IntegrationTest public class EncryptionTest extends HybrisJUnit4TransactionalTest { private static final Logger log = Logger.getLogger(EncryptionTest.class.getName()); private final String[] algos = new String[] { "PBEWITHSHA1AND192BITAES-CBC-BC", "PBEWITHSHA1AND128BITAES-CBC-BC", "PBEWITHMD5ANDRC2", "PBEWITHSHA1ANDRC2", "PBEWITHSHAAND256BITAES-CBC-BC", "PBEWITHSHA256AND192BITAES-CBC-BC", "PBEWITHMD5AND256BITAES-CBC-OPENSSL", "PBEWITHSHAAND40BITRC4", "PBEWITHMD5AND192BITAES-CBC-OPENSSL", "PBEWITHSHAAND128BITRC4", "PBEWITHSHAAND2-KEYTRIPLEDES-CBC", "PBEWITHSHA-256AND256BITAES-CBC-BC", "PBEWITHSHA1ANDDES", "PBEWITHSHAANDTWOFISH-CBC", "PBEWITHSHAAND128BITRC2-CBC", "PBEWITHSHAAND192BITAES-CBC-BC", "PBEWithSHAAnd3KeyTripleDES", "PBEWITHSHA-256AND128BITAES-CBC-BC", "PBEWITHSHA-1AND128BITAES-CBC-BC", "PBEWITHSHA256AND128BITAES-CBC-BC", "PBEWITHSHA-256AND192BITAES-CBC-BC", "PBEWITHMD5AND128BITAES-CBC-OPENSSL", "PBEWITHSHAAND128BITAES-CBC-BC", "PBEWITHSHA1AND256BITAES-CBC-BC", "PBEWITHSHAANDIDEA-CBC", "PBEWITHMD5ANDDES" }; /** * getValueEncryptor() initializes lazily some encryption properties in Master Tenant Config (eg. symmetric.key.file.1) * Previously test passed due to test invocation sequence which changed when upgrading to Java 8. */ @Before public void doBefore() { Registry.getMasterTenant().getValueEncryptor(); } @Test public void testDumpProviderInfos() { ValueEncryptor.dumpProviderInfo(); } @Test public void testEncryptionEngine() { final ValueEncryptor engine = Registry.getMasterTenant().getValueEncryptor(); final String str = "teststring"; String ciphertext = null; try { ciphertext = engine.encrypt(str); } catch (final Exception e) { log.error(e.getMessage()); } log.info("Encrypted 'java.lang.String' (" + str + ") is..."); log.info(ciphertext); final String plaintext = engine.decrypt(ciphertext); assertEquals(str, plaintext); log.info("Decrypted 'java.lang.String': " + plaintext); } @Test public void testSupportedAlgorithms() { final String keyfile = EncryptionUtil.DEFAULT_ENCRYPTION_KEY_FILE_NAME; SecretKey key = null; try { key = EncryptionUtil.loadKey(keyfile); } catch (final Exception e) { log.error(e.getMessage()); } final Map<String, SecretKey> keyfiles = new HashMap<String, SecretKey>(); keyfiles.put("1", key); final String plaintext = "test 1 2 3"; final ConfigIntf cfg = Registry.getMasterTenant().getConfig(); final String provider = cfg.getParameter(Constants.Encryption.PROVIDERCLASS); final String sig = cfg.getParameter(Constants.Encryption.PROVIDERSIGNATURE); for (int i = 0; i < algos.length; i++) { final String algo = algos[i]; String encrypted = null; String decrypted = null; try { final ValueEncryptor engine = new ValueEncryptor(cfg, provider, sig, keyfiles, algo); try { encrypted = engine.encrypt(plaintext); } catch (final Exception e) { log.error(e.getMessage()); } if (encrypted != null) { decrypted = engine.decrypt(encrypted); } log.info(algo + ":: PLAIN: " + plaintext + ", ENCRYPTED: " + encrypted + ", DECRYPTED: " + decrypted); assertEquals(plaintext, decrypted); } catch (final InvalidParameterException e) { log.error(e.getMessage()); } } } }
[ "Kalpana" ]
Kalpana
b8bd09c580c6180ec9512ec5124e33047d24c7c9
bf4f25723680f315d20eb8810b19b033aab61d3c
/Chapter27/App02/src/net/homenet/Main.java
a0c8eaf3e4ff05f19e5ed84a2c669d756e8fface
[]
no_license
mousesd/GodOfJava
bae43a0e2b78693581fa026bd3d1e15e6eec70f4
b724f1cc4e7703d19e771ccd22ae050a52246878
refs/heads/master
2020-04-04T16:31:15.334771
2018-12-22T05:18:06
2018-12-22T05:18:06
156,081,316
0
0
null
null
null
null
UTF-8
Java
false
false
1,315
java
package net.homenet; import java.io.FileInputStream; import java.io.FileOutputStream; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; @SuppressWarnings("SameParameterValue") public class Main { public static void main(String[] args) { Main app = new Main(); app.runNewIOSample(); } private void runNewIOSample() { String fileName = "/Users/mousesd/Documents/Java/GodOfJava/text/nio.txt"; try { writeFile(fileName, "My first NIO sample"); readFile(fileName); } catch (Exception e) { e.printStackTrace(); } } private void writeFile(String fileName, String data) throws Exception { FileChannel channel = new FileOutputStream(fileName).getChannel(); byte[] bytes = data.getBytes(); ByteBuffer buffer = ByteBuffer.wrap(bytes); channel.write(buffer); channel.close(); } private void readFile(String fileName) throws Exception { FileChannel channel = new FileInputStream(fileName).getChannel(); ByteBuffer buffer = ByteBuffer.allocate(1024); channel.read(buffer); buffer.flip(); while (buffer.hasRemaining()) { System.out.print((char) buffer.get()); } channel.close(); } }
[ "mousesd@gmail.com" ]
mousesd@gmail.com
ab95911825d68cb3b8bdc51f47d145a2c84f2c45
bf842deaace785241e7e55ac4d733a49d7da12a4
/cdm/src/main/java/ucar/nc2/util/cache/FileCacheIF.java
1a550b46166e368a035acc2ba39659a6aebe7c92
[ "NetCDF" ]
permissive
vegasm/thredds
0d30743f8b4bd6352f57941068d8ad57eadf441a
910db13d3ff90d8910e32b7421cbbfc9d3dad487
refs/heads/4.5.5
2021-01-18T08:18:23.730722
2015-03-06T22:24:24
2015-03-06T22:24:24
24,839,106
0
0
null
null
null
null
UTF-8
Java
false
false
2,873
java
/* * Copyright 1998-2014 University Corporation for Atmospheric Research/Unidata * * Portions of this software were developed by the Unidata Program at the * University Corporation for Atmospheric Research. * * Access and use of this software shall impose the following obligations * and understandings on the user. The user is granted the right, without * any fee or cost, to use, copy, modify, alter, enhance and distribute * this software, and any derivative works thereof, and its supporting * documentation for any purpose whatsoever, provided that this entire * notice appears in all copies of the software, derivative works and * supporting documentation. Further, UCAR requests that the user credit * UCAR/Unidata in any publications that result from the use of this * software or in any product that includes this software. The names UCAR * and/or Unidata, however, may not be used in any advertising or publicity * to endorse or promote any products or commercial entity unless specific * written permission is obtained from UCAR/Unidata. The user also * understands that UCAR/Unidata is not obligated to provide the user with * any support, consulting, training or assistance of any kind with regard * to the use, operation and performance of this software nor to provide * the user with any updates, revisions, new versions or "bug fixes." * * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. */ package ucar.nc2.util.cache; import ucar.nc2.util.CancelTask; import java.io.IOException; import java.util.Formatter; import java.util.List; /** * An interface to a FileCache * * @author caron * @since 10/28/2014 */ public interface FileCacheIF { public void enable(); public void disable(); public FileCacheable acquire(FileFactory factory, String location) throws IOException; public FileCacheable acquire(FileFactory factory, Object hashKey, String location, int buffer_size, CancelTask cancelTask, Object spiObject) throws IOException; public void release(FileCacheable ncfile) throws IOException; public void clearCache(boolean force); // debugging public void resetTracking(); public void showTracking(Formatter format); public void showCache(Formatter format); public void showStats(Formatter format); public List<String> showCache(); }
[ "caron@unidata.ucar.edu" ]
caron@unidata.ucar.edu
3694e18ffa4919747c25972dabf35dad538ca8dc
f7f9d7fa841e856927e02513ecc74dc00c935f8a
/test/framework/src/main/java/org/codelibs/fesen/test/rest/yaml/section/GreaterThanEqualToAssertion.java
595abd1b6d10d66eb549f72d8d7b75c8401e3f35
[ "CDDL-1.0", "MIT", "BSD-3-Clause", "LGPL-2.0-or-later", "LGPL-2.1-only", "NAIST-2003", "LicenseRef-scancode-generic-export-compliance", "ICU", "SunPro", "Python-2.0", "CC-BY-SA-3.0", "MPL-1.1", "GPL-2.0-only", "CPL-1.0", "LicenseRef-scancode-other-copyleft", "Apache-2.0", "LicenseRef-scancode-public-domain", "CC-PDDC", "BSD-2-Clause", "LicenseRef-scancode-unicode-mappings", "LicenseRef-scancode-unicode", "CC0-1.0", "Apache-1.1", "EPL-1.0", "Classpath-exception-2.0" ]
permissive
codelibs/fesen
3f949fd3533e8b25afc3d3475010d1b1a0d95c09
b2440fbda02e32f7abe77d2be95ead6a16c8af06
refs/heads/main
2022-07-27T21:14:02.455938
2021-12-21T23:54:20
2021-12-21T23:54:20
330,334,670
4
0
Apache-2.0
2022-05-17T01:54:31
2021-01-17T07:07:56
Java
UTF-8
Java
false
false
3,312
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch 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.codelibs.fesen.test.rest.yaml.section; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.codelibs.fesen.common.xcontent.XContentLocation; import org.codelibs.fesen.common.xcontent.XContentParser; import org.codelibs.fesen.core.Tuple; import java.io.IOException; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; /** * Represents a gte assert section: * * - gte: { fields._ttl: 0 } */ public class GreaterThanEqualToAssertion extends Assertion { public static GreaterThanEqualToAssertion parse(XContentParser parser) throws IOException { XContentLocation location = parser.getTokenLocation(); Tuple<String,Object> stringObjectTuple = ParserUtils.parseTuple(parser); if (! (stringObjectTuple.v2() instanceof Comparable) ) { throw new IllegalArgumentException("gte section can only be used with objects that support natural ordering, found " + stringObjectTuple.v2().getClass().getSimpleName()); } return new GreaterThanEqualToAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2()); } private static final Logger logger = LogManager.getLogger(GreaterThanEqualToAssertion.class); public GreaterThanEqualToAssertion(XContentLocation location, String field, Object expectedValue) { super(location, field, expectedValue); } @Override protected void doAssert(Object actualValue, Object expectedValue) { logger.trace("assert that [{}] is greater than or equal to [{}] (field: [{}])", actualValue, expectedValue, getField()); assertThat("value of [" + getField() + "] is not comparable (got [" + safeClass(actualValue) + "])", actualValue, instanceOf(Comparable.class)); assertThat("expected value of [" + getField() + "] is not comparable (got [" + expectedValue.getClass() + "])", expectedValue, instanceOf(Comparable.class)); try { assertThat(errorMessage(), (Comparable) actualValue, greaterThanOrEqualTo((Comparable) expectedValue)); } catch (ClassCastException e) { fail("cast error while checking (" + errorMessage() + "): " + e); } } private String errorMessage() { return "field [" + getField() + "] is not greater than or equal to [" + getExpectedValue() + "]"; } }
[ "shinsuke@apache.org" ]
shinsuke@apache.org
2725c08f8cc94d1a8d8c4b29f27215846dd41699
318b813ad38900bf63c6d7978dc5e0f674d1f847
/Chapter 5 - Example 11 (MTOM)/src/main/java/br/com/acaosistemas/images/SkiImageService.java
23496721797ce9ea2b2a023410ea569a8431833e
[]
no_license
MarceloLeite2604/JWSUR2E
9f14ef3ade90549b7c3d55890a317d23e93fdf6b
d77d595ed98cd11059376eae00a40954dcd157c1
refs/heads/master
2021-01-10T17:01:25.254898
2019-07-02T18:41:54
2019-07-02T18:41:54
43,815,334
0
0
null
2020-06-30T23:15:32
2015-10-07T12:49:16
Java
UTF-8
Java
false
false
2,881
java
package br.com.acaosistemas.images; import java.awt.Image; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.imageio.ImageIO; import javax.imageio.ImageReader; import javax.imageio.stream.ImageInputStream; import javax.jws.WebMethod; import javax.jws.WebService; import javax.xml.ws.BindingType; import javax.xml.ws.soap.SOAPBinding; /* * Marcelo Leite - No caso da publicação do serviço através de * Endpoint, o arquivo WSDL deve estar na pasta raiz dos fontes. * Se o arquivo for colocado em outra pasta ou dentro de uma * package, ao executar o programa ocorrerá o erro "[failed to * localize] cannot.load.wsdl", mesmo que sua localização esteja * correta no atributo "wsdlLoation". */ @WebService(wsdlLocation = "mtom.wsdl") @BindingType(value = SOAPBinding.SOAP11HTTP_MTOM_BINDING) // optional public class SkiImageService { private String folder = "images"; private Map<String, String> photos; @WebMethod public Image getImage(String name) { System.out.println(name); return createImage(name); } @WebMethod public List<Image> getImages() { return createImageList(); } public SkiImageService() { photos = new HashMap<String, String>(); photos.put("nordic", "nordic.jpg"); photos.put("alpine", "alpine.jpg"); photos.put("telemk", "telemk.jpg"); } @SuppressWarnings("rawtypes") private Image createImage(String name) { String fileName = folder + File.separator + photos.get(name); byte[] bytes = getRawBytes(fileName); ByteArrayInputStream in = new ByteArrayInputStream(bytes); Iterator iterators = ImageIO.getImageReadersByFormatName("jpeg"); ImageReader iterator = (ImageReader) iterators.next(); Image image = null; try { ImageInputStream iis = ImageIO.createImageInputStream(in); iterator.setInput(iis, true); image = iterator.read(0); } catch (Exception e) { throw new RuntimeException(e); } return image; } private List<Image> createImageList() { List<Image> list = new ArrayList<Image>(); for (String key : photos.keySet()) { Image image = createImage(key); if (image != null) list.add(image); } return list; } private byte[] getRawBytes(String fileName) { if (fileName == null) fileName = "nordic.jpg"; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { FileInputStream in = new FileInputStream(fileName); /*if (in == null) in = new FileInputStream("nordic.jpg");*/ byte[] buffer = new byte[2048]; int n = 0; while ((n = in.read(buffer)) != -1) out.write(buffer, 0, n); // append to array in.close(); } catch (Exception e) { throw new RuntimeException(e); } return out.toByteArray(); } }
[ "marceloleite2604@gmail.com" ]
marceloleite2604@gmail.com
f9910a147461ded27ff07a233202b71398be7b7c
5f84a11cf6ad938a1d3cf0d84708b7bb3b4c5ab9
/src/hasor-jdbc/src/main/java/net/hasor/jdbc/exceptions/TransactionDataAccessException.java
5a9588f4d99469e6f29e9a1e6c21857c10b55246
[]
no_license
zhao07/hasor
9afd9fdb43a698bc80928e0fa9717fac2a2bc73e
1beaa46d59d0dc7c3a8a0867b74a371cdba8b87c
refs/heads/master
2021-01-21T16:00:15.307952
2014-01-17T12:07:10
2014-01-17T12:07:10
null
0
0
null
null
null
null
GB18030
Java
false
false
1,485
java
/* * Copyright 2002-2006 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 net.hasor.jdbc.exceptions; /** * 数据库事务性异常的根,子类将会确定具体事务方面原因。 * @version : 2013-10-12 * @author 赵永春(zyc@hasor.net) */ public class TransactionDataAccessException extends DataAccessException { private static final long serialVersionUID = -5338007128104634937L; /** * 数据库事务性异常的根,子类将会确定具体事务方面原因。 * @param msg the detail message */ public TransactionDataAccessException(String msg) { super(msg); } /** * 数据库事务性异常的根,子类将会确定具体事务方面原因。 * @param msg the detail message * @param cause the root cause from the data access API in use */ public TransactionDataAccessException(String msg, Throwable cause) { super(msg, cause); } }
[ "zyc@byshell.org" ]
zyc@byshell.org
3d73152bc95468e5b05c3150f46506df29027dfa
b150de05a7feb9f00cfd5fdb971b58ebc71cda47
/src/test/java/com/sp/ApplicationTests.java
91df30011f03c8a07ccc450f42c6f0f2e19198c0
[]
no_license
JeerlaManjunath/SBMSProject
f0d0376ae018bb99fddbab201d3f0f7f4d5beab1
0c19cb3df9187cfe15ddb56d75835de80f8db3e5
refs/heads/master
2022-10-22T05:03:00.591456
2020-06-08T08:15:55
2020-06-08T08:15:55
270,576,248
0
0
null
null
null
null
UTF-8
Java
false
false
192
java
package com.sp; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ApplicationTests { @Test void contextLoads() { } }
[ "=" ]
=
28565d3a59b425ddf9104ac07eb3a747555dbe29
57653c870d15158b2d9c30dfd48d490258b75c1c
/mango-db/src/io/pelle/mango/db/dao/IDAOCallback.java
fc7b8a4c929b217e8f01109436d9c0f5638c3517
[]
no_license
pellepelster/mango
edf3938a80edf336e17f4079db3bf7aa638a74ce
ecd09e877eb59630feb449fb260574eb8705bc3b
refs/heads/master
2016-09-15T19:43:24.564927
2015-12-18T17:04:39
2015-12-18T17:04:39
20,863,367
5
2
null
2015-07-13T20:38:13
2014-06-15T19:26:57
Java
UTF-8
Java
false
false
399
java
package io.pelle.mango.db.dao; import io.pelle.mango.client.base.vo.IVOEntity; import java.util.Map; public interface IDAOCallback<VOType extends IVOEntity> { void onCreate(VOType voEntity); void onUpdate(VOType voEntity); void onDeleteAll(Class<? extends IVOEntity> voEntityClass); void onDelete(VOType voEntity); void onNewInstance(VOType voEntity, Map<String, String> properties); }
[ "pelle@pelle.io" ]
pelle@pelle.io
bed16d93744e27ba3d407f232c420a73b9cb40a6
2cdb0859a93650ef5db10387dce6158f7286c31e
/app/src/main/java/com/cyht/wykc/exception/AppExceptionHandler.java
fb0257034b6262927b3347b5e75a5997d597ca94
[]
no_license
LEEHOR/LookForCar
91cf7d39b56e846bdf09b629a85066e73ad43fae
212a7fe8a9f5437cfca01b41c316074d787fd9b6
refs/heads/master
2020-04-02T12:21:35.115602
2018-12-25T10:10:02
2018-12-25T10:10:02
154,429,988
1
0
null
null
null
null
UTF-8
Java
false
false
7,329
java
package com.cyht.wykc.exception; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Build; import android.os.Environment; import android.util.Log; import com.cyht.wykc.mvp.view.LaunchActivity; import com.cyht.wykc.utils.ActivityManagerUtils; import com.socks.library.KLog; import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; import java.lang.reflect.Field; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Locale; import java.util.Map; /** * Author:leguang on 2016/10/9 0009 15:49 * Email:langmanleguang@qq.com */ @SuppressWarnings("unused") public class AppExceptionHandler implements Thread.UncaughtExceptionHandler { private static final String TAG = AppExceptionHandler.class.getSimpleName(); //系统默认的UncaughtException处理类 private Thread.UncaughtExceptionHandler mDefaultHandler; //CrashHandler实例 private static AppExceptionHandler instance; //程序的Context对象 private Context mContext; //用来存储设备信息和异常信息 private Map<String, String> infos = new HashMap<>(); //用于格式化日期,作为日志文件名的一部分 private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.CHINA); private String crashTip = "很抱歉,程序出现异常,即将退出!"; public String getCrashTip() { return crashTip; } public void setCrashTip(String crashTip) { this.crashTip = crashTip; } /** * 保证只有一个CrashHandler实例 */ private AppExceptionHandler(Context mContext) { this.mContext = mContext; //获取系统默认的UncaughtException处理器 mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler(); } /** * 获取CrashHandler实例 ,单例模式 * * @return 单例 */ public static AppExceptionHandler getInstance(Context mContext) { if (instance == null) { instance = new AppExceptionHandler(mContext); } return instance; } /** * 当UncaughtException发生时会转入该函数来处理 * * @param thread 线程 * @param ex 异常 */ @Override public void uncaughtException(Thread thread, Throwable ex) { if (!handleException(ex) && mDefaultHandler != null) { //如果用户没有处理则让系统默认的异常处理器来处理 mDefaultHandler.uncaughtException(thread, ex); } } /** * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成. * * @param throwable 异常 * @return true:如果处理了该异常信息;否则返回false. */ private boolean handleException(final Throwable throwable) { if (throwable == null || mContext == null) { return false; } boolean isSuccess = true; try { //收集设备参数信息 collectDeviceInfo(mContext); //保存日志文件 isSuccess = saveCrashInfo2File(throwable); } catch (Exception e) { e.printStackTrace(); return false; } finally { if (!isSuccess) { return false; } else { // new Thread() { // @Override // public void run() { // Looper.prepare(); // //弹出Dialog提示用户退出App或重启App // showDialog(); // Looper.loop(); // } // }.start(); Intent intent = new Intent(mContext, LaunchActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent); ActivityManagerUtils.getInstance().appExit(); KLog.e("重启"); } } return true; } private void showDialog() { } /** * 收集设备参数信息 * * @param ctx 上下文 */ public void collectDeviceInfo(Context ctx) { try { PackageManager pm = ctx.getPackageManager(); PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), PackageManager.GET_ACTIVITIES); if (pi != null) { String versionName = pi.versionName == null ? "null" : pi.versionName; String versionCode = pi.versionCode + ""; infos.put("versionName", versionName); infos.put("versionCode", versionCode); } } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "an error occured when collect package info", e); } Field[] fields = Build.class.getDeclaredFields(); for (Field field : fields) { try { field.setAccessible(true); infos.put(field.getName(), field.get(null).toString()); Log.d(TAG, field.getName() + " : " + field.get(null)); } catch (Exception e) { Log.e(TAG, "an error occured when collect crash info", e); } } } /** * 保存错误信息到文件中 * * @param ex 异常 * @return 返回文件名称, 便于将文件传送到服务器 */ private Boolean saveCrashInfo2File(Throwable ex) { boolean isSave = false; StringBuffer sb = new StringBuffer(); for (Map.Entry<String, String> entry : infos.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); sb.append(key + "=" + value + "\n"); } Writer writer = new StringWriter(); PrintWriter printWriter = new PrintWriter(writer); ex.printStackTrace(printWriter); Throwable cause = ex.getCause(); while (cause != null) { cause.printStackTrace(printWriter); cause = cause.getCause(); } printWriter.close(); String result = writer.toString(); sb.append(result); try { long timestamp = System.currentTimeMillis(); String time = formatter.format(new Date()); String fileName = "crash-" + time + "-" + timestamp + ".log"; if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { String path = Environment.getExternalStorageDirectory().getPath() + "/crash/"; Log.d(TAG, "path=" + path); File dir = new File(path); if (!dir.exists()) { dir.mkdirs(); } FileOutputStream fos = new FileOutputStream(path + fileName); fos.write(sb.toString().getBytes()); fos.close(); isSave = true; } return isSave; } catch (Exception e) { Log.e(TAG, "an error occured while writing file...", e); } return null; } }
[ "1622293788@qq.com" ]
1622293788@qq.com
8d5f11776d0ccdd70d9fcfe913fe50bd875b0dcc
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/24/24_b507a707ca983215f08215ff9176142b30f303b4/MembersUpdateCall/24_b507a707ca983215f08215ff9176142b30f303b4_MembersUpdateCall_s.java
7c4dc7acec3a55ca5e7f678efed5cee06b02b175
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,514
java
/* * Copyright (c) 2008-2012, Hazel Bilisim Ltd. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hazelcast.cluster; import com.hazelcast.impl.MemberImpl; import com.hazelcast.nio.Address; import com.hazelcast.util.Clock; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; public class MembersUpdateCall extends AbstractRemotelyCallable<Boolean> { private static final long serialVersionUID = -2311579721761844861L; private Collection<MemberInfo> memberInfos; private long masterTime = Clock.currentTimeMillis(); public MembersUpdateCall() { memberInfos = new ArrayList<MemberInfo>(); } public MembersUpdateCall(Collection<MemberImpl> lsMembers, long masterTime) { this.masterTime = masterTime; memberInfos = new ArrayList<MemberInfo>(lsMembers.size()); for (MemberImpl member : lsMembers) { memberInfos.add(new MemberInfo(member.getAddress(), member.getNodeType(), member.getUuid())); } } public Boolean call() { final Address masterAddress = conn != null ? conn.getEndPoint() : null; final boolean accept = conn == null || // which means this is a local call. (masterAddress != null && masterAddress.equals(node.getMasterAddress())); if (accept) { node.getClusterImpl().setMasterTime(masterTime); node.clusterManager.updateMembers(getMemberInfos()); return Boolean.TRUE; } return Boolean.FALSE; } public void addMemberInfo(MemberInfo memberInfo) { if (!memberInfos.contains(memberInfo)) { memberInfos.add(memberInfo); } } @Override public void readData(DataInput in) throws IOException { masterTime = in.readLong(); int size = in.readInt(); memberInfos = new ArrayList<MemberInfo>(size); while (size-- > 0) { MemberInfo memberInfo = new MemberInfo(); memberInfo.readData(in); memberInfos.add(memberInfo); } } @Override public void writeData(DataOutput out) throws IOException { out.writeLong(masterTime); out.writeInt(memberInfos.size()); for (MemberInfo memberInfo : memberInfos) { memberInfo.writeData(out); } } @Override public String toString() { StringBuilder sb = new StringBuilder("MembersUpdateCall {\n"); for (MemberInfo address : memberInfos) { sb.append(address).append('\n'); } sb.append('}'); return sb.toString(); } /** * @return the lsMemberInfos */ public Collection<MemberInfo> getMemberInfos() { return Collections.unmodifiableCollection(memberInfos); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
4864c7d0b23abfd4401b61f7aff7de17445731c1
b93a95bae3c52bf5a7cd3d5fbb43959d0aaa6131
/src/main/java/org/apache/jsp/WEB_002dINF/jsp/st/usTmc_jsp.java
775f9e7baac2897f6b5b896b09fb5ad48c3593f8
[ "EPL-1.0", "MIT", "BSD-2-Clause", "LGPL-2.0-or-later", "Classpath-exception-2.0", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-proprietary-license", "GPL-2.0-or-later", "GPL-2.0-only", "LicenseRef-scancode-generic-exception", "GPL-1.0-or-later", "CDDL-1.0", "LicenseRef-scancode-unknown-license-reference", "blessing", "LicenseRef-scancode-public-domain", "Apache-2.0", "OFL-1.1", "LicenseRef-scancode-public-domain-disclaimer", "LicenseRef-scancode-free-unknown", "Bitstream-Vera", "CDDL-1.1" ]
permissive
demidenko05/beige-accjet
f4aa0a6dd99c36d4bc04aad3b80f57ea9272c470
64e489cfb33f5ca2f468253e1f99512028b2585f
refs/heads/master
2023-05-27T02:04:47.309469
2020-11-06T08:46:06
2020-11-06T08:46:06
186,005,182
0
0
BSD-2-Clause
2023-05-23T20:14:17
2019-05-10T14:47:16
Java
UTF-8
Java
false
false
5,932
java
/* * Generated by the Jasper component of Apache Tomcat * Version: JspCServletContext/1.0 * Note: The last modified time of this file was set to * the last modified time of the source file after * generation to assist with modification tracking. */ package org.apache.jsp.WEB_002dINF.jsp.st; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; public final class usTmc_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { private static final javax.servlet.jsp.JspFactory _jspxFactory = javax.servlet.jsp.JspFactory.getDefaultFactory(); private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants; private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest; private volatile javax.el.ExpressionFactory _el_expressionfactory; private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager; public java.util.Map<java.lang.String,java.lang.Long> getDependants() { return _jspx_dependants; } public javax.el.ExpressionFactory _jsp_getExpressionFactory() { if (_el_expressionfactory == null) { synchronized (this) { if (_el_expressionfactory == null) { _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory(); } } } return _el_expressionfactory; } public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() { if (_jsp_instancemanager == null) { synchronized (this) { if (_jsp_instancemanager == null) { _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig()); } } } return _jsp_instancemanager; } public void _jspInit() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig()); } public void _jspDestroy() { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release(); } public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException { final javax.servlet.jsp.PageContext pageContext; javax.servlet.http.HttpSession session = null; final javax.servlet.ServletContext application; final javax.servlet.ServletConfig config; javax.servlet.jsp.JspWriter out = null; final java.lang.Object page = this; javax.servlet.jsp.JspWriter _jspx_out = null; javax.servlet.jsp.PageContext _jspx_page_context = null; try { response.setContentType("text/html;charset=UTF-8"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext; application = pageContext.getServletContext(); config = pageContext.getServletConfig(); session = pageContext.getSession(); out = pageContext.getOut(); _jspx_out = out; out.write('\n'); out.write('\n'); if (_jspx_meth_c_005fif_005f0(_jspx_page_context)) return; out.write('\n'); out.write('\n'); } catch (java.lang.Throwable t) { if (!(t instanceof javax.servlet.jsp.SkipPageException)){ out = _jspx_out; if (out != null && out.getBufferSize() != 0) try { if (response.isCommitted()) { out.flush(); } else { out.clearBuffer(); } } catch (java.io.IOException e) {} if (_jspx_page_context != null) _jspx_page_context.handlePageException(t); else throw new ServletException(t); } } finally { _jspxFactory.releasePageContext(_jspx_page_context); } } private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context) throws java.lang.Throwable { javax.servlet.jsp.PageContext pageContext = _jspx_page_context; javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut(); // c:if org.apache.taglibs.standard.tag.rt.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.rt.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.rt.core.IfTag.class); _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context); _jspx_th_c_005fif_005f0.setParent(null); // /WEB-INF/jsp/st/usTmc.jsp(3,0) name = test type = boolean reqTime = true required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null _jspx_th_c_005fif_005f0.setTest(((java.lang.Boolean) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${not empty mdl}", java.lang.Boolean.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)).booleanValue()); int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag(); if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { do { out.write('\n'); out.write(' '); out.write(' '); out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${mdl.usr}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false)); out.write('\n'); int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody(); if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break; } while (true); } if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) { _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return true; } _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0); return false; } }
[ "demidenko05@gmail.com" ]
demidenko05@gmail.com
63e9ae4de6803eac7e260bf8f567e3aa8f4f9ccf
682bfd40c3cc651a6196e8e368696e930370a618
/currency-service/src/main/java/ekol/currency/util/Util.java
3c100e7b6f2dc01fdee43a3924007fdf7767107a
[]
no_license
seerdaryilmazz/OOB
3b27b67ce1cbf3f411f7c672d0bed0d71bc9b127
199f0c18b82d04569d26a08a1a4cd8ee8c7ba42d
refs/heads/master
2022-12-30T09:23:25.061974
2020-10-09T13:14:39
2020-10-09T13:14:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,061
java
package ekol.currency.util; import ekol.currency.domain.ExchangeRate; import ekol.currency.domain.PreferredValue; import ekol.currency.domain.dto.ExchangeRateForUI; import ekol.exceptions.ApplicationException; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.tuple.Pair; import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.net.URL; import java.net.URLConnection; import java.util.*; public class Util { public static <E> HashSet<E> hashSet(E... args) { HashSet<E> set = new HashSet<>(); for (E obj : args) { set.add(obj); } return set; } public static <E> LinkedHashSet<E> linkedHashSet(E... args) { LinkedHashSet<E> set = new LinkedHashSet<>(); for (E obj : args) { set.add(obj); } return set; } public static <K, V> HashMap<K, V> hashMap(Pair<K, V>... args) { HashMap<K, V> map = new HashMap<>(); for (Pair<K, V> pair : args) { map.put(pair.getLeft(), pair.getRight()); } return map; } public static List<String> readLinesOfFileAtUrl(String urlStr) throws IOException { List<String> lines = new ArrayList<>(); BufferedReader in = null; try { URL url = new URL(urlStr); URLConnection connection = url.openConnection(); connection.setConnectTimeout(Constants.DEFAULT_CONNECT_TIMEOUT); connection.setReadTimeout(Constants.DEFAULT_READ_TIMEOUT); in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { lines.add(line); } in.close(); } catch (IOException e) { IOUtils.closeQuietly(in); throw e; } return lines; } public static String readContentOfFileAtUrl(String urlStr) throws IOException { StringBuilder stringBuilder = new StringBuilder(); BufferedReader in = null; try { URL url = new URL(urlStr); URLConnection connection = url.openConnection(); connection.setConnectTimeout(Constants.DEFAULT_CONNECT_TIMEOUT); connection.setReadTimeout(Constants.DEFAULT_READ_TIMEOUT); in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { stringBuilder.append(line).append("\n"); } in.close(); } catch (IOException e) { IOUtils.closeQuietly(in); throw e; } return stringBuilder.toString(); } public static Document getDocumentFromXml(String xml) throws ParserConfigurationException, IOException, SAXException { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = builderFactory.newDocumentBuilder(); return builder.parse(new ByteArrayInputStream(xml.getBytes())); } public static String removeNonAsciiChars(String s) { return s.replaceAll("[^\\x00-\\x7F]", ""); } private static BigDecimal getExchangeRateValue(ExchangeRate exchangeRate, PreferredValue preferredValue) { BigDecimal value; if (preferredValue == null) { value = exchangeRate.getValue(); } else { if (preferredValue.equals(PreferredValue.FOREX_BUYING)) { value = exchangeRate.getForexBuyingValue(); } else if (preferredValue.equals(PreferredValue.FOREX_SELLING)) { value = exchangeRate.getForexSellingValue(); } else if (preferredValue.equals(PreferredValue.BANKNOTE_BUYING)) { value = exchangeRate.getBanknoteBuyingValue(); } else if (preferredValue.equals(PreferredValue.BANKNOTE_SELLING)) { value = exchangeRate.getBanknoteSellingValue(); } else { throw new ApplicationException("No implementation for {0}", preferredValue); } if (value == null) { throw new ApplicationException("No value for {0}", preferredValue); } } return value; } private static BigDecimal getExchangeRateValue( List<ExchangeRate> exchangeRates, String fromCurrency, String toCurrency, PreferredValue preferredValue) { BigDecimal value = null; if (fromCurrency.equals(toCurrency)) { value = BigDecimal.ONE; } else { for (ExchangeRate exchangeRate : exchangeRates) { if (exchangeRate.getFromCurrency().equals(fromCurrency) && exchangeRate.getToCurrency().equals(toCurrency)) { value = getExchangeRateValue(exchangeRate, preferredValue); value = value.divide(BigDecimal.valueOf(exchangeRate.getUnit()), 10, BigDecimal.ROUND_HALF_UP); break; } else if (exchangeRate.getFromCurrency().equals(toCurrency) && exchangeRate.getToCurrency().equals(fromCurrency)) { value = getExchangeRateValue(exchangeRate, preferredValue); value = BigDecimal.valueOf(exchangeRate.getUnit()).divide(value, 10, BigDecimal.ROUND_HALF_UP); break; } } } return value; } /** * @param crossRateCurrency Çapraz hesaplama yapmak durumunda kalırsak arada kullanacağımız para birimi */ public static BigDecimal getExchangeRateValue( List<ExchangeRate> exchangeRates, String fromCurrency, String toCurrency, String crossRateCurrency, PreferredValue preferredValue) { BigDecimal value = getExchangeRateValue(exchangeRates, fromCurrency, toCurrency, preferredValue); // Çapraz kur bulmaya çalışacağız. if (value == null && crossRateCurrency != null) { BigDecimal value1 = getExchangeRateValue(exchangeRates, fromCurrency, crossRateCurrency, preferredValue); if (value1 != null) { BigDecimal value2 = getExchangeRateValue(exchangeRates, crossRateCurrency, toCurrency, preferredValue); if (value2 != null) { value = value1.multiply(value2); } } } if (value == null) { throw new ApplicationException("{0} cannot be converted to {1}", fromCurrency, toCurrency); } else { /** * Döviz kurları çevriminde virgülden sonra 6 rakamdan fazla gösteren yer/site görmedik. O yüzden * yuvarlama yaparken 6 kullanıyoruz. */ return value.setScale(6, BigDecimal.ROUND_HALF_UP); } } /** * TODO: Normalde böyle bir çevrime gerek yok ancak currency-service'i ve currency-service'i kullanan management-ui'ı aynı anda prod'a * alamadığımız için böyle yaptık. Uygun bir zamanda ExchangeRateForUI silinip yerine yine ExchangeRate kullanılabilir. */ public static List<ExchangeRateForUI> convert(List<ExchangeRate> list) { List<ExchangeRateForUI> resultList = new ArrayList<>(); if (CollectionUtils.isNotEmpty(list)) { for (ExchangeRate elem : list) { resultList.add(ExchangeRateForUI.convert(elem)); } } return resultList; } }
[ "dogukan.sahinturk@ekol.com" ]
dogukan.sahinturk@ekol.com
b99b21e6d70e5185cd85fe052e07fe1a4e17564a
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13316-3-11-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/transformation/XWikiRenderingContext_ESTest.java
3a84d6300a1288510036d373cd9e039539585684
[]
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
592
java
/* * This file was automatically generated by EvoSuite * Sat Apr 04 00:02:20 UTC 2020 */ package org.xwiki.rendering.internal.transformation; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWikiRenderingContext_ESTest extends XWikiRenderingContext_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7b49aafd235ec05c0295769ed8c8f1331206e631
9c05b703a7f3d00d70b77d3815ff087b3f244c06
/JavaEE/Spring_Folder/MVC/Spring_MVC_Examples/first_example/Book.java
3b632303828821b1f7c324f7d99fa87a8a483d9c
[]
no_license
ramdafale/Notes1
641ef32d34bf66fc4097b71402bf9e046f11351e
20bcf6e9440308f87db7ce435d68ca26bad17e9b
refs/heads/master
2020-03-17T04:16:12.660683
2018-12-19T10:40:23
2018-12-19T10:40:23
133,268,772
0
1
null
null
null
null
UTF-8
Java
false
false
439
java
package mypack; public class Book { @Override public String toString() { // TODO Auto-generated method stub return "["+bookName+" "+price+"]"; } private String bookName; private long price; public String getBookName() { return bookName; } public void setBookName(String bookName) { this.bookName = bookName; } public long getPrice() { return price; } public void setPrice(long price) { this.price = price; } }
[ "ramdafale@gmail.com" ]
ramdafale@gmail.com
c538e835ceadfb80b485bed52843bbdf78efd8c8
bd9d83c3470ecde06de79e8ce04f8f2f65664b04
/line/line-bot-sample/src/test/java/com/github/yukihane/linebotsample/LineBotSampleApplicationTests.java
42721274582e60e66b23dc5563e95ba3bf44b1f9
[]
no_license
yukihane/hello-java
b85a482e797892743bb43a60944b3708e87af21d
305c0eb113a41f9c393c35f927fb2183324f2222
refs/heads/main
2023-03-10T08:40:51.328711
2023-01-27T04:47:37
2023-01-27T04:47:37
43,946,811
10
2
null
2023-03-07T05:08:33
2015-10-09T09:44:52
Java
UTF-8
Java
false
false
357
java
package com.github.yukihane.linebotsample; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class LineBotSampleApplicationTests { @Test public void contextLoads() { } }
[ "yukihane.feather@gmail.com" ]
yukihane.feather@gmail.com
17d1775479a6f6de5e1e007509e296862a2102ae
c81963cab526c4dc24bee21840f2388caf7ff4cf
/io/reactivex/internal/operators/flowable/FlowableSubscribeOn.java
172bca3dc6fd58aaa36c7d3d518cc5ef4c6241ad
[]
no_license
ryank231231/jp.co.penet.gekidanprince
ba2f38e732828a4454402aa7ef93a501f8b7541e
d76db01eeadf228d31006e4e71700739edbf214f
refs/heads/main
2023-02-19T01:38:54.459230
2021-01-16T10:04:22
2021-01-16T10:04:22
329,815,191
0
0
null
null
null
null
UTF-8
Java
false
false
4,799
java
package io.reactivex.internal.operators.flowable; import io.reactivex.Flowable; import io.reactivex.FlowableSubscriber; import io.reactivex.Scheduler; import io.reactivex.internal.subscriptions.SubscriptionHelper; import io.reactivex.internal.util.BackpressureHelper; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; public final class FlowableSubscribeOn<T> extends AbstractFlowableWithUpstream<T, T> { final boolean nonScheduledRequests; final Scheduler scheduler; public FlowableSubscribeOn(Flowable<T> paramFlowable, Scheduler paramScheduler, boolean paramBoolean) { super(paramFlowable); this.scheduler = paramScheduler; this.nonScheduledRequests = paramBoolean; } public void subscribeActual(Subscriber<? super T> paramSubscriber) { Scheduler.Worker worker = this.scheduler.createWorker(); SubscribeOnSubscriber<T> subscribeOnSubscriber = new SubscribeOnSubscriber<T>(paramSubscriber, worker, (Publisher<T>)this.source, this.nonScheduledRequests); paramSubscriber.onSubscribe(subscribeOnSubscriber); worker.schedule(subscribeOnSubscriber); } static final class SubscribeOnSubscriber<T> extends AtomicReference<Thread> implements FlowableSubscriber<T>, Subscription, Runnable { private static final long serialVersionUID = 8094547886072529208L; final Subscriber<? super T> actual; final boolean nonScheduledRequests; final AtomicLong requested; final AtomicReference<Subscription> s; Publisher<T> source; final Scheduler.Worker worker; SubscribeOnSubscriber(Subscriber<? super T> param1Subscriber, Scheduler.Worker param1Worker, Publisher<T> param1Publisher, boolean param1Boolean) { this.actual = param1Subscriber; this.worker = param1Worker; this.source = param1Publisher; this.s = new AtomicReference<Subscription>(); this.requested = new AtomicLong(); this.nonScheduledRequests = param1Boolean ^ true; } public void cancel() { SubscriptionHelper.cancel(this.s); this.worker.dispose(); } public void onComplete() { this.actual.onComplete(); this.worker.dispose(); } public void onError(Throwable param1Throwable) { this.actual.onError(param1Throwable); this.worker.dispose(); } public void onNext(T param1T) { this.actual.onNext(param1T); } public void onSubscribe(Subscription param1Subscription) { if (SubscriptionHelper.setOnce(this.s, param1Subscription)) { long l = this.requested.getAndSet(0L); if (l != 0L) requestUpstream(l, param1Subscription); } } public void request(long param1Long) { if (SubscriptionHelper.validate(param1Long)) { Subscription subscription = this.s.get(); if (subscription != null) { requestUpstream(param1Long, subscription); } else { BackpressureHelper.add(this.requested, param1Long); subscription = this.s.get(); if (subscription != null) { param1Long = this.requested.getAndSet(0L); if (param1Long != 0L) requestUpstream(param1Long, subscription); } } } } void requestUpstream(long param1Long, Subscription param1Subscription) { if (this.nonScheduledRequests || Thread.currentThread() == get()) { param1Subscription.request(param1Long); return; } this.worker.schedule(new Request(param1Subscription, param1Long)); } public void run() { lazySet(Thread.currentThread()); Publisher<T> publisher = this.source; this.source = null; publisher.subscribe((Subscriber)this); } static final class Request implements Runnable { private final long n; private final Subscription s; Request(Subscription param2Subscription, long param2Long) { this.s = param2Subscription; this.n = param2Long; } public void run() { this.s.request(this.n); } } } static final class Request implements Runnable { private final long n; private final Subscription s; Request(Subscription param1Subscription, long param1Long) { this.s = param1Subscription; this.n = param1Long; } public void run() { this.s.request(this.n); } } } /* Location: Y:\classes2-dex2jar.jar!\io\reactivex\internal\operators\flowable\FlowableSubscribeOn.class * Java compiler version: 6 (50.0) * JD-Core Version: 1.1.3 */
[ "ryank231231@gmail.com" ]
ryank231231@gmail.com
bddd0030678bd27a54b31d05520e690d4c92f0a5
4bdc2db9778a62009326a7ed1bed2729c8ff56a9
/extension/other/databinding/fabric3-databinding-jaxb/src/main/java/org/fabric3/databinding/jaxb/transform/Node2JAXBElementTransformer.java
e2d0cdbbc301c3475bd295476d41bb42ab030dce
[]
no_license
aaronanderson/fabric3-core
2a66038338ac3bb8ba1ae6291f39949cb93412b2
44773a3e636fcfdcd6dcd43b7fb5b442310abae5
refs/heads/master
2021-01-16T21:56:29.067390
2014-01-09T15:44:09
2014-01-14T06:26:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,750
java
/* * Fabric3 * Copyright (c) 2009-2013 Metaform Systems * * Fabric3 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, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. * * --- Original Apache License --- * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.fabric3.databinding.jaxb.transform; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import org.w3c.dom.Node; import org.fabric3.spi.transform.TransformationException; import org.fabric3.spi.transform.Transformer; /** * Converts from a DOM Node to a JAXB type serialized as a JAXBElement. */ public class Node2JAXBElementTransformer implements Transformer<Node, Object> { private JAXBContext jaxbContext; private Class<?> declaredType; public Node2JAXBElementTransformer(JAXBContext jaxbContext, Class<?> declaredType) { this.jaxbContext = jaxbContext; this.declaredType = declaredType; } public Object transform(Node source, ClassLoader loader) throws TransformationException { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loader); return jaxbContext.createUnmarshaller().unmarshal(source, declaredType).getValue(); } catch (JAXBException e) { throw new TransformationException(e); } finally { Thread.currentThread().setContextClassLoader(cl); } } }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com
7521674f49990f952ecf4d40cbd33eb10090f268
000e9ddd9b77e93ccb8f1e38c1822951bba84fa9
/java/classes/cn/testin/analysis/gx.java
2e051c1b0853005be53b5b8d222f398766aa7060
[ "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
1,203
java
package cn.testin.analysis; public final class gx extends ha { public gt a(gt paramgt, int paramInt1, int paramInt2, hc paramhc) { if ((paramInt1 <= 0) || (paramInt2 <= 0)) { throw fw.a(); } gt localgt = new gt(paramInt1, paramInt2); float[] arrayOfFloat = new float[paramInt1 * 2]; paramInt1 = 0; while (paramInt1 < paramInt2) { int j = arrayOfFloat.length; float f = paramInt1; int i = 0; while (i < j) { arrayOfFloat[i] = (i / 2 + 0.5F); arrayOfFloat[(i + 1)] = (f + 0.5F); i += 2; } paramhc.a(arrayOfFloat); a(paramgt, arrayOfFloat); i = 0; while (i < j) { try { if (paramgt.a((int)arrayOfFloat[i], (int)arrayOfFloat[(i + 1)])) { localgt.b(i / 2, paramInt1); } i += 2; } catch (ArrayIndexOutOfBoundsException paramgt) { throw fw.a(); } } paramInt1 += 1; } return localgt; } } /* Location: /Users/gaoht/Downloads/zirom/classes-dex2jar.jar!/cn/testin/analysis/gx.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ght163988@autonavi.com" ]
ght163988@autonavi.com
62f169756705235b12c023dd87b5d732fc62ecc3
3a5985651d77a31437cfdac25e594087c27e93d6
/ojc-core/component-common/test-util/src/com/sun/jbi/common/util/test/Util.java
a3b4253584ff098eecf570ee3f6c175f6cb93ad3
[]
no_license
vitalif/openesb-components
a37d62133d81edb3fdc091abd5c1d72dbe2fc736
560910d2a1fdf31879e3d76825edf079f76812c7
refs/heads/master
2023-09-04T14:40:55.665415
2016-01-25T13:12:22
2016-01-25T13:12:33
48,222,841
0
5
null
null
null
null
UTF-8
Java
false
false
7,623
java
/* * BEGIN_HEADER - DO NOT EDIT * * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the "License"). You may not use this file except * in compliance with the License. * * You can obtain a copy of the license at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * HEADER in each file and include the License file at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * If applicable add the following below this CDDL HEADER, * with the fields enclosed by brackets "[]" replaced with * your own identifying information: Portions Copyright * [year] [name of copyright owner] */ /* * @(#)Util.java * * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. * * END_HEADER - DO NOT EDIT */ package com.sun.jbi.common.util.test; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.PrintWriter; import java.io.StringWriter; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; /** * Contains generic utility methods. * * @author Kevan Simpson */ public class Util { private static TransformerFactory mFactory = TransformerFactory.newInstance(); /** * Utility to compare two objects for equality, * either of which may be <code>null</code>. * @param o1 The first object. * @param o2 The second object. * @return <code>true</code> if both objects are <code>null</code> or equal. */ public static boolean equals(Object o1, Object o2) { if (o1 == null) return (o2 == null); else if (o2 != null) return o1.equals(o2); else return false; } /** * Utility to generate a hashCode for an object, which may be <code>null</code>. * @param o1 The object. * @return The object's hashCode or 0 if the object is <code>null</code>. */ public static int hashCode(Object o1) { return (o1 == null) ? 0 : o1.hashCode(); } public static int parseInt(String str, int defaultValue) { try { return (Util.isEmpty(str)) ? defaultValue : Integer.parseInt(str); } catch (NumberFormatException nfe) { return defaultValue; } } public static long parseLong(String str, long defaultValue) { try { return (Util.isEmpty(str)) ? defaultValue : Long.parseLong(str); } catch (NumberFormatException nfe) { return defaultValue; } } /** * Generates a string representation of an array. * @param objs The array of objects. * @return A string representation of the array or an empty string. */ public static String toString(Object[] objs, String delim) { if (objs == null) return ""; StringBuffer buff = new StringBuffer(); String actualDelim = ""; buff.append("["); for (Object o : objs) { try { buff.append(actualDelim).append(String.valueOf(o)); } catch (Exception e) { /* ignore */ } actualDelim = (delim == null) ? "," : delim; } buff.append("]"); return buff.toString(); } /** * Converts the specified error's stacktrace to a string. * @param t The error to convert. * @return string-representation of error's stacktrace. */ public static String toString(Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.flush(); return sw.toString(); } /** * Tests the specified string for null-ness and emptiness (zero non-whitespace characters). * @param str The test string. * @return <code>true</code> if the string is <code>null</code> or zero-length when trimmed. */ public static boolean isEmpty(String str) { return (str == null || str.trim().length() == 0); } /** * Escapes XML text. * @param text The xml to escape. * @return Escaped xml. */ public static String escape(String text) { if (text == null) return ""; StringBuffer buff = new StringBuffer(); char[] chars = text.toCharArray(); for (int i = 0, n = chars.length; i < n; i++) { switch (chars[i]) { case '<': buff.append("&lt;"); break; case '>': buff.append("&gt;"); break; case '&': buff.append("&amp;"); break; case '"': buff.append("&quot;"); break; case '\'': buff.append("&apos;"); break; default: buff.append(chars[i]); } } return buff.toString(); } /** * Formats the specified xml source and returns an xml string. * <b>Note:</b> If the specified <code>Source</code> is an instance of * <code>StreamSource</code>, it will be {@link #reset(Source)} after * the xml string is generated. * * @param src The xml source object. * @return Formatted xml or an empty string if formatting fails. * @throws Exception if an error occurs printing xml. */ public static String print(Source src) throws Exception { StringWriter writer = new StringWriter(); StreamResult dest = new StreamResult(writer); Transformer tr = mFactory.newTransformer(); tr.transform(src, dest); return writer.toString(); } /** * Reads the content of the specified file. This method reads the file * a byte at a time, using {@link DataInputStream#readByte()}. * * @param file The file to read. * @return The content of the file. * @throws Exception If an error occurs reading file. */ public static String readFileContent(File file) throws Exception { FileInputStream fis = null; DataInputStream dis = null; try { StringBuffer buff = new StringBuffer(); fis = new FileInputStream(file); dis = new DataInputStream(fis); while (dis.available() != 0) { buff.append((char) dis.readByte()); } return buff.toString(); } finally { if (fis != null) fis.close(); if (dis != null) dis.close(); } } /** * Writes the specified content to a file. This method writes a * <code>byte[]</code>, generated from the content parameter, to * a file using a {@link DataOutputStream}. * * @param file The destination file. * @param content The content to write. * @throws Exception If an error occurs writing content to file. */ public static void writeFile(File file, String content) throws Exception { FileOutputStream fos = null; DataOutputStream dos = null; try { fos = new FileOutputStream(file); dos = new DataOutputStream(fos); byte[] b = content.getBytes(); dos.write(b, 0, b.length); } finally { if (fos != null) fos.close(); if (dos != null) dos.close(); } } }
[ "bitbucket@bitbucket02.private.bitbucket.org" ]
bitbucket@bitbucket02.private.bitbucket.org
b6676332cd3940666e31d0f48bd8a77a36c579b3
35b710e9bc210a152cc6cda331e71e9116ba478c
/tc-wars/tc/src/main/java/com/topcoder/web/tc/controller/request/LinkTracking.java
6e58c079d578aabe5716429470db767977b61edc
[]
no_license
appirio-tech/tc1-tcnode
d17649afb38998868f9a6d51920c4fe34c3e7174
e05a425be705aca8f530caac1da907d9a6c4215a
refs/heads/master
2023-08-04T19:58:39.617425
2016-05-15T00:22:36
2016-05-15T00:22:36
56,892,466
1
8
null
2022-04-05T00:47:40
2016-04-23T00:27:46
Java
UTF-8
Java
false
false
2,122
java
package com.topcoder.web.tc.controller.request; import com.topcoder.ejb.Util.Util; import com.topcoder.shared.util.TCContext; import com.topcoder.web.common.BaseProcessor; import com.topcoder.web.common.NavigationException; import com.topcoder.web.common.StringUtils; import javax.naming.InitialContext; /** * @author dok * @version $Revision: 58289 $ Date: 2005/01/01 00:00:00 * Create Date: Jul 21, 2006 */ public class LinkTracking extends BaseProcessor { protected void businessProcessing() throws Exception { String refer; String link; InitialContext ctx = null; try { link = StringUtils.checkNull((String) getRequest().getAttribute("link")); if ("".equals(link)) { link = StringUtils.checkNull(getRequest().getParameter("link")); } refer = StringUtils.checkNull((String) getRequest().getAttribute("refer")); if ("".equals(refer)) { refer = StringUtils.checkNull(getRequest().getParameter("refer")); } String ip = getRequest().getRemoteHost(); if ( !( ip.equals("65.112.118.193") || ip.equals("65.112.118.193") || ip.equals("65.112.118.194") || ip.equals("65.112.118.195") || ip.equals("65.112.118.196") || ip.equals("65.112.118.197") || ip.equals("65.112.118.210") ) ) { ctx = new javax.naming.InitialContext(); Util util = (Util) BaseProcessor.createEJB(ctx, Util.class); util.incrementSponsorHitCount(link, refer); } log.debug(link); setNextPage(link); setIsNextPageInContext(false); } catch (Exception e) { throw new NavigationException(e); } finally { TCContext.close(ctx); } } }
[ "dongzhengbin@winterflames-MacBook-Pro.local" ]
dongzhengbin@winterflames-MacBook-Pro.local
4511bc450573a2657b9bca2c6c609e4fb5d76b79
287d6d170530a04bff9f80460125993cb8c506b1
/tl/src/main/java/com/github/badoualy/telegram/tl/api/request/TLRequestContactsDeleteContact.java
59a7660d9b335fc0b867550aed2404ea970d7366
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
thecodrr/kotlogram
c72fb8f81a422d5c3d067ef194faab6e20861d30
dc692348229fed14b738f376f7a3af2c474e5737
refs/heads/master
2020-07-30T00:14:07.740929
2017-01-06T07:19:09
2017-01-06T07:19:09
210,013,661
0
0
MIT
2019-09-21T16:00:26
2019-09-21T16:00:25
null
UTF-8
Java
false
false
2,650
java
package com.github.badoualy.telegram.tl.api.request; import com.github.badoualy.telegram.tl.TLContext; import com.github.badoualy.telegram.tl.api.TLAbsInputUser; import com.github.badoualy.telegram.tl.api.contacts.TLLink; import com.github.badoualy.telegram.tl.core.TLMethod; import com.github.badoualy.telegram.tl.core.TLObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import static com.github.badoualy.telegram.tl.StreamUtils.readTLObject; import static com.github.badoualy.telegram.tl.StreamUtils.writeTLObject; import static com.github.badoualy.telegram.tl.TLObjectUtils.SIZE_CONSTRUCTOR_ID; /** * @author Yannick Badoual yann.badoual@gmail.com * @see <a href="http://github.com/badoualy/kotlogram">http://github.com/badoualy/kotlogram</a> */ public class TLRequestContactsDeleteContact extends TLMethod<TLLink> { public static final int CONSTRUCTOR_ID = 0x8e953744; protected TLAbsInputUser id; private final String _constructor = "contacts.deleteContact#8e953744"; public TLRequestContactsDeleteContact() { } public TLRequestContactsDeleteContact(TLAbsInputUser id) { this.id = id; } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public TLLink deserializeResponse(InputStream stream, TLContext context) throws IOException { final TLObject response = readTLObject(stream, context); if (response == null) { throw new IOException("Unable to parse response"); } if (!(response instanceof TLLink)) { throw new IOException("Incorrect response type, expected " + getClass().getCanonicalName() + ", found " + response.getClass().getCanonicalName()); } return (TLLink) response; } @Override public void serializeBody(OutputStream stream) throws IOException { writeTLObject(id, stream); } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public void deserializeBody(InputStream stream, TLContext context) throws IOException { id = readTLObject(stream, context, TLAbsInputUser.class, -1); } @Override public int computeSerializedSize() { int size = SIZE_CONSTRUCTOR_ID; size += id.computeSerializedSize(); return size; } @Override public String toString() { return _constructor; } @Override public int getConstructorId() { return CONSTRUCTOR_ID; } public TLAbsInputUser getId() { return id; } public void setId(TLAbsInputUser id) { this.id = id; } }
[ "yann.badoual@gmail.com" ]
yann.badoual@gmail.com
dd02b482005dd5d11cbf752258b319210b01ccad
0c547cb4c80ee369533541afab9b126755e17cc3
/app/src/main/java/com/fhzc/app/android/android/ui/activity/ClientListActivity.java
de75f88dc46ed41a838fbf0ef580009e326be98e
[]
no_license
chengyue5923/fuhuagit
1bbb90dcbdb52bb8624c26e67af174df16b38c57
12bd8356bca6b7e68a153f456a36b4fcd1cc9ecf
refs/heads/master
2020-07-09T02:24:04.319489
2016-11-17T11:20:09
2016-11-17T11:20:09
74,019,879
0
0
null
null
null
null
UTF-8
Java
false
false
4,319
java
package com.fhzc.app.android.android.ui.activity; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.fhzc.app.android.R; import com.fhzc.app.android.android.base.BaseActivity; import com.fhzc.app.android.android.ui.view.adapter.ClientListAdapter; import com.fhzc.app.android.android.ui.view.widget.CommonToolBar; import com.fhzc.app.android.controller.UserController; import com.fhzc.app.android.models.MemberModel; import com.fhzc.app.android.utils.android.IntentTools; import java.io.Serializable; import java.util.List; import java.util.Map; import butterknife.Bind; import butterknife.ButterKnife; /** * Created by yanbo on 2016/8/2. */ public class ClientListActivity extends BaseActivity implements AdapterView.OnItemClickListener ,CommonToolBar.ClickRightListener{ @Bind(R.id.myClientList) ListView myClientList; ClientListAdapter clientListAdapter; SwipeRefreshLayout swipeLayout; @Bind(R.id.plannerWorkToor) CommonToolBar plannerWorkToor; @Bind(R.id.swipe_container) SwipeRefreshLayout swipeContainer; @Override protected void initView() { ButterKnife.bind(this); // registerForContextMenu(myClientList); swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container); swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { // new Handler().postDelayed(new Runnable() { // @Override // public void run() { // swipeLayout.setRefreshing(false); // } // }, 5000); initData(); } }); swipeLayout.setColorSchemeResources(R.color.color_bule2, R.color.color_bule, R.color.color_bule2, R.color.color_bule3); } @Override protected void initEvent() { plannerWorkToor.setClickRightListener(this); myClientList.setOnItemClickListener(this); } @Override protected void initData() { clientListAdapter = new ClientListAdapter(this, false); myClientList.setAdapter(clientListAdapter); UserController.getInstance().customerList(this); } @Override protected int getLayoutId() { return R.layout.activity_my_client_list; } @Override public void onData(Serializable result, int flag, boolean fromNet, Object o, Map<String, Object> param) { List<MemberModel> list = (List<MemberModel>) result; swipeLayout.setRefreshing(false); clientListAdapter.setRes(list); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { IntentTools.startCustomerNewDetail(ClientListActivity.this, clientListAdapter.getItem(position)); } @Override public void OnClickRight(View view) { if(plannerWorkToor.getRightText().equals("显示备注")){ plannerWorkToor.setRightText("关闭备注"); clientListAdapter.SetFlag(true); clientListAdapter.notifyDataSetChanged(); }else{ plannerWorkToor.setRightText("显示备注"); clientListAdapter.SetFlag(false); clientListAdapter.notifyDataSetChanged(); } } // @Override // public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { // super.onCreateContextMenu(menu, v, menuInfo); // getMenuInflater().inflate(R.menu.planner_context_client_list, menu); // } // // @Override // public boolean onContextItemSelected(MenuItem item) { // int position = ((AdapterView.AdapterContextMenuInfo) item.getMenuInfo()).position; // MemberModel memberModel = clientListAdapter.getItem(position); // if (item.getItemId() == R.id.contact_customer) { // IntentTool.chat(ClientListActivity.this, null, memberModel.getUid()); // return true; // } else if (item.getItemId() == R.id.wealth_right) { // IntentTools.startCustomerDetail(ClientListActivity.this,memberModel); // return true; // } // return super.onContextItemSelected(item); // } }
[ "chengyue5923@163.com" ]
chengyue5923@163.com
4ab7a492f25c2eb0705f15cc09fd90e14b497ae9
1e8a5381b67b594777147541253352e974b641c5
/com/google/android/gms/games/internal/api/AclsImpl.java
3609523beded57f40f699d6d86d02dd43b2e73d5
[]
no_license
jramos92/Verify-Prueba
d45f48829e663122922f57720341990956390b7f
94765f020d52dbfe258dab9e36b9bb8f9578f907
refs/heads/master
2020-05-21T14:35:36.319179
2017-03-11T04:24:40
2017-03-11T04:24:40
84,623,529
1
0
null
null
null
null
UTF-8
Java
false
false
1,310
java
package com.google.android.gms.games.internal.api; import android.os.RemoteException; import com.google.android.gms.common.api.Status; import com.google.android.gms.games.Games.BaseGamesApiMethodImpl; import com.google.android.gms.games.internal.GamesClientImpl; import com.google.android.gms.games.internal.game.Acls; import com.google.android.gms.games.internal.game.Acls.LoadAclResult; public final class AclsImpl implements Acls { private static Acls.LoadAclResult zzX(Status paramStatus) { new Acls.LoadAclResult() { public Status getStatus() { return this.zzVb; } public void release() {} }; } private static abstract class LoadNotifyAclImpl extends Games.BaseGamesApiMethodImpl<Acls.LoadAclResult> { public Acls.LoadAclResult zzZ(Status paramStatus) { return AclsImpl.zzY(paramStatus); } } private static abstract class UpdateNotifyAclImpl extends Games.BaseGamesApiMethodImpl<Status> { public Status zzd(Status paramStatus) { return paramStatus; } } } /* Location: C:\Users\julian\Downloads\Veryfit 2 0_vV2.0.28_apkpure.com-dex2jar.jar!\com\google\android\gms\games\internal\api\AclsImpl.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "ramos.marin92@gmail.com" ]
ramos.marin92@gmail.com
6e89e5236c1b1bc69a9d4a418679fa02eac2793b
417b0e3d2628a417047a7a70f28277471d90299f
/proxies/com/microsoft/bingads/v10/adinsight/ArrayOfCategory.java
50ce9c56c2ae6246e2b0f401e7b594fdebbf051d
[ "MIT" ]
permissive
jpatton14/BingAds-Java-SDK
30e330a5d950bf9def0c211ebc5ec677d8e5fb57
b928a53db1396b7e9c302d3eba3f3cc5ff7aa9de
refs/heads/master
2021-07-07T08:28:17.011387
2017-10-03T14:44:43
2017-10-03T14:44:43
105,914,216
0
0
null
2017-10-05T16:33:39
2017-10-05T16:33:39
null
UTF-8
Java
false
false
1,983
java
package com.microsoft.bingads.v10.adinsight; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ArrayOfCategory complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ArrayOfCategory"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Category" type="{http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.AdInsight.Api.DataContract.Entity}Category" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ArrayOfCategory", propOrder = { "categories" }) public class ArrayOfCategory { @XmlElement(name = "Category", nillable = true) protected List<Category> categories; /** * Gets the value of the categories property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the categories property. * * <p> * For example, to add a new item, do as follows: * <pre> * getCategories().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Category } * * */ public List<Category> getCategories() { if (categories == null) { categories = new ArrayList<Category>(); } return this.categories; } }
[ "jiaj@microsoft.com" ]
jiaj@microsoft.com
e29d14be1e555bc4e908ed6c9bc057077004de13
43f89c7ea961f24d7255aa967c149353a32b8e18
/jode/output/com/strobel/assembler/ir/attributes/LocalVariableTableAttribute.java
18756f47a8c21f0fff46fedffa6285c463b3072f
[]
no_license
Neumann789/springboot-learn
43ae3550c3b8237b261c72225dafed76dcf4cf2c
2e1fb8fb60bb07d5a3dff765d9d82a4d7e0e6d17
refs/heads/master
2022-12-21T09:06:07.587918
2018-04-05T00:45:22
2018-04-05T00:45:22
97,288,751
1
0
null
2022-12-16T07:56:00
2017-07-15T03:08:50
Java
UTF-8
Java
false
false
625
java
/* LocalVariableTableAttribute - Decompiled by JODE * Visit http://jode.sourceforge.net/ */ package com.strobel.assembler.ir.attributes; import java.util.List; import com.strobel.core.ArrayUtilities; public final class LocalVariableTableAttribute extends SourceAttribute { private final List _entries; public LocalVariableTableAttribute(String name, LocalVariableTableEntry[] entries) { super(name, 2 + entries.length * 10); _entries = ArrayUtilities.asUnmodifiableList((Object[]) entries.clone()); } public List getEntries() { return _entries; } }
[ "test@test.com" ]
test@test.com
afe826a717c688f42fb1047f4ce935c24b3373a0
fc4150290b10e2e331b55e54e628798eabaa47ad
/HAL/.svn/pristine/71/7154eb4c8b0ba883d29a7afaf278f1b71a14651a.svn-base
1b98a3d0e1a59fd084b31db7c64d806c451547fc
[]
no_license
vadhwa11/newproject2
8e40bd4acfd4edc6b721eeca8636f8b7d589af2b
fc9bd770fdadf650f004323f85884dc143827f4d
refs/heads/master
2020-05-05T04:01:05.628775
2019-04-05T14:38:10
2019-04-05T14:38:10
179,694,408
0
0
null
null
null
null
UTF-8
Java
false
false
456
package jkt.hms.masters.business; import jkt.hms.masters.business.base.BasePatientLifeStyleFactor; public class PatientLifeStyleFactor extends BasePatientLifeStyleFactor { private static final long serialVersionUID = 1L; /*[CONSTRUCTOR MARKER BEGIN]*/ public PatientLifeStyleFactor () { super(); } /** * Constructor for primary key */ public PatientLifeStyleFactor (java.lang.Integer id) { super(id); } /*[CONSTRUCTOR MARKER END]*/ }
[ "vadhwa11@gmail.com" ]
vadhwa11@gmail.com
e5c386c85cb645cd10555c9bdcbf0c052900522a
0ff1d0ee1f9ea1e1b46fbd65d1d457ba2760e543
/src/main/java/com/sen/concurrency3/juc/utils/semaphore/SemaphoreExample4.java
4a1f05df285de3029d39ce8e4e4e768ab4fac725
[ "Apache-2.0" ]
permissive
sumforest/concurrency
100abc27f3436d356d17f76d80f90293f5d1451a
2470277fa614e049400a6b33f38ebf6289d5b774
refs/heads/master
2021-06-24T04:54:00.159469
2021-05-23T12:09:26
2021-05-23T12:09:26
226,290,511
0
0
Apache-2.0
2020-10-13T18:13:08
2019-12-06T09:18:02
Java
UTF-8
Java
false
false
1,636
java
package com.sen.concurrency3.juc.utils.semaphore; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; /** * @Author: Sen * @Date: 2019/12/16 02:11 * @Description: 使用 {@linkplain Semaphore#drainPermits()} 排干所有共享资源, * 使用 {@linkplain Semaphore#tryAcquire(long, TimeUnit)} 超过等待时间后立即 * 返回,获取共享资源失败。 */ public class SemaphoreExample4 { public static void main(String[] args) throws InterruptedException { final Semaphore semaphore = new Semaphore(5); Thread t1 = new Thread(()->{ System.out.println(Thread.currentThread().getName() + " in"); try { semaphore.drainPermits(); TimeUnit.SECONDS.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } finally { semaphore.release(5); System.out.println(Thread.currentThread().getName() + " out"); } }); t1.start(); Thread t2 = new Thread(()->{ System.out.println(Thread.currentThread().getName() + " in"); try { // 获取临界资源失败 semaphore.tryAcquire(2,TimeUnit.SECONDS); TimeUnit.SECONDS.sleep(2); } catch (InterruptedException e) { e.printStackTrace(); } finally { semaphore.release(); System.out.println(Thread.currentThread().getName() + " out"); } }); TimeUnit.SECONDS.sleep(1); t2.start(); } }
[ "12345678" ]
12345678
d6fbda4cd3253b4df59809e70998ec02cfbdd6f7
ac6fe0f82231b44f64451ac3e78513d9392061d8
/common/dal/src/main/java/com/xianglin/act/common/dal/model/PrizeConfig.java
4d5dd649600b6613a7c294242d3e8a48cd94a85c
[]
no_license
heke183/act
015ef0d0dd57f53afefe41d88f810a9cb0e59b8e
2378cf1056b672a898a3c7c8fd1e540fd8ee0a42
refs/heads/master
2020-04-15T11:00:33.035873
2019-01-09T05:46:07
2019-01-09T05:46:07
164,609,667
0
1
null
null
null
null
UTF-8
Java
false
false
1,253
java
package com.xianglin.act.common.dal.model; import java.util.Date; /** * @author yefei * @date 2018-01-23 19:14 */ public class PrizeConfig { private Long id; private String prizeCode; private int prizeLevel; private String customerType; private Date startDate; private Date expireDate; public int getPrizeLevel() { return prizeLevel; } public void setPrizeLevel(int prizeLevel) { this.prizeLevel = prizeLevel; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getPrizeCode() { return prizeCode; } public void setPrizeCode(String prizeCode) { this.prizeCode = prizeCode; } public String getCustomerType() { return customerType; } public void setCustomerType(String customerType) { this.customerType = customerType; } public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getExpireDate() { return expireDate; } public void setExpireDate(Date expireDate) { this.expireDate = expireDate; } }
[ "wangleitom@126.com" ]
wangleitom@126.com
a2406b9a7c7d0aa0e4fac56e1233011b2a114127
4ff9b1fe3e8024687ab0cd3090a45a38f702c56e
/app/src/main/java/com/zhailr/caipiao/base/BaseActivity.java
f747ddaac929509f453722e2b9e7d3f8a383836b
[]
no_license
DavyJohn/trunk
9a24cb3c9d099ab8bfa4c3cead881857bfb91e4f
8a8b06ceb2bf53e36ada42452ed4ba1078d8ad08
refs/heads/master
2021-01-17T16:04:13.622181
2017-10-12T10:34:41
2017-10-12T10:34:41
74,008,911
0
0
null
null
null
null
UTF-8
Java
false
false
6,954
java
package com.zhailr.caipiao.base; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; import android.view.View; import android.widget.RelativeLayout; import android.widget.Toast; import com.github.javiersantos.appupdater.AppUpdater; import com.github.javiersantos.appupdater.AppUpdaterUtils; import com.github.javiersantos.appupdater.enums.AppUpdaterError; import com.github.javiersantos.appupdater.enums.Display; import com.github.javiersantos.appupdater.enums.Duration; import com.github.javiersantos.appupdater.enums.UpdateFrom; import com.zhailr.caipiao.R; import com.zhailr.caipiao.http.OkHttpHelper; import com.zhailr.caipiao.utils.Constant; import com.zhailr.caipiao.widget.WaitProgressDialog; /** * Created by zhailiangrong on 16/6/8. */ public abstract class BaseActivity extends AppCompatActivity { private Toolbar mToolBar; private RelativeLayout mNoContentLayout; private RelativeLayout mContentLayout; private ToolBarX mToolBarX; /** * 提示消息 */ private Toast toast; /** * */ protected OkHttpHelper mOkHttpHelper = OkHttpHelper.getInstace(); protected Context mContext; protected int screenwidth; protected int densityDpi; protected WaitProgressDialog mWaitProgressDialog; private AlertDialog dialog; protected AppUpdater appupdater; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ac_baselayout); mContext = this; initView(); View view = getLayoutInflater().inflate(getLayoutId(), mContentLayout, false); //IOC 控制反转:在父类中调用子类的反转 mContentLayout.addView(view); } private void initView() { mWaitProgressDialog = new WaitProgressDialog(this,"正在加载中..."); mToolBar = (Toolbar) findViewById(R.id.toolbar); mToolBar.setOverflowIcon(ContextCompat.getDrawable(mContext,R.drawable.assistant_icon)); mContentLayout = (RelativeLayout) findViewById(R.id.content); mNoContentLayout = (RelativeLayout) findViewById(R.id.no_content); // 获取手机分辨率 DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); screenwidth = dm.widthPixels; densityDpi = dm.densityDpi; appupdater = new AppUpdater(this) .setDisplay(Display.DIALOG) .setDuration(Duration.NORMAL) .setUpdateFrom(UpdateFrom.XML) .setUpdateXML(Constant.UPDATEURL) .setDialogTitleWhenUpdateAvailable("可更新") .setDialogButtonUpdate("立即更新") .setDialogButtonDismiss("稍后再说") .setDialogButtonDoNotShowAgain("不再提示") .setDialogTitleWhenUpdateNotAvailable("无可用更新") .setDialogDescriptionWhenUpdateNotAvailable("您的app是最新版本!"); AppUpdaterUtils appUpdaterUtils = new AppUpdaterUtils(this) .setUpdateFrom(UpdateFrom.XML) .withListener(new AppUpdaterUtils.AppUpdaterListener() { @Override public void onSuccess(String s, Boolean isUpdateAvailable) { Log.d("AppUpdater", s + Boolean.toString(isUpdateAvailable)); } @Override public void onFailed(AppUpdaterError appUpdaterError) { Log.d("AppUpdater", "Something went wrong"); } }); appUpdaterUtils.start(); } public abstract int getLayoutId(); public ToolBarX getToolBar() { if (null == mToolBarX) { mToolBarX = new ToolBarX(mToolBar, this); } return mToolBarX; } public void hasToolBar(boolean flag) { if (!flag) { mToolBar.setVisibility(View.GONE); } else { mToolBar.setVisibility(View.VISIBLE); } } @Override public void startActivity(Intent intent) { super.startActivity(intent); overridePendingTransition(R.anim.anmi_in_right_left, R.anim.anmi_out_right_left); } @Override public void startActivityForResult(Intent intent, int requestCode) { super.startActivityForResult(intent, requestCode); overridePendingTransition(R.anim.anmi_in_right_left, R.anim.anmi_out_right_left); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); overridePendingTransition(R.anim.anim_in_left_right, R.anim.anim_out_left_right); } public void finishAndTransition(Boolean flag) { super.finish(); if (flag) { overridePendingTransition(R.anim.anim_in_left_right, R.anim.anim_out_left_right); } } /** * 展示Toast消息。 * * @param message * 消息内容 */ public synchronized void showToast(String message) { if (toast == null) { toast = Toast.makeText(this, message, Toast.LENGTH_LONG); } if (!TextUtils.isEmpty(message)) { toast.setText(message); toast.show(); } } @Override public void onBackPressed() { super.onBackPressed(); finishAndTransition(true); } protected void showDialog() { mWaitProgressDialog.show(); } protected void dimissDialog() { if (mWaitProgressDialog != null) { mWaitProgressDialog.dismiss(); } } protected void showMessageDialog(String str, Context context) { dialog = new AlertDialog.Builder(context) .setMessage(str).setTitle("提示") .setPositiveButton("确认", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }).create(); dialog.show(); } protected void dismissMessageDialog() { if (dialog != null && dialog.isShowing()) { dialog.dismiss(); } } public void showNoContent() { mNoContentLayout.setVisibility(View.VISIBLE); mContentLayout.setVisibility(View.GONE); } public void dimssNoContent() { mNoContentLayout.setVisibility(View.GONE); mContentLayout.setVisibility(View.VISIBLE); } }
[ "1139099003@qq.com" ]
1139099003@qq.com
9b51c4fe7e3ba6083d4a9c8f1fc1d06a742e31fd
5e8760e4159ca6570cf45b9673bec8f1e86157bf
/app/src/main/java/com/hkkj/carmall/activity/SelectPhotoActivity.java
1512edfbf9344805794c53ce7e9ae4cbd98930dc
[]
no_license
dawei134679/car_mall
e08d55dbada915d51b7746928f45336f196d2ee7
9428b294b3ec263f0664b21f5959859caaafbd50
refs/heads/master
2020-06-12T03:40:46.622967
2019-07-31T08:24:17
2019-07-31T08:24:17
194,184,227
0
0
null
null
null
null
UTF-8
Java
false
false
7,568
java
package com.hkkj.carmall.activity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.widget.ImageView; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hkkj.carmall.R; import com.hkkj.carmall.utils.Constants; import com.hkkj.carmall.utils.GlideImageUtils; import com.hkkj.carmall.utils.HeadersUtils; import com.hkkj.carmall.utils.ToastUtils; import com.luck.picture.lib.PictureSelector; import com.luck.picture.lib.config.PictureConfig; import com.luck.picture.lib.config.PictureMimeType; import com.luck.picture.lib.entity.LocalMedia; import com.zhy.http.okhttp.OkHttpUtils; import com.zhy.http.okhttp.callback.StringCallback; import java.io.File; import java.util.List; import butterknife.Bind; import butterknife.ButterKnife; import butterknife.OnClick; import okhttp3.Call; public class SelectPhotoActivity extends Activity { private List<LocalMedia> selectList; @Bind(R.id.iv_asp_picture) ImageView headPicture; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_photo); ButterKnife.bind(this); } @OnClick(R.id.tv_asp_SelectPhoto) void selectPhoto(){ // 进入相册 以下是例子:用不到的api可以不写 PictureSelector.create(SelectPhotoActivity.this) .openGallery(PictureMimeType.ofAll())//全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()、音频.ofAudio() .theme(R.style.picture_default_style)//主题样式(不设置为默认样式) 也可参考demo values/styles下 例如:R.style.picture.white.style .maxSelectNum(1)// 最大图片选择数量 int .minSelectNum(1)// 最小选择数量 int .imageSpanCount(4)// 每行显示个数 int .selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE .previewImage(true)// 是否可预览图片 true or false .previewVideo(true)// 是否可预览视频 true or false .enablePreviewAudio(true) // 是否可播放音频 true or false .isCamera(true)// 是否显示拍照按钮 true or false // .imageFormat(PictureMimeType.PNG)// 拍照保存图片格式后缀,默认jpeg .isZoomAnim(true)// 图片列表点击 缩放效果 默认true .sizeMultiplier(0.5f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效 .setOutputCameraPath("/CustomPath")// 自定义拍照保存路径,可不填 .enableCrop(true)// 是否裁剪 true or false .compress(true)// 是否压缩 true or false // .glideOverride()// int glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度 // .withAspectRatio(1,1)// int 裁剪比例 如16:9 3:2 3:4 1:1 可自定义 .hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false .isGif(true)// 是否显示gif图片 true or false // .compressSavePath(getPath())//压缩图片保存地址 .freeStyleCropEnabled(true)// 裁剪框是否可拖拽 true or false .circleDimmedLayer(true)// 是否圆形裁剪 true or false .showCropFrame(true)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false .showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false .openClickSound(false)// 是否开启点击声音 true or false .selectionMedia(selectList)// 是否传入已选图片 List<LocalMedia> list .previewEggs(false)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false .cropCompressQuality(90)// 裁剪压缩质量 默认90 int .minimumCompressSize(100)// 小于100kb的图片不压缩 .synOrAsy(true)//同步true或异步false 压缩 默认同步 // .cropWH()// 裁剪宽高比,设置如果大于图片本身宽高则无效 int .rotateEnabled(true) // 裁剪是否可旋转图片 true or false .scaleEnabled(true)// 裁剪是否可放大缩小图片 true or false // .videoQuality()// 视频录制质量 0 or 1 int .videoMaxSecond(15)// 显示多少秒以内的视频or音频也可适用 int .videoMinSecond(10)// 显示多少秒以内的视频or音频也可适用 int // .recordVideoSecond()//视频秒数录制 默认60s int .forResult(PictureConfig.CHOOSE_REQUEST);//结果回调onActivityResult code } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { switch (requestCode) { case PictureConfig.CHOOSE_REQUEST: // 图片选择结果回调 selectList = PictureSelector.obtainMultipleResult(data); GlideImageUtils.display(this,selectList.get(0).getCompressPath(),headPicture); File file = new File(selectList.get(0).getCompressPath()); uploadHeadImg(file); // 例如 LocalMedia 里面返回三种path // 1.media.getPath(); 为原图path // 2.media.getCutPath();为裁剪后path,需判断media.isCut();是否为true // 3.media.getCompressPath();为压缩后path,需判断media.isCompressed();是否为true // 如果裁剪并压缩了,以取压缩路径为准,因为是先裁剪后压缩的 break; } } } private void uploadHeadImg(File file) { OkHttpUtils .post() .headers(HeadersUtils .getHeaders(null)) .addFile("file",file.getName() ,file) .url(Constants.DO_UPLOAD) .id(100) .build() .execute(new StringCallback() { @Override public void onError(Call call, Exception e, int id) { Log.e("TAG", "联网失败" + e.getMessage()); } @Override public void onResponse(String response, int id) { switch (id) { case 100: if (response != null) { processData(response); } break; case 101: break; } } }); } private void processData(String json) { if (!TextUtils.isEmpty(json)) { JSONObject jsonObject = JSON.parseObject(json); //得到状态码 String code = jsonObject.getString("code"); if ("200".equals(code)){ }else { ToastUtils.showMessage("登陆失败"); } } } }
[ "532231254@qq.com" ]
532231254@qq.com
73c6c781c3a7ff00088d1314ae0572f2e385c472
1c0f0e40a1cc781e895480fce5c708c01fb6e31b
/src/main/java/frames/BaseDataFrame.java
d6a9ccc0f3ef4b953431d10a4cf66ec655b1ea10
[]
no_license
yacooler/CoolCloudStorageClient
3c9d98f2a8edfeecb38243a65996939c28b70e7b
724aa7a3643290e8d3b0c580a7effdfd1c7808e4
refs/heads/master
2023-01-23T20:43:49.185406
2020-11-19T19:01:59
2020-11-19T19:01:59
314,097,538
0
0
null
2020-11-20T16:36:46
2020-11-19T00:54:38
Java
UTF-8
Java
false
false
469
java
package frames; import fileobjects.FileInformation; import lombok.Getter; import lombok.Setter; public class BaseDataFrame extends BaseFrame { @Getter @Setter protected int currentFrame = -1; @Getter @Setter private int lastFrame = -1; @Getter @Setter private int dataOffset = 0; @Getter @Setter private FileInformation fileInformation; @Getter @Setter private boolean initialized; public BaseDataFrame() { } }
[ "yacooler@yandex.ru" ]
yacooler@yandex.ru
5a01e22c4d34662cd80b906dead0a2c776754663
6ef4869c6bc2ce2e77b422242e347819f6a5f665
/devices/google/Pixel 2/29/QPP6.190730.005/src/ext/gov/nist/javax/sip/parser/ims/PPreferredServiceParser.java
b05e8e752893830a8725ed538823a438fae75454
[]
no_license
hacking-android/frameworks
40e40396bb2edacccabf8a920fa5722b021fb060
943f0b4d46f72532a419fb6171e40d1c93984c8e
refs/heads/master
2020-07-03T19:32:28.876703
2019-08-13T03:31:06
2019-08-13T03:31:06
202,017,534
2
0
null
2019-08-13T03:33:19
2019-08-12T22:19:30
Java
UTF-8
Java
false
false
3,405
java
/* * Decompiled with CFR 0.145. */ package gov.nist.javax.sip.parser.ims; import gov.nist.core.LexerCore; import gov.nist.core.Token; import gov.nist.javax.sip.header.SIPHeader; import gov.nist.javax.sip.header.ims.PPreferredService; import gov.nist.javax.sip.parser.HeaderParser; import gov.nist.javax.sip.parser.Lexer; import gov.nist.javax.sip.parser.TokenTypes; import java.text.ParseException; import javax.sip.InvalidArgumentException; public class PPreferredServiceParser extends HeaderParser implements TokenTypes { protected PPreferredServiceParser(Lexer lexer) { super(lexer); } public PPreferredServiceParser(String string) { super(string); } /* * Enabled aggressive block sorting * Enabled unnecessary exception pruning * Enabled aggressive exception aggregation */ @Override public SIPHeader parse() throws ParseException { if (debug) { this.dbg_enter("PPreferredServiceParser.parse"); } try { this.lexer.match(2144); this.lexer.SPorHT(); this.lexer.match(58); this.lexer.SPorHT(); PPreferredService pPreferredService = new PPreferredService(); Object object = this.lexer.getBuffer(); if (((String)object).contains("urn:urn-7:")) { boolean bl = ((String)object).contains("3gpp-service"); if (bl) { if (!((String)(object = ((String)object).split("3gpp-service.")[1])).trim().equals("")) { pPreferredService.setSubserviceIdentifiers((String)object); } else { try { object = new InvalidArgumentException("URN should atleast have one sub-service"); throw object; } catch (InvalidArgumentException invalidArgumentException) { invalidArgumentException.printStackTrace(); } } } else if (((String)object).contains("3gpp-application")) { if (!((String)(object = ((String)object).split("3gpp-application")[1])).trim().equals("")) { pPreferredService.setApplicationIdentifiers((String)object); } else { try { object = new InvalidArgumentException("URN should atleast have one sub-application"); throw object; } catch (InvalidArgumentException invalidArgumentException) { invalidArgumentException.printStackTrace(); } } } else { try { object = new InvalidArgumentException("URN is not well formed"); throw object; } catch (InvalidArgumentException invalidArgumentException) { invalidArgumentException.printStackTrace(); } } } super.parse(); return pPreferredService; } finally { if (debug) { this.dbg_enter("PPreferredServiceParser.parse"); } } } }
[ "me@paulo.costa.nom.br" ]
me@paulo.costa.nom.br