id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
89fc2795-eec7-4062-9b35-cdbc43ec30fa | public void setLineElementStyle(String lineElementStyle) {
this.myLineElementStyle = lineElementStyle;
} |
d561512c-0027-4904-b3e1-a7f2ac749997 | public static void main(String[] args) throws Exception {
// System.err.println(new BeanDumper(new HtmlFormatHandler()).dump(new BeanA()));
// System.err.println(new BeanDumper().dump(new BeanA()));
Map<Object, Object> cMap = new LinkedHashMap<Object, Object>();
cMap.put("ax", "cc");
... |
633505f4-862b-4108-b030-5f800d8ad1c7 | public BeanA() {
// List<BeanB> listOfB = new ArrayList<BeanB>();
// listOfB.add(new BeanB());
// listOfB.add(new BeanB());
// this.setListOfB(listOfB);
//
// Set<BeanC> setOfC = new HashSet<BeanC>();
// setOfC.add(new BeanC());
// setOfC.add(null);
// setOfC.add... |
50e368eb-f53d-4c7f-8add-7dee9fbe8685 | public String getString() {
return this.myString;
} |
6e08eba0-0e5b-4512-9238-5284942e52fc | public void setString(String string) {
this.myString = string;
} |
cb1fd273-f3c9-4670-9539-6573494d3563 | public String getNullString() {
return this.myNullString;
} |
b8666d35-2aac-4049-b7ba-51f68892c06b | public void setNullString(String nullString) {
this.myNullString = nullString;
} |
bb26259b-767a-4646-8553-0106a5fd0ab6 | public int getIntPrimitive() {
return this.myIntPrimitive;
} |
5ef94a56-6f5c-4038-83e5-a1a1c8c94734 | public void setIntPrimitive(int intPrimitive) {
this.myIntPrimitive = intPrimitive;
} |
0b08c26b-82fd-40de-bcf1-6410b0ea41d0 | public Integer getInteger() {
return this.myInteger;
} |
370dffd0-6f6d-4ad2-95e3-e8dd47d0e324 | public void setInteger(Integer integer) {
this.myInteger = integer;
} |
021cef62-affe-40b9-a758-c038bb15c46c | public Integer getIntegerNull() {
return this.myIntegerNull;
} |
770b3e3e-1353-44a2-936a-10928f6da6b1 | public void setIntegerNull(Integer integerNull) {
this.myIntegerNull = integerNull;
} |
6797b699-e24e-4918-b243-7c24cb3101ca | public List<BeanB> getListOfB() {
return this.myListOfB;
} |
d4061597-d56d-4a8d-a325-aa288a378e97 | public void setListOfB(List<BeanB> listOfB) {
this.myListOfB = listOfB;
} |
d6b0d29f-e6e3-475c-a93a-d66e35dfc3bf | public BeanB getBeanB() {
return this.myBeanB;
} |
b91bc284-ae7a-4e29-81b1-864d1c85fe4b | public void setBeanB(BeanB beanB) {
this.myBeanB = beanB;
} |
11ac1cf9-6b1c-4238-ad7e-48c18bcec550 | public Set<BeanC> getSetOfC() {
return this.mySetOfC;
} |
3357cf89-93a7-4e82-928d-0db5dda597e7 | public void setSetOfC(Set<BeanC> setOfC) {
this.mySetOfC = setOfC;
} |
d527cea8-1f1a-4191-9682-607385c8868f | public Map<Object, Object> getMap() {
return this.myMap;
} |
fb13c7b3-2397-4bf3-89f9-28276425b737 | public void setMap(Map<Object, Object> map) {
this.myMap = map;
} |
c4ccd336-c17f-4533-84c4-fd743552085c | public Thread getThread() {
return this.myThread;
} |
41134698-cc13-4943-beae-90465fd5b1d4 | public void setThread(Thread thread) {
this.myThread = thread;
} |
62984d26-7f73-4bcd-9b64-f32a340f7cec | public BeanD getBeanD1() {
return this.myBeanD1;
} |
d59fc642-8252-4562-806d-f60386dde099 | public void setBeanD1(BeanD beanD1) {
this.myBeanD1 = beanD1;
} |
dac5c6e2-d282-4adc-a3b3-ed51cf37214e | public BeanD getBeanD2() {
return this.myBeanD2;
} |
5d279d6b-1dba-4fa7-8d5c-6565e022b754 | public void setBeanD2(BeanD beanD2) {
this.myBeanD2 = beanD2;
} |
e8526ca1-d0ec-4292-a144-6f8472803cd1 | public BeanD getBeanD3() {
return this.myBeanD3;
} |
1e700c8b-a3e8-4996-9b24-7accdc54b244 | public void setBeanD3(BeanD beanD3) {
this.myBeanD3 = beanD3;
} |
a0ce3a42-212e-40a6-9771-78c80f9bcc79 | public BeanC getBeanC() {
return this.myBeanC;
} |
886784b1-fc7e-4231-8024-eb48476d506e | public void setBeanC(BeanC beanC) {
this.myBeanC = beanC;
} |
a466fa1b-18d4-487a-90b5-301ab30fe402 | public BeanD(Object object) {
this.setObject(object);
} |
9b7b3622-ac5f-4704-a2e8-6dec8cf4d006 | public Object getObjectWithExceptionInGetter() {
throw new RuntimeException("foo");
} |
eedea1b2-b94f-4714-9796-4ed3634c1b85 | public Object getObject() {
return this.myObject;
} |
97027e5f-1b66-4506-81a6-39e43ad6946d | public void setObject(Object object) {
this.myObject = object;
} |
5b83ca53-cda0-4e62-8284-ae4b47a1d22f | public Long getLong() {
return this.myLong;
} |
b79cf7f6-72c8-4009-a42b-7266bdc610e3 | public void setLong(Long l) {
this.myLong = l;
} |
34945a42-7c00-489e-a04b-ec5eea940e32 | @Override
public String toString() {
return "toString from BeanC";
} |
9e153e6a-cf42-40dd-8d9e-dbd462fd2f3b | public AllEncompasingP2PClient(String mac_address, String ip, String name, String groupOwner) {
this.setMac(mac_address);
this.setName(name);
this.setIp(ip);
this.setGroupOwnerMac(groupOwner);
this.isDirectLink = true;
} |
417c3fb1-7eb8-413a-8cc9-90dcbb397f5a | public void setIsDirectLink(boolean d) {
this.isDirectLink = d;
} |
5edd542e-1cd0-4276-b58e-8c18127e8413 | public boolean getIsDirectLink() {
return this.isDirectLink;
} |
224c66be-7e1e-4fe1-b379-662007b1aae9 | public String getGroupOwnerMac() {
return groupOwnerMac;
} |
15a220bf-75e7-4bc1-9f55-a3bea3a09c20 | public void setGroupOwnerMac(String groupOwnerMac) {
this.groupOwnerMac = groupOwnerMac;
} |
1867090e-a37f-49e4-9222-fa732e1d216b | public String getName() {
return name;
} |
0ee39dde-9431-4cb7-a0b8-c89beb000006 | public void setName(String name) {
this.name = name;
} |
3ee17cc3-c5af-4757-ae7b-05ad71751fde | public String getMac() {
return mac;
} |
7755ef0c-8ae3-4239-919f-e4898d4f39cd | public void setMac(String mac) {
this.mac = mac;
} |
ce7dc597-5638-45bc-b48c-c46969187f95 | public String getIp() {
return ip;
} |
d998e444-5a68-420c-9e34-5da8350e0dd9 | public void setIp(String ip) {
this.ip = ip;
} |
70443795-974e-4baa-91d0-50afa686ac64 | @Override
public String toString() {
return getIp() + "," + getMac() + "," + getName() + "," + getGroupOwnerMac();
} |
4a2ee346-39bb-455d-901c-5e3c3f9c5a90 | public static AllEncompasingP2PClient fromString(String serialized) {
String[] divided = serialized.split(",");
return new AllEncompasingP2PClient(divided[1], divided[0], divided[2], divided[3]);
} |
f29cdc99-715d-40e7-be8e-b6b736296e2e | public Packet(Packet.TYPE type, byte[] extraData, String receiverMac, String senderMac) {
this.setData(extraData);
this.setType(type);
this.receiverMac = receiverMac;
this.setTtl(3);
if (receiverMac == null)
this.receiverMac = "00:00:00:00:00:00";
this.senderMac = senderMac;
} |
650acbd4-dae9-4106-b6ff-ca3061c42f93 | public Packet(TYPE type2, byte[] eData, String receivermac, String senderMac, int timetolive) {
this.setData(eData);
this.setType(type2);
this.receiverMac = receivermac;
if (receiverMac == null)
this.receiverMac = "00:00:00:00:00:00";
this.senderMac = senderMac;
this.ttl = timetolive;
} |
a2984bec-1ebe-4ffb-b849-20fa24cc0225 | public byte[] getData() {
return data;
} |
058ea60e-13fe-4723-8366-35f42ebaa427 | public void setData(byte[] data) {
this.data = data;
} |
362975e0-3567-4279-b853-91ad23463621 | public Packet.TYPE getType() {
return type;
} |
808edc62-fd14-43d3-8a8b-293dfb8e8831 | public void setType(Packet.TYPE type) {
this.type = type;
} |
95db779d-df1f-495f-b145-db11c932e596 | public static byte[] getMacAsBytes(String maca) {
String[] mac = maca.split(":");
byte[] macAddress = new byte[6]; // mac.length == 6 bytes
for (int i = 0; i < mac.length; i++) {
macAddress[i] = Integer.decode("0x" + mac[i]).byteValue();
}
return macAddress;
} |
3746f47e-1aa0-4113-a2b4-24116b498d30 | public static String getMacBytesAsString(byte[] data, int startOffset) {
StringBuilder sb = new StringBuilder(18);
for (int i = startOffset; i < startOffset + 6; i++) {
byte b = data[i];
if (sb.length() > 0)
sb.append(':');
sb.append(String.format("%02x", b));
}
return sb.toString();
} |
421f5084-69da-4a0e-b685-4124b011f83d | public byte[] serialize() {
// 6 bytes for mac
byte[] serialized = new byte[1 + data.length + 13];
serialized[0] = (byte) type.ordinal();
serialized[1] = (byte) ttl;
byte[] mac = getMacAsBytes(this.receiverMac);
for (int i = 2; i <= 7; i++) {
serialized[i] = mac[i - 2];
}
mac = getMacAsBytes(this... |
a62a5f06-898b-4315-a161-e15195491ad7 | public static Packet deserialize(byte[] inputData) {
Packet.TYPE type = TYPE.values()[(int) inputData[0]];
byte[] data = new byte[inputData.length - 14];
int timetolive = (int) inputData[1];
String mac = getMacBytesAsString(inputData, 2);
String receivermac = getMacBytesAsString(inputData, 8);
for (int i ... |
1783cc46-13bd-4fc2-8a0f-a93bc6b571ab | public String getMac() {
return receiverMac;
} |
7cb8a00d-1f53-4e29-be23-63ae28490b52 | public void setMac(String mac) {
this.receiverMac = mac;
} |
b7933c25-5019-48c8-b694-1c611c4e323e | public String getSenderMac() {
return this.senderMac;
} |
9e4846d4-77f1-47f1-a2c1-beff7026cea5 | public String getSenderIP() {
return senderIP;
} |
55e94b00-8c0d-4b5f-adb4-cfa021c14f4f | public void setSenderIP(String senderIP) {
this.senderIP = senderIP;
} |
820b523f-a55f-46ae-bb17-18505623f581 | @Override
public String toString() {
return "Type" + getType().toString() + "receiver:" + getMac() + "sender:" + getSenderMac();
} |
33533c36-024d-4f27-afc6-0827b9133b4b | public int getTtl() {
return ttl;
} |
f9f3a377-4256-4136-b406-6423eb64830f | public void setTtl(int ttl) {
this.ttl = ttl;
} |
ee37e110-81fa-4710-9855-1f8cb1a4b331 | public boolean sendPacket(String ip, int port, byte[] data) {
try {
InetAddress serverAddr = InetAddress.getByName(ip);
tcpSocket = new Socket(serverAddr, port);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
OutputStream os = null;
... |
cbc8b8c1-af48-4d22-af02-5823c3a15d52 | public static void main(String[] args) {
/*
* Intro message
*/
System.out.println(" WELCOME TO");
for(int i=0;i<echo_ascii.length();i++){
System.out.print(echo_ascii.charAt(i));
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.pri... |
c2a48784-d113-4ae9-b456-87716c35f947 | private static String randomMACAddress(){
Random rand = new Random();
byte[] macAddr = new byte[6];
rand.nextBytes(macAddr);
macAddr[0] = (byte)(macAddr[0] & (byte)254); //zeroing last 2 bytes to make it unicast and locally adminstrated
StringBuilder sb = new StringBuilder(18);
for(byte... |
20294556-26c9-445b-8dee-99f2e6ff02f6 | public static void newClient(AllEncompasingP2PClient c){
routingTable.put(c.getMac(), c);
} |
2e2dd1de-de2e-4d45-94c5-4e5187f27864 | public static void clientGone(AllEncompasingP2PClient c){
routingTable.remove(c.getMac());
} |
1965e139-adb7-4a2c-8713-370e90008505 | public static AllEncompasingP2PClient getSelf() {
return self;
} |
41932bf9-73f4-45a7-b6e3-3dc0a2a8821b | public static void setSelf(AllEncompasingP2PClient self) {
MeshNetworkManager.self = self;
} |
f5d58fe6-d3aa-4b82-81d5-3d2247aac5f8 | public static String getIPForClient(AllEncompasingP2PClient c){
/*
* This is part of the same Group so its okay to use its IP
*/
if(self.getGroupOwnerMac() == c.getGroupOwnerMac()){
// share the same GO then just give its IP
return c.getIp();
}
AllEncompasingP2PClient go = routingTable.get(c.g... |
16881f94-04a3-4a06-b1f1-34f8c2a47604 | public static byte[] serializeRoutingTable(){
//TODO: this to do the hello packet stuff
StringBuilder serialized = new StringBuilder();
for(AllEncompasingP2PClient v : routingTable.values()){
serialized.append(v.toString());
serialized.append("\n");
}
return serialized.toString().getBytes();
} |
b7ac1f30-6a2a-491b-95c2-b9d88432578e | public static void deserializeRoutingTableAndAdd(byte[] rtable){
String rstring = new String(rtable);
String[] div = rstring.split("\n");
for(String s : div){
AllEncompasingP2PClient a = AllEncompasingP2PClient.fromString(s);
routingTable.put(a.getMac(), a);
}
} |
abb07bf5-5fb9-4a53-aef9-74854ea88f73 | public static String getIPForClient(String mac){
AllEncompasingP2PClient c = routingTable.get(mac);
if(c == null){
return Configuration.GO_IP;
}
return getIPForClient(c);
} |
0268920d-5385-4f25-aff8-e5c0d57b624f | public TcpReciever(int port, ConcurrentLinkedQueue<Packet> queue) {
try {
this.serverSocket = new ServerSocket(port);
} catch (IOException e) {
System.err.println("Server socket on port " + port + " could not be created. ");
e.printStackTrace();
}
this.packetQueue = queue;
} |
2890089f-bd2c-4b48-b35d-3cb219610ad6 | @Override
public void run() {
Socket socket;
while (!Thread.currentThread().isInterrupted()) {
try {
socket = this.serverSocket.accept();
InputStream in = socket.getInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
while(true) {
i... |
8586ca25-c5b0-4f40-80f8-c7b286713d75 | public Sender() {
if(ccl == null)
ccl = new ConcurrentLinkedQueue<Packet>();
} |
ed32a80b-148d-4876-9a18-8a79f09a4310 | public static boolean queuePacket(Packet p) {
return ccl.add(p);
} |
339707e5-20b2-4a21-b4b4-951bccbcbe8c | @Override
public void run() {
TcpSender packetSender = new TcpSender();
while (true) {
// A spin wait is super resource heavy
// TODO: not this
while (ccl.isEmpty()) {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace(... |
ae46a001-85fb-4aae-b6c8-6261f43dd9e8 | public Reciever() {
} |
5bb9161e-9676-45d5-a833-9448df572966 | public void run() {
ConcurrentLinkedQueue<Packet> packetQueue = new ConcurrentLinkedQueue<Packet>();
new Thread(new TcpReciever(Configuration.RECEIVE_PORT, packetQueue)).start();
Packet p;
while (true) {
while (packetQueue.isEmpty()) {
try {
Thread.sleep(2000);
} catch (InterruptedException... |
ab81199e-9a2d-4683-863d-46f90212d4b6 | @CreoleParameter(
comment="Directory that contains the files to access as documents",
defaultValue = "")
public void setDirectoryURL(URL dirURL) {
directoryURL = dirURL;
} |
16b7969e-6d1e-44ac-94a1-fc48c62f9e25 | public URL getDirectoryURL() {
return directoryURL;
} |
7e82824d-2bd5-496c-9f6b-21679cf92aa5 | @CreoleParameter(
comment="Exclude hidden files", defaultValue="true")
public void setExcludeHidden(Boolean yesno) {
excludeHidden = yesno;
} |
53288500-316b-4c4c-86fb-cafab5d901b6 | public Boolean getExcludeHidden() {
return excludeHidden;
} |
66b58296-dc79-4faa-8677-c406fc5e53e5 | @CreoleParameter(
comment="Maximum number of documents to access, 0=all",
defaultValue = "0")
public void setLimit(Integer max) {
limit = max;
} |
f4f07f2d-3ab3-49e0-9aad-9c38d123d578 | public Integer getLimit() {
return limit;
} |
a764199d-0015-4e82-960d-f9d56dc4000b | @CreoleParameter(
comment="Encoding of the file contents, empty: use system default encoding",
defaultValue="utf-8")
public void setEncoding(String enc) {
encoding = enc;
} |
f32f5553-2673-4736-95b3-e4b7cca70a51 | public String getEncoding() {
return encoding;
} |
d7c1ecbe-4743-4b29-b218-d43c2e3833f4 | @CreoleParameter(
comment="Mime type of the file contents, empty: guess from extension",
defaultValue="application/xml")
public void setMimeType(String mtype) {
mimeType = mtype;
} |
1d9ab052-b9a0-49ae-aad6-4e9a6dd7c37f | public String getMimeType() {
return mimeType;
} |
bb5f18c4-dec6-4430-b781-56ba202b9f56 | @CreoleParameter(
comment="If the contents of the file is compressed",
defaultValue = "FROM_EXTENSION")
public void setCompressed(ParamCompressed c) {
compressed = c;
} |
232f11c6-6c64-4d69-9b43-8d84c683f6e2 | public ParamCompressed getCompressed() {
return compressed;
} |
18ef9ad6-e6d0-4680-a1f4-e7a5700e7a6b | @CreoleParameter(
comment="If the file extension should be included in the document name",
defaultValue="true")
public void setIncludeExtension(Boolean yesno) {
includeExtension = yesno;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.