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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b0f5eb34bfcbce7086833120c1b037f977d08d10
|
0ac05e3da06d78292fdfb64141ead86ff6ca038f
|
/OSWE/oswe/openCRX/rtjar/rt.jar.src/sun/net/httpserver/UnmodifiableHeaders.java
|
f97e1725ca79deb43c8e5b7615ec11227e7807c0
|
[] |
no_license
|
qoo7972365/timmy
|
31581cdcbb8858ac19a8bb7b773441a68b6c390a
|
2fc8baba4f53d38dfe9c2b3afd89dcf87cbef578
|
refs/heads/master
| 2023-07-26T12:26:35.266587
| 2023-07-17T12:35:19
| 2023-07-17T12:35:19
| 353,889,195
| 7
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,371
|
java
|
/* */ package sun.net.httpserver;
/* */
/* */ import com.sun.net.httpserver.Headers;
/* */ import java.util.Collection;
/* */ import java.util.Collections;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import java.util.Set;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class UnmodifiableHeaders
/* */ extends Headers
/* */ {
/* */ Headers map;
/* */
/* */ UnmodifiableHeaders(Headers paramHeaders) {
/* 36 */ this.map = paramHeaders;
/* */ }
/* */ public int size() {
/* 39 */ return this.map.size();
/* */ } public boolean isEmpty() {
/* 41 */ return this.map.isEmpty();
/* */ }
/* */ public boolean containsKey(Object paramObject) {
/* 44 */ return this.map.containsKey(paramObject);
/* */ }
/* */
/* */ public boolean containsValue(Object paramObject) {
/* 48 */ return this.map.containsValue(paramObject);
/* */ }
/* */
/* */ public List<String> get(Object paramObject) {
/* 52 */ return this.map.get(paramObject);
/* */ }
/* */
/* */ public String getFirst(String paramString) {
/* 56 */ return this.map.getFirst(paramString);
/* */ }
/* */
/* */
/* */ public List<String> put(String paramString, List<String> paramList) {
/* 61 */ return this.map.put(paramString, paramList);
/* */ }
/* */
/* */ public void add(String paramString1, String paramString2) {
/* 65 */ throw new UnsupportedOperationException("unsupported operation");
/* */ }
/* */
/* */ public void set(String paramString1, String paramString2) {
/* 69 */ throw new UnsupportedOperationException("unsupported operation");
/* */ }
/* */
/* */ public List<String> remove(Object paramObject) {
/* 73 */ throw new UnsupportedOperationException("unsupported operation");
/* */ }
/* */
/* */ public void putAll(Map<? extends String, ? extends List<String>> paramMap) {
/* 77 */ throw new UnsupportedOperationException("unsupported operation");
/* */ }
/* */
/* */ public void clear() {
/* 81 */ throw new UnsupportedOperationException("unsupported operation");
/* */ }
/* */
/* */ public Set<String> keySet() {
/* 85 */ return Collections.unmodifiableSet(this.map.keySet());
/* */ }
/* */
/* */ public Collection<List<String>> values() {
/* 89 */ return Collections.unmodifiableCollection(this.map.values());
/* */ }
/* */
/* */
/* */
/* */ public Set<Map.Entry<String, List<String>>> entrySet() {
/* 95 */ return Collections.unmodifiableSet(this.map.entrySet());
/* */ }
/* */ public boolean equals(Object paramObject) {
/* 98 */ return this.map.equals(paramObject);
/* */ } public int hashCode() {
/* 100 */ return this.map.hashCode();
/* */ }
/* */ }
/* Location: /Users/timmy/timmy/OSWE/oswe/openCRX/rt.jar!/sun/net/httpserver/UnmodifiableHeaders.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
[
"t0984456716"
] |
t0984456716
|
fa90cba75c8149af91ed5eed2538ede5636b94bb
|
ee40799e6ad93ac07e2580e890ae38e140f6132a
|
/src/RDPCrystalEDILibrary/Documents/X12/IG5010/Segments/HSD.java
|
544c07cee574e4eea55c1b981f471a227f57dd1d
|
[] |
no_license
|
Javonet-io-user/3e31e312-8b7c-43cc-a7c0-96ec31b56ad5
|
c2a96b7dbeb0a0abd788f76ecf64de756cbcd779
|
db68571c6724fe123032af7cd8603ebf7b3dc0a9
|
refs/heads/master
| 2020-04-15T16:17:08.109701
| 2019-01-09T09:10:38
| 2019-01-09T09:10:38
| 164,828,467
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,074
|
java
|
package RDPCrystalEDILibrary.Documents.X12.IG5010.Segments;
import Common.Activation;
import static Common.Helper.Convert;
import static Common.Helper.getGetObjectName;
import static Common.Helper.getReturnObjectName;
import static Common.Helper.ConvertToConcreteInterfaceImplementation;
import Common.Helper;
import com.javonet.Javonet;
import com.javonet.JavonetException;
import com.javonet.JavonetFramework;
import com.javonet.api.NObject;
import com.javonet.api.NEnum;
import com.javonet.api.keywords.NRef;
import com.javonet.api.keywords.NOut;
import com.javonet.api.NControlContainer;
import java.util.concurrent.atomic.AtomicReference;
import java.util.Iterator;
import java.lang.*;
import RDPCrystalEDILibrary.Documents.*;
import RDPCrystalEDILibrary.Documents.X12.IG5010.Segments.*;
import RDPCrystalEDILibrary.*;
public class HSD extends DocumentSegment {
protected NObject javonetHandle;
/** SetProperty */
public void setQuantityQualifier(java.lang.String value) {
try {
javonetHandle.set("QuantityQualifier", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getQuantityQualifier() {
try {
java.lang.String res = javonetHandle.get("QuantityQualifier");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setQuantity(java.lang.String value) {
try {
javonetHandle.set("Quantity", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getQuantity() {
try {
java.lang.String res = javonetHandle.get("Quantity");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setUnitOrBasisForMeasurementCode(java.lang.String value) {
try {
javonetHandle.set("UnitOrBasisForMeasurementCode", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getUnitOrBasisForMeasurementCode() {
try {
java.lang.String res = javonetHandle.get("UnitOrBasisForMeasurementCode");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setSampleSelectionModulus(java.lang.String value) {
try {
javonetHandle.set("SampleSelectionModulus", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getSampleSelectionModulus() {
try {
java.lang.String res = javonetHandle.get("SampleSelectionModulus");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setTimePeriodQualifier(java.lang.String value) {
try {
javonetHandle.set("TimePeriodQualifier", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getTimePeriodQualifier() {
try {
java.lang.String res = javonetHandle.get("TimePeriodQualifier");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setNumberOfPeriods(java.lang.String value) {
try {
javonetHandle.set("NumberOfPeriods", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getNumberOfPeriods() {
try {
java.lang.String res = javonetHandle.get("NumberOfPeriods");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setShipDeliveryOrCalendarPatternCode(java.lang.String value) {
try {
javonetHandle.set("ShipDeliveryOrCalendarPatternCode", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getShipDeliveryOrCalendarPatternCode() {
try {
java.lang.String res = javonetHandle.get("ShipDeliveryOrCalendarPatternCode");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
/** SetProperty */
public void setShipDeliveryPatternTimeCode(java.lang.String value) {
try {
javonetHandle.set("ShipDeliveryPatternTimeCode", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.String getShipDeliveryPatternTimeCode() {
try {
java.lang.String res = javonetHandle.get("ShipDeliveryPatternTimeCode");
if (res == null) return "";
return (java.lang.String) res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return "";
}
}
public HSD() {
super((NObject) null);
try {
javonetHandle = Javonet.New("RDPCrystalEDILibrary.Documents.X12.IG5010.Segments.HSD");
super.setJavonetHandle(javonetHandle);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
public HSD(NObject handle) {
super(handle);
this.javonetHandle = handle;
}
public void setJavonetHandle(NObject handle) {
this.javonetHandle = handle;
}
/** Method */
public void Write(WriteArguments w) {
try {
javonetHandle.invoke("Write", w);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** Method */
public void Load(LightWeightSegment segment) {
try {
javonetHandle.invoke("Load", segment);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
static {
try {
Activation.initializeJavonet();
} catch (java.lang.Exception e) {
e.printStackTrace();
}
}
}
|
[
"support@javonet.com"
] |
support@javonet.com
|
a29d714b961ed31ae5511cfb59c9764159cca504
|
439847f28dbbc23289d085548fa2e2221ac217b3
|
/com.ibm.ive.tools.japt exec optimizer/src/java/lang/Error.java
|
358eebe3a96cc687877d41356c9eda3e871b1d19
|
[] |
no_license
|
daniellansun/Japt-Bytecode-Optimizer-for-Java
|
e87aa8bec0371a34dff43aec8d3d24d9ccf2d601
|
a5487fa3f3071f2a79be9dc48ec66370677ed822
|
refs/heads/master
| 2022-03-22T12:00:12.687609
| 2016-10-22T04:01:11
| 2016-10-22T04:01:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 346
|
java
|
package java.lang;
public class Error extends Throwable {
public Error () {
super();
}
public Error (String detailMessage) {
super(detailMessage);
}
public Error (String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public Error (Throwable throwable) {
super(throwable);
}
}
|
[
"seancfoley@yahoo.com"
] |
seancfoley@yahoo.com
|
a53a7c8e027d970ee26a8f9b2cba2b33b58c8aa1
|
a16b2a58625081530c089568e2b29f74e23f95a9
|
/doolin/Doolin-Core/src/test/java/net/sf/doolin/util/copy/CDAOAccount.java
|
a3c7fbacac8e4fd1d52d0e4a9fec53ca15f35203
|
[] |
no_license
|
dcoraboeuf/orbe
|
440335b109dee2ee3db9ee2ab38430783e7a3dfb
|
dae644da030e5a5461df68936fea43f2f31271dd
|
refs/heads/master
| 2022-01-27T10:18:43.222802
| 2022-01-01T11:45:35
| 2022-01-01T11:45:35
| 178,600,867
| 0
| 0
| null | 2022-01-01T11:46:01
| 2019-03-30T19:13:13
|
Java
|
UTF-8
|
Java
| false
| false
| 237
|
java
|
package net.sf.doolin.util.copy;
public class CDAOAccount extends CAccount {
private CDAOPerson person;
public CDAOPerson getPerson() {
return person;
}
public void setPerson(CDAOPerson person) {
this.person = person;
}
}
|
[
"damien.coraboeuf@gmail.com"
] |
damien.coraboeuf@gmail.com
|
e55015d48eb4f34870341f7d09ab72988fa5b946
|
7df62a93d307a01b1a42bb858d6b06d65b92b33b
|
/src/com/afunms/polling/snmp/device/LinuxDeviceSnmp.java
|
3f4a3fea28cc09348e5759c671bfa4b69e12ddc3
|
[] |
no_license
|
wu6660563/afunms_fd
|
79ebef9e8bca4399be338d1504faf9630c42a6e1
|
3fae79abad4f3eb107f1558199eab04e5e38569a
|
refs/heads/master
| 2021-01-10T01:54:38.934469
| 2016-01-05T09:16:38
| 2016-01-05T09:16:38
| 48,276,889
| 0
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 6,112
|
java
|
package com.afunms.polling.snmp.device;
/*
* @author hukelei@dhcc.com.cn
*
*/
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
import com.afunms.common.util.ShareData;
import com.afunms.common.util.SnmpUtils;
import com.afunms.indicators.model.NodeGatherIndicators;
import com.afunms.monitor.executor.base.SnmpMonitor;
import com.afunms.monitor.item.base.MonitoredItem;
import com.afunms.polling.PollingEngine;
import com.afunms.polling.base.Node;
import com.afunms.polling.loader.HostLoader;
import com.afunms.polling.node.Host;
import com.afunms.polling.om.Devicecollectdata;
import com.afunms.topology.model.HostNode;
import com.gatherResulttosql.HostDatatempDeviceRttosql;
public class LinuxDeviceSnmp extends SnmpMonitor {
private static java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
public LinuxDeviceSnmp() {
}
private static Hashtable device_Status = null;
static {
device_Status = new Hashtable();
device_Status.put("1", "未知");
device_Status.put("2", "运行");
device_Status.put("3", "告警");
device_Status.put("4", "测试");
device_Status.put("5", "停止");
};
private static Hashtable device_Type = null;
static {
device_Type = new Hashtable();
device_Type.put("1.3.6.1.2.1.25.3.1.1", "其他");
device_Type.put("1.3.6.1.2.1.25.3.1.2", "未知");
device_Type.put("1.3.6.1.2.1.25.3.1.3", "CPU");
device_Type.put("1.3.6.1.2.1.25.3.1.4", "网络");
device_Type.put("1.3.6.1.2.1.25.3.1.5", "打印机");
device_Type.put("1.3.6.1.2.1.25.3.1.6", "磁盘");
device_Type.put("1.3.6.1.2.1.25.3.1.10", "显卡");
device_Type.put("1.3.6.1.2.1.25.3.1.11", "声卡");
device_Type.put("1.3.6.1.2.1.25.3.1.12", "协处理器");
device_Type.put("1.3.6.1.2.1.25.3.1.13", "键盘");
device_Type.put("1.3.6.1.2.1.25.3.1.14", "调制解调器");
device_Type.put("1.3.6.1.2.1.25.3.1.15", "并口");
device_Type.put("1.3.6.1.2.1.25.3.1.16", "打印口");
device_Type.put("1.3.6.1.2.1.25.3.1.17", "串口");
device_Type.put("1.3.6.1.2.1.25.3.1.18", "磁带");
device_Type.put("1.3.6.1.2.1.25.3.1.19", "时钟");
device_Type.put("1.3.6.1.2.1.25.3.1.20", "动态内存");
device_Type.put("1.3.6.1.2.1.25.3.1.21", "固定内存");
};
public void collectData(Node node, MonitoredItem item) {
}
public void collectData(HostNode node) {
}
public Hashtable collect_Data(NodeGatherIndicators nodeGatherIndicators) {
Hashtable returnHash = new Hashtable();
Vector deviceVector = new Vector();
List cpuList = new ArrayList();
HostLoader hostLoader = new HostLoader();
Host node = hostLoader.loadOneByID(nodeGatherIndicators.getNodeid());
if (node == null) {
return null;
}
if (!node.isManaged()) {
return null;
}
try {
// Devicecollectdata devicedata = null;
// Calendar date = Calendar.getInstance();
//
// try {
// SimpleDateFormat sdf = new SimpleDateFormat(
// "yyyy-MM-dd HH:mm:ss");
// com.afunms.polling.base.Node snmpnode = (com.afunms.polling.base.Node) PollingEngine
// .getInstance().getNodeByIP(node.getIpAddress());
// Date cc = date.getTime();
// String time = sdf.format(cc);
// snmpnode.setLastTime(time);
// } catch (Exception e) {
//
// }
try {
String[] oids = new String[] { "1.3.6.1.2.1.25.3.2.1.1", // hrDeviceIndex
"1.3.6.1.2.1.25.3.2.1.2", // hrDeviceType
"1.3.6.1.2.1.25.3.2.1.3", // hrDeviceDescr
"1.3.6.1.2.1.25.3.2.1.5" }; // hrDeviceStatus
String[][] valueArray = null;
try {
valueArray = SnmpUtils.getTableData(node.getIpAddress(),
node.getCommunity(), oids, node.getSnmpversion(),
3, 1000 * 30);
} catch (Exception e) {
valueArray = null;
// SysLogger.error(node.getIpAddress() + "_WindowsSnmp");
}
for (int i = 0; i < valueArray.length; i++) {
Devicecollectdata devicedata = new Devicecollectdata();
String devindex = valueArray[i][0];
String type = valueArray[i][1];
String name = valueArray[i][2];
String status = valueArray[i][3];
if (status == null)
status = "";
if (device_Status.containsKey(status))
status = (String) device_Status.get(status);
devicedata.setDeviceindex(devindex);
devicedata.setIpaddress(node.getIpAddress());
devicedata.setName(name);
devicedata.setStatus(status);
devicedata.setType((String) device_Type.get(type));
deviceVector.addElement(devicedata);
}
} catch (Exception e) {
}
} catch (Exception e) {
}
Hashtable ipAllData = (Hashtable) ShareData.getSharedata().get(
node.getIpAddress());
if (ipAllData == null)
ipAllData = new Hashtable();
ipAllData.put("device", deviceVector);
ShareData.getSharedata().put(node.getIpAddress(), ipAllData);
returnHash.put("device", deviceVector);
// 把采集结果生成sql
HostDatatempDeviceRttosql totempsql = new HostDatatempDeviceRttosql();
totempsql.CreateResultTosql(returnHash, node);
return returnHash;
}
}
|
[
"nick@comprame.com"
] |
nick@comprame.com
|
55879ca374499233ce7e02b6859cbeb288a899be
|
472d7820a5f5d9d5ab2ec150eab0c9bdeb2008c7
|
/Protege-2000/source/Protege-2000/src/edu/stanford/smi/protege/ui/SelectInstanceFromCollectionPanel.java
|
602a6df37a28c63365393aa3d09364cfee56b801
|
[] |
no_license
|
slacker247/GPDA
|
1ad5ebe0bea4528d9a3472d3c34580648ffb670e
|
fa9006d0877a691f1ddffe88799c844a3e8a669a
|
refs/heads/master
| 2022-10-08T07:39:09.786313
| 2020-06-10T22:22:58
| 2020-06-10T22:22:58
| 105,063,261
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,520
|
java
|
/*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The Original Code is Protege-2000.
*
* The Initial Developer of the Original Code is Stanford University. Portions
* created by Stanford University are Copyright (C) 2001. All Rights Reserved.
*
* Protege-2000 was developed by Stanford Medical Informatics
* (http://www.smi.stanford.edu) at the Stanford University School of Medicine
* with support from the National Library of Medicine, the National Science
* Foundation, and the Defense Advanced Research Projects Agency. Current
* information about Protege can be obtained at http://protege.stanford.edu
*
* Contributor(s):
*/
package edu.stanford.smi.protege.ui;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import edu.stanford.smi.protege.model.*;
import edu.stanford.smi.protege.util.*;
/**
* Description of the class
*
* @author Ray Fergerson <fergerson@smi.stanford.edu>
*/
public class SelectInstanceFromCollectionPanel extends JComponent {
private JList _list;
public SelectInstanceFromCollectionPanel(Collection c, int initialSelection) {
setLayout(new BorderLayout());
_list = ComponentFactory.createList(getCloseAction());
c = removeHidden(c);
_list.setListData(c.toArray());
FrameRenderer renderer = FrameRenderer.createInstance();
renderer.setDisplayTrailingIcons(false);
_list.setCellRenderer(renderer);
if (initialSelection >= 0) {
setSelection(initialSelection);
}
JScrollPane pane = ComponentFactory.createScrollPane(_list);
add(pane);
setPreferredSize(new Dimension(300, 150));
}
private Action getCloseAction() {
return
new AbstractAction() {
public void actionPerformed(ActionEvent event) {
JComponent c = SelectInstanceFromCollectionPanel.this;
ModalDialog dialog = (ModalDialog) SwingUtilities.getRoot(c);
dialog.attemptClose(ModalDialog.OPTION_OK);
}
}
;
}
public Instance getSelection() {
return (Instance) _list.getSelectedValue();
}
private Collection removeHidden(Collection instances) {
Collection result;
Project p = ((Instance)(CollectionUtilities.getFirstItem(instances))).getProject();
if (p.getDisplayHiddenClasses()) {
result = instances;
} else {
result = new ArrayList();
Iterator i = instances.iterator();
while (i.hasNext()) {
Instance instance = (Instance) i.next();
if (instance.isVisible()) {
result.add(instance);
}
}
}
return result;
}
private void setSelection(final int index) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
_list.setSelectedIndex(index);
_list.ensureIndexIsVisible(index);
}
});
}
}
|
[
"jeffmac710@gmail.com"
] |
jeffmac710@gmail.com
|
167c5c05f9ebd0452dbf7f206bc447a1d14bfc3c
|
8a1ee33c362bd5b3ccd914b4fb019b9da9f1eff3
|
/src/bft/demo/Client.java
|
24f756a1097e37c3d7ea40a273317696646a3bb6
|
[] |
no_license
|
wnagchenghku/sawtooth
|
dfa3985e53f3a0b02901db8361530ae70afb9c91
|
52585d1efbecbee12f47db55a82f89e74fcf507c
|
refs/heads/master
| 2021-10-22T04:28:15.423000
| 2019-03-08T02:10:09
| 2019-03-08T02:10:09
| 125,061,094
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,638
|
java
|
/**
Copyright (c) 2007-2013 Alysson Bessani, Eduardo Alchieri, Paulo Sousa, and the authors indicated in the @author tags
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 bft.demo;
import java.net.DatagramSocket;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.io.IOException;
import java.io.InterruptedIOException;
public class Client {
private static final int PORT = 7686;
public static void main(String[] args) throws IOException {
if ((args.length < 2) || (args.length > 3)) { // Test for correct # of args
throw new IllegalArgumentException("Parameter(s): Parameter(s): <Server> <Data Size> [<Port>] ");
}
InetAddress serverAddress = InetAddress.getByName(args[0]); // Server address
int servPort = (args.length == 3) ? Integer.parseInt(args[2]) : PORT;
byte[] bytesToSend = new byte[Integer.parseInt(args[1])];
DatagramSocket socket = new DatagramSocket();
DatagramPacket sendPacket = new DatagramPacket(bytesToSend, bytesToSend.length, serverAddress, servPort);
for (; ; ) {
socket.send(sendPacket);
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
922394114a33f51490e31bdeb400879ad9718f93
|
5786b8c28f069ae9b9b7f850edf4d4c1b5cf976c
|
/languages/CSharp/source_gen/CSharp/behavior/Local_variable_declarator_BehaviorDescriptor.java
|
91be48aba95791c8b6279003e40ae509883a85dd
|
[
"Apache-2.0"
] |
permissive
|
vaclav/MPS_CSharp
|
681ea277dae2e7503cd0f2d21cb3bb7084f6dffc
|
deea11bfe3711dd241d9ca3f007b810d574bae76
|
refs/heads/master
| 2021-01-13T14:36:41.949662
| 2019-12-03T15:26:21
| 2019-12-03T15:26:21
| 72,849,927
| 19
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 378
|
java
|
package CSharp.behavior;
/*Generated by MPS */
/**
* Will be removed after 3.4
* Need to support compilation of the legacy behavior descriptors before the language is rebuilt
* This class is not involved in the actual method invocation
*/
@Deprecated
public class Local_variable_declarator_BehaviorDescriptor {
public String getConceptFqName() {
return null;
}
}
|
[
"vaclav.pech@gmail.com"
] |
vaclav.pech@gmail.com
|
311d1aa32b2d93d7036cfa36c44d3bbfeac26926
|
9758aafee22725fa3844f2321cad903ece08a52e
|
/spring-boot-mail/src/main/java/com/jeiker/mail/SpringBootMailApplication.java
|
beb94159ef5d4e9182ef754b584fde28e3fb972f
|
[] |
no_license
|
jeikerxiao/spring-boot-ali
|
af154de635561236b87f59a7e6b7b98265a352fa
|
abc08ba8d498edc7f7048e082cad37273b6e8216
|
refs/heads/master
| 2020-05-27T21:00:42.251999
| 2019-05-27T08:57:16
| 2019-05-27T08:57:16
| 188,789,485
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 336
|
java
|
package com.jeiker.mail;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootMailApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootMailApplication.class, args);
}
}
|
[
"jeiker@126.com"
] |
jeiker@126.com
|
4c6f0976eb54d94c290e358ad2730bf6dafce1e4
|
85ed3b5db4ca762543cc63d06e3d6563e364562b
|
/model/storage/src/main/java/org/openfact/models/common/CoordinateSystemCodeType.java
|
168a688423843638c881f85f6ea8972592ef18d9
|
[
"MIT"
] |
permissive
|
carlosthe19916/openfact-temp
|
0850115566ed12f2c8e36d0e47b2dbed71069d5f
|
0ca315fbea20e6f816b12d1df06ae2e8ea18f34a
|
refs/heads/master
| 2020-04-06T04:35:38.393748
| 2016-08-26T20:48:04
| 2016-08-26T20:48:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,145
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// 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.08.16 at 10:50:18 AM PET
//
package org.openfact.models.common;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CoordinateSystemCodeType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="CoordinateSystemCodeType">
* <simpleContent>
* <extension base="<urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2>CodeType">
* </extension>
* </simpleContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CoordinateSystemCodeType")
public class CoordinateSystemCodeType
extends CodeType
{
}
|
[
"carlosthe19916@gmail.com"
] |
carlosthe19916@gmail.com
|
bb18c7d980d3905f1112ffc99d7588f8b438203b
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/eclipsejdt_cluster/65613/tar_1.java
|
7d888c1ca4d90d801dc2d502f675ddabef96220b
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,951
|
java
|
/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.compiler.ast;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.impl.*;
import org.eclipse.jdt.internal.compiler.codegen.*;
import org.eclipse.jdt.internal.compiler.flow.*;
import org.eclipse.jdt.internal.compiler.lookup.*;
public class DoStatement extends Statement {
public Expression condition;
public Statement action;
private Label breakLabel, continueLabel;
// for local variables table attributes
int mergedInitStateIndex = -1;
public DoStatement(Expression condition, Statement action, int s, int e) {
this.sourceStart = s;
this.sourceEnd = e;
this.condition = condition;
this.action = action;
// remember useful empty statement
if (action instanceof EmptyStatement) action.bits |= IsUsefulEmptyStatement;
}
public FlowInfo analyseCode(
BlockScope currentScope,
FlowContext flowContext,
FlowInfo flowInfo) {
breakLabel = new Label();
continueLabel = new Label();
LoopingFlowContext loopingContext =
new LoopingFlowContext(
flowContext,
this,
breakLabel,
continueLabel,
currentScope);
Constant cst = condition.constant;
boolean isConditionTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
cst = condition.optimizedBooleanConstant();
boolean isConditionOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;
boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
int previousMode = flowInfo.reachMode();
FlowInfo actionInfo = flowInfo.copy().unconditionalInits().discardNullRelatedInitializations();
if ((action != null) && !action.isEmptyBlock()) {
actionInfo = action.analyseCode(currentScope, loopingContext, actionInfo);
// code generation can be optimized when no need to continue in the loop
if (!actionInfo.isReachable() && !loopingContext.initsOnContinue.isReachable()) {
continueLabel = null;
}
}
/* Reset reach mode, to address following scenario.
* final blank;
* do { if (true) break; else blank = 0; } while(false);
* blank = 1; // may be initialized already
*/
actionInfo.setReachMode(previousMode);
actionInfo =
condition.analyseCode(
currentScope,
loopingContext,
(action == null
? actionInfo
: (actionInfo.mergedWith(loopingContext.initsOnContinue))));
if (!isConditionOptimizedFalse && continueLabel != null) {
loopingContext.complainOnDeferredChecks(currentScope, actionInfo);
}
// end of loop
FlowInfo mergedInfo = FlowInfo.mergedOptimizedBranches(
loopingContext.initsOnBreak,
isConditionOptimizedTrue,
actionInfo.initsWhenFalse().addInitializationsFrom(flowInfo), // recover null inits from before condition analysis
false, // never consider opt false case for DO loop, since break can always occur (47776)
!isConditionTrue /*do{}while(true); unreachable(); */);
mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);
return mergedInfo;
}
/**
* Do statement code generation
*
*/
public void generateCode(BlockScope currentScope, CodeStream codeStream) {
if ((bits & IsReachable) == 0) {
return;
}
int pc = codeStream.position;
// labels management
Label actionLabel = new Label(codeStream);
if (action != null) actionLabel.tagBits |= Label.USED;
actionLabel.place();
breakLabel.initialize(codeStream);
if (continueLabel != null) {
continueLabel.initialize(codeStream);
}
// generate action
if (action != null) {
action.generateCode(currentScope, codeStream);
}
Constant cst = condition.optimizedBooleanConstant();
boolean isConditionOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;
if (isConditionOptimizedFalse){
condition.generateCode(currentScope, codeStream, false);
} else {
// generate condition
if (continueLabel != null) {
continueLabel.place();
condition.generateOptimizedBoolean(
currentScope,
codeStream,
actionLabel,
null,
true);
}
}
// May loose some local variable initializations : affecting the local variable attributes
if (mergedInitStateIndex != -1) {
codeStream.removeNotDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
codeStream.addDefinitelyAssignedVariables(currentScope, mergedInitStateIndex);
}
if (breakLabel.hasForwardReferences()) {
breakLabel.place();
}
codeStream.recordPositionsFrom(pc, this.sourceStart);
}
public StringBuffer printStatement(int indent, StringBuffer output) {
printIndent(indent, output).append("do"); //$NON-NLS-1$
if (action == null)
output.append(" ;\n"); //$NON-NLS-1$
else {
output.append('\n');
action.printStatement(indent + 1, output).append('\n');
}
output.append("while ("); //$NON-NLS-1$
return condition.printExpression(0, output).append(");"); //$NON-NLS-1$
}
public void resolve(BlockScope scope) {
TypeBinding type = condition.resolveTypeExpecting(scope, TypeBinding.BOOLEAN);
condition.computeConversion(scope, type, type);
if (action != null)
action.resolve(scope);
}
public void traverse(ASTVisitor visitor, BlockScope scope) {
if (visitor.visit(this, scope)) {
if (action != null) {
action.traverse(visitor, scope);
}
condition.traverse(visitor, scope);
}
visitor.endVisit(this, scope);
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
c3ac3a54dbda3486561a155c9a7bab08695fc1eb
|
eec13544246a39cfe64aa8a10089dd5db7adc1a9
|
/src/main/java/com/easyway/java/concurrent/practice/LaunderThrowable.java
|
17f247e685b87ed5e55d06976c04758bf8b8ed11
|
[] |
no_license
|
LonggangBai/java-basic
|
323ba811f3afacc0977f4d1ba266088ec492805f
|
f761218b596558d9696eb04a18143529f0984c85
|
refs/heads/master
| 2022-07-06T16:50:17.064997
| 2019-11-25T07:09:44
| 2019-11-25T07:09:44
| 29,512,547
| 0
| 1
| null | 2022-06-29T19:30:20
| 2015-01-20T04:56:44
|
Java
|
UTF-8
|
Java
| false
| false
| 762
|
java
|
package com.easyway.java.concurrent.practice;
/**
* StaticUtilities
*
* @author Brian Goetz and Tim Peierls
*/
public class LaunderThrowable extends RuntimeException {
public LaunderThrowable(Throwable cause) {
super(cause);
}
/**
* Coerce an unchecked Throwable to a RuntimeException
* <p/>
* If the Throwable is an Error, throw it; if it is a
* RuntimeException return it, otherwise throw IllegalStateException
*/
public static RuntimeException launderThrowable(Throwable t) {
if (t instanceof RuntimeException)
return (RuntimeException) t;
else if (t instanceof Error)
throw (Error) t;
else
throw new IllegalStateException("Not unchecked", t);
}
}
|
[
"Administrator@WIN-20140718QRT"
] |
Administrator@WIN-20140718QRT
|
1b4ccc408524376765d5c3418c22b73863569187
|
e3109a079793c5a66891aebef6dd7c2a44f8d360
|
/base/java/com/microsoft/azure/sdk/iot/deps/serializer/FileUploadStatusParser.java
|
24bfcb65c4fc60faad43c4fc9c5e17d2d7c548d1
|
[] |
no_license
|
msorland/no.simula.smittestopp
|
d5a317b432e8a37c547fc9f2403f25db78ffd871
|
f5eeba1cc4b1cad98b8174315bb2b0b388d14be9
|
refs/heads/master
| 2022-04-17T12:50:10.853188
| 2020-04-17T10:14:01
| 2020-04-17T10:14:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,668
|
java
|
package com.microsoft.azure.sdk.iot.deps.serializer;
import e.c.c.e;
import e.c.c.v.a;
import e.c.c.v.c;
public class FileUploadStatusParser {
public static final String CORRELATION_ID_TAG = "correlationId";
public static final String IS_SUCCESS_TAG = "isSuccess";
public static final String STATUS_CODE_TAG = "statusCode";
public static final String STATUS_DESCRIPTION_TAG = "statusDescription";
@a(deserialize = true, serialize = true)
@c("correlationId")
public String correlationId = null;
@a(deserialize = true, serialize = true)
@c("isSuccess")
public Boolean isSuccess = null;
@a(deserialize = true, serialize = true)
@c("statusCode")
public Integer statusCode = null;
@a(deserialize = true, serialize = true)
@c("statusDescription")
public String statusDescription = null;
public FileUploadStatusParser(String str, Boolean bool, Integer num, String str2) {
setCorrelationId(str);
updateStatus(bool, num, str2);
}
private void setCorrelationId(String str) {
ParserUtility.validateStringUTF8(str);
this.correlationId = str;
}
private void updateStatus(Boolean bool, Integer num, String str) {
ParserUtility.validateObject(bool);
ParserUtility.validateObject(num);
ParserUtility.validateStringUTF8(str);
this.isSuccess = bool;
this.statusCode = num;
this.statusDescription = str;
}
public String toJson() {
e eVar = new e();
eVar.f1303l = false;
eVar.f1298g = true;
return eVar.a().a((Object) this);
}
public FileUploadStatusParser() {
}
}
|
[
"djkaty@users.noreply.github.com"
] |
djkaty@users.noreply.github.com
|
5d405651aa5b8e9a70fa197a4e6cbc09fde00019
|
e4703d8070c3c23acd34ced1e385fd714d5ec74d
|
/src/main/java/com/opensearchserver/client/common/search/query/filter/MirrorAndFilter.java
|
27cc1e8b4cf2e16da5264e87a356b29a99eaf86d
|
[
"Apache-2.0"
] |
permissive
|
naveenann/oss-java-client
|
aeeceaeafcffd15c61fb5ada07d4c9d84ec2425f
|
d13b3041a009e471fad10f58aa69a33fc7e26ceb
|
refs/heads/master
| 2022-04-29T02:18:03.043321
| 2015-02-16T19:41:11
| 2015-02-16T19:41:11
| 31,155,088
| 0
| 0
|
Apache-2.0
| 2022-03-10T23:45:40
| 2015-02-22T06:37:59
|
Java
|
UTF-8
|
Java
| false
| false
| 1,271
|
java
|
/**
* Copyright 2014-2015 OpenSearchServer 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 com.opensearchserver.client.common.search.query.filter;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonInclude(Include.NON_EMPTY)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MirrorAndFilter")
@XmlRootElement(name = "MirrorAndFilter")
@JsonTypeName("MirrorAndFilter")
public class MirrorAndFilter extends AbstractFilter {
}
|
[
"ekeller@open-search-server.com"
] |
ekeller@open-search-server.com
|
497ae589c84bd1933abc9c12ae704cb577029dbd
|
eb840800bc31f991eab945d9e6efe694143b6718
|
/leetcode/src/test/java/leetcode/arrays/PascalTriangleTest.java
|
bb9836941037eddc447641a2232d9e15ad80a393
|
[] |
no_license
|
aqib1/HackCodeLeet
|
f3ef6e76bb0d4a94b4fc6cbcca1dc76f8a3fc420
|
65c4b30395e980e73e1abec5219c8a37ddb5f063
|
refs/heads/master
| 2023-03-16T23:03:09.118125
| 2023-03-13T08:07:30
| 2023-03-13T08:07:30
| 228,961,291
| 10
| 3
| null | 2023-01-08T02:51:52
| 2019-12-19T02:45:26
|
Java
|
UTF-8
|
Java
| false
| false
| 838
|
java
|
package leetcode.arrays;
import java.lang.reflect.Method;
import java.util.List;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class PascalTriangleTest {
private PascalTriangle pascalTriangle;
@Before
public void init() {
pascalTriangle = new PascalTriangle();
}
@Test
public void testGenerate() {
List<List<Integer>> r = pascalTriangle.generate(3);
Assert.assertTrue(r.get(0).get(0) == 1);
Assert.assertTrue(r.get(1).get(0) == 1);
Assert.assertTrue(r.get(1).get(1) == 1);
Assert.assertTrue(r.get(2).get(1) == 2);
}
@Test
public void testGenerateMethod() throws NoSuchMethodException, SecurityException {
String methodName = "generate";
Class<?> c = PascalTriangle.class;
Method method = c.getDeclaredMethod(methodName, int.class);
Assert.assertNotNull(method);
}
}
|
[
"aqibbutt3078@gmail.com"
] |
aqibbutt3078@gmail.com
|
763944dc3cc3affb139f94bd13377e6822544b0b
|
aa91f6fae3aca2e93fc06afc43dee9c7985ea733
|
/teams/seeding/RobotPlayer.java
|
0700b2c04d6a4259f32abf753a32cdca111b755d
|
[] |
no_license
|
TheDuck314/battlecode2014
|
6a962a6658c917ed72c15a94c54181d44cadbd9b
|
7814de854706484ad9025b7532fb3cc7340971b5
|
refs/heads/master
| 2016-08-06T16:09:49.119776
| 2014-02-10T02:59:55
| 2014-02-10T02:59:55
| 15,696,204
| 0
| 3
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 459
|
java
|
package seeding;
import battlecode.common.*;
public class RobotPlayer {
public static void run(RobotController theRC) throws Exception {
switch (theRC.getType()) {
case HQ:
BotHQ.loop(theRC);
break;
case SOLDIER:
BotSoldier.loop(theRC);
break;
case PASTR:
BotPastr.loop(theRC);
break;
case NOISETOWER:
BotNoiseTower.loop(theRC);
break;
default:
throw new Exception("Unknown robot type!!! :(");
}
}
}
|
[
"gem2128@columbia.edu"
] |
gem2128@columbia.edu
|
d0ed1e2f7a2a587210a5a584d898b99152b0c42a
|
06a41d3cffdacea1ee0d907fa346c854e01ab738
|
/src/main/java/com/yjfshop123/live/live/live/list/TCChatEntity.java
|
135c1ca324b53cae414b21d25c48cd5e64176da0
|
[] |
no_license
|
yanbingyanjing/Demo
|
9c7c600295f9dc4996da5ff6e0803cfae0cfbdc2
|
dbe9b9f51c9e55038da849caf1322bfb1d546583
|
refs/heads/master
| 2023-04-08T18:11:08.182347
| 2021-04-21T07:20:04
| 2021-04-21T07:20:04
| 360,068,907
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,926
|
java
|
package com.yjfshop123.live.live.live.list;
import com.yjfshop123.live.live.commondef.AttributeInfo;
/**
* 消息体类
*/
public class TCChatEntity {
private String content;//内容
private String user_id = "system";//用户ID
private int type;//消息类型
private String identityType;//身份类型 0普通 1主播
private String isGuard;// 是否守护 (1:是 0:否)
private String isVip;//是否vip (1:是 0:否)
private String userName;//名称
private String user_level;//用户财富等级
public TCChatEntity(int type_){
setType(type_);
}
public TCChatEntity(String nickname, AttributeInfo attributeInfo, int type_, String user_id){
setIdentityType(attributeInfo.getIdentityType());
setIsGuard(attributeInfo.getIsGuard());
setIsVip(attributeInfo.getIsVip());
setUser_level(attributeInfo.getUser_level());
setType(type_);
setUserName(nickname);
setUser_id(user_id);
}
public String getUser_id() {
return user_id;
}
public void setUser_id(String user_id) {
this.user_id = user_id;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getIdentityType() {
return identityType;
}
public void setIdentityType(String identityType) {
this.identityType = identityType;
}
public String getIsVip() {
return isVip;
}
public void setIsVip(String isVip) {
this.isVip = isVip;
}
public String getIsGuard() {
return isGuard;
}
public void setIsGuard(String isGuard) {
this.isGuard = isGuard;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUser_level() {
return user_level;
}
public void setUser_level(String user_level) {
this.user_level = user_level;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
|
[
"yanbingyanjing@163.com"
] |
yanbingyanjing@163.com
|
aaeefd18a62197a6bf78d266aff450f517a70538
|
99d856874f2e13f4da8f67d3a59cb0089ed629fe
|
/temp/src/minecraft/net/minecraft/src/ItemSlab.java
|
465f7b2d9cfa961442f05b4609a7a05b90837b1a
|
[] |
no_license
|
pablo67340/SkinFix
|
f1e0fa64361edb13c7f937f99a571f08bc349c54
|
5d5a9aa55a948376236a4fda84a7a0eefa373400
|
refs/heads/master
| 2020-04-27T20:07:23.310747
| 2019-03-09T04:28:15
| 2019-03-09T04:28:15
| 174,646,319
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,810
|
java
|
package net.minecraft.src;
import net.minecraft.src.Block;
import net.minecraft.src.BlockStep;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemBlock;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;
public class ItemSlab extends ItemBlock {
public ItemSlab(int p_i666_1_) {
super(p_i666_1_);
this.func_21013_d(0);
this.func_21015_a(true);
}
public int func_27009_a(int p_27009_1_) {
return Block.field_410_al.func_232_a(2, p_27009_1_);
}
public int func_21012_a(int p_21012_1_) {
return p_21012_1_;
}
public String func_21011_b(ItemStack p_21011_1_) {
int var2 = p_21011_1_.func_21181_i();
if(var2 < 0 || var2 >= BlockStep.field_22037_a.length) {
var2 = 0;
}
return super.func_20009_a() + "." + BlockStep.field_22037_a[var2];
}
public boolean func_192_a(ItemStack p_192_1_, EntityPlayer p_192_2_, World p_192_3_, int p_192_4_, int p_192_5_, int p_192_6_, int p_192_7_) {
if(p_192_1_.field_1615_a == 0) {
return false;
} else if(!p_192_2_.func_35190_e(p_192_4_, p_192_5_, p_192_6_)) {
return false;
} else {
int var8 = p_192_3_.func_600_a(p_192_4_, p_192_5_, p_192_6_);
int var9 = p_192_3_.func_602_e(p_192_4_, p_192_5_, p_192_6_);
int var10 = var9 & 7;
boolean var11 = (var9 & 8) != 0;
if((p_192_7_ == 1 && !var11 || p_192_7_ == 0 && var11) && var8 == Block.field_410_al.field_376_bc && var10 == p_192_1_.func_21181_i()) {
if(p_192_3_.func_604_a(Block.field_411_ak.func_221_d(p_192_3_, p_192_4_, p_192_5_, p_192_6_)) && p_192_3_.func_688_b(p_192_4_, p_192_5_, p_192_6_, Block.field_411_ak.field_376_bc, var10)) {
p_192_3_.func_684_a((double)((float)p_192_4_ + 0.5F), (double)((float)p_192_5_ + 0.5F), (double)((float)p_192_6_ + 0.5F), Block.field_411_ak.field_358_bl.func_1145_d(), (Block.field_411_ak.field_358_bl.func_1147_b() + 1.0F) / 2.0F, Block.field_411_ak.field_358_bl.func_1144_c() * 0.8F);
--p_192_1_.field_1615_a;
}
return true;
} else {
return func_50087_b(p_192_1_, p_192_2_, p_192_3_, p_192_4_, p_192_5_, p_192_6_, p_192_7_)?true:super.func_192_a(p_192_1_, p_192_2_, p_192_3_, p_192_4_, p_192_5_, p_192_6_, p_192_7_);
}
}
}
private static boolean func_50087_b(ItemStack p_50087_0_, EntityPlayer p_50087_1_, World p_50087_2_, int p_50087_3_, int p_50087_4_, int p_50087_5_, int p_50087_6_) {
if(p_50087_6_ == 0) {
--p_50087_4_;
}
if(p_50087_6_ == 1) {
++p_50087_4_;
}
if(p_50087_6_ == 2) {
--p_50087_5_;
}
if(p_50087_6_ == 3) {
++p_50087_5_;
}
if(p_50087_6_ == 4) {
--p_50087_3_;
}
if(p_50087_6_ == 5) {
++p_50087_3_;
}
int var7 = p_50087_2_.func_600_a(p_50087_3_, p_50087_4_, p_50087_5_);
int var8 = p_50087_2_.func_602_e(p_50087_3_, p_50087_4_, p_50087_5_);
int var9 = var8 & 7;
if(var7 == Block.field_410_al.field_376_bc && var9 == p_50087_0_.func_21181_i()) {
if(p_50087_2_.func_604_a(Block.field_411_ak.func_221_d(p_50087_2_, p_50087_3_, p_50087_4_, p_50087_5_)) && p_50087_2_.func_688_b(p_50087_3_, p_50087_4_, p_50087_5_, Block.field_411_ak.field_376_bc, var9)) {
p_50087_2_.func_684_a((double)((float)p_50087_3_ + 0.5F), (double)((float)p_50087_4_ + 0.5F), (double)((float)p_50087_5_ + 0.5F), Block.field_411_ak.field_358_bl.func_1145_d(), (Block.field_411_ak.field_358_bl.func_1147_b() + 1.0F) / 2.0F, Block.field_411_ak.field_358_bl.func_1144_c() * 0.8F);
--p_50087_0_.field_1615_a;
}
return true;
} else {
return false;
}
}
}
|
[
"pablo67340@gmail.com"
] |
pablo67340@gmail.com
|
31105b00c1e6aa0f3d77d621f256eb33104bed31
|
6db8e1a553d23175d6d36804a0e34ef82dfc8131
|
/projects/batfish/src/batfish/z3/node/NodeDropExpr.java
|
39207c8230eb6b2649021f945f7d48bc2c4abaeb
|
[
"Apache-2.0"
] |
permissive
|
pyrocat101/batfish
|
0bb6759fe1e7bdc8f68f505c5e241f473e40a264
|
f4d333b03dcbb2670a82ce47d8c95787584031bc
|
refs/heads/master
| 2021-01-14T14:28:25.884785
| 2015-01-19T06:30:40
| 2015-01-19T06:30:40
| 28,770,972
| 0
| 0
| null | 2015-01-04T10:10:29
| 2015-01-04T10:10:29
| null |
UTF-8
|
Java
| false
| false
| 221
|
java
|
package batfish.z3.node;
public class NodeDropExpr extends NodePacketRelExpr {
public static final String BASE_NAME = "R_node_drop";
public NodeDropExpr(String nodeArg) {
super(BASE_NAME, nodeArg);
}
}
|
[
"arifogel@ucla.edu"
] |
arifogel@ucla.edu
|
a302eee2bc6c333e4d5d98fe19c6cd3a74f59cae
|
f822c2a7de4658f2a71ffce5f0e7a83e5eaccb94
|
/statemachine-parent/statemachine-impl/src/main/java/com/sxj/statemachine/fsm/annotation/LogExecTime.java
|
e5c5260442bfee474dcbbf1ab53e68ec41ef2650
|
[] |
no_license
|
helpying/sxj-src
|
d05f7ff10b07c92b70412e0390fed88c24c33b55
|
b969dee813b51bbbb1a7018258bced33ae7b83ed
|
refs/heads/master
| 2020-12-31T05:55:19.231173
| 2014-12-24T07:20:46
| 2014-12-24T07:20:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 421
|
java
|
package com.sxj.statemachine.fsm.annotation;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Retention(RUNTIME)
@Target({METHOD, TYPE})
@Documented
public @interface LogExecTime {
}
|
[
"redtroyzhang@gmail.com"
] |
redtroyzhang@gmail.com
|
848bd54752ab7ca5bc6b1624d97b58c0a418fd17
|
0cd9e0184f628d0ae62d6e582f55fb1e83c49e81
|
/ModuleWatchMan/src/main/java/cn/com/watchman/chatui/WarningDetailsActivity.java
|
95e2851f7aea47b003a47985c88fd38d6f273165
|
[] |
no_license
|
sun529417168/ParkGuardFirst
|
b83928b5a7647bba10c5b7204c9479507921d9f8
|
b6690db6a32ad806130cc9936438d66c1fc51a44
|
refs/heads/master
| 2020-12-02T22:13:05.256488
| 2017-07-20T08:15:30
| 2017-07-20T08:15:30
| 96,081,866
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,307
|
java
|
package cn.com.watchman.chatui;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.GridView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.linked.erfli.library.base.BaseActivity;
import com.linked.erfli.library.utils.DeviceUuidFactory;
import com.linked.erfli.library.utils.SharedUtil;
import java.util.ArrayList;
import cn.com.watchman.R;
import cn.com.watchman.chatui.adapter.ChatWarningDetailsImageGridviewAdapter;
import cn.com.watchman.chatui.enity.WarningDetailsInfo;
import cn.com.watchman.chatui.interfaces.ChatWarningDetailsInterface;
import cn.com.watchman.chatui.uiutils.MyGridViewHeightUtiils;
import cn.com.watchman.networkrequest.WatchManRequest;
/**
* zzq
* 2017年6月15日13:41:35
* 巡更事件上报详情页面
*/
public class WarningDetailsActivity extends BaseActivity implements View.OnClickListener, ChatWarningDetailsInterface {
private LinearLayout title_back;
private TextView title_name;
private int warningId;
//=========
private TextView chat_war_details_tv_number_value;//编号文本
private TextView chat_war_details_tv_reprottime_value;//时间
private TextView chat_war_details_tv_describe_value;//备注信息
private GridView problem_detail_gridView;//图片
//===========
private ChatWarningDetailsImageGridviewAdapter adapter;
@Override
protected void setView() {
setContentView(R.layout.activity_chat_warning_details);
}
@Override
protected void setDate(Bundle savedInstanceState) {
Intent intent = getIntent();
warningId = Integer.parseInt(intent.getStringExtra("id"));
Toast.makeText(this, "" + warningId, Toast.LENGTH_SHORT).show();
String deviceUuid = new DeviceUuidFactory(WarningDetailsActivity.this).getDeviceUuid().toString();
int userId = Integer.parseInt(SharedUtil.getString(WarningDetailsActivity.this, "PersonID"));
WatchManRequest.getWarningDetails(WarningDetailsActivity.this, 10, 12, deviceUuid, userId, warningId);
}
@Override
protected void init() {
title_back = (LinearLayout) findViewById(R.id.title_back);
title_name = (TextView) findViewById(R.id.title_name);
title_back.setVisibility(View.VISIBLE);
title_name.setText("问题详情");
title_back.setOnClickListener(this);
//======================
chat_war_details_tv_number_value = (TextView) findViewById(R.id.chat_war_details_tv_number_value);
chat_war_details_tv_reprottime_value = (TextView) findViewById(R.id.chat_war_details_tv_reprottime_value);
chat_war_details_tv_describe_value = (TextView) findViewById(R.id.chat_war_details_tv_describe_value);
problem_detail_gridView = (GridView) findViewById(R.id.problem_detail_gridView);
//===========
}
@Override
public void onClick(View v) {
int i = v.getId();
if (i == R.id.title_back) {
PGApp.finishTop();
}
}
private ArrayList<String> list;
@Override
public void getWarningDetailsInterface(WarningDetailsInfo warningDetailsInfo) {
list = new ArrayList();
if (warningDetailsInfo.getFile().size() > 0) {
chat_war_details_tv_number_value.setText(warningDetailsInfo.getAlarm().getDeviceguid());
String time = warningDetailsInfo.getAlarm().getAlarm_time();
time = time.replace("T", " ");
chat_war_details_tv_reprottime_value.setText(time);
chat_war_details_tv_describe_value.setText(warningDetailsInfo.getAlarm().getAlarm_text());
int fileSize = warningDetailsInfo.getFile().size();
for (int i = 0; i < fileSize; i++) {
list.add(warningDetailsInfo.getFile().get(i).getFile_address());
}
adapter = new ChatWarningDetailsImageGridviewAdapter(WarningDetailsActivity.this, list);
problem_detail_gridView.setAdapter(adapter);
MyGridViewHeightUtiils.setListViewHeightBasedOnChildren(problem_detail_gridView);
adapter.notifyDataSetChanged();
} else {
Toast.makeText(this, "数据查询有误~", Toast.LENGTH_SHORT).show();
}
}
}
|
[
"xue7758521"
] |
xue7758521
|
0af9fcba27dad2a94c3e2a7adb29a0e60d79ea01
|
d7939b55ab10a2070ca90013886a26bc2bba1002
|
/src/main/java/org/takes/rs/RsWrap.java
|
7fe32ec9baae494aa41d6501092f9b177dd39c9a
|
[
"MIT"
] |
permissive
|
celezar/takes
|
672002e6d247c334c619f337234a61b0bdab6f4b
|
2fb190cae20a74d917a874cd13a3b69cff1be5c3
|
refs/heads/master
| 2020-12-29T00:30:05.072630
| 2015-04-07T20:32:50
| 2015-04-07T20:32:50
| 33,399,051
| 1
| 0
| null | 2015-04-04T08:23:00
| 2015-04-04T08:23:00
| null |
UTF-8
|
Java
| false
| false
| 1,985
|
java
|
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Yegor Bugayenko
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.takes.rs;
import java.io.IOException;
import java.io.InputStream;
import lombok.EqualsAndHashCode;
import org.takes.Response;
/**
* Response decorator.
*
* <p>The class is immutable and thread-safe.
*
* @author Yegor Bugayenko (yegor@teamed.io)
* @version $Id$
* @since 0.1
*/
@EqualsAndHashCode(of = "origin")
public class RsWrap implements Response {
/**
* Original response.
*/
private final transient Response origin;
/**
* Ctor.
* @param res Original response
*/
public RsWrap(final Response res) {
this.origin = res;
}
@Override
public final Iterable<String> head() throws IOException {
return this.origin.head();
}
@Override
public final InputStream body() throws IOException {
return this.origin.body();
}
}
|
[
"yegor@tpc2.com"
] |
yegor@tpc2.com
|
8e63f6ca466aa5f0507e629d138faf8e3911f7d4
|
d90faaf33e6bc55176a21c34d9aadf0ffa8ed939
|
/org.raml.dialects.core/src/main/java/org/raml/dialecs/core/model/JSONLDContext.java
|
772494674a26c6dc869e266ad1d490f03f3404bc
|
[
"Apache-2.0"
] |
permissive
|
Pavel-research/raml-dialects-tools
|
dd6683599a6d810f8e11bb2de0efdcf9522a221e
|
73b64e99bf3dce1032c7d4ff710d1db36d0e1d68
|
refs/heads/master
| 2021-05-15T16:07:06.459157
| 2017-10-20T03:05:44
| 2017-10-20T03:05:44
| 107,439,142
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,010
|
java
|
package org.raml.dialecs.core.model;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import org.raml.dialects.core.HasId;
import org.raml.dialects.core.annotations.BuiltinInstances;
public class JSONLDContext {
protected static class Entry {
protected final String id;
protected final PropertyModel model;
protected final Object target;
public Entry(String id, PropertyModel model, Object target) {
super();
this.id = id;
this.model = model;
this.target = target;
}
}
protected ArrayList<Entry> toBind = new ArrayList<Entry>();
protected LinkedHashMap<String, Object> knownObjects = new LinkedHashMap<String,Object>();
public Object getObject(String id){
return this.knownObjects.get(id);
}
public void record(String id,Object object){
this.knownObjects.put(id, object);
}
public void delay(String id, PropertyModel model, Object target){
this.toBind.add(new Entry(id, model, target));
}
public void bind() {
for (Entry e : toBind) {
Object newValue = knownObjects.get(e.id);
if (newValue==null){
BuiltinInstances annotation = e.model.nodeType.getAnnotation(BuiltinInstances.class);
if (annotation!=null){
for (Class<?> c:annotation.value()){
for (Field f:c.getDeclaredFields()){
if (Modifier.isStatic(f.getModifiers())){
if (e.model.nodeType.isAssignableFrom(f.getType())){
try {
HasId object = (HasId) f.get(null);
newValue = resolveBuiltin(e, newValue, object);
} catch (Exception e1) {
throw new IllegalStateException(e1);
}
}
}
}
}
}
}
e.model.append(e.target, newValue, null, null);
}
}
protected Object resolveBuiltin(Entry e, Object newValue, HasId object) {
if (object.id().equals(e.id)){
newValue=object;
}
return newValue;
}
}
|
[
"petrochenko.pavel.a@gmail.com"
] |
petrochenko.pavel.a@gmail.com
|
035a55ef1c60905b2f26a9b1b48bd0aa75238003
|
00dcb5cc5e5a4b75db2275fa5d2c185c0f3e485a
|
/src/main/java/org/xnio/nativeimpl/Version.java
|
02516d7367fcbcb5074da87a1008501b00714da4
|
[] |
no_license
|
ctomc/xnio-native
|
799706611cc26f9a7cd966ff9531ffcf52feed89
|
411c2acd563a57983c3363ba7f592fb9646253ff
|
refs/heads/master
| 2020-12-07T15:30:49.580201
| 2014-01-08T22:50:56
| 2014-01-08T22:50:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,210
|
java
|
/*
* JBoss, Home of Professional Open Source
*
* Copyright 2013 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.xnio.nativeimpl;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
/**
* The version class.
*
* @apiviz.exclude
*/
public final class Version {
private Version() {}
/**
* Print out the current XNIO version on {@code System.out}.
*
* @param args ignored
*/
public static void main(String[] args) {
System.out.print(VERSION_STRING);
}
private static final String JAR_NAME;
private static final String VERSION_STRING;
static {
final Enumeration<URL> resources;
String jarName = "(unknown)";
String versionString = "(unknown)";
try {
final ClassLoader classLoader = Version.class.getClassLoader();
resources = classLoader == null ? ClassLoader.getSystemResources("META-INF/MANIFEST.MF") : classLoader.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final URL url = resources.nextElement();
try {
final InputStream stream = url.openStream();
if (stream != null) try {
final Manifest manifest = new Manifest(stream);
final Attributes mainAttributes = manifest.getMainAttributes();
if (mainAttributes != null && "XNIO Native Implementation".equals(mainAttributes.getValue("Specification-Title"))) {
jarName = mainAttributes.getValue("Jar-Name");
versionString = mainAttributes.getValue("Jar-Version");
}
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (Throwable ignored) {
}
}
} catch (IOException ignored) {}
}
} catch (IOException ignored) {}
JAR_NAME = jarName;
VERSION_STRING = versionString;
}
/**
* Get the name of the JBoss Modules JAR.
*
* @return the name
*/
public static String getJarName() {
return JAR_NAME;
}
/**
* Get the version string of JBoss Modules.
*
* @return the version string
*/
public static String getVersionString() {
return VERSION_STRING;
}
}
|
[
"david.lloyd@redhat.com"
] |
david.lloyd@redhat.com
|
8c726db528c969b9cad9baf810b15d968dcaee98
|
183bfe29873fca557a8f76f940d398264ff2a121
|
/src/main/java/com/kenny/openimgur/classes/Upload.java
|
10d13a59daeb5b300ac973e85658a968c82337f3
|
[
"Apache-2.0"
] |
permissive
|
darkevilmac/Opengur
|
54152a9d1a217f852eb53b1df032fb5c083d2686
|
9567d6ae940a3d12620de6f0a3c789896d939507
|
refs/heads/master
| 2021-01-15T08:20:38.947009
| 2015-12-21T23:17:07
| 2015-12-21T23:17:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,945
|
java
|
package com.kenny.openimgur.classes;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Created by Kenny-PC on 6/21/2015.
*/
public class Upload implements Parcelable {
private String mLocation;
private String mUploadedLink;
private String mTitle;
private String mDesc;
private boolean mIsLink;
private Upload(Parcel in) {
mLocation = in.readString();
mUploadedLink = in.readString();
mTitle = in.readString();
mDesc = in.readString();
mIsLink = in.readInt() == 1;
}
public Upload(String location, boolean isLink) {
mLocation = location;
mIsLink = isLink;
}
public Upload(String location) {
this(location, false);
}
public String getLocation() {
return mLocation;
}
public boolean isLink() {
return mIsLink;
}
public String getUploadedLink() {
return mUploadedLink;
}
public void setUploadedLink(String link) {
mUploadedLink = link;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public String getDescription() {
return mDesc;
}
public void setDescription(String description) {
mDesc = description;
}
public static final Parcelable.Creator<Upload> CREATOR = new Parcelable.Creator<Upload>() {
public Upload createFromParcel(Parcel in) {
return new Upload(in);
}
public Upload[] newArray(int size) {
return new Upload[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeString(mLocation);
out.writeString(mUploadedLink);
out.writeString(mTitle);
out.writeString(mDesc);
out.writeInt(mIsLink ? 1 : 0);
}
}
|
[
"kennyc1012@gmail.com"
] |
kennyc1012@gmail.com
|
f6d7b805ce10b8cf4fe5aae0ce95ace76acd664b
|
112a579bcf27a2d63c367bf476b34fcf2faeb707
|
/my-handwriting/handwriting-spring-simulate/src/main/java/prosayj/handwritingspring/simulate/core/convert/support/StringToNumberConverterFactory.java
|
47e24108216e59ba7691149c0271609ab6d1ee28
|
[] |
no_license
|
ProSayJ/think-in-spring
|
78b4a7d0b4f0e08bf42c16fcda48c451fcb41165
|
507a2bacd16af92b1320781fc4d1739118c8323d
|
refs/heads/main
| 2023-06-22T16:58:36.037144
| 2021-07-21T07:20:34
| 2021-07-21T07:20:34
| 332,664,184
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,017
|
java
|
/*
* Copyright 2002-2017 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
*
* https://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 prosayj.handwritingspring.simulate.core.convert.support;
import prosayj.handwritingspring.simulate.core.convert.converter.Converter;
import prosayj.handwritingspring.simulate.core.convert.converter.ConverterFactory;
import prosayj.handwritingspring.simulate.util.NumberUtils;
/**
* Converts from a String any JDK-standard Number implementation.
*
* <p>Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class
* delegates to {@link NumberUtils#parseNumber(String, Class)} to perform the conversion.
*
* @author Keith Donald
* @since 3.0
* @see Byte
* @see Short
* @see Integer
* @see Long
* @see java.math.BigInteger
* @see Float
* @see Double
* @see java.math.BigDecimal
* @see NumberUtils
*/
final class StringToNumberConverterFactory implements ConverterFactory<String, Number> {
@Override
public <T extends Number> Converter<String, T> getConverter(Class<T> targetType) {
return new StringToNumber<>(targetType);
}
private static final class StringToNumber<T extends Number> implements Converter<String, T> {
private final Class<T> targetType;
public StringToNumber(Class<T> targetType) {
this.targetType = targetType;
}
@Override
public T convert(String source) {
if (source.isEmpty()) {
return null;
}
return NumberUtils.parseNumber(source, this.targetType);
}
}
}
|
[
"15665662468@163.com"
] |
15665662468@163.com
|
07cee7d5ab35f85a8e2c438626d2a697d447cd79
|
f96fe513bfdf2d1dbd582305e1cbfda14a665bec
|
/net.sf.smbt.osc.ableton.edit/src/net/sf/smbt/ezableton/provider/LiveScene2ItemProvider.java
|
f33561d4fe2ae16702a626e91fd397837ba1c846
|
[] |
no_license
|
lucascraft/ubq_wip
|
04fdb727e7b2dc384ba1d2195ad47e895068e1e4
|
eff577040f21be71ea2c76c187d574f1617703ce
|
refs/heads/master
| 2021-01-22T02:28:20.687330
| 2015-06-10T12:38:47
| 2015-06-10T12:38:47
| 37,206,324
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,395
|
java
|
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package net.sf.smbt.ezableton.provider;
import java.util.Collection;
import java.util.List;
import net.sf.smbt.ezableton.EzabletonPackage;
import net.sf.smbt.ezableton.LiveScene2;
import net.sf.xqz.model.cmd.PRIORITY;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
/**
* This is the item provider adapter for a {@link net.sf.smbt.ezableton.LiveScene2} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class LiveScene2ItemProvider
extends AbletonLiveSndCmdItemProvider
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LiveScene2ItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
addSceneIDPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
* This adds a property descriptor for the Scene ID feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addSceneIDPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LiveScene2_sceneID_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LiveScene2_sceneID_feature", "_UI_LiveScene2_type"),
EzabletonPackage.Literals.LIVE_SCENE2__SCENE_ID,
true,
false,
false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
null,
null));
}
/**
* This returns LiveScene2.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/LiveScene2"));
}
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
PRIORITY labelValue = ((LiveScene2)object).getPriority();
String label = labelValue == null ? null : labelValue.toString();
return label == null || label.length() == 0 ?
getString("_UI_LiveScene2_type") :
getString("_UI_LiveScene2_type") + " " + label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(LiveScene2.class)) {
case EzabletonPackage.LIVE_SCENE2__SCENE_ID:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
super.notifyChanged(notification);
}
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}
}
|
[
"lucas.bigeardel@gmail.com"
] |
lucas.bigeardel@gmail.com
|
0e55627da7fd79b83910bd138408843f98ef4b46
|
83ec53285d2f805876665d70cd48cdaddb95047c
|
/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/model/PurgeQueueInProgressException.java
|
7e447aea52eabef0f39df04e30e634e8b7dbb18a
|
[
"JSON",
"Apache-2.0"
] |
permissive
|
sarvex/aws-sdk-java
|
58d1d2094a689ab20925ad9b208a46008af5efb4
|
8cd1cfb947a419914ebf477ede050fe320d9ca71
|
refs/heads/master
| 2023-05-13T16:53:16.261624
| 2023-05-01T06:35:34
| 2023-05-01T06:35:34
| 32,573,530
| 0
| 0
|
Apache-2.0
| 2023-05-01T06:35:35
| 2015-03-20T08:59:36
|
Java
|
UTF-8
|
Java
| false
| false
| 1,300
|
java
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.sqs.model;
import com.amazonaws.AmazonServiceException;
/**
* <p>
* Indicates that the specified queue previously received a
* <code>PurgeQueue</code> request within the last 60 seconds, the time
* it can take to delete the messages in the queue.
* </p>
*/
public class PurgeQueueInProgressException extends AmazonServiceException {
private static final long serialVersionUID = 1L;
/**
* Constructs a new PurgeQueueInProgressException with the specified error
* message.
*
* @param message Describes the error encountered.
*/
public PurgeQueueInProgressException(String message) {
super(message);
}
}
|
[
"aws@amazon.com"
] |
aws@amazon.com
|
7d2d060476b429f321c19513f231f39bb0363dad
|
343c983e497e39e9f41dae6edf990b112a0d7320
|
/etl.editor/src/org/netbeans/modules/masterindex/schemagenerator/DefaultSystemFields.java
|
ada519f59c29283f19ced09a432493a430419020
|
[] |
no_license
|
svenreimers/hg-netbeans-org-community-soa
|
8857c31aa333cd3a3a393838e78df60268e7cedf
|
deac77f78021b64866d60965585dcb7efccb8f71
|
refs/heads/master
| 2023-03-09T11:51:16.023114
| 2011-09-28T10:01:59
| 2011-09-28T10:01:59
| 342,031,636
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,723
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.netbeans.modules.masterindex.schemagenerator;
import java.util.HashMap;
import java.util.logging.Logger;
/**
*
* @author Manish Bharani
*/
public class DefaultSystemFields {
// Enter System fields that need to be set as defaults (UPPERCASE)
// These fields must be present in the source system from where data is being pulled out.
private static final String[] defaults = {
"GID",
"SYSTEMCODE",
"LID",
"UPDATEDATE",
"USR",};
//logger
private static Logger logger = Logger.getLogger(DefaultSystemFields.class.getName());
HashMap fieldMap = new HashMap<String, Integer>();
public DefaultSystemFields() {
logger.info("Default System Fields ..." + printfields());
createFieldMap();
}
private String printfields() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < defaults.length; i++) {
sb.append("\n " + defaults[i]);
}
return sb.toString();
}
// This is to speed up search of fields at runtime
private void createFieldMap() {
for (int i = 0; i < defaults.length; i++) {
fieldMap.put(defaults[i], new Integer(i));
}
}
// If Attribute is found, index is returned for the attribute
public int isAttributeDefault(String attrib) {
Integer index = (Integer) fieldMap.get(attrib);
if (index != null) {
return index.intValue();
}
return -1;
}
public static String[] getDefaultSystemFields(){
return defaults;
}
}
|
[
"yaroslavskiy@netbeans.org"
] |
yaroslavskiy@netbeans.org
|
31aa82aaffeda155e909cf9cad06bca7b637f91f
|
edeb76ba44692dff2f180119703c239f4585d066
|
/libFMap_dal/src/org/gvsig/fmap/dal/feature/exception/IllegalValueException.java
|
855612d2f251955ee7b8553109da306fadeecbf3
|
[] |
no_license
|
CafeGIS/gvSIG2_0
|
f3e52bdbb98090fd44549bd8d6c75b645d36f624
|
81376f304645d040ee34e98d57b4f745e0293d05
|
refs/heads/master
| 2020-04-04T19:33:47.082008
| 2012-09-13T03:55:33
| 2012-09-13T03:55:33
| 5,685,448
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,244
|
java
|
/* gvSIG. Geographic Information System of the Valencian Government
*
* Copyright (C) 2007-2008 Infrastructures and Transports Department
* of the Valencian Government (CIT)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
/*
* AUTHORS (In addition to CIT):
* 2009 IVER T.I {{Task}}
*/
/**
*
*/
package org.gvsig.fmap.dal.feature.exception;
import org.gvsig.fmap.dal.exception.DataRuntimeException;
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
/**
* @author jmvivo
*
*/
public class IllegalValueException extends DataRuntimeException {
/**
*
*/
private static final long serialVersionUID = 7398202284121091833L;
private final static String MESSAGE_FORMAT = "Value not allowed for the attribute '%(attribute)'[%(typename)]: %(value).";
private final static String MESSAGE_KEY = "_IllegalValueException";
public IllegalValueException(FeatureAttributeDescriptor attribute,
Object value) {
super(MESSAGE_FORMAT, MESSAGE_KEY, serialVersionUID);
setValue("attribute", attribute.getName());
setValue("typename", attribute.getDataTypeName());
if (value == null) {
setValue("value", "{null}");
} else {
setValue("value", value.toString());
}
}
public IllegalValueException(FeatureAttributeDescriptor attribute,
Object value, Throwable cause) {
super(MESSAGE_FORMAT, cause, MESSAGE_KEY, serialVersionUID);
setValue("attribute", attribute.getName());
setValue("typename", attribute.getDataTypeName());
if (value == null) {
setValue("value", "{null}");
} else {
setValue("value", value.toString());
}
}
}
|
[
"tranquangtruonghinh@gmail.com"
] |
tranquangtruonghinh@gmail.com
|
739ce8e5bc52a38697d07213365bd426217ff000
|
d9d08ab2379766b70f2e7be99f3b40aedd8c369d
|
/src/main/java/com/kepler/generic/impl/DefaultImported.java
|
4e33ddfcb677f576f00f7b5a9299323f73a85c02
|
[] |
no_license
|
haogrgr/Kepler-All
|
7b55132d2f87cea3b537e1c0954d492c28bf7741
|
be9fb018384b66479fcce9425d17497d93d1856d
|
refs/heads/master
| 2020-12-25T13:51:25.419526
| 2016-10-12T03:43:01
| 2016-10-12T03:43:01
| 52,507,339
| 1
| 1
| null | 2016-02-25T08:01:17
| 2016-02-25T08:01:17
| null |
UTF-8
|
Java
| false
| false
| 1,934
|
java
|
package com.kepler.generic.impl;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.kepler.generic.GenericImported;
import com.kepler.generic.GenericMarker;
import com.kepler.header.HeadersContext;
import com.kepler.header.HeadersProcessor;
import com.kepler.id.IDGenerators;
import com.kepler.invoker.Invoker;
import com.kepler.protocol.RequestFactory;
import com.kepler.serial.Serials;
import com.kepler.service.Imported;
import com.kepler.service.Service;
/**
* 服务导入
*
* @author KimShen
*
*/
abstract public class DefaultImported implements GenericImported {
private static final Log LOGGER = LogFactory.getLog(DefaultImported.class);
/**
* 已注册服务
*/
private final Set<Service> services = new HashSet<Service>();
protected final HeadersProcessor processor;
protected final IDGenerators generators;
protected final RequestFactory factory;
protected final HeadersContext header;
protected final GenericMarker marker;
protected final Imported imported;
protected final Serials serials;
protected final Invoker invoker;
public DefaultImported(HeadersProcessor processor, IDGenerators generators, RequestFactory factory, HeadersContext header, GenericMarker marker, Imported imported, Serials serials, Invoker invoker) {
super();
this.generators = generators;
this.processor = processor;
this.imported = imported;
this.factory = factory;
this.serials = serials;
this.invoker = invoker;
this.header = header;
this.marker = marker;
}
public void imported(Service service) throws Exception {
// 仅加载尚未加载的服务
if (!this.services.contains(service)) {
this.imported.subscribe(service);
this.services.add(service);
DefaultImported.LOGGER.warn("Import generic service: " + service + ", and will not be uninstalled until server closed");
}
}
}
|
[
"shenjiawei@didichuxing.com"
] |
shenjiawei@didichuxing.com
|
d0e4b84a33ac79867479cb85beb6d9030b74a500
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/23/23_6b503bddee983f3948888ce87f4273b3df34e3b8/TempData/23_6b503bddee983f3948888ce87f4273b3df34e3b8_TempData_t.java
|
93dfc5536c5fe5f9ff6bccb6c84fdcf0b872325c
|
[] |
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,009
|
java
|
/*
* Copyright (c) 2008-2013, Hazelcast, Inc. 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.map;
import java.io.Serializable;
import java.util.Map;
public class TempData implements Serializable {
private static final long serialVersionUID = 1L;
private String attr1;
private String attr2;
public TempData() {
}
public TempData(String attr1, String attr2) {
this.attr1 = attr1;
this.attr2 = attr2;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
@Override
public String toString() {
return attr1 + " " + attr2;
}
public static class DeleteEntryProcessor extends AbstractEntryProcessor<String, TempData> {
private static final long serialVersionUID = 1L;
public Object process(Map.Entry<String, TempData> entry) {
entry.setValue(null);
return true;
}
}
public static class LoggingEntryProcessor extends AbstractEntryProcessor<String, TempData> {
private static final long serialVersionUID = 1L;
public Object process(Map.Entry<String, TempData> entry) {
return true;
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
1e510189d7b4f88f45c46b82303157ad1ca6364f
|
6edf6c315706e14dc6aef57788a2abea17da10a3
|
/com/planet_ink/marble_mud/Abilities/Fighter/Fighter_CoupDeGrace.java
|
823c6c9cf6cccf55e12d82a2a12f2bba48774b94
|
[] |
no_license
|
Cocanuta/Marble
|
c88efd73c46bd152098f588ba1cdc123316df818
|
4306fbda39b5488dac465a221bf9d8da4cbf2235
|
refs/heads/master
| 2020-12-25T18:20:08.253300
| 2012-09-10T17:09:50
| 2012-09-10T17:09:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,368
|
java
|
package com.planet_ink.marble_mud.Abilities.Fighter;
import com.planet_ink.marble_mud.core.interfaces.*;
import com.planet_ink.marble_mud.core.*;
import com.planet_ink.marble_mud.core.collections.*;
import com.planet_ink.marble_mud.Abilities.interfaces.*;
import com.planet_ink.marble_mud.Areas.interfaces.*;
import com.planet_ink.marble_mud.Behaviors.interfaces.*;
import com.planet_ink.marble_mud.CharClasses.interfaces.*;
import com.planet_ink.marble_mud.Commands.interfaces.*;
import com.planet_ink.marble_mud.Common.interfaces.*;
import com.planet_ink.marble_mud.Exits.interfaces.*;
import com.planet_ink.marble_mud.Items.interfaces.*;
import com.planet_ink.marble_mud.Locales.interfaces.*;
import com.planet_ink.marble_mud.MOBS.interfaces.*;
import com.planet_ink.marble_mud.Races.interfaces.*;
import java.util.*;
/*
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.
*/
@SuppressWarnings("rawtypes")
public class Fighter_CoupDeGrace extends FighterSkill
{
public String ID() { return "Fighter_CoupDeGrace"; }
public String name(){ return "Coup de Grace";}
private static final String[] triggerStrings = {"COUP","COUPDEGRACE"};
public int abstractQuality(){return Ability.QUALITY_MALICIOUS;}
public String[] triggerStrings(){return triggerStrings;}
protected int canAffectCode(){return 0;}
protected int canTargetCode(){return Ability.CAN_MOBS;}
public int maxRange(){return adjustedMaxInvokerRange(0);}
public int classificationCode(){ return Ability.ACODE_SKILL|Ability.DOMAIN_DIRTYFIGHTING;}
public int usageType(){return USAGE_MOVEMENT;}
public int castingQuality(MOB mob, Physical target)
{
if((mob!=null)&&(target!=null))
{
if(!mob.isInCombat()) return Ability.QUALITY_INDIFFERENT;
if(mob.rangeToTarget()>0) return Ability.QUALITY_INDIFFERENT;
Item w=mob.fetchWieldedItem();
Weapon ww=null;
if((w==null)||(!(w instanceof Weapon))) return Ability.QUALITY_INDIFFERENT;
ww=(Weapon)w;
if((ww.weaponType()!=Weapon.TYPE_SLASHING)
&&(ww.weaponType()!=Weapon.TYPE_PIERCING))
return Ability.QUALITY_INDIFFERENT;
if(mob.curState().getMovement()<150) return Ability.QUALITY_INDIFFERENT;
if(!CMLib.flags().isSleeping(mob.getVictim())) return Ability.QUALITY_INDIFFERENT;
}
return super.castingQuality(mob,target);
}
public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!mob.isInCombat())
{
mob.tell("You must be in combat to do this!");
return false;
}
if(mob.isInCombat()&&(mob.rangeToTarget()>0))
{
mob.tell("You are too far away to try that!");
return false;
}
Item w=mob.fetchWieldedItem();
Weapon ww=null;
if(!auto)
{
if((w==null)||(!(w instanceof Weapon)))
{
mob.tell("You cannot coup de grace without a weapon!");
return false;
}
ww=(Weapon)w;
if((ww.weaponType()!=Weapon.TYPE_SLASHING)
&&(ww.weaponType()!=Weapon.TYPE_PIERCING))
{
mob.tell("You cannot coup de grace with a "+ww.name()+"!");
return false;
}
if(mob.curState().getMovement()<150)
{
mob.tell("You don't have the energy to try it.");
return false;
}
if(!CMLib.flags().isSleeping(mob.getVictim()))
{
if(CMLib.flags().isSitting(mob.getVictim()))
mob.tell(mob.getVictim().charStats().HeShe()+" is on the ground, but not prone!");
else
mob.tell(mob.getVictim().charStats().HeShe()+" is not prone!");
return false;
}
}
MOB target=mob.getVictim();
int dmg=target.curState().getHitPoints();
if((!super.invoke(mob,commands,givenTarget,auto,asLevel))||(ww==null))
return false;
int levelDiff=target.phyStats().level()-(mob.phyStats().level()+(2*super.getXLEVELLevel(mob)));
if(levelDiff>0)
levelDiff=levelDiff*3;
else
levelDiff=0;
mob.curState().adjMovement(-150,mob.maxState());
int chance=(-levelDiff)+(-(target.charStats().getStat(CharStats.STAT_CONSTITUTION)*2));
boolean hit=(auto)||CMLib.combat().rollToHit(mob,target);
boolean success=proficiencyCheck(mob,chance,auto)&&(hit);
if((success)&&((dmg<50)||(dmg<(target.maxState().getHitPoints()/4))))
{
CMMsg msg=CMClass.getMsg(mob,target,this,CMMsg.MSK_MALICIOUS_MOVE|CMMsg.TYP_JUSTICE|(auto?CMMsg.MASK_ALWAYS:0),null);
if(mob.location().okMessage(mob,msg))
{
mob.location().send(mob,msg);
target.curState().setHitPoints(1);
CMLib.combat().postDamage(mob,target,ww,dmg,CMMsg.MSG_WEAPONATTACK,ww.weaponClassification(),auto?"":"^F^<FIGHT^><S-NAME> rear(s) back and Coup-de-Grace(s) <T-NAME>!^</FIGHT^>^?"+CMProps.msp("decap.wav",30));
mob.location().recoverRoomStats();
}
}
else
{
String str=auto?"":"<S-NAME> attempt(s) a Coup-de-Grace and fail(s)!";
CMMsg msg=CMClass.getMsg(mob,target,null,CMMsg.MASK_MALICIOUS|CMMsg.MSG_OK_ACTION,str);
if(mob.location().okMessage(mob,msg))
mob.location().send(mob,msg);
}
return success;
}
}
|
[
"Cocanuta@Gmail.com"
] |
Cocanuta@Gmail.com
|
4ff382f5445e617d0e4339cc2bff4759f2a7f57d
|
a00326c0e2fc8944112589cd2ad638b278f058b9
|
/src/main/java/000/141/713/CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51a.java
|
39a3f9532b47fb075c86889ff6c9eb9648af5e1e
|
[] |
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
| 3,116
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51a.java
Label Definition File: CWE606_Unchecked_Loop_Condition.label.xml
Template File: sources-sinks-51a.tmpl.java
*/
/*
* @description
* CWE: 606 Unchecked Input for Loop Condition
* BadSource: getCookies_Servlet Read data from the first cookie using getCookies()
* GoodSource: hardcoded int in string form
* Sinks:
* GoodSink: validate loop variable
* BadSink : loop variable not validated
* Flow Variant: 51 Data flow: data passed as an argument from one function to another in different classes in the same package
*
* */
import javax.servlet.http.*;
public class CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* initialize data in case there are no cookies */
/* Read data from cookies */
{
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
/* POTENTIAL FLAW: Read data from the first cookie value */
data = cookieSources[0].getValue();
}
}
(new CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51b()).badSink(data , request, response );
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded int as a string */
data = "5";
(new CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51b()).goodG2BSink(data , request, response );
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* initialize data in case there are no cookies */
/* Read data from cookies */
{
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
/* POTENTIAL FLAW: Read data from the first cookie value */
data = cookieSources[0].getValue();
}
}
(new CWE606_Unchecked_Loop_Condition__getCookies_Servlet_51b()).goodB2GSink(data , request, response );
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"anhtluet12@gmail.com"
] |
anhtluet12@gmail.com
|
aaf0f334dd8efbdc08275fea4782f885c7568684
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/elastic--elasticsearch/2cc97a0d3ed2a9276378e2a6462942deab04a1fb/before/SpanWithinQueryBuilderTests.java
|
c9befe3d1c697c38f4d48b812633d2e9351fc58d
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,108
|
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.elasticsearch.index.query;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.spans.SpanWithinQuery;
import org.junit.Test;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.instanceOf;
public class SpanWithinQueryBuilderTests extends AbstractQueryTestCase<SpanWithinQueryBuilder> {
@Override
protected SpanWithinQueryBuilder doCreateTestQueryBuilder() {
SpanTermQueryBuilder[] spanTermQueries = new SpanTermQueryBuilderTests().createSpanTermQueryBuilders(2);
return new SpanWithinQueryBuilder(spanTermQueries[0], spanTermQueries[1]);
}
@Override
protected void doAssertLuceneQuery(SpanWithinQueryBuilder queryBuilder, Query query, QueryShardContext context) throws IOException {
assertThat(query, instanceOf(SpanWithinQuery.class));
}
@Test
public void testIllegalArguments() {
try {
new SpanWithinQueryBuilder(null, SpanTermQueryBuilder.PROTOTYPE);
fail("cannot be null");
} catch (IllegalArgumentException e) {
// expected
}
try {
new SpanWithinQueryBuilder(SpanTermQueryBuilder.PROTOTYPE, null);
fail("cannot be null");
} catch (IllegalArgumentException e) {
// expected
}
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
e590431f452d477b6a7232079e2c8e3ee54e432d
|
1ba33872823155f476a6f7e0c7074d0aa2432431
|
/src/main/java/de/hshannover/f4/trust/irongui/communication/DumpImpl.java
|
44c3bf833abaccbb3c283d0d93f064ea6fa3e867
|
[
"Apache-2.0"
] |
permissive
|
trustathsh/irongui
|
15c7eafac686ed91b9a969ed5dc3c957a97333b0
|
7d48f795e2df5578bb364cd32c6048ebce49f5d9
|
refs/heads/master
| 2021-01-01T06:26:29.438446
| 2015-03-19T13:11:17
| 2015-03-19T13:11:17
| 9,518,232
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,239
|
java
|
/*
* #%L
* =====================================================
* _____ _ ____ _ _ _ _
* |_ _|_ __ _ _ ___| |_ / __ \| | | | ___ | | | |
* | | | '__| | | / __| __|/ / _` | |_| |/ __|| |_| |
* | | | | | |_| \__ \ |_| | (_| | _ |\__ \| _ |
* |_| |_| \__,_|___/\__|\ \__,_|_| |_||___/|_| |_|
* \____/
*
* =====================================================
*
* Hochschule Hannover
* (University of Applied Sciences and Arts, Hannover)
* Faculty IV, Dept. of Computer Science
* Ricklinger Stadtweg 118, 30459 Hannover, Germany
*
* Email: trust@f4-i.fh-hannover.de
* Website: http://trust.f4.hs-hannover.de/
*
* This file is part of irongui, version 0.4.8,
* implemented by the Trust@HsH research group at the Hochschule Hannover.
* %%
* Copyright (C) 2010 - 2015 Trust@HsH
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
package de.hshannover.f4.trust.irongui.communication;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import util.DomHelpers;
import de.hshannover.f4.trust.ifmapj.exception.IfmapErrorResult;
import de.hshannover.f4.trust.ifmapj.exception.MarshalException;
import de.hshannover.f4.trust.ifmapj.exception.UnmarshalException;
import de.hshannover.f4.trust.ifmapj.identifier.Identifier;
import de.hshannover.f4.trust.ifmapj.identifier.Identifiers;
import de.hshannover.f4.trust.ifmapj.messages.Request;
import de.hshannover.f4.trust.ifmapj.messages.RequestHandler;
import de.hshannover.f4.trust.ifmapj.messages.RequestImpl;
import de.hshannover.f4.trust.ifmapj.messages.Requests.Helpers;
import de.hshannover.f4.trust.ifmapj.messages.Result;
class DumpRequestHandler implements RequestHandler<DumpRequest> {
DumpRequestHandler() {
}
public static final String DUMP_REQ_EL_NAME = "dump";
public static final String DUMP_REQ_IDENT_FILTER = "identifier";
public static final String DUMP_RES_EL_NAME = "dumpResult";
public static final String DUMP_RES_LAST_UPDATE_ATTRIB = "last-update";
@Override
public Element toElement(Request req, Document doc) throws MarshalException {
Helpers.checkRequestType(req, this);
String identFilter = ((DumpRequest) req).getIdentifierFilter();
Element ret = doc.createElementNS(Helpers.baseNsUri(),
DomHelpers.makeRequestFqName(DUMP_REQ_EL_NAME));
if (identFilter != null) {
DomHelpers.addAttribute(ret, DUMP_REQ_IDENT_FILTER, identFilter);
}
Helpers.addSessionId(ret, req);
return ret;
}
@Override
public Result fromElement(Element res) throws UnmarshalException,
IfmapErrorResult {
Element content = Helpers.getResponseContentErrorCheck(res);
Attr lastUpdateNode = null;
String lastUpdate = null;
List<Element> children;
List<Identifier> resIdents = new ArrayList<Identifier>();
if (!DomHelpers.elementMatches(content, DUMP_RES_EL_NAME)) {
throw new UnmarshalException("No dumpResult element found");
}
lastUpdateNode = content.getAttributeNode(DUMP_RES_LAST_UPDATE_ATTRIB);
if (lastUpdateNode == null) {
throw new UnmarshalException("No " + DUMP_RES_LAST_UPDATE_ATTRIB
+ " attribute in " + DUMP_RES_EL_NAME + " element found");
}
lastUpdate = content.getAttribute(DUMP_RES_LAST_UPDATE_ATTRIB);
children = DomHelpers.getChildElements(content);
for (Element child : children)
resIdents.add((Identifiers.fromElement(child)));
return new DumpResultImpl(lastUpdate, resIdents);
}
@Override
public Class<DumpRequest> handles() {
return DumpRequest.class;
}
}
class DumpRequestImpl extends RequestImpl implements DumpRequest {
private String mIdentifierFilter;
DumpRequestImpl(String identFilter) {
mIdentifierFilter = identFilter;
}
DumpRequestImpl() {
this(null);
}
@Override
public void setIdentifierFilter(String filter) {
mIdentifierFilter = filter;
}
@Override
public String getIdentifierFilter() {
return mIdentifierFilter;
}
}
class DumpResultImpl implements DumpResult {
private final String mLastUpdate;
private final Collection<Identifier> mIdentifiers;
DumpResultImpl(String lastUpdate, Collection<Identifier> identifiers) {
if (identifiers == null) {
throw new NullPointerException("identifiers list is null");
}
if (lastUpdate == null) {
throw new NullPointerException("lastUpdate is null");
}
mLastUpdate = lastUpdate;
mIdentifiers = identifiers;
}
@Override
public String getLastUpdate() {
return mLastUpdate;
}
@Override
public Collection<Identifier> getIdentifiers() {
return Collections.unmodifiableCollection(mIdentifiers);
}
}
|
[
"bahellma@googlemail.com"
] |
bahellma@googlemail.com
|
45b4d95d9e98b59932c5d6ff216d78c9ea0052f0
|
2173d136de981d7a581e4970f4dc7313750b2b22
|
/tfkc_shop/src/com/koala/view/web/action/ActivityViewAction.java
|
cce8db8fc81e300b92dc0b5d8a228cad9f1cccf6
|
[] |
no_license
|
yunwow/lyRespository
|
b26a6c488f8aec382c2d419dacf99cfba1ece271
|
8e472b1350914c488a268bc5c7e8756e093a5743
|
refs/heads/master
| 2021-10-24T04:52:56.530018
| 2019-03-22T02:51:21
| 2019-03-22T02:51:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,999
|
java
|
package com.koala.view.web.action;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.koala.core.domain.virtual.SysMap;
import com.koala.core.mv.JModelAndView;
import com.koala.core.query.support.IPageList;
import com.koala.core.security.support.SecurityUserHolder;
import com.koala.core.tools.CommUtil;
import com.koala.foundation.domain.Activity;
import com.koala.foundation.domain.BuyGift;
import com.koala.foundation.domain.EnoughReduce;
import com.koala.foundation.domain.User;
import com.koala.foundation.domain.query.ActivityGoodsQueryObject;
import com.koala.foundation.domain.query.GoodsQueryObject;
import com.koala.foundation.service.IActivityGoodsService;
import com.koala.foundation.service.IActivityService;
import com.koala.foundation.service.IBuyGiftService;
import com.koala.foundation.service.IEnoughReduceService;
import com.koala.foundation.service.IGoodsService;
import com.koala.foundation.service.ISysConfigService;
import com.koala.foundation.service.IUserConfigService;
import com.koala.foundation.service.IUserService;
import com.koala.view.web.tools.ActivityViewTools;
/**
*
* <p>
* Title: ActivityViewAction.java
* </p>
*
* <p>
* Description:商城活动前台管理控制控制器
* </p>
*
* <p>
* Copyright: Copyright (c) 2015
* </p>
*
* <p>
* Company: 沈阳网之商科技有限公司 www.koala.com
* </p>
*
* @author erikzhang
*
* @date 2014-9-24
*
* @version koala_b2b2c 2015
*/
@Controller
public class ActivityViewAction {
@Autowired
private ISysConfigService configService;
@Autowired
private IUserConfigService userConfigService;
@Autowired
private IActivityService activityService;
@Autowired
private IActivityGoodsService activityGoodsService;
@Autowired
private ActivityViewTools activityViewTools;
@Autowired
private IBuyGiftService buyGiftService;
@Autowired
private IEnoughReduceService enoughReduceService;
@Autowired
private IGoodsService goodsService;
@Autowired
private IUserService userService;
@RequestMapping("/activity/index.htm")
public ModelAndView activity(HttpServletRequest request,
HttpServletResponse response, String id, String currentPage) {
ModelAndView mv = new JModelAndView("activity.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request, response);
Map params = new HashMap();
params.put("ac_begin_time", new Date());
params.put("ac_end_time", new Date());
params.put("ac_status", 1);
List<Activity> acts = this.activityService
.query("select obj from Activity obj where obj.ac_status=:ac_status and obj.ac_begin_time<=:ac_begin_time and obj.ac_end_time>=:ac_end_time",
params, -1, -1);
if (acts.size()>0) {
if (id == null) {
id = CommUtil.null2String(acts.get(0).getId());
mv.addObject("op", "true");
}
Activity act = this.activityService.getObjById(CommUtil.null2Long(id));
if (act != null) {
if (act.getAc_status() == 1) {
ActivityGoodsQueryObject qo = new ActivityGoodsQueryObject(
currentPage, mv, "addTime", "desc");
qo.setPageSize(20);
qo.addQuery("obj.ag_status", new SysMap("ag_status", 1), "=");// 审核是否通过
qo.addQuery("obj.act.id", new SysMap("act_id", act.getId()),
"=");
qo.addQuery("obj.ag_goods.goods_status", new SysMap(
"goods_status", 0), "=");// 商品状态为上架
IPageList pList = this.activityGoodsService.list(qo);
CommUtil.saveIPageList2ModelAndView("", "", "", pList, mv);
mv.addObject("act", act);
mv.addObject("activityViewTools", activityViewTools);
} else {
mv = new JModelAndView("error.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request,
response);
mv.addObject("op_title", "活动尚未开启");
mv.addObject("url", CommUtil.getURL(request) + "/index.htm");
return mv;
}
}else{
mv = new JModelAndView("error.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request,
response);
mv.addObject("op_title", "参数错误,活动查看失败");
mv.addObject("url", CommUtil.getURL(request) + "/index.htm");
return mv;
}
mv.addObject("acts", acts);
}else{
mv = new JModelAndView("error.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request,
response);
mv.addObject("op_title", "系统未开启任何商城活动");
mv.addObject("url", CommUtil.getURL(request) + "/index.htm");
return mv;
}
return mv;
}
@RequestMapping("/buygift/index.htm")
public ModelAndView buygift(HttpServletRequest request,
HttpServletResponse response, String id, String currentPage) {
ModelAndView mv = new JModelAndView("buygift.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request, response);
BuyGift bg = this.buyGiftService.getObjById(CommUtil.null2Long(id));
if (bg != null) {
if (bg.getGift_status() == 10) {
mv.addObject("obj", bg);
} else {
mv = new JModelAndView("error.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request,
response);
mv.addObject("op_title", "参数错误,活动查看失败");
mv.addObject("url", CommUtil.getURL(request) + "/index.htm");
return mv;
}
} else {
mv = new JModelAndView("error.html", configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request,
response);
mv.addObject("op_title", "参数错误,活动查看失败");
mv.addObject("url", CommUtil.getURL(request) + "/index.htm");
return mv;
}
return mv;
}
@RequestMapping("/enoughreduce/index.htm")
public ModelAndView enoughreduce(HttpServletRequest request,
HttpServletResponse response, String id, String currentPage) {
ModelAndView mv = new JModelAndView("enoughreduceview.html",
configService.getSysConfig(),
this.userConfigService.getUserConfig(), 1, request, response);
User user = SecurityUserHolder.getCurrentUser();
EnoughReduce er = this.enoughReduceService.getObjById(CommUtil
.null2Long(id));
if (er == null || er.getErstatus() != 10) {
return null;
}
GoodsQueryObject qo = new GoodsQueryObject(currentPage, mv, null, null);
qo.addQuery("obj.order_enough_reduce_id", new SysMap(
"order_enough_reduce_id", id), "=");
qo.setPageSize(20);
IPageList pList = this.goodsService.list(qo);
CommUtil.saveIPageList2ModelAndView("", "", "", pList, mv);
mv.addObject("currentPage", currentPage);
mv.addObject("user", user);
mv.addObject("er", er);
return mv;
}
}
|
[
"67857020@qq.com"
] |
67857020@qq.com
|
38a6ec68a6aea9c018367e76f81ca3a876cd8e06
|
7dbc40ea98d17fdc2180563c2ffd8b25504714b3
|
/com/github/lunatrius/schematica/block/state/pattern/BlockStateReplacer.java
|
12497fb490365775c2766ffa7c744f12654f8f9e
|
[] |
no_license
|
WarriorCrystal/Zenith-0.7-src
|
c144e3548f7ae1542df2ce6a29de864aec25b87d
|
34fd7a76d0e1b59518c813da6f5dd339a0425d58
|
refs/heads/main
| 2023-01-21T04:42:58.249921
| 2020-11-29T21:37:31
| 2020-11-29T21:37:31
| 317,043,706
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,641
|
java
|
//Deobfuscated with https://github.com/PetoPetko/Minecraft-Deobfuscator3000 using mappings "1.12 stable mappings"!
//
// Decompiled by Procyon v0.5.36
//
package com.github.lunatrius.schematica.block.state.pattern;
import java.util.Collection;
import java.util.HashMap;
import com.github.lunatrius.core.exceptions.LocalizedException;
import net.minecraft.block.Block;
import net.minecraft.util.ResourceLocation;
import com.google.common.base.Predicate;
import net.minecraft.block.state.pattern.BlockStateMatcher;
import java.util.Iterator;
import net.minecraft.block.properties.IProperty;
import java.util.Map;
import net.minecraft.block.state.IBlockState;
public class BlockStateReplacer
{
private final IBlockState defaultReplacement;
private BlockStateReplacer(final IBlockState defaultReplacement) {
this.defaultReplacement = defaultReplacement;
}
public IBlockState getReplacement(final IBlockState original, final Map<IProperty, Comparable> properties) {
IBlockState replacement = this.defaultReplacement;
replacement = this.applyProperties(replacement, (Map<IProperty, Comparable>)original.getProperties());
replacement = this.applyProperties(replacement, properties);
return replacement;
}
private <K extends IProperty, V extends Comparable> IBlockState applyProperties(IBlockState blockState, final Map<K, V> properties) {
for (final Map.Entry<K, V> entry : properties.entrySet()) {
try {
blockState = blockState.withProperty((IProperty)entry.getKey(), (Comparable)entry.getValue());
}
catch (IllegalArgumentException ex) {}
}
return blockState;
}
public static BlockStateReplacer forBlockState(final IBlockState replacement) {
return new BlockStateReplacer(replacement);
}
public static BlockStateMatcher getMatcher(final BlockStateInfo blockStateInfo) {
final BlockStateMatcher matcher = BlockStateMatcher.forBlock(blockStateInfo.block);
for (final Map.Entry<IProperty, Comparable> entry : blockStateInfo.stateData.entrySet()) {
matcher.where((IProperty)entry.getKey(), (Predicate)new Predicate<Comparable>() {
public boolean apply(final Comparable input) {
return input != null && input.equals(entry.getValue());
}
});
}
return matcher;
}
public static BlockStateInfo fromString(final String input) throws LocalizedException {
final int start = input.indexOf(91);
final int end = input.indexOf(93);
String blockName;
String stateData;
if (start > -1 && end > -1) {
blockName = input.substring(0, start);
stateData = input.substring(start + 1, end);
}
else {
blockName = input;
stateData = "";
}
final ResourceLocation location = new ResourceLocation(blockName);
if (!Block.REGISTRY.containsKey((Object)location)) {
throw new LocalizedException("schematica.message.invalidBlock", new Object[] { blockName });
}
final Block block = (Block)Block.REGISTRY.getObject((Object)location);
final Map<IProperty, Comparable> propertyData = parsePropertyData(block.getDefaultState(), stateData, true);
return new BlockStateInfo(block, propertyData);
}
public static Map<IProperty, Comparable> parsePropertyData(final IBlockState blockState, final String stateData, final boolean strict) throws LocalizedException {
final HashMap<IProperty, Comparable> map = new HashMap<IProperty, Comparable>();
if (stateData == null || stateData.length() == 0) {
return map;
}
final String[] split2;
final String[] propertyPairs = split2 = stateData.split(",");
for (final String propertyPair : split2) {
final String[] split = propertyPair.split("=");
if (split.length != 2) {
throw new LocalizedException("schematica.message.invalidProperty", new Object[] { propertyPair });
}
putMatchingProperty(map, blockState, split[0], split[1], strict);
}
return map;
}
private static boolean putMatchingProperty(final Map<IProperty, Comparable> map, final IBlockState blockState, final String name, final String value, final boolean strict) throws LocalizedException {
for (final IProperty property : blockState.getPropertyKeys()) {
if (property.getName().equalsIgnoreCase(name)) {
final Collection<Comparable> allowedValues = (Collection<Comparable>)property.getAllowedValues();
for (final Comparable allowedValue : allowedValues) {
if (String.valueOf(allowedValue).equalsIgnoreCase(value)) {
map.put(property, allowedValue);
return true;
}
}
}
}
if (strict) {
throw new LocalizedException("schematica.message.invalidPropertyForBlock", new Object[] { name + "=" + value, Block.REGISTRY.getNameForObject((Object)blockState.getBlock()) });
}
return false;
}
public static class BlockStateInfo
{
public final Block block;
public final Map<IProperty, Comparable> stateData;
public BlockStateInfo(final Block block, final Map<IProperty, Comparable> stateData) {
this.block = block;
this.stateData = stateData;
}
}
}
|
[
"68621329+Warrior80@users.noreply.github.com"
] |
68621329+Warrior80@users.noreply.github.com
|
d93f20609302b13cf746a2c8bb87caa3a5762f72
|
f4579585211b7f52dc4b74d8468b3100a190c122
|
/src/main/java/me/darki/konas/unremaped/Class413.java
|
c3f49358f0bf281dde3b90a54adbd463500128ff
|
[] |
no_license
|
xDd01/Konas-Deobf-Remap
|
26010da334ec671d6aeaf58c006f71c5f1e0a0a3
|
110d9a50572a6a5a138c1a53edf23d7634eff8a3
|
refs/heads/main
| 2023-08-27T10:49:57.851470
| 2021-11-06T23:32:58
| 2021-11-06T23:32:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 474
|
java
|
package me.darki.konas.unremaped;
import me.darki.konas.*;
import net.minecraft.util.math.BlockPos;
public class Class413 {
public BlockPos Field1087;
public BlockPos Field1088;
public Class413(BlockPos blockPos, BlockPos blockPos2) {
this.Field1087 = blockPos;
this.Field1088 = blockPos2;
}
public BlockPos Method1123() {
return this.Field1087;
}
public BlockPos Method1124() {
return this.Field1088;
}
}
|
[
"63124240+Gopro336@users.noreply.github.com"
] |
63124240+Gopro336@users.noreply.github.com
|
874d34e3be5670ad6c7dcc0dbe8ee882e388dd0c
|
f64fa51d2079cce2cad65e0e989c818f761d5a5b
|
/skWeiChatBaidu/src/main/java/com/sk/weichat/view/TabView.java
|
579d0c6a13366ec0503855831b63a7353ae84980
|
[] |
no_license
|
im8s/HongGuan
|
c7bf4963cafa2505f4105d43dc943a4de9831b51
|
c4d508719a8d07ac6a72ea42a76b7136c5af6af9
|
refs/heads/master
| 2023-02-22T23:08:02.580290
| 2021-01-25T11:03:22
| 2021-01-25T11:03:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,927
|
java
|
package com.sk.weichat.view;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.sk.weichat.ui.tool.ButtonColorChange;
import com.yujianni.app.R;
public class TabView implements View.OnClickListener {
private Context mContext;
private View mView;
private TextView attention_each_tv;
private TextView attention_single_tv;
private boolean isfriend;
private int index = 0;
private OnTabSelectedLisenter onTabSelectedLisenter;
public TabView(Context context) {
mContext = context;
initView();
}
public TabView(Context context, boolean isnotgroup) {
mContext = context;
isfriend = isnotgroup;
initView();
}
public TextView getAttention_each_tv() {
return attention_each_tv;
}
public TextView getAttention_single_tv() {
return attention_single_tv;
}
private void initView() {
mView = LayoutInflater.from(mContext).inflate(R.layout.actionbar_tag_second, null);
View view1 = findviewbyid(R.id.tag1);
// view1.setBackgroundColor(SkinUtils.getSkin(mContext).getAccentColor());
View view2 = findviewbyid(R.id.tag2);
// view2.setBackgroundColor(SkinUtils.getSkin(mContext).getAccentColor());
attention_each_tv = findviewbyid(R.id.attention_each_tv);
attention_single_tv = findviewbyid(R.id.attention_single_tv);
if (isfriend) {
attention_each_tv.setText(getString(R.string.bisniss));
attention_single_tv.setText(getString(R.string.black_list_all));
} else {
attention_each_tv.setText(getString(R.string.my_group));
attention_single_tv.setText(getString(R.string.all_group));
}
attention_each_tv.setOnClickListener(this);
attention_single_tv.setOnClickListener(this);
hideViewByTag(1);
showViewByTag(0);
}
public View getView() {
return mView;
}
@Override
public void onClick(View v) {
int beforeIndex = index;
switch (v.getId()) {
case R.id.attention_each_tv:
index = 0;
break;
case R.id.attention_single_tv:
index = 1;
break;
}
if (beforeIndex == index)
return;
hideViewByTag(index == 0 ? 1 : 0);
showViewByTag(index);
onTabSelectedLisenter.onSelected(index);
}
public void callOnSelect(int index) {
View view;
switch (index) {
case 0:
view = findviewbyid(R.id.attention_each_tv);
break;
case 1:
view = findviewbyid(R.id.attention_single_tv);
break;
default:
view = findviewbyid(R.id.attention_each_tv);
}
onClick(view);
}
public void setOnTabSelectedLisenter(OnTabSelectedLisenter onTabSelectedLisenter) {
this.onTabSelectedLisenter = onTabSelectedLisenter;
}
public <T> T findviewbyid(int id) {
return (T) mView.findViewById(id);
}
public String getString(int rid) {
return mContext.getResources().getString(rid);
}
public void hideViewByTag(int tag) {
if (tag == 0) {
getAttention_each_tv().setTextColor(mContext.getResources().getColor(R.color.text_color));
} else {
getAttention_single_tv().setTextColor(mContext.getResources().getColor(R.color.text_color));
}
}
public void showViewByTag(int tag) {
if (tag == 0) {
ButtonColorChange.textChange(mContext, getAttention_each_tv());
} else {
ButtonColorChange.textChange(mContext, getAttention_single_tv());
}
}
public interface OnTabSelectedLisenter {
void onSelected(int index);
}
}
|
[
"895977304@qq.com"
] |
895977304@qq.com
|
07e6f4e1c2fdcc3a553d2b3443a969a378bb2853
|
2169cc3278abb69154ecdf54bb29b6570f312946
|
/src/main/java/sobow/brick/breaker/services/ScoreService.java
|
5cdd1832e8e27e7b26b15fc5e3534da38238a676
|
[] |
no_license
|
psobow/brick-breaker
|
528bd47c6c4a0faaa2bc02ecc11c7b46a94df018
|
9cfc570bee686c9bd1cb1ab46c9e406aec1d7564
|
refs/heads/master
| 2020-06-15T13:39:05.633095
| 2019-07-18T15:59:55
| 2019-07-18T15:59:55
| 195,315,065
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 360
|
java
|
package sobow.brick.breaker.services;
public class ScoreService
{
private static int playerScore = 0;
private ScoreService() {}
public static void reset()
{
playerScore = 0;
}
public static void incrementScore()
{
playerScore++;
}
public static int getScore()
{
return playerScore;
}
}
|
[
"patryk.sobow95@gmail.com"
] |
patryk.sobow95@gmail.com
|
df6b28fd4a437f3b0bd0a979c41b6e8188613d40
|
5f82aae041ab05a5e6c3d9ddd8319506191ab055
|
/Projects/Mockito/27/src/org/mockito/stubbing/OngoingStubbing.java
|
757aff2fe6a85aff6a9a9f7b1f14a8b212d016ec
|
[
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] |
permissive
|
lingming/prapr_data
|
e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc
|
be9ababc95df45fd66574c6af01122ed9df3db5d
|
refs/heads/master
| 2023-08-14T20:36:23.459190
| 2021-10-17T13:49:39
| 2021-10-17T13:49:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,813
|
java
|
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.stubbing;
import org.mockito.Mockito;
import org.mockito.internal.progress.IOngoingStubbing;
/**
* Simply put: "<b>When</b> the x method is called <b>then</b> return y". E.g:
*
* <pre>
* <b>when</b>(mock.someMethod()).<b>thenReturn</b>(10);
*
* //you can use flexible argument matchers, e.g:
* when(mock.someMethod(<b>anyString()</b>)).thenReturn(10);
*
* //setting exception to be thrown:
* when(mock.someMethod("some arg")).thenThrow(new RuntimeException());
*
* //you can set different behavior for consecutive method calls.
* //Last stubbing (e.g: thenReturn("foo")) determines the behavior of further consecutive calls.
* when(mock.someMethod("some arg"))
* .thenThrow(new RuntimeException())
* .thenReturn("foo");
*
* //There is a shorter way of consecutive stubbing:
* when(mock.someMethod()).thenReturn(1,2,3);
* when(mock.otherMethod()).thenThrow(exc1, exc2);
* </pre>
*
* See examples in javadoc for {@link Mockito#when}
*/
public interface OngoingStubbing<T> extends IOngoingStubbing {
/**
* Sets a return value to be returned when the method is called. E.g:
* <pre>
* when(mock.someMethod()).thenReturn(10);
* </pre>
*
* See examples in javadoc for {@link Mockito#when}
*
* @param value return value
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenReturn(T value);
/**
* Sets consecutive return values to be returned when the method is called. E.g:
* <pre>
* when(mock.someMethod()).thenReturn(1, 2, 3);
* </pre>
*
* Last return value in the sequence (in example: 3) determines the behavior of further consecutive calls.
* <p>
* See examples in javadoc for {@link Mockito#when}
*
* @param value first return value
* @param values next return values
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenReturn(T value, T... values);
/**
* Sets Throwable objects to be thrown when the method is called. E.g:
* <pre>
* when(mock.someMethod()).thenThrow(new RuntimeException());
* </pre>
*
* If throwables contain a checked exception then it has to
* match one of the checked exceptions of method signature.
* <p>
* You can specify throwables to be thrown for consecutive calls.
* In that case the last throwable determines the behavior of further consecutive calls.
* <p>
* if throwable is null then exception will be thrown.
* <p>
* See examples in javadoc for {@link Mockito#when}
*
* @param throwables to be thrown on method invocation
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenThrow(Throwable... throwables);
/**
* Sets Throwable classes to be thrown when the method is called. E.g:
* <pre>
* when(mock.someMethod()).thenThrow(RuntimeException.class);
* </pre>
*
* <p>
* Each throwable class will be instantiated for each method invocation.
* <p>
* If throwableClasses contain a checked exception then it has to
* match one of the checked exceptions of method signature.
* <p>
* You can specify throwableClasses to be thrown for consecutive calls.
* In that case the last throwable determines the behavior of further consecutive calls.
* <p>
* if throwable is null then exception will be thrown.
* <p>
* See examples in javadoc for {@link Mockito#when}
*
* @param throwableClasses to be thrown on method invocation
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenThrow(Class<? extends Throwable>... throwableClasses);
/**
* Sets the real implementation to be called when the method is called on a mock object.
* <p>
* As usual you are going to read <b>the partial mock warning</b>:
* Object oriented programming is more less tackling complexity by dividing the complexity into separate, specific, SRPy objects.
* How does partial mock fit into this paradigm? Well, it just doesn't...
* Partial mock usually means that the complexity has been moved to a different method on the same object.
* In most cases, this is not the way you want to design your application.
* <p>
* However, there are rare cases when partial mocks come handy:
* dealing with code you cannot change easily (3rd party interfaces, interim refactoring of legacy code etc.)
* However, I wouldn't use partial mocks for new, test-driven & well-designed code.
* <pre>
* // someMethod() must be safe (e.g. doesn't throw, doesn't have dependencies to the object state, etc.)
* // if it isn't safe then you will have trouble stubbing it using this api. Use Mockito.doCallRealMethod() instead.
* when(mock.someMethod()).thenCallRealMethod();
*
* // calls real method:
* mock.someMethod();
*
* </pre>
* See also javadoc {@link Mockito#spy(Object)} to find out more about partial mocks.
* <b>Mockito.spy() is a recommended way of creating partial mocks.</b>
* The reason is it guarantees real methods are called against correctly constructed object because you're responsible for constructing the object passed to spy() method.
* <p>
* See examples in javadoc for {@link Mockito#when}
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenCallRealMethod();
/**
* Sets a generic Answer for the method. E.g:
* <pre>
* when(mock.someMethod(10)).thenAnswer(new Answer<Integer>() {
* public Integer answer(InvocationOnMock invocation) throws Throwable {
* return (Integer) invocation.getArguments()[0];
* }
* }
* </pre>
*
* @param answer the custom answer to execute.
*
* @return iOngoingStubbing object that allows stubbing consecutive calls
*/
OngoingStubbing<T> thenAnswer(Answer<?> answer);
/**
* Sets a generic Answer for the method.
*
* This method is an alias of {@link #thenAnswer(Answer)}. This alias allows
* more readable tests on occasion, for example:
* <pre>
* //using 'then' alias:
* when(mock.foo()).then(returnCoolValue());
*
* //versus good old 'thenAnswer:
* when(mock.foo()).thenAnswer(byReturningCoolValue());
* </pre>
*
* @param answer the custom answer to execute.
* @return iOngoingStubbing object that allows stubbing consecutive calls
*
* @see #thenAnswer(Answer)
*/
OngoingStubbing<T> then(Answer<?> answer);
/**
* Returns the mock that was used for this stub.
* <p>
* It allows to create a stub in one line of code.
* This can be helpful to keep test code clean.
* For example, some boring stub can be created & stubbed at field initialization in a test:
* <pre>
* public class CarTest {
* Car boringStubbedCar = when(mock(Car.class).shiftGear()).thenThrow(EngineNotStarted.class).getMock();
*
* @Test public void should... {}
* </pre>
*
* @param <M> The mock type given by the variable type.
* @return Mock used in this ongoing stubbing.
*/
<M> M getMock();
}
|
[
"2890268106@qq.com"
] |
2890268106@qq.com
|
97bc45ad0661a4ca369bd57b5acb63b5d604b635
|
ed607eb2b36cd63ddb8ea1950703f90dfbbc13e8
|
/JavaRXDemo/opensdk/src/main/java/com/chinaums/opensdk/weex/AppletManager.java
|
ba7dcd43f6cd3db2e085d4fad6a5c64380f7b581
|
[] |
no_license
|
reyhoo/collection
|
29ab53e6105e3dc4cb3b0d2a0ba56a509cfbc1ab
|
5cc0ab1b0596fd7eefb0bf755525c1cc4b8d1579
|
refs/heads/master
| 2020-07-08T20:49:12.018422
| 2017-10-23T09:28:01
| 2017-10-23T09:28:01
| 67,034,220
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,415
|
java
|
package com.chinaums.opensdk.weex;
import android.content.Context;
import android.content.SharedPreferences;
import com.chinaums.opensdk.OpenSdkApplication;
import com.chinaums.opensdk.manager.IOpenManager;
import com.chinaums.opensdk.util.UmsLog;
import com.chinaums.opensdk.weex.adapter.DefaultWebSocketAdapterFactory;
import com.chinaums.opensdk.weex.adapter.ImageAdapter;
import com.chinaums.opensdk.weex.adapter.JSExceptionAdapter;
import com.chinaums.opensdk.weex.adapter.PlayDebugAdapter;
import com.chinaums.opensdk.weex.module.UmsAccelerometerModule;
import com.chinaums.opensdk.weex.module.UmsAnimationModule;
import com.chinaums.opensdk.weex.module.UmsBatteryModule;
import com.chinaums.opensdk.weex.module.UmsCameraModule;
import com.chinaums.opensdk.weex.module.UmsClipboardModule;
import com.chinaums.opensdk.weex.module.UmsCompassModule;
import com.chinaums.opensdk.weex.module.UmsDeviceModule;
import com.chinaums.opensdk.weex.module.UmsFileModule;
import com.chinaums.opensdk.weex.module.UmsGeolocationModule;
import com.chinaums.opensdk.weex.module.UmsGlobalEventModule;
import com.chinaums.opensdk.weex.module.UmsInstanceWrap;
import com.chinaums.opensdk.weex.module.UmsMediaModule;
import com.chinaums.opensdk.weex.module.UmsMetaModule;
import com.chinaums.opensdk.weex.module.UmsModalUIModule;
import com.chinaums.opensdk.weex.module.UmsNavigatorModule;
import com.chinaums.opensdk.weex.module.UmsNetworkModule;
import com.chinaums.opensdk.weex.module.UmsPickersModule;
import com.chinaums.opensdk.weex.module.UmsRecorderModule;
import com.chinaums.opensdk.weex.module.UmsScreenModule;
import com.chinaums.opensdk.weex.module.UmsStorageModule;
import com.chinaums.opensdk.weex.module.UmsTimerModule;
import com.chinaums.opensdk.weex.module.UmsVibrationModule;
import com.chinaums.opensdk.weex.module.UmsVolumeModule;
import com.chinaums.opensdk.weex.module.UmsWebSocketModule;
import com.chinaums.opensdk.weex.module.UmsWebViewModule;
import com.chinaums.opensdk.weex.module.sqlite.UmsSQLiteModule;
import com.chinaums.opensdk.weex.module.stream.UmsStreamModule;
import com.taobao.weex.InitConfig;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.common.WXException;
import com.taobao.weex.common.WXModule;
public class AppletManager implements IOpenManager {
/**
* 单例
*/
private static AppletManager instance = new AppletManager();
/**
* context
*/
private Context context;
public static AppletManager getInstance() {
return instance;
}
@Override
public void init(Context context) {
if (context == null) {
return;
}
this.context = context;
ExecutorManager.getInstance().init(context);
initWeex();
UmsLog.d("AppletManager init success!");
}
@Override
public void destroy() {
SharedPreferences sp = context.getSharedPreferences("cookie", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.clear();
editor.commit();
ExecutorManager.getInstance().destroy();
UmsLog.d("AppletManager destory success!");
}
private void initWeex() {
WXSDKEngine.initialize(OpenSdkApplication.getInstance(),
new InitConfig.Builder()
.setImgAdapter(new ImageAdapter())
.setDebugAdapter(new PlayDebugAdapter())
.setWebSocketAdapterFactory(new DefaultWebSocketAdapterFactory())
.setJSExceptionAdapter(new JSExceptionAdapter())
.build()
);
registerModule("ums_animation", UmsAnimationModule.class);
registerModule("ums_clipboard", UmsClipboardModule.class);
registerModule("ums_globalEvent", UmsGlobalEventModule.class);
registerModule("ums_instanceWrap", UmsInstanceWrap.class);
registerModule("ums_meta", UmsMetaModule.class);
registerModule("ums_modal", UmsModalUIModule.class, false);
registerModule("ums_navigator", UmsNavigatorModule.class);
registerModule("ums_picker", UmsPickersModule.class);
registerModule("ums_storage", UmsStorageModule.class);
registerModule("ums_stream", UmsStreamModule.class);
registerModule("ums_timer", UmsTimerModule.class, false);
registerModule("ums_webSocket", UmsWebSocketModule.class);
registerModule("ums_webView", UmsWebViewModule.class);
registerModule("ums_device", UmsDeviceModule.class);
registerModule("ums_location", UmsGeolocationModule.class);
registerModule("ums_battery", UmsBatteryModule.class);
registerModule("ums_volume", UmsVolumeModule.class);
registerModule("ums_vibrate", UmsVibrationModule.class);
registerModule("ums_netstatus", UmsNetworkModule.class);
registerModule("ums_compass", UmsCompassModule.class);
registerModule("ums_accelerometer", UmsAccelerometerModule.class);
registerModule("ums_recorder", UmsRecorderModule.class);
registerModule("ums_screen", UmsScreenModule.class);
registerModule("ums_file", UmsFileModule.class);
registerModule("ums_camera", UmsCameraModule.class);
registerModule("ums_media", UmsMediaModule.class);
registerModule("ums_sqlite", UmsSQLiteModule.class);
}
/**
* @param moduleName 模块名称
* @param moduleClass Class 用于生成实例
* @return 是否注册成功
* @Created at 2017/6/9
* @Developer Jiangbo
* @Version 1.0
* @Description 注册Weex模块
*/
public boolean registerModule(String moduleName, Class<? extends WXModule> moduleClass) {
return registerModule(moduleName, moduleClass, false);
}
/**
* @param moduleName 模块名称
* @param moduleClass Class 用于生成实例
* @param global 是否注册时生成实例(建议填写false)
* @return 是否注册成功
* @Created at 2017/6/9
* @Developer Jiangbo
* @Version 1.0
* @Description 注册Weex模块
*/
public boolean registerModule(String moduleName, Class<? extends WXModule> moduleClass, boolean global) {
try {
return WXSDKEngine.registerModule(moduleName, moduleClass, global);
} catch (WXException e) {
e.printStackTrace();
return false;
}
}
}
|
[
"373561022@qq.com"
] |
373561022@qq.com
|
cf75c919f24f39869cb208bfa8ddefaee3ba82bd
|
3fd464e4510ba66da66e7fa35a5f9f801898d893
|
/src/main/java/com/microMart/entity/Merchant.java
|
1f31cd65c528084989d22e160edd1b85f3250a1a
|
[] |
no_license
|
handongqingxue/MicroMart
|
9a8396e2fc6bf7dd81c765bdfb89a33353513703
|
fa738182cb41f6048e90bf5fbd46aa110cf00339
|
refs/heads/main
| 2023-05-12T01:02:48.904814
| 2021-06-05T02:24:08
| 2021-06-05T02:24:08
| 370,934,176
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,832
|
java
|
package com.microMart.entity;
public class Merchant {
private Integer id;
private String userName;
private String password;
private String nickName;
private String contactTel;
private String email;
private Integer role;
private String logo;
private String createTime;
private String shopName;
private String shopAddress;
public Merchant(String userName,String password) {
this.userName=userName;
this.password=password;
}
public Merchant() {
super();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getContactTel() {
return contactTel;
}
public void setContactTel(String contactTel) {
this.contactTel = contactTel;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getRole() {
return role;
}
public void setRole(Integer role) {
this.role = role;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getShopAddress() {
return shopAddress;
}
public void setShopAddress(String shopAddress) {
this.shopAddress = shopAddress;
}
}
|
[
"1417140290@qq.com"
] |
1417140290@qq.com
|
1c606e1fbc9f1a5b295d43b776e569db961b0b16
|
ce0a08692c51a465a19b0a7df6e4d311593a2d7a
|
/src/main/java/com/livinglogic/ul4/FunctionBin.java
|
69302deff050f8290ab352a6715e8634f5426183
|
[] |
no_license
|
mahmoudimus/LivingLogic.Java.ul4
|
54e8c5f034399cafba8d642fb9455ffffdf3864b
|
f0fa1ca5d4036cb684df68bbe10228afe74e08d3
|
refs/heads/master
| 2023-06-04T08:04:37.664780
| 2021-06-15T16:11:31
| 2021-06-15T16:11:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,504
|
java
|
/*
** Copyright 2009-2021 by LivingLogic AG, Bayreuth/Germany
** All Rights Reserved
** See LICENSE for the license
*/
package com.livinglogic.ul4;
import java.util.List;
import java.math.BigInteger;
public class FunctionBin extends Function
{
@Override
public String getNameUL4()
{
return "bin";
}
private static final Signature signature = new Signature().addPositionalOnly("number");
@Override
public Signature getSignature()
{
return signature;
}
@Override
public Object evaluate(BoundArguments args)
{
return call(args.get(0));
}
public static Object call(Object obj)
{
if (obj instanceof Integer || obj instanceof Byte || obj instanceof Short)
{
int value = ((Number)obj).intValue();
if (value < 0)
return "-0b" + Integer.toBinaryString(-value);
else
return "0b" + Integer.toBinaryString(value);
}
else if (obj instanceof Boolean)
{
return ((Boolean)obj).booleanValue() ? "0b1" : "0b0";
}
else if (obj instanceof Long)
{
long value = ((Long)obj).longValue();
if (value < 0)
return "-0b" + Long.toBinaryString(-value);
else
return "0b" + Long.toBinaryString(value);
}
else if (obj instanceof BigInteger)
{
BigInteger bi = (BigInteger)obj;
if (bi.signum() < 0)
{
return "-0b" + bi.toString(2).substring(1);
}
else
return "0b" + bi.toString(2);
}
throw new ArgumentTypeMismatchException("bin({!t}) not supported", obj);
}
public static final Function function = new FunctionBin();
}
|
[
"walter@livinglogic.de"
] |
walter@livinglogic.de
|
1427d6e1132711a7ef16059fe622bf05d728c98b
|
e4e6c2620ecab8b8f5797751267a31d3537a9c54
|
/app/src/main/java/com/shenkangyun/recoveryproject/BeanFolder/StreetBean.java
|
0dc062ca3cb944c660f45d9ca8b6d48f6d8fdd22
|
[] |
no_license
|
Galvatron0521/Recovery
|
2af61963d881432a0f60370956640e901c8c0006
|
cc23ee1e47141144f056b0bc06c0ce0fa454e162
|
refs/heads/master
| 2022-01-15T07:15:20.097347
| 2019-06-03T02:26:20
| 2019-06-03T02:26:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,029
|
java
|
package com.shenkangyun.recoveryproject.BeanFolder;
import java.util.List;
/**
* Created by Administrator on 2018/4/8.
*/
public class StreetBean {
/**
* status : 0
* data : {"list":[{"id":"370902001","name":"岱庙街道办事处","pid":"370902"},{"id":"370902002","name":"财源街道办事处","pid":"370902"},{"id":"370902003","name":"泰前街道办事处","pid":"370902"},{"id":"370902004","name":"上高街道办事处","pid":"370902"},{"id":"370902005","name":"徐家楼街道办事处","pid":"370902"},{"id":"370902100","name":"省庄镇","pid":"370902"},{"id":"370902101","name":"邱家店镇","pid":"370902"}]}
*/
private String status;
private DataBean data;
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
private List<ListBean> list;
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public static class ListBean {
/**
* id : 370902001
* name : 岱庙街道办事处
* pid : 370902
*/
private String id;
private String name;
private String pid;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
}
}
}
|
[
"18353847303@163.com"
] |
18353847303@163.com
|
74d869ddcf8c01f212aa03a85e5f7ea8a4b4fe86
|
67d0c4a542cc27bb10e0ceca1f07a9f478cc2317
|
/src/com/xjgc/wind/datastatistics/service/impl/MeastypeServiceImpl.java
|
841744eb3629c66ebaa6f0a474fb886e830ce15d
|
[] |
no_license
|
willingox/DWE8000-REPORT
|
6b8ed454a47e36004a5660438d7ed1a6eae27cbd
|
492a4aa34aff08dee468a6d2fc4a029dd2f704cf
|
refs/heads/master
| 2023-07-20T20:36:51.001871
| 2021-09-08T08:21:58
| 2021-09-08T08:21:58
| 404,266,299
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 653
|
java
|
package com.xjgc.wind.datastatistics.service.impl;
import java.math.BigDecimal;
import java.util.List;
import com.xjgc.wind.datastatistics.dao.IMeastypeDao;
import com.xjgc.wind.datastatistics.service.IMeastypeService;
import com.xjgc.wind.datastatistics.vo.DataStatisticsDataVo;
public class MeastypeServiceImpl implements IMeastypeService {
IMeastypeDao meastypeDao;
public IMeastypeDao getMeastypeDao() {
return meastypeDao;
}
public void setMeastypeDao(IMeastypeDao meastypeDao) {
this.meastypeDao = meastypeDao;
}
public List<DataStatisticsDataVo> list(Integer measclassId) {
return meastypeDao.list(measclassId);
}
}
|
[
"249497110@qq.com"
] |
249497110@qq.com
|
102e76b4732bba8fa37cf57bc70e8bd40d04bca5
|
da9b931be21d1f191aa062dfe47bc01fc9233c89
|
/implementation/fault-tolerance/src/main/java/io/smallrye/faulttolerance/DefaultAsyncExecutorProvider.java
|
9e6b79dbae16fdd6cad7af9cb7bca8f5a5b82155
|
[
"Apache-2.0"
] |
permissive
|
brunobat/smallrye-fault-tolerance
|
ece24b56d7ad40bbccb990b3ad439e9f938cc20d
|
009afb5483f63ec88545cf88ea7e7ce6440358f6
|
refs/heads/master
| 2023-01-07T13:27:00.255336
| 2022-07-07T11:29:01
| 2022-07-07T11:29:01
| 227,167,183
| 0
| 0
|
Apache-2.0
| 2022-12-29T13:12:16
| 2019-12-10T16:31:45
|
Java
|
UTF-8
|
Java
| false
| false
| 2,688
|
java
|
package io.smallrye.faulttolerance;
import java.util.OptionalInt;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.eclipse.microprofile.config.inject.ConfigProperty;
/**
* Default implementation of {@link AsyncExecutorProvider}.
* Manages its own thread pool.
* <p>
* If integrators don't want to manage the fault tolerance thread pool,
* yet still want to customize the thread factory, they can provide
* an {@code @Alternative} bean which inherits from this class.
*/
@Singleton
public class DefaultAsyncExecutorProvider implements AsyncExecutorProvider {
private final ExecutorService executor;
@Inject
public DefaultAsyncExecutorProvider(
@ConfigProperty(name = "io.smallrye.faulttolerance.mainThreadPoolSize") OptionalInt mainThreadPoolSize,
@ConfigProperty(name = "io.smallrye.faulttolerance.mainThreadPoolQueueSize") OptionalInt mainThreadPoolQueueSize,
@ConfigProperty(name = "io.smallrye.faulttolerance.globalThreadPoolSize") OptionalInt globalThreadPoolSize) {
int maxSize = mainThreadPoolSize.orElse(globalThreadPoolSize.orElse(100));
int queueSize = mainThreadPoolQueueSize.orElse(-1);
if (maxSize < 5) {
throw new IllegalArgumentException("The main thread pool size must be >= 5.");
}
if (queueSize < -1) {
throw new IllegalArgumentException("The main thread pool queue size must be -1, 0, or > 1");
}
BlockingQueue<Runnable> queue;
if (queueSize > 1) {
queue = new LinkedBlockingQueue<>(queueSize);
} else if (queueSize == 0) {
queue = new SynchronousQueue<>();
} else {
queue = new LinkedBlockingQueue<>();
}
ThreadPoolExecutor executor = new ThreadPoolExecutor(maxSize, maxSize, 1, TimeUnit.MINUTES, queue, threadFactory());
executor.allowCoreThreadTimeOut(true);
this.executor = executor;
}
@Override
public ExecutorService get() {
return executor;
}
/**
* Can be overridden in a subclass to provide a different {@link ThreadFactory}.
* Useful e.g. in a Jakarta EE container, where the threads must be managed.
*/
protected ThreadFactory threadFactory() {
return Executors.defaultThreadFactory();
}
}
|
[
"ladicek@gmail.com"
] |
ladicek@gmail.com
|
f83e6ce15441f5350429c69d041df7ddb550f8bc
|
5b82e2f7c720c49dff236970aacd610e7c41a077
|
/QueryReformulation-master 2/data/processed/NewWizard1.java
|
b8cb3122dd44fe0b430fc74a755e7b5cba7a52ca
|
[] |
no_license
|
shy942/EGITrepoOnlineVersion
|
4b157da0f76dc5bbf179437242d2224d782dd267
|
f88fb20497dcc30ff1add5fe359cbca772142b09
|
refs/heads/master
| 2021-01-20T16:04:23.509863
| 2016-07-21T20:43:22
| 2016-07-21T20:43:22
| 63,737,385
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 612
|
java
|
/***/
package org.eclipse.ui.tests.navigator.wizards;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
/**
* Does nothing. Used to test the Capability-awareness of the <b>commonWizard</b> extension.
*
* @since 3.2
*
*/
public class NewWizard1 extends Wizard implements INewWizard {
public NewWizard1() {
}
@Override
public boolean performFinish() {
return false;
}
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
}
}
|
[
"muktacseku@gmail.com"
] |
muktacseku@gmail.com
|
1cd192f62511da1476045e055df31cdd0f4fb939
|
5a15d10a44ba030f3fb8ed1d631c5a81d8b9ed66
|
/original/240/gen/com/example209/R.java
|
05eba640705b1045b8e78533f6d67c3ae50fac85
|
[] |
no_license
|
kongxiangyue/sample_android
|
c0ae7ba0d5b2b7d0bae8168fd8aad72918f4d882
|
ba63d80516754881212f2fd52b0e6d3a3a4091dc
|
refs/heads/master
| 2020-03-26T13:06:46.378051
| 2018-08-30T08:57:22
| 2018-08-30T08:57:22
| 144,923,789
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 719
|
java
|
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.example209;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int golden_gate=0x7f020000;
public static final int icon=0x7f020001;
}
public static final class layout {
public static final int main=0x7f030000;
public static final int main2=0x7f030001;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
|
[
"513001363@qq.com"
] |
513001363@qq.com
|
f6c92c348bac28621d92d10dcf9cd7a23b5ec468
|
32fcd90a01b4e8f0a4aeb40e349cb78bdb15dc6b
|
/thundergate-project/asakusa-thundergate/src/test/java/com/asakusafw/bulkloader/transfer/OpenSshFileListProviderTest.java
|
e05895ba3d5f1197fd8915a7d8021e0af04924fe
|
[
"Apache-2.0"
] |
permissive
|
asakusafw/asakusafw-legacy
|
3bf051a550c0c81245b9bf2cedc98d332a7e90fa
|
37d785c65194151a4ac72d51e871612edc6dfaed
|
refs/heads/master
| 2022-07-11T20:32:30.570948
| 2021-01-07T09:33:20
| 2021-01-07T09:33:20
| 50,084,654
| 0
| 2
|
Apache-2.0
| 2022-06-28T15:17:49
| 2016-01-21T05:34:44
|
Java
|
UTF-8
|
Java
| false
| false
| 1,579
|
java
|
/**
* Copyright 2011-2021 Asakusa Framework Team.
*
* 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.asakusafw.bulkloader.transfer;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Assume;
import org.junit.Test;
/**
* Test for {@link OpenSshFileListProvider}.
*/
public class OpenSshFileListProviderTest {
/**
* Simple testing.
*/
@Test
public void simple() {
try {
OpenSshFileListProvider provider = new OpenSshFileListProvider(
"/usr/bin/ssh",
System.getProperty("user.name"),
"localhost",
Arrays.asList("echo", "hoge", "VAR"),
Collections.singletonMap("MESSAGE", "VAR"));
try {
provider.discardWriter();
provider.discardReader();
provider.waitForComplete();
} finally {
provider.close();
}
} catch (Exception e) {
Assume.assumeNoException(e);
}
}
}
|
[
"kawaguchi@nautilus-technologies.com"
] |
kawaguchi@nautilus-technologies.com
|
fce257e5d316ec3c3630d3a8fda12af3fc9bba97
|
5fddb9a3f85f50cdefe3bf29ca06b33ad44bcd62
|
/src/main/java/com/syncleus/aethermud/game/Abilities/Traps/Trap_SporeTrap.java
|
4471c76bc52fa554eafe9dd59f27fe7f8a2ce9a1
|
[
"Apache-2.0"
] |
permissive
|
freemo/AetherMUD-coffee
|
da315ae8046d06069a058fb38723750a02f72853
|
dbc091b3e1108aa6aff3640da4707ace4c6771e5
|
refs/heads/master
| 2021-01-19T22:34:29.830622
| 2017-08-26T14:01:24
| 2017-08-26T14:06:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,412
|
java
|
/**
* Copyright 2017 Syncleus, Inc.
* with portions copyright 2004-2017 Bo Zimmerman
*
* 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.syncleus.aethermud.game.Abilities.Traps;
import com.syncleus.aethermud.game.Abilities.interfaces.Ability;
import com.syncleus.aethermud.game.Abilities.interfaces.Trap;
import com.syncleus.aethermud.game.Common.interfaces.CMMsg;
import com.syncleus.aethermud.game.Items.interfaces.Food;
import com.syncleus.aethermud.game.Items.interfaces.Item;
import com.syncleus.aethermud.game.Items.interfaces.RawMaterial;
import com.syncleus.aethermud.game.MOBS.interfaces.MOB;
import com.syncleus.aethermud.game.core.CMClass;
import com.syncleus.aethermud.game.core.CMLib;
import com.syncleus.aethermud.game.core.interfaces.Physical;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Vector;
public class Trap_SporeTrap extends StdTrap {
private final static String localizedName = CMLib.lang().L("spore trap");
@Override
public String ID() {
return "Trap_SporeTrap";
}
@Override
public String name() {
return localizedName;
}
@Override
protected int canAffectCode() {
return Ability.CAN_EXITS | Ability.CAN_ITEMS;
}
@Override
protected int canTargetCode() {
return 0;
}
@Override
protected int trapLevel() {
return 13;
}
@Override
public String requiresToSet() {
return "some diseased food";
}
public List<Ability> returnOffensiveAffects(Physical fromMe) {
final List<Ability> offenders = new Vector<Ability>();
for (final Enumeration<Ability> a = fromMe.effects(); a.hasMoreElements(); ) {
final Ability A = a.nextElement();
if ((A != null) && ((A.classificationCode() & Ability.ALL_ACODES) == Ability.ACODE_DISEASE))
offenders.add(A);
}
return offenders;
}
protected Item getPoison(MOB mob) {
if (mob == null)
return null;
if (mob.location() == null)
return null;
for (int i = 0; i < mob.location().numItems(); i++) {
final Item I = mob.location().getItem(i);
if ((I != null)
&& (I instanceof Food)) {
final List<Ability> V = returnOffensiveAffects(I);
if (V.size() > 0)
return I;
}
}
return null;
}
@Override
public Trap setTrap(MOB mob, Physical P, int trapBonus, int qualifyingClassLevel, boolean perm) {
if (P == null)
return null;
if (mob != null) {
final Item I = getPoison(mob);
if (I != null) {
final List<Ability> V = returnOffensiveAffects(I);
if (V.size() > 0)
setMiscText(V.get(0).ID());
I.destroy();
}
}
return super.setTrap(mob, P, trapBonus, qualifyingClassLevel, perm);
}
@Override
public List<Item> getTrapComponents() {
final List<Item> V = new Vector<Item>();
final Item I = CMLib.materials().makeItemResource(RawMaterial.RESOURCE_MEAT);
Ability A = CMClass.getAbility(text());
if (A == null)
A = CMClass.getAbility("Disease_Cold");
I.addNonUninvokableEffect(A);
V.add(I);
return V;
}
@Override
public boolean canSetTrapOn(MOB mob, Physical P) {
if (!super.canSetTrapOn(mob, P))
return false;
final Item I = getPoison(mob);
if ((I == null)
&& (mob != null)) {
mob.tell(L("You'll need to set down some diseased food first."));
return false;
}
return true;
}
@Override
public void spring(MOB target) {
if ((target != invoker()) && (target.location() != null)) {
if ((!invoker().mayIFight(target))
|| (isLocalExempt(target))
|| (invoker().getGroupMembers(new HashSet<MOB>()).contains(target))
|| (target == invoker())
|| (doesSaveVsTraps(target)))
target.location().show(target, null, null, CMMsg.MASK_ALWAYS | CMMsg.MSG_NOISE, L("<S-NAME> avoid(s) setting off a trap!"));
else if (target.location().show(target, target, this, CMMsg.MASK_ALWAYS | CMMsg.MSG_NOISE, L("<S-NAME> set(s) off a trap which sends spores flying around!"))) {
super.spring(target);
Ability A = CMClass.getAbility(text());
if (A == null)
A = CMClass.getAbility("Disease_Cold");
if (A != null)
A.invoke(invoker(), target, true, 0);
if ((canBeUninvoked()) && (affected instanceof Item))
disable();
}
}
}
}
|
[
"jeffrey.freeman@syncleus.com"
] |
jeffrey.freeman@syncleus.com
|
28c7c7a493d26941d53b3668629164b9301bb506
|
da9e57fa9472869a09abeb7a6a381cf86d4878ba
|
/src/plugin/interaction/item/SpadeDigOptionPlugin.java
|
06a66e3bfeb741743b2a9b488e5a2c575aa04936
|
[] |
no_license
|
ModGallus/Server
|
f617b45a9e71f5fc1c04e6ab82fd7579c856ccaa
|
38bd2219cfda82936b5249932c0c4465d02c2b65
|
refs/heads/master
| 2021-01-11T15:21:20.792638
| 2017-01-29T09:58:40
| 2017-01-29T09:58:40
| 80,338,829
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 920
|
java
|
package plugin.interaction.item;
import org.areillan.cache.def.impl.ItemDefinition;
import org.areillan.game.content.global.action.DigSpadeHandler;
import org.areillan.game.interaction.OptionHandler;
import org.areillan.game.node.Node;
import org.areillan.game.node.entity.player.Player;
import org.areillan.plugin.Plugin;
/**
* Represents the plugin used to handle the dig option on a spade.
* @author 'Vexia
* @author Emperor
*/
public class SpadeDigOptionPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
ItemDefinition.forId(952).getConfigurations().put("option:dig", this);
return null;
}
@Override
public boolean handle(final Player player, Node node, String option) {
if (!DigSpadeHandler.dig(player)) {
player.sendMessage("You dig but find nothing.");
}
return true;
}
@Override
public boolean isWalk() {
return false;
}
}
|
[
"theofficialgallus@gmail.com"
] |
theofficialgallus@gmail.com
|
e700288421c824285fbd9b3b05acbca2e44fab7e
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_7405a8f38136b58a64c2e0d4deca03efcb77b5a0/JSONConverter/2_7405a8f38136b58a64c2e0d4deca03efcb77b5a0_JSONConverter_t.java
|
c74bcc2e1f244b45242690eaa295b8aca24da732
|
[] |
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
| 4,093
|
java
|
/**
* Copyright (C) Posten Norge AS
*
* 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 no.digipost.android.api;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import no.digipost.android.model.Letter;
import org.apache.http.ParseException;
import org.apache.http.entity.StringEntity;
import org.apache.http.protocol.HTTP;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.ser.FilterProvider;
import org.codehaus.jackson.map.ser.impl.SimpleBeanPropertyFilter;
import org.codehaus.jackson.map.ser.impl.SimpleFilterProvider;
public class JSONConverter {
public static String getJsonStringFromInputStream(final InputStream inputStream) {
String content = "";
if (inputStream != null) {
Writer writer = new StringWriter();
int buffer_size = 1024;
char[] buffer = new char[buffer_size];
try {
Reader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"), buffer_size);
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
inputStream.close();
reader.close();
writer.close();
} catch (Exception e) {
}
content = writer.toString();
}
return content;
}
public static <T> Object processJackson(final Class<T> type, final String data) {
ObjectMapper objectMapper = new ObjectMapper();
JsonFactory fact = new JsonFactory();
Object jacksonObject = null;
try {
JsonParser jp = fact.createJsonParser(data);
jacksonObject = objectMapper.readValue(jp, type);
} catch (JsonParseException e) {
// Ignore
} catch (IOException e) {
// Ignore
} catch (Exception e) {
// Ignore
}
return jacksonObject;
}
public static <T> Object processJackson(final Class<T> type, final InputStream data) {
return processJackson(type, getJsonStringFromInputStream(data));
}
public static StringEntity createJsonFromJackson(final Letter letter) throws ParseException, IOException {
// ignore-test
String[] ignore = { "link", "contentUri", "deleteUri", "updateUri", "organizationLogo","attachment" };
ObjectMapper objectMapper = new ObjectMapper();
FilterProvider filters = new SimpleFilterProvider().addFilter("toJSON", SimpleBeanPropertyFilter.serializeAllExcept(ignore));
Writer strWriter = new StringWriter();
try {
objectMapper.filteredWriter(filters).writeValue(strWriter, letter);
} catch (JsonGenerationException e) {
// Ignore
} catch (JsonMappingException e) {
// Ignore
} catch (IOException e) {
// Ignore
}
return new StringEntity(strWriter.toString(), HTTP.UTF_8);
}
public static byte[] inputStreamtoByteArray(final int size, final InputStream data) {
InputStream is = data;
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] byteArray = new byte[size];
try {
while ((nRead = is.read(byteArray, 0, byteArray.length)) != -1) {
buffer.write(byteArray, 0, nRead);
}
buffer.flush();
} catch (IOException e) {
// Ignore
}
return buffer.toByteArray();
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
ed500826a6f1297a1fc7dce9abccb8975973b403
|
82e2fa3b1128edc8abd2bd84ecfc01c932831bc0
|
/jena-core/src/test/java/org/apache/jena/rdfxml/libtest/LazyZipEntryInputStream.java
|
7bcb8a603299e6e7b33b8b7cc3085bdfce889b12
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
apache/jena
|
b64f6013582f2b5aa38d1c9972d7b14e55686316
|
fb41e79d97f065b8df9ebbc6c69b3f983b6cde04
|
refs/heads/main
| 2023-08-14T15:16:21.086308
| 2023-08-03T08:34:08
| 2023-08-03T08:34:08
| 7,437,073
| 966
| 760
|
Apache-2.0
| 2023-09-02T09:04:08
| 2013-01-04T08:00:32
|
Java
|
UTF-8
|
Java
| false
| false
| 1,625
|
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.jena.rdfxml.libtest;
import java.io.*;
import java.util.zip.*;
/**
*In test cases we cannot open all the input files
* while creating the test suite, but must defer the
* opening until the test is actually run.
*/
class LazyZipEntryInputStream extends LazyInputStream {
private ZipEntry entry;
private ZipFile zip;
/** Creates new LazyZipEntryInputStream */
LazyZipEntryInputStream(ZipFile zip,String name) {
// System.err.println(name);
entry = new ZipEntry(name);
this.zip = zip;
}
@Override
InputStream open() throws IOException {
InputStream rslt = zip.getInputStream(entry);
if ( rslt == null )
throw new IllegalArgumentException(entry.getName()+ " cannot be opened.");
return rslt;
}
}
|
[
"andy@apache.org"
] |
andy@apache.org
|
b6db5b5ef17fc3e7321cd8d26debba703328585a
|
5e9024c33ba28c618847d756306ea15208ea1e18
|
/implementation/src/main/java/io/smallrye/reactive/streams/utils/recovery/OnErrorReturnSubscriber.java
|
184ddc16afbfd75b1da5c96ede9989e9138b2b3a
|
[
"Apache-2.0"
] |
permissive
|
hutchig/smallrye-reactive-streams-operators
|
8cbfbac55d7270b6e3c6da3803ee035514b78739
|
801f9621d52d055ebe5bdc07409b9c2faa31a5a4
|
refs/heads/master
| 2020-04-08T15:24:23.111592
| 2019-01-24T14:18:05
| 2019-01-24T14:18:05
| 159,477,281
| 0
| 0
|
Apache-2.0
| 2018-11-28T09:34:29
| 2018-11-28T09:34:29
| null |
UTF-8
|
Java
| false
| false
| 1,178
|
java
|
package io.smallrye.reactive.streams.utils.recovery;
import io.reactivex.internal.subscribers.SinglePostCompleteSubscriber;
import org.reactivestreams.Subscriber;
import java.util.Objects;
import java.util.function.Function;
public class OnErrorReturnSubscriber<T> extends SinglePostCompleteSubscriber<T, T> {
private static final long serialVersionUID = 1111111L;
private final transient Function<? super Throwable, ? extends T> valueSupplier;
OnErrorReturnSubscriber(Subscriber<? super T> actual,
Function<? super Throwable, ? extends T> valueSupplier) {
super(actual);
this.valueSupplier = valueSupplier;
}
@Override
public void onNext(T t) {
produced++;
downstream.onNext(t);
}
@Override
public void onError(Throwable t) {
T v;
try {
v = Objects.requireNonNull(valueSupplier.apply(t), "The valueSupplier returned a null value");
} catch (Exception ex) {
downstream.onError(ex);
return;
}
complete(v);
}
@Override
public void onComplete() {
downstream.onComplete();
}
}
|
[
"clement.escoffier@gmail.com"
] |
clement.escoffier@gmail.com
|
a89ad4517d120d011d9d032fbb5a51c621fece41
|
7a0acc1c2e808c7d363043546d9581d21a129693
|
/remote/client/src/java/org/openqa/selenium/remote/RenderedRemoteWebElement.java
|
9bf5afd24b34d52d72de2ea447eb16c7635dfe7a
|
[
"Apache-2.0"
] |
permissive
|
epall/selenium
|
39b9759f8719a168b021b28e500c64afc5f83582
|
273260522efb84116979da2a499f64510250249b
|
refs/heads/master
| 2022-06-25T22:15:25.493076
| 2010-03-11T00:43:02
| 2010-03-11T00:43:02
| 552,908
| 3
| 0
|
Apache-2.0
| 2022-06-10T22:44:36
| 2010-03-08T19:10:45
|
C
|
UTF-8
|
Java
| false
| false
| 2,713
|
java
|
/*
Copyright 2007-2009 WebDriver committers
Copyright 2007-2009 Google 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.
*/
// Copyright 2008 Google Inc. All Rights Reserved.
package org.openqa.selenium.remote;
import org.openqa.selenium.RenderedWebElement;
import com.google.common.collect.ImmutableMap;
import java.awt.Dimension;
import java.awt.Point;
import java.util.Map;
public class RenderedRemoteWebElement extends RemoteWebElement implements RenderedWebElement {
public boolean isDisplayed() {
Response response = parent.execute(DriverCommand.IS_ELEMENT_DISPLAYED, ImmutableMap.of("id", id));
return (Boolean) response.getValue();
}
@SuppressWarnings({"unchecked"})
public Point getLocation() {
Response response = parent.execute(DriverCommand.GET_ELEMENT_LOCATION, ImmutableMap.of("id", id));
Map<String, Object> rawPoint = (Map<String, Object>) response.getValue();
int x = ((Long) rawPoint.get("x")).intValue();
int y = ((Long) rawPoint.get("y")).intValue();
return new Point(x, y);
}
@SuppressWarnings({"unchecked"})
public Dimension getSize() {
Response response = parent.execute(DriverCommand.GET_ELEMENT_SIZE, ImmutableMap.of("id", id));
Map<String, Object> rawSize = (Map<String, Object>) response.getValue();
int width = ((Long) rawSize.get("width")).intValue();
int height = ((Long) rawSize.get("height")).intValue();
return new Dimension(width, height);
}
public void hover() {
parent.execute(DriverCommand.HOVER_OVER_ELEMENT, ImmutableMap.of("id", id));
}
public void dragAndDropBy(int moveRightBy, int moveDownBy) {
parent.execute(DriverCommand.DRAG_ELEMENT, ImmutableMap.of("id", id), moveRightBy, moveDownBy);
}
public void dragAndDropOn(RenderedWebElement element) {
Point currentLocation = getLocation();
Point destination = element.getLocation();
dragAndDropBy(destination.x - currentLocation.x, destination.y - currentLocation.y);
}
public String getValueOfCssProperty(String propertyName) {
Response response = parent.execute(DriverCommand.GET_ELEMENT_VALUE_OF_CSS_PROPERTY,
ImmutableMap.of("id", id, "propertyName", propertyName));
return (String) response.getValue();
}
}
|
[
"simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9"
] |
simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9
|
25af3218f0cd400b132fad7066f9609f16712782
|
995f73d30450a6dce6bc7145d89344b4ad6e0622
|
/DVC-AN20_EMUI10.1.1/src/main/java/android/util/CoordinationModeUtils.java
|
27bc13829541c92e457bb0885da0f19aeec4bad5
|
[] |
no_license
|
morningblu/HWFramework
|
0ceb02cbe42585d0169d9b6c4964a41b436039f5
|
672bb34094b8780806a10ba9b1d21036fd808b8e
|
refs/heads/master
| 2023-07-29T05:26:14.603817
| 2021-09-03T05:23:34
| 2021-09-03T05:23:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,853
|
java
|
package android.util;
import android.common.HwFrameworkFactory;
import android.content.Context;
import android.graphics.Rect;
import android.hardware.display.HwFoldScreenState;
import android.os.SystemProperties;
import android.provider.Settings;
import android.telephony.SmsManager;
import com.huawei.hwaps.IHwApsImpl;
public final class CoordinationModeUtils {
public static final String COORDINATION_CREATE_MODE = "coordination_create_mode";
public static final int COORDINATION_MODE_EXITING_RIGHT = 2;
public static final int FINISH_ENTERING_COORDINATION_MODE = 2;
public static final int FINISH_EXITING_COORDINATION_MODE = 4;
public static final String HW_FOLD_DISP_PROP = "ro.config.hw_fold_disp";
private static final boolean IS_FOLDABLE = (!SystemProperties.get("ro.config.hw_fold_disp").isEmpty() || !SystemProperties.get(HwFoldScreenState.DEBUG_HW_FOLD_DISP_PROP).isEmpty());
public static final int LEFT_TO_RIGHT = 3;
public static final int NORMAL_MODE = 0;
public static final int RIGHT_TO_LEFT = 4;
public static final int START_ENTERING_COORDINATION_MODE = 1;
public static final int START_EXITING_COORDINATION_MODE = 3;
private static int mFoldScreenEdgeWidth;
private static int mFoldScreenFullHeight;
private static int mFoldScreenFullWidth;
private static int mFoldScreenMainWidth;
private static int mFoldScreenSubWidth;
private static CoordinationModeUtils mInstance;
private Context mContext;
int mCoordinationCreateMode = 0;
int mCoordinationState = 0;
static {
String[] screenSizes = SystemProperties.get("ro.config.hw_fold_disp").split(SmsManager.REGEX_PREFIX_DELIMITER);
if (screenSizes.length == 6) {
try {
mFoldScreenSubWidth = Integer.parseInt(screenSizes[0]);
mFoldScreenEdgeWidth = Integer.parseInt(screenSizes[1]);
mFoldScreenMainWidth = Integer.parseInt(screenSizes[2]);
mFoldScreenFullWidth = mFoldScreenSubWidth + mFoldScreenEdgeWidth + mFoldScreenMainWidth;
mFoldScreenFullHeight = Integer.parseInt(screenSizes[3]);
} catch (NumberFormatException e) {
Log.e("CoordinationModeUtils", "HW_FOLD_DISP_PROP error");
}
}
}
private CoordinationModeUtils(Context context) {
this.mContext = context;
}
public static synchronized CoordinationModeUtils getInstance(Context context) {
CoordinationModeUtils coordinationModeUtils;
synchronized (CoordinationModeUtils.class) {
if (mInstance == null) {
mInstance = new CoordinationModeUtils(context);
}
coordinationModeUtils = mInstance;
}
return coordinationModeUtils;
}
public static boolean isFoldable() {
return IS_FOLDABLE;
}
public void setCoordinationCreateMode(int mode) {
Settings.Global.putInt(this.mContext.getContentResolver(), COORDINATION_CREATE_MODE, mode);
this.mCoordinationCreateMode = mode;
}
public int getCoordinationCreateMode() {
return this.mCoordinationCreateMode;
}
public void setCoordinationState(int state) {
this.mCoordinationState = state;
}
public int getCoordinationState() {
return this.mCoordinationState;
}
public boolean isEnterOrExitCoordinationMode() {
int i = this.mCoordinationState;
return i == 1 || i == 3;
}
public boolean isEnteringCoordinationMode() {
return this.mCoordinationState == 1;
}
public boolean isExitingCoordinationMode() {
return this.mCoordinationState == 3;
}
public void getStackCoordinationModeBounds(boolean isCoordinationPrimary, int rotation, Rect outBounds) {
if (rotation == 0) {
int i = this.mCoordinationCreateMode;
if (i == 3) {
if (isCoordinationPrimary) {
outBounds.set(0, 0, mFoldScreenSubWidth, mFoldScreenFullHeight);
} else {
outBounds.set(mFoldScreenSubWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullWidth, mFoldScreenFullHeight);
}
} else if (i == 4 || i == 2) {
if (isCoordinationPrimary) {
outBounds.set(mFoldScreenSubWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullWidth, mFoldScreenFullHeight);
} else {
outBounds.set(0, 0, mFoldScreenSubWidth, mFoldScreenFullHeight);
}
}
} else if (rotation == 1) {
int i2 = this.mCoordinationCreateMode;
if (i2 == 3) {
if (isCoordinationPrimary) {
outBounds.set(0, mFoldScreenMainWidth + mFoldScreenEdgeWidth, mFoldScreenFullHeight, mFoldScreenFullWidth);
} else {
outBounds.set(0, 0, mFoldScreenFullHeight, mFoldScreenMainWidth);
}
} else if (i2 == 4 || i2 == 2) {
if (isCoordinationPrimary) {
outBounds.set(0, 0, mFoldScreenFullHeight, mFoldScreenMainWidth);
} else {
outBounds.set(0, mFoldScreenMainWidth + mFoldScreenEdgeWidth, mFoldScreenFullHeight, mFoldScreenFullWidth);
}
}
} else if (rotation == 2) {
int i3 = this.mCoordinationCreateMode;
if (i3 == 3) {
if (isCoordinationPrimary) {
outBounds.set(mFoldScreenMainWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullWidth, mFoldScreenFullHeight);
} else {
outBounds.set(0, 0, mFoldScreenMainWidth, mFoldScreenFullHeight);
}
} else if (i3 == 4 || i3 == 2) {
if (isCoordinationPrimary) {
outBounds.set(0, 0, mFoldScreenMainWidth, mFoldScreenFullHeight);
} else {
outBounds.set(mFoldScreenMainWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullWidth, mFoldScreenFullHeight);
}
}
} else if (rotation == 3) {
int i4 = this.mCoordinationCreateMode;
if (i4 == 3) {
if (isCoordinationPrimary) {
outBounds.set(0, 0, mFoldScreenFullHeight, mFoldScreenSubWidth);
} else {
outBounds.set(mFoldScreenSubWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullHeight, mFoldScreenFullWidth);
}
} else if (i4 == 4 || i4 == 2) {
if (isCoordinationPrimary) {
outBounds.set(mFoldScreenSubWidth + mFoldScreenEdgeWidth, 0, mFoldScreenFullHeight, mFoldScreenFullWidth);
} else {
outBounds.set(0, 0, mFoldScreenFullHeight, mFoldScreenSubWidth);
}
}
}
outBounds.scale(getRogRatio());
}
private static float getRogRatio() {
IHwApsImpl apsImpl = HwFrameworkFactory.getHwApsImpl();
if (apsImpl != null) {
return apsImpl.getRogRatio();
}
return 1.0f;
}
private static int scaleSizeInRog(int originSize) {
return (int) ((((float) originSize) * getRogRatio()) + 0.5f);
}
public static int getFoldScreenMainWidth() {
return scaleSizeInRog(mFoldScreenMainWidth);
}
public static int getFoldScreenEdgeWidth() {
return scaleSizeInRog(mFoldScreenEdgeWidth);
}
public static int getFoldScreenSubWidth() {
return scaleSizeInRog(mFoldScreenSubWidth);
}
public static int getFoldScreenFullWidth() {
return scaleSizeInRog(mFoldScreenFullWidth);
}
public static int getFoldScreenFullHeight() {
return scaleSizeInRog(mFoldScreenFullHeight);
}
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
6b06c6e8d5d498b7182c51e4df5efe2e6156bd18
|
cb0e772430877ceb7b9a1656b8fc4ff36289250b
|
/Java/src/instructions/stack/pop/POP.java
|
9062780cda42ca2a05ce05a1c5b22066adcb6097
|
[] |
no_license
|
LailaiMaster/JVM
|
4f296ef8f6c1708b8e4524692968aa31249d1932
|
0e3b830c12d5daa531dd01387b1fd74e2296ad34
|
refs/heads/master
| 2023-03-20T22:49:19.143489
| 2018-01-20T12:16:31
| 2018-01-20T12:16:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 430
|
java
|
package instructions.stack.pop;
import instructions.base.NoOperandsInstruction;
import runtimedata.Zframe;
/**
* Author: zhangxin
* Time: 2017/5/5 0005.
* Desc: pop指令把栈顶变量弹出
* 只能用于弹出int、float等占用一个操作数栈位置的变量
*/
public class POP extends NoOperandsInstruction {
@Override
public void execute(Zframe frame) {
frame.getOperandStack().popSlot();
}
}
|
[
"zachaxy@163.com"
] |
zachaxy@163.com
|
2bfe2902c484a4aa81acd1914b4d9c45006acf85
|
6ea7f7ecab3b2abd789753c6c833a34bcaacb48f
|
/company/microsoft/InsertionSortList.java
|
d071a02c1ed4bf7f7c1f7606008a094db96c568b
|
[] |
no_license
|
bhaskarsantoshk/problem-solving
|
2fb44712fc3495097b01339164ef570d9cb2b4f6
|
a53d19a10c181f75e11033fa2666f11b4af03485
|
refs/heads/master
| 2023-07-25T00:52:43.790559
| 2023-07-16T13:50:20
| 2023-07-16T13:50:20
| 166,809,536
| 9
| 2
| null | 2023-04-16T15:46:25
| 2019-01-21T12:20:58
|
Java
|
UTF-8
|
Java
| false
| false
| 149
|
java
|
package company.microsoft;
public class InsertionSortList {
public ListNode insertionSortList(ListNode A) {
return null;
}
}
|
[
"bhaskarsantoshk@gmail.com"
] |
bhaskarsantoshk@gmail.com
|
0ee11d3eaad433f611b6de786669d52d95c89612
|
e6be1c458851a19b5f53e86e8505fe07bc5c6014
|
/Ghidra/Features/MicrosoftDmang/src/main/java/mdemangler/template/MDTemplateNameAndArguments.java
|
1934a369acf2f672dcf65fb4532e6acdf8a1c5c6
|
[
"Apache-2.0",
"GPL-1.0-or-later",
"GPL-3.0-only",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
penhoi/ghidra-decompiler
|
6a950ad56acc467fa4fd771097d068d9785d36e0
|
151133f957e8fb4172cd6f0f4b750b5948df4c95
|
refs/heads/master
| 2020-05-19T16:46:36.863144
| 2019-07-26T01:17:19
| 2019-07-26T01:17:19
| 185,118,431
| 17
| 7
|
Apache-2.0
| 2019-07-10T10:16:13
| 2019-05-06T03:36:43
|
Java
|
UTF-8
|
Java
| false
| false
| 2,465
|
java
|
/* ###
* IP: GHIDRA
*
* 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 mdemangler.template;
import mdemangler.*;
import mdemangler.naming.MDBasicName;
/**
* This class represents the template name and arguments list portion of a
* Microsoft mangled symbol.
*/
public class MDTemplateNameAndArguments extends MDParsableItem {
private MDBasicName templateName;
private MDTemplateArgumentsList args;
public MDTemplateNameAndArguments(MDMang dmang) {
super(dmang);
}
public boolean isConstructor() {
return templateName.isConstructor();
}
public boolean isDestructor() {
return templateName.isDestructor();
}
public boolean isTypeCast() {
return templateName.isTypeCast();
}
public String getName() {
return templateName.getName();
}
public void setName(String name) {
templateName.setName(name);
}
public MDTemplateArgumentsList getArgumentsList() {
return args;
}
@Override
public void insert(StringBuilder builder) {
StringBuilder argsBuilder = new StringBuilder();
args.insert(argsBuilder);
dmang.insertString(builder, ">");
if ((argsBuilder.length() != 0) && (argsBuilder.charAt(argsBuilder.length() - 1) == '>')) {
dmang.insertString(builder, " ");
}
dmang.insertString(builder, argsBuilder.toString());
dmang.insertString(builder, "<");
templateName.insert(builder);
}
@Override
protected void parseInternal() throws MDException {
if (dmang.peek() != '?' && dmang.peek(1) != '$') {
throw new MDException("Invalid TemplateNameandArguments");
}
dmang.increment(); // skip the '?'
dmang.increment(); // skip the '$'
dmang.pushTemplateContext();
templateName = new MDBasicName(dmang);
templateName.parse();
args = new MDTemplateArgumentsList(dmang);
args.parse();
dmang.popContext();
}
}
/******************************************************************************/
/******************************************************************************/
|
[
"46821332+nsadeveloper789@users.noreply.github.com"
] |
46821332+nsadeveloper789@users.noreply.github.com
|
7d4da2628fb8c6c0966e4ee806a158fd154ba4e3
|
5cbf5f4c5a98abc98dc570c651ee3574ba20bde8
|
/buspass-ws-master/src/main/java/com/sctrcd/buspassws/model/ItemCategory.java
|
ba698dc9a25c6df410831b1f9f3e2d259aad8748
|
[
"Apache-2.0"
] |
permissive
|
zlatanp/web.shop.drools
|
106d52c1391f6da8f817ece63d155ae231ba2312
|
66e51e4b90b8acee2ac5d9e25159ac88376e58ad
|
refs/heads/master
| 2021-01-22T08:02:16.506680
| 2017-07-13T07:07:44
| 2017-07-13T07:07:44
| 92,597,210
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,235
|
java
|
package com.sctrcd.buspassws.model;
import org.springframework.data.annotation.Id;
import java.util.ArrayList;
public class ItemCategory {
@Id
private String code;
private String name;
private String supercategory;
private int maxDiscount;
private boolean wholesale;
public ItemCategory() {
super();
}
public ItemCategory(String code, String name, String supercategory, int maxDiscount, boolean wholesale) {
super();
this.code = code;
this.name = name;
this.supercategory = supercategory;
this.maxDiscount = maxDiscount;
this.wholesale = wholesale;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getSuperCategory() {
return supercategory;
}
public void setSuperCategory(String supercategory) {
this.supercategory = supercategory;
}
public int getMaxDiscount() {
return maxDiscount;
}
public void setMaxDiscount(int maxDiscount) {
this.maxDiscount = maxDiscount;
}
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public boolean isWholesale() {
return wholesale;
}
public void setWholesale(boolean wholesale) {
this.wholesale = wholesale;
}
}
|
[
"zlajox@gmail.com"
] |
zlajox@gmail.com
|
3f11810af8e49796e4bc9dc2e88578690d75098d
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/XWIKI-13138-15-16-Single_Objective_GGA-WeightedSum/org/xwiki/platform/wiki/creationjob/internal/WikiCreationJob_ESTest.java
|
c45314f31ab0664fe01171d1f967777f09e67f61
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 581
|
java
|
/*
* This file was automatically generated by EvoSuite
* Wed Apr 01 12:30:09 UTC 2020
*/
package org.xwiki.platform.wiki.creationjob.internal;
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 WikiCreationJob_ESTest extends WikiCreationJob_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
94deff5b8ad1f1fece9093793c99ca9af696fa4b
|
9c190f0377d1374d98ccf6866dbd8719aba0be06
|
/app/src/main/java/me/lancer/pocket/tool/mvp/todo/taskdetail/TaskDetailPresenter.java
|
c441ec141b414fb34cab608874d98481935e1ebd
|
[] |
no_license
|
1anc3r/Pocket
|
e7bb03e98947d984ef225971fbfc8610f110766d
|
68a49bc2ecabcbf536d7daa12145766aca05c586
|
refs/heads/master
| 2020-03-28T19:47:22.647719
| 2019-03-02T10:40:54
| 2019-03-02T10:40:54
| 94,602,624
| 11
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,663
|
java
|
/*
* Copyright 2016, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package me.lancer.pocket.tool.mvp.todo.taskdetail;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.test.espresso.core.deps.guava.base.Strings;
import me.lancer.pocket.tool.mvp.todo.data.Task;
import me.lancer.pocket.tool.mvp.todo.data.source.TasksDataSource;
import me.lancer.pocket.tool.mvp.todo.data.source.TasksRepository;
import static com.bumptech.glide.util.Preconditions.checkNotNull;
/**
* Listens to user actions from the UI ({@link TaskDetailFragment}), retrieves the data and updates
* the UI as required.
*/
public class TaskDetailPresenter implements TaskDetailContract.Presenter {
private final TasksRepository mTasksRepository;
private final TaskDetailContract.View mTaskDetailView;
@Nullable
private String mTaskId;
public TaskDetailPresenter(@Nullable String taskId,
@NonNull TasksRepository tasksRepository,
@NonNull TaskDetailContract.View taskDetailView) {
mTaskId = taskId;
mTasksRepository = checkNotNull(tasksRepository, "tasksRepository cannot be null!");
mTaskDetailView = checkNotNull(taskDetailView, "taskDetailView cannot be null!");
mTaskDetailView.setPresenter(this);
}
@Override
public void start() {
openTask();
}
private void openTask() {
if (Strings.isNullOrEmpty(mTaskId)) {
mTaskDetailView.showMissingTask();
return;
}
mTaskDetailView.setLoadingIndicator(true);
mTasksRepository.getTask(mTaskId, new TasksDataSource.GetTaskCallback() {
@Override
public void onTaskLoaded(Task task) {
// The view may not be able to handle UI updates anymore
if (!mTaskDetailView.isActive()) {
return;
}
mTaskDetailView.setLoadingIndicator(false);
if (null == task) {
mTaskDetailView.showMissingTask();
} else {
showTask(task);
}
}
@Override
public void onDataNotAvailable() {
// The view may not be able to handle UI updates anymore
if (!mTaskDetailView.isActive()) {
return;
}
mTaskDetailView.showMissingTask();
}
});
}
@Override
public void editTask() {
if (Strings.isNullOrEmpty(mTaskId)) {
mTaskDetailView.showMissingTask();
return;
}
mTaskDetailView.showEditTask(mTaskId);
}
@Override
public void deleteTask() {
if (Strings.isNullOrEmpty(mTaskId)) {
mTaskDetailView.showMissingTask();
return;
}
mTasksRepository.deleteTask(mTaskId);
mTaskDetailView.showTaskDeleted();
}
@Override
public void completeTask() {
if (Strings.isNullOrEmpty(mTaskId)) {
mTaskDetailView.showMissingTask();
return;
}
mTasksRepository.completeTask(mTaskId);
mTaskDetailView.showTaskMarkedComplete();
}
@Override
public void activateTask() {
if (Strings.isNullOrEmpty(mTaskId)) {
mTaskDetailView.showMissingTask();
return;
}
mTasksRepository.activateTask(mTaskId);
mTaskDetailView.showTaskMarkedActive();
}
private void showTask(@NonNull Task task) {
String title = task.getTitle();
String description = task.getDescription();
if (Strings.isNullOrEmpty(title)) {
mTaskDetailView.hideTitle();
} else {
mTaskDetailView.showTitle(title);
}
if (Strings.isNullOrEmpty(description)) {
mTaskDetailView.hideDescription();
} else {
mTaskDetailView.showDescription(description);
}
mTaskDetailView.showCompletionStatus(task.isCompleted());
}
}
|
[
"huangfangzhi@icloud.com"
] |
huangfangzhi@icloud.com
|
8654e34e5b98ed299e347d1c6a492bfdc9312f3b
|
18e6da955719cff29d33ac4c0c5587d8f7b1188e
|
/apg-ui/src/main/java/it/giunti/apg/client/frames/RinnoviMassiviFrame.java
|
feef136a055bb1a4e1f76ab7d32cb1fa8f9e5218
|
[] |
no_license
|
pynolo/backup-apg-project
|
5dde8def09a330298e981a0146b3f7e00295801f
|
36c427a6ea2242db433129dd1a17a4e7ed09438b
|
refs/heads/master
| 2023-01-23T19:56:18.519181
| 2020-12-02T11:05:17
| 2020-12-02T11:05:17
| 317,835,636
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,676
|
java
|
package it.giunti.apg.client.frames;
import it.giunti.apg.client.AuthSingleton;
import it.giunti.apg.client.ClientConstants;
import it.giunti.apg.client.CookieSingleton;
import it.giunti.apg.client.IAuthenticatedWidget;
import it.giunti.apg.client.UiSingleton;
import it.giunti.apg.client.UriManager;
import it.giunti.apg.client.UriParameters;
import it.giunti.apg.client.WaitSingleton;
import it.giunti.apg.client.services.LoggingService;
import it.giunti.apg.client.services.LoggingServiceAsync;
import it.giunti.apg.client.widgets.DownloadIFrame;
import it.giunti.apg.client.widgets.FramePanel;
import it.giunti.apg.client.widgets.RinnoviMassiviPanel;
import it.giunti.apg.client.widgets.select.PeriodiciSelect;
import it.giunti.apg.client.widgets.tables.DataModel;
import it.giunti.apg.client.widgets.tables.LogTable;
import it.giunti.apg.shared.AppConstants;
import it.giunti.apg.shared.DateUtil;
import it.giunti.apg.shared.ValueUtil;
import it.giunti.apg.shared.model.Utenti;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.InlineHTML;
import com.google.gwt.user.client.ui.VerticalPanel;
public class RinnoviMassiviFrame extends FramePanel implements IAuthenticatedWidget {
private static final String TITLE_FORM = "Rinnovo massivo";
private static final String TITLE_LOG = "Rapporto";
private Integer idPeriodico = null;
private PeriodiciSelect periodiciList = null;
private VerticalPanel panelLog = null;
private Utenti utente = null;
public RinnoviMassiviFrame(UriParameters params) {
super();
if (params == null) {
params = new UriParameters();
}
idPeriodico = ValueUtil.stoi(params.getValue(AppConstants.PARAM_ID_PERIODICO));
if (idPeriodico == null) idPeriodico = ValueUtil.stoi(CookieSingleton.get().getCookie(ClientConstants.COOKIE_LAST_PERIODICO));
if (idPeriodico == null) idPeriodico = UiSingleton.get().getDefaultIdPeriodico(utente);
AuthSingleton.get().queueForAuthentication(this);
}
@Override
public void onSuccessfulAuthentication(Utenti utente) {
init(utente);
}
private void init(Utenti utente) {
this.utente = utente;
// Editing rights
int ruolo = utente.getRuolo().getId();
// UI
if (ruolo >= AppConstants.RUOLO_ADMIN) {
draw();
}
}
private void draw() {
this.clear();
VerticalPanel vPanel = new VerticalPanel();
RinnoviPanel rinnoviForm = new RinnoviPanel(idPeriodico);
HorizontalPanel topPanel = new HorizontalPanel();
// Periodico
topPanel.add(new InlineHTML("Periodico "));
periodiciList = new PeriodiciSelect(idPeriodico, DateUtil.now(), false, false, utente);
periodiciList.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
idPeriodico = periodiciList.getSelectedValueInt();
CookieSingleton.get().setCookie(ClientConstants.COOKIE_LAST_PERIODICO, idPeriodico+"");
UriParameters params = new UriParameters();
params.add(AppConstants.PARAM_ID_PERIODICO, idPeriodico);
params.triggerUri(UriManager.RINNOVI_MASSIVI);
}
});
periodiciList.setEnabled(true);
topPanel.add(periodiciList);
vPanel.add(topPanel);
vPanel.add(rinnoviForm);
this.add(vPanel, TITLE_FORM);
//Log Panel
panelLog = new VerticalPanel();
this.add(panelLog, TITLE_LOG);
}
private void showLogTable(int idRapporto) {
DataModel<String> model = new LogTable.LogModel(idRapporto);
LogTable logTable = new LogTable(model);
panelLog.clear();
panelLog.add(logTable);
this.showWidget(1);
}
private void createRapporto(RinnoviPanel form, String idUtente) {
LoggingServiceAsync loggingService = GWT.create(LoggingService.class);
final RinnoviPanel fForm = form;
String titolo = TITLE_FORM;
AsyncCallback<Integer> callback = new AsyncCallback<Integer>() {
@Override
public void onFailure(Throwable e) {
WaitSingleton.get().stop();
UiSingleton.get().addError(e);
}
@Override
public void onSuccess(Integer result) {
WaitSingleton.get().stop();
showLogTable(result);
fForm.onSubmit(result);
}
};
WaitSingleton.get().start();
loggingService.createRapporto(titolo, idUtente, callback);
}
// Inner Classes
public class RinnoviPanel extends FlowPanel {
private Hidden periodicoHid;
private Hidden rapportoHid;
private Hidden utenteHid;
public RinnoviPanel(Integer idPeriodico) {
super();
final RinnoviPanel thisForm = this;
periodicoHid = new Hidden();
periodicoHid.setValue(idPeriodico+"");
FlowPanel holder = new FlowPanel();
holder.add(new InlineHTML("Trasformazioni programmate per il rinnovo massivo:<br/>"));
//Tabella trasformazioni
final RinnoviMassiviPanel rmp = new RinnoviMassiviPanel(idPeriodico);
holder.add(rmp);
//Icona aggiungi riga
InlineHTML newImg = new InlineHTML(ClientConstants.ICON_ADD);
newImg.setTitle("Nuova riga");
newImg.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
rmp.addNewRow();
}
});
holder.add(newImg);
HorizontalPanel buttonPanel = new HorizontalPanel();
//Bottone salva
Button saveButton = new Button(ClientConstants.ICON_SAVE+" Salva");
saveButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
rmp.save();
}
});
buttonPanel.add(saveButton);
//Separatore
buttonPanel.add(new Image("img/separator.gif"));
//Bottone avvia rinnovo massivo
Button startButton = new Button("Avvia rinnovo massivo");
startButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
avviaRinnovo(thisForm);
}
});
buttonPanel.add(startButton);
holder.add(buttonPanel);
//Avviso
buttonPanel.add(new InlineHTML(" "+ClientConstants.ICON_WARNING+" "+
"I nuovi <b>fascicoli</b> e i nuovi <b>listini</b> devono essere già pronti"));
//Hidden values
utenteHid = new Hidden(AppConstants.PARAM_ID_UTENTE);
utenteHid.setValue(AuthSingleton.get().getUtente().getId());
holder.add(utenteHid);
rapportoHid = new Hidden(AppConstants.PARAM_ID_RAPPORTO);
rapportoHid.setValue("0");
holder.add(rapportoHid);
thisForm.add(holder);
}
private void avviaRinnovo(RinnoviPanel form) {
boolean confirm1 = Window.confirm(
"Vuoi veramente avviare il rinnovo massivo?\r\n"+
"La configurazione deve essere salvata prima di proseguire.");
if (confirm1) {
boolean confirm2 = Window.confirm("E' un'operazione molto pericolosa e IRREVERSIBILE, vuoi veramente rinnovare?");
if (confirm2) {
createRapporto(form, AuthSingleton.get().getUtente().getId());
}
}
}
public void onSubmit(int idRapporto) {
rapportoHid.setValue(idRapporto+"");
String servletURL = GWT.getModuleBaseURL()+AppConstants.SERVLET_RINNOVO_MASSIVO +
"?" + AppConstants.PARAM_ID_UTENTE + "=" + utenteHid.getValue() +
"&" + AppConstants.PARAM_ID_PERIODICO + "=" + periodicoHid.getValue() +
"&" + AppConstants.PARAM_ID_RAPPORTO + "=" + rapportoHid.getValue();
new DownloadIFrame(servletURL);
showLogTable(idRapporto);
}
}
}
|
[
"p.tacconi@giunti.it"
] |
p.tacconi@giunti.it
|
0eeeaff0702b6ec55c50809294c6dd58d7a36582
|
27511a2f9b0abe76e3fcef6d70e66647dd15da96
|
/src/com/instagram/ui/j/am.java
|
bac98447a32a8e328cc540efc174a83d03b0d658
|
[] |
no_license
|
biaolv/com.instagram.android
|
7edde43d5a909ae2563cf104acfc6891f2a39ebe
|
3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de
|
refs/heads/master
| 2022-05-09T15:05:05.412227
| 2016-07-21T03:48:36
| 2016-07-21T03:48:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 427
|
java
|
package com.instagram.ui.j;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
final class am
implements Runnable
{
am(ap paramap, Handler paramHandler) {}
public final void run()
{
ap.e(b);
((HandlerThread)a.getLooper().getThread()).quit();
}
}
/* Location:
* Qualified Name: com.instagram.ui.j.am
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
5524f93743a44573ceda035aab74d8a870952cc4
|
e89d45f9e6831afc054468cc7a6ec675867cd3d7
|
/src/main/java/com/microsoft/graph/models/extensions/DeviceManagementConfigurationDependentOn.java
|
197b5a79ae56969988388a538e003a6213f6d221
|
[
"MIT"
] |
permissive
|
isabella232/msgraph-beta-sdk-java
|
67d3b9251317f04a465042d273fe533ef1ace13e
|
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
|
refs/heads/dev
| 2023-03-12T05:44:24.349020
| 2020-11-19T15:51:17
| 2020-11-19T15:51:17
| 318,158,544
| 0
| 0
|
MIT
| 2021-02-23T20:48:09
| 2020-12-03T10:37:46
| null |
UTF-8
|
Java
| false
| false
| 2,541
|
java
|
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.models.extensions;
import com.microsoft.graph.serializer.ISerializer;
import com.microsoft.graph.serializer.IJsonBackedObject;
import com.microsoft.graph.serializer.AdditionalDataManager;
import java.util.EnumSet;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Device Management Configuration Dependent On.
*/
public class DeviceManagementConfigurationDependentOn implements IJsonBackedObject {
@SerializedName("@odata.type")
@Expose
public String oDataType;
private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this);
@Override
public final AdditionalDataManager additionalDataManager() {
return additionalDataManager;
}
/**
* The Dependent On.
* Identifier of parent setting/ parent setting option dependent on
*/
@SerializedName(value = "dependentOn", alternate = {"DependentOn"})
@Expose
public String dependentOn;
/**
* The Parent Setting Id.
* Identifier of parent setting/ parent setting id dependent on
*/
@SerializedName(value = "parentSettingId", alternate = {"ParentSettingId"})
@Expose
public String parentSettingId;
/**
* The raw representation of this class
*/
private JsonObject rawObject;
/**
* The serializer
*/
private ISerializer serializer;
/**
* Gets the raw representation of this class
*
* @return the raw representation of this class
*/
public JsonObject getRawObject() {
return rawObject;
}
/**
* Gets serializer
*
* @return the serializer
*/
protected ISerializer getSerializer() {
return serializer;
}
/**
* Sets the raw JSON object
*
* @param serializer the serializer
* @param json the JSON object to set this object to
*/
public void setRawObject(final ISerializer serializer, final JsonObject json) {
this.serializer = serializer;
rawObject = json;
}
}
|
[
"GraphTooling@service.microsoft.com"
] |
GraphTooling@service.microsoft.com
|
6a909a164f2cb0ab79765e7b0e6831f5223327ae
|
e8cd24201cbfadef0f267151ea5b8a90cc505766
|
/group03/1360464792/src/main/java/rui/study/coding2017/coding/basic/LinkedList.java
|
f9669b99e14d5f039d6b0ec300e28713b00625de
|
[] |
no_license
|
XMT-CN/coding2017-s1
|
30dd4ee886dd0a021498108353c20360148a6065
|
382f6bfeeeda2e76ffe27b440df4f328f9eafbe2
|
refs/heads/master
| 2021-01-21T21:38:42.199253
| 2017-06-25T07:44:21
| 2017-06-25T07:44:21
| 94,863,023
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,599
|
java
|
package rui.study.coding2017.coding.basic;
/**
* 单向链表
*/
public class LinkedList {
private Node head;
private Node current;
private int size;
public LinkedList(){
}
public int size(){
return size;
}
public void add(Object o){
Node newNode=new Node(o,null);
if(size==0){
head=current=newNode;
}
current.next=newNode;
current=newNode;
size++;
}
public void add(int index , Object o){
checkIndexForAdd(index);
if(index==size){
add(o);
}else{
Node newNode=new Node(o,null);
if(index==0){
newNode.next=head;
head=newNode;
}else{
Node after=getIndexNode(index);
Node before=getIndexNode(index-1);
before.next=newNode;
newNode.next=after;
}
size++;
}
}
public Object get(int index){
return getIndexNode(index).data;
}
public void addFirst(Object obj){
add(0,obj);
}
public void addLast(Object obj){
if(size==0){
add(obj);
}else {
add(size,obj);
}
}
public Object remove(int index){
checkIndex(index);
Node needRemove;
if(index==0){
needRemove=head;
if(size==1){
head=null;
}else{
head=head.next;
}
}else{
needRemove=getIndexNode(index);
Node before=getIndexNode(index-1);
before.next=needRemove.next;
if(index==size-1){
current=before;
}
}
size--;
return needRemove.data;
}
public Object removeFirst(){
return remove(0);
}
public Object removeLast(){
return remove(size-1);
}
public Iterator iterator(){
return new LinkedListIterator();
}
public class LinkedListIterator implements Iterator{
private int cursor=0;
private Node cursorNode=head;
@Override
public boolean hasNext() {
return cursor!=size;
}
@Override
public Object next() {
Object object=cursorNode.data;
cursorNode=cursorNode.next;
cursor++;
return object;
}
}
private void checkIndexForAdd(int index){
if(!(index>=0&&index<=size)){
throw new IndexOutOfBoundsException("索引"+index+"越界!");
}
}
private void checkIndex(int index){
if(!(index>=0&&index<size)){
throw new IndexOutOfBoundsException("索引"+index+"越界!");
}
}
private Node getIndexNode(int index){
checkIndex(index);
if(index==0){
return head;
}else if(index+1==size){
return current;
}else{
boolean flag=false;
Node nodes=head;
int cursor=1;
while(!flag){
nodes=nodes.next;
flag=cursor==index;
cursor++;
}
return nodes;
}
}
private static class Node{
Object data;
Node next;
public Node(Object data, Node next) {
this.data = data;
this.next = next;
}
}
}
|
[
"542194147@qq.com"
] |
542194147@qq.com
|
54ed146da3289b231f8ef1869b59a8c873a46486
|
0429ec7192a11756b3f6b74cb49dc1ba7c548f60
|
/src/main/java/com/linkage/litms/common/corba/CorbaInst.java
|
c0bcbf9a099c0b6c4acdecc6077ec5a77b2a9550
|
[] |
no_license
|
lichao20000/WEB
|
5c7730779280822619782825aae58506e8ba5237
|
5d2964387d66b9a00a54b90c09332e2792af6dae
|
refs/heads/master
| 2023-06-26T16:43:02.294375
| 2021-07-29T08:04:46
| 2021-07-29T08:04:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,020
|
java
|
package com.linkage.litms.common.corba;
import java.util.Map;
import com.linkage.commons.db.PrepareSQL;
import com.linkage.litms.common.database.DataSetBean;
public abstract class CorbaInst {
// private NamingContext ncRef = null;
protected String getNameIor() {
String object_name = "NameService";
String object_poa = "/rootPoa";
return getNameIor(object_name, object_poa);
}
protected String getNameIor(String object_name, String object_poa) {
String ior = null;
String strSQL = "select ior from tab_ior where object_name='"
+ object_name + "' " + "and object_poa='" + object_poa
+ "' and object_port=0";
PrepareSQL psql = new PrepareSQL(strSQL);
Map fields = DataSetBean.getRecord(psql.getSQL());
if (fields != null) {
ior = (String) fields.get("ior");
}
return ior;
}
public abstract boolean bind();
public abstract org.omg.CORBA.Object getInstance();
}
|
[
"di4zhibiao.126.com"
] |
di4zhibiao.126.com
|
29a01f532bbde028994c8bb5ba65883d3d6f3f85
|
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
|
/tags/2008-08-12/seasar2-2.4.27/s2jdbc-gen/s2jdbc-gen-core/src/main/java/org/seasar/extension/jdbc/gen/sql/SqlFileExecutorImpl.java
|
2158d9ed95a5072b543c998405f76537968061e2
|
[] |
no_license
|
svn2github/s2container
|
54ca27cf0c1200a93e1cb88884eb8226a9be677d
|
625adc6c4e1396654a7297d00ec206c077a78696
|
refs/heads/master
| 2020-06-04T17:15:02.140847
| 2013-08-09T09:38:15
| 2013-08-09T09:38:15
| 10,850,644
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,220
|
java
|
/*
* Copyright 2004-2008 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.extension.jdbc.gen.sql;
import java.io.File;
import java.sql.SQLException;
import java.sql.Statement;
import org.seasar.extension.jdbc.gen.GenDialect;
import org.seasar.extension.jdbc.gen.SqlExecutionContext;
import org.seasar.extension.jdbc.gen.SqlFileExecutor;
import org.seasar.extension.jdbc.gen.exception.SqlFailedException;
import org.seasar.framework.log.Logger;
/**
* {@link SqlFileExecutor}の実装クラスです。
*
* @author taedium
*/
public class SqlFileExecutorImpl implements SqlFileExecutor {
/** ロガー */
protected static Logger logger = Logger
.getLogger(SqlFileExecutorImpl.class);
/** 方言 */
protected GenDialect dialect;
/** SQLファイルのエンコーディング */
protected String sqlFileEncoding;
/** SQLステートメントの区切り文字 */
protected char statementDelimiter;
/** SQLブロックの区切り文字 */
protected String blockDelimiter;
/** SQLファイルのトークナイザ */
protected SqlFileTokenizer tokenizer;
/**
* @param dialect
* 方言
* @param sqlFileEncoding
* SQLファイルのエンコーディング
* @param statementDelimiter
* SQLステートメントの区切り文字
* @param blockDelimiter
* SQLブロックの区切り文字
*/
public SqlFileExecutorImpl(GenDialect dialect, String sqlFileEncoding,
char statementDelimiter, String blockDelimiter) {
if (dialect == null) {
throw new NullPointerException("dialect");
}
if (sqlFileEncoding == null) {
throw new NullPointerException("sqlFileEncoding");
}
this.sqlFileEncoding = sqlFileEncoding;
this.statementDelimiter = statementDelimiter;
this.blockDelimiter = blockDelimiter;
this.dialect = dialect;
tokenizer = createSqlFileTokenizer();
}
public void execute(SqlExecutionContext context, File sqlFile) {
logger.log("DS2JDBCGen0006", new Object[] { sqlFile.getPath() });
SqlFileReader reader = createSqlFileReader(sqlFile);
try {
for (String sql = reader.readSql(); sql != null; sql = reader
.readSql()) {
logger.log("DS2JDBCGen0007", new Object[] { sql });
Statement statement = context.getStatement();
try {
statement.execute(sql);
} catch (SQLException e) {
context.addException(new SqlFailedException(e, sqlFile
.getPath(), sql));
}
}
} finally {
reader.close();
}
}
/**
* {@link SqlFileTokenizer}の実装を作成します。
*
* @return {@link SqlFileTokenizer}
*/
protected SqlFileTokenizer createSqlFileTokenizer() {
return new SqlFileTokenizer(statementDelimiter,
blockDelimiter != null ? blockDelimiter : dialect
.getSqlBlockDelimiter());
}
/**
* {@link SqlFileReader}の実装を作成します。
*
* @param sqlFile
* SQLファイル
*
* @return {@link SqlFileReader}の実装
*/
protected SqlFileReader createSqlFileReader(File sqlFile) {
return new SqlFileReader(sqlFile, sqlFileEncoding, tokenizer, dialect);
}
}
|
[
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] |
koichik@319488c0-e101-0410-93bc-b5e51f62721a
|
1b7b936c9567388caeeaf940274421a6c8f26395
|
d10b03a30d2cbb58be2500c08a82207eaab070a0
|
/src/main/java/org/spongepowered/common/data/manipulator/immutable/extra/ImmutableSpongeFluidItemData.java
|
5141982733a8ebf1d854e7e77a95580f5bfc9306
|
[
"MIT"
] |
permissive
|
hsyyid/SpongeCommon
|
587d1dd6b5e49020011fdeea6a1852a791c8fd39
|
49b565e59953188a42d16d59ae4ba55c03fd3ec2
|
refs/heads/master
| 2020-12-25T01:05:31.768497
| 2016-04-01T18:02:41
| 2016-04-01T20:50:52
| 40,790,345
| 0
| 2
| null | 2015-08-15T23:01:17
| 2015-08-15T23:01:17
| null |
UTF-8
|
Java
| false
| false
| 2,825
|
java
|
/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.common.data.manipulator.immutable.extra;
import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.data.value.immutable.ImmutableValue;
import org.spongepowered.api.extra.fluid.FluidStackSnapshot;
import org.spongepowered.api.extra.fluid.data.manipulator.immutable.ImmutableFluidItemData;
import org.spongepowered.api.extra.fluid.data.manipulator.mutable.FluidItemData;
import org.spongepowered.common.data.manipulator.immutable.common.AbstractImmutableSingleData;
import org.spongepowered.common.data.manipulator.mutable.extra.SpongeFluidItemData;
import org.spongepowered.common.data.value.immutable.ImmutableSpongeValue;
import org.spongepowered.common.extra.fluid.SpongeFluidStackSnapshot;
public class ImmutableSpongeFluidItemData extends AbstractImmutableSingleData<FluidStackSnapshot, ImmutableFluidItemData, FluidItemData> implements ImmutableFluidItemData {
public ImmutableSpongeFluidItemData(FluidStackSnapshot value) {
super(ImmutableFluidItemData.class, value, Keys.FLUID_ITEM_STACK);
}
@Override
protected ImmutableValue<FluidStackSnapshot> getValueGetter() {
return new ImmutableSpongeValue<>(Keys.FLUID_ITEM_STACK, SpongeFluidStackSnapshot.DEFAULT, this.value);
}
@Override
public FluidItemData asMutable() {
return new SpongeFluidItemData(this.value);
}
@Override
public int compareTo(ImmutableFluidItemData o) {
return 0;
}
@Override
public ImmutableValue<FluidStackSnapshot> fluid() {
return getValueGetter();
}
}
|
[
"gabizou@me.com"
] |
gabizou@me.com
|
91d526dd5b13a713c204fb5821a0596c0858ee56
|
36ed51ed011a593f70b985a160e670ec77e9d77c
|
/DP_BoxStackingImpl/src/BoxStacking.java
|
5b91e29f8f3450e9cca6ad7d859f6f3f1975de77
|
[] |
no_license
|
npalgit/dynpro
|
9be4592a1d7243a46e01b46f395f7e5709490b22
|
1e5bea35c90db4785aa47491fecae75e0af956d3
|
refs/heads/master
| 2021-06-04T16:15:10.856006
| 2016-10-08T23:32:13
| 2016-10-08T23:32:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,744
|
java
|
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
/*
* Given different dimensions and unlimited supply of boxes for each dimension, stack boxes
* on top of each other such that it has maximum height but with caveat that length and width
* of box on top should be strictly less than length and width of box under it. You can
* rotate boxes as you like.
*
* 1) Create all rotations of boxes such that length is always greater or equal to width
* 2) Sort boxes by base area in non increasing order (length * width). This is because box
* with more area will never ever go on top of box with less area.
* 3) Take T[] and result[] array of same size as total boxes after all rotations are done
* 4) Apply longest increasing subsequence type of algorithm to get max height.
*
* If n number of dimensions are given total boxes after rotation will be 3n.
* So space complexity is O(n)
* Time complexity - O(nlogn) to sort boxes. O(n^2) to apply DP on it So really O(n^2)
*/
public class BoxStacking {
public static void main(String[] args) {
BoxStacking bs = new BoxStacking();
int [][] input = {
{3, 2, 5},
{1, 2, 4}
};
int ans = bs.maxHeight(input);
System.out.println("max height: " + ans);
}
public int maxHeight(int [][] input) {
Box [] boxes = createBoxes(input);
Arrays.sort(boxes, new BoxComparator());
printBoxes(boxes);
int [] height = new int[boxes.length];
int [] result = new int[boxes.length];
for (int i=0; i<boxes.length; i++) {
height[i] = boxes[i].height;
result[i] = i;
}
for (int i=1; i<boxes.length; i++) {
for (int j=0; j<i; j++) {
if ((boxes[i].length < boxes[j].length) && (boxes[i].width < boxes[j].width)) {
height[i] = Math.max(height[i], + height[j]);
result[i] = j;
}
}
}
int maxHeight = 0;
int index = 0;
for (int i=0; i<height.length; i++) {
if (height[i] > maxHeight) {
maxHeight = height[i];
index = i;
}
}
ArrayList<Box> boxList = new ArrayList<Box>();
boxList.add(boxes[index]);
while (index != result[index]) {
index = result[index];
boxList.add(boxes[index]);
}
System.out.println("list of final boxes are: ");
for (Box box: boxList) {
System.out.println(box.toString());
}
return maxHeight;
}
public void printBoxes(Box [] boxes) {
for (Box B: boxes) {
System.out.println(B.toString());
}
}
public Box [] createBoxes(int [][] input) {
Box [] boxes = new Box[input.length*3];
int index = 0;
for (int i=0; i<input.length; i++) {
int [] aux = input[i];
int len = Math.max(aux[0], aux[1]);
int wid = Math.min(aux[0], aux[1]);
int ht = aux[2];
boxes[index++] = new Box(len, wid, ht);
len = Math.max(aux[1], aux[2]);
wid = Math.min(aux[1], aux[2]);
ht = aux[0];
boxes[index++] = new Box(len, wid, ht);
len = Math.max(aux[2], aux[0]);
wid = Math.min(aux[2], aux[0]);
ht = aux[1];
boxes[index++] = new Box(len, wid, ht);
}
return boxes;
}
}
class Box {
int length;
int width;
int height;
public Box(int length, int width, int height) {
this.length = length;
this.width = width;
this.height = height;
}
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append("[length: " + length + ", ");
sb.append("width: " + width + ", ");
sb.append("height: " + height + "]");
return sb.toString();
}
}
class BoxComparator implements Comparator<Box> {
@Override
public int compare(Box o1, Box o2) {
int baseArea1 = o1.length * o1.width;
int baseArea2 = o2.length * o2.width;
if (baseArea1 > baseArea2) {
return -1;
} else if (baseArea1 < baseArea2) {
return 1;
} else {
return 0;
}
}
}
|
[
"manibhushan.cs@gmail.com"
] |
manibhushan.cs@gmail.com
|
5513daef23085b3373318e9fa5a02fb1192b80aa
|
6a06db6e7f86711a6a64d09e44aebbad044d2540
|
/app/src/main/java/hungpt/development/RegisterActivity.java
|
8dfc4878f8e2191b3de966543c7c0021c483bf68
|
[] |
no_license
|
matsatit/Shipper
|
2b1330797c7107d3209c26bc1b9ca9c411fae5dc
|
df077fb2037f30b5f323d49bf7984bc89933738a
|
refs/heads/master
| 2021-03-27T15:25:40.727247
| 2017-04-27T06:10:53
| 2017-04-27T06:10:53
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,406
|
java
|
package hungpt.development;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.toolbox.Volley;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
final EditText etUsername = (EditText)findViewById(R.id.etUsername);
final EditText etPassword = (EditText)findViewById(R.id.etPass);
final EditText etName = (EditText) findViewById(R.id.etName);
final EditText etAddr = (EditText) findViewById(R.id.etAddr);
final EditText etPhone = (EditText)findViewById(R.id.etPhone);
final Spinner SpinnerList = (Spinner)findViewById(R.id.spTL);
final Button btRegister = (Button) findViewById(R.id.btRegister);
final TextView loginLink = (TextView) findViewById(R.id.tvLoginHere);
ArrayList<String> arrayTL = new ArrayList<String>();
arrayTL.add("Shipper");
arrayTL.add("Chủ Đơn");
ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, arrayTL);
arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
SpinnerList.setAdapter(arrayAdapter);
loginLink.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent loginIntent = new Intent(RegisterActivity.this, LoginActivity.class);
RegisterActivity.this.startActivity(loginIntent);
}
});
btRegister.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String username = etUsername.getText().toString();
final String password = etPassword.getText().toString();
final String hoten = etName.getText().toString() ;
final String diachi = etAddr.getText().toString();
final String phone = etPhone.getText().toString();
final String quyen = SpinnerList.getSelectedItem().toString();
final int quyen1;
if (quyen.equals("Shipper")) quyen1 = 1;
else quyen1 = 0;
Response.Listener<String>responseListener = new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject jsonResponse = new JSONObject(response);
Boolean success = jsonResponse.getBoolean("success");
if(success){
Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
RegisterActivity.this.startActivity(intent);
}
else{
AlertDialog.Builder builder = new AlertDialog.Builder(RegisterActivity.this);
builder.setMessage("Register Failed")
.setNegativeButton("Retry", null)
.create()
.show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
};
RegisterRequest registerRequest = new RegisterRequest( username, password, hoten, diachi, String.valueOf(quyen1), phone,responseListener);
RequestQueue queue = Volley.newRequestQueue(RegisterActivity.this);
queue.add(registerRequest);
}
});
}
}
|
[
"="
] |
=
|
82bf2d1f55ea640909af3f2eeb135093354cb439
|
6d61e8c6c74f53a0d2bdde075bc86ede918b13c4
|
/Code Samples/Matrix.java
|
604acf1f69378c3a26b806707f767cf7131d4100
|
[] |
no_license
|
PatrickCunanan/CS-203-Codes-UST-2nd-Year-2nd-Semester
|
2d95d07022f22e54079700e84f362dbbaddbbe3a
|
d66c4e55f473a14d75a8f011ddeef9fc2ab66dfc
|
refs/heads/master
| 2020-03-28T19:34:45.688939
| 2018-10-24T08:06:34
| 2018-10-24T08:06:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,825
|
java
|
//Cunanan, Patrick Bryan F.
//CS 203 2CS-B
//Lab Exercise 1
//Lab Exercise on matrices
//and iterative algorithms
import java.util.*;
public class Matrix{
//static initialization of Scanner
static Scanner Scan = new Scanner (System.in);
//global variables
static int i, j, k, l, m = 0, n = 0, p = 0, r = 0, s = 0, u = 0, v = 0;
static int M [][] = new int[][]{
{2,1,1,1,1,1,1,1,1,2},
{1,0,0,0,0,0,0,0,0,1},
{1,0,-1,-1,-1,-1,-1,-1,0,1},
{1,0,2,2,0,0,1,1,0,1},
{1,0,2,2,0,0,1,1,0,1},
{1,0,3,3,4,5,-2,-2,0,1},
{1,0,3,3,6,7,-2,-2,0,1},
{1,0,-1,-1,-1,-1,-1,-1,0,1},
{1,0,0,0,0,0,0,0,0,1},
{2,1,1,1,1,1,1,1,1,2}
};
static int A [][] = new int[100][100];
static int B [][] = new int[100][100];
static int P [][] = new int[100][100];
static void printsSubmatrixA (){
for (i = 0, j = r; j < (m+r); i++, j++){
for (k = 0, l = s; l < (n+s); k++, l++){
A[i][k] = M[j][l];
}
}
System.out.println("A");
for (i = 0; i < m; i++){
for (j = 0; j < n; j++){
System.out.printf("%3d ",A[i][j]);
}
System.out.println("");
}
}
static void printsSubmatrixB (){
for (i = 0, j = u; j < (n+u); i++, j++){
for (k = 0, l = v; l < (p+v); k++, l++){
B[i][k] = M[j][l];
}
}
System.out.println("B");
for (i = 0; i < n; i++){
for (j = 0; j < p; j++){
System.out.printf("%3d ",B[i][j]);
}
System.out.println("");
}
}
static void printsMatrixP (){
int P[][] = new int[100][100];
int ProductCounter = 0;
for (i = 0; i < m; i++){
for (j = 0; j < p; j++){
for (k = 0; k < n; k++){
ProductCounter += (A[i][k]*B[k][j]);
}
P[i][j] = ProductCounter;
ProductCounter = 0;
}
}
System.out.println("P");
for (i = 0; i < m; i++){
for (j = 0; j < p; j++){
System.out.printf("%3d ",P[i][j]);
}
System.out.println("");
}
}
public static void main (String[]args){
//initializations of variables
int t;
//print Array M
System.out.println("M");
for (i = 0; i < 10; i++){
for (j = 0; j < 10; j++){
System.out.printf("%3d ",M[i][j]);
}
System.out.println("");
}
System.out.print("t = ");
t = Scan.nextInt();
if (t == 0){
System.exit(0);
}
else if (t == 1){
do{
System.out.print("m = ");
m = Scan.nextInt();
System.out.print("n = ");
n = Scan.nextInt();
System.out.print("p = ");
p = Scan.nextInt();
System.out.print("r = ");
r = Scan.nextInt();
System.out.print("s = ");
s = Scan.nextInt();
System.out.print("u = ");
u = Scan.nextInt();
System.out.print("v = ");
v = Scan.nextInt();
printsSubmatrixA();
printsSubmatrixB();
printsMatrixP();
System.out.print("t = ");
t = Scan.nextInt();
}while(t == 1);
}
else if (t == 2 || t ==3){
//laboratory stuff
}
}
}
|
[
"="
] |
=
|
4e9722710bd4d9c129773e002c57360dc56030dd
|
6ca8c52621600eb4416467a1ae38e6bdc575f4c9
|
/AlgorithmCode/LintCode/Java/Valid Anagram.java
|
f3ea6cbed86e47c9f401bb22a7ab0abe8c400b25
|
[] |
no_license
|
hanrick2000/Data_Structure-Algorithm
|
b7081ded83cfc7886eb2cb799c1cb3b4797800e7
|
946ed8803da7008b592d33e28f4614cba05473aa
|
refs/heads/master
| 2021-01-03T05:09:54.313513
| 2020-01-14T13:48:34
| 2020-01-14T13:48:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,341
|
java
|
E
1519713982
tags: Hash Table, Sort
HashMap
```
/*
Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
s = "rat", t = "car", return false.
Note:
You may assume the string contains only lowercase alphabets.
Follow up:
What if the inputs contain unicode characters? How would you adapt your solution to such case?
Tags: Hash Table, Sort
Similar Problems: (M) Group Anagrams, (E) Palindrome Permutation
*/
/*
Thoughts:
Anagram: reorder of letters.
Use HashMap<charactor, count> to store the frequency of chars of 1st string, and check aginst 2nd string.
s character: +1;
t character: -1;
check count of each index in the map; they should all be 0
*/
class Solution {
public boolean isAnagram(String s, String t) {
if (s == null || t == null || s.length() != t.length()) {
return false;
}
if (s.equals(t)) {
return true;
}
final Map<Character, Integer> charMap = new HashMap<>();
for (int i = 0; i < s.length(); i++) {
char charS = s.charAt(i);
char charT = t.charAt(i);
if (!charMap.containsKey(charS)) {
charMap.put(charS, 0);
}
if (!charMap.containsKey(charT)) {
charMap.put(charT, 0);
}
charMap.put(charS, charMap.get(charS) + 1);
charMap.put(charT, charMap.get(charT) - 1);
}
for (Map.Entry<Character, Integer> entry: charMap.entrySet()) {
if (entry.getValue() != 0) {
return false;
}
}
return true;
}
}
/*
Thoughts: if only lower case letters, use int[26] for simplicity
*/
class Solution {
public boolean isAnagram(String s, String t) {
if (s == null || t == null || s.length() != t.length()) {
return false;
}
if (s.equals(t)) {
return true;
}
int[] chars = new int[26];
for (int i = 0; i < s.length(); i++) {
chars[s.charAt(i) - 'a'] += 1;
chars[t.charAt(i) - 'a'] -= 1;
}
for (int i = 0; i < chars.length; i++) {
if (chars[i] != 0) {
return false;
}
}
return true;
}
}
```
|
[
"673556024@qq.com"
] |
673556024@qq.com
|
e1ccdce3e367ebb377f051b5a9c7efc7cc1526d1
|
7f20b1bddf9f48108a43a9922433b141fac66a6d
|
/core3/ding-presentation-impl/branches/vp-tree/src/main/java/org/cytoscape/ding/Bend.java
|
35448294e559051aebcf15086f7e16415c4af268
|
[] |
no_license
|
ahdahddl/cytoscape
|
bf783d44cddda313a5b3563ea746b07f38173022
|
a3df8f63dba4ec49942027c91ecac6efa920c195
|
refs/heads/master
| 2020-06-26T16:48:19.791722
| 2013-08-28T04:08:31
| 2013-08-28T04:08:31
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,842
|
java
|
package org.cytoscape.ding;
import java.awt.geom.Point2D;
/**
* A class that encapsulates the representation of the bend used for a
* particular EdgeView.
*
* @author Mike Smoot (mes5k)
*/
public interface Bend {
/**
* Given a list of points removes all existing handles/handlePoints
* and adds new ones for those specified in the List.
* @param bendPoints A list of Point2Ds to create new handles.
*/
public void setHandles( java.util.List bendPoints );
/**
* Returns a (new) List of clones of the Point2Ds that locate the handles.
*/
public java.util.List<Point2D> getHandles();
/**
* Moves the handle specified at the given index to the given point.
* @param i Index of the handle to move.
* @param pt Point2D to which to move the specified handle.
*/
public void moveHandle( int i, Point2D pt );
/**
* Returns the handle Point2D closest to the source node.
*/
public Point2D getSourceHandlePoint ();
/**
* Returns the handle Point2D closest to the target node.
*/
public Point2D getTargetHandlePoint ();
/**
* Add a PHandle to the edge at the point specified. Acts as
* an interface to actuallyAddHandle() which does the actual adding.
*
* @param pt The point at which to draw the PHandle and to which the
* PHandle will be attached via the locator.
*/
public void addHandle ( Point2D pt );
/**
* Add a PHandle to the edge at the point and index specified. Acts as
* an interface to actuallyAddHandle() which does the actual adding.
*
* @param insertIndex The index at which to add the PHandle to the
* list of handles.
* @param pt The point at which to draw the PHandle and to which the
* PHandle will be attached via the locator.
*/
public void addHandle ( int insertIndex , Point2D pt );
/**
* Removes the PHandle at the specified point.
*
* @param pt If this point intersects an existing PHandle, then remove that
* PHandle.
*/
public void removeHandle ( Point2D pt );
/**
* Removes the PHandle at the given index.
*
* @param i The index of the PHandle to remove.
*/
public void removeHandle ( int i );
/**
* Removes all handles
*/
public void removeAllHandles () ;
/**
* Checks to see if a PHandle already exists for the given point.
*
* @param pt If this point intersects a currently existing PHandle, then
* return true, else return false.
*/
public boolean handleAlreadyExists ( Point2D pt );
/**
* Draws any handles previously added.
*/
public void drawSelected();
/**
* Removes any handles from the display.
*/
public void drawUnselected();
/**
* Returns a list of points that define what gets drawn and hence
* what is visible to the user.
*/
public Point2D[] getDrawPoints();
}
|
[
"kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] |
kono@0ecc0d97-ab19-0410-9704-bfe1a75892f5
|
7ccfc979cb38fcb2bad4ae3f55993b70e311a2f4
|
3796f6edf053b9f613370e96ae8cde48065aed33
|
/finance/src/main/java/tk/zielony/randomdata/finance/StringAmountGenerator.java
|
e71fe690b0cb729723580402eee7ccdccac2ffb0
|
[
"Apache-2.0"
] |
permissive
|
lindy8632/RandomData
|
3c8555456591c604ad248843d5de77eafaa9a4ae
|
812a7c222afb4e6edd11414f42270d7e5c92e813
|
refs/heads/master
| 2021-01-21T09:34:01.231255
| 2017-04-23T21:36:45
| 2017-04-23T21:36:45
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 842
|
java
|
package tk.zielony.randomdata.finance;
import java.util.Currency;
import java.util.Locale;
import tk.zielony.randomdata.DataContext;
import tk.zielony.randomdata.Matcher;
/**
* Created by Marcin on 27.03.2017.
*/
public class StringAmountGenerator extends AmountGenerator<String> {
public StringAmountGenerator() {
super();
}
public StringAmountGenerator(int max, boolean useCommon) {
super(max, useCommon);
}
@Override
protected Matcher getDefaultMatcher() {
return f -> f.getType().equals(String.class) && f.getName().contains("amount");
}
@Override
public String next(DataContext context) {
Currency currency = Currency.getInstance(Locale.getDefault());
return String.format(Locale.getDefault(), "%s %.2f", currency.getSymbol(), next2(context));
}
}
|
[
"niewartotupisac@gmail.com"
] |
niewartotupisac@gmail.com
|
87cec3d1355a51fd5946c583f3cc20dc8303af46
|
776ca746c61ae4879b32c470a423f9de43f807b7
|
/generatorcode-ppms/src/main/java/com/github/fartherp/generatorcode/ppms/java/file/PPmsJavaGenerator.java
|
f9465153f1668ca46b66b6600dd95ce3b4e1af07
|
[
"Apache-2.0"
] |
permissive
|
fartherp/generator-code-integration
|
c51ddd95c478bcddfd963e55c6b6d867fe5ccbd6
|
6406dc105d6d0ed2d4e42ab31cea3465de5d6d46
|
refs/heads/master
| 2021-09-24T01:42:34.677945
| 2018-10-01T09:24:18
| 2018-10-01T09:24:18
| 104,735,167
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,010
|
java
|
/*
* Copyright (c) 2017. CK. All rights reserved.
*/
package com.github.fartherp.generatorcode.ppms.java.file;
import com.github.fartherp.codegenerator.db.TableInfoWrapper;
import com.github.fartherp.codegenerator.java.element.AbstractJavaElementGenerator;
import com.github.fartherp.codegenerator.java.file.AbstractJavaGenerator;
import com.github.fartherp.generatorcode.ppms.db.PPmsAttributes;
import com.github.fartherp.generatorcode.ppms.java.element.PPmsActionGenerator;
import com.github.fartherp.generatorcode.ppms.java.element.PPmsBaseBoGenerator;
import com.github.fartherp.generatorcode.ppms.java.element.PPmsDaoGenerator;
import com.github.fartherp.generatorcode.ppms.java.element.PPmsServiceGenerator;
import com.github.fartherp.generatorcode.ppms.java.element.PPmsServiceImplGenerator;
import com.github.fartherp.javacode.CompilationUnit;
import java.util.List;
/**
* Created by IntelliJ IDEA .
* Auth: CK
* Date: 2016/7/10
*/
public class PPmsJavaGenerator extends AbstractJavaGenerator<PPmsAttributes> {
public PPmsJavaGenerator(TableInfoWrapper<PPmsAttributes> t) {
super(t);
}
public void getJavaFile(List<CompilationUnit> answers) {
AbstractJavaElementGenerator<PPmsAttributes> extendBo = new PPmsBaseBoGenerator(tableInfoWrapper);
initializeAndExecuteGenerator(extendBo, answers);
AbstractJavaElementGenerator<PPmsAttributes> dao = new PPmsDaoGenerator(tableInfoWrapper);
initializeAndExecuteGenerator(dao, answers);
AbstractJavaElementGenerator<PPmsAttributes> service = new PPmsServiceGenerator(tableInfoWrapper);
initializeAndExecuteGenerator(service, answers);
AbstractJavaElementGenerator<PPmsAttributes> serverImpl = new PPmsServiceImplGenerator(tableInfoWrapper);
initializeAndExecuteGenerator(serverImpl, answers);
AbstractJavaElementGenerator<PPmsAttributes> action = new PPmsActionGenerator(tableInfoWrapper);
initializeAndExecuteGenerator(action, answers);
}
}
|
[
"1qazxsw23edc"
] |
1qazxsw23edc
|
8b3438ccd8ac7d56b47918e46c16e74d520b21d8
|
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
|
/Freecol/rev5884-6672/right-trunk-6672/net/sf/freecol/client/gui/panel/StatisticsPanel.java
|
7b6c0e0a0b8031dfc0db0bdeb2be65daf8070dc5
|
[] |
no_license
|
joliebig/featurehouse_fstmerge_examples
|
af1b963537839d13e834f829cf51f8ad5e6ffe76
|
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
|
refs/heads/master
| 2016-09-05T10:24:50.974902
| 2013-03-28T16:28:47
| 2013-03-28T16:28:47
| 9,080,611
| 3
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,015
|
java
|
package net.sf.freecol.client.gui.panel;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Dimension;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import net.sf.freecol.client.gui.Canvas;
import net.sf.freecol.common.networking.StatisticsMessage;
public final class StatisticsPanel extends FreeColPanel implements ActionListener {
private static final Logger logger = Logger.getLogger(StatisticsPanel.class.getName());
class StatisticsModel extends AbstractTableModel {
private static final int NAME_COLUMN = 0, VALUE_COLUMN = 1;
private final String[] columnNames = { "Name", "Value" };
private Object data[][] = null;
public StatisticsModel() {
}
public void setData(HashMap<String,Long> statsData) {
this.data = new Object[2][statsData.size()];
int i=0;
for (String s : statsData.keySet()) {
data[NAME_COLUMN][i] = s;
data[VALUE_COLUMN][i] = statsData.get(s);
i++;
}
}
public int getColumnCount() {
return columnNames.length;
}
public String getColumnName(int column) {
return columnNames[column];
}
public int getRowCount() {
return data[NAME_COLUMN].length;
}
public Object getValueAt(int row, int column) {
if ((row < getRowCount()) && (column < getColumnCount()) && (row >= 0) && (column >= 0)) {
switch (column) {
case StatisticsModel.NAME_COLUMN:
return data[NAME_COLUMN][row];
case StatisticsModel.VALUE_COLUMN:
return data[VALUE_COLUMN][row];
}
}
return null;
}
public boolean isCellEditable(int row, int column) {
return false;
}
public Class<?> getColumnClass(int column) {
return getValueAt(0, column).getClass();
}
}
public StatisticsPanel(Canvas parent) {
super(parent, new BorderLayout());
StatisticsMessage serverStatistics = getController().getServerStatistics();
StatisticsMessage clientStatistics = new StatisticsMessage(getGame(), null);
JPanel header = new JPanel();
this.add(header, BorderLayout.NORTH);
header.add(new JLabel("Statistics"),JPanel.CENTER_ALIGNMENT);
JPanel statsPanel = new JPanel(new GridLayout(1,2));
JScrollPane scrollPane = new JScrollPane(statsPanel,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.getViewport().setOpaque(false);
scrollPane.setBorder(null);
this.add(scrollPane,BorderLayout.CENTER);
statsPanel.add(displayStatsMessage("Client", clientStatistics));
statsPanel.add(displayStatsMessage("Server", serverStatistics));
add(okButton, BorderLayout.SOUTH);
setSize(getPreferredSize());
}
private JPanel displayStatsMessage(String title, StatisticsMessage statistics) {
JPanel panel = new JPanel();
panel.setBorder(BorderFactory.createTitledBorder(title));
Box b = new Box(BoxLayout.Y_AXIS);
panel.add(b);
b.add(createStatsTable("Memory", statistics.getMemoryStatistics()));
b.add(createStatsTable("Game", statistics.getGameStatistics()));
if (statistics.getAIStatistics()!=null) {
b.add(createStatsTable("AI", statistics.getAIStatistics()));
} else {
b.add(new JLabel());
}
return panel;
}
private JPanel createStatsTable(String title, HashMap<String,Long> data) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(new JLabel(title), BorderLayout.NORTH);
StatisticsModel model = new StatisticsModel();
model.setData(data);
JTable table = new JTable(model);
table.setAutoCreateColumnsFromModel(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
JScrollPane scrollPane = new JScrollPane(table);
table.addNotify();
scrollPane.getViewport().setOpaque(false);
scrollPane.getColumnHeader().setOpaque(false);
panel.add(scrollPane, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(300, (data.size()+2)*17));
return panel;
}
}
|
[
"joliebig@fim.uni-passau.de"
] |
joliebig@fim.uni-passau.de
|
61461ee4ddb924606d61f5c3ce916bdd0e4f3383
|
331a54444ea173841a87d8fe5fbff59a73e6f5fc
|
/jrpc-spring/src/test/java/com/dinstone/jrpc/NamespaceHandlerTest.java
|
871555abe0b8d9e062c6fea92825d58692bfbced
|
[
"Apache-2.0"
] |
permissive
|
dzdqfq/jrpc
|
2c58e878c647c5d5967213b5ce9e7c15a34f6e8d
|
b830f206d578cc3a0580a6ac2b274040d25bc3c5
|
refs/heads/master
| 2021-10-09T06:51:43.595196
| 2018-12-23T02:22:00
| 2018-12-23T02:22:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,460
|
java
|
/*
* Copyright (C) 2013~2017 dinstone<dinstone@163.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.dinstone.jrpc;
import java.io.IOException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.dinstone.jrpc.demo.HelloService;
public class NamespaceHandlerTest {
public static void main(String[] args) {
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"application-context-sample.xml");
HelloService service = (HelloService) applicationContext.getBean("rhsv1");
try {
testHot(service);
} catch (Exception e) {
e.printStackTrace();
}
try {
testSend1k(service);
} catch (Exception e) {
e.printStackTrace();
}
try {
System.in.read();
} catch (IOException e) {
}
applicationContext.close();
}
protected static void testHot(HelloService service) {
long st = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
service.sayHello("dinstone");
}
long et = System.currentTimeMillis() - st;
System.out.println("hot takes " + et + "ms, " + (100000 * 1000 / et) + " tps");
}
public static void testSend1k(HelloService service) throws IOException {
byte[] mb = new byte[1 * 1024];
for (int i = 0; i < mb.length; i++) {
mb[i] = 65;
}
String name = new String(mb);
long st = System.currentTimeMillis();
int count = 10000;
for (int i = 0; i < count; i++) {
service.sayHello(name);
}
long et = System.currentTimeMillis() - st;
System.out.println("it takes " + et + "ms, 1k : " + (count * 1000 / et) + " tps");
}
}
|
[
"dinstone@163.com"
] |
dinstone@163.com
|
c6ca896d401d2326239a5efc7d5a6643d98a62d1
|
f2febbb4f57abfc5f5a340e88d1b15f49a7c1778
|
/src/main/java/com/sr178/game/server/client/socket/ClientBridgeEntry.java
|
b084049a654573299270fdf81bb75eb7c0e3f27a
|
[] |
no_license
|
jiaocq1972/game-server
|
07ca9461a6ea8d469240d3847314be30d2b19407
|
46d5a6153bb4554d73e69f434ddecc22fb626125
|
refs/heads/master
| 2020-04-23T02:48:13.617694
| 2019-07-07T04:08:50
| 2019-07-07T04:08:50
| 170,857,807
| 0
| 0
| null | 2019-02-15T11:55:25
| 2019-02-15T11:55:25
| null |
UTF-8
|
Java
| false
| false
| 1,939
|
java
|
package com.sr178.game.server.client.socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.sr178.game.framework.log.LogSystem;
import com.sr178.game.msgbody.common.codec.DataCodecFactory;
import com.sr178.game.msgbody.common.model.Msg;
import com.sr178.game.server.bridge.IBridgeEntry;
import com.sr178.game.server.callback.ICallBackHandler;
import com.sr178.game.server.channel.Channel;
import com.sr178.game.server.constant.SystemConstant;
public class ClientBridgeEntry implements IBridgeEntry {
private Map<Long,ICallBackHandler> handlers = new ConcurrentHashMap<Long,ICallBackHandler>();
private MsgCodecType msgCodecType;
public ClientBridgeEntry(MsgCodecType msgCodecType){
this.msgCodecType = msgCodecType;
}
public void addCallBackHandler(long key,ICallBackHandler callBackHandler){
handlers.put(key, callBackHandler);
}
/**
* 连接关闭时 清除这些handler
* @param key
*/
public void removeCallBackHandler(long key){
ICallBackHandler backHandler = handlers.remove(key);
if(backHandler!=null){
backHandler.OnFail(null, null);
}
}
@Override
public void receivedData(Channel channel, byte[] datas) throws Exception {
List<Msg> msgs = null;
if(msgCodecType == MsgCodecType.Server){
msgs = DataCodecFactory.getInstance().decodeMsgServer(datas);
}else{
msgs = new ArrayList<Msg>();
msgs.addAll(DataCodecFactory.getInstance().decodeMsgUser(datas));
}
for(Msg msg:msgs){
ICallBackHandler backHandler = handlers.get(channel.getChannelId());
if(backHandler!=null){
if(msg.getMsgHead().getErrorCode()!=SystemConstant.SUCCESS_CODE){
backHandler.OnFail(msg, channel);
}else{
backHandler.onSuccess(msg, channel);
}
}else{
LogSystem.warn("CallbackHandler Is null!But has a response msg"+msg.getMsgHead().toString());
}
}
}
}
|
[
"dogdog7788@qq.com"
] |
dogdog7788@qq.com
|
4f68aafff2697da0235fe4ff455b3ee62e2315a1
|
b71a12e46a2582b915346c6ca21f8c2948aeef13
|
/.idea/fileTemplates/internal/Class.java
|
60c254d9bd549a1602cb4e22207f9b0de87e72a8
|
[] |
no_license
|
poomoo/HomeOnLine
|
21295eb89f8d41ca3d3b8dc913c8dc9b0669b45b
|
483099470ff74dcb76cd09825a999c91e28b979c
|
refs/heads/master
| 2020-04-04T06:12:27.958470
| 2017-03-10T04:54:41
| 2017-03-10T04:54:41
| 49,559,977
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,387
|
java
|
/**
* # #
* # _oo0oo_ #
* # o8888888o #
* # 88" . "88 #
* # (| -_- |) #
* # 0\ = /0 #
* # ___/`---'\___ #
* # .' \\| |# '. #
* # / \\||| : |||# \ #
* # / _||||| -:- |||||- \ #
* # | | \\\ - #/ | | #
* # | \_| ''\---/'' |_/ | #
* # \ .-\__ '-' ___/-. / #
* # ___'. .' /--.--\ `. .'___ #
* # ."" '< `.___\_<|>_/___.' >' "". #
* # | | : `- \`.;`\ _ /`;.`/ - ` : | | #
* # \ \ `_. \_ __\ /__ _/ .-` / / #
* # =====`-.____`.___ \_____/___.-`___.-'===== #
* # `=---=' #
* # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
* # #
* # 佛祖保佑 永无BUG #
* # #
* Copyright (c) ${YEAR}. 李苜菲 Inc. All rights reserved.
*/
|
[
"454592359@qq.com"
] |
454592359@qq.com
|
45fbe82176d2920128b0a59c304f92fbe06860f5
|
df58a5796a20f59942d4decb01ee9ee61b584e15
|
/java/CreationalDP/Prototype/Book.java
|
ccad21127508cb24a480fed87b4e77d2416d965b
|
[] |
no_license
|
daudzaidi/interview
|
30da34f934902f0e871f485a9a9bd631b38174ed
|
7beb4c632fbad1d3d73f30d31c2fb2428ec05c5f
|
refs/heads/master
| 2021-01-23T00:28:55.941874
| 2017-01-16T17:54:06
| 2017-01-16T17:54:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 322
|
java
|
package CreationalDP.Prototype;
/**
* Created by shalvi on 20/03/16.
*/
public class Book extends Item {
public int getNumberOfPages() {
return numberOfPages;
}
public void setNumberOfPages(int numberOfPages) {
this.numberOfPages = numberOfPages;
}
private int numberOfPages;
}
|
[
"shyamsunderpandita@SHYAMs-MacBook-Pro.local"
] |
shyamsunderpandita@SHYAMs-MacBook-Pro.local
|
0e169f013529a4b2088d7ea83d2fd5e1040d478c
|
5f82aae041ab05a5e6c3d9ddd8319506191ab055
|
/Projects/JacksonDatabind/56/src/main/java/com/fasterxml/jackson/databind/introspect/Annotated.java
|
90ed52447888130d850f2a27f8bd0d4adb93fa5b
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] |
permissive
|
lingming/prapr_data
|
e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc
|
be9ababc95df45fd66574c6af01122ed9df3db5d
|
refs/heads/master
| 2023-08-14T20:36:23.459190
| 2021-10-17T13:49:39
| 2021-10-17T13:49:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,558
|
java
|
package com.fasterxml.jackson.databind.introspect;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeBindings;
/**
* Shared base class used for anything on which annotations (included
* within a {@link AnnotationMap}).
*/
public abstract class Annotated
{
protected Annotated() { }
public abstract <A extends Annotation> A getAnnotation(Class<A> acls);
public abstract boolean hasAnnotation(Class<?> acls);
/**
* @since 2.7
*/
public abstract boolean hasOneOf(Class<? extends Annotation>[] annoClasses);
/**
* Fluent factory method that will construct a new instance that uses specified
* instance annotations instead of currently configured ones.
*/
public abstract Annotated withAnnotations(AnnotationMap fallback);
/**
* Fluent factory method that will construct a new instance that uses
* annotations from specified {@link Annotated} as fallback annotations
*/
public final Annotated withFallBackAnnotationsFrom(Annotated annotated) {
return withAnnotations(AnnotationMap.merge(getAllAnnotations(), annotated.getAllAnnotations()));
}
/**
* Method that can be used to find actual JDK element that this instance
* represents. It is non-null, except for method/constructor parameters
* which do not have a JDK counterpart.
*/
public abstract AnnotatedElement getAnnotated();
protected abstract int getModifiers();
public final boolean isPublic() {
return Modifier.isPublic(getModifiers());
}
public abstract String getName();
/**
* Full generic type of the annotated element; definition
* of what exactly this means depends on sub-class.
*
* @since 2.7
*/
public abstract JavaType getType();
/**
* @deprecated Since 2.7 Use {@link #getType()} instead. To be removed from 2.8.
*/
@Deprecated
public final JavaType getType(TypeBindings bogus) {
return getType();
}
/**
* JDK declared generic type of the annotated element; definition
* of what exactly this means depends on sub-class. Note that such type
* can not be reliably resolved without {@link TypeResolutionContext}, and
* as a result use of this method was deprecated in Jackson 2.7: see
* {@link #getType} for replacement.
*
* @deprecated Since 2.7 should instead use {@link #getType()}. To be removed from 2.8
*/
@Deprecated
public Type getGenericType() {
return getRawType();
}
/**
* "Raw" type (type-erased class) of the annotated element; definition
* of what exactly this means depends on sub-class.
*/
public abstract Class<?> getRawType();
/**
* Accessor that can be used to iterate over all the annotations
* associated with annotated component.
*
* @since 2.3
*/
public abstract Iterable<Annotation> annotations();
/**
* Internal helper method used to access annotation information;
* not exposed to developers since instances are mutable.
*/
protected abstract AnnotationMap getAllAnnotations();
// Also: ensure we can use #equals, #hashCode
@Override
public abstract boolean equals(Object o);
@Override
public abstract int hashCode();
@Override
public abstract String toString();
}
|
[
"2890268106@qq.com"
] |
2890268106@qq.com
|
cd180519f23de371fff1c2b23bdaca2f65c36c83
|
fb8c3a8781476b462e50f5e3b45d951d375b6c95
|
/aliyun-java-sdk-mpaas/src/main/java/com/aliyuncs/mpaas/model/v20200710/CreateOpenGlobalDataResponse.java
|
ca598ea938bda6e552498832a585b2ce92fcce2a
|
[
"Apache-2.0"
] |
permissive
|
yuan9778/aliyun-openapi-java-sdk
|
b10e7f1150c2575f0ade899414715ead7073bf92
|
c0f26f4622c8c74c53b1177e198d516a5f62dd81
|
refs/heads/master
| 2023-07-14T12:35:42.312757
| 2021-08-27T03:08:22
| 2021-08-27T03:08:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,876
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.mpaas.model.v20200710;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.mpaas.transform.v20200710.CreateOpenGlobalDataResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class CreateOpenGlobalDataResponse extends AcsResponse {
private String requestId;
private String resultCode;
private String resultMessage;
private Boolean result;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public String getResultCode() {
return this.resultCode;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultMessage() {
return this.resultMessage;
}
public void setResultMessage(String resultMessage) {
this.resultMessage = resultMessage;
}
public Boolean getResult() {
return this.result;
}
public void setResult(Boolean result) {
this.result = result;
}
@Override
public CreateOpenGlobalDataResponse getInstance(UnmarshallerContext context) {
return CreateOpenGlobalDataResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
f13990a2601f83407680422d9a4aeb4c3811d027
|
e2a1f09c671d43f3ea3f16fa7e60c81cec1a4e2d
|
/contextawareness-android-sdk/src/main/java/io/github/contextawareness/core/actions/contextcallback/ForEachContextCallback.java
|
8a3b5e72a30ba2653175cbbf0468a6717300b1a5
|
[] |
no_license
|
xinyu1118/EventAwareness
|
9cfd0f295603433df5dcd7406d8aa48d7cf5ed81
|
23666f9d791c4fcb0b2504ad25c7dd025ef37779
|
refs/heads/master
| 2020-03-28T13:13:43.598381
| 2019-01-22T02:00:53
| 2019-01-22T02:00:53
| 148,376,394
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 775
|
java
|
package io.github.contextawareness.core.actions.contextcallback;
import io.github.contextawareness.core.ContextAction;
import io.github.contextawareness.core.Function;
import io.github.contextawareness.core.Item;
import io.github.contextawareness.utils.Assertions;
class ForEachContextCallback extends ContextAction {
private final Function<Item, Void> itemCallback;
ForEachContextCallback(Function<Item, Void> itemCallback) {
this.itemCallback = Assertions.notNull("itemCallback", itemCallback);
this.addParameters(itemCallback);
}
@Override
protected void onInput(Item item) {
if (item.isEndOfStream()) {
this.finish();
return;
}
this.itemCallback.apply(this.getUQI(), item);
}
}
|
[
"yangxycl@163.com"
] |
yangxycl@163.com
|
ad8678c074fc5647ad2d426e1681bfc7f49b0d8d
|
b2f44ba766a44426cd06ebfb922d8b75c1773d63
|
/src/com/leetcode/P986_IntervalListIntersections.java
|
6a0d77841795b8ee4fc677092759f94034b8a94b
|
[] |
no_license
|
joy32812/leetcode
|
a1179ecff91127a6cda83cf70838354b0670970f
|
9bd74b9774012df0e2e221eedc63d10f3ba88238
|
refs/heads/master
| 2023-08-16T14:11:34.232388
| 2023-08-13T11:30:05
| 2023-08-13T11:30:05
| 81,704,645
| 10
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,647
|
java
|
package com.leetcode;
import java.util.ArrayList;
import java.util.List;
public class P986_IntervalListIntersections {
public Interval[] intervalIntersection(Interval[] A, Interval[] B) {
if (A == null || B == null || A.length == 0 || B.length == 0) return new Interval[0];
int i = 0;
int j = 0;
List<Interval> ansList = new ArrayList<>();
while (i < A.length && j < B.length) {
Interval a = A[i];
Interval b = B[j];
if (a.end < b.start) {
i ++;
} else if (b.end < a.start) {
j ++;
} else {
Interval now = new Interval();
now.start = Math.max(a.start, b.start);
now.end = Math.min(a.end, b.end);
ansList.add(now);
if (a.end < b.end) {
i ++;
} else {
j ++;
}
}
}
return ansList.toArray(new Interval[0]);
}
public static void main(String[] args) {
System.out.println(new P986_IntervalListIntersections().intervalIntersection(
new Interval[]{
new Interval(0, 2),
new Interval(5, 10),
new Interval(13, 23),
new Interval(24, 25)
},
new Interval[]{
new Interval(1, 5),
new Interval(8, 12),
new Interval(15, 24),
new Interval(25, 26)
}
));
}
}
|
[
"joy32812@qq.com"
] |
joy32812@qq.com
|
edde49b95813d39d8686d8833dd2bb2c25fd4661
|
f63bb4535e8347ffc73025ed3c58b845eeefc9ce
|
/ums-service/src/main/java/com/zscat/ums/impl/UmsMemberReceiveAddressServiceImpl.java
|
ab4f77fe36b30ba695e09730cc5c279291d0486f
|
[] |
no_license
|
442114004/mall-dubbo
|
ed1e6130ab0f14710fb975ac97ba0bf1e40564f9
|
1dfb2d6b262d19a859111d5451464be0b5a3d099
|
refs/heads/master
| 2020-04-27T16:11:43.405289
| 2019-03-08T05:31:41
| 2019-03-08T05:31:41
| 174,475,739
| 4
| 3
| null | 2019-03-08T05:37:56
| 2019-03-08T05:37:55
| null |
UTF-8
|
Java
| false
| false
| 3,687
|
java
|
package com.zscat.ums.impl;
import com.zscat.ums.mapper.UmsMemberReceiveAddressMapper;
import com.zscat.ums.model.UmsMember;
import com.zscat.ums.model.UmsMemberReceiveAddress;
import com.zscat.ums.model.UmsMemberReceiveAddressExample;
import com.zscat.ums.service.UmsMemberReceiveAddressService;
import com.zscat.ums.service.UmsMemberService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 用户地址管理Service实现类
* Created by zscat on 2018/8/28.
*/
@Service("umsMemberReceiveAddressService")
public class UmsMemberReceiveAddressServiceImpl implements UmsMemberReceiveAddressService {
@Resource
private UmsMemberService memberService;
@Resource
private UmsMemberReceiveAddressMapper addressMapper;
@Override
public int add(UmsMemberReceiveAddress address,UmsMember currentMember) {
address.setMemberId(currentMember.getId());
if (this.list(currentMember)!=null && this.list(currentMember).size()>0){
address.setDefaultStatus(0);
}else {
address.setDefaultStatus(1);
}
return addressMapper.insert(address);
}
@Override
public int delete(Long id,UmsMember currentMember) {
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
return addressMapper.deleteByExample(example);
}
@Override
public int update(Long id, UmsMemberReceiveAddress address,UmsMember currentMember) {
address.setId(null);
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
return addressMapper.updateByExampleSelective(address, example);
}
@Override
public List<UmsMemberReceiveAddress> list(UmsMember currentMember) {
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
example.createCriteria().andMemberIdEqualTo(currentMember.getId());
return addressMapper.selectByExample(example);
}
@Override
public UmsMemberReceiveAddress getItem(Long id,UmsMember currentMember) {
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andIdEqualTo(id);
List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
if (!CollectionUtils.isEmpty(addressList)) {
return addressList.get(0);
}
return null;
}
@Override
public UmsMemberReceiveAddress getDefaultItem(UmsMember currentMember) {
UmsMemberReceiveAddressExample example = new UmsMemberReceiveAddressExample();
example.createCriteria().andMemberIdEqualTo(currentMember.getId()).andDefaultStatusEqualTo(1);
List<UmsMemberReceiveAddress> addressList = addressMapper.selectByExample(example);
if (!CollectionUtils.isEmpty(addressList)) {
return addressList.get(0);
}
return null;
}
@Transactional
@Override
public int setDefault(Long id,UmsMember currentMember) {
addressMapper.updateStatusByMember(currentMember.getId());
UmsMemberReceiveAddress def = new UmsMemberReceiveAddress();
def.setId(id);
def.setDefaultStatus(1);
addressMapper.updateByPrimaryKeySelective(def);
return 1;
}
}
|
[
"zhuan.shen@rjfittime.com"
] |
zhuan.shen@rjfittime.com
|
4516fa57742d437a420c89d20186738961b1ed9a
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/1/1_c1bcf2f783b06cd41ffe64afa150096b2a55b741/CrystalBlock/1_c1bcf2f783b06cd41ffe64afa150096b2a55b741_CrystalBlock_s.java
|
a248afe4ad345bd46fd2d50d3251cdaee8a770d7
|
[] |
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
| 6,092
|
java
|
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2013
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.GeoStrata.Base;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityXPOrb;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import Reika.DragonAPI.Libraries.IO.ReikaPacketHelper;
import Reika.DragonAPI.Libraries.MathSci.ReikaMathLibrary;
import Reika.DragonAPI.Libraries.Registry.ReikaDyeHelper;
import Reika.GeoStrata.GeoStrata;
import Reika.GeoStrata.Blocks.BlockCaveCrystal;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public abstract class CrystalBlock extends Block {
protected final Icon[] icons = new Icon[ReikaDyeHelper.dyes.length];
public CrystalBlock(int ID, Material mat) {
super(ID, mat);
this.setCreativeTab(GeoStrata.tabGeo);
this.setHardness(1F);
}
@SideOnly(Side.CLIENT)
@Override
public final Icon getIcon(int s, int meta) {
return icons[meta];
}
@Override
public final int getRenderType() {
return GeoStrata.proxy.crystalRender; //6 was crops
}
@Override
public final boolean isOpaqueCube() {
return false;
}
@Override
public final boolean renderAsNormalBlock() {
return false;
}
@Override
public final int getRenderBlockPass() {
return 1;
}
@SideOnly(Side.CLIENT)
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
int color = world.getBlockMetadata(x, y, z);
double[] v = ReikaDyeHelper.getColorFromDamage(color).getRedstoneParticleVelocityForColor();
world.spawnParticle("reddust", x+rand.nextDouble(), y+rand.nextDouble(), z+rand.nextDouble(), v[0], v[1], v[2]);/*
//ReikaJavaLibrary.pConsole(FMLCommonHandler.instance().getEffectiveSide());
world.playSoundEffect(x+0.5, y+0.5, z+0.5, "random.orb", 1F, 1);*/
if (rand.nextInt(3) == 0)
ReikaPacketHelper.sendUpdatePacket(GeoStrata.packetChannel, 0, world, x, y, z);
}
@Override
@SideOnly(Side.CLIENT)
public boolean addBlockHitEffects(World world, MovingObjectPosition target, EffectRenderer effectRenderer)
{
Random rand = new Random();
int x = target.blockX;
int y = target.blockY;
int z = target.blockZ;
int color = world.getBlockMetadata(x, y, z);
double[] v = ReikaDyeHelper.getColorFromDamage(color).getRedstoneParticleVelocityForColor();
for (int i = 0; i < 4; i++)
world.spawnParticle("reddust", x+rand.nextDouble(), y+rand.nextDouble(), z+rand.nextDouble(), v[0], v[1], v[2]);
ReikaPacketHelper.sendUpdatePacket(GeoStrata.packetChannel, 0, world, x, y, z);
return false;
}
public void updateEffects(World world, int x, int y, int z) {
Random rand = new Random();
world.playSoundEffect(x+0.5, y+0.5, z+0.5, "random.orb", 0.1F, 0.5F * ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.8F));
if (this instanceof BlockCaveCrystal) {
AxisAlignedBB box = AxisAlignedBB.getAABBPool().getAABB(x, y, z, x+1, y+1, z+1).expand(3, 3, 3);
List inbox = world.getEntitiesWithinAABB(EntityLiving.class, box);
for (int i = 0; i < inbox.size(); i++) {
EntityLiving e = (EntityLiving)inbox.get(i);
if (ReikaMathLibrary.py3d(e.posX-x-0.5, e.posY+e.getEyeHeight()/2F-y-0.5, e.posZ-z-0.5) <= 4)
this.getEffectFromColor(e, ReikaDyeHelper.getColorFromDamage(world.getBlockMetadata(x, y, z)));
}
}
}
private void getEffectFromColor(EntityLiving e, ReikaDyeHelper color) {
int dura = 200;
switch(color) {
case BLACK:
if (e instanceof EntityMob) {
EntityMob m = (EntityMob)e;
m.setAttackTarget(null);
m.getNavigator().clearPathEntity();
}
break;
case BLUE:
e.addPotionEffect(new PotionEffect(Potion.nightVision.id, dura, 0));
break;
case BROWN:
if (e instanceof EntityPlayer) {
EntityPlayer ep = (EntityPlayer)e;
float sat = ep.getFoodStats().getSaturationLevel();
sat += 0.5F;
ep.getFoodStats().setFoodSaturationLevel(sat);
break;
}
case CYAN:
e.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, dura, 0));
break;
case GRAY:
e.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, dura, 0));
break;
case GREEN:
e.addPotionEffect(new PotionEffect(Potion.poison.id, dura, 0));
break;
case LIGHTBLUE:
e.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, dura, 0));
break;
case LIGHTGRAY:
e.addPotionEffect(new PotionEffect(Potion.weakness.id, dura, 0));
break;
case LIME:
e.addPotionEffect(new PotionEffect(Potion.jump.id, dura, 0));
break;
case MAGENTA:
e.addPotionEffect(new PotionEffect(Potion.regeneration.id, dura, 0));
break;
case ORANGE:
e.addPotionEffect(new PotionEffect(Potion.fireResistance.id, dura, 0));
break;
case PINK:
e.addPotionEffect(new PotionEffect(Potion.damageBoost.id, dura, 0));
break;
case PURPLE:
if (!e.worldObj.isRemote && new Random().nextInt(12) == 0)
e.worldObj.spawnEntityInWorld(new EntityXPOrb(e.worldObj, e.posX, e.posY, e.posZ, 1));
break;
case RED:
e.addPotionEffect(new PotionEffect(Potion.resistance.id, dura, 0));
break;
case WHITE:
e.clearActivePotions();
break;
case YELLOW:
e.addPotionEffect(new PotionEffect(Potion.digSpeed.id, dura, 0));
break;
default:
break;
}
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
8d12935ce2f0bfd5afa12336031794ac4817866f
|
cfc60fc1148916c0a1c9b421543e02f8cdf31549
|
/src/testcases/CWE78_OS_Command_Injection/CWE78_OS_Command_Injection__URLConnection_12.java
|
bb4205c54dc0a992f21a6bde2805ddbc95f234a5
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
zhujinhua/GitFun
|
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
|
987f72fdccf871ece67f2240eea90e8c1971d183
|
refs/heads/master
| 2021-01-18T05:46:03.351267
| 2012-09-11T16:43:44
| 2012-09-11T16:43:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,055
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__URLConnection_12.java
Label Definition File: CWE78_OS_Command_Injection.label.xml
Template File: sources-sink-12.tmpl.java
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: URLConnection Read a string from a web server with URLConnection
* GoodSource: A hardcoded string
* BadSink: exec dynamic command execution with Runtime.getRuntime().exec()
* Flow Variant: 12 Control flow: if(IO.static_returns_t_or_f())
*
* */
package testcases.CWE78_OS_Command_Injection;
import testcasesupport.*;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Logger;
public class CWE78_OS_Command_Injection__URLConnection_12 extends AbstractTestCase
{
/* uses badsource and badsink - see how tools report flaws that don't always occur */
public void bad() throws Throwable
{
String data;
if(IO.static_returns_t_or_f())
{
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
URLConnection conn = (new URL("http://www.example.org/")).openConnection();
BufferedReader buffread = null;
InputStreamReader instrread = null;
try
{
/* read input from URLConnection */
instrread = new InputStreamReader(conn.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine(); // This will be reading the first "line" of the response body,
// which could be very long if there are no newlines in the HTML
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally
{
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
}
}
else {
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
String osCommand;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
osCommand = "c:\\WINDOWS\\SYSTEM32\\cmd.exe /c dir ";
}
else
{
/* running on non-Windows */
osCommand = "/bin/ls ";
}
/* POTENTIAL FLAW: command injection */
Process p = Runtime.getRuntime().exec(osCommand + data);
p.waitFor();
}
/* goodG2B() - use goodsource and badsink by changing the "if" so that
both branches use the GoodSource */
private void goodG2B() throws Throwable
{
String data;
if(IO.static_returns_t_or_f())
{
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
else {
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
}
String osCommand;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
{
/* running on Windows */
osCommand = "c:\\WINDOWS\\SYSTEM32\\cmd.exe /c dir ";
}
else
{
/* running on non-Windows */
osCommand = "/bin/ls ";
}
/* POTENTIAL FLAW: command injection */
Process p = Runtime.getRuntime().exec(osCommand + data);
p.waitFor();
}
public void good() throws Throwable
{
goodG2B();
}
/* 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);
}
}
|
[
"amitf@chackmarx.com"
] |
amitf@chackmarx.com
|
601bbab9fc9dad4a9f07b5ee0878ab8dfa059e59
|
ec9dacd41c75346c05d836b4000a6eeadaa596e3
|
/kernelplatform/src/main/java/net/ytoec/kernel/service/impl/WarnValueServiceImpl.java
|
42fcd46d743ec64abc9245f6240d618d7ff7c255
|
[] |
no_license
|
Pd1r/eop
|
08295a8c2543c3f96470965fc9db90fcb186335a
|
0c43b484de6f08e57a64b5194fc1413db0fd78f4
|
refs/heads/master
| 2020-06-07T17:31:56.208813
| 2018-11-28T05:57:59
| 2018-11-28T05:57:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,505
|
java
|
package net.ytoec.kernel.service.impl;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import net.ytoec.kernel.dao.WarnValueDao;
import net.ytoec.kernel.dataobject.WarnValue;
import net.ytoec.kernel.service.WarnValueService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class WarnValueServiceImpl<T extends WarnValue> implements WarnValueService<T> {
private static Logger logger = LoggerFactory.getLogger(WarnValueServiceImpl.class);
@Inject
private WarnValueDao<T> dao;
@Override
public String addWarnValue(T entity) {
String resultString = "";
if(entity == null){
logger.error(WarnValue.class.getName() + "对象参数信息为空!");
resultString = "抱歉!系统繁忙,请稍后再试。";
return resultString;
}
//先判断是否存在相同预警值
T t = this.dao.searchWarnValueOneAdd(entity);
if(t != null){
logger.error("添加的预警值已存在!");
resultString="抱歉!不能重复添加。";
return resultString;
}
boolean b = false;
try{
this.dao.addWarnValue(entity);
b = true;
resultString = "";
}catch(Exception e){
logger.error("添加预警值异常!");
resultString = "抱歉!系统繁忙,请稍后再试。";
}
return resultString;
}
@Override
public boolean remove(T entity) {
boolean b = false;
try{
this.dao.removeWarnValue(entity);
b = true;
}catch(Exception e){
logger.error( "删除预警值异常!");
}
return b;
}
@Override
public String edit(T entity) {
if(entity == null){
logger.error(WarnValue.class.getName() + "对象参数信息为空!");
return "抱歉!系统繁忙,请稍后再试。";
}
//先判断是否存在相同预警值
T t = this.dao.searchWarnValueOne(entity);
if(t != null){
logger.error("预警值已存在!无法修改");
return "";
}
logger.info("预警值不存在,可以修改");
boolean b = false;
String resultString = "";
try{
this.dao.editWarnValue(entity);
b = true;
resultString = "";
}catch(Exception e){
logger.error( "修改预警值异常!");
resultString = "抱歉!系统繁忙,请稍后再试。";
}
return resultString;
}
@Override
public List<T> searchWarnValueBySellerId(T entity) throws Exception {
logger.info("查询卖家:"+entity.getSellerId()+"下的所有目的地");
List<T> list = null;
try{
list = this.dao.searchWarnValueMore(entity);
}catch(Exception e){
throw new Exception("查询卖家预警值异常");
}
return list;
}
@Override
public boolean operatorWarnValue(Map<String, Object> map) {
boolean result = true;
List<T> paramInsertList = (List<T>) map.get("paramInsertList");
List<T> paramUpdateList = (List<T>)map.get("paramUpdateList");
List<T> paramDeleteList = (List<T>)map.get("paramDeleteList");
//插入数据
if(paramInsertList != null && paramInsertList.size() >0){
for(T warnValue : paramInsertList){
result = this.dao.addWarnValue(warnValue);
}
}
if(paramUpdateList != null && paramUpdateList.size()> 0){
for(T warnValue : paramUpdateList){
result = this.dao.editWarnValue(warnValue);
}
}
if(paramDeleteList != null && paramDeleteList.size() >0){
for(T warnValue : paramDeleteList){
result = this.dao.removeWarnValue(warnValue);
}
}
return result;
}
}
|
[
"caozhi_soft@163.com"
] |
caozhi_soft@163.com
|
b9fac2b83ae41dabfeb85ce1190b91b6ad1e7218
|
964601fff9212bec9117c59006745e124b49e1e3
|
/matos-android/src/main/java/gov/nist/javax/sip/parser/ims/PAssertedIdentityParser.java
|
d2a049ff66c9cb67d9e9c8d8ee903c426b23f196
|
[
"Apache-2.0"
] |
permissive
|
vadosnaprimer/matos-profiles
|
bf8300b04bef13596f655d001fc8b72315916693
|
fb27c246911437070052197aa3ef91f9aaac6fc3
|
refs/heads/master
| 2020-05-23T07:48:46.135878
| 2016-04-05T13:14:42
| 2016-04-05T13:14:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,274
|
java
|
package gov.nist.javax.sip.parser.ims;
/*
* #%L
* Matos
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2010 - 2014 Orange SA
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public class PAssertedIdentityParser
extends gov.nist.javax.sip.parser.AddressParametersParser implements gov.nist.javax.sip.parser.TokenTypes
{
// Constructors
public PAssertedIdentityParser(java.lang.String arg1){
super((gov.nist.javax.sip.parser.Lexer) null);
}
protected PAssertedIdentityParser(gov.nist.javax.sip.parser.Lexer arg1){
super((gov.nist.javax.sip.parser.Lexer) null);
}
// Methods
public gov.nist.javax.sip.header.SIPHeader parse() throws java.text.ParseException{
return (gov.nist.javax.sip.header.SIPHeader) null;
}
}
|
[
"pierre.cregut@orange.com"
] |
pierre.cregut@orange.com
|
04128edc0542114089cfc0640f3a65a46964bbf9
|
9b75d8540ff2e55f9ff66918cc5676ae19c3bbe3
|
/bazaar8.apk-decompiled/sources/com/farsitel/bazaar/data/feature/payment/PaymentGateway.java
|
c87619df762bb34719da40a0f2ad93008e31cb17
|
[] |
no_license
|
BaseMax/PopularAndroidSource
|
a395ccac5c0a7334d90c2594db8273aca39550ed
|
bcae15340907797a91d39f89b9d7266e0292a184
|
refs/heads/master
| 2020-08-05T08:19:34.146858
| 2019-10-06T20:06:31
| 2019-10-06T20:06:31
| 212,433,298
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,684
|
java
|
package com.farsitel.bazaar.data.feature.payment;
import android.os.Parcel;
import android.os.Parcelable;
import com.crashlytics.android.answers.SessionEventTransform;
import h.f.b.f;
import h.f.b.j;
/* compiled from: PaymentEntities.kt */
public final class PaymentGateway extends PaymentData implements Parcelable {
public static final a CREATOR = new a(null);
public final String agreement;
public final String code;
public final String description;
public final String icon;
public final long price;
public final String subDescription;
public final String title;
public final String type;
/* compiled from: PaymentEntities.kt */
public static final class a implements Parcelable.Creator<PaymentGateway> {
public a() {
}
public /* synthetic */ a(f fVar) {
this();
}
public PaymentGateway createFromParcel(Parcel parcel) {
j.b(parcel, "parcel");
return new PaymentGateway(parcel);
}
public PaymentGateway[] newArray(int i2) {
return new PaymentGateway[i2];
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public PaymentGateway(String str, String str2, String str3, String str4, String str5, String str6, String str7, long j2) {
super(null);
j.b(str, "title");
j.b(str2, "icon");
j.b(str3, SessionEventTransform.TYPE_KEY);
j.b(str4, "code");
j.b(str5, "agreement");
j.b(str6, "description");
j.b(str7, "subDescription");
this.title = str;
this.icon = str2;
this.type = str3;
this.code = str4;
this.agreement = str5;
this.description = str6;
this.subDescription = str7;
this.price = j2;
}
public final String a() {
return this.agreement;
}
public final String b() {
return this.code;
}
public final String c() {
return this.description;
}
public final String d() {
return this.icon;
}
public int describeContents() {
return 0;
}
public final long e() {
return this.price;
}
public boolean equals(Object obj) {
if (this != obj) {
if (obj instanceof PaymentGateway) {
PaymentGateway paymentGateway = (PaymentGateway) obj;
if (j.a((Object) this.title, (Object) paymentGateway.title) && j.a((Object) this.icon, (Object) paymentGateway.icon) && j.a((Object) this.type, (Object) paymentGateway.type) && j.a((Object) this.code, (Object) paymentGateway.code) && j.a((Object) this.agreement, (Object) paymentGateway.agreement) && j.a((Object) this.description, (Object) paymentGateway.description) && j.a((Object) this.subDescription, (Object) paymentGateway.subDescription)) {
if (this.price == paymentGateway.price) {
return true;
}
}
}
return false;
}
return true;
}
public final String f() {
return this.subDescription;
}
public final String g() {
return this.title;
}
public final String h() {
return this.type;
}
public int hashCode() {
String str = this.title;
int i2 = 0;
int hashCode = (str != null ? str.hashCode() : 0) * 31;
String str2 = this.icon;
int hashCode2 = (hashCode + (str2 != null ? str2.hashCode() : 0)) * 31;
String str3 = this.type;
int hashCode3 = (hashCode2 + (str3 != null ? str3.hashCode() : 0)) * 31;
String str4 = this.code;
int hashCode4 = (hashCode3 + (str4 != null ? str4.hashCode() : 0)) * 31;
String str5 = this.agreement;
int hashCode5 = (hashCode4 + (str5 != null ? str5.hashCode() : 0)) * 31;
String str6 = this.description;
int hashCode6 = (hashCode5 + (str6 != null ? str6.hashCode() : 0)) * 31;
String str7 = this.subDescription;
if (str7 != null) {
i2 = str7.hashCode();
}
long j2 = this.price;
return ((hashCode6 + i2) * 31) + ((int) (j2 ^ (j2 >>> 32)));
}
public String toString() {
return "PaymentGateway(title=" + this.title + ", icon=" + this.icon + ", type=" + this.type + ", code=" + this.code + ", agreement=" + this.agreement + ", description=" + this.description + ", subDescription=" + this.subDescription + ", price=" + this.price + ")";
}
public void writeToParcel(Parcel parcel, int i2) {
j.b(parcel, "parcel");
parcel.writeString(this.title);
parcel.writeString(this.icon);
parcel.writeString(this.type);
parcel.writeString(this.code);
parcel.writeString(this.agreement);
parcel.writeString(this.description);
parcel.writeString(this.subDescription);
parcel.writeLong(this.price);
}
/* JADX WARNING: Illegal instructions before constructor call */
/* Code decompiled incorrectly, please refer to instructions dump. */
public PaymentGateway(android.os.Parcel r12) {
/*
r11 = this;
java.lang.String r0 = "parcel"
h.f.b.j.b(r12, r0)
java.lang.String r2 = r12.readString()
r0 = 0
if (r2 == 0) goto L_0x0051
java.lang.String r3 = r12.readString()
if (r3 == 0) goto L_0x004d
java.lang.String r4 = r12.readString()
if (r4 == 0) goto L_0x0049
java.lang.String r5 = r12.readString()
if (r5 == 0) goto L_0x0045
java.lang.String r6 = r12.readString()
if (r6 == 0) goto L_0x0041
java.lang.String r7 = r12.readString()
if (r7 == 0) goto L_0x003d
java.lang.String r8 = r12.readString()
if (r8 == 0) goto L_0x0039
long r9 = r12.readLong()
r1 = r11
r1.<init>(r2, r3, r4, r5, r6, r7, r8, r9)
return
L_0x0039:
h.f.b.j.a()
throw r0
L_0x003d:
h.f.b.j.a()
throw r0
L_0x0041:
h.f.b.j.a()
throw r0
L_0x0045:
h.f.b.j.a()
throw r0
L_0x0049:
h.f.b.j.a()
throw r0
L_0x004d:
h.f.b.j.a()
throw r0
L_0x0051:
h.f.b.j.a()
throw r0
*/
throw new UnsupportedOperationException("Method not decompiled: com.farsitel.bazaar.data.feature.payment.PaymentGateway.<init>(android.os.Parcel):void");
}
}
|
[
"MaxBaseCode@gmail.com"
] |
MaxBaseCode@gmail.com
|
3a64792449685241dc456eecb693543ef8acf7c6
|
9707f795379c3bd61314868976938461db9a4610
|
/net/divinerpg/render/gui/GuiDreamLamp.java
|
057434d6b4c528dc21b1813dce8de5f99e35ea23
|
[] |
no_license
|
Ingr13/DivineRPG
|
688e95f9630a6e0d439d9b46445a8fb0aed0f98e
|
a9a8c4e9284684e3c0b93a9bfe9f07992d728849
|
refs/heads/master
| 2016-08-03T09:09:10.441505
| 2013-09-16T03:53:14
| 2013-09-16T03:53:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,595
|
java
|
package net.divinerpg.render.gui;
import net.divinerpg.block.container.ContainerDreamLamp;
import net.divinerpg.lib.ResourceGuiLoc;
import net.divinerpg.overworld.block.tileentity.TileEntityDreamLamp;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import org.lwjgl.opengl.GL11;
public class GuiDreamLamp extends GuiContainer {
TileEntityDreamLamp TeDreamLamp;
public GuiDreamLamp(InventoryPlayer inventory, TileEntityDreamLamp var7)
{
super(new ContainerDreamLamp(inventory, var7));
this.TeDreamLamp = var7;
}
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(ResourceGuiLoc.GUI_DREAMLAMP);
int var5 = (this.width - this.xSize) / 2;
int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
if(TeDreamLamp.isBurning())
{
int var7 = 12;
this.drawTexturedModalRect(var5 + 81, var6 + 31 + 12 - var7, 176, 12 - var7, 14, var7 + 2);
}
}
@Override
public void updateScreen()
{
super.updateScreen();
}
@Override
public boolean doesGuiPauseGame()
{
return false;
}
@Override
protected void keyTyped(char par1, int par2)
{
if (par2 == 1 || par2 == mc.gameSettings.keyBindInventory.keyCode)
{
mc.thePlayer.closeScreen();
}
}
}
|
[
"brock.kerley@hotmail.com"
] |
brock.kerley@hotmail.com
|
aa51e1863caf1fd973d7eb40b0f3cac40f893e8e
|
38c4451ab626dcdc101a11b18e248d33fd8a52e0
|
/tokens/batik-1.7/sources/org/apache/batik/gvt/event/GraphicsNodeChangeListener.java
|
6b8187eab870d7317c5c9f7938fc25b8938cf50a
|
[] |
no_license
|
habeascorpus/habeascorpus-data
|
47da7c08d0f357938c502bae030d5fb8f44f5e01
|
536d55729f3110aee058ad009bcba3e063b39450
|
refs/heads/master
| 2020-06-04T10:17:20.102451
| 2013-02-19T15:19:21
| 2013-02-19T15:19:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 945
|
java
|
package TokenNamepackage
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
batik TokenNameIdentifier
. TokenNameDOT
gvt TokenNameIdentifier
. TokenNameDOT
event TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
java TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
EventListener TokenNameIdentifier
; TokenNameSEMICOLON
public TokenNamepublic
interface TokenNameinterface
GraphicsNodeChangeListener TokenNameIdentifier
extends TokenNameextends
EventListener TokenNameIdentifier
{ TokenNameLBRACE
void TokenNamevoid
changeStarted TokenNameIdentifier
( TokenNameLPAREN
GraphicsNodeChangeEvent TokenNameIdentifier
gnce TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
void TokenNamevoid
changeCompleted TokenNameIdentifier
( TokenNameLPAREN
GraphicsNodeChangeEvent TokenNameIdentifier
gnce TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
|
[
"pschulam@gmail.com"
] |
pschulam@gmail.com
|
857cf98be9c5994c3e3a90ac2cbcfea78c9ca3d6
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_5690574640250880_0/java/wadayama/MinesweeperMaster.java
|
1a3a36f5e7e536f2abba41dc43ad3374caafce6e
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,399
|
java
|
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Scanner;
public class MinesweeperMaster {
public static void main(String[] args) {
Scanner sc = null;
PrintWriter fout = null;
try {
sc = new Scanner(new File(args[0]));
fout = new PrintWriter(new BufferedWriter(new FileWriter("result.txt")));
} catch(Exception e) {
System.out.println(e);
}
final int T = sc.nextInt();
for( int t = 1; t <= T; t++ ) {
final int R = sc.nextInt();
final int C = sc.nextInt();
final int M = sc.nextInt();
final int N = R * C - M;
final int r = Math.min( R, C );
final int c = Math.max( R, C );
int[][] state = new int[r][c];
boolean pos = false;
if( N == 1 ) {
pos = true;
state[0][0] = 2;
}
else if( r == 1 ){
pos = true;
for( int i = 0; i < N; i++ ) state[0][i] = 1;
state[0][0] = 2;
}
else if( r == 2 ) {
if( N % 2 == 0 && N / 2 > 1 ) {
pos = true;
for( int i = 0; i < N / 2; i++ ) state[0][i] = state[1][i]= 1;
state[0][0] = 2;
}
}
else if( N % 2 == 0 && N / 2 <= c && N / 2 > 1 ) {
pos = true;
for( int i = 0; i < N / 2; i++ ) state[0][i] = state[1][i]= 1;
state[0][0] = 2;
}
else if( N <= 9 ) {
if( N == 4 ) {
pos = true;
state[0][0] = state[0][1] = state[1][0] = state[1][1] = 1;
state[0][0] = 2;
}
if( N == 6 ) {
pos = true;
for( int i = 0; i < 2; i++ ) for( int j = 0; j < 3; j++ ) state[i][j] = 1;
state[0][0] = 2;
}
if( N == 8 ) {
pos = true;
for( int i = 0; i < 3; i++ ) for( int j = 0; j < 3; j++ ) state[i][j] = 1;
state[0][0] = 2;
state[2][2] = 0;
}
if( N == 9 ) {
pos = true;
for( int i = 0; i < 3; i++ ) for( int j = 0; j < 3; j++ ) state[i][j] = 1;
state[0][0] = 2;
}
}
else {
pos = true;
for( int rr = 3; rr <= r; rr++ ) {
int cc = ( N + (rr-1) ) / rr;
if( cc > c ) continue;
int n = N;
for( int i = 0; i < rr - 1 ; i++ ) {
for( int j = 0; j < cc; j++ ) {
state[i][j] = 1;
}
n -= cc;
}
if( n > 1 ) {
for( int j = 0; j < n; j++ ) {
state[rr-1][j] = 1;
}
}
else {
state[rr-1][0] = state[rr-1][1] = 1;
state[rr-2][cc-1] = 0;
}
state[0][0] = 2;
break;
}
}
// System.out.println( "Case #" + t + ":" );
fout.println( "Case #" + t + ":" );
// fout.println( R + " " + C + " " + N );
if( pos == true ) {
for( int i = 0; i < R; i++ ) {
for( int j = 0; j < C; j++ ) {
int i2 = i, j2 = j;
if( r != R ) {
i2 = j;
j2 = i;
}
if( state[i2][j2] == 0 ) fout.print( "*" );
else if( state[i2][j2] == 1 ) fout.print( "." );
else if( state[i2][j2] == 2 ) fout.print( "c" );
// if( state[i2][j2] == 0 ) System.out.print( "*" );
// else if( state[i2][j2] == 1 ) System.out.print( "." );
// else if( state[i2][j2] == 2 ) System.out.print( "c" );
}
fout.println();
// System.out.println();
}
}
else {
fout.println( "Impossible" );
// System.out.println( "Impossible" );
}
}
fout.close();
sc.close();
}
}
|
[
"eewestman@gmail.com"
] |
eewestman@gmail.com
|
4b14d8936b8bed6099378e96eb4d1075effd39f5
|
22ffabeab1d2ba7ae0c6f71c52cf97f25bf87e33
|
/app/src/main/java/com/derrick/fragments/DiscoverFragment.java
|
32aa742c77d289b48071779c8052d67a680edc5c
|
[
"Apache-2.0"
] |
permissive
|
mikemacharia39/M-Box
|
26d3c9b6ffbd75481901c1a036bd12b1d0576173
|
16767cc1ce61fa9706c6c6be4d6c65d5b94e5edf
|
refs/heads/master
| 2021-01-13T04:30:36.495888
| 2017-01-22T13:26:58
| 2017-01-22T13:26:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,771
|
java
|
/*
* Copyright 2016 Derrick Njeru
*
* 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.derrick.fragments;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.derrick.movies.R;
import java.util.ArrayList;
import java.util.List;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DiscoverFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class DiscoverFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private static final String INDEX_KEY = "index";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
private TabLayout tabLayout;
private ViewPager viewPager;
private SharedPreferences sharedPreferences;
private SharedPreferences.Editor editor;
public static final String MY_PREFERENCES = "MyPrefs";
private int index;
public DiscoverFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment DiscoverFragment.
*/
// TODO: Rename and change types and number of parameters
public static DiscoverFragment newInstance(String param1, String param2) {
DiscoverFragment fragment = new DiscoverFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_discover, container, false);
viewPager = (ViewPager) v.findViewById(R.id.viewpager);
setupViewPager(viewPager);
sharedPreferences = getActivity().getSharedPreferences(MY_PREFERENCES, Context.MODE_PRIVATE);
editor = sharedPreferences.edit();
int currentPager = sharedPreferences.getInt(INDEX_KEY, 0);
if (viewPager != null) {
viewPager.setCurrentItem(currentPager);
}
tabLayout = (TabLayout) v.findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
index = tab.getPosition();
editor.putInt(INDEX_KEY, index); //3
editor.commit(); //4
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
});
return v;
}
private void setupViewPager(ViewPager viewPager) {
ViewPagerAdapter adapter = new ViewPagerAdapter(getChildFragmentManager());
adapter.addFragment(new PopularMoviesFragment().newInstance("popular", ""), "popular");
adapter.addFragment(new NowPlayingFragment().newInstance("now playing", ""), "now playing");
adapter.addFragment(new UpcomingFragment().newInstance("upcoming", ""), "upcoming");
viewPager.setAdapter(adapter);
}
class ViewPagerAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
public ViewPagerAdapter(FragmentManager manager) {
super(manager);
}
@Override
public Fragment getItem(int position) {
return mFragmentList.get(position);
}
@Override
public int getCount() {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
@Override
public CharSequence getPageTitle(int position) {
return mFragmentTitleList.get(position);
}
}
}
|
[
"derricknjeru5@gmail.com"
] |
derricknjeru5@gmail.com
|
730e07c6a542544e952bc7b3d8fb3bef20653b5a
|
947fc9eef832e937f09f04f1abd82819cd4f97d3
|
/src/apk/io/intercom/okhttp3/internal/http2/Http2Codec.java
|
fe5871e68ea383a3e544c1d252d3e9a2988d6904
|
[] |
no_license
|
thistehneisen/cifra
|
04f4ac1b230289f8262a0b9cf7448a1172d8f979
|
d46c6f4764c9d4f64e45c56fa42fddee9b44ff5a
|
refs/heads/master
| 2020-09-22T09:35:57.739040
| 2019-12-01T19:39:59
| 2019-12-01T19:39:59
| 225,136,583
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,723
|
java
|
package io.intercom.okhttp3.internal.http2;
import e.a.b.A;
import e.a.b.B;
import e.a.b.g;
import e.a.b.j;
import e.a.b.l;
import e.a.b.t;
import io.intercom.okhttp3.Headers;
import io.intercom.okhttp3.Interceptor.Chain;
import io.intercom.okhttp3.OkHttpClient;
import io.intercom.okhttp3.Protocol;
import io.intercom.okhttp3.Request;
import io.intercom.okhttp3.Response;
import io.intercom.okhttp3.Response.Builder;
import io.intercom.okhttp3.ResponseBody;
import io.intercom.okhttp3.internal.Internal;
import io.intercom.okhttp3.internal.Util;
import io.intercom.okhttp3.internal.connection.StreamAllocation;
import io.intercom.okhttp3.internal.http.HttpCodec;
import io.intercom.okhttp3.internal.http.HttpHeaders;
import io.intercom.okhttp3.internal.http.RealResponseBody;
import io.intercom.okhttp3.internal.http.RequestLine;
import io.intercom.okhttp3.internal.http.StatusLine;
import java.io.IOException;
import java.net.ProtocolException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
public final class Http2Codec implements HttpCodec {
private static final j CONNECTION = j.c("connection");
private static final j ENCODING = j.c("encoding");
private static final j HOST = j.c("host");
private static final List<j> HTTP_2_SKIPPED_REQUEST_HEADERS = Util.immutableList((T[]) new j[]{CONNECTION, HOST, KEEP_ALIVE, PROXY_CONNECTION, TE, TRANSFER_ENCODING, ENCODING, UPGRADE, Header.TARGET_METHOD, Header.TARGET_PATH, Header.TARGET_SCHEME, Header.TARGET_AUTHORITY});
private static final List<j> HTTP_2_SKIPPED_RESPONSE_HEADERS = Util.immutableList((T[]) new j[]{CONNECTION, HOST, KEEP_ALIVE, PROXY_CONNECTION, TE, TRANSFER_ENCODING, ENCODING, UPGRADE});
private static final j KEEP_ALIVE = j.c("keep-alive");
private static final j PROXY_CONNECTION = j.c("proxy-connection");
private static final j TE = j.c("te");
private static final j TRANSFER_ENCODING = j.c("transfer-encoding");
private static final j UPGRADE = j.c("upgrade");
private final Chain chain;
private final Http2Connection connection;
private final Protocol protocol;
private Http2Stream stream;
final StreamAllocation streamAllocation;
class StreamFinishingSource extends l {
long bytesRead = 0;
boolean completed = false;
StreamFinishingSource(B b2) {
super(b2);
}
private void endOfInput(IOException iOException) {
if (!this.completed) {
this.completed = true;
Http2Codec http2Codec = Http2Codec.this;
http2Codec.streamAllocation.streamFinished(false, http2Codec, this.bytesRead, iOException);
}
}
public void close() throws IOException {
super.close();
endOfInput(null);
}
public long read(g gVar, long j2) throws IOException {
try {
long read = delegate().read(gVar, j2);
if (read > 0) {
this.bytesRead += read;
}
return read;
} catch (IOException e2) {
endOfInput(e2);
throw e2;
}
}
}
public Http2Codec(OkHttpClient okHttpClient, Chain chain2, StreamAllocation streamAllocation2, Http2Connection http2Connection) {
Protocol protocol2;
this.chain = chain2;
this.streamAllocation = streamAllocation2;
this.connection = http2Connection;
if (okHttpClient.protocols().contains(Protocol.H2_PRIOR_KNOWLEDGE)) {
protocol2 = Protocol.H2_PRIOR_KNOWLEDGE;
} else {
protocol2 = Protocol.HTTP_2;
}
this.protocol = protocol2;
}
public static List<Header> http2HeadersList(Request request) {
Headers headers = request.headers();
ArrayList arrayList = new ArrayList(headers.size() + 4);
arrayList.add(new Header(Header.TARGET_METHOD, request.method()));
arrayList.add(new Header(Header.TARGET_PATH, RequestLine.requestPath(request.url())));
String header = request.header("Host");
if (header != null) {
arrayList.add(new Header(Header.TARGET_AUTHORITY, header));
}
arrayList.add(new Header(Header.TARGET_SCHEME, request.url().scheme()));
int size = headers.size();
for (int i2 = 0; i2 < size; i2++) {
j c2 = j.c(headers.name(i2).toLowerCase(Locale.US));
if (!HTTP_2_SKIPPED_REQUEST_HEADERS.contains(c2)) {
arrayList.add(new Header(c2, headers.value(i2)));
}
}
return arrayList;
}
public static Builder readHttp2HeadersList(List<Header> list, Protocol protocol2) throws IOException {
Headers.Builder builder = new Headers.Builder();
int size = list.size();
Headers.Builder builder2 = builder;
StatusLine statusLine = null;
for (int i2 = 0; i2 < size; i2++) {
Header header = (Header) list.get(i2);
if (header != null) {
j jVar = header.name;
String h2 = header.value.h();
if (jVar.equals(Header.RESPONSE_STATUS)) {
StringBuilder sb = new StringBuilder();
sb.append("HTTP/1.1 ");
sb.append(h2);
statusLine = StatusLine.parse(sb.toString());
} else if (!HTTP_2_SKIPPED_RESPONSE_HEADERS.contains(jVar)) {
Internal.instance.addLenient(builder2, jVar.h(), h2);
}
} else if (statusLine != null && statusLine.code == 100) {
builder2 = new Headers.Builder();
statusLine = null;
}
}
if (statusLine != null) {
return new Builder().protocol(protocol2).code(statusLine.code).message(statusLine.message).headers(builder2.build());
}
throw new ProtocolException("Expected ':status' header not present");
}
public void cancel() {
Http2Stream http2Stream = this.stream;
if (http2Stream != null) {
http2Stream.closeLater(ErrorCode.CANCEL);
}
}
public A createRequestBody(Request request, long j2) {
return this.stream.getSink();
}
public void finishRequest() throws IOException {
this.stream.getSink().close();
}
public void flushRequest() throws IOException {
this.connection.flush();
}
public ResponseBody openResponseBody(Response response) throws IOException {
StreamAllocation streamAllocation2 = this.streamAllocation;
streamAllocation2.eventListener.responseBodyStart(streamAllocation2.call);
return new RealResponseBody(response.header("Content-Type"), HttpHeaders.contentLength(response), t.a((B) new StreamFinishingSource(this.stream.getSource())));
}
public Builder readResponseHeaders(boolean z) throws IOException {
Builder readHttp2HeadersList = readHttp2HeadersList(this.stream.takeResponseHeaders(), this.protocol);
if (!z || Internal.instance.code(readHttp2HeadersList) != 100) {
return readHttp2HeadersList;
}
return null;
}
public void writeRequestHeaders(Request request) throws IOException {
if (this.stream == null) {
this.stream = this.connection.newStream(http2HeadersList(request), request.body() != null);
this.stream.readTimeout().timeout((long) this.chain.readTimeoutMillis(), TimeUnit.MILLISECONDS);
this.stream.writeTimeout().timeout((long) this.chain.writeTimeoutMillis(), TimeUnit.MILLISECONDS);
}
}
}
|
[
"putnins@nils.digital"
] |
putnins@nils.digital
|
6efc31c03ee8122299e02fda045c77ddd04e24c2
|
377e5e05fb9c6c8ed90ad9980565c00605f2542b
|
/bin/platform/ext/platformservices/src/de/hybris/platform/order/CalculationService.java
|
fb91cd48fd12d7447670543130b0748348ef5900
|
[] |
no_license
|
automaticinfotech/HybrisProject
|
c22b13db7863e1e80ccc29774f43e5c32e41e519
|
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
|
refs/heads/master
| 2021-07-20T18:41:04.727081
| 2017-10-30T13:24:11
| 2017-10-30T13:24:11
| 108,957,448
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,402
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* 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 SAP Hybris.
*/
package de.hybris.platform.order;
import de.hybris.platform.core.model.order.AbstractOrderEntryModel;
import de.hybris.platform.core.model.order.AbstractOrderModel;
import de.hybris.platform.order.exceptions.CalculationException;
import de.hybris.platform.order.strategies.calculation.FindDeliveryCostStrategy;
import de.hybris.platform.order.strategies.calculation.FindDiscountValuesStrategy;
import de.hybris.platform.order.strategies.calculation.FindPaymentCostStrategy;
import de.hybris.platform.order.strategies.calculation.FindPriceStrategy;
import de.hybris.platform.order.strategies.calculation.FindTaxValuesStrategy;
import de.hybris.platform.order.strategies.calculation.OrderRequiresCalculationStrategy;
import java.util.Date;
/**
* Service allows calculation or recalculation of the order. This includes calculation of all the entries, taxes and
* discount values. Information about price, taxes and discounts are fetched using dedicated strategies :
* {@link FindDiscountValuesStrategy}, {@link FindTaxValuesStrategy}, {@link FindPriceStrategy}. Also payment and
* delivery costs are resolved using strategies {@link FindDeliveryCostStrategy} and {@link FindPaymentCostStrategy}.
*
* Whether order needs to be calculated or not is up to the implementation of {@link OrderRequiresCalculationStrategy}.
*/
public interface CalculationService
{
/**
* Calculates the given order and all its entries unless they're already calculated and the order has not been
* modified.
* <p>
* So this method will fetch prices, taxes and discounts (using spring configurable strategies) for uncalculated or
* modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order
* itself has been modified the totals will be calculated as well.
* <p>
* if you merely like to adjust totals while keeping prices, taxes and discounts you should call
* {@link #calculateTotals(AbstractOrderModel, boolean)} instead (e.g. if just a quantity has changed or prices have
* been imported and cannot be found via price factory ).
*
* @param order
* target {@link AbstractOrderModel}
* @throws CalculationException
* if a pricefactory error occurred.
*/
void calculate(AbstractOrderModel order) throws CalculationException;
/**
* Return {@link Boolean#TRUE} in case if order needs to be calculated. Default implementation use
* calculationStrategy to get this information.
*/
boolean requiresCalculation(AbstractOrderModel order);
/**
* Calculates the given order and all its entries unless they're already calculated and the order has not been
* modified.
* <p>
* So this method will fetch prices, taxes and discounts (using spring configured strategies) for uncalculated or
* modified entries only - all other will remain unchanged. If at least one entry has been calculated or the order
* itself has been modified the totals will be calculated as well.
* <p>
* if you merely like to adjust totals while keeping prices, taxes and discounts you should call
* {@link #calculateTotals(AbstractOrderModel, boolean)} instead (e.g. if just a quantity has changed or prices have
* been imported and cannot be found via price factory ).
*
* @param order
* target {@link AbstractOrderModel}
*
* @param date
* assumes a given date to perform calculations for - be careful with that since this method will calculate
* modified or uncalculated entries only, so the given date may not apply to all entries!
* @throws CalculationException
* if a pricefactory error occurred
*/
void calculate(AbstractOrderModel order, final Date date) throws CalculationException;
/**
* recalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and
* delivery costs by calling the currently installed price factory.
* <p>
* if you merely like to adjust totals while keeping prices, taxes and discounts you should call
* {@link #calculateTotals(AbstractOrderModel, boolean)} instead (e.g. if just a quantity has changed or prices have
* been imported and cannot be found via price factory ).
*
* @param order
* target {@link AbstractOrderModel}
* @throws CalculationException
* if a pricefactory error occurred.
*/
void recalculate(AbstractOrderModel order) throws CalculationException;
/**
* recalculates the whole order and all its entries. this includes finding prices, taxes, discounts, payment and
* delivery costs by calling the currently installed dedicated strategies ( {@link FindPriceStrategy},
* {@link FindDeliveryCostStrategy}, {@link FindTaxValuesStrategy}, etc... ).
* <p>
* if you merely like to adjust totals while keeping prices, taxes and discounts you should call
* {@link #calculateTotals(AbstractOrderModel, boolean)} instead (e.g. if just a quantity has changed or prices have
* been imported and cannot be found via price factory ).
*
* @param order
* target {@link AbstractOrderModel}
* @param date
* the date to calculate prices for
* @throws CalculationException
* if a pricefactory error occurred
*/
void recalculate(AbstractOrderModel order, final Date date) throws CalculationException;
/**
* (re)calculates all totals for the given order. This does not trigger price, tax and discount calculation but takes
* all currently set price, tax and discount values as base.
*
* @param order
* target {@link AbstractOrderModel}
* @param recalculate
* forces setting total even if order is marked as calculated
*/
void calculateTotals(AbstractOrderModel order, final boolean recalculate) throws CalculationException;
/**
* Recalculates given entries total prices and re-applies tax and discount values. This does not include finding
* price, taxes or discount but uses all currently set values.
*
* @param entry
* target {@link AbstractOrderEntryModel}
* @param recalculate
* forces the recalculation of the abstract order entry.
*/
void calculateTotals(AbstractOrderEntryModel entry, final boolean recalculate);
/**
* Calculates this entry even if the entry was calculated before. This includes finding the correct base price, taxes
* and discount using the currently installed price factory.
* <p>
* If prices should be left as currently set but the entry totals have to be consolidated (e.g. when the quantity has
* changed) call {@link #calculateTotals(AbstractOrderEntryModel,boolean)} instead !
*
* @param entry
* target {@link AbstractOrderEntryModel}
* @throws CalculationException
* if a pricefactory error occurred
*/
void recalculate(AbstractOrderEntryModel entry) throws CalculationException;
}
|
[
"santosh.kshirsagar@automaticinfotech.com"
] |
santosh.kshirsagar@automaticinfotech.com
|
04d0e3db92a7a7eec1b01a343e45da4e07c17df1
|
c5e9a7adf90dc4765a40aa3cb9306a3eee72b9d1
|
/core/src/main/java/org/pushingpixels/flamingo/api/svg/transcoders/FloatArrayTranscoder.java
|
2dbb46b98d63967da490b2df93c3fe9f9e6d3e79
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
codenameone/flamingo-svg-transcoder
|
c87c867e0f75c5aa5a5a7d7fa297aa15228f038b
|
3d9635a62c8e5024db5660a6d7e9544b754d52e9
|
refs/heads/master
| 2021-09-11T13:01:29.607885
| 2021-02-03T19:37:38
| 2021-02-03T19:37:38
| 91,692,709
| 5
| 3
|
NOASSERTION
| 2021-02-03T19:37:39
| 2017-05-18T12:50:34
|
Java
|
UTF-8
|
Java
| false
| false
| 1,418
|
java
|
/**
* Copyright 2012 Emmanuel Bourg
*
* 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.pushingpixels.flamingo.api.svg.transcoders;
import java.io.PrintWriter;
/**
* @author Emmanuel Bourg
* @version $Revision$, $Date$
*/
public class FloatArrayTranscoder extends Transcoder<float[]> {
public static FloatArrayTranscoder INSTANCE = new FloatArrayTranscoder();
@Override
public void transcode(float[] array, PrintWriter output) {
if (array == null) {
output.append("null");
} else {
String comma = "";
output.append("new float[]{");
for (float value : array) {
output.append(comma);
output.append(FloatTranscoder.INSTANCE.transcode(value));
comma = ", ";
}
output.append("}");
}
}
}
|
[
"ebourg@apache.org"
] |
ebourg@apache.org
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.