blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7f2be82c1dcd8991b3f4c5ccec5e71422a194f37 | 029943a736db4a19700dc5e8093ffac451b0eec8 | /src/com/vidyo/webservices/user/LogOutResponse.java | 5c1f9f06093d3ca697047aa2d9c31d321a1d5d0b | [] | no_license | hsolia/rankrepo | 8c051ba5704cc81c2d93c061b6c38931e564cb0a | 5a26c815a0e485d6a3294d4eaa7ac876a0ea7110 | refs/heads/master | 2021-01-25T07:19:47.078792 | 2012-09-21T06:56:47 | 2012-09-21T06:56:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,486 | java |
package com.vidyo.webservices.user;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{http://portal.vidyo.com/user/v1_1}OK"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"ok"
})
@XmlRootElement(name = "LogOutResponse")
public class LogOutResponse {
@XmlElement(name = "OK", required = true)
protected String ok;
/**
* Gets the value of the ok property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOK() {
return ok;
}
/**
* Sets the value of the ok property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOK(String value) {
this.ok = value;
}
}
| [
"hsolia@kristeksoftware.com"
] | hsolia@kristeksoftware.com |
fc24fb1fdf01d1818d21db78d83df7423065ed36 | d24d9e3f608ec8e56457bd76e45831425198e64c | /src/main/java/Dest.java | e32364d6fd61e854b1dff94a547fcb3a3d5174c3 | [] | no_license | RFLewandowski/orika-lombok-integration | acb05f5e43aeb2a9f9744fb818dae559d52a4847 | 5f2f3c29be470529f67650cc08e4ee9d6bae612d | refs/heads/master | 2020-04-24T19:31:24.811490 | 2019-02-23T13:05:35 | 2019-02-23T13:05:35 | 172,214,634 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 107 | java | import lombok.Data;
@Data
public class Dest {
private final String name;
private final int age;
}
| [
"R.F.Lewandowski@gmail.com"
] | R.F.Lewandowski@gmail.com |
b792a04d6f4bc1835233de49577000aec39a076c | e34544a32430efcd23f8dfaa28ebfa8c856bed30 | /OutdoorTourTracker/app/src/main/java/de/esri/outdoortourtracker/TourTypeAdapter.java | 4785277e05c59607557d279413fb38a0f30af6e5 | [
"Apache-2.0"
] | permissive | EsriDE/Outdoor-Tour-Tracker | 3aa7f3d3e40795b83d3cbebb602f5267182847e7 | 96ac6797f851af2d9f988db8696e11e841506561 | refs/heads/master | 2021-10-10T20:11:39.989921 | 2019-01-16T13:26:17 | 2019-01-16T13:26:17 | 114,980,452 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,390 | java | package de.esri.outdoortourtracker;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
/**
*
*/
public class TourTypeAdapter extends BaseAdapter {
private Context context;
private int[] typeIcons;
private String[] typeNames;
private LayoutInflater inflater;
public TourTypeAdapter(Context context, int[] typeIcons, String[] typeNames){
this.context = context;
this.typeIcons = typeIcons;
this.typeNames = typeNames;
inflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return typeNames.length;
}
@Override
public Object getItem(int position) {
return typeNames[position];
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View view, ViewGroup parent) {
view = inflater.inflate(R.layout.tour_type_item, null);
ImageView image = (ImageView) view.findViewById(R.id.image_tour_type);
TextView name = (TextView) view.findViewById(R.id.text_tour_type);
image.setImageResource(typeIcons[position]);
name.setText(typeNames[position]);
return view;
}
}
| [
"r.suchan@esri.de"
] | r.suchan@esri.de |
be1f2c2d595e28a0c619644db6491296917824a5 | 31f4cab278d83a755f1e434f35273223b049d172 | /repositories/jackrabbit-oak/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java | 07cb816b72239ee1938a7dc9c7f85a70e4d56d82 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JenniferJohnson89/bugs_dot_jar_dissection | 2a017f5f77772ddb2b9a5e45423ae084fa1bd7a0 | 7012cccce9a3fdbfc97a0ca507420c24650f6bcf | refs/heads/main | 2022-12-28T16:38:18.039203 | 2020-10-20T09:45:47 | 2020-10-20T09:45:47 | 305,639,612 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 25,240 | 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.jackrabbit.mk.model;
import org.apache.jackrabbit.mk.store.Binding;
import org.apache.jackrabbit.mk.store.RevisionProvider;
import org.apache.jackrabbit.mk.store.RevisionStore;
import org.apache.jackrabbit.mk.util.AbstractFilteringIterator;
import org.apache.jackrabbit.mk.util.AbstractRangeIterator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
/**
*
*/
public class ChildNodeEntriesTree implements ChildNodeEntries {
protected static final List<ChildNode> EMPTY = Collections.emptyList();
protected int count;
protected RevisionProvider revProvider;
// array of *immutable* IndexEntry objects
protected IndexEntry[] index = new IndexEntry[1024]; // 2^10
ChildNodeEntriesTree(RevisionProvider revProvider) {
this.revProvider = revProvider;
}
@Override
public boolean inlined() {
return false;
}
//------------------------------------------------------------< overrides >
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof ChildNodeEntriesTree) {
ChildNodeEntriesTree other = (ChildNodeEntriesTree) obj;
return Arrays.equals(index, other.index);
}
return false;
}
@Override
public Object clone() {
ChildNodeEntriesTree clone = null;
try {
clone = (ChildNodeEntriesTree) super.clone();
} catch (CloneNotSupportedException e) {
// can't possibly get here
}
// shallow clone of array of immutable IndexEntry objects
clone.index = index.clone();
return clone;
}
//-------------------------------------------------------------< read ops >
@Override
public int getCount() {
return count;
}
@Override
public ChildNode get(String name) {
IndexEntry entry = index[keyToIndex(name)];
if (entry == null) {
return null;
}
if (entry instanceof ChildNode) {
ChildNode cne = (ChildNode) entry;
return cne.getName().equals(name) ? cne : null;
} else if (entry instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) entry;
ChildNodeEntries entries = retrieveBucket(bi.getId());
return entries == null ? null : entries.get(name);
} else {
// dirty bucket
Bucket bucket = (Bucket) entry;
return bucket.get(name);
}
}
@Override
public Iterator<String> getNames(int offset, int cnt) {
if (offset < 0 || cnt < -1) {
throw new IllegalArgumentException();
}
if (offset >= count || cnt == 0) {
List<String> empty = Collections.emptyList();
return empty.iterator();
}
if (cnt == -1 || (offset + cnt) > count) {
cnt = count - offset;
}
return new AbstractRangeIterator<String>(getEntries(offset, cnt), 0, -1) {
@Override
protected String doNext() {
ChildNode cne = (ChildNode) it.next();
return cne.getName();
}
};
}
@Override
public Iterator<ChildNode> getEntries(int offset, int cnt) {
if (offset < 0 || cnt < -1) {
throw new IllegalArgumentException();
}
if (offset >= count || cnt == 0) {
return EMPTY.iterator();
}
int skipped = 0;
if (cnt == -1 || (offset + cnt) > count) {
cnt = count - offset;
}
ArrayList<ChildNode> list = new ArrayList<ChildNode>(cnt);
for (IndexEntry e : index) {
if (e != null) {
if (skipped + e.getSize() <= offset) {
skipped += e.getSize();
} else {
if (e instanceof NodeInfo) {
list.add((NodeInfo) e);
} else if (e instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) e;
ChildNodeEntries bucket = retrieveBucket(bi.getId());
for (Iterator<ChildNode> it =
bucket.getEntries(offset - skipped, cnt - list.size());
it.hasNext(); ) {
list.add(it.next());
}
skipped = offset;
} else {
// dirty bucket
Bucket bucket = (Bucket) e;
for (Iterator<ChildNode> it =
bucket.getEntries(offset - skipped, cnt - list.size());
it.hasNext(); ) {
list.add(it.next());
}
skipped = offset;
}
if (list.size() == cnt) {
break;
}
}
}
}
return list.iterator();
}
//------------------------------------------------------------< write ops >
@Override
public ChildNode add(ChildNode entry) {
int idx = keyToIndex(entry.getName());
IndexEntry ie = index[idx];
if (ie == null) {
index[idx] = new NodeInfo(entry.getName(), entry.getId());
count++;
return null;
}
if (ie instanceof ChildNode) {
ChildNode existing = (ChildNode) ie;
if (existing.getName().equals(entry.getName())) {
index[idx] = new NodeInfo(entry.getName(), entry.getId());
return existing;
} else {
Bucket bucket = new Bucket();
bucket.add(existing);
bucket.add(entry);
index[idx] = bucket;
count++;
return null;
}
}
Bucket bucket;
if (ie instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie;
bucket = new Bucket(retrieveBucket(bi.getId()));
} else {
// dirty bucket
bucket = (Bucket) ie;
}
ChildNode existing = bucket.add(entry);
if (entry.equals(existing)) {
// no-op
return existing;
}
index[idx] = bucket;
if (existing == null) {
// new entry
count++;
}
return existing;
}
@Override
public ChildNode remove(String name) {
int idx = keyToIndex(name);
IndexEntry ie = index[idx];
if (ie == null) {
return null;
}
if (ie instanceof ChildNode) {
ChildNode existing = (ChildNode) ie;
if (existing.getName().equals(name)) {
index[idx] = null;
count--;
return existing;
} else {
return null;
}
}
Bucket bucket;
if (ie instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie;
bucket = new Bucket(retrieveBucket(bi.getId()));
} else {
// dirty bucket
bucket = (Bucket) ie;
}
ChildNode existing = bucket.remove(name);
if (existing == null) {
return null;
}
if (bucket.getCount() == 0) {
index[idx] = null;
} else if (bucket.getCount() == 1) {
// inline single remaining entry
ChildNode remaining = bucket.getEntries(0, 1).next();
index[idx] = new NodeInfo(remaining.getName(), remaining.getId());
} else {
index[idx] = bucket;
}
count--;
return existing;
}
@Override
public ChildNode rename(String oldName, String newName) {
if (oldName.equals(newName)) {
return get(oldName);
}
ChildNode old = remove(oldName);
if (old == null) {
return null;
}
add(new ChildNode(newName, old.getId()));
return old;
}
//-------------------------------------------------------------< diff ops >
@Override
public Iterator<ChildNode> getAdded(final ChildNodeEntries other) {
if (other instanceof ChildNodeEntriesTree) {
List<ChildNode> added = new ArrayList<ChildNode>();
ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
for (int i = 0; i < index.length; i++) {
IndexEntry ie1 = index[i];
IndexEntry ie2 = otherEntries.index[i];
if (! (ie1 == null ? ie2 == null : ie1.equals(ie2))) {
// index entries aren't equal
if (ie1 == null) {
// this index entry in null => other must be non-null
if (ie2 instanceof NodeInfo) {
added.add((ChildNode) ie2);
} else if (ie2 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie2;
ChildNodeEntries bucket = retrieveBucket(bi.getId());
for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
it.hasNext(); ) {
added.add(it.next());
}
} else {
// dirty bucket
Bucket bucket = (Bucket) ie2;
for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
it.hasNext(); ) {
added.add(it.next());
}
}
} else if (ie2 != null) {
// both this and other index entry are non-null
ChildNodeEntriesMap bucket1;
if (ie1 instanceof NodeInfo) {
bucket1 = new ChildNodeEntriesMap();
bucket1.add((ChildNode) ie1);
} else if (ie1 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie1;
bucket1 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket1 = (Bucket) ie1;
}
ChildNodeEntriesMap bucket2;
if (ie2 instanceof NodeInfo) {
bucket2 = new ChildNodeEntriesMap();
bucket2.add((ChildNode) ie2);
} else if (ie2 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie2;
bucket2 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket2 = (Bucket) ie2;
}
for (Iterator<ChildNode> it = bucket1.getAdded(bucket2);
it.hasNext(); ) {
added.add(it.next());
}
}
}
}
return added.iterator();
} else {
// todo optimize
return new AbstractFilteringIterator<ChildNode>(other.getEntries(0, -1)) {
@Override
protected boolean include(ChildNode entry) {
return get(entry.getName()) == null;
}
};
}
}
@Override
public Iterator<ChildNode> getRemoved(final ChildNodeEntries other) {
if (other instanceof ChildNodeEntriesTree) {
List<ChildNode> removed = new ArrayList<ChildNode>();
ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
for (int i = 0; i < index.length; i++) {
IndexEntry ie1 = index[i];
IndexEntry ie2 = otherEntries.index[i];
if (! (ie1 == null ? ie2 == null : ie1.equals(ie2))) {
// index entries aren't equal
if (ie2 == null) {
// other index entry is null => this must be non-null
if (ie1 instanceof NodeInfo) {
removed.add((ChildNode) ie1);
} else if (ie1 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie1;
ChildNodeEntries bucket = retrieveBucket(bi.getId());
for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
it.hasNext(); ) {
removed.add(it.next());
}
} else {
// dirty bucket
Bucket bucket = (Bucket) ie1;
for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
it.hasNext(); ) {
removed.add(it.next());
}
}
} else if (ie1 != null) {
// both this and other index entry are non-null
ChildNodeEntriesMap bucket1;
if (ie1 instanceof NodeInfo) {
bucket1 = new ChildNodeEntriesMap();
bucket1.add((ChildNode) ie1);
} else if (ie1 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie1;
bucket1 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket1 = (Bucket) ie1;
}
ChildNodeEntriesMap bucket2;
if (ie2 instanceof NodeInfo) {
bucket2 = new ChildNodeEntriesMap();
bucket2.add((ChildNode) ie2);
} else if (ie2 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie2;
bucket2 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket2 = (Bucket) ie2;
}
for (Iterator<ChildNode> it = bucket1.getRemoved(bucket2);
it.hasNext(); ) {
removed.add(it.next());
}
}
}
}
return removed.iterator();
} else {
// todo optimize
return new AbstractFilteringIterator<ChildNode>(getEntries(0, -1)) {
@Override
protected boolean include(ChildNode entry) {
return other.get(entry.getName()) == null;
}
};
}
}
@Override
public Iterator<ChildNode> getModified(final ChildNodeEntries other) {
if (other instanceof ChildNodeEntriesTree) {
List<ChildNode> modified = new ArrayList<ChildNode>();
ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
for (int i = 0; i < index.length; i++) {
IndexEntry ie1 = index[i];
IndexEntry ie2 = otherEntries.index[i];
if (ie1 != null && ie2 != null && !ie1.equals(ie2)) {
// index entries are non-null and not equal
if (ie1 instanceof NodeInfo
&& ie2 instanceof NodeInfo) {
NodeInfo ni1 = (NodeInfo) ie1;
NodeInfo ni2 = (NodeInfo) ie2;
if (ni1.getName().equals(ni2.getName())
&& !ni1.getId().equals(ni2.getId())) {
modified.add(ni1);
continue;
}
}
ChildNodeEntriesMap bucket1;
if (ie1 instanceof NodeInfo) {
bucket1 = new ChildNodeEntriesMap();
bucket1.add((ChildNode) ie1);
} else if (ie1 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie1;
bucket1 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket1 = (Bucket) ie1;
}
ChildNodeEntriesMap bucket2;
if (ie2 instanceof NodeInfo) {
bucket2 = new ChildNodeEntriesMap();
bucket2.add((ChildNode) ie2);
} else if (ie2 instanceof BucketInfo) {
BucketInfo bi = (BucketInfo) ie2;
bucket2 = retrieveBucket(bi.getId());
} else {
// dirty bucket
bucket2 = (Bucket) ie2;
}
for (Iterator<ChildNode> it = bucket1.getModified(bucket2);
it.hasNext(); ) {
modified.add(it.next());
}
}
}
return modified.iterator();
} else {
return new AbstractFilteringIterator<ChildNode>(getEntries(0, -1)) {
@Override
protected boolean include(ChildNode entry) {
ChildNode namesake = other.get(entry.getName());
return (namesake != null && !namesake.getId().equals(entry.getId()));
}
};
}
}
//-------------------------------------------------------< implementation >
protected void persistDirtyBuckets(RevisionStore store, RevisionStore.PutToken token) throws Exception {
for (int i = 0; i < index.length; i++) {
if (index[i] instanceof Bucket) {
// dirty bucket
Bucket bucket = (Bucket) index[i];
Id id = store.putCNEMap(token, bucket);
index[i] = new BucketInfo(id, bucket.getSize());
}
}
}
protected int keyToIndex(String key) {
int hash = key.hashCode();
// todo rehash? ensure optimal distribution of hash WRT to index.length
return (hash & 0x7FFFFFFF) % index.length;
}
protected ChildNodeEntriesMap retrieveBucket(Id id) {
try {
return revProvider.getCNEMap(id);
} catch (Exception e) {
// todo log error and gracefully handle exception
return new ChildNodeEntriesMap();
}
}
//------------------------------------------------< serialization support >
public void serialize(Binding binding) throws Exception {
// TODO use binary instead of string serialization
binding.write(":count", count);
binding.writeMap(":index", index.length, new Binding.StringEntryIterator() {
int pos = -1;
@Override
public boolean hasNext() {
return pos < index.length - 1;
}
@Override
public Binding.StringEntry next() {
pos++;
if (pos >= index.length) {
throw new NoSuchElementException();
}
// serialize index array entry
IndexEntry entry = index[pos];
if (entry == null) {
// null entry: ""
return new Binding.StringEntry(Integer.toString(pos), "");
} else if (entry instanceof NodeInfo) {
NodeInfo ni = (NodeInfo) entry;
// "n<id>:<name>"
return new Binding.StringEntry(Integer.toString(pos), "n" + ni.getId() + ":" + ni.getName());
} else {
BucketInfo bi = (BucketInfo) entry;
// "b<id>:<count>"
return new Binding.StringEntry(Integer.toString(pos), "b" + bi.getId() + ":" + bi.getSize());
}
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
});
}
static ChildNodeEntriesTree deserialize(RevisionProvider provider, Binding binding) throws Exception {
// TODO use binary instead of string serialization
ChildNodeEntriesTree newInstance = new ChildNodeEntriesTree(provider);
newInstance.count = binding.readIntValue(":count");
Binding.StringEntryIterator iter = binding.readStringMap(":index");
int pos = -1;
while (iter.hasNext()) {
Binding.StringEntry entry = iter.next();
++pos;
// deserialize index array entry
assert(pos == Integer.parseInt(entry.getKey()));
if (entry.getValue().length() == 0) {
// ""
newInstance.index[pos] = null;
} else if (entry.getValue().charAt(0) == 'n') {
// "n<id>:<name>"
String value = entry.getValue().substring(1);
int i = value.indexOf(':');
String id = value.substring(0, i);
String name = value.substring(i + 1);
newInstance.index[pos] = new NodeInfo(name, Id.fromString(id));
} else {
// "b<id>:<count>"
String value = entry.getValue().substring(1);
int i = value.indexOf(':');
String id = value.substring(0, i);
int count = Integer.parseInt(value.substring(i + 1));
newInstance.index[pos] = new BucketInfo(Id.fromString(id), count);
}
}
return newInstance;
}
//--------------------------------------------------------< inner classes >
protected static interface IndexEntry {
// number of entries
int getSize();
}
protected static class BucketInfo implements IndexEntry {
// bucket id
private final Id id;
// number of bucket entries
private final int size;
protected BucketInfo(Id id, int size) {
this.id = id;
this.size = size;
}
public Id getId() {
return id;
}
public int getSize() {
return size;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof BucketInfo) {
BucketInfo other = (BucketInfo) obj;
return (size == other.size && id == null ? other.id == null : id.equals(other.id));
}
return false;
}
}
protected static class Bucket extends ChildNodeEntriesMap implements IndexEntry {
protected Bucket() {
}
protected Bucket(ChildNodeEntriesMap other) {
super(other);
}
@Override
public int getSize() {
return getCount();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof Bucket) {
return super.equals(obj);
}
return false;
}
}
protected static class NodeInfo extends ChildNode implements IndexEntry {
public NodeInfo(String name, Id id) {
super(name, id);
}
public int getSize() {
return 1;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof NodeInfo) {
return super.equals(obj);
}
return false;
}
}
}
| [
"JenniferJonhnson89@163.com"
] | JenniferJonhnson89@163.com |
4542b17c3aec7484e37582353c2e2343ce10f97a | d50b16be68bce09edeee3828aba03982d3bb0af0 | /app/src/main/java/com/ladsoft/bakingapp/activity/RecipeStepActivity.java | 2978e32e76676e733c456f35fba93456334c69ab | [] | no_license | ladSuematsu/BakingApp | e250f130408d7ad31eabb772d45fa4d26c8773d6 | bba4512c8582ca8bf80662015e3d7bd8909e2a07 | refs/heads/master | 2021-01-20T07:08:40.566300 | 2018-06-14T04:33:36 | 2018-06-14T04:33:36 | 89,966,202 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,688 | java | package com.ladsoft.bakingapp.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import com.ladsoft.bakingapp.R;
import com.ladsoft.bakingapp.adapter.StepSlideshowAdapter;
import com.ladsoft.bakingapp.entity.Step;
import com.ladsoft.bakingapp.fragment.RecipeStepFragment;
import com.ladsoft.bakingapp.mvp.StepsMvp;
import com.ladsoft.bakingapp.mvp.presenter.StepPresenter;
import java.util.List;
import javax.inject.Inject;
import butterknife.BindView;
import butterknife.ButterKnife;
import dagger.android.AndroidInjection;
public class RecipeStepActivity extends AppCompatActivity implements StepsMvp.View, RecipeStepFragment.Callback {
private static final String LOG_TAG = RecipeStepActivity.class.getSimpleName();
public static final String EXTRA_STEPS = "extra_steps";
public static final String EXTRA_STEP_INDEX = "extra_step_index";
@Inject StepPresenter presenter;
@BindView(R.id.toolbar) Toolbar toolbar;
@BindView(R.id.step_pager) ViewPager content;
private StepSlideshowAdapter slideshowAdapter;
private boolean activityCreation;
@Override
protected void onCreate(@android.support.annotation.Nullable Bundle savedInstanceState) {
Log.d(LOG_TAG, "onCreate: " + (savedInstanceState != null ? savedInstanceState.toString() : "NULL"));
AndroidInjection.inject(this);
activityCreation = true;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_step);
ButterKnife.bind(this);
setupViews();
setupFragments();
}
@Override
protected void onStart() {
Log.d(LOG_TAG, "onStart");
super.onStart();
presenter.attachView(this);
if (activityCreation) {
Intent intent = getIntent();
presenter.setData(intent.getIntExtra(EXTRA_STEP_INDEX, 0),
(List) intent.getParcelableArrayListExtra(EXTRA_STEPS),
true);
presenter.showCurrentStep();
activityCreation = false;
}
}
protected void onStop() {
Log.d(LOG_TAG, "onStop");
presenter.detachView();
super.onStop();
}
private void setupViews() {
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
}
private void setupFragments() {
slideshowAdapter = new StepSlideshowAdapter(getSupportFragmentManager(), this);
content.setAdapter(slideshowAdapter);
content.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
presenter.setCurrentStepIndex(position);
}
});
}
@Override
public void onStepsLoaded(List<Step> steps) {
slideshowAdapter.setDataSource(steps);
}
@Override
public void onNextPress() {
presenter.nextStep();
}
@Override
public void onPreviousPress() {
presenter.previousStep();
}
@Nullable
@Override
public Step onVisible() {
return presenter.stepData();
}
@Override
public void showStep(int position) {
Log.d(LOG_TAG, "Navigating to index $position");
content.setCurrentItem(position, true);
}
}
| [
"suematsu01@gmail.com"
] | suematsu01@gmail.com |
955ad655cd57951e7b08461c503d0eb6dcfaf01c | 5ab18a8c41279c1902bed51e221b4179ad48bbd2 | /FLongApis/src/main/java/com/yanShu/fLongs/servicesImpls/Category_ServiceImpl.java | caca95acc7a029dcb7f67fe08b7e0191adc00436 | [] | no_license | Saber201314/FLongApis | bcb81da02fe703c386a5975ca7b86469abd30b0a | 682dc9b121519224c9b21e617057da63164472ab | refs/heads/master | 2020-12-30T15:41:36.414914 | 2017-05-16T10:57:21 | 2017-05-16T10:57:21 | 91,159,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package com.yanShu.fLongs.servicesImpls;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanShu.fLongs.entitys.CategoryEntity;
import com.yanShu.fLongs.mappers.Icategory_Mapper;
import com.yanShu.fLongs.services.Icategory_Service;
@Service
public class Category_ServiceImpl implements Icategory_Service{
@Autowired
private Icategory_Mapper categoryMapper;
@Override
public List<CategoryEntity> findById(Integer id) {
// TODO Auto-generated method stub
return categoryMapper.findById(id);
}
@Override
public List<CategoryEntity> findByName(String name) {
// TODO Auto-generated method stub
return categoryMapper.findByName(name);
}
@Override
public List<CategoryEntity> findByType(String categoryType) {
// TODO Auto-generated method stub
return categoryMapper.findByType(categoryType);
}
@Override
public List<CategoryEntity> findByLeafId(String leafId) {
// TODO Auto-generated method stub
return categoryMapper.findByLeafId(leafId);
}
@Override
public List<CategoryEntity> findByLevelNode(String levelNode) {
// TODO Auto-generated method stub
return categoryMapper.findByLevelNode(levelNode);
}
}
| [
"171553438@qq.com"
] | 171553438@qq.com |
73f6adb7583ffac2e7009545ff164c7f6953519d | 03600d83904ea123f4ab3d255a9edd1598ff563a | /food-order/src/dao/FavorDao.java | 4af97be8d33590f747f1fa243335fdccab919ad7 | [] | no_license | qq456cvb/Online_food_order | 108af9a91ea1d5a2c545fb937419cd383424c373 | 3be1bf12c691691886892d60035b1b28d849a6ef | refs/heads/master | 2021-01-10T04:48:05.215195 | 2015-10-29T15:22:36 | 2015-10-29T15:22:36 | 45,191,712 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,889 | java | package dao;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import model.Customer;
import model.Favor;
import model.Restaurant;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
public class FavorDao {
private SessionFactory sessionFactory;
public SessionFactory getSessionFactory()
{
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory)
{
this.sessionFactory = sessionFactory;
}
public FavorDao()
{
}
private CustomDao cusDao;
private RestDao restDao;
public boolean addFavor(Long cid, Long rid) {
Session session = sessionFactory.openSession();
Favor favor = (Favor) session.createSQLQuery("select f.* from favors f where cusId = :cid and restId = :rid")
.addEntity(Favor.class).setParameter("cid", cid).setParameter("rid", rid)
.uniqueResult();
if (favor != null) {
favor.setStat(1);
Transaction tx = session.beginTransaction();
session.update(favor);
tx.commit();
session.close();
return true;
}
favor = new Favor();
favor.setStat(1);
Customer cus = new Customer();
cus = cusDao.getUserById(cid);
Restaurant rest = new Restaurant();
rest = restDao.getRestById(rid);
List cusFavorList = new ArrayList();
cusFavorList = cusDao.getFavors(cid);
List restFavorList = new ArrayList();
restFavorList = restDao.getRestFavors(rid);
Set cusFavors = new HashSet();
Set restFavors = new HashSet();
for (Iterator it = cusFavorList.iterator();it.hasNext();) {
cusFavors.add(it.next());
}
for (Iterator it = restFavorList.iterator();it.hasNext();) {
restFavors.add(it.next());
}
favor.setCus(cus);
favor.setRest(rest);
if (!cusFavors.add(favor)) {
return false;
}
if (!restFavors.add(favor)) {
return false;
}
cus.setFavors(cusFavors);
rest.setFavors(restFavors);
Transaction tx = session.beginTransaction();
session.save(favor);
tx.commit();
session.close();
return true;
}
public RestDao getRestDao() {
return restDao;
}
public void setRestDao(RestDao restDao) {
this.restDao = restDao;
}
public CustomDao getCusDao() {
return cusDao;
}
public void setCusDao(CustomDao cusDao) {
this.cusDao = cusDao;
}
public List getFavorRest(Long cid) {
Session session = sessionFactory.openSession();
List<Restaurant> rests = session.createSQLQuery("select r.* from customers c natural join favors f natural join restaurants r where cusId = :cid and stat != 0")
.addEntity(Restaurant.class).setParameter("cid", cid)
.list();
session.close();
return rests;
}
public boolean findFavor(Long cid, Long rid) {
Session session = sessionFactory.openSession();
List<Favor> favors = session.createSQLQuery("select f.* from favors f where cusId = :cid and restId = :rid and stat != 0")
.addEntity(Favor.class).setParameter("cid", cid).setParameter("rid", rid)
.list();
session.close();
if (favors.size() == 0) {
return false;
} else {
return true;
}
}
public boolean removeFavor(Long cid, Long rid) {
Session session = sessionFactory.openSession();
Favor favor = (Favor) session.createSQLQuery("select f.* from favors f where cusId = :cid and restId = :rid")
.addEntity(Favor.class).setParameter("cid", cid).setParameter("rid", rid)
.uniqueResult();
if (favor == null || favor.getStat() == 0) {
return false;
} else {
favor.setStat(0);
Transaction tx = session.beginTransaction();
session.update(favor);
tx.commit();
session.close();
return true;
}
}
}
| [
"447626601@qq.com"
] | 447626601@qq.com |
577c920dc1a27c1bcbfb98962c8559b9f0a3f766 | debcb92f59ebbb5f5369bece051669363a685bef | /src/test/java/ExamTest/Exam.java | 49110ffd39b8114457d1d19be782a6689ae983e8 | [] | no_license | alicemarkaryan/Exam | fd262f4c92f4da49ca64359dcc5d803b956cadb1 | b3c835fe0b9dee37b856bb190072b67913a0f7f4 | refs/heads/master | 2023-05-16T07:29:23.226299 | 2021-05-19T17:35:07 | 2021-05-19T17:35:07 | 368,944,746 | 0 | 0 | null | 2021-05-26T10:33:26 | 2021-05-19T17:09:39 | HTML | UTF-8 | Java | false | false | 2,287 | java | package ExamTest;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;
import net.bytebuddy.dynamic.DynamicType;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
public class Exam {
@Test
public void testExam() {
System.setProperty("webdriver.chrome.driver", "src\\main\\resources\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://staff.am/");
WebDriverWait wait = new WebDriverWait(driver, 20);
By jobCategoElem = By.xpath("//*[@id='jobsfilter-category']");
WebElement jobCatego = wait.until(ExpectedConditions.elementToBeClickable(jobCategoElem));
jobCatego.click();
By jobElem = By.xpath("//*[@id='jobsfilter-category']//child::option[4]");
WebElement job = wait.until(ExpectedConditions.elementToBeClickable(jobElem));
job.click();
By searchElem = By.xpath("//*[@class='fa fa-search']");
WebElement search = driver.findElement(searchElem);
search.click();
By countElem = By.xpath("//*[@id='jobsfilter-category']//child::label[4]");
WebElement count = wait.until(ExpectedConditions.visibilityOfElementLocated(countElem));
String countStr = count.getText();
String countRep = countStr.replaceAll("[^0-9]", "");
int countInt = Integer.parseInt(countRep);
System.out.println(countInt);
By allJobsElem = By.xpath("//*[@class='job_list_company_title']");
List<WebElement> allJobs = wait.until(ExpectedConditions.numberOfElementsToBeLessThan(allJobsElem, 50));
int elemCount = allJobs.size();
System.out.println(elemCount);
Assert.assertTrue(this.check(countInt, elemCount));
driver.quit();
}
public boolean check(int a, int b) {
return a == b;
}
}
| [
"alisa.markaryan@yahoo.com"
] | alisa.markaryan@yahoo.com |
f6150f46a672558e7a6c97179be6f7d2c88f6805 | 4d5fd67921149fe8650cc47994f518421036c546 | /java8-jersey2/src/test/java/com/sphereon/sdk/blockchain/easy/api/EntryApiTest.java | 8eacc1f1b42fbabaaa06bd1ef8c1314786ebafa4 | [
"Apache-2.0"
] | permissive | nr24119/easy-blockchain-sdk | af45f3b0a35d85c4f3755e8246b7d6201c6e73ea | 50855f37ce81f987fe16cce51866743d05bcf732 | refs/heads/master | 2020-04-01T01:08:42.825307 | 2018-03-13T02:19:56 | 2018-03-13T02:19:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,045 | java | /**
* Easy Blockchain API
* <b>The Easy Blockchain API is an easy to use API to store entries within chains. Currently it stores entries using the bitcoin blockchain by means of Factom. In the future other solutions will be made available</b> The flow is generally as follows: 1. Make sure a chain has been created using the /chain POST endpoint. Normally you only need one or a handful of chains. This is an expensive operation. 2. Store entries on the chain from step 1. The entries will contain the content and metadata you want to store forever on the specified chain. 3. Retrieve an existing entry from the chain to verify or retrieve data <b>Interactive testing: </b>A web based test console is available in the <a href=\"https://store.sphereon.com\">Sphereon API Store</a>
*
* OpenAPI spec version: 0.1.0
* Contact: dev@sphereon.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* 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.sphereon.sdk.blockchain.easy.api;
import com.sphereon.sdk.blockchain.easy.handler.ApiException;
import com.sphereon.sdk.blockchain.easy.model.CommittedEntryResponse;
import com.sphereon.sdk.blockchain.easy.model.Entry;
import com.sphereon.sdk.blockchain.easy.model.VndErrors;
import com.sphereon.sdk.blockchain.easy.model.AnchoredEntryResponse;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for EntryApi
*/
public class EntryApiTest {
private final EntryApi api = new EntryApi();
/**
* Create a new entry in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void createEntryTest() throws ApiException {
String chainId = null;
Entry entry = null;
// CommittedEntryResponse response = api.createEntry(chainId, entry);
// TODO: test validations
}
/**
* Get an existing entry in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void entryByIdTest() throws ApiException {
String chainId = null;
String entryId = null;
// AnchoredEntryResponse response = api.entryById(chainId, entryId);
// TODO: test validations
}
/**
* Get an existing entry in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void entryByRequestTest() throws ApiException {
String chainId = null;
Entry entry = null;
// AnchoredEntryResponse response = api.entryByRequest(chainId, entry);
// TODO: test validations
}
/**
* Get the first entry in the provided chain. This is the oldest entry also called the chain tail
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void firstEntryTest() throws ApiException {
String chainId = null;
// AnchoredEntryResponse response = api.firstEntry(chainId);
// TODO: test validations
}
/**
* Get the last entry in the provided chain. This is the most recent entry also called the chain head
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void lastEntryTest() throws ApiException {
String chainId = null;
// AnchoredEntryResponse response = api.lastEntry(chainId);
// TODO: test validations
}
/**
* Get the entry after the supplied entry Id (the next) in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void nextEntryByIdTest() throws ApiException {
String chainId = null;
String entryId = null;
// AnchoredEntryResponse response = api.nextEntryById(chainId, entryId);
// TODO: test validations
}
/**
* Get the entry after the supplied entry Id (the next) in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void nextEntryByRequestTest() throws ApiException {
String chainId = null;
Entry entry = null;
// AnchoredEntryResponse response = api.nextEntryByRequest(chainId, entry);
// TODO: test validations
}
/**
* Get the entry before the supplied entry Id (the previous) in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void previousEntryByIdTest() throws ApiException {
String chainId = null;
String entryId = null;
// AnchoredEntryResponse response = api.previousEntryById(chainId, entryId);
// TODO: test validations
}
/**
* Get the entry before the supplied entry Id (the previous) in the provided chain
*
*
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void previousEntryByRequestTest() throws ApiException {
String chainId = null;
Entry entry = null;
// AnchoredEntryResponse response = api.previousEntryByRequest(chainId, entry);
// TODO: test validations
}
}
| [
"niels.klomp@gmail.com"
] | niels.klomp@gmail.com |
c7fa19c01a915af7a70e97f140b9a100b9553653 | 739e319f5615424667ac6acdf4366fef9bc71a84 | /tags/version.1.0/trunk/modules/rajenlab-common/source/main/java/li/rajenlab/common/hibernate/type/StringValuedEnumType.java | d835bc9caf23557e5528748d756d66f4114de3a9 | [] | no_license | BackupTheBerlios/canto-svn | 1c10441e84f66c8c59ae9aad092903a3d3790df1 | 4c387afbedcb66c6fb71fa970b98225ece223ebf | refs/heads/master | 2016-09-05T21:35:57.797761 | 2007-07-12T09:43:27 | 2007-07-12T09:43:27 | 40,669,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,329 | java | /******************************************************************************
* $LastChangedBy$
* $LastChangedRevision$
* $LastChangedDate$
******************************************************************************
* Project: rajenlab-common
******************************************************************************
* $HeadURL$
******************************************************************************/
package li.rajenlab.common.hibernate.type;
import static li.rajenlab.common.lang.StringValuedEnumReflect.getNameFromValue;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Properties;
import li.rajenlab.common.lang.StringValuedEnum;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.usertype.EnhancedUserType;
import org.hibernate.usertype.ParameterizedType;
/**
* @author raph (raph@rajenlab.li)
* @version $Id$
*/
public class StringValuedEnumType <T extends Enum & StringValuedEnum> implements EnhancedUserType,
ParameterizedType {
//-------------------------------------------------------------------------
//PUBLIC CONSTANTS
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//PROTECTED AND PRIVATE VARIABLES AND CONSTANTS
//-------------------------------------------------------------------------
protected static Log log = LogFactory.getLog(StringValuedEnumType.class);
/**
* Enum class for this particular user type.
*/
private Class<T> enumClass_;
/**
* Value to use if null.
*/
private String defaultValue_;
//-------------------------------------------------------------------------
//CONSTRUCTORS
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//PUBLIC METHODS
//-------------------------------------------------------------------------
/** Creates a new instance of StringValuedEnumType */
public StringValuedEnumType() {
}
/**
*
* @see org.hibernate.usertype.ParameterizedType#setParameterValues(java.util.Properties)
*/
@SuppressWarnings("unchecked")
public void setParameterValues(Properties parameters) {
String enumClassName = parameters.getProperty("enumClass");
try {
enumClass_ = (Class<T>) Class.forName(enumClassName).asSubclass(Enum.class).
asSubclass(StringValuedEnum.class); //Validates the class but does not eliminate the cast
} catch (ClassNotFoundException cnfe) {
throw new HibernateException("Enum class not found", cnfe);
}
setDefaultValue(parameters.getProperty("defaultValue"));
}
public String getDefaultValue() {
return defaultValue_;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue_ = defaultValue;
}
/**
* The class returned by <tt>nullSafeGet()</tt>.
* @return Class
*/
public Class returnedClass() {
return enumClass_;
}
/**
*
* @see org.hibernate.usertype.UserType#sqlTypes()
*/
public int[] sqlTypes() {
return new int[] { Types.VARCHAR };
}
/**
*
* @see org.hibernate.usertype.UserType#isMutable()
*/
public boolean isMutable() {
return false;
}
/**
* Retrieve an instance of the mapped class from a JDBC resultset. Implementors
* should handle possibility of null values.
*
* @param rs a JDBC result set
* @param names the column names
* @param owner the containing entity
* @return Object
* @throws HibernateException
* @throws SQLException
*/
@SuppressWarnings("unchecked")
public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
throws HibernateException, SQLException {
String value = rs.getString( names[0] );
if (value==null) {
value = getDefaultValue();
if (value==null){ //no default value
return null;
}
}
String name = getNameFromValue(enumClass_, value);
Object res = name == null ? null : Enum.valueOf(enumClass_, name);
return res;
}
/**
* Write an instance of the mapped class to a prepared statement. Implementors
* should handle possibility of null values. A multi-column type should be written
* to parameters starting from <tt>index</tt>.
*
* @param st a JDBC prepared statement
* @param value the object to write
* @param index statement parameter index
* @throws HibernateException
* @throws SQLException
*/
@SuppressWarnings("unchecked")
public void nullSafeSet(PreparedStatement st, Object value, int index)
throws HibernateException, SQLException {
if (value==null) {
st.setNull(index, Types.VARCHAR);
} else {
st.setString( index, ((T) value).getValue() );
}
}
/**
*
* @see org.hibernate.usertype.UserType#assemble(java.io.Serializable, java.lang.Object)
*/
public Object assemble(Serializable cached, Object owner)
throws HibernateException {
return cached;
}
/**
*
* @see org.hibernate.usertype.UserType#disassemble(java.lang.Object)
*/
public Serializable disassemble(Object value) throws HibernateException {
return (Enum) value;
}
/**
*
* @see org.hibernate.usertype.UserType#deepCopy(java.lang.Object)
*/
public Object deepCopy(Object value) throws HibernateException {
return value;
}
/**
*
* @see org.hibernate.usertype.UserType#equals(java.lang.Object, java.lang.Object)
*/
public boolean equals(Object x, Object y) throws HibernateException {
return x==y;
}
/**
*
* @see org.hibernate.usertype.UserType#hashCode(java.lang.Object)
*/
public int hashCode(Object x) throws HibernateException {
return x.hashCode();
}
/**
*
* @see org.hibernate.usertype.UserType#replace(java.lang.Object, java.lang.Object, java.lang.Object)
*/
public Object replace(Object original, Object target, Object owner)
throws HibernateException {
return original;
}
/**
*
* @see org.hibernate.usertype.EnhancedUserType#objectToSQLString(java.lang.Object)
*/
@SuppressWarnings("unchecked")
public String objectToSQLString(Object value) {
return '\'' + ((T) value).getValue() + '\'';
}
/**
*
* @see org.hibernate.usertype.EnhancedUserType#toXMLString(java.lang.Object)
*/
@SuppressWarnings("unchecked")
public String toXMLString(Object value) {
return ((T) value).getValue();
}
/**
*
* @see org.hibernate.usertype.EnhancedUserType#fromXMLString(java.lang.String)
*/
@SuppressWarnings("unchecked")
public Object fromXMLString(String xmlValue) {
String name = getNameFromValue(enumClass_, xmlValue);
return Enum.valueOf(enumClass_, name);
}
//-------------------------------------------------------------------------
//PROTECTED METHODS
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//PRIVATE METHODS
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//PUBLIC ACCESSORS (GETTERS / SETTERS)
//-------------------------------------------------------------------------
}
| [
"neoraph@be5e2811-002a-0410-8f54-c5534af08d37"
] | neoraph@be5e2811-002a-0410-8f54-c5534af08d37 |
7e7a9bf217e884ae5fa17bc780eae94ec9d920f0 | c59e34ed03b04f56d0092c72957ff4906cb3f146 | /src/com/pay/lianpay/pay/Bean/UserBaseBean.java | ab0709d56f378a97798921fec74d95758a032900 | [] | no_license | myCodeCang/hspay | 3c3bfa18472383966c39c6b8fa27bff1e409f923 | 2206a9c384571100eecb758664ba80eb29b82938 | refs/heads/master | 2020-03-11T01:53:21.613525 | 2018-04-16T08:26:42 | 2018-04-16T08:26:54 | 129,704,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,401 | java | package com.pay.lianpay.pay.Bean;
/**
* 用户基础类
* @author zhuqf
* @date 2016-4-15 14:08:15
* @version 1.0
*
*/
public class UserBaseBean extends BaseLLwalletBean{
private static final long serialVersionUID = -5309299206335853160L;
/** 连连内部用户登录名 */
private String user_login;
/** 连连生成的唯一用户号 */
private String oid_userno;
/** 绑定手机号 */
private String mob_bind;
/** 短信验证码 */
private String verify_code;
/** 姓名 */
private String name_user;
/** 证件类型 */
private String type_idcard;
/** 证件号 */
private String no_idcard;
/** 登录密码 */
private String pwd_login;
/** 支付密码 */
private String pwd_pay;
/** 绑定邮箱 */
private String eml_bind;
/** 联系地址 */
private String addr_conn;
/** 证件有效期 */
private String exp_idcard;
/** 国籍 */
private String nation_user;
/** 邮政编码 */
private String no_postcode;
/** 操作标示 0 开户 1企业开户 2:找回企业支付密码|修改绑定手机号码 3:修改个人用户基本信息*/
private String flag_send;
/** 实名认证 0 调用实名认证, 1 不调用实名认证*/
private String flag_auth;
/**0 女 1 男 */
private String flg_sex;
/** 0 V0未认证 1 V1实名认证 2 V2 实名认证+身份证认证*/
private String stat_user;
/** 经营范围*/
private String busi_user;
/** 省级地址*/
public String addr_pro;
/** 市级地址*/
public String addr_city;
/** 区级地址*/
public String addr_dist;
/** 职业类别*/
private String oid_job;
/** 企业注册类型*/
private String type_register;
/** 营业执照类型*/
private String type_license;
/** 行业类别*/
private String type_industry;
/** 组织机构代码有效期*/
private String exp_orgcode;
/** 开户行所在市编码*/
private String city_code;
/** 开户支行名称*/
private String brabank_name;
/** 银行账号*/
private String card_no;
/** 所属银行编号*/
private String bank_code;
/** 大额行号*/
private String prcptcd;
/** 用户银行账号姓名*/
private String acct_name;
/** 企业地址*/
private String addr_unit;
/** 企业名称*/
private String name_unit;
/** 营业执照号码*/
private String num_license;
/** 营业执照有效期*/
private String exp_license;
/** 组织机构代码*/
private String org_code;
/** 身份证有效期类型*/
private String type_expidcard;
/** 代理人 姓名*/
private String name_agent;
/** 代理人 身份证*/
private String idno_agent;
/** 代理人 有效期*/
private String exp_idcard_agent;
/** 代理人证件有效期类型*/
private String type_agentexpidcard;
/** 营业执照有效期类型*/
private String type_explicense;
/** 用户类型 0 个人用户 1单位用户*/
private String type_user;
public String getUser_login()
{
return user_login;
}
public void setUser_login(String user_login)
{
this.user_login = user_login;
}
public String getOid_userno()
{
return oid_userno;
}
public void setOid_userno(String oid_userno)
{
this.oid_userno = oid_userno;
}
public String getMob_bind()
{
return mob_bind;
}
public void setMob_bind(String mob_bind)
{
this.mob_bind = mob_bind;
}
public String getVerify_code()
{
return verify_code;
}
public void setVerify_code(String verify_code)
{
this.verify_code = verify_code;
}
public String getName_user()
{
return name_user;
}
public void setName_user(String name_user)
{
this.name_user = name_user;
}
public String getType_idcard()
{
return type_idcard;
}
public void setType_idcard(String type_idcard)
{
this.type_idcard = type_idcard;
}
public String getNo_idcard()
{
return no_idcard;
}
public void setNo_idcard(String no_idcard)
{
this.no_idcard = no_idcard;
}
public String getPwd_login()
{
return pwd_login;
}
public void setPwd_login(String pwd_login)
{
this.pwd_login = pwd_login;
}
public String getPwd_pay()
{
return pwd_pay;
}
public void setPwd_pay(String pwd_pay)
{
this.pwd_pay = pwd_pay;
}
public String getEml_bind()
{
return eml_bind;
}
public void setEml_bind(String eml_bind)
{
this.eml_bind = eml_bind;
}
public String getAddr_conn()
{
return addr_conn;
}
public void setAddr_conn(String addr_conn)
{
this.addr_conn = addr_conn;
}
public String getExp_idcard()
{
return exp_idcard;
}
public void setExp_idcard(String exp_idcard)
{
this.exp_idcard = exp_idcard;
}
public String getNation_user()
{
return nation_user;
}
public void setNation_user(String nation_user)
{
this.nation_user = nation_user;
}
public String getNo_postcode()
{
return no_postcode;
}
public void setNo_postcode(String no_postcode)
{
this.no_postcode = no_postcode;
}
public String getFlag_send()
{
return flag_send;
}
public void setFlag_send(String flag_send)
{
this.flag_send = flag_send;
}
public String getFlag_auth()
{
return flag_auth;
}
public void setFlag_auth(String flag_auth)
{
this.flag_auth = flag_auth;
}
public String getFlg_sex()
{
return flg_sex;
}
public void setFlg_sex(String flg_sex)
{
this.flg_sex = flg_sex;
}
public String getStat_user()
{
return stat_user;
}
public void setStat_user(String stat_user)
{
this.stat_user = stat_user;
}
public String getBusi_user()
{
return busi_user;
}
public void setBusi_user(String busi_user)
{
this.busi_user = busi_user;
}
public String getAddr_pro()
{
return addr_pro;
}
public void setAddr_pro(String addr_pro)
{
this.addr_pro = addr_pro;
}
public String getAddr_city()
{
return addr_city;
}
public void setAddr_city(String addr_city)
{
this.addr_city = addr_city;
}
public String getAddr_dist()
{
return addr_dist;
}
public void setAddr_dist(String addr_dist)
{
this.addr_dist = addr_dist;
}
public String getOid_job()
{
return oid_job;
}
public void setOid_job(String oid_job)
{
this.oid_job = oid_job;
}
public String getType_register()
{
return type_register;
}
public void setType_register(String type_register)
{
this.type_register = type_register;
}
public String getType_license()
{
return type_license;
}
public void setType_license(String type_license)
{
this.type_license = type_license;
}
public String getType_industry()
{
return type_industry;
}
public void setType_industry(String type_industry)
{
this.type_industry = type_industry;
}
public String getExp_orgcode()
{
return exp_orgcode;
}
public void setExp_orgcode(String exp_orgcode)
{
this.exp_orgcode = exp_orgcode;
}
public String getCity_code()
{
return city_code;
}
public void setCity_code(String city_code)
{
this.city_code = city_code;
}
public String getBrabank_name()
{
return brabank_name;
}
public void setBrabank_name(String brabank_name)
{
this.brabank_name = brabank_name;
}
public String getCard_no()
{
return card_no;
}
public void setCard_no(String card_no)
{
this.card_no = card_no;
}
public String getBank_code()
{
return bank_code;
}
public void setBank_code(String bank_code)
{
this.bank_code = bank_code;
}
public String getPrcptcd()
{
return prcptcd;
}
public void setPrcptcd(String prcptcd)
{
this.prcptcd = prcptcd;
}
public String getAcct_name()
{
return acct_name;
}
public void setAcct_name(String acct_name)
{
this.acct_name = acct_name;
}
public String getAddr_unit()
{
return addr_unit;
}
public void setAddr_unit(String addr_unit)
{
this.addr_unit = addr_unit;
}
public String getName_unit()
{
return name_unit;
}
public void setName_unit(String name_unit)
{
this.name_unit = name_unit;
}
public String getNum_license()
{
return num_license;
}
public void setNum_license(String num_license)
{
this.num_license = num_license;
}
public String getExp_license()
{
return exp_license;
}
public void setExp_license(String exp_license)
{
this.exp_license = exp_license;
}
public String getOrg_code()
{
return org_code;
}
public void setOrg_code(String org_code)
{
this.org_code = org_code;
}
public String getType_expidcard()
{
return type_expidcard;
}
public void setType_expidcard(String type_expidcard)
{
this.type_expidcard = type_expidcard;
}
public String getName_agent()
{
return name_agent;
}
public void setName_agent(String name_agent)
{
this.name_agent = name_agent;
}
public String getIdno_agent()
{
return idno_agent;
}
public void setIdno_agent(String idno_agent)
{
this.idno_agent = idno_agent;
}
public String getExp_idcard_agent()
{
return exp_idcard_agent;
}
public void setExp_idcard_agent(String exp_idcard_agent)
{
this.exp_idcard_agent = exp_idcard_agent;
}
public String getType_agentexpidcard()
{
return type_agentexpidcard;
}
public void setType_agentexpidcard(String type_agentexpidcard)
{
this.type_agentexpidcard = type_agentexpidcard;
}
public String getType_explicense()
{
return type_explicense;
}
public void setType_explicense(String type_explicense)
{
this.type_explicense = type_explicense;
}
public String getType_user()
{
return type_user;
}
public void setType_user(String type_user)
{
this.type_user = type_user;
}
}
| [
"1193983973@qq.com"
] | 1193983973@qq.com |
f342cf399c1e1e66bd539fd21d5fad5a77279406 | 410029a2cd3a9dcc7856fc65a879e79bb9deba5a | /src/com/contractorsintelligence/cis/ForgotPasswordActivity.java | 71d809928af798371388e8934491ff05caca1ece | [] | no_license | maindeveloper113/ExamPrep | c1d56fcce77c3d177f15a3dd466ca32e8658e883 | 90f3cab9cb9bf0979f6a4e24804e208b256667c0 | refs/heads/master | 2020-05-22T03:50:55.346851 | 2017-03-11T18:08:32 | 2017-03-11T18:08:32 | 84,669,818 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,910 | java | package com.contractorsintelligence.cis;
import android.app.Activity;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.InputStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ForgotPasswordActivity extends Activity implements OnClickListener {
Button btn_submit;
String Response_code;
TextView txt_msg, txt_title;
String forgotpasswprd_result, email;
EditText et_email;
Typeface Set_font;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.forgotpassword);
setContent();
clickeEvent();
}
@Override
public void onBackPressed() {
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
private void clickeEvent() {
// TODO Auto-generated method stub
btn_submit.setOnClickListener(this);
}
private void setContent() {
// TODO Auto-generated method stub
txt_msg = (TextView) findViewById(R.id.txt_msg);
txt_title = (TextView) findViewById(R.id.txt_title);
btn_submit = (Button) findViewById(R.id.btn_submit);
et_email = (EditText) findViewById(R.id.et_email);
Set_font = Typeface.createFromAsset(
getApplicationContext().getAssets(), "fonts/AGENCYR.TTF");
txt_msg.setTypeface(Set_font);
txt_title.setTypeface(Set_font);
btn_submit.setTypeface(Set_font);
et_email.setTypeface(Set_font);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.btn_submit:
try {
email = et_email.getText().toString();
/*if(emailValidator(et_email.getText().toString())){
Toast.makeText(this, "valid email address",
Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(this, "invalid email address",
Toast.LENGTH_SHORT).show();
}
*/
if (email.length() <= 0 || email.equals("")) {
et_email.setError("Invalid Email");
} else {
if (StaticData.isNetworkConnected(getApplicationContext())) {
forgotpassword();
} else {
Toast.makeText(getApplicationContext(),
"Not connected to Internet", Toast.LENGTH_SHORT)
.show();
}
}
// i = new Intent(ForgotPassword_Activity.this,
// ForgotPasswordThankYou_Activity.class);
// i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// startActivity(i);
break;
} catch (Exception e) {
//e.printStackTrace();
}
}
}
private void forgotpassword() {
// TODO Auto-generated method stub
new ForgotpasswordOperation().execute();
}
private class ForgotpasswordOperation extends AsyncTask<String, Void, Void> {
//private ProgressDialog pDialog = new ProgressDialog(
// ForgotPasswordActivity.this);
Dialog pDialog = new Dialog(ForgotPasswordActivity.this);
protected void onPreExecute() {
// Dialog.setMessage("Please Wait...");
// Dialog.getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
//Dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Dialog.setContentView(R.layout.custom_image_dialog);
// Dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
//Dialog.show();
//Dialog.setCancelable(false);
pDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
pDialog.getWindow().setBackgroundDrawable(
new ColorDrawable(Color.TRANSPARENT));
pDialog.setContentView(R.layout.custom_image_dialog);
pDialog.show();
pDialog.setCancelable(false);
}
// Call after onPreExecute method
protected Void doInBackground(String... urls) {
postData();
Log.w("....", "...." + Response_code);
try {
JSONObject jobj = new JSONObject(Response_code);
forgotpasswprd_result = jobj.getString("ResponseCode");
Log.e("Forgotpasswprd Result", "...." + forgotpasswprd_result);
} catch (JSONException e) {
//e.printStackTrace();
} catch (NullPointerException n) {
//n.printStackTrace();
}
return null;
}
private void postData() {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
email = et_email.getText().toString().toLowerCase();
String result = "";
try {
JSONObject json = new JSONObject();
json.put("email", email);
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, 10000);
HttpConnectionParams.setSoTimeout(httpParams, 10000);
HttpClient client = new DefaultHttpClient(httpParams);
String url = StaticData.link + "forgot_password.php";
HttpPost request = new HttpPost(url);
request.setEntity(new ByteArrayEntity(json.toString().getBytes(
"UTF8")));
request.setHeader("json", json.toString());
HttpResponse response = client.execute(request);
HttpEntity entity = response.getEntity();
// If the response does not enclose an entity, there is no need
if (entity != null) {
InputStream instream = entity.getContent();
result = MainActivity.RestClient.convertStreamToString(instream);
Log.i("Read from server", result);
// Toast.makeText(this, result, Toast.LENGTH_LONG).show();
}
} catch (Throwable t) {
// Toast.makeText(this, "Request failed: " + t.toString(),
// Toast.LENGTH_LONG).show();
}
Response_code = result;
}
protected void onPostExecute(Void unused) {
pDialog.dismiss();
Forgotpassword_result();
}
private void Forgotpassword_result() {
// TODO Auto-generated method stub
Log.w("Login Result..", "l" + forgotpasswprd_result);
if (forgotpasswprd_result.equals("1")) {
Toast.makeText(getApplicationContext(),
"Your Password Email Address Send Successfully...",
Toast.LENGTH_SHORT).show();
txt_msg.setText("Your password has been sent to the email address that you entered in the form.");
txt_msg.setTextColor(Color.parseColor("#008017"));
txt_msg.setTextSize(15);
// String android_id = Secure.getString(getApplicationContext()
// .getContentResolver(), Secure.ANDROID_ID);
//
// Log.w("Device ID:-", ".." + android_id);
} else {
Toast.makeText(getApplicationContext(),
"Email does Not exists.... . ", Toast.LENGTH_SHORT)
.show();
txt_msg.setText("Email Does Not exists Currect Your Email.");
txt_msg.setTextColor(Color.parseColor("#cc3333"));
txt_msg.setTextSize(15);
}
}
}
public static boolean emailValidator(final String mailAddress) {
Pattern pattern;
Matcher matcher;
final String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@" + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
pattern = Pattern.compile(EMAIL_PATTERN);
matcher = pattern.matcher(mailAddress);
return matcher.matches();
}
}
| [
"maindeveloper113@hotmail.com"
] | maindeveloper113@hotmail.com |
83ef13810934851949187372414d10c25216933d | 3bc271314b8e7479c804da7073b539d247600428 | /src/main/java/bnfc/abs/Absyn/NormalFunBody.java | 5e8a89bda1e5444e035d4edc69be1ce205a8f3ad | [
"Apache-2.0"
] | permissive | peteryhwong/jabsc | 2c099d8260afde3a40979a9b912c4e324bae857b | e01e86cdefaebd4337332b157374fced8b537e00 | refs/heads/master | 2020-04-07T23:46:42.357421 | 2016-04-10T21:30:30 | 2016-04-10T21:30:30 | 40,371,728 | 0 | 0 | null | 2015-08-07T17:10:47 | 2015-08-07T17:10:47 | null | UTF-8 | Java | false | false | 671 | java | package bnfc.abs.Absyn; // Java Package generated by the BNF Converter.
public class NormalFunBody extends FunBody {
public final PureExp pureexp_;
public NormalFunBody(PureExp p1) { pureexp_ = p1; }
public <R,A> R accept(bnfc.abs.Absyn.FunBody.Visitor<R,A> v, A arg) { return v.visit(this, arg); }
public boolean equals(Object o) {
if (this == o) return true;
if (o instanceof bnfc.abs.Absyn.NormalFunBody) {
bnfc.abs.Absyn.NormalFunBody x = (bnfc.abs.Absyn.NormalFunBody)o;
return this.pureexp_.equals(x.pureexp_);
}
return false;
}
public int hashCode() {
return this.pureexp_.hashCode();
}
}
| [
"serbanescu.vlad.nicolae@gmail.com"
] | serbanescu.vlad.nicolae@gmail.com |
99bd252afe5650445950ff1a399e2d6f88e717dc | 183e4126b2fdb9c4276a504ff3ace42f4fbcdb16 | /II семестр/Об'єктно орієнтоване програмування/Мазан/Лабораторна №5/src/Vegetable.java | 2d14c68d2fd9c045fd3147cf75eea800a3c07301 | [] | no_license | Computer-engineering-FICT/Computer-engineering-FICT | ab625e2ca421af8bcaff74f0d37ac1f7d363f203 | 80b64b43d2254e15338060aa4a6d946e8bd43424 | refs/heads/master | 2023-08-10T08:02:34.873229 | 2019-06-22T22:06:19 | 2019-06-22T22:06:19 | 193,206,403 | 3 | 0 | null | 2023-07-22T09:01:05 | 2019-06-22T07:41:22 | HTML | UTF-8 | Java | false | false | 585 | java | public class Vegetable extends Salad {
public String name = "";
public int nutrition = 0;
public Vegetable(String name, int calories_value) {
try {
this.name = name;
this.nutrition = calories_value;
}
catch (Exception exc) {
System.out.println("Ви ввели неправильні дані для описання овоча");
}
}
@Override
public void print() {
System.out.printf("%10s; %20d кал\n", name, nutrition);
}
public void find_by_nutrition() {
}
}
| [
"mazanyan027@gmail.com"
] | mazanyan027@gmail.com |
6b40eb7286883d8d196038938579e281aada6094 | aadd84f77e5952b31afa321fe12d15cfb72382c1 | /src/main/java/com/example/demo/entity/HL7004.java | b5c40b61299a7e25a6662aa5f5d731cda042429c | [] | no_license | bsagortest/hl7demo | b4b0f7f0aacc57d0256b155de667d298e31f16e0 | 8275b6bd63f4203d8af011454680bc8cfde51330 | refs/heads/master | 2021-01-19T17:05:31.245724 | 2017-08-22T11:20:49 | 2017-08-22T11:20:49 | 101,037,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,852 | java | package com.example.demo.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class HL7004 {
@Column(name = "T_RECEIVED_DATE")
private String receivedDate;
@Column(name = "T_RECEIVED_TIME")
private String receivedTime;
@Id
@Column(name = "T_HL7_MSG_NO")
private String messageNo;
@Column(name = "T_MSG_DATA")
private String messageData;
@Column(name = "T_MSG_DATA1")
private String messageDataMore;
@Column(name = "T_MSG_TYPE")
private String messageType;
public String getMessageType() {
return messageType;
}
public void setMessageType(String messageType) {
this.messageType = messageType;
}
public String getReceivedDate() {
return receivedDate;
}
public void setReceivedDate(String receivedDate) {
this.receivedDate = receivedDate;
}
public String getReceivedTime() {
return receivedTime;
}
public void setReceivedTime(String receivedTime) {
this.receivedTime = receivedTime;
}
public String getMessageNo() {
return messageNo;
}
public void setMessageNo(String messageNo) {
this.messageNo = messageNo;
}
public String getMessageData() {
return messageData;
}
public void setMessageData(String messageData) {
this.messageData = messageData;
}
public String getMessageDataMore() {
return messageDataMore;
}
public void setMessageDataMore(String messageDataMore) {
this.messageDataMore = messageDataMore;
}
public HL7004(String receivedDate, String receivedTime, String messageNo, String messageData,
String messageDataMore, String messageType) {
super();
this.receivedDate = receivedDate;
this.receivedTime = receivedTime;
this.messageNo = messageNo;
this.messageData = messageData;
this.messageDataMore = messageDataMore;
this.messageType = messageType;
}
public HL7004() {
}
}
| [
"bsagor@gmail.com"
] | bsagor@gmail.com |
429a4b41498fb3b9f5716a9c1df4cca33d279d61 | 4affd6a01977eb58def66da1418be274e50caef3 | /MicroControladorEscolarSOLID/src/Utilidades/GeneradorPDF.java | 3c8c2d00e3be9166a42e7f71e36d36ee8b326c68 | [] | no_license | SonBear/Dise-o-Software | 1d5f21e64cd8692ba892f1a3778307c938591935 | c871d5fbe49a265a41733673c23a9c54c1d26355 | refs/heads/master | 2020-12-13T06:13:35.865344 | 2020-06-02T22:29:02 | 2020-06-02T22:29:02 | 234,331,633 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 355 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Utilidades;
import Objetos.Imprimible;
/**
*
* @author emman
*/
public class GeneradorPDF {
public static void generarPDF(Imprimible objeto) {
}
}
| [
"emmanuelisai_28@hotmail.com"
] | emmanuelisai_28@hotmail.com |
bc9590eacfb491d6120a09d06856502978366fa6 | 1532ad87139de8d2856cae4addde264f8a48cb1e | /language/src/main/java/edu/uci/ics/perpetual/statement/select/Top.java | 782a5f8c29217ebef06a6e1c7d172b0c6ead208d | [] | no_license | nl0012/perpetual-db | f43d8c87ebc8f0487ade29e4d71dac704cd70907 | acf80dec0f163cb19c66d319d11481a91dfb5596 | refs/heads/master | 2023-07-10T23:56:24.825971 | 2021-05-06T18:14:23 | 2021-05-06T18:14:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,208 | java |
package edu.uci.ics.perpetual.statement.select;
import edu.uci.ics.perpetual.expressions.Expression;
/**
* A top clause in the form [TOP (row_count) or TOP row_count]
*/
public class Top {
private boolean hasParenthesis = false;
private boolean isPercentage = false;
private Expression expression;
public Expression getExpression() {
return expression;
}
public void setExpression(Expression expression) {
this.expression = expression;
}
public boolean hasParenthesis() {
return hasParenthesis;
}
public void setParenthesis(boolean hasParenthesis) {
this.hasParenthesis = hasParenthesis;
}
public boolean isPercentage() {
return isPercentage;
}
public void setPercentage(boolean percentage) {
this.isPercentage = percentage;
}
@Override
public String toString() {
String result = "TOP ";
if (hasParenthesis) {
result += "(";
}
result += expression.toString();
if (hasParenthesis) {
result += ")";
}
if (isPercentage) {
result += " PERCENT";
}
return result;
}
}
| [
"peeyush.lnmit@gmail.com"
] | peeyush.lnmit@gmail.com |
4f643d6bba101987fc4fcc3d546d00c0c693ce3c | 7c029d05ebd8f4491a42b2f4e9cd0c6619b30d5d | /drools-service/src/main/java/com/slk/drools/db/repository/model/DBSceneInfo.java | 13b886d2659806746cb92ff5b4c81450a21f978f | [] | no_license | systemsarchitecture/pioneer | bb6c08d81994940c59c95653fde6b5f4baf719f5 | 82da20680976e39231f9d54f3c437bb127111942 | refs/heads/master | 2022-12-04T21:57:54.420139 | 2020-08-17T12:16:57 | 2020-08-17T12:16:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 928 | java | package com.slk.drools.db.repository.model;
import com.slk.tester.jpa.model.BasePo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.persistence.*;
import java.util.List;
/**
* 场景信息
* <br/>08/01/2020 14:04
*
* @author lshao
*/
@Data
@Entity
@Table(name = "scene_info")
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DBSceneInfo extends BasePo {
/**
* 场景code唯一,一个场景对应多个drl定义
*/
@Column(name = "scene_code", length = 50)
private String sceneCode;
@Column(name = "scene_desc", length = 50)
private String desc;
//拥有mappedBy注解的实体类为关系被维护端
@OneToMany(mappedBy = "sceneInfo",cascade= {CascadeType.ALL},fetch=FetchType.EAGER)
@org.hibernate.annotations.ForeignKey(name = "none")
private List<DBRuleInfo> ruleInfoList;//drl规则列表
}
| [
"604331309@qq.com"
] | 604331309@qq.com |
7183bfacd0125c854257e64c956c47a369b80fc2 | 028cbe18b4e5c347f664c592cbc7f56729b74060 | /external/modules/msv/tahiti/src/com/sun/tahiti/grammar/InterfaceItem.java | 657ec31a37d52b3e0e5f765a57e1861a657ff7f7 | [] | no_license | dmatej/Glassfish-SVN-Patched | 8d355ff753b23a9a1bd9d7475fa4b2cfd3b40f9e | 269e29ba90db6d9c38271f7acd2affcacf2416f1 | refs/heads/master | 2021-05-28T12:55:06.267463 | 2014-11-11T04:21:44 | 2014-11-11T04:21:44 | 23,610,469 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 782 | java | /*
* @(#)$Id: InterfaceItem.java 923 2001-07-20 20:45:03Z Bear $
*
* Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
*
* This software is the proprietary information of Sun Microsystems, Inc.
* Use is subject to license terms.
*
*/
package com.sun.tahiti.grammar;
import com.sun.msv.grammar.Expression;
/**
* represents a generated interface.
*
* @author
* <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
*/
public class InterfaceItem extends TypeItem {
protected InterfaceItem( String name, Expression body ) {
super(name);
this.exp = body;
}
public Type getSuperType() { return null; } // interfaces do not have the super type.
public Object visitJI( JavaItemVisitor visitor ) {
return visitor.onInterface(this);
}
}
| [
"janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5"
] | janey@6f3ba3e3-413c-0410-a8aa-90bee3ab43b5 |
f2e2571862dc34e07c1d98ecc74ef8a87b0dfa64 | e20651d683cd657a7dd07795dd284c3138b75986 | /src/main/java/com/yuer/dbutils/utils/XMLUtils.java | 06a7eb7d4a1c807c21bf6a0784dd4a29700dd8dd | [] | no_license | yuercl/MyUtils | ad60d9fe20ec3351910fdcc722f91bd0e41f8e60 | 103209e1fc77cbbb0bb5425c67bae3a7fc242912 | refs/heads/master | 2020-05-07T11:11:55.964063 | 2015-01-14T03:01:08 | 2015-01-14T03:01:08 | 17,966,931 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,973 | java | package com.yuer.dbutils.utils;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URL;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
/**
* XML工具类,调用Dom4j的方法解析xml<br>
* 用法:
* <pre>
* Document document = XMLUtil.parse( this.getClass().getResource( "src.xml" ) );
* File f = new File( "output.xml" );
* OutputStream out = new FileOutputStream( f );
* XMLUtil.write( document, out, OutputFormat.createPrettyPrint() );
* XMLUtil.write( document, out, OutputFormat.createCompactFormat() );
* </pre>
* @author <a href="mailto:joe.dengtao@gmail.com">DengTao</a>
* @version 1.0
* @since 1.0
*/
public class XMLUtils {
/**
* 将输入的xml字符串转换成XML Document对象
*
* @since 1.0
* @param xmlString
* @return 返回转换成功的Document对象
* @throws DocumentException
*/
public static Document parse(String xmlString) throws DocumentException {
Document doc = DocumentHelper.parseText(xmlString);
return doc;
}
/**
* 将输入的URL的文件内容转换成XML Document对象
*
* @since 1.0
* @param url
* @return 返回转换成功的Document对象
* @throws DocumentException
*/
public static Document parse(URL url) throws DocumentException {
SAXReader reader = new SAXReader();
Document doc = reader.read(url);
return doc;
}
/**
* 将 Document 对象写入到输出流
* @param document
* @param out
* @param format OutputFormat.createPrettyPrint()/OutputFormat.createCompactFormat()
* @throws IOException
* @since 1.0
*/
public static void write(Document document, OutputStream out,
OutputFormat format) throws IOException {
XMLWriter writer = new XMLWriter(out, format);
writer.write(document);
}
}
| [
"yuerguang.cl@gmail.com"
] | yuerguang.cl@gmail.com |
57815f7ab8a2f3a5e4b603559ee51fb3f4348c81 | ddc40d0d543c53333302cd8a12722ec381cc2096 | /week11/EspressoList/src/Espresso/Epic/TrieNode.java | e321dc64471180a3047b16d558611bd77df97a34 | [] | no_license | SaudiWebDev2020/wgoode3 | 12b973cf5d99717d090507112aa631d352bda662 | 390877b166344da061d857be7bf82c6ecf4885b1 | refs/heads/main | 2023-04-11T13:03:22.342532 | 2021-04-09T22:12:30 | 2021-04-09T22:12:30 | 314,376,152 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 295 | java | package Espresso.Epic;
import java.util.HashMap;
public class TrieNode {
public String value;
public HashMap<Character, TrieNode> children;
public Integer count;
public TrieNode(String value) {
this.value = value;
children = new HashMap<Character, TrieNode> ();
count = 0;
}
}
| [
"wgoode3@gmail.com"
] | wgoode3@gmail.com |
b0cce1dad693cba8f25cae80bdda4d7467f28b3a | e4088d9fa5611c4111699bf483b6b87ae2395745 | /tnblibrary/src/main/java/com/example/sifiso/tnblibrary/MainActivity.java | 110c786e1458fa8d9408589f1856a39514b21b1d | [] | no_license | manqoba1/TNBAppSuites | 4060900d32cbd62e34b05f4cd55a2c80a25c51d0 | 2b36dab0501a7552c1c7f791adf431a6fcaf6492 | refs/heads/master | 2016-09-06T06:39:24.865120 | 2015-08-24T17:31:23 | 2015-08-24T17:31:23 | 37,603,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,134 | java | package com.example.sifiso.tnblibrary;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_pager);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"snpeace.sifiso@gmail.com"
] | snpeace.sifiso@gmail.com |
d01583c322ea6253cff00e55114ccb8c6135b00f | bcdb2144172f0b5a842523ee3a1ca47d9ab96bb7 | /app/src/main/java/fh/ooe/mcm/inactivitytracker/utils/DatabaseHandler.java | 8e3765cf6ef8a3ec33204b468065cdd2072e7a5d | [] | no_license | headzik/inactivity-tracking-app | 125516428d22bd39d39e277316d5e4d662df53d8 | 50daa7953eea3a903dc52fa8800d6970be561c22 | refs/heads/master | 2022-02-24T05:42:20.796365 | 2019-10-29T14:35:43 | 2019-10-29T14:35:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,241 | java | package fh.ooe.mcm.inactivitytracker.utils;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import fh.ooe.mcm.inactivitytracker.interfaces.Observable;
import fh.ooe.mcm.inactivitytracker.interfaces.Observer;
public class DatabaseHandler extends SQLiteOpenHelper implements Observer, Observable {
private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "database";
private static final String TABLE_ACTIVITIES = "activities";
//private static final String KEY_ID = "id"; ??
private static final String KEY_TIMESTAMP = "timestamp";
private static final String KEY_ACTIVITY = "activity";
ArrayList<Observer> observers;
public DatabaseHandler(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
observers = new ArrayList<>();
}
@Override
public void onCreate(SQLiteDatabase db) {
try {
String CREATE_ACTIVITIES_TABLE = "CREATE TABLE IF NOT EXISTS " + TABLE_ACTIVITIES + "("
//+ KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_TIMESTAMP + " INTEGER,"
+ KEY_ACTIVITY + " TEXT" + ")";
db.execSQL(CREATE_ACTIVITIES_TABLE);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_ACTIVITIES);
onCreate(db);
}
public void addActivity(Long timestamp, String activity) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_TIMESTAMP, timestamp);
values.put(KEY_ACTIVITY, activity);
db.insert(TABLE_ACTIVITIES, null, values);
db.close();
}
public Map<Long, String> getAllPhysicalActivitiesForDays(long timestampFrom, long timestampTo) {
if(timestampTo == 0) {
timestampTo = System.currentTimeMillis();
}
Map<Long, String> activities = new LinkedHashMap<>();
String selectQuery = "SELECT * FROM " + TABLE_ACTIVITIES +
" WHERE " + KEY_TIMESTAMP + " BETWEEN " + timestampFrom +
" AND " + timestampTo + " ORDER BY " + KEY_TIMESTAMP + " ASC ";
SQLiteDatabase db = this.getReadableDatabase();
try {
Cursor cursor = db.rawQuery(selectQuery, null);
if (cursor.moveToFirst()) {
do {
activities.put(cursor.getLong(0), cursor.getString(1));
} while (cursor.moveToNext());
}
} catch(Exception e) {
e.printStackTrace();
}
return activities;
}
public void deletePhysicalActivities(long timestampFrom, long timestampTo) {
SQLiteDatabase db = this.getWritableDatabase();
db.delete(TABLE_ACTIVITIES, KEY_TIMESTAMP + " >= ? AND" + KEY_TIMESTAMP + "<= ?",
new String[]{String.valueOf(timestampFrom), String.valueOf(timestampTo)});
db.close();
}
public void dropTable() {
this.getWritableDatabase().execSQL("DROP TABLE IF EXISTS " + TABLE_ACTIVITIES);
}
@Override
public void update(Observable observable, Object object) {
if(observable instanceof Recognizer) {
if(object instanceof Map) {
Map<Long, String> activities = (ConcurrentHashMap) object;
for(Map.Entry<Long, String> activity: activities.entrySet()) {
addActivity(activity.getKey(), activity.getValue());
}
}
}
}
@Override
public void notifyAll(Object object) {
for (Observer observer: observers) {
observer.update(this, object);
}
}
@Override
public void addObserver(Observer observer) {
observers.add(observer);
}
} | [
"lukaszstrzelecki9@gmail.com"
] | lukaszstrzelecki9@gmail.com |
e31f1e891484581a55dae180c85285581202e281 | dc341d32e5c1b9750c22abebc5c8e872b68a280d | /src/com/throne/emm/net/result/CheckVersionResult.java | 72616591ae2c469d7016b8a106917992ef0230d2 | [] | no_license | throne10/project | 7f22ca8aaddb8104e46b40f2bad712657512c86c | e43605bd81969192d77164948de4eab25cb0772e | refs/heads/master | 2021-01-10T02:35:16.672292 | 2015-10-14T16:18:53 | 2015-10-14T16:18:53 | 44,227,399 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,611 | java | package com.throne.emm.net.result;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.throne.emm.eventbus.event.AppGetEvent;
import com.throne.emm.eventbus.event.BaseEvent;
import com.throne.emm.eventbus.event.CheckDeviceEvent;
import com.throne.emm.eventbus.event.CheckVersionEvent;
import com.throne.emm.model.AppInfo;
import de.greenrobot.event.EventBus;
import android.os.Handler;
import android.os.Message;
public class CheckVersionResult extends BaseResult {
private CheckVersionEvent mCheckVersionEvent= new CheckVersionEvent();
private boolean success;
@Override
public void dataAnalysis(String content) {
try {
JSONObject mJSONObject = new JSONObject(content);
if(mJSONObject.has("success"))
{
success = mJSONObject.getBoolean("success");
}
if(success)
{
int mint=mJSONObject.getInt("message");
if(mint==1)
{
mCheckVersionEvent.setResult(CheckVersionEvent.UPDATE);
}
else
{
mCheckVersionEvent.setResult(CheckVersionEvent.NO_UPDATE);
}
}
else
{
mCheckVersionEvent.setResult(CheckVersionEvent.Fail);
}
EventBus.getDefault().post(mCheckVersionEvent);
} catch (Exception e) {
mCheckVersionEvent.setResult(BaseEvent.Fail);
EventBus.getDefault().post(mCheckVersionEvent);
e.printStackTrace();
}
}
@Override
public void postFailure() {
mCheckVersionEvent.setResult(BaseEvent.Fail);
EventBus.getDefault().post(mCheckVersionEvent);
}
}
| [
"349434222@qq.com"
] | 349434222@qq.com |
d62910d3cdffddd0a2d2fb926e718c26d21ecd29 | 65e338e4cc68a0228d8d17b12e4d8550183d896c | /LucaSteam/src/data/DatosJuegos.java | c166a029eeaac615b8590e907bad6a040108938a | [] | no_license | Mimiloon/LucaSteam | 01c89f96934a10cceb43833825aa72ced07f1de7 | facd38640dcb0beb6bc17f52c8b9382655a625c1 | refs/heads/master | 2023-05-22T08:55:45.377603 | 2021-06-15T11:29:32 | 2021-06-15T11:29:32 | 377,105,381 | 0 | 0 | null | 2021-06-15T09:20:09 | 2021-06-15T09:20:08 | null | UTF-8 | Java | false | false | 45 | java | package data;
public class DatosJuegos {
}
| [
"rocio.jimenezmoreno8@gmail.com"
] | rocio.jimenezmoreno8@gmail.com |
27c9d8dcd6d8bef39da6b6a12622275121a7b091 | e178a63a9fcdaf47d4c322cde0dc365b7c66646e | /src/java/Resources/SelectorBacker.java | bbcf7514f49da8209685ee5c79a1adc6ca8b8950 | [] | no_license | bhtrost124/RandomSelector2 | 92756061ff32bce7fcdf49271925661525496e68 | f6ad214b1c4511147161a493134442e95dbb74d2 | refs/heads/master | 2016-09-05T14:34:59.135615 | 2015-05-05T03:38:15 | 2015-05-05T03:38:15 | 35,075,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,745 | java | /*
* Attention: The following code is part of a project that is not "Complete,"
* meaning that updates and other assorted changes have yet to take shape. Also
* note that this was originally written with the intention of nobody but myself
* seeing or using it.Tthere are some aspects of this code that would not
* be present in a true enterprise application, most notably of which would be
* attempts to make the usage more "safe," or to prevent the user from making
* changes they did not mean to make.
*/
package Resources;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
/**
*
* @author Bryce
*
* This Application was designed for a user to keep track of shows that they are
* watching, how far behind in that show they are, and in the event of not being
* able to decide what to watch randomly selects one for them.
*
* This backing bean is application scoped for the reason that I was the only
* intended user, thus the series list can be considered as always being present
* for the application. It was originally developed as request scoped, and it
* worked just fine like that, but I wanted to eliminate the constant database
* queries as well as test out other scopes.
*/
@Named
@ApplicationScoped
public class SelectorBacker {
@Inject
private SeriesBean seriesBean;
private List<Series> serList;
private final Random random;
private String randSeries;
private String seriesToAdd;
private String dateToAdd;
private Series currSeries;
private String listType;
public String getListType() {
if (!(listType.equals("Video") || listType.equals("Book") || listType.equals("Audio"))) {
listType = "Video"; //default to video
}
return listType;
}
public void setListType(String listType) {
this.listType = listType;
}
public Series getCurrSeries() {
return currSeries;
}
public String getDateToAdd() {
return dateToAdd;
}
public void setDateToAdd(String dateToAdd) {
this.dateToAdd = dateToAdd;
}
/**
* Creates a new instance of SelectorBacker
*/
public SelectorBacker() {
this.random = new Random();
this.seriesToAdd = "";
this.randSeries = "";
this.listType = "";
}
public boolean isRandSet() {
return !this.randSeries.equals("");
}
@PostConstruct
public void init() {
try {
this.serList = this.seriesBean.getAllSeries();
} catch (Exception ex) {
this.serList = new ArrayList<>();
}
}
/*
Performs the logic to select a random series from the series list. Series that
are caught up on are not included in the selection.
*/
public void selectRandomSeries() {
List<Series> randList = new ArrayList<>();
for (Series s : this.serList) {
if (s.getEps() != 0) {
randList.add(s);
}
}
this.randSeries = randList.get(this.random.nextInt(randList.size())).getName();
}
public String getRandSeries() {
return this.randSeries;
}
public String addSeries() {
Series added = new Series(this.seriesToAdd, this.dateToAdd);
this.seriesBean.createSeries(added);
this.serList = this.seriesBean.getAllSeries();
this.seriesToAdd = "";
this.randSeries = "";
return "index.xhtml";
}
public String removeSeries(Series series) {
this.seriesBean.removeSeries(series);
this.serList.remove(series);
this.randSeries = "";
return "index.xhtml";
}
public String addEpsBehind(Series series) {
this.seriesBean.incSeries(series);
this.serList = this.seriesBean.getAllSeries();
this.randSeries = "";
return "index.xhtml";
}
public String decEpsBehind(Series series) {
if (series.getEps() != 0) {
this.seriesBean.decSeries(series);
this.serList = this.seriesBean.getAllSeries();
this.randSeries = "";
}
return "index.xhtml";
}
public List<Series> getSeriesList() {
return this.serList;
}
public String getSeriesToAdd() {
return this.seriesToAdd;
}
public void setSeriesToAdd(String s) {
this.seriesToAdd = s;
}
}
| [
"Bryce@Bryce-PC"
] | Bryce@Bryce-PC |
e350753e96cb78af873992a55f2430ca7c1d901e | 7aa34c35886a12486dd392d360b0de0cdf2fe6d5 | /src/za/ac/tut/extradatainterface/ExtraDataInterface.java | 5228d2d7ff4b146a9770ff43fc36c47775afecb9 | [] | no_license | TresorKL/PizzaApp | 5171f03d2b486eca10e60aa4391f92e2900384e9 | 4abc243ac3adb99aca8cd0bdc1d739f520171c85 | refs/heads/master | 2023-08-31T17:27:44.407537 | 2021-10-13T11:33:53 | 2021-10-13T11:33:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 451 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package za.ac.tut.extradatainterface;
/**
*
* @author tresorkl
*/
public interface ExtraDataInterface {
int COCA_PRICE = 10;
int FANTA_PRICE = 11;
int SALADE_PRICE = 19;
int PASTA_PRICE = 22;
}
| [
"trezmathieu@gmail.com"
] | trezmathieu@gmail.com |
215f6a5206dd59d336ca559330148a79d1f05777 | 46e4dd86de80a27dae0bbdb91f2a24cecc0bd48f | /java/expression/Log.java | f906b73e08ef501188a88d3adf96cf240b49f657 | [] | no_license | FonGadke/expression | 7ff885468fca3250d6a5f313a32ef5f3cd534757 | 028aa8022038716ffa8a3ff89f59e95d2c9631be | refs/heads/master | 2020-04-03T10:54:32.290689 | 2018-10-29T12:37:23 | 2018-10-29T12:37:23 | 155,205,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 887 | java | package expression;
import expression.exceptions.ArithmeticError;
import expression.exceptions.IllegalArgumentException;
public class Log extends BinaryOperation {
public Log(CommonExpression first, CommonExpression second) {
super(first, second);
}
@Override
protected double calculation(double first, double second) {
throw new ArithmeticError("We can't do that yet");
}
@Override
protected int calculation(int first, int second) {
if (first <= 0) {
throw new IllegalArgumentException("logarithm of non-positive number");
}
if (second <= 1) {
throw new IllegalArgumentException("logarithm base is non-positive number or one");
}
int result = 0;
while (first >= second) {
first /= second;
result++;
}
return result;
}
}
| [
"k146.chulkov@yandex.ru"
] | k146.chulkov@yandex.ru |
73ae09c270991cef5210b5f4a34d085d15af63c8 | 86e0a17392172dc506deb4da743d711a0b38c6e4 | /src/com/company/ReverseTrainAdventure.java | 474320b742470483432dd5ddf2d2be71f10a0540 | [] | no_license | Yuqizhoujoe/ReverseTrainAdventure | 275b46f809fd92d375090d32e4ad487b74389ca2 | 3def61fc233380d8795915747fb1a36aec41d835 | refs/heads/master | 2021-01-02T01:01:28.217058 | 2020-02-10T04:00:23 | 2020-02-10T04:00:23 | 239,423,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,179 | java | package com.company;
import java.io.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
public class ReverseTrainAdventure {
public static void main(String args[]) {
ReverseTrainAdventure.train();
}
public static int[] readFile(){
BufferedReader in = null;
int[] station = new int[0];
try {
File file = new File("File/index.txt");
in = new BufferedReader(new FileReader(file));
String str = in.readLine();
String[] strArray = str.split(" ");
station = new int[strArray.length];
for (int i = 0; i < strArray.length; i++) {
station[i] = Integer.parseInt(strArray[i]);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return station;
}
public static void train(){
int[] station = ReverseTrainAdventure.readFile();
LinkedHashSet<Set<Integer>> journey = new LinkedHashSet<>();
int next;
int count = 0;
for (int i = 1; i < station.length; i++) {
LinkedHashSet<Integer> possible = new LinkedHashSet<>();
// store the first station number
possible.add(i);
// if the first station is odd, count++
if (i % 2 != 0) {
count += 1;
}
// set the value to next variable as second station
next = station[i];
// store the second station number
possible.add(next);
// if the second station is odd, count++
if (next % 2 != 0) {
count += 1;
}
// the in the first 2 station only one station is odd, then we can go to next station
if (count <= 1) {
// while next station is not 0 which is start station, then we can keep going to next
// if the next station is 0, which means this path is already finished
while(next != 0) {
// create a array list which can contain repeated station numbers
ArrayList<Integer> repeated = new ArrayList<>(possible);
// go to next station
next = station[next];
// if the possible set does not have 2 odd numbers or duplicate numbers
// the possible set will end up with 0
possible.add(next);
repeated.add(next);
// if there is a odd station
if (next % 2 != 0){
// count++
count++;
// check if count > 1
if (count > 1) {
// because we did not contain the beginning station at the beginning
// we need to add 0 at the end of the set
possible.add(0);
// if count > 1, then break the loop, which means this path is already finished
break;
}
}
// if the repeated array list's length is longer than possible set, then break the the loop
if (repeated.size() > possible.size()) {
// because we did not contain the beginning station at the beginning
// we need to add 0 at the end of the set
possible.add(0);
break;
}
}
}
// Set journey collect the paths
journey.add(possible);
// reset the count for the next path
count = 0;
}
// to get the max length of paths
int max = 0;
for (Set<Integer> set : journey) {
if (set.size() > max) {
max = set.size();
}
System.out.println(set + " : " + set.size());
}
System.out.println(max);
}
}
| [
"kevinyuqi123@gmail.com"
] | kevinyuqi123@gmail.com |
b8f0b9d3352a00c42ba2347b19ba847a1a28addf | fec418944c12c49d793aaf8cefb7d64ac876f283 | /src/Account.java | 16b547dac57e0b3f3d1e8ccd0efd47acb05cdc24 | [] | no_license | permadiekapermana/oopjava-class-no1 | aee962fcbe01ee83c14733ce7ef15e9b54941d3d | c0a62739f1d09972ff07ea819eb66b49b33fa08e | refs/heads/main | 2023-02-21T21:33:19.079178 | 2021-01-22T06:48:35 | 2021-01-22T06:48:35 | 331,861,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,193 | java | public class Account{
protected double balance;
protected String name;
protected double amount;
protected double withdrawFail = 0.0;
// Constructor to initialize balance
public Account( String name, double amount ){
balance = amount;
this.name = name;
}
// Overloaded constructor for empty balance
public Account(String name){
balance = 0.0;
this.name = name;
}
public void deposit( double amount ){
balance = balance + amount;
this.amount = amount;
}
public double withdraw( double amount ){
// See if amount can be withdrawn
if (balance >= amount){
balance -= amount;
return amount;
}
else{
// Withdrawal not allowed
return withdrawFail;
}
}
public double getbalance(){
return balance;
}
public static void main(String[] args) {
// account dengan saldo kosong
Account account1 = new Account("Permadi");
System.out.println("Detail Account --");
System.out.println("Nama Akun\t: "+account1.name);
System.out.println("Saldo Akun\t: Rp. "+account1.getbalance());
// deposit 500.000
System.out.println("\nDeposit --");
account1.deposit(500000);
System.out.println("Deposit Saldo\t: Rp. "+account1.amount);
System.out.println("Saldo Akun\t: Rp. "+account1.getbalance());
// withdraw 50.000
System.out.println("\nWithdraw --");
System.out.println("Saldo Akun\t: Rp. "+account1.getbalance());
account1.withdraw(50000);
System.out.println("Withdraw Saldo\t: Rp. "+account1.amount);
System.out.println("Saldo Akhir\t: Rp. "+account1.getbalance());
// withdraw 500.000
System.out.println("\nWithdraw ke-2 --");
System.out.println("Saldo Akun\t: Rp. "+account1.getbalance());
account1.withdraw(500000);
System.out.println("Withdraw Saldo\t: Rp. "+account1.amount);
System.out.println("Withdraw Berhasil\t: Rp. "+account1.withdrawFail + " Gagal Withdraw!");
System.out.println("Saldo Akhir\t: Rp. "+account1.getbalance());
}
} | [
"permadiekapermana@gmail.com"
] | permadiekapermana@gmail.com |
37f6d1ffc1b0cff76b79fbf50537b676996f74af | c8d41a0e44bbf2b0fb69d7ddc8fd175ca2a722d1 | /homework12/代码/HRMSClient/src/main/java/presentation/hotelstaff/view/PeriodStrategy.java | 811267b9c4bbeed73d43407c7ae1b6b62e68eb79 | [] | no_license | LLLHgo/Garden | a6eabaea8353b800e85c6adcd9296d1eecfbd003 | 58551074055f9dce8b3c301e54475182b1967727 | refs/heads/master | 2020-09-14T07:52:26.971868 | 2017-01-02T04:42:03 | 2017-01-02T04:42:03 | 67,698,226 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,235 | java | package presentation.hotelstaff.view;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import Enum.HotelStrategy;
import Enum.ResultMessage;
import Enum.VIPType;
import presentation.hotelstaff.component.CancleButton;
import presentation.hotelstaff.component.ConfirmButton;
import presentation.hotelstaff.component.TextField;
import presentation.hotelstaff.component.TextLabel;
import presentation.hotelstaff.component.TimePanel1;
import presentation.hotelstaff.component.TimePanel2;
import presentation.hotelstaff.controller.HotelstaffViewController;
import vo.strategyVO.HotelStrategyVO;
public class PeriodStrategy extends JPanel{
private static final long serialVersionUID = 1L;
private HotelstaffViewController controller;
private String hotelID;
private HotelStrategyVO vo;
private ImageIcon image;
private TextField jftdiscount;
private TimePanel2 tpStart;
private TimePanel2 tpEnd;
private ConfirmButton jbConfirm;
private CancleButton jbCancle;
private TextLabel discountLabel;
private TextLabel startLabel;
private TextLabel endLabel;
private String discount;
private JLabel resultLabel;
private Calendar startTime;
private Calendar endTime;
public PeriodStrategy(HotelstaffViewController controller,HotelStrategyVO vo){
this.controller = controller;
this.hotelID = controller.gethotelID();
this.vo = vo;
init();
showMessage("双十一活动折扣");
}
private void init(){
this.setLayout(null);
this.setBounds(0,0,1000,618);
this.setVisible(true);
setOpaque(false);
discountLabel = new TextLabel(350,235,50,30,"折扣");
this.add(discountLabel);
startLabel = new TextLabel(350,135,100,30,"开始时间 ");
this.add(startLabel);
endLabel = new TextLabel(350,185,100,30,"结束时间");
this.add(endLabel);
jftdiscount = new TextField("",460,234,80,30,4);
jftdiscount.setText(String.valueOf(vo.getDiscount()));
jftdiscount.setForeground(Color.white);
jftdiscount.setFont(new Font("微软雅黑",Font.BOLD,20));
this.add(jftdiscount);
tpStart = new TimePanel2(458,129,308,37);
tpStart.setTime(Calendar.getInstance().get(Calendar.YEAR), 11, 11, 00, 00);
tpEnd = new TimePanel2(458,182,308,37);
tpEnd.setTime(Calendar.getInstance().get(Calendar.YEAR), 11, 11, 24, 00);
this.add(tpStart);
this.add(tpEnd);
jbConfirm = new ConfirmButton(670,470);
this.add(jbConfirm);
jbConfirm.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
discount = jftdiscount.getText();
startTime = tpStart.getTime();
endTime = tpStart.getTime();
try{
vo.setName("双十一活动折扣");
vo.setStartTime(startTime);
vo.setEndTime(endTime);
vo.setType(HotelStrategy.SPECIALDAY);
vo.setHotelID(hotelID);
vo.setDiscount(Double.parseDouble(discount));
ResultMessage result = controller.updatehotelStrategy(vo);
if(result == ResultMessage.SUCCESS){
controller.JBStrategyClicked("双十一活动折扣修改成功");
}else{
showMessage(result.toString());
}
}catch(NumberFormatException e1){
showMessage("未正确填写数字");
}
}
});
jbCancle = new CancleButton(520,470);
this.add(jbCancle);
jbCancle.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
controller.JBStrategyClicked("取消操作成功");
}
});
//显示结果
resultLabel = new JLabel();
resultLabel.setForeground(Color.BLACK);
resultLabel.setFont(new Font("微软雅黑",Font.PLAIN,15));
resultLabel.setBounds(290, 50, 500, 20);
this.add(resultLabel);
}
public void showMessage(String message){
//提示信息
new Thread(new Runnable(){
@Override
public void run() {
resultLabel.setText(message);
try {
Thread.sleep(1000);
}catch(InterruptedException ex){
ex.printStackTrace();
}
resultLabel.setText("");
}
}).start();
}
}
| [
"2008luyiqing@163.com"
] | 2008luyiqing@163.com |
fca5859695774efcec8fd9e0193a841b1ab9eb1c | e0723d854d718b9ee6598a15505db24db43c46ba | /src/Station.java | ff83cf1012aa84d0b817c7b408d39b5d347850a2 | [] | no_license | pascal08/OOP-exam-2013 | 709e5bb1ae37d5f17e0b618ea0d8ebe8df3e0bcc | bcfa466d015a0d61d1286a40783251a28c266ba4 | refs/heads/master | 2021-05-02T16:57:29.787874 | 2016-11-01T13:59:19 | 2016-11-01T13:59:19 | 72,541,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java |
public class Station extends AbstractStation {
public Station(String name) {
super(name);
}
public String getType() {
return "Station";
}
}
| [
"pascallubbers8@hotmail.com"
] | pascallubbers8@hotmail.com |
8ac42d56802f64980b6ed71a849d695d5cadbcfd | 6a5f0cee7d978d7a321950c95cb28f32edc72cf2 | /Android/src/com/neo/infocommunicate/fragment/ContextMenuFragment.java | b76bec653efb1da4bf074debed7eb51c13e94f48 | [] | no_license | theoneneo/InfoCommunicate | 3ba200c1e6b163bfc70ef6f8357b9ede97ba6a4d | 24e22320ae219cb4b5fb9c0e446c597e93cbfb7c | refs/heads/master | 2020-04-01T22:18:27.909267 | 2014-06-11T06:41:26 | 2014-06-11T06:41:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,742 | java | package com.neo.infocommunicate.fragment;
import java.util.ArrayList;
import com.neo.infocommunicate.R;
import com.neo.infocommunicate.controller.MessageManager;
import com.neo.infocommunicate.controller.MyFragmentManager;
import com.neo.infocommunicate.data.NoticeInfo;
import com.neo.infocommunicate.fragment.NotificationListFragment.MessageViewHolder;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.TextView;
public class ContextMenuFragment extends DialogFragment implements
OnItemClickListener {
private ListView list;
private String user_id;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setCancelable(true);
setStyle(DialogFragment.STYLE_NO_TITLE, 0);
}
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View contentView = inflater.inflate(R.layout.fragment_contextmenu,
container, false);
initView(contentView);
return contentView;
}
public void initView(View contentView) {
list = (ListView) contentView.findViewById(R.id.list);
list.setOnItemClickListener(this);
show();
}
public void setId(String id) {
user_id = id;
}
public void show() {
StringAdapter adapter = new StringAdapter(getActivity());
list.setAdapter(adapter);
}
@Override
public void onDismiss(DialogInterface dialog) {
super.onDismiss(dialog);
}
public class StringAdapter extends BaseAdapter {
private ArrayList<String> items = new ArrayList<String>();
private LayoutInflater inflater;
private Context mContext;
public StringAdapter(Context context) {
mContext = context;
inflater = LayoutInflater.from(mContext);
items.add("发送通知");
items.add("发送消息");
}
@Override
public int getCount() {
return items.size();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = (View) inflater.inflate(R.layout.item_menu,
parent, false);
holder = new ViewHolder();
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.text.setText(items.get(position));
return convertView;
}
}
static class ViewHolder {
TextView text;
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
// TODO Auto-generated method stub
switch (arg2) {
case 0: {
Bundle b = new Bundle();
b.putString("sender_id", user_id);
MyFragmentManager.getInstance().replaceFragment(R.id.content_frame,
new EditNoticeFragment(), MyFragmentManager.PROCESS_MAIN,
MyFragmentManager.FRAGMENT_EDIT_NOTICE, b);
}
break;
case 1: {
Bundle b = new Bundle();
b.putString("sender_id", user_id);
MyFragmentManager.getInstance().replaceFragment(R.id.content_frame,
new ChatRoomFragment(), MyFragmentManager.PROCESS_MAIN,
MyFragmentManager.FRAGMENT_EDIT_MESSAGE, b);
}
break;
default:
break;
}
this.dismiss();
}
}
| [
"bing.liu@liubing-pc.autonavi.com"
] | bing.liu@liubing-pc.autonavi.com |
e35c466356d246934f9fbb6da7a6d89bfcb6123f | 9199f3450ada95f1677034358f006004bd2e589d | /swing/test1.java | 5e2feb84ab0eb599a87be33220c934e3971612ea | [] | no_license | Hits-95/Java | 03b73fc3e4330c456fde5c1825409bdb0f86868c | ee2d85cb74da5cf9d1f559ce87c9f543a4226c36 | refs/heads/master | 2023-04-01T15:24:48.947283 | 2020-12-17T18:14:17 | 2020-12-17T18:14:17 | 322,350,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | //without inheriting JFrame class...
import javax.swing.*;
public class test1{
public static void main(String[] args){
JFrame jf = new JFrame("Hits");
jf.setSize(400,300);
jf.setVisible(true);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
} | [
"hbahire2014@gmail.com"
] | hbahire2014@gmail.com |
4f82864d484976f449b780859d1f986992a0cfd8 | c8353234b0f32db3bcce8da8e55c91c334054324 | /DataStructure/src/list/linkedlist/implementation/LinkedList.java | 62eb179094073517a2d829ebf92ef6690ea12851 | [] | no_license | jjaekkaemi/DataStructure1 | 363545fd1a5b9586743b5476dc740539387356d9 | 9385acd588a18d6c664022417a5141d951860610 | refs/heads/master | 2020-04-11T13:09:08.724383 | 2018-12-14T15:46:22 | 2018-12-14T15:46:22 | 161,805,424 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 3,033 | java | package list.linkedlist.implementation;
public class LinkedList {
private Node head;
private Node tail;
private int size = 0 ;
private class Node{
private Object data;
private Node next ;
public Node(Object input) {
this.data = input ;
this.next = null ;
}
public String toString() {
return String.valueOf(this.data) ;
}
}
public void addFirst(Object i) {
Node newNode = new Node(i) ;
newNode.next = head ;//head값을 참조한다는 의미.
head = newNode ;
size++ ;
if(head.next==null) {
tail = head ;
}
}
public void addLast(Object i) {
Node newNode = new Node(i) ;
if(size == 0) {
addFirst(i) ;
}
else {
tail.next = newNode ;
tail = newNode ;
size++ ;
}
}
Node node(int i) {
Node x = head ;
for(int z=0 ; z < i ; z++) {
x = x.next ;
}
return x ;
}
public void add(int i, Object j) {
if(i == 0 ) {
addFirst(j) ;
}
else if(i+1 == size-1){
addLast(j) ;
}
else {
Node x = node(i-1) ;
Node y = node(i) ;
Node newNode = new Node(j) ;
x.next = newNode ;
newNode.next = y ;
size++ ;
if(newNode.next == null) {
tail = newNode ;
}
}
}
public String toString() {
String s = "[" ;
for(int i = 0 ; i<size ; i++) {
if(i==size-1) {
s = s+node(i) ;
}
else s = s + node(i) + "," ;
}
s = s + "]" ;
return s ;
}
public void removeFirst() {
Node x = node(0) ;
x = head ;
head = head.next ;
Object returnData = x.data ;
x = null ;
size-- ;
}
public void remove(int i) {
if(i==0) {
removeFirst() ;
}
/*else if(i+1 == size-1){
removeLast() ;
}*/
else {
Node x = node(i) ;
Node y = node(i-1) ;
Node z = node(i+1) ;
y.next = z ;
Object returnData = x.data ;
if(y == tail) {
tail = x ;
}
x = null ;
size-- ;
}
}
/*public void removeLast() {
Node x = node(size-2) ;
Node y = x.next ;
tail = x ;
Object returnData = y ;
y = null ;
size-- ;
} OR remove(size-1) ;
*/
public int size() {
return size ;
}
public Object get(int i) {
Node x = node(i) ;
return x.data ;
}
public int indexOf(Object x) {
for(int i = 0 ; i<size ; i++) {
Node temp = node(i) ;
if(temp.data==x) {
return i ;
}
}
return -1 ;
}
public ListIterator listIterator() {
return new ListIterator() ;
}
public class ListIterator{
private Node next ;
private Node lastReturned ;
private int nextIndex = 0;
ListIterator(){
next = head ;
}
public Object next() {
lastReturned = next ;
next = next.next ;
nextIndex++ ;
return lastReturned.data ;
}
public boolean hasNext() {
return nextIndex < size() ;
}
public void add(Object i) {
LinkedList.this.add(nextIndex++, i) ;
}
public void remove(Object i) {
int x = LinkedList.this.indexOf(i) ;
if(x>-1) {
LinkedList.this.remove(x) ;
}
}
}
}
| [
"21600752@handong.edu"
] | 21600752@handong.edu |
cda4c6f1eecd3254ee353151433cdb901a1127ae | 53176ce8b5db9416766dd724c79fb7226b77fe55 | /app/src/main/java/com/example/hp/zha/LoginSignup/Signup.java | 53a19a5a51291d9d7b0ee37836b9a749c4a68006 | [] | no_license | SubashMourougayane/Zha2 | 98070fa3dd7c205e07607475867c670488e68be6 | 01d1d42e5a04905962de3dd9ab98c4a735c557a3 | refs/heads/master | 2021-08-19T13:59:55.973137 | 2017-11-26T14:04:13 | 2017-11-26T14:04:13 | 111,916,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,663 | java | package com.example.hp.zha.LoginSignup;
import android.app.DatePickerDialog;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.WindowManager;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.example.hp.zha.Adapters.UserCreds;
import com.example.hp.zha.R;
import com.firebase.client.Firebase;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import org.w3c.dom.Text;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import com.example.hp.zha.Adapters.SignUpAdapter;
import me.anwarshahriar.calligrapher.Calligrapher;
public class Signup extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
Calligrapher calligrapher;
EditText input_name,input_password,input_dob,input_mail,input_profession,input_phone;
TextView input_MP,input_MLA;
Button button_signup;
TextView already_account;
Spinner s1,s2;
String sp1,Sp2;
TextInputLayout input_layout_name,input_layout_password,input_layout_mail,input_layout_MP,input_layout_MLA,input_layout_profession,input_layout_dob,input_layout_phone;
UserCreds userCreds;
Firebase fb_db;
String Base_Url = "https://zha-admin.firebaseio.com/";
String Uname,MailID;
private String email;
private String password;
private String name;
private String phone;
private String dob;
private String MP;
private String profession;
private String MLA;
private DatePickerDialog datePickerDialog;
private SimpleDateFormat dateFormatter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_signup);
Firebase.setAndroidContext(getApplicationContext());
fb_db = new Firebase(Base_Url);
calligrapher = new Calligrapher(this);
calligrapher.setFont(Signup.this,"Ubuntu_R.ttf",true);
dateFormatter = new SimpleDateFormat("dd-MM-yyyy", Locale.US);
already_account = (TextView) findViewById(R.id.textView3);
input_name = (EditText) findViewById(R.id.input_name);
input_dob = (EditText) findViewById(R.id.input_dob);
input_MP = (TextView) findViewById(R.id.input_MP);
input_password = (EditText) findViewById(R.id.input_password);
input_mail = (EditText) findViewById(R.id.input_mail);
input_MLA = (TextView) findViewById(R.id.input_MLA);
input_profession = (EditText) findViewById(R.id.input_profession);
input_phone = (EditText) findViewById(R.id.input_phone);
button_signup = (Button) findViewById(R.id.button_signup);
input_layout_name = (TextInputLayout) findViewById(R.id.input_layout_name);
input_layout_mail = (TextInputLayout) findViewById(R.id.input_layout_mail);
input_layout_password = (TextInputLayout) findViewById(R.id.input_layout_password);
input_layout_phone = (TextInputLayout) findViewById(R.id.input_layout_phone);
input_layout_MP = (TextInputLayout) findViewById(R.id.input_layout_MP);
input_layout_MLA = (TextInputLayout) findViewById(R.id.input_layout_MLA);
input_layout_profession = (TextInputLayout) findViewById(R.id.input_layout_profession);
input_layout_dob = (TextInputLayout) findViewById(R.id.input_layout_dob);
s1 = (Spinner)findViewById(R.id.spinner1);
s2 = (Spinner)findViewById(R.id.spinner2);
s1.setOnItemSelectedListener(this);
input_name.addTextChangedListener(new MyTextWatcher(input_name));
input_mail.addTextChangedListener(new MyTextWatcher(input_mail));
input_password.addTextChangedListener(new MyTextWatcher(input_password));
input_dob.addTextChangedListener(new MyTextWatcher(input_dob));
input_phone.addTextChangedListener(new MyTextWatcher(input_phone));
input_MP.addTextChangedListener(new MyTextWatcher(input_MP));
input_profession.addTextChangedListener(new MyTextWatcher(input_profession));
input_MLA.addTextChangedListener(new MyTextWatcher(input_MLA));
input_dob.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pickdob();
}
});
already_account.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(Signup.this,Login.class));
finish();
}
});
button_signup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
validate();
new MyTask1().execute();
}
});
}
private class MyTask1 extends AsyncTask<String, Integer, String>
{
@Override
protected String doInBackground(String... strings) {
userCreds = new UserCreds();
userCreds.Uname = input_name.getText().toString();
userCreds.Pass = input_password.getText().toString();
userCreds.DOB = input_dob.getText().toString();
userCreds.Mail = input_mail.getText().toString();
userCreds.PhNo = input_phone.getText().toString();
userCreds.Prof = input_profession.getText().toString();
userCreds.Dist = s1.getSelectedItem().toString();
userCreds.Const = s2.getSelectedItem().toString();
// String [] arr = input_mail.getText().toString().split(".");
// String Node = input_name.getText().toString()+"@"+arr[0];
fb_db.child("Admin").child("AdminCreds").child(input_name.getText().toString()).setValue(userCreds);
return null;
}
}
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
sp1= String.valueOf(s1.getSelectedItem());
if(sp1.contentEquals("THIRUVALLUR")) {
List<String> list = new ArrayList<String>();
list.add("Gummidipoondi");
list.add("Ponneri");
list.add("Tiruttani");
list.add("Thiruvallur");
list.add("Poonamallee");
list.add("Avadi");
list.add("Ambattur");
list.add("Madavaram");
list.add("Maduravoyal");
list.add("Tiruvottiyur");
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter.notifyDataSetChanged();
s2.setAdapter(dataAdapter);
}
if(sp1.contentEquals("CHENNAI")) {
List<String> list = new ArrayList<String>();
list.add("DrRadhakrishnan Nagar");
list.add("Perambur");
list.add("Kolathur");
list.add("Villivakkam");
list.add("Thiru -Vi -Ka -Nagar");
list.add("Egmore");
list.add("Royapuram");
list.add("Harbour");
list.add("Chepauk-Thiruvallikeni");
list.add("Thousand Lights");
list.add("Anna Nagar");
list.add("Virugampakkam");
list.add("Saidapet");
list.add("Thiyagarayanagar");
list.add("Mylapore");
list.add("Velachery");
ArrayAdapter<String> dataAdapter2 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter2.notifyDataSetChanged();
s2.setAdapter(dataAdapter2);
}
if(sp1.contentEquals("KANCHEEPURAM")) {
List<String> list = new ArrayList<String>();
list.add("Sholinganallur");
list.add("Alandur");
list.add("Sriperumbudur");
list.add("Pallavaram");
list.add("Tambaram");
list.add("Chengalpattu");
list.add("Thiruporur");
list.add("Cheyyur");
list.add("Madurantakam");
list.add("Uthiramerur");
list.add("Kancheepuram");
ArrayAdapter<String> dataAdapter3 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter3.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter3.notifyDataSetChanged();
s2.setAdapter(dataAdapter3);
}
if(sp1.contentEquals("VELLORE")) {
List<String> list = new ArrayList<String>();
list.add("Arakkonam");
list.add("Sholingur");
list.add("Katpadi");
list.add("Ranipet");
list.add("Arcot");
list.add("Vellore");
list.add("Anaikattu");
list.add("Kilvaithinankuppam");
list.add("Gudiyattam");
list.add("Vaniyambadi");
list.add("Ambur");
list.add("Jolarpet");
list.add("Tiruppattur");
ArrayAdapter<String> dataAdapter4 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter4.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter4.notifyDataSetChanged();
s2.setAdapter(dataAdapter4);
}
if(sp1.contentEquals("KRISHNAGIRI")) {
List<String> list = new ArrayList<String>();
list.add("Uthangarai");
list.add("Bargur");
list.add("Krishnagiri");
list.add("Veppanahalli");
list.add("Hosur");
list.add("Thalli");
ArrayAdapter<String> dataAdapter5 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter5.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter5.notifyDataSetChanged();
s2.setAdapter(dataAdapter5);
}
if(sp1.contentEquals("DHARMAPURI")) {
List<String> list = new ArrayList<String>();
list.add("Palacodu");
list.add("Pennagaram");
list.add("Dharmapuri");
list.add("Pappireddippatti");
list.add("Harur");
ArrayAdapter<String> dataAdapter6 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter6.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter6.notifyDataSetChanged();
s2.setAdapter(dataAdapter6);
}
if(sp1.contentEquals("TIRUVANNAMALAI")) {
List<String> list = new ArrayList<String>();
list.add("Chengam");
list.add("Tiruvannamalai");
list.add("Kilpennathur");
list.add("Kalasapakkam");
list.add("Polur");
list.add("Arani");
list.add("Cheyyar");
list.add("Vandavasi");
ArrayAdapter<String> dataAdapter7 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter7.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter7.notifyDataSetChanged();
s2.setAdapter(dataAdapter7);
}
if(sp1.contentEquals("VILLUPURAM")) {
List<String> list = new ArrayList<String>();
list.add("Gingee");
list.add("Mailam");
list.add("Tindivanam ");
list.add("Kalasapakkam");
list.add("Polur");
list.add("Arani");
list.add("Cheyyar");
list.add("Vandavasi");
ArrayAdapter<String> dataAdapter8 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, list);
dataAdapter8.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
dataAdapter8.notifyDataSetChanged();
s2.setAdapter(dataAdapter8);
}
}
public void onNothingSelected(AdapterView<?> arg0) {
// TODO Auto-generated method stub
}
private void pickdob() {
Calendar newCalendar = Calendar.getInstance();
datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
Calendar newDate = Calendar.getInstance();
newDate.set(year, monthOfYear, dayOfMonth);
input_dob.setText(dateFormatter.format(newDate.getTime()));
}
},newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));
datePickerDialog.show();
}
private void validate() {
if (!validateName()) {
return;
}
if (!validateMail()) {
return;
}
if (!validatePassword()) {
return;
}
if (!validateDOB()) {
return;
}
if (!validatePhone()) {
return;
}
// if (!validateLocation()) {
// return;
// }
if (!validateProfession()) {
return;
}
// if (!validatePost()) {
// return;
// }
validateComplete();
}
private void validateComplete() {
email = input_mail.getText().toString().trim();
password = input_password.getText().toString().trim();
System.out.println("test ---> Entering validate");
}
private boolean validateName() {
if ((input_name.getText().toString().trim().isEmpty())||(input_name.getText().toString().length()<5)) {
input_layout_name.setError(getString(R.string.err_msg_name));
requestFocus(input_name);
return false;
} else {
input_layout_name.setErrorEnabled(false);
}
return true;
}
private boolean validateMail() {
String email = input_mail.getText().toString().trim();
if (email.isEmpty() || !isValidEmail(email)) {
input_layout_mail.setError(getString(R.string.err_msg_mail));
requestFocus(input_mail);
return false;
} else {
input_layout_mail.setErrorEnabled(false);
}
return true;
}
private static boolean isValidEmail(String email) {
return !TextUtils.isEmpty(email) && android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
}
private boolean validatePassword() {
if ((input_password.getText().toString().trim().isEmpty())||(input_password.getText().toString().length()<8)) {
input_layout_password.setError(getString(R.string.err_msg_password));
requestFocus(input_password);
return false;
} else {
input_layout_password.setErrorEnabled(false);
}
return true;
}
private boolean validateDOB() {
if (input_dob.getText().toString().trim().isEmpty()) {
input_layout_dob.setError(getString(R.string.err_msg_dob));
requestFocus(input_dob);
return false;
} else {
input_layout_dob.setErrorEnabled(false);
}
return true;
}
private boolean validatePhone() {
if ((input_phone.getText().toString().trim().isEmpty())||(input_phone.getText().toString().length()!=10)) {
input_layout_phone.setError(getString(R.string.err_msg_phone));
requestFocus(input_phone);
return false;
} else {
input_layout_phone.setErrorEnabled(false);
}
return true;
}
// private boolean validateLocation() {
// if (input_location.getText().toString().trim().isEmpty()) {
// input_layout_location.setError(getString(R.string.err_msg_location));
// requestFocus(input_location);
// return false;
// } else {
// input_layout_location.setErrorEnabled(false);
// }
//
// return true;
// }
private boolean validateProfession() {
if (input_profession.getText().toString().trim().isEmpty()) {
input_layout_profession.setError(getString(R.string.err_msg_profession));
requestFocus(input_profession);
return false;
} else {
input_layout_profession.setErrorEnabled(false);
}
return true;
}
// private boolean validatePost() {
// if (input_post.getText().toString().trim().isEmpty()) {
// input_layout_post.setError(getString(R.string.err_msg_post));
// requestFocus(input_post);
// return false;
// } else {
// input_layout_post.setErrorEnabled(false);
// }
//
// return true;
// }
private void requestFocus(View view) {
if (view.requestFocus()) {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}
}
private class MyTextWatcher implements TextWatcher {
private View view;
private MyTextWatcher(View view) {
this.view = view;
}
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
public void afterTextChanged(Editable editable) {
switch (view.getId()) {
case R.id.input_name:
validateName();
break;
case R.id.input_mail:
validateMail();
break;
case R.id.input_password:
validatePassword();
break;
case R.id.input_dob:
validateDOB();
break;
case R.id.input_phone:
validatePhone();
break;
// case R.id.input_location:
// // validateLocation();
// break;
case R.id.input_profession:
validateProfession();
break;
// case R.id.input_post:
// // validatePost();
// break;
}
}
}
}
| [
"msubashjay@gmail.com"
] | msubashjay@gmail.com |
41ddcda70c62d5fe3a38ccf50fadee6a93a5b057 | 9cceacc9d8af179803cfcb9dea0dd37c86129e77 | /trunk/core/src/main/java/ru/factus/bo/Relation.java | c6e044e8ac6bf4cdad97d4858637cb5492c0a47f | [] | no_license | BGCX067/factus-svn-to-git | 0bc0e4d6807a5515dd711036f523f8fab36846f2 | c8d14d4f48e8b24d84d6370a49d49ded5a5e3bff | refs/heads/master | 2021-01-13T00:56:26.559267 | 2015-12-28T14:41:22 | 2015-12-28T14:41:22 | 48,849,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package ru.factus.bo;
import ru.factus.AbstractEntity;
import javax.persistence.*;
/**
* @author <a href="mailto:ziman200@gmail.com">freeman</a>
* created 13.05.2008 15:00:30
*/
@Entity
@Table(name = "RELATION")
public class Relation extends AbstractEntity{
@Id
@GeneratedValue
private Long id;
@Basic
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"you@example.com"
] | you@example.com |
31c3568b363cef1936721c27cb5e47b7745366a9 | 68524a2b1ee1c937a0f2a19661d06be4f005c70a | /DiaDia_BASE/src/it/uniroma3/diadia/attrezzi/Attrezzo.java | bce9ecc46f3e64b89dee458f22f1b106cfa24ce3 | [] | no_license | PaoloHp/DiaDia_BASE | 4135b698501bab0d7f63de2b10201c4d65645b2f | a32a3c3df65d505f83cbaa92dbb44cf41f8169e6 | refs/heads/master | 2020-12-02T22:31:46.312403 | 2017-07-03T20:08:50 | 2017-07-03T20:08:50 | 96,145,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,329 | java | package it.uniroma3.diadia.attrezzi;
import it.uniroma3.diadia.ambienti.Stanza;
/**
* Una semplice classe che modella un attrezzo.
* Gli attrezzi possono trovarsi all'interno delle stanze
* del labirinto.
* Ogni attrezzo ha un nome ed un peso.
*
* @author Paolo Merialdo
* @see Stanza
* @version 0.1
*
*/
public class Attrezzo implements Comparable<Attrezzo> {
private String nome;
private int peso;
/**
* Crea un attrezzo
* @param nome il nome che identifica l'attrezzo
* @param peso il peso dell'attrezzo
*/
public Attrezzo(String nome, int peso) {
this.peso = peso;
this.nome = nome;
}
/**
* Restituisce il nome identificatore dell'attrezzo
* @return il nome identificatore dell'attrezzo
*/
public String getNome() {
return this.nome;
}
/**
* Restituisce il peso dell'attrezzo
* @return il peso dell'attrezzo
*/
public int getPeso() {
return this.peso;
}
/**
* Restituisce una rappresentazione stringa di questo attrezzo
* @return la rappresentazione stringa
*/
public String toString() {
return this.getNome()+" ("+this.getPeso()+"kg)";
}
@Override
public int compareTo(Attrezzo that) {
return this.nome.compareTo(that.getNome());
}
} | [
"accaputopaolo@me.com"
] | accaputopaolo@me.com |
750c74ee0cdc4b6357613fb2f2bd956f6e613e09 | 7518a885fa8faaf75aa4f244ec9355ae8f9fb2b8 | /src/dispatcher/DispatcherServlet.java | 7b62db72a48b4106bc7fbfd29320d940b666a1b1 | [] | no_license | heekyeom/FandomEtherDapp | 2060efca08886ccaa51ef2c8decbfe5ab9dbbeeb | 944be5da15df7ccfc95eb33326ac08e143aee406 | refs/heads/master | 2020-03-28T13:31:00.511817 | 2018-09-12T01:18:59 | 2018-09-12T01:18:59 | 148,401,545 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,248 | java | package dispatcher;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class DispatcherServlet
*/
@WebServlet("/DispatcherServlet")
public class DispatcherServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DispatcherServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"eileenkim1208@naver.com"
] | eileenkim1208@naver.com |
a4e518e3bc0b04fb0d960f94beeb77e61dd5bdee | 6832918e1b21bafdc9c9037cdfbcfe5838abddc4 | /jdk_8_maven/cs/rest/original/proxyprint/src/main/java/io/github/proxyprint/kitchen/controllers/consumer/PrintingSchemaController.java | c0d9fecaa891d2d76cfb8befa16e04047bcd6662 | [
"Apache-2.0",
"GPL-1.0-or-later",
"LGPL-2.0-or-later"
] | permissive | EMResearch/EMB | 200c5693fb169d5f5462d9ebaf5b61c46d6f9ac9 | 092c92f7b44d6265f240bcf6b1c21b8a5cba0c7f | refs/heads/master | 2023-09-04T01:46:13.465229 | 2023-04-12T12:09:44 | 2023-04-12T12:09:44 | 94,008,854 | 25 | 14 | Apache-2.0 | 2023-09-13T11:23:37 | 2017-06-11T14:13:22 | Java | UTF-8 | Java | false | false | 6,378 | java | package io.github.proxyprint.kitchen.controllers.consumer;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import io.github.proxyprint.kitchen.models.consumer.Consumer;
import io.github.proxyprint.kitchen.models.consumer.PrintingSchema;
import io.github.proxyprint.kitchen.models.repositories.ConsumerDAO;
import io.github.proxyprint.kitchen.models.repositories.PrintingSchemaDAO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Set;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
/**
* Created by daniel on 28-04-2016.
*/
@RestController
@Transactional
public class PrintingSchemaController {
@Autowired
private ConsumerDAO consumers;
@Autowired
private PrintingSchemaDAO printingSchemas;
@Autowired
private Gson GSON;
/**
* Get all the consumer's PrintingSchemas.
* @param id, the id of the consumer.
* @return set of the printing schemas belonging to the consumer matched by the id.
*/
@ApiOperation(value = "Returns a set of the printing schemas.", notes = "This method allows consumers to get his PrintingSchemas.")
@Secured({"ROLE_USER"})
@RequestMapping(value = "/consumer/{consumerID}/printingschemas", method = RequestMethod.GET)
public String getConsumerPrintingSchemas(@PathVariable(value = "consumerID") long id) {
Set<PrintingSchema> consumerSchemas = consumers.findOne(id).getPrintingSchemas();
JsonObject response = new JsonObject();
if(consumerSchemas!=null) {
response.addProperty("success", true);
response.add("pschemas",GSON.toJsonTree(consumerSchemas));
return GSON.toJson(response);
} else {
response.addProperty("success", false);
return GSON.toJson(response);
}
}
/**
* Add a new PrintingSchema to user's printing schemas collection.
* Test
* curl --data "name=MyFancySchema&bindingSpecs=SPIRAL&coverSpecs=CRISTAL_ACETATE&paperSpecs=COLOR,A4,SIMPLEX" -u joao:1234 localhost:8080/consumer/1001/printingschemas
* @param id, the id of the consumer.
* @param ps, the PrintingSchema created by the consumer.
* @return HttpStatus.OK if everything went well.
*/
@ApiOperation(value = "Returns success/insuccess.", notes = "This method allows consumers to add a new printing schema to his printing schemas collection.")
@Secured({"ROLE_USER"})
@RequestMapping(value = "/consumer/{consumerID}/printingschemas", method = RequestMethod.POST)
public String addNewConsumerPrintingSchema(@PathVariable(value = "consumerID") long id, @RequestBody PrintingSchema ps) {
JsonObject obj = new JsonObject();
Consumer c = consumers.findOne(id);
PrintingSchema addedPS = printingSchemas.save(ps);
boolean res = c.addPrintingSchema(addedPS);
if(res) {
consumers.save(c);
obj.addProperty("success", true);
obj.addProperty("id", addedPS.getId());
return GSON.toJson(obj);
} else {
obj.addProperty("success", false);
return GSON.toJson(obj);
}
}
/**
* Delete a PrintingSchema.
* Test
* curl -u joao:1234 -X DELETE localhost:8080/consumer/1001/printingschemas/{printingSchemaID}
* @param cid, the id of the consumer.
* @param psid, the id of the printing schema to delete.
* @return HttpStatus.OK if everything went well.
*/
@ApiOperation(value = "Returns success/insuccess.", notes = "This method allows consumers to delete a printing schema from his printing schemas collection.")
@Secured({"ROLE_USER"})
@RequestMapping(value = "/consumer/{consumerID}/printingschemas/{printingSchemaID}", method = RequestMethod.DELETE)
public String deleteConsumerPrintingSchema(@PathVariable(value = "consumerID") long cid, @PathVariable(value = "printingSchemaID") long psid) {
JsonObject obj = new JsonObject();
PrintingSchema ps = printingSchemas.findOne(psid);
if(!ps.isDeleted()) {
ps.delete();
printingSchemas.save(ps);
obj.addProperty("success", true);
} else {
obj.addProperty("false", true);
}
return GSON.toJson(obj);
}
/**
* Edit an existing PrintingSchema.
* Test
* curl -X PUT --data "name=MyFancyEditedSchema&bindingSpecs=STAPLING&paperSpecs=COLOR,A4,SIMPLEX" -u joao:1234 localhost:8080/consumer/1001/printingschemas/{printingSchemaID}
* @param cid, the id of the consumer.
* @param psid, the PrintingSchema id.
* @return HttpStatus.OK if everything went well.
*/
@ApiOperation(value = "Returns success/insuccess.", notes = "This method allows consumers to edit a printing schema from his printing schemas collection.")
@Secured({"ROLE_USER"})
@RequestMapping(value = "/consumer/{consumerID}/printingschemas/{printingSchemaID}", method = RequestMethod.PUT)
public ResponseEntity<String> editConsumerPrintingSchema(@PathVariable(value = "consumerID") long cid, @PathVariable(value = "printingSchemaID") long psid, @RequestBody PrintingSchema pschema) {
PrintingSchema ps = printingSchemas.findOne(psid);
ps.setBindingSpecs(pschema.getBindingSpecs());
ps.setCoverSpecs(pschema.getCoverSpecs());
ps.setName(pschema.getName());
ps.setPaperSpecs(pschema.getPaperSpecs());
JsonObject obj = new JsonObject();
PrintingSchema res = printingSchemas.save(ps);
if(res!=null) {
obj.addProperty("success", true);
return new ResponseEntity<>(GSON.toJson(obj), HttpStatus.OK);
} else {
obj.addProperty("success", false);
return new ResponseEntity<>(GSON.toJson(obj), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
| [
"arcuri82@gmail.com"
] | arcuri82@gmail.com |
49993b088dfcc01391d39cfecc490f82b6a43543 | 133f0936e0e3b9e4753ce0d679fa293969543eee | /emgui_beSa/JAVA 3/vidu/Advanced_JAVA_1/src/session08/URL_methods.java | 63db6a7c0797fd06e4897571500b5f0bea6f05d5 | [] | no_license | trandai201/StudyJS | 95ab6ea28b3e07608ba64d1041faf35559e24ef9 | a22952e1c0acf696be9f260432c69ed213074ec7 | refs/heads/main | 2023-07-10T21:07:52.236664 | 2021-08-15T06:35:35 | 2021-08-15T06:35:35 | 390,725,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 949 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package session08;
import java.net.MalformedURLException;
import java.net.URL;
/**
*
* @author nguyenducthao
*/
public class URL_methods {
public static void main(String[] args) throws MalformedURLException {
URL myUrl=new URL("https://www.google.com.vn/webhp?sourceid=chrome-instant&rlz=1C1CHZL_viVN732VN732&ion=1&espv=2&ie=UTF-8#q=aptech&*");
System.out.println("myUrl: "+myUrl);
System.out.println("Host: "+myUrl.getHost());
System.out.println("File: "+myUrl.getFile());
System.out.println("Path: "+myUrl.getPath());
System.out.println("Query: "+myUrl.getQuery());
System.out.println("Default port: "+myUrl.getDefaultPort());
System.out.println("Protocol: "+myUrl.getProtocol());
}
}
| [
"="
] | = |
fb3dbff057da183d77ab090319b83d1b83d1dc7e | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/serge-rider--dbeaver/38b17640165b3f5d259bdb0178fd1ca2def71650/after/GenericProcedure.java | 17cab215099ef6a5a828284ffbe4d2b490f4259a | [] | 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 | 9,234 | java | /*
* Copyright (C) 2010-2012 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.generic.model;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.generic.GenericConstants;
import org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaObject;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.exec.DBCExecutionPurpose;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCConstants;
import org.jkiss.dbeaver.model.impl.struct.AbstractProcedure;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.DBSObjectUnique;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameterType;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureType;
import org.jkiss.utils.CommonUtils;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* GenericProcedure
*/
public class GenericProcedure extends AbstractProcedure<GenericDataSource, GenericStructContainer> implements GenericStoredCode, DBSObjectUnique
{
private static final Pattern PATTERN_COL_NAME_NUMERIC = Pattern.compile("\\$?([0-9]+)");
private String specificName;
private DBSProcedureType procedureType;
private List<GenericProcedureParameter> columns;
public GenericProcedure(
GenericStructContainer container,
String procedureName,
String specificName,
String description,
DBSProcedureType procedureType)
{
super(container, true, procedureName, description);
this.procedureType = procedureType;
this.specificName = specificName;
}
/*
@Property(viewable = true, order = 2)
public String getPlainName()
{
return specificName;
}
*/
@Property(viewable = true, order = 3)
public GenericCatalog getCatalog()
{
return getContainer().getCatalog();
}
@Property(viewable = true, order = 4)
public GenericSchema getSchema()
{
return getContainer().getSchema();
}
@Property(viewable = true, order = 5)
public GenericPackage getPackage()
{
return getContainer() instanceof GenericPackage ? (GenericPackage) getContainer() : null;
}
@Override
@Property(viewable = true, order = 6)
public DBSProcedureType getProcedureType()
{
return procedureType;
}
@Override
public Collection<GenericProcedureParameter> getParameters(DBRProgressMonitor monitor)
throws DBException
{
if (columns == null) {
loadColumns(monitor);
}
return columns;
}
private void loadColumns(DBRProgressMonitor monitor) throws DBException
{
Collection<GenericProcedure> procedures = getContainer().getProcedures(monitor, getName());
if (procedures == null || !procedures.contains(this)) {
throw new DBException("Internal error - cannot read columns for procedure '" + getName() + "' because its not found in container");
}
Iterator<GenericProcedure> procIter = procedures.iterator();
GenericProcedure procedure = null;
final GenericMetaObject pcObject = getDataSource().getMetaObject(GenericConstants.OBJECT_PROCEDURE_COLUMN);
final JDBCExecutionContext context = getDataSource().openContext(monitor, DBCExecutionPurpose.META, "Load procedure columns");
try {
final JDBCResultSet dbResult = context.getMetaData().getProcedureColumns(
getCatalog() == null ? this.getPackage() == null || !this.getPackage().isNameFromCatalog() ? null : this.getPackage().getName() : getCatalog().getName(),
getSchema() == null ? null : getSchema().getName(),
getName(),
null);
try {
int previousPosition = -1;
while (dbResult.next()) {
String columnName = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.COLUMN_NAME);
int columnTypeNum = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.COLUMN_TYPE);
int valueType = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.DATA_TYPE);
String typeName = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.TYPE_NAME);
int columnSize = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.LENGTH);
boolean notNull = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.NULLABLE) == DatabaseMetaData.procedureNoNulls;
int scale = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.SCALE);
int precision = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.PRECISION);
//int radix = GenericUtils.safeGetInt(dbResult, JDBCConstants.RADIX);
String remarks = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.REMARKS);
int position = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.ORDINAL_POSITION);
//DBSDataType dataType = getDataSourceContainer().getInfo().getSupportedDataType(typeName);
DBSProcedureParameterType parameterType;
switch (columnTypeNum) {
case DatabaseMetaData.procedureColumnIn: parameterType = DBSProcedureParameterType.IN; break;
case DatabaseMetaData.procedureColumnInOut: parameterType = DBSProcedureParameterType.INOUT; break;
case DatabaseMetaData.procedureColumnOut: parameterType = DBSProcedureParameterType.OUT; break;
case DatabaseMetaData.procedureColumnReturn: parameterType = DBSProcedureParameterType.RETURN; break;
case DatabaseMetaData.procedureColumnResult: parameterType = DBSProcedureParameterType.RESULTSET; break;
default: parameterType = DBSProcedureParameterType.UNKNOWN; break;
}
if (CommonUtils.isEmpty(columnName) && parameterType == DBSProcedureParameterType.RETURN) {
columnName = "RETURN";
}
if (position == 0) {
// Some drivers do not return ordinal position (PostgreSQL) but
// position is contained in column name
Matcher numberMatcher = PATTERN_COL_NAME_NUMERIC.matcher(columnName);
if (numberMatcher.matches()) {
position = Integer.parseInt(numberMatcher.group(1));
}
}
if (procedure == null || (previousPosition >= 0 && position <= previousPosition && procIter.hasNext())) {
procedure = procIter.next();
}
GenericProcedureParameter column = new GenericProcedureParameter(
procedure,
columnName,
typeName,
valueType,
position,
columnSize,
scale, precision, notNull,
remarks,
parameterType);
procedure.addColumn(column);
previousPosition = position;
}
}
finally {
dbResult.close();
}
} catch (SQLException e) {
throw new DBException(e);
} finally {
context.close();
}
}
private void addColumn(GenericProcedureParameter column)
{
if (this.columns == null) {
this.columns = new ArrayList<GenericProcedureParameter>();
}
this.columns.add(column);
}
@Override
public String getFullQualifiedName()
{
return DBUtils.getFullQualifiedName(getDataSource(),
getCatalog(),
getSchema(),
this);
}
@Override
public String getUniqueName()
{
return CommonUtils.isEmpty(specificName) ? getName() : specificName;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
f796b7f184488238ac64c3470fbf64b6d1238533 | 2a654fd308c3ec47a54b9652dcd24b75dd335975 | /src/main/java/ru/bjcreslin/web/rest/errors/package-info.java | 26855ad2ced3170d65101356cc215662a340095e | [] | no_license | BJCreslin/Home-for-your-projects | 74b54205477f2b661e7f0e17eecf5a3b71fb1f20 | 1d46355541b4cec5478be603523456890e3d62fe | refs/heads/main | 2023-03-30T21:50:19.134842 | 2021-04-05T12:55:14 | 2021-04-05T12:55:14 | 352,530,707 | 0 | 0 | null | 2021-03-29T06:23:14 | 2021-03-29T05:51:30 | Java | UTF-8 | Java | false | false | 187 | java | /**
* Specific errors used with Zalando's "problem-spring-web" library.
*
* More information on https://github.com/zalando/problem-spring-web
*/
package ru.bjcreslin.web.rest.errors;
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
4d6548c0a73c0013d6c592dbfc23b7e1e8da9564 | 907313dd719babe704f7063a0bf5bdcde6bf8ff9 | /src/com/allen/george/utils/FileUtil.java | 704c421e38737d511b9e6ef14331ff322cb82bfc | [] | no_license | brenodvs/ImageCompression | bd4716570a402a2365bf295321916e8adaa70f08 | d10683612f52cce714598ecf0a6695fb56c9dccd | refs/heads/master | 2020-12-29T01:23:08.349345 | 2015-02-13T17:27:56 | 2015-02-13T17:27:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package com.allen.george.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.IOUtils;
//Class to read and write bytes to files using Apache Commons IOUTILS
public class FileUtil {
//Method to write bytes to a file
//Takes in the file path and the bytes to write
public static void writeBytes(String filePath, byte[] dataBytes) {
try {
IOUtils.write(dataBytes, new FileOutputStream(new File(filePath)));
} catch (Exception e) {
e.printStackTrace();
}
}
//Method to read bytes from a file.
//Takes in a file path
//Returns the file contents as a string.
public static byte[] readBytes(String filePath) {
try {
return IOUtils.toByteArray(new FileInputStream(new File(filePath)));
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| [
"george.allen93@outlook.com"
] | george.allen93@outlook.com |
ca0a7e9a41e85a057f7420b832ab639823777d31 | 6779e6628c5861f4ea0979d9dd142d1aac24bf9e | /src/main/java/ru/yar/bird/remindme/server/ApplicationInitializer.java | e5ac55614c39d12c0b374ca0e395bec90bceb436 | [] | no_license | Bird55/RemindMeServer | 62ed83ec11580eb56403584311032a9e8cf31449 | 08a4fcea62a727fea0828d56b891dc502534938e | refs/heads/master | 2021-01-13T13:20:25.807942 | 2015-12-15T11:30:06 | 2015-12-15T11:30:06 | 47,683,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,088 | java | package ru.yar.bird.remindme.server;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import ru.yar.bird.remindme.server.config.WebConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
public class ApplicationInitializer implements WebApplicationInitializer {
private static final String DISPATCER = "dispatcher";
public void onStartup(ServletContext servletContext) throws ServletException {
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
ctx.register(WebConfig.class);
servletContext.addListener(new ContextLoaderListener(ctx));
ServletRegistration.Dynamic servlet = servletContext.addServlet(DISPATCER, new DispatcherServlet(ctx));
servlet.addMapping("/");
servlet.setLoadOnStartup(1);
}
}
| [
"bird55@narod.ru"
] | bird55@narod.ru |
85aa06a618b372e037ac96146058f8384fdf81a2 | 9fc0b633abc500b23c426f33f6a001970e396cc6 | /core/src/com/kpetlak/arkanoid/assets/SplashScreenAssets.java | 4fcd8cba3fdd32e8fc092abf2f1ce2822344ae59 | [] | no_license | krzysiekp25/Arkanoid | 6b6197c27ff227843501aebc59686f3055568da7 | 5a20e8f62bf47609f54ec61bd7d4bf1437036fa8 | refs/heads/master | 2020-04-02T01:23:05.277719 | 2019-01-13T14:15:36 | 2019-01-13T14:15:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.kpetlak.arkanoid.assets;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
public class SplashScreenAssets implements ScreenAssets {
@Override
public void load() {
manager.load("fonts/bondi48.fnt", BitmapFont.class);
}
@Override
public void dispose() {
manager.dispose();
}
}
| [
"krzysiek251p@gmail.com"
] | krzysiek251p@gmail.com |
0928ec7c77c2cab4dc468e7db7f4e91335a99995 | 79877c93c6511faa1fa9c36205abaf98f5c2491a | /android/src/main/java/com/react/jiguang/PushService.java | 76264fb1f11161a0145ea41b8fd56f052e288a11 | [
"Apache-2.0"
] | permissive | yiky84119/react-native-jiguang | 9363a25e8e32c70e1c11ba75a382f363c35464d8 | 6cc9840ebeefe2956545f34c6c35846a0fa842f7 | refs/heads/master | 2021-07-13T16:05:32.987285 | 2020-09-02T08:24:00 | 2020-09-02T08:24:00 | 201,386,582 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 129 | java | package com.react.jiguang;
import cn.jpush.android.service.JCommonService;
public class PushService extends JCommonService {
}
| [
"nevo.lee@gmail.com"
] | nevo.lee@gmail.com |
140056aa0e73e64fac429eb8cceb266bf1eef91d | 6968252715e86c7d63fa4d6d62d005570f39b7db | /src/eventbooking/model/StudentsModel.java | 61bff39c173bc6d7cf267782494f1dc3e378b040 | [] | no_license | faisalo1/EventBooking | ad72eeee074ca0dea074b3675e5b374fd9a45145 | a1ae40c6602641146ef1fff2b55d3fa2e29f0e3e | refs/heads/master | 2020-05-19T08:53:55.539036 | 2019-05-03T02:52:39 | 2019-05-03T02:52:39 | 184,934,559 | 1 | 0 | null | 2019-05-04T19:09:08 | 2019-05-04T19:09:08 | null | UTF-8 | Java | false | false | 1,135 | java | package eventbooking.model;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class StudentsModel {
private SimpleIntegerProperty studentId;
private SimpleStringProperty firstName;
private SimpleStringProperty lastName;
public StudentsModel(Integer studentId, String firstName, String lastName) {
this.studentId = new SimpleIntegerProperty(studentId);
this.firstName = new SimpleStringProperty(firstName);
this.lastName = new SimpleStringProperty(lastName);
}
public int getStudentId() {
return studentId.get();
}
public void setStudentId(int studentId) {
this.studentId = new SimpleIntegerProperty(studentId);
}
public String getFirstName() {
return firstName.get();
}
public void setFirstName(String firstName) {
this.firstName = new SimpleStringProperty(firstName);
}
public String getLastName() {
return lastName.get();
}
public void setLastName(String lastName) {
this.lastName = new SimpleStringProperty(lastName);
}
} | [
"RashidKP@rashid"
] | RashidKP@rashid |
fdafe14dc5ab429fafa7ef54440edf5696c2a738 | 9c6755241eafce525184949f8c5dd11d2e6cefd1 | /src/leetcode/algorithms/ConvertBST.java | f974adc9b104db2d5f5c81c07b9c881de043f1ce | [] | no_license | Baltan/leetcode | 782491c3281ad04efbe01dd0dcba2d9a71637a31 | 0951d7371ab93800e04429fa48ce99c51284d4c4 | refs/heads/master | 2023-08-17T00:47:41.880502 | 2023-08-16T16:04:32 | 2023-08-16T16:04:32 | 172,838,932 | 13 | 3 | null | null | null | null | UTF-8 | Java | false | false | 930 | java | package leetcode.algorithms;
import leetcode.entity.TreeNode;
import leetcode.util.BinaryTreeUtils;
/**
* Description: 538. Convert BST to Greater Tree
*
* @author Baltan
* @date 2019-02-25 10:02
*/
public class ConvertBST {
private static int sum = 0;
public static void main(String[] args) {
TreeNode root1 = BinaryTreeUtils.arrayToBinaryTree(new Integer[]{5, 2, 13}, 0);
System.out.println(convertBST(root1));
}
/**
* 参考:
* <a href="https://leetcode-cn.com/problems/convert-bst-to-greater-tree/solution/ba-er-cha-sou-suo-shu-zhuan-huan-wei-lei-jia-sh-14/"></a>
*
* @param root
* @return
*/
public static TreeNode convertBST(TreeNode root) {
if (root == null) {
return null;
}
convertBST(root.right);
sum += root.val;
root.val = sum;
convertBST(root.left);
return root;
}
}
| [
"617640006@qq.com"
] | 617640006@qq.com |
dc5adefce27a7c6df82e17b6f8c29855801988e5 | 9a52fe3bcdd090a396e59c68c63130f32c54a7a8 | /sources/com/iab/omid/library/inmobi/publisher/C2102a.java | eedcc8d0a7784bb45f0bbeea4bae2348b5e4f05b | [] | no_license | mzkh/LudoKing | 19d7c76a298ee5bd1454736063bc392e103a8203 | ee0d0e75ed9fa8894ed9877576d8e5589813b1ba | refs/heads/master | 2022-04-25T06:08:41.916017 | 2020-04-14T17:00:45 | 2020-04-14T17:00:45 | 255,670,636 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package com.iab.omid.library.inmobi.publisher;
import android.annotation.SuppressLint;
import android.webkit.WebView;
/* renamed from: com.iab.omid.library.inmobi.publisher.a */
public class C2102a extends AdSessionStatePublisher {
@SuppressLint({"SetJavaScriptEnabled"})
public C2102a(WebView webView) {
if (webView != null && !webView.getSettings().getJavaScriptEnabled()) {
webView.getSettings().setJavaScriptEnabled(true);
}
mo27596a(webView);
}
}
| [
"mdkhnmm@amazon.com"
] | mdkhnmm@amazon.com |
f2cd30482d8b9df879444b62d26db2fbcd6244ba | 07a12d556a7670a85b3883e19e4b3e5803afbf45 | /Doubts/june20/Sorting.java | e49ed5418e50de64dc8a9cbcc2b4ef16773fafb5 | [] | no_license | jyotik16/Crux8June2018 | d3dd33859c43937fad95829c55e625ebeaa512cc | 97cfa23f5fd4b753663d02b7ee0e4b91b50be8f9 | refs/heads/master | 2022-11-22T22:45:14.480042 | 2020-07-23T07:46:22 | 2020-07-23T07:46:22 | 281,890,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package Doubts.june20;
import java.util.Scanner;
public class Sorting {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int[] arr = new int[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = scn.nextInt();
}
int[] result = Sorting(arr);
for (int i = 0; i < result.length; i++) {
System.out.println(result[i]);
}
}
private static int[] Sorting(int[] arr) {
int low = 0;
int high = arr.length - 1;
int mid = 0;
while (mid <= high) {
int val = arr[mid];
System.out.println("1="+arr[mid]);
if (val == 0) {
int temp = arr[low];
arr[low] = arr[mid];
arr[mid] = temp; System.out.println("2="+arr[mid]);
low++;
mid++;
} else if (val == 1) {
mid++;
} else {
int temp = arr[mid];
arr[mid] = arr[high];
arr[high] = temp; System.out.println("3="+arr[mid]);
high--;
}
}
return arr;
}
}
| [
"jyotik1608@gmail.com"
] | jyotik1608@gmail.com |
943a3780e3dcc57c5f29eb76a52eef1c2a7e0fcf | bf4f9df09b24a1d784dc1a782ab40ea3648e8c40 | /src/main/java/io/github/retrooper/packetevents/utils/entityfinder/EntityFinderUtils.java | bef85bd0ee4888d4eeedd8a2ef35538a739e6551 | [
"MIT"
] | permissive | gabrielvicenteYT/packetevents | 651b6f3bd935027f4b3ab8569da6fc1c4e5bb7e7 | 6b227d55aa00247a5f09c208892962015145b76d | refs/heads/master | 2022-12-31T17:28:30.992726 | 2020-09-12T22:05:11 | 2020-09-12T22:05:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,850 | java | /*
* MIT License
*
* Copyright (c) 2020 retrooper
*
* 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 io.github.retrooper.packetevents.utils.entityfinder;
import io.github.retrooper.packetevents.annotations.Nullable;
import io.github.retrooper.packetevents.enums.ServerVersion;
import io.github.retrooper.packetevents.utils.NMSUtils;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public final class EntityFinderUtils {
@Nullable
public static ServerVersion version;
private static Class<?> worldServerClass;
private static Class<?> craftWorldClass;
private static Class<?> entityClass;
private static Method getEntityByIdMethod;
private static Method craftWorldGetHandle;
private static Method getBukkitEntity;
private static boolean isServerVersion_v_1_8_x;
public static void load() {
isServerVersion_v_1_8_x = version.isHigherThan(ServerVersion.v_1_7_10) && version.isLowerThan(ServerVersion.v_1_9);
try {
worldServerClass = NMSUtils.getNMSClass("WorldServer");
craftWorldClass = NMSUtils.getOBCClass("CraftWorld");
entityClass = NMSUtils.getNMSClass("Entity");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
try {
getEntityByIdMethod = worldServerClass.getMethod(getEntityByIDMethodName(), int.class);
craftWorldGetHandle = craftWorldClass.getMethod("getHandle");
getBukkitEntity = entityClass.getMethod("getBukkitEntity");
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
}
/**
* Get an entity by their ID.
* @param id
* @return Entity
*/
public static Entity getEntityById(final int id) {
for (final World world : Bukkit.getWorlds()) {
final Entity entity = getEntityByIdWithWorld(world, id);
if (entity != null) {
return entity;
}
}
return null;
}
/**
* Get an entity by their ID, guaranteed to be in the specified world.
* @param world
* @param id
* @return Entity
*/
@Nullable
public static Entity getEntityByIdWithWorld(final World world, final int id) {
if (world == null) {
return null;
}
else if(craftWorldClass == null) {
throw new IllegalStateException("PacketEvents failed to locate the CraftWorld class.");
}
Object craftWorld = craftWorldClass.cast(world);
Object worldServer = null;
try {
worldServer = craftWorldGetHandle.invoke(craftWorld);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
Object nmsEntity = null;
try {
nmsEntity = getEntityByIdMethod.invoke(worldServer, id);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
if (nmsEntity == null) {
return null;
}
try {
return (Entity) getBukkitEntity.invoke(nmsEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* This is the name of the method that returns the NMS entity when you pass in its ID.
* On 1.8-1.8.8 the function name is called 'a', on 1.7.10 and 1.9 and above the name is called 'getEntity'.
* @return entity by ID method name
*/
public static String getEntityByIDMethodName() {
if (isServerVersion_v_1_8_x) {
return "a";
}
return "getEntity";
}
}
| [
"uchizi4000@gmail.com"
] | uchizi4000@gmail.com |
d68cb872628f523142b89f961be08b651a6217cb | d0f017ec559692c6d97f2c4c715a7cd8e6fdd9bf | /app/src/main/java/com/omi/bean/chat/IMMessageType.java | 3105e71ea1331601c0c27a508008eef8175e1341 | [] | no_license | SensYang/OMI | ce63437589bdf46dcd5e79c6701bc676364da3a4 | fa126b6087918ab373b40282c015900266a3923c | refs/heads/master | 2020-04-04T00:13:43.949511 | 2018-11-01T01:32:58 | 2018-11-01T01:32:58 | 155,644,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,398 | java | package com.omi.bean.chat;
/**
* Created by SensYang on 2017/04/04 15:29
*/
public enum IMMessageType {
TXT_OTHER(0),
TXT_SELF(100),
IMAGE_OTHER(1),
IMAGE_SELF(101),
VIDEO_OTHER(2),
VIDEO_SELF(102),
LOCATION_OTHER(3),
LOCATION_SELF(103),
VOICE_OTHER(4),
VOICE_SELF(104),
FILE_OTHER(5),
FILE_SELF(105),
CMD_OTHER(6),
CMD_SELF(106),
GIF_OTHER(7),
GIF_SELF(107),
UNKNOW(404);
private int value;
IMMessageType(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public static IMMessageType valueOf(int type) {
if(type>200)return UNKNOW;
switch (type) {
case 0: return TXT_OTHER;
case 100: return TXT_SELF;
case 1: return IMAGE_OTHER;
case 101: return IMAGE_SELF;
case 2: return VIDEO_OTHER;
case 102: return VIDEO_SELF;
case 3: return LOCATION_OTHER;
case 103: return LOCATION_SELF;
case 4: return VOICE_OTHER;
case 104: return VOICE_SELF;
case 5: return FILE_OTHER;
case 105: return FILE_SELF;
case 6: return CMD_OTHER;
case 106: return CMD_SELF;
case 7: return GIF_OTHER;
case 107: return GIF_SELF;
default: return UNKNOW;
}
}
}
| [
"lui1997@126.com"
] | lui1997@126.com |
c547f1c4d79850b401e916e1e747b32d89180154 | 50c7cc094206699a9c53f9c12f77eb7ddf1a2efe | /CodeForces/WaterMelon.java | d7cab616a64115b35f6ea726ca59e0831c17b7cf | [] | no_license | pattu777/CompetitiveCoding | fe186745f07237c91bc4d58cff19b5c8613668f1 | 5bdbcb0a2015f65800e87f92dff3a130912143f9 | refs/heads/master | 2016-09-05T21:29:43.753494 | 2015-09-28T11:19:20 | 2015-09-28T11:19:20 | 26,258,885 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | import java.util.Scanner;
public class WaterMelon
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
if(((n % 2)==0) && (n != 2))
System.out.println("YES");
else
System.out.println("NO");
}
}
| [
"patanaikchinmaya@gmail.com"
] | patanaikchinmaya@gmail.com |
d06c74d4656fd4068f6a67f51dccc9f1054d88a1 | f845bbdb4aa0a3d61c6b6faf358f14d1752c0145 | /2019-01-20 Security_reimplementation/src/main/java/application/model/IAdmin.java | d654d0f16a250e4a6f45fd291f7c765897c58a40 | [] | no_license | fainafr/ClassWorksII | cb8cd9ed32c86022496103215768257b7a9f8a1b | b4792a565bec6053a0a8614889b1c7f977f15383 | refs/heads/master | 2020-05-17T23:20:56.407378 | 2019-04-16T13:41:08 | 2019-04-16T13:41:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 279 | java | package application.model;
public interface IAdmin {
boolean addAccount(String login, String password);
boolean addRole(String login, String role);
String getPassword(String login);
String[] getRoles(String login);
String[] getAccounts(String roleString);
}
| [
"vitkovsky1337@gmail.com"
] | vitkovsky1337@gmail.com |
f489e431d4287273472ab178dc33633b6f79e01f | 4c1935a9ddfb93497bb93bce08c645d03b15c90e | /src/SamsungGalaxy/Sample/Sample_Application/BleAnpServer/gen/com/samsung/ble/anpserver/BuildConfig.java | 4514dce4392ad1a994eebdf6b4671072d03beaa8 | [] | no_license | kalpeshkumar412/doFirst | 30962bc35385d347e4c27415d117d65e1804f5f8 | a005aafaf506c8e523e7b74930942ba4d4208d7d | refs/heads/master | 2020-12-30T19:23:31.349880 | 2014-02-09T23:17:26 | 2014-02-09T23:23:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | /*___Generated_by_IDEA___*/
/** Automatically generated file. DO NOT MODIFY */
package com.samsung.ble.anpserver;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | [
"sh.haam@gmail.com"
] | sh.haam@gmail.com |
0f551baf5c4ddf82c41e99a9c6192b97a18598b9 | d5893b70aafdc0147790ce7ecc98136740599de7 | /src/main/java/com/haoyanbing/datastructure/list/MyLinkedList.java | ab5065ab584810b9656b772595e067eacbfa89dd | [] | no_license | haoyanbing/algorithm-study | 5354bb2d117a941623880dfc076161af5b20ec6a | 664d11bc7c05221ce42dd47ace898449b51f6848 | refs/heads/master | 2022-04-15T13:15:13.363550 | 2020-04-02T06:41:36 | 2020-04-02T06:41:36 | 228,612,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,585 | java | package com.haoyanbing.datastructure.list;
class MyLinkedList {
Node head, tail;
int count;
private class Node {
int value;
Node next;
Node(int value) {
this.value = value;
}
}
public MyLinkedList() {
this.count = 0;
}
public int get(int index) {
if (index >= 0 && index < count) {
// 找到index节点
Node curr = head;
for (int i = 0; i < index; i++) {
curr = curr.next;
}
return curr.value;
}
return -1;
}
public void addAtHead(int val) {
if (head == null) {
head = new Node(val);
tail = head;
} else {
Node curr = new Node(val);
curr.next = head;
head = curr;
}
count++;
}
public void addAtTail(int val) {
if (head == null) {
head = new Node(val);
tail = head;
} else {
Node node = new Node(val);
tail.next = node;
tail = node;
}
count++;
}
public void addAtIndex(int index, int val) {
if (index <= 0) {
addAtHead(val);
} else if (index == count) {
addAtTail(val);
} else if (index < count) {
// 找到index的前一个节点
Node curr = head;
for (int i = 0; i < index - 1; i++) {
curr = curr.next;
}
Node newNode = new Node(val);
newNode.next = curr.next;
curr.next = newNode;
count++;
}
}
public void deleteAtIndex(int index) {
if (index >= 0 && index < count) {
if (index == 0) {
head = head.next;
} else {
// 找到index的前一个节点
Node curr = head;
for (int i = 0; i < index - 1; i++) {
curr = curr.next;
}
if (curr.next == tail) {
tail = curr;
curr.next = null;
} else {
curr.next = curr.next.next;
}
}
count--;
}
}
public static void main(String[] args) {
MyLinkedList list = new MyLinkedList();
list.addAtHead(1);
list.addAtTail(3);
list.addAtIndex(1, 2);
System.out.println(list.get(1));
list.deleteAtIndex(1);
System.out.println(list.get(1));
}
} | [
"binary_hao@163.com"
] | binary_hao@163.com |
b77edf8155f61fb5c9b3937d0bab4969f929eafe | c47a1df06bebfdc53ef58a187a6a07401e847b93 | /src/trees/InOrderSucc.java | 3ec121008158ff9d20c9b5ff402783e2ba9f1b32 | [] | no_license | shwsac/2014 | aa4423573723c7ee8c880755a100733f761d3747 | 07038ec1f0f472cbbc2ab939c984b1177b26845c | refs/heads/master | 2020-12-25T19:15:26.195006 | 2015-04-23T05:40:19 | 2015-04-23T05:40:19 | 34,311,654 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 650 | java | package trees;
class TN {
int val;
TN left;
TN right;
TN parent;
}
public class InOrderSucc {
public static TN getInorderSucc(TN n) {
if(n == null) {
return null;
}
if(n.parent==null || n.right!=null) {
return getLeftMostChild(n.right);
} else{
TN prnt = n.parent;
TN chld = n;
while(prnt!=null && prnt.left!=chld) {
chld = prnt;
prnt = prnt.parent;
}
return prnt;
}
}
private static TN getLeftMostChild(TN right) {
if(right==null) {
return null;
}
while(right.left!=null) {
right = right.left;
}
return right;
}
}
| [
"shwetasachdeva86@gmail.com"
] | shwetasachdeva86@gmail.com |
a4b671cc6158b7b86819552539fbc0cbeb71db4c | a4fcf49371d7f114e99c24cda1149b091bc9003a | /src/LeJOSSandBox/Frame.java | b49217b14c47513d04bb11ba41909eca080529d5 | [] | no_license | parampawar07/LeJOSSandBox | 6fe873bc1f50dfc65f71e001233b21a4a1338441 | dc7f6c5b9f529f2e9f32d548dd9c308049d06ddf | refs/heads/master | 2021-04-29T15:30:08.153345 | 2018-02-16T21:45:12 | 2018-02-16T21:45:12 | 121,799,541 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,847 | java | package LeJOSSandBox;
import coppelia.IntW;
import java.util.concurrent.TimeUnit;
import LeJOSSandBox.VrepConnectionFactory;
import coppelia.FloatW;
import coppelia.FloatWAA;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JTextField;
import coppelia.IntW;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFormattedTextField;
public class Frame {
int x ;
JFrame frame;
private JTextField textField;
private JLabel lblNewOrthosize;
private JTextField textField_1;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LejosGUI window = new LejosGUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
* @wbp.parser.entryPoint
*/
public Frame() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 450, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
textField = new JTextField();
textField.setBounds(146, 64, 86, 20);
frame.getContentPane().add(textField);
textField.setColumns(10);
JLabel lblOrthosize = new JLabel("OrthoSize");
lblOrthosize.setBounds(44, 67, 86, 14);
frame.getContentPane().add(lblOrthosize);
JButton btnSetRenderMode = new JButton("Set RenderMode");
btnSetRenderMode.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
String s = textField.getText();
int k =Integer.valueOf(s);
x = k;
}
});
btnSetRenderMode.setBounds(39, 189, 140, 23);
frame.getContentPane().add(btnSetRenderMode);
lblNewOrthosize = new JLabel("Render Mode");
lblNewOrthosize.setBounds(43, 161, 103, 14);
frame.getContentPane().add(lblNewOrthosize);
textField_1 = new JTextField();
textField_1.setBounds(146, 111, 86, 20);
frame.getContentPane().add(textField_1);
textField_1.setColumns(10);
JFormattedTextField formattedTextField = new JFormattedTextField();
formattedTextField.setBounds(156, 158, 226, 20);
frame.getContentPane().add(formattedTextField);
formattedTextField.setValue(setFloatValue(x));
formattedTextField.getValue();
//formattedTextField.g
}
public int setFloatValue(int i) {
IntW handle;
int error;
int parameterID = 1017;
System.out.println(parameterID);
int parameterValue = x;
handle = new IntW(0);
error = VrepConnectionFactory.getInstance().VrepConnection_get_object().simxGetObjectHandle(VrepConnectionFactory.getInstance().VrepConnection_get_ID(), "Vision_sensor", handle, VrepConnectionFactory.getInstance().VrepConnection_get_object().simx_opmode_oneshot_wait);
error = VrepConnectionFactory.getInstance().VrepConnection_get_object().simxSetObjectIntParameter(VrepConnectionFactory.getInstance().VrepConnection_get_ID(), handle.getValue(), parameterID, parameterValue, VrepConnectionFactory.getInstance().VrepConnection_get_object().simx_opmode_streaming);
try {
TimeUnit.SECONDS.sleep(2);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
error = VrepConnectionFactory.getInstance().VrepConnection_get_object().simxSetObjectIntParameter(VrepConnectionFactory.getInstance().VrepConnection_get_ID(), handle.getValue(), parameterID, parameterValue, VrepConnectionFactory.getInstance().VrepConnection_get_object().simx_opmode_buffer);
return parameterValue;
}
}
| [
"param@DESKTOP-3534VVE"
] | param@DESKTOP-3534VVE |
8f059472de70c5a6073b2dd12cb8db636f845c13 | bbab8d9ef176c812a6cebe68f9ec3831bf6b6f27 | /src/test/java/com/todarch/td/helper/TestUser.java | e7a5c93c77ffcd0c121ec0bbe2a58be21c8252c3 | [
"Apache-2.0"
] | permissive | todarch/todarch-td | a658b024c729a27bac255a8f79d8b1299a85bc06 | 2b22bbd7cd5b4d2034bfd790792ffc6f838997d1 | refs/heads/master | 2021-06-04T08:50:16.665530 | 2020-04-04T16:32:07 | 2020-04-04T16:32:07 | 136,719,419 | 1 | 1 | Apache-2.0 | 2020-04-03T22:09:37 | 2018-06-09T11:58:12 | Java | UTF-8 | Java | false | false | 425 | java | package com.todarch.td.helper;
import java.util.UUID;
public final class TestUser {
public TestUser() {
throw new AssertionError("No instace of utility class");
}
public static final String EMAIL = "test2@user.com";
public static final String ID = UUID.randomUUID().toString();
public static final String ANOTHER_USER_ID = UUID.randomUUID().toString();
public static final String PREFIXED_TOKEN = null;
}
| [
"selimssevgi@gmail.com"
] | selimssevgi@gmail.com |
53764d9e95922b3692936b799656eff362f4265e | 598317d4c7fe6a24fc6c542d1d8f39a410780ad8 | /src/java/br/immunit/controller/PacienteEnderecoControl.java | 587b5ec26e99d8fb05019e69051176ccf4ea8f83 | [] | no_license | evansantos/immunit-java | d0e1564ff5a2a3358ebf5538d2820d20dfc49a4c | 06207ada64da48c6a036fc8c0afef7855b5d004e | refs/heads/master | 2021-01-01T19:07:41.655162 | 2015-03-16T15:00:31 | 2015-03-16T15:00:31 | 32,332,539 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,367 | java | package br.immunit.controller;
import br.immunit.dao.EnderecoDAO;
import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class PacienteEnderecoControl extends org.apache.struts.action.Action{
private static final String SUCCESS = "success";
private static final String FAIL = "fail";
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws SQLException{
EnderecoDAO endereco = new EnderecoDAO();
HttpSession session = request.getSession();
session.removeAttribute("cartaoSUS");
session.removeAttribute("cpf");
session.removeAttribute("rg");
session.removeAttribute("nome");
session.removeAttribute("sobrenome");
session.removeAttribute("sexo");
session.removeAttribute("datanascimento");
session.removeAttribute("email");
session.removeAttribute("responsavel");
session.removeAttribute("cep");
session.setAttribute("cartaoSUS", request.getParameter("cartaoSUS"));
session.setAttribute("cpf", request.getParameter("cpf"));
session.setAttribute("rg", request.getParameter("rg"));
session.setAttribute("nome", request.getParameter("nome"));
session.setAttribute("sobrenome", request.getParameter("sobrenome"));
session.setAttribute("sexo", request.getParameter("sexo"));
session.setAttribute("datanascimento", request.getParameter("datanascimento"));
session.setAttribute("email", request.getParameter("email"));
session.setAttribute("responsavel", request.getParameter("responsavel"));
session.setAttribute("cep", request.getParameter("cep"));
if(request.getParameter("cep").equals("")){
return mapping.findForward(FAIL);
}else{
if(endereco.pesquisa(request.getParameter("cep"))){
return mapping.findForward(SUCCESS);
}else{
return mapping.findForward(FAIL);
}
}
}
} | [
"rafael.brsantos@hotmail.com"
] | rafael.brsantos@hotmail.com |
7c6bac2458ac591f1f4a9e0e2018e52dc0b819ad | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/21/21_a227fe1e2ec7161a8f5d438f5d938dfab1476262/ApplicationWindow/21_a227fe1e2ec7161a8f5d438f5d938dfab1476262_ApplicationWindow_s.java | 291846d4404b4fd67166d04630134a95beaf7e63 | [] | 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 | 26,410 | java | package gui;
import images.ImageTag;
import images.TaggableImage;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.FlowLayout;
import java.awt.GraphicsEnvironment;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.KeyStroke;
import javax.swing.ToolTipManager;
import javax.swing.border.EtchedBorder;
import application.ImageClassifier;
import application.ImageLoader;
import application.ImagePdfExporter;
public class ApplicationWindow extends JFrame implements ActionListener, WindowListener, MouseListener {
public static boolean minimize, warning, ask;
public static int proxyPort;
public static String proxyUrl;
public static boolean useProxy;
public static String location;
private static DisplayMode mode = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0].getDisplayMode();
private static Dimension dim = new Dimension(mode.getWidth(), mode.getHeight());
//private static Dimension dim = new Dimension(1024, 768);
private static final Dimension RIGHT_PANEL_SIZE = new Dimension(dim.width * 3 / 5, dim.height - 110);
private static final Dimension IMAGE_BUTTON_PANEL_SIZE = new Dimension(dim.width * 3 / 5, (RIGHT_PANEL_SIZE.height)/21);
private static final Dimension IMAGE_METADATA_PANEL_SIZE = new Dimension(dim.width * 3 / 5, (RIGHT_PANEL_SIZE.height)/3);
private static final Dimension IMAGE_CANVAS_SIZE = new Dimension(dim.width * 3 / 5, (RIGHT_PANEL_SIZE.height
-IMAGE_BUTTON_PANEL_SIZE.height
-IMAGE_METADATA_PANEL_SIZE.height));
private static final Dimension IMEX_BUTTON_PANEL_SIZE = new Dimension(dim.width * 1 / 5, (dim.height)/23);
private static final Dimension leftPaneSize = new Dimension(dim.width * 1 / 5, dim.height - 110 - 2*(dim.height/23));
private static final Dimension ANALYSE_ALL_BUTTON_SIZE = new Dimension(dim.width * 1 / 5, dim.height / 23);
private ImageLoader imageLoader;
private static final long serialVersionUID = 1L;
private static List<TaggableImage> importedImageList;
private ImageGridPanel imageGrid;
private ImageCanvas mainImageViewCanvas;
private JPanel imageMetadataPanel;
private JLabel metaDataLabel = new JLabel(" <p>Blank</p>");
private JButton importButton;
private JButton exportButton;
private JButton flagImageButton;
private JButton nextImageButton;
private JButton prevImageButton;
private JButton autobutton;
private JButton analyzeAllButton;
private BufferedImage METADATA_PLACEHOLDER;
public static BufferedImage WAI_LOGO;
public static BufferedImage IMPORT_PLACEHOLDER;
public static final Color WAI_BLUE = new Color(0, 126, 166);
public ApplicationWindow(){
checkSetting();
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
setImportedImageList(new ArrayList<TaggableImage>());
setLayout(new FlowLayout());
setResizable(false);
addWindowListener(this);
initialiseMenus();
initialiseWindow();
initialiseApplication();
setTitle("WAINZ UAVTool");
pack();
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension scrnsize = toolkit.getScreenSize();
setBounds((scrnsize.width - getWidth()) / 2, (scrnsize.height - getHeight()) / 2, getWidth(), getHeight());
setVisible(true);
}
public void initialiseApplication(){
imageLoader = new ImageLoader();
}
public void initialiseMenus(){
System.out.println("button width/height: " + IMAGE_BUTTON_PANEL_SIZE.width/4 + ", " + IMAGE_BUTTON_PANEL_SIZE.height);
JMenuBar menuBar = new JMenuBar();
JMenu file = new JMenu("File");
menuBar.add(file);
JMenuItem importItem = new JMenuItem("Import Images");
importItem.setActionCommand("Import");
JMenuItem exportItem = new JMenuItem("Export Images");
exportItem.setActionCommand("Export");
JMenuItem quitItem = new JMenuItem("Quit");
importItem.addActionListener(this);
exportItem.addActionListener(this);
quitItem.addActionListener(this);
file.add(importItem);
file.add(exportItem);
file.add(quitItem);
JMenu option = new JMenu("Image");
menuBar.add(option);
JMenuItem flagItem = new JMenuItem("Flag Image");
JMenuItem unflagItem = new JMenuItem("Unflag Image");
JMenuItem pdfReportItem = new JMenuItem("PDF Report");
JMenuItem preferencesItem = new JMenuItem("Preferences");
flagItem.addActionListener(this);
unflagItem.addActionListener(this);
preferencesItem.addActionListener(this);
pdfReportItem.addActionListener(this);
option.add(flagItem);
option.add(unflagItem);
option.add(pdfReportItem);
option.add(preferencesItem);
JMenu help = new JMenu("Help");
menuBar.add(help);
JMenuItem about = new JMenuItem("About");
JMenuItem manual = new JMenuItem("Manual");
about.addActionListener(this);
manual.addActionListener(this);
//Setting shortcuts and Mnemonics for Options Menu
flagItem.setMnemonic('F');
flagItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.Event.CTRL_MASK));
unflagItem.setMnemonic('U');
unflagItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.Event.CTRL_MASK));
preferencesItem.setMnemonic('P');
preferencesItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.Event.CTRL_MASK));
//Setting shortcuts and Mnemonics for File Menu
importItem.setMnemonic('I');
importItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.Event.CTRL_MASK));
exportItem.setMnemonic('E');
exportItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.Event.CTRL_MASK));
quitItem.setMnemonic('W');
quitItem.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.Event.CTRL_MASK));
//Setting shortcuts and Mnemonics for Help Menu
about.setMnemonic('A');
about.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.Event.CTRL_MASK));
manual.setMnemonic('M');
manual.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.Event.CTRL_MASK));
help.add(manual);
help.add(about);
setJMenuBar(menuBar);
}
private void initialiseWindow(){
try {
String importPlaceholderPath = "lib/import-placeholder.jpg";
IMPORT_PLACEHOLDER = ImageIO.read(new File(importPlaceholderPath));
} catch (IOException e) {
System.out.println("Error reading WAI Logo");
}
imageGrid = new ImageGridPanel(null, this);
JScrollPane leftPane = new JScrollPane(imageGrid);
leftPane.setPreferredSize(leftPaneSize);
leftPane.setMaximumSize(leftPaneSize);
mainImageViewCanvas = new ImageCanvas(imageGrid);
mainImageViewCanvas.setSize(IMAGE_CANVAS_SIZE);
mainImageViewCanvas.setPreferredSize(IMAGE_CANVAS_SIZE);
mainImageViewCanvas.setMaximumSize(IMAGE_CANVAS_SIZE);
imageGrid.setCanvas(mainImageViewCanvas);
JPanel rightPanel = new JPanel();
rightPanel.setPreferredSize(RIGHT_PANEL_SIZE);
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS)); //changed to FlowLayout jm 180912
//JLabel infoLabel = new JLabel(infoIcon);
//infoLabel.setBounds(10, 10, infoIcon.getIconWidth(), infoIcon.getIconHeight());
//infoLabel.addMouseListener(this);
JPanel imageButtonPanel = new JPanel();
imageButtonPanel.setLayout(new GridLayout(1, 4)); //changed to GridLayout jm 180912
imageButtonPanel.setSize(IMAGE_BUTTON_PANEL_SIZE);
imageButtonPanel.setPreferredSize(IMAGE_BUTTON_PANEL_SIZE);
imageButtonPanel.setMaximumSize(IMAGE_BUTTON_PANEL_SIZE);
//imageButtonPanel.setPreferredSize(new Dimension(RIGHT_PANEL_SIZE.width, RIGHT_PANEL_SIZE.height/18));
//imageButtonPanel.setMaximumSize(new Dimension(RIGHT_PANEL_SIZE.width, RIGHT_PANEL_SIZE.height/18));
//previous button
ImageIcon prevBtnImage = new ImageIcon("lib/prev-image-btn.png");
//Image xa = prevBtnImage.getImage().getScaledInstance(RIGHT_PANEL_SIZE.width/5, RIGHT_PANEL_SIZE.height/18, java.awt.Image.SCALE_SMOOTH);
Image xa = prevBtnImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
prevBtnImage = new ImageIcon(xa);
prevImageButton = new JButton(prevBtnImage);
prevImageButton.addActionListener(this);
prevImageButton.setActionCommand("Previous Image");
imageButtonPanel.add(prevImageButton);
//flag/unflag button
ImageIcon flagBtnImage = new ImageIcon("lib/flag-image-btn.png");
xa = flagBtnImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
flagBtnImage = new ImageIcon(xa);
flagImageButton = new JButton(flagBtnImage);
//unflagImageButton = new JButton(unflagBtnImage);
flagImageButton.addActionListener(this);
//unflagImageButton.addActionListener(this);
flagImageButton.setActionCommand("Flag Image");
//unflagImageButton.setActionCommand("Unflag Image");
imageButtonPanel.add(flagImageButton);
//imageButtonPanel.add(unflagImageButton);
//auto button
ImageIcon autoButtonImage = new ImageIcon("lib/auto-analyse-btn-gold.png");
xa = autoButtonImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
autoButtonImage = new ImageIcon(xa);
autobutton = new JButton(autoButtonImage);
autobutton.setEnabled(false);
autobutton.setActionCommand("Auto Analyse");
autobutton.addActionListener(this);
imageButtonPanel.add(autobutton);
//next button
ImageIcon nextBtnImage = new ImageIcon("lib/next-image-btn.png");
xa = nextBtnImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
nextBtnImage = new ImageIcon(xa);
nextImageButton = new JButton(nextBtnImage);
nextImageButton.setActionCommand("Next Image");
nextImageButton.addActionListener(this);
imageButtonPanel.add(nextImageButton);
//meta-data pane below buttons
String metadataPlaceholderPath = "lib/metadata-panel-default.png";
try {
METADATA_PLACEHOLDER = ImageIO.read(new File(metadataPlaceholderPath));
} catch (IOException e) {
e.printStackTrace();
}
imageMetadataPanel = new JPanel();
imageMetadataPanel.setPreferredSize(IMAGE_METADATA_PANEL_SIZE);
imageMetadataPanel.setMaximumSize(IMAGE_METADATA_PANEL_SIZE);
imageMetadataPanel.setBackground(new Color(153, 157, 158));
if(imageGrid.getSelectedImage()== null)
imageMetadataPanel.add(new JLabel(new ImageIcon(METADATA_PLACEHOLDER.getScaledInstance(IMAGE_METADATA_PANEL_SIZE.width,
IMAGE_METADATA_PANEL_SIZE.height, Image.SCALE_FAST))));
else
imageMetadataPanel.add(metaDataLabel);
rightPanel.add(mainImageViewCanvas);
rightPanel.add(imageButtonPanel);
rightPanel.add(imageMetadataPanel);
//leftPanel
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS));
JPanel importExportPanel = new JPanel();
importExportPanel.setLayout(new GridLayout(1, 2));
ImageIcon importBtnImage = new ImageIcon("lib/import-images-btn.png");
xa = importBtnImage.getImage().getScaledInstance(IMEX_BUTTON_PANEL_SIZE.width/2, IMEX_BUTTON_PANEL_SIZE.height, java.awt.Image.SCALE_SMOOTH);
importBtnImage = new ImageIcon(xa);
importButton = new JButton(importBtnImage);
importButton.setActionCommand("Import");
importButton.addActionListener(this);
importExportPanel.add(importButton);
ImageIcon exportBtnImage = new ImageIcon("lib/export-images-btn.png");
xa = exportBtnImage.getImage().getScaledInstance(IMEX_BUTTON_PANEL_SIZE.width/2, IMEX_BUTTON_PANEL_SIZE.height, java.awt.Image.SCALE_SMOOTH);
exportBtnImage = new ImageIcon(xa);
exportButton = new JButton(exportBtnImage);
exportButton.addActionListener(this);
exportButton.setActionCommand("Export");
importExportPanel.add(exportButton);
importExportPanel.setPreferredSize(IMEX_BUTTON_PANEL_SIZE);
importExportPanel.setMaximumSize(IMEX_BUTTON_PANEL_SIZE);
//importExportPanel.setPreferredSize(new Dimension(leftPaneSize.width, leftPaneSize.height/18));
//importExportPanel.setMaximumSize(new Dimension(leftPaneSize.width, leftPaneSize.height/18));
JPanel analyseAllPanel = new JPanel();
ImageIcon analyseAllButtonImage = new ImageIcon("lib/analyse-all-btn.png");
xa = analyseAllButtonImage.getImage().getScaledInstance(ANALYSE_ALL_BUTTON_SIZE.width, ANALYSE_ALL_BUTTON_SIZE.height, java.awt.Image.SCALE_SMOOTH);
analyseAllButtonImage = new ImageIcon(xa);
analyzeAllButton = new JButton(analyseAllButtonImage);
analyzeAllButton.addActionListener(this);
analyzeAllButton.setActionCommand("Analyze All");
analyzeAllButton.setPreferredSize(ANALYSE_ALL_BUTTON_SIZE);
analyzeAllButton.setMaximumSize(ANALYSE_ALL_BUTTON_SIZE);
analyseAllPanel.add(analyzeAllButton);
leftPanel.add(importExportPanel);
leftPanel.add(leftPane);
leftPanel.add(analyseAllPanel);
//enable buttons
flagImageButton.setEnabled(false);
prevImageButton.setEnabled(false);
nextImageButton.setEnabled(false);
analyzeAllButton.setEnabled(false);
add(leftPanel);
add(rightPanel);
pack();
}
public Canvas getMainCanvas(){
return mainImageViewCanvas;
}
public void setButtonsEnabled(boolean enabled){
flagImageButton.setEnabled(enabled);
prevImageButton.setEnabled(enabled);
nextImageButton.setEnabled(enabled);
autobutton.setEnabled(enabled);
//analyzeAllButton.setEnabled(enabled); not controlled here jm 051012
}
public void toggleFlagButton(boolean flag) {
if (flag) {
//set to flag
ImageIcon flagBtnImage = new ImageIcon("lib/flag-image-btn.png");
Image img = flagBtnImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
flagBtnImage = new ImageIcon(img);
flagImageButton.setIcon(flagBtnImage);
flagImageButton.setActionCommand("Flag Image");
} else {
//set to unflag
ImageIcon unflagBtnImage = new ImageIcon("lib/unflag-image-btn.png");
Image img = unflagBtnImage.getImage().getScaledInstance(IMAGE_BUTTON_PANEL_SIZE.width/4, IMAGE_BUTTON_PANEL_SIZE.height, Image.SCALE_SMOOTH);
unflagBtnImage = new ImageIcon(img);
flagImageButton.setIcon(unflagBtnImage);
flagImageButton.setActionCommand("Unflag Image");
}
}
public void actionPerformed(ActionEvent e) {
String action = e.getActionCommand();
//Debug:
//System.out.println(action); //jm 070912
if (action.equals("Import")) {
//import features
setImportedImageList(imageLoader.importImages(this));
imageGrid.setImageList(getImportedImageList());
imageGrid.initialise();
imageGrid.repaint();
mainImageViewCanvas.repaint();
if (!getImportedImageList().isEmpty()) {
analyzeAllButton.setEnabled(true);
}
repaint();
}
else if (action.equals("Export")) {
//export features
if(!ask) {
String exportPath = location;
int byteread = 0;
InputStream in = null;
OutputStream out = null;
try {
for(TaggableImage image: importedImageList) {
if(image.getTag() == ImageTag.INFRINGEMENT) {
in = new FileInputStream(image.getSource());
out = new FileOutputStream(new File(exportPath + "/" + image.getFileName()));
byte[] buffer = new byte[1024];
while ((byteread = in.read(buffer)) != -1) {
out.write(buffer, 0, byteread);
}
}
}
} catch(IOException ioe) {
System.out.println("Export failed: " + ioe.getMessage());
}
return;
}
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle("Save images to");
int returnVal = fc.showSaveDialog(fc);
if(returnVal == JFileChooser.APPROVE_OPTION) {
String exportPath = fc.getSelectedFile().getPath();
int byteread = 0;
InputStream in = null;
OutputStream out = null;
try {
for(TaggableImage image: importedImageList) {
if(image.getTag() == ImageTag.INFRINGEMENT) {
in = new FileInputStream(image.getSource());
out = new FileOutputStream(new File(exportPath + "/" + image.getFileName()));
byte[] buffer = new byte[1024];
while ((byteread = in.read(buffer)) != -1) {
out.write(buffer, 0, byteread);
}
}
}
} catch(IOException ioe) {
System.out.println("Export failed: " + ioe.getMessage());
}
}
}
else if (action.equals("Quit")) {
//quit popup
if(!warning) System.exit(0);
int n = JOptionPane.showConfirmDialog(
this,
"Would you like to exit now?",
"Quit",
JOptionPane.YES_NO_OPTION);
if(n == 0){System.exit(0);}
}
else if (action.equals("Flag Image")) {
//flag currently selected image
imageGrid.getSelectedImage().setTag(ImageTag.INFRINGEMENT);
imageGrid.repaint();
toggleFlagButton(false);
}
else if (action.equals("Unflag Image")) {
//unflag the selected image
imageGrid.getSelectedImage().setTag(ImageTag.UNTAGGED);
imageGrid.repaint();
toggleFlagButton(true);
}
else if (action.equals("Preferences")) {
//open preferences window
checkSetting();
new PreferenceDialog(this);
checkSetting();
}
else if (action.equals("Manual")) {
//manual features
}
else if (action.equals("About")) {
//about dialog
Object[] option = {"Close"};
JOptionPane pane = new JOptionPane("<html><font size = 5>WAI UAVTool</font></html>\nVersion 1.0\n<html><br>Developed by James McCann, James Watling, Sam Etheridge, Yan Dai, Yang Yu</html>\n" +
"<html><br>WAI UAVTool is an automatic image classification tool</html>\n\n" +
"Copyright (c) 2012 The Agrisoft Team\nLicense: GNU General Public License Version 2",
JOptionPane.INFORMATION_MESSAGE, JOptionPane.DEFAULT_OPTION, new ImageIcon("lib/about.jpg"), option);
JDialog dialog = pane.createDialog("About");
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
if(((String)pane.getValue() != null)) {
if(((String)pane.getValue()).equals("Close")) {
dialog.dispose();
}
}
}
else if (action.equals("Show Metadata")) {
JOptionPane.showMessageDialog(
null,
imageGrid!=null&&imageGrid.getSelectedImage()!=null&&imageGrid.getSelectedImage().getMetaData()!=null?
imageGrid.getSelectedImage().getMetaData():
"NO METADATA");
}
else if (action.equals("Previous Image")) {
imageGrid.browse("previous");
}
else if(action.equals("Next Image")) {
imageGrid.browse("next");
}
else if(action.equals("Auto Analyse")) {
BufferedImage processedImage = new ImageClassifier().findRiverImage(imageGrid.getSelectedImage().getSource().getPath());
imageGrid.getSelectedImage().setImage(processedImage);
imageGrid.update();
processedImage.flush();
}
else if(action.equals("Analyze All")) {
BufferedImage processedImage = null;
boolean first = true;
for(ImageThumbPanel itp: imageGrid.getPanels()) {
processedImage = new ImageClassifier().findRiverImage(itp.getImage().getSource().getPath());
itp.getImage().setImage(processedImage);
if(first) {
imageGrid.update();
first = false;
}
processedImage.flush();
}
}
else if (action.equals("PDF Report")){ //jm 081012
TaggableImage selectedImage = imageGrid.getSelectedImage();
if (selectedImage==null) {
JOptionPane.showMessageDialog(this, "Please select an Image to export!", "ERROR", JOptionPane.ERROR_MESSAGE);
return;
}
//get export location
String exportPath = "";
JFileChooser fc = new JFileChooser();
fc.setDialogTitle("Choose save location for PDF");
int returnVal = fc.showSaveDialog(fc);
if(returnVal == JFileChooser.APPROVE_OPTION) {
exportPath = fc.getSelectedFile().getPath();
}
String description = "";
description = JOptionPane.showInputDialog("Enter a short description of this image to append to the report");
ImagePdfExporter export = new ImagePdfExporter(exportPath, selectedImage, description);
}
}
public void windowOpened(WindowEvent e) {}
public void windowClosing(WindowEvent e) {
if(!warning) System.exit(0);
int n = JOptionPane.showConfirmDialog(
this,
"Would you like to exit now?",
"Quit",
JOptionPane.YES_NO_OPTION);
if(n == 0){System.exit(0);}
}
public void windowClosed(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public static List<TaggableImage> getImportedImageList() {
return importedImageList;
}
private void setImportedImageList(List<TaggableImage> importedImageList) {
ApplicationWindow.importedImageList = importedImageList;
}
public void mouseClicked(MouseEvent e) {
setButtonsEnabled(imageGrid.getSelectedImage()!=null);
String data = (imageGrid.getSelectedImage()!=null?imageGrid.getSelectedImage().getMetaData():"EMPTY");
System.out.println(data);
metaDataLabel.setText(data);
imageMetadataPanel.removeAll();
imageMetadataPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
imageMetadataPanel.setLayout(new BorderLayout());
imageMetadataPanel.setSize(IMAGE_METADATA_PANEL_SIZE);
metaDataLabel.setSize(2*IMAGE_METADATA_PANEL_SIZE.width/3,IMAGE_METADATA_PANEL_SIZE.height);
metaDataLabel.setVerticalAlignment(JLabel.TOP);
imageMetadataPanel.add(metaDataLabel, BorderLayout.WEST);
imageMetadataPanel.setBackground(null);
try {
String latitudeS = metaDataLabel.getText().split("GPS Latitude - ", 2)[1].split("</td>", 2)[0];
String longitudeS = metaDataLabel.getText().split("GPS Longitude - ")[1].split("</td>",2)[0];
Double latitudeNum1 = Double.parseDouble(latitudeS.split((char) 0x00B0+"", 2)[0]);
Double latitudeNum2 = Double.parseDouble(latitudeS.split((char) 0x00B0+"", 2)[1].split("' ", 2)[0]);
Double latitudeNum3 = Double.parseDouble(latitudeS.split("' ", 2)[1].split("\"", 2)[0]);
Double longitudeNum1 = Double.parseDouble(longitudeS.split((char) 0x00B0+"", 2)[0]);
Double longitudeNum2 = Double.parseDouble(longitudeS.split((char) 0x00B0+"", 2)[1].split("' ", 2)[0]);
Double longitudeNum3 = Double.parseDouble(longitudeS.split("' ", 2)[1].split("\"", 2)[0]);
Double latitude;
Double longitude;
if(latitudeNum1>=0)
latitude = latitudeNum1+latitudeNum2/60+latitudeNum3/3600;
else
latitude = latitudeNum1-latitudeNum2/60-latitudeNum3/3600;
if(longitudeNum1>=0)
longitude= longitudeNum1+longitudeNum2/60+longitudeNum3/3600;
else
longitude= longitudeNum1-longitudeNum2/60-longitudeNum3/3600;
URLConnection con = null;
if(useProxy)
con = new URL("http",proxyUrl,proxyPort,"http://maps.google.com/maps/api/staticmap?" +
"center=Wellington,NZ&zoom=5&size="
+IMAGE_METADATA_PANEL_SIZE.width/3+"x"+
IMAGE_METADATA_PANEL_SIZE.height+
"&maptype=roadmap&sensor=false&" +
"markers=||"+latitude+",%20"+longitude).openConnection();
InputStream is = con.getInputStream();
byte bytes[] = new byte[con.getContentLength()];
Toolkit tk = getToolkit();
BufferedImage map = ImageIO.read(is);
tk.prepareImage(map, -1, -1, null);
imageMetadataPanel.add(new JLabel(new ImageIcon(map)),BorderLayout.EAST);
}
catch (Exception e1) {
e1.printStackTrace();
JLabel errorLabel = new JLabel("<html><p>No Internet connection</p><p>Or no image metadata.</p></html>");
errorLabel.setVerticalAlignment(JLabel.TOP);
imageMetadataPanel.add(errorLabel,BorderLayout.EAST);
}
repaint();
}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void checkSetting() {
Scanner sc;
try {
sc = new Scanner(new File("settings.data"));
if(sc.next().equals("minimize=true")) { minimize = true;}
else minimize = false;
if(sc.next().equals("warning=true")) {warning = true;}
else warning = false;
if(sc.next().equals("proxy=true"))
useProxy=true;
else useProxy=false;
String a=sc.nextLine();
a=sc.nextLine();
System.out.println(a);
proxyUrl=a.split("=", 2)[1];
proxyPort=Integer.parseInt(sc.nextLine().split("=",2)[1]);
if(sc.next().equals("ask=true")) {
ask = true;
location = null;
} else {
ask = false;
location = sc.next();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
145d9fad8f33e8114151364cd03ea925149b4d5d | 4b5cb9f7027b99242c6bf3ce87582dc2d98a2e2a | /spring-mvc-excel-view/src/main/java/com/hmkcode/controllers/Controller.java | 1a5c76c5e75fd4b421d46a9b33a2b9ffbf9607fa | [] | no_license | yosef-girma/Spring-Framework | 3bf760bb6c531faa6fbe086840fb862c96f3dc6e | c13c5146f6211377b2d6fd33de91ae12036d48bd | refs/heads/master | 2023-04-21T09:55:14.444398 | 2021-02-27T17:29:58 | 2021-02-27T17:29:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package com.hmkcode.controllers;
import java.util.LinkedList;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.hmkcode.model.Link;
@RestController
public class Controller {
@RequestMapping(value = "/viewExcel", method = RequestMethod.GET)
public ModelAndView getExcel(){
System.out.println("getExcel!");
List<Link> links = new LinkedList<Link>();
links.add(new Link("Android", "android.com"));
links.add(new Link("Spring", "spring.io"));
links.add(new Link("Firebase", "firebase.com"));
return new ModelAndView("ExcelXlsxView", "model", links);
}
}
| [
"hmkcode@gmail.com"
] | hmkcode@gmail.com |
58b1d033218b378064b009cb2d65abd4b8c4e3b5 | 6603800930bd02c7fd06952797b5171e7591394c | /src/test/java/com/example/demo/TimeOutDemo.java | f30f6ef256214401ff74801139b62a309bda31ec | [] | no_license | umanking/spring-junit5-example | 1864583a8e947f712cd14dd877b4121972c86d4b | 7ebc2d4dc922a351723866528685690905c19fb0 | refs/heads/master | 2022-12-01T18:55:54.279316 | 2020-08-21T09:01:58 | 2020-08-21T09:01:58 | 286,653,632 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.example.demo;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import java.util.concurrent.TimeUnit;
/**
* @author Geonguk Han
* @since 2020-08-20
*/
public class TimeOutDemo {
@Test
@Timeout(value = 100, unit = TimeUnit.MILLISECONDS)
void failsIfExecutionTimeExceeds100Milliseconds() throws InterruptedException {
Thread.sleep(200);
}
}
| [
"umanking@gmail.com"
] | umanking@gmail.com |
8ff859fda29f4c1c8e5b79d28b7a0011f955b233 | 677adc691428180ebb1efce5979c5515ca479d55 | /src/main/java/graduate/noise/NoiseRemover.java | 95c60c8a06ba40d1679085425bdd4ee46bcdf118 | [] | no_license | choahbom/GraduateProject | 441b141bdc07021d6260acf705b63691084418f7 | 86685a76d3c982b6c4e6941ec2e66e3dd26836cd | refs/heads/master | 2021-01-24T08:29:07.430172 | 2016-09-28T13:34:57 | 2016-09-28T13:34:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package graduate.noise;
import java.io.IOException;
public interface NoiseRemover {
public boolean removeNoise(String noiseDictionary) throws IOException;
}
| [
"vangarang@naver.com"
] | vangarang@naver.com |
7c12262d6d0db8ee727d56db68fe8563741817ee | 47806ec8f74b23d4f0457e166f816196ef919b2d | /Where.java | e57360bc5b1973b5afc04bb5bf879b3c3b46d5a6 | [] | no_license | akapar2016/FundofDev | 221c0018419dfd14d9c3118c474d84d6875808b6 | b86de736deba46a9a1cb10021bda58116207cb42 | refs/heads/master | 2021-08-30T23:25:49.543687 | 2017-12-19T20:34:24 | 2017-12-19T20:34:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,117 | java | /*
* Author: Aayush Kapar, akapar@my.fit.edu
* Course: CSE 1002, Section 01, Fall 2017
* Project: Where
*/
//package where;
import java.util.ArrayDeque;
import java.util.Scanner;
public final class Where {
private Where () {}
private static final int ZERO = 0;
public static void main (final String[] args) {
final Scanner scanner = new Scanner(System.in);
final Integer nnn = scanner.nextInt();
final Integer kkk = scanner.nextInt();
final Integer qqq = scanner.nextInt();
final ArrayDeque<Integer> arr = new ArrayDeque<Integer>(nnn);
for (int count = ZERO; count < nnn; count++) {
arr.add(scanner.nextInt());
}
for (int count = ZERO; count < kkk; count++) {
final Integer temp = arr.getLast();
arr.removeLast();
arr.addFirst(temp);
}
final Integer[] arra = new Integer[nnn];
arr.toArray(arra);
for (int count = ZERO; count < qqq; count++) {
final int index = scanner.nextInt();
System.out.println(arra[index]);
}
}
}
| [
"aayushkapar@gmail.com"
] | aayushkapar@gmail.com |
39f7c4fb653d5dc7fb93c9fcb0d40b2c7d7fb19c | c32580b40de4c26aa4f74ed89c7f005c62e9d524 | /src/test/java/univ/cnu/lecture/gostop/GameTest.java | 996ddb921d1ba48bd15ddf116a3ae1f3b0e50274 | [] | no_license | tony-riot/gostop | 608fca7a95809f6c0e709b69762496e51e218c61 | 6b2f43efa1283020a360448668ee2db92551ae6e | refs/heads/master | 2021-01-20T00:33:40.307401 | 2017-04-23T08:49:20 | 2017-04-23T08:49:20 | 89,150,206 | 0 | 8 | null | null | null | null | UTF-8 | Java | false | false | 1,293 | java | package univ.cnu.lecture.gostop;
import org.junit.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
/**
* Created by tchi on 2017. 4. 23..
*/
public class GameTest {
private Game game;
@Test
public void testPutOneCardAndGainNothing() {
Player[] players = new Player[] { new Player(new Card[0]) };
Plate dontCarePlate = null;
game = new Game(players, dontCarePlate);
Player player = game.currentPlayer();
Card card = player.nextCard();
Card[] gains = game.putCard(card);
assertThat(gains.length, is(0));
}
@Test
public void testPutOneCardAndGainTwoCardForItsMatching() {
Card puttingCard = new Card();
Player gamingPlayer = new Player(new Card[] { puttingCard });
Player[] players = new Player[] { gamingPlayer };
Plate plate = new Plate(new Card[] { puttingCard });
game = new Game(players, plate);
Player player = game.currentPlayer();
Card card = player.nextCard();
Card[] gains = game.putCard(card);
assertThat(gains.length, is(2));
}
@Test
public void testPutOneCardAndGainFourCardForItsAllMatching() {
fail("Make it!");
}
}
| [
"tchi@riotgames.com"
] | tchi@riotgames.com |
67bb47818092124058be04a5d5d8ef398305463d | b30df1207a041fc6a01b9aef4151d0dcad1b9700 | /src/java/com/csgame/common/persistence/TreeDao.java | 39779f00e035a9ffec65aa825f3d56c85007de67 | [] | no_license | chenyi920711/csgame | 0ee36df72a47a7f6e20682db0afcd39626fe87fe | 7c9011f0913367e42d18a3260696d0305489e3dc | refs/heads/master | 2020-03-27T23:04:32.096992 | 2018-09-17T07:40:32 | 2018-09-17T07:40:32 | 147,287,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | /**
* Copyright © 2012-2016 <a href="https://github.com/xla/csgame">csgame</a> All rights reserved.
*/
package com.csgame.common.persistence;
import java.util.List;
/**
* DAO支持类实现
* @author xla
* @version 2014-05-16
* @param <T>
*/
public interface TreeDao<T extends TreeEntity<T>> extends CrudDao<T> {
/**
* 找到所有子节点
* @param entity
* @return
*/
public List<T> findByParentIdsLike(T entity);
/**
* 更新所有父节点字段
* @param entity
* @return
*/
public int updateParentIds(T entity);
} | [
"375548966@qq.com"
] | 375548966@qq.com |
b989d97eaf784ae4f9734317cae5d4dd3b77151c | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/tags/sca-1.1-assembly-conformance/kernel/api/fabric3-spi/src/main/java/org/fabric3/spi/host/Port.java | 0827d3ca82247a7939f8d79f1d1b0284e7033868 | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,499 | java | /*
* Fabric3
* Copyright (c) 2009-2011 Metaform Systems
*
* Fabric3 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version, with the
* following exception:
*
* Linking this software statically or dynamically with other
* modules is making a combined work based on this software.
* Thus, the terms and conditions of the GNU General Public
* License cover the whole combination.
*
* As a special exception, the copyright holders of this software
* give you permission to link this software with independent
* modules to produce an executable, regardless of the license
* terms of these independent modules, and to copy and distribute
* the resulting executable under terms of your choice, provided
* that you also meet, for each linked independent module, the
* terms and conditions of the license of that module. An
* independent module is a module which is not derived from or
* based on this software. If you modify this software, you may
* extend this exception to your version of the software, but
* you are not obligated to do so. If you do not wish to do so,
* delete this exception statement from your version.
*
* Fabric3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the
* GNU General Public License along with Fabric3.
* If not, see <http://www.gnu.org/licenses/>.
*
* ----------------------------------------------------
*
* Portions originally based on Apache Tuscany 2007
* licensed under the Apache 2.0 license.
*
*/
package org.fabric3.spi.host;
/**
* A reserved port on a runtime. After reserving a port, clients must release the port lock prior to binding a socket to the port using {@link
* #releaseLock()}.
*
* @version $Rev$ $Date$
*/
public interface Port {
/**
* Returns the port name.
*
* @return the port name
*/
String getName();
/**
* Returns the port number.
*
* @return the port number
*/
int getNumber();
/**
* Releases the port lock so that a socket may be bound to the port. This method may be called any number of times.
*/
void releaseLock();
}
| [
"jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf |
f0e602c736d75e5a9446308833ca213962aee5b2 | 40d2d7c165255cf817d091a8d0163825d836a488 | /src/main/java/com/imooc/project/service/ICustomerService.java | 83afd75c7323cb05eec2d63859079891153655f0 | [] | no_license | zhuangsen/authorityManagement | 499ec2f0253ec9e13d455c130b12d0d0d04599f6 | 746be983052ce0bac11b7092c1179779bae26e06 | refs/heads/master | 2023-02-23T15:23:13.266043 | 2021-01-30T10:54:08 | 2021-01-30T10:54:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package com.imooc.project.service;
import com.imooc.project.entity.Customer;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 客户表 服务类
* </p>
*
* @author zhf
* @since 2021-01-02
*/
public interface ICustomerService extends IMyService<Customer> {
}
| [
"zhanghf_123@sina.com"
] | zhanghf_123@sina.com |
5ea2280260fd49a8651f17e4f2be12fe7ffd67a5 | a165ba258bcd3ca5460b42c3c87813721e053507 | /ICarpark/app/src/main/java/com/example/icarpark/Profile.java | 9860da4cded84b9c8cba88f412b1000f3fafc794 | [] | no_license | HansGungadeen/AndroidStudioProjects | a734f199c19834fea2e4c59013a459d29912c886 | 3b7b82bd7d7aac5d5358592e2c68ae6cb85c211e | refs/heads/main | 2023-09-01T06:49:33.928380 | 2021-10-23T15:35:14 | 2021-10-23T15:35:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,191 | java | package com.example.icarpark;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class Profile extends AppCompatActivity
{
String UID;
String fname;
String lname;
String Eml;
String Lcn;
String Phn;
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_profile);
tv=(TextView)findViewById(R.id.tv);
UID = getIntent().getStringExtra("userID");
fname = getIntent().getStringExtra("FirstName");
lname = getIntent().getStringExtra("LastName");
Eml = getIntent().getStringExtra("Email");
Phn = getIntent().getStringExtra("Phone");
Lcn = getIntent().getStringExtra("LicenseNumber");
tv.setText("FirstName: " + "\n" +fname.substring(0, 1).toUpperCase() + fname.substring(1).toLowerCase() + "\n" + "Lastname: " + "\n" + lname.substring(0, 1).toUpperCase() + lname.substring(1).toLowerCase() + "\n" + "Email: " + "\n" + Eml + "\n" + "Phone Number: " + "\n" + Phn + "\n" + "License Number: " + "\n" + Lcn);
}
} | [
"hansgungadeen@gmail.com"
] | hansgungadeen@gmail.com |
599d87fe31a72d0c27ff72e884dc8f2c237acab2 | e8974cd0b517e45734af0a053258ca44f5498f9e | /UnionApp/src/org/service/utilityService/HttpClientUtil.java | f8ad6031c54f6de3652c70ad159ff289c636c86a | [] | no_license | youthix/unionapp | e009c79d62f5e09f6290cdb88494327f8559adeb | 8191635838eb1afa6f904821e779baeabbd691fd | refs/heads/master | 2020-12-01T19:17:41.953681 | 2017-04-17T08:52:55 | 2017-04-17T08:52:55 | 66,667,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,177 | java | package org.service.utilityService;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.common.UnionAppConstants;
public class HttpClientUtil {
// HTTP POST request
public int sendNotification() throws Exception {
String url = UnionAppConstants.fcmServerUrl;
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(url);
// add header
post.setHeader("Authorization", "key="+UnionAppConstants.fcmServerKey);
post.setHeader("Content-Type", "application/json");
StringEntity requestEntity = new StringEntity(
//"{\"data\":{\"score\":\"5x1\"},\"to\":\"eqNEPfDY-pU:APA91bHY7L2M_rBoCRGriP_Fhr6eFtf8ia4JCjYw3wPmVo4WBWhvjbNgBp2Jah8dLLueXLAp6FZtveuftQh_3yCdiSi8D434aqEBnPHGcZS5p0rueM2JppsC782yOGhgJVijLy8QNQzQ\"}",
//"{\"notification\":{\"apps\":{\"alert\":{\"body\" : \"Helllo\",\"title\" : \"Title\"}},\"badge\":\"1\",\"sound\":\"default\"},\"to\":\"eCP99TBwMQU:APA91bG1vwQfn7XhKodRe6HzrDRDq2daj006XPv1b6LyLGZYOsq3gnXQVM9QqG67CmTOgCbmCRXhVozlw8TDZVrScooIuNoA8srbwVXW5ZKluEhWhm9YPvrrAm2qKM7A4geGWbZgpGUf\"}",
//"{\"notification\":{\"title\":\"Hello\",\"text\":\"Hej du har en besked fra WFS Klubben\"},\"priority\":\"high\",\"to\":\"eCP99TBwMQU:APA91bG1vwQfn7XhKodRe6HzrDRDq2daj006XPv1b6LyLGZYOsq3gnXQVM9QqG67CmTOgCbmCRXhVozlw8TDZVrScooIuNoA8srbwVXW5ZKluEhWhm9YPvrrAm2qKM7A4geGWbZgpGUf\"}",
"{\"notification\":{\"title\":\""+UnionAppConstants.notificationTitle+"\",\"text\":\""+UnionAppConstants.notififcaitonMessage+"\",\"sound\":\"default\",\"badge\":\"1\"},\"priority\":\"high\",\"to\":\"/topics/union\"}",
//"{\"notification\":{\"title\":\"Hello\",\"text\":\"Hej du har en besked fra WFS Klubben\"},\"priority\":\"high\",\"to\":\"eqNEPfDY-pU:APA91bHY7L2M_rBoCRGriP_Fhr6eFtf8ia4JCjYw3wPmVo4WBWhvjbNgBp2Jah8dLLueXLAp6FZtveuftQh_3yCdiSi8D434aqEBnPHGcZS5p0rueM2JppsC782yOGhgJVijLy8QNQzQ\"}",
//"{\"data\":[\"aps\":{\"alert\":{\"body\" : \"Helllo\",\"title\" : \"Title\"},\"badge\":\"1\",\"sound\":\"default\"},\"to\":\"eCP99TBwMQU:APA91bG1vwQfn7XhKodRe6HzrDRDq2daj006XPv1b6LyLGZYOsq3gnXQVM9QqG67CmTOgCbmCRXhVozlw8TDZVrScooIuNoA8srbwVXW5ZKluEhWhm9YPvrrAm2qKM7A4geGWbZgpGUf\"]}",
ContentType.APPLICATION_JSON);
post.setEntity(requestEntity);
HttpResponse response = client.execute(post);
System.out.println("Post parameters : " + post.getEntity());
int responseCode=response.getStatusLine().getStatusCode();
System.out.println("Notification Response Code : " +responseCode
);
BufferedReader rd = new BufferedReader(
new InputStreamReader(response.getEntity().getContent()));
StringBuffer result = new StringBuffer();
String line = "";
while ((line = rd.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
return responseCode;
}
} | [
"saurabh.iips@gmail.com"
] | saurabh.iips@gmail.com |
e644a08fd2435ebac496ccd5927ac45c3c0ba0c7 | ed3bccd412e16b54d0fec06454408bc13c420e0d | /HTOAWork/src/com/ht/mapper/finance/FinanceFeedbackdetailMapper.java | 5292bf3c51d26bfc49a90af634c28e53e48359f8 | [] | no_license | Hholz/HTOAWork | 387978548874d1660c559b30b97b9570956b47dd | bacafc4e291e4e9f68bfded90bf3698c704c874c | refs/heads/master | 2021-01-12T05:23:07.621967 | 2017-01-03T12:44:51 | 2017-01-03T12:44:51 | 77,915,150 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 679 | java | package com.ht.mapper.finance;
import java.util.List;
import com.ht.popj.finance.FinanceFeedbackdetail;
public interface FinanceFeedbackdetailMapper {
int deleteByPrimaryKey(Integer id);
int insert(FinanceFeedbackdetail record);
int insertSelective(FinanceFeedbackdetail record);
FinanceFeedbackdetail selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(FinanceFeedbackdetail record);
int updateByPrimaryKey(FinanceFeedbackdetail record);
List<FinanceFeedbackdetail> selectAll();
List<FinanceFeedbackdetail> selectDynamic(FinanceFeedbackdetail record);
int countScoreByfeedbackId(int id);
} | [
"h_holz@qq.com"
] | h_holz@qq.com |
5f21d81f5e315e900d9ea6ab919798bb6447a314 | 47c9ce0e47476acc711f218b43c8bdc84981af8d | /src/net/charter/orion_pax/OasisExtras/OasisExtrasCommand.java | 96c2d75c684a0a7e9f296320a9d47e2c3b930466 | [] | no_license | Paxination/OasisExtras | 417ed3db062f9d993ffbb3d12a1b35e73a2a51df | ceed709f8c8ec39e8cd5577db97d3dea7c1265bf | refs/heads/master | 2016-09-06T00:33:09.992627 | 2013-06-08T02:42:18 | 2013-06-08T02:42:18 | 9,040,174 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,373 | java | package net.charter.orion_pax.OasisExtras;
import java.util.Arrays;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class OasisExtrasCommand implements CommandExecutor{
private OasisExtras plugin; // pointer to your main class, unrequired if you don't need methods from the main class
public OasisExtrasCommand(OasisExtras plugin){
this.plugin = plugin;
}
Entity vehicle;
Entity passenger;
enum Commands {
SLAP, FREEZE, DRUNK, SPOOK, ENABLEME, MOUNT, UNMOUNT,
DISABLEME, BROCAST, RANDOM, OASISEXTRAS, CHANT
}
enum SubCommands {
RELOAD, CANCEL, SAVEALL, BCAST, START, CONFIG, SET, CLEAR, LIST, ADD, REMOVE
}
String[] oasisextrassub = {
ChatColor.GOLD + "Usage: /oasisextras subcommand subcommand"
,ChatColor.GOLD + "SubCommands:"
,ChatColor.GOLD + "RELOAD - Reloads config"
,ChatColor.GOLD + "CANCEL SAVEALL/BCAST/CONFIG"
,ChatColor.GOLD + "START SAVEALL/BCAST/CONFIG"
,ChatColor.GOLD + "BCAST LIST/ADD/REMOVE"
,ChatColor.GOLD + "Do /oasisextras [subcommand] for more info"
};
String[] oasisextrassub2 = {
ChatColor.GOLD + "Usage as follows...."
,ChatColor.GOLD + "/oasisextras CANCEL BCAST - Cancels auto broadcast"
,ChatColor.GOLD + "/oasisextras CANCEL SAVEALL - Cancels auto saveall"
,ChatColor.GOLD + "/oasisextras CANCEL CONFIG - Cancels auto save config"
,ChatColor.GOLD + "/oasisextras START BCAST - Starts auto broadcast"
,ChatColor.GOLD + "/oasisextras START SAVEALL - Starts auto saveall"
,ChatColor.GOLD + "/oasisextras START CONFIG - Starts auto save config"
,ChatColor.GOLD + "/oasisextras BCAST LIST - List auto bcast msgs"
,ChatColor.GOLD + "/oasisextras BCAST ADD - Adds a msg to the auto bcast list"
,ChatColor.GOLD + "/oasisextras BCAST REMOVE - Removes a msg from the auto bcast list"
};
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
try {
Commands mycommand = Commands.valueOf(cmd.getName().toUpperCase());
Player player = null;
if (sender instanceof Player){
player = (Player) sender;
}
switch (mycommand) {
case CHANT:
if (args.length>0){
StringBuffer buffer = new StringBuffer();
buffer.append(args[0]);
for (int i = 1; i < args.length; i++) {
buffer.append(" ");
buffer.append(args[i]);
}
String message = buffer.toString();
plugin.getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('&', message));
return true;
} else {
sender.sendMessage(ChatColor.GOLD + "Usage: /CHANT msg");
return true;
}
case MOUNT:
if (args.length==1){
vehicle=Bukkit.getPlayer(args[0]);
passenger = (Entity) sender;
if ((vehicle!=null) && (sender instanceof Player)){
vehicle.setPassenger(passenger);
sender.sendMessage(ChatColor.GOLD + "You have mounted " + Bukkit.getPlayer(args[0]).getName());
if (!plugin.mounted.containsKey(sender.getName())){
plugin.mounted.put(sender.getName(),null);
}
plugin.mounted.get(Bukkit.getPlayer(args[0])).add(sender.getName());
return true;
}
} else if (args.length==2){
vehicle=Bukkit.getPlayer(args[1]);
passenger = Bukkit.getPlayer(args[0]);
if ((vehicle!=null) && (passenger!=null) && (sender instanceof Player)){
vehicle.setPassenger(passenger);
return true;
} else {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.GOLD + "Cant use on console!");
return true;
} else {
sender.sendMessage(ChatColor.GOLD + "Check your arguments!");
return true;
}
}
} else {
sender.sendMessage(ChatColor.GOLD + "Usage: /mount playername");
return true;
}
case UNMOUNT:
if (args.length==1) {
Player target = plugin.getServer().getPlayer(args[0]);
if (target.isInsideVehicle()) {
target.leaveVehicle();
return true;
}
return true;
} else {
if (player.isInsideVehicle()) {
player.leaveVehicle();
return true;
}
return true;
}
case OASISEXTRAS:
if (args.length==0){
sender.sendMessage(oasisextrassub);
return true;
}
SubCommands subcommand = SubCommands.valueOf(args[0].toUpperCase());
switch (subcommand){
case RELOAD:
plugin.getServer().getPluginManager().disablePlugin(plugin);
plugin.reloadConfig();
plugin.getServer().getPluginManager().enablePlugin(plugin);
plugin.setup();
sender.sendMessage(ChatColor.GOLD + "Config reloaded!");
return true;
case CANCEL:
if (args.length==1){
sender.sendMessage(oasisextrassub2);
return true;
}
SubCommands subcommand2 = SubCommands.valueOf(args[1].toUpperCase());
switch (subcommand2){
case BCAST:
plugin.task.bcasttask.cancel();
sender.sendMessage(ChatColor.GOLD + "Auto broadcast task is " + ChatColor.RED + "DISABLED!");
return true;
case SAVEALL:
plugin.task.savethisworld.cancel();
sender.sendMessage(ChatColor.GOLD + "Auto Save-All task is " + ChatColor.RED + "DISABLED!");
plugin.task.remindmetask.cancel();
return true;
case CONFIG:
plugin.task.savethistask.cancel();
sender.sendMessage(ChatColor.GOLD + "Auto save Config task is " + ChatColor.RED + "DISABLED!");
return true;
default:
sender.sendMessage(oasisextrassub2);
return true;
}
case START:
if (args.length==1){
sender.sendMessage(oasisextrassub2);
return true;
}
SubCommands subcommand3 = SubCommands.valueOf(args[1].toUpperCase());
switch (subcommand3){
case BCAST:
if (plugin.task.bcasttask==null){
plugin.task.bcasttask.runTaskTimer(plugin, plugin.extras.randomNum(0, 18000), plugin.bcasttimer);
sender.sendMessage(ChatColor.GOLD + "Auto broadcast task is " + ChatColor.GREEN + "ENABLED!");
}
return true;
case SAVEALL:
if (plugin.task.savethisworld==null){
plugin.task.savethisworld.runTaskTimer(plugin, plugin.savealltimer, plugin.savealltimer);
plugin.task.remindmetask.runTaskTimer(plugin, plugin.savealltimer-plugin.warningtime, plugin.savealltimer);
sender.sendMessage(ChatColor.GOLD + "Auto Save-All task is " + ChatColor.GREEN + "ENABLED!");
}
return true;
case CONFIG:
if (plugin.task.savethistask==null){
plugin.task.savethistask.runTaskTimer(plugin, 10, 12000);
sender.sendMessage(ChatColor.GOLD + "Auto save Config task is " + ChatColor.GREEN + "ENABLED!");
}
return true;
default:
sender.sendMessage(oasisextrassub2);
return true;
}
default:
sender.sendMessage(oasisextrassub2);
return true;
}
case RANDOM:
if (!(sender instanceof Player)) {
if (args.length==0) {
sender.sendMessage("This command cannot be used from the console.");
return true;
} else if (args.length==1){
Player rplayer = plugin.getServer().getPlayer(args[0]);
if (rplayer==null){
sender.sendMessage(ChatColor.RED + "Player not online!");
return true;
}
World rplayerworld=rplayer.getWorld();
rplayer.setNoDamageTicks(plugin.ndt);
rplayer.teleport(plugin.extras.getRandomLoc(null, plugin.default_min, plugin.default_max, rplayerworld));
rplayer.sendMessage(ChatColor.GOLD + "You have been randomly teleported!");
return true;
} else {
sender.sendMessage("Too many arguments!");
return true;
}
}
if (args.length == 0) {
World default_world = player.getWorld();
player.setNoDamageTicks(plugin.ndt);
player.teleport(plugin.extras.getRandomLoc(null, plugin.default_min, plugin.default_max, default_world));
player.sendMessage(ChatColor.GOLD+"You have been randomly teleported!");
return true;
} else if(args.length==1){
if (sender instanceof BlockCommandSender){
Player bcsplayer = plugin.getServer().getPlayer(args[0]);
World bcsplayerworld = bcsplayer.getWorld();
bcsplayer.setNoDamageTicks(plugin.ndt);
bcsplayer.teleport(plugin.extras.getRandomLoc(null, plugin.default_min, plugin.default_max, bcsplayerworld));
player.sendMessage(ChatColor.GOLD + "You have been randomly teleported!");
return true;
} else if(sender.hasPermission("oasischat.staff.a")){
Player bcsplayer = plugin.getServer().getPlayer(args[0]);
if (bcsplayer==null){
sender.sendMessage(ChatColor.RED + "That player is not online!");
return true;
}
if (!bcsplayer.isOp()) {
World bcsplayerworld = bcsplayer.getWorld();
bcsplayer.setNoDamageTicks(plugin.ndt);
bcsplayer.teleport(plugin.extras.getRandomLoc(null,
plugin.default_min, plugin.default_max,
bcsplayerworld));
bcsplayer.sendMessage(ChatColor.GOLD
+ "You have been randomly teleported!");
sender.sendMessage(ChatColor.GOLD + bcsplayer.getName()
+ " has been randomly teleported!");
return true;
} else {
sender.sendMessage(ChatColor.RED + "You cannot perform this command on that player!");
return true;
}
} else {
sender.sendMessage(ChatColor.GOLD + "Usage: /random");
return true;
}
} else {
sender.sendMessage("/random teleports you to a random location.");
return false;
}
case DRUNK:
if (args.length > 0) {
Player target = sender.getServer().getPlayer(args[0]);
if (target == null){
sender.sendMessage(ChatColor.RED + args[0] + ChatColor.GOLD + " is not online!");
return true;
}
int duration = 600;
if (args.length == 2) {
duration = Integer.parseInt(args[1]);
duration = duration*20;
}
target.getPlayer().addPotionEffect(
new PotionEffect(PotionEffectType.CONFUSION, duration,10));
sender.sendMessage(ChatColor.GOLD + target.getName() + " is now DRUNK!");
return true;
} else {
sender.sendMessage(ChatColor.RED + "Too few arguments!");
return false;
}
case FREEZE:
if (args.length > 0) {
if (sender.getServer().getPlayer(args[0]) != null) {
Player target = sender.getServer().getPlayer(args[0]);
if (target.hasPermission("OasisChat.staff.a")) {
sender.sendMessage("Can not freeze staff");
} else {
if (plugin.frozen.containsKey(target.getName())) {
plugin.frozen.remove(target.getName());
sender.sendMessage(ChatColor.RED + target.getName() + ChatColor.BLUE + " is now THAWED!");
target.sendMessage(ChatColor.GOLD + "You are now " + ChatColor.BLUE + "THAWED!");
plugin.removefrozen(target);
return true;
} else {
plugin.frozen.put(target.getName(),target.getLocation());
sender.sendMessage(ChatColor.RED + target.getName() + ChatColor.AQUA + " is now FROZEN!");
target.sendMessage(ChatColor.GOLD + "You are now " + ChatColor.AQUA + "FROZEN!");
plugin.savefrozen(target);
return true;
}
}
} else {
sender.sendMessage(ChatColor.GOLD + args[0] + " is not online!");
return true;
}
} else {
sender.sendMessage(ChatColor.RED + "Too few arguments!");
return false;
}
break;
case BROCAST:
if (args.length > 0) {
StringBuffer buffer = new StringBuffer();
buffer.append(args[0]);
for (int i = 1; i < args.length; i++) {
buffer.append(" ");
buffer.append(args[i]);
}
String message = buffer.toString();
plugin.getServer().broadcastMessage(
ChatColor.RED + "[" + ChatColor.DARK_RED + "Brocast" + ChatColor.RED + "] " + ChatColor.GOLD + ChatColor.translateAlternateColorCodes('&', message));
return true;
} else {
return false;
}
case SPOOK:
if (args.length > 0) {
Player target = sender.getServer().getPlayer(args[0]);
if (target == null){
sender.sendMessage(ChatColor.RED + args[0] + ChatColor.GOLD + " is not online!");
return false;
}
int soundtoplay = 0;
try {
Integer.parseInt(args[1]);
} catch(NumberFormatException e) {
sender.sendMessage(ChatColor.GOLD + args[1] + " is not an integer!");
return false;
}
if (args.length == 2) {
soundtoplay = Integer.parseInt(args[1]);
}
switch (soundtoplay) {
case 1:
target.playSound(target.getLocation(), Sound.GHAST_MOAN, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Ghast Moan on " + ChatColor.RED + target.getName());
return true;
case 2:
target.playSound(target.getLocation(), Sound.GHAST_SCREAM, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Ghast Scream 1 on " + ChatColor.RED + target.getName());
return true;
case 3:
target.playSound(target.getLocation(), Sound.GHAST_SCREAM2, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Ghast Scream 2 on " + ChatColor.RED + target.getName());
return true;
case 4:
target.playSound(target.getLocation(), Sound.CREEPER_HISS, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Creeper Hiss on " + ChatColor.RED + target.getName());
return true;
case 5:
target.playSound(target.getLocation(), Sound.ENDERDRAGON_GROWL, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Enderdragon Growl on " + ChatColor.RED + target.getName());
return true;
case 6:
target.playSound(target.getLocation(), Sound.ENDERMAN_SCREAM, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Enderman Scream on " + ChatColor.RED + target.getName());
return true;
case 7:
target.playSound(target.getLocation(), Sound.EXPLODE, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing TNT Explosion on " + ChatColor.RED + target.getName());
return true;
case 8:
target.playSound(target.getLocation(), Sound.WITHER_SPAWN, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Wither Spawn on " + ChatColor.RED + target.getName());
return true;
case 9:
target.playSound(target.getLocation(), Sound.ANVIL_LAND, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Anvil Land on " + ChatColor.RED + target.getName());
return true;
case 10:
target.playSound(target.getLocation(), Sound.ZOMBIE_PIG_ANGRY, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Angry Zombie Pigman on " + ChatColor.RED + target.getName());
return true;
default:
target.playSound(target.getLocation(), Sound.GHAST_MOAN, 1, 1);
sender.sendMessage(ChatColor.YELLOW + "Now Playing Ghast Moan on " + ChatColor.RED + target.getName());
return true;
}
} else {
sender.sendMessage(ChatColor.RED + "Too few arguments!");
return false;
}
case SLAP:
if (!(sender instanceof Player)){
plugin.getServer().broadcastMessage(ChatColor.RED + "CONSOLE has slapped " + args[0]);
}
if (args.length == 0){
return false;
}
if (args[0].equalsIgnoreCase("all")){
String msg;
if (args.length > 1){
StringBuffer buffer = new StringBuffer();
for (int i = 1; i < args.length; i++) {
buffer.append(" ");
buffer.append(args[i]);
}
msg = buffer.toString();
} else {
msg = "none";
}
Player[] onlinePlayers = Bukkit.getServer().getOnlinePlayers();
for (Player oplayer : onlinePlayers){
plugin.extras.slap(oplayer.getName(),sender,msg);
}
return true;
} else {
String msg;
if (args.length > 1){
StringBuffer buffer = new StringBuffer();
for (int i = 1; i < args.length; i++) {
buffer.append(" ");
buffer.append(args[i]);
}
msg = buffer.toString();
} else {
msg = "none";
}
plugin.extras.slap(args[0],sender,msg);
return true;
}
case ENABLEME:
if (args.length == 0) {
plugin.getServer().broadcastMessage(ChatColor.GOLD + sender.getName() + " is " + ChatColor.GREEN + "ENABLED!");
return true;
} else if (args.length == 1) {
plugin.getServer().broadcastMessage(ChatColor.GOLD + args[0] + " is " + ChatColor.GREEN + "ENABLED!");
return true;
}
return true;
case DISABLEME:
if (args.length == 0) {
plugin.getServer().broadcastMessage(ChatColor.GOLD + sender.getName() + " is " + ChatColor.RED + "DISABLED!");
return true;
} else if (args.length == 1) {
plugin.getServer().broadcastMessage(ChatColor.GOLD + args[0] + " is " + ChatColor.RED + "DISABLED!");
return true;
}
return true;
}
} catch (Throwable e) {
plugin.printStackTrace(e, sender.getName() + " - " + cmd.getName() + " " + Arrays.toString(args));
}
return false;
}
}
| [
"Orion Pax@HOME"
] | Orion Pax@HOME |
b1ad6d5124a58573a0a1e5547ab7ec21c9dbcfd2 | 54f2a3f9839611e58eecfd63199c340258a0e841 | /android/app/src/main/java/com/demo_3984/MainApplication.java | ee80e26557a2fa3473fbfca951cd576efd9e7888 | [] | no_license | crowdbotics-apps/demo-3984 | 430a60beac313a0fc0554f79c2809119219d30db | 668d975862e93803c39b040eb07a54f17849f9d6 | refs/heads/master | 2022-12-13T08:12:42.289947 | 2019-05-29T17:44:37 | 2019-05-29T17:44:37 | 189,272,106 | 0 | 0 | null | 2022-12-09T04:24:34 | 2019-05-29T17:44:22 | Python | UTF-8 | Java | false | false | 1,045 | java | package com.demo_3984;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
| [
"team@crowdbotics.com"
] | team@crowdbotics.com |
5b982a095874198970cff89a83cc2730fa3438e6 | 2221cc76af6d26b9dcc49c0722a4a577601692e3 | /Egbert/AlgorithmTesting/src/Facebook/ValidIPAddress.java | f46a9d5d5ee8ecd40dc8bec6fdf009b3398b3fe2 | [] | no_license | hanrick2000/A-Record-of-My-Problem-Solving-Journey | f8cca769ce08f0b1cd9ab36abcb4f7c8b91ba591 | 1b9326adcf61eacf0649bc4724b11d8259a79621 | refs/heads/master | 2022-02-24T03:09:54.644809 | 2019-09-24T18:32:53 | 2019-09-24T18:32:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,774 | java | package Facebook;
/**
* @leetcode https://leetcode.com/problems/validate-ip-address/
* @Time N
* @Space N
*/
public class ValidIPAddress {
public String validIPAddress(String ip) {
if (isValidIpv4(ip)) {
return "IPv4";
} else if (isValidIpv6(ip)) {
return "IPv6";
} else {
return "Neither";
}
}
private boolean isValidIpv4(String ip) {
if (ip.length() < 7) {
return false;
} else if (ip.startsWith(".") || ip.charAt(ip.length() - 1) == '.') {
return false;
}
String[] array = ip.split("\\.");
if (array.length != 4) {
return false;
}
for (String str : array) {
if (!isValidIpv4Token(str)) {
return false;
}
}
return true;
}
private boolean isValidIpv4Token(String token) {
if (token.startsWith("0") && token.length() > 1) {
return false;
}
try {
int digit = Integer.parseInt(token);
if (digit < 0 || digit > 255) {
return false;
} else if (digit == 0 && token.length() > 1) {
return false;
}
} catch(NumberFormatException nfe) {
return false;
}
return true;
}
private boolean isValidIpv6(String ip) {
if (ip.length() < 15) {
return false;
} else if (ip.startsWith(":") || ip.charAt(ip.length() - 1) == ':') {
return false;
}
String[] array = ip.split(":");
if (array.length != 8) {
return false;
}
for (String token : array) {
if (!isValidIpv6Token(token)) {
return false;
}
}
return true;
}
private boolean isValidIpv6Token(String token) {
if (token.length() == 0 || token.length() > 4) {
return false;
}
for (int i = 0; i < token.length(); i++) {
char ch = token.charAt(i);
boolean isDigit = (ch >= '0' && ch <= '9');
boolean isLowerCase = (ch >= 'a' && ch <= 'f');
boolean isUpperCase = (ch >= 'A' && ch <= 'F');
if (!(isDigit || isLowerCase || isUpperCase)) {
return false;
}
}
return true;
}
public static void main(String[] args) {
String input = "2001:db8:85a3:0::8a2E:0370:7334";
String[] array = input.split(":");
// System.out.println(array.length);
// System.out.println(':' >= 'a' && ':' <= 'f');
for (String str : array) {
System.out.println(str + " " + str.length());
}
}
}
| [
"egbert1121@gmail.com"
] | egbert1121@gmail.com |
8454bb395c8543f617777cf005e784e9dcba85a6 | 93c3a0cb212536eb971d9df13472f0291a3ce72a | /src/com/taobao/android/taonight/activity/StartActivity.java | 5506bf7eb109ac254dbd8589f3bd9a5fb99aac7c | [] | no_license | heartaway/friendbuy | f002bb5ee60d1e8281b610cebd2522cd9069c98f | a45a8b4d95aac9e88138bdd994d42df7710202e7 | refs/heads/master | 2020-04-01T16:28:18.060609 | 2013-11-07T16:07:34 | 2013-11-07T16:07:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,277 | java | package com.taobao.android.taonight.activity;
import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import com.taobao.android.taonight.R;
import com.taobao.android.taonight.httpclient.TBHttpClient;
import com.taobao.android.taonight.utility.Constant;
/**
* Created with IntelliJ IDEA.
* User: xinyuan.ymm
* Date: 13-1-11
* To change this template use File | Settings | File Templates.
*/
public class StartActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); //To change body of overridden methods use File | Settings | File Templates.
setContentView(R.layout.start);
runStart();
}
private void runStart() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
netConnect();
// Intent intent = new Intent(StartActivity.this,MenuActivity.class);
Intent intent = new Intent(StartActivity.this,LoginActivity.class);
StartActivity.this.startActivity(intent);
StartActivity.this.finish();
}
}, Constant.SPLASH_DISPLAY_TIME);
}
}
| [
"yanmingming1989@163.com"
] | yanmingming1989@163.com |
33c86010d050eb0f2a0260ca162ad9fcbff0537e | d003c272ffbadf6a70b3bbd096cff4b135ca6850 | /core/src/space/hypeo/mankomania/player/PlayerFactory.java | 406bf7036dfbfa9513876f608f430cbb5d68cde1 | [
"MIT"
] | permissive | MustafaZulic/Mankomania | 1d7481f2fb326612e9f2dcc4a05c376cec4cdfb0 | f809667cac032635fbe73724c2d8ecd1f65738b9 | refs/heads/master | 2020-03-21T13:55:49.351144 | 2018-06-24T20:54:08 | 2018-06-24T20:54:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,303 | java | package space.hypeo.mankomania.player;
import space.hypeo.networking.endpoint.EndpointFactory;
import space.hypeo.networking.endpoint.IEndpoint;
import space.hypeo.networking.player.PlayerNT;
/**
* This class is a factory to create instances of the different player in layer:
* - Business Layer
* - Network Layer
*/
public class PlayerFactory {
private final PlayerManager playerManager;
public static final int START_BALANCE = 1000000;
/**
* Create instance of PlayerFactory.
* @param playerManager
*/
public PlayerFactory(final PlayerManager playerManager) {
this.playerManager = playerManager;
}
/**
* Gets used PlayerManager.
* @return
*/
public PlayerManager getPlayerManager() {
return playerManager;
}
/**
* Creates instance of PlayerSkeleton.
* @param nick
* @return
*/
public PlayerSkeleton getPlayerSkeleton(String nick) {
return new PlayerSkeleton(nick);
}
/**
* Creates instance of PlayerNT.
* @return
*/
public PlayerNT getPlayerNT() {
EndpointFactory endpointFactory = new EndpointFactory(playerManager);
IEndpoint endpoint = endpointFactory.getEndpoint();
return new PlayerNT(playerManager, endpoint);
}
}
| [
"christian.motz@gmx.at"
] | christian.motz@gmx.at |
9c191601739b92382b5971f1739a57c8414f15e9 | f11e418cb8cddc861361e28e19830e36cc946120 | /app/src/main/java/com/xupz/manhuareade/adapter/DecompressPasswordAdapter.java | fb86937fde854045eac47202b5484210767aca5d | [] | no_license | AndroidPZ/ManHuaReader | 7c8a9f24e678d63c0f14addc41060ef148e2d8a0 | 782b709b9c994b70da53612ecb19c40f5b04fbb9 | refs/heads/master | 2023-03-21T22:12:45.443260 | 2021-03-12T10:49:38 | 2021-03-12T10:49:38 | 347,002,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,351 | java | package com.xupz.manhuareade.adapter;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.xupz.manhuareade.R;
import com.xupz.manhuareade.database.PasswordDbHelper;
import com.xupz.manhuareade.model.Password;
import com.xupz.manhuareade.ui.activity.BookCollectionActivity;
import com.xupz.manhuareade.ui.fragment.AddPasswordFragment;
import java.util.List;
/**
* Created by YuZhicong on 2017/5/4.
*/
public class DecompressPasswordAdapter extends RecyclerView.Adapter<DecompressPasswordAdapter.PasswordItem> {
private List<Password> list;
private Context mContext;
public DecompressPasswordAdapter(Context context){
mContext = context;
list = PasswordDbHelper.getPasswordDbHelper(context).queryPasswords();
}
@Override
public PasswordItem onCreateViewHolder(ViewGroup viewGroup, int i) {
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_password,null);
return new PasswordItem(itemView);
}
@Override
public void onBindViewHolder(PasswordItem passwordItem, int i) {
final Password psw = list.get(i);
passwordItem.tvSrcName.setText(psw.getSrcName());
passwordItem.tvPassword.setText(psw.getPassword());
passwordItem.tvIcon.setText(psw.getSrcName().substring(0,1));
passwordItem.ivDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder diaBuilder = new AlertDialog.Builder(mContext,R.style.Theme_AppCompat_Light_Dialog);
diaBuilder.setTitle(R.string.remove_password_title);
diaBuilder.setMessage(R.string.remove_password_message);
diaBuilder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
PasswordDbHelper.getPasswordDbHelper(mContext).delectePassword(psw);
DecompressPasswordAdapter.this.refreshPasswordsList();
//最好显示提示删除结果
}
});
diaBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
diaBuilder.create().show();
}
});
passwordItem.ivEdit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AddPasswordFragment editPasswordFragment = new AddPasswordFragment();
Bundle bundle = new Bundle();
bundle.putSerializable("passwordItem",psw);
editPasswordFragment.setArguments(bundle);
editPasswordFragment.show(((BookCollectionActivity)mContext).getSupportFragmentManager(),"Edit Decompress Password");
}
});
}
@Override
public int getItemCount() {
return list.size();
}
public static class PasswordItem extends RecyclerView.ViewHolder{
public TextView tvSrcName,tvPassword,tvIcon;
public ImageView ivEdit,ivDelete;
public PasswordItem(View itemView) {
super(itemView);
tvSrcName = (TextView) itemView.findViewById(R.id.tvSrcName);
tvPassword = (TextView) itemView.findViewById(R.id.tvPassword);
tvIcon = (TextView) itemView.findViewById(R.id.tvIcon);
ivEdit = (ImageView) itemView.findViewById(R.id.ivEdit);
ivDelete = (ImageView) itemView.findViewById(R.id.ivDelete);
}
}
public void refreshPasswordsList(){
list = PasswordDbHelper.getPasswordDbHelper(mContext).queryPasswords();
this.notifyDataSetChanged();
}
}
| [
"xupz@anmed.com.cn"
] | xupz@anmed.com.cn |
a1e99e52a48d264745fdb09fa0c6aa920f5caf74 | 6aeb723abec20f8bc55e01ffde3fec431d0fa07d | /src/main/java/cz/krakora/expensi/dto/ComplexInfoDto.java | 67acc15ff8ad7f57ee3c882ff92d14f234755900 | [] | no_license | vojtechkrakora/expensi | 0b4a6845975754782fdf6ff31fb11036de309bc0 | ba21d31c6aa0055f323431b1beeb8951ef144134 | refs/heads/master | 2021-07-09T17:08:53.373815 | 2019-12-24T20:19:05 | 2019-12-24T20:19:05 | 229,991,721 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | package cz.krakora.expensi.dto;
import lombok.Data;
@Data
public class ComplexInfoDto {
private double maxIncome;
private double avgIncome;
private double medianIncome;
private double maxOutcome;
private double avgOutcome;
private double medianOutcome;
}
| [
"v.krakora@gmail.com"
] | v.krakora@gmail.com |
9fc2539b3b438d60ef442c4d624d1f7545a12b5f | 956c2ed6164ffaadf7104a4ffb0cea5ba4052b1f | /com.dsdl.DSDL.ui/xtend-gen/com/dsdl/ui/labeling/DSDLDescriptionLabelProvider.java | 7691827f22fe455b68436fdf435b6f24a462bf23 | [] | no_license | azaky/dsdl | 7ed15ff4a7c3b4528b207aac4a4b10763d3869cd | 272761eb8cb5bb43532216f7ea124be7322268e0 | refs/heads/master | 2016-08-12T02:23:49.056447 | 2015-11-30T13:28:43 | 2015-11-30T13:28:43 | 47,118,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | /**
* generated by Xtext
*/
package com.dsdl.ui.labeling;
import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider;
/**
* Provides labels for IEObjectDescriptions and IResourceDescriptions.
*
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
*/
@SuppressWarnings("all")
public class DSDLDescriptionLabelProvider extends DefaultDescriptionLabelProvider {
}
| [
"a_zaky003@yahoo.com"
] | a_zaky003@yahoo.com |
a4d8f32beda145ebd40ce59b2c9587c4bb5178b5 | 51e70c3363c893ac5b496670106ab7150482f80d | /app/src/main/java/org/afgl/biblioapp/estanteria/ui/EstanteriaActivity.java | f27f53b4cb81fb33bdd2e8aef28c3c82cdf067d6 | [] | no_license | arturoFer/android-BiblioApp | fa3628dcf70b42c83f130a249935ed6263f86f3b | 4bd5be695c2bd3f2a9c9f0e33c6b99f36570ad96 | refs/heads/master | 2021-01-07T04:44:08.743879 | 2020-02-19T09:24:20 | 2020-02-19T09:24:20 | 241,581,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,324 | java | package org.afgl.biblioapp.estanteria.ui;
import android.content.Intent;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Handler;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import org.afgl.biblioapp.BiblioApp;
import org.afgl.biblioapp.R;
import org.afgl.biblioapp.about.AboutActivity;
import org.afgl.biblioapp.entities.Libro;
import org.afgl.biblioapp.estanteria.EstanteriaPresenter;
import org.afgl.biblioapp.estanteria.di.EstanteriaComponent;
import org.afgl.biblioapp.estanteria.ui.adapter.EstanteriaAdapter;
import org.afgl.biblioapp.estanteria.ui.adapter.OnItemClickListener;
import org.afgl.biblioapp.libro.ui.LibroActivity;
import org.afgl.biblioapp.libs.base.ImageLoader;
import java.util.List;
public class EstanteriaActivity extends AppCompatActivity implements EstanteriaView, OnItemClickListener {
private EstanteriaAdapter adapter;
private RecyclerView recyclerView;
private EstanteriaPresenter presenter;
private int nightMode;
private boolean created = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_estanteria);
recyclerView = findViewById(R.id.recyclerview);
nightMode = getNightMode();
setupToolbar();
setupInjection();
setupRecyclerView();
loadImageCollapsingToolBar();
}
private void setupToolbar(){
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
CollapsingToolbarLayout ctlLayout = findViewById(R.id.collapsingToolbar);
ctlLayout.setTitle(getResources().getString(R.string.menu_estanteria));
}
private void setupInjection() {
BiblioApp app = (BiblioApp) getApplication();
EstanteriaComponent component = app.getEstanteriaComponent(this, this, this);
presenter = component.getPresenter();
adapter = component.getAdapter();
}
private void setupRecyclerView() {
recyclerView.setLayoutManager(new GridLayoutManager(this, getResources().getInteger(R.integer.number_columns)));
recyclerView.setHasFixedSize(true);
recyclerView.setAdapter(adapter);
}
private void loadImageCollapsingToolBar(){
ImageView imageView = findViewById(R.id.estanteria_image);
ImageLoader loader = adapter.getImageLoader();
loader.load(imageView, R.drawable.estanteria);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_estanteria_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()){
case R.id.menu_about:
launchAbout();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void launchAbout(){
Intent intent = new Intent(this, AboutActivity.class);
startActivity(intent);
}
@Override
protected void onResume() {
super.onResume();
presenter.onResume();
if(!created) {
AssetManager assetManager = getAssets();
presenter.getListBooks(assetManager);
created = true;
}
int currentNightMode = getNightMode();
if(currentNightMode != nightMode){
nightMode = currentNightMode;
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
Handler handler = new Handler();
Runnable runnable = new Runnable() {
@Override
public void run() {
recreate();
}
};
handler.post(runnable);
} else{
recreate();
}
}
}
@Override
protected void onPause() {
presenter.onPause();
super.onPause();
}
@Override
protected void onDestroy() {
presenter.onDestroy();
super.onDestroy();
}
@Override
public void setBooks(List<Libro> libros) {
adapter.setBooks(libros);
}
@Override
public void showBook(Libro libro) {
Intent intent = new Intent(this, LibroActivity.class);
intent.putExtra(LibroActivity.PATH_EXTRA, libro.getLocation());
startActivity(intent);
}
@Override
public void showError(String error) {
String messageError = String.format(getString(R.string.estanteria_error_read), error);
Snackbar.make(findViewById(android.R.id.content), messageError, Snackbar.LENGTH_LONG).show();
}
@Override
public void OnItemClick(Libro libro) {
showBook(libro);
}
private int getNightMode(){
return AppCompatDelegate.getDefaultNightMode();
}
}
| [
"clubpinguino70@hotmail.com"
] | clubpinguino70@hotmail.com |
13d9f3fc4a7975a070b462c39b57791055b4241f | 779b5b6cf3a09851b27bcc59d1696581b7fa03d1 | /acepricot-sync/src/com/acepricot/finance/sync/Test.java | 6df3e1fedc0825a2f7e62e5041922f0e05015fe9 | [] | no_license | futre153/bb | b9709e920f48bb35346b5460b4fd8132f3fdc664 | 8256c3cb2ef0df844a12747172005a5e1d5f14c1 | refs/heads/master | 2020-04-05T23:11:32.651132 | 2016-09-23T12:25:43 | 2016-09-23T12:25:43 | 21,938,990 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.acepricot.finance.sync;
import java.io.IOException;
import java.util.InvalidPropertiesFormatException;
import javax.naming.NamingException;
public class Test {
@SuppressWarnings({ })
public static void main(String[] args) throws InvalidPropertiesFormatException, IOException, NamingException {
/*JSONMessage msg = new JSONMessage();
Gson gson = new Gson();
msg.setHeader("heartbeat");
double date = new Date().getTime();
msg.setBody(new Object[]{date, Calendar.getInstance()});
String json = gson.toJson(msg);
System.out.println(json);
JSONMessage msg2 = gson.fromJson(json, JSONMessage.class);
Object[] obj = msg2.getBody();
double l = (double) obj[0];
Map c = (Map) obj[1];
*/
}
}
| [
"futre@szm.sk"
] | futre@szm.sk |
86c5e6a0d60055640fd9ba22f1f3b51f40f38cea | 975e8cce8a7b49176166cc50c3891912e083d612 | /org.encog/src/org/encog/neural/data/PropertyData.java | 4cbec909398732f0c6f69ef70b9e61d1625d88ed | [] | no_license | EmmanuelSotelo/ProjectDow | 4dd28ba2e42bc8e37f4d177ab2ba6b2ade763d11 | 89019ca243df120ea10720161bd2bc2468d8768a | refs/heads/master | 2021-01-04T14:07:06.975335 | 2013-05-12T06:00:56 | 2013-05-12T06:00:56 | 10,009,882 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,562 | java | /*
* Encog Artificial Intelligence Framework v2.x
* Java Version
* http://www.heatonresearch.com/encog/
* http://code.google.com/p/encog-java/
*
* Copyright 2008-2009, Heaton Research Inc., and individual contributors.
* See the copyright.txt in the distribution for a full listing of
* individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.encog.neural.data;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.encog.EncogError;
import org.encog.persist.EncogPersistedObject;
import org.encog.persist.Persistor;
import org.encog.persist.persistors.PropertyDataPersistor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An Encog data object that can be used to hold property data. This is a
* collection of name-value pairs that can be saved in an Encog persisted file.
*
* @author jheaton
*
*/
public class PropertyData implements EncogPersistedObject {
/**
* The serial id.
*/
private static final long serialVersionUID = -7940416732740995199L;
/**
* The name.
*/
private String name;
/**
* The description.
*/
private String description;
/**
* The property data.
*/
private final Map<String, String> data = new HashMap<String, String>();
/**
* The logging object.
*/
@SuppressWarnings("unused")
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* Clone this object.
*
* @return A clonned version of this object.
*/
@Override
public Object clone() {
final PropertyData result = new PropertyData();
result.setName(getName());
result.setDescription(getDescription());
for (final String key : this.data.keySet()) {
result.set(key, get(key));
}
return result;
}
/**
* @return A persistor for the property data.
*/
public Persistor createPersistor() {
return new PropertyDataPersistor();
}
/**
* Get the specified property.
*
* @param name
* The property name.
* @return The property value.
*/
public String get(final String name) {
return this.data.get(name);
}
/**
* Get all of the property data as a map.
*
* @return The property data.
*/
public Map<String, String> getData() {
return this.data;
}
/**
* Get a property as a date.
*
* @param field
* The name of the field.
* @return The date value.
*/
public Date getDate(final String field) {
try {
final String str = get(field);
final DateFormat formatter = new SimpleDateFormat("MM/dd/yy");
final Date date = formatter.parse(str);
return date;
} catch (final ParseException e) {
throw new EncogError(e);
}
}
/**
* @return The description of this object.
*/
public String getDescription() {
return this.description;
}
/**
* Get a property as a double.
*
* @param field
* The name of the field.
* @return The double value.
*/
public double getDouble(final String field) {
final String str = get(field);
try {
return Double.parseDouble(str);
} catch (final NumberFormatException e) {
throw new EncogError(e);
}
}
/**
* Get a property as an integer.
*
* @param field
* The name of the field.
* @return The integer value.
*/
public int getInteger(final String field) {
final String str = get(field);
try {
return Integer.parseInt(str);
} catch (final NumberFormatException e) {
throw new EncogError(e);
}
}
/**
* @return The name of this object.
*/
public String getName() {
return this.name;
}
/**
* Determine of the specified property is defined.
*
* @param key
* The property to check.
* @return True if this property is defined.
*/
public boolean isDefined(final String key) {
return this.data.containsKey(key);
}
/**
* Remove the specified property.
*
* @param key
* The property to remove.
*/
public void remove(final String key) {
this.data.remove(key);
}
/**
* Set the specified property.
*
* @param name
* The name of the property.
* @param value
* The value to set the property to.
*/
public void set(final String name, final String value) {
this.data.put(name, value);
}
/**
* Set the description for this object.
*
* @param description
* The description of this property.
*/
public void setDescription(final String description) {
this.description = description;
}
/**
* Set the name of this property.
*
* @param name
* The name of this property.
*/
public void setName(final String name) {
this.name = name;
}
/**
* @return The number of properties defined.
*/
public int size() {
return this.data.size();
}
}
| [
"e"
] | e |
808aab536cdcf5e6f7d9581954c4a3c5eb44a24c | 5af90728110bf510e4955f33d96bcbbe63f5aa0a | /TestInHome-master/app/src/main/java/com/example/locationtutorial/MemoDbHelper.java | 2643c7f2720d66f5cd92032b3ab111b60780bf48 | [] | no_license | FeeGit/MiddleSave | 6ed2c963203df40934d71d205b29e8a5c66d9e85 | 011f7bfd0f723ecd59cf60c65400cfc096106f88 | refs/heads/master | 2023-05-27T12:39:43.149741 | 2021-06-11T02:33:14 | 2021-06-11T02:33:14 | 376,014,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,985 | java | package com.example.locationtutorial;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class MemoDbHelper extends SQLiteOpenHelper { //OpenHelper 를 기본적으로 상속받아 사용.
private static com.example.locationtutorial.MemoDbHelper sInstance;
//이 db version을 선언해준다. 사실 활용 할 일은 없었지만, 어떤식으로 이용되야 할 지는 감이 잡힌다.
//test를 하면서 table에 개수가 변하게 된 적이 있었다. 그때, 아무리 테스트를 해도 저장에서 오류가 발생했었는데,
//이때 해결은 app을 지우고 다시 설치하여 문제를 해결하였다.
//허나, 이때, version을 한단계 올려주고, 내부적인 문제를 해결하도록 하는 방법이 있지 않았을까 싶다.
private static final int DB_VERSION = 1; //db 버젼. 1번.
//db의 이름 선언
private static final String DB_NAME = "Memo.db"; //db 파일 이름.
//db에 담기는 형식을 결정해준다. 아래는 sql문법이라는데, 우선 활용할 부분만 찾아서 활용하였다.
private static final String SQL_CREATE_ENTRIES = //유지보수를 위하여 미리 상수로 제작.
String.format("CREATE TABLE %s (%s INTEGER PRIMARY KEY AUTOINCREMENT, %s TEXT, %s TEXT, %s TEXT)", //autoimpliment: 자동 증가.
MemoContract.MemoEntry.TABLE_NAME, //각 %s에 들어갈 항목들. 순서대로.
MemoContract.MemoEntry._ID,
MemoContract.MemoEntry.COLUMN_NAME_TITLE,
MemoContract.MemoEntry.COLUMN_NAME_LAT,
MemoContract.MemoEntry.COLUMN_NAME_LNG
);
//db에서 데이터를 불러올 때, MemoDbHelper dbHelper = MemoDbHelper.getInstance(this);
//와 같은 방법으로 데이터를 가져오게 된다.
public static com.example.locationtutorial.MemoDbHelper getInstance(Context context){
if (sInstance == null){
sInstance = new com.example.locationtutorial.MemoDbHelper(context);
}
return sInstance;
}
//db를 지우는 방식 구현
private static final String SQL_DELETE_ENTRIES =
"DROP TABLE IF EXISTS" + MemoContract.MemoEntry.TABLE_NAME;
public MemoDbHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
//처음 활용할 때, sql을 만들어준다.
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) { //최초의 db를 생성하는 부분. db를 사용하게 되면 호출.
sqLiteDatabase.execSQL(SQL_CREATE_ENTRIES); //sql문으로 테이블을 생성하는 코드 작성.
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
//이전 테이블과의 변경점을 처리.
sqLiteDatabase.execSQL(SQL_DELETE_ENTRIES);
}
}
| [
"jhc53533817@gmail.com"
] | jhc53533817@gmail.com |
e9d64ef77e58ef2295d995386eca60dc71889ca2 | caf3f5fbd745bb3c68b9bafebb2561be4d0c0e8e | /src/main/java/com/demo/service/impl/HistoryMovementService.java | 637747ef2bc22fd50c9ec4d74837d9608a679483 | [] | no_license | FenyaTlalaProjects/Velaphanda_v0.1 | e3ae31ba8a657917d78b06b973f761744744dc8b | e42daf4f3dd535815f8f3c3f2447c69d1270daa9 | refs/heads/master | 2018-10-16T23:25:23.796843 | 2018-09-28T15:28:24 | 2018-09-28T15:28:24 | 107,654,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,138 | java | package com.demo.service.impl;
import java.util.List;
import java.util.Set;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.demo.bean.HistoryBean;
import com.demo.bean.HistoryMovementBean;
import com.demo.dao.HistoryDaoInt;
import com.demo.dao.HistoryMovementDaoInt;
import com.demo.model.Device;
import com.demo.model.Employee;
import com.demo.model.History;
import com.demo.model.HistoryMovement;
import com.demo.model.TicketHistory;
import com.demo.service.HistoryMovementServiceInt;
import com.demo.service.HistoryServiceInt;
@Service("historyMovementService")
@Transactional
public class HistoryMovementService implements HistoryMovementServiceInt {
@Autowired
private HistoryMovementDaoInt historyMovementDAO;
private String retMessage = null;
public String saveHistoryMovement(HistoryMovementBean historyMovement) {
retMessage =historyMovementDAO.saveHistoryMovement(historyMovement);
return retMessage;
}
@Override
public List<HistoryMovement> getAllHistoryMovementByPartNumber() {
return historyMovementDAO.getAllHistoryMovementByPartNumber();
}
@Override
public List<HistoryMovement> getHistoryMovementByPartNumber(String partNumber){
return historyMovementDAO.getHistoryMovementByPartNumber(partNumber);
}
@Override
public List<HistoryMovement> getSiteStockHistoryMovementByPartNumber(String partNumber) {
return historyMovementDAO.getSiteStockHistoryMovementByPartNumber(partNumber);
}
@Override
public List<HistoryMovement> getAllSiteStockHistoryMovementByPartNumber() {
return historyMovementDAO.getAllSiteStockHistoryMovementByPartNumber();
}
@Override
public List<HistoryMovement> getBootStockHistoryMovementByPartNumber(String partNumber) {
return historyMovementDAO.getBootStockHistoryMovementByPartNumber(partNumber);
}
@Override
public List<HistoryMovement> getAllBootStockHistoryMovementByPartNumber() {
return historyMovementDAO.getAllBootStockHistoryMovementByPartNumber();
}
}
| [
"zpthile@gmail.com"
] | zpthile@gmail.com |
78729d7fb145b35efc72480208f8fa9460a2bd32 | eae0efa53cd2a6ae2d00e773349f7bf1d64d38e5 | /abi/src/main/java/org/chain3j/abi/datatypes/generated/Int32.java | 57dc83998d4f03e79f3d6e91a0273e821fffa3ed | [
"Apache-2.0"
] | permissive | DavidRicardoWilde/chain3j | 200f915e3bdab8a70c0f2ccdd17355f3bccc0645 | ad93b723ea7f6a22300300138ba119174879662d | refs/heads/master | 2020-04-06T22:17:33.281798 | 2018-11-06T03:47:00 | 2018-11-06T03:47:00 | 157,831,233 | 1 | 0 | Apache-2.0 | 2018-11-16T07:45:21 | 2018-11-16T07:45:21 | null | UTF-8 | Java | false | false | 598 | java | package org.chain3j.abi.datatypes.generated;
import java.math.BigInteger;
import org.chain3j.abi.datatypes.Int;
/**
* Auto generated code.
* <p><strong>Do not modifiy!</strong>
* <p>Please use org.chain3j.codegen.AbiTypesGenerator in the
* <a href="https://github.com/chain3j/chain3j/tree/master/codegen">codegen module</a> to update.
*/
public class Int32 extends Int {
public static final Int32 DEFAULT = new Int32(BigInteger.ZERO);
public Int32(BigInteger value) {
super(32, value);
}
public Int32(long value) {
this(BigInteger.valueOf(value));
}
}
| [
"zhengpeng.li@moac.io"
] | zhengpeng.li@moac.io |
b6cc8799f0dd4032ab6fdd602e564dadc5b57f0f | 37abe6b7783482eb74a16e9614b83460f1f66174 | /notice/src/main/java/com/seglino/jingyi/notice/dao/NoticeAttachDao.java | 4506d3c637e266fd02b571b11dd7f496f06995f7 | [] | no_license | zzhao86/jingyi | 4ffaca948845736a02843a7ec848656945c0d48f | 704ee3ecd86d7faaee48450461b3834c21dc9d11 | refs/heads/master | 2022-12-12T05:14:00.122636 | 2019-10-25T09:29:21 | 2019-10-25T09:29:21 | 192,390,965 | 1 | 1 | null | 2022-12-10T20:09:39 | 2019-06-17T17:32:58 | JavaScript | UTF-8 | Java | false | false | 481 | java | package com.seglino.jingyi.notice.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.seglino.jingyi.common.core.dao.BaseDao;
import com.seglino.jingyi.notice.dto.NoticeAttachDto;
import com.seglino.jingyi.notice.pojo.NoticeAttach;
@Mapper
public interface NoticeAttachDao extends BaseDao<NoticeAttach> {
/**
* 获取附件详情列表
* @param noticeId
* @return
*/
public List<NoticeAttachDto> listForFileDetail(String noticeId);
}
| [
"zzhao86@163.com"
] | zzhao86@163.com |
963e1c7f21547a2dc0bd104598702c1626a8e00d | db03c13ea039a45551e81d20b70e50e38ca681bf | /app/src/main/java/com/mhky/dianhuotong/shop/bean/CartBaseInfo.java | 67fba17dd994d7f2c61f3d9df729f022411f26c4 | [] | no_license | Ckeack66/DianHuoTongProject | 3f6e261c17efffea23f598515ae200d75c938ebe | d44e14e1c32feecff81a40077c43c66d2a0f3ace | refs/heads/master | 2020-03-31T16:54:43.230089 | 2018-10-19T11:00:25 | 2018-10-19T11:00:25 | 145,216,509 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 15,022 | java | package com.mhky.dianhuotong.shop.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by Administrator on 2018/5/5.
* 购物车商品实体类 II
*/
public class CartBaseInfo implements Serializable {
/**
* id : 17
* goodsItems : [{"goodsId":"23","title":"同仁堂 六味地黄丸(浓缩丸)120丸*12件","goodsNo":"lwdhw 123465","model":"200丸*1瓶/盒","manufacturer":"北京同仁堂科技发展股份有限公司制药厂","approvalNumber":"国药准字Z19993068","superviseCode":"国药准字Z19993068","type":"非处方药","barCode":"63497979798","picture":"http://116.255.155.156:9040/20180420\\GOODS\\15242143572658316.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143570312864.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143572654596.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143569844068.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143571567313.jpg","expiryDate":null,"skuDTO":{"id":5,"skuNo":"123456","batchNo":"123456","retailPrice":2045,"wholesalePrice":null,"stock":100,"batchNums":0,"enable":true,"salePropertyOptions":[{"name":"规格","value":"200G","url":""},{"name":"疗程","value":"2疗程","url":""}],"expirationDate":"2018-04-30 08:00:00"},"shopDTO":{"id":"1","shopName":"大鹏旗舰店","address":"济南槐荫区齐州路"},"shelves":true,"offShelves":false,"auditStatus":"APPROVED","expirationTime":null,"promotionDTO":null,"amount":24,"inPrice":49080,"checked":true,"enable":false},{"goodsId":"23","title":"同仁堂 六味地黄丸(浓缩丸)120丸*12件","goodsNo":"lwdhw 123465","model":"200丸*1瓶/盒","manufacturer":"北京同仁堂科技发展股份有限公司制药厂","approvalNumber":"国药准字Z19993068","superviseCode":"国药准字Z19993068","type":"非处方药","barCode":"63497979798","picture":"http://116.255.155.156:9040/20180420\\GOODS\\15242143572658316.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143570312864.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143572654596.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143569844068.jpg,http://116.255.155.156:9040/20180420\\GOODS\\15242143571567313.jpg","expiryDate":null,"skuDTO":{"id":4,"skuNo":"123456","batchNo":"123456","retailPrice":2045,"wholesalePrice":null,"stock":100,"batchNums":0,"enable":true,"salePropertyOptions":[{"name":"疗程","value":"1疗程","url":""},{"name":"规格","value":"400G","url":""}],"expirationDate":"2018-04-30 08:00:00"},"shopDTO":{"id":"1","shopName":"大鹏旗舰店","address":"济南槐荫区齐州路"},"shelves":true,"offShelves":false,"auditStatus":"APPROVED","expirationTime":null,"promotionDTO":null,"amount":10,"inPrice":20450,"checked":true,"enable":false}]
*/
private String id;
private List<GoodsItemsBean> goodsItems;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<GoodsItemsBean> getGoodsItems() {
return goodsItems;
}
public void setGoodsItems(List<GoodsItemsBean> goodsItems) {
this.goodsItems = goodsItems;
}
public static class GoodsItemsBean implements Serializable{
/**
* goodsId : 23
* title : 同仁堂 六味地黄丸(浓缩丸)120丸*12件
* goodsNo : lwdhw 123465
* model : 200丸*1瓶/盒
* manufacturer : 北京同仁堂科技发展股份有限公司制药厂
* approvalNumber : 国药准字Z19993068
* superviseCode : 国药准字Z19993068
* type : 非处方药
* barCode : 63497979798
* picture : http://116.255.155.156:9040/20180420\GOODS\15242143572658316.jpg,http://116.255.155.156:9040/20180420\GOODS\15242143570312864.jpg,http://116.255.155.156:9040/20180420\GOODS\15242143572654596.jpg,http://116.255.155.156:9040/20180420\GOODS\15242143569844068.jpg,http://116.255.155.156:9040/20180420\GOODS\15242143571567313.jpg
* expiryDate : null
* skuDTO : {"id":5,"skuNo":"123456","batchNo":"123456","retailPrice":2045,"wholesalePrice":null,"stock":100,"batchNums":0,"enable":true,"salePropertyOptions":[{"name":"规格","value":"200G","url":""},{"name":"疗程","value":"2疗程","url":""}],"expirationDate":"2018-04-30 08:00:00"}
* shopDTO : {"id":"1","shopName":"大鹏旗舰店","address":"济南槐荫区齐州路"}
* shelves : true
* offShelves : false
* auditStatus : APPROVED
* expirationTime : null
* promotionDTO : null
* amount : 24
* inPrice : 49080
* checked : true
* enable : false
*/
private String goodsId;
private String title;
private String goodsNo;
private String model;
private String manufacturer;
private String approvalNumber;
private String superviseCode;
private String type;
private String barCode;
private String picture;
private Object expiryDate;
private SkuDTOBean skuDTO;
private ShopDTOBean shopDTO;
private boolean shelves;
private boolean offShelves;
private String auditStatus;
// private Object expirationTime;
// private Object promotionDTO;
private int amount;
private int inPrice;
private boolean checked;
private boolean enable;
//运费实体类(自己添加,提交订单界面需使用)
private FrigthInfo frigthInfo;
public FrigthInfo getFrigthInfo() {
return frigthInfo;
}
public void setFrigthInfo(FrigthInfo frigthInfo) {
this.frigthInfo = frigthInfo;
}
public CouponInfo getCouponInfo() {
return couponInfo;
}
public void setCouponInfo(CouponInfo couponInfo) {
this.couponInfo = couponInfo;
}
private CouponInfo couponInfo;
public String getGoodsId() {
return goodsId;
}
public void setGoodsId(String goodsId) {
this.goodsId = goodsId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getGoodsNo() {
return goodsNo;
}
public void setGoodsNo(String goodsNo) {
this.goodsNo = goodsNo;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getApprovalNumber() {
return approvalNumber;
}
public void setApprovalNumber(String approvalNumber) {
this.approvalNumber = approvalNumber;
}
public String getSuperviseCode() {
return superviseCode;
}
public void setSuperviseCode(String superviseCode) {
this.superviseCode = superviseCode;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getBarCode() {
return barCode;
}
public void setBarCode(String barCode) {
this.barCode = barCode;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public Object getExpiryDate() {
return expiryDate;
}
public void setExpiryDate(Object expiryDate) {
this.expiryDate = expiryDate;
}
public SkuDTOBean getSkuDTO() {
return skuDTO;
}
public void setSkuDTO(SkuDTOBean skuDTO) {
this.skuDTO = skuDTO;
}
public ShopDTOBean getShopDTO() {
return shopDTO;
}
public void setShopDTO(ShopDTOBean shopDTO) {
this.shopDTO = shopDTO;
}
public boolean isShelves() {
return shelves;
}
public void setShelves(boolean shelves) {
this.shelves = shelves;
}
public boolean isOffShelves() {
return offShelves;
}
public void setOffShelves(boolean offShelves) {
this.offShelves = offShelves;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
// public Object getExpirationTime() {
// return expirationTime;
// }
//
// public void setExpirationTime(Object expirationTime) {
// this.expirationTime = expirationTime;
// }
//
// public Object getPromotionDTO() {
// return promotionDTO;
// }
//
// public void setPromotionDTO(Object promotionDTO) {
// this.promotionDTO = promotionDTO;
// }
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
public int getInPrice() {
return inPrice;
}
public void setInPrice(int inPrice) {
this.inPrice = inPrice;
}
public boolean isChecked() {
return checked;
}
public void setChecked(boolean checked) {
this.checked = checked;
}
public boolean isEnable() {
return enable;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public static class SkuDTOBean implements Serializable{
/**
* id : 5
* skuNo : 123456
* batchNo : 123456
* retailPrice : 2045
* wholesalePrice : null
* stock : 100
* batchNums : 0
* enable : true
* salePropertyOptions : [{"name":"规格","value":"200G","url":""},{"name":"疗程","value":"2疗程","url":""}]
* expirationDate : 2018-04-30 08:00:00
*/
private int id;
private String skuNo;
private String batchNo;
private int retailPrice;
private int wholesalePrice;
private int stock;
private int batchNums;
private boolean enable;
private String expirationDate;
private int retail;
private List<SalePropertyOptionsBean> salePropertyOptions;
public int isRetail() {
return retail;
}
public void setRetail(int retail) {
this.retail = retail;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSkuNo() {
return skuNo;
}
public void setSkuNo(String skuNo) {
this.skuNo = skuNo;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public int getRetailPrice() {
return retailPrice;
}
public void setRetailPrice(int retailPrice) {
this.retailPrice = retailPrice;
}
public int getWholesalePrice() {
return wholesalePrice;
}
public void setWholesalePrice(int wholesalePrice) {
this.wholesalePrice = wholesalePrice;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public int getBatchNums() {
return batchNums;
}
public void setBatchNums(int batchNums) {
this.batchNums = batchNums;
}
public boolean isEnable() {
return enable;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public String getExpirationDate() {
return expirationDate;
}
public void setExpirationDate(String expirationDate) {
this.expirationDate = expirationDate;
}
public List<SalePropertyOptionsBean> getSalePropertyOptions() {
return salePropertyOptions;
}
public void setSalePropertyOptions(List<SalePropertyOptionsBean> salePropertyOptions) {
this.salePropertyOptions = salePropertyOptions;
}
public static class SalePropertyOptionsBean implements Serializable{
/**
* name : 规格
* value : 200G
* url :
*/
private String name;
private String value;
private String url;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
}
public static class ShopDTOBean implements Serializable{
/**
* id : 1
* shopName : 大鹏旗舰店
* address : 济南槐荫区齐州路
*/
private String id;
private String shopName;
private String address;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
}
}
| [
"lizhetongliao@163.com"
] | lizhetongliao@163.com |
158dff27638b9a8fdd84d7b304f3e8f74d01fb65 | 09b1b29255b2b555a81853afe9cf528087398983 | /src/com/zhbitacm/admin/formbean/OrdinaryAdminForm.java | c1c47a1ce46ee60a3c80b967e30c5f059b2ef5f6 | [] | no_license | chenyueling/zhbitAcm | 68e653d95a28bee77c877b8fcbd9de019a5afd97 | c061e1fb89ebfc674ace817d272aed7ace229b13 | refs/heads/master | 2020-04-22T05:44:16.982902 | 2015-07-29T00:57:30 | 2015-07-29T00:57:30 | 39,865,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,201 | java | package com.zhbitacm.admin.formbean;
public class OrdinaryAdminForm {
private String id;
private String username;
private String password;
private String realname;
private String validataCode;
private String password2;
private String oldPassword;
//管理员类型
private String associationType;
private String searchTitle;
private String search;
private int page;
private int rows;
private String sort;
private String order;
public String getAssociationType() {
return associationType;
}
public void setAssociationType(String associationType) {
this.associationType = associationType;
}
public String getId() {
return id;
}
public void setId(String 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 getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getValidataCode() {
return validataCode;
}
public void setValidataCode(String validataCode) {
this.validataCode = validataCode;
}
public String getPassword2() {
return password2;
}
public void setPassword2(String password2) {
this.password2 = password2;
}
public String getOldPassword() {
return oldPassword;
}
public void setOldPassword(String oldPassword) {
this.oldPassword = oldPassword;
}
public String getSearchTitle() {
return searchTitle;
}
public void setSearchTitle(String searchTitle) {
this.searchTitle = searchTitle;
}
public String getSearch() {
return search;
}
public void setSearch(String search) {
this.search = search;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
}
| [
"chen_yueling@163.com"
] | chen_yueling@163.com |
f64e143cbb564e11c4575f40a49bfb74d8d5666b | 27171e5939eea40761257cfbd0fcf78435033433 | /src/Arrays/SubarraywithGivenSumPositive.java | 02d725003c4bb5ed2482eceed06899a97ccd4e34 | [
"Apache-2.0"
] | permissive | Shivamsharma009/Interview | c8512a97fa71981bb2ebf82e3831dc8dc8a9a3df | 4c0d223cb2dca7e7a4ae279a03d5578ed5bd9e12 | refs/heads/master | 2020-12-13T05:59:37.001832 | 2020-05-19T21:20:50 | 2020-05-19T21:20:50 | 234,330,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 875 | java | package Arrays;
public class SubarraywithGivenSumPositive {
public static void SubarraySum(int arr[],int size,int sum)
{
int curr_sum = arr[0],start =0,index;
for(index = 1; index <size;index++)
{
while(curr_sum > sum && start < index-1){
curr_sum = curr_sum - arr[start];
start++;
}
if(curr_sum == sum){
System.out.println("Sum found Between Indexes "+ start + "to " +(index-1));
break;
}
if(index < size)
{
curr_sum = curr_sum + arr[index];
}
}
}
//Driver Program
public static void main(String[] args){
int arr[] = new int[]{5,4,6,7,9,8,3,1,2};
int size = arr.length;
int sum = 21;
SubarraySum(arr,size,sum);
}
}
| [
"shivamsharma0501@gmail.com"
] | shivamsharma0501@gmail.com |
f85bfde15b332a185db4bd4ed2395f7c025edd87 | cec628def1aad94ccbefa814d2a0dbd51588e9bd | /web.project/src/org/netbeans/modules/web/project/classpath/DelagatingProjectClassPathModifierImpl.java | bdcd3d5a4abf078261a4638a504adf51aba041ce | [] | no_license | emilianbold/netbeans-releases | ad6e6e52a896212cb628d4522a4f8ae685d84d90 | 2fd6dc84c187e3c79a959b3ddb4da1a9703659c7 | refs/heads/master | 2021-01-12T04:58:24.877580 | 2017-10-17T14:38:27 | 2017-10-17T14:38:27 | 78,269,363 | 30 | 15 | null | 2020-10-13T08:36:08 | 2017-01-07T09:07:28 | null | UTF-8 | Java | false | false | 6,735 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2012 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Contributor(s):
*
* Portions Copyrighted 2012 Sun Microsystems, Inc.
*/
package org.netbeans.modules.web.project.classpath;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.netbeans.api.java.classpath.JavaClassPathConstants;
import org.netbeans.api.project.SourceGroup;
import org.netbeans.api.project.ant.AntArtifact;
import org.netbeans.api.project.libraries.Library;
import org.netbeans.modules.java.api.common.classpath.ClassPathModifier;
import org.netbeans.modules.java.api.common.classpath.ClassPathSupport;
import org.netbeans.spi.java.project.classpath.ProjectClassPathModifierImplementation;
/**
* In order to handle properly new COMPILE_ONLY classpath this class delegates
* handling of some classpath types to ClassPathModifier and handling of COMPILE_ONLY
* is delegated to WebProjectLibrariesModifierImpl.
*/
public class DelagatingProjectClassPathModifierImpl extends ProjectClassPathModifierImplementation {
private final ClassPathModifier cpMod;
private final WebProjectLibrariesModifierImpl compileOnlyClassPathSupport;
public DelagatingProjectClassPathModifierImpl(ClassPathModifier cpMod,
WebProjectLibrariesModifierImpl compileOnlyClassPathSupport) {
this.compileOnlyClassPathSupport = compileOnlyClassPathSupport;
this.cpMod = cpMod;
}
@Override
protected SourceGroup[] getExtensibleSourceGroups() {
return cpMod.getExtensibleSourceGroups();
}
@Override
protected String[] getExtensibleClassPathTypes(SourceGroup sourceGroup) {
List<String> res = new ArrayList<String>(Arrays.asList(cpMod.getExtensibleClassPathTypes(sourceGroup)));
res.add(JavaClassPathConstants.COMPILE_ONLY);
return res.toArray(new String[res.size()]);
}
@Override
protected boolean addLibraries(Library[] libraries, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.addCompileLibraries(libraries);
} else {
return cpMod.addLibraries(libraries, sourceGroup, type);
}
}
@Override
protected boolean removeLibraries(Library[] libraries, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.removeCompileLibraries(libraries);
} else {
return cpMod.removeLibraries(libraries, sourceGroup, type);
}
}
@Override
protected boolean addRoots(URL[] classPathRoots, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.addCompileRoots(classPathRoots);
} else {
return cpMod.addRoots(classPathRoots, sourceGroup, type);
}
}
@Override
protected boolean removeRoots(URL[] classPathRoots, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.removeCompileRoots(classPathRoots);
} else {
return cpMod.removeRoots(classPathRoots, sourceGroup, type);
}
}
@Override
protected boolean addAntArtifacts(AntArtifact[] artifacts, URI[] artifactElements, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.addCompileAntArtifacts(artifacts, artifactElements);
} else {
return cpMod.addAntArtifacts(artifacts, artifactElements, sourceGroup, type);
}
}
@Override
protected boolean removeAntArtifacts(AntArtifact[] artifacts, URI[] artifactElements, SourceGroup sourceGroup, String type) throws IOException, UnsupportedOperationException {
if (JavaClassPathConstants.COMPILE_ONLY.equals(type)) {
return compileOnlyClassPathSupport.removeCompileAntArtifacts(artifacts, artifactElements);
} else {
return cpMod.removeAntArtifacts(artifacts, artifactElements, sourceGroup, type);
}
}
public ClassPathSupport getClassPathSupport() {
return cpMod.getClassPathSupport();
}
// TODO: remove
public ClassPathModifier getClassPathModifier() {
return cpMod;
}
}
| [
"dkonecny@netbeans.org"
] | dkonecny@netbeans.org |
278c14d2f52e430202f3eb9e3e246cb70a2f0e57 | ccf8ab4e0679abd0b52c88a18fca96a72eb4f664 | /BankAccount.java | 708a2897b7669ee0b2025fc406fd14c0750b7302 | [] | no_license | sanimusamuhammad/JAVA-LAB04 | 3458148d7afa80ab406b5233bce3ae17f9bd7cb1 | fa89b4784ab68c4d91995dd259d68f53884d9c1a | refs/heads/master | 2020-05-19T15:30:17.650471 | 2019-05-05T22:01:59 | 2019-05-05T22:01:59 | 185,086,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | /**
* Lab04 Assignment2.
*
* @author (Sani Musa Muhammad u15/fns/csc/005)
* @version (a version number or a date)
*/
public class BankAccount
{
private int accountNumber;
private String customerName;
private double balance;
public BankAccount( int _accountNumber , String _customerName , double _balance){
accountNumber = _accountNumber;
customerName = _customerName;
balance = _balance;
}
public void deposit (double newDeposit){
balance = newDeposit + balance;
//return balance;
}
public void withdraw(double newWithdraw){
balance = balance -newWithdraw ;
//return balance;
}
public double getBalance(){
return balance;
}
}
| [
"48831155+Ndatsu25@users.noreply.github.com"
] | 48831155+Ndatsu25@users.noreply.github.com |
9edb5a04d341572ff53ca422d00223bf6356e64b | 4205d87cfb58967524ae60ef397315aff878dccb | /app/src/main/java/com/example/catalogmovie/config/ServerConfig.java | f5925f948ffa6bef5d4e797d5511a4ab86836d83 | [] | no_license | AndiYS/CatalogMovie | bedff459fee0ae2ac68223425825b95bc44f2269 | 4c7cfe88e38ba14721e742d607390757242a6f15 | refs/heads/master | 2023-06-03T10:45:38.937549 | 2021-06-10T14:38:17 | 2021-06-10T14:38:17 | 375,729,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 201 | java | package com.example.catalogmovie.config;
public class ServerConfig {
public static final String URL_BASE = "https://api.themoviedb.org/";
public static final String API_ENDPOINT = URL_BASE;
}
| [
"muhammadyusril128@gmail.com"
] | muhammadyusril128@gmail.com |
7e1d195d619ea56ee8d4ab67299188662e359d64 | a4178e5042f43f94344789794d1926c8bdba51c0 | /iwxxm2Converter/src/schemabindings/schemabindings21/org/isotc211/_2005/gmd/MDMetadataType.java | 64362a6c0ce04a483a0198d4fcd80152e1696f5b | [
"Apache-2.0"
] | permissive | moryakovdv/iwxxmConverter | c6fb73bc49765c4aeb7ee0153cca04e3e3846ab0 | 5c2b57e57c3038a9968b026c55e381eef0f34dad | refs/heads/master | 2023-07-20T06:58:00.317736 | 2023-07-05T10:10:10 | 2023-07-05T10:10:10 | 128,777,786 | 11 | 7 | Apache-2.0 | 2023-07-05T10:03:12 | 2018-04-09T13:38:59 | Java | UTF-8 | Java | false | false | 35,458 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.02.27 at 12:41:52 PM MSK
//
package schemabindings21.org.isotc211._2005.gmd;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import schemabindings21.org.isotc211._2005.gco.AbstractObjectType;
import schemabindings21.org.isotc211._2005.gco.CharacterStringPropertyType;
import schemabindings21.org.isotc211._2005.gco.DatePropertyType;
import schemabindings21.org.isotc211._2005.gco.ObjectReferencePropertyType;
/**
* Information about the metadata
*
* <p>Java class for MD_Metadata_Type complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MD_Metadata_Type">
* <complexContent>
* <extension base="{http://www.isotc211.org/2005/gco}AbstractObject_Type">
* <sequence>
* <element name="fileIdentifier" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="language" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="characterSet" type="{http://www.isotc211.org/2005/gmd}MD_CharacterSetCode_PropertyType" minOccurs="0"/>
* <element name="parentIdentifier" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="hierarchyLevel" type="{http://www.isotc211.org/2005/gmd}MD_ScopeCode_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="hierarchyLevelName" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="contact" type="{http://www.isotc211.org/2005/gmd}CI_ResponsibleParty_PropertyType" maxOccurs="unbounded"/>
* <element name="dateStamp" type="{http://www.isotc211.org/2005/gco}Date_PropertyType"/>
* <element name="metadataStandardName" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="metadataStandardVersion" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="dataSetURI" type="{http://www.isotc211.org/2005/gco}CharacterString_PropertyType" minOccurs="0"/>
* <element name="locale" type="{http://www.isotc211.org/2005/gmd}PT_Locale_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="spatialRepresentationInfo" type="{http://www.isotc211.org/2005/gmd}MD_SpatialRepresentation_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="referenceSystemInfo" type="{http://www.isotc211.org/2005/gmd}MD_ReferenceSystem_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="metadataExtensionInfo" type="{http://www.isotc211.org/2005/gmd}MD_MetadataExtensionInformation_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="identificationInfo" type="{http://www.isotc211.org/2005/gmd}MD_Identification_PropertyType" maxOccurs="unbounded"/>
* <element name="contentInfo" type="{http://www.isotc211.org/2005/gmd}MD_ContentInformation_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="distributionInfo" type="{http://www.isotc211.org/2005/gmd}MD_Distribution_PropertyType" minOccurs="0"/>
* <element name="dataQualityInfo" type="{http://www.isotc211.org/2005/gmd}DQ_DataQuality_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="portrayalCatalogueInfo" type="{http://www.isotc211.org/2005/gmd}MD_PortrayalCatalogueReference_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="metadataConstraints" type="{http://www.isotc211.org/2005/gmd}MD_Constraints_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="applicationSchemaInfo" type="{http://www.isotc211.org/2005/gmd}MD_ApplicationSchemaInformation_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="metadataMaintenance" type="{http://www.isotc211.org/2005/gmd}MD_MaintenanceInformation_PropertyType" minOccurs="0"/>
* <element name="series" type="{http://www.isotc211.org/2005/gmd}DS_Aggregate_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="describes" type="{http://www.isotc211.org/2005/gmd}DS_DataSet_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="propertyType" type="{http://www.isotc211.org/2005/gco}ObjectReference_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="featureType" type="{http://www.isotc211.org/2005/gco}ObjectReference_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="featureAttribute" type="{http://www.isotc211.org/2005/gco}ObjectReference_PropertyType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MD_Metadata_Type", propOrder = {
"fileIdentifier",
"language",
"characterSet",
"parentIdentifier",
"hierarchyLevel",
"hierarchyLevelName",
"contact",
"dateStamp",
"metadataStandardName",
"metadataStandardVersion",
"dataSetURI",
"locale",
"spatialRepresentationInfo",
"referenceSystemInfo",
"metadataExtensionInfo",
"identificationInfo",
"contentInfo",
"distributionInfo",
"dataQualityInfo",
"portrayalCatalogueInfo",
"metadataConstraints",
"applicationSchemaInfo",
"metadataMaintenance",
"series",
"describes",
"propertyType",
"featureType",
"featureAttribute"
})
public class MDMetadataType
extends AbstractObjectType
{
protected CharacterStringPropertyType fileIdentifier;
protected CharacterStringPropertyType language;
protected MDCharacterSetCodePropertyType characterSet;
protected CharacterStringPropertyType parentIdentifier;
protected List<MDScopeCodePropertyType> hierarchyLevel;
protected List<CharacterStringPropertyType> hierarchyLevelName;
@XmlElement(required = true)
protected List<CIResponsiblePartyPropertyType> contact;
@XmlElement(required = true)
protected DatePropertyType dateStamp;
protected CharacterStringPropertyType metadataStandardName;
protected CharacterStringPropertyType metadataStandardVersion;
protected CharacterStringPropertyType dataSetURI;
protected List<PTLocalePropertyType> locale;
protected List<MDSpatialRepresentationPropertyType> spatialRepresentationInfo;
protected List<MDReferenceSystemPropertyType> referenceSystemInfo;
protected List<MDMetadataExtensionInformationPropertyType> metadataExtensionInfo;
@XmlElement(required = true)
protected List<MDIdentificationPropertyType> identificationInfo;
protected List<MDContentInformationPropertyType> contentInfo;
protected MDDistributionPropertyType distributionInfo;
protected List<DQDataQualityPropertyType> dataQualityInfo;
protected List<MDPortrayalCatalogueReferencePropertyType> portrayalCatalogueInfo;
protected List<MDConstraintsPropertyType> metadataConstraints;
protected List<MDApplicationSchemaInformationPropertyType> applicationSchemaInfo;
protected MDMaintenanceInformationPropertyType metadataMaintenance;
protected List<DSAggregatePropertyType> series;
protected List<DSDataSetPropertyType> describes;
protected List<ObjectReferencePropertyType> propertyType;
protected List<ObjectReferencePropertyType> featureType;
protected List<ObjectReferencePropertyType> featureAttribute;
/**
* Gets the value of the fileIdentifier property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getFileIdentifier() {
return fileIdentifier;
}
/**
* Sets the value of the fileIdentifier property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setFileIdentifier(CharacterStringPropertyType value) {
this.fileIdentifier = value;
}
public boolean isSetFileIdentifier() {
return (this.fileIdentifier!= null);
}
/**
* Gets the value of the language property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getLanguage() {
return language;
}
/**
* Sets the value of the language property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setLanguage(CharacterStringPropertyType value) {
this.language = value;
}
public boolean isSetLanguage() {
return (this.language!= null);
}
/**
* Gets the value of the characterSet property.
*
* @return
* possible object is
* {@link MDCharacterSetCodePropertyType }
*
*/
public MDCharacterSetCodePropertyType getCharacterSet() {
return characterSet;
}
/**
* Sets the value of the characterSet property.
*
* @param value
* allowed object is
* {@link MDCharacterSetCodePropertyType }
*
*/
public void setCharacterSet(MDCharacterSetCodePropertyType value) {
this.characterSet = value;
}
public boolean isSetCharacterSet() {
return (this.characterSet!= null);
}
/**
* Gets the value of the parentIdentifier property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getParentIdentifier() {
return parentIdentifier;
}
/**
* Sets the value of the parentIdentifier property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setParentIdentifier(CharacterStringPropertyType value) {
this.parentIdentifier = value;
}
public boolean isSetParentIdentifier() {
return (this.parentIdentifier!= null);
}
/**
* Gets the value of the hierarchyLevel property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the hierarchyLevel property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHierarchyLevel().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDScopeCodePropertyType }
*
*
*/
public List<MDScopeCodePropertyType> getHierarchyLevel() {
if (hierarchyLevel == null) {
hierarchyLevel = new ArrayList<MDScopeCodePropertyType>();
}
return this.hierarchyLevel;
}
public boolean isSetHierarchyLevel() {
return ((this.hierarchyLevel!= null)&&(!this.hierarchyLevel.isEmpty()));
}
public void unsetHierarchyLevel() {
this.hierarchyLevel = null;
}
/**
* Gets the value of the hierarchyLevelName property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the hierarchyLevelName property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getHierarchyLevelName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CharacterStringPropertyType }
*
*
*/
public List<CharacterStringPropertyType> getHierarchyLevelName() {
if (hierarchyLevelName == null) {
hierarchyLevelName = new ArrayList<CharacterStringPropertyType>();
}
return this.hierarchyLevelName;
}
public boolean isSetHierarchyLevelName() {
return ((this.hierarchyLevelName!= null)&&(!this.hierarchyLevelName.isEmpty()));
}
public void unsetHierarchyLevelName() {
this.hierarchyLevelName = null;
}
/**
* Gets the value of the contact property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the contact property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContact().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CIResponsiblePartyPropertyType }
*
*
*/
public List<CIResponsiblePartyPropertyType> getContact() {
if (contact == null) {
contact = new ArrayList<CIResponsiblePartyPropertyType>();
}
return this.contact;
}
public boolean isSetContact() {
return ((this.contact!= null)&&(!this.contact.isEmpty()));
}
public void unsetContact() {
this.contact = null;
}
/**
* Gets the value of the dateStamp property.
*
* @return
* possible object is
* {@link DatePropertyType }
*
*/
public DatePropertyType getDateStamp() {
return dateStamp;
}
/**
* Sets the value of the dateStamp property.
*
* @param value
* allowed object is
* {@link DatePropertyType }
*
*/
public void setDateStamp(DatePropertyType value) {
this.dateStamp = value;
}
public boolean isSetDateStamp() {
return (this.dateStamp!= null);
}
/**
* Gets the value of the metadataStandardName property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getMetadataStandardName() {
return metadataStandardName;
}
/**
* Sets the value of the metadataStandardName property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setMetadataStandardName(CharacterStringPropertyType value) {
this.metadataStandardName = value;
}
public boolean isSetMetadataStandardName() {
return (this.metadataStandardName!= null);
}
/**
* Gets the value of the metadataStandardVersion property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getMetadataStandardVersion() {
return metadataStandardVersion;
}
/**
* Sets the value of the metadataStandardVersion property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setMetadataStandardVersion(CharacterStringPropertyType value) {
this.metadataStandardVersion = value;
}
public boolean isSetMetadataStandardVersion() {
return (this.metadataStandardVersion!= null);
}
/**
* Gets the value of the dataSetURI property.
*
* @return
* possible object is
* {@link CharacterStringPropertyType }
*
*/
public CharacterStringPropertyType getDataSetURI() {
return dataSetURI;
}
/**
* Sets the value of the dataSetURI property.
*
* @param value
* allowed object is
* {@link CharacterStringPropertyType }
*
*/
public void setDataSetURI(CharacterStringPropertyType value) {
this.dataSetURI = value;
}
public boolean isSetDataSetURI() {
return (this.dataSetURI!= null);
}
/**
* Gets the value of the locale property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the locale property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getLocale().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link PTLocalePropertyType }
*
*
*/
public List<PTLocalePropertyType> getLocale() {
if (locale == null) {
locale = new ArrayList<PTLocalePropertyType>();
}
return this.locale;
}
public boolean isSetLocale() {
return ((this.locale!= null)&&(!this.locale.isEmpty()));
}
public void unsetLocale() {
this.locale = null;
}
/**
* Gets the value of the spatialRepresentationInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the spatialRepresentationInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSpatialRepresentationInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDSpatialRepresentationPropertyType }
*
*
*/
public List<MDSpatialRepresentationPropertyType> getSpatialRepresentationInfo() {
if (spatialRepresentationInfo == null) {
spatialRepresentationInfo = new ArrayList<MDSpatialRepresentationPropertyType>();
}
return this.spatialRepresentationInfo;
}
public boolean isSetSpatialRepresentationInfo() {
return ((this.spatialRepresentationInfo!= null)&&(!this.spatialRepresentationInfo.isEmpty()));
}
public void unsetSpatialRepresentationInfo() {
this.spatialRepresentationInfo = null;
}
/**
* Gets the value of the referenceSystemInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the referenceSystemInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReferenceSystemInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDReferenceSystemPropertyType }
*
*
*/
public List<MDReferenceSystemPropertyType> getReferenceSystemInfo() {
if (referenceSystemInfo == null) {
referenceSystemInfo = new ArrayList<MDReferenceSystemPropertyType>();
}
return this.referenceSystemInfo;
}
public boolean isSetReferenceSystemInfo() {
return ((this.referenceSystemInfo!= null)&&(!this.referenceSystemInfo.isEmpty()));
}
public void unsetReferenceSystemInfo() {
this.referenceSystemInfo = null;
}
/**
* Gets the value of the metadataExtensionInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the metadataExtensionInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getMetadataExtensionInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDMetadataExtensionInformationPropertyType }
*
*
*/
public List<MDMetadataExtensionInformationPropertyType> getMetadataExtensionInfo() {
if (metadataExtensionInfo == null) {
metadataExtensionInfo = new ArrayList<MDMetadataExtensionInformationPropertyType>();
}
return this.metadataExtensionInfo;
}
public boolean isSetMetadataExtensionInfo() {
return ((this.metadataExtensionInfo!= null)&&(!this.metadataExtensionInfo.isEmpty()));
}
public void unsetMetadataExtensionInfo() {
this.metadataExtensionInfo = null;
}
/**
* Gets the value of the identificationInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the identificationInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getIdentificationInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDIdentificationPropertyType }
*
*
*/
public List<MDIdentificationPropertyType> getIdentificationInfo() {
if (identificationInfo == null) {
identificationInfo = new ArrayList<MDIdentificationPropertyType>();
}
return this.identificationInfo;
}
public boolean isSetIdentificationInfo() {
return ((this.identificationInfo!= null)&&(!this.identificationInfo.isEmpty()));
}
public void unsetIdentificationInfo() {
this.identificationInfo = null;
}
/**
* Gets the value of the contentInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the contentInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContentInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDContentInformationPropertyType }
*
*
*/
public List<MDContentInformationPropertyType> getContentInfo() {
if (contentInfo == null) {
contentInfo = new ArrayList<MDContentInformationPropertyType>();
}
return this.contentInfo;
}
public boolean isSetContentInfo() {
return ((this.contentInfo!= null)&&(!this.contentInfo.isEmpty()));
}
public void unsetContentInfo() {
this.contentInfo = null;
}
/**
* Gets the value of the distributionInfo property.
*
* @return
* possible object is
* {@link MDDistributionPropertyType }
*
*/
public MDDistributionPropertyType getDistributionInfo() {
return distributionInfo;
}
/**
* Sets the value of the distributionInfo property.
*
* @param value
* allowed object is
* {@link MDDistributionPropertyType }
*
*/
public void setDistributionInfo(MDDistributionPropertyType value) {
this.distributionInfo = value;
}
public boolean isSetDistributionInfo() {
return (this.distributionInfo!= null);
}
/**
* Gets the value of the dataQualityInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dataQualityInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDataQualityInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DQDataQualityPropertyType }
*
*
*/
public List<DQDataQualityPropertyType> getDataQualityInfo() {
if (dataQualityInfo == null) {
dataQualityInfo = new ArrayList<DQDataQualityPropertyType>();
}
return this.dataQualityInfo;
}
public boolean isSetDataQualityInfo() {
return ((this.dataQualityInfo!= null)&&(!this.dataQualityInfo.isEmpty()));
}
public void unsetDataQualityInfo() {
this.dataQualityInfo = null;
}
/**
* Gets the value of the portrayalCatalogueInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the portrayalCatalogueInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPortrayalCatalogueInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDPortrayalCatalogueReferencePropertyType }
*
*
*/
public List<MDPortrayalCatalogueReferencePropertyType> getPortrayalCatalogueInfo() {
if (portrayalCatalogueInfo == null) {
portrayalCatalogueInfo = new ArrayList<MDPortrayalCatalogueReferencePropertyType>();
}
return this.portrayalCatalogueInfo;
}
public boolean isSetPortrayalCatalogueInfo() {
return ((this.portrayalCatalogueInfo!= null)&&(!this.portrayalCatalogueInfo.isEmpty()));
}
public void unsetPortrayalCatalogueInfo() {
this.portrayalCatalogueInfo = null;
}
/**
* Gets the value of the metadataConstraints property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the metadataConstraints property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getMetadataConstraints().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDConstraintsPropertyType }
*
*
*/
public List<MDConstraintsPropertyType> getMetadataConstraints() {
if (metadataConstraints == null) {
metadataConstraints = new ArrayList<MDConstraintsPropertyType>();
}
return this.metadataConstraints;
}
public boolean isSetMetadataConstraints() {
return ((this.metadataConstraints!= null)&&(!this.metadataConstraints.isEmpty()));
}
public void unsetMetadataConstraints() {
this.metadataConstraints = null;
}
/**
* Gets the value of the applicationSchemaInfo property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the applicationSchemaInfo property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getApplicationSchemaInfo().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MDApplicationSchemaInformationPropertyType }
*
*
*/
public List<MDApplicationSchemaInformationPropertyType> getApplicationSchemaInfo() {
if (applicationSchemaInfo == null) {
applicationSchemaInfo = new ArrayList<MDApplicationSchemaInformationPropertyType>();
}
return this.applicationSchemaInfo;
}
public boolean isSetApplicationSchemaInfo() {
return ((this.applicationSchemaInfo!= null)&&(!this.applicationSchemaInfo.isEmpty()));
}
public void unsetApplicationSchemaInfo() {
this.applicationSchemaInfo = null;
}
/**
* Gets the value of the metadataMaintenance property.
*
* @return
* possible object is
* {@link MDMaintenanceInformationPropertyType }
*
*/
public MDMaintenanceInformationPropertyType getMetadataMaintenance() {
return metadataMaintenance;
}
/**
* Sets the value of the metadataMaintenance property.
*
* @param value
* allowed object is
* {@link MDMaintenanceInformationPropertyType }
*
*/
public void setMetadataMaintenance(MDMaintenanceInformationPropertyType value) {
this.metadataMaintenance = value;
}
public boolean isSetMetadataMaintenance() {
return (this.metadataMaintenance!= null);
}
/**
* Gets the value of the series property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the series property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSeries().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DSAggregatePropertyType }
*
*
*/
public List<DSAggregatePropertyType> getSeries() {
if (series == null) {
series = new ArrayList<DSAggregatePropertyType>();
}
return this.series;
}
public boolean isSetSeries() {
return ((this.series!= null)&&(!this.series.isEmpty()));
}
public void unsetSeries() {
this.series = null;
}
/**
* Gets the value of the describes property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the describes property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDescribes().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link DSDataSetPropertyType }
*
*
*/
public List<DSDataSetPropertyType> getDescribes() {
if (describes == null) {
describes = new ArrayList<DSDataSetPropertyType>();
}
return this.describes;
}
public boolean isSetDescribes() {
return ((this.describes!= null)&&(!this.describes.isEmpty()));
}
public void unsetDescribes() {
this.describes = null;
}
/**
* Gets the value of the propertyType property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the propertyType property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPropertyType().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ObjectReferencePropertyType }
*
*
*/
public List<ObjectReferencePropertyType> getPropertyType() {
if (propertyType == null) {
propertyType = new ArrayList<ObjectReferencePropertyType>();
}
return this.propertyType;
}
public boolean isSetPropertyType() {
return ((this.propertyType!= null)&&(!this.propertyType.isEmpty()));
}
public void unsetPropertyType() {
this.propertyType = null;
}
/**
* Gets the value of the featureType property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the featureType property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getFeatureType().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ObjectReferencePropertyType }
*
*
*/
public List<ObjectReferencePropertyType> getFeatureType() {
if (featureType == null) {
featureType = new ArrayList<ObjectReferencePropertyType>();
}
return this.featureType;
}
public boolean isSetFeatureType() {
return ((this.featureType!= null)&&(!this.featureType.isEmpty()));
}
public void unsetFeatureType() {
this.featureType = null;
}
/**
* Gets the value of the featureAttribute property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the featureAttribute property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getFeatureAttribute().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ObjectReferencePropertyType }
*
*
*/
public List<ObjectReferencePropertyType> getFeatureAttribute() {
if (featureAttribute == null) {
featureAttribute = new ArrayList<ObjectReferencePropertyType>();
}
return this.featureAttribute;
}
public boolean isSetFeatureAttribute() {
return ((this.featureAttribute!= null)&&(!this.featureAttribute.isEmpty()));
}
public void unsetFeatureAttribute() {
this.featureAttribute = null;
}
}
| [
"moryakovdv@gmail.com"
] | moryakovdv@gmail.com |
3af3206706d0dda3e20ce4554a29c2d339aaceab | b84e757c19c25420726abe333b702a3ead469490 | /app/src/main/java/com/hzbank/citylist/bean/TopHeaderBean.java | 6f8fe718fc801954bf16cc90d178c17828c9bf0a | [] | no_license | superBlossom/CityList | 28e8bd6d3228fe726371aa66efcdcf2afe21c2ec | 1c9a99503e78811192161af2f8c81740a0092fda | refs/heads/master | 2021-01-17T08:44:12.860436 | 2017-03-06T08:04:13 | 2017-03-06T08:04:13 | 83,953,169 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.hzbank.citylist.bean;
/**
* 介绍:美团最顶部Header
* 作者:zp
* 时间: 16/11/28.
*/
public class TopHeaderBean {
private String txt;
public TopHeaderBean(String txt) {
this.txt = txt;
}
public String getTxt() {
return txt;
}
public TopHeaderBean setTxt(String txt) {
this.txt = txt;
return this;
}
}
| [
"1216761420@qq.com"
] | 1216761420@qq.com |
4c5fd176ff7c5054d0f9c59a9032d1cef84a5070 | 44e7adc9a1c5c0a1116097ac99c2a51692d4c986 | /aws-java-sdk-mediapackage/src/main/java/com/amazonaws/services/mediapackage/model/CreateChannelResult.java | 3d7f8c73e96f18b1a92bff96efd0c940a3cac950 | [
"Apache-2.0"
] | permissive | QiAnXinCodeSafe/aws-sdk-java | f93bc97c289984e41527ae5bba97bebd6554ddbe | 8251e0a3d910da4f63f1b102b171a3abf212099e | refs/heads/master | 2023-01-28T14:28:05.239019 | 2020-12-03T22:09:01 | 2020-12-03T22:09:01 | 318,460,751 | 1 | 0 | Apache-2.0 | 2020-12-04T10:06:51 | 2020-12-04T09:05:03 | null | UTF-8 | Java | false | false | 11,180 | java | /*
* Copyright 2015-2020 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.mediapackage.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateChannel" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateChannelResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/** The Amazon Resource Name (ARN) assigned to the Channel. */
private String arn;
/** A short text description of the Channel. */
private String description;
private EgressAccessLogs egressAccessLogs;
private HlsIngest hlsIngest;
/** The ID of the Channel. */
private String id;
private IngressAccessLogs ingressAccessLogs;
private java.util.Map<String, String> tags;
/**
* The Amazon Resource Name (ARN) assigned to the Channel.
*
* @param arn
* The Amazon Resource Name (ARN) assigned to the Channel.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
* The Amazon Resource Name (ARN) assigned to the Channel.
*
* @return The Amazon Resource Name (ARN) assigned to the Channel.
*/
public String getArn() {
return this.arn;
}
/**
* The Amazon Resource Name (ARN) assigned to the Channel.
*
* @param arn
* The Amazon Resource Name (ARN) assigned to the Channel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withArn(String arn) {
setArn(arn);
return this;
}
/**
* A short text description of the Channel.
*
* @param description
* A short text description of the Channel.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* A short text description of the Channel.
*
* @return A short text description of the Channel.
*/
public String getDescription() {
return this.description;
}
/**
* A short text description of the Channel.
*
* @param description
* A short text description of the Channel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withDescription(String description) {
setDescription(description);
return this;
}
/**
* @param egressAccessLogs
*/
public void setEgressAccessLogs(EgressAccessLogs egressAccessLogs) {
this.egressAccessLogs = egressAccessLogs;
}
/**
* @return
*/
public EgressAccessLogs getEgressAccessLogs() {
return this.egressAccessLogs;
}
/**
* @param egressAccessLogs
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withEgressAccessLogs(EgressAccessLogs egressAccessLogs) {
setEgressAccessLogs(egressAccessLogs);
return this;
}
/**
* @param hlsIngest
*/
public void setHlsIngest(HlsIngest hlsIngest) {
this.hlsIngest = hlsIngest;
}
/**
* @return
*/
public HlsIngest getHlsIngest() {
return this.hlsIngest;
}
/**
* @param hlsIngest
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withHlsIngest(HlsIngest hlsIngest) {
setHlsIngest(hlsIngest);
return this;
}
/**
* The ID of the Channel.
*
* @param id
* The ID of the Channel.
*/
public void setId(String id) {
this.id = id;
}
/**
* The ID of the Channel.
*
* @return The ID of the Channel.
*/
public String getId() {
return this.id;
}
/**
* The ID of the Channel.
*
* @param id
* The ID of the Channel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withId(String id) {
setId(id);
return this;
}
/**
* @param ingressAccessLogs
*/
public void setIngressAccessLogs(IngressAccessLogs ingressAccessLogs) {
this.ingressAccessLogs = ingressAccessLogs;
}
/**
* @return
*/
public IngressAccessLogs getIngressAccessLogs() {
return this.ingressAccessLogs;
}
/**
* @param ingressAccessLogs
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withIngressAccessLogs(IngressAccessLogs ingressAccessLogs) {
setIngressAccessLogs(ingressAccessLogs);
return this;
}
/**
* @return
*/
public java.util.Map<String, String> getTags() {
return tags;
}
/**
* @param tags
*/
public void setTags(java.util.Map<String, String> tags) {
this.tags = tags;
}
/**
* @param tags
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateChannelResult#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap<String, String>();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChannelResult clearTagsEntries() {
this.tags = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getEgressAccessLogs() != null)
sb.append("EgressAccessLogs: ").append(getEgressAccessLogs()).append(",");
if (getHlsIngest() != null)
sb.append("HlsIngest: ").append(getHlsIngest()).append(",");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getIngressAccessLogs() != null)
sb.append("IngressAccessLogs: ").append(getIngressAccessLogs()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateChannelResult == false)
return false;
CreateChannelResult other = (CreateChannelResult) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getEgressAccessLogs() == null ^ this.getEgressAccessLogs() == null)
return false;
if (other.getEgressAccessLogs() != null && other.getEgressAccessLogs().equals(this.getEgressAccessLogs()) == false)
return false;
if (other.getHlsIngest() == null ^ this.getHlsIngest() == null)
return false;
if (other.getHlsIngest() != null && other.getHlsIngest().equals(this.getHlsIngest()) == false)
return false;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getIngressAccessLogs() == null ^ this.getIngressAccessLogs() == null)
return false;
if (other.getIngressAccessLogs() != null && other.getIngressAccessLogs().equals(this.getIngressAccessLogs()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getEgressAccessLogs() == null) ? 0 : getEgressAccessLogs().hashCode());
hashCode = prime * hashCode + ((getHlsIngest() == null) ? 0 : getHlsIngest().hashCode());
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getIngressAccessLogs() == null) ? 0 : getIngressAccessLogs().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateChannelResult clone() {
try {
return (CreateChannelResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| [
""
] | |
d1ebadefa498501a66bae2fb6681147c2048ee5f | 3fa1e007f8464c427560a6ec5ca54add8f6f6458 | /app/src/test/java/com/example/abhinavchinta/minesweeper/ExampleUnitTest.java | bde01e93cd1c3b2671860a3e870a415c973918a9 | [] | no_license | abhinavch15/Minesweeper | 135367c66445bfa10c8b1766cd70fb75c20f568e | 54bb1173aa0c575e67d32cbf3f1f45cf0f36be13 | refs/heads/master | 2021-07-23T16:37:36.478390 | 2017-11-02T19:39:08 | 2017-11-02T19:39:08 | 109,310,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 415 | java | package com.example.abhinavchinta.minesweeper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"32746183+abnv15@users.noreply.github.com"
] | 32746183+abnv15@users.noreply.github.com |
7fbf0688e5c7b08d753de77cf71a2e0ad0f1f34b | d6f3087a2657a76d9fa8fb40b00bc07926a1b3fa | /imitation/src/main/java/ua/telesens/ostapenko/systemimitation/dao/LogStationDAO.java | af6865ae82b0e44a596406b07821644e7fcbfd14 | [] | no_license | GregGGregGreG/public-transport-system-imitation | d05d76cd4356caaecf684dd6e2399e89a32626f5 | 8c17ef31eb9bda763ece34dacccab309c945e133 | refs/heads/master | 2021-01-10T17:41:29.973939 | 2016-01-29T10:00:19 | 2016-01-29T10:00:19 | 50,654,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 247 | java | package ua.telesens.ostapenko.systemimitation.dao;
import ua.telesens.ostapenko.systemimitation.model.internal.LogStation;
/**
* @author root
* @since 11.01.16
*/
public interface LogStationDAO {
int insertLogStation(LogStation add);
}
| [
"truegreg13@mail.ru"
] | truegreg13@mail.ru |
845f8b8a241ff22414a6091575660a3828aa0464 | 840b88c335bc8dd8a187e9595eb55b02ec5a599c | /Calculator/app/src/androidTest/java/edu/exeter/calculator/ExampleInstrumentedTest.java | 20502c4629c7202706cd9bc390ed4b88a56e89e0 | [] | no_license | subinkim/PEA_CSC506 | b4a2e3f3a2ea0bf5f2e16fbdbb14cd26f1df1cae | ba9167d4aaa0aedc6d2e1570fab8e2fdede99bbb | refs/heads/master | 2022-12-15T20:04:08.773746 | 2019-04-27T02:31:28 | 2019-04-27T02:31:28 | 183,718,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 726 | java | package edu.exeter.calculator;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("edu.exeter.calculator", appContext.getPackageName());
}
}
| [
"subinrachaelkim@Subin-Rachael-Kims-MacBook-Pro.local"
] | subinrachaelkim@Subin-Rachael-Kims-MacBook-Pro.local |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.